diff --git a/upload/actions/edit_comment.php b/upload/actions/edit_comment.php new file mode 100644 index 00000000..bfd0c310 --- /dev/null +++ b/upload/actions/edit_comment.php @@ -0,0 +1,20 @@ +admin_login_check(); + +$cid = $_POST['id']; +$value = $_POST['value']; + +$myquery->update_comment($cid,$value); + +echo mysql_clean($value); +?> diff --git a/upload/actions/video_convert.php b/upload/actions/video_convert.php index 78de877f..ef8afadc 100644 --- a/upload/actions/video_convert.php +++ b/upload/actions/video_convert.php @@ -28,30 +28,33 @@ $orig_file = CON_DIR.'/'.$tmp_file.'.'.$ext; //rcopy($temp_file,$orig_file); rename($temp_file,$orig_file); - - $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'=>64000, - 'video_bitrate'=>500000, - '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' + ); + $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->remove_input=FALSE; $ffmpeg->ClipBucket(); + exit(); $db->update("conversion_queue", array("cqueue_conversion"), array("yes")," cqueue_id = '".$queue_details['cqueue_id']."'"); diff --git a/upload/admin_area/edit_member.php b/upload/admin_area/edit_member.php index aea1f2c7..9bd18805 100644 --- a/upload/admin_area/edit_member.php +++ b/upload/admin_area/edit_member.php @@ -29,19 +29,19 @@ $user = mysql_clean(@$_GET['userid']); } //Get User Details $data = $userquery->GetUserData($user); - DoTemplate::assign('data',$data); + CBTemplate::assign('data',$data); }else{ $msg[] = "User Doesn't Exist"; } //Assing Template -DoTemplate::assign('country',$signup->country()); -DoTemplate::assign('msg',@$msg); -DoTemplate::display(LAYOUT.'/header.html'); -DoTemplate::display(LAYOUT.'/leftmenu.html'); -DoTemplate::display(LAYOUT.'/message.html'); -DoTemplate::display(LAYOUT.'/edit_member.html'); -DoTemplate::display(LAYOUT.'/footer.html'); +CBTemplate::assign('country',$signup->country()); +CBTemplate::assign('msg',@$msg); +CBTemplate::display(LAYOUT.'/header.html'); +CBTemplate::display(LAYOUT.'/leftmenu.html'); +CBTemplate::display(LAYOUT.'/message.html'); +CBTemplate::display(LAYOUT.'/edit_member.html'); +CBTemplate::display(LAYOUT.'/footer.html'); ?> \ No newline at end of file diff --git a/upload/admin_area/groups_manager.php b/upload/admin_area/groups_manager.php index 1ef48053..68eb5f03 100644 --- a/upload/admin_area/groups_manager.php +++ b/upload/admin_area/groups_manager.php @@ -109,7 +109,7 @@ if(isset($_POST['delete_selected'])){ 'search_order' => mysql_clean($_GET['order']) ); while(list($name,$value) = each($values_search)){ - DoTemplate::assign($name,$value); + CBTemplate::assign($name,$value); } diff --git a/upload/admin_area/mass_uploader.php b/upload/admin_area/mass_uploader.php index 6b10ad08..0e78e912 100644 --- a/upload/admin_area/mass_uploader.php +++ b/upload/admin_area/mass_uploader.php @@ -65,7 +65,7 @@ if(isset($_POST['upload_01'])){ 'default_date' => $_POST['year'].'-'.$_POST['month'].'-'.$_POST['day'] ); while(list($name,$value) = each($values)){ - DoTemplate::assign($name,$value); + CBTemplate::assign($name,$value); } for($id=0;$id<=3;$id++){ diff --git a/upload/admin_area/members.php b/upload/admin_area/members.php index 712ff9ec..534d5119 100644 --- a/upload/admin_area/members.php +++ b/upload/admin_area/members.php @@ -31,7 +31,7 @@ $view = clean(@$_GET['view']); if(empty($view)){ $view = 'showall'; } while(list($property['value'],$property['name']) = each($property_values)){ if($property['value'] == $view){ - DoTemplate::assign("property",$property); + CBTemplate::assign("property",$property); } } @@ -179,7 +179,7 @@ if(isset($_GET['unban'])){ 'default_zip' => mysql_clean($_POST['zip']) ); while(list($name,$value) = each($values)){ - DoTemplate::assign($name,$value); + CBTemplate::assign($name,$value); } @$values_search= array( @@ -193,7 +193,7 @@ if(isset($_GET['unban'])){ 'search_order' => mysql_clean($_GET['order']) ); while(list($name,$value) = each($values_search)){ - DoTemplate::assign($name,$value); + CBTemplate::assign($name,$value); } //Jump To The page diff --git a/upload/admin_area/styles/cbadmin/layout/blocks/comments.html b/upload/admin_area/styles/cbadmin/layout/blocks/comments.html index 5136e560..e4b84e02 100644 --- a/upload/admin_area/styles/cbadmin/layout/blocks/comments.html +++ b/upload/admin_area/styles/cbadmin/layout/blocks/comments.html @@ -3,8 +3,10 @@ - - + + + + @@ -16,11 +18,13 @@ {foreach from=$myquery->get_comments($id,$type) item=comment} {if $comment.parent_id == 0} - + {if $comment.userid !='' }{assign var="udetails" value=$userquery->get_user_details($comment.userid)}{/if} - + + + @@ -29,10 +33,13 @@ {foreach from=$myquery->get_comments($id,$type,false,$comment.comment_id,TRUE) item=reply} {if $reply.comment !=''} + {if $reply.userid !='' }{assign var="udetails" value=$userquery->get_user_details($reply.userid)}{/if} - + + + @@ -50,7 +57,7 @@ {/foreach} {else} - + {/if}
CIDUID
Comment
UIDUsernameEmail
Comment
Date Votes  
{$comment.comment_id} {$comment.userid}{$comment.comment}{if $comment.anonym_name}{$comment.anonym_name}{else}{$udetails.username}{/if}{if $comment.anonym_email}{$comment.anonym_email}{else}{$udetails.email}{/if}
{$comment.comment}
{$comment.date_added|date_format} {$comment.vote} Delete
{$reply.comment_id} {$reply.userid}{$comment.comment_id} ⇔ {$reply.comment}{if $reply.anonym_name}{$reply.anonym_name}{else}{$udetails.username}{/if}{if $reply.anonym_email}{$reply.anonym_email}{else}{$udetails.email}{/if}
{$comment.comment_id} ⇔ {$reply.comment}
{$reply.date_added|date_format} {$reply.vote} Delete
No User Comments For This VideoNo User Comments For This Video
diff --git a/upload/admin_area/styles/cbadmin/layout/edit_announcemnent.html b/upload/admin_area/styles/cbadmin/layout/edit_announcemnent.html new file mode 100644 index 00000000..ff330b82 --- /dev/null +++ b/upload/admin_area/styles/cbadmin/layout/edit_announcemnent.html @@ -0,0 +1,13 @@ +

Edit Announcement

+ + + + +
+
+ Announcement
+ + +
+ +
diff --git a/upload/admin_area/styles/cbadmin/layout/global_header.html b/upload/admin_area/styles/cbadmin/layout/global_header.html index d2dadf0c..30f31639 100644 --- a/upload/admin_area/styles/cbadmin/layout/global_header.html +++ b/upload/admin_area/styles/cbadmin/layout/global_header.html @@ -54,7 +54,16 @@ var baseurl = "{$baseurl}"; } $(document).ready(function() { - $('.edit').editable(baseurl+'/actions/update_phrase.php', { + $('.edit_lang').editable(baseurl+'/actions/update_phrase.php', { + // cancel : 'Cancel', + // submit : 'OK', + indicator : '', + tooltip : 'Click to edit...', + }); + }); + + $(document).ready(function() { + $('.edit_comment').editable(baseurl+'/actions/edit_comment.php', { // cancel : 'Cancel', // submit : 'OK', indicator : '', diff --git a/upload/admin_area/styles/cbadmin/layout/language_settings.html b/upload/admin_area/styles/cbadmin/layout/language_settings.html index 6dfa249b..aab010cc 100644 --- a/upload/admin_area/styles/cbadmin/layout/language_settings.html +++ b/upload/admin_area/styles/cbadmin/layout/language_settings.html @@ -67,7 +67,7 @@ {$lang_phrases[p_list].id} {$lang_phrases[p_list].varname} -
{$lang_phrases[p_list].text}
+
{$lang_phrases[p_list].text}
diff --git a/upload/admin_area/styles/cbadmin/layout/templates.html b/upload/admin_area/styles/cbadmin/layout/templates.html new file mode 100644 index 00000000..34ac27f3 --- /dev/null +++ b/upload/admin_area/styles/cbadmin/layout/templates.html @@ -0,0 +1,39 @@ +
Selected Template
+
+{assign var="selected" value=$Cbucket->configs.template_dir} +{assign var="curtpl" value=$cbtpl->get_template_details($selected)} + + + + + +

{$curtpl.name}

{$curtpl.author}
+{$curtpl.description}
+Version : {$curtpl.version} Released on {$curtpl.released|date_format}
+Website : {$curtpl.website.title}
+ + +
+ +
+ +
Available Templates
+ +{* Listing All Avilable Templates *} + +{assign var='templates' value=$cbtpl->get_templates()} + +
+{foreach from=$templates item=template} +{if $selected != $template.dir} +
+ +
+ {$template.name}
by {$template.author}
+ Activate This Template
+ Preview
+ Preview & Activate
+
+{/if} +{/foreach} +
\ No newline at end of file diff --git a/upload/admin_area/styles/cbadmin/layout/upload_thumbs.html b/upload/admin_area/styles/cbadmin/layout/upload_thumbs.html new file mode 100644 index 00000000..6e894b44 --- /dev/null +++ b/upload/admin_area/styles/cbadmin/layout/upload_thumbs.html @@ -0,0 +1,33 @@ +{if $data.title neq ""} +

Manage Video Thumbs

+
+ « Back to Edit Details | Regenerate Thumbs
+
+ {assign var=vidthumbs value=func->get_thumb($data,1,TRUE)} + + {foreach from=$vidthumbs item=vid_thumb} +
+
+ {if $vid_thumb|getname!='processing'} + Delete + {/if} +
+ {/foreach} +

+
+
+ +
+
+

Upload New Thumb

+
+ Insert More
+
+ + +
+

+ + +
+{/if} \ No newline at end of file diff --git a/upload/admin_area/styles/cbadmin/layout/user_levels.html b/upload/admin_area/styles/cbadmin/layout/user_levels.html new file mode 100644 index 00000000..0729394b --- /dev/null +++ b/upload/admin_area/styles/cbadmin/layout/user_levels.html @@ -0,0 +1,104 @@ + +

User Levels

+ + +{if $view=='view'} + +Add New Level + + + + + + + + + + {assign var=levels value=$userquery->get_levels()} + {section name=l loop=$levels} + + + + + + + + {sectionelse} + + + + {/section} +
IDNameActiveUsersActions
{$levels[l].user_level_id}{$levels[l].user_level_name}{$levels[l].user_level_active}{$userquery->get_level_users($levels[l].user_level_id,true)}Edit{if $levels[l].user_level_is_default !=yes} | Remove{/if}
No Levels Were Found
+ +{elseif $view=='edit'} +
+ + + + +
Edit Level
+ + + + + +{foreach from=$userquery->access_type_list key=access item=name} + + + + +{/foreach} +
Level Name +
{$name} + + +
+ + + + +
+
+
+{elseif $view=='add'} +
+ + + + +
ADD Level
+ + + + + +{foreach from=$userquery->access_type_list key=access item=name} + + + + +{/foreach} +
Level Name + + + +
{$name} + + +
+ + + + +
+
+
+{/if} \ No newline at end of file diff --git a/upload/admin_area/styles/cbadmin/layout/view_video.html b/upload/admin_area/styles/cbadmin/layout/view_video.html index 6c755dec..49dbd4ba 100644 --- a/upload/admin_area/styles/cbadmin/layout/view_video.html +++ b/upload/admin_area/styles/cbadmin/layout/view_video.html @@ -195,3 +195,5 @@ {assign var=id value=$data.videoid}{include file="$style_dir/blocks/comments.html" type=v id=$data.videoid link="video=$id"} +
+
diff --git a/upload/admin_area/styles/cbadmin/theme/stylesheet.css b/upload/admin_area/styles/cbadmin/theme/stylesheet.css index 707a50fa..bac398d8 100644 --- a/upload/admin_area/styles/cbadmin/theme/stylesheet.css +++ b/upload/admin_area/styles/cbadmin/theme/stylesheet.css @@ -120,4 +120,12 @@ padding-left:5px; font-size:16px; font-weight:bold; font-family:Arial, Helvetica .item_listing td{border-bottom:1px solid #ccc} .item_listing li{list-style:none} -.item_listing a{color:#0c4469; font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; font-style:italic} \ No newline at end of file +.item_listing a{color:#0c4469; font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; font-style:italic} + +.templates_container +{ + font-size:11px; color:#333; +} +.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 diff --git a/upload/admin_area/templates.php b/upload/admin_area/templates.php index 01b6d3d3..fa9aa8cb 100644 --- a/upload/admin_area/templates.php +++ b/upload/admin_area/templates.php @@ -8,67 +8,13 @@ */ require_once '../includes/admin_config.php'; -$userquery->admin_login_check(); -//$pages->page_redir(); +$pages->page_redir(); +$userquery->login_check('admin_access'); -//Getting And Listing Files -if(!file_exists(BASEDIR.'/'.TEMPLATEFOLDER.'/'.@$_GET['temp']) || @$_GET['temp']==''){ -$dir = SITETEMPLATEDIR.'/layout/'; -$cur_dir = TEMPLATE; -}else{ -$dir = BASEDIR.'/'.TEMPLATEFOLDER.'/'.$_GET['temp'].'/layout/'; -$cur_dir = $_GET['temp']; +if($_GET['change']) +{ + $myquery->set_template($_GET['change']); } -if(!($dp = opendir($dir))) die("Cannot open $dir."); -while($file = readdir($dp)){ -$ext = GetExt($file); -if($ext == 'html' || $ext == 'HTML'){ -$files[] = $file; -} -} -closedir($dp -); -sort($files); -Assign('files',$files); - -//Writng File -if(isset($_POST['save'])){ - $file = $dir.$_POST['file']; - $data = stripslashes($_POST['data']); - $open_file = fopen($file, "w"); - fwrite($open_file, $data); - $msg = $_POST['file']." Has Been Saved And Updated"; -} - -//Getting Data from File -if(isset($_POST['file'])){ -$file = $dir.$_POST['file']; -$_file = $_POST['file']; -}else{ -$file = $dir.$files[0]; -$_file = $files[0]; -} -$open_file = fopen($file, "r"); -$data = htmlentities(file_get_contents($file)); - -//Getting Template List -$query = "SELECT * FROM template ORDER by template_name"; -$TmpExe = $db->Execute($query); -$Temps = $TmpExe->getrows(); -Assign('Temps',$Temps); - -//Checking Which Template Currently Using -$query = mysql_query("SELECT template_name,template_dir FROM template WHERE template_dir='".mysql_clean($cur_dir)."'"); -$TempArr = mysql_fetch_assoc($query); - -Assign('CurTemplate',$TempArr['template_name']); -Assign('CurDir',$TempArr['template_dir']); -Assign('data',$data); -Assign('file',$_file); - -Assign('msg',@$msg); -Template('header.html'); -Template('leftmenu.html'); -Template('templates.html'); -Template('footer.html'); +template_files('templates.html'); +display_it(); ?> \ No newline at end of file diff --git a/upload/favicon.ico b/upload/favicon.ico index 9d50d311..8f48c65f 100644 Binary files a/upload/favicon.ico and b/upload/favicon.ico differ diff --git a/upload/images/icons/no_thumb.png b/upload/images/icons/no_thumb.png new file mode 100644 index 00000000..336f3ada Binary files /dev/null and b/upload/images/icons/no_thumb.png differ diff --git a/upload/includes/admin.functions.php b/upload/includes/admin.functions.php new file mode 100644 index 00000000..b3b2e931 --- /dev/null +++ b/upload/includes/admin.functions.php @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/upload/includes/classes/ClipBucket.class.php b/upload/includes/classes/ClipBucket.class.php index f8f4023a..600791d7 100644 --- a/upload/includes/classes/ClipBucket.class.php +++ b/upload/includes/classes/ClipBucket.class.php @@ -25,6 +25,8 @@ class ClipBucket var $temp_exts = array(); //Temp extensions var $actions_play_video = array(); var $template_files = array(); + var $cur_template = 'clipbucketblue'; + var $links = array(); function ClipBucket () { @@ -46,6 +48,7 @@ class ClipBucket 'checkall.js' => 'global', 'redir.js' => 'global', 'functions.js' => 'global', + 'swfobject.js' => 'global', )); //This is used to create Admin Menu @@ -66,7 +69,8 @@ class ClipBucket ) ); - $this->temp_exts = array('ahz','jhz','abc','xyz','cb2','tmp','olo'); + $this->temp_exts = array('ahz','jhz','abc','xyz','cb2','tmp','olo','oar','oz','luffy','zoro','nami','chopper','ussop','sanji'); + $this->template = $this->configs['template_dir']; } @@ -290,6 +294,39 @@ class ClipBucket { $this->show_page = $val; } + + + /** + * Function used to set template (Frontend) + */ + function set_the_template() + { + global $cbtpl,$myquery; + $template = $this->template; + + if($_GET['template']) + { + if(is_dir(STYLES_DIR.'/'.$_GET['template']) && $_GET['template']) + $template = $_GET['template']; + } + if(!is_dir(STYLES_DIR.'/'.$template) || !$template) + $template = 'clipbucketblue'; + 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 ClipBucket Support!"); + + + if($_GET['set_template']) + { + $myquery->set_template($template); + } + + define('TEMPLATE',$template); + } } ?> \ No newline at end of file diff --git a/upload/includes/classes/category.class.php b/upload/includes/classes/category.class.php index 19b7f6d2..12d7c8ae 100644 --- a/upload/includes/classes/category.class.php +++ b/upload/includes/classes/category.class.php @@ -5,8 +5,8 @@ * This class is used to create * and manage categories * its an abstract class - * it will be used in plugins or built-in - * sections to use category system like videos, groups , channels etc + * it will be used in custom plugins or built-in plugins + * sections also use category system like videos, groups , channels etc * * this abstract class has some rules * each section's category column should be named as "category" diff --git a/upload/includes/classes/conversion/ffmpeg.win32.php b/upload/includes/classes/conversion/ffmpeg.win32.php index 2ed2e8aa..62d6fe18 100644 --- a/upload/includes/classes/conversion/ffmpeg.win32.php +++ b/upload/includes/classes/conversion/ffmpeg.win32.php @@ -26,6 +26,7 @@ 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; @@ -168,11 +169,36 @@ class ffmpeg $opt_av .= " -map_meta_data ".$this->output_file.":".$this->input_file; - $command = $this->ffmpeg." -i ".$this->input_file." $opt_av ".$this->output_file." 2> ".TEMP_DIR."/output.tmp "; + if(!$this->two_pass) + $command = $this->ffmpeg." -i ".$this->input_file." $opt_av ".$this->output_file." 2> ".TEMP_DIR."/output.tmp "; + else + { + + $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 "; + $output = $this->exec($command); + if(file_exists(TEMP_DIR.'/output.tmp')) + { + $output = $output ? $output : join("", file(TEMP_DIR.'/output.tmp')); + unlink(TEMP_DIR.'/output.tmp'); + } + + $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 "; + } + $output = $this->exec($command); - $output = $output ? $output : join("", file(TEMP_DIR.'/output.tmp')); if(file_exists(TEMP_DIR.'/output.tmp')) + { + $output = $output ? $output : join("", file(TEMP_DIR.'/output.tmp')); unlink(TEMP_DIR.'/output.tmp'); + } + $this->log('Conversion Command',$command); $this->log .="\r\n\r\nConversion Details\r\n\r\n"; $this->log .=$output; @@ -207,7 +233,7 @@ class ffmpeg $info['path'] = $path_source; # get the file size - $stats = stat( $path_source ); + $stats = @stat( $path_source ); if( $stats === false ) $this->log .= "Failed to stat file $path_source!\n"; $info['size'] = (integer)$stats['size']; diff --git a/upload/includes/classes/my_queries.class.php b/upload/includes/classes/my_queries.class.php index af1ea276..748bd204 100644 --- a/upload/includes/classes/my_queries.class.php +++ b/upload/includes/classes/my_queries.class.php @@ -20,8 +20,9 @@ class myquery { function Set_Website_Details($name,$value){ //mysql_query("UPDATE config SET value = '".$value."' WHERE name ='".$name."'"); - global $db; + global $db,$Cbucket; $db->update("config",array('value'),array($value)," name = '".$name."'"); + $Cbucket->configs = $Cbucket->get_configs(); } //Updating Plugin Details @@ -1164,7 +1165,7 @@ class myquery { */ function add_comment($comment,$obj_id,$reply_to=NULL,$type='v') { - global $userquery,$eh,$db; + global $userquery,$eh,$db,$Cbucket; //Checking maximum comments characters allowed if(defined("MAX_COMMENT_CHR")) { @@ -1187,15 +1188,27 @@ class myquery { } } - if(!userid()) + if(!userid() && $Cbucket->configs['anonym_comments']!='yes') e("You are not logged in"); + if(!userid() && $Cbucket->configs['anonym_comments']=='yes') + { + //Checking for input name and email + if(empty($_POST['name'])) + e("Please enter your name"); + if(empty($_POST['email'])) + e("Please enter your email"); + + $name = mysql_clean($_POST['name']); + $email = mysql_clean($_POST['email']); + } + if(empty($eh->error_list)) { $db->insert("comments",array - ('type,comment,type_id,userid,date_added,parent_id'), + ('type,comment,type_id,userid,date_added,parent_id,anonym_name,anonym_email'), array - ($type,$comment,$obj_id,userid(),NOW(),$reply_to)); + ($type,$comment,$obj_id,userid(),NOW(),$reply_to,$name,$email)); e("Comment has been added",m); return $db->insert_id(); } @@ -1324,5 +1337,29 @@ class myquery { return $results[0]; } + /** + * Function used to set website template + */ + function set_template($template) + { + global $myquery; + if(is_dir(STYLES_DIR.'/'.$template) &&template) + { + $myquery->Set_Website_Details('template_dir',$template); + e("Template has been activated",m); + }else + e("An error occured while changing the template"); + + } + + + /** + * Function used to update comment + */ + function update_comment($cid,$text) + { + global $db; + $db->Execute("UPDATE comments SET comment='$text' WHERE comment_id='$cid'"); + } } ?> \ No newline at end of file diff --git a/upload/includes/classes/objects.class.php b/upload/includes/classes/objects.class.php new file mode 100644 index 00000000..3b205e6f --- /dev/null +++ b/upload/includes/classes/objects.class.php @@ -0,0 +1,34 @@ +\n"; + foreach($templates as $template) + { + if($template['name']!='') + $dd .= "\n"; + } + $dd .="\n"; + + return $dd; + } +} \ No newline at end of file diff --git a/upload/includes/classes/template.class.php b/upload/includes/classes/template.class.php index a4b84549..6f0fc4e3 100644 --- a/upload/includes/classes/template.class.php +++ b/upload/includes/classes/template.class.php @@ -1,8 +1,11 @@ compile_dir = $dir_name; } @@ -31,7 +34,7 @@ class DoTemplate { function setType($type) { global $Smarty; if (!isset($Smarty)) { - DoTemplate::create(); + CBTemplate::create(); } $Smarty->type = $type; } @@ -39,7 +42,7 @@ class DoTemplate { function assign($var, $value) { global $Smarty; if (!isset($Smarty)) { - DoTemplate::create(); + CBTemplate::create(); } $Smarty->assign($var, $value); } @@ -47,7 +50,7 @@ class DoTemplate { function setTplDir($dir_name = null) { global $Smarty; if (!isset($Smarty)) { - DoTemplate::create(); + CBTemplate::create(); } if (!$dir_name) { $Smarty->template_dir = BASEDIR."/styles/clipbucketblue"; @@ -59,7 +62,7 @@ class DoTemplate { function setModule($module) { global $Smarty; if (!isset($Smarty)) { - DoTemplate::create(); + CBTemplate::create(); } $Smarty->theme = $module; $Smarty->type = "module"; @@ -68,7 +71,7 @@ class DoTemplate { function setTheme($theme) { global $Smarty; if (!isset($Smarty)) { - DoTemplate::create(); + CBTemplate::create(); } $Smarty->template_dir = BASEDIR."/styles/" . $theme; $Smarty->compile_dir = BASEDIR."/styles/" . $theme; @@ -79,7 +82,7 @@ class DoTemplate { function getTplDir() { global $Smarty; if (!isset($Smarty)) { - DoTemplate::create(); + CBTemplate::create(); } return $Smarty->template_dir; } @@ -87,7 +90,7 @@ class DoTemplate { function display($filename) { global $Smarty; if (!isset($Smarty)) { - DoTemplate::create(); + CBTemplate::create(); } $Smarty->display($filename); } @@ -95,7 +98,7 @@ class DoTemplate { function fetch($filename) { global $Smarty; if (!isset($Smarty)) { - DoTemplate::create(); + CBTemplate::create(); } return $Smarty->fetch($filename); } @@ -103,9 +106,116 @@ class DoTemplate { function getVars() { global $Smarty; if (!isset($Smarty)) { - DoTemplate::create(); + CBTemplate::create(); } return $Smarty->get_template_vars(); } + + /** + * Function used to get available templates + */ + function get_templates() + { + $dir = STYLES_DIR; + //Scaning Dir + $dirs = scandir($dir); + foreach($dirs as $tpl) + { + if(substr($tpl,0,1)!='.') + $tpl_dirs[] = $tpl; + } + //Now Checking for template template.xml + $tpls = array(); + foreach($tpl_dirs as $tpl_dir) + { + $tpl_details = CBTemplate::get_template_details($tpl_dir); + + if($tpl_details && $tpl_details['name']!='') + $tpls[$tpl_details['name']] = $tpl_details; + } + + return $tpls; + } + function gettemplates() + { + return $this->get_templates(); + } + + function get_template_details($temp,$file='template.xml') + { + $file = STYLES_DIR.'/'.$temp.'/template.xml'; + if(file_exists($file)) + { + $content = file_get_contents($file); + preg_match('/(.*)<\/name>/',$content,$name); + preg_match('/(.*)<\/author>/',$content,$author); + preg_match('/(.*)<\/version>/',$content,$version); + preg_match('/(.*)<\/released>/',$content,$released); + preg_match('/(.*)<\/description>/',$content,$description); + preg_match('/(.*)<\/website>/',$content,$website_arr); + + $name = $name[1]; + $author = $author[1]; + $version = $version[1]; + $released = $released[1]; + $description = $description[1]; + + $website = array('title'=>$website_arr[1],'link'=>$website_arr[2]); + + //Now Create array + $template_details = array + ('name'=>$name, + 'author'=>$author, + 'version'=>$version, + 'released'=>$released, + 'description'=>$description, + 'website'=>$website, + 'dir'=>$temp, + 'path'=>TEMPLATEFOLDER.'/'.$temp + ); + + return $template_details; + }else + return false; + } + + /** + * Function used to get template thumb + */ + function get_preview_thumb($template) + { + $path = TEMPLATEFOLDER.'/'.$template.'/images/preview.'; + $exts = array('png','jpg','gif'); + $thumb_path = BASEURL.'/images/icons/no_thumb.png'; + foreach($exts as $ext) + { + $file = BASEDIR.'/'.$path.$ext; + if(file_exists($file)) + { + $thumb_path = BASEURL.'/'.$path.$ext; + break; + } + } + + return $thumb_path; + } + + /** + * Function used to get any template + */ + function get_any_template() + { + $templates = $this->get_templates(); + if(is_array($templates)) + { + foreach($templates as $template) + { + if(!empty($template['name'])) + return $template['dir']; + } + return false; + }else + return false; + } } ?> \ No newline at end of file diff --git a/upload/includes/classes/user.class.php b/upload/includes/classes/user.class.php index 70e3b046..116a0b7b 100644 --- a/upload/includes/classes/user.class.php +++ b/upload/includes/classes/user.class.php @@ -27,7 +27,7 @@ class userquery { $this->userid = $sess->get('userid'); $this->username = $sess->get('username'); $this->level = $sess->get('level'); - + //Setting Access $this->add_access_type('admin_access','Admin Access'); @@ -1121,9 +1121,9 @@ class userquery { $ext = GetExt($thumb_file); $file = getName($thumb_file); if(!empty($size)) - $thumb = $file.'-'.$size.'.'.$ext; + $thumb = BASEURL.'/images/avatars/'.$file.'-'.$size.'.'.$ext; else - $thumb = $file.'.'.$ext; + $thumb = BASEURL.'/images/avatars/'.$file.'.'.$ext; return $thumb; } function avatar($udetails,$size='',$uid=NULL) diff --git a/upload/includes/classes/video.class.php b/upload/includes/classes/video.class.php index 11dbee57..e5021215 100644 --- a/upload/includes/classes/video.class.php +++ b/upload/includes/classes/video.class.php @@ -304,6 +304,52 @@ class CBvideo extends CBCategory } e(lang("vid_files_removed_msg"),m); } + + + /** + * Function used to get videos + * this function has all options + * that you need to fetch videos + * please see docs.clip-bucket.com for more details + */ + function get_videos($params) + { + $cond_array = array(); + + //Setting Category Condition + if($params['category']) + { + if(is_array($params['category'])) + { + foreach($params['category'] as $cat_params) + { + $cond_array[] = " category ='$cat_params' "; + } + }else{ + $cond_array[] = " category ='".$params['category']."' "; + } + } + + //date span + switch($param['date_span']) + { + case 'today'; + { + + } + } + + } + + + /** + * Function used to add video comment + */ + function add_comment($comment,$obj_id,$reply_to=NULL) + { + global $myquery; + return $myquery->add_comment($comment,$obj_id,$reply_to,'v'); + } } diff --git a/upload/includes/common.php b/upload/includes/common.php index 034dfb67..bc324055 100644 --- a/upload/includes/common.php +++ b/upload/includes/common.php @@ -63,7 +63,7 @@ if(file_exists(dirname(__FILE__).'/../install/isinstall.php')){ require_once('classes/category.class.php'); require_once('classes/video.class.php'); require_once 'languages.php'; - + $pages = new pages(); $myquery = new myquery(); $userquery = new userquery(); @@ -89,6 +89,7 @@ if(file_exists(dirname(__FILE__).'/../install/isinstall.php')){ //Initializng Userquery class $userquery->init(); +require 'defined_links.php'; //Holds Advertisment IDS that are being Viewed $ads_array = array(); @@ -182,22 +183,8 @@ error_reporting(E_ALL ^ E_NOTICE ^E_DEPRECATED); define('TEMPLATEFOLDER','styles'); //Template Folder Name, usually STYLES + define('STYLES_DIR',BASEDIR.'/'.TEMPLATEFOLDER); - if($row['allow_template_change'] == 1){ - $sitestyle = @$_COOKIE['sitestyle']; - if (!$sitestyle || !$myquery->IsTemplate($sitestyle)) - { - define('TEMPLATE',$row['template_dir']); - setcookie('sitestyle', $row['template_dir'], time()+315360000, '/'); - } - else - { - define('TEMPLATE',$sitestyle); - } - }else{ - define('TEMPLATE',$row['template_dir']); - } - // Define Lang Select & Style Select define('ALLOW_LANG_SELECT',$row['allow_language_change']); @@ -223,6 +210,9 @@ error_reporting(E_ALL ^ E_NOTICE ^E_DEPRECATED); define('THUMBS_URL',FILES_URL.'/thumbs'); define('ORIGINAL_URL',FILES_URL.'/original'); define('TEMP_URL',FILES_URL.'/temp'); + define("PLAYER_DIR",BASEDIR.'/player'); + define("PLAYER_URL",BASEURL.'/player'); + //Required Settings For Video Converion @@ -262,17 +252,21 @@ error_reporting(E_ALL ^ E_NOTICE ^E_DEPRECATED); define('CAT_THUMB_DIR',BASEDIR.'/images/category_thumbs'); define('CAT_THUMB_URL',BASEURL.'/images/category_thumbs'); - //Assigning Smarty Tags & Values + include 'functions.php'; include 'plugin.functions.php'; include 'plugins_functions.php'; require BASEDIR.'/includes/templatelib/Template.class.php'; require BASEDIR.'/includes/classes/template.class.php'; + require BASEDIR.'/includes/classes/objects.class.php'; + require BASEDIR.'/includes/active.php'; - require BASEDIR.'/includes/defined_links.php'; require_once('email_templates/template_writer.php'); include(BASEDIR.'/lang/'.LANG.'/lang.php'); - + + $cbtpl = new CBTemplate(); + $cbobjects = new CBObjects(); + $is_admin = $userquery->admin_check(); if ($is_admin == 1) { @@ -282,6 +276,7 @@ error_reporting(E_ALL ^ E_NOTICE ^E_DEPRECATED); $thisurl = curPageURL(); Assign('THIS_URL', $thisurl); + //Assigning Smarty Tags & Values Assign('CB_VERSION',CB_VERSION); Assign('FFMPEG_FLVTOOLS_BINARY',FFMPEG_FLVTOOLS_BINARY); Assign('FFMPEG_MPLAYER_BINARY',FFMPEG_MPLAYER_BINARY); @@ -328,27 +323,7 @@ error_reporting(E_ALL ^ E_NOTICE ^E_DEPRECATED); Assign('LANG',$LANG); Assign('langf',LANG); Assign('lang_count',count($languages)); - -//Assign Footer - Assign('lang_changer', $row['allow_language_change']); - Assign('template_changer', $row['allow_template_change']); - Assign('current_template', TEMPLATE); - -//Getting Template List (admin area) - $sql = "SELECT * from template"; - $rs = $db->Execute($sql); - $templates = $rs->getrows(); - - // sort user template list (fwhite / February 05, 2009) - foreach ($templates as $key => $temp_row) { - $temp_name[$key] = $temp_row[1]; - } - - // Sort the data with name ascending - // Add data as the last parameter, to sort by the common key - array_multisort($temp_name, SORT_ASC, $templates); - Assign('templates', $templates); //Assign Player Div Id Assign('player_div_id',$row['player_div_id']); @@ -366,6 +341,9 @@ if(user_id()) $userquery->permission = $userquery->get_user_level(userid()); } +//Checking Website Template +$Cbucket->set_the_template(); + /* REGISTER OBJECTS FOR SMARTY */ @@ -384,6 +362,8 @@ $Smarty->assign_by_ref('Cbucket', $Cbucket);$Smarty->assign_by_ref('ClipBucket', $Smarty->assign_by_ref('eh', $eh); $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); /* REGISERTING FUNCTION FOR SMARTY TEMPLATES @@ -403,7 +383,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('link','cblink'); $Smarty->register_modifier('SetTime','SetTime'); $Smarty->register_modifier('getname','getname'); @@ -421,4 +401,12 @@ $Smarty->register_modifier('get_thumb_num','get_thumb_num'); register_action_remove_video('remove_video_thumbs'); 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/defined_links.php b/upload/includes/defined_links.php index d8848247..6474cdd3 100644 --- a/upload/includes/defined_links.php +++ b/upload/includes/defined_links.php @@ -1,117 +1,15 @@ Array([Non SEO Link] [SEO Link])) + */ - // We Can Set SEO urls or Simple Urls by selecting following options, by selecting YES , make sure that all ReWrites are defined in .httaccess - - $seo_urls = SEO; // yes/no - +$Cbucket->links = array +( +'signup' =>array('signup.php','signup'), +'login' =>array('signup.php','login'), +'videos' =>array('videos.php','videos'), +); - /* if selected yes then our UPLOAD link will become http://ourdomain.com/upload and if no the http://ourdomain.com/upload.php */ - - if($seo_urls == 'yes'){ - @Assign('seo','yes'); - - Assign('logout_link',BASEURL.'/logout'); - Assign('leave_group_link',BASEURL.'/group/leave/'); - Assign('sent_link',BASEURL.'/message/sent/'); - Assign('signup_link',BASEURL.'/signup'); - Assign('subscriptions_link',BASEURL.'/subscriptions/'); - Assign('search_result',BASEURL.'/search/result'); - Assign('upload_link',BASEURL.'/upload'); - Assign('myaccount_link',BASEURL.'/myaccount'); - Assign('manage_videos',BASEURL.'/manage/videos/'); - Assign('manage_subscriptions',BASEURL.'/manage/subscriptions/'); - Assign('manage_favourites_link',BASEURL.'/manage/favourites/'); - Assign('manage_contacts_link',BASEURL.'/manage/contacts/'); - Assign('manage_group_videos_link',BASEURL.'/manage_group_videos.php?url='); - Assign('manage_group_members_link',BASEURL.'/manage_group_members.php?url='); - Assign('manage_groups_link',BASEURL.'/manage/group/'); - Assign('videos_link',BASEURL.'/videos'); - Assign('user_account_link',BASEURL.'/manage/account'); - Assign('user_contacts_link',BASEURL.'/user/contacts/'); - Assign('user_videos_link',BASEURL.'/user/videos/'); - Assign('user_fav_videos_link',BASEURL.'/user/favourites/'); - Assign('channels_link',BASEURL.'/channels/'); - Assign('compose_msg_link',BASEURL.'/message/compose/'); - Assign('view_channel_link',BASEURL.'/channel/'); - Assign('view_topic_link',BASEURL.'/group/topic/'); - Assign('view_group_link',BASEURL.'/group/view/'); - Assign('view_group_videos_link',BASEURL.'/view_group_videos.php?url='); - Assign('view_group_members_link',BASEURL.'/view_group_members.php?url='); - Assign('inbox_link',BASEURL.'/message/inbox/'); - Assign('invite_group_members_link',BASEURL.'/invite_group.php?url='); - Assign('edit_video_link',BASEURL.'/manage/video/edit'); - Assign('edit_video_watch',BASEURL.'/edit_video.php'); - Assign('edit_group_link',BASEURL.'/edit_group.php?url='); - Assign('about_us_link',BASEURL.'/pages/aboutus/'); - Assign('add_group_video_link',BASEURL.'/add_group_videos.php?url='); - Assign('contact_us_link',BASEURL.'/pages/contactus/'); - Assign('create_group_link',BASEURL.'/group/create/'); - Assign('privacy_link',BASEURL.'/pages/privacy/'); - Assign('termsofuse_link',BASEURL.'/pages/termsofuse/'); - Assign('help_link',BASEURL.'/pages/help/'); - Assign('join_group_link',BASEURL.'/join_group.php?url='); - Assign('groups_link',BASEURL.'/community'); - Assign('delete_group_link',BASEURL.'/delete_group.php?url='); - Assign('External_Upload_link',BASEURL.'/external_upload.php'); - Assign('rss_link',BASEURL.'/rss.php?show='); - Assign('admin_link',BASEURL.'/admin_area/'); - - }else{ - @Assign('seo','no'); - - Assign('logout_link',BASEURL.'/logout.php'); - Assign('leave_group_link',BASEURL.'/leave_group.php?url='); - Assign('sent_link',BASEURL.'/sent.php'); - Assign('signup_link',BASEURL.'/signup.php'); - Assign('subscriptions_link',BASEURL.'/manage_subscriptions.php'); - Assign('search_result',BASEURL.'/search_result.php'); - Assign('upload_link',BASEURL.'/upload.php'); - Assign('myaccount_link',BASEURL.'/myaccount.php'); - Assign('manage_videos',BASEURL.'/manage_videos.php'); - Assign('manage_subscriptions',BASEURL.'/manage_subscriptions.php'); - Assign('manage_favourites_link',BASEURL.'/manage_favourites.php'); - Assign('manage_contacts_link',BASEURL.'/manage_contacts.php'); - Assign('manage_group_videos_link',BASEURL.'/manage_group_videos.php?url='); - Assign('manage_group_members_link',BASEURL.'/manage_group_members.php?url='); - Assign('manage_groups_link',BASEURL.'/manage_groups.php'); - Assign('videos_link',BASEURL.'/videos.php'); - Assign('user_account_link',BASEURL.'/user_account.php'); - Assign('user_contacts_link',BASEURL.'/user_contacts.php?user='); - Assign('user_videos_link',BASEURL.'/user_videos.php?user='); - Assign('user_fav_videos_link',BASEURL.'/user_fav_videos.php?user='); - Assign('channels_link',BASEURL.'/channels.php'); - Assign('compose_msg_link',BASEURL.'/compose.php'); - Assign('view_channel_link',BASEURL.'/view_channel.php?user='); - Assign('view_topic_link',BASEURL.'/view_topic.php?tid='); - Assign('view_group_link',BASEURL.'/view_group.php?url='); - Assign('view_group_videos_link',BASEURL.'/view_group_videos.php?url='); - Assign('view_group_members_link',BASEURL.'/view_group_members.php?url='); - Assign('inbox_link',BASEURL.'/inbox.php'); - Assign('invite_group_members_link',BASEURL.'/invite_group.php?url='); - Assign('edit_video_link',BASEURL.'/edit_video.php'); - Assign('edit_video_watch',BASEURL.'/edit_video.php'); - Assign('edit_group_link',BASEURL.'/edit_group.php?url='); - Assign('about_us_link',BASEURL.'/aboutus.php'); - Assign('add_group_video_link',BASEURL.'/add_group_videos.php?url='); - Assign('contact_us_link',BASEURL.'/contactus.php'); - Assign('create_group_link',BASEURL.'/create_group.php'); - Assign('privacy_link',BASEURL.'/privacy.php'); - Assign('termsofuse_link',BASEURL.'/termsofuse.php'); - Assign('help_link',BASEURL.'/help.php'); - Assign('join_group_link',BASEURL.'/join_group.php?url='); - Assign('groups_link',BASEURL.'/groups.php'); - Assign('delete_group_link',BASEURL.'/delete_group.php?url='); - Assign('External_Upload_link',BASEURL.'/External_Upload'); - Assign('rss_link',BASEURL.'/rss.php?show='); - Assign('admin_link',BASEURL.'/admin_area/'); - - } ?> \ No newline at end of file diff --git a/upload/includes/functions.php b/upload/includes/functions.php index debb5a27..5b4d7b3a 100644 --- a/upload/includes/functions.php +++ b/upload/includes/functions.php @@ -105,6 +105,7 @@ echo ''; + exit("Javascript is turned off, click here to go to requested page"); } //Simple Template Displaying Function @@ -112,20 +113,20 @@ function Template($template,$layout=true){ global $admin_area; if($layout) - DoTemplate::display(LAYOUT.'/'.$template); + CBTemplate::display(LAYOUT.'/'.$template); else - DoTemplate::display($template); + CBTemplate::display($template); if($template == 'footer.html' && $admin_area !=TRUE){ - DoTemplate::display(BASEDIR.'/includes/templatelib/'.$template); + CBTemplate::display(BASEDIR.'/includes/templatelib/'.$template); } if($template == 'header.html'){ - DoTemplate::display(BASEDIR.'/includes/templatelib/'.$template); + CBTemplate::display(BASEDIR.'/includes/templatelib/'.$template); } } function Assign($name,$value){ - DoTemplate::assign($name,$value); + CBTemplate::assign($name,$value); } //Funtion of Random String @@ -806,7 +807,10 @@ function SetTime($sec, $padHours = true) { break; } } - + function getSmartyCategoryList($params,&$Smarty) + { + return getCategoryList($params['type']); + } //Function used to register function as multiple modifiers @@ -1332,6 +1336,8 @@ function SetTime($sec, $padHours = true) { return VIDEOS_URL.'/no_video.flv'; else return 'no_video.flv'; + }else{ + return false; } }else{ if($multi) @@ -1910,4 +1916,103 @@ function SetTime($sec, $padHours = true) { return $cbvid->remove_files($vdetails); } + + /** + * Function used to get player logo + */ + function get_player_logo() + { + return PLAYER_URL.'/logo.png'; + } + + /** + * Function used to assign link + */ + function cblink($params,&$Smarty) + { + global $ClipBucket; + $name = $params['name']; + $ref = $param['ref']; + + return BASEURL.'/'.$ClipBucket->links[$name][0]; + } + + /** + * Function used to check video is playlable or not + * @param vkey,vid + */ + function video_playable($id) + { + global $cbvideo; + $vdo = $cbvideo->get_video($id); + if(!$vdo) + { + e("Video does not exist"); + return false; + }elseif($vdo['status']!='Successful') + { + e("This video is not working properly"); + if(!has_access('admin_access',TRUE)) + return false; + else + return true; + }else{ + return true; + } + } + + + /** + * Function used to turn tags into links + */ + function tags($input,$type) + { + //Exploding using comma + $tags = explode(',',$input); + $count = 1; + $total = count($tags); + $new_tags = ''; + foreach($tags as $tag) + { + $new_tags .= $tag; + if($count<$total) + $new_tags .= ','; + $count++; + } + + return $new_tags; + } + + + /** + * Function used to turn db category into links + */ + function categories($input,$type) + { + global $cbvideo; + switch($type) + { + case 'video': + default: + $obj = $cbvideo; + } + + preg_match_all('/#([0-9]+)#/',$input,$m); + $cat_array = array($m[1]); + $cat_array = $cat_array[0]; + + $count = 1; + $total = count($cat_array); + $cats = ''; + foreach($cat_array as $cat) + { + $cat_details = $obj->get_category($cat); + $cats .= $cat_details['category_name']; + if($count<$total) + $cats .= ','; + $count++; + } + + return $cats; + } ?> \ No newline at end of file diff --git a/upload/index.php b/upload/index.php index daa918cd..1049fba2 100644 --- a/upload/index.php +++ b/upload/index.php @@ -1,67 +1,22 @@ page_redir(); - if(isset($_GET['cb_ver']) && $is_admin) { $msg = "ClipBucket ".CB_VERSION.""; } -//Get user Data, if logged in - if(isset($_SESSION['username'])){ - $user = $_SESSION['userid']; - $data = $userquery->GetUserData($user); - Assign('data',$data); - } -//Getting Users With Most Videos - $sql = "SELECT * FROM users WHERE total_videos > 0 ORDER by total_videos DESC LIMIT 5"; - $udata = $db->Execute($sql); - $top_user = $udata->getrows(); - $total_users = $udata->recordcount() + 0; - for($id=0;$id<$total_users;$id++){ - $sql = "Select * FROM video WHERE username='".$top_user[$id]['username']."'"; - $rs = $db->Execute($sql); - $top_user[$id]['total_videos'] = $rs->recordcount() + 0; - } - - Assign('top_user',$top_user); - -//Getting List of Featured Videos -$query_param = "broadcast='public' AND active='yes' AND status='Successful'"; -$show = 'featured'; -$limit = "LIMIT ".VLISTPT; -$query = "SELECT * FROM video WHERE featured = 'yes' AND $query_param ORDER BY date_added DESC $limit"; -$text = 'Featured'; -Assign('text',$text); - -$link = BASEURL.videos_link.'?order=fr'; -Assign('link',$link); - -$data = $db->Execute($query); -$videos = $data->getrows(); -$total = $data->recordcount() + 0; - - -Assign('videos',$videos); -Assign('show',$show); -if(isset($msg)) -{ -Assign('msg',$msg); -} - - -subtitle('index'); -Template('header.html'); -Template('message.html'); -Template('index.html'); -Template('footer.html'); +//Displaying The Template +template_files('index.html'); +display_it(); ?> \ No newline at end of file diff --git a/upload/player/cbplayer/cbplayer.plug.php b/upload/player/cbplayer/cbplayer.plug.php new file mode 100644 index 00000000..21485441 --- /dev/null +++ b/upload/player/cbplayer/cbplayer.plug.php @@ -0,0 +1,44 @@ + \ No newline at end of file diff --git a/upload/player/cbplayer/settings.php b/upload/player/cbplayer/settings.php new file mode 100644 index 00000000..bfbdf0fc --- /dev/null +++ b/upload/player/cbplayer/settings.php @@ -0,0 +1,62 @@ +get_video($vid); +header ("content-type: text/xml"); +echo ''; +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/upload/player/cbplayer/staf.php b/upload/player/cbplayer/staf.php new file mode 100644 index 00000000..d7721c22 --- /dev/null +++ b/upload/player/cbplayer/staf.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/upload/player/cbplayer/stafTemplate.html b/upload/player/cbplayer/stafTemplate.html new file mode 100644 index 00000000..d5fd913f --- /dev/null +++ b/upload/player/cbplayer/stafTemplate.html @@ -0,0 +1,13 @@ + + + + + + + + +
Hi,
Your friend thought you might be interested in this video:
+ Go to Video! +   + +
\ No newline at end of file diff --git a/upload/player/cbplayer/videoPlayer.swf b/upload/player/cbplayer/videoPlayer.swf new file mode 100644 index 00000000..110c0d02 Binary files /dev/null and b/upload/player/cbplayer/videoPlayer.swf differ diff --git a/upload/player/jwplayer/cbplayer.plug.php b/upload/player/jwplayer/cbplayer.plug.php new file mode 100644 index 00000000..575c404c --- /dev/null +++ b/upload/player/jwplayer/cbplayer.plug.php @@ -0,0 +1,48 @@ +playerFile = PLAYER_URL.'/jwplayer/player.swf'; + $swfobj->FlashObj(); + //Writing Param + $swfobj->addParam('allowfullscreen','true'); + $swfobj->addParam('allowscriptaccess','always'); + $swfobj->addParam('wmode','opaque'); + + $swfobj->addVar('file',BASEURL.'/files/videos/'.$vid_file); + $swfobj->CreatePlayer(); + return $swfobj->code; + }else{ + return false; + } + } + + register_actions_play_video('jwplayer'); +} +?> \ No newline at end of file diff --git a/upload/plugins/jw_player/expressInstall.swf b/upload/player/jwplayer/expressInstall.swf similarity index 100% rename from upload/plugins/jw_player/expressInstall.swf rename to upload/player/jwplayer/expressInstall.swf diff --git a/upload/plugins/jw_player/jwplayer.php b/upload/player/jwplayer/jwplayer.php similarity index 100% rename from upload/plugins/jw_player/jwplayer.php rename to upload/player/jwplayer/jwplayer.php diff --git a/upload/plugins/jw_player/player.swf b/upload/player/jwplayer/player.swf similarity index 100% rename from upload/plugins/jw_player/player.swf rename to upload/player/jwplayer/player.swf diff --git a/upload/player/jwplayer/skin/Snel.swf b/upload/player/jwplayer/skin/Snel.swf new file mode 100644 index 00000000..b5ae4297 Binary files /dev/null and b/upload/player/jwplayer/skin/Snel.swf differ diff --git a/upload/player/jwplayer/skin/dangdang.swf b/upload/player/jwplayer/skin/dangdang.swf new file mode 100644 index 00000000..9c5aa26d Binary files /dev/null and b/upload/player/jwplayer/skin/dangdang.swf differ diff --git a/upload/player/jwplayer/skin/nacht.swf b/upload/player/jwplayer/skin/nacht.swf new file mode 100644 index 00000000..ac792102 Binary files /dev/null and b/upload/player/jwplayer/skin/nacht.swf differ diff --git a/upload/player/jwplayer/skin/new.swf b/upload/player/jwplayer/skin/new.swf new file mode 100644 index 00000000..725be0ba Binary files /dev/null and b/upload/player/jwplayer/skin/new.swf differ diff --git a/upload/plugins/jw_player/yt.swf b/upload/player/jwplayer/yt.swf similarity index 100% rename from upload/plugins/jw_player/yt.swf rename to upload/player/jwplayer/yt.swf diff --git a/upload/player/clipbucketblue.swf b/upload/player/old_players/clipbucketblue.swf similarity index 100% rename from upload/player/clipbucketblue.swf rename to upload/player/old_players/clipbucketblue.swf diff --git a/upload/player/embed_player.swf b/upload/player/old_players/embed_player.swf similarity index 100% rename from upload/player/embed_player.swf rename to upload/player/old_players/embed_player.swf diff --git a/upload/player/mini_logo.png b/upload/player/old_players/mini_logo.png similarity index 100% rename from upload/player/mini_logo.png rename to upload/player/old_players/mini_logo.png diff --git a/upload/player/panel.xml.php b/upload/player/old_players/panel.xml.php similarity index 100% rename from upload/player/panel.xml.php rename to upload/player/old_players/panel.xml.php diff --git a/upload/player/player.conf.php b/upload/player/old_players/player.conf.php similarity index 100% rename from upload/player/player.conf.php rename to upload/player/old_players/player.conf.php diff --git a/upload/player/youtube.swf b/upload/player/old_players/youtube.swf similarity index 100% rename from upload/player/youtube.swf rename to upload/player/old_players/youtube.swf diff --git a/upload/player/youtube_glossy.swf b/upload/player/old_players/youtube_glossy.swf similarity index 100% rename from upload/player/youtube_glossy.swf rename to upload/player/old_players/youtube_glossy.swf diff --git a/upload/plugins/global_announcement/uninstall_embed_video_mod.php b/upload/plugins/global_announcement/uninstall_embed_video_mod.php deleted file mode 100644 index 6892a667..00000000 --- a/upload/plugins/global_announcement/uninstall_embed_video_mod.php +++ /dev/null @@ -1,14 +0,0 @@ -Execute("ALTER TABLE `video` DROP `embed_code` "); -} -uninstall_embed_video_mode(); -?> \ No newline at end of file diff --git a/upload/styles/cbv2/images/dot.gif b/upload/styles/cbv2/images/dot.gif new file mode 100644 index 00000000..35d42e80 Binary files /dev/null and b/upload/styles/cbv2/images/dot.gif differ diff --git a/upload/styles/cbv2/images/field_bg.png b/upload/styles/cbv2/images/field_bg.png new file mode 100644 index 00000000..1fb99b0a Binary files /dev/null and b/upload/styles/cbv2/images/field_bg.png differ diff --git a/upload/styles/cbv2/images/gradients.png b/upload/styles/cbv2/images/gradients.png new file mode 100644 index 00000000..9d26e71d Binary files /dev/null and b/upload/styles/cbv2/images/gradients.png differ diff --git a/upload/styles/cbv2/images/header/navs.png b/upload/styles/cbv2/images/header/navs.png new file mode 100644 index 00000000..b7b35fa7 Binary files /dev/null and b/upload/styles/cbv2/images/header/navs.png differ diff --git a/upload/styles/cbv2/images/icons.png b/upload/styles/cbv2/images/icons.png new file mode 100644 index 00000000..add09aa8 Binary files /dev/null and b/upload/styles/cbv2/images/icons.png differ diff --git a/upload/styles/cbv2/images/logo.png b/upload/styles/cbv2/images/logo.png new file mode 100644 index 00000000..60b95095 Binary files /dev/null and b/upload/styles/cbv2/images/logo.png differ diff --git a/upload/styles/cbv2/images/preview.png b/upload/styles/cbv2/images/preview.png new file mode 100644 index 00000000..2978f256 Binary files /dev/null and b/upload/styles/cbv2/images/preview.png differ diff --git a/upload/styles/cbv2/images/the_bg.png b/upload/styles/cbv2/images/the_bg.png new file mode 100644 index 00000000..ced930ce Binary files /dev/null and b/upload/styles/cbv2/images/the_bg.png differ diff --git a/upload/styles/cbv2/layout/blocks/add_comment.html b/upload/styles/cbv2/layout/blocks/add_comment.html new file mode 100644 index 00000000..140dfc07 --- /dev/null +++ b/upload/styles/cbv2/layout/blocks/add_comment.html @@ -0,0 +1,26 @@ +
+
  Add Comment + +{if $userquery->login_check('',true) || $Cbucket->configs.anonym_comments == 'yes'} +
+ {if !$userquery->login_check('',true) && $Cbucket->configs.anonym_comments == 'yes'} + +
+
+ +
+
+ {else} + Name : {$userquery->username}
+ {/if} + +
+ {ANCHOR place='before_compose_box'} + +
+ +
+{else} + Please login to comment +{/if} +
\ No newline at end of file diff --git a/upload/styles/cbv2/layout/blocks/category_list.html b/upload/styles/cbv2/layout/blocks/category_list.html new file mode 100644 index 00000000..8ca17608 --- /dev/null +++ b/upload/styles/cbv2/layout/blocks/category_list.html @@ -0,0 +1,9 @@ +
+Categories +{assign var='category_list' value=func->getCategoryList(video)} + +
\ No newline at end of file diff --git a/upload/styles/cbv2/layout/blocks/comments.html b/upload/styles/cbv2/layout/blocks/comments.html new file mode 100644 index 00000000..b2061048 --- /dev/null +++ b/upload/styles/cbv2/layout/blocks/comments.html @@ -0,0 +1,12 @@ +{assign var='comments' value=$myquery->get_comments($id,$type)} +{foreach from=$comments item=comment} +
+ {if $comment.userid !='' && $comment.userid!=0} + {assign var=name value=$userquery->get_user_field($comment.userid,username)}{$name.username} + {else} + {$comment.anonym_name} + {/if} + wrote on {$comment.date_added|date_format}
+ {$comment.comment} +
+{/foreach} \ No newline at end of file diff --git a/upload/styles/cbv2/layout/blocks/pagination.html b/upload/styles/cbv2/layout/blocks/pagination.html new file mode 100644 index 00000000..cc61ae2a --- /dev/null +++ b/upload/styles/cbv2/layout/blocks/pagination.html @@ -0,0 +1,3 @@ + diff --git a/upload/styles/cbv2/layout/blocks/video.html b/upload/styles/cbv2/layout/blocks/video.html new file mode 100644 index 00000000..4e9c05f2 --- /dev/null +++ b/upload/styles/cbv2/layout/blocks/video.html @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/upload/styles/cbv2/layout/body.html b/upload/styles/cbv2/layout/body.html new file mode 100644 index 00000000..c5ae3c84 --- /dev/null +++ b/upload/styles/cbv2/layout/body.html @@ -0,0 +1,24 @@ +{* Including Global Header *} +{include file="$style_dir/global_header.html"} + + +
+ + {include file="$style_dir/header.html" } + {include file="$style_dir/message.html"} +
+
+ {foreach from=$template_files item=file} + {include file="$style_dir/$file" } + {/foreach} +
+
+ + +
+ + \ No newline at end of file diff --git a/upload/styles/cbv2/layout/global_header.html b/upload/styles/cbv2/layout/global_header.html new file mode 100644 index 00000000..f4ff02db --- /dev/null +++ b/upload/styles/cbv2/layout/global_header.html @@ -0,0 +1,157 @@ + + + + + + + + + + + + + +{$title} + + + + + + + + +{foreach from=$Cbucket->JSArray key=file item=type} +{if $curActive == $type || $type=='global' } + +{/if} +{/foreach} + + + + +{foreach from=$Cbucket->header_files key=type item=file} + {if $curActive == $type || $type=='global' } + {include file="$file"} + {/if} +{/foreach} + + + + +{if $page == 'upload_video'} + + + +{/if} + +{php} +global $plugin_list; +if(!empty($plugin_list) && is_array($plugin_list)) +{ + foreach($plugin_list as $plugin) + { + if(!empty($plugin['plugin_header_file'])) + { + if( !empty($plugin['plugin_folder']) && + file_exists(PLUG_DIR.'/'.$plugin['plugin_folder'].'/'.$plugin['plugin_header_file']) + ) + { + template(PLUG_DIR.'/'.$plugin['plugin_folder'].'/'.$plugin['plugin_header_file'],false); + }else{ + if(file_exists(PLUG_DIR.'/'.$plugin['plugin_header_file'])) + template(PLUG_DIR.'/'.$plugin['plugin_header_file'],false); + }} + } +} +{/php} + + + + +{php} +global $Cbucket; +$modlist = $Cbucket->moduleList; +if(!empty($modlist) && is_array($modlist)) +{ + foreach($modlist as $mod) + { + if(!empty($mod['module_include_file']) && + file_exists(MODULEDIR.'/'.$mod['module_include_file'])) + template(MODULEDIR.'/'.$mod['module_include_file'],false); + } +} +{/php} + + + + + \ No newline at end of file diff --git a/upload/styles/cbv2/layout/header.html b/upload/styles/cbv2/layout/header.html new file mode 100644 index 00000000..9939e032 --- /dev/null +++ b/upload/styles/cbv2/layout/header.html @@ -0,0 +1,24 @@ + + + \ No newline at end of file diff --git a/upload/styles/cbv2/layout/index.html b/upload/styles/cbv2/layout/index.html new file mode 100644 index 00000000..53953b67 --- /dev/null +++ b/upload/styles/cbv2/layout/index.html @@ -0,0 +1,4 @@ +asdasd +asd +asd +as diff --git a/upload/styles/cbv2/layout/message.html b/upload/styles/cbv2/layout/message.html new file mode 100644 index 00000000..94b9a2a5 --- /dev/null +++ b/upload/styles/cbv2/layout/message.html @@ -0,0 +1,53 @@ +
+ +{assign var=msg value=$eh->message_list} +{assign var=err value=$eh->error_list} +{if $err.0 neq ''} + + + + + + + + + + + + + + + + +
 
    + {foreach from=$err item=show_msg} +
  • {$show_msg}
  • + {/foreach} +
 
+
+{/if} + +{if $msg.0 neq ''} + + + + + + + + + + + + + + + + +
 
    + {foreach from=$msg item=show_msg} +
  • {$show_msg}
  • + {/foreach} +
 
+
+{/if} \ No newline at end of file diff --git a/upload/styles/cbv2/layout/videos.html b/upload/styles/cbv2/layout/videos.html new file mode 100644 index 00000000..aac7468d --- /dev/null +++ b/upload/styles/cbv2/layout/videos.html @@ -0,0 +1,17 @@ + + + {include file="$style_dir/blocks/category_list.html" type='video'} + + +
+
Videos
+ {section name=v_list loop=$videos} + {include file="$style_dir/blocks/video.html" video=$videos[v_list]} + {/section} +
+
+ +
{AD place='ad_160x600'}
+
+ +{include file="$style_dir/blocks/pagination.html"} \ No newline at end of file diff --git a/upload/styles/cbv2/layout/watch_video.html b/upload/styles/cbv2/layout/watch_video.html new file mode 100644 index 00000000..2a7cffbf --- /dev/null +++ b/upload/styles/cbv2/layout/watch_video.html @@ -0,0 +1,49 @@ +
{$vdo.title}
+{if has_access('admin_access')}
{ANCHOR place=watch_admin_options}
{/if} + +
+
+ This content requires JavaScript and Macromedia Flash Player 7 or higher. Get Flash

+
+ +
+ + + +
+ About This Video +
+ {assign var='udetails' value=$userquery->get_user_details($vdo.userid)} + + {$udetails.username} uploaded on {$vdo.date_added|date_format}
+ {$vdo.views|number_format} times viewed
+
+ +
+
+ {$vdo.description} +
+ {$vdo.tags|tags:video}
+Categories : {$vdo.category|categories:video} +
+ +
+ + +
+ + + + + + {include file="$style_dir/blocks/add_comment.html"} + + + {include file="$style_dir/blocks/comments.html" id=$vdo.videoid type=v} +
diff --git a/upload/styles/cbv2/template.xml b/upload/styles/cbv2/template.xml new file mode 100644 index 00000000..321cc6a0 --- /dev/null +++ b/upload/styles/cbv2/template.xml @@ -0,0 +1,9 @@ + + \ No newline at end of file diff --git a/upload/styles/cbv2/theme/blocks.css b/upload/styles/cbv2/theme/blocks.css new file mode 100644 index 00000000..f31f76d2 --- /dev/null +++ b/upload/styles/cbv2/theme/blocks.css @@ -0,0 +1,9 @@ +@charset "utf-8"; +/* CSS Document */ +.video_block{width:130px; margin:5px; float:left} + +/* Category List */ +.category_list{width:160px; float:left; margin-right:10px;} +.category_list ul, .category_list ul li{margin:0px; padding:0px; list-style:none} +.category_list a{display:block; border-bottom:dashed 1px #EEE; font-size:13px; font-weight:bold; color:#09c; padding:3px; margin-bottom:3px;} +.category_list a:hover{background-color:#F9F9F9} diff --git a/upload/styles/cbv2/theme/body.css b/upload/styles/cbv2/theme/body.css new file mode 100644 index 00000000..8cf0fa30 --- /dev/null +++ b/upload/styles/cbv2/theme/body.css @@ -0,0 +1,68 @@ +@charset "utf-8"; +/* CSS Document */ +body{ + margin-left: 0px; + margin-top: 0px; + margin-right: 0px; + margin-bottom: 0px; + font-size:12px; + color:#333; + font-family:Arial, Helvetica, sans-serif; +} + +a{text-decoration:none; font-family:Arial, Helvetica, sans-serif;color:#333; } + +#header{width:990px; margin:auto} +#logo_icon{ width:350px; height:65px; background-image:url(../images/logo.png)} +.logo{float:left; width:400px;} + +.clear{clear:both} +.clear_left{clear:left} +.clear_left{clear:right} + +#content{width:970px; margin:auto; padding-top:10px; min-height:800px} +#content_container{background-image:url(../images/the_bg.png); background-position:center; background-repeat:no-repeat; min-height:500px } + +.header_box{ padding-right:10px; padding-top:5px; font-size:13px; font-weight:bold} +.header_box a{color:#0099cc} + +.heading{font-size:16px; color:#333; font-weight:bold} + +.verticle_ad{width:160px; float:left} + +#footer{ background-image:url(../images/gradients.png); height:29px;} +.footer{width:980px; margin:auto; color:#fff; line-height:29px} + +.video_title{font-size:18px; font-weight:bold; color:#09c; text-transform:uppercase; padding:5px 0px 10px 0px} + +.video_options { width:100%; margin:10px 0px 10px 0px} +.video_options a{display:inline-block; height:37px; line-height:37px; width:180px; color:#333; font-size:16px; font-weight:bold} +.share_video,.flag_video,.add_favorite,.add_comment_icon,.tags_icon{background-image:url(../images/icons.png); height:37px; width:37px; background-repeat:no-repeat; display:inline-block} +.share_video{background-position:-37px 0px;} +.flag_video{background-position:-74px -0px} +.add_comment_icon{background-position:-111px -0px} +.tags_icon{background-position:-0px -36px; width:15px; height:15px} + + + + +.player_container{width:620px; float:left} +.video_right{width:600px;} + + +.add_comment_box .a_comment a{display:inline-block; height:37px; line-height:37px; width:300px;color:#333; font-size:16px; font-weight:bold} + + + +.video_details{width:320px; border:1px solid #0099cc; float:left; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px; padding:5px} +.vd_heading{display:block; border-bottom:1px solid #999; font-size:14px; font-weight:bold} + +.vd_user{margin:5px 0px 5px 0px} +.vd_thumb{display:inline-block; float:left;} +.mid_user_thumb{max-width:60px; max-height:60px; display:inline-block; margin-right:5px} +.vd_desc{ border-bottom:1px solid #999; margin-bottom:5px } + + +/* FORM */ +.input{border:1px solid #666; background-image:url(../images/field_bg.png); background-repeat:no-repeat; width:500px; min-height:20px; font-size:11px; color:#666; padding:5px} +.label{font-size:13px; font-weight:bold} \ No newline at end of file diff --git a/upload/styles/cbv2/theme/main.css b/upload/styles/cbv2/theme/main.css new file mode 100644 index 00000000..60c22bf3 --- /dev/null +++ b/upload/styles/cbv2/theme/main.css @@ -0,0 +1,10 @@ +/* +ClipBucket 'ClipBucket v2' Template Theme by Arslan Hassan +-------------------------------------------------------------- +Style name: ClipBucket v2 +-------------------------------------------------------------- +*/ + +@import url("body.css"); +@import url("navbar.css"); +@import url("blocks.css"); \ No newline at end of file diff --git a/upload/styles/cbv2/theme/navbar.css b/upload/styles/cbv2/theme/navbar.css new file mode 100644 index 00000000..4619e7fc --- /dev/null +++ b/upload/styles/cbv2/theme/navbar.css @@ -0,0 +1,7 @@ +#nav_container{background-image:url(../images/gradients.png); height:35px} + +.nav_menu{width:990px; margin:auto; } +.nav_menu ul{padding:0px; margin:0px; padding-top:6px} +.nav_menu ul li{padding:0px; margin:0px; list-style:none; float:left; margin-right:2px} +.nav_menu a{display:block; width:127px; background-image:url(../images/header/navs.png); height:29px; color:#fff; font-size:14px; font-weight:bold; text-align:center; line-height:29px; font-family:Arial, Helvetica, sans-serif; text-decoration:none} +.nav_menu a:hover{background-position:0px -29px} \ No newline at end of file diff --git a/upload/styles/clipbucketblue/images/preview.png b/upload/styles/clipbucketblue/images/preview.png new file mode 100644 index 00000000..33cd4005 Binary files /dev/null and b/upload/styles/clipbucketblue/images/preview.png differ diff --git a/upload/styles/clipbucketblue/layout/body.html b/upload/styles/clipbucketblue/layout/body.html new file mode 100644 index 00000000..cb940b32 --- /dev/null +++ b/upload/styles/clipbucketblue/layout/body.html @@ -0,0 +1,7 @@ + + {include file="$style_dir/header.html" } + {include file="$style_dir/message.html"} + {foreach from=$template_files item=file} + {include file="$style_dir/$file" } + {/foreach} + {include file="$style_dir/footer.html"} \ No newline at end of file diff --git a/upload/styles/clipbucketblue/layout/watch_video.html b/upload/styles/clipbucketblue/layout/watch_video.html index 2b606aac..50950ab1 100644 --- a/upload/styles/clipbucketblue/layout/watch_video.html +++ b/upload/styles/clipbucketblue/layout/watch_video.html @@ -26,7 +26,7 @@ -
+
This content requires JavaScript and Macromedia Flash Player 7 or higher. Get Flash