Welcome Guest, Not a member yet? Register   Sign In
RSS Links
#1

[eluser]JanDoToDo[/eluser]
hey guys,

i looked through previous posts and found the simplepie lib for rss feeds. However, Im trying to make the title a link and it seems to be replacing all '=' with = and all the '&'with &. The char set is set to utf-8 in simple and utf-8 using the meta on the page. How can i get it to display the characters coz otherwise the link isnt working!

I can just change the chars in PHP but it seems like this should already have been thought of so i might be missing something?

here is code

Code:
$this -> simplepie -> set_feed_url($rss_feed['rss_feed']);
            $this -> simplepie -> set_cache_location(BASEPATH.'cache/rss');
            $this -> simplepie -> init();
            $this -> simplepie -> handle_content_type();
            $rss_items = $this -> simplepie -> get_items(0, 5);
#2

[eluser]JanDoToDo[/eluser]
anyone???
#3

[eluser]JanDoToDo[/eluser]
*Bump* Anyone?
#4

[eluser]Phil Sturgeon[/eluser]
Quote:replacing all ‘=’ with = and all the ‘&‘with &.

huh?

Are you talking about html_entity_decode() or htmlentities()?
#5

[eluser]JanDoToDo[/eluser]
I have no idea! Oh sorry the forums converted the characters - It meant to say:

replacing all ‘=’ with '% 3D' and all the ‘&‘ with '% 26' (but without the spaces between % signs)

The original link is, e.g.

http://www.shef.ac.uk/union/news.php?con...=news-feed

but when i get this and then make it a link on my page, the link href is converted to:

http://www.shef.ac.uk/union/news.php?contentID'% 3D'8997'% 26'utm_medium'% 3D'RSS'% 26'utm_campaign'% 3D'news-feed

Ignore the spaces and apostrophies as obviously it will convert them to the characters if there is no space!

I know i could convert the characters myself but it seems like i shouldnt have to?
#6

[eluser]Phil Sturgeon[/eluser]
Looks like you'd be better off trying urldecode()
#7

[eluser]JanDoToDo[/eluser]
Works like a charm thankyou. However,surely I shouldnt have to do this?? Whjy would it be converting the characters in the first place? If I look at the data in the feed it hasnt converted the characters - it only converts when i put the <a href="feed_link"




Theme © iAndrew 2016 - Forum software by © MyBB