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

Reply
 
Thread Tools
Hall of Fame - Top vBExperience Members - Widget, Forum Block and VBA CMPS Module Details »»
Hall of Fame - Top vBExperience Members - Widget, Forum Block and VBA CMPS Module
Version: 1.1, by Sadikb Sadikb is offline
Developer Last Online: Jun 2022 Show Printable Version Email this Page

Category: Add-On Releases - Version: 4.0.6 Rating:
Released: 09-17-2010 Last Update: 09-28-2010 Installs: 22
Uses Plugins Template Edits
Re-useable Code Translations  
No support by the author.

On my site running vBExperience 4, I needed to have a CMS Widget and Forum Block showing Top Members, aptly named as Hall of Fame. So I wrote this one. This is not a standalone widget and it is only tested with vBExperience 4 and vBulletin 4.0.6. I will try and help if you have any issues but I can't guarantee support.

What this does:

Not much... This is totally based on the need of my site where I wanted to show member's avatar's besides their names, titles and Experience Points. So that's all this will show. If you need anything more you will have to change the Query.


INSTALL INSTRUCTIONS

1) Add the CSS which we will use

Styles & Templates > select style > Edit Template > CSS Templates > additional.css

Add the below CSS

Before you add the CSS, a very important point to note is that I use a 300px sidebar column on CMS and 300px sidebar on Forums. If your CMS/Forum sidebar column is of less width, you should change the CSS values accordingly. I highly recommend playing with Firebug to arrive at optimum Display.


HTML Code:
.clearfix {
background:none repeat scroll 0 0 #FFFFFF;
display:block;
float:left;
margin:0 5px 5px;
width:95%;
}

.connections_grid .grid_item {
border-bottom:1px solid #AAAAAA;
float:left;
margin-bottom:10px;
overflow:hidden;
padding-bottom:10px;
padding-top:10px;
width:130px;
}

.connections_grid .grid_item .name {
float:left;
font-size:10px;
overflow:hidden;
padding-left:10px;
padding-top:5px;
text-align:center;
white-space:nowrap;
}

.tpimg {
float:left;
height:45px;
padding-left:5px;
width:45px;
}

.allrankings {
font-size:11px;
text-align:center;
}
2) Create a new Templates

For Widget:

Styles & Templates > select style > Add Template
Title - vbcms_widget_execphp_hof
Template code -

HTML Code:
<div class="cms_widget">
	<div class="block">
		<div class="cms_widget_header">
		<h3>{vb:raw widget_title}</h3>
		</div>
		<div class="cms_widget_content" style="float:left">
		{vb:raw show_top}
		</div>
	</div>
</div>
For Forum Block:

Styles & Templates > select style > Add Template
Title - block_hof
Template code -

HTML Code:
<li>
	<div class="block smaller">
		<div class="blocksubhead">
			<a class="collapse" id="collapse_block_html_{vb:raw blockinfo.blockid}" href="{vb:raw relpath}#top"><img alt="" src="{vb:stylevar imgdir_button}/collapse_40b.png" id="collapseimg_html_{vb:raw blockinfo.blockid}"/></a>
			<span class="blocktitle">{vb:raw blockinfo.title}</span>
		</div>
		<div id="block_html_{vb:raw blockinfo.blockid}" class="blockbody floatcontainer restore">
		{vb:raw content}
		</div>
	</div>
	<div class="underblock"></div>
</li>
I usually remove the atrocious PHP/HTML icons that appear beside widget and block headings.

3) Cache Templates

Plugins & Products > Add New Plugin > leave everything default except:
Hook Location - cache_templates
Title - Cache templates for Hall of Fame
Plugin PHP code -
PHP Code:
PHP Code:
$cache array_merge((array)$cache,array(
    
'block_hof',
    
'vbcms_widget_execphp_hof'
)); 
Plugin is Active - Yes

4) Create a new Widget

vBulletin CMS > Widgets > Create New Widget
Widget Type - PHP Direct Execution
Title - Hall of Fame
SAVE

5) Configure the Widget

Now go to vBulletin CMS > Widgets > Hall of Fame > Configure
Change the Template Name to -
vbcms_widget_execphp_hof
Add the following code
PHP Code:
$member_count 8;

ob_start();
require_once(
'./includes/functions_user.php');
require_once(
'./includes/functions_bigthree.php');

$ignore_condition '1=1';

if (
strlen($vbulletin->options['xperience_ignore_users']) > 0)
{
    
$ignore_condition .= " AND u.userid NOT IN(".$vbulletin->options['xperience_ignore_users'].") ";
}

// Get Top Members
$topusers_get vB::$db->query_read("SELECT u.userid AS userid,
                                    u.username AS username,
                                    u.usertitle AS title,
                                    x.points_xperience AS points
                                    FROM "
.TABLE_PREFIX."user AS u        
                                    LEFT JOIN "
.TABLE_PREFIX."xperience_stats AS x
                                    ON x.userid=u.userid
                                    WHERE "
.$ignore_condition."
                                    ORDER BY x.points_xperience DESC
                                    LIMIT 
$member_count"
                                    
);

$show_top='<div class="connections_grid clearfix">';                                                                        
                                    
while(
$topusers vB::$db->fetch_array($topusers_get))
{
 
$URL fetch_avatar_url($topusers[userid]);
   
$a_url = @$URL[0];  

    if (empty(
$a_url)) 
    {
        
$a_url 'images/misc/unknown.gif';
    }
    

$show_top.='<div class="grid_item"><a href="member.php?u='.$topusers[userid].'"><img class="tpimg" src="'.$a_url.'" alt="'.$newuser[username].'"/><div class="name">'.$topusers[username].'<br />'.$topusers[title].'<br /><b>Points </b><span style="color:green;font-weight:bold">'.$topusers[points].'</span></div></a></div>';

}

$show_top.='<div class="allrankings"><a rel="nofollow" href="xperience.php?go=ranking">Complete  Hall of Fame Rankings</a></div></div>';

vB_Template::preRegister('vbcms_widget_execphp_hof', array('show_top' => $show_top));  

ob_end_clean(); 
You can change $member_count to as many members as you want to display.

Save

6) Add the widget to a proper layout.

7) Create New Forum Block

Forums & Moderators > Forum Blocks Manager > Add Block
Block Type - Custom Html/PHP
Title - Hall of Fame
Content Type - PHP
Content - Add this PHP Code

PHP Code:
$member_count 8;

ob_start();
require_once(
'./includes/functions_user.php');
require_once(
'./includes/functions_bigthree.php');

$ignore_condition '1=1';

if (
strlen($vbulletin->options['xperience_ignore_users']) > 0)
{
    
$ignore_condition .= " AND u.userid NOT IN(".$vbulletin->options['xperience_ignore_users'].") ";
}

// Get Top Members
$topusers_get vB::$db->query_read("SELECT u.userid AS userid,
                                    u.username AS username,
                                    u.usertitle AS title,
                                    x.points_xperience AS points
                                    FROM "
.TABLE_PREFIX."user AS u        
                                    LEFT JOIN "
.TABLE_PREFIX."xperience_stats AS x
                                    ON x.userid=u.userid
                                    WHERE "
.$ignore_condition."
                                    ORDER BY x.points_xperience DESC
                                    LIMIT 
$member_count"
                                    
);

$show_top='<div class="connections_grid clearfix">';                                                                        
                                    
while(
$topusers vB::$db->fetch_array($topusers_get))
{
$URL fetch_avatar_url($topusers[userid]);
   
$a_url = @$URL[0];  

    if (empty(
$a_url)) 
    {
        
$a_url 'images/misc/unknown.gif';
    }

$show_top.='<div class="grid_item"><a href="member.php?u='.$topusers[userid].'"><img class="tpimg" src="'.$a_url.'" alt="'.$newuser[username].'"/><div class="name">'.$topusers[username].'<br />'.$topusers[title].'<br /><b>Points </b><span style="color:green;font-weight:bold">'.$topusers[points].'</span></div></a></div>';

}

$show_top.='<div class="allrankings"><a href="xperience.php?go=ranking">Complete  Hall of Fame Rankings</a></div></div>';

$output $show_top;

ob_end_clean(); 
Again, You can change $member_count to as many members as you want to display.

Change template to use block_hof
Save
Save a proper Display Order

Of course, I use both CMS Widget and Forum block, you may use either only one.

VBAdvanced CMPS Module is attached. Thanks to DS MrSinister who provided this.

Working Demo can be seen on my site : Oracle Forums Community. Screen shots not attached as don't want to show my member's avatar's here.

Hope someone uses this... lol...

Download Now

File Type: xml halloffame_vba.xml (2.9 KB, 64 views)

Supporters / CoAuthors

Show Your Support

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

Comments
  #12  
Old 09-19-2010, 10:49 AM
gwerzal's Avatar
gwerzal gwerzal is offline
 
Join Date: Oct 2007
Posts: 317
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanksd mate

Looking good
Reply With Quote
  #13  
Old 09-19-2010, 02:09 PM
Aramist Aramist is offline
 
Join Date: Apr 2006
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ty u for the update Sadikb.
Reply With Quote
  #14  
Old 09-20-2010, 06:15 AM
warrior uw warrior uw is offline
 
Join Date: Sep 2010
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

installed thanks
Reply With Quote
  #15  
Old 09-21-2010, 08:36 AM
Sadikb's Avatar
Sadikb Sadikb is offline
 
Join Date: Aug 2008
Location: Internet
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by gwerzal View Post
Thanksd mate

Looking good
Quote:
Originally Posted by Aramist View Post
Ty u for the update Sadikb.
Quote:
Originally Posted by warrior uw View Post
installed thanks
You are welcome!
Reply With Quote
  #16  
Old 09-21-2010, 09:05 AM
Phalynx Phalynx is offline
 
Join Date: Feb 2004
Location: Erlangen, Germany
Posts: 2,747
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have referenced this widget in my readme. Thank you for sharing.
Reply With Quote
  #17  
Old 09-21-2010, 04:32 PM
Gn_Snake Gn_Snake is offline
 
Join Date: Feb 2006
Location: Italy
Posts: 358
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks man!! Good job

//edit
Not working widget cms. I see a small square
Any idea?
Reply With Quote
  #18  
Old 09-21-2010, 09:47 PM
CoZmicShReddeR's Avatar
CoZmicShReddeR CoZmicShReddeR is offline
 
Join Date: Sep 2006
Location: MI, USA
Posts: 338
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Gn_Snake View Post
Thanks man!! Good job


//edit
Not working widget cms. I see a small square
Any idea?
Yeah me too @ www.cozworld.com
Reply With Quote
  #19  
Old 09-22-2010, 12:40 AM
Sadikb's Avatar
Sadikb Sadikb is offline
 
Join Date: Aug 2008
Location: Internet
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Phalynx View Post
I have referenced this widget in my readme. Thank you for sharing.
Thanks Phalynx!

Quote:
Originally Posted by Gn_Snake View Post
Not working widget cms. I see a small square
Any idea?
Quote:
Originally Posted by CoZmicShReddeR View Post
Yeah me too @ www.cozworld.com
I couldn't find the widget or forum block on cozworld.com. If you guys could share the link where it's not working i could figure out the reason.

Edit: Sorry I just noticed. Have fixed the Widget Php code. Please again copy-paste the widget php code. It should be working now.

Thanks
Reply With Quote
  #20  
Old 09-27-2010, 01:49 PM
DS MrSinister DS MrSinister is offline
 
Join Date: Dec 2002
Location: the burgh
Posts: 553
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK this is the best i can do with my limited knowledge of php and vba.

Hall Of Fame for vBadvanced CMPS. also attach screen shot so you can see what it looks like.
enjoy. if anyone wants to clean it up some feel free.

Sadikb. feel free to added it to the main post or what ever you would like to do..
Attached Images
File Type: png hofvba.png (18.7 KB, 0 views)
Attached Files
File Type: xml halloffame.xml (2.9 KB, 17 views)
Reply With Quote
  #21  
Old 09-29-2010, 05:54 AM
Sadikb's Avatar
Sadikb Sadikb is offline
 
Join Date: Aug 2008
Location: Internet
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DS MrSinister View Post
OK this is the best i can do with my limited knowledge of php and vba.

Hall Of Fame for vBadvanced CMPS. also attach screen shot so you can see what it looks like.
enjoy. if anyone wants to clean it up some feel free.

Sadikb. feel free to added it to the main post or what ever you would like to do..
Added VBA Module to OP. Thanks!
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 02:02 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.08162 seconds
  • Memory Usage 2,397KB
  • Queries Executed 27 (?)
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
  • (3)bbcode_html
  • (3)bbcode_php
  • (8)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (3)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete