'.__( 'WpStream Pay Per View / Subscription mode works only with WooCommerce - If you want to charge money for your live events or videos you need to activate WooCommerce plugin', 'wpestate' ).'
'.__( 'The php CURL library is not enabled on your server. WpStream plugin needs this library in order to work. Please address this issue with your hosting provider.', 'wpestate' ).'
';
}
}
add_action( 'admin_notices', 'wpstream_admin_notice' );
function wpstream_enqueue_styles() {
wp_enqueue_style('wpstream-style', WPSTREAM_PLUGIN_DIR_URL .'/wpstream_style.css' );
wp_enqueue_style('video-js.min', WPSTREAM_PLUGIN_DIR_URL.'/css/video-js.min.css', array(), '1.0', 'all');
wp_enqueue_script('video.min', WPSTREAM_PLUGIN_DIR_URL.'js/video.min.js',array(), '1.0', false);
wp_enqueue_script('videojs-contrib-hls', WPSTREAM_PLUGIN_DIR_URL.'js/videojs-contrib-hls.min.js',array('video.min'), '1.0', false);
wp_enqueue_script('youtube.min', WPSTREAM_PLUGIN_DIR_URL.'js/youtube.min.js',array('video.min'), '1.0', false);
wp_enqueue_script('videojs-vimeo.min', WPSTREAM_PLUGIN_DIR_URL.'js/videojs-vimeo.min.js',array('video.min'), '1.0', false);
}
function wpstream_enqueue_styles_admin(){
wp_enqueue_script("jquery-ui-slider");
wp_enqueue_script("jquery-ui-datepicker");
wp_enqueue_script('wpstream-jquery.fileupload', WPSTREAM_PLUGIN_DIR_URL.'js/jquery.fileupload.js',array(), '1.0', true);
wp_enqueue_style ('admin-css', WPSTREAM_PLUGIN_DIR_URL.'/css/admin_style.css', array(), '1.0', 'all');
wp_enqueue_script('wpstream-admin-control', WPSTREAM_PLUGIN_DIR_URL.'js/admin_control.js',array(), '1.0', true);
wp_localize_script('wpstream-admin-control', 'wpstream_admin_control_vars',
array(
'admin_url' => get_admin_url(),
'loading_url' => WPSTREAM_PLUGIN_DIR_URL.'/img/loading.gif',
'download_mess' => esc_html__('Click to download! The url will work for the next 20 minutes! Refresh page if you need to generate the link again!','wpstream'),
'uploading' => esc_html('We are uploading your file.Do not close this window!','wpstream'),
'upload_complete2' => esc_html('Upload Complete! You can upload another file!','wpstream'),
'not_accepted' => esc_html('The file is not an accepted video format','wpstream'),
'upload_complete' => esc_html('Upload Complete!','wpstream'),
'no_band' => esc_html('Not enough bandwidth.','wpsteam'),
'no_band_no_store' => esc_html('Not enough bandwidth or storage.','wpsteam')
));
}
function wpstream_my_custom_endpoints() {
add_rewrite_endpoint( 'video-list', EP_ROOT | EP_PAGES );
add_rewrite_endpoint( 'event-list', EP_ROOT | EP_PAGES );
}
function wpstream_my_custom_query_vars( $vars ) {
$vars[] = 'video-list';
$vars[] = 'event-list';
return $vars;
}
function wpstream_custom_flush_rewrite_rules() {
flush_rewrite_rules();
}
function wpstream_custom_my_account_menu_items( $items ) {
if(function_exists('wpstream_is_global_subscription') && wpstream_is_global_subscription()){
$items = array(
'dashboard' => __( 'Dashboard', 'woocommerce' ),
'orders' => __( 'Orders', 'woocommerce' ),
'edit-address' => __( 'Addresses', 'woocommerce' ),
'edit-account' => __( 'Edit Account', 'woocommerce' ),
'customer-logout' => __( 'Logout', 'woocommerce' ),
);
}else{
$items = array(
'dashboard' => __( 'Dashboard', 'woocommerce' ),
'orders' => __( 'Orders', 'woocommerce' ),
'edit-address' => __( 'Addresses', 'woocommerce' ),
'edit-account' => __( 'Edit Account', 'woocommerce' ),
'event-list' => __( 'Events', 'wpstream' ),
'video-list' => __( 'Videos', 'wpstream' ),
'customer-logout' => __( 'Logout', 'woocommerce' ),
);
}
return $items;
}
function wpstream_custom_endpoint_content_event_list() {
include 'woocommerce/myaccount/event_list.php';
}
function wpstream_custom_endpoint_video_list() {
include 'woocommerce/myaccount/video_list.php';
}
function wpstream_user_logged_in_product_already_bought($from_sh_id='') {
if ( is_user_logged_in() ) {
global $product;
$current_user = wp_get_current_user();
$product_id = $product->get_id();
if ( wc_customer_bought_product( $current_user->user_email, $current_user->ID, $product_id) || ( function_exists('wcs_user_has_subscription') && wcs_user_has_subscription( $current_user->ID, $product_id ,'active') ) ){
echo '