coppermine-gallery.com/forum

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: Walkinman on January 23, 2012, 03:40:33 AM

Title: Category and display random files
Post by: Walkinman on January 23, 2012, 03:40:33 AM
hello Folks

One thing that would be great, if it's possible, is in each category, to have the option to display a certain number of photos form the albums in that category under the listing of the albums:

If you look here:

http://www.skolaiimages.com/stock/index-4.html

you see the list of albums with a title and description of each, with a thumbnail - 11 in total.Is it possible to then have a random display of say up to 50 or 100 thumbnails in a new section, under the album titles; thumbnails randomly selected from those albums. So the container with all the albums, and then another container with a bunch of thumbnails selected (randomly would be fine) from those albums.

It would just give a lot more weight to the search engine ranking of the category pages. Right now, categories don't seem to rank well because they don't display enough content; just a single thumb and title for each album.

Do you know if this would be possible?

Thanks so much

Cheers

Carl
Title: Re: Category and display random files
Post by: Αndré on January 23, 2012, 09:17:16 AM
Just add the random meta album to The content of the main page (http://documentation.coppermine-gallery.net/en/configuration.htm#admin_album_list_content).
Title: Re: Category and display random files
Post by: Walkinman on January 23, 2012, 10:01:08 AM
Hey André

Awesome, that does it .. but then it also does that for the home page .. is there a way to make this work ONLY for the Category pages, not the home page? as is, the home page is a bit heavy.

Thanks for your help.

cheers

Carl
Title: Re: Category and display random files
Post by: Αndré on January 23, 2012, 10:04:54 AM
Open index.php, find
display_thumbnails($matches[1], $cat, 1, $CONFIG['thumbcols'], max(1, $matches[2]), false);
and replace with
                    if ($superCage->get->keyExists('cat') && $superCage->get->getInt('cat') > 0) {
                        display_thumbnails($matches[1], $cat, 1, $CONFIG['thumbcols'], max(1, $matches[2]), false);
                    }
Title: Re: Category and display random files
Post by: Walkinman on January 23, 2012, 10:17:40 AM
Hey André

You're awesome! 4 minutes! Thanks so much. That works.

I notice I'm getting this error in my debug info:

/themes/water_drop/theme.php
Notice line 599: Use of undefined constant album - assumed 'album'
Notice line 605: Use of undefined constant album - assumed 'album'
/include/functions.inc.php
Warning line 4152: ksort() expects parameter 1 to be array, null given
Warning line 4162: Invalid argument supplied for foreach()
Warning line 4152: ksort() expects parameter 1 to be array, null given
Warning line 4183: Invalid argument supplied for foreach()
/index.html
Warning line 1075: sprintf() [function.sprintf]: Too few arguments
Warning line 1075: sprintf() [function.sprintf]: Too few arguments
Warning line 1075: sprintf() [function.sprintf]: Too few arguments


The last one 'too few arguments' is repeated many many times.

I'm not sure if any of this is related to these changes. But it all seems to be working fine. Thanks so much.

Cheers

Carl
Title: Re: Category and display random files
Post by: Αndré on January 23, 2012, 10:34:47 AM
From the docs:
Quote from: http://documentation.coppermine-gallery.net/en/configuration.htm#admin_misc_debug_noticesleave notices_display off if it doesn't mean anything to you
Title: Re: Category and display random files
Post by: Walkinman on January 23, 2012, 10:55:49 AM
Hey André

Ha ha .. I looked around for some info on the error here and found a bunch of posts all saying the same .. so I turned it off. I just wasn't sure if that was something that was caused by the code changes above, but apparently not (I toggled between them and no difference) .. that's all.

Thanks again man, I really appreciate it.

Cheers

Carl
Title: Re: Category and display random files
Post by: BT755 on February 20, 2012, 11:29:45 PM
posted in wrong thread.

Hi. Got here from a random google. But the topic is exactly what I want to do from several folders in xp. Search for say 200 files from 50 directories, and then display them as thumbnails in a random order. I cannot find anything that will do this (apart from maybe an upgrade to window 7)
Title: Re: Category and display random files
Post by: Αndré on March 01, 2012, 02:33:07 PM
Sorry, but this is the support board of an web gallery, not Windows.


Locking.