OtherLinkShow.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?php
  2. define('EmpireCMSAdmin','1');
  3. require("../../class/connect.php");
  4. require("../../class/db_sql.php");
  5. require("../../class/functions.php");
  6. require '../'.LoadLang("pub/fun.php");
  7. require("../../data/dbcache/class.php");
  8. $link=db_connect();
  9. $empire=new mysqlquery();
  10. $editor=1;
  11. //验证用户
  12. $lur=is_login();
  13. $logininid=$lur['userid'];
  14. $loginin=$lur['username'];
  15. $loginrnd=$lur['rnd'];
  16. $loginlevel=$lur['groupid'];
  17. $loginadminstyleid=$lur['adminstyleid'];
  18. //ehash
  19. $ecms_hashur=hReturnEcmsHashStrAll();
  20. $classid=(int)$_GET['classid'];
  21. $id=(int)$_GET['id'];
  22. $enews=ehtmlspecialchars($_GET['enews']);
  23. $keyid=RepPostVar($_GET['keyid']);
  24. $delid=(int)$_GET['delid'];
  25. if(!$classid||!$class_r[$classid]['tbname'])
  26. {
  27. exit();
  28. }
  29. ?>
  30. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  31. <html>
  32. <head>
  33. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  34. <title>相关链接</title>
  35. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  36. </head>
  37. <body>
  38. <table width="100%" border="0" cellspacing="1" cellpadding="3" class="tableborder">
  39. <?php
  40. $ids='';
  41. $retids='';
  42. if($keyid)
  43. {
  44. $showlinknum=$class_r[$classid]['link_num'];
  45. if(!$showlinknum)
  46. {
  47. $showlinknum=10;
  48. }
  49. $dh='';
  50. $keyr=explode(',',$keyid);
  51. $count=count($keyr);
  52. $showno=0;
  53. for($i=0;$i<$count;$i++)
  54. {
  55. $infoid=(int)$keyr[$i];
  56. if(!$infoid||$infoid==$delid)
  57. {
  58. continue;
  59. }
  60. if($showno>$showlinknum)
  61. {
  62. break;
  63. }
  64. $ids.=$dh.$infoid;
  65. $dh=',';
  66. $showno++;
  67. }
  68. if($ids)
  69. {
  70. $dh='';
  71. $infosql=$empire->query("select isurl,titleurl,classid,id,newstime,username,userid,title from {$dbtbpre}ecms_".$class_r[$classid][tbname]." where id in (".$ids.") order by newstime desc limit ".$showlinknum);
  72. while($infor=$empire->fetch($infosql))
  73. {
  74. $retids.=$dh.$infor['id'];
  75. $dh=',';
  76. $titleurl=sys_ReturnBqTitleLink($infor);
  77. ?>
  78. <tr bgcolor="#ffffff" onmouseout="this.style.backgroundColor='#ffffff'" onmouseover="this.style.backgroundColor='#C3EFFF'">
  79. <td width="11%" height="25"> <div align="center">
  80. <?=$infor['id']?>
  81. </div></td>
  82. <td width="75%"><a href="<?=$titleurl?>" target="_blank" title="发布时间:<?=date('Y-m-d H:i:s',$infor['newstime'])?>">
  83. <?=stripSlashes($infor['title'])?>
  84. </a></td>
  85. <td width="14%"><div align="center"><a href="OtherLinkShow.php?classid=<?=$classid?>&id=<?=$id?>&enews=<?=$enews?>&keyid=<?=$ids?>&delid=<?=$infor['id']?><?=$ecms_hashur['ehref']?>" onclick="return confirm('确认要从相关链接移除?');">删</a></div></td>
  86. </tr>
  87. <?php
  88. }
  89. }
  90. }
  91. ?>
  92. </table>
  93. <script>
  94. parent.document.otherlinkform.returnkeyid.value='<?=$retids?>';
  95. parent.document.searchinfoform.returnkeyid.value='<?=$retids?>';
  96. </script>
  97. </body>
  98. </html>
  99. <?php
  100. db_close();
  101. $empire=null;
  102. ?>