Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Display latest blog post in postbit using Magpie RSS Details »»
Display latest blog post in postbit using Magpie RSS
Version: 1.10, by pmkb pmkb is offline
Developer Last Online: Sep 2018 Show Printable Version Email this Page

Category: Mini Mods - Version: 3.6.8 Rating:
Released: 08-26-2007 Last Update: 08-28-2007 Installs: 24
Uses Plugins Template Edits
Is in Beta Stage  
No support by the author.

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. Download Magpie RSS 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:
    Quote:
    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:
    Quote:
    <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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 08-27-2007, 03:08 PM
Ratman2050 Ratman2050 is offline
 
Join Date: Jul 2007
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Reserved.

P.S. My First Reserve
Reply With Quote
  #3  
Old 08-27-2007, 05:39 PM
yahoooh yahoooh is offline
 
Join Date: Oct 2002
Posts: 567
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

any demo?
Reply With Quote
  #4  
Old 08-27-2007, 06:31 PM
pmkb's Avatar
pmkb pmkb is offline
 
Join Date: Sep 2005
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I added a screenshot.
Reply With Quote
  #5  
Old 08-28-2007, 12:38 PM
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Location: Australia
Posts: 2,469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When I read the title of this mod, I thought vb must have released its blog ^^ but then I got my hopes up too fast lol. nice mod tho.
Reply With Quote
  #6  
Old 08-28-2007, 02:32 PM
pmkb's Avatar
pmkb pmkb is offline
 
Join Date: Sep 2005
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry about that! It's hard to describe some mods in just a few words.
Reply With Quote
  #7  
Old 08-29-2007, 08:40 AM
Triky's Avatar
Triky Triky is offline
 
Join Date: Mar 2007
Location: [Italy]
Posts: 728
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed.
I will use this feature in the future.
Really thanks, pmkb.
Reply With Quote
  #8  
Old 08-29-2007, 08:56 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is the magpie rss_fetch.inc file needed on each vBulletin page? You are currently loading it unconditionally in the "global_start" hook. This might lead to more overhead then needed.

PHP Code:
if ($post['field5']){ 
 
$num_items 1
 
$rss fetch_rss($post['field5']); 
 if(
$rss) { 
  
$items array_slice($rss->items0$num_items); 
  foreach ( 
$items as $item ) { 
   
$blogTitle $item['title']; 
   
$blogLink $item['link']; 
  } 
 } 

As you overwrite $blogTitle and $blogLink each time you go thru the loop, only the last value will ever be displayed (assuming you can have more then 1 entry, otherwise the loop does also not make sense).
Reply With Quote
  #9  
Old 08-29-2007, 09:09 AM
gforce75 gforce75 is offline
 
Join Date: Sep 2003
Posts: 192
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good catch Herwaarden. Nice mod, but will wait till see a demo
Reply With Quote
  #10  
Old 08-29-2007, 11:04 AM
pmkb's Avatar
pmkb pmkb is offline
 
Join Date: Sep 2005
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

gforce, what do you mean by a demo? I posted a screenshot of what it does from my own forum (see sig) where this mod is working. I have the mod installed on 3 forums and it works great.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:50 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05642 seconds
  • Memory Usage 2,303KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete