Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

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

0 Members and 1 Guest are viewing this topic.

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362

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: 15764
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.019 seconds with 19 queries.