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: [Solved]: Overrides the number of rows for album list  (Read 2360 times)

0 Members and 1 Guest are viewing this topic.

cimona

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
    • Simona Mar
[Solved]: Overrides the number of rows for album list
« on: March 15, 2009, 08:17:53 am »

Hi guys,
I am using 2 diffrent themes in my website and for one category i would like to override the number of albums listed.
In my main page by configuration are listed only 2 because otherwise is making the index page very long and doesn't look nice.
But i use the second theme for a category and there i would like to be listed more albums then 2.
I am a BIG noobie with php, by using Coppermine is the first time i came across with php so i dont really know what i am doing.
Looking in diffrent themes i found in one of them i think oranje .. not sure, at the top of theme.php saying:

$CONFIG['thumbcols'] = 3;   //overrides the number of columns for thumbnails set in the admin configuration

I tried to find a way of changing the numbers of rows for alblist but no success. :(
I am not even sure if works the same for the alblist, so any answer will be a big help.
Thank you
P.S. i hope my questions is in the right place :)
« Last Edit: March 15, 2009, 05:33:10 pm by Joachim Müller »
Logged

Nibbler

  • Guest
Re: Overrides the number of rows for album list
« Reply #1 on: March 15, 2009, 04:19:26 pm »

Try using

Code: [Select]
$CONFIG['albums_per_page']
Logged

cimona

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
    • Simona Mar
Re: Overrides the number of rows for album list
« Reply #2 on: March 15, 2009, 04:59:15 pm »

Thanks alot Nibbler :)
In case someone else need this code.. change include/init.inc.php and /themes/your-second-theme.php

In the file init.inc.php search for // Load theme file and after the code:
Code: [Select]
// Load theme file
if (isset($USER['theme']) && !strstr($USER['theme'], '/') && is_dir('themes/' . $USER['theme'])) {
        $CONFIG['theme'] = strtr($USER['theme'], '$/\\:*?"\'<>|`', '____________');
} else {
        unset($USER['theme']);
}

add
Code: [Select]
if (isset($_GET['cat']) && !empty($_GET['cat'])) {
  if ((int)$_GET['cat'] == 2) {
    $CONFIG['theme'] = 'your-second-theme';
  }
}

2 is the category i needed to change
And thanks to this topic i managed to change the themes http://forum.coppermine-gallery.net/index.php/topic,15002.0.html


And in my second theme.php i added at the top of the page, before the first //HTML theme for..

Code: [Select]
$CONFIG['albums_per_page']= 5;   //overrides the number of albums listed in the admin configuration
Thank you again Nibbler!!




Logged
Pages: [1]   Go Up
 

Page created in 0.015 seconds with 15 queries.