|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <?php
- /**
- * 文档规则采集
- *
- * @version $id:article_coonepage_rule.php 14:12 2010年7月12日 tianya $
- * @package DedeBIZ.Administrator
- * @copyright Copyright (c) 2022 DedeBIZ.COM
- * @license https://www.dedebiz.com/license
- * @link https://www.dedebiz.com
- */
- require_once(dirname(__FILE__)."/config.php");
- require_once(DEDEINC."/datalistcp.class.php");
- setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/");
- if (empty($action)) $action = '';
- /*------
- function _AddNote(){ }
- -------*/
- if ($action == 'add') {
- $row = $dsql->GetOne("SELECT * FROM `#@__co_onepage` WHERE url LIKE '$url' ");
- if (is_array($row)) {
- echo "系统已经存在这个网址的条目";
- } else {
- $query = " INSERT INTO `#@__co_onepage` (`url`,`title`,`issource`,`lang`,`rule`) VALUES ('$url','$title','$issource','$lang','$rule'); ";
- $dsql->ExecuteNonequery($query);
- echo $dsql->GetError();
- }
- }
- /*------
- function _DelNote(){ }
- -------*/
- else if ($action == 'del') {
- if (!preg_match("#,#", $ids)) {
- $query = "DELETE FROM `#@__co_onepage` WHERE id='$ids' ";
- } else {
- $query = "DELETE FROM `#@__co_onepage` WHERE id IN($ids) ";
- }
- $dsql->ExecuteNonequery($query);
- }
- /*------
- function _EditNote(){ }
- -------*/
- else if ($action == 'editsave') {
- $query = "UPDATE `#@__co_onepage` SET `url`='$url',`title`='$title',`issource`='$issource',`lang`='$lang',`rule`='$rule' WHERE id='$id' ";
- $dsql->ExecuteNonequery($query);
- echo $dsql->GetError();
- }
- /*------
- function _EditNoteLoad(){ }
- -------*/
- else if ($action == 'editload') {
- $row = $dsql->GetOne("SELECT * FROM `#@__co_onepage` WHERE id='$id' ");
- AjaxHead();
- ?>
- <form name="addform" action="article_coonepage_rule.php" method="post">
- <input type="hidden" name="id" value="<?php echo $id;?>">
- <input type="hidden" name="action" value="editsave">
- <table width="430" cellspacing="0" cellpadding="0">
- <tr>
- <td width="90">网站名称:</td>
- <td width="270"><input type="text" name="title" id="title" class="biz-input-md" value="<?php echo $row['title'];?>"></td>
- </tr>
- <tr>
- <td>原内容编码:</td>
- <td colspan="2">
- <label><input type="radio" name="lang" value="utf-8" <?php echo ($row['lang'] == 'utf-8' ? 'checked="checked"' : '');?>> UTF-8</label>
- <label><input type="radio" name="lang" value="gb2312" <?php echo ($row['lang'] == 'gb2312' ? 'checked="checked"' : '');?>> GB2312/GBK</label>
- </td>
- </tr>
- <tr>
- <td>用作文档来源:</td>
- <td colspan="2">
- <label><input type="radio" name="issource" value="0" <?php echo ($row['issource'] == 0 ? 'checked="checked"' : '');?>> 否</label>
- <label><input type="radio" name="issource" value="1" <?php echo ($row['issource'] == 1 ? 'checked="checked"' : '');?>> 是</label>
- </td>
- </tr>
- <tr>
- <td>网站网址:</td>
- <td colspan="2"><input type="text" name="url" id="url" value="<?php echo $row['url'];?>" class="biz-input-md"></td>
- </tr>
- <tr>
- <td></td>
- <td colspan="2">
- 使用不带http及任何附加目录的网址<br>
- 如:news.dedebiz.com
- </td>
- </tr>
- <tr>
- <td>采集规则:</td>
- <td colspan="2">仅针对文档内容,格式:前面HTML{@body}后面HMTL</td>
- </tr>
- <tr>
- <td></td>
- <td colspan="2"><textarea name="rule" class="biz-textarea"><?php echo $row['rule'];?></textarea></td>
- </tr>
- <tr>
- <td></td>
- <td colspan="2">
- <button class="btn btn-success btn-sm" type="submit" name="Submit">保存</button>
- <button class="btn btn-success btn-sm" type="button" name="Submit2" onclick="javascript:CloseEditNode();">关闭</button>
- </td>
- </tr>
- </table>
- </form>
- <?php
- exit();
- } //loadedit
- /*---------------
- function _ShowLoad(){ }
- -------------*/
- $sql = "";
- $sql = "SELECT id,url,title,lang,issource FROM `#@__co_onepage` ORDER BY id DESC";
- $dlist = new DataListCP();
- $dlist->SetTemplate(DEDEADMIN."/templets/article_coonepage_rule.htm");
- $dlist->SetSource($sql);
- $dlist->Display();
- ?>
|