<html><head><title>mobile pictures/text from my smartphone (formerly hiptop)</title></head>
<body bgcolor="#004040" text="#ffffff" link="#ffffff" alink="#ffffff" vlink="#ffffff">
<CENTER>
<font size=+2>Pictures and text from my <strike>Hiptop</strike> <strike>SmartPhone</strike> Treo</font><BR>
<font size=-1>
Source code: <a href="index.phps">index.phtml</a>, <A href="inco-ming.phps">inco-ming.phps</a>, <a href="dotforward.txt">.forward</a>, <a href="dotprocmailrc.txt">.procmailrc</a>.<BR>
Note that this page is no longer updated with images, I have them going straight into my <a href="http://1014.org">blog</a>.
This page is just here to provide the code for people. Thank you.
</font>
<TABLE BORDER=0 CELLPADDING=10 CELLSPACING=0 WIDTH=600>
<?
// requires that a directory named data with permissions 777 or so
// exist. a file named 'counter' with the permissions 644 should
// exist in that directory.
$fp=fopen("data/counter","r");
flock($fp,LOCK_SH);
$index = trim(fgets($fp,1024));
flock($fp,LOCK_UN);
fclose($fp);
if ($start > 0)
{
$s=$start-20;
if ($s<0)$s=0;
echo "<TR><TD><a href=\"index.phtml?start=$s\">newer images...</a></TD></TR>";
}
$index -= $start;
if ($index<0)$index=0;
$bottom = $index-20;
if ($bottom < 0) $bottom=0;
while ($index > $bottom)
{
$index--;
$fp=@fopen("data/text_$index.txt","r");
if ($fp)
{
$text="";
while (!feof($fp))
{
$t = fgets($fp,1024);
if ($t != "-J\n") $text .= $t;
}
fclose($fp);
echo "<TR><TD BGCOLOR=\"#101010\" ALIGN=CENTER>";
if (is_file("data/image_$index.jpg")) echo "<img src=\"data/image_$index.jpg\"><BR>";
else echo "<img src=\"no_pic.gif\"><BR>"; // i copied this gif from taber
$t=stat("data/text_$index.txt");
$datestr=date("M j Y G:i",$t[9]);
echo "<font size=-1>$datestr</font><BR>";
echo "<font size=-1>$text</font>";
if ($index > $bottom) echo "<HR>";
echo "</TD></TR>";
}
else if ($bottom > 0) $bottom--;
}
if ($bottom > 0)
{
echo "<TR><TD><a href=\"index.phtml?start=" . ($start+20) . "\">older images...</a></TD></TR>";
}
?>
</TABLE>
<BR>
</CENTER>
</BODY>
</HTML>