MyBB Community Forums

Full Version: Script help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I know I should post this over in the mybb mods site but I don't want to register again. I have been messing with the show ratings on member list mod making it use rep instead. All works fine but I am now stuck at this bit. Which is the hardest bit for me. Can anyone point me in the right direction for this working correctly. At the moment nothing shows up unless the user has 0 rep (Before messing with the memberlist.php it did have the rep in text form) Even if this did work I can see it will only ever show the green squares and would give 1 for every rep point they have.

help me Smile

if($users['reputation'])
{
	$repinfo = explode('|', $users['reputation']);
	$reputation = round($repinfo[0] / $repinfo[1]);
	unset($users['reputation']);
	for($i= 0; $i < $reputation; $i++)
	{
		$users['reputation'] .= "<img src=\"images/repbit_pos.gif\">";
	}
}
else
{
	$users['reputation'] = '0';
}

http://forums.theresource.co.uk/memberlist.php

Edit: I have removed that bit of code for now
You can use the getreputation() function in inc/functions.php to generate the images for you Wink

Take a look at it and the parameters it accepts.
Thanks for that Chris I think I got it working correctly Smile I'll write a little guide for it incase others are interested.