Ich versuche auf Unsere HP ein RSS Feed einzubauen, in eine bereits erstellte Box, leider gelingt mir das nicht, mir wird nur ein Fehler angezeigt :
"
Warning: join() [function.join]: Invalid arguments passed in /var/www/web185/html/include/boxes/lastwars.php on line 30
"
der Quelltext ist :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | <? # script and copyright by Patriot1980 # for ilch clan script V 1.1 # rss_news_box Version 1.1.0 $ENABLE_CACHING = false; //Bevore ihr das caching aktiviert ($ENABLE_CACHING = true;) schaut ob die CACHE_FILE korrekt angelegt ist $CACHE_FILE = '/tmp/heisenews.rdf' ; //Hier der Pfad zu Eurer CACHE_FILE. Vergesst nicht die Rechte im FTP für diese Datei auf Schreiben zu setzen $CACHE_REFRESH_TIME = 20; //Cache timeout in Minuten $MAX_NEWS = 7; //Hier könnt Ihr die Anzahl der Headlines die gelistet werden sollen setzen if ( $ENABLE_CACHING ){ $cache_diff =(time() - @ filemtime ( $CACHE_FILE ))/60; if (! file_exists ( $CACHE_FILE ) or ( $cache_diff > 20) ){ $fcontents = join ( '' , @file ( 'http://www.gamestar.de/news/rss/news.rss' )); //Hier kommt Euer gewünschtes RSS hinein @unlink( $CACHE_FILE ); $handle = @ fopen ( $CACHE_FILE , 'x+' ); @fwrite( $handle , $fcontents ); @fclose( $handle ); } $fcontents = join ( '' , @file ( $CACHE_FILE )); } else { $fcontents = join ( '' , @file ( 'http://www.gamestar.de/news/rss/news.rss' )); //Hier nochmal das gewünschte RSS hinein } $fcontents = str_replace ( "</item>" , "" , $fcontents ); $fcontents = str_replace ( "</link>" , "" , $fcontents ); $splices = explode ( "<item>" , $fcontents ); if ( count ( $splices ) > $MAX_NEWS ){ $stop_at = $MAX_NEWS +1; } else { $stop_at = count ( $splices ); } //setzt an dieser Stelle einen Banner der RSS Newsseite ein, ersetzt include/images/news/heise_online_h50.gif mit Eurem Banner, nicht vergessen //Banner hochzuladen und Link zu ändern! // print '<br /><center /><a href="http://www.heise.de" title="heise online" target="_blank" /><img //src="include/images/news/heise_online_h50.gif" border="0" align="top" alt="heise online" /></a /><br /></center /><font size="1" ///>-----------------------</font /></br />'; //ab hier muss nichts geändert werden $out_buffer = '<span class="heisenews">' ; for ( $i = 1; $i < $stop_at ; $i ++){ $link = explode ( "<link>" , $splices [ $i ]); $link [1] = strip_tags ( $link [1]); $headline = str_replace ( "<title>" , '<a href="' . trim( $link [1]) . '" target="_blank" class="heiseheadline">' , $splices [ $i ]); $headline = str_replace ( "</title>" , "</a>" , $headline ); $headline = explode ( "<link>" , $headline ); $headline = $headline [0]; $out_buffer = $out_buffer . $headline . '<br /><font size="1" />-----------------------</font /><br />' ; } $out_buffer = $out_buffer . "</span>" ; print $out_buffer ; ?> |
betroffene Homepage: die-jungen-wilden.org/
Zuletzt modifiziert von Mairu am 08.09.2012 - 10:06:29