Advanced search  

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

Pages: [1]   Go Down

Author Topic: Category and display random files  (Read 3829 times)

0 Members and 1 Guest are viewing this topic.

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Category and display random files
« 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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Category and display random files
« Reply #1 on: January 23, 2012, 09:17:16 am »

Just add the random meta album to The content of the main page.
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: Category and display random files
« Reply #2 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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Category and display random files
« Reply #3 on: January 23, 2012, 10:04:54 am »

Open index.php, find
Code: [Select]
display_thumbnails($matches[1], $cat, 1, $CONFIG['thumbcols'], max(1, $matches[2]), false);and replace with
Code: [Select]
                    if ($superCage->get->keyExists('cat') && $superCage->get->getInt('cat') > 0) {
                        display_thumbnails($matches[1], $cat, 1, $CONFIG['thumbcols'], max(1, $matches[2]), false);
                    }
« Last Edit: January 23, 2012, 10:16:48 am by Αndré »
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: Category and display random files
« Reply #4 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:

Code: [Select]
/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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Category and display random files
« Reply #5 on: January 23, 2012, 10:34:47 am »

From the docs:
leave notices_display off if it doesn't mean anything to you
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: Category and display random files
« Reply #6 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
Logged

BT755

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Category and display random files
« Reply #7 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)
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Category and display random files
« Reply #8 on: March 01, 2012, 02:33:07 pm »

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


Locking.
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.