ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Avatars on forum error

January 02, 2009 6:01pm

Subscribe [1]
  • #1 / Jan 02, 2009 6:01pm

    Ronny

    83 posts

    Hi,

    At last I’ve been able to update our site to the latest EE version. I was quite nervous about it because before our EE launch something went wrong with the avatars on our forum. Derek Jones came to the rescue and was able to fix our problem back then. But of course.. the problem returns with our updated website.

    On our forum there’s a bar with options for our users (logout, profile, control panel etc.), next to that bar I always showed the avatar of the user that was logged in. What happens is that I can see the avatar, but there’s a small error above it that is caused by the code below:

    <?
    global $SESS;
    $member_id = $SESS->userdata('member_id');
    $query = "SELECT exp_members.member_id, exp_members.avatar_filename FROM exp_members WHERE exp_members.member_id='$member_id'";
    $r = mysql_query($query);
    $data = mysql_fetch_array ($r);
    echo ( isset($data['avatar_filename']) && !empty($data['avatar_filename']) )? '**website**/images/avatars/' : '**website**/themes/forum_themes/images/icon_profile.gif';
    ?>

    Of course php is allowed in my forum-templates and the parsing stage is on input. I did clear all caches and updated both my site and the forum to the latest version.

    The error I’m getting is:

    Notice: Use of undefined constant avatar_filename - assumed 'avatar_filename' in /home/.sites/70/site4/web/**system**/core/core.functions.php(637) : eval()'d code on line 12

    Thanks!!

  • #2 / Jan 02, 2009 6:28pm

    Sue Crocker

    26054 posts

    Ronny, look at this bit:

    $data[avatar_filename]

    It needs quotes around it like this:

    $data['avatar_filename']

    Make sense?

  • #3 / Jan 02, 2009 6:44pm

    Ronny

    83 posts

    Not to me because my php knowledge is limited. But it did work! So thank you very much!!

  • #4 / Jan 02, 2009 6:48pm

    Sue Crocker

    26054 posts

    No worries! Don’t hesitate to post again if needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases