Ejemplo n.º 1
0
 public function show()
 {
     $type = intval($this->input['type']);
     $url = $this->input['url'];
     include_once ROOT_PATH . 'lib/class/shorturl.class.php';
     $shorturl = new shorturl($url);
     $url = $shorturl->shorturl($url);
     $vedio_url = $this->input['vedio_addr'];
     $title = $this->input['title'];
     $this->tpl->addVar('type', $type);
     $this->tpl->addVar('url', $url);
     $this->tpl->addVar('vedio_url', $vedio_url);
     $this->tpl->addVar('title', $title);
     echo $this->tpl->outTemplate('share_comm', 'hg_html_share_comm');
 }
Ejemplo n.º 2
0
 /**
  * Function to instantiate our class and make it a singleton
  */
 public static function getInstance()
 {
     if (!self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Ejemplo n.º 3
0
 public function __construct($_options)
 {
     if (is_array($_options)) {
         if (!empty($_options['db'])) {
             $this->_db = $_options['db'];
         }
         if (!empty($_options['table'])) {
             $this->_table = $_options['table'];
         }
         if (!empty($_options['sumtable'])) {
             $this->_sumtable = $_options['sumtable'];
         }
         if (!empty($_options['keys'])) {
             $this->_keys = $_options['keys'];
         }
         if (!empty($_options['keylength'])) {
             $this->_keylength = $_options['keylength'];
         }
         if (!empty($_options['host'])) {
             $this->_host = $_options['host'];
         }
         if (!empty($_options['port'])) {
             $this->_port = $_options['port'];
         }
         if (!empty($_options['domain'])) {
             $this->_domain = $_options['domain'];
         }
         if (!empty($_options['username'])) {
             $this->_username = $_options['username'];
         }
         if (!empty($_options['password'])) {
             $this->_password = $_options['password'];
         }
         if (!class_exists('Mongo')) {
             return false;
         }
         if (!empty($this->_username) && !empty($this->_password)) {
             $constr = 'mongodb://' . $this->_username . ':' . $this->_password . '@' . $this->_host . ':' . $this->_port;
         } else {
             $constr = 'mongodb://' . $this->_host . ':' . $this->_port;
         }
         if (!self::$handle) {
             self::$handle = new Mongo($constr);
         }
         $db = self::$handle->selectDB($this->_db);
         $this->conn = $db->selectCollection($this->_table);
         if (!$this->conn) {
             return false;
         }
     }
 }
Ejemplo n.º 4
0
 private function status_bind($id, $text, $pic_id)
 {
     include_once ROOT_DIR . 'lib/user/user.class.php';
     $this->mUser = new user();
     $bind_info = $this->mUser->get_bind_info();
     //获取绑定信息
     include_once ROOT_PATH . 'lib/class/status.class.php';
     $status = new status();
     if (!$bind_info) {
         //do nothing!
     } else {
         //file_put_contents('d:/show.txt', '用户绑定了' , FILE_APPEND);
         $bind_info = $bind_info[0];
         if ($bind_info['state'] == 1 && $bind_info['last_key']) {
             //file_put_contents('d:/show.txt', '用户开启同步了' , FILE_APPEND);
             include_once ROOT_PATH . 'lib/class/weibooauth.class.php';
             $last_key = unserialize($bind_info['last_key']);
             $oauth = new WeiboClient(WB_AKEY, WB_SKEY, $last_key['oauth_token'], $last_key['oauth_token_secret']);
             //$oauth = new WeiboOAuth( WB_AKEY , WB_SKEY , 'e9b1d743a687550cec725e65fd204b6c' , '119934aabf1632d426533505c0f02e70' );
             //判断是否发送了图片
             if ($pic_id) {
                 //file_put_contents('d:/show.txt', '用户发送了图片' , FILE_APPEND);
                 //取出该图片的路径
                 //获取媒体信息
                 $pic_url = $status->getPicById($pic_id);
                 $url = $pic_url[0];
                 //$url = 'http://127.0.0.1/3.jpg';
                 $content = $oauth->upload($text, $url);
             } else {
                 $content = $text;
                 $pattern = "/#([\\x{4e00}-\\x{9fa5}0-9A-Za-z_-\\s‘’“”'\"!\\?\$%&:;!?¥×\\*\\<\\>》《]+)[\\s#]/iu";
                 if (preg_match_all($pattern, $content, $topic)) {
                     include_once ROOT_PATH . 'lib/class/shorturl.class.php';
                     $shorturl = new shorturl();
                     $link = '';
                     $tmp_url = '';
                     $topic_name = array();
                     foreach ($topic[1] as $key => $value) {
                         $tmp_url = SNS_MBLOG . 'k.php?q=' . urlencode($value);
                         $short_url = $shorturl->shorturl($tmp_url);
                         $link .= $short_url;
                     }
                     $content = $content . $link;
                 }
                 //			    	$content = $oauth->post( $oauth->updateURL() , array( 'status' =>  $content) );
                 $content = $oauth->update($content);
                 //同步发送
             }
             $syn_id = $content['id'];
             //返回点滴的ID
             $type = $bind_info['type'];
             //绑定类型
             /**
              * 记录同步发送的点滴id
              */
             $status->syn_relation($id, $syn_id, $type);
         }
     }
 }
Ejemplo n.º 5
0
 /**
  * 验证内容,是否含有屏蔽词语,是否含有短网址
  * @param $text 传入值
  * @param $memberid
  * @param $source
  * @return $info array 
  */
 private function verifyUrlBanword($text, $memberid, $source)
 {
     include_once ROOT_DIR . 'lib/class/banword.class.php';
     $banword = new banword();
     $status = 0;
     $banwords = $banword->banword(urlencode($text));
     if ($banwords && $banwords != 'null') {
         $status = 1;
         $banwords = implode(',', $banwords);
     } else {
         $banwords = '';
     }
     include_once ROOT_DIR . 'lib/class/shorturl.class.php';
     $shorturl = new shorturl();
     $text = $shorturl->shorturl($text);
     /*
      * 在这里对是否含有媒体信息进行判断
      * */
     $info = array('member_id' => $memberid, 'text' => $text, 'location' => '地址', 'status' => $status, 'source' => $source, 'bans' => $banwords);
     return $info;
 }
Ejemplo n.º 6
0
<?php

/* urlshort / api.php */
/* api for creation and lookup*/
/* written june 24 2008 by adam */
/* updated may 29 2009 by matt */
error_reporting(0);
require_once 'includes/config.php';
// settings
require_once 'includes/gen.php';
// url generation and location
require_once 'includes/install_path.php';
global $request;
$url = new shorturl();
$msg = '';
header('HTTP/1.1 500 Internal Server Error');
// if the url has been sent to this script
if (isset($request->url) && strlen(trim($request->url))) {
    // escape bad characters from the users url
    $longurl = trim(mysql_escape_string($request->url));
    // set the protocol to not ok by default
    $protocol_ok = false;
    // if there's a list of allowed protocols,
    // check to make sure its all cool
    if (count($allowed_protocols)) {
        foreach ($allowed_protocols as $ap) {
            if (strtolower(substr($longurl, 0, strlen($ap))) == strtolower($ap)) {
                $protocol_ok = true;
                break;
            }
        }
Ejemplo n.º 7
0
 /**
  * 视频
  */
 public function uploadVideo()
 {
     //$this->input['url'] = "http://www.tudou.com/playlist/playindex.do?lid=11088377&iid=68415328";
     $userinfo = $this->mUser->verify_credentials();
     if (!$userinfo['id']) {
         $this->errorOutput(USENAME_NOLOGIN);
     }
     if (!$this->input['url']) {
         $this->errorOutput(OBJECT_NULL);
     }
     $link = urldecode($this->input['url']);
     //		$link = "http://127.0.0.1/livsns/vui/video_play.php?id=1";
     $infos = hg_get_video($link);
     //		file_put_contents("D:texzt.php", $link);
     if (!$infos['img'] && !$infos['link'] && !$infos['title']) {
         $this->errorOutput(OBJECT_NULL);
     }
     include_once ROOT_DIR . 'lib/class/shorturl.class.php';
     $short = new shorturl();
     $url = $short->shorturl($link);
     $ip = hg_getip();
     $create_at = time();
     $sql = "INSERT " . DB_PREFIX . "media(status_id,type,title,link,img,url,ip,create_at) VALUES(0,1,'" . str_replace("'", "’", $infos['title']) . "','" . $infos['link'] . "','" . $infos['img'] . "','" . $url . "','" . $ip . "'," . $create_at . ")";
     $this->db->query($sql);
     $id = $this->db->insert_id();
     $info['id'] = $id;
     $info['url'] = $url;
     $info['ip'] = $ip;
     $info['link'] = $infos['link'];
     $info['img'] = $infos['img'];
     $info['title'] = $infos['title'];
     $info['create_at'] = $create_at;
     $info['type'] = 1;
     $this->setXmlNode('media', 'info');
     $this->addItem($info);
     return $this->output();
 }
Ejemplo n.º 8
0
    public function show()
    {
        $sta_id = intval(trim($this->input['sta_id']));
        $n_user_id = intval(trim($this->user['id']));
        $n_station = $this->mVideo->get_user_station($n_user_id);
        $n_sta_id = intval(trim($n_station['id']));
        $station = $this->mVideo->get_station($sta_id);
        $station = $station[0];
        $user_id = intval(trim($station['user_id']));
        $username = $station['user']['username'];
        $vip_url = $station['user']['vip_url'] ? $station['user']['vip_url'] : '';
        if ($sta_id && $user_id) {
            $program = $this->mVideo->get_station_programe($sta_id, $user_id);
            //			hg_pre($program);
            $info_id = array();
            $info = array();
            $js = 'var gProgramIds = new Array();
				var gIndexs = new Array();
				var gVideoIds = new Array();
				var gTitles = new Array();
				var gMedias = new Array();
				var gSchematic = new Array();
				var gToffs = new Array();
				var gBriefs = new Array();
				var gRelations = new Array();
				var user_id = ' . $this->user['id'] . ';
				var sta_id = ' . $n_sta_id . ';
				var gLastProgram = 0;
				';
            if ($program && is_array($program)) {
                $skey = 0;
                foreach ($program as $key => $value) {
                    if (!$key) {
                        $js .= "var gFirstProgram = " . $value['id'] . ";";
                    }
                    $js .= 'gIndexs[' . $value['id'] . '] = ' . $key . ';';
                    $js .= 'gProgramIds[' . $key . '] = ' . $value['id'] . ';';
                    $js .= "gVideoIds[{$value['id']}] = '{$value['video']['id']}';";
                    $js .= "gTitles[{$value['id']}] = \"" . addslashes($value['video']['title']) . "\";";
                    $js .= "gMedias[{$value['id']}] = '{$value['video']['streaming_media']}';";
                    $js .= "gSchematic[{$value['id']}] = '{$value['video']['schematic']}';";
                    $js .= "gToffs[{$value['id']}] = '{$value['video']['toff']}';";
                    //$js .= "gBriefs[{$value['id']}] = '{$value['video']['brief']}';";
                    $js .= "gRelations[{$value['id']}] = '{$value['video']['relation']}';";
                    $skey = $key;
                }
                $js .= "gLastProgram = " . $skey . ";";
            }
            /*include_once(ROOT_PATH . 'lib/class/groups.class.php');
            		$this->group = new Group();
            		$group = $this->group->get_my_groups($user_id);*/
            if ($this->user['id'] == $user_id) {
                $is_my_page = 1;
            } else {
                $is_my_page = 0;
            }
            $this->mVideo->update_click_count($sta_id);
            if (!$is_my_page && $this->user['id']) {
                $this->mVideo->create_visit_history($user_id, $sta_id, 2);
            }
            $visit = $this->mVideo->get_visit_history($sta_id, $type = 2, $page = 0, $count = 10);
            $type = 1;
            $state = 1;
            //评论状态,0-待审核,1-已审核通过
            $cid = $sta_id;
            $user_id = $user_id;
            $count = 10;
            $page = intval($this->input['pp']) / $count;
            $comment_list = $this->mVideo->get_comment_list($user_id, $cid, $type, $state, $page, $count);
            if (is_array($comment_list)) {
                $total_nums = $comment_list['total'];
                unset($comment_list['total']);
                $data['totalpages'] = $total_nums;
                $data['perpage'] = $count;
                $data['curpage'] = $this->input['pp'];
                $data['onclick'] = ' onclick="comment_page(this,' . $cid . ',' . $user_id . ',' . $type . ',' . $count . ');"';
                $data['pagelink'] = hg_build_link('', array('user_id' => $this->input['user_id'], 'sta_id' => $this->input['sta_id']));
                $showpages = hg_build_pagelinks($data);
            }
            $url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
            include_once ROOT_PATH . 'lib/class/shorturl.class.php';
            $shorturl = new shorturl($url);
            $url = $shorturl->shorturl($url);
            $url = urldecode($url);
            $this->page_title = $station['web_station_name'] . '视频_原创视频';
            $this->keywords = $station['web_station_name'];
            $this->description = $station['web_station_name'];
            hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'comment.js');
            //			hg_add_head_element('js', RESOURCE_DIR . 'scripts/' .  'tvieplayer_new.js');
            //			hg_add_head_element('js', 'http://liveapi.hcrt.cn/flash-player_r9510/swfobject.js');
            //			hg_add_head_element('js', 'http://liveapi.hcrt.cn/flash-player_r9510/tvieplayer.js');
            hg_add_head_element('js', 'http://video.hcrt.cn/flash-player/swfobject.js');
            hg_add_head_element('js', 'http://video.hcrt.cn/flash-player/tvieplayer.js');
            hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'share.js');
            hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'station.js');
            hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'my.js');
            hg_add_head_element('css', RESOURCE_DIR . 'css/' . 'color_open.css', 'id="lamp" ');
            hg_add_head_element('js-c', "{$js}");
            hg_add_head_element('js-c', 'var video_address="";video_title="";');
            /*start---视频广告*/
            if (defined('ADVERT_XML')) {
                $xml = simplexml_load_file(ADVERT_XML, null, LIBXML_NOCDATA);
                $prePlayAd = $xml->item->prePlayAd;
                $prePlayAd_url = $xml->item->prePlayAd_url;
                $onPauseAd = $xml->item->onPauseAd;
                $onPauseAd_url = $xml->item->onPauseAd_url;
                $onEndAd = $xml->item->onEndAd;
                $onEndAd_url = $xml->item->onEndAd_url;
            }
            /*end-----视频广告*/
            hg_add_head_element('js-c', '
				REQUEST_URI = "' . $_SERVER['REQUEST_URI'] . '";
				REQUEST_URL = "' . $url . '";
				U_REQUEST_URI = "' . urlencode($_SERVER['REQUEST_URI']) . '";
				WB_AKEY = "' . WB_AKEY . '";			
				WEB_SITE_NAME = "' . WEB_SITE_NAME . '";
          		var prePlayAd = "' . $prePlayAd . '";
          		var prePlayAd_url = "' . $prePlayAd_url . '";
          		var onPauseAd = "' . $onPauseAd . '";
          		var onPauseAd_url = "' . $onPauseAd_url . '";
          		var onEndAd = "' . $onEndAd . '";
          		var onEndAd_url = "' . $onEndAd_url . '";
			');
            $_mBodyCode = ' onload="timing();"';
            $gScriptName = SCRIPTNAME;
            $this->tpl->addVar('head_line', 0);
            $this->tpl->addVar('_mBodyCode', $_mBodyCode);
            $this->tpl->addVar('station', $station);
            $this->tpl->addVar('n_sta_id', $n_sta_id);
            $this->tpl->addVar('n_station', $n_station);
            $this->tpl->addVar('n_user_id', $n_user_id);
            $this->tpl->addVar('sta_id', $sta_id);
            $this->tpl->addVar('username', $username);
            $this->tpl->addVar('vip_url', $vip_url);
            $this->tpl->addVar('program', $program);
            $this->tpl->addVar('is_my_page', $is_my_page);
            $this->tpl->addVar('visit', $visit);
            $this->tpl->addVar('user_id', $user_id);
            $this->tpl->addVar('comment_list', $comment_list);
            $this->tpl->addVar('total_nums', $total_nums);
            $this->tpl->addVar('showpages', $showpages);
            $this->tpl->addVar('url', $url);
            $this->tpl->addVar('gScriptName', $gScriptName);
            $this->tpl->addVar('cid', $cid);
            $this->tpl->addVar('video_id', 0);
            $this->tpl->addVar('toff', 0);
            $this->tpl->addVar('type', $type);
            $this->tpl->addVar('play', 1);
            $this->tpl->addVar('gKeywords', $this->keywords);
            $this->tpl->addVar('gDescription', $this->description);
            $this->tpl->addHeaderCode(hg_add_head_element('echo'));
            $this->tpl->setTemplateTitle($this->page_title);
            $this->tpl->outTemplate('station_play');
        } else {
            header("Location:index.php");
        }
    }
Ejemplo n.º 9
0
 function onsoap_info()
 {
     if ($this->user['admin'] == 1) {
         $id = getgpc('id', 'P');
         $name = getgpc('name', 'P');
         $blog = getgpc('blog', 'P');
         $soapId = getgpc('soapId', 'P');
         $avatar = getgpc('img', 'P');
         $link = SNS_UCENTER . "user.php?user_id=" . $id;
         include_once ROOT_PATH . 'lib/class/shorturl.class.php';
         include_once ROOT_PATH . 'lib/func/functions.php';
         $shorturl = new shorturl();
         $link = $shorturl->shorturl($link);
         //$avatar = $shorturl->shorturl($avatar);
         //导入cms
         $xml_soap = '<?xml version="1.0" encoding="utf-8"?> <contentlist> <con> <columnid>' . $soapId . '</columnid><tcontentid>' . $id . '</tcontentid><tname>' . $name . '</tname><user_id>' . $id . '</user_id><title>' . $name . '</title><images>' . $avatar . '</images><content>' . $blog . '</content><liv_outlink>' . $link . '</liv_outlink></con></contentlist>';
         ini_set("soap.wsdl_cache_enabled", "0");
         $objSoapClient = new SoapClient($this->gSoapConfig['wsdl_url']);
         $xml_soap = $objSoapClient->import($xml_soap, $this->gSoapConfig['u'], $this->gSoapConfig['p']);
         if ($xml_soap == 1) {
             echo "导入成功";
         } else {
             echo "导入错误";
         }
     } else {
         echo "没有权限";
     }
 }
Ejemplo n.º 10
0
function do_shorten_redirect(&$model, &$model)
{
    global $request;
    if (!($model->table == 'settings')) {
        return;
    }
    $perma = parse_url($_SERVER['REQUEST_URI']);
    $_PERMA = explode("/", $perma['path']);
    @array_shift($_PERMA);
    if (isset($_PERMA[0])) {
        $id = mysql_escape_string($_PERMA[0]);
    } else {
        $id = '';
    }
    if ($id != '' && $id != basename($_SERVER['PHP_SELF'])) {
        add_include_path(library_path() . 'urlshort/upload');
        require_once 'includes/config.php';
        // settings
        require_once 'includes/gen.php';
        // url generation and location
        $url = new shorturl();
        $location = $url->get_url($id);
        if ($location != -1) {
            include 'db/library/pca/pca.class.php';
            $cache = PCA::get_best_backend();
            $timeout = 86400;
            $cache->add($_SERVER['REQUEST_URI'], $location, $timeout);
            header('Location: ' . $location, TRUE, 301);
            exit;
        }
    }
}
Ejemplo n.º 11
0
 private function check_url($text)
 {
     include_once ROOT_PATH . 'lib/class/shorturl.class.php';
     $shorturl = new shorturl();
     return $shorturl->shorturl($text);
 }
Ejemplo n.º 12
0
    public function show()
    {
        global $gGlobalConfig;
        include_once ROOT_PATH . 'lib/class/shorturl.class.php';
        $shorturl = new shorturl();
        $last_id = @file_get_contents(CACHE_DIR . 'autoget.txt');
        echo $last_id = intval($last_id);
        $statusline = $this->status->public_timeline($page, 30, $last_id, 1);
        if ($statusline) {
            krsort($statusline);
            $xml_soap = '<?xml version="1.0" encoding="utf-8"?> <contentlist>';
            $pattern = "((((f|ht){1}tp|ftp|gopher|news|telnet|rtsp|mms)://|www\\.)[-a-zA-Z0-9@:%_\\+.~#?&//=]+)";
            foreach ($statusline as $k => $blog) {
                if (in_array($blog['user']['id'], array(1, 6687))) {
                    continue;
                }
                $blog['text'] = strip_tags($blog['text']);
                $blog['text'] = preg_replace("/<script/i", "&#60;script", $blog['text']);
                $pregfind = array('&#032;', '<!--', '-->', '>', '<', '"', '!', "'", "\n", '$', "\r");
                $pregreplace = array(' ', '&#60;&#33;--', '--&#62;', '&gt;', '&lt;', '&quot;', '&#33;', '&#39;', '', '&#036;', '');
                $val = str_replace($pregfind, $pregreplace, $blog['text']);
                $blog['text'] = preg_replace('/\\\\(&amp;#|\\?#)/', '&#092;', $blog['text']);
                $blog['text'] = preg_replace("/(\\:.*[0-9]*\\:)/Ui", '', $blog['text']);
                $blog['text'] = preg_replace($pattern, '', $blog['text']);
                $blog['text'] = trim($blog['text']);
                $text = preg_replace("/(#[\\x{4e00}-\\x{9fa5}0-9A-Za-z_-\\s‘’“”'\"!\\?\$%&:;!?¥×\\*\\<\\>》《]+[\\s#])/iu", '', $blog['text']);
                if (!$blog['text'] || !trim($text)) {
                    continue;
                }
                if ($blog['medias'][0]['ori']) {
                    if ($blog['text'] == '分享图片') {
                        continue;
                    }
                } else {
                    $images = '';
                }
                $last_id = $blog['id'];
                if ($gGlobalConfig['rewrite']) {
                    $link = $this->settings['mblog_url'] . 'status-' . $blog['id'] . '.html';
                } else {
                    $link = $this->settings['mblog_url'] . 'show.php?id=' . $blog['id'];
                }
                $link = $shorturl->shorturl($link);
                $xml_soap .= '<content> 
					<columnid>24</columnid>
					<tcontentid>' . $blog['id'] . '</tcontentid>
					<title><![CDATA[' . $blog['text'] . ']]></title>
					<tname><![CDATA[' . $blog['user']['username'] . ']]></tname>
					<user_id>' . $blog['user']['id'] . '</user_id>
					<images><![CDATA[' . $images . ']]></images>
					<content><![CDATA[' . $blog['text'] . ']]></content>
					<liv_outlink><![CDATA[' . $link . ']]></liv_outlink>
					</content>';
            }
            $xml_soap .= '</contentlist>';
            ini_set("soap.wsdl_cache_enabled", "0");
            $xml_soap = preg_replace('/[\\x00-\\x08\\x0b-\\x0c\\x0e-\\x1f]/', '', $xml_soap);
            $objSoapClient = new SoapClient($this->gSoapConfig['wsdl_url']);
            $xml_soap = $objSoapClient->import($xml_soap, $this->gSoapConfig['u'], $this->gSoapConfig['p']);
            if ($xml_soap) {
                file_put_contents(CACHE_DIR . 'autoget.txt', $last_id);
            }
        }
    }
Ejemplo n.º 13
0
    public function play()
    {
        $video_id = intval(trim($this->input['id']));
        if ($video_id) {
            /**
             * 获取单个已发布的的视频
             */
            $single_video_info = $this->mVideo->get_single_video($video_id);
            if (!$single_video_info['id']) {
                if ($this->user['id']) {
                    header('Location:' . SNS_VIDEO . 'user.php?user_id=' . $this->user['id']);
                } else {
                    header('Location:' . SNS_VIDEO);
                }
            }
            /**
             * 更新这部视频的播放数
             */
            $this->mVideo->update_play_count($video_id);
            if (is_array($single_video_info)) {
                $user_id = $single_video_info['user_id'];
                $username = $single_video_info['user']['username'];
                $vip_url = $single_video_info['user']['vip_url'] ? $single_video_info['user']['vip_url'] : '';
                $visit_total = $single_video_info['click_count'];
            }
            if ($this->user['id'] == $user_id) {
                $relation = 1;
            } else {
                $relation = 0;
            }
            if (!$relation && $this->user['id']) {
                $this->mVideo->create_visit_history($user_id, $video_id);
            }
            $visit = $this->mVideo->get_visit_history($video_id, $type = 1, $page = 0, $count = 10);
            $type = 0;
            $state = 1;
            //评论状态,0-待审核,1-已审核通过
            $cid = $video_id;
            $user_id = $user_id;
            $count = 10;
            $page = intval($this->input['pp']) / $count;
            $comment_list = $this->mVideo->get_comment_list($user_id, $cid, $type, $state, $page, $count);
            if (is_array($comment_list)) {
                $total_nums = $comment_list['total'];
                unset($comment_list['total']);
                $data['totalpages'] = $total_nums;
                $data['perpage'] = $count;
                $data['curpage'] = $this->input['pp'];
                $data['onclick'] = ' onclick="comment_page(this,' . $cid . ',' . $user_id . ',' . $type . ',' . $count . ');"';
                $data['pagelink'] = $this->input['id'] ? hg_build_link('', array('id' => $this->input['id'])) : '';
                $showpages = hg_build_pagelinks($data);
            }
            $station = $this->mVideo->get_user_station($user_id);
            $program = $this->mVideo->video_program($video_id, 0, 3);
            if (is_array($program)) {
                $program_total = $program['total'];
                unset($program['total']);
            }
            $video = $this->mVideo->video_tags_search($video_id, 0, 8);
            if (is_array($video)) {
                unset($video['total']);
            }
            include_once ROOT_PATH . 'lib/class/groups.class.php';
            $this->group = new Group();
            $group = $this->group->get_my_groups($user_id);
            $n_user_id = intval(trim($this->user['id']));
            $station = $this->mVideo->get_user_station($n_user_id);
            $n_sta_id = intval(trim($station['id']));
            $toff = $single_video_info['toff'];
            $program_all = $this->mVideo->get_station_program($n_sta_id, $n_user_id);
            $start_time = 0;
            if (is_array($program_all)) {
                $start_time = $program_all[count($program_all) - 1]['end_time'];
            }
            $this->page_title = $single_video_info['title'] . "视频_视频信息";
            $this->keywords = $single_video_info['title'];
            $this->description = $single_video_info['title'];
            hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'comment.js');
            //			hg_add_head_element('js', RESOURCE_DIR . 'scripts/' .  'tvieplayer_new.js');
            hg_add_head_element('js', 'http://video.hcrt.cn/flash-player/swfobject.js');
            hg_add_head_element('js', 'http://video.hcrt.cn/flash-player/tvieplayer.js');
            /*start---视频广告*/
            if (defined('ADVERT_XML')) {
                $xml = simplexml_load_file(ADVERT_XML, null, LIBXML_NOCDATA);
                $prePlayAd = $xml->item->prePlayAd;
                $prePlayAd_url = $xml->item->prePlayAd_url;
                $onPauseAd = $xml->item->onPauseAd;
                $onPauseAd_url = $xml->item->onPauseAd_url;
                $onEndAd = $xml->item->onEndAd;
                $onEndAd_url = $xml->item->onEndAd_url;
                $watermark = $xml->item->watermark;
            }
            /*end-----视频广告*/
            $js = '
           video_address="' . $single_video_info['streaming_media'] . '";
           video_title="' . $single_video_info['title'] . '";
           video_schematic="' . $single_video_info['schematic'] . '";
			function lightOnHanle() { lamps(2,1);}
           function lightOffHandle() { lamps(2,0);}
            function playComplete() {}
            var resource = "http://video.hcrt.cn/flash-player/";
            var width = 530;
            var height = 462;
            var tvie = new TViePlayer("player", resource+"CBNVodSkin.swf", width, height);
            tvie.videoScaleMode = "original";
			tvie.bgcolor="#000";
            //tvie.forceBase64 = true;
            tvie.loader = resource+"Loader.swf";
            tvie.player = resource+"Player.swf";
            tvie.setTVieVod("video.hcrt.cn", "' . $single_video_info['streaming_media'] . '");
            tvie.setJSCallback("playComplete", "lightOnHanle", "lightOffHandle");
            var adLoader = resource+"MockADS/TVieADLoader.swf";
            var layout = {layout:"float",vertical:"middle",horizen:"center"};
            
            tvie.addPlugin(resource+"TVieNotice.swf", { mode: "isolate" }, {layout:"float",x:105,y:420}, ["api","http://www.hoolo.tv/dealfunc/notice.php","width",300,"height",20,"refreshInterval",3]);
            tvie.addPlugin(resource+"TVieVideoList2.swf",{mode:"embeded",type:"onEndAd"}, {layout:"float",x:2,y:0}, ["api","http://www.hoolo.tv/dealfunc/videoList.php","id","any"],null,true,false);
            tvie.addPlugin(resource+"MockADS/TVieADLoader.swf",{mode:"isolate"},{layout:"float",vertical:"top",horizen:"right",x:-20,y:10},["url","' . $watermark . '","width",115,"height",57],null,true,null,null);
			tvie.addPlugin(resource+"TVieFacade.swf", { mode: "embeded",type:"facade" },{layout:"float",x:0,y:0},["adapter","yi_chuan_mei","ad_player","http://static.acs86.com/FrameWork/AFP/AFP_1031.swf","width",540,"height",455,"id",2460,"keywords",""]);			
 			tvie.run();
			';
            //tvie.addPlugin(resource+"TVieFacade.swf", { mode: "embeded",type:"facade" },{layout:"float",x:0,y:0},["adapter","yi_chuan_mei","ad_player","http://static.acs86.com/FrameWork/AFP/AFP_1031.swf","width",540,"height",455,"id",2460,"keywords",""]);
            hg_add_head_element('js-c', $js);
            hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'share.js');
            hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'my.js');
            hg_add_head_element('css', RESOURCE_DIR . 'css/' . 'color_open.css', 'id="lamp" ');
            $url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
            include_once ROOT_PATH . 'lib/class/shorturl.class.php';
            $shorturl = new shorturl($url);
            $url = $shorturl->shorturl($url);
            $url = urldecode($url);
            $gScriptName = SCRIPTNAME;
            $this->tpl->addVar('head_line', 0);
            $this->tpl->addVar('single_video_info', $single_video_info);
            $this->tpl->addVar('user_id', $user_id);
            $this->tpl->addVar('username', $username);
            $this->tpl->addVar('cid', $cid);
            $this->tpl->addVar('vip_url', $vip_url);
            $this->tpl->addVar('visit_total', $visit_total);
            $this->tpl->addVar('video_id', $video_id);
            $this->tpl->addVar('relation', $relation);
            $this->tpl->addVar('total_nums', $total_nums);
            $this->tpl->addVar('comment_list', $comment_list);
            $this->tpl->addVar('visit', $visit);
            $this->tpl->addVar('program', $program);
            $this->tpl->addVar('program_total', $program_total);
            $this->tpl->addVar('video', $video);
            $this->tpl->addVar('station', $station);
            $this->tpl->addVar('n_sta_id', $n_sta_id);
            $this->tpl->addVar('n_user_id', $n_user_id);
            $this->tpl->addVar('toff', $toff);
            $this->tpl->addVar('showpages', $showpages);
            $this->tpl->addVar('url', $url);
            $this->tpl->addVar('gScriptName', $gScriptName);
            $this->tpl->addVar('play', 1);
            $this->tpl->addVar('gKeywords', $this->keywords);
            $this->tpl->addVar('gDescription', $this->description);
            $this->tpl->addHeaderCode(hg_add_head_element('echo'));
            $this->tpl->setTemplateTitle($this->page_title);
            $this->tpl->outTemplate('video_play');
        } else {
            //报错
        }
    }