MyBB Community Forums

Full Version: Reputation system + images
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello. I have problem. I just writed a script to display pictures above reputation power.
My script is:
if($reputation == 0){

echo "reputation-pic 0";

}

if($reputation => 1){

echo "reputation-pic 1green";

}

if($reputation => 10){

echo "reputation-pic 2green";

}

...
I don't know where to put it...
In templates it dosn't work.

I want to have like vB:
<picture of reputation> (<Reputation Power> )
ex. [][] (10)

Please help me with code Smile
Thanks

#edit
reputation-pic 1green will be changed to <img src="green1.gif">
Put it "global.php"
if($mybb->user['reputation'] == 0)
{

}
else if($mybb->user['reputation'] >= 1)
{

}
else if($mybb->user['reputation'] >= 10)
{

}
Where to put it (after, before line?)?


My script looks:
// REPUTACJA PLUS START
if($mybb->user['reputation'] == 0)
{
echo "<img src='images/repbit_bal.gif'>"
}
else if($mybb->user['reputation'] >= 1)
{
echo "<img src='images/repbit_pos.gif'>"
}
else if($mybb->user['reputation'] >= 10)
{
echo "<img src='images/repbit_pos.gif'><img src='images/repbit_pos.gif'>"
} 
kacperoo Wrote:Where to put it (after, before line?)?


My script looks:
// REPUTACJA PLUS START
if($mybb->user['reputation'] == 0)
{
echo "<img src='images/repbit_bal.gif'>"
}
else if($mybb->user['reputation'] >= 1)
{
echo "<img src='images/repbit_pos.gif'>"
}
else if($mybb->user['reputation'] >= 10)
{
echo "<img src='images/repbit_pos.gif'><img src='images/repbit_pos.gif'>"
} 

After
// Run global_start plugin hook now that the basics are set up
$plugins->run_hooks("global_start");
I have problem (again?)
When I put it where you said i have an error that says:
Parse error: syntax error, unexpected '}', expecting ',' or ';' in /var/www/web35/html/forum/global.php on line 69
My code looks: (line 69 is marked)
// REPUTACJA PLUS START
if($mybb->user['reputation'] == 0)
{
echo "<img src='images/repbit_bal.gif'>"
} <- LINE 69
else if($mybb->user['reputation'] >= 1)
{
echo "<img src='images/repbit_pos.gif'>"
}
else if($mybb->user['reputation'] >= 10)
{
echo "<img src='images/repbit_pos.gif'><img src='images/repbit_pos.gif'>"
}