db = pc_base::load_model('video_store_model');
		pc_base::load_app_class('ku6api', 'video', 0);
		$this->userid = param::get_cookie('_userid');
		pc_base::load_app_class('v', 'video', 0);
		$this->v =  new v($this->db);
		$this->setting = getcache('video', 'video');
		$this->ku6api = new ku6api($this->setting['sn'], $this->setting['skey']);
	}
	
	/**
	 * 
	 * 视频列表
	 */
	public function init() {
		
		if (!$this->check_priv('video2content')) {
			showmessage('您没有权限操作该项','blank');
		}
		$where = '`status`=21';
		$page = max(intval($_GET['page']), 1);
		$pagesize = 6;
		if (!param::get_cookie('admin_username')) {
			$where .= " AND `userid`='".$this->userid."'";
		}
		$infos = $this->db->listinfo($where, 'videoid DESC', $page, $pagesize);
		$number = $this->db->number;
		$pages = $this->pages($number, $page, $pagesize, 4, 'get_videoes');
		$flash_info = $this->ku6api->flashuploadparam();
		include template('content','video_for_ck');
	}
	
	public function search() {
		$title = safe_replace($_GET['title']);
		if (CHARSET=='gbk') {
			$title = utf8_to_gbk($title);
		}
		$where = '`status`=21';
		if ($title) {
			$where .= ' AND `title` LIKE \'%'.$title.'%\'';
		}
		$userupload = intval($_GET['userupload']);
		if ($userupload) {
			$where .= ' AND `userupload`=1';
		}
		$page = $_GET['page'];
		$pagesize = 6;
		$infos = $this->db->listinfo($where, 'videoid DESC', $page, $pagesize);
		$number = $this->db->number;
		$pages = $this->pages($number, $page, $pagesize, 4, 'get_videoes');
		if (is_array($infos) && !empty($infos)) {
			$html = '';
			foreach ($infos as $info) {
				$html .= '

'.str_cut($info['title'], 18).'