vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Blank Profile Feild (https://vborg.vbsupport.ru/showthread.php?t=39823)

Takara 06-14-2002 01:00 AM

Blank Profile Feild
 
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.

Brad 06-14-2002 01:08 AM

easy

in fuctions.php find:

PHP Code:

if ($post[aim]!="") {
            eval(
"\$post[aimicon] = \"".gettemplate("aim")."\";");
        } else {
            
$post[aim]="";
        } 

under it add

PHP Code:

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

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>';
}

But it always shows no avatar selected (unless your not registerd).

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>";
                }

Can you help? Welcome to my board, btw ^_^

Brad 06-14-2002 02:15 AM

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

Brad 06-16-2002 01:20 AM

Quote:

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


All times are GMT. The time now is 07:00 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01125 seconds
  • Memory Usage 1,736KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete