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
e9ac6681
Commit
e9ac6681
authored
Jul 23, 2022
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed minor bugs
parent
d99c6003
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
12 deletions
+23
-12
TODO.txt
TODO.txt
+1
-0
class-integrate-google-drive.php
includes/class-integrate-google-drive.php
+3
-4
class-video.php
includes/class-video.php
+0
-1
class-woocommerce-support.php
includes/class-woocommerce-support.php
+2
-2
functions-forms-save.php
includes/functions-forms-save.php
+5
-5
functions-utils.php
includes/functions-utils.php
+12
-0
No files found.
TODO.txt
View file @
e9ac6681
...
@@ -9,6 +9,7 @@ based on the ideas I planned for www.sexhack.me:
...
@@ -9,6 +9,7 @@ based on the ideas I planned for www.sexhack.me:
- Version 0.0.3:
- Version 0.0.3:
* Integration of Ultimate Members plugin for user and model profiles
* Integration of Ultimate Members plugin for user and model profiles
* Show thumbnail in video post list in admin
* 404 Not Found page with gallery instead of WC products
* 404 Not Found page with gallery instead of WC products
- Version 0.0.4:
- Version 0.0.4:
...
...
includes/class-integrate-google-drive.php
View file @
e9ac6681
...
@@ -36,6 +36,7 @@ if(!class_exists('SH_GDrive')) {
...
@@ -36,6 +36,7 @@ if(!class_exists('SH_GDrive')) {
function
get_download_url
(
$file
)
function
get_download_url
(
$file
)
{
{
if
(
!
(
$file
&&
is_string
(
$file
)
&&
strlen
(
$file
)
>
3
))
return
$file
;
if
(
function_exists
(
'igd_fs'
)
)
if
(
function_exists
(
'igd_fs'
)
)
{
{
// Integrate Google Drive Plugin is installed and active, so, filter it!
// Integrate Google Drive Plugin is installed and active, so, filter it!
...
@@ -47,12 +48,11 @@ if(!class_exists('SH_GDrive')) {
...
@@ -47,12 +48,11 @@ if(!class_exists('SH_GDrive')) {
$gparts
=
explode
(
'/'
,
$gpath
);
$gparts
=
explode
(
'/'
,
$gpath
);
if
(
count
(
$gparts
)
>
0
)
if
(
count
(
$gparts
)
>
0
)
{
{
$parent
=
false
;
$parent
=
false
;
$gfile
=
false
;
$gfile
=
false
;
$success
=
false
;
$success
=
false
;
$igd
=
\IGD\App
::
instance
();
$igd
=
\IGD\App
::
instance
();
// Try root first
// Try root first
foreach
(
$gparts
as
$k
=>
$part
)
foreach
(
$gparts
as
$k
=>
$part
)
{
{
...
@@ -100,13 +100,12 @@ if(!class_exists('SH_GDrive')) {
...
@@ -100,13 +100,12 @@ if(!class_exists('SH_GDrive')) {
if
(
$g
[
'name'
]
==
$part
)
if
(
$g
[
'name'
]
==
$part
)
{
{
$parent
=
$g
[
'id'
];
$parent
=
$g
[
'id'
];
$gf
=
$g
;
$gf
=
$g
;
}
}
}
}
}
}
}
}
if
(
count
(
$gparts
)
-
1
==
$k
)
$success
=
true
;
if
(
count
(
$gparts
)
-
1
==
$k
)
$success
=
true
;
if
(
$success
)
$gfile
=
$gf
;
if
(
$success
)
$gfile
=
$gf
;
...
...
includes/class-video.php
View file @
e9ac6681
...
@@ -184,7 +184,6 @@ if(!class_exists('SH_Video')) {
...
@@ -184,7 +184,6 @@ if(!class_exists('SH_Video')) {
public
function
get_guests
(
$usedb
=
true
)
public
function
get_guests
(
$usedb
=
true
)
{
{
if
(
isset
(
$this
->
attributes
[
'guests'
]))
return
$this
->
guests
;
if
(
isset
(
$this
->
attributes
[
'guests'
]))
return
$this
->
guests
;
sexhack_log
(
"(TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT"
);
$this
->
attributes
[
'guests'
]
=
array
();
$this
->
attributes
[
'guests'
]
=
array
();
if
(
$usedb
)
if
(
$usedb
)
{
{
...
...
includes/class-woocommerce-support.php
View file @
e9ac6681
...
@@ -59,10 +59,10 @@ if(!class_exists("SH_VideoProducts")) {
...
@@ -59,10 +59,10 @@ if(!class_exists("SH_VideoProducts")) {
// main product settings
// main product settings
$prod
->
set_name
(
$video
->
title
);
$prod
->
set_name
(
$video
->
title
);
$prod
->
set_slug
(
$video
->
slug
);
// XXX TODO Compose slug with username too to avoid name collisions?
$prod
->
set_slug
(
$video
->
slug
);
// Product description.
// Product description.
$video_link
=
site_url
()
.
'/'
.
get_option
(
'gallery_slug'
,
'v'
)
.
"/"
;
// XXX TODO Get the right product link
$video_link
=
site_url
()
.
'/'
.
get_option
(
'gallery_slug'
,
'v'
)
.
"/"
.
$video
->
slug
.
"/"
;
$prod
->
set_short_description
(
'<p>Whach me <a href="'
.
$video_link
.
'">ONLINE HERE</a></p>'
);
$prod
->
set_short_description
(
'<p>Whach me <a href="'
.
$video_link
.
'">ONLINE HERE</a></p>'
);
$prod
->
set_description
(
$video
->
description
);
$prod
->
set_description
(
$video
->
description
);
...
...
includes/functions-forms-save.php
View file @
e9ac6681
...
@@ -81,13 +81,13 @@ function save_sexhack_video_meta_box_data( $post_id )
...
@@ -81,13 +81,13 @@ function save_sexhack_video_meta_box_data( $post_id )
//
//
// Title and slug
// Title and slug
$video
->
title
=
$post
->
post_title
;
$video
->
title
=
$post
->
post_title
;
$video
->
slug
=
$post
->
post_name
;
$video
->
slug
=
uniqidReal
()
.
"-"
.
$post
->
post_name
;
// TODO Remove debug
// TODO Remove debug
sexhack_log
(
"SAVE post object:"
);
//
sexhack_log("SAVE post object:");
sexhack_log
(
$post
);
//
sexhack_log($post);
sexhack_log
(
' - $POST:'
);
//
sexhack_log(' - $POST:');
sexhack_log
(
$_POST
);
//
sexhack_log($_POST);
// Model
// Model
if
(
array_key_exists
(
'video_model'
,
$_POST
)
&&
is_numeric
(
$_POST
[
'video_model'
])
&&
intval
(
$_POST
[
'video_model'
])
>
0
)
if
(
array_key_exists
(
'video_model'
,
$_POST
)
&&
is_numeric
(
$_POST
[
'video_model'
])
&&
intval
(
$_POST
[
'video_model'
])
>
0
)
...
...
includes/functions-utils.php
View file @
e9ac6681
...
@@ -261,6 +261,18 @@ function check_url_or_path($url)
...
@@ -261,6 +261,18 @@ function check_url_or_path($url)
return
false
;
return
false
;
}
}
function
uniqidReal
(
$lenght
=
13
)
{
// uniqid gives 13 chars, but you could adjust it to your needs.
if
(
function_exists
(
"random_bytes"
))
{
$bytes
=
random_bytes
(
ceil
(
$lenght
/
2
));
}
elseif
(
function_exists
(
"openssl_random_pseudo_bytes"
))
{
$bytes
=
openssl_random_pseudo_bytes
(
ceil
(
$lenght
/
2
));
}
else
{
throw
new
Exception
(
"no cryptographically secure random function available"
);
}
return
substr
(
bin2hex
(
$bytes
),
0
,
$lenght
);
}
function
html2text
(
$html
)
function
html2text
(
$html
)
{
{
// remove comments and any content found in the the comment area (strip_tags only removes the actual tags).
// remove comments and any content found in the the comment area (strip_tags only removes the actual tags).
...
...
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