Posted on: 04/07/05 08:25pm
By: csmart
if( $fp = @fopen( $rdfurl, 'r' )) { $startoffeed = true; while( $data = fread( $fp, 4096 )) { if( $startoffeed ) { $data = ltrim( $data ); if( empty( $data )) { break; } $startoffeed = false; } if( !xml_parse( $xml_parser, $data, feof( $fp ))) { $errmsg = sprintf( 'Parse error in %s: %s at line %d', $rdfurl, xml_error_string( xml_get_error_code( $xml_parser )), xml_get_current_line_number( $xml_parser ) ); COM_errorLog( $errmsg, 1 ); $rdferror = true; $result = DB_change( $_TABLES['blocks'], 'content', addslashes( $LANG21[4] ), 'bid', $bid ); break; } } if( $startoffeed && empty( $data )) { $errmsg = sprintf( 'The feed at %s exists but is currently empty.', $rdfurl ); COM_errorLog( $errmsg, 1 ); $rdferror = true; $result = DB_change( $_TABLES['blocks'], 'content', addslashes( $LANG21[4] ), 'bid', $bid ); } fclose( $fp ); xml_parser_free( $xml_parser ); if( !$rdferror ) { if( $maxheadlines > 0 ) { $RDFheadlines = array_slice( $RDFheadlines, 0, $maxheadlines ); } $blockcontent = COM_makeList( $RDFheadlines, 'list-feed' ); $RDFheadlines = array(); $blockcontent = preg_replace( "/(1512)|(15)|(12)/", '', $blockcontent ); $result = DB_change( $_TABLES['blocks'], 'content', $blockcontent, 'bid', $bid); } } else { $errmsg = sprintf( 'Geeklog can not reach the feed at %s.', $rdfurl ); if( !@ini_get( 'allow_url_fopen' )) { $errmsg = 'Sorry, your webserver configuration does not allow reading of remote files (allow_url_fopen = off).'; } COM_errorLog( $errmsg, 1 ); $rdferror = true; $result = DB_change( $_TABLES['blocks'], 'content', addslashes( $LANG21[4] ), 'bid', $bid ); }
if( !@ini_get( 'allow_url_fopen' ))
php_value register_globals 1 php_value allow_url_fopen 1
Posted on: 04/08/05 01:57am
By: Dirk