diff --git a/upload/includes/classes/video.class.php b/upload/includes/classes/video.class.php index a95f09b9..ec95a61d 100644 --- a/upload/includes/classes/video.class.php +++ b/upload/includes/classes/video.class.php @@ -667,7 +667,7 @@ class CBvideo extends CBCategory $embed_code = false; - $funcs = $this->embed_func_listl; + $funcs = $this->embed_func_list; if(is_array($funcs)) { foreach($funcs as $func) diff --git a/upload/includes/common.php b/upload/includes/common.php index 6b4a2029..97a42e1f 100644 --- a/upload/includes/common.php +++ b/upload/includes/common.php @@ -280,6 +280,9 @@ if(phpversion() < '5.2.0') //Enable youtube videos define("YOUTUBE_ENABLED",$row['youtube_enabled']); + define("EMBED_VDO_WIDTH","480"); + define("EMBED_VDO_HEIGHT","385"); + include 'plugin.functions.php'; include 'plugins_functions.php'; require BASEDIR.'/includes/templatelib/Template.class.php'; @@ -307,6 +310,7 @@ if(phpversion() < '5.2.0') define('ALLOWED_VDO_CATS',$row['video_categories']); define('ALLOWED_CATEGORIES',3); + //Assigning Smarty Tags & Values Assign('CB_VERSION',CB_VERSION); Assign('FFMPEG_FLVTOOLS_BINARY',FFMPEG_FLVTOOLS_BINARY); diff --git a/upload/includes/functions.php b/upload/includes/functions.php index 274ac611..a3618799 100644 --- a/upload/includes/functions.php +++ b/upload/includes/functions.php @@ -2362,7 +2362,7 @@ * Function used to display * Blank Screen * if there is nothing to play or to show - * then who a blank screen + * then show a blank screen */ function blank_screen($data) { @@ -4150,4 +4150,23 @@ return $filename; } + /** + * Function used to generate + * embed code of embedded video + */ + function embeded_code($vdetails) + { + $code = ''; + $code .= ''; + $code .= ''; + $code .= ''; + //Replacing Height And Width + $h_w_p = array("{Width}","{Height}"); + $h_w_r = array(EMBED_VDO_WIDTH,EMBED_VDO_HEIGHT); + $embed_code = str_replace($h_w_p,$h_w_r,$vdetails['embed_code']); + $code .= unhtmlentities($embed_code); + $code .= ''; + return $code; + } + ?> \ No newline at end of file diff --git a/upload/includes/plugin.functions.php b/upload/includes/plugin.functions.php index 8b24bc20..9682a618 100644 --- a/upload/includes/plugin.functions.php +++ b/upload/includes/plugin.functions.php @@ -349,4 +349,13 @@ } } + /** + * Regiseter Embed Function + */ + function register_embed_function($name) + { + global $cbvid; + $cbvid->embed_func_list [] = $name; + } + ?> \ No newline at end of file diff --git a/upload/install/cb_v2.sql b/upload/install/cb_v2.sql index 4eab4b17..7d11008f 100644 --- a/upload/install/cb_v2.sql +++ b/upload/install/cb_v2.sql @@ -227,7 +227,7 @@ INSERT INTO `{tbl_prefix}config` (`configid`, `name`, `value`) VALUES (56, 'allow_language_change', '1'), (57, 'default_site_lang', ''), (58, 'video_require_login', ''), -(59, 'audio_codec', 'mp3'), +(59, 'audio_codec', 'libmp3lame'), (60, 'con_modules_type', ''), (61, 'remoteUpload', ''), (62, 'embedUpload', ''), diff --git a/upload/player/cbplayer/cbplayer.plug.php b/upload/player/cbplayer/cbplayer.plug.php index 61017184..6b9c721e 100644 --- a/upload/player/cbplayer/cbplayer.plug.php +++ b/upload/player/cbplayer/cbplayer.plug.php @@ -38,9 +38,9 @@ if(!function_exists('cbplayer')) $code = "var flashvars = {\n"; $code .= " htmlPage: document.location,\n"; if($data['hq']) - $code .= "settingsFile: \"".PLAYER_URL."/cbplayer/settings.php?hqid=".$vdata['videoid']."&autplay=".$data['autoplay']."\"\n"; + $code .= "settingsFile: \"".PLAYER_URL."/cbplayer/settings.php?hqid=".$vdata['videoid']."&autoplay=".$data['autoplay']."\"\n"; else - $code .= "settingsFile: \"".PLAYER_URL."/cbplayer/settings.php?vid=".$vdata['videoid']."&autplay=".$data['autoplay']."\"\n"; + $code .= "settingsFile: \"".PLAYER_URL."/cbplayer/settings.php?vid=".$vdata['videoid']."&autoplay=".$data['autoplay']."\"\n"; $code .= "};\n"; $code .= "var params = {\n"; $code .= " allowFullScreen: \"true\"\n"; @@ -56,13 +56,21 @@ if(!function_exists('cbplayer')) function default_embed_code($vdetails) { + + $vid_file = get_video_file($vdata,$no_video,false); + if($vid_file) + { $code = ''; - $code .= ''; + $code .= ''; $code .= ''; $code .= ''; $code .= ''; $code .= ''; $code .= ''; + }else + { + return embeded_code($vdetails); + } return $code; } diff --git a/upload/player/cbplayer/settings.php b/upload/player/cbplayer/settings.php index b33c3086..c2db9eb0 100644 --- a/upload/player/cbplayer/settings.php +++ b/upload/player/cbplayer/settings.php @@ -36,7 +36,7 @@ echo ''; - + diff --git a/upload/player/hdflvplayer/hdflvplayer.plug.php b/upload/player/hdflvplayer/hdflvplayer.plug.php index 1fb68303..7173e006 100644 --- a/upload/player/hdflvplayer/hdflvplayer.plug.php +++ b/upload/player/hdflvplayer/hdflvplayer.plug.php @@ -1,7 +1,7 @@ "; + $code .= ""; + $code .= ""; + $code .= ""; + $code .= ""; + $code .= " \ No newline at end of file diff --git a/upload/player/jw_smart/jw_smart.php b/upload/player/jw_smart/jw_smart.php index 50805bac..4214c2ac 100644 --- a/upload/player/jw_smart/jw_smart.php +++ b/upload/player/jw_smart/jw_smart.php @@ -109,7 +109,52 @@ if(!function_exists("jw_smart")) return false; } + function jw_embed_code($vdetails) + { + + $vid_file = get_video_file($vdetails,false,true); + //Checking for YT Referal + $ref = $vdetails['refer_url']; + //Checking for youtube + if(function_exists('is_ref_youtube')) + $ytcom = is_ref_youtube($ref); + if($ytcom) + $is_youtube = true; + else + $is_youtube = false; + + if($vid_file || $is_youtube) + { + if(!$vid_file) + $vid_file = urlencode($ref); + $code = ''; + $code .= ""; + $code .= ""; + $code .= ""; + $code .= ""; + $code .= ""; + $code .= "'global')); register_actions_play_video('jw_smart'); + register_embed_function('jw_embed_code'); + //Adding Embed Function + } ?> \ No newline at end of file diff --git a/upload/plugins/embed_video_mod/embed_video_mod.php b/upload/plugins/embed_video_mod/embed_video_mod.php index 7396df01..f1e8a392 100644 --- a/upload/plugins/embed_video_mod/embed_video_mod.php +++ b/upload/plugins/embed_video_mod/embed_video_mod.php @@ -217,7 +217,7 @@ if(!function_exists('validate_embed_code')) if(!empty($vdetails['embed_code']) && $vdetails['embed_code'] !=' ' && $vdetails['embed_code'] !='none') { //Parsing Emebd Codek, Getting Referal URL if possible and add AUTPLAY on of option - $ref_url = get_refer_url_from_embed_code(unhtmlentities($vdetails['embed_code'])); + $ref_url = get_refer_url_from_embed_code(unhtmlentities(stripslashes($vdetails['embed_code']))); $ref_url = $ref_url['url']; $db->update(tbl("video"),array("status","refer_url"),array('Successful',$ref_url)," videoid='$vid'"); } diff --git a/upload/search_result.php b/upload/search_result.php index 1f5838c9..67102f1a 100644 --- a/upload/search_result.php +++ b/upload/search_result.php @@ -11,14 +11,14 @@ require 'includes/config.inc.php'; $pages->page_redir(); $page = mysql_clean($_GET['page']); -$type = $_GET['type'] ; +$type = mysql_clean($_GET['type']) ; $type = $type ? $type : 'videos'; $search = cbsearch::init_search($type); -$search->key = $_GET['query']; -$search->category = $_GET['category']; -$search->date_margin = $_GET['datemargin']; -$search->sort_by = $_GET['sort']; +$search->key = mysql_clean($_GET['query']); +$search->category = mysql_clean($_GET['category']); +$search->date_margin = mysql_clean($_GET['datemargin']); +$search->sort_by = mysql_clean($_GET['sort']); $search->limit = create_query_limit($page,$search->results_per_page); $results = $search->search();