Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

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
  #62  
Old 09-22-2004, 03:11 AM
TJFweb TJFweb is offline
 
Join Date: Dec 2001
Posts: 191
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by hambil
You where onto something, but you didn't take it far enough. Here is the fix:

Find:
PHP Code:
$post['posts'] = vb_number_format($post['posts']); 
Add above:
PHP Code:
global $rawposts;
$rawposts $post['posts']; 
Modify reputation power section as follows:
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($rawposts $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 ((
$rawposts $vboptions['minreputationpost']) OR ($post['reputation'] < $vboptions['minreputationcount'])) 
    { 
        
$score 0
    } 
That works for me. Good luck.
It actually work well now. Actually it works extremely well. Thanks for fixing it hambil!
Reply With Quote
  #63  
Old 09-30-2004, 05:10 PM
dune dune is offline
 
Join Date: May 2004
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Guys, I think I found a MUCH simpler way to do this. I assumed there was a function in vB to compute the reputation power, and there is. Why not use this function?

In functions_reputation.php

Find (line 81):
Code:
        $reputation_value = $post['reputation'];
Immediately after, ADD:
Code:
        $reputation_power = fetch_reppower($post, $perms);
        $post['reputationpower'] = $reputation_power;
Now, you can use $post[reputationpower] the same way you can use $post[reputation] in your postbit template...
Reply With Quote
  #64  
Old 10-01-2004, 04:04 AM
dune dune is offline
 
Join Date: May 2004
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So far this is working great... What am I missing that this wasn't built-in function used before?
Reply With Quote
  #65  
Old 10-01-2004, 05:17 PM
dune dune is offline
 
Join Date: May 2004
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just adding a verification, full day with this change, no issues...
Reply With Quote
  #66  
Old 10-10-2004, 12:07 AM
Takamine334 Takamine334 is offline
 
Join Date: Aug 2004
Posts: 175
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

if I've installed the way the first post says to, am I supposed to update anything. I've read the thread and several people say to change several things.
Reply With Quote
  #67  
Old 10-12-2004, 02:50 AM
dune dune is offline
 
Join Date: May 2004
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Takamine334
if I've installed the way the first post says to, am I supposed to update anything. I've read the thread and several people say to change several things.
My change is a complete replacement of the first post. I was hoping somone could validate it, so I knew I wasn't just being crazy...then I'd post it as a completely different mod.
Reply With Quote
  #68  
Old 01-04-2005, 03:16 AM
kisersose kisersose is offline
 
Join Date: Jun 2004
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

excellent... thanx
Reply With Quote
  #69  
Old 01-10-2005, 02:36 PM
yoyoyoyo's Avatar
yoyoyoyo yoyoyoyo is offline
 
Join Date: Dec 2004
Location: USA
Posts: 1,612
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dune
Now, you can use $post[reputationpower] the same way you can use $post[reputation] in your postbit template...
can you be a little more specific? Where should I put $post[reputation] in order for it to show in the postbit?
Reply With Quote
  #70  
Old 01-27-2005, 11:17 PM
dune dune is offline
 
Join Date: May 2004
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by yoyoyoyo
can you be a little more specific? Where should I put $post[reputation] in order for it to show in the postbit?
I put mine in the "alt' tag of the reputation image:

...alt="$post[reputation]/$post[reputationpower]"...

looks like: 100/10 on mouseover.
Reply With Quote
  #71  
Old 01-28-2005, 03:42 PM
Big Kahuna's Avatar
Big Kahuna Big Kahuna is offline
 
Join Date: Feb 2002
Location: SE Texas
Posts: 182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed at www.moparstyle.com and popular
Reply With Quote
  #72  
Old 01-30-2005, 02:51 PM
Big Kahuna's Avatar
Big Kahuna Big Kahuna is offline
 
Join Date: Feb 2002
Location: SE Texas
Posts: 182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Little problem (I installed the way it is in the first post of the thread)

I have some (small percentage that I can tell) members that display zero -- but when I go in and look at their profile in Admincp -- they'll have a power of say 6. One member PM'd me screaming his power was zero and what had he done -- then pm'd be that it now shows 6. I look at his post and it shows zero -- but when I look at his profile in admncp -- it is 6.

Obviously -- those are the ones screaming conspiracy. How can I fix this?
Reply With Quote
  #73  
Old 01-31-2005, 08:37 AM
nintendo's Avatar
nintendo nintendo is offline
 
Join Date: Dec 2001
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You should make a completly new thread with that much smaller method. Then we can give you an 'Install' click.
Reply With Quote
  #74  
Old 04-21-2005, 10:12 AM
face0fdie face0fdie is offline
 
Join Date: Feb 2005
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So sorry but i use Use Legacy (Vertical) Postbit Template and in my template when i use Use Legacy (Vertical) Postbit Template dot show this
what can i do to fix this problem
thanks
Reply With Quote
  #75  
Old 01-29-2007, 05:02 AM
akulion's Avatar
akulion akulion is offline
 
Join Date: Nov 2005
Location: Canada
Posts: 259
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hi
using the edit that Dune gave but there is a slight problem
Anytime someone reps someone the rep points/power display dissapears until the page reloads

I added it like this
Rep Power:
Rep:

so the template edits were in post bit legacy near where the rep is displayed

any idea how to fix it?
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 12:24 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.09148 seconds
  • Memory Usage 2,395KB
  • Queries Executed 29 (?)
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_code
  • (2)bbcode_html
  • (7)bbcode_php
  • (4)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
  • (15)post_thanks_box
  • (15)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (15)post_thanks_postbit_info
  • (14)postbit
  • (15)postbit_onlinestatus
  • (15)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