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

📄 main.php

📁 多国语言系统,支持中英文,繁体文.有很强的 稳定性.
💻 PHP
字号:
<?
####################################################################################
//			准备就绪
####################################################################################
set_time_limit(0);
if(!$is_admin){
nalog_error("您没有足够权限");
}
?>

<?
####################################################################################
//			插件主画面
####################################################################################
if(!$pmode){?>
<table width=100% border=0 cellpadding=2 cellspacing=0 align=center bgcolor=white>
<tr><td align=center>
<br><br><br><br><br>
<img src="plug_in/<?=$plugin[dir]?>/logo.gif" border=0>
<br><br><br><br><br><br>
</td></tr>
</table>
<?}?>

<?
####################################################################################
//			第 1 页 - 备份资料
####################################################################################
if($pmode==1){?>
<?
$tables=nalog_list_bd();
$total=count($tables);

$page=10;
$pageviewsu=10;
$pagesu=ceil($total/$page);
$start=($page*$pagenum);
$no=$total-$start;
$pagegroup=ceil(($pagenum+1)/$pageviewsu);
$pagestart=($pageviewsu*($pagegroup-1))+1;
$pageend=$pagestart+$pageviewsu-1;
$nowpage=$pagenum+1;
$send="&page=$page&";
?>
		<table align=center width=98% cellpadding=4 cellspacing=0 border=1 bordercolor=white>
		<form method=post action="plug_in/<?=$plugin[dir]?>/dump.php">
		<tr>
		<td nowrap>总共 <b><?=$total?></b> 个计数器</td>
		<td align=right>请选择备份方式:
		<input type=radio name=how value=1 checked> 下载到自己计算机
		<input type=radio name=how value=0> 储存在服务器端
		(路径: <?=str_replace("admin_counter.php","*.sql",$PHP_SELF)?>)</td>
		</tr>
		</table>

		<table align=center width=98% cellpadding=4 cellspacing=0 border=1 bordercolor=white>
		<input type=hidden name=counter value="<?=$counter?>">
		<input type=hidden name=id value="<?=$id?>">
		<input type=hidden name=pmode value="<?=$pmode?>">
		<tr bgcolor=#C9F0FF>
		<td width=1% nowrap align=center>编号</td>
		<td width=1% nowrap align=center>选取</td>
		<td width=92% align=center>计数器名称</td>
		<td width=1% nowrap align=center>已记录天数</td>
		<td width=1% nowrap align=center>OS/浏览器记录</td>
		<td width=1% nowrap align=center>来源主机记录</td>
		<td width=1% nowrap align=center>来源网址记录</td>
		<td width=1% nowrap align=center>访客记录</td>
		<td width=1% nowrap align=center>会员记录</td>
		</tr>
<?
		$j=0;
		for($i=$start;$i<$start+$page;$i++)
		{
		if(!$tables[$i]){break;}
		$board_name=$tables[$i];

		$total_data	= mysql_fetch_array(mysql_query("select count(*) from nalog3_data where counter='$board_name'"));
		$total_os	= mysql_fetch_array(mysql_query("select count(*) from nalog3_os where counter='$board_name' and os='1'"));
		$total_bw	= mysql_fetch_array(mysql_query("select count(*) from nalog3_os where counter='$board_name' and os='0'"));
		$total_log	= mysql_fetch_array(mysql_query("select count(*) from nalog3_log_$board_name"));
		$total_dlog	= mysql_fetch_array(mysql_query("select count(*) from nalog3_dlog_$board_name"));
		$total_counter	= mysql_fetch_array(mysql_query("select count(*) from nalog3_counter_$board_name"));
		$total_member	= mysql_fetch_array(mysql_query("select count(*) from nalog3_counter_$board_name where id<>''"));


		echo"
		<tr bgcolor=white>
		<td width=1% nowrap align=center>$no</td>
		<td width=1% nowrap align=center><input type=checkbox name=name[$j] value='$board_name' checked id=name[$j]></td>
		<td width=92%><b><label for=name[$j]>$board_name</label></b></td>
		<td width=1% nowrap align=right>$total_data[0]天</td>
		<td width=1% nowrap align=right>$total_os[0]种 / $total_bw[0]种</td>
		<td width=1% nowrap align=right>$total_log[0]个</td>
		<td width=1% nowrap align=right>$total_dlog[0]个</td>
		<td width=1% nowrap align=right>$total_counter[0]笔</td>
		<td width=1% nowrap align=right>$total_member[0]笔</td>
		</tr>
		";
		$no--;
		$j++;
		}
?>
		</table>
		<table align=center width=98% cellpadding=4 cellspacing=0 border=1 bordercolor=white>
		<tr>
		<td align=center><?nalog_index()?></td>
		</tr>
		<tr bgcolor=white>
		<td align=center><input type=submit class=button value="立即备份"></td>
		</tr>
		</form>
		</table>
<?}?>

<?
####################################################################################
//			第 2 页 - 还原数据
####################################################################################
if($pmode==2){?>

		<script language=javascript>
		function chk(){
		if(!ok.filename.value){alert('请在备份文件下拉选单选择一个 .sql 档案以作备份。\n假如在 n@log 主资料夹里没有任何 .sql 档案存在,请先上传档案。');ok.filename.focus();return false;}
		}
		function chkup(){
		if(!up.backup.value){alert('请先指定一个 .sql 档案以作上传');up.backup.click();return false;}
		}
		</script>

		<table align=center width=98% cellpadding=4 cellspacing=0 border=1 bordercolor=white>
		<tr bgcolor=#C9F0FF>
		<td align=center>上传 n@log 备份数据文件</td>
		</tr>
		</table>

		<table align=center width=98% cellpadding=10 cellspacing=0 border=1 bordercolor=white>
		<form method=post action="plug_in/<?=$plugin[dir]?>/upload.php" onsubmit="return chkup()" name=up enctype="multipart/form-data">
		<tr bgcolor=white>
		<td><input type=file name=backup size=32 class=input><br>(请指定一个以 'sql' 为扩展名的 n@log 备份数据文件)</td>
		<td align=right><input type=submit class=button value="立即上传"></td>
		</tr>
		</form>
		</table>

		<table align=center width=98% cellpadding=10 cellspacing=0 border=1 bordercolor=white>
		<tr><td>
		如果您想要还原先前备份的 .sql 档案,第一件事要做的是将这个档案上传到 n@log 主数据夹。<br>
		我们建议您使用 FTP 的方式上传,因为在某些情况下,您可能无法利用手动的方法删除使用脚本上传的档案。
		</td></tr>
		</table>

		<table align=center width=98% cellpadding=4 cellspacing=0 border=1 bordercolor=white>
		<tr bgcolor=#C9F0FF>
		<td align=center>还原 n@log 备份数据文件</td>
		</tr>
		</table>

		<table align=center width=98% cellpadding=10 cellspacing=0 border=1 bordercolor=white>
		<tr bgcolor=white>
		<form method=post action="plug_in/<?=$plugin[dir]?>/restore.php" onsubmit="return chk()" name=ok>
		<td><select name=filename>
		<option value="">请选择一个备份数据文件以作还原</option>
		<?
		$handle=@opendir("./");
		while ($dir = @readdir($handle))
		{
		if(!eregi("\.sql$",$dir)){continue;}
		echo "<option value=\"$dir\">$dir</option>";
		}
		?>
		</select><br>(这个下拉选单列出储存在服务器中 n@log 主数据夹里所有可用的 .sql 档案)</td>
		<td align=right><input type=submit class=button value="立即还原"></td>
		</tr>
		</table>


<?}?>

<?
####################################################################################
//			第 3 页 - 插件相关信息
####################################################################################
if($pmode==3){?>
<table width=100% border=0 cellpadding=5 cellspacing=0 align=center bgcolor=white>
<tr>
<td width=99% valign=top>
	<table width=100% border=0 cellpadding=4 cellspacing=0 align=center bgcolor=white>
	<tr>
	<td width=1% nowrap>插件名称</td>
	<td width=99%>:  <?=$plugin[name]?></td>
	</tr>
	<tr>
	<td width=1% nowrap>插件英文ID</td>
	<td width=99%>:  <?=$plugin[id]?></td>
	</tr>
	<tr>
	<td width=1% nowrap>版本编号</td>
	<td width=99%>:  <?=$plugin[version]?></td>
	</tr>
	<tr>
	<td width=1% nowrap>发表日期</td>
	<td width=99%>:  <?=$plugin[date]?></td>
	</tr>
	<tr>
	<td width=1% nowrap>作者</td>
	<td width=99%>:  <?=$plugin[programmer]?></td>
	</tr>
	<tr>
	<td width=1% nowrap>电子邮件</td>
	<td width=99%>:  <?=$plugin[email]?></td>
	</tr>
	<tr>
	<td width=1% nowrap>个人网站</td>
	<td width=99%>:  <?=$plugin[homepage]?></td>
	</tr>
	</table>
</td>
<td width=1% nowrap valign=top><img src="plug_in/<?=$plugin[dir]?>/logo.gif" border=0></td>
</tr>
</table>
<?}?>

⌨️ 快捷键说明

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