page_number = isset($_GET['page-id']) ? $_GET['page-id'] : 1; $limit_per_page = isset($_GET['limit']) ? (int) $_GET['limit'] : 50; $link = ""; $video_source = 'all'; if (!empty($_GET['source'])) { $video_source = PT_Secure($_GET['source']); } $link .= "&source=".$video_source; $video_filter = 'all'; $category_filter = '0'; if (!empty($_GET['category_id'])) { if (in_array($_GET['category_id'], array_keys(ToArray($pt->categories)))) { $category_filter = $_GET['category_id']; } } $link .= "&category_id=".$category_filter; $video_filter = 'all'; if (isset($_GET['privacy'])) { if (in_array($_GET['privacy'], array('0', '1', '2'))) { $video_filter = $_GET['privacy']; } } $link .= "&privacy=".$video_filter; $video_approve = 'all'; if (isset($_GET['status'])) { if (in_array($_GET['status'], array('0', '1'))) { $video_approve = $_GET['status']; } } $link .= "&status=".$video_approve; $video_type = 'all'; if (isset($_GET['type'])) { if (in_array($_GET['type'], array('all', 'free','paid','review'))) { $video_type = $_GET['type']; } } $link .= "&type=".$video_type; $filter_keyword = (!empty($_GET['query'])) ? PT_Secure($_GET['query']) : ''; $db->pageLimit = $limit_per_page; $where = 'id > 0'; if ($video_source != 'all') { if ($video_source == 'youtube') { $where .= " AND `youtube` <> ''"; } if ($video_source == 'dailymotion') { $where .= " AND `daily` <> ''"; } if ($video_source == 'vimeo') { $where .= " AND `vimeo` <> ''"; } if ($video_source == 'uploaded') { $where .= " AND `youtube` = '' AND `vimeo` = '' AND `daily` = ''"; } } if (!empty($category_filter)) { $where .= " AND `category_id` = '$category_filter'"; } if (isset($video_filter)) { if ($video_filter != 'all') { $where .= " AND `privacy` = '$video_filter'"; } } if (isset($video_approve)) { if ($video_approve != 'all') { $where .= " AND `approved` = '$video_approve'"; } } if (isset($video_type)) { if ($video_type == 'paid') { $where .= " AND `sell_video` > 0 "; } elseif ($video_type == 'free') { $where .= " AND `sell_video` = 0 "; } elseif ($video_type == 'review') { $where .= " AND `approved` = 0 "; } } if (!empty($filter_keyword)) { $link .= "&query=".$filter_keyword; $where .= " AND MATCH (title) AGAINST ('{$filter_keyword}' IN BOOLEAN MODE) OR id = '$filter_keyword' OR (video_id = '$filter_keyword')"; } if (!empty($_GET['range']) && in_array($_GET['range'], array('Today','Yesterday','This Week','This Month','Last Month','This Year'))) { if ($_GET['range'] == 'Today' || $_GET['range'] == 'Yesterday') { $this_start = strtotime(date('M')." ".date('d').", ".date('Y')." 12:00am"); $this_end = strtotime(date('M')." ".date('d').", ".date('Y')." 11:59pm"); if ($_GET['range'] == 'Yesterday') { $this_start = strtotime(date('M')." ".date('d',strtotime("-1 days")).", ".date('Y')." 12:00am"); $this_end = strtotime(date('M')." ".date('d',strtotime("-1 days")).", ".date('Y')." 11:59pm"); } $main_range = 'Today'; $title = "Daily"; } elseif ($_GET['range'] == 'This Week') { $time = strtotime(date('l').", ".date('M')." ".date('d').", ".date('Y')); if (date('l') == 'Saturday') { $this_start = strtotime(date('M')." ".date('d').", ".date('Y')." 12:00am"); } else{ $this_start = strtotime('last saturday, 12:00am', $time); } if (date('l') == 'Friday') { $this_end = strtotime(date('M')." ".date('d').", ".date('Y')." 11:59pm"); } else{ $this_end = strtotime('next Friday, 11:59pm', $time); } $main_range = 'This Week'; $title = "Weekly"; } elseif ($_GET['range'] == 'This Month' ||$_GET['range'] == 'Last Month') { $this_start = strtotime("1 ".date('M')." ".date('Y')." 12:00am"); $this_end = strtotime(cal_days_in_month(CAL_GREGORIAN, date('m'), date('Y'))." ".date('M')." ".date('Y')." 11:59pm"); if ($_GET['range'] == 'Last Month') { $this_start = strtotime("1 ".date('M',strtotime("-1 month"))." ".date('Y')." 12:00am"); $this_end = strtotime(cal_days_in_month(CAL_GREGORIAN, date('m',strtotime("-1 month")), date('Y'))." ".date('M',strtotime("-1 month"))." ".date('Y')." 11:59pm"); } $main_range = 'This Month'; $title = "Monthly"; } elseif ($_GET['range'] == 'This Year') { $this_start = strtotime("1 January ".date('Y')." 12:00am"); $this_end = strtotime("31 December ".date('Y')." 11:59pm"); $main_range = 'This Year'; $title = "Yearly"; } } $start = ''; $end = ''; $first_code = ''; $second_code = ''; if (!empty($_GET['range']) && !in_array($_GET['range'], array('Today','Yesterday','This Week','This Month','Last Month','This Year'))) { $arr = explode('-', $_GET['range']); if (preg_match('~(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d~m', $arr[0]) && preg_match('~(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d~m', $arr[1])) { $start = PT_Secure($arr[0]); $end = PT_Secure($arr[1]); $this_start = strtotime($start); $this_end = strtotime($end); $month_days = cal_days_in_month(CAL_GREGORIAN, date('m',strtotime($start)), date('Y',strtotime($start))); $diff = abs(strtotime($end) - strtotime($start)); $years = floor($diff / (365*60*60*24)); $months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24)); $days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24)); if ($years >= 1) { $array = array(); for ($i=date('Y',strtotime($start)); $i <= date('Y',strtotime($end)); $i++) { $array["'".$i."'"] = 0; } $main_range = 'Custom'; $code = 'Y'; $title = "Yearly"; } elseif ($months >= 1) { $array = array('01' => 0 ,'02' => 0 ,'03' => 0 ,'04' => 0 ,'05' => 0 ,'06' => 0 ,'07' => 0 ,'08' => 0 ,'09' => 0 ,'10' => 0 ,'11' => 0 ,'12' => 0); $code = 'm'; $main_range = 'This Year'; $title = "Monthly"; if (date('Y',strtotime($start)) == date('Y',strtotime($end))) { $array = array(); for ($i=date('m',strtotime($start)); $i <= date('m',strtotime($end)); $i++) { $array["'".(int)$i."'"] = 0; } $code = 'm'; $main_range = 'Custom'; } else{ $month = cal_days_in_month(CAL_GREGORIAN, date('m',strtotime($start)), date('Y',strtotime($start))); $array = array(); for ($i=(int)date('m',strtotime($start)); $i <= 12; $i++) { $array["'".(int)$i.'-'.date('Y',strtotime($start))."'"] = 0; } for ($i=1; $i <= (int)date('m',strtotime($end)); $i++) { $array["'".(int)$i.'-'.date('Y',strtotime($end))."'"] = 0; } $first_code = 'm'; $second_code = 'Y'; $main_range = 'Custom'; } } elseif ($days > 7) { if (date('m',strtotime($start)) == date('m',strtotime($end))) { $array = array(); for ($i=date('d',strtotime($start)); $i <= date('d',strtotime($end)); $i++) { $array["'".(int)$i."'"] = 0; } $code = 'd'; $main_range = 'Custom'; } else{ $month = cal_days_in_month(CAL_GREGORIAN, date('m',strtotime($start)), date('Y',strtotime($start))); $array = array(); for ($i=(int)date('d',strtotime($start)); $i <= $month; $i++) { $array["'".(int)$i.'-'.date('m',strtotime($start))."'"] = 0; } for ($i=1; $i <= (int)date('d',strtotime($end)); $i++) { $array["'".(int)$i.'-'.date('m',strtotime($end))."'"] = 0; } $first_code = 'd'; $second_code = 'm'; $main_range = 'Custom'; } $title = "Daily"; } elseif ($days >= 1 && $days < 8) { $title = "Daily"; $code = 'l'; $array = array('Saturday' => 0 , 'Sunday' => 0 , 'Monday' => 0 , 'Tuesday' => 0 , 'Wednesday' => 0 , 'Thursday' => 0 , 'Friday' => 0); if (date('m',strtotime($start)) == date('m',strtotime($end))) { $array = array(); for ($i=date('d',strtotime($start)); $i <= date('d',strtotime($end)); $i++) { $array["'".(int)$i."'"] = 0; } $code = 'd'; $main_range = 'Custom'; } else{ $month = cal_days_in_month(CAL_GREGORIAN, date('m',strtotime($start)), date('Y',strtotime($start))); $array = array(); for ($i=(int)date('d',strtotime($start)); $i <= $month; $i++) { $array["'".(int)$i.'-'.date('m',strtotime($start))."'"] = 0; } for ($i=1; $i <= (int)date('d',strtotime($end)); $i++) { $array["'".(int)$i.'-'.date('m',strtotime($end))."'"] = 0; } $first_code = 'd'; $second_code = 'm'; $main_range = 'Custom'; } } } } $rang_link = $link; if (!empty($this_start) && !empty($this_end)) { $link .= "&range=".PT_Secure($_GET['range']); $db->where('time',$this_start,'>=')->where('time',$this_end,'<='); } $sort_link = $link; $sort_array = array('DESC_i' => array('id' , 'DESC'), 'ASC_i' => array('id' , 'ASC'), 'DESC_v' => array('video_id' , 'DESC'), 'ASC_v' => array('video_id' , 'ASC'), 'DESC_t' => array('title' , 'DESC'), 'ASC_t' => array('title' , 'ASC'), 'DESC_c' => array('category_id' , 'DESC'), 'ASC_c' => array('category_id' , 'ASC'), 'DESC_p' => array('privacy' , 'DESC'), 'ASC_p' => array('privacy' , 'ASC')); if (!empty($_GET['sort']) && in_array($_GET['sort'], array_keys($sort_array))) { $db->orderBy($sort_array[$_GET['sort']][0],$sort_array[$_GET['sort']][1]); $link .= "&sort=".PT_Secure($_GET['sort']); $rang_link .= "&sort=".PT_Secure($_GET['sort']); } else{ $_GET['sort'] = 'DESC_i'; $db->orderBy('id', 'DESC'); } $videos = $db->where($where)->objectbuilder()->paginate(T_VIDEOS, $pt->page_number); if ($db->totalPages != 0) { if (($pt->page_number > $db->totalPages) && !empty($_GET['page-id'])) { header("Location: " . PT_LoadAdminLinkSettings('manage-videos')); exit(); } } $db->where('recipient_id',0)->where('admin',1)->where('seen',0)->where('type','approve')->update(T_NOTIFICATIONS,array('seen' => time())); ?>

Manage Videos

Manage & Edit Videos
config->approve_videos == 'on') { ?>






$video) { $video = $pt->video = PT_GetVideoByID($video, 0, 0, 0); $privacy = 'Public'; if ($video->privacy == 1) { $privacy = 'Private'; } else if ($video->privacy == 2) { $privacy = 'Unlisted'; } $pt->sell_video = $video->sell_video; $video_data = array( 'ID' => $video->id, 'TITLE' => mb_substr($video->title, 0, 40, "UTF-8") . '..', 'VIDEO_ID' => $video->video_id, 'URL' => $video->url, 'ajax_url' => $video->ajax_url, 'SOURCE' => $video->source, 'CATEGORY' => $video->category_name, 'USER_DATA' => PT_UserData($video->user_id), 'PRIVACY' => $privacy ); $pt->video_approve = $video->approved; $pt->showApprove = false; if ($pt->config->approve_videos == 'on') { if (($pt->config->auto_approve_ == 'no' && $pt->sell_video != 0) || $pt->sell_video == 0) { $pt->showApprove = true; } if (($pt->config->review_embed_videos == 'on' && $video->embed == 1) || $video->embed != 1) { $pt->showApprove = true; } } if ($pt->config->review_embed_videos == 'on' && $video->embed == 1) { $pt->showApprove = true; } if ($pt->config->auto_approve_ == 'no' && $pt->sell_video != 0) { $pt->showApprove = true; } echo PT_LoadAdminPage('manage-videos/list', $video_data); } ?>
ID '" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#000000" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-up cursor-p"> '" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#000000" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-down cursor-p"> Video ID '" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#000000" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-up cursor-p"> '" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#000000" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-down cursor-p"> Title '" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#000000" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-up cursor-p"> '" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#000000" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-down cursor-p"> Category '" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#000000" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-up cursor-p"> '" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#000000" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-down cursor-p"> Source Privacy '" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#000000" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-up cursor-p"> '" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#000000" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-down cursor-p"> Added By Action
No videos found
0) { ?>
page_number out of " . $db->totalPages; ?>
Action