// // SSI: // // // Feel free to modify the code and e-mail me fixes as you see // them fit... // */ // Customize as you like it $link_prefix = "  o "; $link_postfix = "
\n"; $cache_file = "linuxcom.inc"; $cache_time = 1; $max_items = 10; $target = "_top"; // End of customizations $backend = "http://linux.com/tuneup/listtips.phtml/bb.txt"; $items = 0; $time = split(" ", microtime()); srand((double)microtime()*1000000); $cache_time_rnd = 300 - rand(0, 600); if ( (!(file_exists($cache_file))) || ((filectime($cache_file) + $cache_time - $time[1]) + $cache_time_rnd < 0) || (!(filesize($cache_file))) ) { $fpread = fopen($backend, 'r'); if(!$fpread) { // echo "$errstr ($errno)
\n"; // exit; } else { $fpwrite = fopen($cache_file, 'w'); if(!$fpwrite) { // echo "$errstr ($errno)
\n"; // exit; } else { while(! feof($fpread) ) { $title = ltrim(Chop(fgets($fpread, 256))); $number = ltrim(Chop(fgets($fpread, 256))); $date = ltrim(Chop(fgets($fpread, 256))); $link = ltrim(Chop(fgets($fpread, 256))); $slask = ltrim(Chop(fgets($fpread, 256))); if (($title != "") && ($items < $max_items)) { fputs($fpwrite, "$link_prefix$title$link_postfix"); $items++; } } } fclose($fpread); } fclose($fpwrite); } if (file_exists($cache_file)) { include($cache_file); } ?>