forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: allvip on February 01, 2014, 01:27:33 pm

Title: Where is if config Themes settings ( diffrent theme for the admin pages )
Post by: allvip on February 01, 2014, 01:27:33 pm
I want to know where is the code for the gallery theme.The code that adds theme settings in config and the code that coppermine uses to display the theme I set in the config.

Maybe I can find some php code or something to add a diffrent theme for the admin pages.
Title: Re: Where is if config Themes settings
Post by: Αndré on February 03, 2014, 04:23:01 pm
The code that adds theme settings in config
Code: (include/admin.inc.php) [Select]
    'theme' => array(
      'type'          => 'select',
      'help_link'     => 'f=configuration.htm&as=admin_theme_theme&ae=admin_theme_theme_end',
      'options'       => form_get_foldercontent('themes/', 'folder', '', array('sample', '.svn')),
      'default_value' => 'curve',
      'force_config'  => '1',
    ),


the code that coppermine uses to display the theme I set in the config.
Code: (include/init.inc.php) [Select]
// ********************************************************
// * Theme processing - start
// ********************************************************

$CONFIG['theme_config'] = DEFAULT_THEME;        // Save the gallery-configured setting

if ($matches = $superCage->get->getMatched('theme', '/^[A-Za-z0-9_-]+$/')) {
    $USER['theme'] = $matches[0];
}
if (isset($USER['theme']) && !strstr($USER['theme'], '/') && is_dir('themes/' . $USER['theme'])) {
    $CONFIG['theme'] = strtr($USER['theme'], '$/\\:*?"\'<>|`', '____________');
} else {
    unset($USER['theme']);
}
if (!file_exists('themes/'.$CONFIG['theme'].'/theme.php')) {
    $CONFIG['theme'] = 'curve';
}
$THEME_DIR = 'themes/'.$CONFIG['theme'].'/';
require('themes/'.$CONFIG['theme'].'/theme.php');   // Load configured theme first
require('include/themes.inc.php');                  // All Fallback Theme Templates and Functions

// ********************************************************
// * Theme processing - end
// ********************************************************


To answer what you're actually looking for, just add something like
Code: [Select]
if (in_array($CPG_PHP_SELF, array('admin.php', 'util.php'))) {
    $CONFIG['theme'] = 'water_drop';
}
before
Code: [Select]
if (!file_exists('themes/'.$CONFIG['theme'].'/theme.php')) {
    $CONFIG['theme'] = 'curve';
}