Category and display random files Category and display random files
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Category and display random files

Started by Walkinman, January 23, 2012, 03:40:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Walkinman

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

Αndré


Walkinman

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

Αndré

#3
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);
                    }

Walkinman

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

Αndré


Walkinman

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

BT755

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)

Αndré

Sorry, but this is the support board of an web gallery, not Windows.


Locking.