Jump to content


Photo

RSS parser


  • Please log in to reply
7 replies to this topic

#1 a-base

a-base
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 23 June 2006 - 08:09 PM

Hello everybody!

I've been playing a round with some different RSS parsers in PHP. I found one to my liking, there's just one problem, when clicking links, they are opened in the same window. I want them to be opened in a new window. It should be really easy to do I think. I'm a PHP newb but I think I should get "target=_new" in there somewhere?

Anyone have an idea for me? Thanx in advance [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]

[a href=\"http://www.a-base.dds.nl/forum/rss/temp.txt\" target=\"_blank\"]code of the RSS parser[/a]

[a href=\"http://www.a-base.dds.nl/forum/rss/temp.php\" target=\"_blank\"]result[/a]

#2 phpstuck

phpstuck
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 23 June 2006 - 09:53 PM

<a target="_blank" href="http://www.yahoo.com">YAHOO LINK</a>

#3 a-base

a-base
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 23 June 2006 - 10:50 PM

thanx for your help phpstuck, but I'm still stuck hehe

I think it's the code on line 87 I have to alter.
current code:
print ("\n<div class=\"itemtitle\"><a href=\"" . $rss_channel["ITEMS"][$i]["LINK"] . "\">" . $rss_channel["ITEMS"][$i]["TITLE"] . "</a></div>"

I changed it to:
print ("\n<div class=\"itemtitle\"><a target="_blank" href=\"" . $rss_channel["ITEMS"][$i]["LINK"] . "\">" . $rss_channel["ITEMS"][$i]["TITLE"] . "</a></div>"

but this is giving me a php error. I don't know where else to put that target bit.

#4 phpstuck

phpstuck
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 23 June 2006 - 11:01 PM

Are you getting a parse error?

#5 a-base

a-base
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 23 June 2006 - 11:11 PM

I'm getting a syntax parse error.

[a href=\"http://www.a-base.dds.nl/forum/rss/temp2.txt\" target=\"_blank\"]code of the edited RSS parser[/a]

[a href=\"http://www.a-base.dds.nl/forum/rss/temp2.php\" target=\"_blank\"]result[/a]

#6 phpstuck

phpstuck
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 23 June 2006 - 11:29 PM

I think I know what the problem is... I think

When you echo or print you start with

echo "something inside these quotes";

but if you say

echo "somthing "important" in these quotes";

it will generate a syntax error because you have double quotes inside the start and end double quotes. Try changing the starting and ending quotes to single quotes, if that dosen't work change the start and end back to doubles and all of the quotes inside (in your code for everything) to single quotes.

Let me know, but that has happened to me more than once and driven me crazy for hours trying to figure it out.

#7 Allen4172

Allen4172
  • Members
  • PipPip
  • Member
  • 17 posts

Posted 24 June 2006 - 12:12 PM

a-base,

Change

print ("\n<div class=\"itemtitle\"><a target="_blank" href=\"" . $rss_channel["ITEMS"][$i]["LINK"] . "\">" . $rss_channel["ITEMS"][$i]["TITLE"] . "</a></div>"

To this:

print ("\n<div class=\"itemtitle\"><a target=\"_blank\" href=\"" . $rss_channel["ITEMS"][$i]["LINK"] . "\">" . $rss_channel["ITEMS"][$i]["TITLE"] . "</a></div>"

That should take care of the parser error.

#8 a-base

a-base
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 24 June 2006 - 03:39 PM

[!--quoteo(post=387422:date=Jun 24 2006, 01:12 PM:name=MikeAAAAA)--][div class=\'quotetop\']QUOTE(MikeAAAAA @ Jun 24 2006, 01:12 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
That should take care of the parser error.
[/quote]oh my goodness was that all, yep it works now.

thanx for your help guys [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users