Esempio n. 1
0
 public function getVideo()
 {
     $infovideoModel = new Model_InfoVideo();
     $filter['where'] = " id='{$this->info_id}' and customer_id='{$this->customer_id}' and state='1' ";
     $sql = $infovideoModel->select($filter);
     $inforesult = $infovideoModel->fetchRow($sql);
     $sql = "update info_video set push_num=push_num+1 where id='{$this->info_id}' and customer_id='{$this->customer_id}' limit 1";
     $infovideoModel->query($sql);
     $data['msgtype'] = 'news';
     $data['title'] = $inforesult['video_name'];
     $data['description'] = $inforesult['video_desc'];
     $data['picurl'] = 'http://' . $_SERVER['HTTP_HOST'] . "/data/image_c/" . $inforesult['video_pic'];
     $data['url'] = $inforesult['video_url'];
     $movie_play_url = null;
     $preg_content = "|v\\.youku\\.com/v_show/id_(.*?)\\.html|s";
     preg_match($preg_content, $data['url'], $match);
     if (!empty($match)) {
         $movie_play_url = 'http://player.youku.com/embed/' . $match['1'];
     }
     $preg_content = "|http://v.qq.com/(.*)|s";
     preg_match($preg_content, $data['url'], $match);
     if (!empty($match)) {
         $movie_play_url = $data['url'];
     }
     $data['url'] = $movie_play_url;
     return $data;
 }