functions.php dosyasına ekleyecegin kodlar.
//yeni eklenen oyunlar
function displaynewest() {
global $maxnewest;
$result = mysql_query("SELECT fileid, title, description, rating, icon, iconlocation, category, timesplayed FROM files WHERE status = '1' ORDER BY fileid DESC LIMIT $maxnewest");
if (mysql_num_rows($result)) {
$fileinrow="1";
while($row = mysql_fetch_array($result)) {
$nfiletitle = $row['title'];
$nfileid = $row['fileid'];
$nfilerating = $row['rating'];
$ntimesplayed = number_format($row['timesplayed']);
$nfileicon = $row['icon'];
$niconlocation = $row['iconlocation'];
$ntimesplayed = number_format($row['timesplayed']);
if ($niconlocation == '1') {
$nimageurl = $siteurl."/files/image/".$nfileicon;
} else {
$nimageurl = $nfileicon;
}
if ($fileinrow == '1') {
echo "<tr>";
}
?>
<?
$ncategory = $row['category'];
$categoryName = array(
"1" => "Kız Oyunları",
"2" => "Macera Oyunları",
"3" => "Yarış Oyunları",
"4" => "Dövüş Oyunları",
"5" => "Aksiyon Oyunları",
"6" => "Spor Oyunları",
"7" => "Savaş Oyunları",
"8" => "Hedef Oyunları",
"9" => "Karışık Oyunlar",
"10" => "Çocuk Oyunları"
);
?>
<td width="25%"><table bgcolor="white" align="center" style="border-collapse: collapse" border="0"><tr><td onMouseOver="this.bgColor='#C5FB91'" onMouseOut="this.bgColor=''" valign="top" align="center"><a href="<?php echo fileurl($nfileid,$nfiletitle); ?>" target="_self"><img src="<?php echo $nimageurl; ?>" width="100" height="80" title="<?php echo $nfiletitle; ?>" border="0"></a><tr><td height="10" valign="top" align="center"> <a href="<?php echo fileurl($nfileid,$nfiletitle); ?>" target="_self" class="gamelink"><?php echo $nfiletitle; ?></a></td></tr><tr><td height="5" valign="top" class="file-link" align="center"><a href="<? echo $siteurl;?>/<? echo $ncategory;?>-cocuk-<?php echo $categoryName[$ncategory];?>" target="_self"><b><?php echo $categoryName[$ncategory];?></a></b></td></tr></td></tr><tr><td height="10"></td></tr></table> </td>
<?php
if ($fileinrow == '4') {
echo "</tr>";
$fileinrow = "0";
}
$fileinrow++;
}
if ($fileinrow == '2') {
echo "<td width=\"25%\"></td><td width=\"25%\"></td></tr>";
} elseif ($fileinrow == '3') {
echo "<td width=\"25%\"></td></tr>";
}
}
}
templates/indexpage.html in içine ekleyeceğin kodlar
<div style="border: 2px solid #C5FB91;"><table bgcolor="white" border="0" cellpadding="0" cellspacing="0" width="100%"><?php displaynewest(); ?></table></div>
gelelim en cok oynananlara oda su sorguyu soyle değiştirip aynı kodları kullana bılırsın
$result = mysql_query("SELECT fileid, title, description, rating, icon, iconlocation, category, timesplayed FROM files WHERE status = '1' ORDER BY
timesplayed DESC LIMIT $maxnewest");
php kodda ben oyun ısımlerının altına kategorileride yazdırdım ıstemessen kldırırsın 1,2,3,4 dıye belırlenen degıskenler kategorılerın ID lerı id lere gorede kategorı ısımlerı yazıyo
takıldıgın yerde pm at.