Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-26-2004, 04:57 PM
Watson's Avatar
Watson Watson is offline
 
Join Date: May 2004
Location: Scotland
Posts: 220
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Reputation Modification

Is there any way I am able to reduce the amount of reputation that is displayed.

I used to have it displayed Numerically, but I went back to the basic system, except I now use stars instead of Blobs.

But the stars are rather big, but I do like them.

What I am looking for is how I would edit when a new star is added to someones rep, so I can have it like 1000 = 1 Star, 2000 = 2 Stars and so on

Cheers

Watson
Reply With Quote
  #2  
Old 12-26-2004, 05:04 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this ;

https://vborg.vbsupport.ru/showthrea...threadid=69836

Just adapt it to display your stars instead of the gree/gold pips, and alter the default display values as required for your 1000 = 1 etc.
Reply With Quote
  #3  
Old 12-26-2004, 09:00 PM
Watson's Avatar
Watson Watson is offline
 
Join Date: May 2004
Location: Scotland
Posts: 220
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks like this could work well mate, but I aint sure what would be the best to take out of there, so it just works with the 1 image that I have

Code:
--------------------------------------
Reputation 'Pips' Display Enhancement.
--------------------------------------

This extends the existing reputation display system into three flexible bands ;

The existing dark green and light green pips, followed by 'gold' pips. 
The number and value of the pips in each band is defined by six variables in the code.


For each band a, b or c - 'band_x_val' is the vaulue of each pip and 'band_x_count' is the number displayed before moving onto the next level.


The defaults make the first 5 pips value 100, followed by 5 pips worth 200, followed by gold pips worth 1000 (max 10).

i.e. 

1 - 100 = 1 Dark green
101 - 200 = 2 Dark green
401 - 500 = 5 Dark green

501 - 700 = 5 Dark green, 1 Light green
701 - 900 = 5 Dark green, 2 Light green
501 - 1500 = 5 Dark green, 5 Light green

1501 - 2500 = 5 Dark green, 5 Light green, 1 Gold
2501 - 3500 = 5 Dark green, 5 Light green, 2 Gold

10501 - onwards = 5 Dark green, 5 Light green, 10 Gold


Negative reputations are similarly displayed, except there is no gold.

If your reputation is zero then the neutral grey pip is displayed.


 ##### v1.1 ##### ;


Added code for undefined reputaion level description.

Added code for people whose reputation is disabled - they will display a crossed icon (new 'off' gif included in zip).




##################
## Instructions ##
##################


Step 1 ;

In functions_reputation.php

Find ;


// ###################### Start getreputationimage #######################

<current block of code>

/*======================================================================*\
|| ####################################################################



Replace the whole block of code with this ;


// ###################### Start getreputationimage #######################
// ###################### Start Reputation Image Hack - Paul Marsden v1.1 #######################
function fetch_reputation_image(&$post, &$perms)
{
	global $vboptions, $stylevar, $vbphrase;

	$band_a_val = 100;
	$band_a_count = 5;

	$band_b_val = 200;
	$band_b_count = 5;

	$band_c_val = 1000;
	$band_c_count = 10;

//  For each band 'band_x_val' is the vaulue of each pip and 'band_x_count' is the number displayed before moving onto the next level.  

	if (!$vboptions['reputationenable'])
	{
		return true;
	}

	if (!$post['reputationlevelid'])
	{
		$post['level'] = $vboptions['reputationundefined'];
	}

	if (!$post['showreputation'] AND $perms['genericpermissions'] & CANHIDEREP)
	{
			$posneg = 'off';
			$post['level'] = $vbphrase['reputation_disabled'];
			eval('$post[\'reputationdisplay\'] .= "' . fetch_template('postbit_reputation') . '";');
	}
	else
	{

		$repval = $post['reputation'];	

		if ($repval == 0)
		{
			$posneg = 'grey';
			eval('$post[\'reputationdisplay\'] .= "' . fetch_template('postbit_reputation') . '";');
		}
		else if ($post['reputation'] < 0)
		{
			$repa = 'red';
			$repb = 'redh';
			$repc = 'redh';
			$repval = $repval * -1;
		}
		else
		{
			$repa = 'green';
			$repb = 'greenh';
			$repc = 'gold';
		}

		$count = $band_a_count;
		while ($count > 0 and $repval > 0) {
			$count -= 1;
			$repval -= $band_a_val;
			$posneg = $repa;
			eval('$post[\'reputationdisplay\'] .= "' . fetch_template('postbit_reputation') . '";');
		}

		$count = $band_b_count;
		while ($count > 0 and $repval > 0) {
			$count -= 1;
			$repval -= $band_b_val;
			$posneg = $repb;
			eval('$post[\'reputationdisplay\'] .= "' . fetch_template('postbit_reputation') . '";');
		}

		$count = $band_c_count;
		while ($count > 0 and $repval > 0) {
			$count -= 1;
			$repval -= $band_c_val;
			$posneg = $repc;
			eval('$post[\'reputationdisplay\'] .= "' . fetch_template('postbit_reputation') . '";');
		}
	}
	return true;
}


/*======================================================================*\
|| ####################################################################



Step 2 ;

Copy the six gif images into your /images/reputation folder.



That's it, enjoy

Paul.
I aint really got a scooby what I would edit to allow for me to change the amount of rep points, and also what I would take out so that it works with my stars. Any help with the file would be magic mate

Watson
Reply With Quote
  #4  
Old 12-26-2004, 09:51 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Watson
I aint really got a scooby what I would edit to allow for me to change the amount of rep points, and also what I would take out so that it works with my stars. Any help with the file would be magic mate
Sure, but a few questions first.

1. What is the name of you star image file (star.gif ?)

2. What do you actually want to display - e.g. 0 - 750 = 1 star, 751 - 1500 = 2 stars etc

3. At what point do you want to stop (3 stars, 5 stars, 10 stars, or some other value ?)

4. What do you want to display for negative reputations ?

The answers to these will determine what settings to alter in the hack.
Reply With Quote
  #5  
Old 12-27-2004, 08:28 PM
Watson's Avatar
Watson Watson is offline
 
Join Date: May 2004
Location: Scotland
Posts: 220
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

1. they are just named the default name of the reputation blobs, cause I didnt know how too change them, so I can change the star name to anything that you name it, as long as its in the folder. Cause my files are named like

reputation_pos.gif
reputation_high.gif

And its the same image :/

2. 1 Star = 0-500
2 Star = 501-1000
3 Star = 1001 - 2500
4 Star = 2501 - 5000
5 Star = 5001 - 10000
6 Star = 10001 +

3. I would like it to stop at 6 Stars mate

4. I would like to display summit else for negative rep, i.e. a piece of poo or summit (heh) so if you just tell me what to name the file and where to put it, then I can do that too.

Thanks very mucho mate

Watson
Reply With Quote
  #6  
Old 12-28-2004, 12:22 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

use the following.

I have marked the relevant values in red.

Code:
// ###################### Start Reputation Image Hack - Paul Marsden v1.1 #######################
function fetch_reputation_image(&$post, &$perms)
{
	global $vboptions, $stylevar, $vbphrase;

	$band_a_val = 500;
	$band_a_count = 2;

	$band_b_val = 2000;
	$band_b_count = 2;

	$band_c_val = 5000;
	$band_c_count = 2;

//  For each band 'band_x_val' is the vaulue of each pip and 'band_x_count' is the number displayed before moving onto the next level.  

	if (!$vboptions['reputationenable'])
	{
		return true;
	}

	if (!$post['reputationlevelid'])
	{
		$post['level'] = $vboptions['reputationundefined'];
	}

	if (!$post['showreputation'] AND $perms['genericpermissions'] & CANHIDEREP)
	{
			$posneg = 'off';
			$post['level'] = $vbphrase['reputation_disabled'];
			eval('$post[\'reputationdisplay\'] .= "' . fetch_template('postbit_reputation') . '";');
	}
	else
	{

		$repval = $post['reputation'];	

		if ($repval == 0)
		{
			$posneg = 'zero';
			eval('$post[\'reputationdisplay\'] .= "' . fetch_template('postbit_reputation') . '";');
		}
		else if ($post['reputation'] < 0)
		{
			$repa = 'poo';
			$repb = 'poo';
			$repc = 'poo';
			$repval = $repval * -1;
		}
		else
		{
			$repa = 'star';
			$repb = 'star';
			$repc = 'star';
		}

		$count = $band_a_count;
		while ($count > 0 and $repval > 0) {
			$count -= 1;
			$repval -= $band_a_val;
			$posneg = $repa;
			eval('$post[\'reputationdisplay\'] .= "' . fetch_template('postbit_reputation') . '";');
		}

		$count = $band_b_count;
		while ($count > 0 and $repval > 0) {
			$count -= 1;
			$repval -= $band_b_val;
			$posneg = $repb;
			eval('$post[\'reputationdisplay\'] .= "' . fetch_template('postbit_reputation') . '";');
		}

		$count = $band_c_count;
		while ($count > 0 and $repval > 0) {
			$count -= 1;
			$repval -= $band_c_val;
			$posneg = $repc;
			eval('$post[\'reputationdisplay\'] .= "' . fetch_template('postbit_reputation') . '";');
		}
	}
	return true;
}
You need four image files ;

star.gif = Positive rep image.
poo.gif = Negative rep image.
zero.gif = Image when rep is exactly zero.
off.gif = Image if rep display is disabled.

This will give you the closest possible to what you want - you will get ;

1 Star = 0-500
2 Star = 501-1000
3 Star = 1001 - 3000
4 Star = 3001 - 5000
5 Star = 5001 - 10000
6 Star = 10001 +

No more than 6 stars.

Negative scores will work exactly the same, but display poo.gif

Reply With Quote
  #7  
Old 12-28-2004, 05:00 PM
Watson's Avatar
Watson Watson is offline
 
Join Date: May 2004
Location: Scotland
Posts: 220
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok works mate, however the images aint showing up for some reason
Reply With Quote
  #8  
Old 12-28-2004, 05:06 PM
Watson's Avatar
Watson Watson is offline
 
Join Date: May 2004
Location: Scotland
Posts: 220
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Its ok actually mate, I had to put reputation_ before the image names. Thanks very much for this
Reply With Quote
  #9  
Old 12-28-2004, 05:45 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your postbit_reputation template must be adding that prefix, glad you sorted it.
Reply With Quote
  #10  
Old 11-01-2005, 08:34 AM
Watson's Avatar
Watson Watson is offline
 
Join Date: May 2004
Location: Scotland
Posts: 220
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am wondering if anyone is able to port this over to 3.5 for me. Or if it will work anyway?

Any help would be mucho appreciated

Regards

Watson
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:17 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.04487 seconds
  • Memory Usage 2,270KB
  • Queries Executed 11 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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