Esempio n. 1
0
				<a href="javascript:;" onclick="$.kc_ajax({URL:'<?php 
    echo DIR;
    ?>
user/manage.php',CMD:'resetpass'})" title="修改密码">修改密码</a>
			<?php 
} else {
    ?>
				<a href="javascript:;" onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('<?php 
    echo FULLURL;
    ?>
');">设为首页</a>
				<a href="javascript:;" onclick="window.external.addFavorite('<?php 
    echo FULLURL;
    ?>
','<?php 
    echo kc_config('site.name');
    ?>
')" >加入收藏</a>
			<?php 
}
?>
				<span class="top_hover top_sitemaps">
					<a href="/sitemaps/" class="sub">网站导航</a>
					<ul>
						<li><a href="/">网站首页</a></li>
						<li><a href="<?php 
echo DIR;
?>
tianqi/">天气预报</a></li>
						<li><a href="<?php 
echo DIR;
Esempio n. 2
0
 public function __destruct()
 {
     flush();
     if (!is_dir(ROOT . 'task')) {
         return false;
     }
     if (AJAX) {
         return false;
     }
     //ajax操作的时候不做计划任务
     if (defined('CLOSETASK')) {
         return false;
     }
     extract($this->info);
     /** 分时计划任务 **/
     $file = new file();
     $db = new db();
     $str = new str();
     $time = time();
     $today = $str->formatDate($time, 'Ymd');
     for ($i_task = 1; $i_task <= 6; $i_task++) {
         if ($time - intval(kc_config('task.update' . $i_task)) > 3600 * $i_task) {
             $tasks = $file->getDir('task/' . $i_task . '/', 'php');
             if (!empty($tasks)) {
                 foreach ($tasks as $k => $v) {
                     require ROOT . $k;
                 }
             }
             unset($tasks);
             $db->update('%s_config', array('value' => $time), "class='task' and name='update{$i_task}'");
         }
     }
     //开始执行每日计划任务
     if (kc_config('task.day') != $today) {
         $tasks = $file->getDir('task/day/', 'php');
         if (!empty($tasks)) {
             foreach ($tasks as $k => $v) {
                 require ROOT . $k;
             }
         }
         unset($tasks);
         $db->update('%s_config', array('value' => $today), "class='task' and name='day'");
     }
     //刷新即可执行
     $tasks = $file->getDir('task/0/', 'php');
     if (!empty($tasks)) {
         foreach ($tasks as $k => $v) {
             require ROOT . $k;
         }
     }
 }