コード例 #1
0
ファイル: video.php プロジェクト: show123456/taiyou
$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : '';
$act = isset($_REQUEST['act']) ? $_REQUEST['act'] : '';
$customer_id = (int) $_SESSION['customer_id'];
$info_type = 'video';
$data = array();
//delete
if ($act == 'del' && $id) {
    Model_Table::get('InfoVideo')->delete("id='{$id}' and customer_id='{$customer_id}'");
    Model_Table::get('KeywordList')->delete("info_id='{$id}' and customer_id='{$customer_id}' and info_type='{$info_type}'");
    header("location:/home/info/index.php?type=video");
    die;
}
//method:add||modify
if ($id) {
    $music_table = new Model_InfoVideo();
    $data = $music_table->fetchRow("select * from info_video where id='{$id}' and customer_id='{$customer_id}'");
    $smarty->assign('infoRow', $data);
}
//submit
if (method_is('post')) {
    $data['customer_id'] = $customer_id;
    //$data['info_type']        = Model_InfoVideo::get_type($info_type);
    $data['keyword'] = isset($_POST['keyword']) ? str_inmysql(str_replace(array(';', ','), ',', $_POST['keyword'])) : '';
    $data['cate_id'] = isset($_POST['cate_id']) ? (int) $_POST['cate_id'] : '';
    $data['create_date'] = date('Y-m-d H:i:s', $_WGT['TIME']);
    $data['video_name'] = isset($_POST['video_name']) ? str_inmysql($_POST['video_name']) : '';
    $data['video_pic'] = isset($_POST['video_pic']) ? str_inmysql($_POST['video_pic']) : '';
    $data['video_desc'] = isset($_POST['video_desc']) ? str_inmysql($_POST['video_desc']) : '';
    $data['video_url'] = isset($_POST['video_url']) ? str_inmysql($_POST['video_url']) : '';
    $data['state'] = isset($_POST['state']) ? str_inmysql($_POST['state']) : '';
    if (!$data['keyword']) {
コード例 #2
0
ファイル: base_info.php プロジェクト: show123456/taiyou
 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;
 }