Fix query filters on video categories

parent 120d4bcb
...@@ -264,15 +264,17 @@ if(!class_exists('SH_Query')) { ...@@ -264,15 +264,17 @@ if(!class_exists('SH_Query')) {
// XXX TODO This filtering using a $_GET in the query class is SHIT. // XXX TODO This filtering using a $_GET in the query class is SHIT.
// Move it in the gallery interface, and pass a fucking argument // Move it in the gallery interface, and pass a fucking argument
$filter=false; $filter=false;
if(isset($_GET['sexhack_vselect'])) if(isset($_GET['shvs']))
{ {
switch($_GET['sexhack_vselect']) switch($_GET['shvs'])
{ {
case 'premium': case 'premium':
case 'members': case 'members':
case 'public': case 'public':
$filter="hls_".$_GET['shvs'];
break;
case 'preview': case 'preview':
$filter=$_GET['sexhack_vselect']; $filter=$_GET['shvs'];
break; break;
} }
} }
...@@ -280,6 +282,7 @@ if(!class_exists('SH_Query')) { ...@@ -280,6 +282,7 @@ 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."!=''";
$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)
...@@ -421,15 +424,15 @@ if(!class_exists('SH_Query')) { ...@@ -421,15 +424,15 @@ if(!class_exists('SH_Query')) {
public static function get_Products($vcat=false) public static function get_Products($vcat=false)
{ {
$filter=false; $filter=false;
if(isset($_GET['sexhack_vselect'])) if(isset($_GET['shvs']))
{ {
switch($_GET['sexhack_vselect']) switch($_GET['shvs'])
{ {
case 'premium': case 'premium':
case 'members': case 'members':
case 'public': case 'public':
case 'preview': case 'preview':
$filter=$_GET['sexhack_vselect']; $filter=$_GET['shvs'];
break; break;
} }
} }
......
...@@ -134,11 +134,11 @@ if(!class_exists('SH_GalleryWidget')) { ...@@ -134,11 +134,11 @@ if(!class_exists('SH_GalleryWidget')) {
echo $args['before_title'] . $title . $args['after_title']; echo $args['before_title'] . $title . $args['after_title'];
?> ?>
<ul> <ul>
<li><a href="">All videos</a></li> <li><a href="?shvs=all">All videos</a></li>
<li><a href="?sexhack_vselect=public">Public videos</a></li> <li><a href="?shvs=public">Public videos</a></li>
<li><a href="?sexhack_vselect=members">Members videos</a></li> <li><a href="?shvs=members">Members videos</a></li>
<li><a href="?sexhack_vselect=premium">Premium videos</a></li> <li><a href="?shvs=premium">Premium videos</a></li>
<li><a href="?sexhack_vselect=preview">Previews videos</a></li> <li><a href="?shvs=preview">Previews videos</a></li>
</ul> </ul>
<?php <?php
echo $args['after_widget']; echo $args['after_widget'];
......
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