DoUpdateData.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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,"changedata");
  20. //栏目
  21. $fcfile="../../data/fc/ListEnews.php";
  22. $class="<script src=../../data/fc/cmsclass.js></script>";
  23. if(!file_exists($fcfile))
  24. {$class=ShowClass_AddClass("",0,0,"|-",0,0);}
  25. //刷新表
  26. $retable="";
  27. $selecttable="";
  28. $cleartable='';
  29. $i=0;
  30. $tsql=$empire->query("select tid,tbname,tname from {$dbtbpre}enewstable where intb=0 order by tid");
  31. while($tr=$empire->fetch($tsql))
  32. {
  33. $i++;
  34. if($i%4==0)
  35. {
  36. $br="<br>";
  37. }
  38. else
  39. {
  40. $br="";
  41. }
  42. $retable.="<input type=checkbox name=tbname[] value='$tr[tbname]' checked>$tr[tname]&nbsp;&nbsp;".$br;
  43. $selecttable.="<option value='".$tr[tbname]."'>".$tr[tname]."</option>";
  44. $cleartable.="<option value='".$tr[tid]."'>".$tr[tname]."</option>";
  45. }
  46. //专题
  47. $ztclass="";
  48. $ztsql=$empire->query("select ztid,ztname from {$dbtbpre}enewszt order by ztid desc");
  49. while($ztr=$empire->fetch($ztsql))
  50. {
  51. $ztclass.="<option value='".$ztr['ztid']."'>".$ztr['ztname']."</option>";
  52. }
  53. //选择日期
  54. $todaydate=date("Y-m-d");
  55. $todaytime=time();
  56. $changeday="<select name=selectday onchange=\"document.reform.startday.value=this.value;document.reform.endday.value='".$todaydate."'\">
  57. <option value='".$todaydate."'>--选择--</option>
  58. <option value='".$todaydate."'>今天</option>
  59. <option value='".ToChangeTime($todaytime,7)."'>一周</option>
  60. <option value='".ToChangeTime($todaytime,30)."'>一月</option>
  61. <option value='".ToChangeTime($todaytime,90)."'>三月</option>
  62. <option value='".ToChangeTime($todaytime,180)."'>半年</option>
  63. <option value='".ToChangeTime($todaytime,365)."'>一年</option>
  64. </select>";
  65. ?>
  66. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  67. <html>
  68. <head>
  69. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  70. <title>数据整理</title>
  71. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  72. <script type="text/javascript" src="../ecmseditor/js/jstime/WdatePicker.js"></script>
  73. <script>
  74. function CheckAll(form)
  75. {
  76. for (var i=0;i<form.elements.length;i++)
  77. {
  78. var e = form.elements[i];
  79. if (e.name != 'chkall')
  80. e.checked = form.chkall.checked;
  81. }
  82. }
  83. </script>
  84. </head>
  85. <body>
  86. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  87. <tr>
  88. <td width="12%" height="25">位置:<a href="DoUpdateData.php<?=$ecms_hashur['whehref']?>">数据整理</a></td>
  89. <td width="42%"><table width="460" border="0" align="center" cellpadding="0" cellspacing="0">
  90. <tr>
  91. <td> <div align="center">[<a href="#IfTotalPlNum">批量更新信息评论数</a>]</div></td>
  92. <td> <div align="center">[<a href="#IfOtherInfo">批量更新相关链接</a>]</div></td>
  93. <td><div align="center">[<a href="#IfClearBreakInfo">清理多余信息</a>]</div></td>
  94. </tr>
  95. </table></td>
  96. <td width="46%"><div align="right" class="emenubutton">
  97. <input type="button" name="Submit52" value="数据更新中心" onclick="self.location.href='ChangeData.php<?=$ecms_hashur['whehref']?>';">
  98. &nbsp;&nbsp;
  99. <input type="button" name="Submit522" value="更新信息页地址" onclick="self.location.href='ReInfoUrl.php<?=$ecms_hashur['whehref']?>';">
  100. &nbsp;&nbsp;
  101. <input type="button" name="Submit522" value="更新动态页缓存" onclick="self.location.href='ChangePageCache.php<?=$ecms_hashur['whehref']?>';">
  102. </div></td>
  103. </tr>
  104. </table>
  105. <form action="../ecmspl.php" method="get" name="form1" target="_blank" onsubmit="return confirm('确认要更新?');">
  106. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder" id=IfTotalPlNum>
  107. <?=$ecms_hashur['form']?>
  108. <input name="from" type="hidden" id="from" value="ReHtml/DoUpdateData.php<?=$ecms_hashur['whehref']?>">
  109. <tr class="header">
  110. <td height="25"> <div align="center">批量更新信息评论数</div></td>
  111. </tr>
  112. <tr>
  113. <td height="25" bgcolor="#FFFFFF"> <div align="center">
  114. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  115. <tr>
  116. <td height="25">数据表:</td>
  117. <td height="25"> <select name="tbname" id="tbname">
  118. <option value=''>------ 选择数据表 ------</option>
  119. <?=$selecttable?>
  120. </select>
  121. (*) </td>
  122. </tr>
  123. <tr>
  124. <td height="25">栏目</td>
  125. <td height="25"><select name="classid">
  126. <option value="0">所有栏目</option>
  127. <?=$class?>
  128. </select>
  129. <font color="#666666">(如选择父栏目,将更新所有子栏目)</font></td>
  130. </tr>
  131. <tr>
  132. <td width="23%" height="25"> <input name="retype" type="radio" value="0" checked>
  133. 按时间更新:</td>
  134. <td width="77%" height="25">从
  135. <input name="startday" type="text" size="15" class="Wdate" onClick="WdatePicker({skin:'default',dateFmt:'yyyy-MM-dd'})">
  136. <input name="endday" type="text" size="15" class="Wdate" onClick="WdatePicker({skin:'default',dateFmt:'yyyy-MM-dd'})">
  137. 之间的信息 <font color="#666666">(不填将更新所有信息)</font></td>
  138. </tr>
  139. <tr>
  140. <td height="25"> <input name="retype" type="radio" value="1">
  141. 按ID更新:</td>
  142. <td height="25">从
  143. <input name="startid" type="text" value="0" size="6">
  144. <input name="endid" type="text" value="0" size="6">
  145. 之间的信息 <font color="#666666">(两个值为0将更新所有信息)</font></td>
  146. </tr>
  147. <tr>
  148. <td height="25">指定固定信息ID:</td>
  149. <td height="25"><input name="doids" type="text" id="doids" size="50">
  150. <font color="#666666">(多个ID可用半角逗号“,”隔开)</font></td>
  151. </tr>
  152. <tr>
  153. <td height="25">&nbsp;</td>
  154. <td height="25"><input type="submit" name="Submit62" value="开始更新">
  155. <input type="reset" name="Submit72" value="重置"> <input name="enews" type="hidden" value="UpdateAllInfoPlnum"> </td>
  156. </tr>
  157. <tr>
  158. <td height="25" colspan="2"><font color="#666666">说明:当信息表里的评论数与实际评论数不符时使用。</font></td>
  159. </tr>
  160. </table>
  161. </div></td>
  162. </tr>
  163. </table>
  164. </form>
  165. <form action="../ecmscom.php" method="get" name="form1" target="_blank" onsubmit="return confirm('确认要更新?');">
  166. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder" id=IfOtherInfo>
  167. <?=$ecms_hashur['form']?>
  168. <input name="from" type="hidden" id="from" value="ReHtml/DoUpdateData.php<?=$ecms_hashur['whehref']?>">
  169. <tr class="header">
  170. <td height="25"> <div align="center">批量更新相关链接</div></td>
  171. </tr>
  172. <tr>
  173. <td height="25" bgcolor="#FFFFFF"> <div align="center">
  174. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  175. <tr>
  176. <td height="25">数据表:</td>
  177. <td height="25"> <select name="tbname" id="tbname">
  178. <option value=''>------ 选择数据表 ------</option>
  179. <?=$selecttable?>
  180. </select>
  181. (*) </td>
  182. </tr>
  183. <tr>
  184. <td height="25">栏目</td>
  185. <td height="25"><select name="classid">
  186. <option value="0">所有栏目</option>
  187. <?=$class?>
  188. </select>
  189. <font color="#666666">(如选择父栏目,将更新所有子栏目)</font></td>
  190. </tr>
  191. <tr>
  192. <td width="23%" height="25"> <input name="retype" type="radio" value="0" checked>
  193. 按时间更新:</td>
  194. <td width="77%" height="25">从
  195. <input name="startday" type="text" size="15" class="Wdate" onClick="WdatePicker({skin:'default',dateFmt:'yyyy-MM-dd'})">
  196. <input name="endday" type="text" size="15" class="Wdate" onClick="WdatePicker({skin:'default',dateFmt:'yyyy-MM-dd'})">
  197. 之间的信息 <font color="#666666">(不填将更新所有信息)</font></td>
  198. </tr>
  199. <tr>
  200. <td height="25"> <input name="retype" type="radio" value="1">
  201. 按ID更新:</td>
  202. <td height="25">从
  203. <input name="startid" type="text" value="0" size="6">
  204. <input name="endid" type="text" value="0" size="6">
  205. 之间的信息 <font color="#666666">(两个值为0将更新所有信息)</font></td>
  206. </tr>
  207. <tr>
  208. <td height="25">&nbsp;</td>
  209. <td height="25"><input type="submit" name="Submit62" value="开始更新">
  210. <input type="reset" name="Submit72" value="重置"> <input name="enews" type="hidden" value="ChangeInfoOtherLink">
  211. </td>
  212. </tr>
  213. <tr>
  214. <td height="25" colspan="2"><font color="#666666">友情提醒:此功能比较耗资源,非必要时请勿用。</font></td>
  215. </tr>
  216. </table>
  217. </div></td>
  218. </tr>
  219. </table>
  220. </form>
  221. <form action="../ecmscom.php" method="POST" name="form1" onsubmit="return confirm('确认要清理?');">
  222. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder" id="IfClearBreakInfo">
  223. <?=$ecms_hashur['form']?>
  224. <tr class="header">
  225. <td height="25" colspan="2"> <div align="center">清理多余信息</div></td>
  226. </tr>
  227. <tr>
  228. <td width="20%" height="25" bgcolor="#FFFFFF">选择要清理的数据表</td>
  229. <td width="80%" bgcolor="#FFFFFF"><select name="tid" id="tid">
  230. <option value=''>------ 选择数据表 ------</option>
  231. <?=$cleartable?>
  232. </select>
  233. *</td>
  234. </tr>
  235. <tr>
  236. <td height="25" bgcolor="#FFFFFF">&nbsp;</td>
  237. <td bgcolor="#FFFFFF"><input type="submit" name="Submit6" value="马上清理">
  238. <input name="enews" type="hidden" id="enews2" value="ClearBreakInfo"> </td>
  239. </tr>
  240. </table>
  241. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  242. <tr>
  243. <td height="25"><font color="#666666">说明: 当生成信息内容页时提示如下错误时使用本功能来清理多余信息:<br>
  244. 生成内容页提示“Table '*.phome_ecms_' doesn't exist......update ***_ecms_ set havehtml=1 where id='' limit 1”时使用。</font></td>
  245. </tr>
  246. </table>
  247. </form>
  248. <p>&nbsp;</p>
  249. <p>&nbsp;</p>
  250. <p>&nbsp;</p>
  251. <p><br>
  252. </p>
  253. </body>
  254. </html>
  255. <?
  256. db_close();
  257. $empire=null;
  258. ?>