8 downloads pr. side!
HejHvordan laver jeg sådan at jeg har 8 downloads pr. side.
Og der hvor man skifter side skal se sådan ud "Forrige 1 Næste"
Hvis nu vi siger der er en kategori der er 14 i som hedder "Virus Scanner" skal den vise "Forrige 1 2 Næste" Men så hvis vi har "Lyd" og der kun er 2 i den skal den kun vise "Forrige 1 Næste".
HVordan gør man det?
Download script ser sådan ud:
<?php
include_once('inc.config.php');
mysql_connect($cfg['mysql']['host'],$cfg['mysql']['username'],$cfg['mysql']['password']);
mysql_select_db($cfg['mysql']['database']);
?>
<br>
<table border="0" width="600" align="center" valign="top">
<tr>
<td>
<table cellpadding="0" cellspacing="0" valign="top"style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000;">
<tr>
<td height="20" width="600" bgcolor="C1C3CB">
<b><font color="#FFFFFF">- Downloads</font></b></td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000;">
<tr>
<td width="3"> </td>
<td width="597">
<b>Vælg Kategori</b><br><?
include("dbconnect.php");
$query = mysql_query("SELECT * FROM kajbi_download_categori") or die(mysql_error());
while ($row = mysql_fetch_assoc($query)) {
echo '- <a href="?side=download/index&kat='.$row['cate_id'].'"><U>'.$row['navn'].'</u></a> ';
}
?>
</center>
<br></tr>
</table>
</td>
</tr>
</table>
<br>
<?
if ($kat) {
$result = mysql_query("select * from kajbi_download where cate_id like '%$kat%' ORDER BY id DESC LIMIT 100");
$number = mysql_num_rows($result);
while ($row = mysql_fetch_array($result)) {
?>
<table border="0" width="600" align="center" valign="top">
<tr>
<td>
<table cellpadding="0" cellspacing="0" valign="top"style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000;">
<tr>
<td height="20" width="600" bgcolor="C1C3CB">
<b><font color="#FFFFFF"><? echo '<a href="?side=download/downloads.display&id='.$row['id'].'">- '.$row['title'].'</a> - Tilføjet af <a href="?side=logind/profil&login_username='.$row['author'].'"><u>'.$row['author'].'</u></a>'; ?></font></b></td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000;">
<tr>
<td width="3"> </td>
<td width="597">
<?
echo empty($row['image']) ? '' : '<a href="?side=download/downloads.display&id='.$row['id'].'"><img src="context/logind/download/files/'.$row['image'].'" class="input" align="left" width="125" height="100" border="0"></a>';
echo substr($row[text], 0, 225);
?>
</tr>
</table>
</td>
</tr>
</table>
<br>
<?
}
}
?>
