2009-08-25 12:16:42 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @ Author Arslan Hassan
|
2010-03-16 18:56:41 +00:00
|
|
|
* @ License : Attribution Assurance License -- http://www.opensource.org/licenses/attribution.php
|
2009-08-25 12:16:42 +00:00
|
|
|
* @ Class : CLipBucket Class
|
|
|
|
* @ date : 12 MARCH 2009
|
|
|
|
* @ Version : v1.8
|
|
|
|
*/
|
|
|
|
|
|
|
|
class ClipBucket
|
|
|
|
{
|
|
|
|
var $BASEDIR;
|
|
|
|
var $JSArray = array();
|
2010-01-12 14:14:29 +00:00
|
|
|
var $AdminJSArray = array();
|
2009-08-25 12:16:42 +00:00
|
|
|
var $moduleList = array();
|
|
|
|
var $actionList = array();
|
|
|
|
var $anchorList = array();
|
|
|
|
var $ids = array(); //IDS WILL BE USED FOR JS FUNCTIONS
|
|
|
|
var $AdminMenu = array();
|
|
|
|
var $configs = array();
|
|
|
|
var $header_files = array();// these files will be included in <head> tag
|
2010-01-12 14:14:29 +00:00
|
|
|
var $admin_header_files = array();// these files will be included in <head> tag
|
2009-08-25 12:16:42 +00:00
|
|
|
var $anchor_function_list = array();
|
|
|
|
var $show_page = true;
|
|
|
|
var $upload_opt_list = array();//this will have array of upload opts like upload file, emebed or remote upload
|
|
|
|
var $temp_exts = array(); //Temp extensions
|
2010-03-30 05:53:27 +00:00
|
|
|
var $actions_play_video = array();
|
2009-08-25 12:16:42 +00:00
|
|
|
var $template_files = array();
|
2009-09-28 05:23:50 +00:00
|
|
|
var $cur_template = 'clipbucketblue';
|
|
|
|
var $links = array();
|
2009-12-09 13:43:19 +00:00
|
|
|
var $captchas = array();
|
2010-01-13 09:53:21 +00:00
|
|
|
var $clipbucket_footer = array('the_end');
|
2010-02-21 20:40:26 +00:00
|
|
|
var $clipbucket_functions = array();
|
2010-01-01 13:01:53 +00:00
|
|
|
var $head_menu = array();
|
|
|
|
var $foot_menu = array();
|
|
|
|
|
|
|
|
var $in_footer = false;
|
|
|
|
|
2010-01-06 11:59:41 +00:00
|
|
|
var $cbinfo = array();
|
|
|
|
|
2011-01-03 11:02:54 +00:00
|
|
|
var $search_types = array();
|
2009-12-23 13:06:42 +00:00
|
|
|
|
2009-10-03 10:38:28 +00:00
|
|
|
/**
|
|
|
|
* All Functions that are called
|
|
|
|
* before after converting a video
|
|
|
|
* are saved in these arrays
|
|
|
|
*/
|
|
|
|
|
|
|
|
var $before_convert_functions = array();
|
|
|
|
var $after_convert_functions = array();
|
2011-01-01 19:44:58 +00:00
|
|
|
|
2009-10-10 14:25:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This array contains
|
|
|
|
* all functions that are called
|
|
|
|
* when we call video to play on watch_video page
|
|
|
|
*/
|
|
|
|
var $watch_video_functions = array();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Email Function list
|
|
|
|
*/
|
|
|
|
var $email_functions = array();
|
2010-03-30 05:53:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This array contains
|
|
|
|
* all functions that are called
|
|
|
|
* on CBvideo::remove_files
|
|
|
|
*/
|
|
|
|
var $on_delete_video = array();
|
|
|
|
|
2009-10-10 14:25:07 +00:00
|
|
|
|
2009-08-25 12:16:42 +00:00
|
|
|
function ClipBucket ()
|
|
|
|
{
|
|
|
|
global $pages;
|
|
|
|
//Assign Configs
|
|
|
|
$this->configs = $this->get_configs();
|
|
|
|
//Get Current Page and Redirects it to without www.
|
|
|
|
$pages->redirectOrig();
|
|
|
|
//Get Base Directory
|
|
|
|
$this->BASEDIR = $this->getBasedir();
|
|
|
|
//Listing Common JS File
|
|
|
|
$this->addJS(array
|
|
|
|
(
|
2010-11-13 12:25:38 +00:00
|
|
|
'jquery.js' => 'global',
|
|
|
|
'ajax.js' => 'homeactive',
|
|
|
|
'jquery_plugs/cookie.js' => 'global',
|
|
|
|
'rating_update.js' => 'global',
|
|
|
|
'checkall.js' => 'global',
|
|
|
|
'functions.js' => 'global',
|
2009-08-25 12:16:42 +00:00
|
|
|
));
|
|
|
|
|
2010-01-12 14:14:29 +00:00
|
|
|
|
2009-08-25 12:16:42 +00:00
|
|
|
//This is used to create Admin Menu
|
|
|
|
$this->AdminMenu = $this->get_admin_menu();
|
2010-01-13 09:53:21 +00:00
|
|
|
|
2010-12-29 12:28:44 +00:00
|
|
|
//Updating Upload Options
|
2009-10-03 10:38:28 +00:00
|
|
|
$this->temp_exts = array('ahz','jhz','abc','xyz','cb2','tmp','olo','oar','ozz');
|
2009-09-28 05:23:50 +00:00
|
|
|
$this->template = $this->configs['template_dir'];
|
2009-12-09 13:43:19 +00:00
|
|
|
|
|
|
|
if(!defined("IS_CAPTCHA_LOADING"))
|
|
|
|
$_SESSION['total_captchas_loaded'] = 0;
|
2010-01-13 09:53:21 +00:00
|
|
|
|
2010-04-16 14:32:58 +00:00
|
|
|
$this->clean_requests();
|
2009-08-25 12:16:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getBasedir()
|
|
|
|
{
|
|
|
|
$dirname = dirname(__FILE__);
|
|
|
|
$dirname = preg_replace(array('/includes/','/classes/'),'',$dirname);
|
|
|
|
$dirname = substr($dirname,0,strlen($dirname) -2);
|
|
|
|
return $dirname == '/' ? '' : $dirname;
|
|
|
|
}
|
|
|
|
|
|
|
|
function addJS($files)
|
|
|
|
{
|
|
|
|
if(is_array($files))
|
|
|
|
{
|
|
|
|
foreach($files as $key=> $file)
|
2010-01-25 13:18:18 +00:00
|
|
|
$this->JSArray[][$key] = $file;
|
2009-08-25 12:16:42 +00:00
|
|
|
}else{
|
|
|
|
$this->JSArray[$files] = 'global';
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
function add_js($files)
|
|
|
|
{
|
|
|
|
$this->addJS($files);
|
|
|
|
}
|
|
|
|
|
2010-01-12 14:14:29 +00:00
|
|
|
|
|
|
|
function addAdminJS($files)
|
|
|
|
{
|
|
|
|
if(is_array($files))
|
|
|
|
{
|
|
|
|
foreach($files as $key=> $file)
|
|
|
|
$this->AdminJSArray[$key] = $file;
|
|
|
|
}else{
|
|
|
|
$this->AdminJSArray[$files] = 'global';
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2009-08-25 12:16:42 +00:00
|
|
|
/**
|
|
|
|
* Function add_header()
|
|
|
|
* this will be used to add new files in header array
|
|
|
|
* this is basically for plugins
|
2009-11-30 19:46:45 +00:00
|
|
|
* @param FILE
|
|
|
|
* @param PAGES (array)
|
2009-08-25 12:16:42 +00:00
|
|
|
*/
|
2009-11-30 19:46:45 +00:00
|
|
|
function add_header($file,$place='global')
|
2009-08-25 12:16:42 +00:00
|
|
|
{
|
2009-11-30 19:46:45 +00:00
|
|
|
if(!is_array($place))
|
2009-08-25 12:16:42 +00:00
|
|
|
{
|
2009-11-30 19:46:45 +00:00
|
|
|
$place = array($place);
|
2009-08-25 12:16:42 +00:00
|
|
|
}
|
2009-11-30 19:46:45 +00:00
|
|
|
$this->header_files[$file] = $place;
|
2009-08-25 12:16:42 +00:00
|
|
|
}
|
|
|
|
|
2010-01-12 14:14:29 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function add_admin_header()
|
|
|
|
* this will be used to add new files in header array
|
|
|
|
* this is basically for plugins
|
|
|
|
* @param FILE
|
|
|
|
* @param PAGES (array)
|
|
|
|
*/
|
|
|
|
function add_admin_header($file,$place='global')
|
|
|
|
{
|
|
|
|
if(!is_array($place))
|
|
|
|
{
|
|
|
|
$place = array($place);
|
|
|
|
}
|
|
|
|
$this->admin_header_files[$file] = $place;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2009-08-25 12:16:42 +00:00
|
|
|
/**
|
|
|
|
* Function used to get list of function of any type
|
|
|
|
* @param : type (category,title,date etc)
|
|
|
|
*/
|
|
|
|
function getFunctionList($type)
|
|
|
|
{
|
|
|
|
return $this->actionList[$type];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function used to get anchors that are registered in plugins
|
|
|
|
*/
|
|
|
|
function get_anchor_codes($place)
|
|
|
|
{
|
|
|
|
//Geting list of codes available for $place
|
|
|
|
$list = $this->anchorList[$place];
|
|
|
|
return $list;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function used to get function of anchors that are registered in plugins
|
|
|
|
*/
|
|
|
|
function get_anchor_function_list($place)
|
|
|
|
{
|
|
|
|
//Geting list of functions
|
|
|
|
$list = $this->anchor_function_list[$place];
|
|
|
|
return $list;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function used to create admin menu
|
|
|
|
*/
|
|
|
|
function get_admin_menu()
|
|
|
|
{
|
|
|
|
$menu_array = array
|
|
|
|
(
|
|
|
|
//Statistics
|
2010-01-13 12:55:00 +00:00
|
|
|
'Stats And Configurations' =>
|
2009-08-25 12:16:42 +00:00
|
|
|
array(
|
2010-01-23 13:16:19 +00:00
|
|
|
'Reports & Stats'=>'reports.php',
|
2009-08-25 12:16:42 +00:00
|
|
|
'Website Configurations'=>'main.php',
|
|
|
|
'Email Settings'=>'email_settings.php',
|
2010-01-13 12:55:00 +00:00
|
|
|
'Language Settings' => 'language_settings.php',
|
|
|
|
'Add New Phrases' => 'add_phrase.php',
|
2010-01-14 15:29:09 +00:00
|
|
|
'Manage Pages' => 'manage_pages.php',
|
2010-03-19 13:26:16 +00:00
|
|
|
'Manage Comments' => 'comments.php',
|
2009-08-25 12:16:42 +00:00
|
|
|
),
|
|
|
|
|
2010-01-13 12:55:00 +00:00
|
|
|
|
2009-08-25 12:16:42 +00:00
|
|
|
//Video
|
|
|
|
'Videos' =>
|
|
|
|
array(
|
|
|
|
'Videos Manager'=>'video_manager.php',
|
|
|
|
'Manage Categories'=>'category.php',
|
|
|
|
'List Flagged Videos'=>'flagged_videos.php',
|
|
|
|
'Upload Videos' =>'mass_uploader.php',
|
2010-01-05 09:47:10 +00:00
|
|
|
'List Inactive Videos'=>'video_manager.php?search=search&active=no'
|
2009-08-25 12:16:42 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
//Users
|
|
|
|
'Users' =>
|
|
|
|
array(
|
2010-01-05 09:47:10 +00:00
|
|
|
'Manage Members' => 'members.php',
|
2010-01-06 11:59:41 +00:00
|
|
|
'Add Member'=>'add_member.php',
|
2010-01-27 11:37:26 +00:00
|
|
|
'Manage categories' => 'user_category.php',
|
2009-08-25 12:16:42 +00:00
|
|
|
'User Levels'=>'user_levels.php',
|
|
|
|
'Search Members'=>'members.php?view=search',
|
2010-01-05 09:47:10 +00:00
|
|
|
'Inactive Only'=>'members.php?search=yes&status=ToActivate',
|
|
|
|
'Active Only'=>'members.php?search=yes&status=Ok',
|
2010-01-06 11:59:41 +00:00
|
|
|
'Reported Users'=>'flagged_users.php',
|
2009-08-25 12:16:42 +00:00
|
|
|
'Mass Email'=>'mass_email.php'
|
|
|
|
),
|
|
|
|
|
|
|
|
//Groups
|
|
|
|
'Groups' =>
|
|
|
|
array(
|
2009-11-16 11:55:31 +00:00
|
|
|
'Add Group'=>'add_group.php',
|
2009-08-25 12:16:42 +00:00
|
|
|
'Manage Groups'=>'groups_manager.php',
|
2010-01-05 09:47:10 +00:00
|
|
|
'Manage Categories'=>'group_category.php?view=show_category',
|
|
|
|
'View Inactive Groups' => 'groups_manager.php?active=no&search=yes',
|
2010-01-06 11:59:41 +00:00
|
|
|
'View Reported Groups' => 'flagged_groups.php',
|
2009-08-25 12:16:42 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
//Advertisments
|
|
|
|
'Advertisement' =>
|
|
|
|
array(
|
|
|
|
'Manage Advertisments'=>'ads_manager.php',
|
|
|
|
'Manage Placements'=>'ads_add_placements.php',
|
|
|
|
),
|
|
|
|
|
|
|
|
//Template Manager
|
2010-01-13 12:55:00 +00:00
|
|
|
'Templates And Players'=>
|
2009-08-25 12:16:42 +00:00
|
|
|
array(
|
2010-01-14 15:29:09 +00:00
|
|
|
'Templates Manager'=>'templates.php',
|
|
|
|
'Templates Editor'=>'template_editor.php',
|
2010-04-26 15:17:37 +00:00
|
|
|
'Players Manager' => 'manage_players.php',
|
|
|
|
'Player Settings' => 'manage_players.php?mode=show_settings'
|
2009-08-25 12:16:42 +00:00
|
|
|
|
2010-01-13 12:55:00 +00:00
|
|
|
),
|
2009-08-25 12:16:42 +00:00
|
|
|
//Plugin Manager
|
|
|
|
'Plugin Manager'=>
|
|
|
|
array(
|
|
|
|
'Plugin Manager'=>'plugin_manager.php'
|
|
|
|
),
|
|
|
|
|
|
|
|
//Tool Box
|
|
|
|
'Tool Box'=>
|
|
|
|
array(
|
2010-03-03 12:54:56 +00:00
|
|
|
//'ClipBucket Module Manager'=>'module_manager.php',
|
2010-02-13 12:03:01 +00:00
|
|
|
'PHP Info' => 'phpinfo.php',
|
2010-01-12 14:14:29 +00:00
|
|
|
'Server Modules Info' => 'cb_mod_check.php',
|
2010-03-23 15:21:27 +00:00
|
|
|
'Conversion Queue Manager' => 'cb_conversion_queue.php',
|
2010-07-18 20:14:21 +00:00
|
|
|
'ReIndexer' => 'reindex_cb.php',
|
2010-03-03 12:54:56 +00:00
|
|
|
//'View Encoding Status'=>'',
|
2009-08-25 12:16:42 +00:00
|
|
|
),
|
|
|
|
|
2010-01-13 12:55:00 +00:00
|
|
|
|
2009-08-25 12:16:42 +00:00
|
|
|
);
|
|
|
|
|
2009-10-03 10:38:28 +00:00
|
|
|
|
2009-08-25 12:16:42 +00:00
|
|
|
return $menu_array;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function used to assign ClipBucket configurations
|
|
|
|
*/
|
|
|
|
function get_configs()
|
|
|
|
{
|
|
|
|
global $myquery;
|
|
|
|
return $myquery->Get_Website_Details();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Funtion cused to get list of countries
|
|
|
|
*/
|
|
|
|
function get_countries($type=iso2)
|
|
|
|
{
|
|
|
|
global $db;
|
2010-02-06 11:29:50 +00:00
|
|
|
$results = $db->select(tbl("countries"),"*");
|
2009-08-25 12:16:42 +00:00
|
|
|
switch($type)
|
|
|
|
{
|
|
|
|
case id:
|
|
|
|
foreach($results as $result)
|
|
|
|
{
|
2010-02-12 16:17:17 +00:00
|
|
|
$carray[$result['country_id']] = $result['name_en'];
|
2009-08-25 12:16:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case iso2:
|
|
|
|
foreach($results as $result)
|
|
|
|
{
|
|
|
|
$carray[$result['iso2']] = $result['name_en'];
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case iso3:
|
|
|
|
foreach($results as $result)
|
|
|
|
{
|
|
|
|
$carray[$result['iso3']] = $result['name_en'];
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
foreach($results as $result)
|
|
|
|
{
|
2010-02-12 16:17:17 +00:00
|
|
|
$carray[$result['country_id']] = $result['name_en'];
|
2009-08-25 12:16:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $carray;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function used to set show_page = false or true
|
|
|
|
*/
|
|
|
|
function show_page($val=true)
|
|
|
|
{
|
|
|
|
$this->show_page = $val;
|
|
|
|
}
|
2009-09-28 05:23:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function used to set template (Frontend)
|
|
|
|
*/
|
|
|
|
function set_the_template()
|
|
|
|
{
|
|
|
|
global $cbtpl,$myquery;
|
|
|
|
$template = $this->template;
|
|
|
|
|
2010-02-21 20:40:26 +00:00
|
|
|
if(isset($_SESSION['the_template']) && $cbtpl->is_template($_SESSION['the_template']))
|
|
|
|
$template = $_SESSION['the_template'];
|
2009-09-28 05:23:50 +00:00
|
|
|
if($_GET['template'])
|
|
|
|
{
|
|
|
|
if(is_dir(STYLES_DIR.'/'.$_GET['template']) && $_GET['template'])
|
|
|
|
$template = $_GET['template'];
|
|
|
|
}
|
2010-02-21 20:40:26 +00:00
|
|
|
if(isset($_GET['set_the_template']) && $cbtpl->is_template($_GET['set_the_template']))
|
|
|
|
$template = $_SESSION['the_template'] = $_GET['set_the_template'];
|
2009-09-28 05:23:50 +00:00
|
|
|
if(!is_dir(STYLES_DIR.'/'.$template) || !$template)
|
2010-02-21 20:40:26 +00:00
|
|
|
$template = 'cbv2new';
|
2009-09-28 05:23:50 +00:00
|
|
|
if(!is_dir(STYLES_DIR.'/'.$template) || !$template)
|
|
|
|
{
|
|
|
|
$template = $cbtpl->get_any_template();
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!is_dir(STYLES_DIR.'/'.$template) || !$template)
|
|
|
|
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'])
|
|
|
|
{
|
|
|
|
$myquery->set_template($template);
|
|
|
|
}
|
|
|
|
|
|
|
|
define('TEMPLATE',$template);
|
|
|
|
}
|
2009-10-10 14:25:07 +00:00
|
|
|
|
2009-12-29 18:15:35 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function used to list available extension for clipbucket
|
|
|
|
*/
|
|
|
|
function list_extensions()
|
|
|
|
{
|
|
|
|
$exts = $this->configs['allowed_types'];
|
|
|
|
$exts = preg_replace('/ /','',$exts);
|
|
|
|
$exts = explode(',',$exts);
|
|
|
|
$new_form = '';
|
|
|
|
foreach($exts as $ext)
|
|
|
|
{
|
|
|
|
if(!empty($new_form))
|
|
|
|
$new_form .=";";
|
|
|
|
$new_form .= "*.$ext";
|
|
|
|
}
|
|
|
|
|
|
|
|
return $new_form;
|
|
|
|
}
|
2010-01-01 13:01:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function used to load head menu
|
|
|
|
*/
|
|
|
|
function head_menu($params=NULL)
|
|
|
|
{
|
|
|
|
global $cbpage;
|
2011-01-01 19:44:58 +00:00
|
|
|
$this->head_menu[] = array('name'=>lang("menu_home"),'link'=>BASEURL,"this"=>"home","section"=>"home","extra_attr"=>"");
|
|
|
|
$this->head_menu[] = array('name'=>lang("videos"),'link'=>cblink(array('name'=>'videos')),"this"=>"videos","section"=>"home");
|
|
|
|
$this->head_menu[] = array('name'=>lang("menu_channels"),'link'=>cblink(array('name'=>'channels')),"this"=>"channels","section"=>"channels");
|
|
|
|
$this->head_menu[] = array('name'=>lang("groups"),'link'=>cblink(array('name'=>'groups')),"this"=>"groups","section"=>"groups");
|
|
|
|
$this->head_menu[] = array('name'=>lang("Collections"),'link'=>cblink(array('name'=>'collections')),"this"=>"collections","section"=>"collections");
|
2010-01-01 13:01:53 +00:00
|
|
|
if(!userid())
|
|
|
|
$this->head_menu[] = array('name'=>lang("signup"),'link'=>cblink(array('name'=>'signup')),"this"=>"signup");
|
|
|
|
|
2011-01-01 19:44:58 +00:00
|
|
|
$this->head_menu[] = array('name'=>lang("upload"),'link'=>cblink(array('name'=>'upload')),"this"=>"upload");
|
2010-01-01 13:01:53 +00:00
|
|
|
if($params['assign'])
|
|
|
|
assign($params['assign'],$this->head_menu);
|
|
|
|
else
|
|
|
|
return $this->head_menu;
|
|
|
|
}
|
|
|
|
|
2011-01-01 19:44:58 +00:00
|
|
|
|
|
|
|
function cbMenu($params=NULL)
|
|
|
|
{
|
2011-01-03 11:02:54 +00:00
|
|
|
$this->head_menu();
|
|
|
|
if(!$params['tag'])
|
|
|
|
$params['tag'] = 'li';
|
|
|
|
|
|
|
|
if(!$params['class'])
|
|
|
|
$params['class'] = '';
|
|
|
|
|
|
|
|
|
|
|
|
if(!$params['getSubTab'])
|
|
|
|
$params['getSubTab'] = '';
|
|
|
|
|
|
|
|
if(!$params['parentTab'])
|
|
|
|
$params['parentTab'] = '';
|
|
|
|
|
|
|
|
if(!$params['selectedTab'])
|
|
|
|
$params['selectedTab'] = '';
|
2011-01-01 19:44:58 +00:00
|
|
|
{
|
|
|
|
$headMenu = $this->head_menu;
|
|
|
|
$output = '';
|
|
|
|
if(($params['tag']))
|
|
|
|
$output .= "<".$params['tag'].">";
|
|
|
|
foreach($headMenu as $menu)
|
|
|
|
{
|
2011-01-03 11:02:54 +00:00
|
|
|
if(isSectionEnabled($menu['this']))
|
|
|
|
{
|
|
|
|
$selected = current_page(array("page"=>$menu['this']));
|
2011-01-01 19:44:58 +00:00
|
|
|
|
2011-01-03 11:02:54 +00:00
|
|
|
$output .= "<li ";
|
|
|
|
$output .= "id = 'cb".$menu['name']."Tab'";
|
|
|
|
|
|
|
|
$output .= " class = '";
|
|
|
|
if($params['class'])
|
|
|
|
$outout .= $params['class'];
|
|
|
|
if($selected)
|
|
|
|
$output .= " selected";
|
|
|
|
$output .= "'";
|
|
|
|
|
|
|
|
if($params['extra_params'])
|
|
|
|
$output .= ($params['extra_params']);
|
|
|
|
$output .= ">";
|
|
|
|
$output .= "<a href='".$menu['link']."'>";
|
|
|
|
$output .= $menu['name']."</a>";
|
|
|
|
$output .= "</li>";
|
|
|
|
}
|
2011-01-01 19:44:58 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
if(($params['tag']))
|
|
|
|
$output .= "</".$params['tag'].">";
|
2011-01-03 11:02:54 +00:00
|
|
|
|
|
|
|
if($params['echo'])
|
|
|
|
echo $output;
|
|
|
|
else
|
|
|
|
return $output;
|
2011-01-01 19:44:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-01-01 13:01:53 +00:00
|
|
|
/**
|
|
|
|
* Function used to load head menu
|
|
|
|
*/
|
|
|
|
function foot_menu($params=NULL)
|
|
|
|
{
|
|
|
|
global $cbpage;
|
|
|
|
$this->foot_menu[] = array('name'=>lang("menu_home"),'link'=>BASEURL,"this"=>"home");
|
|
|
|
$this->foot_menu[] = array('name'=>lang("contact_us"),'link'=>cblink(array('name'=>'contact_us')),"this"=>"home");
|
|
|
|
if(userid())
|
|
|
|
$this->foot_menu[] = array('name'=>lang("my_account"),'link'=>cblink(array('name'=>'my_account')),"this"=>"home");
|
|
|
|
|
|
|
|
if($cbpage->is_active(1))
|
|
|
|
$this->foot_menu[] = array('name'=>lang("about_us"),'link'=>$cbpage->get_page_link(1),"this"=>"home");
|
|
|
|
|
|
|
|
if($cbpage->is_active(2))
|
|
|
|
$this->foot_menu[] = array('name'=>lang("privacy_policy"),'link'=>$cbpage->get_page_link(2),"this"=>"home");
|
|
|
|
|
|
|
|
if($cbpage->is_active(3))
|
|
|
|
$this->foot_menu[] = array('name'=>lang("terms_of_serivce"),'link'=>$cbpage->get_page_link(3),"this"=>"home");
|
|
|
|
|
|
|
|
if($cbpage->is_active(4))
|
|
|
|
$this->foot_menu[] = array('name'=>lang("help"),'link'=>$cbpage->get_page_link(4),"this"=>"groups");
|
|
|
|
|
|
|
|
if($params['assign'])
|
|
|
|
assign($params['assign'],$this->foot_menu);
|
|
|
|
else
|
|
|
|
return $this->foot_menu;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function used to call footer
|
|
|
|
*/
|
|
|
|
function footer()
|
|
|
|
{
|
|
|
|
ANCHOR(array('place'=>'the_footer'));
|
|
|
|
}
|
2010-01-05 09:47:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function used to get News From ClipBucket Blog
|
|
|
|
*/
|
|
|
|
function get_cb_news()
|
|
|
|
{
|
2010-12-23 16:56:33 +00:00
|
|
|
/*$feeds = 5;
|
2010-01-05 09:47:10 +00:00
|
|
|
$text = 400;
|
2010-01-13 09:53:21 +00:00
|
|
|
|
|
|
|
if($_SERVER['HTTP_HOST']!='localhost')
|
|
|
|
$url = 'http://blog.clip-bucket.com/feed/';
|
|
|
|
else
|
|
|
|
$url = 'http://localhost/clipbucket/2.x/2/upload/tester/feed.xml';
|
2010-01-05 09:47:10 +00:00
|
|
|
$news = xml2array($url);
|
|
|
|
if(!$news)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}else
|
|
|
|
{
|
|
|
|
$items = array();
|
|
|
|
$item = $news['rss']['channel']['item'];
|
|
|
|
for($i=0;$i<$feeds;$i++)
|
|
|
|
$items[] = $item[$i];
|
|
|
|
|
|
|
|
return $items;
|
2010-12-23 16:56:33 +00:00
|
|
|
}*/
|
2010-04-16 14:32:58 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fucntion used to clean requests
|
|
|
|
*/
|
|
|
|
function clean_requests()
|
|
|
|
{
|
|
|
|
$posts = $_POST;
|
|
|
|
$gets = $_GET;
|
|
|
|
$request = $_REQUEST;
|
|
|
|
|
|
|
|
//Cleaning post..
|
|
|
|
if(is_array($posts) && count($posts)>0)
|
|
|
|
{
|
|
|
|
$clean_posts = array();
|
|
|
|
foreach($posts as $key => $post)
|
|
|
|
{
|
|
|
|
if(!is_array($post))
|
|
|
|
{
|
|
|
|
$clean_posts[$key] = preg_replace(array('/\|no_mc\|/','/\|f\|/'),'',$post);
|
|
|
|
}else
|
|
|
|
$clean_posts[$key] = $post;
|
|
|
|
}
|
|
|
|
$_POST = $clean_posts;
|
|
|
|
}
|
|
|
|
|
|
|
|
//Cleaning get..
|
|
|
|
if(is_array($gets) && count($gets)>0)
|
|
|
|
{
|
|
|
|
$clean_gets = array();
|
|
|
|
foreach($gets as $key => $get)
|
|
|
|
{
|
|
|
|
if(!is_array($get))
|
|
|
|
{
|
|
|
|
$clean_gets[$key] = preg_replace(array('/\|no_mc\|/','/\|f\|/'),'',$get);
|
|
|
|
}else
|
|
|
|
$clean_gets[$key] = $get;
|
|
|
|
}
|
|
|
|
$_GET = $clean_gets;
|
|
|
|
}
|
|
|
|
|
|
|
|
//Cleaning request..
|
|
|
|
if(is_array($request) && count($request)>0)
|
|
|
|
{
|
|
|
|
$clean_request = array();
|
|
|
|
foreach($request as $key => $request)
|
|
|
|
{
|
|
|
|
if(!is_array($request))
|
|
|
|
{
|
|
|
|
$clean_request[$key] = preg_replace(array('/\|no_mc\|/','/\|f\|/'),'',$request);
|
|
|
|
}else
|
|
|
|
$clean_request[$key] = $request;
|
|
|
|
}
|
|
|
|
$_REQUEST = $clean_request;
|
|
|
|
}
|
|
|
|
|
2010-01-05 09:47:10 +00:00
|
|
|
}
|
2009-08-25 12:16:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|