
Ana sayfada rastgele oyun(resmi ve ismi dahil) göstermek için ne yapabiliriz.
11
●2.087

//Display Rastgele Oyun
function displayhafta() {
global $maxmostpopular;
$result = mysql_query("SELECT title, icon, rating, iconlocation, fileid, timesplayed FROM files WHERE status = '1' ORDER BY rand() DESC LIMIT 1 ");
if (mysql_num_rows($result)) {
while($row = mysql_fetch_array($result)) {
$mpfiletitle = $row['title'];
$mpfileicon = $row['icon'];
$mpfilerating = $row['rating'];
$mpiconlocation = $row['iconlocation'];
$mpfileid = $row['fileid'];
$mptimesplayed = number_format($row['timesplayed']);
if ($mpiconlocation == '1') {
$mpimageurl = $siteurl."/files/image/".$mpfileicon;
} else {
$mpimageurl = $mpfileicon;
}
?><table width="100%"><tr><td align="center"><br /><b><?php echo $mpfiletitle; ?></b><br /> <a href = "<?php echo fileurl($mpfileid,$mpfiletitle); ?>" target="_self"><img src="<?php echo $mpimageurl; ?>" width="120" height="100" title="<?php echo $mpfiletitle; ?>" alt="<?php echo $mpfiletitle; ?>" border="2" bordercolor="orange"></a><br /> <?php echo $mptimesplayed; ?> kez oyandı. Puanı : <?php echo $mpfilerating; ?></td></tr></table>
<?php
}
} else {
echo "Oyun Bulunamadı";
}
}<div class="contentbox"> <div class="contentheader"> <center>Rastgele Oyun</center> </div> <div class="boxestext"> <?php displayhafta(); ?> </div></div>
//Display most popular files
function rastgeleoyunlar() {
$result = mysql_query("SELECT title,icon,iconlocation,link,timesplayed,description,category FROM files ORDER BY rand() DESC LIMIT 12");
if (mysql_num_rows($result)) {
$fileinrow="1";
while($row = mysql_fetch_array($result)) {
$mpfiletitle = $row['title'];
$mpfileicon = $row['icon'];
$mpiconlocation = $row['iconlocation'];
$mpfilelink = $row['link'];
$mptimesplayed = $row['timesplayed'];
if ($mpiconlocation == '1') {
$imageurl = $siteurl."files/image/".$mpfileicon;
} else {
$imageurl = $mpfileicon;
}
if ($fileinrow == '1') {
echo "<tr>";
}
?>
<?
$mpcategory = $row['category'];
$categoryName = array(
"1" => "Kız Oyunları",
"2" => "Aksiyon Oyunları",
"3" => "Dövüş Oyunları",
"4" => "Macera Oyunları",
"5" => "Spor Oyunları",
"6" => "Zeka Oyunları",
"7" => "Diğer Oyunlar",
"8" => "Casino Oyunları",
"9" => "Barbie Oyunları",
"10" => "Yarış Oyunları",
"11" => "Çocuk Oyunları",
"12" => "Makyaj Oyunlar",
"13" => "Manken Oyunları",
"14" => "Hedef Oyunları",
"15" => "Oda Oyunları",
"16" => "Yemek Oyunları",
"17" => "Bratz Oyunları",
"18" => "Giysi Giydirme Oyunları",
"19" => "Boyama Oyunları",
"20" => "Sue Oyunları",
"21" => "Komik Oyunlar",
"22" => "Bebek Oyunları",
"23" => " Oyunları",
"24" => " Oyunları",
"25" => " Oyunları",
"26" => " Oyunları",
);
?>
<td width="120"><table bgcolor="white" style="border-collapse: collapse" border="0" align="center"><tr><td width="120" height="110" onMouseOver="this.bgColor='#AA002A'" onMouseOut="this.bgColor=''" valign="top" align="center">
<a href="<?php echo fileurl($mpfilelink); ?>" target="_self" class="gamelink"><?php echo $mpfiletitle; ?><br />
<img src="<?php echo $imageurl; ?>" width="100" height="90" title="<?php echo $mpfiletitle; ?>" border="0"></a>
<br />Hit : <?php echo $mptimesplayed; ?>
</td></tr></table></td>
<?php
if ($fileinrow == '6') {
echo "</tr>";
$fileinrow = "0";
}
$fileinrow++;
}
if ($fileinrow == '2') {
echo "<td width=\"120\"></td><td width=\"120\"></td></tr>";
} elseif ($fileinrow == '3') {
echo "<td width=\"120\"></td></tr>";
}
}
}templates/tema/indexpage.html dosyasının içine<div style="border: 2px solid #0E3C60;"> <table bgcolor="white" border="0" cellpadding="0" cellspacing="0" width="100%"><?php rastgeleoyunlar(); ?></table> </div>