forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: THIS ACCOUNT IS NO LONGER IN USE on January 04, 2005, 12:08:29 pm

Title: How to change the thumbnail representing an user ?
Post by: THIS ACCOUNT IS NO LONGER IN USE on January 04, 2005, 12:08:29 pm
In the "Home > User Galleries" page (http://....../gallery/index.php?cat=1) there are users represented by thumbnails. I have to admit I am unable to change my thumbnail and must ask for help. This is not an album thumbnail that can be easily changed in the album properties.  Thank you in advance.

Harvey
Title: Re: How to change the thumbnail representing an user ?
Post by: Nibbler on January 04, 2005, 01:56:13 pm
Can you post a link to your site please.
Title: Re: How to change the thumbnail representing an user ?
Post by: THIS ACCOUNT IS NO LONGER IN USE on January 04, 2005, 03:56:01 pm
Unfortunately you cannot visit this gallery. The server is behind a firewall and not reachable from Internet.

The thumbnail in question seems to be the last uploaded file to any of the user's albums. I want to change it but don't know how.

Harvey
Title: Re: How to change the thumbnail representing an user ?
Post by: Nibbler on January 04, 2005, 04:27:17 pm
Should be in album properties, dropdown box to select 'Album thumbnail'. Make sure you are using latest stable version, currently 1.3.2
Title: Re: How to change the thumbnail representing an user ?
Post by: THIS ACCOUNT IS NO LONGER IN USE on January 04, 2005, 10:20:31 pm
Thank you for the reply, but as I wrote it is not an album that's why there are no album properties. I think it was called sub-category in one of the posts here.  Look at the demo gallery at http://coppermine.sourceforge.net/demo/index.php?cat=1 - how could one change the thumbnail close to the "Oasis, 1 album, 1 picture" there ?

My gallery is freshly installed 1.3.2 version.

Harvey
Title: Re: How to change the thumbnail representing an user ?
Post by: Joachim Müller on January 05, 2005, 01:35:49 am
the thumb that represents a user (cat) in user galleries can't be changed currently afaik.

Joachim
Title: Re: How to change the thumbnail representing an user ?
Post by: THIS ACCOUNT IS NO LONGER IN USE on January 06, 2005, 10:43:45 am
If it cannot be changed, could you please tell which lines of code are responsible for that thumbnail ? I'll try to change it.  "Click here" is better than a thumbnail of an ugly spider from the close-up gallery. Thank you.
Title: Re: How to change the thumbnail representing an user ?
Post by: Nibbler on January 06, 2005, 04:52:56 pm
It's this query here I think, in index.php

Code: [Select]
        $sql = "SELECT user_id, " .
               "user_name, " .
               "COUNT(DISTINCT a.aid) as alb_count, " .
               "COUNT(DISTINCT pid) as pic_count, " .
               "MAX(pid) as thumb_pid " .
               "FROM {$CONFIG['TABLE_USERS']} AS u " .
               "INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON category = " . FIRST_USER_CAT . " + user_id " .
               "LEFT JOIN {$CONFIG['TABLE_PICTURES']} AS p ON (p.aid = a.aid AND approved = 'YES') ";

It's taking the max(pid) (ie. last uploaded pic) to use as the thumbnail pic.
Title: Re: How to change the thumbnail representing an user ?
Post by: THIS ACCOUNT IS NO LONGER IN USE on January 06, 2005, 08:45:52 pm
Thank you for the hint.

I did the following:
in the line 328: $user_thumb = '<img src="images/nopic.jpg" class="image" border="0" />
changed the default "nopic.jpg" to "gallery.jpg" which I prepared and copied to the images directory
and commented out the line 346: $user_thumb = "<img src=\"" . get_pic_url($picture        , 'thumb') . " .....

Now is the general "gallery.jpg" thumbnail representing all users' galleries. Not a real solution, but it is OK for me. Yes, It's just a stupid hack, but I do not know PHP.

Thanks and good bye

Harvey