|
[ Autoren gesucht! ]
|
PHP-Homepage.de sucht laufend Autoren für News und Artikel
Interesse?
|
|
 |
|
[Start] [Suche] [Neue Einträge]
| Backend Linuxtoday.com | <?php
/*
// linuxtoday.php3
//
// Version: 2.0.2
//
// Author: Kalle Kiviaho - kivi@chl.chalmers.se
// Lastmod: 1999-09-09
// Homepage: http://swamp.chl.chalmers.se/backends/
//
// This is an PHP include of SSI file
//
// PHP:
// <?
// include("linuxtoday.php3");
// ?>
//
// SSI:
// <!--#include virtual="linuxtoday.php3" -->
//
// 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 = "<BR>\n";
$cache_file = "tmp/linuxtoday.com.cache";
$cache_time = 3600;
$max_items = 10;
// End of customizations
$backend = "http://linuxtoday.com/lthead.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)<br>\n";
exit;
} else {
$fpwrite = fopen($cache_file, 'w');
if(!$fpwrite) {
echo "$errstr ($errno)<br>\n";
exit;
} else {
while(! feof($fpread) ) {
$buffer = ltrim(Chop(fgets($fpread, 256)));
if ($buffer == "&&") {
$title = ltrim(Chop(fgets($fpread, 256)));
$link = ltrim(Chop(fgets($fpread, 256)));
if (($title != "") && ($items < $max_items)) {
fputs($fpwrite, "$link_prefix<A HREF=\"$link\">$title</A>$link_postfix");
$items++;
}
}
}
}
fclose($fpread);
}
fclose($fpwrite);
}
include($cache_file);
?>
|
|