Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
Avatar in a block
  • Posted: 28.08.2003, 12:28
     
    stormdesign
    rank:
    Freshman Freshman
    registered:
     April 2003
    Status:
    offline
    last visit:
    28.09.03
    Posts:
    27
    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
  • Posted: 28.08.2003, 13:44
     
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    26.08.08
    Posts:
    7720
    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
  • Posted: 28.08.2003, 22:55
     
    stormdesign
    rank:
    Freshman Freshman
    registered:
     April 2003
    Status:
    offline
    last visit:
    28.09.03
    Posts:
    27
    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
  • Posted: 28.08.2003, 23:26
     
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    26.08.08
    Posts:
    7720
    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

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula