avatar on userlist? avatar on userlist?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

avatar on userlist?

Started by DaBe, December 04, 2007, 10:01:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DaBe

helllo

how I can display the avatar from a user near the username on the userlist.

when an user dont have a avatar, should display a default avatar.


can me everyone help, pls?

Stramm


DaBe

do you have time to do this ? (i cant code php, only html and css...)

Stramm

This is not difficult... maybe I'll add that, I'm not sure about that yet

jsb207

I would really like this feature also.

dreams83

I had the MODpack by Stramm and PHPbb 2 integrate and managed to get the avatar from phpbb to display on the usermgr.php page with the following changes. Might or might not work for you.

    foreach ($users as $user) {
        if ($user['disk_usage'] == '') {
            $user['disk_usage'] = 0;
        }
        if ($user['user_active'] == 'NO') {
            $user['group_name'] = '<i>' . $lang_usermgr_php['inactive'] . '</i>';
        }
        $user['user_regdate'] = localised_date($user['user_regdate'], $register_date_fmt);
        if ($user['user_lastvisit']) {
            $user['user_lastvisit'] = localised_date($user['user_lastvisit'], $register_date_fmt);
        }
        else {
            $user['user_lastvisit'] = $lang_usermgr_php['never'];
        }

        $usr_link = '<a href="profile.php?uid=' . $user['user_id'] . '">' . $user['user_name'];
        if ($user['pic_count']) {
            $usr_link .= '</a> (<a href="thumbnails.php?album=lastupby&uid=' . $user['user_id'] . '">' . $lang_usermgr_php['latest_upload'] . '</a>)';
        } else {
            $usr_link .= '</a>';
        }
        //---------------------ADDED to make a link to the avatar---------------
        if ($CONFIG['enable_avatar']) {
   
            if (AVATAR_URL !="") $avatar_url = "<a href='avatar_manage.php'><img src='".AVATAR_PATH.AVATAR_URL."' class=\"image\"></a>";
            else $avatar_url="&nbsp;";
       
            if (isset($user['user_id'])) {
                $user_data1 = $cpg_udb->get_user_infos($user['user_id']);
                $avatar_url = $user_data1['avatar_url'];
                if ($avatar_url !=""){
                    if($user_data1['user_avatar_type']==3){
                        $avatar_url = "<img src='".AVATAR_PATH."gallery/".$avatar_url."' class=\"image\">";
                    }else if($user_data1['user_avatar_type']==2){
                        $avatar_url = "<img src='".$avatar_url."' class=\"image\">";
                    }
                    else{
                        $avatar_url = "<img src='".AVATAR_PATH.$avatar_url."' class=\"image\">";
                    }
                }
               
               
               
            }
            if($avatar_url==""){
                $avatar_url = "<img src='images/stamp.gif' class=\"image\">";
            }
        }
        //----------------------END avatar ---------------------------------


        if (!$lim_user) {
                if ($user['user_id'] == $USER_DATA['user_id']) {
                    $profile_link = 'profile.php?op=edit_profile';
                    $checkbox_html = '';
                } else {
                    $profile_link = $_SERVER['PHP_SELF'].'?op=edit&user_id='.$user['user_id'];
                    $checkbox_html = '<input name="u'.$user['user_id'].'" '.$makereadonly.'type="checkbox" value="" class="checkbox" />';
                }
               
                echo <<< EOT
        <tr>
                <td class="tableb" align="center">$checkbox_html</td>
                <td class="tableb">$usr_link<br/><a href="forum/profile.php?mode=viewprofile&u={$user['user_id']}" target="_blank">$avatar_url</a></td>
                <td class="tableb" align="center">
                    <button type="button" class="button" {$makereadonly}onclick="window.location.href ='$profile_link';">
                        <img src="images/edit.gif" width="16" height="16" border="0" alt="" title="{$lang_usermgr_php['edit']}" />
                    </button>
                </td>
                <td class="tableb">{$user['group_name']}</td>
                <td class="tableb">{$user['user_regdate']}</td>
                <td class="tableb">{$user['user_lastvisit']}</td>
                <td class="tableb" align="right">{$user['pic_count']}</td>
                <td class="tableb" align="right">{$user['disk_usage']}&nbsp;{$lang_byte_units[1]}</td>
                <td class="tableb" align="right">{$user['group_quota']}&nbsp;{$lang_byte_units[1]}</td>
        </tr>

EOT;
        } else {
                  echo <<< EOT
        <tr>
                <td class="tableb">$usr_link<br/><a href="forum/profile.php?mode=viewprofile&u={$user['user_id']}" target="_blank">$avatar_url</a></td>
                <td class="tableb">{$user['group_name']}</td>
                <td class="tableb">{$user['user_regdate']}</td>
                <td class="tableb">{$user['user_lastvisit']}</td>
                <td class="tableb" align="right">{$user['pic_count']}</td>
                <td class="tableb" align="right">{$user['disk_usage']}&nbsp;{$lang_byte_units[1]}</td>
                <td class="tableb" align="right">{$user['group_quota']}&nbsp;{$lang_byte_units[1]}</td>
        </tr>

EOT;


Hopefully that will help someone change it to match their setup :)

dumbo

Quote from: dreams83 on March 14, 2008, 12:58:46 AM
I had the MODpack by Stramm and PHPbb 2 integrate and managed to get the avatar from phpbb to display on the usermgr.php page with the following changes. Might or might not work for you.

    foreach ($users as $user) {
        if ($user['disk_usage'] == '') {
            $user['disk_usage'] = 0;
        }
        if ($user['user_active'] == 'NO') {
            $user['group_name'] = '<i>' . $lang_usermgr_php['inactive'] . '</i>';
        }
        $user['user_regdate'] = localised_date($user['user_regdate'], $register_date_fmt);
        if ($user['user_lastvisit']) {
            $user['user_lastvisit'] = localised_date($user['user_lastvisit'], $register_date_fmt);
        }
        else {
            $user['user_lastvisit'] = $lang_usermgr_php['never'];
        }

        $usr_link = '<a href="profile.php?uid=' . $user['user_id'] . '">' . $user['user_name'];
        if ($user['pic_count']) {
            $usr_link .= '</a> (<a href="thumbnails.php?album=lastupby&uid=' . $user['user_id'] . '">' . $lang_usermgr_php['latest_upload'] . '</a>)';
        } else {
            $usr_link .= '</a>';
        }
        //---------------------ADDED to make a link to the avatar---------------
        if ($CONFIG['enable_avatar']) {
   
            if (AVATAR_URL !="") $avatar_url = "<a href='avatar_manage.php'><img src='".AVATAR_PATH.AVATAR_URL."' class=\"image\"></a>";
            else $avatar_url="&nbsp;";
       
            if (isset($user['user_id'])) {
                $user_data1 = $cpg_udb->get_user_infos($user['user_id']);
                $avatar_url = $user_data1['avatar_url'];
                if ($avatar_url !=""){
                    if($user_data1['user_avatar_type']==3){
                        $avatar_url = "<img src='".AVATAR_PATH."gallery/".$avatar_url."' class=\"image\">";
                    }else if($user_data1['user_avatar_type']==2){
                        $avatar_url = "<img src='".$avatar_url."' class=\"image\">";
                    }
                    else{
                        $avatar_url = "<img src='".AVATAR_PATH.$avatar_url."' class=\"image\">";
                    }
                }
               
               
               
            }
            if($avatar_url==""){
                $avatar_url = "<img src='images/stamp.gif' class=\"image\">";
            }
        }
        //----------------------END avatar ---------------------------------


        if (!$lim_user) {
                if ($user['user_id'] == $USER_DATA['user_id']) {
                    $profile_link = 'profile.php?op=edit_profile';
                    $checkbox_html = '';
                } else {
                    $profile_link = $_SERVER['PHP_SELF'].'?op=edit&user_id='.$user['user_id'];
                    $checkbox_html = '<input name="u'.$user['user_id'].'" '.$makereadonly.'type="checkbox" value="" class="checkbox" />';
                }
               
                echo <<< EOT
        <tr>
                <td class="tableb" align="center">$checkbox_html</td>
                <td class="tableb">$usr_link<br/><a href="forum/profile.php?mode=viewprofile&u={$user['user_id']}" target="_blank">$avatar_url</a></td>
                <td class="tableb" align="center">
                    <button type="button" class="button" {$makereadonly}onclick="window.location.href ='$profile_link';">
                        <img src="images/edit.gif" width="16" height="16" border="0" alt="" title="{$lang_usermgr_php['edit']}" />
                    </button>
                </td>
                <td class="tableb">{$user['group_name']}</td>
                <td class="tableb">{$user['user_regdate']}</td>
                <td class="tableb">{$user['user_lastvisit']}</td>
                <td class="tableb" align="right">{$user['pic_count']}</td>
                <td class="tableb" align="right">{$user['disk_usage']}&nbsp;{$lang_byte_units[1]}</td>
                <td class="tableb" align="right">{$user['group_quota']}&nbsp;{$lang_byte_units[1]}</td>
        </tr>

EOT;
        } else {
                  echo <<< EOT
        <tr>
                <td class="tableb">$usr_link<br/><a href="forum/profile.php?mode=viewprofile&u={$user['user_id']}" target="_blank">$avatar_url</a></td>
                <td class="tableb">{$user['group_name']}</td>
                <td class="tableb">{$user['user_regdate']}</td>
                <td class="tableb">{$user['user_lastvisit']}</td>
                <td class="tableb" align="right">{$user['pic_count']}</td>
                <td class="tableb" align="right">{$user['disk_usage']}&nbsp;{$lang_byte_units[1]}</td>
                <td class="tableb" align="right">{$user['group_quota']}&nbsp;{$lang_byte_units[1]}</td>
        </tr>

EOT;


Hopefully that will help someone change it to match their setup :)

Thanks i would add this part

DaBe

wow..thats nice, exactly that what I search! Can everyone make that for cpg without phpbb...I have tried, but dont worked..

sry for my english...