Skip to content

Instantly share code, notes, and snippets.

@joomlapro
joomlapro / gist:3431184
Created August 23, 2012 01:45
Generate Alias
UPDATE jos_content SET
alias = TRIM(title),
alias = REPLACE(REPLACE(REPLACE(title, ' ', '-'), ' ', '-'), '--', ''),
alias = UCASE(alias),
alias = REPLACE(alias, 'Á', 'A'),
alias = REPLACE(alias, 'À', 'A'),
alias = REPLACE(alias, 'Ã', 'A'),
alias = REPLACE(alias, 'Â', 'A'),
alias = REPLACE(alias, 'É', 'E'),
alias = REPLACE(alias, 'È', 'E'),
@joomlapro
joomlapro / gist:3295673
Created August 8, 2012 15:00
Assinatura
<p>Atenciosamente,<br /><br /><b>Bruno Batista</b><br />Desenvolvedor Web</p>
<p><img src="http://www.atomtech.com.br/images/logo-email.png" /></p>
<p>QSB 02 Lote 14 Sala 101 Taguatinga Sul - DF<br />Tel.: 61 3021 0010 Cel.: 61 8170 2222</p>
@joomlapro
joomlapro / gist:3290396
Created August 7, 2012 23:11
Get Check IP
<?php
$ip = '189.114.10.215';
var_dump(geoCheckIP($ip));
// Get an array with geoip-infodata
function geoCheckIP($ip)
{
// Check, if the provided ip is valid
if (!filter_var($ip, FILTER_VALIDATE_IP))
@joomlapro
joomlapro / gist:3286700
Created August 7, 2012 16:06
JImage Method for resize
<?php
/**
* @package Vehicles
* @subpackage com_vehicles
* @copyright Copyright (C) 2012 AtomTech, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access
defined('_JEXEC') or die;
@joomlapro
joomlapro / gist:3247101
Created August 3, 2012 12:23
Module Manifest
<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="2.5" client="site" method="upgrade">
<name>mod_hello</name>
<author>Bruno Batista</author>
<creationDate>03/08/2012</creationDate>
<copyright>Copyright (C) 2012 AtomTech, Inc. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>bruno@atomtech.com.br</authorEmail>
<authorUrl>http://www.atomtech.com.br</authorUrl>
<releaseDate>2012-08-03</releaseDate>
@joomlapro
joomlapro / gist:3239639
Created August 2, 2012 18:49
Read image on directory
$directory = 'uploads/';
// Get all image files with a .jpg extension.
$images = glob($directory . "*_small.jpg");
// Print each file name
foreach($images as $image)
{
echo '<img src=' . $image . ' />';
}
@joomlapro
joomlapro / gist:3171961
Created July 24, 2012 19:09
Add Button Before
jQuery(function ($) {
// Add Button Before
$('nav .menu').before('<a href="#" class="btn btn-lightblue btn-extensions">Download Extensões</a>');
});
# Get href
href="?([^">]+)"
@joomlapro
joomlapro / gist:3166889
Created July 23, 2012 23:19
Pattern Switcher
// Pattern Switcher
if ($.cookie('background') != '') {
var pattern = $.cookie('background');
$('body').css('background-image', 'url(' + pattern + ')');
}
$('.main ul li a').click(function () {
var pattern = $(this).attr('href');
@joomlapro
joomlapro / gist:3164342
Created July 23, 2012 15:50
Restyle value
/**
* Restyle value
*
* @param int $value The value to convert.
*
* @return string
*
* @since 2.5
*/
public static function restyleValue($value)