Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Where is if config Themes settings ( diffrent theme for the admin pages )  (Read 1891 times)

0 Members and 1 Guest are viewing this topic.

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1290

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.
« Last Edit: July 13, 2014, 05:48:35 pm by allvip »
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15757
Re: Where is if config Themes settings
« Reply #1 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';
}
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 21 queries.