It is currently Mon May 28, 2018 1:33 pm

All times are UTC + 5:30 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Mon Aug 25, 2014 4:35 pm 
Apptha Team

Joined :
Tue Feb 21, 2012 12:15 pm

Responses Posted : 285
To assign video stream theme to video gallery plugin alone, download the video stream package from the following link http://www.apptha.com/category/theme/Wordpress/video-stream and unzip it. Now go to WP admin -> Appearance -> Themes -> Install Theme -> and choose and install "videostream.zip" file and follow the below steps.

Steps:
1) Create a new file in the below file path ../wp-content/plugins/contus-video-gallery/contusBannerSlideshow.php with the below code.

<?php
class widget_ContusBannerSlideshow_init extends WP_Widget {
function widget_ContusBannerSlideshow_init() {
$widget_ops = array('classname' => 'widget_ContusBannerSlideshow_init ', 'description' => 'Contus Banner slide show');
$this->WP_Widget('widget_ContusBannerSlideshow_init', 'Contus Banner Slide Show', $widget_ops);
}
function form($instance) {
$instance = wp_parse_args((array) $instance, array('title' => 'Contus Banner Slide Show', 'show' => '5'));
$options = get_option('widget_ContusBannerSlideshow');
$title = esc_attr($instance['title']);
$show = esc_attr($instance['show']);
?>
<p><label for="<?php echo $this->get_field_id('title'); ?>">Title: <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></label></p>
<p><label for="<?php echo $this->get_field_id('show'); ?>">Show: <input class="widefat" id="<?php echo $this->get_field_id('show'); ?>" name="<?php echo $this->get_field_name('show'); ?>" type="text" value="<?php echo $show; ?>" /></label></p>
<?php
}
function update($new_instance, $old_instance) {
$instance = $old_instance;
$instance['title'] = $new_instance['title'];
$instance['show'] = $new_instance['show'];
return $instance;
}
function widget($args, $instance) {
global $wpdb;
$query = "select id from " . $wpdb->prefix . "posts WHERE post_content like '%[videohome]%' and post_status='publish' and post_type='page' limit 1";
$pageID = $wpdb->get_var($query);
$currentPageID = get_the_ID();
if ($currentPageID == $pageID) {
extract($args, EXTR_SKIP);
global $wpdb;
$options = get_option('widget_ContusBannerSlideshow');
$title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
$show = $instance['show']; ## # of Posts we are showing
$site_url = get_bloginfo('url');
$pluginName = 'contus-video-gallery';
$bannertype = '';
if (empty($bannertype)){ $bannertype = 'featured'; }
~ ($bannertype) {
case 'popular' :
$baseref = "type=1&numberofvideos=$show";
$bannervideos = "SELECT distinct w.*,p.playlist_name FROM " . $wpdb->prefix . "hdflvvideoshare w
INNER JOIN " . $wpdb->prefix . "hdflvvideoshare_med2play m ON m.media_id = w.vid
INNER JOIN " . $wpdb->prefix . "hdflvvideoshare_playlist p ON p.pid=m.playlist_id
WHERE publish='1' AND p.is_publish='1' GROUP BY w.vid ORDER BY w.hitcount DESC LIMIT " . $show;
break;
case 'recent' :
$baseref = "type=2&numberofvideos=$show";
$bannervideos = "SELECT distinct w.*,p.playlist_name FROM " . $wpdb->prefix . "hdflvvideoshare w
INNER JOIN " . $wpdb->prefix . "hdflvvideoshare_med2play m ON m.media_id = w.vid
INNER JOIN " . $wpdb->prefix . "hdflvvideoshare_playlist p ON p.pid=m.playlist_id
WHERE publish='1' AND p.is_publish='1' GROUP BY w.vid ORDER BY w.post_date DESC LIMIT " . $show;
break;
case 'featured' :
$baseref = "type=3&numberofvideos=$show";
$bannervideos = "SELECT distinct w.*,p.playlist_name FROM " . $wpdb->prefix . "hdflvvideoshare w
INNER JOIN " . $wpdb->prefix . "hdflvvideoshare_med2play m ON m.media_id = w.vid
INNER JOIN " . $wpdb->prefix . "hdflvvideoshare_playlist p ON p.pid=m.playlist_id
WHERE featured='1' and publish='1' AND p.is_publish='1' GROUP BY w.vid ORDER BY w.ordering ASC LIMIT " . $show;
break;
case 'category' :
$bannervideos = "SELECT distinct w.*,p.playlist_name FROM " . $wpdb->prefix . "hdflvvideoshare w
INNER JOIN " . $wpdb->prefix . "hdflvvideoshare_med2play m ON m.media_id = w.vid
INNER JOIN " . $wpdb->prefix . "hdflvvideoshare_playlist p ON p.pid=m.playlist_id
WHERE (m.playlist_id = '" . intval($playid) . "') and publish='1' AND p.is_publish='1' GROUP BY w.vid ORDER BY w.ordering ASC LIMIT " . $show;
break;
default;
}
$bannerSlideShow = $wpdb->get_results($bannervideos);
?>
<script type="text/javascript">
var lt = false;
</script>
<!--[if lt IE 7]>
<script type="text/javascript">
var lt=true;
</script>
<![endif]-->
<!--[if lt IE 8]>
<script type="text/javascript">
var lt=true;
</script>
<![endif]-->
<!--[if lt IE 9]>
<script type="text/javascript">
var lt=true;
</script>
<![endif]-->
<script type="text/javascript">
var baseurl;
baseurl = '<?php echo $site_url; ?>';
$(document).ready(function() {
$("#featured").tabs({fx: {opacity: "toggle"}}).tabs("rotate", 5000, true);
var get_width = 'auto';
if (get_width == 'auto')
{
var theme_width = '960';
}
var actual_width = parseInt(theme_width);
$("#featured").css('width', actual_width);
$("#slider_banner > ul").tabs({fx: {opacity: "toggle"}}).tabs("rotate", '3000', true);
});
function currentVideo(vid, videoids) {
for (var i = 0; i < videoids.length; i++) {
if (videoids[i] != vid) {
var prev_fragment = document.getElementById('nav-fragment-' + videoids[i])
prev_fragment.className = "ui-tabs-nav-item";
}
}
var fragment = document.getElementById('nav-fragment-' + vid)
fragment.className += " ui-tabs-selected";
}
function switchVideo(vid) {
sourceCode = document.getElementById(vid).innerHTML;
embedCode = sourceCode.replace('embecontus', 'embed');
embedCode = embedCode.replace('iframcontus', 'iframe');
embedCode = embedCode.replace('videcontus', 'video');
if (lt == true) {
embedCode = sourceCode.replace('EMBECONTUS', 'EMBED');
embedCode = embedCode.replace('IFRAMCONTUS', 'IFRAME');
embedCode = embedCode.replace('VIDECONTUS', 'IFRAME');
}
document.getElementById("nav-" + vid).className = 'ui-tabs-nav-item ui-tabs-selected';
removeSelectItem = document.getElementById("activeCSS").value;
document.getElementById("nav-" + removeSelectItem).className = 'ui-tabs-nav-item';
document.getElementById('videoPlay').innerHTML = embedCode;
document.getElementById("activeCSS").value = vid;

}
window.onload = function() {
vid = "fragment-<?php echo $bannerSlideShow[0]->vid; ?>";
sourceCode = document.getElementById(vid).innerHTML;
embedCode = sourceCode.replace('embecontus', 'embed');
embedCode = embedCode.replace('iframcontus', 'iframe');
embedCode = embedCode.replace('videcontus', 'video');
if (lt == true) {
embedCode = sourceCode.replace('EMBECONTUS', 'EMBED');
embedCode = embedCode.replace('IFRAMCONTUS', 'IFRAME');
embedCode = embedCode.replace('VIDECONTUS', 'IFRAME');
}
document.getElementById("nav-" + vid).className = 'ui-tabs-nav-item ui-tabs-selected';
document.getElementById('videoPlay').innerHTML = embedCode;
}
</script>
<?php
function videostream_detectmobile() {
$_SERVER['ALL_HTTP'] = isset($_SERVER['ALL_HTTP']) ? $_SERVER['ALL_HTTP'] : '';
$mobile_browser = '0';
$agent = strtolower($_SERVER['HTTP_USER_AGENT']);
if (preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|iphone|ipad|ipod|android|xoom)/i', $agent))
$mobile_browser++;
if ((isset($_SERVER['HTTP_ACCEPT'])) and (strpos(strtolower($_SERVER['HTTP_ACCEPT']), 'application/vnd.wap.xhtml+xml') !== false))
$mobile_browser++;
if (isset($_SERVER['HTTP_X_WAP_PROFILE']))
$mobile_browser++;
if (isset($_SERVER['HTTP_PROFILE']))
$mobile_browser++;
$mobile_ua = substr($agent, 0, 4);
$mobile_agents = array('w3c ', 'acs-', 'alav', 'alca', 'amoi', 'audi', 'avan', 'benq', 'bird', 'blac','blaz', 'brew', 'cell', 'cldc', 'cmd-', 'dang', 'doco', 'eric', 'hipt', 'inno','ipaq', 'java', 'jigs', 'kddi', 'keji', 'leno', 'lg-c', 'lg-d', 'lg-g', 'lge-','maui', 'maxo', 'midp', 'mits', 'mmef', 'mobi', 'mot-', 'moto', 'mwbp', 'nec-','newt', 'noki', 'oper', 'palm', 'pana', 'pant', 'phil', 'play', 'port', 'prox','qwap', 'sage', 'sams', 'sany', 'sch-', 'sec-', 'send', 'seri', 'sgh-', 'shar','sie-', 'siem', 'smal', 'smar', 'sony', 'sph-', 'symb', 't-mo', 'teli', 'tim-','tosh', 'tsm-', 'upg1', 'upsi', 'vk-v', 'voda', 'wap-', 'wapa', 'wapi', 'wapp','wapr', 'webc', 'winw', 'xda', 'xda-');
if (in_array($mobile_ua, $mobile_agents))
$mobile_browser++;
if (strpos(strtolower($_SERVER['ALL_HTTP']), 'operamini') !== false)
$mobile_browser++;
if (strpos($agent, 'windows') !== false)
$mobile_browser = 0;
if (strpos($agent, 'windows phone') !== false)
$mobile_browser++;
if ($mobile_browser > 0)
return true;
else
return false;
}
$moreName = $wpdb->get_var("select ID from " . $wpdb->prefix . "posts WHERE post_content='[videomore]'");
echo $before_widget;
$div = '<div id="contusfeatured" class="sidebar-wrap clearfix">
<div><a href="' . $site_url . '/?page_id=' . $moreName . '&more=fea"><h2 class="widget-title">Feature Videos</h2></a></div>';
$show = $options['show'];
$moreF = $wpdb->get_results("select count(*) as contus from " . $wpdb->prefix . "hdflvvideoshare WHERE featured='1'");
$countF = $moreF[0]->contus;
$div .='<ul class="ulwidget">';
if (!empty($bannerSlideShow)) {
?>
<div id="featured"><div class="page-bannershort" id="gallery_banner_list" ><ul class="page-lof-navigator">
<?php for ($i = 0; $i < count($bannerSlideShow); $i++) { ?>
<li class="ui-tabs-nav-item " id="nav-fragment-<?php echo $bannerSlideShow[$i]->vid; ?>">
<div class="nav_container"><a href="javascript:void(0)" onclick=switchVideo("fragment-<?php echo $bannerSlideShow[$i]->vid; ?>")><div class="page-thumb-img"><img src="<?php echo $bannerSlideShow[$i]->image; ?>" alt="thumb image" /></div><div class="slide_video_info" ><?php echo substr($bannerSlideShow[$i]->name, 0, 25); ?><div class="category"><?php echo $bannerSlideShow[$i]->playlist_name ?></div></div></a></div></li>
<?php } ?>
</ul></div><div id="lofslidecontent45" class="lof-slidecontent lof-snleft"><div class="right_side"><div id="videoPlay" class="ui-tabs-panel" style="height:100%"></div></div><input type="hidden" id="activeCSS" value="fragment-<?php echo $bannerSlideShow[0]->vid; ?>" /><?php
for ($i = 0; $i < count($bannerSlideShow); $i++) {
if ($bannertype == 'category')
$baseref = "&pid=" . $playid;
?>
<div id="fragment-<?php echo $bannerSlideShow[$i]->vid; ?>" class="ui-tabs-panel" style="height:100%;float:right">
<?php
$file_type = $bannerSlideShow[$i]->file_type;
if ($file_type == 5) {
$bannerembedcode = stripslashes($bannerSlideShow[$i]->embedcode);
$banneriframecode = str_replace('<iframe', '<iframcontus', $bannerembedcode);
$banneriframewidth = str_replace('width=', 'width="100"', $banneriframecode);
echo str_replace('height=', 'height="335"', $banneriframewidth);
} else {
$mobile = videostream_detectmobile();
if ($mobile === true) {
$videourl = $bannerSlideShow[$i]->file;
$_imagePath = APPTHA_VGALLERY_BASEURL . 'images' . DS;
$image_path = str_replace('plugins/contus-video-gallery/', 'uploads/videogallery/', APPTHA_VGALLERY_BASEURL);
$imgurl = $bannerSlideShow[$i]->image;
$file_type = $bannerSlideShow[$i]->file_type;
if ($imgurl == '') { $imgurl = $_imagePath . 'nothumbimage.jpg'; } else { if ($file_type == 2) { $imgurl = $image_path . $imgurl; }
}
if (preg_match('/www\.youtube\.com\/watch\?v=[^&]+/', $videourl, $vresult)) {
$urlArray = explode("=", $vresult[0]);$videoid = trim($urlArray[1]);
?>
<iframcontus type="text/html" width="100%" height="335" src="http://www.youtube.com/embed/<?php echo $videoid; ?>" frameborder="0">
</iframcontus>
<?php
} else {
if ($file_type == 2) { $videourl = $image_path . $videourl; } else if ($file_type == 4) { $streamer = str_replace("rtmp://", "http://", $bannerSlideShow[$i]->streamer_path);$videourl = $streamer . '_definst_/mp4:' . $videourl . '/playlist.m3u8'; }
?>
<videcontus id='video' width="100%" height="335" poster='<?php echo $imgurl; ?>' src='<?php echo $videourl; ?>' autobuffer controls onerror='failed(event)'>Html5 Not support This video Format.</video>
<?php
} } else { ?>
<embecontus src="<?php echo $site_url . '/wp-content/plugins/' . $pluginName . '/hdflvplayer/hdplayer.swf'; ?>" flashvars="baserefW=<?php echo $site_url; ?>&banner=true&mtype=playerModule&vid=<?php echo $bannerSlideShow[$i]->vid; ?>&<?php echo $baseref; ?>&Preview=<?php echo $bannerSlideShow[$i]->image; ?>" style="width:680px; height: 335px" allowFullScreen="true" allowScriptAccess="always" type="application/x-shockwave-flash" wmode="transparent"></embecontus>
<?php }
} ?>
</div>
<?php } ?>
</div>
</div>
<?php
} else { $div .="No Banner videos"; }
if (($show < $countF) || ($show == $countF)) {
$div .='<div align="right"><a href="' . $site_url . '/?page_id=' . $moreName . '&more=fea">More</a></div>';
} else {
$div .='<div align="right"> </div>';
}
$div .='</ul></div>';
echo $after_widget;
}
}
}
add_action('widgets_init', create_function('', 'return register_widget("widget_ContusBannerSlideshow_init");')); ##adding product tag widget
?>

2) Open hdflvvideoshare.php file from the following path ../wp-content/plugins/contus-video-gallery/hdflvvideoshare.php and find the below code

if (file_exists($widgetPath . '/contusBannerSlideshow.php')) {
include_once($widgetPath . '/contusBannerSlideshow.php');
}

Now replace with the following code

if (file_exists($widgetPath . '/contusBannerSlideshow.php')) {
include_once($widgetPath . '/contusBannerSlideshow.php');
} else {
include_once(dirname(__FILE__) . '/contusBannerSlideshow.php');
}

3) Download and install the "jonradio Multiple Themes" plugin from the following link http://wordpress.org/plugins/jonradio-multiple-themes/. Don't activate it.

4) Now download and install the "Theme Test Drive" plugin from the following link http://wordpress.org/extend/plugins/theme-test-drive/ and activate it.

5) Now, go to admin -> Appearance -> Theme Test Drive.

6) In the "Usage" section, select an alternate theme as "video stream".

7) Click the "Enable Theme Drive" button at the bottom.

8) Go to admin -> Appearance -> widgets -> then drag and drop video gallery widgets to the corresponding video stream theme positions.

Available Position and Widgets (Ex:)

Header Widget Area - Contus Video Search
Top Menu Widget Area - Contus Video Category
Banner Widget Area - Contus Banner Slideshow
Sidebar Widget Area - Contus Recent videos, Contus Popular Videos, Contus Featured Videos

9) Deactivate the "Theme Test Drive" plugin and Activate "jonradio Multiple Themes"

10) Go to admin -> Appearance -> Multiple Themes Plugin

11) Here, find the section "For An Individual Page, Post or other non-Admin page;
or a group of pages, specified by URL Prefix, optionally with Asterisk(s)"

12) In this section, select url option for Select here if URL is a Prefix and video stream in the drop down box for Theme.

13) Give your video home page url in the text box of the "URL of Page, Post, Prefix or other"

14) Then, in the same page find the "For A Query Keyword=Value on any Page, Post or other non-Admin page" section.

15) Select video stream in the drop down box for Theme.

16) Type "post_type" text in the given text box for the "Query Keyword" and type "videogallery" text in the given text box for the "Query Value".

17) Then Click "Save Changes" button.

Again in the same page find the section "For An Individual Page, Post or other non-Admin page;
or a group of pages, specified by URL Prefix, optionally with Asterisk(s)"

18) In this section, select url option for Select here if URL is a Prefix and video stream in the drop down box for Theme.

19) Give your video categories page url in the text box of the "URL of Page, Post, Prefix or other"

20) Then Click "Save Changes" button.

If you are using the permalink structure as other than "default" then, go to admin -> Appearance -> Multiple Themes Plugin

1) Here, again find the section "For An Individual Page, Post or other non-Admin page;
or a group of pages, specified by URL Prefix, optionally with Asterisk(s)"

2) In this section, select url prefix option for Select here if URL is a Prefix and video stream in the drop down box for Theme.

3) Give your video detail page url upto videogallery text (Ex: sitename/videogallery/) in the text box of the "URL of Page, Post, Prefix or other"

4) Then Click "Save changes" button.

Note: If you have noticed any of our plugin page have not video stream theme, then copy the url and again follow the steps 11 to 14.

If you are facing any difficulties in this, feel free to contact us.


Last edited by contusteam on Tue Sep 27, 2016 5:47 pm, edited 1 time in total.
taurite


Report this post
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 5:30 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron