예제 #1
0
파일: get.php 프로젝트: Coding110/cbvideo
 private function getVideos()
 {
     $request = $_REQUEST;
     $blacklist_fields = array('password', 'video_password', 'avcode', 'session');
     if (isset($request['page'])) {
         $page = (int) $request['page'];
     } else {
         $page = 1;
     }
     $get_limit = create_query_limit($page, $this->videos_limit);
     $request['limit'] = $get_limit;
     if (VERSION < 3) {
         $request['user'] = $request['userid'];
     }
     //$request['order'] = tbl('video.'.$request['order']);
     $vids = $request['video_id'];
     if ($vids) {
         $vids = explode(',', $vids);
         $request['videoids'] = $vids;
     }
     if ($is_mobile) {
         $request['has_mobile'] = 'yes';
     }
     global $cbvid;
     $videos = $cbvid->get_videos($request);
     //header('Content-Type: text/html; charset=utf-8');
     $new_videos = array();
     global $userquery;
     if ($videos) {
         foreach ($videos as $video) {
             $video['title'] = utf8_encode($video['title']);
             $video['description'] = utf8_encode($video['description']);
             $video['thumbs'] = array('default' => get_thumb($video), 'big' => get_thumb($video, 'big'));
             if (function_exists('get_mob_video')) {
                 $video['videos'] = array('mobile' => get_mob_video(array('video' => $video)));
                 if (has_hq($video)) {
                     $video['videos']['hq'] = get_hq_video_file($video);
                 }
             }
             $video['url'] = $video['video_link'] = $video['videoLink'] = videoLink($video);
             $video['avatar'] = $video['user_photo'] = $video['displayPic'] = $userquery->avatar($video);
             /*
               if (!$video['fullname'])
               {
               $video['userDetail'] = $userquery->get_user_details($video['userid']);
               }
             */
             foreach ($blacklist_fields as $field) {
                 unset($video[$field]);
             }
             $new_videos[] = $video;
         }
     }
     //echo $db->db_query;
     //echo json_encode($new_videos);
     if (!empty($new_videos)) {
         $data = array('code' => "200", 'status' => "success", "msg" => "Success", "data" => $new_videos);
         $this->response($this->json($data));
     } else {
         $data = array('code' => "204", 'status' => "success", "msg" => "No Record Found", "data" => "");
         $this->response($this->json($data));
     }
 }
예제 #2
0
$search->key = mysql_clean($request['query']);
$results = $search->search();
if ($results) {
    $the_results = array();
    switch ($type) {
        case "video":
        default:
            if ($results) {
                foreach ($results as $video) {
                    $hq_file = get_hq_video_file($video);
                    $video['title'] = title($video['title']);
                    $video['description'] = mob_description($video['description']);
                    $video['thumbs'] = array('default' => get_thumb($video), 'big' => getSmartyThumb(array('vdetails' => $video, 'size' => 'big')));
                    $video['videos'] = array('mobile' => get_mob_video(array('video' => $video)));
                    $video['url'] = $video['video_link'] = $video['videoLink'] = videoLink($video);
                    if (has_hq($video)) {
                        $video['videos']['hd'] = $hq_file;
                    }
                    foreach ($blacklist_fields as $field) {
                        unset($video[$field]);
                    }
                    $the_results[] = $video;
                }
            }
            break;
        case "users":
            if ($results) {
                foreach ($results as $user) {
                    $user['avatar'] = $user['user_photo'] = $userquery->avatar($user);
                    foreach ($blacklist_fields as $field) {
                        unset($user[$field]);