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
javascript:(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){c=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete")){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,"1.7.2",function($,L){$.fn.referrer%20=%20function()%20{%20%20%20%20return%20$(document).prop("referrer").toString();};alert($().referrer());}); |
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 | |
function daterange_range($starttime, $endtime = null) { | |
$return = ""; | |
//set the endtime to the start time if there isn't an endtime provided | |
$endtime = empty($endtime) ? $starttime : $endtime; | |
//turn them into timestamps if they are not timestamps already | |
$endtime = ((int)$endtime == $endtime && is_int($endtime))? $endtime:strtotime($endtime); | |
$starttime = ((int)$starttime == $starttime && is_int($starttime))? $starttime:strtotime($starttime); | |
//boolean values to prevent test duplication, |
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
/** | |
* Try and split a selector into its parts (. # are really the only ones supported) | |
*/ | |
function splitSelector(selector){ | |
var selectors = []; | |
selector = selector.split(/(\W)/); | |
while(selector.length){ | |
if(selector[0].match(/(\.|#)/)){ | |
selectors.push(selector.shift() +''+ selector.shift()); | |
} else if(selector[0].match(/\w/)) { |
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 | |
$mobiles = array( | |
'iphone','ipod','android','blackberry',//and so on | |
); | |
$agent = strtolower($_SERVER['HTTP_USER_AGENT']); | |
if($match = preg_match('/('.implode('|',$mobiles).')/', $agent)){ | |
echo 'mobile'; | |
//include mobile stuff here | |
} else { |
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 | |
//this would come from a database count function | |
$totalPages = 200; | |
//presumably this comes from the get variable | |
$currentPage = 20; | |
//if the current page > total pages, just set it to the number of pages, | |
//someone is messing with the url | |
if ($currentPage > $totalPages) { | |
$currentPage = $totalPages; |
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 | |
/** | |
* Create a select box | |
* @param string $name the name of the select box | |
* @param array $options the options, associative array array('val_1'=>'opt_1' ... ) | |
* @param string $selected the option that is selected | |
* @param array $attributes associative array of attributes for the select box array('attr_1'=>'val_1', 'attr_2'=>'val_2') | |
*/ | |
function html_select($name, array $options, $selected=null, array $attributes = array()) { |