Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: different number of categories depending on page  (Read 2649 times)

0 Members and 1 Guest are viewing this topic.

macmiller

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 80
different number of categories depending on page
« on: August 13, 2011, 04:36:40 pm »

There is a config item: Number of levels of categories to display which indicates the depth of categories to display.  I would like to modify the behavior slightly, on the initial 'front page' index.php I would like to have one level of categories displayed and on other 'drill down' pages a different level.  (ie. on index.php say the level is 1 and in index.php?cat=xx say the level is 4).

Is there a way to tell from within the script index.php whether or not we are on the front page (index.php) or on another page?  Any suggestions on the easiest way to accomplish this mod?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: different number of categories depending on page
« Reply #1 on: August 15, 2011, 11:13:41 am »

Open index.php, find
Code: [Select]
if ($superCage->get->keyExists('cat')) {
    $cat = $superCage->get->getInt('cat');
}
and below, add
Code: [Select]
$CONFIG['subcat_level'] = $cat ? 4 : 1;
Logged

macmiller

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 80
Re: different number of categories depending on page
« Reply #2 on: August 19, 2011, 03:39:11 pm »

Andre:  this worked, thanks ;D
Logged
Pages: [1]   Go Up
 

Page created in 0.076 seconds with 19 queries.