View Full Version : post name idea... help me out
Shokkka
06-16-2002, 06:39 PM
Well, im the Admin of these forums Im at
When I psot it shows my boring dull name, and I wanna make it change to an image.
now this is my idea I think i got the PHP part right, just bear with me cause im new to php but this should show the image for my name if the $post[username] is identicle to my name on the forums which is "Shokka"
heres the code
//special name image
if($post[username] == Shokka) {
print("<img src="IMAGE URL">");
}
now the only problem is, what file would this go in AND would it show my name in text and then the image?
Just an idea hehe
Tell me what you think, and please dont steal the idea lol :lick:
L8r
~Shokka
Chris M
06-16-2002, 07:34 PM
Probably all the file to do with posting and/or threads...
So :
forumdisplay.php
newthread.php
newreply.php
online.php
showthread.php
memberlist.php
Satan
Xenon
06-16-2002, 08:33 PM
you have to edit functions.php
the getpostbit section.
but don't use this code:
print("<img src="IMAGE URL">");
it'll destroy the design.
instead use this code:
$post[image]="<img src='Imageurl'>";
just put the $post[image] into your postbittemplate
if you want to change your username to an image write instead
$post[image]="<img src='Imageurl'>";
this:
$post[username]="<img src='Imageurl'>";
also its not good to use the username here:
if($post[username] == Shokka)
change it to your userid, so if you change your name you need not change your code:
if($post[userid] == xx)
Shokkka
06-16-2002, 09:09 PM
its only gonna be for admins. but i thought of it this way
if ($post[userid] == "filewithuserids") {
print("images/$post[userid].gif")
}
something like that.
Xenon
06-17-2002, 12:11 PM
if if it should be for all admins, thats very easy to do:
in admin/functions.php go to section getpostbit, and before this lines:// do posts from ignored users
if (!$ignore[$post[userid]]) {
eval("\$retval = \"".gettemplate("postbit")."\";");
} else {
eval("\$retval = \"".gettemplate("postbit_ignore")."\";");
}
add this lines:
if ($post[usergroupid] == 6) {
$post[username]="<img src='images/".$post[userid].".gif'>";}
Shokkka
06-17-2002, 08:47 PM
and it will show an image for the admin user name?
Xenon
06-17-2002, 08:50 PM
yes it will.
but don't forget to create an image for every admin you have :)
Shokkka
06-17-2002, 08:50 PM
oh ya and BTW, shouldnt it check if the user has an image first ;) so incase it doesnt show nothing :p
Xenon
06-17-2002, 08:54 PM
why do you think i have asked this question:
"if it should be for all admins, thats very easy to do:" ;)
change the if clause to
$post[usergroupid] == 6 && $post[userid]!=xy
and add so much ids, which don't have a picture ;)
as i think you haven'T soo much admins this would be easier than mak long coding to find out if file exists and so on ^^
Shokkka
06-17-2002, 08:58 PM
no no no i meant, like if the admin doesnt have his/her image made yet, then instead of showing a dead link picture, it will check to see if the picture is there, and if its not, it will just display the name :p thats what i meant lol
Xenon
06-17-2002, 09:04 PM
that code i told you should make it, but you'll have to enter manually who hasn't a picture yet.
i'm not sure, but i think you can use this code to do what you want:
if ($post[usergroupid] == 6) {
if(file_exists("images/".$post[userid].".gif")) { $post[username]="<img src='images/".$post[userid].".gif'>";}}
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.