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

Recent

Welcome to TinyPortal. Please login or sign up.

June 26, 2024, 09:33:44 AM

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

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.

IchBin

This is one of those things that I wish we had as well. Unfortunately, I don't know of any way to do that myself.

3nd3r

Well, let's use some of that 'essay and error' working mode to see if anything works... :P  ;)

Let's try first "if exists..." or maybe a "curl"...

I will tell here if I get it  :up:

morskisrle

What line of code should i put i in order to encode the letters in utf8?

3nd3r

What I've done is put what I want to be UTF-8 inside this:
utf8_encode(HERE THE CODE YOU WANT IN utf8)

MargateSteve

Right, I tried to sort this on my own but have got nowhere!
I have used this code at http://margate.wsnw.net top left in a block called 'margate-fc.com' and although it is working it is only picking up 1 post in the feed.
A few blocks below that in 'Latest headlines from www.margate-fc.com... ' all the posts from the same feed are showing up.
Any advice on where I am going wrong would be greatfully recieved!
Steve

MargateSteve

I have just re-read my post and got a bit worried that it was a bit criticle in some way! Just in case people have ignored it for that reason let me reassure that that is not the case. Basically I like to try to solve problems like this myself before asking a question, which is why the post started off the way it did.
Anyway, by way of an update, the output from the feed has changed twice in the last two days and although it has picked up the new story each time, it will still only show the newest one in the block.
I am sure that I am missing something simple here!
Steve

thefley

#76
the code you posted on page one works just find for me on IE7 and FireFox

demo www.gpriders.com

Just one thing, is there a way to make the links open in a new window ??


code used:
//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>';

IchBin

#77
Change this code:

$ausgabe_temp .= "<a href=\"".$link."\"><b><big>".$title."</big></b></a><br><small>".$description."</small><br>";

To this:

$ausgabe_temp .= "<a target=\"_blank\" href=\"".$link."\"><b><big>".$title."</big></b></a><br><small>".$description."</small><br>";

thefley

#78
got myself an error when I did it....


Parse error: parse error, unexpected T_STRING in /home/content/h/e/f/hefleys/html/smf/Sources/Load.php(1802) : eval()'d code(35) : eval()'d code on line 30

IchBin

Try the above code again.