// $Id: 4chan.php,v 1.4 2007-05-17 13:07:48 mitch Exp $
// cookie handling
if (isset($comic) && isset($id) && isset($tag)) {
setcookie("lastVisited[$tag]", $id, time()+( 3600 * 24 * 365 * 5));
}
?>
cache.pud.se
image cache
File |
Chan |
Board |
Date |
$cachedir='/home/dal/public_html/4chan/';
$find = popen("ls -t $cachedir", "r");
if ($find) {
while (! feof($find)) {
$file = rtrim(fgets($find, 8192)); // max 8k per line
$entry = array();
if (preg_match('/\.idx$/', $file)) {
$idx = fopen("$cachedir/$file", 'r');
if ($idx) {
while (! feof($idx)) {
$line = rtrim(fgets($idx, 8192)); // max 8k per line
list($key, $value) = split("\t", $line);
$entry[$key] = $value;
}
fclose($idx);
}
if (!$entry['CHAN']) {
$entry['CHAN'] = '4chan';
}
echo " \n";
echo " {$entry['FILE']} (orig) | \n";
echo " {$entry['CHAN']} | \n";
echo " /{$entry['BOARD']}/ | \n";
// echo " {$entry['NICK']} | \n";
// echo " {$entry['CHANNEL']} | \n";
echo " {$entry['TIME']} | \n";
echo "
\n";
}
}
pclose($find);
}
?>