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: Missin image  (Read 3305 times)

0 Members and 1 Guest are viewing this topic.

Visitor

  • Coppermine regular visitor
  • **
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 55
Missin image
« on: January 23, 2012, 04:10:41 pm »

Did I do anything wrong?

Guest album, last image shown on index (visitors)
Past Visitors, album made and old photos uploaded, now no more uploads here

those show a small photo (last uploaded)

However the album "Forum Members Personal Galleries" has no phone, just a link, when clicked shows all the albums that belong to registerd members

Anyway to fet a small image next to its link?
Logged

Visitor

  • Coppermine regular visitor
  • **
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 55
Re: Missin image
« Reply #1 on: January 23, 2012, 04:12:54 pm »

However the album "Forum Members Personal Galleries" has no phone

should say
However the album "Forum Members Personal Galleries" has no photo
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Missin image
« Reply #2 on: January 25, 2012, 10:50:25 am »

Open index.php, find
Code: [Select]
                $cat_data[]    = array($link, str_repeat($indent, $level-1) . $cat['details']['description'], $album_count, $pic_count, 'cat_albums' => $users);and replace with
Code: [Select]
                if ($cat['details']['thumb'] > 0) {
                    $sql = "SELECT filepath, filename, url_prefix, pwidth, pheight FROM {$CONFIG['TABLE_PICTURES']} AS p WHERE pid = {$cat['details']['thumb']} $FORBIDDEN_SET";
                    $result = cpg_db_query($sql);
                    if (mysql_num_rows($result)) {
                        $picture = mysql_fetch_assoc($result);
                        mysql_free_result($result);
                        $pic_url = get_pic_url($picture, 'thumb');
                        if (!is_image($picture['filename'])) {
                            $image_info = getimagesize(urldecode($pic_url));
                            $picture['pwidth'] = $image_info[0];
                            $picture['pheight'] = $image_info[1];
                        }
                        $image_size = compute_img_size($picture['pwidth'], $picture['pheight'], $CONFIG['alb_list_thumb_size']);
                        $user_thumb = "<img src=\"" . $pic_url . "\" class=\"image\" {$image_size['geom']} border=\"0\" alt=\"\" />";
                        $user_thumb = "<a href=\"index.php?cat={$cid}\">" . $user_thumb . "</a>";
                    } else {
                        $user_thumb = "";
                    }
                }
                $cat_data[]    = array($link, str_repeat($indent, $level-1) . $cat['details']['description'], $album_count, $pic_count, 'cat_albums' => $users, 'cat_thumb' => $user_thumb);


As there's no user interface to choose the thumbnail, you have to manually add the picture ID to the categories table in the database.
Logged

Visitor

  • Coppermine regular visitor
  • **
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 55
Re: Missin image
« Reply #3 on: January 27, 2012, 12:26:36 pm »

well that made it look right, however it shows last photo uploaded, which happend to be a guest :)

anyway to change it to any photo from any registerd member (last uploaded)

page shows last uploaded twice now, guest last uploaded
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Missin image
« Reply #4 on: January 27, 2012, 12:44:21 pm »

it shows last photo uploaded
As there's no user interface to choose the thumbnail, you have to manually add the picture ID to the categories table in the database.
Logged

Visitor

  • Coppermine regular visitor
  • **
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 55
Re: Missin image
« Reply #5 on: January 27, 2012, 10:32:50 pm »

so if i look at catagories in mysql there will be a space there? will it overwrite the mod i just did

thanks
Logged

Visitor

  • Coppermine regular visitor
  • **
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 55
Re: Missin image
« Reply #6 on: January 27, 2012, 11:40:08 pm »

ok, added an id and it works great

thanks !
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 20 queries.