diff --git a/upload/actions/file_uploader.php b/upload/actions/file_uploader.php index 629c76b0..8f03c6b5 100644 --- a/upload/actions/file_uploader.php +++ b/upload/actions/file_uploader.php @@ -127,7 +127,7 @@ include('../includes/config.inc.php'); exit(0); }else{ $Upload->add_conversion_queue($file_name); - exec(php_path()." -q ".BASEDIR."/actions/video_convert.php > /dev/null &"); + exec(php_path()." -q ".BASEDIR."/actions/video_convert.php &> /dev/null &"); } exit(0); diff --git a/upload/actions/update_configs.php b/upload/actions/update_configs.php new file mode 100644 index 00000000..c458657c --- /dev/null +++ b/upload/actions/update_configs.php @@ -0,0 +1,22 @@ +login_check('admin_access'); + +if(isset($_POST['update_player_size'])) +{ + $height = mysql_clean($_POST['height']); + $width = mysql_clean($_POST['width']); + if(!is_numeric($height) || $height <=100) + $height = 100; + if(!is_numeric($width) || $width <=100) + $width = 100; + $myquery->Set_Website_Details('player_height',$height); + $myquery->Set_Website_Details('player_width',$width); + echo "Player size has been updated"; +} +?> \ No newline at end of file diff --git a/upload/actions/video_convert.php b/upload/actions/video_convert.php index ef8afadc..4b81c4b7 100644 --- a/upload/actions/video_convert.php +++ b/upload/actions/video_convert.php @@ -1,9 +1,9 @@ true, + 'use_video_bit_rate' => true, + 'use_audio_rate' => true, + 'use_audio_bit_rate' => true, + 'use_audio_codec' => true, + 'format' => 'flv', + 'video_codec'=>'libx264', + 'audio_codec'=>'libfaac', + 'audio_rate'=>22050, + 'audio_bitrate'=>128000, + 'video_bitrate'=>512000, + 'video_width'=>400, + 'video_height'=>300, + 'resize'=>'max' + ); - $configs = array - ( - 'use_video_rate' => true, - 'use_video_bit_rate' => true, - 'use_audio_rate' => true, - 'use_audio_bit_rate' => true, - 'format' => 'flv', - 'video_codec'=>'flv', - 'audio_rate'=>22050, - 'audio_bitrate'=>128000, - 'video_bitrate'=>512000, - 'video_width'=>400, - 'video_height'=>300, - 'resize'=>'max' - ); - - + + /** + * Calling Functions before converting Video + */ + if(get_functions('before_convert_functions')) + { + foreach(get_functions('before_convert_functions') as $func) + { + if(@function_exists($func)) + $func(); + } + } + + $ffmpeg = new ffmpeg($orig_file); $ffmpeg->configs = $configs; $ffmpeg->gen_thumbs = TRUE; $ffmpeg->gen_big_thumb = TRUE; $ffmpeg->output_file = VIDEOS_DIR.'/'.$tmp_file.'.flv'; - $ffmpeg->two_pass = FALSE; + $ffmpeg->hq_output_file = VIDEOS_DIR.'/'.$tmp_file.'.mp4'; + $ffmpeg->h264_single_pass = TRUE; $ffmpeg->remove_input=FALSE; $ffmpeg->ClipBucket(); - exit(); $db->update("conversion_queue", array("cqueue_conversion"), array("yes")," cqueue_id = '".$queue_details['cqueue_id']."'"); update_processed_video($queue_details); + + + /** + * Calling Functions before converting Video + */ + if(get_functions('after_convert_functions')) + { + foreach(get_functions('after_convert_functions') as $func) + { + if(@function_exists($func)) + $func(); + } + } } diff --git a/upload/admin_area/ads_add_placements.php b/upload/admin_area/ads_add_placements.php index 2110ad3b..ad1fad4f 100644 --- a/upload/admin_area/ads_add_placements.php +++ b/upload/admin_area/ads_add_placements.php @@ -38,11 +38,7 @@ $total_placements = $ads_exec->recordcount() + 0; Assign('ads_placements',$ads_placements); -Assign('msg',@$msg); -Template('header.html'); -Template('leftmenu.html'); -Template('message.html'); -Template('ads_add_placements.html'); -Template('footer.html'); +template_files('ads_add_placements.html'); +display_it(); ?> \ No newline at end of file diff --git a/upload/admin_area/ads_manager.php b/upload/admin_area/ads_manager.php index af7461c9..ba802354 100644 --- a/upload/admin_area/ads_manager.php +++ b/upload/admin_area/ads_manager.php @@ -1,91 +1,41 @@ admin_login_check(); +$userquery->login_check('admin_access'); $pages->page_redir(); -//Adding Advertisment - -if(isset($_POST['add_ad'])){ - $msg = $ads_query->AddAd(); +//Adding +if(isset($_POST['add'])) +{ + $adsObj->AddAd(); } -//Changing Status - -if(isset($_GET['change_status'])){ -$id = mysql_clean($_GET['change_status']); -$status = mysql_clean($_GET['status']); -$msg = $ads_query->ChangeAdStatus($status,$id); +//Adding +if(isset($_POST['update'])) +{ + $adsObj->EditAd($_POST['ad_id']); } -//Delet Advertisment -if(isset($_GET['delete_ad'])){ -$id = mysql_clean($_GET['delete_ad']); -$msg = $ads_query->DeleteAd($id); + +//Editing Ad +if(isset($_GET['ad_id'])) +{ + $ad_id = mysql_clean($_GET['ad_id']); + $ad_data = $adsObj->get_ad_details($ad_id); + if(!$ad_data) + e("Ad does not exist"); + else + assign('ad_data',$ad_data); } -//Editing An Add/ -if(isset($_GET['ad'])){ - $ad = clean($_GET['ad']); - $query = mysql_query("SELECT * FROM ads_data WHERE ad_id='".$ad."'"); - if(mysql_num_rows($query)>0){ - if(isset($_POST['update_ad'])){ - $id = mysql_clean($_GET['ad']); - $msg = $ads_query->EditAd($id); - } - $sql = "SELECT * FROM ads_data WHERE ad_id='".$ad."'"; - $rs = $db->Execute($sql); - $ad_data = $rs->getrows();; - Assign('ad_data',$ad_data); - Assign('edit_ad','show'); - }else{ - $msg[] = $LANG['ad_exists_error1']; - } -} +template_files('ads_manager.html'); +display_it(); -//Advertisment Array -$placements = array( - "ad_160x600" => "Wide Skyscrapper 160 x 600", - "ad_468x60" => "Banner 468 x 60", - "ad_300x250" => "Medium Rectangle 300 x 250", - "ad_728x90" => "Leader Board 728 x 90", - "ad_200x200" => "Small Square 200 x 200", - "ad_250x250" => "Square 250 x 250", - "ad_120x600" => "Skyscrapper 120 x 600", - "ad_336x280" => "Large Rectangle 336x280" - ); - -Assign('placement',$placements); - $sql = "SELECT * from ads_data"; - $rs = $db->Execute($sql); - $total = $rs->recordcount(); - $ads = $rs->getrows(); - for($id=0;$id<$total;$id++){ - $category = $myquery->GetCategory($ads[$id]['ad_category']); - $ads[$id]['ad_category'] = $category['category_name']; - $ads[$id]['placement'] = $placements [$ads[$id]['ad_placement']]; - } - - Assign('total', $total); - Assign('ads', $ads); - - -//Getting List Of Placement -$sql = "SELECT * FROM ads_placements"; -$ads_exec = $db->Execute($sql); -$ads_placements = $ads_exec->getrows(); -Assign('ads_placements',$ads_placements); -Assign('msg',@$msg); -Template('header.html'); -Template('leftmenu.html'); -Template('message.html'); -Template('ads_manager.html'); -Template('footer.html'); ?> \ No newline at end of file diff --git a/upload/admin_area/category.php b/upload/admin_area/category.php index 93cded33..07f7c90b 100644 --- a/upload/admin_area/category.php +++ b/upload/admin_area/category.php @@ -8,7 +8,7 @@ */ require_once '../includes/admin_config.php'; -$userquery->admin_login_check(); +$userquery->login_check('admin_access'); $pages->page_redir(); diff --git a/upload/admin_area/edit_announcement.php b/upload/admin_area/edit_announcement.php index 7bc8bb82..332c2bf5 100644 --- a/upload/admin_area/edit_announcement.php +++ b/upload/admin_area/edit_announcement.php @@ -4,7 +4,7 @@ * @author : Arslan Hassan */ require_once '../includes/admin_config.php'; -$userquery->admin_login_check(); +$userquery->login_check('admin_access'); $pages->page_redir(); if(isset($_POST['update'])) diff --git a/upload/admin_area/edit_group.php b/upload/admin_area/edit_group.php index 1b79b254..bfbfa15e 100644 --- a/upload/admin_area/edit_group.php +++ b/upload/admin_area/edit_group.php @@ -8,7 +8,7 @@ */ require'../includes/admin_config.php'; -$userquery->admin_login_check(); +$userquery->login_check('admin_access'); $pages->page_redir(); $group = mysql_clean($_GET['group']); diff --git a/upload/admin_area/index.php b/upload/admin_area/index.php index 70953575..dfc35b0d 100644 --- a/upload/admin_area/index.php +++ b/upload/admin_area/index.php @@ -40,8 +40,6 @@ Template('footer.html'); */ -pr($cbvid->category_exists(27)); - template_files('index.html'); display_it(); ?> \ No newline at end of file diff --git a/upload/admin_area/manage_players.php b/upload/admin_area/manage_players.php new file mode 100644 index 00000000..f2431ae1 --- /dev/null +++ b/upload/admin_area/manage_players.php @@ -0,0 +1,20 @@ +page_redir(); +$userquery->login_check('admin_access'); + +if($_GET['set']) +{ + $cbplayer->set_player($_GET); +} +template_files('manage_players.html'); +display_it(); +?> \ No newline at end of file diff --git a/upload/admin_area/styles/cbadmin/images/play_icon.png b/upload/admin_area/styles/cbadmin/images/play_icon.png new file mode 100644 index 00000000..95ed7d01 Binary files /dev/null and b/upload/admin_area/styles/cbadmin/images/play_icon.png differ diff --git a/upload/admin_area/styles/cbadmin/layout/ads_add_placements.html b/upload/admin_area/styles/cbadmin/layout/ads_add_placements.html new file mode 100644 index 00000000..20b4740e --- /dev/null +++ b/upload/admin_area/styles/cbadmin/layout/ads_add_placements.html @@ -0,0 +1,80 @@ + +{if $Cbucket->show_page == true} + + + +
+ + + + + + +
 Add Placement  
+ + + + + + + + + + + + + + + + + + + + + + + +
 
 
+
+
+
+
+ + + Note: if you delete any placement, all ads under it will be deleted + +
+
+ +
+ + + + + + + + +
ID
PlacementName
PlacementCode
TotalAds
Action
+{section name=a_list loop=$ads_placements} +{if $ads_placements[a_list].placement_name !=''} + + + + + + + + +
{$ads_placements[a_list].placement_id}
{$ads_placements[a_list].placement_name}
{literal}{AD place={/literal}{$ads_placements[a_list].placement}{literal}}{/literal}
{$ads_placements[a_list].total_ads}
{if $ads_placements[a_list].disable == no}Remove{else}Default Placement{/if}
+ {if $bgcolor == ""} + {assign var = bgcolor value = "#EEEEEE"} + {else} + {assign var = bgcolor value = ""} + {/if} +{/if} +{/section} + +{/if} \ No newline at end of file diff --git a/upload/admin_area/styles/cbadmin/layout/ads_manager.html b/upload/admin_area/styles/cbadmin/layout/ads_manager.html new file mode 100644 index 00000000..5ce4f7be --- /dev/null +++ b/upload/admin_area/styles/cbadmin/layout/ads_manager.html @@ -0,0 +1,161 @@ + +{if $ad_data.ad_name !=''} + + + + + + + + + +
 Eid Advertisement 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 all fields are required
 {$ad_data.ad_code|ad}
+ * + e.g Home Banner
+ Add More Placements
Status +
 
+
+
+
+{else} +{if $edit_ad != "show"} + + + + + + + + + +
 Add Advertisement 
+ + + + + + + + + + + + + + + + + + + + + + + + + +
 all fields are required
+ * + e.g Home Banner
+ Add More Placements
Status +
 
+
+
+ {/if} +
+

Advertisement Manager

+ + + + + {if $bgcolor == ""} + {assign var = bgcolor value = "#EEEEEE"} + {else} + {assign var = bgcolor value = ""} + {/if} + +
+ + + + + + + + + + +
AID
Advertisment name
Advertisment
Impressions
Date Added
Placement
Actions
+
+ + {assign var='ads' value=$adsObj->get_advertisements()} + {foreach item=ad from=$ads} + + + + + + + + + + {/foreach} +
{$ad.ad_id}
{$ad.ad_name}
{$ad.ad_codes}View Advertisment
{$ad.ad_impressions|number_format}
{$ad.date_added|date_format}
{$adsObj->get_placement_name($ad.ad_placement)}
 
+{/if} \ No newline at end of file diff --git a/upload/admin_area/styles/cbadmin/layout/global_header.html b/upload/admin_area/styles/cbadmin/layout/global_header.html index 30f31639..b7a54fbf 100644 --- a/upload/admin_area/styles/cbadmin/layout/global_header.html +++ b/upload/admin_area/styles/cbadmin/layout/global_header.html @@ -14,11 +14,14 @@ var baseurl = "{$baseurl}"; + + + diff --git a/upload/admin_area/styles/cbadmin/layout/index.html b/upload/admin_area/styles/cbadmin/layout/index.html index 5a25aec1..ee97b6a3 100644 --- a/upload/admin_area/styles/cbadmin/layout/index.html +++ b/upload/admin_area/styles/cbadmin/layout/index.html @@ -1 +1,30 @@ -Test is best \ No newline at end of file +{literal} + + + +
+ +
+

Resize larger / smaller

+
+ +
+ +
+ +

Limit the resizable element to a maximum or minimum height or width using the maxHeight, maxWidth, minHeight, and minWidth options.

+ +
+{/literal} \ No newline at end of file diff --git a/upload/admin_area/styles/cbadmin/layout/manage_players.html b/upload/admin_area/styles/cbadmin/layout/manage_players.html new file mode 100644 index 00000000..43b9537a --- /dev/null +++ b/upload/admin_area/styles/cbadmin/layout/manage_players.html @@ -0,0 +1,99 @@ +
Selected Player
+
+{assign var="player_dir" value=$Cbucket->configs.player_dir} +{assign var="player_file" value=$Cbucket->configs.player_file} + +{assign var="curplayer" value=$cbplayer->getPlayerDetails($player_file,$player_dir)} + + + + + +

{$curplayer.name}

{$curplayer.author}
+{$curplayer.description}
+Version : {$curplayer.version} Released on {$curplayer.released|date_format}
+Website : {$curplayer.website}
+ + +
+ +
+ +
Change Player Size
+
+
+{literal} + + +{/literal} +
+ +
+

Actual Player Size

+
+ + + + +
+
+ +
+
Available Players
+ +{* Listing All Avilable Players *} + +{assign var='players' value=$cbplayer->get_players()} + +
+{foreach from=$players item=player} +{if $player_file !=$player.file && $player_dir != $player.folder} + +
+ +
+ {$player.name}
by {$player.author}
+ Activate This Player
+
+
+{/if} +{/foreach} +
\ No newline at end of file diff --git a/upload/admin_area/styles/cbadmin/layout/video_manager.html b/upload/admin_area/styles/cbadmin/layout/video_manager.html index bdbd6c7e..8892b0fc 100644 --- a/upload/admin_area/styles/cbadmin/layout/video_manager.html +++ b/upload/admin_area/styles/cbadmin/layout/video_manager.html @@ -34,7 +34,7 @@ - + diff --git a/upload/admin_area/styles/cbadmin/theme/stylesheet.css b/upload/admin_area/styles/cbadmin/theme/stylesheet.css index bac398d8..0cacb626 100644 --- a/upload/admin_area/styles/cbadmin/theme/stylesheet.css +++ b/upload/admin_area/styles/cbadmin/theme/stylesheet.css @@ -49,6 +49,8 @@ a{font-size:12px; font-weight:bold; text-decoration:none; color:#147dc3; font-fa -webkit-border-radius: 5px; border:0px solid #EAEEFF;} .vdo_sets{font-size:11px; text-transform:uppercase; font-family: Consolas, Monaco, Courier, monospace;} + +.setting_title{font-size:18px; margin-bottom:5px 0px 5px 0px;} /** * Forms */ @@ -68,7 +70,8 @@ a{font-size:12px; font-weight:bold; text-decoration:none; color:#147dc3; font-fa /** * Forms End - */ +*/ +.block_head tr td{padding:0px 2px 0px 2px} .block tr td{padding:2px; border-bottom:1px dotted #eee; } .block tr:hover{background-color:#f8f8f8} @@ -128,4 +131,7 @@ padding-left:5px; font-size:16px; font-weight:bold; font-family:Arial, Helvetica } .templates_container .tpl_title{width:80%; margin:auto; font-size:12px;} .templates_container .template_box{width:200px; float:left; margin:10px; padding:10px} -.templates_container .template_box:hover{background-color:#F3E8FF} \ No newline at end of file +.templates_container .template_box:hover{background-color:#F3E8FF} + + +.preview_thumb{max-width:175px; max-height:175px} \ No newline at end of file diff --git a/upload/includes/admin.functions.php b/upload/includes/admin.functions.php index b3b2e931..9e499512 100644 --- a/upload/includes/admin.functions.php +++ b/upload/includes/admin.functions.php @@ -11,7 +11,12 @@ if(has_access('admin_access',TRUE)) { - register_anchor('my_func','watch_admin_options'); + function show_video_admin_link($data) + { + echo 'Edit Video'; + } + + register_anchor_function('show_video_admin_link','watch_admin_options'); } ?> \ No newline at end of file diff --git a/upload/includes/admin_config.php b/upload/includes/admin_config.php index fe0a1e8b..1db9359e 100644 --- a/upload/includes/admin_config.php +++ b/upload/includes/admin_config.php @@ -1,5 +1,7 @@ temp_exts = array('ahz','jhz','abc','xyz','cb2','tmp','olo','oar','oz','luffy','zoro','nami','chopper','ussop','sanji'); + $this->temp_exts = array('ahz','jhz','abc','xyz','cb2','tmp','olo','oar','ozz'); $this->template = $this->configs['template_dir']; + } @@ -234,8 +243,15 @@ class ClipBucket 'View Encoding Status'=>'', ), + //Playes + 'Manage Players'=> + array + ( + 'Manage Players' => 'manage_players.php' + ) ); + return $menu_array; } @@ -327,6 +343,7 @@ class ClipBucket define('TEMPLATE',$template); } + } ?> \ No newline at end of file diff --git a/upload/includes/classes/ads.class.php b/upload/includes/classes/ads.class.php index 149fa4fb..a77e334b 100644 --- a/upload/includes/classes/ads.class.php +++ b/upload/includes/classes/ads.class.php @@ -18,8 +18,8 @@ class AdsManager global $LANG; $name = mysql_clean($_POST['name']); - $code = mysql_clean(htmlspecialchars($_POST['code'])); - $placement = mysql_clean($_POST['type']); + $code = mysql_real_escape_string(htmlspecialchars($_POST['code'])); + $placement = mysql_clean($_POST['placement']); $category = $_POST['category']; $status = $_POST['status']; @@ -65,9 +65,9 @@ class AdsManager function EditAd($id){ global $LANG; - $placement = mysql_clean($_POST['type']); + $placement = mysql_clean($_POST['placement']); $name = mysql_clean($_POST['name']); - $code = htmlspecialchars($_POST['code']); + $code = mysql_real_escape_string(htmlspecialchars($_POST['code'])); $category = mysql_clean(@$_POST['category']); if(empty($name)){ $msg = e($LANG['ad_name_error']); @@ -193,5 +193,73 @@ class AdsManager $db->Execute($query); } + + /** + * Function usd to get all placemetns + */ + function get_placements() + { + global $db; + + $result = $db->select("ads_placements"); + if($db->num_rows>0) + return $result; + else + return false; + } + + /** + * Function used to get all advertisments + */ + function get_advertisements() + { + global $db; + + $result = $db->select("ads_data"); + if($db->num_rows>0) + return $result; + else + return false; + + } + + /** + * Function used to get placement + */ + function get_placement($place) + { + global $db; + $result = $db->select("ads_placements","*"," placement='$place' OR placement_id='$place' "); + if($db->num_rows>0) + return $result[0]; + else + return false; + } + + /** + * Function used to create placement name + */ + function get_placement_name($place) + { + $details = $this->get_placement($place); + if($details) + return $details['placement_name']; + else + return false; + } + + /** + * Function used to get advertismetn + */ + function get_ad_details($id) + { + global $db; + $result = $db->select("ads_data","*"," ad_placement='$id' OR ad_id='$id'"); + if($db->num_rows>0) + return $result[0]; + else + return false; + } + } ?> \ No newline at end of file diff --git a/upload/includes/classes/conversion/ffmpeg.win32.php b/upload/includes/classes/conversion/ffmpeg.win32.php index 62d6fe18..42449940 100644 --- a/upload/includes/classes/conversion/ffmpeg.win32.php +++ b/upload/includes/classes/conversion/ffmpeg.win32.php @@ -26,8 +26,8 @@ class ffmpeg var $gen_thumbs; //If set to TRUE , it will generate thumbnails also var $remove_input = TRUE; var $gen_big_thumb = FALSE; - var $two_pass = FALSE; - + var $h264_single_pass = FALSE; + var $hq_output_file = ''; /** @@ -84,6 +84,7 @@ class ffmpeg */ function convert($file=NULL) { + global $db; if($file) $this->input_file = $file; @@ -93,6 +94,7 @@ class ffmpeg $p = $this->configs; $i = $this->input_details; + echo test; # Prepare the ffmpeg command to execute if(isset($p['extra_options'])) @@ -107,7 +109,9 @@ class ffmpeg $opt_av .= " -vcodec ".$p['video_codec']; elseif(isset($i['video_codec'])) $opt_av .= " -vcodec ".$i['video_codec']; - + if($p['video_codec'] == 'libx264') + $opt_av .= " -vpre normal "; + # video rate if($p['use_video_rate']) { @@ -153,7 +157,10 @@ class ffmpeg elseif(isset($i['audio_bitrate'])) $abrate = $i['audio_bitrate']; if(!empty($abrate)) - $opt_av .= " -ab $abrate "; + { + $abrate_cmd = " -ab $abrate "; + $opt_av .= $abrate_cmd; + } } # audio bitrate @@ -169,19 +176,12 @@ class ffmpeg $opt_av .= " -map_meta_data ".$this->output_file.":".$this->input_file; - if(!$this->two_pass) - $command = $this->ffmpeg." -i ".$this->input_file." $opt_av ".$this->output_file." 2> ".TEMP_DIR."/output.tmp "; - else + if($this->h264_single_pass) { + //Before Converting video to HQ , we must check weather + // ITS Hq Or Not - $options = "-vcodec libx264 -b 512k -flags +loop+mv4 -cmp 256 - -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 - -me_method hex -subq 7 -trellis 1 -refs 5 -bf 3 - -flags2 +bpyramid+wpred+mixed_refs+dct8x8 -coder 1 -me_range 16 - -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 - -qmax 51 -qdiff 4"; - - $command = $this->ffmpeg." -i ".$this->input_file." -an -pass 1 -threads 2 $options ".$this->output_file." 2> ".TEMP_DIR."/output.tmp "; + $command = $this->ffmpeg." -i ".$this->input_file." -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(file_exists(TEMP_DIR.'/output.tmp')) { @@ -189,8 +189,16 @@ class ffmpeg unlink(TEMP_DIR.'/output.tmp'); } - $command = $this->ffmpeg." -y -i ".$this->input_file." -acodec libfaac -ar 44100 -ab 96k -pass 2 -threads 2 $options ".$this->output_file." 2> ".TEMP_DIR."/output.tmp "; + $this->log('HQ Video -- Conversion Command',$command); + $this->log .="\r\n\r\nConversion Details\r\n\r\n"; + $this->log .=$output; + $this->log .= "\r\n\r\n\n=========ENDING HQ CONVERSION==============\n\n"; } + + $command = $this->ffmpeg." -i ".$this->input_file." $opt_av ".$this->output_file." 2> ".TEMP_DIR."/output.tmp "; + + //Updating DB + $db->update($this->tbl,array('command_used'),array($command)," id = '".$this->row_id."'"); $output = $this->exec($command); if(file_exists(TEMP_DIR.'/output.tmp')) diff --git a/upload/includes/classes/player.class.php b/upload/includes/classes/player.class.php new file mode 100644 index 00000000..b6c1b842 --- /dev/null +++ b/upload/includes/classes/player.class.php @@ -0,0 +1,182 @@ +getPlayerDetails($player_file); + if(!empty($player_details['name'])) + $player_array[]= $player_details; + } + + //Now Reading Sub Dir Files + foreach($subitem_list as $sub_dir => $sub_dir_list ) + { + foreach($subitem_list[$sub_dir] as $player_file) + { + $player_details = $this->getPlayerDetails($player_file,$sub_dir); + $player_details['dir'] = $player_details['folder'] = $sub_dir; + if(!empty($player_details['name'])) + $player_array[] = $player_details; + } + } + + return $player_array; + } + + /** + * Function used to get ClipBucket Player + */ + function get_players() + { + return $this->getPlayers(); + } + + /** + * Function used to get player details + * @input = file + */ + function get_player_details($player_file,$sub_dir=NULL) + { + if($sub_dir!='') + $sub_dir = $sub_dir.'/'; + + $file = PLAYER_DIR.'/'.$sub_dir.$player_file; + if(file_exists($file) && is_file($file)) + { + // We don't need to write to the file, so just open for reading. + $fp = fopen($file, 'r'); + // Pull only the first 8kiB of the file in. + $plugin_data = fread( $fp, 8192 ); + // PHP will close file handle, but we are good citizens. + fclose($fp); + preg_match( '/Player Name:(.*)$/mi', $plugin_data, $name ); + preg_match( '/Website:(.*)$/mi', $plugin_data, $website ); + preg_match( '/Version:(.*)/mi', $plugin_data, $version ); + preg_match( '/Description:(.*)$/mi', $plugin_data, $description ); + preg_match( '/Author:(.*)$/mi', $plugin_data, $author ); + preg_match( '/Author Website:(.*)$/mi', $plugin_data, $author_page ); + preg_match( '/ClpBucket Version:(.*)$/mi', $plugin_data, $cbversion ); + preg_match( '/Player Type:(.*)$/mi', $plugin_data, $type ); + + $details_array = array + ( + 'name', + 'website', + 'version', + 'description', + 'author', + 'cbversion', + 'author_page', + 'code', + 'type', + + ); + foreach ($details_array as $detail) + { + $plugin_array[$detail]=${$detail}[1]; + } + $plugin_array['file'] = $player_file; + $plugin_array['dir'] = $plugin_array['folder'] = $sub_dir; + $plugin_array['code'] = preg_replace('/\s/', '', $code[1]); + + return $plugin_array; + }else{ + return false; + } + } + function getPlayerDetails($file,$sub_dir=NULL) + { + return $this->get_player_details($file,$sub_dir); + } + + + /** + * Function used to get template thumb + */ + function get_preview_thumb($player) + { + $path = $player.'/preview.'; + $exts = array('png','jpg','gif'); + $thumb_path = BASEURL.'/images/icons/no_thumb.png'; + foreach($exts as $ext) + { + $file = PLAYER_DIR.'/'.$path.$ext; + if(file_exists($file)) + { + $thumb_path = PLAYER_URL.'/'.$path.$ext; + break; + } + } + return $thumb_path; + } + + /** + * Function used to set player for ClipBucket + */ + function set_player($details) + { + global $myquery; + + if($this->getPlayerDetails($details['file'],$details['folder'])) + { + $myquery->Set_Website_Details('player_file',$details['file']); + $myquery->Set_Website_Details('player_dir',$details['folder']); + e("Player has been activated",m); + }else + e("An error occured while activating player"); + } + function setplayer($details) + { + return $this->set_player($details); + } + +} +?> \ No newline at end of file diff --git a/upload/includes/classes/plugin.class.php b/upload/includes/classes/plugin.class.php index 34a17f43..fdafe98c 100644 --- a/upload/includes/classes/plugin.class.php +++ b/upload/includes/classes/plugin.class.php @@ -213,7 +213,7 @@ class CBPlugin extends ClipBucket preg_match( '/Author:(.*)$/mi', $plugin_data, $author ); preg_match( '/Author Website:(.*)$/mi', $plugin_data, $author_page ); preg_match( '/ClpBucket Version:(.*)$/mi', $plugin_data, $cbversion ); - preg_match( '/Plugint Type:(.*)$/mi', $plugin_data, $type ); + preg_match( '/Plugin Type:(.*)$/mi', $plugin_data, $type ); $details_array = array ( @@ -224,6 +224,7 @@ class CBPlugin extends ClipBucket 'author', 'cbversion', 'code', + 'author_page', 'type', ); diff --git a/upload/includes/classes/swfObj.class.php b/upload/includes/classes/swfObj.class.php index e703b14f..6d5bedf9 100644 --- a/upload/includes/classes/swfObj.class.php +++ b/upload/includes/classes/swfObj.class.php @@ -11,16 +11,21 @@ class SWFObject { //var Code -var $objName = 'FlashObject'; -var $DivId = 'videoplayer'; +var $objName = 'SWFObject'; +var $DivId = 'videoPlayer'; var $code = ''; var $playerFile = ''; -var $width = '450'; -var $height = '378'; + var $PlayerVer = '7'; var $bgcolor = '#FFFFFF'; var $playerVar = 'player'; + function SWFObject() + { + $this->width = config('player_width'); + $this->height = config('player_height'); + } + //Function Used TO Create Player function CreatePlayer(){ $this->SelectPlayer(); @@ -88,9 +93,9 @@ var $playerVar = 'player'; } //function for Embed Code - function EmbedCode($code){ + function EmbedCode($code,$div){ $this->code = 'var EmbedCode="'.addslashes($code).'";'."\r\n"; - $this->code .= "innerHtmlDiv('".$this->DivId."',EmbedCode)"; + $this->code .= "innerHtmlDiv('".$div."',EmbedCode)"; } } diff --git a/upload/includes/classes/user.class.php b/upload/includes/classes/user.class.php index 116a0b7b..725a83c7 100644 --- a/upload/includes/classes/user.class.php +++ b/upload/includes/classes/user.class.php @@ -1169,6 +1169,16 @@ class userquery { }function get_user_fields($uid,$field){return $this->get_user_field($uid,$field);} + /** + * This function will return + * user field without array + */ + function get_user_field_only($uid,$field) + { + $fields = $this->get_user_field($uid,$field); + return $fields[$field]; + } + /** * Function used to get user level and its details * @param INT userid @@ -1430,5 +1440,15 @@ class userquery { { return $this->get_user_fields(user_id(),'username'); } + + /** + * Function used to create profile link + */ + function profile_link($udetails) + { + if(!is_array($udetails) && is_numeric($udetails)) + $udetails = $this->get_user_details($udetails); + return BASEURL.'/view_profile.php?uid='.$udetails['userid']; + } } ?> \ No newline at end of file diff --git a/upload/includes/classes/video.class.php b/upload/includes/classes/video.class.php index e5021215..e45dbbc5 100644 --- a/upload/includes/classes/video.class.php +++ b/upload/includes/classes/video.class.php @@ -18,6 +18,8 @@ class CBvideo extends CBCategory { + var $embed_func_list = array(); //Function list that are applied while asking for video embed code + /** * __Constructor of CBVideo */ @@ -350,6 +352,43 @@ class CBvideo extends CBCategory global $myquery; return $myquery->add_comment($comment,$obj_id,$reply_to,'v'); } + + + /** + * Function used to generate Embed Code + */ + function embed_code($vdetails) + { + //Checking for video details + if(!is_array($vdetails)) + { + $vdetails = $this->get_video($vdetails); + } + + $embed_code = false; + + $funcs = $this->embed_func_listl; + if(is_array($funcs)) + { + foreach($funcs as $func) + { + if(@function_exists($func)) + $embed_code = $func($vdetails); + } + } + + if(!$embed_code) + { + //Default ClipBucket Embed Code + if(function_exists('default_embed_code')) + { + $embed_code = default_embed_code($vdetails); + } + } + + return $embed_code; + + } } diff --git a/upload/includes/common.php b/upload/includes/common.php index bc324055..1ef1d7e2 100644 --- a/upload/includes/common.php +++ b/upload/includes/common.php @@ -62,6 +62,7 @@ if(file_exists(dirname(__FILE__).'/../install/isinstall.php')){ require_once('classes/image.class.php'); require_once('classes/category.class.php'); require_once('classes/video.class.php'); + require_once('classes/player.class.php'); require_once 'languages.php'; $pages = new pages(); @@ -82,9 +83,9 @@ if(file_exists(dirname(__FILE__).'/../install/isinstall.php')){ $lang_obj = new language; $sess = new Session(); $cblog = new CBLogs(); - $swfobj = new SWFObject(); $imgObj = new ResizeImage(); $cbvideo = $cbvid = new CBvideo(); + $cbplayer = new CBPlayer(); //Initializng Userquery class $userquery->init(); @@ -194,6 +195,7 @@ error_reporting(E_ALL ^ E_NOTICE ^E_DEPRECATED); define('SUBTITLE',$row['code_dev']); define('JSDIR','js'); //Javascript Directory Name define('ADMINDIR','admin_area'); //Admin Accissble Folder + define('ADMIN_BASEURL',BASEURL.'/'.ADMINDIR); define('MODULEDIR',BASEDIR.'/modules'); //Modules Directory //DIRECT PATHS OF VIDEO FILES @@ -266,8 +268,9 @@ error_reporting(E_ALL ^ E_NOTICE ^E_DEPRECATED); $cbtpl = new CBTemplate(); $cbobjects = new CBObjects(); - - $is_admin = $userquery->admin_check(); + $swfobj = new SWFObject(); + + $is_admin = $userquery->admin_check(); if ($is_admin == 1) { Assign('is_admin',$is_admin); @@ -364,6 +367,7 @@ $Smarty->assign_by_ref('lang_obj', $lang_obj); $Smarty->assign_by_ref('cbvid', $cbvid); $Smarty->assign_by_ref('cbtpl',$cbtpl); $Smarty->assign_by_ref('cbobjects',$cbobjects); +$Smarty->assign_by_ref('cbplayer',$cbplayer); /* REGISERTING FUNCTION FOR SMARTY TEMPLATES @@ -374,7 +378,7 @@ $Smarty->register_function('AD','getAd'); $Smarty->register_function('get_thumb','getSmartyThumb'); $Smarty->register_function('getThumb','getSmartyThumb'); $Smarty->register_function('videoLink','videoSmartyLink'); -$Smarty->register_function('pullRating','pullSmartyRating'); +$Smarty->register_function('show_rating','show_rating'); $Smarty->register_function('ANCHOR','ANCHOR'); $Smarty->register_function('FUNC','FUNC'); $Smarty->register_function('avatar','avatar'); @@ -383,6 +387,7 @@ $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'); +$Smarty->register_function('HQFlashPlayer','HQflashPlayer'); $Smarty->register_function('link','cblink'); $Smarty->register_modifier('SetTime','SetTime'); @@ -393,6 +398,7 @@ $Smarty->register_modifier('get_from_val','get_from_val'); $Smarty->register_modifier('post_form_val','post_form_val'); $Smarty->register_modifier('request_form_val','request_form_val'); $Smarty->register_modifier('get_thumb_num','get_thumb_num'); +$Smarty->register_modifier('ad','ad'); /* @@ -403,10 +409,5 @@ register_action_remove_video('remove_video_log'); register_action_remove_video('remove_video_files'); -/** - * Include ClipBucket's Default Player - */ -include(PLAYER_DIR.'/cbplayer/cbplayer.plug.php'); - include('admin.functions.php'); ?> \ No newline at end of file diff --git a/upload/includes/config.inc.php b/upload/includes/config.inc.php index 947783ba..2387b83d 100644 --- a/upload/includes/config.inc.php +++ b/upload/includes/config.inc.php @@ -2,6 +2,9 @@ /* Config.Inc.php */ +define("FRONT_END",TRUE); +define("BACK_END",FALSE); + include('common.php'); define('TEMPLATEDIR',BASEDIR.'/'.TEMPLATEFOLDER.'/'.TEMPLATE); @@ -40,7 +43,7 @@ if($row['closed'] == 1){ exit(); } } -$AdminArea = false; + include('plugins.php'); //Assigning JS Files diff --git a/upload/includes/functions.php b/upload/includes/functions.php index 5b4d7b3a..393dd0be 100644 --- a/upload/includes/functions.php +++ b/upload/includes/functions.php @@ -179,161 +179,6 @@ } } - // -------------RATING FUNCTION---------------- // - -function getRating($id){ - - $total = 0; - $rows = 0; - - $sel = mysql_query("SELECT * FROM video WHERE videoid = '$id'"); - if(mysql_num_rows($sel) > 0){ - $data = mysql_fetch_assoc($sel); - - //$newPerc = round($perc/5)*5; - //return $newPerc.'%'; - - $newPerc = round($data['rating']*10,2); - return $newPerc.'%'; - - } else { - - return '0%'; - - } -} - -function outOfFive($id){ - - $total = 0; - $rows = 0; - - $sel = mysql_query("SELECT * FROM video WHERE videoid = '$id'"); - if(mysql_num_rows($sel) > 0){ - $data = mysql_fetch_assoc($sel); - - return round($data['rating']/2,2); - //return round(($perc*2), 0)/2; // 3.5 - - } else { - - return '0'; - - } - - -} - -function getVotes($id){ - - $sel = mysql_query("SELECT * FROM video WHERE videoid = '$id'"); - $data = mysql_fetch_assoc($sel); - return $data['rated_by']; - -} - -function pullRating($id,$show5 = false, $showPerc = false, $showVotes = false, $static = NULL){ - global $row; - // Check if they have already voted... - $text = ''; - - $sel = mysql_query("SELECT * FROM video WHERE videoid = '$id'"); - $data = mysql_fetch_array($sel); - $voter_id = $data['voter_ids']; - @$userid = $_SESSION['userid']; - $niddle = "|"; - $niddle .= $userid; - $niddle .= "|"; - $flag = strstr($voter_id, $niddle); - if($row['user_rate_opt1'] !='yes'){ - if($data['username'] == $_SESSION['username']){ - $static = 'novote'; - } - } - if(!empty($flag) || $static == 'novote' || !isset($_SESSION['userid']) || isset($_COOKIE['has_voted_'.$id]) ){ - - - - if($show5 || $showPerc || $showVotes){ - - $text .= '
'; - - } - - if($show5){ - $text .= 'Rated '.outOfFive($id).'/5'; - } - if($showPerc){ - $text .= ' ('.getRating($id).')'; - } - if($showVotes){ - $text .= ' ('.getVotes($id).')'; - } - - if($show5 || $showPerc || $showVotes){ - - $text .= '
'; - - } - - - return $text.' - -
'; - - - } else { - - if($show5 || $showPerc || $showVotes){ - - $text .= '
'; - - } - if($show5){ - $show5bool = 'true'; - $text .= 'Rated '.outOfFive($id).'/5'; - } else { - $show5bool = 'false'; - } - if($showPerc){ - $showPercbool = 'true'; - $text .= ' ('.getRating($id).')'; - } else { - $showPercbool = 'false'; - } - if($showVotes){ - $showVotesbool = 'true'; - $text .= ' ('.getVotes($id).')'; - } else { - $showVotesbool = 'false'; - } - - if($show5 || $showPerc || $showVotes){ - - $text .= '
'; - - } - - return $text.' - -
'; - - } -} //Function Send Email @@ -389,38 +234,53 @@ function pullRating($id,$show5 = false, $showPerc = false, $showVotes = false, $ return substr($file, strrpos($file,'.') + 1); } -function SetTime($sec, $padHours = true) { - - $hms = ""; - - // there are 3600 seconds in an hour, so if we - // divide total seconds by 3600 and throw away - // the remainder, we've got the number of hours - $hours = intval(intval($sec) / 3600); - - // add to $hms, with a leading 0 if asked for - $hms .= ($padHours) - ? str_pad($hours, 2, "0", STR_PAD_LEFT). ':' - : $hours. ':'; - - // dividing the total seconds by 60 will give us - // the number of minutes, but we're interested in - // minutes past the hour: to get that, we need to - // divide by 60 again and keep the remainder - $minutes = intval(($sec / 60) % 60); - - // then add to $hms (with a leading 0 if needed) - $hms .= str_pad($minutes, 2, "0", STR_PAD_LEFT). ':'; - - // seconds are simple - just divide the total - // seconds by 60 and keep the remainder - $seconds = intval($sec % 60); - - // add to $hms, again with a leading 0 if needed - $hms .= str_pad($seconds, 2, "0", STR_PAD_LEFT); - - return $hms; -} + function old_set_time($temps) + { + round($temps); + $heures = floor($temps / 3600); + $minutes = round(floor(($temps - ($heures * 3600)) / 60)); + if ($minutes < 10) + $minutes = "0" . round($minutes); + $secondes = round($temps - ($heures * 3600) - ($minutes * 60)); + if ($secondes < 10) + $secondes = "0" . round($secondes); + return $minutes . ':' . $secondes; + } + function SetTime($sec, $padHours = true) { + + if($sec < 3600) + return old_set_time($sec); + + $hms = ""; + + // there are 3600 seconds in an hour, so if we + // divide total seconds by 3600 and throw away + // the remainder, we've got the number of hours + $hours = intval(intval($sec) / 3600); + + // add to $hms, with a leading 0 if asked for + $hms .= ($padHours) + ? str_pad($hours, 2, "0", STR_PAD_LEFT). ':' + : $hours. ':'; + + // dividing the total seconds by 60 will give us + // the number of minutes, but we're interested in + // minutes past the hour: to get that, we need to + // divide by 60 again and keep the remainder + $minutes = intval(($sec / 60) % 60); + + // then add to $hms (with a leading 0 if needed) + $hms .= str_pad($minutes, 2, "0", STR_PAD_LEFT). ':'; + + // seconds are simple - just divide the total + // seconds by 60 and keep the remainder + $seconds = intval($sec % 60); + + // add to $hms, again with a leading 0 if needed + $hms .= str_pad($seconds, 2, "0", STR_PAD_LEFT); + + return $hms; + } //Simple Validation function isValidText($text){ @@ -708,7 +568,12 @@ function SetTime($sec, $padHours = true) { function getAd($params,&$Smarty) { global $adsObj; - $data = $adsObj->getAd($params['place']); + $data = ''; + if($params['style'] || $params['class'] || $params['align']) + $data .= '
'; + $data .= ad($adsObj->getAd($params['place'])); + if($params['style'] || $params['class'] || $params['align']) + $data .= '
'; return $data; } @@ -1304,7 +1169,7 @@ function SetTime($sec, $padHours = true) { /** * Function use to get video files */ - function get_video_file($vdetails,$return_default=true,$with_path=true,$multi=false,$count_only=false) + function get_video_file($vdetails,$return_default=true,$with_path=true,$multi=false,$count_only=false,$hq=false) { # checking if there is any other functions # available @@ -1344,10 +1209,33 @@ function SetTime($sec, $padHours = true) { return $files; if($count_only) return count($files); + + foreach($files as $file) + { + if($hq) + { + if(getext($file)=='mp4') + { + return $file; + break; + } + }else{ + return $file; + break; + } + } return $files[0]; } } + /** + * FUnction used to get HQ ie mp4 video + */ + function get_hq_video_file($vdetails) + { + return get_video_file($vdetails,true,true,false,false,true); + } + /** * Function used to display flash player for ClipBucket video @@ -1356,6 +1244,8 @@ function SetTime($sec, $padHours = true) { { global $Cbucket,$swfobj; + $param['player_div'] = $param['player_div'] ? $param['player_div'] : 'videoPlayer'; + $key = $param['key']; $flv = $param['flv'].'.flv'; $code = $param['code']; @@ -1371,38 +1261,28 @@ function SetTime($sec, $padHours = true) { { if(function_exists($funcs)) { - $func_data = $funcs($param['vdetails']); + $func_data = $funcs($param); } if($func_data) return $func_data; } } - #checking video file - $file = get_video_file($param['vdetails']); - - - - //Getting Player - $player = get_player(); - $swfobj->playerFile = BASEURL.'/player/'.FLVPLAYER; - $swfobj->FlashObj(); - //Writing Param - $swfobj->addParam('allowfullscreen','true'); - $swfobj->addParam('allowscriptaccess','always'); - $swfobj->addParam('quality','high'); - $swfobj->addVar('baseurl',BASEURL); - $swfobj->addVar('video',get_video_file($param['vdetails'],false,true)); - - if(!empty($flv_url) && GetExt($flv_url)=='flv'){ - $swfobj->addVar('file_url',urldecode($flv_url)); - }else{ - $swfobj->addVar('file_url',$file ); - } - $swfobj->CreatePlayer(); - return $swfobj->code; + if(function_exists('cbplayer')) + return cbplayer($param,true); + return blank_screen($param); } + + /** + * FUnctiuon used to plya HQ videos + */ + function HQflashPlayer($param,&$Smarty) + { + return flashPlayer($param,&$Smarty); + } + + /** * Function used to get player from website settings */ @@ -1635,17 +1515,17 @@ function SetTime($sec, $padHours = true) { } } - $count = 1; - if(is_array($cat_array)) + $count = 1; + if(is_array($cat_array)) + { + foreach($cat_array as $cat) { - foreach($cat_array as $cat) - { - echo ''.$cat[1].''; - if($count!=count($cat_array)) - echo ', '; - $count++; - } + echo ''.$cat[1].''; + if($count!=count($cat_array)) + echo ', '; + $count++; } + } } @@ -2015,4 +1895,130 @@ function SetTime($sec, $padHours = true) { return $cats; } + + + /** + * Function used to show rating + * @inputs + * class : class used to show rating usually rating_stars + * rating : rating of video or something + * ratings : number of rating + * total : total rating or out of + */ + function show_rating($params,&$Smarty) + { + $class = $params['class'] ? $params['class'] : 'rating_stars'; + $rating = $params['rating']; + $ratings = $params['ratings']; + $total = $params['total']; + + //Checking Percent + if($rating<=0) + $perc = '0'; + else + { + if($total<=1) + $total = 1; + $perc = $rating*100/$total; + } + + $perc = $perc.'%'; + + $rating = '
+
+
 
+
+
+
'; + return $rating; + } + + + /** + * Function used to display + * Blank Screen + * if there is nothing to play or to show + * then who a blank screen + */ + function blank_screen($data) + { + global $swfobj; + $code = '
No Player or Video File Found - Unable to Play Any Video
'; + $swfobj->EmbedCode(unhtmlentities($code),$data['player_div']); + return $swfobj->code; + } + + + /** + * Function used to check weather video has Mp4 file or not + */ + function has_hq($vdetails) + { + $file = get_hq_video_file($vdetails); + if(getext($file)=='mp4') + return $file; + else + return false; + } + + /** + * Function used to display an ad + */ + function ad($in) + { + return stripslashes(htmlspecialchars_decode($in)); + } + + + /** + * Function used to get + * available function list + * for special place , read docs.clip-bucket.com + */ + function get_functions($name) + { + global $Cbucket; + $funcs = $CBucket->get_functions; + if(is_array($funcs) && count($funcs)>0) + return $funcs; + else + return false; + } + + + /** + * Function used to add js in ClipBuckets JSArray + * see docs.clip-bucket.com + */ + function add_js($files) + { + global $Cbucket; + return $Cbucket->addJS($files); + } + + /** + * Function add_header() + * this will be used to add new files in header array + * this is basically for plugins + * for specific page array('page'=>'file') + * ie array('uploadactive'=>'datepicker.js') + */ + function add_header($files) + { + global $Cbucket; + return $Cbucket->add_header($files); + } + + + /** + * Function used to get config value + * of ClipBucket + */ + function config($input) + { + global $Cbucket; + return $Cbucket->configs[$input]; + } + function get_config($input){ return config($input); } + ?> \ No newline at end of file diff --git a/upload/includes/plugin.functions.php b/upload/includes/plugin.functions.php index 2e5dd805..5302faaa 100644 --- a/upload/includes/plugin.functions.php +++ b/upload/includes/plugin.functions.php @@ -73,7 +73,12 @@ foreach($funcs as $func) { if(function_exists($func)) - $func(); + { + if($params['data']) + $func($params['data']); + else + $func(); + } } }else{ $funcs(); diff --git a/upload/includes/plugins.php b/upload/includes/plugins.php index 91fe4291..2749bbf2 100644 --- a/upload/includes/plugins.php +++ b/upload/includes/plugins.php @@ -7,47 +7,43 @@ Simple Plugin System //Getting Plugin Config Details $plug_row = $myquery->Get_Plugin_Details(); -if(!$AdminArea){ - -$pluginQueryNA = mysql_query("SELECT * FROM plugins WHERE plugin_active ='yes'"); -$total_plugins = mysql_num_rows($pluginQueryNA); -while($pluginDataNa = mysql_fetch_array($pluginQueryNA)){ - - if($pluginDataNa['plugin_folder']) - $folder = $pluginDataNa['plugin_folder'].'/'; - else - $folder = ''; - if(file_exists(BASEDIR.'/plugins/'.$folder.$pluginDataNa['plugin_file']) - && !empty($pluginDataNa['plugin_file'])) - { - include(BASEDIR.'/plugins/'.$folder.$pluginDataNa['plugin_file']); - $plugin_list[] = $pluginDataNa; - } +if(FRONT_END){ + $installed_plugins = $cbplugin->getInstalledPlugins(); + foreach($installed_plugins as $plugin) + { + if($plugin['folder']) + $folder = '/'.$plugin['folder']; + $file = PLUG_DIR.$folder.'/'.$plugin['file']; + if(file_exists($file)) + include_once($file); } -}else{ -$pluginQueryA = mysql_query("SELECT * FROM plugins"); -$total_plugins = mysql_num_rows($pluginQueryA); -if($total_plugins > 0) -{ -while($pluginDataA = mysql_fetch_array($pluginQueryA)){ - - if($pluginDataA['plugin_folder']) - $folder = $pluginDataA['plugin_folder'].'/'; - else - $folder = ''; - - if(file_exists(BASEDIR.'/plugins/'.$folder.$pluginDataA['plugin_file']) - && !empty($pluginDataA['plugin_file'])) - include(BASEDIR.'/plugins/'.$folder.$pluginDataA['plugin_file']); - //$plugin_list[] = $pluginDataA; - $plugin_list[] = $pluginDataA; - } - Assign('plugin_list',$plugin_list); -} } -$cbplugin = new CBPlugin(); -$cbplugin->getPlugins(); +if(BACK_END) +{ + $plugin_list = $cbplugin->getPluginList(); + foreach($plugin_list as $plugin) + { + if($plugin['folder']) + $folder = '/'.$plugin['folder']; + $file = PLUG_DIR.$folder.'/'.$plugin['file']; + if(file_exists($file)) + include_once($file); + } +} + +/** + * Include ClipBucket Player + */ + +if($Cbucket->configs['player_file'] !='cbplayer.plug.php' && $Cbucket->configs['player_file'] !='') +{ + if($Cbucket->configs['player_dir']) + $folder = '/'.$Cbucket->configs['player_dir'] ; + $file = PLAYER_DIR.$folder.'/'.$Cbucket->configs['player_file'] ; + if(file_exists($file)) + include_once($file); +} +include_once(PLAYER_DIR.'/cbplayer/cbplayer.plug.php'); -Assign('total_plugins',$total_plugins); ?> \ No newline at end of file diff --git a/upload/js/ajax.js b/upload/js/ajax.js deleted file mode 100644 index 096a0069..00000000 --- a/upload/js/ajax.js +++ /dev/null @@ -1,25 +0,0 @@ - var AjaxObject = false; - if(num){ - }else{ - var num = 1; - } - - if(window.XMLHttpRequest){ - AjaxObject = new XMLHttpRequest(); - }else if(window.ActiveXObject){ - AjaxObject = new ActiveXObject('Microsoft.XMLHTTP'); - } - - function GetPageResults(URL,DIV){ - var ResultConatiner = document.getElementById(DIV); - AjaxObject.open("GET",URL); - AjaxObject.onreadystatechange = function(){ - if(AjaxObject.readyState == 4 && AjaxObject.status == 200){ - ResultConatiner.innerHTML = AjaxObject.responseText; - }else{ - ResultConatiner.innerHTML = "Loading... "; - } - } - - AjaxObject.send(null); - } \ No newline at end of file diff --git a/upload/js/ajaxtabs.js b/upload/js/ajaxtabs.js deleted file mode 100644 index 8e458064..00000000 --- a/upload/js/ajaxtabs.js +++ /dev/null @@ -1,134 +0,0 @@ -var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no) -var loadstatustext=" Loading" -var enabletabpersistence=1 //enable tab persistence via session only cookies, so selected tab is remembered (1=yes, 0=no)? - -////NO NEED TO EDIT BELOW//////////////////////// -var loadedobjects="" -var defaultcontentarray=new Object() -var bustcacheparameter="" - -function ajaxpage(url, containerid, targetobj){ -var page_request = false -if (window.XMLHttpRequest) // if Mozilla, IE7, Safari etc -page_request = new XMLHttpRequest() -else if (window.ActiveXObject){ // if IE -try { -page_request = new ActiveXObject("Msxml2.XMLHTTP") -} -catch (e){ -try{ -page_request = new ActiveXObject("Microsoft.XMLHTTP") -} -catch (e){} -} -} -else -return false -var ullist=targetobj.parentNode.parentNode.getElementsByTagName("li") -for (var i=0; i-1){return true;}else{return YAHOO.lang.isObject(obj)&&obj.constructor==Array;}},isBoolean:function(obj){return typeof obj=='boolean';},isFunction:function(obj){return typeof obj=='function';},isNull:function(obj){return obj===null;},isNumber:function(obj){return typeof obj=='number'&&isFinite(obj);},isObject:function(obj){return obj&&(typeof obj=='object'||YAHOO.lang.isFunction(obj));},isString:function(obj){return typeof obj=='string';},isUndefined:function(obj){return typeof obj=='undefined';},hasOwnProperty:function(obj,prop){if(Object.prototype.hasOwnProperty){return obj.hasOwnProperty(prop);} -return!YAHOO.lang.isUndefined(obj[prop])&&obj.constructor.prototype[prop]!==obj[prop];},extend:function(subc,superc,overrides){if(!superc||!subc){throw new Error("YAHOO.lang.extend failed, please check that "+"all dependencies are included.");} -var F=function(){};F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=superc;} -if(overrides){for(var i in overrides){subc.prototype[i]=overrides[i];}}},augment:function(r,s){if(!s||!r){throw new Error("YAHOO.lang.augment failed, please check that "+"all dependencies are included.");} -var rp=r.prototype,sp=s.prototype,a=arguments,i,p;if(a[2]){for(i=2;i-1),isSafari=(ua.indexOf('safari')>-1),isGecko=(!isOpera&&!isSafari&&ua.indexOf('gecko')>-1),isIE=(!isOpera&&ua.indexOf('msie')>-1);var patterns={HYPHEN:/(-[a-z])/i,ROOT_TAG:/body|html/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;} -if(propertyCache[property]){return propertyCache[property];} -var converted=property;while(patterns.HYPHEN.exec(converted)){converted=converted.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());} -propertyCache[property]=converted;return converted;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;if(property=='float'){property='cssFloat';} -var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)];} -return el.style[property]||value;};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}} -return val/100;break;case'float':property='styleFloat';default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value);}};}else{getStyle=function(el,property){return el.style[property];};} -if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(YAHOO.lang.isString(el.style.filter)){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}} -break;case'float':property='styleFloat';default:el.style[property]=val;}};}else{setStyle=function(el,property,val){if(property=='float'){property='cssFloat';} -el.style[property]=val;};} -YAHOO.util.Dom={get:function(el){if(YAHOO.lang.isString(el)){return document.getElementById(el);} -if(YAHOO.lang.isArray(el)){var c=[];for(var i=0,len=el.length;i=this.left&®ion.right<=this.right&®ion.top>=this.top&®ion.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(x instanceof Array){y=x[1];x=x[0];} -this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.2.2",build:"204"}); -YAHOO.util.CustomEvent=function(type,oScope,silent,signature){this.type=type;this.scope=oScope||window;this.silent=silent;this.signature=signature||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){} -var onsubscribeType="_YUICEOnSubscribe";if(type!==onsubscribeType){this.subscribeEvent=new YAHOO.util.CustomEvent(onsubscribeType,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,override){if(!fn){throw new Error("Invalid callback for subscriber to '"+this.type+"'");} -if(this.subscribeEvent){this.subscribeEvent.fire(fn,obj,override);} -this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,override));},unsubscribe:function(fn,obj){if(!fn){return this.unsubscribeAll();} -var found=false;for(var i=0,len=this.subscribers.length;i0){param=args[0];} -ret=s.fn.call(scope,param,s.obj);}else{ret=s.fn.call(scope,this.type,args,s.obj);} -if(false===ret){if(!this.silent){} -return false;}}} -return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i=0){cacheItem=listeners[index];} -if(!el||!cacheItem){return false;} -if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);var llist=legacyHandlers[legacyIndex];if(llist){for(i=0,len=llist.length;i0);} -var notAvail=[];var executeItem=function(el,item){var scope=el;if(item.override){if(item.override===true){scope=item.obj;}else{scope=item.override;}} -item.fn.call(scope,item.obj);};var i,len,item,el;for(i=0,len=onAvailStack.length;i0){for(var i=0,len=searchList.length;i0){j=listeners.length;while(j){index=j-1;l=listeners[index];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],index);} -j=j-1;} -l=null;EU.clearCache();} -for(i=0,len=legacyEvents.length;i');var el=document.getElementById("_yui_eu_dr");el.onreadystatechange=function(){if("complete"==this.readyState){this.parentNode.removeChild(this);YAHOO.util.Event._ready();}};el=null;YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);}else if(EU.webkit){EU._drwatch=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._drwatch);EU._drwatch=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);} -EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();} -YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(p_type,p_fn,p_obj,p_override){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){ce.subscribe(p_fn,p_obj,p_override);}else{this.__yui_subscribers=this.__yui_subscribers||{};var subs=this.__yui_subscribers;if(!subs[p_type]){subs[p_type]=[];} -subs[p_type].push({fn:p_fn,obj:p_obj,override:p_override});}},unsubscribe:function(p_type,p_fn,p_obj){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){return ce.unsubscribe(p_fn,p_obj);}else{return false;}},unsubscribeAll:function(p_type){return this.unsubscribe(p_type);},createEvent:function(p_type,p_config){this.__yui_events=this.__yui_events||{};var opts=p_config||{};var events=this.__yui_events;if(events[p_type]){}else{var scope=opts.scope||this;var silent=opts.silent||null;var ce=new YAHOO.util.CustomEvent(p_type,scope,silent,YAHOO.util.CustomEvent.FLAT);events[p_type]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);} -this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[p_type];if(qs){for(var i=0;i«\n' - for (var i=0; i'+(i+1)+'\n' - } - paginateHTML+='
  • next »
  • \n' - paginateHTML+='' - }// end construction - for (var i=0; i0 && chunksize