forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 modpack by Stramm => Topic started by: DaBe on December 04, 2007, 10:01:20 pm

Title: avatar on userlist?
Post by: DaBe on December 04, 2007, 10:01:20 pm
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?
Title: Re: avatar on userlist?
Post by: Stramm on December 05, 2007, 07:54:24 am
this needs to be coded
Title: Re: avatar on userlist?
Post by: DaBe on January 25, 2008, 08:05:38 pm
do you have time to do this ? (i cant code php, only html and css...)
Title: Re: avatar on userlist?
Post by: Stramm on January 27, 2008, 11:44:25 am
This is not difficult... maybe I'll add that, I'm not sure about that yet
Title: Re: avatar on userlist?
Post by: jsb207 on February 05, 2008, 12:03:18 am
I would really like this feature also.
Title: Re: avatar on userlist?
Post by: 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.

Code: [Select]
    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 :)
Title: Re: avatar on userlist?
Post by: dumbo on March 18, 2008, 07:09: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.

Code: [Select]
    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
Title: Re: avatar on userlist?
Post by: DaBe on March 21, 2008, 05:35:10 pm
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...