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

121 lines
4.6KB

  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) 2020, 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. -------*/ else if ($action == 'del') {
  31. if (!preg_match("#,#", $ids)) {
  32. $query = "DELETE FROM `#@__co_onepage` WHERE id='$ids' ";
  33. } else {
  34. $query = "DELETE FROM `#@__co_onepage` WHERE id IN($ids) ";
  35. }
  36. $dsql->ExecuteNonequery($query);
  37. }
  38. /*------
  39. function _EditNote(){ }
  40. -------*/ else if ($action == 'editsave') {
  41. $query = "UPDATE `#@__co_onepage` SET `url`='$url',`title`='$title',`issource`='$issource',`lang`='$lang',`rule`='$rule' WHERE id='$id' ";
  42. $dsql->ExecuteNonequery($query);
  43. echo $dsql->GetError();
  44. }
  45. /*------
  46. function _EditNoteLoad(){ }
  47. -------*/ else if ($action == 'editload') {
  48. $row = $dsql->GetOne("SELECT * FROM `#@__co_onepage` WHERE id='$id' ");
  49. AjaxHead();
  50. ?>
  51. <form name='addform' action='article_coonepage_rule.php' method='post'>
  52. <input type='hidden' name='id' value='<?php echo $id; ?>' />
  53. <input type='hidden' name='action' value='editsave' />
  54. <table width="430" border="0" cellspacing="0" cellpadding="0">
  55. <tr>
  56. <td width="102" height="30">网站名称:</td>
  57. <td width="302"><input name="title" type="text" id="title" style="width:200px" value="<?php echo $row['title']; ?>" /></td>
  58. <td width="26" align="center"><a href="javascript:CloseEditNode()" class="mr-3"><img src="images/close.gif" width="12" height="12" border="0" /></a></td>
  59. </tr>
  60. <tr>
  61. <td height="30">原内容编码:</td>
  62. <td colspan="2">
  63. <label><input type="radio" name="lang" value="utf-8" <?php echo ($row['lang'] == 'utf-8' ? ' checked="checked" ' : ''); ?> />
  64. UTF-8</label>
  65. <label><input type="radio" name="lang" value="gb2312" <?php echo ($row['lang'] == 'gb2312' ? ' checked="checked" ' : ''); ?> />
  66. GB2312/GBK</label>
  67. </td>
  68. </tr>
  69. <tr>
  70. <td height="30">用作文章来源:</td>
  71. <td colspan="2">
  72. <label><input type="radio" name="issource" value="0" <?php echo ($row['issource'] == 0 ? ' checked="checked" ' : ''); ?> />
  73. 否</label>
  74. <label><input name="issource" type="radio" value="1" <?php echo ($row['issource'] == 1 ? ' checked="checked" ' : ''); ?> />
  75. 是</label>
  76. </td>
  77. </tr>
  78. <tr>
  79. <td height="30">网站网址:</td>
  80. <td colspan="2">
  81. <input name="url" type="text" id="url" value="<?php echo $row['url']; ?>" style="width:200px" />
  82. </td>
  83. </tr>
  84. <tr>
  85. <td height="30">&nbsp;</td>
  86. <td colspan="2">
  87. 使用不带http及任何附加目录的网址<br />
  88. 如:news.dedebiz.com
  89. </td>
  90. </tr>
  91. <tr>
  92. <td height="30">采集规则:</td>
  93. <td colspan="2">仅针对文章内容,格式:前面HTML{@body}后面HMTL</td>
  94. </tr>
  95. <tr>
  96. <td height="90">&nbsp;</td>
  97. <td colspan="2"><textarea name="rule" style="width:300px;height:80px"><?php echo $row['rule']; ?></textarea></td>
  98. </tr>
  99. <tr>
  100. <td height="32">&nbsp;</td>
  101. <td colspan="2"><button class="btn btn-secondary btn-sm" type="submit" name="Submit" value="">保存规则</button>
  102. <button type="reset" class="btn btn-secondary btn-sm" name="Submit2">重置</button></td>
  103. </tr>
  104. </table>
  105. </form>
  106. <?php
  107. exit();
  108. } //loadedit
  109. /*---------------
  110. function _ShowLoad(){ }
  111. -------------*/
  112. $sql = "";
  113. $sql = "SELECT id,url,title,lang,issource FROM `#@__co_onepage` ORDER BY id DESC";
  114. $dlist = new DataListCP();
  115. $dlist->SetTemplate(DEDEADMIN . "/templets/article_coonepage_rule.htm");
  116. $dlist->SetSource($sql);
  117. $dlist->Display();