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: Can I make displayimage.php have a diffrent theme?  (Read 4209 times)

0 Members and 1 Guest are viewing this topic.

kehbop

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 52
Can I make displayimage.php have a diffrent theme?
« on: December 03, 2005, 03:27:50 am »

I want to make displayimage.php use a diffrent theme than the rest of the gallery. (It is using classic theme)

I can only find where displayimage.php pulls out the style.css. I want to know where it pulls out the rest (template.html specifically)

Code: [Select]
<link rel="stylesheet" href="<?php echo $THEME_DIR ?>/style.css" />
« Last Edit: December 04, 2005, 02:12:23 am by donnoman »
Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: Can I make displayimage.php have a diffrent theme?
« Reply #1 on: December 03, 2005, 06:31:14 am »

look in init.inc.php

you'll probably want to test if "DISPLAYIMAGE_PHP" is defined, then set X theme
Logged

kehbop

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 52
Re: Can I make displayimage.php have a diffrent theme?
« Reply #2 on: December 04, 2005, 01:08:41 am »

This is the code in there.  ??? How do I make it so it is a diffrent theme?
Code: [Select]
// get the current theme
//get the url and all vars except $theme
$cpgCurrentTheme = $_SERVER["SCRIPT_NAME"]."?";
foreach ($_GET as $key => $value) {
    if ($key!="theme"){$cpgCurrentTheme.= $key . "=" . $value . "&";}
}
$cpgCurrentTheme.="theme=";

// get list of available languages
    $value = $CONFIG['theme'];
    $theme_dir = 'themes/';

    $dir = opendir($theme_dir);
    while ($file = readdir($dir)) {
        if (is_dir($theme_dir . $file) && $file != "." && $file != "..") {
            $theme_array[] = $file;
        }
    }
    closedir($dir);

    natcasesort($theme_array);
Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: Can I make displayimage.php have a diffrent theme?
« Reply #3 on: December 04, 2005, 02:03:51 am »

From init.inc.php
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']);
}
change to:
Code: [Select]
// Load theme file
if (isset($USER['theme']) && !strstr($USER['theme'], '/') && is_dir('themes/' . $USER['theme'])) {
    if (defined('DISPLAYIMAGE_PHP')) {
        $CONFIG['theme']='rainy_day';
    } else {
        $CONFIG['theme'] = strtr($USER['theme'], '$/\\:*?"\'<>|`', '____________');
    }
} else {
    unset($USER['theme']);
}
Logged

kehbop

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 52
Re: Can I make displayimage.php have a diffrent theme?
« Reply #4 on: December 04, 2005, 02:10:07 am »

HOLY SWEETNESS!

Thank you sooooo much!
Logged

kehbop

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 52
Re: Can I make displayimage.php have a diffrent theme?
« Reply #5 on: December 04, 2005, 03:26:32 am »

Just so everyone knows this code doesn't work

However, when you put the below at the very end of the code (outside the loop) it seems to work.
Code: [Select]
if (defined('DISPLAYIMAGE_PHP')) {
        $CONFIG['theme']='rainy_day';
    }
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.