Topic: Avatar in a block
stormdesign
avatar
Freshman
Freshman
Posts: 27

Posted:
28.Aug 2003 - 12:28

Please!!!!

I would like to put a block with the user avatar and a Welcome message.
Each user could see his/her avatar and this would incentive they to choose an avatar.

Help me please!!!! icon_lol
markwest

Moderator
Moderator
Posts: 7720

Posted:
28.Aug 2003 - 13:44

This is only the basics - you'll need to add a little to lay this out as you wish but if you add a PHP block and add the following code you'll get your avatar image display. Then format this as you wish.

Code

echo '<img src ="images/avatar/' . pnUserGetVar('user_avatar') . '">';


-Mark
stormdesign
avatar
Freshman
Freshman
Posts: 27

Posted:
28.Aug 2003 - 22:55

Thank you very much!!!
But I would like toi put the a avatar in center of block. Im not so good with the php.php script. With theme.php I do everything I want it.
Other thing. I would to put a condition in the avatar. If user avatar is 000.gif (no avatar) the link is Change Info. If the user avatar is ok the link is User Account.

Please, one more time, help me!!!! :P
markwest

Moderator
Moderator
Posts: 7720

Posted:
28.Aug 2003 - 23:26

With PHP all your doing is echoing out HTML so code the relevant HTML as you need. This is what I meant by you needing to lay this out as you wish.

To code the logic it would be

Code

if (pnUserGetVar('user_avatar') != '000.gif') {
    echo '<img src ="images/avatar/' . pnUserGetVar('user_avatar') . '">';
}


Add the needed HTML to the echo statements as you'd modify any theme. Now's the time for you to learn a bit more ;).

-Mark