This file contains hidden or 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
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
<script> | |
// Registra o evento blur do campo "cep", ou seja, quando o usuário sair do campo "cep" faremos a consulta dos dados | |
$("#cep").focusout(function(){ | |
// Para fazer a consulta, removemos tudo o que não é número do valor informado pelo usuário | |
var cep = this.value.replace(/[^0-9]/, ""); | |
// Validação do CEP; caso o CEP não possua 8 números, então cancela a consulta | |
if(cep.length!=8){ |
This file contains hidden or 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
server { | |
listen 80; | |
server_name site.com www.site.com; | |
server_name_in_redirect off; | |
access_log /var/log/nginx/localhost.access_log; | |
error_log /var/log/nginx/localhost.error_log info; | |
root /usr/share/nginx/html/directory files site; | |
index index.php index.html index.htm default.html default.htm; |
This file contains hidden or 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
## | |
# @package Joomla | |
# @copyright Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. | |
# @license GNU General Public License version 2 or later; see LICENSE.txt | |
## | |
########## Inicio - RewriteEngine ativado | |
RewriteEngine On |
This file contains hidden or 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
//chamando o Jquery | |
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> | |
<script src="http://code.jquery.com/jquery-1.9.1.js"></script> | |
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> | |
<?php | |
//php para listar algo do banco isto para Joomla (pode ser usado em qualquer sistema ) |
This file contains hidden or 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 | |
$db = JFactory::getDBO(); | |
$query = ( 'SELECT bairro FROM `#__cck_store_form_article` ' ); | |
$db->setQuery($query); | |
$items = $db->loadObjectList(); | |
This file contains hidden or 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
sudo apt-get install apache2 | |
sudo apt-get install mysql-client-5.5 mysql-server-5.5 php5-mysql | |
sudo apt-get install php5 php5-cli php5-dev php5-mcrypt php5-curl php5-gd libapache2-mod-php5 | |
This file contains hidden or 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 | |
function get_fb_likes($url) | |
{ | |
$query = "select total_count,like_count,comment_count,share_count,click_count from link_stat where url='{$url}'"; | |
$call = "https://api.facebook.com/method/fql.query?query=" . rawurlencode($query) . "&format=json"; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $call); |
This file contains hidden or 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 |
This file contains hidden or 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> |