Add a link to the RSS feed for each forum

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Wayne Luke
    vBulletin Technical Support Lead
    • Aug 2000
    • 74122

    Add a link to the RSS feed for each forum

    So I wanted to add an image link to each forum for its unique RSS feed. This would allow people to subscribe to their favorite forums with their favorite News Reader instead of email. It would always be up to date and accurate.

    There are three steps to doing this.

    First, I decided I needed a small plugin to determine if RSS was turned on within the forumdisplay template. Go to your plugin manager and add the following code to the "forumdisplay_start" plugin.

    PHP Code:
    if ($vbulletin->options['externalrss'])
    {
       
    $show['rss'] = true;

    Next we will be editing the forumdisplay template itself.

    Find:
    HTML Code:
    <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center" style="border-bottom-width:0px">
    <tr>
        <td class="tcat" width="100%">$vbphrase[threads_in_forum]<span class="normal"> : $foruminfo[title]</span></td>
        <td class="vbmenu_control" id="forumtools" nowrap="nowrap"><a href="$show[nojs_link]#goto_forumtools" rel="nofollow">$vbphrase[forum_tools]</a> <script type="text/javascript"> vbmenu_register("forumtools"); </script></td>
        <if condition="$show['forumsearch']">
        <td class="vbmenu_control" id="forumsearch" nowrap="nowrap"><a href="$show[nojs_link]#goto_forumsearch" rel="nofollow">$vbphrase[search_this_forum]</a> <script type="text/javascript"> vbmenu_register("forumsearch"); </script></td>
        </if>
    </tr>
    </table>
    And replace with:
    HTML Code:
    <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center" style="border-bottom-width:0px">
    <tr>
        <td class="tcat" width="100%">$vbphrase[threads_in_forum]<span class="normal"> : $foruminfo[title]</span></td>
        <td class="vbmenu_control" id="forumtools" nowrap="nowrap"><a href="$show[nojs_link]#goto_forumtools" rel="nofollow">$vbphrase[forum_tools]</a> <script type="text/javascript"> vbmenu_register("forumtools"); </script></td>
        <if condition="$show['forumsearch']">
        <td class="vbmenu_control" id="forumsearch" nowrap="nowrap"><a href="$show[nojs_link]#goto_forumsearch" rel="nofollow">$vbphrase[search_this_forum]</a> <script type="text/javascript"> vbmenu_register("forumsearch"); </script></td>
        </if>
        <if condition="$show['rss']">
          <td class="tcat"><a href="external.php?type=rss2&forumids=$foruminfo[forumid]"><img class="inlineimg" src="$stylevar[imgdir_misc]/feed_icon.png" height="14" width="14" alt="Feed Icon" title="Subscribe to $foruminfo[title]'s RSS Feed"></a></td>
        </if>
        
    </tr>
    </table>
    Finally the third step is to upload the attached image to represent your feed. If your site isn't set up to allow IE to view transparent backgrounds in PNG images, you will probably want to convert the image to a GIF format matted to your background.
    Attached Files
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...