INT, 'perpage' => INT, 'cpage' => INT, 'cat' => STRING, 'page' => INT)); typecast($_POST, array('myzipcode' => STRING)); typecast($_COOKIE, array('zipcode' => STRING)); if ( !empty($myzipcode) ) { @setcookie( "zipcode", $myzipcode, time()+2592000); } function deg_to_rad($deg) { $radians = 0.0; $radians = $deg * M_PI/180.0; return($radians); } // variable setup if (empty($pperpage)) $pperpage=""; authenticate(); if ( isset($Globals['ppboards']) && $User['adminedit'] != 1 ) { if ( $Globals['ppboards'] == "closed" ) { print $Globals['closedmsg']; exit; } } if ( isset($friendemail) && !strstr($friendemail,"yourfriend") ) { if ( valid_email($friendemail) ) { $rname = $User['username']; $from_email = "From: {$Globals['adminemail']}"; require_once("{$Globals['PP_PATH']}/languages/$pplang/emails.php"); $letter = $Globals['pp_lang']['emailsug']; $subject = $Globals['pp_lang']['esugsub']; mail( $friendemail, $subject, $letter, $from_email ); forward("showcat.php?cat=$cat", $Globals['pp_lang']['linksent']); } } if ( !empty($product) ) { if ( ($User['username'] == "" || $User['username'] == $Globals['pp_lang']['unreg']) && $Globals['reqregister'] == "yes" ) { diewell( $Globals['pp_lang']['noreg'] ); exit; } if ($pperpage == "-1" || $pperpage == "") { $pperpage = $Globals['defaultposts']; } if ( isset($cat) ) $holdcat = $cat; else $holdcat = 0; $query = "SELECT id,user,userid,cat,date,title,price,description,keywords,bigimage,bigimage2,bigimage3,views,approved,rating,extra1,extra2,extra3,extra4,extra5,extra6,disporder,status,isauction,highbidder,maxbid,numbids,enddate,zipcode FROM {$Globals['pp_db_prefix']}products WHERE id='".intval($product)."'"; $rows = ppmysql_query($query,$link); list( $id, $user, $iuserid, $cat, $date, $ptitle, $askprice, $desc, $keywords, $bigimage, $bigimage2, $bigimage3, $views, $approved, $rating, $extra1, $extra2, $extra3, $extra4, $extra5, $extra6, $issticky, $status, $isauction, $highbidder, $maxbid, $numbids, $enddate, $prodzipcode) = mysql_fetch_row($rows); ppmysql_free_result( $rows ); if ( empty($id) ) { diewell( $Globals['pp_lang']['noproduct'] ); } if ( $approved == 3 && $User['adminedit'] == 0 ) { diewell( $Globals['pp_lang']['nopayment'] ); } if ( $iuserid != $User['userid'] && ($approved == 0 && $User['adminedit'] == 0) ) { diewell( $Globals['pp_lang']['notapproved'] ); } if ( $holdcat == 0 ) $holdcat = $cat; is_cat_protected( $cat ); if ( $User['userid'] > 0 && $Globals['displaynew'] == "yes" ) { list($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); $mon = $mon + 1; $lasttimeon = mktime($hour,$min,$sec,$mon,$mday,$year); $laston = "REPLACE INTO {$Globals['pp_db_prefix']}laston VALUES($cat,{$User['userid']},$lasttimeon)"; $resultb = ppmysql_query($laston, $link); } $query = "SELECT catname,template,extra1,extra2,extra3,extra4,extra5,extra6 FROM {$Globals['pp_db_prefix']}categories where id='$cat'"; $resulta = ppmysql_query($query,$link); list( $thecatname, $Globals['cattemp'], $Globals['extra1name'], $Globals['extra2name'], $Globals['extra3name'], $Globals['extra4name'], $Globals['extra5name'], $Globals['extra6name'] ) = mysql_fetch_row($resulta); ppmysql_free_result($resulta); // // Next and Previous images for display // if ( empty($sort) ) $sort = 1; $query = "SELECT * FROM {$Globals['pp_db_prefix']}sort WHERE sortid=$sort"; $resultc = ppmysql_query($query,$link); list($sortid, $sortname, $sortc) = mysql_fetch_row($resultc); ppmysql_free_result( $resultc ); $sortcode = "$sortc"; if ( $holdcat == "fav" ) { $query = "SELECT p.id,f.userid FROM {$Globals['pp_db_prefix']}favorites f, {$Globals['pp_db_prefix']}products p WHERE f.userid={$User['userid']} AND f.product=p.id $sortcode"; } elseif ( $holdcat == "all" ) { $query = "SELECT id FROM {$Globals['pp_db_prefix']}products $sortcode"; } elseif ( !is_numeric($holdcat) ) { // Last 1 days if ( $holdcat == "last14" ) $days = 14; elseif ( $holdcat == "last7" ) $days = 7; else $days = 1; list($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); $mon = $mon + 1; $hour = $hour - ($days * 24); $searchdate = mktime($hour,$min,$sec,$mon,$mday,$year); $query = "SELECT id FROM {$Globals['pp_db_prefix']}products WHERE date > $searchdate $exclude_cat $sortcode"; } else $query = "SELECT id FROM {$Globals['pp_db_prefix']}products WHERE cat=$cat $sortcode"; $rows = ppmysql_query($query,$link); $ref=0; $first_image=0; $last_image=0; $ids = array(0); $curr=0; while ( $resultp = mysql_fetch_array($rows) ) { $ref++; $ids[$ref]=$resultp[0]; if ( $ids[$ref] == $product ) { $curr = $ref; } } ppmysql_free_result($rows); $previous_image = 0; $prevlink = ""; $next_image = 0; $nextlink = ""; if ( $curr > 1 ) { $previous_image = $ids[$curr-1]; } if ( $curr != $ref ) { $next_image = $ids[$curr+1]; } if ( $previous_image != 0 ) { if ( $Globals['spider'] == "yes" ) $prevlink = strip_empty("« {$Globals['pp_lang']['prev']}"); else $prevlink = strip_empty("« {$Globals['pp_lang']['prev']}"); } if ( $next_image != 0 ) { if ( $Globals['spider'] == "yes" ) $nextlink = strip_empty("· {$Globals['pp_lang']['next']} »"); else $nextlink = strip_empty("· {$Globals['pp_lang']['next']} »"); } // End to get Next and Previous images for display // for childsub, we need to set these globals $ppuser = $iuserid; $tusername = $user; childsub($cat); $childnav = "{$Globals['pp_lang']['home']} $childnav"; $uploadquery = "?cat=$cat"; printheader( $cat, " $ptitle" ); if ( $Globals['cattemp'] > 0 ) { // We're using a different template here require "{$Globals['PP_PATH']}/languages/$pplang/showproduct{$Globals['cattemp']}.php"; } else { $Globals['cattemp'] = ""; } topmenu(); $count=0; $theext = get_ext($bigimage); $filename = $bigimage; $filename = str_replace( $theext, "", $filename); $imagefn = "{$Globals['datafull']}/$cat/$iuserid$bigimage"; if ( $bigimage == "" ) { $imgdisp = ""; } else { if ( file_exists($imagefn) ) { if ( $Globals['onthefly'] == "yes" ) { $imgdisp = "\"$filename\""; } else { $imgdisp = "\"$filename\""; } } else { $imgdisp = "\"\""; } } $adminopts=""; if ( $User['adminedit'] == 1 || $User['moderator'] == 1 || ($User['userid'] == $iuserid && $Globals['userdel'] == "yes") ) { $selected = $cat; catmoveopt(0, -1); $adminopts = "
{$Globals['pp_lang']['move']}:    {$Globals['pp_lang']['delete']}  
"; } $admindisplay = ""; if ( $adminopts != "" ) { $admindisplay .= "$adminopts

"; } $desc = un_htmlspecialchars(convert_markups( $desc )); if ( VB3_ENHANCEDINT != "on" ) $desc = convert_returns( $desc ); $extra1 = convert_markups( $extra1 ); $extra1 = convert_returns( $extra1 ); $extra2 = convert_markups( $extra2 ); $extra2 = convert_returns( $extra2 ); $extra3 = convert_markups( $extra3 ); $extra3 = convert_returns( $extra3 ); $extra4 = convert_markups( $extra4 ); $extra4 = convert_returns( $extra4 ); $extra5 = convert_markups( $extra5 ); $extra5 = convert_returns( $extra5 ); $extra6 = convert_markups( $extra6 ); $extra6 = convert_returns( $extra6 ); if ( $User['userid'] != "" ) { $query = "SELECT id FROM {$Globals['pp_db_prefix']}favorites WHERE product=$id AND userid={$User['userid']}"; $resultf = ppmysql_query($query, $link); $isfav = mysql_num_rows($resultf); if ( $isfav == 0 ) $pmenu .= "{$Globals['pp_lang']['addfav']}"; else $pmenu .= "{$Globals['pp_lang']['removefav']}"; } if ( $iuserid > 0 ) $postreview = "{$Globals['pp_lang']['post']}"; if ($User['userid'] != "") { if ( !empty($pmenu) ) $pmenu .= " · "; $pmenu .= "{$Globals['pp_lang']['report']}"; } if ($Globals['usenotify'] == "yes" && $User['userid'] > 0) { $query = "SELECT id FROM {$Globals['pp_db_prefix']}notify WHERE userid={$User['userid']} AND product=$id LIMIT 1"; $results = ppmysql_query($query,$link); list( $notifyid ) = mysql_fetch_row($results); ppmysql_free_result($results); if ( !empty($pmenu) ) $pmenu .= " · "; if ($notifyid != "") { $pmenu .= "{$Globals['pp_lang']['disable']}"; } else { $pmenu .= "{$Globals['pp_lang']['enable']}"; } } $postbutton = ""; if ( $usercomment == 1 && $Globals['allowpost'] == "yes" && $CatPerms['ugpost'][$cat] == 0 ) { if ( !empty($pmenu) ) $pmenu .= " · "; $pmenu .= "{$Globals['pp_lang']['postcomment']}"; $postbutton = "$postreply "; } if ( !empty($pmenu) ) $pmenu .= "
"; if ( $User['adminedit'] == 1 || ($User['userid'] == $iuserid ) ) { $pmenu .= "{$Globals['pp_lang']['editproduct']}"; if ( $isauction == 0 ) { if ( $status == 0 ) $pmenu .= " · {$Globals['pp_lang']['soldit']}"; else $pmenu .= " · {$Globals['pp_lang']['relist']}"; } } if ( $User['adminedit'] == 1 ) { if ( !empty($pmenu) ) $pmenu .= " · "; if ( $issticky == 99999 ) $pmenu .= "{$Globals['pp_lang']['stick']}"; else $pmenu .= "{$Globals['pp_lang']['unstick']}"; } // find similiar posts if ( empty($keywords) ) $keywords = $ptitle; $keylinks = ""; $keys = explode( " ", $keywords ); $keys = array_unique($keys); foreach($keys as $eachkey) { if ( !empty($eachkey) && $eachkey != "the" && $eachkey != "a" && $eachkey != "but" && $eachkey != "are" && $eachkey != "and" ) $keylinks .= "$eachkey "; } $timelast = formatpptime( $date ); $datelast = formatppdate( $date ); if ( $askprice > 0 ) $askprice = "{$Globals['currency']}" . number_format( $askprice, 2 ); else $askprice = "{$Globals['pp_lang']['noneind']}"; if ( $status > 0 ) { $askprice = "{$Globals['pp_lang']['sold']} ($askprice)"; } if ( $Globals['ipcache'] != 0 ) { $ipaddress = findenv("REMOTE_ADDR"); $query = "SELECT userid,date,product FROM {$Globals['pp_db_prefix']}ipcache WHERE ipaddr='$ipaddress' AND type='view' AND product='$product' LIMIT 1"; $result = ppmysql_query($query, $link); $numfound = mysql_num_rows($result); if ( $numfound > 0 ) { list( $tuserid, $lastdate, $product ) = mysql_fetch_row($result); list($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); $mon = $mon + 1; $mytime = mktime($hour,$min,$sec,$mon,$mday,$year); $hour = $hour - $Globals['ipcache']; $timeout = mktime($hour,$min,$sec,$mon,$mday,$year); if ( $lastdate < $timeout ) { $query = "UPDATE {$Globals['pp_db_prefix']}products SET views=views+1 WHERE id=$product"; $result = ppmysql_query($query,$link); if ( $User['userid'] > 0 && $Globals['vbversion'] == "Internal" ) { $query = "UPDATE {$Globals['pp_db_prefix']}users SET views=views+1 WHERE userid={$User['userid']}"; $result = ppmysql_query($query,$db_link); } $query = "DELETE FROM {$Globals['pp_db_prefix']}ipcache WHERE date < $timeout"; $result = ppmysql_query($query,$link); $query = "INSERT INTO {$Globals['pp_db_prefix']}ipcache (userid,ipaddr,date,type,product) VALUES ('$tuserid', '$ipaddress', '$mytime', 'view', '$product')"; $result = ppmysql_query($query,$link); } } else { list($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); $mon = $mon + 1; $mytime = mktime($hour,$min,$sec,$mon,$mday,$year); $query = "INSERT INTO {$Globals['pp_db_prefix']}ipcache (userid,ipaddr,date,type,product) VALUES ('$tuserid', '$ipaddress', '$mytime', 'view', '$product')"; $result = ppmysql_query($query,$link); $query = "UPDATE {$Globals['pp_db_prefix']}products SET views=views+1 WHERE id=$product"; $result = ppmysql_query($query,$link); if ( $User['userid'] > 0 && $Globals['vbversion'] == "Internal" ) { $query = "UPDATE {$Globals['pp_db_prefix']}users SET views=views+1 WHERE userid={$User['userid']}"; $result = ppmysql_query($query,$db_link); } } } else { $query = "UPDATE {$Globals['pp_db_prefix']}products SET views=views+1 WHERE id=$product"; $result = ppmysql_query($query,$link); if ( $User['userid'] > 0 && $Globals['vbversion'] == "sellerspost" ) { $query = "UPDATE {$Globals['pp_db_prefix']}users SET views=views+1 WHERE userid={$User['userid']}"; $result = ppmysql_query($query,$link); } } if ( !empty($bigimage) ) { $file1thumb = ""; $largeimg = "{$Globals['datafull']}/$cat/$iuserid" . get_filename($bigimage) . "-large" . get_ext($bigimage); $largeurl = "{$Globals['datadir']}/$cat/$iuserid" . get_filename($bigimage) . "-large" . get_ext($bigimage); if ( file_exists($largeimg) ) { if ( empty($bigimage2) && empty($bigimage3) ) { $imgdisp .= "
{$Globals['pp_lang']['supersize']}"; $file1thumb = ""; } else { $file1thumb .= "
{$Globals['pp_lang']['supersize']}"; } } else { if ( empty($bigimage2) && empty($bigimage3) ) $file1thumb = ""; } } else $file1thumb = ""; if ( !empty($bigimage2) ) { $file2thumb = ""; $largeimg = "{$Globals['datafull']}/$cat/$iuserid" . get_filename($bigimage2) . "-large" . get_ext($bigimage2); $largeurl = "{$Globals['datadir']}/$cat/$iuserid" . get_filename($bigimage2) . "-large" . get_ext($bigimage2); if ( file_exists($largeimg) ) $file2thumb .= "
{$Globals['pp_lang']['supersize']}"; } else $file2thumb = ""; if ( !empty($bigimage3) ) { $file3thumb = ""; $largeimg = "{$Globals['datafull']}/$cat/$iuserid" . get_filename($bigimage3) . "-large" . get_ext($bigimage3); $largeurl = "{$Globals['datadir']}/$cat/$iuserid" . get_filename($bigimage3) . "-large" . get_ext($bigimage3); if ( file_exists($largeimg) ) $file3thumb .= "
{$Globals['pp_lang']['supersize']}"; } else $file3thumb = ""; list( $numstars, $overall ) = get_user_rating( $iuserid ); $ratingicon = ""; if ( $numstars > 0 ) $ratingicon = " \"$numstars"; $userlink = "$user$ratingicon"; // If an auction get some more info $bidq = ""; $auctionend = ""; $hbnumbids = $Globals['pp_lang']['none']; $auctionclosed = 0; if ( $isauction == 1 ) { list($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); $mon = $mon + 1; $julian = mktime($hour,$min,$sec,$mon,$mday,$year); if ( $enddate < $julian ) { $auctionend = "{$Globals['pp_lang']['auctionclose']}"; $auctionclosed = 1; } else { $auctionend = formatppdate( $enddate ); $auctionend .= " " . formatpptime( $enddate ); $timeleft = $enddate - $julian; if ( $timeleft > 0 ) { $auctionend .= "
" . time_left($timeleft); } } // Find out who the high bidder is (if one) if ( $highbidder > 0 ) { $Globals['pp_lang']['askprice'] = $Globals['pp_lang']['highbidr']; list( $hbuserid, $hbuser, $tmail ) = get_userinfo("",$highbidder); list( $hbstars, $hboverall ) = get_user_rating($highbidder); $hbicon = ""; if ( $hbstars > 0 ) $hbicon = " \"$hbstars"; $hbuserlink = "$hbuser$hbicon"; $hbnumbids = "$numbids "; $hbnumbids .= ($numbids > 1 ? $Globals['pp_lang']['bids'] : $Globals['pp_lang']['bid'] ) . " · {$Globals['pp_lang']['bidhistory']}"; $askprice .= " · $hbuserlink"; } else { $Globals['pp_lang']['askprice'] = $Globals['pp_lang']['openprice']; } if ( $gologin == 0 && $status == 0 && $auctionclosed == 0 && $User['userid'] != $iuserid ) { include( "{$Globals['TMPL_PATH']}/askbid.tmpl" ); } } // Distance from zip if ( $Globals['zipcode'] == "yes" ) { $pickcode = "
{$Globals['pp_lang']['enterzip']}
"; if ( isset($myzipcode) ) $zipcode = $myzipcode; if ( !isset($zipcode) ) { $distcode = $pickcode; $long1 = 0; $lat1 = 0; } else { $query = "SELECT lon,lat FROM zipData WHERE zipcode = '$zipcode'"; $longlat = ppmysql_query($query,$link); list( $long1, $lat1 ) = mysql_fetch_row($longlat); ppmysql_free_result($longlat); if ( $long1 > 0 && $lat1 > 0 ) { $lat1 = deg_to_rad($lat1); $long1 = deg_to_rad($long1); } else { $gallery['distance'][0] = $pickcode; $long1 = 0; $lat1 = 0; } } if ( $long1 != 0 && $lat1 != 0 ) { $query = "SELECT lon,lat FROM zipData WHERE zipcode = '".intval($prodzipcode)."'"; $longlat = ppmysql_query($query,$link); list( $long2, $lat2 ) = mysql_fetch_row($longlat); ppmysql_free_result($longlat); if ( $long2 != 0 && $lat2 != 0 ) { $lat2 = deg_to_rad($lat2); $long2 = deg_to_rad($long2); $delta_lat = $lat2 - $lat1; $delta_lon = $long2 - $long1; /* Find the Great Circle distance */ $temp = pow(sin($delta_lat/2.0),2) + cos($lat1) * cos($lat2) * pow(sin($delta_lon/2.0),2); $EARTH_RADIUS = 3956; $distance = $EARTH_RADIUS * 2 * atan2(sqrt($temp),sqrt(1-$temp)); $distcode = number_format($distance)." {$Globals['pp_lang']['miles']}"; } else { $distcode = $Globals['pp_lang']['nozip']; } } } // Comments Start if ( $Globals['allowpost'] == "yes" ) { if ($pperpage == "-1" || $pperpage == "") { $pperpage = $Globals['defaultposts']; } $cc=0; $ckcolor=0; $posts=""; $comq = "
"; $query = "SELECT id,username,userid,date,comment,approved FROM {$Globals['pp_db_prefix']}comments WHERE product=$product ORDER BY date ASC"; $rows = ppmysql_query($query,$link); $comcount = mysql_num_rows($rows); if ( $comcount == 0 ) { $compages = 0; } else { if ($pperpage > 0) { $compages=($comcount/$pperpage); } else { $pperpage = $Globals['defaultposts']; $compages = ($comcount/$pperpage); } } if (intval($compages) < $compages) { $compages=intval($compages)+1; } else { $compages=intval($compages); } if ( isset($cpage) ) { $cstartnumb=($cpage*$pperpage)-$pperpage+1; } else { $cpage=1; $cstartnumb=1; } if ($Globals['vbversion'] == 'dcfplus') { // need some admin preferences from DCF+, but don't want to call for them inside // the loop, since they incur a sql query. $allow_disable_email = dcfp_auth_get_setup_param("allow_disable_email"); $allow_disable_inbox = dcfp_auth_get_setup_param("allow_disable_inbox"); $allow_disable_profile = dcfp_auth_get_setup_param("allow_disable_profile"); } $itemnum = 0; while ( list( $id, $user, $cuserid, $cdate, $clinetext, $capproved ) = mysql_fetch_row($rows) ) { $reviewnum[$itemnum] = $id; $ucuserid[$itemnum] = $cuserid; if ( ($Globals['moderatecoms'] == "no" && $capproved == 0) ) { // Do not print anything under these condition; placeholder } else { $cc++; if ($cc >= $cstartnumb) { if ($cc < ($cstartnumb+$pperpage)) { $profilelink = get_profilelink( $cuserid ); $cclock[$itemnum] = formatpptime( $cdate ); $ppdate[$itemnum] = formatppdate( $cdate ); $query = "SELECT id FROM {$Globals['pp_db_prefix']}products WHERE userid='$cuserid' LIMIT 1"; $results = ppmysql_query($query,$link); list( $phoid ) = mysql_fetch_row($results); ppmysql_free_result($results); $ucuser[$itemnum] = $Globals['pp_lang']['unreg']; $uclocation[$itemnum] = ""; $uctitle[$itemnum] = ""; $ucposts[$itemnum] = ""; $uregdate[$itemnum] = ""; $uugallery[$itemnum] = ""; $uisonline[$itemnum] = ""; $uhpage[$itemnum] = ""; // call get_profiledata to get all the links possible unset($postline); list( $cuname, $cuhomep, $cuposts, $cutitle, $cureg, $culoc, $cuavatar, $usig ) = get_profiledata( $cuserid ); if ($cureg != "") $uregdate[$itemnum] = "

{$Globals['pp_lang']['registered']}: " . formatppdate($cureg, "month yyyy"); if ($cuposts != "") $ucposts[$itemnum] = "
{$Globals['pp_lang']['posts']}: $cuposts"; if ($culoc != "") $uclocation[$itemnum] = "
{$Globals['pp_lang']['location']}: $culoc"; if ($cutitle != "") $uctitle[$itemnum] = "
$cutitle"; if ( !empty($cuavatar) && $Globals['showavatar'] == "yes" ) $uctitle[$itemnum] .= "
$cuavatar"; $uugallery[$itemnum] = $ugallery; $uisonline[$itemnum] = $isonline; $uhpage[$itemnum] = $cuhomep; $ucuser[$itemnum] = $cuname; $upostline[$itemnum] = $postline; if ($ckcolor == 1) { $fillcolor[$itemnum] = "{$Style['alternatetable']}"; $ckcolor = 0; } else { $fillcolor[$itemnum] = "{$Style['tddetails']}"; $ckcolor = 1; } $clinetext = convert_markups($clinetext); if ( VB3_ENHANCEDINT != "on" ) $commenttext[$itemnum] = convert_returns($clinetext); else $commenttext[$itemnum] = $clinetext; if ( !empty($usig) && $Globals['showsigs'] == "yes" ) { $usigline = convert_markups($usig); $commenttext[$itemnum] .= "

------------------------------
$usigline"; } $itemnum++; } } } $date = $cdate; } ppmysql_free_result( $rows ); } // begin pages/nav system ## $comnav=""; if ($compages > 1) { $comnav .= "
{$Globals['pp_lang']['page']}:  "; $thestart=""; if ($cpage < 11) { $thestart=1; } if ($cpage > 10) { $thestart=$cpage/10; $thestart=intval($thestart); $thestart=$thestart*10; } $theend=$thestart+9; for ($p=$thestart;$p<=$compages;$p++) { if ($p != $thestart) { $comnav .= " · "; } if ($cpage != $p) { if ($p == ($theend+1)) { $thispage="$p>"; } else { $thispage="$p"; } $comnav .= "$thispage"; } if ($p >$theend) { break; } if ($cpage == $p) { $comnav .= "$p"; } } if ($cpage < $compages) { $nextpage=$cpage+1; $more = " \"{$Globals['pp_lang']['more']}\""; } else { $more = " "; } $comnav .= "$more
"; } // end pages/nav ### if ( $Globals['statspal'] == "yes" ) { $usertotal = get_totalusers(); $query = "SELECT SUM(views), count(*) FROM {$Globals['pp_db_prefix']}products WHERE approved=1"; $totalv = ppmysql_query($query,$link); list( $totalviews, $totalproducts ) = mysql_fetch_row($totalv); ppmysql_free_result($totalv); $query = "SELECT count(*) FROM {$Globals['pp_db_prefix']}comments"; $totalv = ppmysql_query($query,$link); list( $posttotal ) = mysql_fetch_row($totalv); ppmysql_free_result($totalv); $query = "SELECT amt_sold,ads_sold FROM {$Globals['pp_db_prefix']}stats"; $totalv = ppmysql_query($query,$link); list( $amtsold, $soldads ) = mysql_fetch_row($totalv); ppmysql_free_result($totalv); $totalviews = number_format( $totalviews ); $totalproducts = number_format( $totalproducts ); $usertotal = number_format( $usertotal ); $posttotal = number_format( $posttotal ); $amtsold = number_format( $amtsold ); $soldads = number_format( $soldads ); } if ( $Globals['ratingspal'] == "yes" ) { // Lets get the Most Popular Ads $query = "SELECT cat,id,title,views FROM {$Globals['pp_db_prefix']}products WHERE approved=1 ORDER BY views DESC LIMIT {$Globals['mostpoppal']}"; $queryz = ppmysql_query($query,$link); $tpfound = 1; while ( list($tpcat[$tpfound], $tpphoto[$tpfound], $toptitle, $topviews) = mysql_fetch_row($queryz)) { $tptitle[$tpfound] = ( strlen($toptitle) > 20 ? substr($toptitle,0,20)."..." : $toptitle ); $tpviews[$tpfound] = number_format($topviews); $tplink[$tpfound] = "{$Globals['maindir']}/showproduct.php?product={$tpphoto[$tpfound]}&cat={$tpcat[$tpfound]}"; $tpfound++; } } if ( $usercomment == 1 && $Globals['allowpost'] == "yes" ) { include( "{$Globals['TMPL_PATH']}/quickcom.tmpl" ); } include( "{$Globals['TMPL_PATH']}/menubar.tmpl" ); if ( $Globals['sidebar'] == "left" && $Globals['sidebar_global'] == "yes" ) { include( "{$Globals['TMPL_PATH']}/sidebar_leftopen.tmpl" ); } if ( $Globals['sidebar'] == "right" && $Globals['sidebar_global'] == "yes" ) { include( "{$Globals['TMPL_PATH']}/sidebar_rightopen.tmpl" ); } include( "{$Globals['TMPL_PATH']}/showproduct{$Globals['cattemp']}.tmpl" ); if ( $Globals['sidebar'] == "left" && $Globals['sidebar_global'] == "yes" ) { include( "{$Globals['TMPL_PATH']}/sidebar_leftclose.tmpl" ); } if ( $Globals['sidebar'] == "right" && $Globals['sidebar_global'] == "yes" ) { include( "{$Globals['TMPL_PATH']}/sidebar_rightclose.tmpl" ); } printfooter(); } // end individual product display ### ?>