#!/usr/bin/perl MAIN: { $server = $ENV{'SERVER_NAME'}; $query = $ENV{'QUERY_STRING'}; $query0 = $query; $query =~ s/\&stk\=.*//; $query0 =~ s/\&price\_range\=.*//g; $domain = $server; if ( $domain =~ m/sex\-superstore/i ) { $domain = '.sex-superstore.com' } else { $domain = '' } #affiliate flag if ( !( $server =~ m/pexxx/i ) and !( $server =~ m/privateentertainment/i ) and !( $server =~ m/myadultwarehouse/i ) ) { $aff_flag = 1; } if ( $server =~ /shop\.sex\-superstore\.com/i or $server =~ /store\.sex\-superstore\.com/i or $server =~ /store\.dev\.sex\-superstore\.com/i or $server =~ /shop\.dev\.sex\-superstore\.com/i ) { $aff_super = 1; } #niche specific if ( $server =~ /hetero/i ) { @asso00 = ( 'hotdeal', 'hetero', 'allgirl' ); @asso0 = ( 'hetero', 'Hetero', 'allgirl', 'All Girl', 'voldiscount', 'Volume Discount', 'hotdeal', 'Hot Deals!', 'top20', 'Top 20', 'all', 'New Releases' ); %asso0 = @asso0; @races = ( 'black', 'white', 'asian', 'interracial', 'latin' ); $init_def = 'hetero'; #default initial category $query_def = "(initial='hetero' or initial='allgirl')"; #query default $query_def1 = $query_def; #query modifier only for niches $niche1 = 'Hetero'; #for top20 } elsif ( $server =~ /allmale/i ) { @asso00 = ( 'hotdeal', 'allmale', 'bisex' ); @asso0 = ( 'allmale', 'AllMale', 'bisex', 'BiSexual', 'voldiscount', 'Volume Discount', 'hotdeal', 'Hot Deals!', 'top20', 'Top 20', 'all', 'New Releases' ); %asso0 = @asso0; @races = ( 'black', 'white', 'asian', 'interracial', 'latin' ); $init_def = 'allmale'; $query_def = "(initial='allmale' or initial='bisex')"; $query_def1 = $query_def; $niche1 = 'Allmale'; } elsif ( $server =~ /transsexual/i ) { @asso00 = ( 'hotdeal', 'trans', 'bisex' ); @asso0 = ( 'trans', 'Transsexual', 'bisex', 'BiSexual', 'voldiscount', 'Volume Discount', 'hotdeal', 'Hot Deals!', 'top20', 'Top 20', 'all', 'New Releases' ); %asso0 = @asso0; @races = ( 'black', 'white', 'asian', 'interracial', 'latin' ); $init_def = 'trans'; $query_def = "(initial='trans' or initial='bisex')"; $query_def1 = $query_def; $niche1 = 'Transsexual'; } elsif ( $server =~ /fetish/i ) { @asso00 = ( 'hotdeal', 'fetish', 'bondage' ); @asso0 = ( 'fetish', 'Fetish', 'bondage', 'Bondage', 'voldiscount', 'Volume Discount', 'hotdeal', 'Hot Deals!', 'top20', 'Top 20', 'all', 'New Releases' ); %asso0 = @asso0; @races = ( 'black', 'white', 'asian', 'interracial', 'latin' ); $init_def = 'fetish'; $query_def = "(initial='fetish' or initial='bondage')"; $query_def1 = $query_def; $niche1 = 'Fetish'; } elsif ( $server =~ /interracial/i ) { @asso00 = ( 'hotdeal', 'hetero', 'fetish', 'bondage', 'allgirl', 'allmale', 'bisex', 'trans' ); @asso0 = ( 'hetero', 'Hetero', 'fetish', 'Fetish', 'bondage', 'Bondage', 'allgirl', 'All Girl', 'allmale', 'All Male', 'bisex', 'BiSexual', 'trans', 'Transsexual', 'voldiscount', 'Volume Discount', 'hotdeal', 'Hot Deals!', 'top20', 'Top 20', 'all', 'New Releases' ); %asso0 = @asso0; @races = ( 'black', 'interracial', 'asian', 'latin' ); $init_def = 'hetero'; $query_def = "(initial='hetero' or initial='fetish' or initial='bondage' or initial='allgirl')"; $query_add = "and (sub='black' or sub='interracial' or sub='asian' or sub='latin')" ; #additional query modifier $query_def1 = $query_def; $niche1 = 'Interracial'; } else { #SuperStore @asso00 = ( 'hotdeal', 'hetero', 'fetish', 'bondage', 'allgirl', 'allmale', 'bisex', 'trans' ); @asso0 = ( 'hetero', 'Hetero', 'fetish', 'Fetish', 'bondage', 'Bondage', 'allgirl', 'All Girl', 'allmale', 'All Male', 'bisex', 'BiSexual', 'trans', 'Transsexual', 'voldiscount', 'Volume Discount', 'hotdeal', 'Hot Deals!', 'top20', 'Top 20', 'all', 'New Releases' ); %asso0 = @asso0; @races = ( 'black', 'white', 'asian', 'interracial', 'latin', 'allgirl', 'bondage' ); $init_def = 'hetero'; $query_def = "(initial='hetero' or initial='fetish' or initial='bondage' or initial='allgirl' or initial='bisex' or initial='trans')"; $niche1 = 'Superstore'; } if ($query_def1) { $query_def2 = "and $query_def1" } else { $query_def2 = '' } $pth = 'pthumbs'; $status = 'date'; #DATE local ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time); $year = 1900 + $year; local (@month) = ( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ); local ($mo) = $month[$mon]; &ReadParse; ( $text, $type, $criteria, $last, $last_list, $first, $first_list, $fam, $hotdeal, $discount, $bestseller, $top20, $init, $dozen, $dozen_list, $letter, $init1, $noresult, $race, $affiliate, $stk, $price_range ) = ( $in{'text'}, $in{'type'}, $in{'criteria'}, $in{'last'}, $in{'last_list'}, $in{'first'}, $in{'first_list'}, $in{'fam'}, $in{'hotdeal'}, $in{'discount'}, $in{'bestseller'}, $in{'top20'}, $in{'init'}, $in{'dozen'}, $in{'dozen_list'}, $in{'letter'}, $in{'init1'}, $in{'noresult'}, $in{'race'}, $in{'af'}, $in{'stk'}, $in{'price_range'} ); if (length($ecode) > 10) { die('Invalid Parameter'); } if ( !$type ) { $type = 'dvd' } if ( $text eq 'hotdeal' or $init eq 'hotdeal' ) { $hotdeal = 'Yes' } if ( $init eq 'top20' ) { $top20 = 'Yes' } if ( $criteria eq 'voldiscount' or $init eq 'voldiscount' ) { $discount = 'Yes'; $init = 'voldiscount'; } if ( $discount eq 'Yes' ) { $criteria = 'voldiscount' } if ( $criteria eq 'init' ) { $init = $text } if ( !$init and !$criteria ) { $init = 'all' } if ($noresult) { $text = $noresult; $criteria = 'ecode'; } if ( $text eq 'all' and $criteria eq 'init' ) { $text = ''; $criteria = ''; } if ( $stk eq 'Yes' ) { $first = ''; $last = ''; $first_list = ''; $last_list = ''; $dozen = 1; $dozen_list = 1; } if ($price_range) { $price_app = "&price_range=$price_range" } &get_cookie; $stock = $cookie{'stock'}; $stock = substr( $stock, 0, 1 ); if ( !$stock or ( $stock ne 'N' and $stock ne 'T' and $stock ne 'A' and $stock ne 'P' and $stock ne 'O' and $stock ne 'F' and $stock ne 'D' ) ) { $stock = 'N'; } if ( $stock ne 'N' ) { $inv_mod = " and inventory.available='$stock'"; } else { $inv_mod = " and (inventory.available='T' or inventory.available='P')"; } $res_field = 'results'; if ( $stock eq 'T' ) { $sel_T = 'selected'; $res_field = 'res_T' } if ( $stock eq 'A' ) { $sel_A = 'selected'; $inv_mod = ''; $res_field = 'res_A'; } if ( $stock eq 'P' ) { $sel_P = 'selected'; $res_field = 'res_P' } if ( $stock eq 'O' ) { $sel_O = 'selected'; $res_field = 'res_O' } if ( $stock eq 'F' ) { $sel_F = 'selected'; $res_field = 'res_F'; } if ( $stock eq 'D' ) { $sel_D = 'selected'; $res_field = 'res_D'; } if ( !( $affiliate =~ /^\d/ ) ) { $affiliate = $cookie{'affiliate'}; } $affiliate =~ s/\D.*//s; if ( !( $affiliate =~ /^\d/ ) ) { $affiliate = 0 } if ($fam) { foreach $rc (@races) { if ( $fam eq $rc and $hotdeal ne 'Yes' ) { $race = $fam } } } if ( !$dozen ) { $dozen = 1 } if ( !$dozen_list ) { $dozen_list = 1 } $dozen0 = $dozen - 1; $dozen1 = $dozen + 1; $dozen_list0 = $dozen_list - 1; $dozen_list1 = $dozen_list + 1; $first_list0 = $first_list; $last_list0 = $last_list; if ( !$init1 and ( $discount eq 'Yes' ) ) { $init1 = $init_def } use CGI; $foo = new CGI; $text3 = $text; $text3 =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg; ###CATEGORY & family SELECT $text_type = $type; open( FILEHANDLE, "< store.txt" ) or print 'Cannot open file'; while () { chop $_; $code .= $_ } close(FILEHANDLE); eval($code); %assa3 = @asso3; %assa1 = @asso1; %assa0 = @asso0; $fam_number = ( $#asso1 + 1 ) / 2; $initial = $assa0{$init}; if ( !$text ) { $text = $initial } $family = $assa1{$fam}; if ( $criteria eq 'init' ) { $text1 = " > $asso0{$text}"; } if ($fam) { $fam1 = " > $family"; } if ($init1) { $fam1 = " > $asso0{$init1}"; } if ($race) { $race1 = " > $assa1{$race}"; if ( $race eq $fam ) { $fam1 = '' } else { $add_race = "   $assa1{$race}
" } } require("../inc/dbc.dat"); #show stream if ( $criteria ne 'init' ) { $text1 = " > $text"; } if ( $hotdeal eq 'Yes' ) { $text1 = " > Hot Deals!"; $addition = '&hotdeal=Yes'; } if ( $discount eq 'Yes' ) { $text1 = " > Volume Discounts"; $addition = '&discount=Yes'; } if ( $bestseller eq 'Yes' ) { $text1 = " > Bestsellers"; $addition = '&bestseller=Yes'; $pth = 'pimage'; } if ( $top20 eq 'Yes' ) { $text1 = " > Top 20"; } $type1 = "Adult DVD"; #types for Cart $type3 = $type; if ( $type eq 'magazines' ) { $type3 = 'mag' } if ( $type eq 'toys' ) { $type3 = 'toy' } if ($family) { $family3 = ": $family" } if ($initial) { $initial3 = " $initial" } require("/export/home0/vhost218/cgi-serverwide/colors.pl"); $niche0 = $niche; if ( !$niche0 ) { $niche0 = 'SuperStore' } # $text3 = unescape($text3); #page layout print &PrintHeader; print < Adult DVD: $initial3$family3$text3 $style_sheet EOT require("/export/home0/vhost218/cgi-serverwide/header.pl"); print < EOT require("/export/home0/vhost218/cgi-serverwide/menu_new.pl"); #price range/match if ($price_range) { #field for price if ( ( $aff_flag and !( $server =~ m/shop/ ) ) or ( $server =~ m/myadultwarehouse/ ) ) { $price_field = 'price'; } else { $price_field = 'saleprice' } if ( $price_range !~ /\-/ ) { #exact match $price_match = $price_range; if ( $price_match =~ /^\d+$/ or $price_match =~ /^\d+\.\d+$/ ) { $price_mod = "$price_field=$price_match"; $price2 = "\$$price_match"; $price1 = " > $price2"; } } else { #range ( $price_min, $price_max ) = split /-/, $price_range; if ( $price_min =~ /^\d+$/ or $price_min =~ /^\d+\.\d+$/ ) { $price_mod_min = "$price_field>$price_min"; } if ( $price_max =~ /^\d+$/ or $price_max =~ /^\d+\.\d+$/ ) { $price_mod_max = "$price_field<$price_max"; } if ( $price_mod_min and $price_mod_max ) { $price_mod = "$price_mod_min and $price_mod_max"; $price2 = "\$$price_min - \$$price_max"; $price1 = " > $price2"; } elsif ($price_mod_min) { $price_mod = $price_mod_min; $price2 = "more than \$$price_min"; $price1 = " > $price2"; } elsif ($price_mod_max) { $price_mod = $price_mod_max; $price2 = "less than \$$price_max"; $price1 = " > $price2"; } } } print <
EOT #product DB retrieve $table = 'date_' . $type; $table1 = 'aph_' . $type; if ( $init and $init ne 'all' ) { $where = "WHERE initial='$init'"; $where_list = "WHERE initial='$init'"; } else { $where = "WHERE $query_def"; $where_list = "WHERE $query_def"; } if ( $criteria eq 'title' ) { $crt = 'product_name' } if ( $criteria eq 'manufacturer' ) { $crt = 'manufacturer' } if ( $criteria eq 'star' ) { $crt = 'stars' } if ( $criteria eq 'ecode' ) { $crt = 'inventory.item' } if ( $criteria eq 'init' ) { $crt = 'initial' } if ( $text ne 'all' ) { $textE = "%" . $text . "%"; } else { $textE = "%" . "%"; } $textE = $dbh->quote($textE); if ( $criteria or $init1 ) { $where = "WHERE $crt LIKE $textE"; $where_list = "WHERE $crt LIKE $textE $query_def2"; if ($init1) { $where = $where . " and initial='$init1'"; $where_list = $where_list . " and $table1.initial='$init1'"; } } if ( $discount eq 'Yes' ) { $where = "WHERE voldiscount='T'"; $where_list = "WHERE voldiscount='T'"; if ($init1) { $where = $where . " and initial='$init1'"; $where_list = $where_list . " and initial='$init1'"; } } if ($fam) { if ( $fam =~ m/\d\-\d/ ) { ( $time1, $time2 ) = split /-/, $fam; $where = $where . " and run_time>=$time1 and run_time<=$time2"; $where_list = $where_list . " and run_time>=$time1 and run_time<=$time2"; } else { $where1 = "or sub='$fam'"; $where = $where . " and (family1='$fam' or family2='$fam' $where1)"; $where_list = $where_list . " and (family1='$fam' or family2='$fam' $where1)"; } } if ($race) { $where = $where . " and sub='$race'"; $where_list = $where_list . " and sub='$race'"; $sql5 = $dbh->prepare( " SELECT family_list FROM races_dvd WHERE initial='$init' AND race='$race' LIMIT 1 " ); $sql5->execute; $fam_list = $sql5->fetchrow_array; $sql5->finish; @family_list = split /,/, $fam_list; @family_list = ( @races, @family_list ); $fam_number = 1 + $#family_list; } if ( $hotdeal eq 'Yes' ) { $where = "WHERE hotdeals='T'"; $where_list = "WHERE hotdeals='T'"; if ($fam) { if ( $fam =~ m/\d\-\d/ ) { ( $time1, $time2 ) = split /-/, $fam; $where = $where . " and run_time>=$time1 and run_time<=$time2"; $where_list = $where_list . " and run_time>=$time1 and run_time<=$time2"; } else { $where1 = "or sub='$fam'"; $where = $where . " and (initial='$fam' or family1='$fam' or family2='$fam' $where1)"; $where_list = $where_list . " and (initial='$fam' or family1='$fam' or family2='$fam' $where1)"; } } } $order = 'ORDER by bigkey'; if ( $top20 eq 'Yes' ) { $from_top = ',top_20'; $where = qq{WHERE top_20.niche='$niche1' and top_20.type='$type' and top_20.item=$table.item}; $where_list = qq{WHERE top_20.niche='$niche1' and top_20.type='$type' and $table1.item=top_20.item}; $order = 'Order By top_20.rank'; } if ( $top20 ne 'Yes' ) { if ($last) { $where = $where . " and bigkey>'$last'" } if ($first) { $where = $where . " and bigkey<'$first'"; $order_1 = 'DESC'; } } else { if ($last) { $where = $where . " and rank>'$last'" } if ($first) { $where = $where . " and rank<'$first'"; $order_1 = 'DESC'; } } if ($letter) { $where = $where . " and product_name LIKE '$letter%'" } if ($price_mod) { if ($where) { $where = "$where and $price_mod"; } else { $where = "WHERE $price_mod"; } if ($where_list) { $where_list = "$where_list and $price_mod"; } else { $where_list = "WHERE $price_mod"; } } &getProductData; if ( ( $criteria eq 'ecode' ) and !$imax0 ) { if ( $ecode_pri = &getEcode($text) ) { $where = "WHERE inventory.item='$ecode_pri'"; $where_list = "WHERE inventory.item='$ecode_pri'"; &getProductData; } } else { $ecode_pri = $text } if ($first) { @ecode = reverse @ecode; @product_name = reverse @product_name; @saleprice = reverse @saleprice; @price = reverse @price; @manufacturer = reverse @manufacturer; @image = reverse @image; @onsale = reverse @onsale; @bigkey = reverse @bigkey; @synopsis = reverse @synopsis; @stars = reverse @stars; @stock_this = reverse @stock_this; } $first = $bigkey[0]; $last = $bigkey[$imax]; #alphabetic list $where_list0 = $where_list; if ($last_list) { $where_list = $where_list . " and bigkey>'$last_list'" } if ($first_list) { $where_list = $where_list . " and bigkey<'$first_list'"; $order_list = 'DESC'; } if ($letter) { $where_list = $where_list . " and product_name LIKE '$letter%'"; $where_list0 = $where_list0 . " and product_name LIKE '$letter%'"; } if ($top20) { $where_list =~ s/initial/aph\_dvd\.initial/g; $inv_mod =~ s/initial/aph\_dvd\.initial/g; } $sql2 = $dbh->prepare( " SELECT $table1.item,$table1.product_name,$table1.bigkey FROM $table1,inventory$from_top $where_list and $table1.item=inventory.item $inv_mod ORDER by $table1.bigkey $order_list LIMIT 50 " ); $sql2->execute; $j = 0; while ( @record1 = $sql2->fetchrow_array ) { ( $list_ecode[$j], $list[$j], $bigkey_list[$j] ) = @record1; $j++; } $sql2->finish; #number of search results if ( $letter or ( $criteria and ( $criteria ne 'init' ) and $text ) ) { #check search DB if ( $criteria and ( $criteria ne 'init' ) ) { $phrase = $dbh->quote($text); $sql0 = $dbh->prepare( " SELECT hits,$res_field,inits FROM search WHERE phrase=$phrase and type='$type' and criteria='$criteria' and site='$niche0' LIMIT 1 " ); $sql0->execute; ( $hits, $results, $inits ) = $sql0->fetchrow_array; $sql0->finish; } if ( !$hits or ( $results < 0 ) ) { if ( $criteria ne 'ecode' ) { $add_inv = " $inv_mod"; } else { $add_inv = '' } if ( $query_def1 and $where_list0 !~ /$query_def1/i ) { $where_list0 = "$where_list0 and $query_def1"; } $sql3 = $dbh->prepare( " SELECT COUNT($table1.item) FROM $table1,inventory$from_top $where_list0 and $table1.item=inventory.item $add_inv $order $order_1 $order_list " ); $sql3->execute; $jj = 0; ($jj) = $sql3->fetchrow_array; $sql3->finish; if ( !$hits and $criteria and ( $criteria ne 'init' ) ) { if ( $jj > 0 ) { $sql4 = $dbh->prepare( " SELECT DISTINCT $table1.initial FROM $table1,inventory $where_list0 and $table1.item=inventory.item $inv_mod " ); $sql4->execute; while ( ($init_dd) = $sql4->fetchrow_array ) { push( @init_ddd, $init_dd ); } $sql4->finish; $inits = join( ',', @init_ddd ); } $dbh->do( "INSERT search (phrase,type,criteria,hits,$res_field,inits,site) VALUES ($phrase,'$type','$criteria',1,$jj,'$inits','$niche0') " ) } if ( ( $results < 0 ) and $criteria and ( $criteria ne 'init' ) ) { $dbh->do( "UPDATE search SET hits=hits+1,$res_field=$jj WHERE phrase=$phrase and type='$type' and criteria='$criteria' and site='$niche0' " ); } } #end of no hits in search DB else { $jj = $results; if ( $criteria and ( $criteria ne 'init' ) ) { $dbh->do( "UPDATE search SET hits=hits+1 WHERE phrase=$phrase and type='$type' and criteria='$criteria' and site='$niche0' " ); } } } ### end of number of search results @inits = split /,/, $inits; foreach $init_dd (@inits) { $init_present{$init_dd} = 'Yes' } if ( ( $jj >= 1 ) and ( $criteria eq 'ecode' ) and $text ) { print ""; } if ( $bestseller eq 'Yes' ) { print ""; } if ($first_list) { @list_ecode = reverse @list_ecode; @list = reverse @list; @bigkey_list = reverse @bigkey_list; } $first_list = $bigkey_list[0]; $last_list = $bigkey_list[ $j - 1 ]; $l0 = $#list; #FILTER FOR NAMES IN LIST $l = $#list + 1; local ($lil) = 0; local ($il) = 0; while ( $lil + $il <= 100 && $il <= $l - 1 ) { local ($lilo) = 0; local ($prev) = 0; for ( $i = 0 ; $i <= ( length( $list[$il] ) - 1 ) ; $i++ ) { if ( ( substr( $list[$il], $i, 1 ) eq ' ' ) && ( ( $i - $prev ) > 25 ) && substr( $list[$il], $i + 1, 1 ) ) { $prev = $i + $prev; $lilo++; substr( $list[$il], $i, 1 ) = '*'; } } $lil = $lil + $lilo; while ( $list[$il] =~ m/\*/ ) { $list[$il] =~ s/\*/<\/a>
   /; } $il++; } for ( $i = $0 ; $i < $il ; $i++ ) { $list[ $i + $il ] = $list[ $i + $l ] } $lold = $l; $l = $il; $list_key = $list[ 2 * $l - 1 ]; if ( $imax0 > 0 ) { $text1 = ( $fam ? "->$fam" : '' ); $n = $imax; for ( $i = 0 ; $i <= $imax ; $i++ ) { if ( &Flag( $i + 1 ) && $i != $n ) { #odd != last print ''; &Thumbs( 0, $product_name[$i], $image[$i], $synopsis[$i], $saleprice[$i], $bigkey[$i], $stars[$i], $onsale[$i], $ecode[$i], $price[$i], $stock_this[$i], $show_front[$i] ); } if ( !&Flag( $i + 1 ) ) { #even != 2 &Thumbs( 0, $product_name[$i], $image[$i], $synopsis[$i], $saleprice[$i], $bigkey[$i], $stars[$i], $onsale[$i], $ecode[$i], $price[$i], $stock_this[$i], $show_front[$i] ); print ''; } if ( &Flag( $i + 1 ) && $i eq $n ) { #odd=last print ''; &Thumbs( 1, $product_name[$i], $image[$i], $synopsis[$i], $saleprice[$i], $bigkey[$i], $stars[$i], $onsale[$i], $ecode[$i], $price[$i], $stock_this[$i], $show_front[$i] ); print ' '; } } #end of product loop } ###### NO SEARCH RESULTS else { print < EOT } ### end of no search results # DOZENS CONTROL (NEXT -- PREVIOUS) if ( $n eq 19 and $dozen eq 1 ) { print &Nextt; } if ( $n eq 19 and $dozen > 1 and $dozen ne 1 ) { print &PreviousNext; } if ( $n < 19 and $dozen > 1 ) { print &Previous; } print <
  $type1$text1$race1$fam1$price1

   No $available2 Adult DVD found matching your inventory and search criteria.
   Please search again. For help on search, click here

We recommend these Adult DVD Hot Deals:
EOT if ( $init and ( $init ne 'all' ) ) { $where_hot = "and initial='$init'"; } else { $where_hot = "and initial='$init_def'" } if ( $server =~ /interracial/i ) { $where_hot = "$where_hot and (sub='black' or sub='interracial' or sub='asian' or sub='latin')"; } $sql6 = $dbh->prepare( "SELECT date_dvd.item,date_dvd.product_name,date_dvd.pthumbs,date_dvd.price,date_dvd.saleprice,date_dvd.show_front FROM date_dvd,inventory WHERE date_dvd.hotdeals='T' $where_hot and date_dvd.item=inventory.item and inventory.available='T' ORDER by RAND() LIMIT 4" ); $sql6->execute; while ( @record = $sql6->fetchrow_array ) { ( $item_th, $name_th, $thumb_th, $regprice_th, $price_th, $show_front ) = @record; if ( ( $aff_flag and !( $server =~ m/shop/ ) ) or ( $server =~ m/myadultwarehouse/ ) ) { $price_th = $regprice_th; } # if ($show_front eq "F") { # $thumb_th = "toohot.jpg"; # } print qq(); } $sql6->finish; print <
DVD

$name_th
\$$price_th
E_O_T #RIGHT COLUMN require("/export/home0/vhost218/cgi-serverwide/cart.pl"); require("/export/home0/vhost218/cgi-serverwide/promo_inc.pl"); $initial1 = $initial; if ( $criteria and ( $criteria ne 'init' ) ) { $criteria1 = ucfirst $criteria; if ( $criteria1 eq 'Manufacturer' ) { $criteria1 = 'Studio' } $initial1 = "$criteria1 : $text"; } if ( $criteria eq 'voldiscount' or $discount eq 'Yes' ) { $initial1 = 'Volume Discounts'; } print < E_O_T if ( ( $top20 ne 'Yes' ) and !( $criteria and ( $criteria ne 'init' ) ) and ( $discount ne 'Yes' ) ) { print < E_O_T } if ( ( $criteria and ( $criteria ne 'init' ) ) or $discount eq 'Yes' ) { print < E_O_T } &RightDefault; print <
   Alphabetically Sorted List
   $initial1
  E_O_T # DOZENS CONTROL for list (NEXT -- PREVIOUS) if ( $dozen_list > 1 ) { print "BACK       "; } if ( $l0 eq 49 ) { print "       NEXT"; } if ( $server =~ /^store/i or $server =~ /myadultwarehouse/i ) { #options for higher price $price_range_options = qq( ); } else { #options for lower price $price_range_options = qq( ); } print <


E_O_T $br = ''; $alph_count = 1; @alphabet = ( 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' ); print <
Alphabetical E_O_T $initial_category = $foo->escape($initial_category); print <
E_O_T foreach $alphabet (@alphabet) { if ( $init ne 'top20' ) { $init2 = $init; $fam2 = $fam } else { $init2 = ''; $fam2 = '' } print <$alphabet $br E_O_T $br = ''; $alph_count++; if ( $alph_count == 13 or $alph_count == 26 ) { $br = '
'; } } print <
E_O_T #FOOTER require("/export/home0/vhost218/cgi-serverwide/footer.pl"); print < E_O_T $dbh->disconnect(); exit; } ############################################################################################################################################ sub Thumbs { local ( $control, $name, $image, $synopsis, $price, $key, $star, $onsale, $itkey, $regprice, $available, $show_front ) = @_; local ($available2); if ( $available eq 'T' ) { $available2 = 'IN STOCK'; } if ( $available eq 'F' ) { $available2 = 'SPECIAL ORDER'; } if ( $available eq 'P' ) { $available2 = 'PRE-ORDER'; } if ( $available eq 'O' ) { $available2 = 'ON ORDER'; } if ( $available eq 'D' ) { $available2 = 'NOT AVAILABLE'; } #change plan A->B if ( ( $aff_flag and !( $server =~ m/shop/ ) ) or ( $server =~ m/myadultwarehouse/ ) ) { $price = $regprice; } #-change- local ( $tridot, $tridot1, $sale ); if ( $fam eq 'results' ) { $initial = $show_param; } if ( length($synopsis) > 90 ) { $synopsis = substr( $synopsis, 0, 90 ); $tridot = '...'; } else { $tridot = '' } if ( length($star) > 50 ) { $star = substr( $star, 0, 50 ); $tridot1 = '...'; } else { $tridot1 = '' } if ($control) { print '
  '; } else { print ' '; } if ( $onsale eq 'T' ) { $sale = 'Volume Discounts'; } elsif ( $onsale eq 'C' ) { $sale = 'Clearance Specials'; } else { $sale = '' } $onsale1 = $onsale; if ( $onsale eq 'T' ) { $onsale1 = 1; } if ( $onsale eq 'F' ) { $onsale1 = 0; } if ( $top20 eq 'Yes' ) { $top20_numb = $key . '. '; } else { $top20_numb = '' } print <
E_O_T $name =~ s/\'/\`/g; $name =~ s/"//g; $name1 =~ s/™/\(TM\)/ig; $keystatus = $key . $status . $itkey; #if ($show_front eq "F") { # $image = "toohot.jpg"; #} print < EOT } else { print ' ' } print <
$top20_numb$name
$name
DETAILS
  $synopsis$tridot
more...
Starring:
  $star$tridot1
 $available2 
  \$$price E_O_T if ( $available ne 'D' ) { print <$sale Add to Cart
E_O_T if ($control) { print '   '; } 1; } ######################################################################## # FUNCTION FLAG(NUMBER) sub Flag { local ($input) = @_; local ($flag) = 1; $flag = 0 if ( $input / 2 eq int( $input / 2 ) ); # $flag=0 if even, and =1 if odd; return $flag; 1; } ############################################################################################################################################ #RIGHTDEFAULT sub RightDefault { if ( $criteria and ( $criteria ne 'init' ) ) { $initial = $text; } if ( !$family ) { $family = 'All Categories'; if ($price_range) { $family = $price2 } } if ($letter) { $letter1 = "
   $letter" } if ( $letter or ( $criteria and ( $criteria ne 'init' ) ) ) { $family = "$jj titles found$letter1"; } if ($init1) { $family = $asso0{$init1} . $letter1 } print < $add_race   $family
E_O_T for ( $j = 0 ; $j <= ( $l - 1 ) ; $j++ ) { print "• $list[$j]
"; } print "
"; 1; } ############################################################################################################################################# sub getEcode { local ($ec) = @_; local ($sqlV) = $dbh->prepare( " SELECT item FROM ecode WHERE ecode='$ec' " ); $sqlV->execute; ($ec) = $sqlV->fetchrow_array; $sqlV->finish; return $ec; } ################################################################################## sub getProductData { local ($ad_inv); if ( $criteria ne 'ecode' ) { $ad_inv = " $inv_mod"; } else { $ad_inv = '' } if ( $query_def1 and $where !~ /$query_def1/i ) { $where = "$where and $query_def1"; } if ($top20) { $key_field = 'top_20.rank'; $where =~ s/initial/date\_dvd\.initial/g; $ad_inv =~ s/initial/date\_dvd\.initial/g; } else { $key_field = $table . '.bigkey'; } $sql1 = $dbh->prepare( " SELECT $table.item,$table.product_name,$table.saleprice,$table.price,$table.manufacturer,$table.$pth,$table.voldiscount,$key_field,$table.synopsis,$table.stars,inventory.available,$table.show_front FROM $table,inventory$from_top $where and $table.item=inventory.item $ad_inv $order $order_1 LIMIT 20 " ); $sql1->execute; $i = 0; while ( @record = $sql1->fetchrow_array ) { ( $ecode[$i], $product_name[$i], $saleprice[$i], $price[$i], $manufacturer[$i], $image[$i], $onsale[$i], $bigkey[$i], $synopsis[$i], $stars[$i], $stock_this[$i], $show_front[$i] ) = @record; if ( substr( $synopsis[$i], 100, 1 ) ) { $synopsis[$i] = substr( $synopsis[$i], 0, 100 ) . '...'; } $i++; } $imax0 = $i; $imax = $i - 1; $sql1->finish; if ( ( $i >= 1 ) and ( $criteria eq 'ecode' ) and $text ) { print ""; } } ############################################################################################################################################# sub PrintHeader { return "Content-type: text/html\n\n"; } # NEXT sub Nextt { return " Next"; } # PREVIOUS sub Previous { return "Previous "; } # PREVIOUS-NEXT sub PreviousNext { return "PreviousNext"; } ########################################################################## sub get_cookie { local ( $chip, $val ); foreach ( split( /; /, $ENV{'HTTP_COOKIE'} ) ) { # split cookie at each ; (cookie format is name=value; name=value; etc...) # Convert plus to space (in case of encoding (not necessary, but recommended) s/\+/ /g; # Split into key and value. ( $chip, $val ) = split( /=/, $_, 2 ); # splits on the first =. # Convert %XX from hex numbers to alphanumeric $chip =~ s/%([A-Fa-f0-9]{2})/pack("c",hex($1))/ge; $val =~ s/%([A-Fa-f0-9]{2})/pack("c",hex($1))/ge; # Associate key and value $cookie{$chip} .= "\1" if ( defined( $cookie{$chip} ) ); # \1 is the multiple separator $cookie{$chip} .= $val; } } sub ReadParse { local (*in) = @_ if @_; local ( $i, $key, $val ); # Read in text if (&MethGet) { $in = $ENV{'QUERY_STRING'}; } elsif (&MethPost) { read( STDIN, $in, $ENV{'CONTENT_LENGTH'} ); } @in = split( /[&;]/, $in ); foreach $i ( 0 .. $#in ) { # Convert plus's to spaces $in[$i] =~ s/\+/ /g; # Split into key and value. ( $key, $val ) = split( /=/, $in[$i], 2 ); # splits on the first =. # Convert %XX from hex numbers to alphanumeric $key =~ s/%(..)/pack("c",hex($1))/ge; $val =~ s/%(..)/pack("c",hex($1))/ge; # Associate key and value $in{$key} .= "\0" if ( defined( $in{$key} ) ); # \0 is the multiple separator $in{$key} .= $val; } return scalar(@in); } sub MethGet { return ( $ENV{'REQUEST_METHOD'} eq "GET" ); } # MethPost # Return true if this cgi call was using the POST request, false otherwise sub MethPost { return ( $ENV{'REQUEST_METHOD'} eq "POST" ); }