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: 497
  • Total: 497

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.

G6Cad

Try to convert the rss feed to a script instead.
Go to this page and follow the steps and see if you get a better layout on the feed
http://www.rss-to-javascript.com/p/138.html
Then put the feed in a java/html block

daygo140

#21
Quote from: G6 on August 13, 2006, 09:01:53 AM
Try to convert the rss feed to a script instead.
Go to this page and follow the steps and see if you get a better layout on the feed
http://www.rss-to-javascript.com/p/138.html
Then put the feed in a java/html block

Will that keep the neat scrolling function or will I lose that?

There is no possible way to add target="_blank" into that php script?  Where's the PHP gurus....?

G6Cad

They will come around when yhey have the time for the every day life they have ;)

Im not sure if the scroll will come up, you have to try your way through :)

daygo140

Quote from: G6 on August 13, 2006, 01:16:32 PM
They will come around when yhey have the time for the every day life they have ;)

Im not sure if the scroll will come up, you have to try your way through :)

I'd rather wait it out and add target="_blank" into that php script.  I really like it.  I did try adding it a few different ways but I was unsuccessful...I can patiently wait for the honorable php'ers!!!

URPG

#24
I don't think putting it into a script will sovle any problems... Opera does not work fully with JavaScript either, so it won't improve the scrolling problem Opera has...

I added some blank lines in front and after the news and it's looking real neath now on my page.

What we need now is real TP integration like the RSS box has, so any user could install and configure it...

Target=_blank to open the news in a new browser window? The link comes out of the rss feed, don't know if we could simply change it :-/

daygo140

Quote from: URPG on August 13, 2006, 04:53:01 PM
Target=_blank to open the news in a new browser window? The link comes out of the rss feed, don't know if we could simply change it :-/

I noticed this piece from your code:

$ausgabe_temp .= "<a href=\"".$link."\"><b><big>".$title."</big></b></a>....

That is ultimately the link, is it not?  If so can't you somehow add target="_blank" into there.  I am a big php n00b so don't laugh...

can't u do this....

$blank = ereg_replace( "target=_blank", "", $blank );

Then add it into the above somehow.  Or is that an unnecessary step and you can somehow add simply target=_blank into it?

I experimented with it a little but I didn't have something right because it yielded errors.  I bet a php guru can do it with little effort.

URPG

This is the most up to date code (where you can set all parameters in the header).

I added a target=_blank inside the link statement. It's html, it's only put together by php commands. If your attempt did not work, make sure not to include those "   " since they will disrupt the php code, you don't need them in html anyway.

//RSS Newsreader

  $backend = "http://rss.cnn.com/rss/cnn_world.rss";
  $max_items = 16;
  $items = 0;
  $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>CNN-World Newsfeed:</b><br>";

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

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

  $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."\" target=_blank><b><big>".$title."</big></b></a><br><small>".$description."</small><br>";
            $items++;
          }
      }
      fclose($fpread);
  }

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


Not all of this is my code, i took a very basic "rss to your website" thingy from some tutorial and heavilie modified it...




Any of you official TP guys around? How do we integrate this as RSS block replacement?

daygo140


URPG

If you want more or less empty lines just multiply the BR tags... haven't found a good way to scale it's size and add according free lines automatically.

daygo140

http://www.teamgpk.com/

Check it out!  Of course I added a lil' flavah to it, more when I get a chance to mess with it since now I know "" throws off php. 

Only thing that bugs me is that the scroll isn't as desirable in IE.  I'm not talking speed here but once the feeds cycle through you get the same amount of blank space and you need to wait for the feeds to recycle.  In FireFox no issues whatsoever...suggestions anyone?

This website is proudly hosted on Crocweb Cloud Website Hosting.