ShowInfo.php 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <?php
  2. define('EmpireCMSAdmin','1');
  3. require("../class/connect.php");
  4. require("../class/db_sql.php");
  5. require("../class/functions.php");
  6. require("../data/dbcache/class.php");
  7. require("../data/dbcache/MemberLevel.php");
  8. $link=db_connect();
  9. $empire=new mysqlquery();
  10. //验证用户
  11. $lur=is_login();
  12. $logininid=$lur['userid'];
  13. $loginin=$lur['username'];
  14. $loginrnd=$lur['rnd'];
  15. $loginlevel=$lur['groupid'];
  16. $loginadminstyleid=$lur['adminstyleid'];
  17. //ehash
  18. $ecms_hashur=hReturnEcmsHashStrAll();
  19. $id=(int)$_GET['id'];
  20. $classid=(int)$_GET['classid'];
  21. if(empty($class_r[$classid][classid])||!$id)
  22. {
  23. printerror("ErrorUrl","history.go(-1)");
  24. }
  25. //验证权限
  26. $doselfinfo=CheckLevel($logininid,$loginin,$classid,"news");
  27. if(!$class_r[$classid][tbname]||!$class_r[$classid][classid])
  28. {
  29. printerror("ErrorUrl","history.go(-1)");
  30. }
  31. //非终极栏目
  32. if(!$class_r[$classid]['islast'])
  33. {
  34. printerror("AddInfoErrorClassid","history.go(-1)");
  35. }
  36. $bclassid=$class_r[$classid][bclassid];
  37. $fun_r['AdminInfo']='管理信息';
  38. //模型
  39. $fieldexp="<!--field--->";
  40. $recordexp="<!--record-->";
  41. $tbname=$class_r[$classid][tbname];
  42. $mid=$class_r[$classid][modid];
  43. $mr=$empire->fetch1("select enter,tbname from {$dbtbpre}enewsmod where mid='$mid'");
  44. if(empty($mr['tbname']))
  45. {
  46. printerror("ErrorUrl","history.go(-1)");
  47. }
  48. $enter=$mr['enter'];
  49. $savetxtf=$emod_r[$mid]['savetxtf'];
  50. //导航
  51. $url=AdminReturnClassLink($classid).'&nbsp;>&nbsp;查看信息';
  52. //状态
  53. $addecmscheck='';
  54. $ecmscheck=(int)$_GET['ecmscheck'];
  55. $indexchecked=1;
  56. if($ecmscheck)
  57. {
  58. $addecmscheck='&ecmscheck='.$ecmscheck;
  59. $indexchecked=0;
  60. }
  61. //索引表
  62. $index_r=$empire->fetch1("select id,classid,checked from {$dbtbpre}ecms_".$tbname."_index where id='$id' limit 1");
  63. if(!$index_r['id']||$index_r['classid']!=$classid)
  64. {
  65. printerror("ErrorUrl","history.go(-1)");
  66. }
  67. //主表
  68. $infotb=ReturnInfoMainTbname($tbname,$index_r['checked']);//返回表
  69. $r=$empire->fetch1("select * from ".$infotb." where id='$id' limit 1");
  70. $r[newstime]=date("Y-m-d H:i:s",$r[newstime]);
  71. //副表
  72. $infodatatb=ReturnInfoDataTbname($tbname,$index_r['checked'],$r['stb']);//返回副表
  73. $finfor=$empire->fetch1("select ".ReturnSqlFtextF($mid)." from ".$infodatatb." where id='$id'");
  74. $r=array_merge($r,$finfor);
  75. //内容存文本
  76. if($savetxtf)
  77. {
  78. $r[$savetxtf]=GetTxtFieldText($r[$savetxtf]);
  79. }
  80. //发布者
  81. if($r[ismember])
  82. {
  83. $username=empty($r[userid])?'游客':"会员:<a href='member/AddMember.php?enews=EditMember&userid=".$r[userid].$ecms_hashur['ehref']."' target='_blank'>".$r[username]."</a>";
  84. }
  85. else
  86. {
  87. $username="<a href='user/AddUser.php?enews=EditUser&userid=".$r[userid].$ecms_hashur['ehref']."' target='_blank'>".$r[username]."</a>";
  88. }
  89. //状态
  90. $st='';
  91. if($index_r[checked])//审核
  92. {
  93. $st.="[已审核]&nbsp;&nbsp;";
  94. }
  95. else
  96. {
  97. $st.="[未审核]&nbsp;&nbsp;";
  98. }
  99. if($r[istop])//置顶
  100. {
  101. $st.="[顶".$r[istop]."]&nbsp;&nbsp;";
  102. }
  103. if($r[isgood])//推荐
  104. {
  105. $st.="[推".$r[isgood]."]&nbsp;&nbsp;";
  106. }
  107. if($r[firsttitle])//头条
  108. {
  109. $st.="[头".$r[firsttitle]."]";
  110. }
  111. //标题
  112. $titleurl=sys_ReturnBqTitleLink($r);
  113. //$r[title]="<a href='$titleurl' target='_blank'>".DoTitleFont($r[titlefont],$r[title])."</a>";
  114. //权限
  115. $group='';
  116. if($r[groupid])
  117. {
  118. $group=$level_r[$r[groupid]][groupname];
  119. if($r[userfen])
  120. {
  121. $group.=" ,扣除点数:".$r[userfen];
  122. }
  123. }
  124. //栏目链接
  125. $classurl=sys_ReturnBqClassname($r,9);
  126. $getclassurlr['classid']=$bclassid;
  127. $bclassurl=sys_ReturnBqClassname($getclassurlr,9);
  128. $classes="<a href='$bclassurl' target='_blank'>".$class_r[$bclassid][classname]."</a>&nbsp;>&nbsp;<a href='$classurl' target='_blank'>".$class_r[$classid][classname]."</a>";
  129. //专题
  130. $zts='';
  131. if($r[ztid]&&$r[ztid]<>'|')
  132. {
  133. $ztr=explode('|',$r[ztid]);
  134. $count=count($ztr)-1;
  135. for($i=1;$i<$count;$i++)
  136. {
  137. $zturlr[ztid]=$ztr[$i];
  138. $zturl=sys_ReturnBqZtname($zturlr);
  139. $zts.="<a href='$zturl' target='_blank'>".$class_zr[$ztr[$i]][ztname]."</a>&nbsp;&nbsp;";
  140. }
  141. }
  142. //标题分类
  143. $titletype=$class_tr[$r[ttid]]['tname'];
  144. //信息状态
  145. $einfochecked=$index_r['checked'];
  146. $einfoismember=$r['ismember'];
  147. //------ 编辑器内容显示 ------
  148. $seteshoweditorhtml=3;
  149. $eshoweditorhtml=0;
  150. if($seteshoweditorhtml)
  151. {
  152. if($seteshoweditorhtml==1)//所有
  153. {
  154. $eshoweditorhtml=1;
  155. }
  156. elseif($seteshoweditorhtml==2)//所有未审核
  157. {
  158. if(!$einfochecked)
  159. {
  160. $eshoweditorhtml=1;
  161. }
  162. }
  163. elseif($seteshoweditorhtml==3)//所有投稿
  164. {
  165. if($einfoismember)
  166. {
  167. $eshoweditorhtml=1;
  168. }
  169. }
  170. elseif($seteshoweditorhtml==4)//所有未审核投稿
  171. {
  172. if($einfoismember&&!$einfochecked)
  173. {
  174. $eshoweditorhtml=1;
  175. }
  176. }
  177. else
  178. {
  179. $eshoweditorhtml=1;
  180. }
  181. }
  182. $toshowhtmlbutton=0;
  183. if($eshoweditorhtml)
  184. {
  185. $toshowhtmlbutton=1;
  186. }
  187. //------ 编辑器内容显示 ------
  188. //显示编辑器内容
  189. $eckshowhtml=(int)$_GET['ckshowhtml'];
  190. $ethisshowhtml='1'.date("md").$logininid;
  191. $ethisshowhtml=(int)$ethisshowhtml;
  192. if($ethisshowhtml==$eckshowhtml)
  193. {
  194. $eshoweditorhtml=0;
  195. }
  196. //切换地址
  197. if(!$eckshowhtml)
  198. {
  199. $showhtmlbutton='点击可视化模式显示';
  200. $showhtmlurl='ShowInfo.php?classid='.$r['classid'].'&id='.$r['id'].$addecmscheck.$ecms_hashur['ehref'].'&ckshowhtml='.$ethisshowhtml;
  201. }
  202. else
  203. {
  204. $showhtmlbutton='点击源码模式显示';
  205. $showhtmlurl='ShowInfo.php?classid='.$r['classid'].'&id='.$r['id'].$addecmscheck.$ecms_hashur['ehref'];
  206. }
  207. ?>
  208. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  209. <html>
  210. <head>
  211. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  212. <title>查看信息</title>
  213. <link href="adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  214. </head>
  215. <body>
  216. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  217. <tr>
  218. <td height="25">位置:<?=$url?></td>
  219. </tr>
  220. </table>
  221. <form name="form1" method="post" action="ecmsinfo.php">
  222. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder" style="word-wrap: break-word">
  223. <?=$ecms_hashur['eform']?>
  224. <tr class="header">
  225. <td height="25" colspan="2"><div align="center">
  226. <table width="100%" border="0" cellspacing="1" cellpadding="3">
  227. <tr>
  228. <td width="50%"><strong><font color="#FFFFFF">查看信息</font></strong></td>
  229. <td width="50%"><div align="right">
  230. <?php
  231. if($toshowhtmlbutton)
  232. {
  233. ?>
  234. <input name="button" type="button" id="button" value="<?=$showhtmlbutton?>" onclick="self.location.href='<?=$showhtmlurl?>';">
  235. <?php
  236. }
  237. ?>
  238. </div></td>
  239. </tr>
  240. </table>
  241. </div></td>
  242. </tr>
  243. <tr>
  244. <td width="13%" height="25" bgcolor="#FFFFFF">
  245. <div align="right"><strong>发布者</strong></div></td>
  246. <td bgcolor="#FFFFFF">
  247. <?=$username?> </td>
  248. </tr>
  249. <tr>
  250. <td height="25" bgcolor="#FFFFFF"><div align="right"><strong>发布时间</strong></div></td>
  251. <td bgcolor="#FFFFFF">增加时间:
  252. <?=date("Y-m-d H:i:s",$r[truetime])?>
  253. ,最后修改:
  254. <?=date("Y-m-d H:i:s",$r[lastdotime])?> </td>
  255. </tr>
  256. <tr>
  257. <td height="25" bgcolor="#FFFFFF"><div align="right"><strong>人气</strong></div></td>
  258. <td bgcolor="#FFFFFF">点击数:
  259. <?=$r[onclick]?>
  260. ,评论数:
  261. <?=$r[plnum]?>
  262. ,下载数:
  263. <?=$r[totaldown]?> </td>
  264. </tr>
  265. <tr>
  266. <td height="25" bgcolor="#FFFFFF"><div align="right"><strong>信息状态</strong></div></td>
  267. <td bgcolor="#FFFFFF">
  268. <?=$st?> </td>
  269. </tr>
  270. <tr>
  271. <td height="25" bgcolor="#FFFFFF"><div align="right"><strong>栏目</strong></div></td>
  272. <td bgcolor="#FFFFFF">
  273. <?=$classes?> </td>
  274. </tr>
  275. <tr>
  276. <td height="25" bgcolor="#FFFFFF"><div align="right"><strong>专题</strong></div></td>
  277. <td bgcolor="#FFFFFF">
  278. <?=$zts?> </td>
  279. </tr>
  280. <tr>
  281. <td height="25" bgcolor="#FFFFFF"><div align="right"><strong>标题分类</strong></div></td>
  282. <td bgcolor="#FFFFFF">
  283. <?=$titletype?> </td>
  284. </tr>
  285. <tr>
  286. <td height="25" bgcolor="#FFFFFF"><div align="right"><strong>关键字</strong></div></td>
  287. <td bgcolor="#FFFFFF">
  288. <?=$r[keyboard]?> </td>
  289. </tr>
  290. <tr>
  291. <td height="25" bgcolor="#FFFFFF"><div align="right"><strong>相关信息ID</strong></div></td>
  292. <td bgcolor="#FFFFFF">
  293. <?=$r[keyid]?> </td>
  294. </tr>
  295. <tr>
  296. <td height="25" bgcolor="#FFFFFF"><div align="right"><strong>查看权限</strong></div></td>
  297. <td bgcolor="#FFFFFF">
  298. <?=$group?> </td>
  299. </tr>
  300. <tr>
  301. <td height="25" bgcolor="#FFFFFF"><div align="right"><strong>页面链接</strong></div></td>
  302. <td bgcolor="#FFFFFF"><a href="<?=$titleurl?>" target="_blank"><?=$titleurl?></a></td>
  303. </tr>
  304. <?php
  305. $fr=explode($recordexp,$enter);
  306. $count=count($fr)-1;
  307. for($i=0;$i<$count;$i++)
  308. {
  309. $fr1=explode($fieldexp,$fr[$i]);
  310. $fname=$fr1[0];
  311. $f=$fr1[1];
  312. if($f=="special.field")
  313. {
  314. continue;
  315. }
  316. ?>
  317. <tr>
  318. <td width="13%" height="25" bgcolor="#FFFFFF"><div align="right"> <strong>
  319. <?=$fname?>
  320. </strong> </div></td>
  321. <td width="87%" bgcolor="#FFFFFF">
  322. <?php
  323. if(!$eshoweditorhtml)
  324. {
  325. ?>
  326. <?=stripSlashes($r[$f])?>
  327. <?php
  328. }
  329. else
  330. {
  331. ?>
  332. <?=nl2br(eDoRepShowStr(stripSlashes($r[$f]),1))?>
  333. <?php
  334. }
  335. ?>
  336. </td>
  337. </tr>
  338. <?php
  339. }
  340. ?>
  341. <tr class="header">
  342. <td height="25" colspan="2">
  343. <div align="right">
  344. <table width="100%" border="0" cellspacing="1" cellpadding="3">
  345. <tr>
  346. <td width="50%">&nbsp;</td>
  347. <td width="50%"><div align="right">
  348. <?php
  349. if($toshowhtmlbutton)
  350. {
  351. ?>
  352. <input name="button2" type="button" id="button2" value="<?=$showhtmlbutton?>" onclick="self.location.href='<?=$showhtmlurl?>';">
  353. <?php
  354. }
  355. ?>
  356. </div></td>
  357. </tr>
  358. </table>
  359. </div></td>
  360. </tr>
  361. </table>
  362. </form>
  363. </body>
  364. </html>
  365. <?php
  366. db_close();
  367. $empire=null;
  368. ?>