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: Album Column settings different for main page?  (Read 2738 times)

0 Members and 1 Guest are viewing this topic.

DjMikeWatt

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Album Column settings different for main page?
« on: June 17, 2006, 04:12:13 am »

I like only having 2 columns and 1 row per category on my MAIN page.
(http://ftp://www.mikewattsplayground.net/myspace/pictures/columns1.bmp)
But, once the user clicks on the name of the category, I would like to have all of them show up on the "albums" page. (2 columns, as many rows as needed).... as far as I can tell I am stuck with only 2 albums showing up even within the specific category page...
(http://ftp://www.mikewattsplayground.net/myspace/pictures/columns2.bmp)
has anyone else come into this?  Anyone come up with a work-around?
« Last Edit: June 17, 2006, 04:18:19 am by DjMikeWatt »
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: Album Column settings different for main page?
« Reply #1 on: June 17, 2006, 05:10:45 am »

From a quick look, I don't see how to do this without hacking index.php (or creating a plugin that effectively replaces a function of index.php, like CPGOCat).

So here's the quick hack.  In function list_albums, replace this line:
Code: [Select]
$alb_per_page = $CONFIG['albums_per_page'];with these lines:
Code: [Select]
// MOD - more albums per page on category listings
$alb_per_page = ($cat > 0 ? 100 : $CONFIG['albums_per_page']);
// MOD - original line below
// $alb_per_page = $CONFIG['albums_per_page'];
where you can put whatever number you want, here it's 100.

I recommend doing what I show above, instead of merely replacing the one line.  That way, you can easily search for "// MOD " to find all the hacks you made, when you are upgrading and having to re-apply those hacks.

You might do the same for the function list_cat_albums, depending upon whether you want subcategories to show more albums or not.
Logged

DjMikeWatt

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Re: Album Column settings different for main page?
« Reply #2 on: June 17, 2006, 06:11:47 am »

First of all, you rock... always with the answers!

I have a question about this mod... I did it, but it changes the number of albums on the main page, too - the idea was to allow the main page to stay having 2 per category, but then with in the category view to have the entire category available...

is there something that I am missing?  The new code is currently in (with the default 100 value) at

http://www.ferrallpictures.net

Maybe you'll see something.... right now I am at home and my laptop at home has a severe problem with dealing with this gallery script - cookies & such don't work properly, my work computer does it fine.  My point is that I don't really trust what I'm seeing on my laptop... maybe it IS working properly and I just can't see it cuz my laptop sucks, ya know?
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: Album Column settings different for main page?
« Reply #3 on: June 17, 2006, 06:26:32 am »

The albums shown on your main page are all in subcategories, so you need to make the mod I posted to the function list_cat_albums.  That's the function that shows "first level albums on main page" (whatever that config option is called). 

The function list_albums shows albums when on a category page or uncategorized albums on the main page, so really the only way you'd see the effect on the main page is if you had uncategorized albums.
Logged

DjMikeWatt

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Re: Album Column settings different for main page?
« Reply #4 on: June 17, 2006, 10:02:39 pm »

I'm not very much of a programmer... would you mind spelling it out for me like you did with the first example?  I kind of need to be lead here... Replacing "x" with "y", ya know?
Logged

DjMikeWatt

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Re: Album Column settings different for main page?
« Reply #5 on: June 17, 2006, 10:12:06 pm »

It feels kind of like this should be worked into the config section by the dev team... like, to keep it clean, having only 1 row per category on the main page makes sense... because there are a lot of categories and it just looks to cluttered to have too many showing... but, once a user clicks on a category (in my case, like "staff pics") then one would want to have a larger number of albums visable... again, because now we're only viewing albums within that one category, not all the categories, as in the main page.  To click on the category name and only be able to see 2 albums at a time - clicking through pages... a little repetative.  It's also a waste of space on the page that is only showing one category.

I am afraid that I may not be explaining this properly.  I'm not trying to criticize, more so I am trying to suggest.  If the dev team worked this into the config section then dumb people like me could control it easier...
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: Album Column settings different for main page?
« Reply #6 on: June 19, 2006, 12:21:49 am »

You can request such a thing on the Features Request board.  If you link to this thread, it will help for anyone who might try to implement such a feature in the next version (if the feature is accepted).

The replace "x" with "y" is already shown above.

There are 2 functions that have this exact same line:
Code: [Select]
$alb_per_page = $CONFIG['albums_per_page'];
If you replace this line in both functions, with the lines I showed above, you'll be all set.
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 21 queries.