国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
3.3KB

  1. <?php
  2. /**
  3. * 评论管理
  4. *
  5. * @version $Id: feedback_main.php 1 19:09 2010年7月12日Z tianya $
  6. * @package DedeCMS.Administrator
  7. * @copyright Copyright (c) 2007 - 2019, DesDev, Inc.
  8. * @license http://help.dedecms.com/usersguide/license.html
  9. * @link http://www.dedecms.com
  10. */
  11. require_once(dirname(__FILE__)."/config.php");
  12. //权限检查
  13. CheckPurview('sys_Feedback');
  14. require_once(DEDEINC."/datalistcp.class.php");
  15. require_once(DEDEINC."/typelink.class.php");
  16. setcookie("ENV_GOBACK_URL", $dedeNowurl, time()+3600, "/");
  17. function IsCheck($st)
  18. {
  19. return $st==1 ? "[已审核]" : "<font color='red'>[未审核]</font>";
  20. }
  21. function jsTrimjajx($str,$len)
  22. {
  23. $str = preg_replace("/{quote}(.*){\/quote}/is",'',$str);
  24. $str = str_replace('&lt;br/&gt;',' ',$str);
  25. $str = cn_substr($str,$len);
  26. $str = preg_replace("/['\"\r\n]/","",$str);
  27. $str = str_replace('&lt;', '<', $str);
  28. $str = str_replace('&gt;', '>', $str);
  29. return $str;
  30. }
  31. if(!empty($job))
  32. {
  33. $ids = preg_replace("#[^0-9,]#", '', $fid);
  34. if(empty($ids))
  35. {
  36. ShowMsg("你没选中任何选项!",$_COOKIE['ENV_GOBACK_URL'],0,500);
  37. exit;
  38. }
  39. }
  40. else
  41. {
  42. $job = '';
  43. }
  44. //删除评论
  45. if( $job == 'del' )
  46. {
  47. $query = "DELETE FROM `#@__feedback` WHERE id IN($ids) ";
  48. $dsql->ExecuteNoneQuery($query);
  49. ShowMsg("成功删除指定的评论!",$_COOKIE['ENV_GOBACK_URL'],0,500);
  50. exit();
  51. }
  52. //删除相同IP的所有评论
  53. else if( $job == 'delall' )
  54. {
  55. $dsql->SetQuery("SELECT ip FROM `#@__feedback` WHERE id IN ($ids) ");
  56. $dsql->Execute();
  57. $ips = '';
  58. while($row = $dsql->GetArray())
  59. {
  60. $ips .= ($ips=='' ? " ip = '{$row['ip']}' " : " Or ip = '{$row['ip']}' ");
  61. }
  62. if($ips!='')
  63. {
  64. $query = "DELETE FROM `#@__feedback` WHERE $ips ";
  65. $dsql->ExecuteNoneQuery($query);
  66. }
  67. ShowMsg("成功删除指定相同IP的所有评论!",$_COOKIE['ENV_GOBACK_URL'],0,500);
  68. exit();
  69. }
  70. //审核评论
  71. else if($job=='check')
  72. {
  73. $query = "UPDATE `#@__feedback` SET ischeck=1 WHERE id IN($ids) ";
  74. $dsql->ExecuteNoneQuery($query);
  75. ShowMsg("成功审核指定评论!", $_COOKIE['ENV_GOBACK_URL'], 0, 500);
  76. exit();
  77. }
  78. //浏览评论
  79. else
  80. {
  81. $bgcolor = '';
  82. $typeid = isset($typeid) && is_numeric($typeid) ? $typeid : 0;
  83. $aid = isset($aid) && is_numeric($aid) ? $aid : 0;
  84. $keyword = !isset($keyword) ? '' : $keyword;
  85. $ip = !isset($ip) ? '' : $ip;
  86. $tl = new TypeLink($typeid);
  87. $openarray = $tl->GetOptionArray($typeid,$admin_catalogs,0);
  88. $addsql = ($typeid != 0 ? " And typeid IN (".GetSonIds($typeid).")" : '');
  89. $addsql .= ($aid != 0 ? " And aid=$aid " : '');
  90. $addsql .= ($ip != '' ? " And ip LIKE '$ip' " : '');
  91. $querystring = "SELECT * FROM `#@__feedback` WHERE msg LIKE '%$keyword%' $addsql ORDER BY dtime DESC";
  92. $dlist = new DataListCP();
  93. $dlist->pageSize = 15;
  94. $dlist->SetParameter('aid', $aid);
  95. $dlist->SetParameter('ip', $ip);
  96. $dlist->SetParameter('typeid', $typeid);
  97. $dlist->SetParameter('keyword', $keyword);
  98. $dlist->SetTemplate(DEDEADMIN.'/templets/feedback_main.htm');
  99. $dlist->SetSource($querystring);
  100. $dlist->Display();
  101. }