News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Give specific members extra star

Started by Cheat, August 11, 2010, 06:53:50 PM

Previous topic - Next topic

Cheat

I am trying to figure out how to give specific members (based on id number) an extra image or star in threads. Here's what I have so far (display.template.php):

if (something)
  echo '
                        <li class="stars"><img src="http://urlforimage.png"></li>';


I need to figure out what to put for "something" so I can specify which members will get the extra image. Any ideas?
Sep7agon.net [nofollow] | Off-topic and Gaming Site

mirahalo

you can use $message['member']['id'] to do that, heres an example:


// I call the variable start to avoid conflicts


$stars = array(1,2,3,4);   // where 1,2,3,4 are the ids of the users you want to show the start

if ( in_array($message['member']['id'], $stars) )

{

echo '
                        <li class="stars"><img src="http://urlforimage.png"></li>';

}

you can use this code on display.template.php  on other pages it wont work

Cheat

Thanks a lot, it worked like a charm! :)
Sep7agon.net [nofollow] | Off-topic and Gaming Site

mirahalo


Advertisement: