A
Andre
Foren Gott
hab nen kleines problem mit dem parser hier....irgendwie will der die news nicht aktualisieren...obwohl sie im backend.php (www.rootboard.de/backend.php) schon lnge aktuell sind ?!?!
hat einer vileicht nen tip?
www.rootboard.de/parse.php :
hat einer vileicht nen tip?
www.rootboard.de/parse.php :
PHP:
$link_prefix = htmlentities("*")." ";
$link_postfix = "<br>\n";
$cache_file = "BL-parse.cache";
$cache_time = 2;
$max_items = 10;
$target = "_parent";
$backend= "http://www.rootboard.de/backend.php";
// Ende Einstellungen
$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))) ) {
echo "<!-- creating cache -->";
$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 ((ereg ("<item>", $buffer) ) && ($items < $max_items)) {
echo "\n<!-- getting Titel -->\n";
$buff = ltrim(Chop(fgets($fpread, 256)));
if (ereg ("<title>", $buff)) $title = $buff;
if (ereg ("<link>", $buff)) $link = $buff;
$buff = ltrim(Chop(fgets($fpread, 256)));
if (ereg ("<title>", $buff)) $title = $buff;
if (ereg ("<link>", $buff)) $link = $buff;
$buff = ltrim(Chop(fgets($fpread, 256)));
if (ereg ("<title>", $buff)) $title = $buff;
if (ereg ("<link>", $buff)) $link = $buff;
$title = ereg_replace( "<title>", "", $title );
$title = ereg_replace( "</title>", "", $title );
$link = ereg_replace( "<link>", "", $link );
$link = ereg_replace( "</link>", "", $link );
fputs($fpwrite, "<A HREF=$link\" TARGET=\"$target\">$title<A>$link_postfix");
$items++;
}
}
fclose($fpread);
fclose($fpwrite);
}
}
}
if (file_exists($cache_file)) {
include($cache_file);
}
?>