国内流行的内容管理系统(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.

118 lines
4.3KB

  1. <?php
  2. /**
  3. * 文档规则采集
  4. *
  5. * @version $Id: article_coonepage_rule.php 1 14:12 2010年7月12日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. require_once(DEDEINC."/datalistcp.class.php");
  13. setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/");
  14. if (empty($action)) $action = '';
  15. /*------
  16. function _AddNote(){ }
  17. -------*/
  18. if ($action == 'add') {
  19. $row = $dsql->GetOne("SELECT * FROM `#@__co_onepage` WHERE url LIKE '$url' ");
  20. if (is_array($row)) {
  21. echo "系统已经存在这个网址的条目";
  22. } else {
  23. $query = " INSERT INTO `#@__co_onepage`(`url`,`title`,`issource`,`lang`,`rule`) Values('$url','$title','$issource','$lang','$rule'); ";
  24. $dsql->ExecuteNonequery($query);
  25. echo $dsql->GetError();
  26. }
  27. }
  28. /*------
  29. function _DelNote(){ }
  30. -------*/
  31. else if ($action == 'del') {
  32. if (!preg_match("#,#", $ids)) {
  33. $query = "DELETE FROM `#@__co_onepage` WHERE id='$ids' ";
  34. } else {
  35. $query = "DELETE FROM `#@__co_onepage` WHERE id IN($ids) ";
  36. }
  37. $dsql->ExecuteNonequery($query);
  38. }
  39. /*------
  40. function _EditNote(){ }
  41. -------*/
  42. else if ($action == 'editsave') {
  43. $query = "UPDATE `#@__co_onepage` SET `url`='$url',`title`='$title',`issource`='$issource',`lang`='$lang',`rule`='$rule' WHERE id='$id' ";
  44. $dsql->ExecuteNonequery($query);
  45. echo $dsql->GetError();
  46. }
  47. /*------
  48. function _EditNoteLoad(){ }
  49. -------*/
  50. else if ($action == 'editload') {
  51. $row = $dsql->GetOne("SELECT * FROM `#@__co_onepage` WHERE id='$id' ");
  52. AjaxHead();
  53. ?>
  54. <form name="addform" action="article_coonepage_rule.php" method="post">
  55. <input type="hidden" name="id" value="<?php echo $id; ?>">
  56. <input type="hidden" name="action" value="editsave">
  57. <table width="430" cellspacing="0" cellpadding="0">
  58. <tr>
  59. <td width="102" >网站名称:</td>
  60. <td width="302"><input name="title" type="text" id="title" style="width:200px" value="<?php echo $row['title']; ?>"></td>
  61. <td width="26" align="center"><a href="javascript:CloseEditNode()" class="mr-3"><i class="fa fa-window-close-o"></i></a></td>
  62. </tr>
  63. <tr>
  64. <td>原内容编码:</td>
  65. <td colspan="2">
  66. <label><input type="radio" name="lang" value="utf-8" <?php echo ($row['lang'] == 'utf-8' ? ' checked="checked" ' : ''); ?>> UTF-8</label>
  67. <label><input type="radio" name="lang" value="gb2312" <?php echo ($row['lang'] == 'gb2312' ? ' checked="checked" ' : ''); ?>> GB2312/GBK</label>
  68. </td>
  69. </tr>
  70. <tr>
  71. <td>用作文章来源:</td>
  72. <td colspan="2">
  73. <label><input type="radio" name="issource" value="0" <?php echo ($row['issource'] == 0 ? ' checked="checked" ' : ''); ?>> 否</label>
  74. <label><input name="issource" type="radio" value="1" <?php echo ($row['issource'] == 1 ? ' checked="checked" ' : ''); ?>> 是</label>
  75. </td>
  76. </tr>
  77. <tr>
  78. <td>网站网址:</td>
  79. <td colspan="2">
  80. <input name="url" type="text" id="url" value="<?php echo $row['url']; ?>" style="width:200px" />
  81. </td>
  82. </tr>
  83. <tr>
  84. <td></td>
  85. <td colspan="2">
  86. 使用不带http及任何附加目录的网址<br>
  87. 如:news.dedebiz.com
  88. </td>
  89. </tr>
  90. <tr>
  91. <td>采集规则:</td>
  92. <td colspan="2">仅针对文章内容,格式:前面HTML{@body}后面HMTL</td>
  93. </tr>
  94. <tr>
  95. <td height="90"></td>
  96. <td colspan="2"><textarea name="rule" style="width:300px;height:80px"><?php echo $row['rule']; ?></textarea></td>
  97. </tr>
  98. <tr>
  99. <td></td>
  100. <td colspan="2">
  101. <button class="btn btn-success btn-sm" type="submit" name="Submit">保存</button>
  102. <button class="btn btn-success btn-sm" type="button" name="Submit2" onclick="javascript:CloseEditNode();">关闭</button>
  103. </td>
  104. </tr>
  105. </table>
  106. </form>
  107. <?php
  108. exit();
  109. } //loadedit
  110. /*---------------
  111. function _ShowLoad(){ }
  112. -------------*/
  113. $sql = "";
  114. $sql = "SELECT id,url,title,lang,issource FROM `#@__co_onepage` ORDER BY id DESC";
  115. $dlist = new DataListCP();
  116. $dlist->SetTemplate(DEDEADMIN."/templets/article_coonepage_rule.htm");
  117. $dlist->SetSource($sql);
  118. $dlist->Display();