Updated : conversion system
Added : new activation Added : new user forgot password and username recover Upaded : user.class.php Added : ClipBucket Captcha System Fixed : Category listing Fixed : channels.html
This commit is contained in:
parent
f4b4ee5cfb
commit
2335bca10b
32 changed files with 722 additions and 298 deletions
60
upload/actions/verify_converted_videos.php
Normal file
60
upload/actions/verify_converted_videos.php
Normal file
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* This file is used to verify weather video is converted or not
|
||||
* if it is converted then activate it and let it go
|
||||
*/
|
||||
|
||||
|
||||
include(dirname(__FILE__)."/../includes/config.inc.php");
|
||||
|
||||
$files = get_video_being_processed();
|
||||
|
||||
if(is_array($files))
|
||||
foreach($files as $file)
|
||||
{
|
||||
$file_details = get_file_details($file['cqueue_name']);
|
||||
pr($file_details);
|
||||
if($file_details['conversion_status']=='failed')
|
||||
{
|
||||
|
||||
$db->update("conversion_queue",
|
||||
array("cqueue_conversion"),
|
||||
array("yes")," cqueue_id = '".$file['cqueue_id']."'");
|
||||
update_processed_video($file,'Failed');
|
||||
|
||||
/**
|
||||
* Calling Functions after converting Video
|
||||
*/
|
||||
if(get_functions('after_convert_functions'))
|
||||
{
|
||||
foreach(get_functions('after_convert_functions') as $func)
|
||||
{
|
||||
if(@function_exists($func))
|
||||
$func();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}elseif($file_details['conversion_status']=='completed')
|
||||
{
|
||||
|
||||
$db->update("conversion_queue",
|
||||
array("cqueue_conversion"),
|
||||
array("yes")," cqueue_id = '".$file['cqueue_id']."'");
|
||||
update_processed_video($file,'Successful');
|
||||
|
||||
/**
|
||||
* Calling Functions after converting Video
|
||||
*/
|
||||
if(get_functions('after_convert_functions'))
|
||||
{
|
||||
foreach(get_functions('after_convert_functions') as $func)
|
||||
{
|
||||
if(@function_exists($func))
|
||||
$func();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -4,6 +4,8 @@
|
|||
* Software : ClipBucket v2
|
||||
* License : CBLA
|
||||
**/
|
||||
|
||||
|
||||
ini_set('mysql.connect_timeout','6000');
|
||||
|
||||
include(dirname(__FILE__)."/../includes/config.inc.php");
|
||||
|
@ -63,30 +65,17 @@ rename($temp_file,$orig_file);
|
|||
$ffmpeg->configs = $configs;
|
||||
$ffmpeg->gen_thumbs = TRUE;
|
||||
$ffmpeg->gen_big_thumb = TRUE;
|
||||
$ffmpeg->input_ext = $ext;
|
||||
$ffmpeg->output_file = VIDEOS_DIR.'/'.$tmp_file.'.flv';
|
||||
$ffmpeg->hq_output_file = VIDEOS_DIR.'/'.$tmp_file.'.mp4';
|
||||
$ffmpeg->remove_input=FALSE;
|
||||
$ffmpeg->log_file = LOGS_DIR.'/'.$tmp_file.'.log';
|
||||
//$ffmpeg->remove_input=TRUE;
|
||||
$ffmpeg->ClipBucket();
|
||||
//Converting File In HD Format
|
||||
//$ffmpeg->convert_to_hd();
|
||||
$ffmpeg->convert_to_hd();
|
||||
unlink($ffmpeg->input_file);
|
||||
|
||||
$db->update("conversion_queue",
|
||||
array("cqueue_conversion"),
|
||||
array("yes")," cqueue_id = '".$queue_details['cqueue_id']."'");
|
||||
|
||||
update_processed_video($queue_details);
|
||||
|
||||
/**
|
||||
* Calling Functions after converting Video
|
||||
*/
|
||||
if(get_functions('after_convert_functions'))
|
||||
{
|
||||
foreach(get_functions('after_convert_functions') as $func)
|
||||
{
|
||||
if(@function_exists($func))
|
||||
$func();
|
||||
}
|
||||
}
|
||||
//exec(php_path()." -q ".BASEDIR."/actions/verify_converted_videos.php &> /dev/null &");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,56 +1,44 @@
|
|||
<?php
|
||||
/*
|
||||
****************************************************************************************************
|
||||
| Copyright (c) 2007-2008 Clip-Bucket.com. All rights reserved. |
|
||||
| Copyright (c) 2007-2009 Clip-Bucket.com. All rights reserved. |
|
||||
| @ Author : ArslanHassan |
|
||||
| @ Software : ClipBucket , © PHPBucket.com |
|
||||
****************************************************************************************************
|
||||
*/
|
||||
|
||||
define("THIS_PAGE","activation");
|
||||
define("PARENT_PAGE",'signup');
|
||||
|
||||
|
||||
require 'includes/config.inc.php';
|
||||
$show_active = 1;
|
||||
//Get Username and AVCode By GET Method
|
||||
if(isset($_GET['username'])){
|
||||
$username = mysql_clean($_GET['username']);
|
||||
$avcode = mysql_clean($_GET['avcode']);
|
||||
if($userquery->ActivateUser($username,$avcode)){
|
||||
$msg = $LANG['dear']."<strong>$username</strong>, ".$LANG['usr_activation_msg'];
|
||||
$show_active = 0;
|
||||
}else{
|
||||
$msg = $LANG['usr_activation_err'];
|
||||
$show_active = 1;
|
||||
}
|
||||
}
|
||||
|
||||
//Getting Username And AVCode By POST Method
|
||||
|
||||
if(isset($_POST['activate'])){
|
||||
$username = mysql_clean($_POST['username']);
|
||||
$avcode = mysql_clean($_POST['avcode']);
|
||||
if($userquery->ActivateUser($username,$avcode)){
|
||||
$msg = $LANG['dear']."<strong>$username</strong>, ".$LANG['usr_activation_msg'];
|
||||
$show_active = 0;
|
||||
}else{
|
||||
$msg = $LANG['usr_activation_err'];
|
||||
$show_active = 1;
|
||||
}
|
||||
}
|
||||
if($userquery->login_check('',true)){
|
||||
redirect_to(BASEURL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Activating user account
|
||||
*/
|
||||
if(isset($_REQUEST['av_username']) || isset($_POST['activate_user']))
|
||||
{
|
||||
$user = mysql_clean($_REQUEST['av_username']);
|
||||
$avcode = mysql_clean($_REQUEST['avcode']);
|
||||
$userquery->activate_user_with_avcode($user,$avcode);
|
||||
}
|
||||
|
||||
//Sendin Activation Code
|
||||
|
||||
if(isset($_POST['request'])){
|
||||
$email = mysql_clean($_POST['email']);
|
||||
if($userquery->SendActivation($email)){
|
||||
$msg = $LANG['usr_activation_em_msg'];
|
||||
}else{
|
||||
$msg = $LANG['usr_activation_em_err'];
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Requesting Activation Code
|
||||
*/
|
||||
|
||||
if(isset($_POST['request_avcode']))
|
||||
{
|
||||
$email = mysql_clean($_POST['av_email']);
|
||||
$userquery->send_activation_code($email);
|
||||
}
|
||||
|
||||
subtitle('activation');
|
||||
Assign('show_form', $show_active);
|
||||
Assign('msg',$msg);
|
||||
Template('header.html');
|
||||
Template('activation.html');
|
||||
Template('footer.html');
|
||||
|
||||
template_files('activation.html');
|
||||
display_it();
|
||||
?>
|
|
@ -1,38 +1,21 @@
|
|||
{if $data.id}
|
||||
{if $data.File}
|
||||
<div style="width:99%; margin:auto; margin-bottom:15px">
|
||||
<span class="page_title">Conversion Log For File "{$data.src_name}"</span>
|
||||
<span class="page_title">Conversion Log For File "{$data.File}"</span>
|
||||
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="10" class="left_head"></td>
|
||||
<td class="head">Source File Information </td>
|
||||
<td width="50" class="right_head"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="block">
|
||||
<table width="800" border="0" cellspacing="0" cellpadding="0" class="block">
|
||||
|
||||
{foreach from=$data item=value key=field}
|
||||
{if $field|truncate:4:'' == src_}
|
||||
{if $field !='conversion_log' }
|
||||
<tr>
|
||||
<td>Source {$field|substr:4:100|replace:'_':' '}</td>
|
||||
<td>{$value}</td>
|
||||
<td width="166"> {$field}</td>
|
||||
<td width="634">{$value}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/foreach}
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="tr_head">Output File Information</td>
|
||||
</tr>
|
||||
{foreach from=$data item=value key=field}
|
||||
{if $field|truncate:7:'' == output_}
|
||||
<tr>
|
||||
<td>Output File {$field|substr:7:100|replace:'_':' '}</td>
|
||||
<td>{$value}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/if}
|
||||
{/foreach}
|
||||
<tr>
|
||||
<td> </td>
|
||||
|
@ -49,7 +32,7 @@
|
|||
</table>
|
||||
<div id='Container'>
|
||||
<div style="overflow:auto; border:1px solid #EAEAEA; padding:2px">
|
||||
<div style="background-color:#F3F3F3; border:none; width:100%; min-height:300px;">{$data.file_conversion_log|nl2br}</div>
|
||||
<div style="background-color:#F3F3F3; border:none; width:100%; min-height:300px;">{$data.conversion_log|nl2br}</div>
|
||||
</div></div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -1,42 +1,51 @@
|
|||
<?php
|
||||
/*
|
||||
****************************************************************************************************
|
||||
| Copyright (c) 2007-2008 Clip-Bucket.com. All rights reserved. |
|
||||
| Copyright (c) 2007-2009 Clip-Bucket.com. All rights reserved. |
|
||||
| @ Author : ArslanHassan |
|
||||
| @ Software : ClipBucket , © PHPBucket.com |
|
||||
****************************************************************************************************
|
||||
*/
|
||||
|
||||
define("THIS_PAGE","forgot");
|
||||
define("PARENT_PAGE",'signup');
|
||||
|
||||
require 'includes/config.inc.php';
|
||||
|
||||
$action = mysql_clean($_GET['action']);
|
||||
//Reset Password
|
||||
$mode = $_GET['mode'];
|
||||
|
||||
/**
|
||||
* Reseting Password
|
||||
* Sending Email
|
||||
*/
|
||||
if(isset($_POST['reset'])){
|
||||
$msg = $userquery->ResetPassword(1);
|
||||
$input = post('forgot_username');
|
||||
$userquery->reset_password(1,$input);
|
||||
}
|
||||
|
||||
//Reseting
|
||||
if($action =='reset_pass'){
|
||||
$msg = $userquery->ResetPassword(2);
|
||||
/**
|
||||
* Reseting Password
|
||||
* Real Reseting ;)
|
||||
*/
|
||||
$user = get('user');
|
||||
if($mode =='reset_pass' && $user)
|
||||
{
|
||||
$input = mysql_clean(get('user'));
|
||||
$avcode = mysql_clean(get('avcode'));
|
||||
$userquery->reset_password(2,$input,$avcode);
|
||||
}
|
||||
|
||||
//Recover Username
|
||||
|
||||
if(isset($_POST['recover'])){
|
||||
$msg = $userquery->RecoverUsername();
|
||||
/**
|
||||
* Recovering username
|
||||
*/
|
||||
if(isset($_POST['recover_username']))
|
||||
{
|
||||
$email = mysql_clean($_POST['forgot_email']);
|
||||
$msg = $userquery->recover_username($email);
|
||||
}
|
||||
|
||||
|
||||
if($row['captcha_type']==2){
|
||||
Assign('captcha',BASEURL.'/includes/classes/captcha/img.php');
|
||||
}elseif($row['captcha_type']==1){
|
||||
Assign('captcha',BASEURL.'/includes/classes/captcha_simple.img.php');
|
||||
}
|
||||
assign('mode',$mode);
|
||||
|
||||
Assign('subtitle',$LANG['title_forgot']);
|
||||
|
||||
Assign('msg',$msg);
|
||||
Template('header.html');
|
||||
Template('message.html');
|
||||
Template('forgot.html');
|
||||
Template('footer.html');
|
||||
template_files('forgot.html');
|
||||
display_it();
|
||||
?>
|
|
@ -26,6 +26,7 @@ class ClipBucket
|
|||
var $template_files = array();
|
||||
var $cur_template = 'clipbucketblue';
|
||||
var $links = array();
|
||||
var $captchas = array();
|
||||
|
||||
/**
|
||||
* All Functions that are called
|
||||
|
@ -97,7 +98,9 @@ class ClipBucket
|
|||
|
||||
$this->temp_exts = array('ahz','jhz','abc','xyz','cb2','tmp','olo','oar','ozz');
|
||||
$this->template = $this->configs['template_dir'];
|
||||
|
||||
|
||||
if(!defined("IS_CAPTCHA_LOADING"))
|
||||
$_SESSION['total_captchas_loaded'] = 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -70,6 +70,8 @@ class CBEmail
|
|||
'{date_year}' => cbdate("Y"),
|
||||
'{date_month}' => cbdate("m"),
|
||||
'{date_day}' => cbdate("d"),
|
||||
'{signup_link}' => cblink(array('name'=>'signup')),
|
||||
'{login_link}' => cblink(array('name'=>'login')),
|
||||
);
|
||||
|
||||
if(is_array($array) && count($array)>0)
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
* @License : CBLA - You Cannot MODIFY - REUSE THIS FILE
|
||||
* @website : http://clip-bucket.com/
|
||||
*/
|
||||
|
||||
|
||||
define("KEEP_MP4_AS_IS","yes");
|
||||
|
||||
class ffmpeg
|
||||
{
|
||||
|
@ -28,6 +31,8 @@ class ffmpeg
|
|||
var $gen_big_thumb = FALSE;
|
||||
var $h264_single_pass = FALSE;
|
||||
var $hq_output_file = '';
|
||||
var $log_file = '';
|
||||
var $input_ext = '';
|
||||
|
||||
|
||||
/**
|
||||
|
@ -74,8 +79,7 @@ class ffmpeg
|
|||
$this->log_file_info();
|
||||
|
||||
//Insert Info into database
|
||||
$this->insert_data();
|
||||
|
||||
//$this->insert_data();
|
||||
}
|
||||
|
||||
|
||||
|
@ -421,6 +425,23 @@ class ffmpeg
|
|||
$this->log .=" Unknown file details - Unable to get video details using FFMPEG \n";
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Function log outpuit file details
|
||||
*/
|
||||
function log_ouput_file_info()
|
||||
{
|
||||
$details = $this->output_details;
|
||||
if(is_array($details))
|
||||
{
|
||||
foreach($details as $name => $value)
|
||||
{
|
||||
$this->log('output_'.$name,$value);
|
||||
}
|
||||
}else{
|
||||
$this->log .=" Unknown file details - Unable to get output video details using FFMPEG \n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -463,7 +484,8 @@ class ffmpeg
|
|||
/**
|
||||
* Function used to calculate video padding
|
||||
*/
|
||||
function calculate_size_padding( $parameters, $source_info, & $width, & $height, & $ratio, & $pad_top, & $pad_bottom, & $pad_left, & $pad_right ) {
|
||||
function calculate_size_padding( $parameters, $source_info, & $width, & $height, & $ratio, & $pad_top, & $pad_bottom, & $pad_left, & $pad_right )
|
||||
{
|
||||
$p = $parameters;
|
||||
$i = $source_info;
|
||||
|
||||
|
@ -584,6 +606,7 @@ class ffmpeg
|
|||
*/
|
||||
function ClipBucket()
|
||||
{
|
||||
|
||||
$this->start_time_check();
|
||||
$this->start_log();
|
||||
$this->prepare();
|
||||
|
@ -591,17 +614,24 @@ class ffmpeg
|
|||
$this->end_time_check();
|
||||
$this->total_time();
|
||||
$this->output_details = $this->get_file_info($this->output_file);
|
||||
$this->log .= "\n\Time Took : ";
|
||||
$this->log .= $this->total_time.' seconds';
|
||||
$this->log .= "\r\n\r\n";
|
||||
$this->log_ouput_file_info();
|
||||
$this->log .= "\r\n\r\nTime Took : ";
|
||||
$this->log .= $this->total_time.' seconds'."\r\n\r\n";
|
||||
|
||||
//$this->update_data();
|
||||
//Generating Thumb
|
||||
if($this->gen_thumbs)
|
||||
$this->generate_thumbs($this->input_file,$this->input_details['duration']);
|
||||
if($this->gen_big_thumb)
|
||||
$this->generate_thumbs($this->input_file,$this->input_details['duration'],'300x240','big');
|
||||
//Remove Input
|
||||
if($this->remove_input)
|
||||
unlink($this->input_file);
|
||||
$this->generate_thumbs($this->input_file,$this->input_details['duration'],'original','big');
|
||||
|
||||
if(!file_exists($this->output_file))
|
||||
$this->log("conversion_status","failed");
|
||||
else
|
||||
$this->log("conversion_status","completed");
|
||||
|
||||
$this->create_log_file();
|
||||
}
|
||||
|
||||
|
||||
|
@ -612,12 +642,14 @@ class ffmpeg
|
|||
function generate_thumbs($input_file,$duration,$dim='120x90',$num=3,$rand=NULL)
|
||||
{
|
||||
$output_dir = THUMBS_DIR;
|
||||
|
||||
$dimension = '';
|
||||
if($num=='big')
|
||||
{
|
||||
$file_name = getName($input_file)."-big.jpg";
|
||||
$file_path = THUMBS_DIR.'/'.$file_name;
|
||||
$command = $this->ffmpeg." -i $input_file -an -s $dim -y -f image2 -vframes 1 $file_path ";
|
||||
if($dim!='original')
|
||||
$dimension = " -s $dim ";
|
||||
$command = $this->ffmpeg." -i $input_file -an $dimension -y -f image2 -vframes 1 $file_path ";
|
||||
$this->exec($command);
|
||||
}else{
|
||||
|
||||
|
@ -637,7 +669,11 @@ class ffmpeg
|
|||
} elseif($rand == "") {
|
||||
$time = $this->ChangeTime($id);
|
||||
}
|
||||
$command = $this->ffmpeg." -i $input_file -an -ss $time -an -r 1 -s $dim -y -f image2 -vframes 1 $file_path ";
|
||||
|
||||
if($dim!='original')
|
||||
$dimension = " -s $dim ";
|
||||
|
||||
$command = $this->ffmpeg." -i $input_file -an -ss $time -an -r 1 $dimension -y -f image2 -vframes 1 $file_path ";
|
||||
$this->exec($command);
|
||||
$count = $count+1;
|
||||
}
|
||||
|
@ -682,6 +718,7 @@ class ffmpeg
|
|||
/**
|
||||
* Function used to convert video in HD format
|
||||
*/
|
||||
|
||||
function convert_to_hd($input=NULL,$output=NULL,$p=NULL,$i=NULL)
|
||||
{
|
||||
global $db;
|
||||
|
@ -771,7 +808,7 @@ class ffmpeg
|
|||
$total_dims = count($widths);
|
||||
|
||||
//Checking wich dimension is suitable for the video
|
||||
for($id=0;$id<=$total_dims;$i++)
|
||||
for($id=0;$id<=$total_dims;$id++)
|
||||
{
|
||||
$cur_dim = $widths[$id];
|
||||
$next_dim = $widths[$id+1];
|
||||
|
@ -794,16 +831,22 @@ class ffmpeg
|
|||
//Calculation Size Padding
|
||||
$this->calculate_size_padding( $p, $i, $width, $height, $ratio, $pad_top, $pad_bottom, $pad_left, $pad_right );
|
||||
$opt_av .= "-s {$width}x{$height} -aspect $ratio -padcolor 000000 -padtop $pad_top -padbottom $pad_bottom -padleft $pad_left -padright $pad_right";
|
||||
|
||||
|
||||
|
||||
$command = $this->ffmpeg." -i ".$this->input_file." $opt_av -acodec libfaac -ab 96k -vcodec libx264 -vpre hq -crf 22 -threads 0 ".$this->hq_output_file." 2> ".TEMP_DIR."/output.tmp ";
|
||||
|
||||
$output = $this->exec($command);
|
||||
if(KEEP_MP4_AS_IS=="yes" && $this->input_ext=='mp4')
|
||||
copy($this->input_file,$this->hq_output_file);
|
||||
else
|
||||
$output = $this->exec($command);
|
||||
|
||||
if(file_exists(TEMP_DIR.'/output.tmp'))
|
||||
{
|
||||
$output = $output ? $output : join("", file(TEMP_DIR.'/output.tmp'));
|
||||
unlink(TEMP_DIR.'/output.tmp');
|
||||
}
|
||||
|
||||
$this->log .= "\r\n\r\n\n=========STARTING $type CONVERSION==============\r\n\r\n\n";
|
||||
$this->log("$type Video -- Conversion Command",$command);
|
||||
$this->log .="\r\n\r\nConversion Details\r\n\r\n";
|
||||
$this->log .=$output;
|
||||
|
@ -811,10 +854,25 @@ class ffmpeg
|
|||
|
||||
$fields = array('file_conversion_log',strtolower($type));
|
||||
$values = array(mysql_clean($this->log),'yes');
|
||||
$db->update($this->tbl,$fields,$values," id = '".$this->row_id."'");
|
||||
//$db->update($this->tbl,$fields,$values," id = '".$this->row_id."'");
|
||||
$this->create_log_file();
|
||||
return true;
|
||||
}else
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function used to create log for a file
|
||||
*/
|
||||
function create_log_file()
|
||||
{
|
||||
$file = $this->log_file;
|
||||
$data = $this->log;
|
||||
$fo = fopen($file,"w");
|
||||
if($fo)
|
||||
{
|
||||
fwrite($fo,$data);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -888,13 +888,14 @@ class myquery {
|
|||
function file_details($file_name)
|
||||
{
|
||||
global $db;
|
||||
$results = $db->select("video_files","*"," src_name='$file_name'");
|
||||
return get_file_details($file_name);
|
||||
/*$results = $db->select("video_files","*"," src_name='$file_name'");
|
||||
if($db->num_rows==0)
|
||||
return false;
|
||||
else
|
||||
{
|
||||
return $results[0];
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -93,9 +93,9 @@ class pages{
|
|||
function redirectOrig()
|
||||
{
|
||||
$curpage = $this->GetCurrentUrl();
|
||||
$newPage = preg_replace('/:\/\/www\./','',$curpage);
|
||||
$newPage = preg_replace('/:\/\/www\./','://',$curpage);
|
||||
if($curpage !=$newPage)
|
||||
redirect_to($newPage);
|
||||
header("location:$newPage");
|
||||
}
|
||||
|
||||
function create_url($params_array,$url=NULL,$remove_param=false,$urlencode=false)
|
||||
|
|
|
@ -182,7 +182,7 @@ class cbsearch
|
|||
|
||||
case "yesterday":
|
||||
{
|
||||
$cond = " CONCAT(YEAR(curdate()),DAYOFYEAR(curdate())-1) = CONCAT(YEAR($date_column),DAYOFYEAR($date_column)-1) ";
|
||||
$cond = " CONCAT(YEAR(curdate()),DAYOFYEAR(curdate())-1) = CONCAT(YEAR($date_column),DAYOFYEAR($date_column)) ";
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -218,6 +218,9 @@
|
|||
//Userid
|
||||
$query_field[] = "userid";
|
||||
$query_val[] = userid();
|
||||
|
||||
$activation = ACTIVATION;
|
||||
|
||||
//Setting Activation Option
|
||||
if($activation == 0){
|
||||
$active = 'yes';
|
||||
|
|
|
@ -498,7 +498,7 @@ class userquery extends CBCategory{
|
|||
/*if(!$id)
|
||||
$id = userid();*/
|
||||
|
||||
$results = $db->select('users','*'," userid='$id' OR username='".$id."'");
|
||||
$results = $db->select('users','*'," userid='$id' OR username='".$id."' OR email='".$id."'");
|
||||
return $results[0];
|
||||
}function GetUserData($id=NULL){ return $this->get_user_details($id); }
|
||||
|
||||
|
@ -553,35 +553,103 @@ class userquery extends CBCategory{
|
|||
|
||||
|
||||
//Function Used To Activate User
|
||||
function ActivateUser($user,$avcode){
|
||||
$data = $this->GetUserData_username($user);
|
||||
if($data['usr_status'] == 'Ok' || $data['avcode'] !=$avcode || empty($user)){
|
||||
return false;
|
||||
}else{
|
||||
function activate_user_with_avcode($user,$avcode)
|
||||
{
|
||||
global $eh;
|
||||
$data = $this->get_user_details($user);
|
||||
if(!$data || !$user)
|
||||
e(lang("usr_exist_err"));
|
||||
elseif($udetails['usr_status']=='Ok')
|
||||
e(lang('usr_activation_err'));
|
||||
elseif($udetails['ban_status']=='yes')
|
||||
e(lang('ban_status'));
|
||||
elseif($data['avcode'] !=$avcode)
|
||||
e(lang('avcode_incorrect'));
|
||||
else
|
||||
{
|
||||
$this->action('activate',$data['userid']);
|
||||
return true;
|
||||
$eh->flush();
|
||||
e(lang("usr_activation_msg"),"m");
|
||||
|
||||
if($data['welcome_email_sent']=='no')
|
||||
$this->send_welcome_email($data,TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
//Function Used To Send Activation Code To User
|
||||
function SendActivation($email){
|
||||
$query = mysql_query("SELECT * FROM users WHERE email='".$email."'");
|
||||
$data = mysql_fetch_array($query);
|
||||
if(!empty($data['username']) && $data['usr_status'] != 'Ok'){
|
||||
$username = $data['username'];
|
||||
$avcode = $data['avcode'];
|
||||
$cur_date = date('m-d-Y');
|
||||
$title = TITLE;
|
||||
$baseurl = BASEURL;
|
||||
$from = SUPPORT_EMAIL;
|
||||
$to = $email;
|
||||
require_once(BASEDIR.'/includes/email_templates/activation_request.template.php');
|
||||
require_once(BASEDIR.'/includes/email_templates/activation_request.header.php');
|
||||
send_email($from,$to,$subj,nl2br($body));
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function used to send activation code
|
||||
* to user
|
||||
* @param : $usenrma,$email or $userid
|
||||
*/
|
||||
function send_activation_code($email)
|
||||
{
|
||||
global $db,$cbemail;
|
||||
$udetails = $this->get_user_details($email);
|
||||
|
||||
if(!$udetails || !$email)
|
||||
e(lang("usr_exist_err"));
|
||||
elseif($udetails['usr_status']=='Ok')
|
||||
e(lang('usr_activation_err'));
|
||||
elseif($udetails['ban_status']=='yes')
|
||||
e(lang('ban_status'));
|
||||
else
|
||||
{
|
||||
$tpl = $cbemail->get_template('avcode_request_template');
|
||||
$more_var = array
|
||||
('{username}' => $udetails['username'],
|
||||
'{email}' => $udetails['email'],
|
||||
'{avcode}' => $udetails['avcode']
|
||||
);
|
||||
if(!is_array($var))
|
||||
$var = array();
|
||||
$var = array_merge($more_var,$var);
|
||||
$subj = $cbemail->replace($tpl['email_template_subject'],$var);
|
||||
$msg = nl2br($cbemail->replace($tpl['email_template'],$var));
|
||||
|
||||
//Now Finally Sending Email
|
||||
cbmail(array('to'=>$udetails['email'],'from'=>WEBSITE_EMAIL,'subject'=>$subj,'content'=>$msg));
|
||||
e(lang('usr_activation_em_msg'),"m");
|
||||
}
|
||||
}
|
||||
function SendActivation($email)
|
||||
{
|
||||
return $this->send_activation_code($email);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function used to send welcome email
|
||||
*/
|
||||
function send_welcome_email($user,$update_email_status=FALSE)
|
||||
{
|
||||
global $db,$cbemail;
|
||||
|
||||
if(!is_array($user))
|
||||
$udetails = $this->get_user_details($user);
|
||||
else
|
||||
$udetails = $user;
|
||||
|
||||
if(!$udetails)
|
||||
e(lang("usr_exist_err"));
|
||||
else
|
||||
{
|
||||
$tpl = $cbemail->get_template('welcome_message_template');
|
||||
$more_var = array
|
||||
('{username}' => $udetails['username'],
|
||||
'{email}' => $udetails['email'],
|
||||
);
|
||||
if(!is_array($var))
|
||||
$var = array();
|
||||
$var = array_merge($more_var,$var);
|
||||
$subj = $cbemail->replace($tpl['email_template_subject'],$var);
|
||||
$msg = nl2br($cbemail->replace($tpl['email_template'],$var));
|
||||
|
||||
//Now Finally Sending Email
|
||||
cbmail(array('to'=>$udetails['email'],'from'=>WEBSITE_EMAIL,'subject'=>$subj,'content'=>$msg));
|
||||
|
||||
if($update_email_status)
|
||||
$db->update($this->dbtbl['users'],array('welcome_email_sent'),array("yes")," userid='".$udetails['userid']."' ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -798,99 +866,122 @@ class userquery extends CBCategory{
|
|||
}
|
||||
|
||||
|
||||
//Function Used To Reset Passoword
|
||||
function ResetPassword($step){
|
||||
global $LANG,$row;
|
||||
if($step == 1){
|
||||
$user = mysql_clean($_POST['username']);
|
||||
$verify = $_POST['vcode'];
|
||||
$query = mysql_query("SELECT * FROM users WHERE username = '".$user."'");
|
||||
$data = mysql_fetch_array($query);
|
||||
if(!mysql_num_rows($query)>0){
|
||||
$msg[] = e($LANG['usr_exist_err']);
|
||||
}
|
||||
//Check Confirmation Code
|
||||
if($row['captcha_type'] == '2'){
|
||||
require "captcha/class.img_validator.php";
|
||||
$img = new img_validator();
|
||||
if(!$img->checks_word($verify)){
|
||||
$msg[] = e($LANG['usr_ccode_err']);
|
||||
}
|
||||
}
|
||||
if($row['captcha_type'] == 1){
|
||||
if($verify != $_SESSION['security_code']){
|
||||
$msg[] = e($LANG['usr_ccode_err']);
|
||||
}
|
||||
}
|
||||
if(empty($msg)){
|
||||
$myquery = new myquery();
|
||||
$to = $data['email'];
|
||||
$from = SUPPORT_EMAIL;
|
||||
$subj = $LANG['usr_pass_reset_conf'];
|
||||
$message = $LANG['usr_dear_user'].",
|
||||
".$LANG['usr_pass_reset_msg']."
|
||||
".BASEURL."/forgot.php?action=reset_pass&code=".md5($to)."___AAAWWWx54s5d744_sad1sad&avcode=".$data['avcode']."&user=".$user;
|
||||
send_email($from,$to,$subj,nl2br($message));
|
||||
$msg = $LANG['usr_rpass_email_msg'];
|
||||
}
|
||||
}
|
||||
if($step==2){
|
||||
$user = mysql_clean($_GET['user']);
|
||||
$avcode = mysql_clean($_GET['avcode']);
|
||||
$query = mysql_query("SELECT * FROM users WHERE username='".$user."' AND avcode ='".$avcode."'");
|
||||
$data = mysql_fetch_array($query);
|
||||
if(mysql_num_rows($query)>0&& !empty($avcode)){
|
||||
$newpass = RandomString(6);
|
||||
$pass = pass_code($newpass);
|
||||
mysql_query("UPDATE users SET password = '".$pass."' WHERE username = '".$user."'");
|
||||
$msg = e($LANG['usr_pass_email_msg'],m);
|
||||
|
||||
$myquery = new myquery();
|
||||
$to = $data['email'];
|
||||
$from = SUPPORT_EMAIL;
|
||||
$subj = $LANG['usr_rpass_msg'];
|
||||
$message = $LANG['usr_dear_user'].",
|
||||
".$LANG['usr_rpass_req_msg'].$newpass;
|
||||
send_email($from,$to,$subj,nl2br($message));
|
||||
}else{
|
||||
$msg = e($LANG['usr_exist_err']);
|
||||
}
|
||||
}
|
||||
|
||||
return $msg;
|
||||
/**
|
||||
* Function used to reset user password
|
||||
* it has two steps
|
||||
* 1 to send confirmation
|
||||
* 2 to reset the password
|
||||
*/
|
||||
|
||||
function reset_password($step,$input,$code=NULL)
|
||||
{
|
||||
global $cbemail,$db;
|
||||
switch($step)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
$udetails = $this->get_user_details($input);
|
||||
if(!$udetails)
|
||||
e(lang('usr_exist_err'));
|
||||
//verifying captcha...
|
||||
elseif(!verify_captcha())
|
||||
e(lang('usr_ccode_err'));
|
||||
else
|
||||
{
|
||||
//Sending confirmation email
|
||||
$tpl = $cbemail->get_template('password_reset_request');
|
||||
$more_var = array
|
||||
('{username}' => $udetails['username'],
|
||||
'{email}' => $udetails['email'],
|
||||
'{avcode}' => $udetails['avcode'],
|
||||
'{userid}' => $udetails['userid'],
|
||||
);
|
||||
if(!is_array($var))
|
||||
$var = array();
|
||||
$var = array_merge($more_var,$var);
|
||||
$subj = $cbemail->replace($tpl['email_template_subject'],$var);
|
||||
$msg = nl2br($cbemail->replace($tpl['email_template'],$var));
|
||||
|
||||
//Now Finally Sending Email
|
||||
cbmail(array('to'=>$udetails['email'],'from'=>WEBSITE_EMAIL,'subject'=>$subj,'content'=>$msg));
|
||||
|
||||
e(lang('usr_rpass_email_msg'),"m");
|
||||
}
|
||||
}
|
||||
|
||||
//Function Used to recover USername
|
||||
function RecoverUsername(){
|
||||
global $LANG;
|
||||
$email = mysql_clean($_POST['email']);
|
||||
$verify = $_POST['vcode'];
|
||||
$query = mysql_query("SELECT * FROM users WHERE email='".$email."'");
|
||||
$data = mysql_fetch_array($query);
|
||||
if(!mysql_num_rows($query)>0){
|
||||
$msg[] = e($LANG['usr_exist_err1']);
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$udetails = $this->get_user_details($input);
|
||||
if(!$udetails)
|
||||
e(lang('usr_exist_err'));
|
||||
//verifying captcha...
|
||||
elseif($udetails['avcode'] !=$code)
|
||||
e(lang('usr_ccode_err'));
|
||||
else
|
||||
{
|
||||
$newpass = RandomString(6);
|
||||
$pass = pass_code($newpass);
|
||||
$avcode = RandomString(10);
|
||||
$db->update($this->dbtbl['users'],array('password','avcode'),array($pass,$avcode)," userid='".$udetails['userid']."'");
|
||||
//sending new password email...
|
||||
//Sending confirmation email
|
||||
$tpl = $cbemail->get_template('password_reset_details');
|
||||
$more_var = array
|
||||
('{username}' => $udetails['username'],
|
||||
'{email}' => $udetails['email'],
|
||||
'{avcode}' => $udetails['avcode'],
|
||||
'{userid}' => $udetails['userid'],
|
||||
'{password}' => $newpass,
|
||||
);
|
||||
if(!is_array($var))
|
||||
$var = array();
|
||||
$var = array_merge($more_var,$var);
|
||||
$subj = $cbemail->replace($tpl['email_template_subject'],$var);
|
||||
$msg = nl2br($cbemail->replace($tpl['email_template'],$var));
|
||||
|
||||
//Now Finally Sending Email
|
||||
cbmail(array('to'=>$udetails['email'],'from'=>WEBSITE_EMAIL,'subject'=>$subj,'content'=>$msg));
|
||||
e(lang('usr_pass_email_msg'),m);
|
||||
}
|
||||
|
||||
//Check Confirmation Code
|
||||
require "captcha/class.img_validator.php";
|
||||
$img = new img_validator();
|
||||
if(!$img->checks_word($verify)){
|
||||
$msg[] = e($LANG['usr_ccode_err']);
|
||||
}
|
||||
|
||||
if(empty($msg)){
|
||||
$to = $email;
|
||||
$from = SUPPORT_EMAIL;
|
||||
$subj = $ANG['usr_uname_recovery'];
|
||||
$message= $LANG['usr_dear_user'].",
|
||||
".$LANG['usr_uname_req_msg'].$data['username'];
|
||||
send_email($from,$to,$subj,nl2br($message));
|
||||
$msg = e($LANG['usr_uname_email_msg'],m);
|
||||
}
|
||||
return $msg;
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function used to recover username
|
||||
*/
|
||||
function recover_username($email)
|
||||
{
|
||||
global $cbemail;
|
||||
$udetails = $this->get_user_details($email);
|
||||
if(!$udetails)
|
||||
e(lang('usr_exist_err'));
|
||||
//verifying captcha...
|
||||
elseif($udetails['avcode'] !=$code)
|
||||
e(lang('usr_ccode_err'));
|
||||
else
|
||||
{
|
||||
$tpl = $cbemail->get_template('forgot_username_request');
|
||||
$more_var = array
|
||||
(
|
||||
'{username}' => $udetails['username'],
|
||||
);
|
||||
if(!is_array($var))
|
||||
$var = array();
|
||||
$var = array_merge($more_var,$var);
|
||||
$subj = $cbemail->replace($tpl['email_template_subject'],$var);
|
||||
$msg = nl2br($cbemail->replace($tpl['email_template'],$var));
|
||||
|
||||
//Now Finally Sending Email
|
||||
cbmail(array('to'=>$udetails['email'],'from'=>WEBSITE_EMAIL,'subject'=>$subj,'content'=>$msg));
|
||||
e(lang('usr_pass_email_msg'),m);
|
||||
e(lang("usr_uname_email_msg"),"m");
|
||||
}
|
||||
return $msg;
|
||||
|
||||
|
||||
}
|
||||
//Gettin Bridge Paramaters
|
||||
function GetBridgeParams($bridgeid){
|
||||
$query = mysql_query("SELECT * FROM login_bridges WHERE bridge_id='".$bridgeid."'");
|
||||
|
@ -2604,12 +2695,17 @@ class userquery extends CBCategory{
|
|||
// Setting Verification type
|
||||
if(EMAIL_VERIFICATION == '1'){
|
||||
$usr_status = 'ToActivate';
|
||||
$welcome_email = 'no';
|
||||
}else{
|
||||
$usr_status = 'Ok';
|
||||
$welcome_email = 'yes';
|
||||
}
|
||||
$query_field[] = " usr_status";
|
||||
$query_val[] = $usr_status;
|
||||
|
||||
$query_field[] = " welcome_email_sent";
|
||||
$query_val[] = $welcome_email;
|
||||
|
||||
//Creating AV Code
|
||||
$avcode = RandomString(10);
|
||||
$query_field[] = "avcode";
|
||||
|
@ -2657,7 +2753,7 @@ class userquery extends CBCategory{
|
|||
$insert_id = $db->insert_id();
|
||||
$db->insert($userquery->dbtbl['user_profile'],array("userid"),array($insert_id));
|
||||
|
||||
if(!$userquery->perm_check('admin_add_user',true))
|
||||
if(!$userquery->perm_check('admin_add_user',true,false) && EMAIL_VERIFICATION)
|
||||
{
|
||||
global $cbemail;
|
||||
$tpl = $cbemail->get_template('email_verify_template');
|
||||
|
@ -2674,7 +2770,11 @@ class userquery extends CBCategory{
|
|||
$msg = nl2br($cbemail->replace($tpl['email_template'],$var));
|
||||
|
||||
//Now Finally Sending Email
|
||||
cbmail(array('to'=>post('email'),'from'=>'webmaster@localhost','subject'=>$subj,'content'=>$msg));
|
||||
cbmail(array('to'=>post('email'),'from'=>WEBSITE_EMAIL,'subject'=>$subj,'content'=>$msg));
|
||||
}
|
||||
elseif(!$userquery->perm_check('admin_add_user',true,false))
|
||||
{
|
||||
$this->send_welcome_email($insert_id);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2682,6 +2782,8 @@ class userquery extends CBCategory{
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//Duplicate User Check
|
||||
function duplicate_user($name){
|
||||
|
@ -2941,7 +3043,8 @@ class userquery extends CBCategory{
|
|||
case 'av':
|
||||
case 'a':
|
||||
{
|
||||
$db->update($tbl,array('usr_status'),array('Ok')," userid='$uid' ");
|
||||
$avcode = RandomString(10);
|
||||
$db->update($tbl,array('usr_status','avcode'),array('Ok',$avcode)," userid='$uid' ");
|
||||
e(lang("User has been activated"),m);
|
||||
}
|
||||
break;
|
||||
|
@ -2951,7 +3054,8 @@ class userquery extends CBCategory{
|
|||
case "dav":
|
||||
case "d":
|
||||
{
|
||||
$db->update($tbl,array('usr_status'),array('ToActivate')," userid='$uid' ");
|
||||
$avcode = RandomString(10);
|
||||
$db->update($tbl,array('usr_status','avcode'),array('ToActivate',$avcode)," userid='$uid' ");
|
||||
e(lang("User has been deactivated"),m);
|
||||
}
|
||||
break;
|
||||
|
@ -2997,5 +3101,17 @@ class userquery extends CBCategory{
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Is Registeration allowed
|
||||
*/
|
||||
function is_registeration_allowed()
|
||||
{
|
||||
if(ALLOW_REGISTERATION == 1 )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -205,12 +205,12 @@ class CBvideo extends CBCategory
|
|||
$query .= ',';
|
||||
}*/
|
||||
|
||||
if(has_access('admin_access') && !empty($array['status']))
|
||||
if(has_access('admin_access',TRUE) && !empty($array['status']))
|
||||
{
|
||||
$query_field[] = 'status';
|
||||
$query_val[] = $array['status'];
|
||||
}
|
||||
if(has_access('admin_access') && !empty($array['duration']))
|
||||
if(has_access('admin_access',TRUE) && !empty($array['duration']))
|
||||
{
|
||||
$query_field[] = 'duration';
|
||||
$query_val[] = $array['duration'];
|
||||
|
@ -221,7 +221,7 @@ class CBvideo extends CBCategory
|
|||
e("You are not logged in");
|
||||
}elseif(!$this->video_exists($vid)){
|
||||
e("Video deos not exist");
|
||||
}elseif(!$this->is_video_owner($vid,userid()) && !has_access('admin_access'))
|
||||
}elseif(!$this->is_video_owner($vid,userid()) && !has_access('admin_access',TRUE))
|
||||
{
|
||||
e("You cannot edit this video");
|
||||
}else{
|
||||
|
@ -245,7 +245,7 @@ class CBvideo extends CBCategory
|
|||
|
||||
$vdetails = $this->get_video($vid);
|
||||
|
||||
if($this->is_video_owner($vid,userid()) || has_access('admin_access'))
|
||||
if($this->is_video_owner($vid,userid()) || has_access('admin_access',TRUE))
|
||||
{
|
||||
//list of functions to perform while deleting a video
|
||||
$del_vid_funcs = $this->video_delete_functions;
|
||||
|
@ -308,7 +308,10 @@ class CBvideo extends CBCategory
|
|||
{
|
||||
global $db;
|
||||
$src = $vdetails['videoid'];
|
||||
$file = LOGS_DIR.'/'.$vdetails['file_name'].'.log';
|
||||
$db->execute("DELETE FROM video_file WHERE src_name = '$src'");
|
||||
if(file_exists($file))
|
||||
unlink($file);
|
||||
e(lang("vid_log_delete_msg"),m);
|
||||
}
|
||||
|
||||
|
@ -347,7 +350,8 @@ class CBvideo extends CBCategory
|
|||
$limit = $params['limit'];
|
||||
$order = $params['order'];
|
||||
|
||||
$cond = "";
|
||||
if(!has_access('admin_access',TRUE))
|
||||
$cond = " status='Successful' AND active='yes' ";
|
||||
|
||||
//Setting Category Condition
|
||||
if($params['category'] && strtolower($params['category'])!='all')
|
||||
|
|
|
@ -20,6 +20,9 @@
|
|||
|
||||
ob_start();
|
||||
|
||||
define("DEVELOPMENT_MODE",TRUE);
|
||||
define("DEV_INGNORE_SYNTAX",TRUE);
|
||||
|
||||
//Setting Cookie Timeout
|
||||
define('COOKIE_TIMEOUT',315360000); // 10 years
|
||||
define('GARBAGE_TIMEOUT',COOKIE_TIMEOUT);
|
||||
|
@ -214,6 +217,7 @@ error_reporting(E_ALL ^E_NOTICE ^E_DEPRECATED);
|
|||
define('ORIGINAL_DIR',FILES_DIR.'/original');
|
||||
define('TEMP_DIR',FILES_DIR.'/temp');
|
||||
define('CON_DIR',FILES_DIR.'/conversion_queue');
|
||||
define('LOGS_DIR',FILES_DIR.'/logs');
|
||||
|
||||
//DIRECT URL OF VIDEO FILES
|
||||
define('FILES_URL',BASEURL.'/files');
|
||||
|
@ -286,7 +290,7 @@ error_reporting(E_ALL ^E_NOTICE ^E_DEPRECATED);
|
|||
$cbpm->init();
|
||||
$thisurl = curPageURL();
|
||||
Assign('THIS_URL', $thisurl);
|
||||
|
||||
|
||||
//Assigning Smarty Tags & Values
|
||||
Assign('CB_VERSION',CB_VERSION);
|
||||
Assign('FFMPEG_FLVTOOLS_BINARY',FFMPEG_FLVTOOLS_BINARY);
|
||||
|
@ -404,6 +408,7 @@ $Smarty->register_function('get_videos','get_videos');
|
|||
$Smarty->register_function('get_users','get_users');
|
||||
$Smarty->register_function('private_message','private_message');
|
||||
$Smarty->register_function('show_video_rating','show_video_rating');
|
||||
$Smarty->register_function('load_captcha','load_captcha');
|
||||
|
||||
$Smarty->register_modifier('SetTime','SetTime');
|
||||
$Smarty->register_modifier('getname','getname');
|
||||
|
|
|
@ -126,7 +126,8 @@
|
|||
}
|
||||
}
|
||||
|
||||
function Assign($name,$value){
|
||||
function Assign($name,$value)
|
||||
{
|
||||
CBTemplate::assign($name,$value);
|
||||
}
|
||||
|
||||
|
@ -379,7 +380,10 @@
|
|||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
if(!DEVELOPMENT_MODE)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1145,6 +1149,8 @@
|
|||
|
||||
function is_valid_syntax($code,$text)
|
||||
{
|
||||
if(DEVELOPMENT_MODE && DEV_INGNORE_SYNTAX)
|
||||
return true;
|
||||
return validate_field($code,$text);
|
||||
}
|
||||
|
||||
|
@ -1252,12 +1258,12 @@
|
|||
|
||||
|
||||
/**
|
||||
* Function used to get video from downloading queue
|
||||
* Function used to get video from conversion queue
|
||||
*/
|
||||
function get_queued_video($update=TRUE)
|
||||
{
|
||||
global $db;
|
||||
$results = $db->select("conversion_queue","*","cqueue_conversion='no'");
|
||||
$results = $db->select("conversion_queue","*","cqueue_conversion='no'",1);
|
||||
$result = $results[0];
|
||||
if($update)
|
||||
$db->update("conversion_queue",array("cqueue_conversion"),array("p")," cqueue_id = '".$result['cqueue_id']."'");
|
||||
|
@ -1266,6 +1272,16 @@
|
|||
|
||||
|
||||
|
||||
/**
|
||||
* Function used to get video being processed
|
||||
*/
|
||||
function get_video_being_processed()
|
||||
{
|
||||
global $db;
|
||||
$results = $db->select("conversion_queue","*","cqueue_conversion='p'");
|
||||
return $results;
|
||||
}
|
||||
|
||||
function get_video_details($vid=NULL)
|
||||
{
|
||||
global $myquery;
|
||||
|
@ -1479,7 +1495,7 @@
|
|||
* Function used to update processed video
|
||||
* @param Files details
|
||||
*/
|
||||
function update_processed_video($file_array)
|
||||
function update_processed_video($file_array,$status='Successful')
|
||||
{
|
||||
global $db;
|
||||
$file = $file_array['cqueue_name'];
|
||||
|
@ -1499,7 +1515,7 @@
|
|||
{
|
||||
//Get Duration
|
||||
$stats = get_file_details($file_name);
|
||||
$db->update("video",array("status","duration"),array("Successful",$stats['src_duration'])," file_name='".$file_name."'");
|
||||
$db->update("video",array("status","duration"),array($status,$stats['duration'])," file_name='".$file_name."'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1526,8 +1542,31 @@
|
|||
function get_file_details($file_name)
|
||||
{
|
||||
global $db;
|
||||
$result = $db->select("video_files","*"," id ='$file_name' OR src_name = '$file_name' ");
|
||||
return $result[0];
|
||||
//$result = $db->select("video_files","*"," id ='$file_name' OR src_name = '$file_name' ");
|
||||
//Reading Log File
|
||||
$file = LOGS_DIR.'/'.$file_name.'.log';
|
||||
if(file_exists($file))
|
||||
{
|
||||
$data = file_get_contents($file);
|
||||
//$file = file_get_contents('1260270267.log');
|
||||
|
||||
preg_match_all('/(.*) : (.*)/',trim($data),$matches);
|
||||
|
||||
$matches_1 = ($matches[1]);
|
||||
$matches_2 = ($matches[2]);
|
||||
|
||||
for($i=0;$i<count($matches_1);$i++)
|
||||
{
|
||||
$statistics[trim($matches_1[$i])] = trim($matches_2[$i]);
|
||||
}
|
||||
if(count($matches_1)==0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$statistics['conversion_log'] = $data;
|
||||
return $statistics;
|
||||
}else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -2627,8 +2666,7 @@
|
|||
}
|
||||
break;
|
||||
|
||||
case 'channels':case 'channel':
|
||||
default:
|
||||
case 'channels':case 'channel':case'c':case'user':
|
||||
{
|
||||
if(!isset($_GET['sort']))
|
||||
$_GET['sort'] = 'most_recent';
|
||||
|
@ -2727,4 +2765,64 @@
|
|||
$action = new cbactions();
|
||||
return $action->report_opts;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function used to load captcha field
|
||||
*/
|
||||
function get_captcha()
|
||||
{
|
||||
global $Cbucket;
|
||||
if(count($Cbucket->captchas)>0)
|
||||
{
|
||||
return $Cbucket->captchas[0];
|
||||
}else
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function used to load captcha
|
||||
*/
|
||||
define("GLOBAL_CB_CAPTCHA","cb_captcha");
|
||||
function load_captcha($params,&$Smarty)
|
||||
{
|
||||
global $total_captchas_loaded;
|
||||
switch($params['load'])
|
||||
{
|
||||
case 'function':
|
||||
{
|
||||
if($total_captchas_loaded!=0)
|
||||
$total_captchas_loaded = $total_captchas_loaded+1;
|
||||
else
|
||||
$total_captchas_loaded = 1;
|
||||
$_SESSION['total_captchas_loaded'] = $total_captchas_loaded;
|
||||
if(function_exists($params['captcha']['load_function']))
|
||||
return $params['captcha']['load_function']().'<input name="cb_captcha_enabled" type="hidden" id="cb_captcha_enabled" value="yes" />';
|
||||
}
|
||||
break;
|
||||
case 'field':
|
||||
{
|
||||
echo '<input type="text" '.$params['field_params'].' name="'.GLOBAL_CB_CAPTCHA.'" />';
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function used to verify captcha
|
||||
*/
|
||||
function verify_captcha()
|
||||
{
|
||||
$var = post('cb_captcha_enabled');
|
||||
if($var=='yes')
|
||||
{
|
||||
$captcha = get_captcha();
|
||||
$val = $captcha['validate_function'](post(GLOBAL_CB_CAPTCHA));
|
||||
return $val;
|
||||
}else
|
||||
return true;
|
||||
}
|
||||
|
||||
?>
|
|
@ -208,12 +208,12 @@
|
|||
*/
|
||||
function register_signup_field($array)
|
||||
{
|
||||
global $signup;
|
||||
global $userquery;
|
||||
$name = key($array);
|
||||
if(is_array($array) && !empty($array[$name]['name']))
|
||||
{
|
||||
foreach($array as $key => $arr)
|
||||
$signup->custom_signup_fields[$key] = $arr;
|
||||
$userquery->custom_signup_fields[$key] = $arr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -278,4 +278,14 @@
|
|||
else
|
||||
return $input;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function use to register security captchas for clipbucket
|
||||
*/
|
||||
function register_cb_captcha($func,$ver_func,$show_field=true)
|
||||
{
|
||||
global $Cbucket;
|
||||
$Cbucket->captchas[] = array('load_function'=>$func,'validate_function'=>$ver_func,'show_field'=>$show_field);
|
||||
}
|
||||
?>
|
|
@ -40,9 +40,9 @@ var page = baseurl+'/ajax.php';
|
|||
}
|
||||
}
|
||||
|
||||
function reloadImage(captcha_src)
|
||||
function reloadImage(captcha_src,imgid)
|
||||
{
|
||||
img = document.getElementById('captcha');
|
||||
img = document.getElementById(imgid);
|
||||
img.src = captcha_src+'?'+Math.random();
|
||||
}
|
||||
|
||||
|
|
|
@ -34,16 +34,22 @@ if(!function_exists(jw_player))
|
|||
$vid_file = get_video_file($vdata,$no_video,false);
|
||||
if($vid_file)
|
||||
{
|
||||
$hd = $data['hq'];
|
||||
|
||||
$swfobj->width = $data['width'];
|
||||
$swfobj->height = $data['height'];
|
||||
$swfobj->playerFile = PLAYER_URL.'/jwplayer/player.swf';
|
||||
$swfobj->DivId = $data['player_div'] ? $data['player_div'] : config('player_div_id');
|
||||
|
||||
$swfobj->FlashObj();
|
||||
//Writing Param
|
||||
$swfobj->addParam('allowfullscreen','true');
|
||||
$swfobj->addParam('allowscriptaccess','always');
|
||||
$swfobj->addParam('wmode','opaque');
|
||||
|
||||
$swfobj->addVar('file',BASEURL.'/files/videos/'.$vid_file);
|
||||
if($hd=='yes') $file = get_hq_video_file($vdata); else $file = get_video_file($vdata,true,true);
|
||||
|
||||
$swfobj->addVar('file',$file);
|
||||
|
||||
$swfobj->CreatePlayer();
|
||||
return $swfobj->code;
|
||||
|
|
|
@ -197,7 +197,7 @@ if(!function_exists('validate_embed_code'))
|
|||
{
|
||||
global $myquery,$db;
|
||||
$vdetails = $myquery->get_video_details($vid);
|
||||
if(!empty($vdetails['embed_code']) && $vdetails['embed_code'] !=' ')
|
||||
if(!empty($vdetails['embed_code']) && $vdetails['embed_code'] !=' ' && $vdetails['embed_code'] !='none')
|
||||
{
|
||||
$db->Execute("UPDATE video SET status='Successful' WHERE videoid='$vid'");
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
define("IS_CAPTCHA_LOADING",true);
|
||||
require '../../includes/common.php';
|
||||
require "captcha/class.img_validator.php";
|
||||
|
||||
|
|
|
@ -19,8 +19,9 @@ if(!function_exists("signup_captcha"))
|
|||
|
||||
function signup_captcha()
|
||||
{
|
||||
return '<img src="'.PLUG_URL.'/signup_captcha/captcha.php" border=1 name="captcha" id="captcha"/><br />
|
||||
<a href="javascript:void(0)" onclick="javascript:reloadImage(\''.PLUG_URL.'/signup_captcha/captcha.php\');"> Refresh</a>';
|
||||
$rand_id = RandomString(3);
|
||||
return '<img src="'.PLUG_URL.'/signup_captcha/captcha.php" border=1 name="captcha" id="captcha_img_'.$rand_id.'"/><br />
|
||||
<a href="javascript:void(0)" onclick="javascript:reloadImage(\''.PLUG_URL.'/signup_captcha/captcha.php\',\'captcha_img_'.$rand_id.'\');"> Refresh</a>';
|
||||
}
|
||||
|
||||
$signup_captcha['signup_captcha'] =
|
||||
|
@ -42,7 +43,8 @@ if(!function_exists("signup_captcha"))
|
|||
return $img->checks_word($val);
|
||||
}
|
||||
|
||||
register_anchor(signup_captcha(),signup_captcha);
|
||||
register_anchor(signup_captcha(),"signup_captcha");
|
||||
register_signup_field($signup_captcha);
|
||||
register_cb_captcha('signup_captcha','signup_captcha_check',TRUE);
|
||||
}
|
||||
?>
|
|
@ -11,21 +11,31 @@ define("THIS_PAGE","signup");
|
|||
define("PARENT_PAGE","signup");
|
||||
|
||||
require 'includes/config.inc.php';
|
||||
|
||||
|
||||
|
||||
if($userquery->login_check('',true)){
|
||||
redirect_to(BASEURL);
|
||||
}
|
||||
|
||||
//Checking If Registertatiosn Are Allowed or Not
|
||||
|
||||
if(!$signup->Registration()){
|
||||
$msg = $LANG['usr_reg_err'];
|
||||
}else{
|
||||
/**
|
||||
* Signing up new user
|
||||
*/
|
||||
if(isset($_POST['signup'])){
|
||||
$userquery->signup_user($_POST);
|
||||
if(!$userquery->is_registeration_allowed())
|
||||
e(lang('usr_reg_err'));
|
||||
else
|
||||
{
|
||||
$signup = $userquery->signup_user($_POST);
|
||||
if($signup)
|
||||
{
|
||||
$udetails = $userquery->get_user_details($signup);
|
||||
$eh->flush();
|
||||
assign('udetails',$udetails);
|
||||
assign('mode','signup_success');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
subtitle('signup');
|
||||
|
||||
|
||||
//Login User
|
||||
|
||||
|
@ -45,7 +55,6 @@ if(!isset($_POST['login']) && !isset($_POST['signup'])){
|
|||
}
|
||||
}
|
||||
|
||||
if($signup->Registration());
|
||||
//Displaying The Template
|
||||
template_files('signup.html');
|
||||
display_it()
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<div class="video_title">{$vdo.title}</div>
|
||||
{if $userquery->perm_check('admin_access')=='yes'}<div>{ANCHOR place=watch_admin_options data=$vdo}</div>{/if}
|
||||
|
||||
|
||||
<!-- Video Left -->
|
||||
<div class="video_left" align="left">
|
||||
|
||||
|
@ -11,6 +12,13 @@
|
|||
<script language="javascript">
|
||||
{FlashPlayer vdetails = $vdo}
|
||||
</script>
|
||||
|
||||
<div id="hd_div" class='video_player' style="display:none">
|
||||
This content requires JavaScript and Macromedia Flash Player 7 or higher. <a href=http://www.macromedia.com/go/getflash/>Get Flash</a><br/><br/>
|
||||
</div>
|
||||
<script language="javascript">
|
||||
{FlashPlayer vdetails =$vdo player_div='hd_div' hq=true}
|
||||
</script>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
|
||||
|
|
BIN
upload/styles/cbv2new/images/hq.png
Normal file
BIN
upload/styles/cbv2new/images/hq.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
|
@ -4,7 +4,7 @@
|
|||
<div class="categories">
|
||||
<ul>
|
||||
{foreach from=$category_list item=cat}
|
||||
<li {if $smarty.get.cat==$cat.category_id || ($smarty.get.cat=="" && $cat.category_id=='all')} class="selected"{/if}><a href="{link name='category' data=$cat}">{$cat.category_name}</a></li>
|
||||
<li {if $smarty.get.cat==$cat.category_id || ($smarty.get.cat=="" && $cat.category_id=='all')} class="selected"{/if}><a href="{link name='category' data=$cat type=$type}">{$cat.category_name}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
<div class="prof_title"><a href="{$userquery->profile_link($user)}">{$user.username}</a></div>
|
||||
{$user.total_videos|number_format} videos {$user.profile_hits|number_format} views<br />
|
||||
{$user.subscribers|number_format} subscribers
|
||||
Last active : {$user.last_active|nicetime}
|
||||
</div>
|
||||
<br />
|
||||
Last active : {$user.last_active|nicetime} </div>
|
||||
{/if}
|
||||
|
||||
{if $block_type =='small'}
|
||||
|
|
|
@ -26,10 +26,10 @@
|
|||
{section name=u_list loop=$users}
|
||||
{include file="$style_dir/blocks/user.html" user=$users[u_list]}
|
||||
{/section}
|
||||
<div class="clear"></div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
|
||||
<div class="verticle_ad" align="center">{AD place='ad_160x600'}</div>
|
||||
<div class="clear"></div>
|
||||
<div class="clearfix" style="margin-bottom:10px"></div>
|
||||
|
||||
{include file="$style_dir/blocks/pagination.html"}
|
|
@ -2,6 +2,17 @@
|
|||
{assign var='custom_field' value=$userquery->custom_signup_fields}
|
||||
|
||||
|
||||
{if $mode =='signup_success'}
|
||||
<div class="simple_container">
|
||||
<h2>Signup Success</h2>
|
||||
{if $udetails.usr_status !='Ok'}
|
||||
Thanks for joing {$title}, please check your inbox for activationg details
|
||||
{else}
|
||||
Thanks for joing {$title}, please login to continue as our registered member
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="signup_left">
|
||||
<h2>Members Login</h2>
|
||||
if you already have {$title} account, please login here
|
||||
|
@ -52,6 +63,24 @@
|
|||
|
||||
|
||||
{/foreach}
|
||||
|
||||
<!-- Loading Custom Fields -->
|
||||
{foreach from=$custom_field item=field}
|
||||
<label for="{$field.id}" class="label">{$field.title}</label>
|
||||
<div class="input_container">
|
||||
{if $field.hint_1}
|
||||
<div class="hint">{$field.hint_1}</div>
|
||||
{/if}
|
||||
{ANCHOR place=$field.anchor_before}{$formObj->createField($field)}{ANCHOR place=$field.anchor_after}
|
||||
{if $field.hint_2}
|
||||
<div class="hint">{$field.hint_2}</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
|
||||
{/foreach}
|
||||
|
||||
<div align="center">
|
||||
<input name="agree" type="checkbox" id="agree" value="yes" checked="checked" />
|
||||
- {$LANG.user_i_agree_to_the} <a href="{$termsofuse_link}" target="_blank" style="text-decoration:underline">{$LANG.tos_title}</a> and <a href="{$privacy_link}" target="_blank" style="text-decoration:underline">{$LANG.privacy_policy}</a>
|
||||
|
|
|
@ -40,6 +40,6 @@
|
|||
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<div class="clearfix" style="margin-bottom:10px"></div>
|
||||
|
||||
{include file="$style_dir/blocks/pagination.html"}
|
|
@ -1,18 +1,43 @@
|
|||
<div style="padding:5px">
|
||||
<div class="video_title">{$vdo.title}</div>
|
||||
{if $userquery->perm_check('admin_access')=='yes'}<div>{ANCHOR place=watch_admin_options data=$vdo}</div>{/if}
|
||||
<div class="vid_top_container">
|
||||
<div class="video_title">{$vdo.title}</div>
|
||||
{if $userquery->perm_check('admin_access')=='yes'}<div>{ANCHOR place=watch_admin_options data=$vdo}</div>{/if}
|
||||
|
||||
{if has_hq($vdo)}
|
||||
<span id="hq" class="hq_button_cont">
|
||||
<a href="javascript:void(0)" onclick="$('#normal_player_cont,#hd_player_cont,#hq,#non_hq').toggle()">
|
||||
<img src="{$imageurl}/dot.gif" class="hq_button" border="0" />
|
||||
</a>
|
||||
</span>
|
||||
<span id="non_hq" class="hq_button_cont" style="display:none">
|
||||
<a href="javascript:void(0)" onclick="$('#normal_player_cont,#hd_player_cont,#hq,#non_hq').toggle()">
|
||||
<img src="{$imageurl}/dot.gif" class="hq_button_sel" border="0" />
|
||||
</a>
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="watch_left">
|
||||
<!-- Player -->
|
||||
<div class="player_container">
|
||||
<div class="player_container" id="normal_player_cont">
|
||||
<div id="videoPlayer" class='video_player'>
|
||||
This content requires JavaScript and Macromedia Flash Player 7 or higher. <a href=http://www.macromedia.com/go/getflash/>Get Flash</a><br/><br/>
|
||||
</div>
|
||||
<script language="javascript">
|
||||
{FlashPlayer vdetails = $vdo}
|
||||
</script>
|
||||
|
||||
</div>
|
||||
{if has_hq($vdo)}
|
||||
<div class="player_container" style="display:none" id="hd_player_cont">
|
||||
<div id="hd_div" class='video_player'>
|
||||
This content requires JavaScript and Macromedia Flash Player 7 or higher. <a href=http://www.macromedia.com/go/getflash/>Get Flash</a><br/><br/>
|
||||
</div>
|
||||
<script language="javascript">
|
||||
{FlashPlayer vdetails =$vdo player_div='hd_div' hq=true}
|
||||
</script>
|
||||
</div>
|
||||
{/if}
|
||||
<!-- Player End -->
|
||||
|
||||
<!-- Actions -->
|
||||
|
|
|
@ -404,6 +404,9 @@ display:inline-block; width:18px; height:18px; line-height:18px; text-align:cent
|
|||
/**
|
||||
* Watch Video CSS
|
||||
*/
|
||||
|
||||
.vid_top_container{position:relative; margin-bottom:10px; padding-left:10px}
|
||||
.hq_button_cont{position:absolute; left:620px; bottom:0px}
|
||||
.watch_left{width:670px; float:left; padding:5px; padding-top:0px; }
|
||||
.video_title{font-size:18px; font-weight:bold; font-family:arial}
|
||||
.watch_right{width:310px; float:right; padding-left:5px; display:block}
|
||||
|
@ -582,4 +585,16 @@ display:inline-block; width:18px; height:18px; line-height:18px; text-align:cent
|
|||
.quicklist_box{bottom:0px; right:0px; padding:5px; background-color:#333; width:300px; color:#fff; position:fixed; z-index:1000; border-radius:5px 5px 0px 0px;-moz-border-radius:5px 5px 0px 0px;-webkit-border-radius:5px 5px 0px 0px}
|
||||
.my_quicklist{max-height:325px; overflow:auto; padding-right:8px}
|
||||
.quicklist_box_head{background-image:url(../images/simple_gradient.png); background-position:bottom; height:20px;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px; padding:5px; line-height:20px; color:#333; font-size:11px; font-weight:bold}
|
||||
.quicklist_box_head a{color:#0099cc; font-size:11px; font-weight:bold; text-decoration:none}
|
||||
.quicklist_box_head a{color:#0099cc; font-size:11px; font-weight:bold; text-decoration:none}
|
||||
|
||||
/** HQ BUTTONS **/
|
||||
.hq_button_sel,.hq_button{background-image:url(../images/hq.png); width:49px; height:26px; background-position:top}
|
||||
.hq_button_sel{background-position:bottom}
|
||||
|
||||
|
||||
.simple_container{background:#fff url(../images/simple_gradient.png) bottom repeat-x; border:1px solid #999;border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px; padding:5px; margin:5px}
|
||||
|
||||
.cbform .label{width:150px; float:left; display:block; text-align:right; margin-right:10px}
|
||||
.cbform input[type=textfield],.cbform input[type=text]{border:1px solid #999; margin:0px; width:200px; float:left; margin-bottom:6px; height:23px; line-height:23px; padding-top:0px; padding-bottom:0px;}
|
||||
|
||||
.h2_inner_link,.h2_inner_link a{font-size:13px; font-family:Georgia, "Times New Roman", Times, serif; font-style:italic; text-decoration:none; color:#0099cc}
|
Loading…
Add table
Reference in a new issue