Jump to content

Archived

This topic is now archived and is closed to further replies.

a-base

RSS parser

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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:
[code]print ("\n<div class=\"itemtitle\"><a href=\"" . $rss_channel["ITEMS"][$i]["LINK"] . "\">" . $rss_channel["ITEMS"][$i]["TITLE"] . "</a></div>"[/code]

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

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

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
a-base,

Change

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

To this:

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

That should take care of the parser error.

Share this post


Link to post
Share on other sites
[!--quoteo(post=387422:date=Jun 24 2006, 01:12 PM:name=MikeAAAAA)--][div class=\'quotetop\']QUOTE(MikeAAAAA @ Jun 24 2006, 01:12 PM) [snapback]387422[/snapback][/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\" /]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.