Latest Downloaded Wallpapers'; require("includes/mysql.inc.php"); $url_array = explode("/",$_SERVER['REQUEST_URI']); $ime = $url_array[1]; $page = (int)$url_array[2]; $GLOBALS['n'] = "/latest_downloads"; $num = 900; if(empty($page)) $page = 1; $hits = 30; $start = ($page-1)*$hits; if($page == 1) { $hits += 1; } //$query = "SELECT wallpapers.* FROM downloads RIGHT JOIN wallpapers ON downloads.filename = wallpapers.id WHERE wallpapers.adult=0 AND wallpapers.active=1 ORDER BY downloads.filename DESC LIMIT ".$start.",".$hits; $query = "SELECT * FROM wallpapers WHERE adult=0 AND active=1 ORDER BY dls DESC LIMIT ".$start.",".$hits; $query_key = md5($query); $result = $memcache->get($query_key); //unset($result); if (empty($result)) { $res = mysql_query($query) or die("ERROR".__LINE__.": ".mysql_error()); while($ar = mysql_fetch_array($res)) { $x++; $resr = mysql_query("SELECT * FROM categories WHERE id='".$ar[category]."'") or die("ERROR".__LINE__.": ".mysql_error()); $arr = mysql_fetch_array($resr); if(empty($ar[picture_name])) { $ar[picture_name] = preg_replace("/_/i"," ",$ar[name]); $ar[picture_name] = preg_replace("/-/i"," ",$ar[picture_name]); $ar[picture_name] = preg_replace("/\.jpg/i","",$ar[picture_name]); $ar[picture_name] = ucwords($ar[picture_name]); } if(empty($ar[picture_alt])) $ar[picture_alt] = $ar[picture_name]; if(!empty($ar[picture_alt])) $pictureAlt = $ar[picture_alt]; else $pictureAlt = $ar[name].' Wallpaper'; if($x == 1) { $nid = (int)($ar[category]/100); $filename = '/wallpapers/'.$nid.'/'.$ar[category].'/thumb/600_'.$ar[name]; $filename_full = '/photo/'.$ar[id].'/'.$ar[name]; $out .= '
'; // *** Tiny Navigation **** $out .= '
'; $out .= 'Zoom'; $out .= ''; $out .= 'View'; $out .= '
'; // *** Display Wallpaper *** $out .= ''; $out .= ''.$pictureAlt.''; $out .= ''; // *** Name of the wallpaper *** $out .= '
'; //$out .= ''.$ar1[picture_name].''; $out .= 'Just downloads: '.$ar[picture_name].''; $out .= '
'; $out .= '
'; if(!empty($ar[description])) $out .= '

'.$ar[description].'/p>'; $out .= '

More just downloaded wallpapers:

'; } else { $p++; if($p == 4) { $out .= '
'; $out .= ShowBanner300x250(1); $out .= ''; $out .= ShowBanner300x250(1); $out .= '
'; } $nid = (int)($ar[category]/100); $filename = '/wallpapers/'.$nid.'/'.$ar[category].'/thumb/200_'.$ar[name]; $filename_full = '/photo/'.$ar[id].'/'.$ar[name]; $webURL = ''; $out .= '
'; // *** Tiny Navigation **** $out .= '
'; $out .= 'Zoom'; $out .= ''; $out .= 'View'; $out .= '
'; // *** Display Wallpaper *** $out .= ''; $out .= ''.$pictureAlt.''; $out .= ''; // *** Name of the wallpaper *** $out .= '
'; $out .= ''.$ar1[picture_name].''; $out .= '
'; $out .= '
'; } } echo $out; $memcache->set($query_key,$out,0,3600); // store in memory for 3600sec or 1 hour } else { echo $result; } if ($num>$hits) { echo '
'; $show = 38; ShowPages2($num,$page,$hits,$show); echo '
'; } ### Show Popular Tags echo '

'; echo '

Popular Tag Clouds

'; ShowPopularTagClouds(60); ShowTodayPopular(); require(ROOT . "/templates/footer.inc.php");