I'm trying to stick in just a news feeder on the right side of my page but can't for the life of my figure out what I left out to cause this error. BTW Magic quotes is on
<b>Parse error</b>: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in <b>/var/www/vhosts/thinkpost.com/httpdocs/library/app/universal.module.php(96) : eval()'d code</b> on line <b>1</b><br>
Here is the code
readfeed is
and atom parser
<b>Parse error</b>: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in <b>/var/www/vhosts/thinkpost.com/httpdocs/library/app/universal.module.php(96) : eval()'d code</b> on line <b>1</b><br>
Here is the code
Code:
function render_main_left_column() { global $db, $special, $happiness; print ' <div class="right column"> <div class="newsfeed"> <div class="heading"> <h3 class="title left">News & Entertainment</h3> <p class="right link01"><a href="'.url.'/mainrss" class="rss">Get RSS</a></p> </div>'; $list_news = $db->query("select * from news order by time desc limit 10"); $i = 0; $output2 = readfeed('http://news.google.com/news?ned=us&topic=e&output=rss'); $output1 = readfeed('http://news.google.com/nwshp?hl=en&tab=wn&q=&output=rss'); $q = array_merge($output1, $output2); $output3 = readfeed('http://my.abcnews.go.com/rsspublic/sports_rss20.xml'); $q2 = array_merge(array_unique($q), $output3); while($posts = $db->query_collection($list_news)) { array_walk($posts, 'clean_for_reading'); $post[] = $posts; } foreach ($post as $item4) $q2[] = $item4; $q2 = columnSort($q2, 'time'); foreach (array_slice($q2, 0, 6) as $news) { array_walk($news, 'clean_for_reading'); $newsid = $news['newsid']; $title = $news['title']; $url = $news['url']; $body = $news['body']; if (!$body) $body = $posts['body']; $date = format_date($news['time'], 'reading'); $nobg = ($i == 0) ? ' nobg' : '' ; $i++; print ' <div class="item'.$nobg.'"> <h4>'; if ($url) print '<a href="'.$url.'">'.$title.'</a></h4>'; else print '<a href="'.$news['link'].'" target="blank">'.$title.'</a></h4>'; print ' <p> '.shorten_text(publish(strip_tags($body)), 110).' </p> <div class="footer"> <p class="left"><span class="hide">Posted on: </span>'.$date.'</p>'; if ($url) print '<p class="right circlearrow link02"><a href="/newspost/'.$newsid.'/'.clean_for_url($title).'">Read details</a></p>'; else print '<p class="right circlearrow link02"><a href="'.$news['link'].'" target="blank">Read details</a></p>'; print ' </div> </div>'; } print ' <div class="footer"> <p class="right circlearrow link02"><a href="'.url.'/news">More news</a></p> </div> </div> <div class="newsfeed"> <div class="heading"> <h3 class="title subtitle left">Sound Off</h3> </div> <div class="item nobg">'; global $soundoff, $active_user; $sounds = $db->query_single("select * from soundoffs order by time desc limit 1"); $s = o($sounds); print ' <h4>'.$s->question.'</h4>'; $has_voted = $soundoff->has_voted($active_user, $s->soundoffid); if(!$has_voted and $active_user) { print ' <div id="response"> <form class="poll" id="soundoff-form" onsubmit="soundoff(); return false;">'; print '<input type="hidden" class="hide" name="soundoffid" value="'.$s->soundoffid.'" /> <ul class="radiogroup"> '; if($s->choice1 != '') print '<li> <span class="radio"> <input type="radio" name="vote" value="votes1_'.$s->choice1.'"/><label>'.$s->choice1.'</label></span> </li>'; if($s->choice2 != '') print '<li> <span class="radio"> <input type="radio" name="vote" value="votes2_'.$s->choice2.'"/><label>'.$s->choice2.'</label></span> </li>'; if($s->choice3 != '') print '<li> <span class="radio"> <input type="radio" name="vote" value="votes3_'.$s->choice3.'"/><label>'.$s->choice3.'</label></span> </li>'; if($s->choice4 != '') print '<li> <span class="radio"> <input type="radio" name="vote" value="votes4_'.$s->choice4.'"/><label>'.$s->choice4.'</label></span> </li>'; if($s->choice5 != '') print '<li> <span class="radio"> <input type="radio" name="vote" value="votes5_'.$s->choice5.'"/><label>'.$s->choice5.'</label></span> </li>'; print ' </ul> </p> <textarea class="comments" name="comment"></textarea> <input type="submit" class="button" value="Submit" /> </form> </div>'; } else if($has_voted && $active_user) { $voteid = $has_voted['voteid']; $comment = $has_voted['comment']; $vote = $has_voted['vote']; $answer = '<br/>Your Answer: '.$vote; if($comment) $answer .= '<br/>Your Comment: '.$comment; print '<p>You have already voted'.$answer.'</p>'; } else { print '<p>Please <a href="http://www.thinkpost.com/login">login</a> or <a href="http://www.thinkpost.com/signup">sign-up</a> to vote.</p>'; } print ' </div> <div class="item no-border">'; $num = ($s->num_votes == 0) ? 0 : $s->num_votes ; if($s->num_votes == 0) $s->num_votes = 1; if($s->choice1) print ' <span class="colour02">'.$s->choice1.' : </span> '.number_format(($s->votes1/$s->num_votes)*100).'%'; if($s->choice2) print ' <br /><span class="colour02">'.$s->choice2.' : </span> '.number_format(($s->votes2/$s->num_votes)*100).'%'; if($s->choice3) print ' <br /><span class="colour02">'.$s->choice3.' : </span> '.number_format(($s->votes3/$s->num_votes)*100).'%'; if($s->choice4) print ' <br /><span class="colour02">'.$s->choice4.' : </span> '.number_format(($s->votes4/$s->num_votes)*100).'%'; if($s->choice5) print ' <br /><span class="colour02">'.$s->choice5.' : </span> '.number_format(($s->votes5/$s->num_votes)*100).'%'; print ' <br/>Total votes: '.$num.' <br/><a href="'.url.'/soundoffs">More Soundoffs</a> </div> </div> '; print ' </div> </div> <hr />'; }
Code:
function readfeed($url){ $atom_parser = new AtomParser($url); $output = $atom_parser->normalize(); if (!is_array($output)) $output = readrss($url); return $output; }
Code:
function AtomParser($file) { $xml_parser = xml_parser_create(""); xml_set_object($xml_parser, $this); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "parseData"); $fp = @fopen($file, "r"); while($data = @fread($fp, 4096)) { xml_parse($xml_parser, $data, feof($fp)) or die( sprintf("myAtomParser: Error <b>%s</b> at line <b>%d</b><br>", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser)) ); } @fclose($fp); xml_parser_free($xml_parser); }
Comment