fixed: video thumb path
This commit is contained in:
parent
60fea4be9d
commit
7be013e956
2 changed files with 11 additions and 7 deletions
|
@ -10,11 +10,11 @@
|
||||||
//Database Host
|
//Database Host
|
||||||
$DBHOST = 'localhost';
|
$DBHOST = 'localhost';
|
||||||
//Database Name
|
//Database Name
|
||||||
$DBNAME = 'clipbucket2.7svn';
|
$DBNAME = 'clipbucket';
|
||||||
//Database Username
|
//Database Username
|
||||||
$DBUSER = 'root';
|
$DBUSER = 'root';
|
||||||
//Database Password
|
//Database Password
|
||||||
$DBPASS = '';
|
$DBPASS = 'fine';
|
||||||
//Setting Table Prefix
|
//Setting Table Prefix
|
||||||
define('TABLE_PREFIX','cb_');
|
define('TABLE_PREFIX','cb_');
|
||||||
|
|
||||||
|
|
|
@ -113,6 +113,7 @@ function get_thumb($vdetails,$num='default',$multi=false,$count=false,$return_fu
|
||||||
#check for videoid
|
#check for videoid
|
||||||
if(empty($vdetails['videoid']) && empty($vdetails['vid']) && empty($vdetails['videokey']))
|
if(empty($vdetails['videoid']) && empty($vdetails['vid']) && empty($vdetails['videokey']))
|
||||||
{
|
{
|
||||||
|
dump($multi);
|
||||||
if($multi)
|
if($multi)
|
||||||
return $dthumb[0] = default_thumb();
|
return $dthumb[0] = default_thumb();
|
||||||
return default_thumb();
|
return default_thumb();
|
||||||
|
@ -142,7 +143,6 @@ function get_thumb($vdetails,$num='default',$multi=false,$count=false,$return_fu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#checking if we have vid , so fetch the details
|
#checking if we have vid , so fetch the details
|
||||||
if(!empty($vid))
|
if(!empty($vid))
|
||||||
$vdetails = get_video_details($vid);
|
$vdetails = get_video_details($vid);
|
||||||
|
@ -181,16 +181,20 @@ function get_thumb($vdetails,$num='default',$multi=false,$count=false,$return_fu
|
||||||
#get all possible thumbs of video
|
#get all possible thumbs of video
|
||||||
$thumbDir = (isset($vdetails['file_directory']) && $vdetails['file_directory']) ? $vdetails['file_directory'] : "";
|
$thumbDir = (isset($vdetails['file_directory']) && $vdetails['file_directory']) ? $vdetails['file_directory'] : "";
|
||||||
//echo($thumbDir);
|
//echo($thumbDir);
|
||||||
|
if(substr($thumbDir, (strlen($thumbDir) - 1)) !== "/"){
|
||||||
|
$thumbDir .= "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//$justDate = explode(" ", $vdetails['date_added']);
|
//$justDate = explode(" ", $vdetails['date_added']);
|
||||||
//$dateAdded = implode("/", explode("-", array_shift($justDate)));
|
//$dateAdded = implode("/", explode("-", array_shift($justDate)));
|
||||||
|
|
||||||
$file_dir ="";
|
$file_directory ="";
|
||||||
if(isset($vdetails['file_name']) && $thumbDir)
|
if(isset($vdetails['file_name']) && $thumbDir)
|
||||||
{
|
{
|
||||||
$file_dir = "/" . $thumbDir;
|
$file_directory = "/" . $thumbDir;
|
||||||
}
|
}
|
||||||
$vid_thumbs = glob(THUMBS_DIR."/" .$file_dir.$vdetails['file_name']."*");
|
$vid_thumbs = glob(THUMBS_DIR."/" .$file_directory.$vdetails['file_name']."*");
|
||||||
|
|
||||||
#replace Dir with URL
|
#replace Dir with URL
|
||||||
if(is_array($vid_thumbs))
|
if(is_array($vid_thumbs))
|
||||||
|
@ -204,7 +208,7 @@ function get_thumb($vdetails,$num='default',$multi=false,$count=false,$return_fu
|
||||||
if(!is_big($thumb_file) || $return_big)
|
if(!is_big($thumb_file) || $return_big)
|
||||||
{
|
{
|
||||||
if($return_full_path)
|
if($return_full_path)
|
||||||
$thumbs[] = THUMBS_URL.'/'. $dateAdded . "/" . $thumb_file;
|
$thumbs[] = THUMBS_URL.'/'. $file_directory . $thumb_file;
|
||||||
else
|
else
|
||||||
$thumbs[] = $thumb_file;
|
$thumbs[] = $thumb_file;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue