Example #1
0
 public function gatherurl()
 {
     $time = time();
     $sql = 'SELECT * FROM ' . DB_PREFIX . 'plan WHERE is_open=1 AND createtime < ' . $time;
     $query = $this->db->query($sql);
     $arr = array();
     while ($row = $this->db->fetch_array($query)) {
         $arr[] = $row;
         $setstatussql = "update " . DB_PREFIX . "plan set next_time=" . (time() + $row['mk_time']) . " where id=" . $row['id'];
         $this->db->query($setstatussql);
         $otherinfo = array('auto_publish' => $row['auto_publish'], 'sort_id' => $row['sort_id'], 'create_user' => $this->user['user_name']);
     }
     $ar = new gatherapi();
     $getuser = $ar->getotherinfo($otherinfo);
     //获取其它相关信息传到接口
     /* $otherinfo=array(
       			$user=$this->user['user_name'],
       			$auto_publish = $this->input['auto_publish'],
       			$sort_id = $this->input['sort_id'],
       	); */
     foreach ($arr as $k => $v) {
         $url = explode("\n", $v[url]);
         foreach ($url as $key => $value) {
             $ar->gather(trim($value));
         }
     }
 }
Example #2
0
 public function create()
 {
     $url = $this->input['urladdress'];
     $name = $this->input['name'];
     $time = time();
     $verify = new gatherapi();
     $url = $verify->VerifyUrl($url);
     $urlsql = "insert into " . DB_PREFIX . "plan (id,createtime,url,status) values (null,'{$time}','{$url}','0')";
     $this->db->query($urlsql);
 }