forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Themes/Skins/Templates => Topic started by: ve.ru on October 17, 2004, 07:01:04 pm

Title: thumbnail for a catagory
Post by: ve.ru on October 17, 2004, 07:01:04 pm
Hi,

is there a way to show a thumbnail for each category, not only the category name?

thx,
Verena
Title: Re: thumbnail for a catagory
Post by: ve.ru on October 17, 2004, 07:42:46 pm
Sorry, I was blind...
Verena
Title: Re: thumbnail for a catagory
Post by: Tranz on October 17, 2004, 07:46:43 pm
Does your last post mean that you found the answer?
Title: Re: thumbnail for a catagory
Post by: ve.ru on October 17, 2004, 08:27:17 pm
Yes, I found the anwser.

Or not. I just thought. Is it right that this is only possible für categories which have no subcategories?
Title: Re: thumbnail for a catagory
Post by: Casper on October 17, 2004, 09:06:02 pm
No, it is possible for all categories, providing they have at least 1 pic somewhere in them.
Title: Re: thumbnail for a catagory
Post by: ve.ru on October 17, 2004, 09:37:50 pm
this means for all categories, which includ at least one album. I can't use a pic from a album of a subcategory, right?
Title: Re: thumbnail for a catagory
Post by: gorcutt on November 13, 2004, 04:54:17 pm
this means for all categories, which includ at least one album. I can't use a pic from a album of a subcategory, right?
I was looking for a way to avoid this. I have a category with subcategories, but the first one doesn't have any album and I wish I could add a thumbnail to it. If someone knows the answer for this I would be very grateful.
Title: Re: thumbnail for a catagory
Post by: ve.ru on November 13, 2004, 05:37:14 pm
It is possible to use any picture for a thumbnail, but not within the coppermine admin area. If you are used to phpMyAdmin or any other MySQL client look in the table 'pictures' for the picture you'd like to use and remeber the value in the column 'pid'. Change to the table 'categories', look for the category you wish to select the thumbnail for and enter in the field 'thumb' the value you remembered. Now this is your new thumbnail.
regards,
verena

Title: Re: thumbnail for a catagory
Post by: gorcutt on November 14, 2004, 04:44:33 am
Hey Verena, thanks for the reply, but even filling the thumb field with the thumb pid number it doesn't work. Nothing shows for the category thumb. I must remember that I only have subcategories inside this one, and no album.
Thanks.
Title: Re: thumbnail for a catagory
Post by: ve.ru on November 14, 2004, 11:30:42 pm
Hi,
I'm sorry but this worked on my page. Just to be sure: you didn't make any changes to your theme which interfere with the category thumb? Create an album in this category, upload one pic, select it as thumbnail in the admin area and ascertain yourself of the correct output.
regards,
Verena
Title: Re: thumbnail for a catagory
Post by: gorcutt on November 15, 2004, 12:04:33 am
Hey Verena, the thumbnail shows fine for a category with an album in it, but not without an album. So, in my case I have a category with no albums in it, below it a sub category, and finally some albums. What I'm looking for is a way to show a thumbnail for the first category on the hierarchy, and this one, even filling the picture ID on the DB, the thumb doesn't show on the page.
Thanks,
Guilherme
Title: Re: thumbnail for a catagory
Post by: ve.ru on November 15, 2004, 09:30:29 am
Sorry I forgot something: is the name of the category shown or is it hidden at all?
normally only categories are shown which have at least one pic or one album. If you want to show every category regardles of pictures and albums you have to change index.php:

search for the line
Code: [Select]
if ($pic_count == 0 && $album_count == 0) {
and comment some lines out. Afterwards it should look like this:
Code: [Select]
                // to show all categories - whether there are albums or not
//if ($pic_count == 0 && $album_count == 0) {
// $user_thumb = $ident;
                //    $cat_data[] = array($link, $subcat['description'],'cat_thumb' =>$user_thumb);
                //} else {
                    // Check if you need to show subcat_level
                    if ($level == $CONFIG['subcat_level']) {
                        $cat_albums = list_cat_albums($subcat['cid']);
                    } else {
                        $cat_albums = '';
                    }
                    $cat_data[] = array($link, $subcat['description'], $album_count, $pic_count, 'cat_albums' => $cat_albums,'cat_thumb' =>$user_thumb);
                //}

On my site I have albums in each categorie, but I wanted to use another pictures which weren't shown in the admin area. Perhaps this makes a difference but if this doesn't work I don't have another idea.

verena
Title: Re: thumbnail for a catagory
Post by: Casper on November 15, 2004, 01:28:53 pm
Sorry I forgot something: is the name of the category shown or is it hidden at all?
normally only categories are shown which have at least one pic or one album. If you want to show every category regardles of pictures and albums you have to change index.php:

Not quite correct.  It is only the 'user galleries' category that is hidden if empty.  Standard admin created categories are shown all the time.

Title: Re: thumbnail for a catagory
Post by: gorcutt on November 15, 2004, 06:42:42 pm
The name of the category appears on the page, but only the name and the description. No thumbnail though. On the inner categories with albums in them, everything is ok, only the 'outer' category without an explicit album within doesn't show the thumb.
Thanks.