big thumbs generate thumb and mass embed plugin
This commit is contained in:
parent
9b4fddefc0
commit
062d2ad260
2 changed files with 89 additions and 4 deletions
|
@ -28,12 +28,52 @@ if($myquery->VideoExists($video)){
|
||||||
$myquery->set_default_thumb($video,$_POST['default_thumb']);
|
$myquery->set_default_thumb($video,$_POST['default_thumb']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = get_video_details($video);;
|
$data = get_video_details($video);
|
||||||
|
#pr($data,true);
|
||||||
$vid_file = VIDEOS_DIR.'/'.get_video_file($data,false,false);
|
$vid_file = VIDEOS_DIR.'/'.get_video_file($data,false,false);
|
||||||
# Uploading Thumbs
|
# Uploading Thumbs
|
||||||
if(isset($_POST['upload_thumbs'])){
|
if(isset($_POST['upload_thumbs'])){
|
||||||
|
|
||||||
|
if($data['files_thumbs_path']!=''){
|
||||||
|
|
||||||
|
$files_thumbs_path= $data['files_thumbs_path'];
|
||||||
|
$serverApi = str_replace('/files/thumbs', '', $files_thumbs_path);
|
||||||
|
$serverApi = $serverApi.'/actions/custom_thumb_upload.php';
|
||||||
|
|
||||||
|
$file_thumb = $_FILES['vid_thumb']['tmp_name'][0];
|
||||||
|
$postvars['mode'] = 'add';
|
||||||
|
$postvars['file_thumb'] = "@".$file_thumb;
|
||||||
|
$postvars['files_thumbs_path'] = $files_thumbs_path;
|
||||||
|
$postvars['file_directory'] = $data['file_directory'];
|
||||||
|
$postvars['file_name'] = $data['file_name'];
|
||||||
|
$postvars['duration'] = $data['duration'];
|
||||||
|
|
||||||
|
$ch = curl_init();
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $serverApi);
|
||||||
|
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
|
||||||
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $postvars);
|
||||||
|
/* Tell cURL to return the output */
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
||||||
|
/* Tell cURL NOT to return the headers */
|
||||||
|
curl_setopt($ch, CURLOPT_HEADER, false);
|
||||||
|
$response = curl_exec($ch);
|
||||||
|
/* Check HTTP Code */
|
||||||
|
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||||
|
curl_close($ch);
|
||||||
|
if(!$response)
|
||||||
|
e(lang($response),'w');
|
||||||
|
elseif((int)($response)){
|
||||||
|
e(lang(' remote upload successfully'),'m');
|
||||||
|
$query = "UPDATE " . tbl("video") . " SET file_thumbs_count = ".(int)($response)." WHERE videoid = ".$data['videoid'];
|
||||||
|
$db->Execute($query);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
e(lang($response),'e');
|
||||||
|
}
|
||||||
|
else{
|
||||||
$Upload->upload_thumbs($data['file_name'],$_FILES['vid_thumb'],$data['file_directory']);
|
$Upload->upload_thumbs($data['file_name'],$_FILES['vid_thumb'],$data['file_directory']);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// # Uploading Big Thumb
|
// # Uploading Big Thumb
|
||||||
// if(isset($_POST['upload_big_thumb'])) {
|
// if(isset($_POST['upload_big_thumb'])) {
|
||||||
|
@ -41,8 +81,45 @@ if($myquery->VideoExists($video)){
|
||||||
// }
|
// }
|
||||||
|
|
||||||
# Delete Thumb
|
# Delete Thumb
|
||||||
if(isset($_GET['delete']))
|
if(isset($_GET['delete'])){
|
||||||
|
$data = get_video_details($video);
|
||||||
|
if($data['files_thumbs_path']!=''){
|
||||||
|
#pr($data,true);
|
||||||
|
$files_thumbs_path= $data['files_thumbs_path'];
|
||||||
|
$serverApi = str_replace('/files/thumbs', '', $files_thumbs_path);
|
||||||
|
$serverApi = $serverApi.'/actions/custom_thumb_upload.php';
|
||||||
|
|
||||||
|
$postvars['mode'] = 'delete';
|
||||||
|
$postvars['files_thumbs_path'] = $files_thumbs_path;
|
||||||
|
$postvars['file_directory'] = $data['file_directory'];
|
||||||
|
$postvars['delete_file_name'] = $_GET['delete'];
|
||||||
|
$postvars['file_name'] = $data['file_name'];
|
||||||
|
$ch = curl_init();
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $serverApi);
|
||||||
|
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
|
||||||
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $postvars);
|
||||||
|
/* Tell cURL to return the output */
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
||||||
|
/* Tell cURL NOT to return the headers */
|
||||||
|
curl_setopt($ch, CURLOPT_HEADER, false);
|
||||||
|
$response = curl_exec($ch);
|
||||||
|
/* Check HTTP Code */
|
||||||
|
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||||
|
curl_close($ch);
|
||||||
|
|
||||||
|
if((int)($response)){
|
||||||
|
e(lang($response),'w');
|
||||||
|
$query = "UPDATE " . tbl("video") . " SET file_thumbs_count = ".(int)($response)." WHERE videoid = ".$data['videoid'];
|
||||||
|
$db->Execute($query);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
e(lang($response),'e');
|
||||||
|
|
||||||
|
}else
|
||||||
|
{
|
||||||
delete_video_thumb($_GET['delete']);
|
delete_video_thumb($_GET['delete']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Generating more thumbs
|
# Generating more thumbs
|
||||||
if(isset($_GET['gen_more']))
|
if(isset($_GET['gen_more']))
|
||||||
|
|
|
@ -24,6 +24,7 @@ if(!defined('SUB_PAGE')){
|
||||||
define('SUB_PAGE', 'Videos Manager');
|
define('SUB_PAGE', 'Videos Manager');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Feature / UnFeature Video
|
//Feature / UnFeature Video
|
||||||
if(isset($_GET['make_feature'])){
|
if(isset($_GET['make_feature'])){
|
||||||
$video = mysql_clean($_GET['make_feature']);
|
$video = mysql_clean($_GET['make_feature']);
|
||||||
|
@ -125,6 +126,11 @@ if(isset($_POST['delete_selected']))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(is_installed('cb_mass_embed'))
|
||||||
|
{
|
||||||
|
$array['mass_embed_status'] = 'approved';
|
||||||
|
}
|
||||||
|
|
||||||
$result_array = $array;
|
$result_array = $array;
|
||||||
//Getting Video List
|
//Getting Video List
|
||||||
$result_array['limit'] = $get_limit;
|
$result_array['limit'] = $get_limit;
|
||||||
|
@ -134,6 +140,8 @@ if(isset($_POST['delete_selected']))
|
||||||
|
|
||||||
Assign('videos', $videos);
|
Assign('videos', $videos);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Collecting Data for Pagination
|
//Collecting Data for Pagination
|
||||||
$vcount = $array;
|
$vcount = $array;
|
||||||
$vcount['count_only'] = true;
|
$vcount['count_only'] = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue