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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 629
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 337
  • Total: 337

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.

URPG

#10
I don't have any iFrame tag included... I don't need an iframe, i read the rss and echo it out.  :o

EDIT:
I tried to put it in an iframe, but i just got an empty frame. (had no file to put as src anyway)... other ways to set a fixed height of the box?

Crip

I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



Crip

Maybe you can try it in a leftside or rightside block..might work?
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



URPG

#13
Same in a left side block.

It seems that it does get loaded normaly and once the marquee starts it does get resized to one line...

I did reset the marquee height=90% it was set to 16 pixel not 16 rows  ::) but now it stoped scrolling at all...  :uglystupid2:

Crip

can you put rss feed in an iframe?...I'm not sure?
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



Crip

try a <div tag before and after </div>
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



URPG

I did simply set the marquee size too small! I can resize it to any pixel height and it does scroll! (it's working right now @100px take a look http://www.urpg.info )

But as soon as i set it to a percentage it does stop scrolling :(

Crip

Thats higher than it was..just increase the height a bit at a time
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



URPG

#18
O.K. here is my new version of the advanced RSS thingy:

//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>';


You can set:
  $backend for your RSS feed
  $headline non scrolling headline
  $max_items for maximum items grabbed
  $height the height of the element in pixel
  $scroll set to 1 for scrolling box with marquee set to 0 for no scrolling
   $amount pixel scroleld per step
   $delay ms delay per step
   $stop set to 1 for stop on mouseover set to 0 for no stop

Things to be solved:

  • Still not able to set $height in percent, no idea why...
  • Scrolling is still 'jumping' at the end of one circle, maybe add some empty items?
  • Needs full integration (replace momentary rss box, needs to get the abouve variables from block admin menue like the original thing gets RSS source?)
  • Maybe add something to clean up the text from special characters like ÃÆ'Ã...¸ or ö or ÃÆ'Ã,¤ that could be displayed messy

daygo140

Can u gimme a find/replace to make it when u click a link from the feed that it opens in a new window/tab (_blank)?

This website is proudly hosted on Crocweb Cloud Website Hosting.