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

132 lines
4.5KB

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