Welcome to Geeklog Saturday, May 21 2022 @ 09:05 am EDT

Geeklog Forums

Parse error in static page


Sully

Anonymous
I have a static page that I use to include an rss feed. For months it was fine and today with no change by me I get a parse error:

PHP Formatted Code
       
Parse error: parse error, unexpected '&' in /GeekLog/public_html/staticpages/index.php(59) : eval()'d code on line 1


The static page simple consists of:

PHP Formatted Code
require_once("/php/rss2html.php?MAXITEMS=3");
 


Again, this has worked for months and with no reason that I can see it stopped working today.

I did see this weird error that looks like a user was mucking round with things just prior to the parse errors but don't think it is related:

PHP Formatted Code
[client 71.124.169.19] PHP Warning:  Unknown: failed to open stream: HTTP request failed!
\x8err\x06\xc8!\xc1\xbf\xb4u\xcd\tG in /GeekLog/plugins/staticpages/functions.inc(523) :
eval()'d code on line 1


Any ideas?
 Quote

Status: offline

J23

Forum User
Newbie
Registered: 24/07/05
Posts: 6
Location:Canada
Hi,

I had the same problem, and this is the solution for that:

1. need to open and add the code to your lib-custom.php file

PHP Formatted Code
// Custom RDF / RSS feed on static page
function static_rdf($blockid = false) {
        $error = array();
        if ($blockid != false && is_numeric($blockid) && $blockid != "") {              global $_TABLES;
                if (DB_getItem( $_TABLES['blocks'], 'type', "bid = '{$blockid}'" ) == 'portal') {                                               $sql = "SELECT UNIX_TIMESTAMP(rdfupdated) as date, content, rdfurl FROM {$_TABLES['blocks']} WHERE bid = '" . $blockid . "'";
                        $result = DB_query( $sql );
                        $A = DB_fetchArray( $result );
                        if ( COM_rdfCheck($blockid, $A['rdfurl'], $A['date'] ))
                        {
                                $A['content'] = DB_getItem( $_TABLES['blocks'], 'content',
                                                        "bid = '{$blockid}'" );
                        }                       $return = $A['content'];
                } else {
                        $error[] = 'Block is not of Portal Type';
                }
        } else {
                $error[] = 'Is not a valid BlockID';
        }       if (count($error) > 0) {
                $return = "Something is wrong with the blockid that you entered.  Fix this.  Otherwise there could be issues";
                $return .= '<ul>';
                for ( $x = 0; count($error) > $x; $x++ ) {
                        $return .= '<li>' . $error[$x] . '</li>';
                }
                $return .= "</ul>";
        }
        return $return;
}

 

http://www.info-polonia.com/
 Quote

All times are EDT. The time is now 09:05 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content