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 str_time($stamp) | |
{ | |
$difference = time() - $stamp; | |
$intervals = array( | |
'minute' => 60, | |
'hour' => 3600, | |
'day' => 86400, | |
'month' => 2628000, | |
'year' => 31536000 |
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 | |
/* By Sam Jesso - [email protected] | |
* File: oceansql.php | |
* License: GNU GPL. | |
* Type: PHP | |
* Description: A MySQL (PHP 4 mysql_*) wrapper that makes queries visually easier to follow, execute, and debug. */ | |
defined("SYSTEM") or die("Access denied."); | |
class MySQL | |
{ |
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 toCoordinates($address) | |
{ | |
$bad = array( | |
" " => "+", | |
"," => "", | |
"?" => "", | |
"&" => "", | |
"=" => "" | |
); |
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 | |
/* #!modules/mysql.php | |
* Bike-This.com - Modules | |
* By Sam Jesso - [email protected] | |
* File: mysql.php | |
* Type: PHP | |
* Description: A MySQL (PHP 4 mysql_*) wrapper that makes queries visually easier to follow, execute, and debug. | |
*/ | |
class MySQL |
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 | |
#! Photo resize controller. | |
#! Class interface. | |
interface iResize | |
{ | |
public function __construct($filename); | |
public function resize($x, $y); | |
public function save($locale); | |
} |
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
/* Usage: | |
* Return element: elem("name-of-element"); | |
* Value of element: elem("name-of-element").val(); | |
* Any method in jQuery works here since it returns a jQuery object. | |
* */ | |
var elem = function(selector) | |
{ | |
return $("*[name="+ selector +"]"); | |
} |
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 | |
/* ! | |
* PHP typeof() function - Similar to the JavaScript method. | |
* Usage: if(typeof($phpQuery) == "undefined") require_once "phpQuery.php"; | |
* if(typeof($_GET) == "array") echo "There are \$_GET arguments present."; | |
* etc... | |
* Author: Sam Jesso | |
* URI: http://sammm.net/ | |
* Date: Sun, 9 Oct, 2010 | |
* */ |
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 secure_wysiwyg($filter) | |
{ | |
$badattr = array('onclick="' => 'void="', | |
'onmouseover="' => 'void="', | |
'onload="' => 'void="', | |
'onblur="' => 'void="', | |
'onfocus="' => 'void="', | |
'class="' => 'void="', | |
'id="' => 'void="', |
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 | |
//Get the library. | |
require "mysql.php"; | |
//New connection. | |
$db = new MySQL("localhost", "username", "password", "database"); | |
if($db->errno()) | |
{ | |
print($db->error()); | |
exit; |
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 | |
define("OBJECT", "object"); | |
define("ASSOC", "assoc"); | |
define("ARRAY", "array"); | |