Back to vBulletin 3.6 Add-ons

Display latest blog post in postbit using Magpie RSS
Mod Version: 1.10, by pmkb

This modification is in the archives.
vB Version: 3.6.8 Rating: (3 votes - 4.67 average) Installs: 24
Released: 27 Aug 2007 Last Update: 29 Aug 2007 Downloads: 160
Not Supported Uses Plugins Template Edits Is in Beta Stage  

This mod borrows extensively from the work vauge did for vB 3.5 (as found here) and from the work nevetS did for a similar mod using CaRP RSS.

I did PM vauge requesting permission to update his mod as many people were having difficulty implementing it, but s/he hasn't been online in several months and didn't respond to my PM for over a week now, so I decided to go ahead and post the mod.

This mod will allow forum members to add their blog's RSS feed URLs to their profile and have the forum display a link to their latest blog post next to their username every time they post in the forum.

I had been using nevetS's CaRP mod for this for a long time, but the Magpie RSS reader is actually more powerful (can parse Atom feeds too) and flexible. Also, I don't know if anyone can find the free download for CaRP anymore.

Installation:
  1. http://magpierss.sourceforge.net/ and install on your server. Magpie is a free, open source RSS reader with caching. It consists of 4 .php files plus one external library file. I recommend you create a directory called magpie in your domain's root directory and upload the files there.

    Be sure when installing to create a cache sub-directory inside the magpie directory and CHMOD it to 777.
  2. In your vB ACP, add a new user profile field. I used the following:
    Title: Blog Feed
    Description: Do you write a blog? Post the RSS/XML feed for the blog here and a link to your latest blog post will show in the forums next to your name with every post.
    Max Length: 200
    Type: Single Line
    Required: No
    Editable: Yes
    Private: No * Must be No if you want guests and registered members to see the blog links
    Searchable/Shown on memberlist: No
    After saving, go to the User Profile Field Manager and note what the Name column displays for your new field. It should be field5 or field6 or something like that.
  3. Open the attached magpierss.xml file in your favorite text editor and modify the paths for the MAGPIE_DIR and MAGPIE_CACHE_DIR variables to match your server's directory structure. You can adjust the value for the MAGPIE_CACHE_AGE if you like. It's set to update the cache every 4 hours by default. Last, update the field5 to your field # in two places in the postbit_display_start section. Save the file.
  4. Import your updated magpierss.xml file using the Add/Import Product link in the Manage Products page.
  5. Edit your postbit template. Find $template_hook[postbit_userinfo_left] and add just before it:
    <if condition="$post['field5']"><div class="smallfont">Recent Blog: <a href="$blogLink" target="_blank">$blogTitle</a></div></if>
    You should change the field # in that code to match your field # of course. You can also add rel="nofollow" to the link code if you are so inclined.

That's it.

P.S. Updated per Marco van Herwaarden's suggestions for better performance and security.

P.P.S. If anyone knows how to fix the XML file so that it injects the template code into the postbit_userinfo_left hook so folks don't have to make a manual template edit, by all means please share.

P.P.P.S Unfortunately, there appears to be a conflict with the magpie code and vBulletin's AJAX code which is beyond my coding skills to fix. See page two of this thread for more details.

Download

This modification is archived, downloads are still allowed.

File Type: %1$s magpierss.xml (1.5 KB, 145 downloads)

Screenshots

Click image for larger version
Name:	blogpost.gif
Views:	884
Size:	3.6 KB
ID:	69147  

Similar Mods

Latest Blog Feed in Postbit using Carp RSS vBulletin 3.5 Add-ons
Latest blog in postbit - magpierss vBulletin 3.5 Add-ons

vblts.ru supports vBulletin®, 2022-2024