RSS Feed Question

The GYM Sitemaps and RSS module and it's plug-ins.
Google Yahoo MSN Sitemaps (United 0.9).
RSS 2.0 Feeds and Yahoo! urllist.txt.

Moderator: Moderators


RSS Feed Question

Postby Gamerz7 » Thu Sep 27, 2007 12:34 am

Ok, I know there has to be some way to do this.

What I want to do is make it so that when your on a specific forum, or a page inside that forum it will show that forums feed as well as the main feed.

If you have IE7 theres that RSS button that shows the RSS feeds on found on the page.

So when I go to the forum it will show just the main feed (rss.xml) but say I went into the "Announcements" forum in the feeds list it would show:

-Main Feed (rss.xml)
-Forum Feed (announcements-rf1.xml)

And even if you were like in a thread inside of that forum it would still show that forums feed.

Is there anyway of doing this?

Thanks :D
Gamerz7
 
Posts: 9
Joined: Mon Sep 24, 2007 7:26 pm

Advertisement

Postby HB » Thu Sep 27, 2007 1:58 am

If you add tags like these to the generated header, IE and Firefox will pick up the RSS feeds.

Code: Select all
<link rel="alternate" type="application/rss+xml" title="YourForum Forums [RSS]" href="http://www.yourforum.com/forums/rss.xml">
<link rel="alternate" type="application/rss+xml" title="YourForum.com - AAA Forum [RSS]" href="http://www.yourforum.com/forums/aaa-rf42.xml"><title>YourForum.com - AAA</title>
Dan Kehn
HB
phpBB SEO Team
phpBB SEO Team
 
Posts: 1109
Joined: Mon Oct 16, 2006 2:25 am

Postby Gamerz7 » Thu Sep 27, 2007 2:42 am

HB wrote:If you add tags like these to the generated header, IE and Firefox will pick up the RSS feeds.

Code: Select all
<link rel="alternate" type="application/rss+xml" title="YourForum Forums [RSS]" href="http://www.yourforum.com/forums/rss.xml">
<link rel="alternate" type="application/rss+xml" title="YourForum.com - AAA Forum [RSS]" href="http://www.yourforum.com/forums/aaa-rf42.xml"><title>YourForum.com - AAA</title>


Ya, I have already did that for the main feed, but I was wondering if there was a code to automate it to do what I said in the first post
Gamerz7
 
Posts: 9
Joined: Mon Sep 24, 2007 7:26 pm

Postby HB » Thu Sep 27, 2007 3:11 am

Open overall_header.tpl, find:

Code: Select all
<meta http-equiv="Content-Style-Type" content="text/css">


Insert after:

Code: Select all
{FORUM_RSS}


Open viewforum.php, find:

Code: Select all
//
// Dump out the page header and load viewforum template
//


Insert before:
Code: Select all
$template->assign_vars(array(
   'FORUM_RSS' => '<link rel="alternate" type="application/rss+xml" title="' . $board_config['sitename'] . ' - ' . $forum_row['forum_name'] . ' Forum [RSS]" href="' . $phpbb_seo->seo_path['phpbb_url'] . $phpbb_seo->format_url($forum_row['forum_name'], '') . '-rf' . $forum_id . '.xml">')     
);


The '-rf' should probably be $phpbb_seo->seo_delim['forum_rss'] but I was in a rush when I wrote it. You could make a similar change to viewtopic.php to have the forum RSS available, but I didn't bother.
Dan Kehn
HB
phpBB SEO Team
phpBB SEO Team
 
Posts: 1109
Joined: Mon Oct 16, 2006 2:25 am

Postby Gamerz7 » Thu Sep 27, 2007 3:35 am

OMG! That worked like a charm, that you so much! :D :D

You wouldnt happen to know exactly what to put for the viewtopic would you :oops: I have no clue what to change :?
Gamerz7
 
Posts: 9
Joined: Mon Sep 24, 2007 7:26 pm

Postby HB » Thu Sep 27, 2007 3:56 am

Nearly the same code. Open viewtopic.php, find:

Code: Select all
//
// Output page header
//


Insert after:

Code: Select all
$template->assign_vars(array(
   'FORUM_RSS' => '<link rel="alternate" type="application/rss+xml" title="' . $board_config['sitename'] . ' - ' . $forum_name . ' Forum [RSS]" href="' . $phpbb_seo->seo_path['phpbb_url'] . $phpbb_seo->format_url($forum_name, '') . '-rf' . $forum_id . '.xml">')     
);


Why this isn't part of the RSS MOD is a mystery only dcz understands. :wink:
Dan Kehn
HB
phpBB SEO Team
phpBB SEO Team
 
Posts: 1109
Joined: Mon Oct 16, 2006 2:25 am

Postby Gamerz7 » Thu Sep 27, 2007 4:09 am

HB wrote:Nearly the same code. Open viewtopic.php, find:

Code: Select all
//
// Output page header
//


Insert after:

Code: Select all
$template->assign_vars(array(
   'FORUM_RSS' => '<link rel="alternate" type="application/rss+xml" title="' . $board_config['sitename'] . ' - ' . $forum_name . ' Forum [RSS]" href="' . $phpbb_seo->seo_path['phpbb_url'] . $phpbb_seo->format_url($forum_name, '') . '-rf' . $forum_id . '.xml">')     
);


Why this isn't part of the RSS MOD is a mystery only dcz understands. :wink:


Thank you so much :D This site is awsome.

lol ya, mabey their should be something about this feature, or sticky this thread or something. Im sure lots of other people would love this :)
Gamerz7
 
Posts: 9
Joined: Mon Sep 24, 2007 7:26 pm

Postby dcz » Thu Sep 27, 2007 9:42 am

HB wrote:Why this isn't part of the RSS MOD is a mystery only dcz understands. :wink:


:lol:

Please put together an add on ;)


Anyway, I'm currently working on the next version of gym sitemaps, and it will come with an auto link mod this time, it's only I never had time to work on a working for all cases solution (it's not this obvious with the several type of rewriting available, and I as well wanted to make a general solution for Google sitemaps, rss and html sitemaps).

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 19909
Joined: Fri Apr 28, 2006 9:03 pm

Postby coyote » Fri Sep 28, 2007 6:09 am

This is way better than the way I did it. I just typed in the HTML to the feed in the forum's description. But I had to do it for each one, and it was a pain.
coyote
phpBB SEO Team
phpBB SEO Team
 
Posts: 93
Joined: Fri May 11, 2007 6:24 am

Postby volf » Mon Jan 21, 2008 9:29 am

Nice work!
Wondering will search engines pick up this link?
volf
 
Posts: 3
Joined: Tue May 29, 2007 6:32 am

Postby SeO » Tue Jan 22, 2008 8:27 am

yes ;)
SeO
Admin
Admin
 
Posts: 6012
Joined: Wed Mar 15, 2006 9:41 pm

Postby StL_Stadtroller » Thu Feb 07, 2008 4:45 am

Hello,
I attempted to add the code given above to add the RSS feed notification to my viewforum.php and viewtopic.php files as quoted, but I would winf up with an error in each like the one here:

Code: Select all
Fatal error: Call to a member function format_url() on a non-object in /home/.rugrat/stlscooterforum/stlscooterforum.com/forum/viewtopic.php on line 582


I did try replacing the '-rf- as suggested, and also got an error.

I know really nothing about PHP programming, so am I making a rookie mistake here or something?

my site is:
www.stlscooterforum.com

phpBB is installed in:
www.stlscooterforum.com/forum/

rss.php/sitemap.php/urllist.php are installed in the root.

I think everything is working OK, I just want the RSS "indicator" in IE7, etc to be live.

Thanks!
StL_Stadtroller
 
Posts: 4
Joined: Thu Feb 07, 2008 4:39 am
Location: St. Louis, MO

Postby SeO » Thu Feb 07, 2008 9:09 am

Looks like you are not using the phpBB SEO mod rewrite, correct ?
SeO
Admin
Admin
 
Posts: 6012
Joined: Wed Mar 15, 2006 9:41 pm

Postby StL_Stadtroller » Thu Feb 07, 2008 1:02 pm

yes, that is correct.
StL_Stadtroller
 
Posts: 4
Joined: Thu Feb 07, 2008 4:39 am
Location: St. Louis, MO

Postby dcz » Mon Feb 25, 2008 8:42 am

So, you should proceed as follow.

First, use :
$template->assign_vars(array(
'FORUM_RSS' => '<link rel="alternate" type="application/rss+xml" title="' . $board_config['sitename'] . ' - ' . $forum_name . ' Forum [RSS]" href="http://www.example.com/phpbb/' . format_url($forum_name, 'forum') . '-rf' . $forum_id . '.xml">')
);


Instead of the above code. You'll need to hard code your real forum url (I know it's not the prettiest way, but it's simple) and then, add :
Code: Select all
   /**
   * Prepare Titles for URL injection
   */
   function format_url( $url, $type = 'topic' ) {
      $url = preg_replace("`\[.*\]`U","",$url);
      $url = preg_replace('`&(amp;)?#?[a-z0-9]+;`i','-',$url);
      $url = htmlentities($url, ENT_COMPAT);
      $url = preg_replace( "`&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig);`i","\\1", $url );
      $url = preg_replace( array("`[^a-z0-9]`i","`[-]+`") , "-", $url);
      $url = ( $url == "" ) ? $type : strtolower(trim($url, '-'));
      return $url;
   }


At the end of your includes/functions.php file and ti should be ok.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 19909
Joined: Fri Apr 28, 2006 9:03 pm

Next

Return to GYM Sitemaps phpBB2

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 3 guests


 
cron