Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
W
WordPress_SexHackMe_Plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SexHackMe
WordPress_SexHackMe_Plugin
Commits
65f13d56
Commit
65f13d56
authored
Jul 13, 2022
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved video players and relative shortcodes
parent
b364ecb3
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
402 additions
and
198 deletions
+402
-198
00-videojs_player.php
deprecated/00-videojs_player.php
+0
-89
sexhack_gallery.php
deprecated/sexhack_gallery.php
+3
-3
class-shortcodes.php
includes/class-shortcodes.php
+66
-0
class-video-players.php
includes/class-video-players.php
+49
-0
functions-utils.php
includes/functions-utils.php
+27
-0
sexhackme.php
sexhackme.php
+99
-106
sexhackme.php
template/admin/sexhackme.php
+0
-0
gallery.php
templates/admin/gallery.php
+0
-0
sexhackme.php
templates/admin/sexhackme.php
+83
-0
newvideo.php
templates/newvideo.php
+0
-0
video.php
templates/video.php
+0
-0
hls.php
templates/videoplayer/hls.php
+36
-0
xr.php
templates/videoplayer/xr.php
+39
-0
videoaccess.php
templates/widgets/videoaccess.php
+0
-0
No files found.
deprecated/00-videojs_player.php
deleted
100644 → 0
View file @
b364ecb3
<?php
/**
* Copyright: 2022 (c)Franco (nextime) Lanza <franco@nexlab.it>
* License: GNU/GPL version 3.0
*
* This file is part of SexHackMe Wordpress Plugin.
*
* SexHackMe Wordpress Plugin is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* SexHackMe Wordpress Plugin is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SexHackMe Wordpress Plugin. If not, see <https://www.gnu.org/licenses/>.
*/
namespace
wp_SexHackMe
;
if
(
!
class_exists
(
'SexhackVideoJSPlayer'
))
{
class
SexhackVideoJSPlayer
{
public
function
__construct
()
{
sexhack_log
(
'SexhackVideoJSPlayer() Instanced'
);
add_shortcode
(
"sexvideo"
,
array
(
$this
,
"sexvideo_shortcode"
));
}
public
function
addPlayer
(
$vurl
,
$posters
=
""
,
$projection
=
"180_LR"
)
{
$uid
=
uniqid
(
'sexvideo_'
);
//$uid = "antani";
$html
=
"<video id='
$uid
' class='video-js vjs-default-skin vjs-2-1 vjs-big-play-centered' style='width: 100%; height: 100%;' controls poster='
$posters
'>
\n
"
;
//$html.= '<script src="https://s3.deovr.com/version/1/js/bundle.js" async></script>';
//$html .= "<deo-video id='$uid'>\n";
//$html .= ' <source src="'.$vurl.'" quality="1080p" type="application/x-mpegURL">'."\n";
$html
.=
'</video>'
.
"
\n
"
;
//$html .= "</deo-video>\n";
$html
.=
"<script language='javascript'>
\n
"
;
$html
.=
"$(window).on('load', function() {\n"
;
//$html .= " videojs.log.level('debug');\n";
$html
.=
" var player = videojs('
$uid
', {\n"
;
$html
.=
" html5: {\n"
;
$html
.=
" vhs: {\n"
;
$html
.=
" overrideNative: !videojs.browser.IS_SAFARI
\n
"
;
$html
.=
" },
\n
"
;
$html
.=
" nativeAudioTracks: false,
\n
"
;
$html
.=
" nativeVideoTracks: false
\n
"
;
$html
.=
" }});
\n
"
;
$html
.=
" player.src({ src: '
$vurl
', type: 'application/x-mpegURL'});
\n
"
;
//if($_GET['antani']) {
$html
.=
" player.xr();"
;
//} else {
// $html .= " player.mediainfo = player.mediainfo || {};\n";
// $html .= " player.mediainfo.projection = '$projection';\n";
// $html .= " player.vr({projection: '$projection', debug: false, forceCardboard: true});\n";
//}
//$html .= " player.xr();";
$html
.=
'});'
.
"
\n
"
;
$html
.=
"</script>"
;
return
$html
;
}
public
function
sexvideo_shortcode
(
$attr
,
$cont
)
{
extract
(
shortcode_atts
(
array
(
"url"
=>
''
,
"posters"
=>
''
,
),
$attr
));
return
"<div class='sexvideo_videojs'>"
.
$this
->
addPlayer
(
$url
,
$posters
)
.
"</div>"
;
}
}
}
$SEXHACK_SECTION
=
array
(
'class'
=>
'SexhackVideoJSPlayer'
,
'description'
=>
'Add VideoJS Video Player'
,
'name'
=>
'sexhackme_videojs_player'
);
?>
deprecated/sexhack_gallery.php
View file @
65f13d56
...
@@ -182,9 +182,9 @@ if(!class_exists('SexHackVideoGallery')) {
...
@@ -182,9 +182,9 @@ if(!class_exists('SexHackVideoGallery')) {
$is_sexhack_video
=
get_query_var
(
'wooprod'
,
false
);
$is_sexhack_video
=
get_query_var
(
'wooprod'
,
false
);
if
(
$is_sexhack_video
)
{
if
(
$is_sexhack_video
)
{
set_query_var
(
'post_type'
,
'sexhack_video'
);
set_query_var
(
'post_type'
,
'sexhack_video'
);
if
(
file_exists
(
plugin_dir_path
(
__DIR__
)
.
'/template/'
.
$template
))
{
if
(
file_exists
(
plugin_dir_path
(
__DIR__
)
.
'/template
s
/'
.
$template
))
{
sexhack_log
(
"NEW TEMPLATE!: "
.
plugin_dir_path
(
__DIR__
)
.
'/template/'
.
$template
);
sexhack_log
(
"NEW TEMPLATE!: "
.
plugin_dir_path
(
__DIR__
)
.
'/template
s
/'
.
$template
);
return
plugin_dir_path
(
__DIR__
)
.
'/template/'
.
$template
;
return
plugin_dir_path
(
__DIR__
)
.
'/template
s
/'
.
$template
;
}
}
}
}
return
$template
;
return
$template
;
...
...
deprecated/00-hls_player
.php
→
includes/class-shortcodes
.php
View file @
65f13d56
...
@@ -21,54 +21,46 @@
...
@@ -21,54 +21,46 @@
namespace
wp_SexHackMe
;
namespace
wp_SexHackMe
;
if
(
!
class_exists
(
'S
exhackHlsPlayer
'
))
{
if
(
!
class_exists
(
'S
H_Shortcodes
'
))
{
class
S
exhackHlsPlayer
class
S
H_Shortcodes
{
{
public
function
__construct
()
{
sexhack_log
(
'SexhackHlsPlayer() Instanced'
);
add_shortcode
(
"sexhls"
,
array
(
$this
,
"sexhls_shortcode"
));
}
public
static
function
init
()
{
$shortcodes
=
array
(
'sexhls'
=>
__CLASS__
.
'::video_hls'
,
'sexvideo'
=>
__CLASS__
.
'::video_xr'
,
'sh_videoxr'
=>
__CLASS__
.
'::video_xr'
,
'sh_videohls'
=>
__CLASS__
.
'::video_hls'
,
);
foreach
(
$shortcodes
as
$shortcode_tag
=>
$shortcode_func
)
{
add_shortcode
(
$shortcode_tag
,
$shortcode_func
);
}
public
function
addPlayer
(
$vurl
,
$posters
=
""
)
}
public
static
function
video_hls
(
$attr
,
$cont
)
{
{
$uid
=
uniqid
(
'sexhls_'
);
extract
(
shortcode_atts
(
array
(
$html
=
'<video id="'
.
$uid
.
'" style="width: 100%; height: 100%;" controls poster="'
.
$posters
.
'"></video>'
.
"
\n
"
;
"url"
=>
''
,
$html
.=
'<script language="javascript">'
.
"
\n
"
;
"posters"
=>
''
,
$html
.=
'$(window).on(\'load\', function() {'
.
"
\n
"
;
),
$attr
));
$html
.=
' SexHLSPlayer(\''
.
$vurl
.
'\', \''
.
$uid
.
'\');'
.
"
\n
"
;
return
"<div class='sexhls_video'>"
.
sh_hls_player
(
$url
,
$posters
)
.
"</div>"
;
$html
.=
' $(\'#'
.
$uid
.
'\').on(\'click\', function(){this.paused?this.play():this.pause();});'
.
"
\n
"
;
$html
.=
' Mousetrap(document.getElementById(\''
.
$uid
.
'\')).bind(\'space\', function(e, combo) { SexHLSplayPause(\''
.
$uid
.
'\'); });'
.
"
\n
"
;
$html
.=
' Mousetrap(document.getElementById(\''
.
$uid
.
'\')).bind(\'up\', function(e, combo) { SexHLSvolumeUp(\''
.
$uid
.
'\'); });'
.
"
\n
"
;
$html
.=
' Mousetrap(document.getElementById(\''
.
$uid
.
'\')).bind(\'down\', function(e, combo) { SexHLSvolumeDown(\''
.
$uid
.
'\'); });'
.
"
\n
"
;
$html
.=
' Mousetrap(document.getElementById(\''
.
$uid
.
'\')).bind(\'right\', function(e, combo) { SexHLSseekRight(\''
.
$uid
.
'\'); });'
.
"
\n
"
;
$html
.=
' Mousetrap(document.getElementById(\''
.
$uid
.
'\')).bind(\'left\', function(e, combo) { SexHLSseekLeft(\''
.
$uid
.
'\'); });'
.
"
\n
"
;
$html
.=
' Mousetrap(document.getElementById(\''
.
$uid
.
'\')).bind(\'f\', function(e, combo) { SexHLSvidFullscreen(\''
.
$uid
.
'\'); });'
.
"
\n
"
;
$html
.=
'});'
.
"
\n
"
;
$html
.=
'</script>'
.
"
\n
"
;
return
$html
;
}
}
public
function
sexhls_shortcode
(
$attr
,
$cont
)
public
static
function
video_xr
(
$attr
,
$cont
)
{
{
extract
(
shortcode_atts
(
array
(
extract
(
shortcode_atts
(
array
(
"url"
=>
''
,
"url"
=>
''
,
"posters"
=>
''
,
"posters"
=>
''
,
),
$attr
));
),
$attr
));
return
"<div class='sex
hls_video'>"
.
$this
->
addP
layer
(
$url
,
$posters
)
.
"</div>"
;
return
"<div class='sex
video_videojs'>"
.
sh_xr_p
layer
(
$url
,
$posters
)
.
"</div>"
;
}
}
}
}
}
}
$SEXHACK_SECTION
=
array
(
'class'
=>
'SexhackHlsPlayer'
,
'description'
=>
'Add HLS Video Player for progressive and live streaming support'
,
'name'
=>
'sexhackme_hls_player'
);
?>
?>
includes/class-video-players.php
0 → 100644
View file @
65f13d56
<?php
/**
* Copyright: 2022 (c)Franco (nextime) Lanza <franco@nexlab.it>
* License: GNU/GPL version 3.0
*
* This file is part of SexHackMe Wordpress Plugin.
*
* SexHackMe Wordpress Plugin is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* SexHackMe Wordpress Plugin is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SexHackMe Wordpress Plugin. If not, see <https://www.gnu.org/licenses/>.
*/
namespace
wp_SexHackMe
;
if
(
!
class_exists
(
'SH_VideoPlayer'
))
{
class
SH_VideoPlayer
{
public
static
function
addPlayer
(
$player_type
=
'hls'
,
$vurl
=
''
,
$posters
=
""
,
$projection
=
'180_LR'
)
{
$html
=
false
;
switch
(
$player_type
)
{
case
'hls'
:
$html
=
sh_get_template
(
"videoplayer/hls.php"
,
array
(
'vurl'
=>
$vurl
,
'posters'
=>
$posters
));
sexhack_log
(
$html
);
break
;
case
'xr'
:
$html
=
sh_get_template
(
"videoplayer/xr.php"
,
array
(
'vurl'
=>
$vurl
,
'posters'
=>
$posters
,
'projection'
=>
$projection
));
break
;
}
return
$html
;
}
}
}
?>
includes/functions-utils.php
View file @
65f13d56
...
@@ -37,6 +37,27 @@ if(!function_exists('sexhack_log')){
...
@@ -37,6 +37,27 @@ if(!function_exists('sexhack_log')){
}
}
function
sh_get_template
(
$tmpl
,
$args
=
array
())
{
foreach
(
$args
as
$var
=>
$data
)
$$var
=
$data
;
if
(
file_exists
(
SH_PLUGIN_DIR_PATH
.
'templates/'
.
$tmpl
))
return
include_once
SH_PLUGIN_DIR_PATH
.
'templates/'
.
$tmpl
;
return
false
;
}
function
sh_hls_player
(
$video_url
,
$posters
=
''
)
{
echo
SH_VideoPlayer
::
addPlayer
(
'hls'
,
$video_url
,
$posters
);
}
function
sh_xr_player
(
$video_url
,
$posters
=
''
,
$projection
=
'180_LR'
)
{
echo
SH_VideoPlayer
::
addPlayer
(
'xr'
,
$video_url
,
$posters
,
$projection
);
}
function
debug_rewrite_rules
(
$matchonly
=
false
)
function
debug_rewrite_rules
(
$matchonly
=
false
)
{
{
$matchonly
=
true
;
$matchonly
=
true
;
...
@@ -261,4 +282,10 @@ function html2text($html)
...
@@ -261,4 +282,10 @@ function html2text($html)
return
$plaintext
;
return
$plaintext
;
}
}
function
checkbox
(
$res
)
{
if
(
$res
==
"1"
)
return
"checked"
;
}
?>
?>
sexhackme.php
View file @
65f13d56
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* Plugin Name: SexHackMe
* Plugin Name: SexHackMe
* Plugin URI: https://www.sexhack.me/SexHackMe_Wordpress
* Plugin URI: https://www.sexhack.me/SexHackMe_Wordpress
* Description: Cumulative plugin for https://www.sexhack.me modifications to wordpress, woocommerce and storefront theme
* Description: Cumulative plugin for https://www.sexhack.me modifications to wordpress, woocommerce and storefront theme
* Version: 0.1
* Version: 0.
0.
1
* Author: Franco Lanza
* Author: Franco Lanza
*
*
* ----------------------
* ----------------------
...
@@ -221,6 +221,20 @@ if(!class_exists('SexHackMe_Plugin')) {
...
@@ -221,6 +221,20 @@ if(!class_exists('SexHackMe_Plugin')) {
if
(
file_exists
(
SH_PLUGIN_DIR_PATH
.
'includes/functions-paid-member-subscriptions-integration.php'
)
)
if
(
file_exists
(
SH_PLUGIN_DIR_PATH
.
'includes/functions-paid-member-subscriptions-integration.php'
)
)
include_once
(
SH_PLUGIN_DIR_PATH
.
'includes/functions-paid-member-subscriptions-integration.php'
);
include_once
(
SH_PLUGIN_DIR_PATH
.
'includes/functions-paid-member-subscriptions-integration.php'
);
/* Video Players */
if
(
file_exists
(
SH_PLUGIN_DIR_PATH
.
'includes/class-video-players.php'
)
)
include_once
(
SH_PLUGIN_DIR_PATH
.
'includes/class-video-players.php'
);
/* Shortcodes */
if
(
file_exists
(
SH_PLUGIN_DIR_PATH
.
'includes/class-shortcodes.php'
)
)
include_once
SH_PLUGIN_DIR_PATH
.
'includes/class-shortcodes.php'
;
/* Hook to include needed files */
do_action
(
'pms_include_files'
);
/* Testing code */
/* Testing code */
foreach
(
glob
(
dirname
(
__FILE__
)
.
'/testing/*.php'
)
as
$class_path
)
{
foreach
(
glob
(
dirname
(
__FILE__
)
.
'/testing/*.php'
)
as
$class_path
)
{
...
@@ -230,8 +244,6 @@ if(!class_exists('SexHackMe_Plugin')) {
...
@@ -230,8 +244,6 @@ if(!class_exists('SexHackMe_Plugin')) {
sexhack_log
(
$e
);
sexhack_log
(
$e
);
}
}
}
}
}
}
...
@@ -280,11 +292,11 @@ if(!class_exists('SexHackMe_Plugin')) {
...
@@ -280,11 +292,11 @@ if(!class_exists('SexHackMe_Plugin')) {
// add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
// add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
// Initialize shortcodes
// Initialize shortcodes
//add_action( 'init', array( 'PMS
_Shortcodes', 'init' ) );
add_action
(
'init'
,
array
(
'wp_SexHackMe\SH
_Shortcodes'
,
'init'
)
);
//add_action( 'init', array( $this, 'init_dependencies' ), 1 );
//add_action( 'init', array( $this, 'init_dependencies' ), 1 );
//Show row meta on the plugin screen (used to add links like Documentation, Support etc.).
//Show row meta on the plugin screen (used to add links like Documentation, Support etc.).
//
add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 );
add_filter
(
'plugin_row_meta'
,
array
(
$this
,
'plugin_row_meta'
),
10
,
2
);
// Hook to be executed on a specific interval, by the cron job (wp_schedule_event); used to check if a subscription has expired
// Hook to be executed on a specific interval, by the cron job (wp_schedule_event); used to check if a subscription has expired
//add_action('pms_check_subscription_status','pms_member_check_expired_subscriptions');
//add_action('pms_check_subscription_status','pms_member_check_expired_subscriptions');
...
@@ -293,7 +305,7 @@ if(!class_exists('SexHackMe_Plugin')) {
...
@@ -293,7 +305,7 @@ if(!class_exists('SexHackMe_Plugin')) {
//add_action('pms_remove_activation_key','pms_remove_expired_activation_key');
//add_action('pms_remove_activation_key','pms_remove_expired_activation_key');
// Add new actions besides the activate/deactivate ones from the Plugins page
// Add new actions besides the activate/deactivate ones from the Plugins page
//
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array( $this, 'add_plugin_action_links' ) );
add_filter
(
'plugin_action_links_'
.
plugin_basename
(
__FILE__
),
array
(
$this
,
'add_plugin_action_links'
)
);
sexhack_log
(
"SexHackMe PLUGIN Loaded!"
);
sexhack_log
(
"SexHackMe PLUGIN Loaded!"
);
...
@@ -304,6 +316,7 @@ if(!class_exists('SexHackMe_Plugin')) {
...
@@ -304,6 +316,7 @@ if(!class_exists('SexHackMe_Plugin')) {
}
}
// XXX There are so many dependencies to add here...
public
function
plugin_dependencies
()
public
function
plugin_dependencies
()
{
{
$plugins
=
array
(
$plugins
=
array
(
...
@@ -315,11 +328,11 @@ if(!class_exists('SexHackMe_Plugin')) {
...
@@ -315,11 +328,11 @@ if(!class_exists('SexHackMe_Plugin')) {
)
)
);
);
$config
=
array
(
$config
=
array
(
'id'
=>
'sexhackme'
,
// Unique ID for hashing notices for multiple instances of TGMPA.
'id'
=>
'sexhackme'
,
// Unique ID for hashing notices for multiple instances of TGMPA.
'default_path'
=>
''
,
// Default absolute path to bundled plugins.
'default_path'
=>
''
,
// Default absolute path to bundled plugins.
'menu'
=>
'tgmpa-install-plugins'
,
// Menu slug.
'menu'
=>
'tgmpa-install-plugins'
,
// Menu slug.
'parent_slug'
=>
'plugins.php'
,
// Parent menu slug.
'parent_slug'
=>
'plugins.php'
,
// Parent menu slug.
'capability'
=>
'manage_options'
,
// Capability needed to view plugin install page, should be a capability associated with the parent menu used.
'capability'
=>
'manage_options'
,
// Capability needed to view plugin install page, should be a capability associated with the parent menu used.
'has_notices'
=>
true
,
// Show admin notices or not.
'has_notices'
=>
true
,
// Show admin notices or not.
'dismissable'
=>
true
,
// If false, a user cannot dismiss the nag message.
'dismissable'
=>
true
,
// If false, a user cannot dismiss the nag message.
'dismiss_msg'
=>
''
,
// If 'dismissable' is false, this message will be output at top of nag.
'dismiss_msg'
=>
''
,
// If 'dismissable' is false, this message will be output at top of nag.
...
@@ -348,35 +361,87 @@ if(!class_exists('SexHackMe_Plugin')) {
...
@@ -348,35 +361,87 @@ if(!class_exists('SexHackMe_Plugin')) {
public
function
enqueue_front_end_scripts
()
public
function
enqueue_front_end_scripts
()
{
{
// HLS Player
// HLS Player
wp_enqueue_script
(
'sexhls_baseplayer'
,
SH_PLUGIN_DIR_URL
.
'js/hls.js'
);
wp_enqueue_script
(
'sexhls_baseplayer'
,
SH_PLUGIN_DIR_URL
.
'js/hls.js'
,
array
(),
SH_VERSION
);
wp_enqueue_script
(
'sexhls_player_controls'
,
SH_PLUGIN_DIR_URL
.
'js/sexhls.js'
);
wp_enqueue_script
(
'sexhls_player_controls'
,
SH_PLUGIN_DIR_URL
.
'js/sexhls.js'
,
array
(
'sexhls_baseplayer'
),
SH_VERSION
);
wp_enqueue_script
(
'sexhls_mousetrap'
,
SH_PLUGIN_DIR_URL
.
'js/mousetrap.min.js'
);
wp_enqueue_script
(
'sexhls_mousetrap'
,
SH_PLUGIN_DIR_URL
.
'js/mousetrap.min.js'
,
array
(
'sexhls_baseplayer'
),
SH_VERSION
);
// VideoJS Player (for 3D)
// VideoJS Player (for 3D)
wp_enqueue_script
(
'sexvideo_baseplayer'
,
SH_PLUGIN_DIR_URL
.
'js/video.min.js'
);
wp_enqueue_script
(
'sexvideo_baseplayer'
,
SH_PLUGIN_DIR_URL
.
'js/video.min.js'
,
array
(),
SH_VERSION
);
wp_enqueue_script
(
'sexvideo_xrplayer'
,
SH_PLUGIN_DIR_URL
.
'js/videojs-xr.min.js'
);
wp_enqueue_script
(
'sexvideo_xrplayer'
,
SH_PLUGIN_DIR_URL
.
'js/videojs-xr.min.js'
,
array
(
'sexvideo_baseplayer'
),
SH_VERSION
);
wp_enqueue_style
(
'videojs'
,
SH_PLUGIN_DIR_URL
.
'css/video-js.min.css'
);
wp_enqueue_style
(
'videojs'
,
SH_PLUGIN_DIR_URL
.
'css/video-js.min.css'
,
array
(),
SH_VERSION
);
wp_enqueue_style
(
'sexhack_videojs'
,
SH_PLUGIN_DIR_URL
.
'css/sexhackme_videojs.css'
);
wp_enqueue_style
(
'sexhack_videojs'
,
SH_PLUGIN_DIR_URL
.
'css/sexhackme_videojs.css'
,
array
(),
SH_VERSION
);
wp_enqueue_style
(
'videojs-xr'
,
SH_PLUGIN_DIR_URL
.
'css/videojs-xr.css'
);
wp_enqueue_style
(
'videojs-xr'
,
SH_PLUGIN_DIR_URL
.
'css/videojs-xr.css'
,
array
(
'videojs'
),
SH_VERSION
);
// Sexhack Video Gallery
// Sexhack Video Gallery
wp_enqueue_style
(
'sexhackme_gallery'
,
SH_PLUGIN_DIR_URL
.
'css/sexhackme_gallery.css'
);
wp_enqueue_style
(
'sexhackme_gallery'
,
SH_PLUGIN_DIR_URL
.
'css/sexhackme_gallery.css'
,
array
(),
SH_VERSION
);
// Sexhack Fix Header
// Sexhack Fix Header
wp_enqueue_style
(
'sexhackme_header'
,
SH_PLUGIN_DIR_URL
.
'css/sexhackme_header.css'
);
wp_enqueue_style
(
'sexhackme_header'
,
SH_PLUGIN_DIR_URL
.
'css/sexhackme_header.css'
,
array
(),
SH_VERSION
);
// Fix Woocommerce Checkout
// Fix Woocommerce Checkout
wp_enqueue_style
(
'sexhackme_checkout'
,
SH_PLUGIN_DIR_URL
.
'css/sexhackme_checkout.css'
);
wp_enqueue_style
(
'sexhackme_checkout'
,
SH_PLUGIN_DIR_URL
.
'css/sexhackme_checkout.css'
,
array
(),
SH_VERSION
);
// XFrame Bypass
// XFrame Bypass
wp_enqueue_script
(
'xfbp_poly'
,
SH_PLUGIN_DIR_URL
.
'js/custom-elements-builtin.js'
);
wp_enqueue_script
(
'xfbp_poly'
,
SH_PLUGIN_DIR_URL
.
'js/custom-elements-builtin.js'
,
array
(),
SH_VERSION
);
wp_enqueue_script
(
'xfbp_js'
,
SH_PLUGIN_DIR_URL
.
'js/x-frame-bypass.js'
);
wp_enqueue_script
(
'xfbp_js'
,
SH_PLUGIN_DIR_URL
.
'js/x-frame-bypass.js'
,
array
(),
SH_VERSION
);
}
/**
* Show row meta on the plugin screen. (Used to add links like Documentation, Support etc.)
*
* @param mixed $links Plugin Row Meta
* @param mixed $file Plugin Base file
* @return array
*
*/
public
static
function
plugin_row_meta
(
$links
,
$file
)
{
if
(
$file
==
SH_PLUGIN_BASENAME
)
{
$row_meta
=
array
(
'get_support'
=>
'<a href="'
.
esc_url
(
apply_filters
(
'sh_docs_url'
,
'https://git.nexlab.net/SexHackMe/sexhackme/issues'
)
)
.
'" title="'
.
esc_attr
(
'Get Support'
)
.
'" target="_blank">Get Support</a>'
,
);
return
array_merge
(
$links
,
$row_meta
);
}
return
(
array
)
$links
;
}
}
public
function
add_plugin_action_links
(
$links
)
{
if
(
current_user_can
(
'manage_options'
)
)
{
$links
[]
=
'<span class="delete"><a href="'
.
wp_nonce_url
(
add_query_arg
(
array
(
'page'
=>
'sh-uninstall-page'
)
,
admin_url
(
'admin.php'
)
),
'sh_uninstall_page_nonce'
)
.
'">Uninstall</a></span>'
;
$settings_url
=
sprintf
(
'<a href="%1$s">%2$s</a>'
,
menu_page_url
(
'sh-settings-page'
,
false
),
esc_html
(
'Settings'
)
);
$docs_url
=
sprintf
(
'<a href="%1$s" target="_blank">%2$s</a>'
,
esc_url
(
'https://www.sexhack.me/SexHackMe_Wordpress'
),
esc_html
(
'Docs'
)
);
array_unshift
(
$links
,
$settings_url
,
$docs_url
);
}
return
$links
;
}
/* FROM HERE IS THE DEPRECATED PART */
/* FROM HERE IS THE DEPRECATED PART */
public
function
deprecated
()
public
function
deprecated
()
...
@@ -385,7 +450,6 @@ if(!class_exists('SexHackMe_Plugin')) {
...
@@ -385,7 +450,6 @@ if(!class_exists('SexHackMe_Plugin')) {
$SECTIONS
=
array
();
$SECTIONS
=
array
();
foreach
(
glob
(
dirname
(
__FILE__
)
.
'/deprecated/*.php'
)
as
$class_path
)
{
foreach
(
glob
(
dirname
(
__FILE__
)
.
'/deprecated/*.php'
)
as
$class_path
)
{
sexhack_log
(
$class_path
);
$SEXHACK_SECTION
=
false
;
$SEXHACK_SECTION
=
false
;
try
{
try
{
include_once
(
$class_path
);
include_once
(
$class_path
);
...
@@ -397,29 +461,17 @@ if(!class_exists('SexHackMe_Plugin')) {
...
@@ -397,29 +461,17 @@ if(!class_exists('SexHackMe_Plugin')) {
$this
->
SECTIONS
=
$SECTIONS
;
$this
->
SECTIONS
=
$SECTIONS
;
$this
->
instances
=
array
();
$this
->
instances
=
array
();
foreach
(
$SECTIONS
as
$section
)
{
foreach
(
$SECTIONS
as
$section
)
{
sexhack_log
(
"Loading "
.
$section
[
'name'
])
;
$class
=
"wp_SexHackMe
\\
"
.
$section
[
'class'
]
;
$this
->
instance
_subclass
(
$section
);
$this
->
instance
s
[
$section
[
'name'
]]
=
new
$class
(
);
}
}
}
}
public
function
instance_subclass
(
$section
)
/* public function settings_section() {
{
* echo "<h3>Enable following functionalities:</h3>";
$class
=
"wp_SexHackMe
\\
"
.
$section
[
'class'
];
* }
//sexhack_log($class);
*/
$this
->
instances
[
$section
[
'name'
]]
=
new
$class
();
}
public
function
settings_section
()
{
echo
"<h3>Enable following functionalities:</h3>"
;
}
public
function
checkbox
(
$res
)
{
if
(
$res
==
"1"
)
return
"checked"
;
}
public
function
initialize_plugin
()
public
function
initialize_plugin
()
{
{
add_settings_section
(
'sexhackme-settings'
,
' '
,
array
(
$this
,
'settings_section'
),
'sexhackme-settings'
);
add_settings_section
(
'sexhackme-settings'
,
' '
,
array
(
$this
,
'settings_section'
),
'sexhackme-settings'
);
...
@@ -443,10 +495,11 @@ if(!class_exists('SexHackMe_Plugin')) {
...
@@ -443,10 +495,11 @@ if(!class_exists('SexHackMe_Plugin')) {
public
function
admin_menu
()
public
function
admin_menu
()
{
{
add_menu_page
(
'SexHackMe Settings'
,
'SexHackMe'
,
'manage_options'
,
'sexhackme-settings'
,
add_menu_page
(
'SexHackMe Settings'
,
'SexHackMe'
,
'manage_options'
,
'sexhackme-settings'
,
array
(
$this
,
'admin_page'
),
plugin_dir_url
(
__FILE__
)
.
'/
img/admin_icon.png'
,
31
);
array
(
$this
,
'admin_page'
),
SH_PLUGIN_DIR_PATH
.
'
img/admin_icon.png'
,
31
);
add_submenu_page
(
'sexhackme-settings'
,
'SexHackMe Settings'
,
'Modules'
,
add_submenu_page
(
'sexhackme-settings'
,
'SexHackMe Settings'
,
'Modules'
,
'manage_options'
,
'sexhackme-settings'
);
'manage_options'
,
'sexhackme-settings'
);
foreach
(
$this
->
SECTIONS
as
$section
)
{
foreach
(
$this
->
SECTIONS
as
$section
)
{
if
(
get_option
(
$section
[
'name'
])
==
"1"
)
if
(
get_option
(
$section
[
'name'
])
==
"1"
)
{
{
...
@@ -469,70 +522,10 @@ if(!class_exists('SexHackMe_Plugin')) {
...
@@ -469,70 +522,10 @@ if(!class_exists('SexHackMe_Plugin')) {
public
function
admin_page
()
public
function
admin_page
()
{
{
?>
if
(
file_exists
(
SH_PLUGIN_DIR_PATH
.
'templates/admin/sexhackme.php'
))
<div
class=
"wrap"
>
include_once
(
SH_PLUGIN_DIR_PATH
.
'templates/admin/sexhackme.php'
);
<h2>
SexHackMe Plugin Settings
</h2>
<form
method=
"post"
action=
"/wp-admin/options.php"
>
<?php
settings_fields
(
'sexhackme-settings'
);
?>
<?php
do_settings_sections
(
'sexhackme-settings'
);
?>
<table
class=
"form-table"
>
<?php
foreach
(
$this
->
SECTIONS
as
$section
)
{
?>
<tr
align=
"top"
>
<th
scope=
"row"
>
<?php
echo
$section
[
'description'
];
?>
</th>
<td>
<input
type=
"checkbox"
name=
"
<?php
echo
$section
[
'name'
];
?>
"
value=
"1"
<?php
echo
$this
->
checkbox
(
get_option
(
$section
[
'name'
]
));
?>
/>
<br>
<?php
if
(
array_key_exists
(
'require-page'
,
$section
)
&&
(
$section
[
'require-page'
]))
{
$reqps
=
array
();
if
(
is_string
(
$section
[
'require-page'
]))
{
$reqtitle
=
"Select the base plugin module page"
;
$reqpages
=
get_posts
(
array
(
'post_type'
=>
$section
[
'require-page'
],
'parent'
=>
0
));
$reqps
[]
=
array
(
'title'
=>
$reqtitle
,
'pages'
=>
$reqpages
,
'option'
=>
$section
[
'name'
]
.
"-page"
);
}
elseif
(
is_array
(
$section
[
'require-page'
]))
{
$i
=
0
;
foreach
(
$section
[
'require-page'
]
as
$rpage
)
{
if
(
array_key_exists
(
'post_type'
,
$rpage
))
{
$reqpsa
=
array
(
'title'
=>
'Select Page'
,
'option'
=>
$section
[
'name'
]
.
"-page
$i
"
,
'pages'
=>
get_posts
(
array
(
'post_type'
=>
$rpage
[
'post_type'
],
'parent'
=>
0
)));
if
(
array_key_exists
(
'option'
,
$rpage
))
$reqpsa
[
'option'
]
=
$rpage
[
'option'
];
if
(
array_key_exists
(
'title'
,
$rpage
))
$reqpsa
[
'title'
]
=
$rpage
[
'title'
];
$reqps
[]
=
$reqpsa
;
}
$i
++
;
}
}
else
{
$reqtitle
=
"Select the base plugin module page"
;
$reqpages
=
get_pages
();
$reqps
[]
=
array
(
'title'
=>
$reqtitle
,
'pages'
=>
$reqpages
,
'option'
=>
$section
[
'name'
]
.
"-page"
);
}
foreach
(
$reqps
as
$reqarr
)
{
?>
<select
id=
"
<?php
echo
$reqarr
[
'option'
];
?>
"
name=
"
<?php
echo
$reqarr
[
'option'
];
?>
"
class=
"widefat"
>
<option
value=
"-1"
>
<?php
esc_html_e
(
'Choose...'
,
'paid-member-subscriptions'
)
?>
</option>
<?php
$opt
=
get_option
(
$reqarr
[
'option'
]);
foreach
(
$reqarr
[
'pages'
]
as
$page
)
{
echo
'<option value="'
.
esc_attr
(
$page
->
ID
)
.
'"'
;
if
(
$opt
==
$page
->
ID
)
{
echo
"selected"
;}
echo
'>'
.
esc_html
(
$page
->
post_title
)
.
' ( ID: '
.
esc_attr
(
$page
->
ID
)
.
')'
.
'</option>'
;
}
?>
</select>
<p
class=
"description"
>
<?php
echo
$reqarr
[
'title'
];
?>
</p>
<?php
}
?>
<?php
}
?>
</td>
</tr>
<?php
}
?>
</table>
<?php
submit_button
();
?>
</form>
</div>
<?php
}
}
}
}
// Let's run the plugin!
// Let's run the plugin!
...
...
template/admin/sexhackme.php
deleted
100644 → 0
View file @
b364ecb3
template/admin/gallery.php
→
template
s
/admin/gallery.php
View file @
65f13d56
File moved
templates/admin/sexhackme.php
0 → 100644
View file @
65f13d56
<?php
/**
* Copyright: 2022 (c)Franco (nextime) Lanza <franco@nexlab.it>
* License: GNU/GPL version 3.0
*
* This file is part of SexHackMe Wordpress Plugin.
*
* SexHackMe Wordpress Plugin is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* SexHackMe Wordpress Plugin is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SexHackMe Wordpress Plugin. If not, see <https://www.gnu.org/licenses/>.
*/
?>
<div
class=
"wrap"
>
<h2>
SexHackMe Plugin Settings
</h2>
<form
method=
"post"
action=
"/wp-admin/options.php"
>
<?php
settings_fields
(
'sexhackme-settings'
);
?>
<?php
do_settings_sections
(
'sexhackme-settings'
);
?>
<table
class=
"form-table"
>
<?php
foreach
(
$this
->
SECTIONS
as
$section
)
{
?>
<tr
align=
"top"
>
<th
scope=
"row"
>
<?php
echo
$section
[
'description'
];
?>
</th>
<td>
<input
type=
"checkbox"
name=
"
<?php
echo
$section
[
'name'
];
?>
"
value=
"1"
<?php
echo
wp_SexHackMe\checkbox
(
get_option
(
$section
[
'name'
]
));
?>
/>
<br>
<?php
if
(
array_key_exists
(
'require-page'
,
$section
)
&&
(
$section
[
'require-page'
]))
{
$reqps
=
array
();
if
(
is_string
(
$section
[
'require-page'
]))
{
$reqtitle
=
"Select the base plugin module page"
;
$reqpages
=
get_posts
(
array
(
'post_type'
=>
$section
[
'require-page'
],
'parent'
=>
0
));
$reqps
[]
=
array
(
'title'
=>
$reqtitle
,
'pages'
=>
$reqpages
,
'option'
=>
$section
[
'name'
]
.
"-page"
);
}
elseif
(
is_array
(
$section
[
'require-page'
]))
{
$i
=
0
;
foreach
(
$section
[
'require-page'
]
as
$rpage
)
{
if
(
array_key_exists
(
'post_type'
,
$rpage
))
{
$reqpsa
=
array
(
'title'
=>
'Select Page'
,
'option'
=>
$section
[
'name'
]
.
"-page
$i
"
,
'pages'
=>
get_posts
(
array
(
'post_type'
=>
$rpage
[
'post_type'
],
'parent'
=>
0
)));
if
(
array_key_exists
(
'option'
,
$rpage
))
$reqpsa
[
'option'
]
=
$rpage
[
'option'
];
if
(
array_key_exists
(
'title'
,
$rpage
))
$reqpsa
[
'title'
]
=
$rpage
[
'title'
];
$reqps
[]
=
$reqpsa
;
}
$i
++
;
}
}
else
{
$reqtitle
=
"Select the base plugin module page"
;
$reqpages
=
get_pages
();
$reqps
[]
=
array
(
'title'
=>
$reqtitle
,
'pages'
=>
$reqpages
,
'option'
=>
$section
[
'name'
]
.
"-page"
);
}
foreach
(
$reqps
as
$reqarr
)
{
?>
<select
id=
"
<?php
echo
$reqarr
[
'option'
];
?>
"
name=
"
<?php
echo
$reqarr
[
'option'
];
?>
"
class=
"widefat"
>
<option
value=
"-1"
>
<?php
esc_html_e
(
'Choose...'
,
'paid-member-subscriptions'
)
?>
</option>
<?php
$opt
=
get_option
(
$reqarr
[
'option'
]);
foreach
(
$reqarr
[
'pages'
]
as
$page
)
{
echo
'<option value="'
.
esc_attr
(
$page
->
ID
)
.
'"'
;
if
(
$opt
==
$page
->
ID
)
{
echo
"selected"
;}
echo
'>'
.
esc_html
(
$page
->
post_title
)
.
' ( ID: '
.
esc_attr
(
$page
->
ID
)
.
')'
.
'</option>'
;
}
?>
</select>
<p
class=
"description"
>
<?php
echo
$reqarr
[
'title'
];
?>
</p>
<?php
}
?>
<?php
}
?>
</td>
</tr>
<?php
}
?>
</table>
<?php
submit_button
();
?>
</form>
</div>
template/newvideo.php
→
template
s
/newvideo.php
View file @
65f13d56
File moved
template/video.php
→
template
s
/video.php
View file @
65f13d56
File moved
templates/videoplayer/hls.php
0 → 100644
View file @
65f13d56
<?php
/**
* Copyright: 2022 (c)Franco (nextime) Lanza <franco@nexlab.it>
* License: GNU/GPL version 3.0
*
* This file is part of SexHackMe Wordpress Plugin.
*
* SexHackMe Wordpress Plugin is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* SexHackMe Wordpress Plugin is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SexHackMe Wordpress Plugin. If not, see <https://www.gnu.org/licenses/>.
*/
$uid
=
uniqid
(
'sexhls_'
);
?>
<video
id=
"
<?php
echo
$uid
;
?>
"
style=
"width: 100%; height: 100%;"
controls
poster=
"
<?php
echo
$posters
;
?>
"
></video>
<script
language=
"javascript"
>
$
(
window
).
on
(
'load'
,
function
()
{
SexHLSPlayer
(
'
<?php
echo
$vurl
;
?>
'
,
'
<?php
echo
$uid
;
?>
'
);
$
(
'#
<?php
echo
$uid
;
?>
'
).
on
(
'click'
,
function
(){
this
.
paused
?
this
.
play
():
this
.
pause
();});
Mousetrap
(
document
.
getElementById
(
'
<?php
echo
$uid
;
?>
'
)).
bind
(
'space'
,
function
(
e
,
combo
)
{
SexHLSplayPause
(
'
<?php
echo
$uid
;
?>
'
);
});
Mousetrap
(
document
.
getElementById
(
'
<?php
echo
$uid
;
?>
'
)).
bind
(
'up'
,
function
(
e
,
combo
)
{
SexHLSvolumeUp
(
'
<?php
echo
$uid
;
?>
'
);
});
Mousetrap
(
document
.
getElementById
(
'
<?php
echo
$uid
;
?>
'
)).
bind
(
'down'
,
function
(
e
,
combo
)
{
SexHLSvolumeDown
(
'
<?php
echo
$uid
;
?>
'
);
});
Mousetrap
(
document
.
getElementById
(
'
<?php
echo
$uid
;
?>
'
)).
bind
(
'right'
,
function
(
e
,
combo
)
{
SexHLSseekRight
(
'
<?php
echo
$uid
;
?>
'
);
});
Mousetrap
(
document
.
getElementById
(
'
<?php
echo
$uid
;
?>
'
)).
bind
(
'left'
,
function
(
e
,
combo
)
{
SexHLSseekLeft
(
'
<?php
echo
$uid
;
?>
'
);
});
Mousetrap
(
document
.
getElementById
(
'
<?php
echo
$uid
;
?>
'
)).
bind
(
'f'
,
function
(
e
,
combo
)
{
SexHLSvidFullscreen
(
'
<?php
echo
$uid
;
?>
'
);
});
});
</script>
templates/videoplayer/xr.php
0 → 100644
View file @
65f13d56
<?php
/**
* Copyright: 2022 (c)Franco (nextime) Lanza <franco@nexlab.it>
* License: GNU/GPL version 3.0
*
* This file is part of SexHackMe Wordpress Plugin.
*
* SexHackMe Wordpress Plugin is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* SexHackMe Wordpress Plugin is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SexHackMe Wordpress Plugin. If not, see <https://www.gnu.org/licenses/>.
*/
$uid
=
uniqid
(
'sexvideo_'
);
?>
<video
id=
'
<?php
echo
$uid
;
?>
'
class=
'video-js vjs-default-skin vjs-2-1 vjs-big-play-centered'
style=
'width: 100%; height: 100%;'
controls
poster=
'
<?php
echo
$posters
;
?>
'
>
</video>
<script
language=
'javascript'
>
$
(
window
).
on
(
'load'
,
function
()
{
var
player
=
videojs
(
'
<?php
echo
$uid
;
?>
'
,
{
html5
:
{
vhs
:
{
overrideNative
:
!
videojs
.
browser
.
IS_SAFARI
},
nativeAudioTracks
:
false
,
nativeVideoTracks
:
false
}});
player
.
src
({
src
:
'
<?php
echo
$vurl
;
?>
'
,
type
:
'application/x-mpegURL'
});
player
.
xr
();
});
</script>
template/widgets/videoaccess.php
→
template
s
/widgets/videoaccess.php
View file @
65f13d56
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment