forum.coppermine-gallery.net

No Support => Feature requests => Topic started by: Jobri on August 23, 2005, 09:05:32 pm

Title: Picture from user in userdetails/userprofile
Post by: Jobri on August 23, 2005, 09:05:32 pm
I gess it would be nice if I can see a picture of every user.
every user can upload pictures in own albums why can't they link a photo of his/her own in the userprofiile.
and a window to discribe yourself where also a nice feature.
Title: Re: Picture from user in userdetails/userprofile
Post by: RatKing on August 26, 2005, 03:45:54 pm
I guess I have recently created some such thingy for a client who is still to pay for it >:(

Anyway I would need to make a little change to the code, as the complete mod included a lot more specialized things not usefull for the average CPG user. But it will do exactly as you described....

I'll see about posting this over the weekend some where (if my girlfriend will let me play with the computer for a little while  ;))
Title: Re: Picture from user in userdetails/userprofile
Post by: Joachim Müller on August 26, 2005, 05:35:23 pm
there already are mods that let you do similar things, please browse the mods section. Feature is being considered for the future.
Title: Re: Picture from user in userdetails/userprofile
Post by: RatKing on August 30, 2005, 12:05:18 pm
Or do the following....

Replace the code shown below found in usermgr.php (function edit_user)
Code: [Select]
    starttable(500, $lang_usermgr_php['modify_user'], 2);
    echo <<<EOT
        <form method="post" action="$PHP_SELF?op=update&user_id=$user_id">

EOT;

With this bit:
Code: [Select]
   $user_thumb = '';
   if ($picture_count) {
       $sql = "SELECT filepath, filename, url_prefix, pwidth, pheight " . "FROM {$CONFIG['TABLE_PICTURES']} " . "WHERE pid='" . $thumb_pid . "'";
       $result = db_query($sql);
       if (mysql_num_rows($result)) {
           $picture = mysql_fetch_array($result);
           mysql_free_result($result);
           $pic_url =  get_pic_url($picture, 'normal');
           if (!is_image($picture['filename'])) {
                   $image_info = getimagesize($pic_url);
                   $picture['pwidth'] = $image_info[0];
                   $picture['pheight'] = $image_info[1];
           }
           $image_size = compute_img_size($picture['pwidth'], $picture['pheight'], $CONFIG['picture_width']);
           $mime_content = get_type($picture['filename']);
           $user_thumb = '<img src="' . $pic_url . '" class="image"'
                       . 'width="'.$image_size['width'].'" height="'.$image_size['height'].'" border="0" alt="">';
           $user_thumb = '<td valign="top" align="center">'
                       . '<a href="thumbnails.php?album=lastupby&uid=' . $uid . '">'
                       . $user_thumb
                       . '</a></td>';
       }
   }
   $quick_jump = ($user_thumb . $lastcom) ? '<table width="100%" border="0" cellspacing="5"><tr>' . $user_thumb . $lastcom . '</tr></table>' : '';
   echo <<<EOT
       <form method="post" action="$PHP_SELF?op=update&user_id=$user_id">
        <td valign="top" colspan="2" class="thumbnails" align="center">
         <table width="100%" cellpadding="0" cellspacing="0">
           <tr>
            <td align="center">{$quick_jump}</td>
           </tr>
          </table>
         </td>
EOT;

And you will get a simple image from the user at the top of the user screen.