Fixed : Unable to get video duration
Fixed : pages error in footer Fixed : cleanForm function verifies if the string is not an array Added : Anchors on signup page
This commit is contained in:
parent
9adec494b4
commit
23592a8a09
6 changed files with 69 additions and 17 deletions
|
@ -23,9 +23,12 @@ if($_POST['fix_duration']
|
|||
|
||||
if($log && $_POST['fix_duration'])
|
||||
{
|
||||
$duration = $log['output_duration'];
|
||||
if(!$duration)
|
||||
$duration = $log['duration'];
|
||||
//$duration = $log['output_duration'];
|
||||
//if(!$duration)
|
||||
// $duration = $log['duration'];
|
||||
|
||||
$duration = parse_duration(LOGS_DIR.'/'.$video['file_name'].'.log');
|
||||
|
||||
if(!$duration)
|
||||
e("Can't do anything about \"".$video['title']."\"");
|
||||
else
|
||||
|
|
|
@ -5,3 +5,5 @@ INSERT INTO `{tbl_prefix}config` (`configid`, `name`, `value`) VALUES (NULL, 'pl
|
|||
|
||||
INSERT INTO `{tbl_prefix}config` (`configid`, `name`, `value`) VALUES (NULL, 'vid_cat_height', '120');
|
||||
INSERT INTO `{tbl_prefix}config` (`configid`, `name`, `value`) VALUES (NULL, 'vid_cat_width', '120');
|
||||
|
||||
ALTER TABLE `{tbl_prefix}photos` ADD `photo_details` TEXT NOT NULL AFTER `photo_tags`;
|
|
@ -607,7 +607,7 @@ class ClipBucket
|
|||
|
||||
$pages = $cbpage->get_pages(array('active'=>'yes','display_only'=>'yes','order'=>'page_order ASC'));
|
||||
|
||||
|
||||
if($pages)
|
||||
foreach($pages as $p)
|
||||
$this->foot_menu[] = array('name'=>$p['page_name'],'link'=>$cbpage->page_link($p),"this"=>"home");
|
||||
|
||||
|
|
|
@ -3869,7 +3869,6 @@ class userquery extends CBCategory{
|
|||
|
||||
}else
|
||||
{
|
||||
|
||||
if($this->login_check(NULL,true))
|
||||
$msg[] = e(lang('you_already_logged'));
|
||||
elseif(!$this->user_exists($udetails['username']))
|
||||
|
|
|
@ -1033,6 +1033,7 @@
|
|||
if(is_string($string))
|
||||
$string = htmlspecialchars($string);
|
||||
if(get_magic_quotes_gpc())
|
||||
if(!is_array($string))
|
||||
$string = stripslashes($string);
|
||||
return $string;
|
||||
}
|
||||
|
@ -1823,9 +1824,10 @@
|
|||
$flv_url = $file;
|
||||
$embed = $param['embed'];
|
||||
$code = $param['code'];
|
||||
$height = $param['height'] = $param['height'] ? $param['height'] : config('player_height');
|
||||
$width = $param['width'] = $param['width'] ? $param['width'] : config('player_width');
|
||||
|
||||
$height = $param['height'] ? $param['height'] : config('player_height');
|
||||
$width = $param['width'] ? $param['width'] : config('player_width');
|
||||
$param['height'] = $height;
|
||||
$param['width'] = $width ;
|
||||
|
||||
if(!$param['autoplay'])
|
||||
$param['autoplay'] = config('autoplay_video');
|
||||
|
@ -2029,18 +2031,23 @@
|
|||
{
|
||||
$stats = get_file_details($file_name);
|
||||
|
||||
$duration = $stats['output_duration'];
|
||||
if(!$duration)
|
||||
$duration = $stats['duration'];
|
||||
//$duration = $stats['output_duration'];
|
||||
//if(!$duration)
|
||||
// $duration = $stats['duration'];
|
||||
|
||||
$duration = parse_duration(LOGS_DIR.'/'.$file_array['cqueue_name'].'.log');
|
||||
|
||||
$db->update(tbl("video"),array("status","duration","failed_reason"),
|
||||
array($status,$duration,$failed_status)," file_name='".$file_name."'");
|
||||
}else
|
||||
{
|
||||
$stats = get_file_details($file_name);
|
||||
|
||||
$duration = $stats['output_duration'];
|
||||
if(!$duration)
|
||||
$duration = $stats['duration'];
|
||||
//$duration = $stats['output_duration'];
|
||||
//if(!$duration)
|
||||
// $duration = $stats['duration'];
|
||||
|
||||
$duration = parse_duration(LOGS_DIR.'/'.$file_array['cqueue_name'].'.log');
|
||||
|
||||
$db->update(tbl("video"),array("status","duration","failed_reason"),
|
||||
array('Failed',$duration,$failed_status)," file_name='".$file_name."'");
|
||||
|
@ -2072,6 +2079,8 @@
|
|||
//$result = $db->select(tbl("video_files"),"*"," id ='$file_name' OR src_name = '$file_name' ");
|
||||
//Reading Log File
|
||||
$file = LOGS_DIR.'/'.$file_name.'.log';
|
||||
if(!file_exists($file))
|
||||
$file = $file_name;
|
||||
if(file_exists($file))
|
||||
{
|
||||
$data = file_get_contents($file);
|
||||
|
@ -2096,6 +2105,40 @@
|
|||
return false;
|
||||
}
|
||||
|
||||
function parse_duration($log)
|
||||
{
|
||||
$duration = false;
|
||||
$log_details = get_file_details($log);
|
||||
$duration = $log['output_duration'];
|
||||
if(!$duration || !is_numeric($duration))
|
||||
$duration = $log['duration'];
|
||||
|
||||
if(!$duration || !is_numeric($duration))
|
||||
{
|
||||
if(file_exists($log))
|
||||
$log_content = file_get_contents($log);
|
||||
|
||||
//Parse duration..
|
||||
preg_match_all('/Duration: ([0-9]{1,2}):([0-9]{1,2}):([0-9.]{1,5})/i',$log_content,$matches);
|
||||
|
||||
unset($log_content);
|
||||
|
||||
//Now we will multiple hours, minutes accordingly and then add up with seconds to
|
||||
//make a single variable of duration
|
||||
|
||||
$hours = $matches[1][0];
|
||||
$minutes = $matches[2][0];
|
||||
$seconds = $matches[3][0];
|
||||
|
||||
$hours = $hours * 60 * 60;
|
||||
$minutes = $minutes * 60;
|
||||
$duration = $hours+$minutes+$seconds;
|
||||
|
||||
$duration;
|
||||
}
|
||||
return $duration;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function used to execute command in background
|
||||
|
@ -5571,7 +5614,7 @@
|
|||
//Checking if browser is firefox
|
||||
if(!$in)
|
||||
$in = $_SERVER['HTTP_USER_AGENT'];
|
||||
|
||||
echo $in;
|
||||
$u_agent = $in;
|
||||
$bname = 'Unknown';
|
||||
$platform = 'Unknown';
|
||||
|
@ -5581,6 +5624,9 @@
|
|||
if (preg_match('/linux/i', $u_agent)) {
|
||||
$platform = 'linux';
|
||||
}
|
||||
elseif (preg_match('/iPhone/i', $u_agent)) {
|
||||
$platform = 'iphone';
|
||||
}
|
||||
elseif (preg_match('/macintosh|mac os x/i', $u_agent)) {
|
||||
$platform = 'mac';
|
||||
}
|
||||
|
|
|
@ -29,7 +29,9 @@
|
|||
<div class="clearfix"></div>
|
||||
<label for="" class="label"> </label>
|
||||
<div class="input_container">
|
||||
{ANCHOR place='before_login_button'}
|
||||
<input type="submit" name="login" class="cb_button_2" value="{lang code='login'}" id="login_signup_bttn" {ANCHOR place='login_signup_bttn'} >
|
||||
{ANCHOR place='after_login_button'}
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div align="center"><a href="{$baseurl}/forgot.php">{lang code='user_forgot_password'}</a> | <a href="{$baseurl}/forgot.php?mode=recover_username">{lang code='user_forgot_username'}</a></div>
|
||||
|
|
Loading…
Add table
Reference in a new issue