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: Two albums- Different themes?  (Read 3556 times)

0 Members and 1 Guest are viewing this topic.

macegruvy

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Two albums- Different themes?
« on: February 19, 2005, 03:29:29 am »

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
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Two albums- Different themes?
« Reply #1 on: February 19, 2005, 07:04:50 am »

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

Code: [Select]
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

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']);
}

(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. :)
Logged
Chief Geek at Ranium Systems

neeth

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 131
  • I love my gallery
    • Gelipo
Re: Two albums- Different themes?
« Reply #2 on: February 20, 2005, 06:45:54 pm »

how to do that with diferend categories ??

tnx.
Logged
[

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Two albums- Different themes?
« Reply #3 on: February 21, 2005, 06:04:14 am »

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.
Logged
Chief Geek at Ranium Systems

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Two albums- Different themes?
« Reply #4 on: February 21, 2005, 10:58:02 am »

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

Code: [Select]
$_GET['album']
and change it to;

Code: [Select]
$_GET['cat']
Logged
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
Pages: [1]   Go Up
 

Page created in 0.024 seconds with 19 queries.