Album Column settings different for main page? Album Column settings different for main page?
 

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]

Main Menu

Album Column settings different for main page?

Started by DjMikeWatt, June 17, 2006, 04:12:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DjMikeWatt

I like only having 2 columns and 1 row per category on my MAIN page.
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fftp%3A%2F%2Fwww.mikewattsplayground.net%2Fmyspace%2Fpictures%2Fcolumns1.bmp&hash=679a835ab35971a6df33151b13be5ceb17cbe8a9)
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...
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fftp%3A%2F%2Fwww.mikewattsplayground.net%2Fmyspace%2Fpictures%2Fcolumns2.bmp&hash=f47f59f31dc54cdc8858ee8c09acd51c638a1e16)
has anyone else come into this?  Anyone come up with a work-around?

Paver

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:
$alb_per_page = $CONFIG['albums_per_page'];
with these lines:
// 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.

DjMikeWatt

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?

Paver

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.

DjMikeWatt

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?

DjMikeWatt

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...

Paver

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:
$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.