国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > PhpCMS > 正文

【phpcms-v9】phpcms-v9中復制采集節點功能(擴展:專題碎片的

2024-09-10 07:15:55
字體:
來源:轉載
供稿:網友

【phpcms-v9】phpcms-v9中復制采集節點功能(擴展:專題碎片的復制).

1.添加采集節點代碼:

  1. /**  
  2.      * add node  
  3.      */   
  4.     public function add() {   
  5.         header("Cache-control: private");   
  6.         //添加采集節點   
  7.         if(isset($_POST['dosubmit'])) {   
  8.             //采集節點表單數據   
  9.             $data = isset($_POST['data']) ? $_POST['data'] :  showmessage(L('illegal_parameters'), HTTP_REFERER);   
  10.             //自定義規則   
  11.             $customize_config = isset($_POST['customize_config']) ? $_POST['customize_config'] :  '';   
  12.             //采集節點名稱   
  13.             if (!$data['name'] = trim($data['name'])) {   
  14.                 showmessage(L('nodename').L('empty'), HTTP_REFERER);   
  15.             }   
  16.             //提示 節點已存在   
  17.             if ($this->db->get_one(array('name'=>$data['name']))) {   
  18.                 showmessage(L('nodename').L('exists'), HTTP_REFERER);   
  19.             }   
  20.             //網址類型   
  21.             $data['urlpage'] = isset($_POST['urlpage'.$data['sourcetype']]) ? $_POST['urlpage'.$data['sourcetype']] : showmessage(L('illegal_parameters'), HTTP_REFERER);   
  22.             //站點id   
  23.             $data['siteid']= $this->get_siteid();   
  24.             //自定義規則   
  25.             $data['customize_config'] = array();   
  26.             if (is_array($customize_config)) foreach ($customize_config['en_name'as $k => $v) {   
  27.                 if (emptyempty($v) || emptyempty($customize_config['name'][$k])) continue;   
  28.                 $data['customize_config'][] = array('name'=>$customize_config['name'][$k], 'en_name'=>$v'rule'=>$customize_config['rule'][$k], 'html_rule'=>$customize_config['html_rule'][$k]);   
  29.             }   
  30.             $data['customize_config'] = array2string($data['customize_config']);   
  31.             //采集節點信息入庫操作   
  32.             if ($this->db->insert($data)) {   
  33.                 showmessage(L('operation_success'), '?m=collection&c=node&a=manage');   
  34.             } else {   
  35.                 showmessage(L('operation_failure'), HTTP_REFERER);   
  36.             }   
  37.         } else {   
  38.             $show_dialog = $show_validator = true;   
  39.             //采集節點信息表單頁面   
  40.             include $this->admin_tpl('node_form');   
  41.         }   
  42.            
  43.     } 

2.復制采集節點信息

  1. //復制已有采集節點   
  2.     public function copy() {   
  3.         //采集節點id   
  4.         $nodeid = isset($_GET['nodeid']) ? intval($_GET['nodeid']) : showmessage(L('illegal_parameters'), HTTP_REFERER);   
  5.         //查詢當前采集節點信息   
  6.         if ($data = $this->db->get_one(array('nodeid'=>$nodeid))) {   
  7.             //是否確定復制當前采集節點信息   
  8.             if (isset($_POST['dosubmit'])) {   
  9.                 //銷毀當前采集節點id   
  10.                 unset($data['nodeid']);   
  11.                 //新采集節點名稱   
  12.                 $name = isset($_POST['name']) && trim($_POST['name']) ? trim($_POST['name']) : showmessage(L('illegal_parameters'), HTTP_REFERER);   
  13.                 //查詢數據庫中是否已存在該新采集節點名稱   
  14.                 if ($this->db->get_one(array('name'=>$name), 'nodeid')) {   
  15.                     showmessage(L('nodename').L('exists'), HTTP_REFERER);   
  16.                 }   
  17.                 //新采集節點名稱   
  18.                 $data['name'] = $name;   
  19.                 //在特殊字符前加反斜線   
  20.                 $data = new_addslashes($data);   
  21.                 //插入新采集節點到數據庫   
  22.                 if ($this->db->insert($data)) {   
  23.                     //插入成功   
  24.                     showmessage(L('operation_success'), '''''test');   
  25.                 } else {  //開源代碼Vevb.com 
  26.                     showmessage(L('operation_failure'));   
  27.                 }   
  28.             } else {   
  29.                 $show_validator = $show_header = true;   
  30.                 include $this->admin_tpl('node_copy');//添加采集節點頁面   
  31.             }   
  32.         } else {   
  33.             showmessage(L('notfound'));   
  34.         }   
  35.     }

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 额尔古纳市| 濮阳县| 浙江省| 南郑县| 保康县| 左云县| 英吉沙县| 昔阳县| 中牟县| 札达县| 明水县| 中卫市| 吉林市| 义乌市| 庆安县| 旬阳县| 安岳县| 阿拉善盟| 和龙市| 临朐县| 财经| 汉寿县| 海晏县| 五寨县| 井冈山市| 山阴县| 泰州市| 汶川县| 江北区| 昌吉市| 康平县| 南通市| 改则县| 夏邑县| 菏泽市| 榆中县| 兴海县| 伊吾县| 香格里拉县| 潞西市| 岢岚县|