public function clearCaches()
 {
     global $class_path;
     include_once $class_path . 'adminpage.inc.php';
     new SQL("DELETE FROM cache WHERE url <> ''");
     clear_template_cache($class_path . 'smarty/templates_c/');
 }
                }
                // chnage all other default pages templates to inactive state, do this only once
                if ($template['is_page'] && !$flag) {
                    $sql = "update templ_tyyp set on_nahtav = '0' where is_default = 1 and on_page_templ = '1' and ttyyp_id <> " . $ext_templates['../../../' . $ext_path . $template['file']];
                    new SQL($sql);
                    $sql = "update templ_tyyp set on_nahtav = '1' where is_default = 1 and on_page_templ = '1' and ttyyp_id = " . $ext_templates['../../../' . $ext_path . $template['file']];
                    new SQL($sql);
                    $flag = true;
                }
            }
            // change the template op's
            if ($template['op'] && $ext_templates['../../../' . $ext_path . $template['file']]) {
                change_op_template($template['op'], $ext_templates['../../../' . $ext_path . $template['file']]);
            }
        }
        clear_template_cache($site->absolute_path . 'classes/smarty/templates_c/');
        clear_cache("ALL");
    }
    if ($site->fdat['direct'] && !$editor_mode) {
        unset($site->fdat['extension']);
        unset($site->fdat['activate']);
        unset($site->fdat['direct']);
    } elseif ($site->fdat['direct'] && $editor_mode) {
        ?>
		<script type="text/javascript">
			window.parent.location.href = window.parent.location.href.replace(/#$/, '');
			window.close();
		</script>
		<?php 
        exit;
    } else {
Ejemplo n.º 3
0
            }
            while ($row = $db->sql_fetchrow($result2)) {
                // get folder info from the filename
                if (($slash_pos = strrpos($row['template_filename'], '/')) === false) {
                    $filelist[''][] = $row['template_filename'];
                } else {
                    $filelist[substr($row['template_filename'], 0, $slash_pos + 1)][] = substr($row['template_filename'], $slash_pos + 1, strlen($row['template_filename']) - $slash_pos - 1);
                }
            }
            $db->sql_freeresult($result2);
            store_templates('update', $style_id, $template_row['template_path'], $filelist);
            unset($filelist);
            $template_refreshed = $user->lang['TEMPLATE_REFRESHED'] . '<br />';
            add_log('admin', 'LOG_TEMPLATE_REFRESHED', $template_row['template_name']);
        }
        clear_template_cache($template_row);
        $template->assign_block_vars('template_row', array('S_SGPRA_TEMPLATE' => true, 'SGRA_TEMPLATE_REFRESHED' => "<br /> &nbsp;  &#187; &nbsp; " . $template_row['template_name'] . $user->lang['REFRESHED']));
    }
    $db->sql_freeresult($result);
    //Refresh all styles themes
    $sql = 'SELECT *
		FROM ' . STYLES_THEME_TABLE . "\n\t\tWHERE theme_id > 0";
    $result = $db->sql_query($sql);
    if (!$result) {
        $template->assign_block_vars('theme_row', array('S_SGPRA_THEME' => false, 'SGPRA_THEME_ERROR' => $user->lang['NO_INFO_FOUND'] . STYLES_THEME_TABLE . $user->lang['DATABASE_TABLE']));
        $no_exeptions = false;
    }
    while ($theme_row = $db->sql_fetchrow($result)) {
        if (!$theme_row['theme_storedb']) {
            $template->assign_block_vars('theme_row', array('S_SGPRA_THEME' => true, 'S_SGPRA_THEME_TABLE' => true, 'SGRA_THEME_REFRESHED' => "<br /> &nbsp;  &#187; &nbsp; " . $theme_row['theme_name'] . " - " . $user->lang['THEME_ERR_REFRESH_FS']));
            continue;
/scms_general.css">
<SCRIPT LANGUAGE="JavaScript" SRC="<?php 
echo $site->CONF['wwwroot'] . $site->CONF['js_path'];
?>
/yld.js"></SCRIPT>
</head>

<body class="popup_body" onLoad="this.focus()" >

<?php 
#############################
# KUSTUTA
#############################
if ($site->fdat[kustuta]) {
    clear_cache("ALL");
    if (clear_template_cache($templ_cache_path)) {
        ########################
        # close window
        ?>
		<SCRIPT language="javascript">
		<!--
	//		window.close();
		// -->
		</SCRIPT>
	<?php 
    }
}
#############################
# FORM
#############################
?>
Ejemplo n.º 5
0
			<p>If you are in Linux environment don't forget to run post_install.sh script now! <br>It will delete install.php from your website root directory for security reasons and also change file permissions for config.php back to normal.
			</p>
<?
		} # if OK
}
# / if INSTALL  step6
#########################
#########################
# if UPDATE  step6
else {
	// clean template and site cache
	ini_set('display_errors', 'On');
	new SQL("DELETE FROM cache WHERE url <> ''");
	
	include_once($class_path.'adminpage.inc.php');
	clear_template_cache(getcwd().'/classes/smarty/templates_c/');
?>
	<h2>Update Finished</h2>
	<br />
	<? store_config_data(); ?>
	
	Congratulations, we hope you enjoy your new copy of Saurus CMS!<br />
	
	What to do next?<br />
	
	<br />
<?
}
# / if UPDATE  step6
#########################