STRING, 'name' => STRING, 'cat' => STRING, 'catp' => STRING, 'page' => INT, 'ppuser' => INT, 'what' => STRING, 'when' => STRING, 'when' => INT, 'whenterm' => STRING, 'sorttime' => INT, 'thumbsonly' => INT, 'thumbcheck' => INT, 'votecontrol' => STRING, 'perpage' => INT, 'friendemail' => STRING, 'limit' => STRING, 'way' => STRING, 'sortby' => STRING, 'ppperpage' => INT, 'date' => INT)); typecast($_POST, array('quickjump' => STRING)); typecast($_COOKIE, array('ppperpage' => INT, 'ppthumbs' => INT, 'catp' => STRING)); // Init some variables if ( !isset($cat) || empty($cat) ) { $cat = "all"; } if ( !isset($page) ) { $page = 1; } if ( !isset($what) || empty($what) ) { $what = "allfields"; } if ( $quickjump == "Go" ) { unset($ppuser, $what, $sorttime, $when, $way, $shortby); } if ( isset($_GET['catp']) ) { @setcookie( "catp", $_GET['catp'], 0, "{$Globals['cookie_path']}", $Globals['domain_path'] ); $GLOBALS[catp] = $_GET['catp']; } elseif ( isset($_POST['catp']) ) { @setcookie( "catp", $_POST['catp'], 0, "{$Globals['cookie_path']}", $Globals['domain_path'] ); $GLOBALS[catp] = $_POST['catp']; } if ( $perpage ) { if ( $perpage != $ppperpage ) { @setcookie( "ppperpage", $perpage, time()+2592000 ); $page = 1; } } $hasintro = "no"; if ( !$ppuser && ($cat == 500 || $cat == MOBILE_CAT) ) { // They shouldnt be here if they didnt give us a valid user, send em to showmembers header( "Location: {$Globals['maindir']}/showmembers.php" ); exit; } $thumbtype = 0; if ( isset($thumbcheck) ) { if ( $thumbsonly && $thumbsonly != 3 ) { @setcookie( "ppthumbs", $thumbsonly, time()+2592000 ); $ppthumbs = $thumbsonly; } elseif ( $thumbsonly == 0 && $thumbcheck > 0 ) { @setcookie( "ppthumbs", "", time()-3600); $ppthumbs = 0; } } authenticate(); if ( $Globals['ppboards'] == "closed" && $User['adminedit'] != 1 ) { diewell( $Globals['closedmsg'] ); } if ( is_numeric($cat) ) { $ctitleq = ppmysql_query("SELECT c.id,c.catname,c.thumbs,c.cattype,c.parent,c.theme,c.thumbtype, c.sortorder,c.frames,c.intro,c.introtitle,c.introcopy,c.ratingtype,c.takevotes,c.ismember,n.userid FROM {$Globals['pp_db_prefix']}categories c LEFT JOIN {$Globals['pp_db_prefix']}notify n ON (n.userid='{$User['userid']}' AND n.photo=c.id AND n.type=1) WHERE c.id=$cat", $link); list( $thecatid, $thecatname, $catthumbs, $cattype, $catparent, $cattheme, $thumbtype, $catsortorder, $frames, $hasintro, $catinfo['introtitle'], $catinfo['introcopy'], $ratingtype, $takevotes, $ismember, $notify ) = mysql_fetch_row($ctitleq); if ( !$thecatid ) { diewell( $Globals['pp_lang']['noview'] ); } if ( ($ismember == 1 || $thumbsonly == 3) && empty($ppuser) ) { // They shouldnt be here if they didnt give us a valid user, send em to showmembers header( "Location: {$Globals['maindir']}/showmembers.php?cat=$thecatid&date=$date" ); exit; } if ( !preg_match("/([\<])([^\>]{1,})*([\>])/i", $catinfo['introtitle']) ) { $catinfo['introtitle'] = preg_replace("/(\r\n|\r|\n)/i","
",$catinfo['introtitle']); } if ( !preg_match("/([\<])([^\>]{1,})*([\>])/i", $catinfo['introcopy']) ) { $catinfo['introcopy'] = preg_replace("/(\r\n|\r|\n)/i","
",$catinfo['introcopy']); } if ( $cattype == "a" ) { $titlereplace = "$tusername's {$Globals['pp_lang']['persalbum']}"; $catthumbs = "yes"; } // Nonstandard theme if ( $cattheme && $Globals['forumstyle'] == "no" ) { $Globals['theme'] = $cattheme; if ( is_dir( "{$Globals['PP_PATH']}/stylesheets/{$Globals['theme']}" ) ) { $Globals['idir'] = "{$Globals['maindir']}/stylesheets/{$Globals['theme']}"; } } // Non standard frames if ( !empty($frames) ) { unset( $Globals['thumbstd'] ); include( "{$Globals['PP_PATH']}/{$Globals['TMPL_PATH']}/$frames.tmpl" ); } is_cat_protected( $cat, $catp, $cattype ); if ( $User['userid'] > 0 && $Globals['displaynew'] == "yes" ) { $lasttimeon = time(); $resultb = ppmysql_query("REPLACE INTO {$Globals['pp_db_prefix']}laston VALUES('$cat', '{$User['userid']}', '$lasttimeon')", $link); } $ismod = false; if ( $ratingtype == 1 ) { if ( !$sortby ) { if ( $takevotes == 0 ) { $sortby = "b"; $catsortorder = 4; } elseif ( $takevotes == 1 ) { $sortby = "b"; $catsortorder = 4; } else { $sortby = "r"; $catsortorder = 6; } } if ( $User['userid'] > 0 ) { // Voting controls if ( $User['adminedit'] == 1 || $User['moderator'] == 1 ) { $ismod = true; if ( $User['moderator'] == 1 ) { $ismod = is_moderator($cat); } } if ( isset($votecontrol) && $ismod ) { if ( $votecontrol == "enable" ) { // enable and set order to random $updateq = ppmysql_query("UPDATE {$Globals['pp_db_prefix']}categories SET takevotes=1,sortorder=6 WHERE id=$cat", $link); $takevotes = 1; } elseif ( $votecontrol == "disable" ) { // disable and set order to highest rated $updateq = ppmysql_query("UPDATE {$Globals['pp_db_prefix']}categories SET takevotes=0,sortorder=4 WHERE id=$cat", $link); $takevotes = 0; } elseif ( $votecontrol == "end" ) { // disable and set order to highest rated $updateq = ppmysql_query("UPDATE {$Globals['pp_db_prefix']}categories SET takevotes=2,sortorder=4 WHERE id=$cat", $link); $takevotes = 2; } elseif ( $votecontrol == "reset" ) { $updateq = ppmysql_query("UPDATE {$Globals['pp_db_prefix']}photos SET rating=0 WHERE cat='$cat'", $link); $updateq = ppmysql_query("DELETE FROM {$Globals['pp_db_prefix']}comments WHERE cat='$cat' AND rating=1", $link); } } // Grab the image they voted on (if they voted) $result = ppmysql_query("SELECT photo FROM {$Globals['pp_db_prefix']}comments WHERE cat=$cat AND userid={$User['userid']} AND rating=1", $link); $hasvoted = mysql_num_rows($result); list( $uservoted ) = mysql_fetch_row($result); } } } else { if ( $thumbsonly == 3 && empty($ppuser) ) { // They shouldnt be here if they didnt give us a valid user, send em to showmembers $extra = ( !empty($limit) ? "&limit=$limit" : "" ); header( "Location: {$Globals['maindir']}/showmembers.php?cat=$cat$extra" ); exit; } } if ( $thumbsonly != 3 ) { $thumbsonly = ( isset($ppthumbs) ? $ppthumbs : $thumbtype ); } $perpage1x = $Globals['thumbcols']; $perpage3x = ($perpage1x * 3); $perpage4x = ($perpage1x * 4); $perpage5x = ($perpage1x * 5); $perpage6x = ($perpage1x * 6); // Force a contest catgeory to show all images on one page if ( $ratingtype == 1 ) { unset($page); $perpage = 1000000; } else { if ( $perpage ) { if ( $perpage > 90 ) { $perpage = 90; } if ($perpage < $perpage1x) { $perpage = $perpage1x; } } else { if ( isset($ppperpage) ) { $perpage = $ppperpage; } else { $perpage = ($Globals['thumbcols'] * $Globals['thumbrows']); } } } if ( isset($page) && $page > 0 ) { $startnumb = ($page*$perpage)-$perpage+1; } else { $page = 1; $startnumb = 1; } // do the sort box // $catrows = $sortcode = null; if ( empty($sortby) && is_numeric($cat) ) { $sortparam = ( isset($catsortorder) && $catsortorder > 0 ? $catsortorder : 1 ); $resultc = ppmysql_query("SELECT * FROM {$Globals['pp_db_prefix']}sort WHERE sortid=$sortparam", $link); list($sortid, $sortname, $sortcode) = mysql_fetch_row($resultc); } else { if ( empty($limit) ) { $sortcode = "ORDER BY disporder,date DESC"; } else { $sortcode = "ORDER BY date DESC"; } } $subalbums = $subcats = $seemore = null; if (!empty($ppuser)) { if ( $cat == 500 || $cat == MOBILE_CAT ) { list( $tuserid, $tusername, $tmail ) = get_userinfo( "", $ppuser); $thecatname = "$tusername {$Globals['pp_lang']['gallery']}"; $titlereplace = "$tusername's {$Globals['pp_lang']['gallery']}"; if ( $Globals['memformat'] == "no" ) { if ( $Globals['spider'] == "yes" ) { $conurl = construct_ppurl( "{$Globals['maindir']}/showgallery.php/cat/all" ); $seemore = "{$Globals['pp_lang']['tosee']} $tusername's {$Globals['pp_lang']['littlephotos']}"; } else { $conurl = construct_ppurl( "{$Globals['maindir']}/showgallery.php?cat=all" ); $seemore = "{$Globals['pp_lang']['tosee']} $tusername's {$Globals['pp_lang']['littlephotos']}"; } } } elseif ( $cattype == "a" ) { list( $tuserid, $tusername, $tmail ) = get_userinfo( "", $ppuser); $thecatname = "$tusername {$Globals['pp_lang']['album']}"; $titlereplace = "$tusername {$Globals['pp_lang']['album']}"; } } else { if ( $cat == "fav" ) { list( $tuserid, $tusername, $tmail ) = get_userinfo( "", $User['userid']); $thecatname = "$tusername {$Globals['pp_lang']['favorites']}"; } elseif ( $cat == "all" ) { $thecatname = $Globals['pp_lang']['callimages']; } elseif ( $cat == "last1" ) { $thecatname = $Globals['pp_lang']['clastday']; } elseif ( $cat == "last7" ) { $thecatname = $Globals['pp_lang']['clast7']; } elseif ( $cat == "last14" ) { $thecatname = $Globals['pp_lang']['clast14']; } } if ( isset($_POST['friendemail']) && !strstr($friendemail, "yourfriend") ) { if ( valid_email($friendemail) ) { if ( $User['userid'] > 0 ) { $rname = $User['username']; } else { $rname = $Globals['pp_lang']['afriend']; } $from_email = "From: {$Globals['adminemail']}"; include("{$Globals['PP_PATH']}/languages/$pplang.php"); $letter = $Globals['pp_lang']['emailsug']; $letter = stripslashes($letter); if ( empty($catp) ) { $letter = str_replace("&catp=", "", $letter); } $subject = $Globals['pp_lang']['esugsub']; mail( $friendemail, $subject, $letter, $from_email ); forward("showgallery.php?cat=$cat&ppuser=$ppuser&limit=$limit&page=$page&sortby=$sortby&sorttime=$sorttime&way=$way", $Globals['pp_lang']['linksent']); } } // Don't do these if we are not on page 1 if ( $page == 1 ) { $albums = array(); $albums['subalbcnt'] = $albums['albumcount'] = $x = 0; if ( !empty($ppuser) && $cat == 500 ) { $arows = ppmysql_query("SELECT c.id,c.parent,c.catname,c.description,c.photos,c.private, p.bigimage, p.cat, p.storecat, p.approved, p.width, p.height, p.userid, p2.bigimage, p2.cat, p2.storecat, p2.userid FROM {$Globals['pp_db_prefix']}categories c LEFT JOIN {$Globals['pp_db_prefix']}photos p ON p.id=c.lastphoto LEFT JOIN {$Globals['pp_db_prefix']}photos p2 ON p2.id=c.thumbnail WHERE ( c.parent=$ppuser AND c.cattype='a' AND c.photos > 0 AND c.subalbum=0 ) ORDER BY catorder ASC", $link); while ( list( $subid, $albuser, $subalbumname, $subalbumdesc, $albphotos, $isprivate, $bigimage, $albcat, $albstcat, $approved, $iwidth, $iheight, $iuser, $catthimg, $catthcat, $catstoreid, $catthuid ) = mysql_fetch_row($arows) ) { if ( $Globals['spider'] == "yes" ) { $albumlink = "{$Globals['maindir']}/showgallery.php/cat/$subid"; } else { $albumlink = "{$Globals['maindir']}/showgallery.php?cat=$subid"; } if ( $isprivate == "no" || $User['userid'] == $albuser ) { if ( !empty($catthimg) ) { if ( $catstoreid != 0 ) { $catthcat = $catstoreid; } $thumbrc = get_imagethumb( $catthimg, $catthcat, $catthuid, $approved ); } else { if ( $albstcat != 0 ) { $albcat = $albstcat; } $thumbrc = get_imagethumb( $bigimage, $albcat, $iuser, $approved ); } } else { continue; //$thumbrc = ""; //$thumbtag = "{$Globals['idir']}/lock.jpg"; } $albums['thumb'][$x] = $thumbrc; $albums['thumbtag'][$x] = $thumbtag; $albums['desc'][$x] = ( empty($subalbumdesc) ? "" : "
$subalbumdesc" ); $albums['desc'][$x] .= ( $isprivate == "no" ? "" : "
{$Globals['pp_lang']['private']}" ); $albums['name'][$x] = $subalbumname; $albums['photos'][$x] = $albphotos; $albums['link'][$x] = $albumlink; $albums['private'][$x] = $isprivate; $albums['width'][$x] = $iwidth; $albums['height'][$x] = $iheight; $albums['username'][$x] = $tusername; $memrec['userid'] = $albuser; $albums['thumbnail'][$x]= get_thumbtmpl( $id, $thumbrc, $iheight, $iwidth, $thumbtag, $subid, $albumlink ); $albums['albumcount']++; $x++; } ppmysql_free_result( $arows ); $fillercode = $albumfiller = " "; if ( $User['userid'] == $ppuser ) { $uploadcat = ( $subid > 0 ? $subid : 500 ); $fillercode = "{$Globals['pp_lang']['upload']}"; $albumfiller = "{$Globals['pp_lang']['addalbum']}"; } } // Now lets see if any albums are assigned here (none applied to Members Galleries) if ( $cat != 500 && is_numeric($cat) ) { $subrows = ppmysql_query("SELECT c.id,c.parent,c.catname,c.description,c.photos,c.private, p.userid, p.user, p.bigimage, p.cat, p.storecat, p.approved, p.width, p.height, p2.bigimage, p2.cat, p2.storecat, p2.userid, p2.user FROM {$Globals['pp_db_prefix']}categories c LEFT JOIN {$Globals['pp_db_prefix']}photos p ON p.id=c.lastphoto LEFT JOIN {$Globals['pp_db_prefix']}photos p2 ON p2.id=c.thumbnail WHERE ( (c.children=$cat OR c.subalbum=$cat) AND c.cattype='a' AND c.photos > 0 )", $link); while ( list( $subid, $albuser, $subalbumname, $subalbumdesc, $albphotos, $isprivate, $iuser, $ppname, $bigimage, $albcat, $albstcat, $approved, $iwidth, $iheight, $catthimg, $catthcat, $catstoreid, $catthuid, $catthname ) = mysql_fetch_row($subrows) ) { if ( $Globals['spider'] == "yes" ) { $albumlink = "{$Globals['maindir']}/showgallery.php/cat/$subid"; } else { $albumlink = "{$Globals['maindir']}/showgallery.php?cat=$subid"; } if ( $isprivate == "no" || $User['userid'] == $albuser ) { if ( !empty($catthimg) ) { if ( $catstoreid != 0 ) { $catthcat = $catstoreid; } $thumbrc = get_imagethumb( $catthimg, $catthcat, $catthuid, 1 ); $albums['username'][$x] = $catthname; } else { if ( $albstcat != 0 ) { $albcat = $albstcat; } $thumbrc = get_imagethumb( $bigimage, $albcat, $iuser, $approved ); } } else { // If the category we are in is private, then we will show subalbums that are private, // even if those subalbums themselves are also private. If the category is not private, // then we do not show private subalbums. if ( empty($CatPerms['catpass'][$cat]) ) { continue; } else { $thumbrc = ""; $thumbtag = "{$Globals['idir']}/lock.jpg"; } } $albums['username'][$x] = $ppname; $albums['thumb'][$x] = $thumbrc; $albums['thumbtag'][$x] = $thumbtag; $albums['desc'][$x] = ( empty($subalbumdesc) ? "" : "
$subalbumdesc" ); $albums['name'][$x] = $subalbumname; $albums['photos'][$x] = $albphotos; $albums['link'][$x] = $albumlink; $albums['private'][$x] = $isprivate; $albums['width'][$x] = $iwidth; $albums['height'][$x] = $iheight; $albums['thumbnail'][$x]= get_thumbtmpl( $subid, $thumbrc, $iheight, $iwidth, $thumbtag, $subid, $albumlink ); $albums['subalbcnt']++; $x++; } ppmysql_free_result( $subrows ); } if ( is_numeric($cat) && $cattype != 'a' ) { catrow( $cat, "showgallery" ); } } $cols = $Globals['thumbcols']; $catcheck = $mcats = null; if ( isset($_REQUEST['mcats']) ) { if ( is_array($_REQUEST['mcats']) ) { for ( $i = 0; $i < count($_REQUEST['mcats']); $i++ ) { if ( $mcats != null ) { $mcats .= ","; } $mcats .= (int)$_REQUEST['mcats'][$i]; } } else { typecast($_REQUEST, array('mcats' => INT)); } } if ( $mcats ) { $catcheck = " AND cat IN ($mcats)"; } elseif ( is_numeric($cat) ) { $catcheck = " AND cat=$cat"; } $datecheck = null; if ( !empty($limit) && $limit != "all" ) { if ( $limit == "last14" ) { $days = 14; } elseif ( $limit == "last7" ) { $days = 7; } else { $days = 1; } $timeq = time() - (($days * 24) * 3600); $datecheck = "AND date > $timeq"; } elseif ( !empty($date) ) { $thisdate = getdate($date); $thismonth = $thisdate['mon']; $thisyear = $thisdate['year']; $thisday = $thisdate['mday']; $lowdate = mktime(0, 0, 0, $thismonth, $thisday, $thisyear); $highdate = mktime(0, 0, 0, $thismonth, $thisday+1, $thisyear); $datecheck = "AND date >= $lowdate AND date < $highdate"; } $ppquery = null; if ( $cat == "all" && $ppuser ) { $ppquery = "AND userid=$ppuser"; } // Sort timeframe (takes priority over recent selection if selected) if ( !empty($sorttime) ) { $sortcheck = time() - (($sorttime * 24) * 3600); $datecheck = "AND date > $sortcheck"; } // Sortname? if ( $sortby ) { if ( $sortby == "s" ) { $sortvar = "filesize"; } elseif ( $sortby == "r" ) { $sortvar = "rating"; } elseif ( $sortby == "l" ) { $sortvar = "lastpost"; } elseif ( $sortby == "d" ) { $sortvar = "date"; } elseif ( $sortby == "v" ) { $sortvar = "views"; } else { $sortvar = "bigimage"; } $sortdir = ( $way == "asc" ? "ASC" : "DESC" ); $sortcode = "ORDER BY disporder,$sortvar $sortdir"; if ( $sortby == "r" && $ratingtype != 1 ) { $sortcode = "AND rating > 0 $sortcode"; } elseif ( $sortby == "l" ) { $sortcode = "AND lastpost > 0 $sortcode"; } } $query = "SELECT id,user,userid,cat,storecat,date,title,description,keywords,bigimage,width,height,filesize,views,medwidth,medheight,medsize,approved,rating,allowprint,numcom,lastposter FROM {$Globals['pp_db_prefix']}photos "; if ( $cat == "fav" ) { $query = "SELECT f.userid,p.id,p.user,p.userid,p.cat,p.storecat,p.date,p.title,p.description,p.keywords, p.bigimage,p.width,p.height,p.filesize,p.views,p.medwidth,p.medheight,p.medsize,p.approved,p.rating,p.allowprint,p.numcom,p.lastposter FROM {$Globals['pp_db_prefix']}favorites f, {$Globals['pp_db_prefix']}photos p WHERE f.userid={$User['userid']} AND f.photo=p.id $datecheck $sortcode"; } else { if ( !$ppuser ) { $query .= "WHERE approved < 2 $catcheck $datecheck $sortcode"; } else { $query .= "WHERE "; if ( $ppuser != $User['userid'] ) { $query .= "approved=1 AND "; } if ( $cat == 500 ) { if ( $Globals['memformat'] == "yes" ) { $query .= "userid=$ppuser AND storecat=0 $datecheck $sortcode"; } else { $query .= "userid=$ppuser AND storecat=0 $catcheck $datecheck $sortcode"; } } else { $query .= "userid=$ppuser $catcheck $datecheck $sortcode"; } } } $queryv = ppmysql_query($query, $link); $rowcnt = mysql_num_rows($queryv); $count = $count = $cntresults = $itemcnt = 0; $pwidth = intval(100 / $Globals['thumbcols']); $gallery = array(); while ( $row = mysql_fetch_row($queryv) ) { if ( $cat == "fav" ) { list( $favid, $id, $tuser, $tuserid, $pcat, $storecat, $pdate, $title, $desc, $keywords, $bigimage, $width, $height, $filesize, $views, $medwidth, $medheight, $medsize, $approved, $imgrating, $allowprint, $comcount, $lastposter ) = $row; } else { list( $id, $tuser, $tuserid, $pcat, $storecat, $pdate, $title, $desc, $keywords, $bigimage, $width, $height, $filesize, $views, $medwidth, $medheight, $medsize, $approved, $imgrating, $allowprint, $comcount, $lastposter ) = $row; } $is_private = "no"; if ( $pcat != $cat ) { $is_private = is_image_private( $pcat ); } if ( $storecat == 0 ) { $storecat = $pcat; } if ( $CatPerms['cattype'][$pcat] == "a" && $cat == 500 ) { continue; } if ( $approved == 0 && ($User['adminedit'] == 0 && $User['moderator'] == 0 && $tuserid != $User['userid']) ) { continue; } if ( $is_private == "no" ) { $cntresults++; if ( $cntresults >= $startnumb ) { if ( $cntresults < ($startnumb+$perpage) ) { $sizecode = $Globals['pp_lang']['na']; if ( $width > 0 && $height > 0 ) { $sizecode = "$width x $height"; } $filesize = sprintf("%1.1f", ($filesize/1024)) . "{$Globals['pp_lang']['kb']}"; $theext = get_ext($bigimage); $filename = $bigimage; $filename = str_replace( $theext, "", $filename); $ppdate = formatppdate( $pdate ); if ( $medsize > 0 ) { $medsize = sprintf("%1.1f", ($medsize/1024)) . "{$Globals['pp_lang']['kb']}"; $ilink = "{$Globals['datadir']}/$storecat/medium/$bigimage"; $biglink = "{$Globals['datadir']}/$storecat/$bigimage"; if ( $Globals['spider'] == "yes" ) { $conurl = construct_ppurl( "{$Globals['maindir']}/showphoto.php/photo/$id" ); $fsizedisp = "$medsize, "; $conurl = construct_ppurl( "{$Globals['maindir']}/showphoto.php/photo/$id/size/big" ); $fsizedisp .= "$filesize"; } else { $conurl = construct_ppurl( "{$Globals['maindir']}/showphoto.php?photo=$id" ); $fsizedisp = "$medsize, "; $conurl = construct_ppurl( "{$Globals['maindir']}/showphoto.php?photo=$id&size=big" ); $fsizedisp .= "$filesize"; } } else { $ilink = "{$Globals['datadir']}/$storecat/$bigimage"; if ( $Globals['spider'] == "yes" ) { $conurl = construct_ppurl( "{$Globals['maindir']}/showphoto.php/photo/$id" ); $fsizedisp = "$filesize"; } else { $conurl = construct_ppurl( "{$Globals['maindir']}/showphoto.php?photo=$id" ); $fsizedisp = "$filesize"; } } // Find out if a photo has comments if ( $comcount > 0 ) { if ( $Globals['spider'] == "yes" ) { $conurl = construct_ppurl( "{$Globals['maindir']}/showphoto.php/photo/$id" ); $comline = "$comcount {$Globals['pp_lang']['littlecom']}"; } else { $conurl = construct_ppurl( "{$Globals['maindir']}/showphoto.php?photo=$id" ); $comline = "$comcount {$Globals['pp_lang']['littlecom']}"; } } else { $comline = "{$Globals['pp_lang']['nocomments']}"; } // get the rating if ( ($imgrating && $Globals['allowrate'] == "yes") || $ratingtype == 1 ) { $rating = number_format( $imgrating, 2 ); } else { $rating = $Globals['pp_lang']['none']; } $thumbrc = get_imagethumb( $bigimage, $storecat, $tuserid, $approved ); $gallery['profilelink'][$itemcnt] = "{$Globals['maindir']}/member.php?uid=$tuserid"; if ( $Globals['spider'] == "yes" ) { $conurl = construct_ppurl( "{$Globals['maindir']}/showphoto.php/photo/$id/cat/$cat" ); $gallery['plink'][$itemcnt] = ""; } else { $conurl = construct_ppurl( "{$Globals['maindir']}/showphoto.php?photo=$id&cat=$cat" ); $gallery['plink'][$itemcnt] = ""; } $gallery['thumbrc'][$itemcnt] = $thumbrc; $gallery['thumbtag'][$itemcnt] = $thumbtag; $gallery['tuser'][$itemcnt] = $tuser; if ( strlen($title) > 22 ) { $title = substr($title,0,22) . "..."; } $gallery['filename'][$itemcnt] = $bigimage; $gallery['title'][$itemcnt] = $title; $gallery['views'][$itemcnt] = $views; $gallery['rating'][$itemcnt] = ( $ratingtype == 0 ? $rating : intval($rating) ); $gallery['ppdate'][$itemcnt] = "$ppdate $pptime"; $gallery['comline'][$itemcnt] = $comline; $gallery['fsizedisp'][$itemcnt] = $fsizedisp; $gallery['sizecode'][$itemcnt] = $sizecode; $gallery['allowprint'][$itemcnt] = $allowprint; $gallery['width'][$itemcnt] = $width; $gallery['height'][$itemcnt] = $height; $gallery['id'][$itemcnt] = $id; $gallery['userid'][$itemcnt] = $tuserid; $gallery['voted'][$itemcnt] = ( $id == $uservoted ? 1 : 0 ); $gallery['thumbnail'][$itemcnt] = get_thumbtmpl( $id, $thumbrc, $height, $width, $thumbtag ); $gallery['background'][$itemcnt] = ( $approved == 2 ? $Style['tableborders'] : $Style['tddetails'] ); $itemcnt++; } } } } ppmysql_free_result( $queryv ); $numpages = pagesystem($cntresults); $pageind = null; if ( $cntresults > 0 ) { $start = ( $page > 1 ? (($page-1)*$perpage)+1 : 1 ); $finish = $page * $perpage; if ( $finish > $cntresults ) { $finish = $cntresults; } $replvars = array( "{start}", "{finish}", "{cntresults}" ); $replnews = array( $start, $finish, $cntresults ); $pageind = str_replace( $replvars, $replnews, $Globals['pp_lang']['imagecnt'] ); } $noresults = null; if ( $rowcnt == 0 || $cntresults == 0 ) { $noresults .= "{$Globals['pp_lang']['nocatimg']}
"; } $nextbutton = $prevbutton = null; if ( $posternav ) { if ( $page < $pages ) { $nextpage = $page + 1; if ( $Globals['spider'] == "yes" ) { $conurl = construct_ppurl( "{$Globals['maindir']}/showgallery.php/cat/$cat/page/$nextpage" ); $nextbutton = " 
»"; } else { $conurl = construct_ppurl( "{$Globals['maindir']}/showgallery.php?cat=$cat&page=$nextpage" ); $nextbutton = " »"; } } if ( $page > 1 ) { $prevpage = $page - 1; if ( $Globals['spider'] == "yes" ) { $conurl = construct_ppurl( "{$Globals['maindir']}/showgallery.php/cat/$cat/page/$prevpage" ); $prevbutton = " « "; } else { $conurl = construct_ppurl( "{$Globals['maindir']}/showgallery.php?cat=$cat&page=$prevpage" ); $prevbutton = " « "; } } $posternav = "$prevbutton$posternav$nextbutton"; if ( !empty($seemore) ) { $posternav .= "

"; } } if ( !empty($noresults) ) { $noresults = "$noresults"; } if ( !empty($noresults) && !empty($seemore) ) { $noresults .= "
"; } if ( empty($posternav) && empty($seemore) && empty($noresults) ) { $posternav = " "; } // Quick Jump menu $selected = $cat; quickcats(0,1); if ( !is_numeric($cat) ) { $catoptions = "$catoptions"; } elseif ( $cattype == "a" ) { $catoptions = "$catoptions"; } $quickjump = ""; // Last thing, give them a subscribe button? $subscribe = " "; if ( $User['userid'] > 0 && $Globals['usenotify'] == "yes" && is_numeric($cat) && $cat != 500 ) { if ( $notify == $User['userid'] ) { $subscribe = "{$Globals['pp_lang']['unsubgallery']}"; } else { $subscribe = "{$Globals['pp_lang']['subscribe']}"; } } if ( $Globals['sidebar_global'] == "yes" ) { if ( $Globals['statspal'] == "yes" ) { get_statscache(); } if ( $Globals['topposterspal'] == "yes" ) { get_posterscache(); } if ( $Globals['ratingspal'] == "yes" ) { get_ratingcache(); } } topmenu(); // // Print the page // printheader( $cat, $thecatname ); childsub($cat, $cattype); $childnav = "{$Globals['pp_lang']['home']} $childnav"; if ( $cattype == 'c' && empty($ppuser) ) { if ( $Globals['features'] == "yes" && ($Globals['mostrecent'] == "yes" && $Globals['recentdefault'] == "no") ) { display_gallery("latest", "", $cat); } } // Cell alignment $aligntb = ( $thumbsonly > 0 ? "middle" : "bottom" ); if ( $thumbsonly == 1 ) { $views = ""; } elseif( $thumbsonly == 2 ) { $views = ""; } elseif( $thumbsonly == 3 ) { $views = ""; } elseif( $thumbsonly == 4 ) { $views = ""; // $thumbfudge is used to add a few thumbnails per line when using Puzzle view (since we have more room) $thumbfudge = 6; } else { $views = ""; } $whoonline = null; if ( $Globals['catonline'] == "yes" ) { // Lets get Who is Online $whoonline = get_whoonline( $cat ); } include( "{$Globals['PP_PATH']}/{$Globals['TMPL_PATH']}/menubar.tmpl" ); if ( $Globals['sidebar'] == "left" && $Globals['sidebar_global'] == "yes" ) { include( "{$Globals['PP_PATH']}/{$Globals['TMPL_PATH']}/sidebar_leftopen.tmpl" ); } if ( $Globals['sidebar'] == "right" && $Globals['sidebar_global'] == "yes" ) { include( "{$Globals['PP_PATH']}/{$Globals['TMPL_PATH']}/sidebar_rightopen.tmpl" ); } $whichgallery = ( $Globals['pplayout'] == "no" ? "categall" : "categories" ); $count = 0; include( "{$Globals['PP_PATH']}/{$Globals['TMPL_PATH']}/showgallery.tmpl" ); if ( $cattype == "c" && !$ppuser ) { if ( $Globals['features'] == "yes" ) { if ( $Globals['mostrecent'] == "yes" && $Globals['recentdefault'] == "yes" ) { display_gallery("latest", "", $cat); } if ( $Globals['dispopular'] == "yes" ) { display_gallery("most_views", "", $cat); } if ( $Globals['disrandom'] == "yes" ) { display_gallery("random", "", $cat); } } } if ( $Globals['sidebar'] == "left" && $Globals['sidebar_global'] == "yes" ) { include( "{$Globals['PP_PATH']}/{$Globals['TMPL_PATH']}/sidebar_leftclose.tmpl" ); } if ( $Globals['sidebar'] == "right" && $Globals['sidebar_global'] == "yes" ) { include( "{$Globals['PP_PATH']}/{$Globals['TMPL_PATH']}/sidebar_rightclose.tmpl" ); } printfooter(); ?>