Can I make displayimage.php have a diffrent theme? Can I make displayimage.php have a diffrent theme?
 

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

Can I make displayimage.php have a diffrent theme?

Started by kehbop, December 03, 2005, 03:27:50 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kehbop

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)

<link rel="stylesheet" href="<?php echo $THEME_DIR ?>/style.css" />

donnoman

look in init.inc.php

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

kehbop

This is the code in there.  ??? How do I make it so it is a diffrent theme?
// 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);

donnoman

From init.inc.php

// 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:

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


kehbop


kehbop

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.
if (defined('DISPLAYIMAGE_PHP')) {
        $CONFIG['theme']='rainy_day';
    }