Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: avatar on userlist?  (Read 6824 times)

0 Members and 1 Guest are viewing this topic.

DaBe

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 110
avatar on userlist?
« 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?
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: avatar on userlist?
« Reply #1 on: December 05, 2007, 07:54:24 am »

this needs to be coded

DaBe

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 110
Re: avatar on userlist?
« Reply #2 on: January 25, 2008, 08:05:38 pm »

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

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: avatar on userlist?
« Reply #3 on: January 27, 2008, 11:44:25 am »

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

jsb207

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: avatar on userlist?
« Reply #4 on: February 05, 2008, 12:03:18 am »

I would really like this feature also.
Logged

dreams83

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 54
Re: avatar on userlist?
« Reply #5 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 :)
Logged

dumbo

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 112
Re: avatar on userlist?
« Reply #6 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
Logged

DaBe

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 110
Re: avatar on userlist?
« Reply #7 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...
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 20 queries.