Пример #1
0
 /**
  * Function used to set template (Frontend)
  */
 function set_the_template()
 {
     global $cbtpl, $myquery;
     $template = $this->template;
     $can_change = can_change_template();
     if (isset($_SESSION['the_template']) && $cbtpl->is_template($_SESSION['the_template'])) {
         $template = $_SESSION['the_template'];
     }
     if ($_GET['template'] and $can_change) {
         if (is_dir(STYLES_DIR . '/' . $_GET['template']) && $_GET['template']) {
             $template = $_GET['template'];
         }
     }
     if (isset($_GET['set_the_template']) && $cbtpl->is_template($_GET['set_the_template']) and $can_change) {
         $template = $_SESSION['the_template'] = $_GET['set_the_template'];
     }
     if (!is_dir(STYLES_DIR . '/' . $template) || !$template || is_template_hidden($template)) {
         $template = 'cbv3';
     }
     if (!is_dir(STYLES_DIR . '/' . $template) || !$template) {
         $template = $cbtpl->get_any_template();
     }
     if (!is_dir(STYLES_DIR . '/' . $template) || !$template) {
         exit("Unable to find any template, please goto <a href='http://clip-bucket.com/no-template-found'><strong>ClipBucket Support!</strong></a>");
     }
     if ($_GET['set_template'] and has_access('admin_access')) {
         $myquery->set_template($template);
     }
     $this->template_details = $cbtpl->get_template_details($template);
     //CHecking if there is any php file, include it like a BOSS!
     //if($this->template_details['php_file'])
     //    include($this->template_details['php_file']);
     $this->template = $template;
     return $this->template;
 }
Пример #2
0
 function delete_template($dir)
 {
     $current = config('template_dir');
     $tpl = $this->get_template_details($current);
     if ($tpl['dir'] == $dir) {
         e(lang('You cannot delete current active template.'));
     } else {
         if ($template = $this->is_template($dir)) {
             if (is_template_hidden($template['dir'])) {
                 show_the_template($template['dir']);
             }
             $path = STYLES_DIR . '/' . $template['dir'];
             rmdir_recurse($path);
             return true;
         } else {
             e(lang('Either it is not a Clipbucket compatible template or template does not exist'));
         }
     }
 }
Пример #3
0
 ****************************************************************************************************
*/
require_once '../includes/admin_config.php';
$userquery->admin_login_check();
$pages->page_redir();
$userquery->perm_check('manage_template_access', true);
if ($_GET['delete']) {
    $to_delete = mysql_clean($_GET['delete']);
    if ($cbtpl->delete_template($to_delete)) {
        e(lang('Template deleted'), 'm');
    }
}
if ($_GET['change']) {
    $myquery->set_template($_GET['change']);
    $dir = mysql_clean($_GET['change']);
    if (is_template_hidden($dir)) {
        show_the_template($dir);
    }
}
if ($_GET['hide']) {
    $tpl_dir = mysql_clean($_GET['hide']);
    hide_the_template($tpl_dir);
}
if ($_GET['show']) {
    $tpl_dir = mysql_clean($_GET['show']);
    show_the_template($tpl_dir);
}
if ($_POST['do-action']) {
    $do_action = mysql_clean($_POST['do-action']);
    switch ($do_action) {
        case "upload-theme":