I saw someone requesting this, so here it is.
This will replace whatever user's name you choose with an image. This could be helpful if say you want the moderators name animated and in a rare font. Well, here you go.
Since this is NOT dynamicly driven, or anything like that, i highly reccomend you only do this for privliedge/staff/etc. members. members with a certain special group. (mods, admins, etc.)
This will only show in posts. meaning that if you view a member's profile, you'll see text, not your image.
The first thing you want to do, is create the images. make sure they are named the same as the username, since we're using ',$message['member']['name'],' to find the pic. This means capitalization, etc. I think members with special characters in there user name may mess this up, in that case, you can just make a seperate if.
now, upload those images wherever. I dont care. Just upload them all to the same place (and in your public_html dir). in our example, we'll use mine. http://model98.org/forum/Themes/site. JUst replace it with yours.
Here is my image:
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg464.imageshack.us%2Fimg464%2F5916%2Fusername7zh.gif&hash=bd956acd79f6b91f2c87bb48afc2f489fb3e579c)
ok. we got ALL images, right? There all together? OK. Now, right down the member id of all of the members you made images for. You can find it by viewing their profile url.
http://model98.org/forum/index.php?action=profile;u=174
ok. now we're ready to actually do it.
open display.template.php, find
', $message['member']['link'], '
you need to replace that with this code, but you need to change it abit to suit your url to images and member id.
Quote';
// Display an image rather than username for certain members
$image_memberID = array(1, 4);
if(in_array($message['member']['id'], $image_memberID))
{
echo'<a href="model98.org/forum/index.php?action=profile;u=', $message['member']['id'], '"><img src="model98.org/forum/Themes/site/', $message['member']['name'], '.gif"/></a>';
}
else
{
echo' ', $message['member']['link'], '';
}
echo'
**http:// removed because it turned to a link and wont show color
you need to replace the blue numbers with the id of your members you made images for. (seperate them with a comma then space: 1, 2, 6, 7, 8). You need to replce the green with the link to your profile page. You can get this by copying the address of a members profile, and editing out the number. Lastly, you need to replce the red with the path to your member's images.
Let me know if you see anything wrong with it.
if you're still confused as to what this does, look at the screenshot below. ( i know my image-names or really crappy, just made them to show you guys)
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg457.imageshack.us%2Fimg457%2F3858%2Fimageuser6ij.gif&hash=a5e46d23a7547018282288902aef515cef54c509)
if you're good with making graphics, you can make animated names, which would be realy cool, different fonts, and lots of other dynamic effects.
**tips and tricks board on validation
Very cool :).
/me moves this to Tips and Tricks.
QuoteI saw someone requesting this, so here it is.
That was me, thank you so much, I will try this first thing tomorrow morning.
Thanks again.
Just out of curiousity, can this be done with membergroups too? Not with the stars, but just where it'd say something like
Name
Group (only a pic instead of the text..)
Stars
?
yeah, just replace the group variable with the second larger block of code
...god knows I'd ****** it up.
Ok, PHPMasters....and...er...Tippmaster....
I'm a complete idiot on this kind of stuff....any chance you could explain it to me? I tried to do it myself like...3 times...and...completely screwed things up.
works great tip with 1.1RC2! Thanks!! CHECK OUT SHOYOROLL.com and look for my NAME! LOL ;D ;D ;D
it didnt make any difference for me? my names still in text?, this is the code i have
// Display an image rather than username for certain members
$image_memberID = array(1);
if(in_array($message['member']['id'], $image_memberID))
{
echo'<a href="theteenzone.net/forum/index.php?action=profile;u=1', $message['member']['id'], '"><img src="/forum/alans.gif', $message['member']['name'], '.gif"/></a>';
}
else
{
echo' ', $message['member']['link'], '';
}
echo'
its placed below
// Show information about the poster of this message.
echo '
<table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
<tr>
<td valign="top" width="16%" rowspan="2" style="overflow: hidden;">
and above
<div class="smalltext">';
// Show the member's custom title, if they have one.
if (isset($message['member']['title']) && $message['member']['title'] != '')
echo '
', $message['member']['title'], '<br />';
any ideas what i did wrong? thanks ,
i've tryed varations of the code and i still cant get it right? any ideas anyone?
Try this below. Be sure to name the gif the same as your user name or it wont work!
Look at this post (http://www.shoyoroll.com/forum/index.php?topic=9128.0). IT WORKS! I got it to work fairly with little problems 1.1rc2.
// Display an image rather than username for certain members
$image_memberID = array(1);
if(in_array($message['member']['id'], $image_memberID))
{
echo'<a href="http://www.theteenzone.net/forum/index.php?action=profile;u=', $message['member']['id'], '"><img src=http://www.theteenzone.net/forum/FOLDER YOU HAVE YOUR IMAGES"/', $message['member']['name'], '.gif"/></a>';
}
else
{
echo' ', $message['member']['link'], '';
}
echo'
nope still no image appearing , any more ideas? im using the tp_dilbertMC theme if it makes any dif
Can I suggest another option?
Well I'm going to anyways ;)
Create the image(s) and add them as smilies, using the members name as the short code and setting the 'smilie' to hidden. This also means that you can have different versions of the graphic in different smilie sets, i.e. a 'nice' one and a 'rude' one ;D
You can also use the swear filter to substitute a smilie short code for a members name .....
and that would make it appear in place of the members name how???????
Dont know how to help you man. I did exactly what I explained to you and it worked great in my TP SMF site. make sure it points to the folder where you have your images. and your image names have to be exact!
Ex. my gif for this site has to be trenchteam.gif in the folder i place it in.
http://www.theteenzone.net/forum/FOLDER YOU HAVE YOUR IMAGES"/
i foun dout what was wrong , i viewed the source code and it was requesting the wrong image , the link was after getting messed up so i removed the ', $message['member']['name'], ' after the image link and it worked!! thanks for the help!!
Tipp, will you be updating this anytime soon? You PM'ed me yesterday, but never got back to me with the coding changes. Thanks again. ;D
works with 1.1.2
Can you post the code and the lines you find them in the display then. Thanks
see the first post in this thread
I did exactly as it says
I dont have some of the coding in my template. :(
the coding does exist in the default template, i can't really assist with other templates, you'd need to contact the theme author.
But it should be there, elsewise i don't see how your membername links inside posts could be parsed properly, unless its simply showing just the member name.
Are you sure you're looking at Display.template.php and searching for
$message['member']['link']
works gr8, it took me a while to get it.. but i got it
is there an updated version?
I am new at this so very effective for me really