Where is if config Themes settings ( diffrent theme for the admin pages ) Where is if config Themes settings ( diffrent theme for the admin pages )
 

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

Where is if config Themes settings ( diffrent theme for the admin pages )

Started by allvip, February 01, 2014, 01:27:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

allvip

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.

ΑndrĂ©

Quote from: allvip on February 01, 2014, 01:27:33 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',
    ),



Quote from: allvip on February 01, 2014, 01:27:33 PM
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
if (in_array($CPG_PHP_SELF, array('admin.php', 'util.php'))) {
    $CONFIG['theme'] = 'water_drop';
}

before
if (!file_exists('themes/'.$CONFIG['theme'].'/theme.php')) {
    $CONFIG['theme'] = 'curve';
}