MyBB Community Forums

Full Version: Putting + sign in-front of positive reps
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've spotted if you have negative rep and minus (-) sign gets displayed before the number in posts for REP points, but if you have positive Rep no plus (+) sign get displayed. It stays the same a neutral rep (0), with nothing displayed before it.

So I looked in the reputation.php file and located this code.

		$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'])
		{
			$negative_title = $lang->sprintf($lang->power_negative, "-".$i);
			$negative_power .= "\t\t\t\t\t<option value=\"-{$i}\" class=\"reputation_negative\" onclick=\"$('reputation').className='reputation_negative'\"{$vote_check[-$i]}>{$negative_title}</option>\n";
		}
	}

I can see there is a minus sign (-) in two places for negative reps, so thought by adding the + sign in the same two places higher above that would do the trick. But it's not and no plus sign gets displayed doing this below.

Change This:

Quote: $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'])

To this (red changes):

Quote: $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'])

Any ideas why that didn't work? I thought it would have.
Quote:$negative_title = $lang->sprintf($lang->power_negative, "-".$i);
$positive_title = is it defined !?
Yes there was already a + there anyway on that line.

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'])
{
$negative_title = $lang->sprintf($lang->power_negative, "-".$i);
$negative_power .= "\t\t\t\t\t<option value=\"-{$i}\" class=\"reputation_negative\" onclick=\"$('reputation').className='reputation_negative'\"{$vote_check[-$i]}>{$negative_title}</option>\n";

The only difference I see between positive and negative there, is two minus signs inserted.

Quote:{$vote_check[-$i]}>

and here

Quote:<option value=\"-{$i}

I put the + signs in the same places thinking it would work, it doesn't. I have spotted one other small thing, not sure if this might be a bug, or if it should be like that. But there is a DOT (full stop) missing in the positive line, that's there in the negative line here before the "=" sign.

$positive_power = "\t\t\t\t\t
$negative_power .= "\t\t\t\t\t

In that latest post you've got this code:
$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'])
{
$negative_title = $lang->sprintf($lang->power_negative, "-".$i);
$negative_power .= "\t\t\t\t\t<option value=\"-{$i}\" class=\"reputation_negative\" onclick=\"$('reputation').className='reputation_negative'\"{$vote_check[-$i]}>{$negative_title}</option>\n";

Second line appears to be missing a +.

$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'])
{
$negative_title = $lang->sprintf($lang->power_negative, "-".$i);
$negative_power .= "\t\t\t\t\t<option value=\"-{$i}\" class=\"reputation_negative\" onclick=\"$('reputation').className='reputation_negative'\"{$vote_check[-$i]}>{$negative_title}</option>\n";
That was just an example of the code I was looking in, not what I added. Guess I should have made that more clear. Below is what I did and nothing changes.

        $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'])
        {

And also tried putting + in two places, just to rule out it might have to be needed there also. But doubted it, that just checks the votes negative or normal here: {$vote_check[+$i]}>{$positive_title}
Forgot to say, as a test I removed the minus "-" sign on purpose to see it that disappeared on negative votes listed and it didn't, so I don't think this has anything to do with it now.

For others here looking how to do this also, I now have this solved working perfect via help from another forum I posted on. Visit the link below.

Link: Displaying Plus sign (+) before positive rep points.