Picture from user in userdetails/userprofile Picture from user in userdetails/userprofile
 

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

Picture from user in userdetails/userprofile

Started by Jobri, August 23, 2005, 09:05:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jobri

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.

RatKing

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  ;))

Joachim Müller

there already are mods that let you do similar things, please browse the mods section. Feature is being considered for the future.

RatKing

Or do the following....

Replace the code shown below found in usermgr.php (function edit_user)

    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:

   $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.