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

Recent

Welcome to TinyPortal. Please login or sign up.

April 18, 2024, 07:05:50 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,164
  • Total Topics: 21,219
  • Online today: 203
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 131
  • Total: 131

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

Hi there. I have been writing in an old thread about it, but apperantly nobody seems to read it...

The RSS Block is just very basic, I have done this one (from scratch and spare code found on the net, since nobody provided me with the code TP uses to do an rss box) and so far it does:


  • read external RSS
  • have a steady headline and scroll the messages
  • Links and Title are Big, Summary is small
  • It does stop when you move your mouse into it and continue on if you remove it

//RSS Newsreader

  $backend = "http://rss.cnn.com/rss/cnn_world.rss";
  $max_items = 10;
  $items = 0;
  $ausgabe_temp = "<b>CNN-World Newsfeed:</b><br><marquee direction=up scrolldelay=3 scrollamount=1 height=16 onmouseout=this.start() onmouseover=this.stop()>";

  $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 );     

            $ausgabe_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 $ausgabe_temp;
echo '</marquee>';


I'd like to make it variable so you can set the scroll to 1 or 0 and variable speed, etc. maybe even include multiple RSS feeds, but before that a minor annoyance has to be solved:

It does only display a single line that it is scrolling smoothly. Does anyone know how i can enlarge the area?

Demo on bottom of my Frontpage: http://www.urpg.info

Crip

URPG.
Where did you get and do the Langage Translate deal?

crip
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



URPG

Thant language translation is something i tried to get help on here and in SMF forum, no replies at all...

It's basically calling up altavista translation site with your URL in it. Still got some bug like translating an already translated site does produce an empty page and i do not know how to get rid of the iframe. If you want to look into it / help with it, go here in Bloczone Forum: URL translation for TP

What about the scrolling RSS box? any ideas? i did add some BR's but it does not seem to help any...

k_4_kelly

hello,

may i know for the Advanced RSS Feed, which type/code of block are u using?  php or script?  i tried php, script and html...it didnt work for me.....did i missed something??

URPG

It's a "phpBox", just copy + paste the code above, it's exactly what's running at my side. Just to make sure i will copy + paste it again into the above topic!

Any idea about the size issue?

EDIT: Done, i opened the Block on my site and copy+paste the code again... *must* work now!

Nokonium

Nice work, though there is a small problem. In the Opera browser the mouseover doesn't stop the scrolling.

IchBin

Sounds like a personal problem to me. :P

Nokonium

Opera and I are just good friends



Firefox fiend

URPG

Actualy Marquee is an IE element that also became supported by Netscape / Mozilla don't know why Opera does not do it. Do you have any other sugestion to make it scroll? I will gladly put it in. But as i heard Javascript is not fully supported by Opera either  :coolsmiley:

Anything on the height problem? I'd like it to be more then one line  :tickedoff:

Crip

Do you have the <Iframe Height="100%"... ?
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes