1: Oyunların eklenme tarihlerini göstermek istedim aşagıdaki kodları denedim olmadı.Oyunların eklenme tarihlerini nasıl gösterebilirim acaba.
<b>Eklenme Tarihi:</b> <?php echo $cdate; ?>
<b>Eklenme Tarihi:</b> <?php echo $dateadded; ?>
2: Aşagıdaki kodla 5 tane rastgele oyunun resmi alt alta sıralanıyor bu kodu nasıl düzenlersek yanyana 5 tane oyun resmini sıralayabiliriz.
// Display related files
function relatedfiles($filecategory,$fileId) {
global $siteurl, $maxrelatedfiles;
$result = mysql_query("SELECT fileid, title, description, icon, iconlocation, timesplayed FROM files WHERE category = '$filecategory' && status ='1' && fileid != '$fileId'
ORDER BY RAND() LIMIT $maxrelatedfiles");
while($row = mysql_fetch_array($result)) {
$rfileId = $row['fileid'];
$rfileTitle = $row['title'];
$rfileDescription = $row['description'];
$rfileIcon = $row['icon'];
$riconLocation = $row['iconlocation'];
$rtimesPlayed = number_format($row['timesplayed']);
if ($riconLocation == '1') {
$rimageUrl = $siteurl."/files/image/".$rfileIcon;
} else {
$rimageUrl = $rfileIcon;
}
if (strlen($rfileDescription) > '80') {
$rfileDescription = substr("$rfileDescription",0,77)."...";
}
?>
<tr>
<td width="71">
<a href="<?php echo fileurl($rfileId,$rfileTitle); ?>" target="_self"><img src="<?php echo $rimageUrl; ?>" width="70" height="59" title="<?php echo $rfileTitle; ?>"
alt="<?php echo $rfileTitle; ?>" border="0"></a>
</td>
</tr>
<?php
}
}
$sitename2 = $sitename." - ".$fileTitle;
$sitedescription = $filedescription;
$sitekeywords = $sitekeywords.", ".$filekeywords;
Onarcade php yardım
4
●354
- 20-10-2010, 23:01:391- öncelikle sorgunun yapıldığı yere select içinde dateadded eklemeniz dahasonra $tarih=$row['dateadded']; gibi okutup sonra yazdırabilirsiniz.
2-function relatedfiles($filecategory,$fileId) { global $siteurl, $maxrelatedfiles; $result = mysql_query("SELECT fileid, title, description, icon, iconlocation, timesplayed FROM files WHERE category = '$filecategory' && status ='1' && fileid != '$fileId' ORDER BY RAND() LIMIT $maxrelatedfiles");?><tr><?php while($row = mysql_fetch_array($result)) { $rfileId = $row['fileid']; $rfileTitle = $row['title']; $rfileDescription = $row['description']; $rfileIcon = $row['icon']; $riconLocation = $row['iconlocation']; $rtimesPlayed = number_format($row['timesplayed']); if ($riconLocation == '1') { $rimageUrl = $siteurl."/files/image/".$rfileIcon; } else { $rimageUrl = $rfileIcon; } if (strlen($rfileDescription) > '80') { $rfileDescription = substr("$rfileDescription",0,77)."..."; } ?> <td width="71"> <a href="<?php echo fileurl($rfileId,$rfileTitle); ?>" target="_self"><img src="<?php echo $rimageUrl; ?>" width="70" height="59" title="<?php echo $rfileTitle; ?>" alt="<?php echo $rfileTitle; ?>" border="0"></a> </td> <?php } ?></tr> <?php } $sitename2 = $sitename." - ".$fileTitle; $sitedescription = $filedescription; $sitekeywords = $sitekeywords.", ".$filekeywords;kolay gelsin... - 21-10-2010, 00:03:17Hocam çok teşekkürler ederim.Sayenizde uzun zamandır yapmaya çalıştıgım işlemi tamamlamış oldum.Sizden bir ricam daha olacak kusura bakmazsanız.
Bu yukardaki kodlarda 5 tane resim yayınlayabiliyorum bu sayıyı nasıl arttırabilirim acaba.Yukardaki kod oyunun bulundugu katogoriden rastgele 5 oyun seçip gösteriyor bunu sadece o katogoriden degilde genelden rastgele göstermesini nasıl saglayabiliriz aşagıdaki kodlar genelden random gösteriyor ama altalta gösteriyor.
Ayrıca birde aşagıdaki kodlarda aynı dertten muzdaripim yani burdaki resimleri de yanyana dizmeme yardımcı olursanız minnettar kalacagım.
//Rastgele Oyunlar Cekiliyor. By-NeLph.
function rastgele($sayi=12)
{
$result = mysql_query("SELECT title, fileid, icon, iconlocation, timesplayed FROM files WHERE status = '1' ORDER BY rand() DESC LIMIT $sayi");
if (mysql_num_rows($result)) {
while($row = mysql_fetch_array($result)) {
$rfiletitle = $row['title'];
$rfileid = $row['fileid'];
$rtimesplayed = number_format($row['timesplayed']);
$rfileicon = $row['icon'];
$riconlocation = $row['iconlocation'];
if ($riconlocation == '1') {
$imageurl = $siteurl."/files/image/".$rfileicon;
} else {
$imageurl = $rfileicon;
}
?>
<div class="rastgele">
<a href="<?php echo fileurl($rfileid,$rfiletitle); ?>"><img src="<?php echo $imageurl; ?>" width="98" height="84" alt="<?php echo $rfiletitle; ?>" style="border:0px;" /><br /><?php echo $rfiletitle; ?></a>
</div>
<?php
}
} else {
echo "Sitede Henuz Dosya Yok.";
} - 21-10-2010, 12:05:32
function rastgele($sayi=10){ global $siteurl; $result = mysql_query("SELECT fileid, title, description, icon, iconlocation, timesplayed FROM files WHERE status ='1' ORDER BY RAND() LIMIT $sayi");?><tr><?php while($row = mysql_fetch_array($result)) { $rfileId = $row['fileid']; $rfileTitle = $row['title']; $rfileDescription = $row['description']; $rfileIcon = $row['icon']; $riconLocation = $row['iconlocation']; $rtimesPlayed = number_format($row['timesplayed']); if ($riconLocation == '1') { $rimageUrl = $siteurl."/files/image/".$rfileIcon; } else { $rimageUrl = $rfileIcon; } if (strlen($rfileDescription) > '80') { $rfileDescription = substr("$rfileDescription",0,77)."..."; } ?> <td width="71"> <a href="<?php echo fileurl($rfileId,$rfileTitle); ?>" target="_self"><img src="<?php echo $rimageUrl; ?>" width="70" height="59" title="<?php echo $rfileTitle; ?>" alt="<?php echo $rfileTitle; ?>" border="0"></a> </td> <?php } ?></tr> <?php }fonksiyonu çağırırken rastgele(5); 5 yerine göstermek istedeğin sayıyı yazman yeterli