Displaying Plus sign (+) before positive rep points
mrgtb Offline
Junior Member
**
Posts: 10
Joined: Jan 2011
Post: #1
Displaying Plus sign (+) before positive rep points
I've been asking about this on MyBB but have gotten nowhere with it, read this post first: Putting + sign in-front of positive reps.

What I'm trying to do there seemed pretty straight forward to me, edit the reputation.php file and change this code below to put two + sign in the same places were (- signs) are displayed for negative points in the code below it. Not the case though!

Quote: $positive_title = $lang->sprintf($lang->power_positive, "+".$i);
$positive_power = "\t\t\t\t\t<option value=\"{$i}\" class=\"reputation_positive\" onclick=\"$('reputation').className='reputation_positive'\"{$vote_check[$i]}>{$positive_title}</option>\n".$positive_power;
if($mybb->settings['negrep'])
{

Two + signs added below (in red), but made no difference.

Quote: $positive_title = $lang->sprintf($lang->power_positive, "+".$i);
$positive_power = "\t\t\t\t\t<option value=\"+{$i}\" class=\"reputation_positive\" onclick=\"$('reputation').className='reputation_positive'\"{$vote_check[+$i]}>{$positive_title}</option>\n".$positive_power;
if($mybb->settings['negrep'])
{

My question, how can you make it so plus points displays a + sign in-front of rep points. I've tried lot of ways now, only using one + sign in each place, rather than 2 added. Still no joy though! Surely it can be that hard to show a + sign in-front of positive reps numbers.
(This post was last modified: 07-05-2011 01:44 AM by mrgtb.)
07-05-2011 01:38 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #2
RE: Displaying Plus sign (+) before positive rep points
You can try this way:

functions.php, find (by default, MyBB 1.6*, it's in line #2738):

PHP Code:
2738
2739
2740
2741
elseif($reputation > 0)
{
	$display_reputation .= "reputation_positive";
}


replace it with:

PHP Code:
2738
2739
2740
2741
2742
elseif($reputation > 0)
{
	$display_reputation .= "reputation_positive";
	$reputation = '+'.$reputation;
}


07-05-2011 01:59 AM
Find all posts by this user Quote this message in a reply
mrgtb Offline
Junior Member
**
Posts: 10
Joined: Jan 2011
Post: #3
RE: Displaying Plus sign (+) before positive rep points
Alternatively, if it's not possible to display the + sign in-front of Positve reps points. Is the a way instead to remove the - sign from being displayed in-front of negative points. That's another option I'm willing to go with as well? So you would see a red number with no - sign displayed.
(07-05-2011 01:59 AM)RateU Wrote:  You can try this way:

functions.php, find (by default, MyBB 1.6*, it's in line #2738):

PHP Code:
2738
2739
2740
2741
elseif($reputation > 0)
{
	$display_reputation .= "reputation_positive";
}


replace it with:

PHP Code:
2738
2739
2740
2741
2742
elseif($reputation > 0)
{
	$display_reputation .= "reputation_positive";
	$reputation = '+'.$reputation;
}


Thanks for that, it works fine displaying the + sign in profile fields on the forum in posts. But when you go to the REP page where comments are left the + sign does not get displayed there like it does if you have minus REP. Pictures uploaded to show what I mean.

But it works fine on testing, just now needs to get a + sign displayed there also and jobs a good one.


Attached File(s) Thumbnail(s)
           
(This post was last modified: 07-05-2011 02:37 AM by mrgtb.)
07-05-2011 02:00 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #4
RE: Displaying Plus sign (+) before positive rep points
If you have Template Conditionals or PHP in Templates / Complex Templates plugin, you can try to do that via template edit:

reputation template, find:

Code:
{$user['reputation']}


Replace it with:

Code:
<if $user['reputation'] > 0 then>+</if>{$user['reputation']}


Or, if you want to do that via a core edit, you can try this:
reputation.php file, find:

PHP Code:
469
470
471
472
if(!$user['reputation'])
{
	$user['reputation'] = 0;
}


Replace it with:

PHP Code:
469
470
471
472
473
474
if(!$user['reputation'])
{
	$user['reputation'] = 0;
}elseif($user['reputation'] > 0){
	$user['reputation'] = '+'.$user['reputation'];
}


(This post was last modified: 07-05-2011 02:38 AM by RateU.)
07-05-2011 02:37 AM
Find all posts by this user Quote this message in a reply
mrgtb Offline
Junior Member
**
Posts: 10
Joined: Jan 2011
Post: #5
RE: Displaying Plus sign (+) before positive rep points
I've done lots of core file edits already to add borders and such around avatars, plus I don't use that hack permission in templates. I've gone the way of core editing and it works perfect, image below to show.

Thanks very much for your help and being fast doing it too. I'll update that thread on MyBB now and point in direction of this thread here to help others looking how to do the same thing.

Again, thanks! Much appreciated.


Attached File(s) Thumbnail(s)
   
(This post was last modified: 07-05-2011 02:59 AM by mrgtb.)
07-05-2011 02:54 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #6
RE: Displaying Plus sign (+) before positive rep points
Glad you can solve the problem Smile

07-05-2011 03:12 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: