Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
Display Reputation Power in postbit Details »»
Display Reputation Power in postbit
Version: 1.00, by Gary King Gary King is offline
Developer Last Online: Jun 2020 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 02-09-2004 Last Update: Never Installs: 31
 
No support by the author.

This hack will display each user's reputation power in their postbit.

No extra queries run and this code doesn't really add too much extra load time, maybe only 0.0000000000000001 seconds

Very easy hack to install, 1 minute or less

Okay let's begin

First create a new Global phrase called reputation_power with the content
Code:
Reputation Power
Now open up includes/functions_showthread.php and find

PHP Code:
        $post['joindate'] = vbdate($vboptions['registereddateformat'], $post['joindate']); 
Above, add
PHP Code:
        $repjoindate $post[joindate]; 
Find:
PHP Code:
    $show['messageicon'] = iif($post['iconpath'], truefalse); 
Above add
PHP Code:
    $show['score'] = 1;
    
// reputation SECTION
    // initialize reputation power
    
$score 1;

    
// for every certain number of posts, gain a point
    
if ($vboptions['pcpower'])
    {
        
$postfactor intval($post['posts'] / $vboptions['pcpower']);
    }
    else
    {
        
$postfactor 0;
    }


    
// for every certain number of reputation points, gain a point
    
if ($vboptions['kppower'])
    {
        
$reputationfactor intval($post['reputation'] / $vboptions['kppower']);
    }
    else
    {
        
$reputationfactor 0;
    }

    
// for every certain number of days registered, gain a point
    
$timepassed intval((TIMENOW $repjoindate) / 86400);    
    if (
$vboptions['rdpower'])
    {
        
$timefactor intval($timepassed $vboptions['rdpower']);
    }
    else
    {
        
$timefactor 0;
    }

    
// compute the user's total reputation power
    
$score $score $postfactor $timefactor $reputationfactor;

    
# the following only matters for admin
    
$perms fetch_permissions(0$post['userid'], $post);
    if (
$perms['adminpermissions'] & CANCONTROLPANEL AND $vboptions['adminpower'])
    {
        
$score $vboptions['adminpower'];
    }
    else if ((
$post['posts'] < $vboptions['minreputationpost']) OR ($post['reputation'] < $vboptions['minreputationcount']))
    {
        
$score 0;
    }
    
##### 
Now open up postbit template and find
HTML Code:
					</div>
					<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon]</div>
Above add
HTML Code:
						<if condition="$show[score]"><br />$vbphrase[reputation_power]: $score</if>
All done

Show Your Support

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

Comments
  #32  
Old 02-12-2004, 02:20 PM
Milez Milez is offline
 
Join Date: Jan 2002
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Tried moving the affected users to another usergroup but still they show Rep Power: 0.

Anyone out there installed this on a busy board with alot of members and have no troubles at all?
Reply With Quote
  #33  
Old 02-13-2004, 02:27 PM
Milez Milez is offline
 
Join Date: Jan 2002
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Gary: Perhaps since only 3 users seem to be affected I should recreate their user accounts? Not sure how to do this without them losing their posts though which is not good. Any advice?

You can for yourself the problem with the 0 Rep Power score with the user account I created for you on my board. I pm'ed you the info so not sure if you saw it or not.
Reply With Quote
  #34  
Old 02-13-2004, 02:41 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Milez
Gary: Perhaps since only 3 users seem to be affected I should recreate their user accounts? Not sure how to do this without them losing their posts though which is not good. Any advice?

You can for yourself the problem with the 0 Rep Power score with the user account I created for you on my board. I pm'ed you the info so not sure if you saw it or not.
Yeah I saw, and it's really strange; unless I receive confirmation from someone else about this problem though I think I'll leave it for now, especially since I've been real busy these days :ermm:
Reply With Quote
  #35  
Old 02-15-2004, 01:34 PM
trilOByte's Avatar
trilOByte trilOByte is offline
 
Join Date: Nov 2001
Location: England
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Followed your intstructions on page 1 and all mods/supermods/admins show 0. Regular members show correctly, as do members of a custom user group.

See:
http://www.britishblades.com/forums/...6&page=1&pp=20

The template edit is on the "vB3 grey style" skin only, so make sure you have that selected.
Reply With Quote
  #36  
Old 02-15-2004, 02:37 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by trilOByte
Followed your intstructions on page 1 and all mods/supermods/admins show 0. Regular members show correctly, as do members of a custom user group.

See:
http://www.britishblades.com/forums/...6&page=1&pp=20

The template edit is on the "vB3 grey style" skin only, so make sure you have that selected.
Make sure that they actually don't have 0 reputation power before jumping to conclusions because I believe that admins are different in that their reputation power stays the same, etc. I'm not too sure on the specifics, but maybe check first to see if the user has 0 reputation power; also please make a screenshot would make life easier for me (in the admin cp when editing the user.)
Reply With Quote
  #37  
Old 02-15-2004, 03:31 PM
trilOByte's Avatar
trilOByte trilOByte is offline
 
Join Date: Nov 2001
Location: England
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No mistake. My power is currently 6, it displays as 0. I checked several mods/admins to make sure they had power, they did, it was displaying 0. If you browse the thread linked above, notice the different user groups have their names in different colours.

There is no mistake.

Correction *some* mods show the power rating also some members of other user groups do not. It would appear to be random, although it does not show for any of the 3 admins, and is missing of all but 1 of the moderators.

On an aside, I manually set the power rating in the ACP to 10 for admins - the hack then showed this value (for admins only, the mods still had 0 showing). I then reset it to 0 in the ACP (this should set admins to the same rules as everyone else) and the admins showed as 0 in the postbit - even though the ACP correctly showed my power as 6.
Reply With Quote
  #38  
Old 02-16-2004, 12:29 AM
Milez Milez is offline
 
Join Date: Jan 2002
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have similiar issues that Gary is aware of.

As a side note I have also noticed that none of my users in my created group show having incorrect values. Some as I have mentioned are 0 yet some are showing values slightly off from what is shown in the admincp.

Anyways there is definately something wrong. I think I will have to uninstall this hack until someone comes up with a solution to fix this - I have spent dozens of hours trying to figure out what it could be.

As a side note: I recreated an account for one of the affected users and merged his existing account with the new one. After doing this the rep power didn't display zero but it did display a value that was incorrect from what is shown in the admincp.

has anyone else with a large board tested this code? Can a vb dev member shed some light as to what it could be?
Reply With Quote
  #39  
Old 02-16-2004, 02:33 AM
trilOByte's Avatar
trilOByte trilOByte is offline
 
Join Date: Nov 2001
Location: England
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The power=0 issue seems random. I get it accross all user groups, regardless of actual power rating. Some read correctly, some just say 0. So far, I havent found a member with a value other than 0, which is also incorrect.
Reply With Quote
  #40  
Old 02-16-2004, 11:06 AM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Strange that's real weird, I posted a question at vB.com about this hopefully I get a response
Reply With Quote
  #41  
Old 02-16-2004, 02:37 PM
Milez Milez is offline
 
Join Date: Jan 2002
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hehe so did I Gary. Thanks for your attention.
Reply With Quote
Reply

Thread Tools

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 11:27 AM.


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.13803 seconds
  • Memory Usage 2,330KB
  • Queries Executed 25 (?)
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_code
  • (2)bbcode_html
  • (4)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
  • (4)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
  • (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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete