RSS Feeds in profiles
I created this after a few members asking for a system whereby they can display an RSS feed in the profiles. I searched around a bit for a mod, but found none so put together some template modifications of my own.
I must say, this wouldn't be possible without dynamicdrive.com who provided all the code I needed. Check out the page for the original system here: http://www.dynamicdrive.com/dynamicindex18/gajaxrssdisplayer.htm Instructions Okay, so the first thing that you need to do is access the template manager. Select the theme you wish to add the modification to and select "Edit Templates". Now, access the headerinclude template and add the following right at the bottom: Code:
<!--RSS Feed In profile Stuff--> <script type="text/javascript" src="http://www.google.com/jsapi?key=YOUR API HERE"> </script> <script type="text/javascript" src="gfeedfetcher.js"> /*********************************************** * gAjax RSS Feeds Displayer- (c) Dynamic Drive (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit http://www.dynamicdrive.com/ for full source code ***********************************************/ </script> <style type="text/css"> .labelfield{ color: #ffffff; font-weight: bold; font-size: 90%; } .datefield{ color: #ffffff; font-size: 90%; } #example2 div{ margin-bottom: 5px; } #example2 div a{ text-decoration: none; } code{ /*CSS for insructions*/ color: red; } </style> https://code.google.com/apis/ajaxfeeds/signup.html Paste the code into the part that says "YOUR API HERE" in the stuff you just added to the headerinclude. Hit the "Save and reaload" button. Ok, so you now need to add this file to the root directory of your forum. Just upload it via your favourite FTP client: http://www.dynamicdrive.com/dynamicindex18/gfeedfetcher.js The next step is to add 2 profile fields. Both should be single line textboxes. The rest is up to you ;D Just name them something like "RSS Title" and "RSS URL". Almost done now You just need to edit the MEMBERINFO template Find: Code:
$template_hook[profile_right_mini] Code:
<!-- RSS Feed --> <if condition="$userinfo[fieldX]"> <div id="$id" class="tborder content_block"> <h4 class="thead block_title"> <a href="#top" class="collapse_gadget" onclick="return toggle_collapse('$id')"><img id="collapseimg_$id" src="$stylevar[imgdir_button]/collapse_generic{$vbcollapse['collapseimg_'.$id]}.gif" alt="" border="0" /></a> <a name="$id"></a> <span class="block_name">RSS Feed</span> </h4> <div class="block_content" id="collapseobj_$id" style="{$vbcollapse['collapseobj_'.$id]}"><div class="alt1 smallfont block_row block_footer"> <p align="center"> <script type="text/javascript"> var cssfeed=new gfeedfetcher("example1", "example1class", "") cssfeed.addFeed("$userinfo[fieldX1]", "$userinfo[fieldX]") //Specify "label" plus URL to RSS feed cssfeed.displayoptions("label") //show the specified additional fields cssfeed.setentrycontainer("div") //Display each entry as a list (li element) cssfeed.filterfeed(5, "date") //Show 5 entries, sort by date cssfeed.init() //Always call this last </script> <br /> </p> </div></div> </div> </if> <!-- / RSS Feed --> Code:
$user[fieldX] Code:
$user[WHATEVER THE FIELD ID OF YOUR RSS URL FIELD IS] Code:
$user[fieldX1] Code:
$user[WHATEVER THE FIELD ID OF YOUR RSS TITLE FIELD IS] Demo http://www.360elites.net/member.php?u=1 Screenshots See attached :] Download No files for download. Screenshots |
Similar Mods
Forum Display Enhancements Add Recent Blog/Site Feed under Postbit. Displays Recent Blog feeds or Site Feeds. | vBulletin 3.6 Template Modifications |