TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

June 17, 2024, 05:00:18 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,253
  • Total Topics: 21,225
  • Online today: 149
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 112
  • Total: 112

Advanced RSS Feed

Started by URPG, August 07, 2006, 06:59:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

doughboy99

#80
Could someone help wit this please?

I am using TP.1.0.6 and SMF 1.17. I am getting this error when I put this code in a phpbox

Parse error: syntax error, unexpected T_CONCAT_EQUAL in path removed/forum/Sources/Load.php(1745) : eval()'d code(43) : eval()'d code on line 18

line 18 is

if($scroll) output_temp .="<marquee direction=up scrolldelay=$delay scrollamount=$amount height=$height ";


G6Cad

Have no idea on how to help you with that, you dont give any info what so ever
And how is this related to the RSS feed ??

IchBin

In addition to answering what G6 said, please post the full code and post the code in the BBC [code ] brackets.

doughboy99

Apologies.

Using the code below from page two this topic in a php

//RSS Newsreader

  $backend = "http://rss.cnn.com/rss/cnn_world.rss";
  $headline = "CNN World News";
  $max_items = 16;
  $items = 0;
  $height = 200;
  $scroll = 1; //1 for scrolling box 0 for no scrolling
  $amount = 1; //pixels per scroll step
  $delay = 25; //step delay ms
  $stop = 1; //1 for scroll stop on mouseover 0 for no stop

  if($scroll==0)$stop=0; //no scrollstop if no scrolling

  $output_temp = "<b> $headline </b><br>";

//add marquee tag if scrolling is enabled
  if($scroll) output_temp .="<marquee direction=up scrolldelay=$delay scrollamount=$amount height=$height ";

//only add mouse events if wanted
  if($stop) $output_temp .="onmouseout=this.start() onmouseover=this.stop()>"; else $output_temp .=">";

  $fpread = fopen($backend, 'r');
  if(!$fpread) {
      echo "error $errstr ($errno)<br>\n";
      exit;
  } else {

       while(! feof($fpread) ) {

          $buffer = ltrim(Chop(fgets($fpread, 256)));

          if (($buffer == "<item>") && ($items < $max_items)) {
            $title = ltrim(Chop(fgets($fpread, 256)));
            $link = ltrim(Chop(fgets($fpread, 256)));
            $description = ltrim(Chop(fgets($fpread, 256)));

            $title = ereg_replace( "<title>", "", $title );
            $title = ereg_replace( "</title>", "", $title );
            $link = ereg_replace( "<link>", "", $link );
            $link = ereg_replace( "</link>", "", $link );
            $description = ereg_replace( "<description>", "", $description );
            $description = ereg_replace( "</description>", "", $description );     

            $output_temp .= "<a href=\"".$link."\"><b><big>".$title."</big></b></a><br><small>".$description."</small><br>";
            $items++;
          }
      }
      fclose($fpread);
  }

// alle daten sind in $ausgabe_temp
echo $output_temp;
echo '</marquee>';


generates this

Parse error: syntax error, unexpected T_CONCAT_EQUAL in "path removed"/Sources/Load.php(1745) : eval()'d code(43) : eval()'d code on line 18

in the phpbox when it is displayed.

Line 18 is

if($scroll) output_temp .="<marquee direction=up scrolldelay=$delay scrollamount=$amount height=$height ";


doughboy99

Resolved this. The code on page 2 seems to be missing a $ symbol

if($scroll) output_temp .="<marquee direction=up scrolldelay=$delay scrollamount=$amount height=$height ";

should be
if($scroll) $output_temp .="<marquee direction=up scrolldelay=$delay scrollamount=$amount height=$height ";

now just need to get it display my feed.

Nr|Five

Great piece of code URPG kudos on that.

Got a question though. Both the title and description is being posted atm. In the description text I often have URLs. Only those are not clickable. Anyone here know a solution to that problem?

// Nr|Five

Denniga

Is it possible to have the block filled with text, and then begin scrolling?

Because right now, the block is empty and then scrolling begins.

If you want to see the implementation on our site, check out: www.nphscs.com