Two albums- Different themes? Two albums- Different themes?
 

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

Two albums- Different themes?

Started by macegruvy, February 19, 2005, 03:29:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

macegruvy

Hello all,

Here is my question:

I have a gallery with two albums, sketchbook and gallery. Can I assign a different skin to each album? Basically I want the two galleries to respond to two different template.html files.

I am looking for a way to do this without having to create two completely different directories, possibly just two different themes, each gallery calling it's own theme.

Does anyone know if this is possible?

Thanks,
Mace

Abbas Ali

Yes it is possible. The solution I am giving is not 100% perfect but is the easiest way to achieve what you want.

Edit include/init.inc.php

Add


if (isset($_GET['album']) && !empty($_GET['album'])) {
  if ((int)$_GET['album'] == 1) {
    $CONFIG['theme'] = 'mac_ox_x';
  } elseif ((int)$_GET['album'] == 2) {
    $CONFIG['theme'] = 'igames';
  }
}


just after


// Load theme file
if (isset($USER['theme']) && !strstr($USER['theme'], '/') && is_dir('themes/' . $USER['theme'])) {
    $CONFIG['theme'] = strtr($USER['theme'], '$/\\:*?"\'<>|`', '____________');
} else {
    unset($USER['theme']);
}


(int)$_GET['album'] == 1, here 1, 2 are the album ids of the two albums whose theme you want to change. Replace these ids with the album ids (aid) of your albums and the themes with the themes which you want.

This code will work for thumbnails page and displayimage page. But it will not work for meta albums like last up, most viewed etc. If you want themes for meta albums too then it can be done by modifying above code and adding more conditions.

I hope this is what you wanted. :)
Chief Geek at Ranium Systems

neeth

how to do that with diferend categories ??

tnx.
[

Abbas Ali

Thumbnails page and intermediate pic page are displayed on album basis and not category basis and hence category based theming cannot be done directly. It can be done by doing some workaround. What we will need to do is first find the category in which the album lies and then choose the theme accordingly.

I am busy right now and cant give you solution but you can try yourself. Modify the above code. Run a query to find the category id of the album from database and then select a theme accordingly.
Chief Geek at Ranium Systems

Casper

First, what Abbas has told you is correct.  If you show first level albums on the index page, so users canm go straight to the albums without first going to the category, this will not work.  Nor will it work for the meta albums.

To change the theme based on the category you are in, change the code Abbass gave you above, as follows.  Find all

$_GET['album']

and change it to;

$_GET['cat']
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here