vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   Profile Enhancements - RSS Feeds in profiles (https://vborg.vbsupport.ru/showthread.php?t=225018)

euantor 10-10-2009 10:00 PM

RSS Feeds in profiles
 
1 Attachment(s)
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/dynamici...sdisplayer.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>

Then, you need to grab a google API Code. Grab yours from here:

http://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:

(Right Click and Save As...)

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]
Add after:

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 -->

You need to change all the
Code:

$user[fieldX]
terms to
Code:

$user[WHATEVER THE FIELD ID OF YOUR RSS URL FIELD IS]
and all the
Code:

$user[fieldX1]
terms to
Code:

$user[WHATEVER THE FIELD ID OF YOUR RSS TITLE FIELD IS]
There. we should be done. Go to a profile and check if it works. If not, you've obviously gotten confused somewhere along the lines of my unclear explanation ;P

Demo

http://www.360elites.net/member.php?u=1

Screenshots

See attached :]

ubcforums 10-13-2009 01:11 PM

Nice :D

euantor 10-15-2009 05:53 PM

Thanks :)


All times are GMT. The time now is 10:14 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01174 seconds
  • Memory Usage 1,721KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete