MyBB Community Forums

Full Version: Positive Reputation Variable?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I'm working on a "Profile" sidebox, I've gotten everything I need to work so far, except for one thing. And that's trying to display only positive reputation. 

To explain things a bit more, here's a picture:

[Image: 1e0hQfR.png]

I've got the unread messages to appear using this code
<a href="{$mybb->settings['bburl']}/private.php">{$mybb->user['pms_unread']}</a>

But no matter what I've tried for getting the reputation, it just refuses to show anything. Except for this
{$mybb->user['reputation']}

However, that only shows the total reputation, and not the individual positive, neutral, and negative rep.

I don't know if this is the correct forum for this. But I figured I'd try.
Maybe this is what you're looking for. Smile
https://community.mybb.com/mods.php?action=view&pid=140
I'll install it and see if I can get it working.

The main problem I have is just trying to get the variable for only Positive Reputation to show up like it does when viewing a users reputation details. However using the same variable that's listed in the reputation details doesn't work. Here's to hoping this plugin adds a workaround.

EDIT: Didn't add a workaround, sadly.
i believe that its not possible to show only the positive rank
by adding this
{$mybb->user['reputation']}

will show all the reputation
I may be a little bit late to the party but. If you have the plugin PHP and Template Conditionals by ZiNgA BuRgA installed just add this to where your reputation code for the sidebar is.

<if $GLOBALS['mybb']->user['usergroup'] == 1 then>
			Registration crap can go here for guest to see.
		</if>

<!-- This makes it so only Registered, Super Mods, Admins and Moderators can see this. -->
<if $GLOBALS['mybb']->user['usergroup'] == 2 ||  $GLOBALS['mybb']->user['usergroup'] == 3 || $GLOBALS['mybb']->user['usergroup'] == 4 || $GLOBALS['mybb']->user['usergroup'] == 6 then>
        <if $GLOBALS['mybb']->user['reputation'] > 0 then>
            Reputation: {$mybb->user['reputation']}
        <elseif $GLOBALS['mybb']->user['reputation'] <= 0 then>
        Reputation: is too low
        <else />
    </if>
</if>

<if $GLOBALS['mybb']->user['usergroup'] == 7 then>
    Crap for banned users to see.
</if>

Remove any code from that block that you don't need.