coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: kehbop on December 03, 2005, 03:27:50 AM

Title: Can I make displayimage.php have a diffrent theme?
Post by: kehbop 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)

<link rel="stylesheet" href="<?php echo $THEME_DIR ?>/style.css" />
Title: Re: Can I make displayimage.php have a diffrent theme?
Post by: donnoman 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
Title: Re: Can I make displayimage.php have a diffrent theme?
Post by: kehbop 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?
// 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);
Title: Re: Can I make displayimage.php have a diffrent theme?
Post by: donnoman on December 04, 2005, 02:03:51 AM
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']);
}

Title: Re: Can I make displayimage.php have a diffrent theme?
Post by: kehbop on December 04, 2005, 02:10:07 AM
HOLY SWEETNESS!

Thank you sooooo much!
Title: Re: Can I make displayimage.php have a diffrent theme?
Post by: kehbop 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.
if (defined('DISPLAYIMAGE_PHP')) {
        $CONFIG['theme']='rainy_day';
    }