0 ) { 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 laston VALUES($cat,$userid,$lasttimeon)"; $resultb = ppmysql_query($laston, $link); } childsub($cat); $childnav = "{$Globals['pp_lang']['home']} $childnav"; $searchcat = $cat; } else { if ( $username != "" && $username != "Unregistered" ) $childnav = "{$Globals['pp_lang']['welcomeuser']} $username!"; else $childnav = "{$Globals['pp_lang']['welcome']} {$Globals['galleryname']}!"; $searchcat = 998; } if ( !empty($cat) ) { $query = "SELECT id,catname FROM categories WHERE id='$cat'"; $ctitleq = ppmysql_query($query, $link); if ( $ctitleq ) { list( $catid, $cattitle ) = mysql_fetch_row($ctitleq); ppmysql_free_result( $ctitleq ); $tablehead = "$cattitle"; } else $tablehead = ""; } else { $tablehead = $Globals['pp_lang']['tablehead']; } printheader( $thecat, $tablehead ); $output = "
$menu2$menu 
"; if ( $Globals['mostrecent'] == "yes" && $Globals['recentdefault'] == "no" ) { display_gallery("latest"); $output .= "
"; } $output .= "
"; if ( $Globals['allowpost'] == "yes" ) { $output .= ""; } $output .= ""; $count = 0; $catdepth = 0; $catrows = ""; $cptotal = 0; $posttotal = 0; $totalviews = 0; $diskspace = 0; if ( !(isset($cat)) ) { catrow(0); } else { catrow($cat); } $output .= $catrows; $usertotal = get_totalusers(); $query = "SELECT SUM(views), SUM(filesize) AS fsize FROM photos"; $totalv = ppmysql_query($query,$link); list( $totalviews, $diskuse ) = mysql_fetch_row($totalv); ppmysql_free_result($totalv); $totalviews = number_format( $totalviews ); $totalphotos = number_format( $totalphotos ); $usertotal = number_format( $usertotal ); $posttotal = number_format( $posttotal ); $diskspace = $diskuse/1048576; $diskspace = number_format( $diskspace, 1 ); $diskspace = "$diskspace MB"; // Lets get the Top 5 Posters $query = "SELECT user,userid,COUNT(*) AS pcount FROM photos GROUP BY user ORDER BY pcount DESC"; $queryz = ppmysql_query($query,$link); $rowcnt = mysql_num_rows($queryz); $numfound = 0; while ( list($theuser, $theuserid, $uphotos) = mysql_fetch_row($queryz)) { $numfound++; $topposters[$numfound] = $theuser; $topid[$numfound] = $theuserid; $topposts[$numfound] = $uphotos; if ( $numfound == 5 ) break; } $toplist = "
{$Globals['pp_lang']['toposter']}"; for ( $x=1; $x < ($numfound+1); $x++ ) { $toplist .= "   $topposters[$x] ($topposts[$x])"; } if ($Globals['stats'] == "yes") { if ( !isset($cat) ) { $output .= ""; } } $output .= "
 $childnav
{$Globals['pp_lang']['recent']} {$Globals['pp_lang']['lastday']}  {$Globals['pp_lang']['last7']}  {$Globals['pp_lang']['last14']}  {$Globals['pp_lang']['allimages']}
{$Globals['pp_lang']['category']} {$Globals['pp_lang']['photos']}{$Globals['pp_lang']['comments']} {$Globals['pp_lang']['lastcomment']} {$Globals['pp_lang']['lastphoto']}
$usertotal {$Globals['pp_lang']['regusers']} $totalphotos "; if ( $Globals['allowpost'] == "yes" ) { $output .= "{$Globals['pp_lang']['posted']} $posttotal {$Globals['pp_lang']['posts']}"; } else { $output .= "{$Globals['pp_lang']['postednoc']}"; } $output .= "
$totalviews {$Globals['pp_lang']['views']} $diskspace {$Globals['pp_lang']['diskspace']}$toplist
"; if ( $Globals['mostrecent'] == "yes" && $Globals['recentdefault'] == "yes") { $output .= "
"; display_gallery("latest"); } if ( $Globals['dispopular'] == "yes" ) { $output .= "
"; display_gallery("most_views"); } if ( $Globals['disrandom'] == "yes" ) { $output .= "
"; display_gallery("random"); } print "$output
{$Globals['cright']}
"; printfooter(); ?>