MyBB Community Forums

Full Version: Reputation Bug.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
I hope everybody is moody.
Im just dealing with a reputation bug see the below photos in order to understand my problem.

1)In this photo reputation icon is ok and counted correctly.
[attachment=44436]

2)In this photo the icon is displayed blank with green color on the left and the history summary on right is just blank.
[attachment=44437]
Check for the variable $rep_total in your theme's reputation template. If it's not there, it needs to be added, in a line something like this (this is the line by default; it might be different in your theme):

<strong>{$lang->total_reputation}:</strong> <span class="repbox {$total_class}">{$rep_total}</span><br /><br />
(2021-09-29, 02:23 AM)Laird Wrote: [ -> ]Check for the variable $rep_total in your theme's reputation template. If it's not there, it needs to be added, in a line something like this (this is the line by default; it might be different in your theme):

<strong>{$lang->total_reputation}:</strong> <span class="repbox {$total_class}">{$rep_total}</span><br /><br />

(SEE BELOW IF YOU CAN FIGURE OUT ANY SOLUTION PLEASE).
Checked that! I already have that code in my template:

<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->reputation_report}</title>
{$headerinclude}
<script type="text/javascript">
<!--
	var delete_reputation_confirm = "{$lang->delete_reputation_confirm}";
// -->
</script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/report.js?ver=1804"></script>
</head>
<body>
{$header}
{$add_reputation}
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder clear">
<tr>
	<td class="thead"><strong>{$lang->reputation_report}</strong></td>
</tr>
<tr>
	<td class="tcat"><strong>{$lang->summary}</strong></td>
</tr>
<tr>
	<td class="trow1">
	<table width="100%" cellspacing="0" cellpadding="0" border="0">
		<tr>
			<td>
				<span class="largetext"><strong>{$username}</strong></span><br />
				<span class="smalltext">
					({$usertitle})<br />
					<br />
					<strong>{$lang->total_reputation}:</strong> <span class="repbox {$total_class}">{$rep_total}</span><br /><br />
					<strong>{$lang->reputation_members} {$rep_members}</strong><br />
					<strong>{$lang->reputation_posts} {$rep_posts}</strong>
				</span>
			</td>
			<td align="right" style="width: 300px;">
					<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="hide htc tborder trow2">
						<tr>
							<td>&nbsp;</td>
							<td><span class="smalltext reputation_positive">{$lang->positive_count}</span></td>
							<td><span class="smalltext reputation_neutral">{$lang->neutral_count}</span></td>
							<td><span class="smalltext reputation_negative">{$lang->negative_count}</span></td>
						</tr>
						<tr>
							<td style="text-align: right;"><span class="smalltext">{$lang->last_week}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$f_positive_week}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$f_neutral_week}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$f_negative_week}</span></td>
						</tr>
						<tr>
							<td style="text-align: right;"><span class="smalltext">{$lang->last_month}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$f_positive_month}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$f_neutral_month}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$f_negative_month}</span></td>
						</tr>
						<tr>
							<td style="text-align: right;"><span class="smalltext">{$lang->last_6months}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$f_positive_6months}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$f_neutral_6months}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$f_negative_6months}</span></td>
						</tr>
						<tr>
							<td style="text-align: right;"><span class="smalltext">{$lang->all_time}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$f_positive_count}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$f_neutral_count}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$f_negative_count}</span></td>
						</tr>
					</table>
			</td>
		</tr>
	</table>
	</td>
</tr>
<tr>
	<td class="tcat"><strong>{$lang->comments}</strong></td>
</tr>
{$reputation_votes}
<tr>
	<td class="tfoot" align="right">
	<form action="reputation.php" method="get">
		<input type="hidden" name="uid" value="{$user['uid']}" />
		<select name="show">
			<option value="all" {$show_selected['all']}>{$lang->show_all}</option>
			<option value="positive" {$show_selected['positive']}>{$lang->show_positive}</option>
			<option value="neutral" {$show_selected['neutral']}>{$lang->show_neutral}</option>
			<option value="negative" {$show_selected['negative']}>{$lang->show_negative}</option>
		</select>
		<select name="sort">
			<option value="dateline" {$sort_selected['last_updated']}>{$lang->sort_updated}</option>
			<option value="username" {$sort_selected['username']}>{$lang->sort_username}</option>
		</select>
		{$gobutton}
	</form>
	</td>
</tr>
</table>
{$multipage}
{$footer}
</body>
</html>



TEMPLATED I DO HAVE:
PHOTO:
[attachment=44443]
Interesting. The only two other possibilities I can think of right now is that either there's a plugin interfering with that variable, or that core code, especially in reputation.php has been changed to interfere with that variable.

Does temporarily disabling all plugins resolve the problem? (You can do this via the ACP under Board Settings » Configuration » Disable All Plugins).

If not, what does the ACP's File Verification tool (under Tools & Maintenance) show?
Same thing happening with MyBB default theme?

Also, check css. I've seen where the color matches the background and makes things disappear visually. Inspect the page source for actual content.
Good question re default theme. Re CSS and page inspection: I'd already checked that - there's definitely no number in the HTML output where there should be one. See here.
1)Files have no problem at verification.
2)Disabled all plugins same problem.
3)Default theme for sure it will be working,even i dont have the default theme to test it.

I THINK THAT SOMETHING MUST BE ADDED AS A CODE SINCE ITS TEMPLATE ISSUE.
BUT IM NOT 100% SURE.

Guys i dont know which code is changed but i got that fixed.
(AS I TOLD YOU IT MUST BE TEMPLATE ISSUE ONLY)
(THIS TOPIC NOW WILL BE MARKED AS SOLVED)

Here is the new code:

<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->reputation_report}</title>
{$headerinclude}
<script type="text/javascript">
<!--
	var delete_reputation_confirm = "{$lang->delete_reputation_confirm}";
// -->
</script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/report.js?ver=1804"></script>
</head>
<body>
{$header}
{$add_reputation}
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder clear">
<tr>
	<td class="thead"><strong>{$lang->reputation_report}</strong></td>
</tr>
<tr>
	<td class="tcat"><strong>{$lang->summary}</strong></td>
</tr>
<tr>
	<td class="trow1">
	<table width="100%" cellspacing="0" cellpadding="0" border="0">
		<tr>
			<td>
				<span class="largetext"><strong>{$username}</strong></span><br />
				<span class="smalltext">
					({$usertitle})<br />
					<br />
					<strong>{$lang->total_reputation}:</strong> <span class="repbox {$total_class}">{$user['reputation']}</span><br /><br />
					<strong>{$lang->reputation_members} {$rep_members}</strong><br />
					<strong>{$lang->reputation_posts} {$rep_posts}</strong>
				</span>
			</td>
			<td align="right" style="width: 300px;">
					<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder trow2">
						<tr>
							<td>&nbsp;</td>
							<td><span class="smalltext reputation_positive">{$lang->positive_count}</span></td>
							<td><span class="smalltext reputation_neutral">{$lang->neutral_count}</span></td>
							<td><span class="smalltext reputation_negative">{$lang->negative_count}</span></td>
						</tr>
						<tr>
							<td style="text-align: right;"><span class="smalltext">{$lang->last_week}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$positive_week}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$neutral_week}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$negative_week}</span></td>
						</tr>
						<tr>
							<td style="text-align: right;"><span class="smalltext">{$lang->last_month}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$positive_month}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$neutral_month}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$negative_month}</span></td>
						</tr>
						<tr>
							<td style="text-align: right;"><span class="smalltext">{$lang->last_6months}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$positive_6months}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$neutral_6months}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$negative_6months}</span></td>
						</tr>
						<tr>
							<td style="text-align: right;"><span class="smalltext">{$lang->all_time}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$positive_count}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$neutral_count}</span></td>
							<td style="text-align: center;"><span class="smalltext">{$negative_count}</span></td>
						</tr>
					</table>
			</td>
		</tr>
	</table>
	</td>
</tr>
<tr>
	<td class="tcat"><strong>{$lang->comments}</strong></td>
</tr>
{$reputation_votes}
<tr>
	<td class="tfoot" align="right">
	<form action="reputation.php" method="get">
		<input type="hidden" name="uid" value="{$user['uid']}" />
		<select name="show">
			<option value="all" {$show_selected['all']}>{$lang->show_all}</option>
			<option value="positive" {$show_selected['positive']}>{$lang->show_positive}</option>
			<option value="neutral" {$show_selected['neutral']}>{$lang->show_neutral}</option>
			<option value="negative" {$show_selected['negative']}>{$lang->show_negative}</option>
		</select>
		<select name="sort">
			<option value="dateline" {$sort_selected['last_updated']}>{$lang->sort_updated}</option>
			<option value="username" {$sort_selected['username']}>{$lang->sort_username}</option>
		</select>
		{$gobutton}
	</form>
	</td>
</tr>
</table>
{$multipage}
{$footer}
</body>
</html>

If somebody can tell the defference just reply below,before i mark it as solved.So the other users have the solution ready thought that is the reason i posted the fixed code.Everything works fine now.Of course im not clever than you its just trials that made that working.
Well, there is that line 37 first time says class="hide htc tborder trow2"
now just says class="tborder trow2"
That's the only difference I see.
It looks like your fix was to replace $rep_total with $user['reputation'], the raw and unformatted version of that $rep_total variable (no commas every three digits). This suggests that you are running a version of MyBB prior to that for which the formatted version $rep_total was introduced, which was in version 1.8.5.

If that diagnosis is correct, then, dude, you really need to upgrade. You're putting your server at risk by running such outdated software.
(2021-10-02, 04:21 AM)Laird Wrote: [ -> ]It looks like your fix was to replace $rep_total with $user['reputation'], the raw and unformatted version of that $rep_total variable (no commas every three digits). This suggests that you are running a version of MyBB prior to that for which the formatted version $rep_total was introduced, which was in version 1.8.5.

If that diagnosis is correct, then, dude, you really need to upgrade. You're putting your server at risk by running such outdated software.

Yes buddy,may you are right!very close!
SOLUTION(CORE-ANSWER):I just removed "hide" & "htc" as they were hiding it from view.
Thats all.It was more simple than i though.
But another guy figured it out.
Thanks everybody you are most welcomed!
I