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
<? | |
$mobile_browser = false; // set mobile browser as false till we can prove otherwise | |
$user_agent = $_SERVER['HTTP_USER_AGENT']; // get the user agent value - this should be cleaned to ensure no nefarious input gets executed | |
$accept = $_SERVER['HTTP_ACCEPT']; // get the content accept value - this should be cleaned to ensure no nefarious input gets executed | |
switch(true){ // using a switch against the following statements which could return true is more efficient than the previous method of using if statements | |
case (preg_match('/ipad/i',$user_agent)); // we find the word ipad in the user agent | |
$mobile_browser = false; // mobile browser is either true or false depending on the setting of ipad when calling the function | |
$status = 'Apple iPad'; |
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
<? | |
//bootstrap | |
require_once 'lib/Sado/sado.bootstrap.php'; | |
//pre-qualify | |
if(function_exists($_GET['method'])){ | |
$_GET['method'](); | |
} | |
//methods |
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
/*~~~~ CONTAINERS December 2013 - http://www.w3counter.com/globalstats.php ~~~~*/ | |
/* 1600x900 4.09% */ | |
.container{ | |
margin: 0 auto; | |
padding:0; | |
height:auto; | |
width:1410px; /* 3 Columns would be 470px */ | |
} | |
/* 1440x900 5.26% */ | |
@media (max-width: 1440px){ .container{width: 1230px; /* 3 Columns would be 410px */ } } |
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 | |
$tweet_data = json_decode(file_get_contents("http://api.twitter.com/1/users/show.json?screen_name=YOURTWITTERNAME"), true); | |
// display tweet data array ( just to show you i know what i'm doing =] ) | |
//print "<pre>"; | |
//print_r($tweet_data); | |
//print "</pre>"; |
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 facebook_feed() { | |
$token = "XXXXXX"; | |
$fb_id = "XXXXXX"; // the number in your Facebook URL | |
$json = json_decode(file_get_contents("https://graph.facebook.com/$fb_id/feed?access_token=$token"), true); | |
// only grab 1st |
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 nicetime($date) | |
{ | |
if(empty($date)) { | |
return "No date provided"; | |
} | |
$periods = array("second", "minute", "hour", "day", "week", "month", "year", "decade"); | |
$lengths = array("60","60","24","7","4.35","12","10"); |
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 | |
//main function | |
function foursquare_spotter() { | |
//set SpotID and Oauth Token - https://foursquare.com/oauth/ | |
$spot_id = 311661; // just change this # to your venue # in the foursquare URL | |
$oauth_token = 123456789; // just change this # to your Oauth Token | |
if ($spot_id != "") { |
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 | |
// must have http://addons.oscommerce.com/info/4269 installed in your osCommerce | |
$fb_data = json_decode(file_get_contents("https://graph.facebook.com/ACCESS-TOKEN-HERE"), true); | |
// ACCESS TOKEN FOR YOUR PAGE OR PROFILE | |
// See http://developers.facebook.com/docs/reference/api - Once a user has granted your application the "manage_pages" permission, the "accounts" connection will yield an additional access_token property for every page administrated by the current user. | |
// used for debugging/install | |
// print "<pre>"; |
NewerOlder