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" />
look in init.inc.php
you'll probably want to test if "DISPLAYIMAGE_PHP" is defined, then set X theme
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);
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']);
}
HOLY SWEETNESS!
Thank you sooooo much!
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';
}