国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

search_keywords_main.php 4.6KB

vor 2 Jahren
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. /**
  3. * 搜索关键词管理
  4. *
  5. * @version $Id: search_keywords_main.php 1 15:46 2010年7月20日Z tianya $
  6. * @package DedeBIZ.Administrator
  7. * @copyright Copyright (c) 2022, DedeBIZ.COM
  8. * @license https://www.dedebiz.com/license
  9. * @link https://www.dedebiz.com
  10. */
  11. require_once(dirname(__FILE__)."/config.php");
  12. setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/");
  13. if (empty($pagesize)) $pagesize = 30;
  14. if (empty($pageno)) $pageno = 1;
  15. if (empty($dopost)) $dopost = '';
  16. if (empty($orderby)) $orderby = 'aid';
  17. //重载列表
  18. if ($dopost == 'getlist') {
  19. AjaxHead();
  20. GetKeywordList($dsql, $pageno, $pagesize, $orderby);
  21. exit();
  22. }
  23. //更新字段
  24. else if ($dopost == 'update') {
  25. $aid = preg_replace("#[^0-9]#", "", $aid);
  26. $count = preg_replace("#[^0-9]#", "", $count);
  27. $keyword = trim($keyword);
  28. $spwords = trim($spwords);
  29. $dsql->ExecuteNoneQuery("UPDATE `#@__search_keywords` SET keyword='$keyword',spwords='$spwords',count='$count' WHERE aid='$aid';");
  30. AjaxHead();
  31. GetKeywordList($dsql, $pageno, $pagesize, $orderby);
  32. exit();
  33. }
  34. //删除字段
  35. else if ($dopost == 'del') {
  36. $aid = preg_replace("#[^0-9]#", "", $aid);
  37. $dsql->ExecuteNoneQuery("DELETE FROM `#@__search_keywords` WHERE aid='$aid';");
  38. AjaxHead();
  39. GetKeywordList($dsql, $pageno, $pagesize, $orderby);
  40. exit();
  41. }
  42. //批量删除字段
  43. else if ($dopost == 'delall') {
  44. foreach ($aids as $aid) {
  45. $dsql->ExecuteNoneQuery("DELETE FROM `#@__search_keywords` WHERE aid='$aid';");
  46. }
  47. ShowMsg("删除成功", $ENV_GOBACK_URL);
  48. exit();
  49. }
  50. //第一次进入这个页面
  51. if ($dopost == '') {
  52. $row = $dsql->GetOne("SELECT COUNT(*) AS dd FROM `#@__search_keywords` ");
  53. $totalRow = $row['dd'];
  54. include(DEDEADMIN."/templets/search_keywords_main.htm");
  55. }
  56. //获得特定的关键词列表
  57. function GetKeywordList($dsql, $pageno, $pagesize, $orderby = 'aid')
  58. {
  59. global $cfg_phpurl;
  60. $start = ($pageno - 1) * $pagesize;
  61. $printhead = "<form name='form3' action=\"search_keywords_main.php\" method=\"post\">
  62. <input name=\"dopost\" type=\"hidden\" value=\"\">
  63. <table width='98%' cellpadding='1' cellspacing='1' style='margin-bottom:10px' align='center' class='table maintable'>
  64. <tr align='center' bgcolor='#F8FCF1' height='26'>
  65. <td width='5%'>选择</td>
  66. <td width='6%' height='26'><a href='javascript:;' onclick=\"ReloadPage('aid')\">ID</a></td>
  67. <td width='20%'>关键词</td>
  68. <td width='30%'>分词结果</td>
  69. <td width='6%'><a href='javascript:;' onclick=\"ReloadPage('count')\">频率</a></td>
  70. <td width='6%'><a href='javascript:;' onclick=\"ReloadPage('result')\">结果</a></td>
  71. <td width='15%'><a href='javascript:;' onclick=\"ReloadPage('lasttime')\">最后搜索时间</a></td>
  72. <td>管理</td>
  73. </tr>\r\n
  74. ";
  75. echo $printhead;
  76. if ($orderby == 'result') $orderby = $orderby." ASC";
  77. else $orderby = $orderby." DESC";
  78. $dsql->SetQuery("SELECT * FROM `#@__search_keywords` ORDER BY $orderby LIMIT $start,$pagesize ");
  79. $dsql->Execute();
  80. while ($row = $dsql->GetArray()) {
  81. $line = "
  82. <tr align='center' onMouseMove=\"javascript:this.bgColor='#F8FCF1';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
  83. <td height='26'><input name=\"aids[]\" type=\"checkbox\" class=\"np\" value=\"{$row['aid']}\" /></td>
  84. <td height='26'>{$row['aid']}</td>
  85. <td><input name='keyword' type='text' id='keyword{$row['aid']}' value='{$row['keyword']}' style='width:93%;'></td>
  86. <td><input name='spwords' type='text' id='spwords{$row['aid']}' value='{$row['spwords']}' style='width:95%;'></td>
  87. <td><input name='count' type='text' id='count{$row['aid']}' value='{$row['count']}' size='5'></td>
  88. <td><a href='{$cfg_phpurl}/search.php?kwtype=0&keyword=".urlencode($row['keyword'])."&searchtype=titlekeyword' target='_blank'>{$row['result']}</a></td>
  89. <td>".MyDate("Y-m-d H:i:s", $row['lasttime'])."</td>
  90. <td>
  91. <a href='javascript:;' onclick='UpdateNote({$row['aid']})' class='btn btn-success btn-sm'>更新</a>
  92. <a href='javascript:;' onclick='DelNote({$row['aid']})' class='btn btn-success btn-sm'>删除</a>
  93. </td>
  94. </tr>
  95. ";
  96. echo $line;
  97. }
  98. echo "<tr align='left' height='26'>
  99. <td colspan='8' style='padding-left:10px;'>
  100. <a href='javascript:selAll()' class='btn btn-success btn-sm'>反选</a>
  101. <a href='javascript:noselAll()' class='btn btn-success btn-sm'>取消</a>
  102. <a href='javascript:delall()' class='btn btn-success btn-sm'>删除</a>
  103. </td>
  104. </tr>\r\n";
  105. echo "</table></form>\r\n";
  106. }