国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

92 satır
3.5KB

  1. <?php
  2. /**
  3. * 自由列表管理
  4. *
  5. * @version $Id: freelist_main.php 1 8:48 2010年7月13日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. CheckPurview('c_FreeList');
  13. require_once DEDEINC.'/channelunit.func.php';
  14. setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/");
  15. if(empty($pagesize)) $pagesize = 30;
  16. if(empty($pageno)) $pageno = 1;
  17. if(empty($dopost)) $dopost = '';
  18. if(empty($orderby)) $orderby = 'aid';
  19. if(empty($keyword))
  20. {
  21. $keyword = '';
  22. $addget = '';
  23. $addsql = '';
  24. } else {
  25. $addget = '&keyword='.urlencode($keyword);
  26. $addsql = " where title like '%$keyword%' ";
  27. }
  28. //重载列表
  29. if($dopost=='getlist')
  30. {
  31. AjaxHead();
  32. GetTagList($dsql,$pageno,$pagesize,$orderby);
  33. exit();
  34. }
  35. //删除字段
  36. else if($dopost=='del')
  37. {
  38. $aid = preg_replace("#[^0-9]#", "", $aid);
  39. $dsql->ExecuteNoneQuery("DELETE FROM `#@__freelist` WHERE aid='$aid'; ");
  40. AjaxHead();
  41. GetTagList($dsql,$pageno,$pagesize,$orderby);
  42. exit();
  43. }
  44. //第一次进入这个页面
  45. if($dopost=='')
  46. {
  47. $row = $dsql->GetOne("SELECT COUNT(*) AS dd FROM `#@__freelist` $addsql ");
  48. $totalRow = $row['dd'];
  49. include(DEDEADMIN."/templets/freelist_main.htm");
  50. }
  51. /**
  52. * 获得特定的Tag列表
  53. *
  54. * @param object $dsql
  55. * @param int $pageno
  56. * @param int $pagesize
  57. * @param string $orderby
  58. */
  59. function GetTagList($dsql,$pageno,$pagesize,$orderby='aid')
  60. {
  61. global $cfg_phpurl,$addsql;
  62. $start = ($pageno-1) * $pagesize;
  63. $printhead ="<table width='98%' cellpadding='1' cellspacing='1' align='center' class='table maintable' style='margin-bottom:10px'>
  64. <tr align='center' bgcolor='#F8FCF1'>
  65. <td width='5%' class='tbsname'><a href='javascript:;' onclick=\"ReloadPage('aid')\">ID</a></td>
  66. <td width='20%' class='tbsname'>列表名称</td>
  67. <td width='20%' class='tbsname'>模板文件</td>
  68. <td width='5%' class='tbsname'><a href='javascript:;' onclick=\"ReloadPage('click')\">点击</a></td>
  69. <td width='15%' class='tbsname'>创建时间</td>
  70. <td class='tbsname'>管理</td>
  71. </tr>\r\n";
  72. echo $printhead;
  73. $dsql->SetQuery("Select aid,title,templet,click,edtime,namerule,listdir,defaultpage,nodefault From #@__freelist $addsql order by $orderby desc limit $start,$pagesize ");
  74. $dsql->Execute();
  75. while($row = $dsql->GetArray())
  76. {
  77. $listurl = GetFreeListUrl($row['aid'],$row['namerule'],$row['listdir'],$row['defaultpage'],$row['nodefault']);
  78. $line = "<tr align='center' onMouseMove=\"javascript:this.bgColor='#F8FCF1';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\">
  79. <td>{$row['aid']}</td>
  80. <td> <a href='$listurl' target='_blank'>{$row['title']}</a> </td>
  81. <td> {$row['templet']} </td>
  82. <td> {$row['click']} </td>
  83. <td>".MyDate("y-m-d",$row['edtime'])."</td>
  84. <td> <a href='javascript:;' onclick='EditNote({$row['aid']})' class='btn btn-success btn-sm'><i class=\"fa fa-pencil-square-o\" aria-hidden=\"true\"></i> 修改</a>
  85. <a href='javascript:;' onclick='CreateNote({$row['aid']})' class='btn btn-success btn-sm'><i class=\"fa fa-refresh\" aria-hidden=\"true\"></i> 更新</a>
  86. <a href='javascript:;' onclick='DelNote({$row['aid']})' class='btn btn-success btn-sm'><i class=\"fa fa-trash\" aria-hidden=\"true\"></i> 删除</a>
  87. </td>
  88. </tr>";
  89. echo $line;
  90. }
  91. echo "</table>\r\n";
  92. }