Add admin subpage for modules

parent 754eb3dd
...@@ -375,12 +375,24 @@ if(!class_exists('SexHackVideoGallery')) { ...@@ -375,12 +375,24 @@ if(!class_exists('SexHackVideoGallery')) {
} }
function gallery_adminpage()
{
?>
<div class="wrap">
<h2>SexHackMe Gallery Settings</h2>
</div>
<?php
}
$SEXHACK_SECTION = array( $SEXHACK_SECTION = array(
'class' => 'SexHackVideoGallery', 'class' => 'SexHackVideoGallery',
'description' => 'Create Video galleries for Sexhack Video products', 'description' => 'Create Video galleries for Sexhack Video products',
//'require-page' => true, //'require-page' => true,
'adminmenu' => array(
array('title' => 'Gallery',
'slug' => 'gallery',
'callback' => 'wp_SexHackMe\gallery_adminpage')
),
'name' => 'sexhackme_videogallery' 'name' => 'sexhackme_videogallery'
); );
......
...@@ -173,6 +173,27 @@ if(!class_exists('SexHackMe')) { ...@@ -173,6 +173,27 @@ if(!class_exists('SexHackMe')) {
{ {
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', 150); array($this, 'admin_page'), plugin_dir_url(__FILE__) .'/img/admin_icon.png', 150);
add_submenu_page( 'sexhackme-settings', 'SexHackMe Settings', 'Modules',
'manage_options', 'sexhackme-settings');
foreach($this->SECTIONS as $section) {
if(get_option( $section['name'])=="1")
{
if (array_key_exists('adminmenu', $section) && is_array($section['adminmenu'])) {
foreach($section['adminmenu'] as $admsub) {
sexhack_log($admsub);
if(is_array($admsub)
&& array_key_exists('title', $admsub)
&& array_key_exists('callback', $admsub)
&& array_key_exists('slug', $admsub)) {
add_submenu_page( 'sexhackme-settings', $admsub['title'],
$admsub['title'], 'manage_options', $admsub['slug'],
$admsub['callback']);
}
}
}
}
}
} }
public function admin_page() public function admin_page()
......
...@@ -30,6 +30,18 @@ get_header(); ?> ...@@ -30,6 +30,18 @@ get_header(); ?>
echo do_shortcode("[sexadv adv=".get_option('sexadv_video_top')."]"); echo do_shortcode("[sexadv adv=".get_option('sexadv_video_top')."]");
$htmltags = '<span><b>TAGS: </b></span>';
$tags = get_the_terms( get_the_ID(), 'product_tag' );
if ( ! empty( $tags ) && ! is_wp_error( $tags ) )
{
foreach($tags as $tag) {
$htmltags.="<span>#".$tag->name . '</span> ';
}
}
$prod = wc_get_product(get_the_ID()); $prod = wc_get_product(get_the_ID());
$hls = $prod->get_attribute("hls_public"); $hls = $prod->get_attribute("hls_public");
$hls_member = $prod->get_attribute("hls_members"); $hls_member = $prod->get_attribute("hls_members");
...@@ -76,6 +88,8 @@ get_header(); ?> ...@@ -76,6 +88,8 @@ get_header(); ?>
else if($gif_preview) echo '<img src="'.$gif_preview.'" loading="lazy"></img>'; else if($gif_preview) echo '<img src="'.$gif_preview.'" loading="lazy"></img>';
else echo '<img src="'.$thumb.'" loading="lazy"></img>'; else echo '<img src="'.$thumb.'" loading="lazy"></img>';
echo $htmltags;
} }
elseif($sexhack_pms->is_member()) // free membership elseif($sexhack_pms->is_member()) // free membership
{ {
...@@ -88,6 +102,8 @@ get_header(); ?> ...@@ -88,6 +102,8 @@ get_header(); ?>
else if($gif_preview) echo '<img src="'.$gif_preview.'" loading="lazy"></img>'; else if($gif_preview) echo '<img src="'.$gif_preview.'" loading="lazy"></img>';
else echo '<img src="'.$thumb.'" loading="lazy"></img>'; else echo '<img src="'.$thumb.'" loading="lazy"></img>';
echo $htmltags;
if($hls_premium) $endhtml .= "<h3><a href='/product-category/subscriptions/'>Premium full lenght version available here</a></h3>"; if($hls_premium) $endhtml .= "<h3><a href='/product-category/subscriptions/'>Premium full lenght version available here</a></h3>";
if($vr_premium) $endhtml .= "<h3><a href='/product-category/subscriptions/'>VR 3D Premium full lenght version available here</a></h3>"; if($vr_premium) $endhtml .= "<h3><a href='/product-category/subscriptions/'>VR 3D Premium full lenght version available here</a></h3>";
} }
...@@ -100,6 +116,8 @@ get_header(); ?> ...@@ -100,6 +116,8 @@ get_header(); ?>
else if($gif_preview) echo '<img src="'.$gif_preview.'" loading="lazy"></img>'; else if($gif_preview) echo '<img src="'.$gif_preview.'" loading="lazy"></img>';
else echo '<img src="'.$thumb.'" loading="lazy"></img>'; else echo '<img src="'.$thumb.'" loading="lazy"></img>';
echo $htmltags;
if($hls_premium) $endhtml .= "<h3><a href='/product-category/subscriptions/'>Premium full lenght version available here</a></h3>"; if($hls_premium) $endhtml .= "<h3><a href='/product-category/subscriptions/'>Premium full lenght version available here</a></h3>";
if($hls_member) $endhtml .= "<h3><a href='/login'>Free members only version available! Sign up or Login to watch</a></h3>"; if($hls_member) $endhtml .= "<h3><a href='/login'>Free members only version available! Sign up or Login to watch</a></h3>";
if($vr_premium) $endhtml .= "<h3><a href='/product-category/subscriptions/'>VR 3D Premium full lenght version available here</a></h3>"; if($vr_premium) $endhtml .= "<h3><a href='/product-category/subscriptions/'>VR 3D Premium full lenght version available here</a></h3>";
...@@ -114,8 +132,10 @@ get_header(); ?> ...@@ -114,8 +132,10 @@ get_header(); ?>
// get_template_part( 'content', get_post_format() ); // get_post_format() return empty for us // get_template_part( 'content', get_post_format() ); // get_post_format() return empty for us
//endif; //endif;
echo $endhtml; echo $endhtml;
?> ?>
<h3><a href="<?php echo get_the_permalink(); ?>">Download the full lenght hi-res version of this video</a><h3> <h3><a href="<?php echo get_the_permalink(); ?>">Download the full lenght hi-res version of this video</a><h3>
<br><hr> <br><hr>
<?php <?php
echo do_shortcode("[sexadv adv=".get_option('sexadv_video_bot')."]"); echo do_shortcode("[sexadv adv=".get_option('sexadv_video_bot')."]");
......
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