Wallpapers, fresh wallpaper uploads


fetch_assoc($sql -> query($cquery)); $total = $r['total']; unset($r); $query = "SELECT * FROM wallpapers as w, users as u WHERE w.wallpaper_sizes != 0 AND w.wallpaper_owner = u.user_id ORDER BY w.wallpaper_id DESC LIMIT ".((int)$_REQUEST['s']*(int)$UPP).", ".(int)$UPP."; "; $wallpapers = new Listing($sql, $query); if($wallpapers){ foreach($wallpapers -> data as $id => $wp){ include('inc/templates/wallpaper_public.php'); } } include('ads_bottom.php'); // CREATE PAGINATION // ------------------------------------------------ if($total > ($UPP)){ echo '
    '; $pages = (int)($total/$UPP); if(($pages*$UPP) < $total){$pages++;} if((int)$_REQUEST['s'] != 0){ $top_limit_pages = (int)$_REQUEST['s']+8; $bottom_limit_pages = ((int)$_REQUEST['s'])-7; if($bottom_limit_pages < 0){ $top_limit_pages += abs($bottom_limit_pages); $bottom_limit_pages = 0; } } //else {$top_limit_pages = $pages; $bottom_limit_pages = 0;} else {$top_limit_pages = 16; $bottom_limit_pages = 0;} if($top_limit_pages > $pages){$top_limit_pages = $pages;}; for($i = $bottom_limit_pages; $i< $top_limit_pages; $i++){ if($i != (int)$_REQUEST['s']){ if($i == 0){echo '
  • '.($i+1).'
  • ';} else {echo '
  • '.($i+1).'
  • ';} } else { if($i == 0){echo '
  • '.($i+1).'
  • ';} else {echo '
  • '.($i+1).'
  • ';} } } echo '
'; } } catch(Exception $e){echo '
'.showError($e).'
';} ?>