⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 update_sys_date.tpl.php

📁 一个文章管理系统,很不错的,php语言开发,运行平台:windows和linux
💻 PHP
字号:
<?php
if( !defined('ISELOOK') ){
	header('HTTP/1.0 404 Not Found');
	exit;
}
?>
<table id=ElookSpace><tr><td></td></tr></table>
<?php
if ($doaction=='') {
print <<<EOT
<table cellpadding="3" cellspacing="1" border="0" class="border" align=center>
  <tr> 
    <th height=25>■ 更新系统统计数据</th>
  </tr>
  <form method="post" action="update_sys_date.php?doaction=update_sys_data">
    <tr> 
      <td class="tdbg1" height="25"><b>注意</b>:此操作将重新计算系统的文章总数,文章浏览量,系统成员总数等。 
        <input type="Submit" value=" 执 行 " name="Submit3">
      </td>
    </tr>
  </form>
  <tr> 
    <th height=25>■ 更新服务器缓存</th>
  </tr>
  <form method="post" action="update_sys_date.php?doaction=update_server_cache">
    <tr> 
      <td class="tdbg1" height="25"><b>注意</b>:此操作将重建系统在服务器生成的缓存。
        <input type="Submit" value=" 执 行 " name="Submit2">
      </td>
    </tr>
  </form>
</table>
EOT;
}elseif($doaction=='update_sys_data'){
	$begin=1;
	$end=3;
	print <<<EOT
<table cellpadding="3" cellspacing="1" border="0" class="border" align=center>
  <tr> 
    <th height=25>■ 更新系统统计数据</th>
  </tr>
<tr>
<td colspan=2 class=tdbg> 下面开始更新系统数据,共有{$end}个项目需要更新 
<table width="400" border="0" cellspacing="1" cellpadding="1">
<tr> 
<td bgcolor=#000000>
<table width="400" border="0" cellspacing="0" cellpadding="1">
<tr> 
<td bgcolor=#ffffff height=9><img src="images/bar.gif" width=0 height=16 id=bar name=bar align=absmiddle></td>
</tr></table>
</td></tr></table> <span id=bartxt name=bartxt style="font-size:9pt">0</span><span style="font-size:9pt">%</span></td></tr>
</table>
EOT;
	for($i=1;$i<=3;$i++){
		switch ($i) {
			case 1:
				$s_articlenum=intval($db->scalar("select count(1) from {$el}article where r_isdel=0"));
				$db->query("update {$el}setup set s_articlenum=$s_articlenum");
				$bodyStr="更新文章数据成功,共有{$s_articlenum}篇文章。";
				break;
			case 2:
				$s_hits=intval($db->scalar("select sum(r_hits) from {$el}article where r_isdel=0"));
				$db->query("update {$el}setup set s_hits=$s_hits");
				$bodyStr="更新文章浏览量数据成功,网站文章一共被浏览了{$s_hits}次。";
				break;
			case 3:
				$s_adminnum=intval($db->scalar("select count(1) from {$el}admin"));
				$db->query("update {$el}setup set s_adminnum=$s_adminnum");
				$bodyStr="更新系统成员数据成功,共有{$s_adminnum}名成员。";
				break;
			default:
		}
		require_once ROOT_PATH.'inc/site_cache_class.php';
		$mycache =& new SiteCache($db);
		$mycache->createSiteSetting();
		unset ($mycache);
		print "<script>bar.width=" . floor(($begin/$end) * 400) . ";" . NEWLINE;
		print "bartxt.innerHTML=\"" . number_format($begin/$end*100,4,'.','') . "\";" . NEWLINE;
		print "bar.title=\"" . $bodyStr . "\";</script>" . NEWLINE;
		print '<table cellpadding="3" cellspacing="1" border="0" class="border" align=center><tr><td colspan=2 class=tdbg>'.$bodyStr.'</td></tr></table>'. NEWLINE;
		$begin=$begin+1;
		ob_flush();
		//for ($j=1;$j<6000000 ;$j++) {
		//}
	}
	print "<script>bar.width=400;bartxt.innerHTML=\"100\";</script>";
}elseif($doaction=='update_server_cache'){
	print <<<EOT
<script language="JavaScript" type="text/javascript">
<!--

function window.onload()
{
	result.innerText='所有缓存已经更新完毕。';
}

//-->
</script>
<div class="tableborder">
	<div class="tit1">
		■ 更新服务器缓存
	</div>
EOT;
	$bodyStr1=null;
	for($i=1;$i<=3;$i++){
		switch ($i) {
			case 1:
				include_once ROOT_PATH.'inc/site_cache_class.php';
				$mycache =& new SiteCache($db);
				$mycache->createAll();
				unset ($mycache);
				$bodyStr=NEWLINE . "正在更新网站栏目数据缓存,请稍等..." . NEWLINE;
				break;
			case 2:
				require_once ROOT_PATH.'inc/site_cache_class.php';
				$mycache =& new SiteCache($db);
				$mycache->createSiteSetting();
				unset ($mycache);
				$bodyStr=NEWLINE . "正在更新网站设置数据缓存,请稍等..." . NEWLINE;
				break;
			case 3:
				$bodyStr=NEWLINE . "正在更新网站前台文章标题列表缓存,请稍等...";
				$bodyStr1=update_front_art_tit_cache();
				break;
			default:
		}
		print '<div class="forumrow" style="border-top:#fff 1px solid;">'.$bodyStr.'</div>'.$bodyStr1. NEWLINE;
		$begin=$begin+1;
		ob_flush();
		//for ($j=1;$j<6000000 ;$j++) {
		//}
	}
	print '<div class="forumrow" style="border-top:#fff 1px solid;" id="result">正在更新网站其余缓存,请稍等...</div>'. NEWLINE;
	print '</div>'. NEWLINE;
}
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -