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

📄 admin.php

📁 需要mysql
💻 PHP
字号:
<?php

if(!$inc_lib)  { include("lib.inc.php"); }
if(!$inc_condb)  { include("conn_db.inc.php"); }

?>
<?php
	session_start();
	session_register("s_admin_user_name");
	session_register("s_admin_pass_word");
	
	if($admin_login)
	{
		$s_admin_user_name=$admin_user_name;
		$s_admin_pass_word=$admin_pass_word;
	}
	if( ($s_admin_user_name!=$admin_name) or ($s_admin_pass_word!=$admin_pass))
	{ 
		header("Location:login.htm\n\n");
		exit;
	}
?>
<html>
<head>
<meta HTTP-EQUIV=Content-Type content="text/html; charset=gb2312">
<title><? echo $gb_title; ?></title>
<link rel="stylesheet" href="nr.css" type="text/css">
<script language=javascript>
function openwin(url,myname)
{
	window.open(url,myname,'resizable=1,scrollbars=1,status=no,toolbar=no,location=no,menu=no,left=0,top=0,width=500,height=420');	
}
</script>
</head>
<body>
<?php
echo $gb_header;
?>
<div align="center"><center>
<table border="0" width="720" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#808080" width="30%"><p align="left">&nbsp;<a href="<? echo $gb_homepage; ?>"  target="_top" class=ahz><font color="#FFFFFF"><? echo $gb_homepage_title?></font></a><font
    color="#000000" class=hz> &gt;&gt;</font> <a href=<?echo $gb_url;?>   target="_top" class=ahz><font color="#FFFFFF"><? echo $gb_name;?></font></a></td> 
    <td width="70%" bgcolor="#808080" align=right class=ahz>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2" width="100%" height="2" bgcolor="#808080"></td>
  </tr>
</table>
</center></div>
<!-- <table width=720 height=4 border=0><tr><td>&nbsp;</td></tr></table> -->
<?php

//index page

//打印标题,表单,相关连接等等:或者放在最后面打印
	$user_id=1;
	
	$past24time=time()-$newpost_hour*3600;
	$past24=date("YmdHis",$past24time);
	$now=date("YmdHi");
	$todaystr=formatdate($now,'date');
	
	$page=intval($page) or 1;
	if($page<1) {$page=1;}
	//if(is_int($page)){}else {$page=1;}
	
	$thissql="select count(*) from $db_gb where g_top_id=0 and user_id=$user_id";
	$query=mysql_query($thissql,$db_conn);
	$array=mysql_fetch_row($query);
	$all_records=$array[0];
	
	$all_page=ceil($all_records/$records_pp);
	if($page>$all_page) {$page=$all_page;}
	$start_topic=($page-1)*$records_pp;
	
	$thissql="select g_id from $db_gb where g_top_id=0 and user_id=$user_id order by g_ltime desc,g_id desc limit $start_topic,$records_pp";
	//echo $thissql;
	$query=mysql_query($thissql,$db_conn);
	
	$top_ids='';
	
	while($array=mysql_fetch_row($query))
	{
		$top_ids.="$array[0],";
	}
	
	$top_ids=substr($top_ids,0,strlen($top_ids)-1);
?>
<form action=admined.php method=post>
<input type=hidden name=user_id value=<?echo $user_id;?>>
<table width=<?echo $gb_table_width;?> border=0 cellspacing=0 cellpadding=2 align=center class=ahz>
<tr><td><b>今天是<?echo $todaystr;?></b></td><td align=right><b>现在共有<?echo $all_records;?>条留言.</b></td></tr></table>	
<?php
if($top_ids=='')
{
}
else
{
	$thissql="select * from $db_gb where ( user_id=$user_id ) and ( (g_top_id in ($top_ids)) or (g_id in ($top_ids)) ) order by g_ltime desc,g_id";
	
	$old_g_top_id=-1;
	$query=mysql_query($thissql,$db_conn);
	
	while($array=mysql_fetch_array($query))
	{	

		$array[g_said]=truncate($array[g_said]);
		$array=conv_array($array,'htmlspecialchars');		
		$array=conv_array($array,'conv_space');
		$array[g_said]=conv_textsee($array[g_said]);
		$array=conv_array($array,'conv_tosee');
		$newicon='';

		if($array[g_time]>$past24) {$newicon="<img src=images/new.gif border=0>";} 
		if( ($old_g_top_id!=-1) and ($array[g_top_id]==0) )
		{
			echo <<<___bbb___
</td></tr></table>
</td>
</tr>
</table><br>		
___bbb___;
		}
		$user_email='';
		$user_url='';
		if($array[user_email]) { $user_email="<a href=\"mailto:$array[user_email]\"><img src=images/email.gif border=0 alt=\"$array[user_email]\"></a>";  }
		if($array[user_url]) { $user_url="<a href=\"$array[user_url]\"  target=_blank><img src=images/home.gif border=0 alt=\"$array[user_url]\"></a>";  }
		$g_time=formatdate($array[g_time]);
		
		if($array[g_top_id]==0)
		{		
			echo <<<___aaa___
\n<table width="$gb_table_width" border="0" cellspacing="0" cellpadding="2" align="center" class=hz>
<tr BGCOLOR=#E3E3E3>
<td><b><input type=checkbox name=del_g_id[] value=$array[g_id] class=hz> $newicon $array[g_title]&nbsp;</b> $array[user_name]&nbsp; ($g_time)&nbsp; $user_url &nbsp; $user_email &nbsp; IP:$array[user_ip]</td>
<td align=right><a href="#" onclick="openwin('admined.php?edit=1&user_id=$user_id&g_id=$array[g_id]','scud_gb_edit');"><img src=images/edit.gif border=0 alt=编辑此留言></a>
</td>
</tr>
<tr BGCOLOR=#F7F7F7> 
<td colspan=2>     	
<hr size=1 noshade>
<table width=100% border=0 class=hz><tr><td width=35></td><td>
$array[g_said]&nbsp;
___aaa___;
		}
		else
		{
			echo <<<___ccc___
<table width=100% class=hz cellspacing="0" cellpadding="2"><tr BGCOLOR=#E3E3E3><td>
<p><b><input type=checkbox name=del_g_id[] value=$array[g_id] class=hz> $newicon $array[g_title]&nbsp;</b> $array[user_name]&nbsp; ($g_time) &nbsp; $user_url &nbsp; $user_email IP:$array[user_ip]</p>
</td><td align=right><a href="#" onclick="openwin('admined.php?edit=1&user_id=$user_id&g_id=$array[g_id]','scud_gb_edit');"><img src=images/edit.gif border=0 alt=编辑此留言></a>
</td>
</tr>
<tr><td  colspan=2><blockquote>$array[g_said]&nbsp;</blockquote></td></tr>
</table>
___ccc___;

		}	
		$old_g_top_id=$array[g_top_id];
	}

	if( ($old_g_top_id!=-1) )
	{
		echo <<<___bbb___
</td></tr></table>
</td>
</tr>
</table>		
___bbb___;
	}	
}
?>
      <table border="0" cellpadding="4" cellspacing="1" width="720" align=center class=hz>
      <tr>
      <td align=right class=hz>&nbsp;<b>页码:
      <?php
 		echo get_pagelist($all_page,$page,$page_pp,"admin.php?user_id=$user_id&page=");
      ?>
      </b></td>
      </tr>
      </table>
      <table width=720 height=4 border=0 align=center><tr><td class=ahz>
      <font color=red class=ahz>注意:删除父主题,子回复也将被删除.</font><br>
      </td></tr>
      </table>      
      <br><div align=center>
      <input type="submit" value=" 删除 " name="dodel" class=btnStyle>&nbsp;&nbsp;&nbsp; <input type="reset" value=" 清除选择 " name="B2"  class=btnStyle></p>
      </form></center>
      <br>
<?php
	echo $gb_footer;
?>     

</body>
</html>

⌨️ 快捷键说明

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