Simplest way to use the pretty URLs into a feed.

Discussions and support about the different URL Rewriting techniques for phpBB.

Moderator: Moderators

Simplest way to use the pretty URLs into a feed.

Postby philgreen » Mon Jan 28, 2013 9:28 pm

I used phpbb seo mod rewrite so that this:

site.com/forums/viewtopic.php?t=919&p=1182#p1182

becomes:

site.com/forums/category/title/

This works fine, except that elsewhere on my site I use the RSS feed to show links to recent posts, it goes something like this:
Code: Select all
<?
$xml = simplexml_load_file("http://www.nextadvisor.com/forums/feed.php?f=15");
?>

<h1><?=$xml->entry[0]->category->attributes()->term?> Forum Posts</h1>

<ul><?
for ($i = 0; $i < count($xml->entry); $i++) {
   $link=$xml->entry[$i]->link->attributes()->href;
   $title = mb_convert_encoding((string) $xml->entry[$i]->title,"ISO-8859-1", "UTF-8");
   $title=str_replace($xml->entry[0]->category->attributes()->term.' ? ','',$title);
   $content = explode('Statistics: Posted by',(string) $xml->entry[$i]->content);   
   $content= mb_convert_encoding($content[0],"ISO-8859-1", "UTF-8");
   if (preg_match('/^.{1,150}\b/s', $content, $match)){
   $content=strip_tags($match[0]);
}
echo '<li>'.$xml->entry[$i]->link->attributes()->href.'</li>';   

?></ul>


This works fine except it gives links that look like "site.com/forums/viewtopic.php?t=919&p=1182#p1182". I want to make my RSS feed show the new links. When other people asked a similar question, they were pointed towards GYM sitemaps and RSS. I don't need a sitemap, isn't there some way I can just look up the forum URL's in the db?
philgreen
 
Posts: 9
Joined: Thu Aug 16, 2012 6:14 pm

Advertisement

Re: Simplest way to use the pretty URLs into a feed.

Postby HB » Mon Jan 28, 2013 10:26 pm

Why use the RSS code to generate the last n posts when there's already mods for that? I searched using http://www.google.com/search?q=phpbb-seo+recent+posts and found helpful discussions.
Dan Kehn
HB
phpBB SEO Team
phpBB SEO Team
 
Posts: 1509
Joined: Mon Oct 16, 2006 2:25 am

Re: Simplest way to use the pretty URLs into a feed.

Postby philgreen » Mon Jan 28, 2013 10:39 pm

Oh that didn't occur to me! Thank you!
philgreen
 
Posts: 9
Joined: Thu Aug 16, 2012 6:14 pm

Re: Simplest way to use the pretty URLs into a feed.

Postby philgreen » Mon Jan 28, 2013 10:43 pm

I don't see which of these does exactly what I want though. "No duplicates" doesn't effect the RSS feed does it?
philgreen
 
Posts: 9
Joined: Thu Aug 16, 2012 6:14 pm

Re: Simplest way to use the pretty URLs into a feed.

Postby HB » Wed Jan 30, 2013 4:46 pm

Yes and no. You may have RSS URLs that differ from your "live" board URLs, but once the user visits the link, they'll end up in the same place if the zero dupe is active. I'm not aware of any "penalty" for RSS feed URLs not matching the live board URLs, assuming of course they all redirect to the same place.
Dan Kehn
HB
phpBB SEO Team
phpBB SEO Team
 
Posts: 1509
Joined: Mon Oct 16, 2006 2:25 am


Return to phpBB mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: Google [Bot] and 13 guests