This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php echo $cck->renderField('email'); ?> //exemplo de campo para por o email | |
<?php echo $cck->renderField('enviar'); ?> | |
// obs o ID css de do campo email é #email | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// No Direct Access | |
defined( '_JEXEC' ) or die; | |
?> | |
<?php echo $cck->renderField('link'); ?> //exemplo de campo para por o link | |
<?php echo $cck->renderField('campo2'); ?> //quando usuário clicar no campo2 JS vai avisar se estiver errado o link. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
?php | |
$menu = &JSite::getMenu(); if ($menu->getActive() != $menu->getDefault()) // verifica se é a página inicial { ?> | |
<?php | |
$currentMenuId = JSite::getMenu()->getActive()->id ; | |
if ($currentMenuId != "119") // verifica se a página pertence ao Item de menu 119 { ?> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Acessa a API do migre.me e gera uma URL encurtada | |
* @param $url URL a ser encurtada | |
* @return String URL encurtada ou informações do erro | |
*/ | |
function gera_url_encurtada($url){ | |
$url = urlencode($url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$urlabsoluta = JURI::current(); //pega a URL do artigo current (ao vivo) | |
$url = 'https://www.googleapis.com/urlshortener/v1/url'; | |
$data['longUrl'] = "$urlabsoluta"; | |
$data['key'] = 'Sua KEY'; //Sua Key dada pelo Google! | |
$data = json_encode($data); | |
$curl = curl_init($url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onkeyup="this.value=this.value.replace(/[' '.,_,-,:,;,),(,=,+,*,¨,-]/g,'')" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$variavel = $cck->getValue('seu_campo'); | |
$variavel_limpa = strtolower( ereg_replace("[^a-zA-Z0-9-]", "-", strtr(utf8_decode(trim($variavel)), utf8_decode("áàãâéêíóôõúüñçÁÀÃÂÉÊÍÓÔÕÚÜÑÇ"),"aaaaeeiooouuncAAAAEEIOOOUUNC-")) ); | |
echo $variavel_limpa; | |
?> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// No Direct Access | |
defined( '_JEXEC' ) or die; | |
?> | |
<div> | |
<a href="<?php echo $cck->getLink('editar'); ?> "> <img src="images/editar.png"/></a> | |
</div> | |
<a href="<?php echo $cck->getLink('deletar'); ?> " onclick="if(!confirm('Você tem certeza que quer apagar este item ?')){return false;}"><img src="images/apagar.png"/></a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = 'http://graph.facebook.com/oceanoliterario'; //Page link | |
echo '['.$url.']: '.json_decode(file_get_contents($url))->{'likes'}; | |
?> | |
//add variable |
OlderNewer