Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Picture from user in userdetails/userprofile  (Read 3529 times)

0 Members and 1 Guest are viewing this topic.

Jobri

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Picture from user in userdetails/userprofile
« 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.
Logged

RatKing

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Personal website
Re: Picture from user in userdetails/userprofile
« Reply #1 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  ;))
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Picture from user in userdetails/userprofile
« Reply #2 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.
Logged

RatKing

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Personal website
Re: Picture from user in userdetails/userprofile
« Reply #3 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.
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.