The Arcive of vBulletin Modifications Site. |
|
Blank Profile Feild Details »»
|
|||||||||||||||||||||||||
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. Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
easy
in fuctions.php find: PHP Code:
PHP Code:
just call $Avatar in the postbit |
|
#3
|
||||
|
||||
|
Thanks very much ^_^
|
|
#4
|
||||
|
||||
|
help anime!! I have this in my index.php for my welcome panel
Code:
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>';
}
This is the code Im using now for the avatar thingie. Code:
if ($post[field6]) {
$aAvatar="<img src=\"$post[field6]\" border=\"0\"><P>";
} else {
$aAvatar="<img src=\"{imagesfolder}/clear.gif\" border=\"0\"><P>";
}
|
|
#5
|
|||
|
|||
|
try using bbuserinfo[$field6] or bbuserinfo[$aAvatar] in the template, i think thats right.
|
|
#6
|
||||
|
||||
|
/me scratches her head, then takes another look at it
|
|
#7
|
||||
|
||||
|
ooohhh, yay. Works. Thankies ^_^
|
|
#8
|
|||
|
|||
|
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 |
|
#9
|
|||
|
|||
|
Quote:
that is true but i avoid editing the database whenever possible
|
|
#10
|
|||
|
|||
|
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 ![]() g-force2k2 |
![]() |
|
|