update distributed encoding system

parent 8ec403d5
...@@ -30,6 +30,10 @@ ...@@ -30,6 +30,10 @@
.woocommerce-form-row--last + div + p { .woocommerce-form-row--last + div + p {
display: none; display: none;
} }
label.wc-stripe-label-payment-type {
color: #939191 !important;
}
/*.col-full{ */ /*.col-full{ */
/* max-width:66%; */ /* max-width:66%; */
/* margin-left: 0; /* margin-left: 0;
......
...@@ -153,7 +153,7 @@ ul.products li.sexhack_thumbli { ...@@ -153,7 +153,7 @@ ul.products li.sexhack_thumbli {
width:90%; width:90%;
} }
.sexhack_thumb_cont .sexhack_thumb_hover { .sexhack_thumb_cont .sexhack_thumb_hover {
width: 90%; width: 100%;
} }
} }
......
...@@ -88,10 +88,18 @@ if(!class_exists('SH_Admin')) { ...@@ -88,10 +88,18 @@ if(!class_exists('SH_Admin')) {
register_setting('sexhackme-gallery-settings', 'sexhack_video_flat_path'); register_setting('sexhackme-gallery-settings', 'sexhack_video_flat_path');
register_setting('sexhackme-gallery-settings', 'sexhack_video_vr_path'); register_setting('sexhackme-gallery-settings', 'sexhack_video_vr_path');
register_setting('sexhackme-gallery-settings', 'sexhack_video_hls_storage'); register_setting('sexhackme-gallery-settings', 'sexhack_video_hls_storage');
register_setting('sexhackme-gallery-settings', 'sexhack_video_hls_uri');
register_setting('sexhackme-gallery-settings', 'sexhack_video_video_storage'); register_setting('sexhackme-gallery-settings', 'sexhack_video_video_storage');
register_setting('sexhackme-gallery-settings', 'sexhack_video_video_uri');
register_setting('sexhackme-gallery-settings', 'sexhack_video_photo_storage'); register_setting('sexhackme-gallery-settings', 'sexhack_video_photo_storage');
register_setting('sexhackme-gallery-settings', 'sexhack_video_photo_uri');
register_setting('sexhackme-gallery-settings', 'sexhack_video_gif_storage'); register_setting('sexhackme-gallery-settings', 'sexhack_video_gif_storage');
register_setting('sexhackme-gallery-settings', 'sexhack_video_gif_uri');
register_setting('sexhackme-gallery-settings', 'sexhack_video_vr_storage'); register_setting('sexhackme-gallery-settings', 'sexhack_video_vr_storage');
register_setting('sexhackme-gallery-settings', 'sexhack_video_vr_uri');
register_setting('sexhackme-gallery-settings', 'sexhack_thumbnail_storage');
register_setting('sexhackme-gallery-settings', 'sexhack_thumbnail_uri');
register_setting('sexhackme-gallery-settings', 'sexhack_socialpost_storage');
add_action('update_option', '\wp_SexHackMe\SH_Admin::update_gallery_slug', 10, 3); add_action('update_option', '\wp_SexHackMe\SH_Admin::update_gallery_slug', 10, 3);
//register_setting('sexhackme-gallery-settings', 'sexhack_gallery_slug'); //register_setting('sexhackme-gallery-settings', 'sexhack_gallery_slug');
} }
......
...@@ -50,7 +50,7 @@ if(!class_exists('SH_PostType_Video')) { ...@@ -50,7 +50,7 @@ if(!class_exists('SH_PostType_Video')) {
if(!is_object($post) || ($post->post_type!='sexhack_video')) if(!is_object($post) || ($post->post_type!='sexhack_video'))
return; return;
//sexhack_log("STATUS CHANGE: post ".$post->ID." changed from $old to $new"); sexhack_log("STATUS CHANGE: post ".$post->ID." changed from $old to $new");
if($old===$new) return; if($old===$new) return;
$video = sh_get_video_from_post($post); $video = sh_get_video_from_post($post);
...@@ -59,10 +59,10 @@ if(!class_exists('SH_PostType_Video')) { ...@@ -59,10 +59,10 @@ if(!class_exists('SH_PostType_Video')) {
$vold = $video->status; $vold = $video->status;
if($new=='publish' && $video->status == 'ready') $video->status = 'published'; if($new=='publish' && $video->status == 'ready') $video->status = 'published';
else if($new!='publish' && $video->status == 'published') $video->status = 'ready'; else if($new!='publish' && $video->status == 'published') $video->status = 'ready';
sexhack_log(" * video ".$video->id." is ".$video->status." (was $vold)");
//sexhack_log(" * video ".$video->id." is ".$video->status." (was $vold)"); if($vold!=$video->status) sh_save_video($video, 'POST_TYPE');
if($vold!=$video->status) sh_save_video($video);
} }
} }
......
...@@ -45,14 +45,15 @@ if(!class_exists('SH_Query')) { ...@@ -45,14 +45,15 @@ if(!class_exists('SH_Query')) {
} }
public static function save_Video($video) public static function save_Video($video, $source=false)
{ {
global $wpdb; global $wpdb;
if($source) sexhack_log("save_Video called from $source");
if(is_object($video)) if(is_object($video))
{ {
$video = apply_filters('video_before_save', $video); $video = apply_filters('video_before_save', $video);
//sexhack_log($video); //sexhack_log($video);
$fieldsarrayraw = $video->get_sql_array(); $fieldsarrayraw = $video->get_sql_array();
...@@ -120,7 +121,8 @@ if(!class_exists('SH_Query')) { ...@@ -120,7 +121,8 @@ if(!class_exists('SH_Query')) {
$wpdb->query( $sql ); $wpdb->query( $sql );
if($updateid) $video->id = $wpdb->insert_id; if($updateid) $video->id = $wpdb->insert_id;
//sexhack_log($sql); if($source) sexhack_log("QUERY FOR save_Video called from $source");
sexhack_log($sql);
foreach($video->get_categories() as $cat) foreach($video->get_categories() as $cat)
{ {
...@@ -275,7 +277,7 @@ if(!class_exists('SH_Query')) { ...@@ -275,7 +277,7 @@ if(!class_exists('SH_Query')) {
public static function get_VideosCat($vcat=false) public static function get_VideosCat($vcat=false, $filtering=false)
{ {
global $wpdb; global $wpdb;
...@@ -302,14 +304,21 @@ if(!class_exists('SH_Query')) { ...@@ -302,14 +304,21 @@ if(!class_exists('SH_Query')) {
$results = array(); $results = array();
//$sql = $wpdb->prepare("SELECT * from {$wpdb->prefix}{$prefix}videos"); //$sql = $wpdb->prepare("SELECT * from {$wpdb->prefix}{$prefix}videos");
$sql = "SELECT * FROM {$wpdb->prefix}".SH_PREFIX."videos"; $sql = "SELECT * FROM {$wpdb->prefix}".SH_PREFIX."videos";
if($filter) $sql .= " WHERE ".$filter."!=''"; if($filter) $sql .= " WHERE ".$filter."!=''";
if($filter && $filtering) $sql .= " AND ";
else if(!$filter && $filtering) $sql .= " WHERE ";
if($filtering) $sql .= " ".$filtering." ";
$dbres = $wpdb->get_results( $sql, ARRAY_A ); $dbres = $wpdb->get_results( $sql, ARRAY_A );
sexhack_log($dbres); //sexhack_log($dbres);
foreach($dbres as $row) foreach($dbres as $row)
{ {
$results[] = new SH_Video($row); $results[] = new SH_Video($row);
} }
sexhack_log($results); //sexhack_log($results);
return $results; return $results;
......
...@@ -127,15 +127,19 @@ if(!class_exists('SH_Shortcodes')) { ...@@ -127,15 +127,19 @@ if(!class_exists('SH_Shortcodes')) {
$html = "<div class='sexhack_gallery'>"; //<h3>SexHack VideoGallery</h3>"; $html = "<div class='sexhack_gallery'>"; //<h3>SexHack VideoGallery</h3>";
if(isset($_GET['SHDEV'])) $html .= '<h3>DEVELOPEMENT MODE</h3>'; if(isset($_GET['SHDEV'])) $html .= '<h3>DEVELOPEMENT MODE</h3>';
$html .= '<ul class="products columns-4">'; $html .= '<ul class="products columns-4">';
$videos = $sh_videogallery->get_videos_by_cat(); $videos = $sh_videogallery->get_videos_by_cat(filtering: "status='published' ORDER BY created DESC");
$sep=1;
foreach($videos as $video) foreach($videos as $video)
{ {
if($video->status == 'published') //if($video->status == 'published')
{ //{
$post = $video->get_post(); $post = $video->get_post();
if($post) setup_postdata($post); if($post) setup_postdata($post);
$html .= $sh_videogallery->get_video_thumb($video); $html .= $sh_videogallery->get_video_thumb($video);
} if($sep==4) $html .= '<li class="product type-product sexhack_thumbli" style="width:100% !important; margin-bottom: 1px !important;"> </li>';
$sep=$sep+1;
if($sep==5) $sep=1;
//}
} }
wp_reset_postdata(); wp_reset_postdata();
$html .= "</ul></div>"; $html .= "</ul></div>";
......
...@@ -46,6 +46,11 @@ if(!class_exists('SH_StoreFront')) { ...@@ -46,6 +46,11 @@ if(!class_exists('SH_StoreFront')) {
// add footer disclaimer // add footer disclaimer
//add_action('storefront_footer', 'wp_SexHackMe\sh_get_disclaimer')); // XXX I don't like positioning this way. Fix in CSS or sobstitute footer theme file? //add_action('storefront_footer', 'wp_SexHackMe\sh_get_disclaimer')); // XXX I don't like positioning this way. Fix in CSS or sobstitute footer theme file?
// add footer navigation menu
register_nav_menu('shm-footer-menu',__( 'Sexhackme Footer Menu' ));
add_action( 'storefront_footer', 'wp_SexHackMe\SH_StoreFront::footer_menu', 15);
// Re add the cart in the right position // Re add the cart in the right position
add_action( 'storefront_header', 'storefront_header_cart', 40); add_action( 'storefront_header', 'storefront_header_cart', 40);
...@@ -68,6 +73,13 @@ if(!class_exists('SH_StoreFront')) { ...@@ -68,6 +73,13 @@ if(!class_exists('SH_StoreFront')) {
} }
} }
public static function footer_menu()
{
echo '<nav class=\'secondary-navigation\' role=\'navigation\' aria-label=\'Secondary Navigation\' >';
wp_nav_menu(array('theme_location' => 'shm-footer-menu'));
echo '</nav>';
}
public static function credits($cred) public static function credits($cred)
{ {
return ''; return '';
......
...@@ -78,7 +78,8 @@ if(!class_exists('SH_Video')) { ...@@ -78,7 +78,8 @@ if(!class_exists('SH_Video')) {
'views_public' => 0, 'views_public' => 0,
'views_members' => 0, 'views_members' => 0,
'views_premium' => 0, 'views_premium' => 0,
'sales' => 0 'sales' => 0,
'socialpost' => 0
); );
public function __construct($attr=false) public function __construct($attr=false)
{ {
...@@ -267,6 +268,20 @@ if(!class_exists('SH_Video')) { ...@@ -267,6 +268,20 @@ if(!class_exists('SH_Video')) {
} }
public function user_bought_video($uid=False)
{
if(!isset($this->attributes['product_id'])) return false;
if(!$uid && get_current_user_id())
{
if(wc_customer_bought_product( '', get_current_user_id(), $this->attributes['product_id'])) return true;
}
else if($uid && intval($uid))
{
if(wc_customer_bought_product( '', $uid, $this->attributes['product_id'])) return true;
}
return false;
}
// Repopulate the object from $post or $post->ID // Repopulate the object from $post or $post->ID
public function update_video_from_post($p) public function update_video_from_post($p)
{ {
......
...@@ -85,11 +85,11 @@ if(!class_exists('SH_VideoGallery')) { ...@@ -85,11 +85,11 @@ if(!class_exists('SH_VideoGallery')) {
} }
} }
public function get_videos_by_cat($vcat=false) { public function get_videos_by_cat($vcat=false, $filtering=false) {
// XXX TODO Only published videos! // XXX TODO Only published videos!
if(!$this->videolist && !$vcat) $this->videolist = sh_get_videos_by_cat(); if(!$this->videolist && !$vcat) $this->videolist = sh_get_videos_by_cat(filtering:$filtering);
else if($vcat) return sh_get_videos_by_cat($vcat); else if($vcat) return sh_get_videos_by_cat($vcat, filtering:$filtering);
return $this->videolist; return $this->videolist;
...@@ -117,7 +117,7 @@ if(!class_exists('SH_VideoGallery')) { ...@@ -117,7 +117,7 @@ if(!class_exists('SH_VideoGallery')) {
$video_preview = $video->preview; $video_preview = $video->preview;
$gif_preview = $video->gif_small; $gif_preview = $video->gif_small;
sexhack_log($video); //sexhack_log($video);
$categories = $video->get_categories(true); $categories = $video->get_categories(true);
......
...@@ -38,6 +38,27 @@ if(!class_exists("SH_VideoProducts")) { ...@@ -38,6 +38,27 @@ if(!class_exists("SH_VideoProducts")) {
// fired when deleting a video // fired when deleting a video
add_action('sh_delete_video', array($this, 'delete_video_product'), 9, 1); add_action('sh_delete_video', array($this, 'delete_video_product'), 9, 1);
// Add filter for download product uri fix
add_filter('woocommerce_download_product_filepath', array($this, 'fix_download_uri'));
}
public function fix_download_uri($path)
{
$vr_storage = get_option('sexhack_video_vr_storage', false);
$vr_uri = get_option('sexhack_video_vr_uri', '/VR/');
$video_storage = get_option('sexhack_video_video_storage', false);
$video_uri = get_option('sexhack_video_video_uri', '/Videos/');
$gif_storage = get_option('sexhack_video_gif_storage', false);
$gif_uri = get_option('sexhack_video_gif_uri', '/GIF/');
$photo_storage = get_option('sexhack_video_photo_storage', false);
$photo_uri = get_option('sexhack_video_photo_uri', '/Photos/');
if($vr_storage && starts_with($vr_storage, $path)) return str_replace($vr_storage, $vr_uri, $path);
if($gif_storage && starts_with($gif_storage, $path)) return str_replace($gif_storage, $gif_uri, $path);
if($video_storage && starts_with($video_storage, $path)) return str_replace($video_storage, $video_uri, $path);
if($photo_storage && starts_with($photo_storage, $path)) return str_replace($photo_storage, $photo_uri, $path);
return $path;
} }
public function delete_video_product($video) public function delete_video_product($video)
...@@ -503,4 +524,6 @@ if(!class_exists('SH_WooCommerce_Registration_Integration')) { ...@@ -503,4 +524,6 @@ if(!class_exists('SH_WooCommerce_Registration_Integration')) {
new SH_WooCommerce_Registration_Integration; new SH_WooCommerce_Registration_Integration;
} }
?> ?>
...@@ -24,7 +24,7 @@ namespace wp_SexHackMe; ...@@ -24,7 +24,7 @@ namespace wp_SexHackMe;
// Exit if accessed directly // Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit; if ( ! defined( 'ABSPATH' ) ) exit;
function save_sexhack_video_forms( $post_id ) function save_sexhack_video_forms( $post_id)
{ {
// Verify that the nonce is set and valid. // Verify that the nonce is set and valid.
...@@ -43,6 +43,10 @@ function save_sexhack_video_forms( $post_id ) ...@@ -43,6 +43,10 @@ function save_sexhack_video_forms( $post_id )
// ... ant it's set to sexhack_video // ... ant it's set to sexhack_video
if($_POST['post_type']!='sexhack_video') return; if($_POST['post_type']!='sexhack_video') return;
// ... what if we are saving the wrong post?
if(get_post_type($post_id) != 'sexhack_video') return;
// Make sure we don't get caught in any loop // Make sure we don't get caught in any loop
if($admin) unset($_POST['sh_video_description_nonce']); if($admin) unset($_POST['sh_video_description_nonce']);
if(!$admin) unset($_POST['sh_editvideo_nonce']); if(!$admin) unset($_POST['sh_editvideo_nonce']);
...@@ -73,7 +77,11 @@ function save_sexhack_video_forms( $post_id ) ...@@ -73,7 +77,11 @@ function save_sexhack_video_forms( $post_id )
} }
// Get $video object // Get $video object
$setslug = false;
$video = sh_get_video_from_post($post_id); $video = sh_get_video_from_post($post_id);
if(!$video) sexhack_log("Video object not initialized, new video?? (form passed \"$post_id\" \$post_id");
if(!$video) sexhack_log($video);
if(!$video) $setslug = true;
if(!$video) $video = new SH_Video(); if(!$video) $video = new SH_Video();
...@@ -87,7 +95,8 @@ function save_sexhack_video_forms( $post_id ) ...@@ -87,7 +95,8 @@ function save_sexhack_video_forms( $post_id )
// //
// Title and slug // Title and slug
$video->title = $post->post_title; $video->title = $post->post_title;
$video->slug = uniqidReal()."-".$post->post_name; if(!$video->slug || $setslug) $video->slug = uniqidReal()."-".$post->post_name;
// TODO Remove debug // TODO Remove debug
//sexhack_log("SAVE post object:"); //sexhack_log("SAVE post object:");
...@@ -120,7 +129,8 @@ function save_sexhack_video_forms( $post_id ) ...@@ -120,7 +129,8 @@ function save_sexhack_video_forms( $post_id )
$video->thumbnail = false; $video->thumbnail = false;
} else { } else {
// Shoudn't we move it somewhere? // Shoudn't we move it somewhere?
if(isset($_POST['video_thumb'])) $video->thumbnail = get_option('sexhack_video_tmp_path', '/tmp')."/".sanitize_text_field($_POST['video_thumb']); if(isset($_POST['video_thumb'])
&& !empty($_POST['video_thumb'])) $video->thumbnail = get_option('sexhack_video_tmp_path', '/tmp')."/".sanitize_text_field($_POST['video_thumb']);
else $video->thumbnail = false; else $video->thumbnail = false;
} }
...@@ -261,6 +271,7 @@ function save_sexhack_video_forms( $post_id ) ...@@ -261,6 +271,7 @@ function save_sexhack_video_forms( $post_id )
{ {
foreach($_POST['video_tags'] as $tag_name) foreach($_POST['video_tags'] as $tag_name)
{ {
$tag_name = str_replace("#", "", $tag_name);
$vtags = $video->get_tags(false); $vtags = $video->get_tags(false);
if(sanitize_text_field(strtolower($tag_name))) if(sanitize_text_field(strtolower($tag_name)))
{ {
...@@ -276,7 +287,9 @@ function save_sexhack_video_forms( $post_id ) ...@@ -276,7 +287,9 @@ function save_sexhack_video_forms( $post_id )
// Save the video data in the database. // Save the video data in the database.
sh_save_video($video); //sexhack_log("SAVING VIDEO FROM FORM");
//sexhack_log($video);
sh_save_video($video, 'FORM');
} }
......
...@@ -81,7 +81,7 @@ function debug_rewrite_rules($matchonly=false) ...@@ -81,7 +81,7 @@ function debug_rewrite_rules($matchonly=false)
} }
function starts_with ($startString, $string) function starts_with($startString, $string)
{ {
$len = strlen($startString); $len = strlen($startString);
return (substr($string, 0, $len) === $startString); return (substr($string, 0, $len) === $startString);
...@@ -394,4 +394,11 @@ function sh_mime_type($filename) { ...@@ -394,4 +394,11 @@ function sh_mime_type($filename) {
} }
} }
function convert_filesize($bytes, $decimals = 2){
$size = array('B','kB','MB','GB','TB','PB','EB','ZB','YB');
$factor = floor((strlen($bytes) - 1) / 3);
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$size[$factor];
}
?> ?>
...@@ -30,7 +30,7 @@ function sh_get_my_videos() ...@@ -30,7 +30,7 @@ function sh_get_my_videos()
return SH_Query::get_Videos(get_current_user_id(), 'user'); return SH_Query::get_Videos(get_current_user_id(), 'user');
} }
function sh_save_video($video) function sh_save_video($video, $source=false)
{ {
if(is_object($video)) { if(is_object($video)) {
// Initialize categories and tags is they are not. // Initialize categories and tags is they are not.
...@@ -38,7 +38,7 @@ function sh_save_video($video) ...@@ -38,7 +38,7 @@ function sh_save_video($video)
$video->get_categories(true); $video->get_categories(true);
$video->get_tags(true); $video->get_tags(true);
$video->get_guests(true); $video->get_guests(true);
return SH_Query::save_Video($video); return SH_Query::save_Video($video, $source);
} }
return false; return false;
} }
...@@ -65,9 +65,21 @@ function sh_delete_video_from_product($p) ...@@ -65,9 +65,21 @@ function sh_delete_video_from_product($p)
} }
function sh_get_videos_by_cat($vcat=false) function sh_get_videos_by_status($status="published")
{ {
return SH_Query::get_VideosCat($vcat); if(!in_array($status, array('published', 'queue', 'creating','uploading','processing','ready','error'))) $status='published';
return sh_get_videos_by_cat(filtering: "status='$status'");
}
function sh_get_videos_by_socialpost($socialpost=0)
{
if(!is_numeric($socialpost)) return 'KO';
return sh_get_videos_by_cat(filtering: "socialpost='$socialpost' AND status='published'");
}
function sh_get_videos_by_cat($vcat=false, $filtering=false)
{
return SH_Query::get_VideosCat($vcat, $filtering);
} }
function sh_get_video($id) function sh_get_video($id)
......
...@@ -32,7 +32,7 @@ function SexHLSPlayer(url, vuid){ ...@@ -32,7 +32,7 @@ function SexHLSPlayer(url, vuid){
hls.autoLevelEnabled = true; hls.autoLevelEnabled = true;
//hls.loadLevel = 4; //hls.loadLevel = 4;
hls.startLoad(); hls.startLoad();
//vtag.play(); // XXX Autoplay doesn't work apparently atm vtag.play(); // XXX Autoplay doesn't work apparently atm
}); });
//document.title = url //document.title = url
} }
......
...@@ -19,9 +19,11 @@ ...@@ -19,9 +19,11 @@
*/ */
function SexVideoPlayer(vuid){ function SexVideoPlayer(vuid){
var vtag = videojs(vuid); var vtag = videojs(vuid, {autoplay: true});
vtag.ready(function() { vtag.ready(function() {
myPlayer.volume(0.5); vtag.play();
vtag.volume(0.5);
}); });
return vtag; return vtag;
} }
......
...@@ -212,6 +212,7 @@ if(!class_exists('SexHackMe_Plugin')) { ...@@ -212,6 +212,7 @@ if(!class_exists('SexHackMe_Plugin')) {
views_members bigint(32) NOT NULL DEFAULT '0', views_members bigint(32) NOT NULL DEFAULT '0',
views_premium bigint(32) NOT NULL DEFAULT '0', views_premium bigint(32) NOT NULL DEFAULT '0',
sales bigint(32) NOT NULL DEFAULT '0', sales bigint(32) NOT NULL DEFAULT '0',
socialpost bigint(32) NOT NULL DEFAULT '0',
PRIMARY KEY (id), PRIMARY KEY (id),
KEY user_id (user_id), KEY user_id (user_id),
KEY post_id (post_id), KEY post_id (post_id),
......
...@@ -106,30 +106,72 @@ if ( ! defined( 'ABSPATH' ) ) exit; ...@@ -106,30 +106,72 @@ if ( ! defined( 'ABSPATH' ) ) exit;
<label>Video Storage HLS</label> <label>Video Storage HLS</label>
<input type='text' name='sexhack_video_hls_storage' value='<?php echo get_option('sexhack_video_hls_storage', ABSPATH.'HLS'); ?>'> <input type='text' name='sexhack_video_hls_storage' value='<?php echo get_option('sexhack_video_hls_storage', ABSPATH.'HLS'); ?>'>
</td> </td>
<td>
<label>Video URI HLS</label>
<input type='text' name='sexhack_video_hls_uri' value='<?php echo get_option('sexhack_video_hls_uri', '/HLS/'); ?>'>
</td>
</tr> </tr>
<tr> <tr>
<td> <td>
<label>Video Storage Video</label> <label>Video Storage Video</label>
<input type='text' name='sexhack_video_video_storage' value='<?php echo get_option('sexhack_video_video_storage', ABSPATH.'Videos'); ?>'> <input type='text' name='sexhack_video_video_storage' value='<?php echo get_option('sexhack_video_video_storage', ABSPATH.'Videos'); ?>'>
</td> </td>
<td>
<label>Video URI Video</label>
<input type='text' name='sexhack_video_video_uri' value='<?php echo get_option('sexhack_video_video_uri', '/Videos/'); ?>'>
</td>
</tr> </tr>
<tr> <tr>
<td> <td>
<label>Video Storage Photo</label> <label>Video Storage Photo</label>
<input type='text' name='sexhack_video_photo_storage' value='<?php echo get_option('sexhack_video_photo_storage', ABSPATH.'Photos'); ?>'> <input type='text' name='sexhack_video_photo_storage' value='<?php echo get_option('sexhack_video_photo_storage', ABSPATH.'Photos'); ?>'>
</td> </td>
<td>
<label>Video URI Photo</label>
<input type='text' name='sexhack_video_photo_uri' value='<?php echo get_option('sexhack_video_photo_uri', '/Photos/'); ?>'>
</td>
</tr> </tr>
<tr> <tr>
<td> <td>
<label>Video Storage GIF</label> <label>Video Storage GIF</label>
<input type='text' name='sexhack_video_gif_storage' value='<?php echo get_option('sexhack_video_gif_storage', ABSPATH.'GIF'); ?>'> <input type='text' name='sexhack_video_gif_storage' value='<?php echo get_option('sexhack_video_gif_storage', ABSPATH.'GIF'); ?>'>
</td> </td>
<td>
<label>Video URI GIF</label>
<input type='text' name='sexhack_video_gif_uri' value='<?php echo get_option('sexhack_video_gif_uri', '/GIF/'); ?>'>
</td>
</tr> </tr>
<tr> <tr>
<td> <td>
<label>Video Storage VR</label> <label>Video Storage VR</label>
<input type='text' name='sexhack_video_vr_storage' value='<?php echo get_option('sexhack_video_vr_storage', ABSPATH.'VR'); ?>'> <input type='text' name='sexhack_video_vr_storage' value='<?php echo get_option('sexhack_video_vr_storage', ABSPATH.'VR'); ?>'>
</td> </td>
<td>
<label>Video URI VR</label>
<input type='text' name='sexhack_video_vr_uri' value='<?php echo get_option('sexhack_video_vr_uri', '/VR/'); ?>'>
</td>
</tr>
<tr>
<td>
<label>Thumbnail Storage</label>
<input type='text' name='sexhack_thumbnail_storage' value='<?php echo get_option('sexhack_thumbnail_storage', ABSPATH.'Thumbs'); ?>'>
</td>
<td>
<label>Thumbnail URI</label>
<input type='text' name='sexhack_thumbnail_uri' value='<?php echo get_option('sexhack_thumbnail_uri', '/Thumbs/'); ?>'>
</td>
</tr>
<tr>
<td>
<label>Social Post Storage</label>
<input type='text' name='sexhack_socialpost_storage' value='<?php echo get_option('sexhack_socialpost_storage', ABSPATH.'SOCIALPOSTS'); ?>'>
</td>
</tr> </tr>
......
...@@ -117,7 +117,7 @@ foreach(array('public','members','premium') as $level) { ?> ...@@ -117,7 +117,7 @@ foreach(array('public','members','premium') as $level) { ?>
<p> <p>
<label> Include in Download?</label> <label> Include in Download?</label>
<input type='radio' name='video_isdownload_<?php echo $level; ?>' value='Y' <?php if($video->has_downloads($level)) echo "checked"; ?>>Yes</input> <input type='radio' name='video_isdownload_<?php echo $level; ?>' value='Y' <?php if($video->has_downloads($level)) echo "checked"; ?>>Yes</input>
<input type='radio' name='video_isdownload <?php echo $level; ?>' value='N' <?php if(!$video->has_downloads($level)) echo "checked"; ?>>No</input> <input type='radio' name='video_isdownload_<?php echo $level; ?>' value='N' <?php if(!$video->has_downloads($level)) echo "checked"; ?>>No</input>
</p> </p>
</p> </p>
<?php <?php
...@@ -393,8 +393,9 @@ jQuery(function($) { ...@@ -393,8 +393,9 @@ jQuery(function($) {
foreach(array('public','members','premium','preview','thumb','gif','gif_small') as $level) { ?> foreach(array('public','members','premium','preview','thumb','gif','gif_small') as $level) { ?>
var flow_<?php echo $level; ?> = new Flow({ var flow_<?php echo $level; ?> = new Flow({
target: '<?php echo admin_url( 'admin-ajax.php' ); ?>', target: '<?php echo admin_url( 'admin-ajax.php' ); ?>',
chunkSize: 1024*1024, // 1MB chunkSize: 1024*1024*8, // 8MB
uploadMethod:'POST', uploadMethod:'POST',
simultaneousUploads: 4,
testChunks:false, testChunks:false,
query:{action:'file_upload', uniqid:'<?php echo $uniqid ?>', security:'<?php echo wp_create_nonce( 'sh_video_upload');?>', level:'<?php echo $level; ?>'}, query:{action:'file_upload', uniqid:'<?php echo $uniqid ?>', security:'<?php echo wp_create_nonce( 'sh_video_upload');?>', level:'<?php echo $level; ?>'},
singleFile: true singleFile: true
......
...@@ -119,7 +119,7 @@ get_header(); ?> ...@@ -119,7 +119,7 @@ get_header(); ?>
} }
else else
{ {
if(user_has_premium_access()) { if(user_has_premium_access() || $video->user_bought_video()) {
if($hls_premium) $tab = 'subscribers'; if($hls_premium) $tab = 'subscribers';
elseif($hls_members) $tab = 'members'; elseif($hls_members) $tab = 'members';
else $tab = 'public'; else $tab = 'public';
...@@ -151,7 +151,7 @@ get_header(); ?> ...@@ -151,7 +151,7 @@ get_header(); ?>
{ {
case "members": case "members":
if(user_has_member_access()) if(user_has_member_access() || $video->user_bought_video())
{ {
if($filterurl && $hls_members && $video->video_type=="VR" ) if($filterurl && $hls_members && $video->video_type=="VR" )
echo do_shortcode( "[sexvideo url=\"".wp_nonce_url($filterurl.$sh_video."/members/".basename($hls_members), 'shm_members_video-'.$video->id)."\" posters=\"".$thumb."\"]" ); echo do_shortcode( "[sexvideo url=\"".wp_nonce_url($filterurl.$sh_video."/members/".basename($hls_members), 'shm_members_video-'.$video->id)."\" posters=\"".$thumb."\"]" );
...@@ -167,13 +167,13 @@ get_header(); ?> ...@@ -167,13 +167,13 @@ get_header(); ?>
{ {
if($gif_preview) echo '<img class="sexhack_videopreview" src="'.$gif_preview.'" loading="lazy"></img>'; if($gif_preview) echo '<img class="sexhack_videopreview" src="'.$gif_preview.'" loading="lazy"></img>';
else echo '<img class="sexhack_videopreview" src="'.$thumb.'" loading="lazy"></img>'; else echo '<img class="sexhack_videopreview" src="'.$thumb.'" loading="lazy"></img>';
echo "<h3 class='sexhack-videonotify'><a href='/login'>YOU NEED TO LOGIN TO ACCESS THIS VIDEO</a></h3>"; echo "<h3 class='sexhack-videonotify'><a href='/login'>YOU NEED FREE MEMBER, PREMUM LOGIN or BUY DOWLOAD TO ACCESS THIS VIDEO</a></h3>";
echo "<div style='width: 80%; margin-left: 10%;' >".do_shortcode('[pms-login redirect_url="/account" ]')."</div>"; echo "<div style='width: 80%; margin-left: 10%;' >".do_shortcode('[pms-login redirect_url="/account" ]')."</div>";
} }
break; break;
case "subscribers": case "subscribers":
if(user_has_premium_access()) if(user_has_premium_access() || $video->user_bought_video())
{ {
if($filterurl && $hls_premium && $video->video_type=="VR") if($filterurl && $hls_premium && $video->video_type=="VR")
echo do_shortcode( "[sexvideo url=\"".wp_nonce_url($filterurl.$sh_video."/premium/".basename($hls_premium), 'shm_premium_video-'.$video->id)."\" posters=\"".$thumb."\"]" ); echo do_shortcode( "[sexvideo url=\"".wp_nonce_url($filterurl.$sh_video."/premium/".basename($hls_premium), 'shm_premium_video-'.$video->id)."\" posters=\"".$thumb."\"]" );
...@@ -190,7 +190,7 @@ get_header(); ?> ...@@ -190,7 +190,7 @@ get_header(); ?>
{ {
if($gif_preview) echo '<img class="sexhack_videopreview" src="'.$gif_preview.'" loading="lazy"></img>'; if($gif_preview) echo '<img class="sexhack_videopreview" src="'.$gif_preview.'" loading="lazy"></img>';
else echo '<img class="sexhack_videopreview" src="'.$thumb.'" loading="lazy"></img>'; else echo '<img class="sexhack_videopreview" src="'.$thumb.'" loading="lazy"></img>';
echo "<h3 class='sexhack-videonotify'><a href='/product-category/subscriptions/'>YOU NEED A SUBSCRIPTION TO ACCESS THIS VIDEO</a></h3>"; echo "<h3 class='sexhack-videonotify'><a href='/product-category/subscriptions/'>YOU NEED A SUBSCRIPTION OR BUY DOWNLOAD TO ACCESS THIS VIDEO</a></h3>";
} }
break; break;
...@@ -221,6 +221,19 @@ get_header(); ?> ...@@ -221,6 +221,19 @@ get_header(); ?>
?> ?>
<h2 class='sexhack-videonotify'><b>PUBLIC VIDEO NOT AVAILABLE</b></h2> <h2 class='sexhack-videonotify'><b>PUBLIC VIDEO NOT AVAILABLE</b></h2>
<?php <?php
/*
if($hls_members) {
?>
<h3><a href="">members version here!</a></h3>
<?php
}
if($hls_premium) {
?>
<h3><a href="">Premium users version here!</a></h3>
<?php
}
*/
} }
?> ?>
</div> <!-- video container --> </div> <!-- video container -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment