Yesterday Most Downloaded Wallpapers'; $output = ''; $m = 0; $l=0; $tmp_data = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/yesterday_top.json"); $data = json_decode($tmp_data); #print_r($data); foreach ($data as $key => $row) { $x++; $res = mysql_query("SELECT * FROM wallpapers WHERE id='".$row->id . "'") or die("ERROR".__LINE__.": ".mysql_error()); $ar = mysql_fetch_array($res); $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("/_/"," ",$ar[name]); $ar[picture_name] = preg_replace("/-/"," ",$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 .= 'Yesterday most downloaded: '.$ar[picture_name].''; $out .= '
'; $out .= '
'; if (!empty($ar[description])) { $out .= '

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

More of yesterday most popular 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 = 'http://im02.galawallpapers.net'; $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; // *** Show Popular Tags echo '

'; echo '

Popular Tags

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