示例#1
0
 public function update()
 {
     $info = array('url' => trim($this->input['url']), 'source' => $this->input['source'], 'sid' => intval($this->input['sid']), 'ip' => hg_getip(), 'create_time' => TIME_NOW);
     if (empty($info['url']) || empty($this->input['id'])) {
         return false;
     }
     include_once ROOT_PATH . 'lib/class/videoUrlParser.class.php';
     $obj = new VideoUrlParser();
     $tmp = $obj->parse($info['url']);
     if (empty($tmp)) {
         return false;
     }
     $info['title'] = $tmp['title'];
     $info['img'] = $tmp['img'];
     $info['url'] = $tmp['url'];
     $info['swf'] = $tmp['swf'];
     $info['object'] = addslashes($tmp['object']);
     $sql = "UPDATE " . DB_PREFIX . "video SET ";
     $space = "";
     foreach ($info as $k => $v) {
         $sql .= $space . $k . "='" . $v . "'";
         $space = ',';
     }
     $sql .= " WHERE id=" . intval($this->input['id']);
     $this->db->query($sql);
     return array('img' => $info['img'], 'title' => $info['title'], 'url' => $info['url'], 'id' => $info['id']);
 }
示例#2
0
 public function video_parseurl()
 {
     include_once ROOT_PATH . 'lib/class/videoUrlParser.class.php';
     $video = new VideoUrlParser();
     $url = urldecode($this->input['url']);
     $result = $video->parse($url);
     $this->addItem($result);
     $this->output();
 }
 public function crawler()
 {
     $url = $this->_get("video_url");
     //        $url='http://v.youku.com/v_show/id_XNyMjE2.html';
     $html = file_get_html($url);
     if ($html == false) {
         echo json_encode(array('statue' => 'false'));
         return;
     }
     $info = VideoUrlParser::parse($url);
     $title_element = $html->find('#subtitle');
     $embed_element = $html->find('#link3');
     $title = $title_element[0]->plaintext;
     $img_path = $info['img'];
     $embed_html = $embed_element[0]->getAttribute('value');
     $info = array('statue' => 'true', 'title' => $title, 'img_path' => $img_path, 'embed_html' => $embed_html);
     echo json_encode($info);
 }
示例#4
0
 public function index()
 {
     $this->load->model('social/social');
     // 判断用户是否登陆
     if ($this->customer->isLogged()) {
         $this->data['logged'] = 1;
         // 记录登入时间
         $this->model_social_social->setSnstime();
     } else {
         $this->data['error_login'] = "";
         $this->data['action'] = $this->url->link('account/login', '', 'SSL');
         $this->data['register'] = $this->url->link('account/register', '', 'SSL');
         $this->data['forgotten'] = $this->url->link('account/forgotten', '', 'SSL');
         $this->data['email'] = '';
         $this->data['password'] = '';
         include_once DIR_SYSTEM . 'weibo/config.php';
         include_once DIR_SYSTEM . 'weibo/saetv2.ex.class.php';
         $o = new SaeTOAuthV2(WB_AKEY, WB_SKEY);
         $this->data['code_url'] = $o->getAuthorizeURL(WB_CALLBACK_URL);
     }
     // 回复的脸
     $this->data['face'] = $this->customer->getface();
     if (!$this->data['face']) {
         $this->data['face'] = "uploads/big/0b4a96400b2372d25da769647bfe4059.jpg";
     }
     // 回复用户的昵称
     $this->data['firstname'] = $this->customer->getFirstName();
     if (!$this->data['firstname']) {
         $this->data['firstname'] = '';
     }
     // 回复的用户id
     $this->data['customer_id'] = $this->customer->getId();
     if (!$this->data['customer_id']) {
         $this->data['customer_id'] = 0;
     }
     if (isset($this->request->post['search']) && $this->request->post['search'] || isset($this->request->get['search']) && $this->request->get['search']) {
         $key_word = isset($this->request->post['search']) ? $this->request->post['search'] : $this->request->get['search'];
         $this->data['post_key_word'] = $key_word;
     } else {
         $key_word = '';
     }
     // 从消息评论表获取所有评论消息并按时间排序
     $this->data['moreall'] = $this->url->link('social/social', 'sort=all', 'SSL');
     $this->data['morepoints'] = $this->url->link('social/social', 'sort=points', 'SSL');
     $this->data['morecomments'] = $this->url->link('social/social', 'sort=comments', 'SSL');
     if (isset($this->request->get['sort']) && $this->request->get['sort']) {
         $sort = $this->request->get['sort'];
         $this->data['sort'] = $sort;
     } else {
         $this->data['sort'] = 'zhiding';
         $sort = 'zhiding';
     }
     if (isset($this->request->get['page'])) {
         $page = $this->request->get['page'];
     } else {
         $page = 1;
     }
     $limit = 10;
     $data = array('limit' => $limit, 'start' => ($page - 1) * $limit, 'sort' => $sort, 'search' => $key_word);
     $message_info = $this->model_social_social->getMessage($data);
     $message_total = $this->model_social_social->getTotalMessage();
     include_once DIR_SYSTEM . 'VideoUrlParser.class.php';
     foreach ($message_info as &$message) {
         $data = array('message_id' => $message['message_id'], 'start' => 0, 'limit' => 10);
         $message['comment_info'] = $this->model_social_social->getComment($data);
         if ($message['videourl']) {
             $message['videoMassage'] = VideoUrlParser::parse($message['videourl']);
         }
         $message['comment_total'] = $this->model_social_social->getTotalComment($message['message_id']);
         $imgs = explode("|", $message['imgurl']);
         if (!empty($imgs[0])) {
             $countFirstImg = count($imgs);
             foreach ($imgs as $k => $v) {
                 $posDot = strrpos($v, '.');
                 $strExt = substr($v, $posDot);
                 $posXie = strrpos($v, '/');
                 $strFile = substr($v, $posXie);
                 $strFile = explode('-', $strFile);
                 $strFile = $strFile[0];
                 if ($k == 0) {
                     $message['strFile'] = "uploads/big" . $strFile . $strExt;
                     $strFiles = '';
                 }
                 if ($countFirstImg > 1 && $k <= $countFirstImg - 2) {
                     $strFiles .= "uploads/big" . $strFile . $strExt . '|';
                 }
             }
             $message['imgurls'] = $strFiles . "uploads/big" . $strFile . $strExt;
         }
     }
     $this->data['message_info'] = $message_info;
     // var_dump($message_info);
     // $this->data['action'] = $this->url->link('social/social/deliver');
     // $this->data['filesrc'] = $this->url->link('social/upfile');
     //轮播图
     $this->data['lunbopics'] = $this->model_social_social->getLunboPics();
     // 载入所有主题
     $theme_array = array();
     $theme_info = $this->model_social_social->getTheme(1);
     foreach ($theme_info as $info) {
         $theme_array[$info['theme_id']] = $info['description'];
     }
     $this->data['theme_array'] = $theme_array;
     $pagination = new Pagination();
     $pagination->total = $message_total;
     $pagination->page = $page;
     $pagination->limit = 10;
     $pagination->num_links = 7;
     $pagination->text = $this->language->get('text_pagination');
     if (!empty($key_word)) {
         $pagination->url = $this->url->link('social/social', 'page={page}&search=' . $key_word, 'SSL');
     } else {
         $pagination->url = $this->url->link('social/social', 'page={page}&sort=' . $sort, 'SSL');
     }
     $this->data['pagination'] = $pagination->render();
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/social/social_list.tpl')) {
         $this->template = $this->config->get('config_template') . '/template/social/social_list.tpl';
     } else {
         $this->template = 'default/template/social/social_list.tpl';
     }
     if (in_array($sort, array('all', 'points', 'comments')) && array_key_exists('HTTP_REFERER', $_SERVER) && !isset($this->request->get['page']) || isset($this->request->get['page'])) {
         if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/social/social_list_ajax.tpl')) {
             echo "<script src='catalog/view/javascript/jquery2/sns_fangda.js'></script>";
             $this->template = $this->config->get('config_template') . '/template/social/social_list_ajax.tpl';
         } else {
             $this->template = 'default/template/social/social_list_ajax.tpl';
         }
     }
     $this->children = array('common/footer', 'common/social_right', 'common/header_sns');
     $this->response->setOutput($this->render());
 }
示例#5
0
<?php

require_once "VideoUrlParser.class.php";
$urls[] = "http://v.youku.com/v_playlist/f12280371o1p0.html";
//$urls[] = "http://v.youku.com/v_show/id_XMjI4MDM4NDc2.html";
//$urls[] = "http://www.tudou.com/playlist/p/l13087099.html";
//$urls[] = "http://www.tudou.com/programs/view/ufg-A3tlcxk/";
//$urls[] = "http://v.ku6.com/special/show_4926690/Klze2mhMeSK6g05X.html";
//$urls[] = "http://www.56.com/u68/v_NjI2NTkxMzc.html";
//$urls[] = "http://www.letv.com/ptv/vplay/1168109.html";
//$urls[] = "http://video.sina.com.cn/v/b/46909166-1290055681.html";
foreach ($urls as $url) {
    $info = VideoUrlParser::parse($url);
    //var_dump($info);
    echo "<a href='{$info['url']}' target='_new'>{$info['title']}</a>";
    echo "<br />";
    echo $info['object'];
    echo "<br />";
}
示例#6
0
 public function create()
 {
     //通过链接上传视频
     if ($this->input['is_link']) {
         require_once ROOT_PATH . 'lib/class/videourlparser.class.php';
         $parse = new VideoUrlParser();
         $url = trim($this->input['url']);
         if (!$url) {
             $this->errorOutput('请填写视频链接');
         }
         $ret = $parse->parse($url);
         if (!$ret) {
             echo json_encode(array('msg' => '提取失败,视频链接有误或该视频存在版权问题', 'error' => 1));
             exit;
         }
         $this->input['title'] = $ret['title'];
         $this->input['index_pic'] = $ret['img'];
         $this->input['ori_url'] = $this->input['url'];
         $url = parse_url($ret['m3u8']);
         $this->input['hostwork'] = 'http://' . $url['host'];
         $this->input['video_path'] = substr($ret['m3u8'], strlen($this->input['hostwork'] . '/'));
         $this->input['swf'] = $ret['swf'];
         $this->input['duration'] = $ret['duration'];
     }
     if (!$this->input['title']) {
         $this->errorOutput(NO_TITLE);
     }
     //创建的权限
     if ($this->user['group_type'] > MAX_ADMIN_TYPE) {
         if (!in_array('create', (array) $this->user['prms']['app_prms'][APP_UNIQUEID]['action'])) {
             $this->errorOutput(NO_PRIVILEGE);
         }
         //创建后的审核状态判断
         switch ($this->user['prms']['default_setting']['create_content_status']) {
             case 0:
                 $this->input['status'];
                 break;
                 //默认
             //默认
             case 1:
                 $this->input['status'] = 1;
                 break;
                 //待审核
             //待审核
             case 2:
                 $this->input['status'] = 2;
                 break;
                 //已审核
         }
     }
     //分类不传,默认分类是编辑上传
     $vod_sort_id = $this->input['vod_sort_id'] ? intval($this->input['vod_sort_id']) : 1;
     //通过分类id反查类型id
     $sql = "SELECT * FROM " . DB_PREFIX . "vod_media_node WHERE id IN (1,2,3,4)";
     $q = $this->db->query($sql);
     while ($r = $this->db->fetch_array($q)) {
         $_childs = explode(',', $r['childs']);
         if (in_array($vod_sort_id, $_childs)) {
             $vod_leixing = $r['id'];
             break;
         }
     }
     if (!$vod_leixing) {
         $vod_leixing = 1;
     }
     //权限测试
     $nodes = array();
     if ($this->user['group_type'] > MAX_ADMIN_TYPE && $vod_sort_id) {
         $sql = 'SELECT id, parents FROM ' . DB_PREFIX . 'vod_media_node WHERE id IN(' . $vod_sort_id . ')';
         $query = $this->db->query($sql);
         while ($row = $this->db->fetch_array($query)) {
             $nodes['nodes'][$row['id']] = $row['parents'];
         }
     }
     $nodes['column_id'] = $this->input['column_id'];
     $nodes['published_column_id'] = '';
     $this->verify_content_prms($nodes);
     //处理发布的栏目
     $column_id = '';
     if ($this->input['column_id']) {
         $column_id = $this->input['column_id'];
         $column_id = $this->publish_column->get_columnname_by_ids('id,name', $column_id);
         $column_id = addslashes(serialize($column_id));
     }
     $status = isset($this->input['status']) ? $this->input['status'] : 1;
     //不传默认待审核
     $data = array('title' => rawurldecode($this->input['title']), 'vod_leixing' => $vod_leixing, 'vod_sort_id' => $vod_sort_id, 'status' => $status, 'column_id' => $column_id, 'isbold' => $this->input['isbold'], 'tcolor' => $this->input['tcolor'], 'isitalic' => $this->input['isitalic'], 'weight' => $this->input['weight'], 'comment' => $this->input['comment'], 'subtitle' => $this->input['subtitle'], 'source' => $this->input['source'], 'author' => $this->input['author'], 'keywords' => $this->input['keywords'], 'hostwork' => $this->input['hostwork'], 'video_path' => $this->input['video_path'], 'video_filename' => $this->input['video_filename'], 'duration' => $this->input['duration'], 'totalsize' => $this->input['totalsize'], 'video' => $this->input['video'], 'frame_rate' => $this->input['frame_rate'], 'aspect' => $this->input['aspect'], 'width' => $this->input['width'], 'height' => $this->input['height'], 'audio' => $this->input['audio'], 'sampling_rate' => $this->input['sampling_rate'], 'audio_channels' => $this->input['audio_channels'], 'bitrate' => $this->input['bitrate'], 'starttime' => $this->input['starttime'], 'is_forcecode' => 1, 'addperson' => $this->user['user_name'], 'user_id' => $this->user['user_id'], 'org_id' => $this->user['org_id'], 'from_appid' => $this->user['appid'], 'from_appname' => $this->user['display_name'], 'create_time' => $this->input['create_time'] ? intval($this->input['create_time']) : TIMENOW, 'update_time' => TIMENOW, 'ip' => hg_getip(), 'template_sign' => $this->input['template_sign'], 'ori_url' => $this->input['ori_url'], 'swf' => $this->input['swf'] ? $this->input['swf'] : '', 'is_link' => $this->input['is_link'] ? 1 : 0, 'iscomment' => $this->input['iscomment'] ? 1 : 0, 'is_praise' => $this->input['is_praise'] ? 1 : 0, 'source_path' => $this->input['source_path'] ? trim($this->input['source_path']) : '', 'source_filename' => $this->input['source_filename'] ? trim($this->input['source_filename']) : '');
     //为叮当视频外链处理
     if ($this->input['chain_m3u8']) {
         $url = parse_url($this->input['chain_m3u8']);
         $data['hostwork'] = 'http://' . $url['host'] . ($url['port'] ? ':' . $url['port'] : '');
         $data['video_path'] = substr($this->input['chain_m3u8'], strlen($data['hostwork'] . '/'));
         $data['swf'] = $this->input['chain_swf'] ? $this->input['chain_swf'] : '';
         $data['is_link'] = 1;
         $data['duration'] = $this->input['chain_duration'];
         if ($data['source_path'] && $data['source_filename']) {
             //检测云视频数据是否重复提交
             $check_video_sql = 'SELECT source_path,source_filename  FROM ' . DB_PREFIX . 'vodinfo WHERE source_path="' . $data['source_path'] . '" AND source_filename="' . $data['source_filename'] . '" AND user_id=' . $this->user['user_id'];
             if ($this->db->query_first($check_video_sql)) {
                 $this->addItem(array('error' => 'repeat'));
                 $this->output();
             }
             //结束
         }
     }
     $sql = "INSERT INTO " . DB_PREFIX . "vodinfo SET ";
     foreach ($data as $k => $v) {
         $sql .= " {$k} = '{$v}',";
     }
     $sql = rtrim($sql, ',');
     $this->db->query($sql);
     $vid = $this->db->insert_id();
     //本地化索引图片
     if ($this->input['index_pic']) {
         $img_info = $this->create_thumb($this->input['index_pic'], $vid);
         if ($img_info) {
             $imgArr = array('host' => $img_info['host'], 'dir' => $img_info['dir'], 'filepath' => $img_info['filepath'], 'filename' => $img_info['filename'], 'imgwidth' => $img_info['imgwidth'], 'imgheight' => $img_info['imgheight']);
             $img_info = addslashes(serialize($imgArr));
         }
     } else {
         $img_info = '';
     }
     //为叮当视频外链传来的索引图作处理
     if ($this->input['chain_img']) {
         unset($this->input['chain_img']['id']);
         $img_info = serialize($this->input['chain_img']);
     }
     //更新排序
     $sql = "UPDATE " . DB_PREFIX . "vodinfo SET img_info='" . $img_info . "',video_order_id = '" . $vid . "' WHERE id = '" . $vid . "'";
     $this->db->query($sql);
     $data['id'] = $vid;
     //如果创建状态是'已审核',就插入发布队列
     if ($data['status'] == 2 && $this->input['column_id']) {
         $data['pub_time'] = $this->input['create_time'] ? intval($this->input['create_time']) : TIMENOW;
         $data['column_id'] = stripslashes($data['column_id']);
         publish_insert_query($data, 'insert');
     }
     //将视频url提交到转码服务器下载并转码
     if ($data && !$this->input['chain_m3u8'] && !$this->input['is_link'] && $this->input['is_local']) {
         $data['img_info'] = serialize($imgArr);
         $data['is_forcecode'] = $this->input['is_forcecode'];
         $re = $this->set_url($data);
         if ($re == 'transcode') {
             $sql = "UPDATE " . DB_PREFIX . "vodinfo SET status=-1 WHERE id = '" . $vid . "'";
             $this->db->query($sql);
         } elseif ($re == 'download') {
             $sql = "UPDATE " . DB_PREFIX . "vodinfo SET status=6 WHERE id = '" . $vid . "'";
             $this->db->query($sql);
         }
     }
     //返回值
     $this->addItem($data);
     $this->output();
 }
示例#7
0
 public function index()
 {
     if (isset($this->request->cookie['hometip'])) {
         $this->data['hometip'] = $this->request->cookie['hometip'];
     } else {
         $this->data['hometip'] = 0;
     }
     $this->data['logged'] = $this->customer->isLogged();
     $this->data['login'] = $this->url->link('account/login');
     $this->data['home'] = $this->url->link('common/home');
     $this->data['favorite'] = $this->url->link('product/favorite');
     $this->data['newbie'] = HTTP_SERVER . "newbie.html";
     $this->data['procurement'] = HTTP_SERVER . "procurement.html";
     $this->data['selfshopping'] = HTTP_SERVER . "selfshopping.html";
     $this->data['express'] = HTTP_SERVER . "international-express.html";
     //晒尔社区
     $this->load->model('social/saiercomment');
     $saiercomment = $this->model_social_saiercomment->getShowComments();
     $this->data['saiercomment'] = array();
     foreach ($saiercomment as $saier) {
         if ($firstImg = explode('|', $saier['imgurl'])) {
             $countFirstImg = count($firstImg);
             $saier['imgurl'] = $firstImg[0];
             $strFile = '';
             foreach ($firstImg as $k => $v) {
                 $posDot = strrpos($v, '.');
                 $strExt = substr($v, $posDot);
                 $posXie = strrpos($v, '/');
                 $strFiles = substr($v, $posXie);
                 $strFiles = explode('-', $strFiles);
                 $strFiles = $strFiles[0];
                 if ($countFirstImg > 1 && $k <= $countFirstImg - 2) {
                     $strFiles = "uploads/big" . $strFiles . $strExt;
                     $strFile .= $strFiles . '|';
                 }
             }
             $strFile .= "uploads/big" . $strFiles . $strExt;
         }
         if (!empty($saier['videourl'])) {
             include_once DIR_SYSTEM . 'VideoUrlParser.class.php';
             $videourl = VideoUrlParser::parse($saier['videourl']);
             $video = $videourl;
         } else {
             $video = '';
         }
         $this->data['saiercomment'][] = array('if_show' => $saier['if_show'], 'message_id' => $saier['message_id'], 'firstname' => $saier['firstname'], 'face' => $saier['face'], 'country' => $saier['country'], 'message_text' => $saier['message_text'], 'imgurl' => $saier['imgurl'], 'strFile' => $strFile, 'videourl' => $video, 'comments' => $saier['comments'], 'points' => $saier['points'], 'utype' => $saier['utype']);
     }
     //网站公告
     $this->load->model('help/help');
     $bulletins = $this->model_help_help->getHomeBulletins();
     $this->data['bulletins'] = $bulletins;
     //网站评论
     $this->load->model('order/sendorder');
     $limit = 5;
     $data = array('start' => 0, 'limit' => $limit);
     $results = $this->model_order_sendorder->getComments($data);
     foreach ($results as $result) {
         $this->data['comments'][] = array('face' => $result['face'], 'uname' => $result['uname'], 'from' => $result['country'], 'utype' => $result['utype'], 'message' => $result['comment']);
     }
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/specialtpl/home.tpl')) {
         $this->template = $this->config->get('config_template') . '/template/specialtpl/home.tpl';
     } else {
         $this->template = 'default/template/specialtpl/home.tpl';
     }
     $this->children = array('common/footer', 'common/header');
     $this->response->setOutput($this->render());
 }
示例#8
0
 protected function index()
 {
     //语言部分
     $this->language->load("common/social_right");
     $this->data['text_Seemore'] = $this->language->get('text_Seemore');
     $this->data['text_Bulletin'] = $this->language->get('text_Bulletin');
     $this->data['text_Suggestedanswer'] = $this->language->get('text_Suggestedanswer');
     $this->data['text_showOrder'] = $this->language->get('text_showOrder');
     $this->data['text_Writemood'] = $this->language->get('text_Writemood');
     $this->data['text_SynchronizationSina'] = $this->language->get('text_SynchronizationSina');
     $this->data['text_opportunity'] = $this->language->get('text_opportunity');
     $this->data['text_curious'] = $this->language->get('text_curious');
     $this->data['text_word'] = $this->language->get('text_word');
     $this->data['text_successful'] = $this->language->get('text_successful');
     $this->data['text_Localupload'] = $this->language->get('text_Localupload');
     $this->data['text_photos'] = $this->language->get('text_photos');
     $this->data['text_videoaddress'] = $this->language->get('text_videoaddress');
     $this->data['text_videowebsite'] = $this->language->get('text_videowebsite');
     $this->data['text_notvalid'] = $this->language->get('text_notvalid');
     $this->data['text_playback'] = $this->language->get('text_playback');
     $this->data['text_Choosetheme'] = $this->language->get('text_Choosetheme');
     $this->data['text_powered'] = $this->language->get('text_powered');
     $this->data['text_Release'] = $this->language->get('text_Release');
     $this->data['text_rec'] = $this->language->get('text_rec');
     $this->data['text_Comment'] = $this->language->get('text_Comment');
     $this->data['text_Master'] = $this->language->get('text_Master');
     $this->data['text_answer'] = $this->language->get('text_answer');
     $this->load->model('order/order');
     //判断用户是否登陆
     if ($this->customer->isLogged()) {
         $this->data['logged'] = 1;
     } else {
         $this->data['logged'] = 0;
     }
     //日历
     if (isset($this->session->data['customer_id'])) {
         $this->data['customer_id'] = $this->session->data['customer_id'];
         $signFlag = $this->model_order_order->getSignFlag($this->session->data['customer_id']);
         if ($signFlag['qiandao'] == date('Y-m-d', time())) {
             $this->data['signFlag'] = 1;
         } else {
             $this->data['signFlag'] = 0;
         }
         $customer = $this->customer->getFirstname();
         $product = $this->model_order_order->monthQiandao($this->data['customer_id']);
         $count = 0;
         if (is_array($product) && !empty($product)) {
             foreach ($product as $v) {
                 $v['addtime'] = date('Y-m-d', $v['addtime']);
                 $v = $v['addtime'];
                 $temp[] = $v;
             }
             $temp = array_unique($temp);
             foreach ($temp as $k => $v) {
                 $ex1 = explode("-", $v);
                 $ex = $ex1[1];
                 if ($ex == date('m', time())) {
                     $count++;
                 }
             }
         }
         $this->data['count'] = $count;
     } else {
         $this->data['session'] = 1;
         $customer = "";
     }
     $this->data['customer_name'] = $customer;
     $this->data['filesrc'] = $this->url->link('social/upfile');
     //晒尔公告
     $this->load->model('help/help');
     $bulletins = $this->model_help_help->getBulletins(1);
     $this->data['bulletins'] = $bulletins;
     //晒尔推荐
     $this->load->model('social/saiercomment');
     $saiercomment = $this->model_social_saiercomment->getShowComments();
     $this->data['saiercomment'] = array();
     foreach ($saiercomment as $saier) {
         if ($firstImg = explode('|', $saier['imgurl'])) {
             $countFirstImg = count($firstImg);
             $saier['imgurl'] = $firstImg[0];
             $strFile = '';
             foreach ($firstImg as $k => $v) {
                 $posDot = strrpos($v, '.');
                 $strExt = substr($v, $posDot);
                 $posXie = strrpos($v, '/');
                 $strFiles = substr($v, $posXie);
                 $strFiles = explode('-', $strFiles);
                 $strFiles = $strFiles[0];
                 if ($countFirstImg > 1 && $k <= $countFirstImg - 2) {
                     $strFiles = "uploads/big" . $strFiles . $strExt;
                     $strFile .= $strFiles . '|';
                 }
             }
             $strFile .= "uploads/big" . $strFiles . $strExt;
         }
         if (!empty($saier['videourl'])) {
             include_once DIR_SYSTEM . 'VideoUrlParser.class.php';
             $videourl = VideoUrlParser::parse($saier['videourl']);
             $video = $videourl;
         } else {
             $video = '';
         }
         $this->data['saiercomment'][] = array('if_show' => $saier['if_show'], 'message_id' => $saier['message_id'], 'firstname' => $saier['firstname'], 'face' => $saier['face'], 'country' => $saier['country'], 'message_text' => $saier['message_text'], 'imgurl' => $saier['imgurl'], 'strFile' => $strFile, 'videourl' => $video, 'comments' => $saier['comments'], 'points' => $saier['points'], 'utype' => $saier['utype']);
     }
     //达人榜
     $this->load->model('social/social');
     $darens = $this->model_social_social->getDaren();
     foreach ($darens as &$daren) {
         if (!$daren['face']) {
             $daren['face'] = "uploads/big/0b4a96400b2372d25da769647bfe4059.jpg";
         }
     }
     $this->data['daren_info'] = $darens;
     $this->template = 'cnstorm/template/common/social_right.tpl';
     $this->render();
 }
<?php

require_once "VideoUrlParser.class.php";
$result['data'] = VideoUrlParser::parse($_POST['url']);
if (!$result['data']) {
    $result['status'] = 0;
} else {
    $result['status'] = 1;
}
echo json_encode($result);
exit;
 private function _56video($ykid)
 {
     $video_url = 'http://www.56.com/u77/' . $ykid . '.html';
     //56视频播放地址
     $info = VideoUrlParser::parse($video_url);
     return $info;
 }
示例#11
0
文件: user.php 项目: h3len/Project
 /**
  * 在线视频地址解析
  */
 public function upload_online()
 {
     $url = isset($this->input['v_url']) ? trim(urldecode($this->input['v_url'])) : '';
     if (empty($url)) {
         echo json_encode(array('error' => 1, 'msg' => '参数错误'));
         exit;
     }
     include_once ROOT_PATH . 'lib/class/videoUrlParser.class.php';
     $video = new VideoUrlParser();
     $result = $video->parse($url);
     if (!$result) {
         echo json_encode(array('error' => 1, 'msg' => '上传失败'));
     } else {
         //本地化视频到数据库中
         $result['a'] = 'addVideo';
         $result['type'] = 1;
         $video = $this->status->localData($result);
         if (!$video) {
             echo json_encode(array('error' => 1, 'msg' => '上传失败'));
         } else {
             echo json_encode($video);
         }
     }
 }
示例#12
0
 protected function getList()
 {
     $url = '';
     if (isset($this->request->get['filter_gid'])) {
         $filter_gid = $this->request->get['filter_gid'];
     } else {
         $filter_gid = null;
     }
     if (isset($this->request->get['filter_uname'])) {
         $filter_uname = $this->request->get['filter_uname'];
         $url .= "&filter_uname=" . $filter_uname;
         $record_total = $this->model_community_saiercomment->messageTotalName($filter_uname);
     } else {
         $filter_uname = null;
     }
     if (isset($this->request->get['appr'])) {
         $appr = $this->request->get['appr'];
         $record_total = 5;
     } else {
         $appr = null;
     }
     if (isset($this->request->get['sort'])) {
         $sort = $this->request->get['sort'];
     } else {
         $sort = 'o.order_id';
     }
     if (isset($this->request->get['order'])) {
         $order = $this->request->get['order'];
     } else {
         $order = 'DESC';
     }
     if (isset($this->request->get['page'])) {
         $page = $this->request->get['page'];
     } else {
         $page = 1;
     }
     $this->data['breadcrumbs'] = array();
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => false);
     $this->data['breadcrumbs'][] = array('text' => "晒尔推荐", 'href' => $this->url->link('community/saiercomment', 'token=' . $this->session->data['token'] . $url, 'SSL'), 'separator' => ' :: ');
     if (isset($this->request->get['reply'])) {
         $reply_sid = $this->request->get['tosid'];
         $reply_msg = $this->request->get['message'];
         $this->model_community_saiercomment->replyComments($reply_msg, $reply_sid);
     }
     if (isset($this->request->post['selected']) && isset($this->request->post['filter_order_status_id'])) {
         $select = $this->request->post['selected'];
         $filter_order_status_id = $this->request->post['filter_order_status_id'];
     } else {
         $order = 'DESC';
     }
     $this->data['token'] = $this->session->data['token'];
     $this->data['manager'] = $this->user->getUserName();
     $this->data['orders'] = array();
     $data = array('sid' => $filter_gid, 'uname' => $filter_uname, 'appr' => $appr, 'sort' => $sort, 'order' => $order, 'start' => ($page - 1) * $this->config->get('config_admin_limit'), 'limit' => $this->config->get('config_admin_limit'));
     date_default_timezone_set('Asia/Shanghai');
     $results = $this->model_community_saiercomment->getComments($data);
     include_once DIR_SYSTEM . 'VideoUrlParser.class.php';
     foreach ($results as $result) {
         $imgurl = explode('|', $result['imgurl']);
         if (is_array($imgurl) && !empty($imgurl[0])) {
             $result['imgurl'] = $imgurl;
         }
         if ($result['videourl']) {
             $result['videoMassage'] = VideoUrlParser::parse($result['videourl']);
         } else {
             $result['videoMassage']['img'] = '';
         }
         $this->data['orders'][] = array('message_id' => $result['message_id'], 'fromuname' => $result['firstname'], 'if_show' => $result['if_show'], 'message' => $result['message_text'], 'sendtime' => date("Y-m-d H:i:s", $result['addtime']), 'imgurl' => $result['imgurl'], 'videourl' => $result['videourl'], 'videoMassage' => $result['videoMassage']['img'], 'country' => $result['country'], 'approved' => $result['approved'], 'zhiding' => $result['zhiding'], 'recomment' => $result['recomment'], 'selected' => isset($this->request->post['selected']) && in_array($result['message_id'], $this->request->post['selected']));
     }
     $record_total = isset($record_total) ? $record_total : $this->model_community_saiercomment->totalComments();
     $pagination = new Pagination();
     $pagination->total = $record_total;
     $pagination->page = $page;
     $pagination->limit = $this->config->get('config_admin_limit');
     $pagination->text = $this->language->get('text_pagination');
     $pagination->url = $this->url->link('community/saiercomment', 'token=' . $this->session->data['token'] . $url . '&page={page}', 'SSL');
     $this->data['pagination'] = $pagination->render();
     $this->template = 'community/saiercomment.tpl';
     $this->children = array('common/header', 'common/footer');
     $this->response->setOutput($this->render());
 }