In-chat avatar question.

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

    In-chat avatar question.

    I've cobbled together a somewhat functioning in-chat avatar system for my chat site.

    What it does is takes the user's uploaded profile picture [or rather its name based on the username] and places it inside image tags at the beginning of the text.html file. [as well as a few other speaking files]

    Here's how I have it set up:

    Quellcode

    1. <img src="memberimages/{GET|$params.name}" height=50" border="0" alt="">


    which is both simple and "dumb"

    The pros:

    The user picture is displayed in chat, making the chat more attractive and fun.
    Avatar size can be easily restricted, etc.
    Browsers will automatically fill in the file extension.

    The cons:

    In IE there is an image placeholder for those who have no avatar.
    Doesn't use the $image string. [if you do, it just shows the viewer's profile pic for all users]
    Can't do an IF/ELSE for those who have not uploaded avatars/guests, it ends up showing nothing but that image for the viewer without a profile picture for ALL users. [since the IF is for the current user not the others.]

    Can someone point me in the direction of how to make this a much more elegant solution? I'm hell-bent on having in-chat avatars. If I can't do an IF/ELSE for a no-avatar, how can I get rid of the placeholder for IE users?
    Hmm, that's a much more elegant solution and I like how it works, however, IE users still see a "broken image" placeholder when someone has no avatar...

    Can I have the contain a default address for those who have yet to choose an avatar?

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „xeper“ ()

    OK, I tried your

    Quellcode

    1. {IF|$user_information.avatarbild eq ""}


    Not sure if I've got it set up wrong or in the wrong place. I have it in the editprofile set up like so:

    Quellcode

    1. {IF|$user_information.avatarbild eq ""}
    2. <input type=text name=avatarbild size=30 style="width:100%" value="images/whoareyou.jpg">
    3. {ELSE}
    4. <input type=text name=avatarbild size=30 style="width:100%" value="{GET|$user_information.avatarbild}">
    5. {ENDIF}


    replacing the normal GET function.

    Sorry to keep bugging you but I really do appreciate your help.
    Ok, you should understand the following:

    Quellcode

    1. {GET|$user_information.avatarbild}


    will display the user setting like images/whoareyou.jpg

    would i use

    Quellcode

    1. <img src="{GET|$user_information.avatarbild}" border="0">


    , i would see an image, stored in the base folder.

    I could also use

    Quellcode

    1. <img src="images/avatars/{GET|$user_information.avatarbild}" border="0">


    This would show an image, which is stored in GTChat-WWW/images/avatars/.

    So, if the user information is empty, we have to use an pre-defined image:

    Quellcode

    1. {IF|$user_information.avatarbild eq ""}<img src="YOUR-PRE-DEFINED-IMAGE" border="0">{ELSE}{GET|$user_information.avatarbild}{ENDIF}


    I hope, that this helps.
    I understand how the get,if and else stuff works and how and what the user_information retrieves, I'm just at a loss for where to put the code.

    When I place the if/else into the editprofile, it just leaves the field blank until you paste a url. when I place it into text.html it doesn't call the if, only the else.

    I'll plug away at it until I get it right though. Thanks.
    Still having trouble [had to step away from it for a few days] getting it to show a default. No biggie as 85%+ of my users use Firefox and it shows nothing.

    I do have another question though, how would I go about allowing users to turn off avatars? Some people still have slow connections or visit on their phones and having avatars slows them down considerably.

    Any easy fix for this? I'm sure I'll dive into figuring it out on my own right after I type this.
    Thanks a ton. Got it working relatively easily. I also was able to get a default avatar in for people who register from now on.

    Once I'm completely done with the avatar stuff [testing and tweaking and whatnot] would it be ok for me to create instructions and files for it?