banlist - řazení
Napsal: 18 bře 2013, 00:54
od Welton123
Zdravím, chci se zeptat, zda se dá nastavit, aby se bany/ipbany atd.. řadily podle datumu - nejnovější vždy nahoře. Jde to? :/
Předem díky.
banlist
Předem díky.
banlist
Spoiler: zobrazit
Kód: Vybrat vše
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<body style="background-color: black; background-image: url(images/bg.jpg); margin: 0 auto; background-position: center top;background-attachment: fixed">
<?php
$dbhost = "lima.fakaheda.eu";
$dbuser = "gs_27653_1";
$dbpass = "heslo MUHAHAHA";
$dbdata = "gs_27653_1";
mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db($dbdata);
$result = mysql_query("SELECT * FROM banlist ORDER BY name DESC");
echo "<table width=100% border=1 cellpadding=1 cellspacing=0>";
echo "<tr style=\"color: gold; text-align: center; font-weight:bold\">
<td>Typ</td>
<td>Nick</td>
<td>Důvod</td>
<td>Admin/Mod</td>
<td>Od kdy ?</td>
<td>Do kdy ?</td>
</tr>";
while($row = mysql_fetch_assoc($result)){
if($row['temptime']==0){$perma=TRUE;}
else{$perma=FALSE;}
if($row['type'] == 0 OR $row['type'] == 9 OR $row['type']== 1){
$cas=time();
$delkatrestu = $row['temptime']-$cas;
if($delkatrestu>0 OR $perma){
if($col == "#eeeeee"){
$col = "#ffffff";
}
else{
$col = "#eeeeee";
}
echo"<tr bgcolor=$col>";
if($row['type']==1){echo'<td><img src="http://weltcraft.eu/eco/bans/images/ipbanicon.png"> |IPban</td>';}
else{
if($row['type']==9){echo'<td><img src="http://weltcraft.eu/eco/bans/images/banicon.png"> |Trvalý ban</td>';}
else{ if($row['type'] == 0){
if($row['temptime'] == 0){
echo'<td><img src="http://weltcraft.eu/eco/bans/images/banicon.png"> |Trvalý ban</td>';
}
else{
echo'<td><img src="http://weltcraft.eu/eco/bans/images/tempbanicon.png"> |Dočasný ban</td>';
}
}}
}
echo"<td>".$row['name']."</td>";
echo"<td>".$row['reason']."</td>";
echo"<td>".$row['admin']."</td>";
$datetime = date("j.n Y, G:i", $row['time']);
echo"<td>$datetime</td>";
$temptime = date("j.n Y, G:i", $row['temptime']);
if($row['temptime'] == 0){
echo"<td>Nikdy</td>";}
else {echo"<td>".$temptime."</td>";}
echo"</tr>";}}}
echo"</table>";
?>
<font color="white"><b>(C) 2013 WeltCraft.</b><br></br></font>
</body>
</html>