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?

English |
French
