1

Topic: show members avatar on phpbb3

I search the forum and can't find any information on how to include members avatar on phpbb3 using vld 2.7

VPS & Dedicated Hosting Servint

2

Re: show members avatar on phpbb3

I am no expert, but I don't think this is an easy thing to achieve.

However, I am very interested in this as well.

I would be willing to pay for a mod like this.

3

Re: show members avatar on phpbb3

I found this posting from another user but I don't think is working on vld 2.7

jensrenner wrote:

Hey, this is my first post, and I'd like to start with a small "mod" ... this one shows vldpersonals avatars in phpBB3.
I modified some things in mod.phpbb3.php:

In function mod_phpbb3_add_member(), change

    $result = $DB->query("SELECT username, password, email, lastvisit, joindate, ipaddress, picture, picture_active FROM  " . DB_PREFIX . "members WHERE member_id='" . $params['member_id'] . "' LIMIT 1");

add

    if ($user_data['picture_active']) {
        $user_avatar = mod_phpbb3_get_avatar($user_data['joindate'], mysql_real_escape_string($user_data['picture']), $params['member_id']);
        $user_avatar_type = "2";
    } else {
        $user_avatar = '';
        $user_avatar_type = "0";
    }

change

    $where_sql = "SET group_id=2,
        username = '" . $user_data['username'] . "',
        username_clean = '" . strtolower($user_data['username']) . "',
        user_password = '{$user_data['password']}',
        user_passchg = '{$user_data['lastvisit']}',
        user_email = '{$user_data['email']}',
        user_type = {$user_data['inactive']},
        user_inactive_reason = {$user_data['inactive']},
        user_regdate = '{$user_data['joindate']}',
        user_lastmark = '{$user_data['lastvisit']}',
        user_avatar = '{$user_avatar}',
        user_avatar_type = '{$user_avatar_type}',
        user_avatar_width = '100',
        user_avatar_height = '100',
        user_lastvisit = '{$user_data['lastvisit']}'";

Also add a new function:

function mod_phpbb3_get_avatar($joindate, $image, $id)
{
    $media = substr($joindate, -1, 1).'/'.
    substr($joindate, -2, 1).'/'.
    substr($joindate, -3, 1).'/'.
    substr($joindate, -4, 1).'/'.
    $id.'/'; 
    return '/v2/media/uploads/'.$media.'t_photo_'.$image;
}

That's it. Adapt to your path, and you should be ready to go. (Of course, external avatars have to be activated in phpbb3.) What do you think?

VPS & Dedicated Hosting Servint

4

Re: show members avatar on phpbb3

I know a lot of you have phpbb3 install with the avatar working, do you mind sharing please.

thanks

VPS & Dedicated Hosting Servint

5

Re: show members avatar on phpbb3

I try changing this code but no luck

viewtopic.php from this


                'avatar'            => ($user->optionget('viewavatars')) ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height']) : '',


to this

                'avatar'        => '<img src="http://www.domian.com/viewthumb.php?user='.$row['username'].'" />',

Anyone?

Last edited by thejackal (2012-01-28 13:26:15)

VPS & Dedicated Hosting Servint