MemberGbook.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <?php
  2. define('EmpireCMSAdmin','1');
  3. require("../../class/connect.php");
  4. require("../../class/db_sql.php");
  5. require("../../class/functions.php");
  6. $link=db_connect();
  7. $empire=new mysqlquery();
  8. $editor=1;
  9. //验证用户
  10. $lur=is_login();
  11. $logininid=$lur['userid'];
  12. $loginin=$lur['username'];
  13. $loginrnd=$lur['rnd'];
  14. $loginlevel=$lur['groupid'];
  15. $loginadminstyleid=$lur['adminstyleid'];
  16. //ehash
  17. $ecms_hashur=hReturnEcmsHashStrAll();
  18. //验证权限
  19. CheckLevel($logininid,$loginin,$classid,"spacedata");
  20. //删除留言
  21. function hDelMemberGbook($add,$userid,$username){
  22. global $empire,$dbtbpre;
  23. $gid=intval($add['gid']);
  24. if(!$gid)
  25. {
  26. printerror("NotDelMemberGbookid","history.go(-1)");
  27. }
  28. $sql=$empire->query("delete from {$dbtbpre}enewsmembergbook where gid='$gid'");
  29. if($sql)
  30. {
  31. //操作日志
  32. insert_dolog("gid=".$gid);
  33. printerror("DelMemberGbookSuccess",EcmsGetReturnUrl());
  34. }
  35. else
  36. {
  37. printerror("DbError","history.go(-1)");
  38. }
  39. }
  40. //批量删除留言
  41. function hDelMemberGbook_All($add,$userid,$username){
  42. global $empire,$dbtbpre;
  43. $gid=$add['gid'];
  44. $count=count($gid);
  45. if(empty($count))
  46. {
  47. printerror("NotDelMemberGbookid","history.go(-1)");
  48. }
  49. for($i=0;$i<$count;$i++)
  50. {
  51. $addsql.="gid='".intval($gid[$i])."' or ";
  52. }
  53. $addsql=substr($addsql,0,strlen($addsql)-4);
  54. $sql=$empire->query("delete from {$dbtbpre}enewsmembergbook where (".$addsql.")");
  55. if($sql)
  56. {
  57. //操作日志
  58. insert_dolog("");
  59. printerror("DelMemberGbookSuccess",EcmsGetReturnUrl());
  60. }
  61. else
  62. {
  63. printerror("DbError","history.go(-1)");
  64. }
  65. }
  66. $enews=$_GET['enews'];
  67. if(empty($enews))
  68. {$enews=$_POST['enews'];}
  69. if($enews)
  70. {
  71. hCheckEcmsRHash();
  72. }
  73. if($enews=="hDelMemberGbook")
  74. {
  75. hDelMemberGbook($_GET,$logininid,$loginin);
  76. }
  77. elseif($enews=="hDelMemberGbook_All")
  78. {
  79. hDelMemberGbook_All($_POST,$logininid,$loginin);
  80. }
  81. include("../../member/class/user.php");
  82. include "../".LoadLang("pub/fun.php");
  83. $page=(int)$_GET['page'];
  84. $page=RepPIntvar($page);
  85. $start=0;
  86. $line=12;//每页显示条数
  87. $page_line=12;//每页显示链接数
  88. $offset=$page*$line;//总偏移量
  89. //搜索
  90. $search='';
  91. $search.=$ecms_hashur['ehref'];
  92. $and='';
  93. if($_GET['sear'])
  94. {
  95. $keyboard=RepPostVar2($_GET['keyboard']);
  96. if($keyboard)
  97. {
  98. $show=RepPostStr($_GET['show'],1);
  99. if($show==1)//留言内容
  100. {
  101. $and.=" where gbtext like '%$keyboard%'";
  102. }
  103. elseif($show==2)//回复内容
  104. {
  105. $and.=" where retext like '%$keyboard%'";
  106. }
  107. elseif($show==3)//留言者
  108. {
  109. $and.=" where uname like '%$keyboard%'";
  110. }
  111. elseif($show==4)//空间主人用户ID
  112. {
  113. $and.=" where userid='$keyboard'";
  114. }
  115. elseif($show==5)//留言者IP
  116. {
  117. $and.=" where ip like '%$keyboard%'";
  118. }
  119. $search.="&sear=1&keyboard=$keyboard&show=$show";
  120. }
  121. }
  122. $query="select gid,isprivate,uid,uname,ip,addtime,gbtext,retext,userid,eipport from {$dbtbpre}enewsmembergbook".$and;
  123. $totalquery="select count(*) as total from {$dbtbpre}enewsmembergbook".$and;
  124. $num=$empire->gettotal($totalquery);//取得总条数
  125. $query=$query." order by gid desc limit $offset,$line";
  126. $sql=$empire->query($query);
  127. $returnpage=page2($num,$line,$page_line,$start,$page,$search);
  128. $url="会员空间&nbsp;>&nbsp;<a href=MemberGbook.php".$ecms_hashur['whehref'].">管理留言</a>";
  129. ?>
  130. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  131. <html>
  132. <head>
  133. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  134. <title>留言管理</title>
  135. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  136. </head>
  137. <body>
  138. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  139. <tr>
  140. <td width="50%">位置:
  141. <?=$url?>
  142. </td>
  143. <td><div align="right"> </div></td>
  144. </tr>
  145. </table>
  146. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  147. <form name="searchgb" method="get" action="MemberGbook.php">
  148. <?=$ecms_hashur['eform']?>
  149. <tr>
  150. <td><div align="center">搜索:
  151. <input name="keyboard" type="text" id="keyboard" value="<?=$keyboard?>">
  152. <select name="show" id="show">
  153. <option value="1"<?=$show==1?' selected':''?>>留言内容</option>
  154. <option value="2"<?=$show==2?' selected':''?>>回复内容</option>
  155. <option value="3"<?=$show==3?' selected':''?>>留言者</option>
  156. <option value="4"<?=$show==4?' selected':''?>>空间主人用户ID</option>
  157. <option value="5"<?=$show==5?' selected':''?>>留言者IP</option>
  158. </select>
  159. <input type="submit" name="Submit" value="搜索">
  160. <input name="sear" type="hidden" id="sear" value="1">
  161. </div></td>
  162. </tr>
  163. </form>
  164. </table>
  165. <form name=thisform method=post action=MemberGbook.php onsubmit="return confirm('确认要执行操作?');">
  166. <?=$ecms_hashur['form']?>
  167. <?
  168. while($r=$empire->fetch($sql))
  169. {
  170. $ur=$empire->fetch1("select ".egetmf('username')." from ".eReturnMemberTable()." where ".egetmf('userid')."='$r[userid]'");
  171. if($r['uid'])
  172. {
  173. $r['uname']="<b><a href='../../space/?userid=$r[uid]' target='_blank'>$r[uname]</a></b>";
  174. }
  175. $username=$ur['username'];
  176. $private='';
  177. if($r['isprivate'])
  178. {
  179. $private='<b>[悄悄话]</b>';
  180. }
  181. ?>
  182. <table width="700" border="0" align="center" cellpadding="3" cellspacing="1" class=tableborder>
  183. <tr class=header>
  184. <td width="55%" height="23">发布者:
  185. <?=$r[uname]?>
  186. </td>
  187. <td width="45%">发布时间:
  188. <?=$r[addtime]?>&nbsp;
  189. (IP: <?=$r[ip]?>:<?=$r[eipport]?>) </td>
  190. </tr>
  191. <tr bgcolor="#FFFFFF">
  192. <td height="23" colspan="2"> <table border=0 width='100%' cellspacing=1 cellpadding=10 bgcolor='#cccccc'>
  193. <tr>
  194. <td width='100%' bgcolor='#FFFFFF' style='word-break:break-all'>
  195. <?=$private.nl2br($r[gbtext])?>
  196. </td>
  197. </tr>
  198. </table>
  199. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" style='word-break:break-all'>
  200. <tr>
  201. <td><img src="../../data/images/regb.gif" width="18" height="18"><strong><font color="#FF0000">回复:</font></strong>
  202. <?=nl2br($r[retext])?>
  203. </td>
  204. </tr>
  205. </table>
  206. </td>
  207. </tr>
  208. <tr bgcolor="#FFFFFF">
  209. <td height="23" colspan="2"><div align="right">
  210. <table width="100%" border="0" cellspacing="1" cellpadding="3">
  211. <tr>
  212. <td width="55%"><strong>空间主人: <a href="MemberGbook.php?sear=1&show=4&keyboard=<?=$r[userid]?><?=$ecms_hashur['ehref']?>">
  213. <?=$username?>
  214. </a> </strong></td>
  215. <td width="45%">
  216. <div align="left"><strong>操作:</strong>&nbsp;[<a href="MemberGbook.php?enews=hDelMemberGbook&gid=<?=$r[gid]?><?=$ecms_hashur['href']?>" onclick="return confirm('确认要删除?');">删除</a>]
  217. <input name="gid[]" type="checkbox" value="<?=$r[gid]?>">
  218. </div></td>
  219. </tr>
  220. </table>
  221. </div></td>
  222. </tr>
  223. </table>
  224. <br>
  225. <?
  226. }
  227. ?>
  228. <table width="700" border="0" align="center" cellpadding="3" cellspacing="1">
  229. <tr>
  230. <td>分页:
  231. <?=$returnpage?>
  232. &nbsp;&nbsp;
  233. <input type="submit" name="Submit2" value="批量删除" onClick="document.thisform.enews.value='hDelMemberGbook_All';">
  234. <input name="enews" type="hidden" id="enews" value="hDelMemberGbook_All">
  235. </td>
  236. </tr>
  237. </table>
  238. </form>
  239. </body>
  240. </html>
  241. <?
  242. db_close();
  243. $empire=null;
  244. ?>