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

131 lines
4.4KB

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