query($query); //if($sql -> num_rows($res) == 0){header('Location:'.$GLOBALS['APP']['PATHS']['BASEURL'].''); exit();} $tag = $sql -> fetch_assoc($res); $tag['tag_name'] = str_replace('+', ' ', $tag['tag_name']); } catch(Exception $e){ //header('Location:'.$GLOBALS['APP']['PATHS']['BASEURL'].''); exit(); } $TMP['META_TITLE'] = ucfirst($tag['tag_name'])." wallpapers - Free ".$tag['tag_name']." wallpaper download"; $TMP['META_KEYWORDS'] = $tag['tag_name']." wallpapers, ".$tag['tag_name'].", download ".$tag['tag_name']." wallpaper, ".$tag['tag_name']." wallpaper"; $TMP['META_DESC'] = ucfirst($tag['tag_name'])." Wallpapers - Free ".$tag['tag_name']." wallpaper download"; $TMP['META_EXTENSION'] = ''; $TOKEN = strtolower($tag['tag_name']); $UPP = 5; if((int)$_REQUEST['s'] != 0){$_REQUEST['s'] = (int)$_REQUEST['s'] -1;} ?>

wallpapers


fetch_assoc($sql -> query($cquery)); $total = $r['total']; unset($r); $query = "SELECT * FROM wallpapers as w, users as u, tag_relations as r, tags as t WHERE w.wallpaper_sizes != 0 AND t.tag_id = r.rel_tag AND w.wallpaper_id = r.rel_wallpaper AND t.tag_id = ".sqlSafe($tag['tag_id'])." 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'); } } $wallpapers -> __destruct(); 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).'
';} ?>