View Full Version : Blank Profile Feild
Takara
06-14-2002, 01:00 AM
I have a custom profile feild, (field6) that I use as an avatar feild. But if a user leaves it blank, I want it to revert to /images/clear.gif
Can anyone give me a hand? Or if its possible, just have $post[field6] return /images/clear.gif if null instead of checking at the control panel.
easy
in fuctions.php find:
if ($post[aim]!="") {
eval("\$post[aimicon] = \"".gettemplate("aim")."\";");
} else {
$post[aim]="";
}
under it add
if ($post[field6]) {
$Avatar="$post[field6]<br>";
} else {
$Avatar="<img src="{ imagesfolder }/clear.gif" border="0" alt="No Avatar">";
}
that sould work
just call $Avatar in the postbit
Takara
06-14-2002, 01:19 AM
Thanks very much ^_^
Takara
06-14-2002, 02:07 AM
help anime!! I have this in my index.php for my welcome panel
if ($bbuserinfo[userid]!=0) {
$avatarurl = $post['field6'];
if ($avatarurl=='') {
$avatarurl='images/noavatar.gif';
}
$avatarimage='<img src="'.$avatarurl.'" align="left">';
} else {
$avatarimage='<a href="register.php?s='.$session[sessionhash].'&action=signup"><img src="images/guestavatar.gif" border="0"></a>';
}
But it always shows no avatar selected (unless your not registerd).
This is the code Im using now for the avatar thingie.
if ($post[field6]) {
$aAvatar="<img src=\"$post[field6]\" border=\"0\"><P>";
} else {
$aAvatar="<img src=\"{imagesfolder}/clear.gif\" border=\"0\"><P>";
}
Can you help? Welcome to my board, btw ^_^
try using bbuserinfo[$field6] or bbuserinfo[$aAvatar] in the template, i think thats right.
Takara
06-14-2002, 02:18 AM
/me scratches her head, then takes another look at it
Takara
06-14-2002, 02:21 AM
ooohhh, yay. Works. Thankies ^_^
g-force2k2
06-15-2002, 02:12 AM
You could also just as easily...
ALTER TABLE userfield DROP field6
ALTER TABLE userfield ADD field6 varchar(250) NOT NULL DEFAULT 'https://vborg.vbsupport.ru/images/clear.gif'
or instead of the 'https://vborg.vbsupport.ru/images/clear.gif' as the defualt just add your own url to a certain img ;)
g-force2k2
Originally posted by gforce2001
You could also just as easily...
ALTER TABLE userfield DROP field6
ALTER TABLE userfield ADD field6 varchar(250) NOT NULL DEFAULT 'https://vborg.vbsupport.ru/images/clear.gif'
or instead of the 'https://vborg.vbsupport.ru/images/clear.gif' as the defualt just add your own url to a certain img ;)
g-force2k2
that is true but i avoid editing the database whenever possible :)
g-force2k2
06-19-2002, 01:25 AM
i like to play with the database quite alot... mysql and php are powerful combined for a reason ;) then again if you drop a query on accident then your in trouble :p
g-force2k2
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.