# Note: Source file is available primarily to satisfy those curious about # the PHP scripting used. This is not an open invitation to copy my code # in its entirety. If you want to use a single command, or even two, that's # fine. But please, above all, do not copy my layout. # This is the source code for the side menu on the frames page. The sidebar # in the no-frames page is based off this code, but is not identical as the # content on it is static and doesn't refresh, and is lacking the collapsible # menus. (You know, cuz it's not in a frame.) The rest of the site is more # or less standard static HTML aside from using the PHP "include" function # all over the place. If you're looking for more programming stuff, head # over to my perl page at http://www.lunamorena.net/perl/ # 18 October 2004: Updated so it doesn't rely on register_globals to be on anymore # cookies and initial variables # Auto-Refresh if($_GET['refresh']) { setcookie("RefreshTime",$_GET['refresh'],mktime(0,0,0,1,1,2030)); $refresh = $_GET['refresh']; } elseif($_COOKIE[RefreshTime]) { $refresh = "$_COOKIE[RefreshTime]"; } else { $refresh = 300; } # Manual Refresh if($_GET['manual']) { setcookie("ManualRefresh",$_GET['manual'],mktime(0,0,0,1,1,2030)); $manual = $_GET['manual']; } elseif($_COOKIE[ManualRefresh]) { $manual = "$_COOKIE[ManualRefresh]"; } else { $manual = "no"; } # Default view if($_GET['default']) { setcookie("ShowByDefault",$_GET['default'],mktime(0,0,0,1,1,2030)); $default = $_GET['default']; } elseif($_COOKIE[ShowByDefault]) { $default = "$_COOKIE[ShowByDefault]"; } else { $default = "darkmoon"; } if($_GET[show]) { $show = $_GET[show]; } else { $show = $default; } # Weather info # Weather's broken until further notice. $weather = "no"; #if($_GET['weather']) { # setcookie("ShowWeather",$_GET['weather'],mktime(0,0,0,1,1,2030)); # $weather = $_GET['weather']; #} #elseif($_COOKIE[ShowWeather]) { # $weather = "$_COOKIE[ShowWeather]"; #} #else { # $weather = "yes"; #} # Music info if($_GET['music']) { setcookie("ShowMusic",$_GET['music'],mktime(0,0,0,1,1,2030)); $music = $_GET['music']; } elseif($_COOKIE[ShowMusic]) { $music = "$_COOKIE[ShowMusic]"; } else { $music = "yes"; } # Random Quote if($_GET['quote']) { setcookie("RandomQuote",$_GET['quote'],mktime(0,0,0,1,1,2030)); $quote = $_GET['quote']; } elseif($_COOKIE[RandomQuote]) { $quote = "$_COOKIE[RandomQuote]"; } else { $quote = "yes"; } # Default Cam if($_GET['defaultcam']) { setcookie("DefaultCam",$_GET['defaultcam'],mktime(0,0,0,1,1,2030)); $defaultcam = $_GET['defaultcam']; } elseif($_COOKIE[DefaultCam]) { $defaultcam = "$_COOKIE[DefaultCam]"; } else { $defaultcam = "monkey"; } if($_GET['cam'] == "") { $cam = $defaultcam; } else { $cam = $_GET['cam']; } ?>
|
echo date ("D d M Y g:ia") ;
# Weather data obtained by the "phpweather" script
# http://phpweather.sourceforge.net/
if($weather == "yes") {
print(" \n"); include('phpweather-1.60/locale_en.inc'); include('phpweather-1.60/phpweather.inc'); $metar = get_metar('KSAC'); $data = process_metar($metar); echo"$data[temp_f]° ($data[temp_c] C)"; if($data[weather]) { echo" · $data[weather]"; } } # Music data is provided by an iTunes plug-in, "Now Playing." # Current song data is exported as an XML file, which is interpreted # by the script included here. For more info, see the web site: # http://brandon.fuller.name/archives/hacks/nowplaying/itunes/mac/ if($music == "yes") { print(" \n"); include("./now_playing.php"); } if($manual == "yes") { print(" \n"); print("[manual refresh]\n"); } ?> |
| ...little pool... » |
|
# And now for the new improved webcam fiasco
$cameras = array("wombat"=>"webcam/wombat.jpg","monkey"=>"photo/webcam.jpg");
print" "; print"current camera: $cam \n"; print"cam updated "; $modified = stat("$cameras[$cam]"); echo date("d M g:ia",$modified[9]); print" \n"; # Archives are currently broken, as is everything else that's currently using CGI on my site. #print"cam archives: add·view \n"; foreach($cameras as $name => $file) { $info = stat("$file"); $age = date("U",$info[9]); $time = date(U); $difference = $time - $age; if($cam == $name) { print"$name: "; } else { print"$name: "; } if($difference > 300) { echo("off\n"); } else { echo("on\n"); } print" \n"; } ?> |
| sierracam » |
|
|
| twitter » |
| if($show != "darkmoon") { echo("+ darkmoon"); } else { echo("- darkmoon"); } ?> |
| if($show != "support") { echo("+ tip jar"); } else { echo("- tip jar"); } ?> |
| if($show != "settings") { echo("+ settings"); } else { echo("- settings"); } ?> |
| \n"); print(" |
| if($show != "other") { echo("+ other"); } else { echo("- other"); } ?> |
| contact me » |
| change.log » |
| source » |