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
a215351c
Commit
a215351c
authored
Jul 03, 2023
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add simple 404 redirect
parent
b5704689
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
20 deletions
+55
-20
class-storefront.php
includes/class-storefront.php
+14
-0
class-video-upload.php
includes/class-video-upload.php
+15
-18
functions-hooks.php
includes/functions-hooks.php
+1
-1
sexhackme.php
sexhackme.php
+1
-1
new_video.php
templates/new_video.php
+24
-0
No files found.
includes/class-storefront.php
View file @
a215351c
...
@@ -43,6 +43,20 @@ if(!class_exists('SH_StoreFront')) {
...
@@ -43,6 +43,20 @@ if(!class_exists('SH_StoreFront')) {
// 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
);
// Replace 404 page if /404.php exists
if
(
is_readable
(
$_SERVER
[
'DOCUMENT_ROOT'
]
.
'/404.php'
))
{
add_action
(
'template_redirect'
,
'wp_SexHackMe\SH_StoreFront::page404'
);
}
}
public
static
function
page404
()
{
if
(
is_404
())
{
wp_redirect
(
home_url
(
'/404.php'
)
);
die
;
}
}
}
public
static
function
credits
(
$cred
)
public
static
function
credits
(
$cred
)
...
...
includes/class-video-upload.php
View file @
a215351c
...
@@ -25,32 +25,29 @@ namespace wp_SexHackMe;
...
@@ -25,32 +25,29 @@ namespace wp_SexHackMe;
if
(
!
defined
(
'ABSPATH'
)
)
exit
;
if
(
!
defined
(
'ABSPATH'
)
)
exit
;
if
(
!
class_exists
(
'SH_
StoreFront
'
))
{
if
(
!
class_exists
(
'SH_
VideoUpload
'
))
{
class
SH_
StoreFront
class
SH_
VideoUpload
{
{
public
static
function
ini
t
()
public
function
__construc
t
()
{
{
// Remove the cart and the product search
add_action
(
'wp_ajax_file_upload'
,
array
(
$this
,
'file_upload_callback'
));
remove_action
(
'storefront_header'
,
'storefront_header_cart'
,
60
);
add_action
(
'wp_ajax_nopriv_file_upload'
,
array
(
$this
,
'file_upload_callback'
));
remove_action
(
'storefront_header'
,
'storefront_product_search'
,
40
);
// Remove StoreFront credits
add_filter
(
'storefront_credit_link'
,
'wp_SexHackMe\SH_StoreFront::credits'
);
// 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?
// Re add the cart in the right position
add_action
(
'storefront_header'
,
'storefront_header_cart'
,
40
);
}
}
public
static
function
credits
(
$cred
)
public
function
file_upload_callback
(
)
{
{
return
''
;
check_ajax_referer
(
'sh_video_upload'
,
'security'
);
$arr_img_ext
=
array
(
'image/png'
,
'image/jpeg'
,
'image/jpg'
,
'image/gif'
);
if
(
in_array
(
$_FILES
[
'file'
][
'type'
],
$arr_img_ext
))
{
$upload
=
wp_upload_bits
(
$_FILES
[
"file"
][
"name"
],
null
,
file_get_contents
(
$_FILES
[
"file"
][
"tmp_name"
]));
//$upload['url'] will gives you uploaded file path
}
wp_die
();
}
}
}
}
new
SH_VideoUpload
;
}
}
...
...
includes/functions-hooks.php
View file @
a215351c
...
@@ -38,7 +38,7 @@ function pms_get_redirect_url($url, $location=false)
...
@@ -38,7 +38,7 @@ function pms_get_redirect_url($url, $location=false)
{
{
if
(
!
isset
(
$_POST
[
'pay_gate'
]
)
||
$_POST
[
'pay_gate'
]
!=
'manual'
)
if
(
!
isset
(
$_POST
[
'pay_gate'
]
)
||
$_POST
[
'pay_gate'
]
!=
'manual'
)
return
$url
;
return
$url
;
// XXX BUG apply_filter ont found??
return
apply_filter
(
'sh_get_redirect_url'
,
$url
,
$location
);
return
apply_filter
(
'sh_get_redirect_url'
,
$url
,
$location
);
}
}
...
...
sexhackme.php
View file @
a215351c
...
@@ -402,7 +402,7 @@ if(!class_exists('SexHackMe_Plugin')) {
...
@@ -402,7 +402,7 @@ if(!class_exists('SexHackMe_Plugin')) {
$this
->
file_include
(
'includes/class-video.php'
);
$this
->
file_include
(
'includes/class-video.php'
);
$this
->
file_include
(
'includes/functions-video.php'
);
$this
->
file_include
(
'includes/functions-video.php'
);
$this
->
file_include
(
'includes/class-post_type-video.php'
);
$this
->
file_include
(
'includes/class-post_type-video.php'
);
$this
->
file_include
(
'includes/class-video-upload.php'
);
/* Video Gallery */
/* Video Gallery */
$this
->
file_include
(
'includes/class-videogallery.php'
);
$this
->
file_include
(
'includes/class-videogallery.php'
);
...
...
templates/new_video.php
View file @
a215351c
...
@@ -22,6 +22,30 @@
...
@@ -22,6 +22,30 @@
// Exit if accessed directly
// Exit if accessed directly
if
(
!
defined
(
'ABSPATH'
)
)
exit
;
if
(
!
defined
(
'ABSPATH'
)
)
exit
;
?>
?>
<script
language=
"javascript"
>
jQuery
(
function
(
$
)
{
$
(
'body'
).
on
(
'change'
,
'#file'
,
function
()
{
$this
=
$
(
this
);
file_data
=
$
(
this
).
prop
(
'files'
)[
0
];
form_data
=
new
FormData
();
form_data
.
append
(
'file'
,
file_data
);
form_data
.
append
(
'action'
,
'file_upload'
);
form_data
.
append
(
'security'
,
'
<?php
echo
wp_create_nonce
(
'sh_video_upload'
);
?>
'
);
$
.
ajax
({
url
:
'
<?php
echo
admin_url
(
'admin-ajax.php'
);
?>
'
,
type
:
'POST'
,
contentType
:
false
,
processData
:
false
,
data
:
form_data
,
success
:
function
(
response
)
{
$this
.
val
(
''
);
alert
(
'File uploaded successfully.'
);
}
});
});
});
</script>
<form
class=
"fileUpload"
enctype=
"multipart/form-data"
>
<form
class=
"fileUpload"
enctype=
"multipart/form-data"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label>
Choose File:
</label>
<label>
Choose File:
</label>
...
...
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