require("pages/site/sql.php");
$table ="ipb_topics"; // Table où sont postés les posts du forum
$idforum = "108"; //ID du forum où sont postées les news
$nbrnews ="50"; //Le nombre de news à afficher (Lien vers les news)
//Obtention de l'id de la dernière news
$sql3 = 'SELECT tid,title,start_date FROM '.$table.' WHERE forum_id = "'.$idforum.'"';
$req3 = mysql_query($sql3) or die('Erreur SQL !
'.$sql3.'
'.mysql_error());
$limite = mysql_num_rows($req3);
$nbr = (isset($_GET['nbr']) ? (int)$_GET['nbr'] : 0);
$sql2 = 'SELECT tid,title,start_date FROM '.$table.' WHERE forum_id = "'.$idforum.'" ORDER BY tid DESC LIMIT '.$nbr.','.$nbrnews.'';
$req2 = mysql_query($sql2) or die('
Erreur SQL');
$nbrn = mysql_num_rows($req2);
$nbrsuivant = $nbr + 50;
$nbrprecedent = $nbr - 50;
echo '
Archives
';
if($nbrprecedent >= 0)
{
echo'
';
}
if($nbrsuivant < $limite)
{
echo'
';
}
echo'
';
while($data = mysql_fetch_assoc($req2))
{
$start_date = $data['start_date'];
$date = date("j/n/y � H:i",$start_date);
$title = $data['title'];
$id = $data['tid'];
echo'- '.$title.'
| '.$date.' |
';
}
echo'
';
if($nbrprecedent >= 0)
{
echo'
';
}
if($nbrsuivant < $limite)
{
echo'
';
}
echo '
';
?>