modified: corrected some php warnings and notices and added a couple of utiliy functions in functions.php
This commit is contained in:
parent
a98316a5fd
commit
1241470069
16 changed files with 151 additions and 109 deletions
|
@ -16,7 +16,7 @@ function current_page($params)
|
|||
{
|
||||
global $this_page,$parent_page;
|
||||
$page = $params['page'];
|
||||
$class = $params['class'];
|
||||
$class = getArrayValue($params, 'class');
|
||||
|
||||
if($class =='')
|
||||
$class = "selected";
|
||||
|
|
|
@ -186,8 +186,11 @@ class ClipBucket
|
|||
function get_anchor_codes($place)
|
||||
{
|
||||
//Geting list of codes available for $place
|
||||
$list = $this->anchorList[$place];
|
||||
return $list;
|
||||
if(isset($this->anchorList[$place])){
|
||||
$list = $this->anchorList[$place];
|
||||
return $list;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -364,7 +367,7 @@ class ClipBucket
|
|||
|
||||
if ($per['web_config_access'] == "yes")
|
||||
$NewMenu['Tool Box']['Maintenance'] = 'maintenance.php';
|
||||
return $NewMenu;
|
||||
return (isset($NewMenu)) ? $NewMenu : false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -428,7 +431,7 @@ class ClipBucket
|
|||
|
||||
if (isset($_SESSION['the_template']) && $cbtpl->is_template($_SESSION['the_template']))
|
||||
$template = $_SESSION['the_template'];
|
||||
if ($_GET['template']) //@todo : add permission
|
||||
if (isset($_GET['template'])) //@todo : add permission
|
||||
{
|
||||
if (is_dir(STYLES_DIR . '/' . $_GET['template']) && $_GET['template'])
|
||||
$template = $_GET['template'];
|
||||
|
@ -446,7 +449,7 @@ class ClipBucket
|
|||
exit("Unable to find any template, please goto <a href='http://clip-bucket.com/no-template-found'><strong>ClipBucket Support!</strong></a>");
|
||||
|
||||
|
||||
if ($_GET['set_template'])
|
||||
if (isset($_GET['set_template']))
|
||||
{
|
||||
$myquery->set_template($template);
|
||||
}
|
||||
|
@ -516,22 +519,22 @@ class ClipBucket
|
|||
$params['class'] = '';
|
||||
|
||||
|
||||
if (!$params['getSubTab'])
|
||||
if (!isset($params['getSubTab']))
|
||||
$params['getSubTab'] = '';
|
||||
|
||||
if (!$params['parentTab'])
|
||||
if (!isset($params['parentTab']))
|
||||
$params['parentTab'] = '';
|
||||
|
||||
if (!$params['selectedTab'])
|
||||
if (!isset($params['selectedTab']))
|
||||
$params['selectedTab'] = '';
|
||||
{
|
||||
$headMenu = $this->head_menu;
|
||||
|
||||
$custom = $this->custom_menu;
|
||||
$custom = (isset($this->custom_menu)) ? $this->custom_menu : false;
|
||||
if (is_array($custom))
|
||||
$headMenu = array_merge($headMenu, $custom);
|
||||
/* Excluding tabs from menu */
|
||||
if ($params['exclude'])
|
||||
if (isset($params['exclude']))
|
||||
{
|
||||
if (is_array($params['exclude']))
|
||||
$exclude = $params['exclude'];
|
||||
|
@ -570,7 +573,7 @@ class ClipBucket
|
|||
foreach ($main_menu as $menu)
|
||||
{
|
||||
|
||||
$selected = $menu['active'];
|
||||
$selected = getArrayValue($menu, 'active');
|
||||
$output .= "<li ";
|
||||
$output .= "id = 'cb" . $menu['name'] . "Tab'";
|
||||
|
||||
|
@ -581,7 +584,7 @@ class ClipBucket
|
|||
$output .= " selected";
|
||||
$output .= "'";
|
||||
|
||||
if ($params['extra_params'])
|
||||
if (isset($params['extra_params']))
|
||||
$output .= ($params['extra_params']);
|
||||
$output .= ">";
|
||||
$output .= "<a href='" . $menu['link'] . "'>";
|
||||
|
@ -607,7 +610,7 @@ class ClipBucket
|
|||
}
|
||||
}else
|
||||
{
|
||||
if ($params['echo'])
|
||||
if (isset($params['echo']))
|
||||
{
|
||||
echo $output;
|
||||
}else
|
||||
|
|
|
@ -142,6 +142,7 @@ class ffmpeg
|
|||
# file format
|
||||
if(isset($p['format']))
|
||||
$opt_av .= " -f {$p['format']} ";
|
||||
//$opt_av .= " -f mp4 ";
|
||||
|
||||
# video codec
|
||||
if(isset($p['video_codec']))
|
||||
|
@ -237,6 +238,7 @@ class ffmpeg
|
|||
//$opt_av .= '-'.$this->vconfigs['map_meta_data']." ".$this->output_file.":".$this->input_file;
|
||||
|
||||
$this->raw_command = $command = $this->ffmpeg." -i ".$this->input_file." $opt_av ".$this->output_file." 2> ".TEMP_DIR."/".$tmp_file;
|
||||
file_put_contents("/home/sajjad/Desktop/ffmpegLog.txt", $this->raw_command);
|
||||
|
||||
//Updating DB
|
||||
//$db->update($this->tbl,array('command_used'),array($command)," id = '".$this->row_id."'");
|
||||
|
@ -868,6 +870,7 @@ class ffmpeg
|
|||
/*End*/
|
||||
$hr = $this->configs['high_res'];
|
||||
$this->configs['video_width'] = $res[$nr][0];
|
||||
$this->configs['format'] = 'mp4';
|
||||
$this->configs['video_height'] = $res[$nr][1];
|
||||
$this->configs['hq_video_width'] = $res[$hr][0];
|
||||
$this->configs['hq_video_height'] = $res[$hr][1];
|
||||
|
|
|
@ -201,7 +201,7 @@ class Clipbucket_db
|
|||
$val = ($vls[$i]);
|
||||
preg_match('/\|no_mc\|/',$val,$matches);
|
||||
//pr($matches);
|
||||
if($matches[0]!='')
|
||||
if(getArrayValue($matches, 0)!='')
|
||||
$val = preg_replace('/\|no_mc\|/','',$val);
|
||||
else
|
||||
$val = $this->clean_var($val);
|
||||
|
@ -222,7 +222,7 @@ class Clipbucket_db
|
|||
$query = "UPDATE $tbl SET $fields_query WHERE $cond $ep";
|
||||
|
||||
//if(!mysql_query($query)) die($query.'<br>'.mysql_error());
|
||||
$this->total_queries++;
|
||||
if(isset($this->total_queries)) $this->total_queries++;
|
||||
$this->total_queries_sql[] = $query;
|
||||
|
||||
try
|
||||
|
@ -244,6 +244,7 @@ class Clipbucket_db
|
|||
|
||||
global $db ;
|
||||
$total_fields = count($flds);
|
||||
$fields_query = "";
|
||||
$count = 0;
|
||||
for($i=0;$i<$total_fields;$i++)
|
||||
{
|
||||
|
@ -263,7 +264,7 @@ class Clipbucket_db
|
|||
//Complete Query
|
||||
$query = "DELETE FROM $tbl WHERE $fields_query $ep";
|
||||
//if(!mysql_query($query)) die(mysql_error());
|
||||
$this->total_queries++;
|
||||
if(isset($this->total_queries)) $this->total_queries++;
|
||||
$this->total_queries_sql[] = $query;
|
||||
|
||||
|
||||
|
@ -306,7 +307,7 @@ class Clipbucket_db
|
|||
|
||||
preg_match('/\|no_mc\|/',$value,$matches);
|
||||
//pr($matches);
|
||||
if($matches[0]!='')
|
||||
if(getArrayValue($matches, 0)!='')
|
||||
$val = preg_replace('/\|no_mc\|/','',$value);
|
||||
else
|
||||
$val = $this->clean_var($value);
|
||||
|
@ -329,7 +330,7 @@ class Clipbucket_db
|
|||
$query = "INSERT INTO $tbl ($fields_query) VALUES ($values_query) $ep";
|
||||
$this->total_queries_sql[] = $query;
|
||||
//if(!mysql_query($query)) die(mysql_error());
|
||||
$this->total_queries++;
|
||||
if(isset($this->total_queries)) $this->total_queries++;
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
@ -39,7 +39,7 @@ class language
|
|||
*/
|
||||
function init()
|
||||
{
|
||||
$lang = mysql_clean($_COOKIE['cb_lang']);
|
||||
$lang = mysql_clean(getArrayValue($_COOKIE, 'cb_lang'));
|
||||
|
||||
//Setting Language
|
||||
if(isset($_GET['set_site_lang']))
|
||||
|
@ -54,7 +54,7 @@ class language
|
|||
$lang_details = $this->lang_exists($lang);
|
||||
}
|
||||
|
||||
if(isset($lang) && $lang_details)
|
||||
if(isset($lang) && isset($lang_details))
|
||||
{
|
||||
$default = $lang_details ;
|
||||
}else
|
||||
|
|
|
@ -38,21 +38,21 @@ class CBLogs
|
|||
$a = $details_array;
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
$agent = $_SERVER['HTTP_USER_AGENT'];
|
||||
$userid = $a['userid'];
|
||||
$userid = getArrayValue($a, 'userid');
|
||||
$username = $a['username'];
|
||||
$useremail = $a['useremail'];
|
||||
$userlevel = $a['userlevel'];
|
||||
$useremail = getArrayValue($a, 'useremail');
|
||||
$userlevel = getArrayValue($a, 'userlevel');
|
||||
|
||||
$action_obj_id = $a['action_obj_id'];
|
||||
$action_done_id = $a['action_done_id'];
|
||||
$action_obj_id = getArrayValue($a, 'action_obj_id');
|
||||
$action_done_id = getArrayValue($a, 'action_done_id');
|
||||
|
||||
$userid = $userid ? $userid : $userquery->udetails['userid'];
|
||||
$username = $username ? $username : $userquery->udetails['username'];
|
||||
$useremail = $useremail ? $useremail : $userquery->udetails['email'];
|
||||
$userlevel = $userlevel ? $userlevel : $userquery->udetails['level'];
|
||||
$userlevel = $userlevel ? $userlevel : getArrayValue($userquery->udetails, 'level');
|
||||
|
||||
$success = $a['success'];
|
||||
$details = $a['details'];
|
||||
$details = getArrayValue($a, 'details');
|
||||
|
||||
$db->insert(tbl('action_log'),
|
||||
array
|
||||
|
|
|
@ -260,10 +260,11 @@ class CBPlugin extends ClipBucket
|
|||
);
|
||||
foreach ($details_array as $detail)
|
||||
{
|
||||
$plugin_array[$detail]=${$detail}[1];
|
||||
$plugin_array[$detail]= (isset(${$detail}[1])) ? ${$detail}[1] : false;
|
||||
}
|
||||
$plugin_array['file'] = $plug_file;
|
||||
$plugin_array['code'] = preg_replace('/\s/', '', $code[1]);
|
||||
if(isset($code[1]))
|
||||
$plugin_array['code'] = preg_replace('/\s/', '', $code[1]);
|
||||
|
||||
return $plugin_array;
|
||||
}else{
|
||||
|
|
|
@ -49,7 +49,7 @@ class Session
|
|||
{
|
||||
$db->insert(tbl($this->tbl),array('session_user','session','session_string','ip','session_value','session_date',
|
||||
'last_active','referer','agent','current_page'),
|
||||
array($user,$this->id,$name,$_SERVER['REMOTE_ADDR'],$value,now(),now(),$_SERVER['HTTP_REFERER'],$_SERVER['HTTP_USER_AGENT'],$cur_url));
|
||||
array($user,$this->id,$name,$_SERVER['REMOTE_ADDR'],$value,now(),now(),getArrayValue($_SERVER, 'HTTP_REFERER'),$_SERVER['HTTP_USER_AGENT'],$cur_url));
|
||||
}
|
||||
if($reg)
|
||||
{
|
||||
|
@ -91,9 +91,9 @@ class Session
|
|||
|
||||
$cur_url = $pages->GetCurrentUrl();
|
||||
|
||||
if(THIS_PAGE!='cb_install')
|
||||
if(getConstant('THIS_PAGE')!='cb_install')
|
||||
{
|
||||
if(THIS_PAGE!='ajax')
|
||||
if(getConstant('THIS_PAGE')!='ajax')
|
||||
$db->update(tbl($this->tbl),array("last_active","current_page"),array(now(),$cur_url)," session='".$this->id."' ");
|
||||
else
|
||||
$db->update(tbl($this->tbl),array("last_active"),array(now())," session='".$this->id."' ");
|
||||
|
@ -198,7 +198,7 @@ class Session
|
|||
{
|
||||
if($this->cookie)
|
||||
{
|
||||
if($_COOKIE[$name])
|
||||
if(isset($_COOKIE[$name]))
|
||||
return $_COOKIE[$name];
|
||||
}else
|
||||
{
|
||||
|
@ -232,7 +232,9 @@ class Session
|
|||
*/
|
||||
function get_cookie($name)
|
||||
{
|
||||
return stripslashes(($_COOKIE[$name]));
|
||||
if(isset($_COOKIE[$name]))
|
||||
return stripslashes(($_COOKIE[$name]));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ class userquery extends CBCategory{
|
|||
var $userid = '';
|
||||
var $username = '';
|
||||
var $level = '';
|
||||
var $permissions = '';
|
||||
var $permission = '';
|
||||
var $access_type_list = array(); //Access list
|
||||
var $usr_levels = array();
|
||||
var $signup_plugins = array(); //Signup Plugins
|
||||
|
@ -77,7 +77,7 @@ class userquery extends CBCategory{
|
|||
$this->sess_salt = $sess->get('sess_salt');
|
||||
$this->sessions = $this->get_sessions();
|
||||
|
||||
if($this->sessions['smart_sess'])
|
||||
if(getArrayValue($this->sessions, 'smart_sess'))
|
||||
{
|
||||
$this->userid = $this->sessions['smart_sess']['session_user'];
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ class userquery extends CBCategory{
|
|||
//exit();
|
||||
|
||||
//Calling Logout Functions
|
||||
$funcs = $this->init_login_functions;
|
||||
$funcs = (isset($this->init_login_functions)) ? $this->init_login_functions : false;
|
||||
if(is_array($funcs) && count($funcs)>0)
|
||||
{
|
||||
foreach($funcs as $func)
|
||||
|
@ -153,12 +153,12 @@ class userquery extends CBCategory{
|
|||
$this->action->type_tbl = $this->dbtbl['users'];
|
||||
$this->action->type_id_field = 'userid';
|
||||
|
||||
define('AVATAR_SIZE',config('max_profile_pic_width'));
|
||||
define('AVATAR_SMALL_SIZE',40);
|
||||
define('BG_SIZE',config('max_bg_width'));
|
||||
define('BACKGROUND_URL',config('background_url'));
|
||||
define("USE_GAVATAR",config('gravatars') ? config('gravatars') : false); //Use Gavatar
|
||||
define('BACKGROUND_COLOR',config('background_color'));
|
||||
if(!defined('AVATAR_SIZE')) define('AVATAR_SIZE',config('max_profile_pic_width'));
|
||||
if(!defined('AVATAR_SMALL_SIZE')) define('AVATAR_SMALL_SIZE',40);
|
||||
if(!defined('BG_SIZE')) define('BG_SIZE',config('max_bg_width'));
|
||||
if(!defined('BACKGROUND_URL')) define('BACKGROUND_URL',config('background_url'));
|
||||
if(!defined('USE_GAVATAR')) define("USE_GAVATAR",config('gravatars') ? config('gravatars') : false); //Use Gavatar
|
||||
if(!defined('BACKGROUND_COLOR')) define('BACKGROUND_COLOR',config('background_color'));
|
||||
|
||||
if(isSectionEnabled('channels'))
|
||||
$Cbucket->search_types['users'] = "userquery";
|
||||
|
@ -271,7 +271,7 @@ class userquery extends CBCategory{
|
|||
|
||||
//Inerting Access Log
|
||||
$log_array = array('username'=>$username);
|
||||
|
||||
$msg = array();
|
||||
//First we will check weather user is already logged in or not
|
||||
if($this->login_check(NULL,true))
|
||||
$msg[] = e(lang('you_already_logged'));
|
||||
|
@ -281,16 +281,16 @@ class userquery extends CBCategory{
|
|||
$msg[] = e(lang('usr_login_err'));
|
||||
elseif(strtolower($udetails['usr_status']) != 'ok')
|
||||
$msg[] = e(lang('user_inactive_msg'));
|
||||
elseif($udetails['ban_status'] == 'yes')
|
||||
elseif(getArrayValue($udetails,'ban_status') == 'yes')
|
||||
$msg[] = e(lang('usr_ban_err'));
|
||||
else
|
||||
{
|
||||
|
||||
//dump($udetails);
|
||||
$log_array['userid'] = $userid = $udetails['userid'];
|
||||
$log_array['useremail'] = $udetails['email'];
|
||||
$log_array['success'] = 1;
|
||||
|
||||
$log_array['level'] = $level = $udetails['level'];
|
||||
//dump($log_array);die();
|
||||
|
||||
//Adding Sessing In Database
|
||||
//$sess->add_session($userid,'logged_in');
|
||||
|
@ -320,7 +320,7 @@ class userquery extends CBCategory{
|
|||
|
||||
//Setting Vars
|
||||
$this->userid = $udetails['userid'];
|
||||
$this->username = $udetails['username'];
|
||||
$this->username = getArrayValue($udetails, 'username');
|
||||
$this->level = $udetails['level'];
|
||||
|
||||
//Updating User last login , num of visist and ip
|
||||
|
@ -334,7 +334,6 @@ class userquery extends CBCategory{
|
|||
"userid='".$userid."'"
|
||||
);
|
||||
|
||||
|
||||
$this->init();
|
||||
//Logging Actiong
|
||||
$cblog->insert('login',$log_array);
|
||||
|
@ -346,10 +345,11 @@ class userquery extends CBCategory{
|
|||
if(!empty($msg))
|
||||
{
|
||||
//Loggin Action
|
||||
$log_array['success'] = no;
|
||||
$log_array['success'] = 'no';
|
||||
$log_array['details'] = $msg[0];
|
||||
$cblog->insert('login',$log_array);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -400,10 +400,13 @@ class userquery extends CBCategory{
|
|||
}
|
||||
|
||||
//Now user have passed all the stages, now checking if user has level access or not
|
||||
|
||||
if($access)
|
||||
{
|
||||
//$access_details = $this->get_user_level(userid());
|
||||
$access_details = $this->permission;
|
||||
//echo "permissions";
|
||||
//dump($this->permission);
|
||||
if(is_numeric($access))
|
||||
{
|
||||
if($access_details['level_id'] == $access)
|
||||
|
@ -416,8 +419,7 @@ class userquery extends CBCategory{
|
|||
$Cbucket->show_page(false);
|
||||
return false;
|
||||
}
|
||||
}else
|
||||
{
|
||||
}else{
|
||||
if($access_details[$access] == 'yes')
|
||||
{
|
||||
|
||||
|
@ -523,13 +525,14 @@ class userquery extends CBCategory{
|
|||
{
|
||||
return $this->login_check('admin_access');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function used to check user is admin or not
|
||||
* @param BOOLEAN if true, after checcking user will be redirected to login page if needed
|
||||
*/
|
||||
function admin_login_check($check_only=false)
|
||||
{
|
||||
//dump(has_access('admin_access',true));die();
|
||||
if(!has_access('admin_access',true))
|
||||
{
|
||||
if($check_only==FALSE)
|
||||
|
@ -1710,11 +1713,11 @@ class userquery extends CBCategory{
|
|||
}
|
||||
else
|
||||
{
|
||||
$level = $this->udetails['level'];
|
||||
$level = getArrayValue($this->udetails, 'level');
|
||||
}
|
||||
|
||||
if ( $level == userid() or $level == $this->udetails[ 'level' ] ) {
|
||||
if ( $this->permission ) {
|
||||
if ( $level == userid() or $level == getArrayValue($this->udetails, 'level')) {
|
||||
if ( isset($this->permission) && $this->permission ) {
|
||||
return $this->permission;
|
||||
}
|
||||
}
|
||||
|
@ -1740,6 +1743,7 @@ class userquery extends CBCategory{
|
|||
|
||||
//Now Merging the two arrays
|
||||
$user_level = $result[0];
|
||||
|
||||
//pr($user_level);
|
||||
return $user_level;
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ if(!@$in_bg_cron)
|
|||
break;
|
||||
case 1:
|
||||
{
|
||||
error_reporting(E_ALL);
|
||||
error_reporting(E_ALL ^ E_NOTICE);
|
||||
ini_set('display_errors', 'on');
|
||||
}
|
||||
break;
|
||||
|
@ -236,9 +236,9 @@ if(!@$in_bg_cron)
|
|||
|
||||
//Website Details
|
||||
|
||||
define('CB_VERSION', $row['version']);
|
||||
define('TITLE',$row['site_title']);
|
||||
define('SLOGAN',$row['site_slogan']);
|
||||
define('CB_VERSION', $row['version']);
|
||||
define('TITLE',$row['site_title']);
|
||||
if(!defined('SLOGAN')) define('SLOGAN',$row['site_slogan']);
|
||||
|
||||
|
||||
|
||||
|
@ -249,7 +249,7 @@ if(!@$in_bg_cron)
|
|||
//Registration & Email Settings
|
||||
|
||||
define('EMAIL_VERIFICATION',$row['email_verification']);
|
||||
define('ALLOW_REG',$row['allow_registration']);
|
||||
define('ALLOW_REG',getArrayValue($row, 'allow_registration'));
|
||||
define('WEBSITE_EMAIL',$row['website_email']);
|
||||
define('SUPPORT_EMAIL',$row['support_email']);
|
||||
define('WELCOME_EMAIL',$row['welcome_email']);
|
||||
|
@ -427,9 +427,9 @@ if(!@$in_bg_cron)
|
|||
|
||||
|
||||
|
||||
|
||||
$cbtpl = new CBTemplate();
|
||||
|
||||
// STOP CACHING
|
||||
$cbtpl->caching = 0;
|
||||
$cbobjects = new CBObjects();
|
||||
$swfobj = new SWFObject();
|
||||
//Initializng Userquery class
|
||||
|
@ -477,17 +477,17 @@ if(!@$in_bg_cron)
|
|||
|
||||
//Assigning Smarty Tags & Values
|
||||
Assign('CB_VERSION',CB_VERSION);
|
||||
Assign('FFMPEG_FLVTOOLS_BINARY',FFMPEG_FLVTOOLS_BINARY);
|
||||
Assign('FFMPEG_MPLAYER_BINARY',FFMPEG_MPLAYER_BINARY);
|
||||
Assign('FFMPEG_FLVTOOLS_BINARY',getConstant('FFMPEG_FLVTOOLS_BINARY'));
|
||||
Assign('FFMPEG_MPLAYER_BINARY',getConstant('FFMPEG_MPLAYER_BINARY'));
|
||||
Assign('PHP_PATH',PHP_PATH);
|
||||
Assign('FFMPEG_BINARY',FFMPEG_BINARY);
|
||||
Assign('FFMPEG_MENCODER_BINARY',FFMPEG_MENCODER_BINARY);
|
||||
Assign('FFMPEG_BINARY',getConstant('FFMPEG_BINARY'));
|
||||
Assign('FFMPEG_MENCODER_BINARY',getConstant('FFMPEG_MENCODER_BINARY'));
|
||||
Assign('js',JS_URL);
|
||||
Assign('title',TITLE);
|
||||
Assign('slogan',SLOGAN);
|
||||
Assign('flvplayer',FLVPLAYER);
|
||||
Assign('avatardir',BASEURL.'/images/avatars');
|
||||
Assign('whatis',$row['whatis']);
|
||||
Assign('whatis',getArrayValue($row, 'whatis'));
|
||||
Assign('category_thumbs',CAT_THUMB_URL);
|
||||
Assign('gp_thumbs_url',GP_THUMB_URL);
|
||||
Assign('video_thumbs',THUMBS_URL);
|
||||
|
@ -497,7 +497,7 @@ if(!@$in_bg_cron)
|
|||
Assign('group_thumb',BASEURL.'/images/groups_thumbs');
|
||||
Assign('bg_dir',BASEURL.'/images/backgrounds');
|
||||
Assign('captcha_type',$row['captcha_type']);
|
||||
Assign('languages',$languages);
|
||||
Assign('languages',(isset($languages)) ? $languages : false);
|
||||
|
||||
Assign('module_dir',MODULEDIR);
|
||||
|
||||
|
@ -541,15 +541,15 @@ if(!@$in_bg_cron)
|
|||
)
|
||||
);
|
||||
Assign('LANG',$LANG);
|
||||
Assign('langf',LANG);
|
||||
Assign('lang_count',count($languages));
|
||||
Assign('langf',getConstant('LANG'));
|
||||
Assign('lang_count',(isset($languages)) ? count($languages) : false);
|
||||
|
||||
|
||||
//Assign Player Div Id
|
||||
Assign('player_div_id',$row['player_div_id']);
|
||||
|
||||
//Asigning Page
|
||||
Assign('page',PAGE);
|
||||
Assign('page',getConstant('PAGE'));
|
||||
|
||||
//Add Modules
|
||||
require('modules.php');
|
||||
|
@ -599,7 +599,8 @@ $Smarty->register_function('ANCHOR','ANCHOR');
|
|||
$Smarty->register_function('FUNC','FUNC');
|
||||
$Smarty->register_function('avatar','avatar');
|
||||
$Smarty->register_function('load_form','load_form');
|
||||
$Smarty->register_function('get_all_video_files',get_all_video_files_smarty);
|
||||
//getConstant('get_all_video_files_smarty')
|
||||
$Smarty->register_function('get_all_video_files', 'get_all_video_files_smarty');
|
||||
$Smarty->register_function('input_value','input_value');
|
||||
$Smarty->register_function('userid','userid');
|
||||
$Smarty->register_function('FlashPlayer','flashPlayer');
|
||||
|
|
|
@ -1081,7 +1081,7 @@
|
|||
function has_access($access,$check_only=TRUE,$verify_logged_user=true)
|
||||
{
|
||||
global $userquery;
|
||||
|
||||
//dump($userquery->login_check($access,$check_only,$verify_logged_user));
|
||||
return $userquery->login_check($access,$check_only,$verify_logged_user);
|
||||
}
|
||||
|
||||
|
@ -1749,7 +1749,7 @@
|
|||
$array_replace = array
|
||||
( $Cbucket->configs['site_title'] );
|
||||
|
||||
if($LANG[$var])
|
||||
if(isset($LANG[$var]))
|
||||
{
|
||||
$phrase = str_replace($array_str,$array_replace,$LANG[$var]);
|
||||
}else
|
||||
|
@ -1774,21 +1774,38 @@
|
|||
}
|
||||
function smarty_lang($param)
|
||||
{
|
||||
if($param['assign']=='')
|
||||
return lang($param['code'],$param['sprintf']);
|
||||
if(getArrayValue($param, 'assign')=='')
|
||||
return lang($param['code'],getArrayValue($param, 'sprintf'));
|
||||
else
|
||||
assign($param['assign'],lang($param['code'],$param['sprintf']));
|
||||
}
|
||||
|
||||
|
||||
function getArrayValue($array = array(), $key = false){
|
||||
if(!empty($array) && $key){
|
||||
if(isset($array[$key])){
|
||||
return $array[$key];
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function getConstant($constantName = false){
|
||||
if($constantName && defined($constantName))
|
||||
return constant($constantName);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function used to assign link
|
||||
*/
|
||||
function cblink($params)
|
||||
{
|
||||
global $ClipBucket;
|
||||
$name = $params['name'];
|
||||
$ref = $param['ref'];
|
||||
$name = getArrayValue($params, 'name');
|
||||
$ref = getArrayValue($params, 'ref');
|
||||
|
||||
if($name=='category')
|
||||
{
|
||||
|
@ -1840,7 +1857,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
if($params['assign'])
|
||||
if(isset($params['assign']))
|
||||
assign($params['assign'],$link.$param_link);
|
||||
else
|
||||
return $link.$param_link;
|
||||
|
@ -1970,11 +1987,13 @@
|
|||
function get_functions($name)
|
||||
{
|
||||
global $Cbucket;
|
||||
$funcs = $Cbucket->$name;
|
||||
if(is_array($funcs) && count($funcs)>0)
|
||||
return $funcs;
|
||||
else
|
||||
return false;
|
||||
if(isset($Cbucket->$name)){
|
||||
$funcs = $Cbucket->$name;
|
||||
if(is_array($funcs) && count($funcs)>0)
|
||||
return $funcs;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -2923,7 +2942,7 @@
|
|||
{
|
||||
global $cbsubtitle;
|
||||
|
||||
$sub_sep = $params['sub_sep'];
|
||||
$sub_sep = getArrayValue($params, 'sub_sep');
|
||||
if(!$sub_sep)
|
||||
$sub_sep = '-';
|
||||
|
||||
|
@ -3304,8 +3323,8 @@
|
|||
*/
|
||||
function include_header($params)
|
||||
{
|
||||
$file = $params['file'];
|
||||
$type = $params['type'];
|
||||
$file = getArrayValue($params, 'file');
|
||||
$type = getArrayValue($params, 'type');
|
||||
|
||||
if($file=='global_header')
|
||||
{
|
||||
|
@ -4699,12 +4718,18 @@
|
|||
*/
|
||||
function in_dev()
|
||||
{
|
||||
if(defined(DEVELOPMENT_MODE) || DEVELOPMENT_MODE)
|
||||
if(defined('DEVELOPMENT_MODE'))
|
||||
return DEVELOPMENT_MODE;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
function dump($data){
|
||||
echo "<pre>";
|
||||
var_dump($data);
|
||||
echo "</pre>";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* displays a runtime error
|
||||
|
|
|
@ -23,17 +23,17 @@
|
|||
function cb_register_action($func_name,$place,$extra_params=Array(),$scope=array('global'))
|
||||
{
|
||||
global $Cbucket;
|
||||
|
||||
$actions_list = $Cbucket->actions_list;
|
||||
$actions_list[$place][] = array(
|
||||
'action' => $func_name,
|
||||
'params' => $extra_params,
|
||||
'scope' => $scope
|
||||
);
|
||||
if(isset($Cbucket->actions_list)){
|
||||
$actions_list = $Cbucket->actions_list;
|
||||
$actions_list[$place][] = array(
|
||||
'action' => $func_name,
|
||||
'params' => $extra_params,
|
||||
'scope' => $scope
|
||||
);
|
||||
|
||||
|
||||
$Cbucket->actions_list = $actions_list;
|
||||
|
||||
$Cbucket->actions_list = $actions_list;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
{
|
||||
global $Cbucket;
|
||||
|
||||
if(isset($Cbucket->filters[$type]));
|
||||
if(isset($Cbucket->filters[$type]))
|
||||
return $Cbucket->filters[$type];
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ function display_it()
|
|||
$dir = LAYOUT;
|
||||
foreach($ClipBucket->template_files as $file)
|
||||
{
|
||||
if(file_exists(LAYOUT.'/'.$file) || is_array($file))
|
||||
if(file_exists(LAYOUT.'/'.$file['file']) || is_array($file))
|
||||
{
|
||||
|
||||
if(!$ClipBucket->show_page && $file['follow_show_page'])
|
||||
|
@ -87,7 +87,7 @@ function display_it()
|
|||
$new_list[] = $file;
|
||||
else
|
||||
{
|
||||
if($file['folder'] && file_exists($file['folder'].'/'.$file['file']))
|
||||
if(isset($file['folder']) && file_exists($file['folder'].'/'.$file['file']))
|
||||
$new_list[] = $file['folder'].'/'.$file['file'];
|
||||
else
|
||||
$new_list[] = $file['file'];
|
||||
|
|
|
@ -100,7 +100,7 @@ class Modules
|
|||
$Modules = new Modules();
|
||||
|
||||
//Ading and Displaying Module
|
||||
|
||||
$module_list = array();
|
||||
$moduleQuery = @mysql_query("SELECT * FROM modules WHERE active ='yes'");
|
||||
while($moduleData = @mysql_fetch_array($moduleQuery)){
|
||||
$module = $Modules->GetModuleDetails($moduleData['module_name']);
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
{
|
||||
if(function_exists($func))
|
||||
{
|
||||
if($params['data'])
|
||||
if(isset($params['data']))
|
||||
$func($params['data']);
|
||||
else
|
||||
$func();
|
||||
|
@ -371,11 +371,13 @@
|
|||
function cb_get_functions($place)
|
||||
{
|
||||
global $Cbucket;
|
||||
if(count($Cbucket->clipbucket_functions[$place])>0)
|
||||
{
|
||||
return $Cbucket->clipbucket_functions[$place];
|
||||
}else
|
||||
return false;
|
||||
if(isset($Cbucket->clipbucket_functions[$place])){
|
||||
if(count($Cbucket->clipbucket_functions[$place])>0)
|
||||
{
|
||||
return $Cbucket->clipbucket_functions[$place];
|
||||
}else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue