GetNumberOfGamesInCategory("All"); $google=join ('', file ("/home/filespac/public_html/templates/google-728x90.txt")); $catname="New casual game downloads"; $filesperpage=20; $startfile=1; if(empty($p)) $p=1; $pagenum=$p; $numpages=ceil(strval($numfiles/$filesperpage)); $startfile=($pagenum-1)*$filesperpage; if($pagenum>1) $paget=" - Page ".$pagenum; $category=$catname; // Navigation ------------------- $pnext=$p+1; $pprev=$p-1; if(dev==1) { $nextpageurl="new-games.html?p=".$pnext; $prevpageurl="new-games.html?p=".$pprev; } else { $nextpageurl="/new-games".$pnext.".html"; $prevpageurl="/new-games".$pprev.".html"; } if($pagenum>1) $navpagelinks='«  Page '; if($numpages < 15 ) { for($i=1;$i<=$numpages;$i++) { if($i == $pagenum) $navpagelinks.=" ".$i." "; else { if(dev==1) { $navpagelinks.=''.$i.''; } else { $navpagelinks.=''.$i.''; } } } } else { if($pagenum < 10) { for($i=1;$i<=10;$i++) { if($i == $pagenum) $navpagelinks.=" ".$i." "; else { if(dev==1) $navpagelinks.=''.$i.''; else $navpagelinks.=''.$i.''; } } $navpagelinks.=" ... "; for($i=$numpages-2;$i<=$numpages;$i++) { if(dev==1) $navpagelinks.=''.$i.''; else $navpagelinks.=''.$i.''; } } else if($pagenum > $numpages-7) { for($i=1;$i<=3;$i++) { if(dev==1) $navpagelinks.=''.$i.''; else $navpagelinks.=''.$i.''; } $navpagelinks.=" ... "; for($i=$numpages-7;$i<=$numpages;$i++) { if($i == $pagenum) $navpagelinks.=" ".$i." "; else { if(dev==1) $navpagelinks.=''.$i.''; else $navpagelinks.=''.$i.''; } } } else { for($i=1;$i<=3;$i++) { if(dev==1) $navpagelinks.=''.$i.''; else $navpagelinks.=''.$i.''; } $navpagelinks.=" ... "; for($i=$pagenum-3;$i<=$pagenum-1;$i++) { if(dev==1) $navpagelinks.=''.$i.''; else $navpagelinks.=''.$i.''; } $navpagelinks.=" ".$i." "; for($i=$pagenum+1;$i<=$pagenum+3;$i++) { if(dev==1) $navpagelinks.=''.$i.''; else $navpagelinks.=''.$i.''; } $navpagelinks.=" ... "; for($i=$numpages-2;$i<=$numpages;$i++) { if(dev==1) $navpagelinks.=''.$i.''; else $navpagelinks.=''.$i.''; } } } if($pagenum<$numpages) { if(dev==1) $navpagelinks.='»'; else $navpagelinks.='»'; } $pagetitle="Casual Games Latest Releases. Free download."; $menu = topMenu(dev,'new-games'); $base = SITEURL; $page=EvalTemplate("templates/top.html",'$pagetitle,$subcatname,$catslist,$subcatslist,$paget,$title,$version,$base,$menu'); $desc="New Casual Game Downloads"; $page.=EvalTemplate("templates/game_category_list_header.html",'$desc,$pagenum,$numpages,$navpagelinks'); $imageSize=80; $in_type='Age'; // GAME LIST ------------------------------------------------------------------------- if ($numfiles > 0) { $newGame = $mdb->select(array("*"), "wdk_gamedata", "", "", "ReleaseDate desc", "$startfile,20"); $row=0; //for ($i = $startfile; $i < min($filesperpage + $startfile, $numfiles); $i++) foreach($newGame as $newg) { $row++; /*{ RA_SetGame( $in_type . '|All[' . ($i+1) . ']'); }*/ RA_SetAID($newg->AID); $title = $newg->GameTitle; $company = $newg->Developer; $description80 = substr(htmlspecialchars($newg->LongDescription),0,200)."..."; //$screenshot_url = RA_GetGameImage('Game_' . $imageSize . 'x' . $imageSize); $cost = $newg->Price; $listprice = $newg->ListPrice; $sizeMB = $newg->DownloadSizeMB; $rating = max(0, min(5, round(2 * $newg->Rating)/2)); $popularity = $val["popularity"]; if(dev==1) { $download_url = "dl.php?gid=".$newg->AID; } else { $download_url = "http://games.filespack.com/dl/".$newg->AID; } $keywords = htmlspecialchars($val["keywords"]); $discount = $val["discount"]; $small_pic=$val[id]; if($cost!=0) $price_string="Free to try; $".$cost." to buy"; else $price_string="Free"; if(empty($val["pick"])) $pick=""; else $pick=""; if(!empty($coupon)) $pick.=" 
".$discount."% OFF
"; ///////////////////// creating of the description page////////////////////////// if($popularity > 90) { $stars_image='FilesPack Excellent Award'; } else { $rating_image=""; for($nstar=0;$nstar<5;$nstar++) { if($rating>$nstar) $rating_image.='+'; else $rating_image.='+'; } $stars_image='
'.$rating_image.'
'; } $pagetitle=$title." information"; // Screenshot thumbnail if(dev==1) { $fileurl="showgame.php?AID=".$newg->AID; if($mdb->selectIfExist(array("gameID","foldername"), "wdk_gamedata", "AID=".$newg->AID." and gameID!=''")) { $gameData = $mdb->selectSRow(array("gameID","foldername"), "wdk_gamedata", "AID=".$newg->AID." and gameID!=''"); $folder = explode('_',$gameData["foldername"]); $small_scr=''.$title.' '.$version.''; } else { $small_scr=''.$title.''; } } else { if($mdb->selectIfExist(array("gameID","foldername"), "wdk_gamedata", "AID=".$newg->AID." and gameID!=''")) { $gameData = $mdb->selectSRow(array("gameID","foldername"), "wdk_gamedata", "AID=".$newg->AID." and gameID!=''"); $folder = explode('_',$gameData["foldername"]); $small_scr=''.$title.' '.$version.''; } else { $small_scr=''.$title.''; } $fileurl="http://games.filespack.com/".generateSlug($title).".html"; } if($row!=2) $page.=EvalTemplate("templates/game_category_list_entry.html",'$title,$fileurl,$description80,$download_url,$small_pic,$keywords,$version,$screenshot_url,$sizeMB,$price_string,$company,$stars_image,$ptype,$small_scr,$pick'); else $page.=$google; } $page.=EvalTemplate("templates/game_category_list_footer.html",'$pagenum,$numpages,$navpagelinks'); $google1= join ('', file ("../templates/google1.txt")); // $page.=EvalTemplate("../templates/google3.html",'$google1'); $google_v= join ('', file ("../templates/google_160x600.txt")); $promo= join ('', file ("../templates/rpromo.txt")); $related=$picked; $page.=EvalTemplate("../templates/right_col.html",'$promo,$google_v,$related'); if(dev==1) { $page.= EvalTemplate("templates/footer_dev.html",'$base'); } else { $page.= join ('', file ("templates/footer.html")); } include("../inc/pagetimeend.inc"); echo $page; } // else // header ("Location: http://games.filespack.com\n\n"); ?>