<?
/* ----------------------------------------------------------------------------
V O I R L E S C O M M E N T A I R E S
PHPMyRing (4.0) dernière modification du fichier [12-11-04]
---------------------------------------------------------------------------- */
require('include/config.php');
require('include/fonctions.php');
// Configuration
$conf=config();
InsertLang('',$conf['lang']);
// Si le numéro du site n'est pas défini
if (!$idsite)
{
echo "<p align=\"center\">"._("Erreur! Le n° du site n'est pas défini!")."</p>";
}
else
{
// On va aller chercher le nom du site conserné, ça sera fait ;)
// Connexion MySQL
$conn=connecte();
$row=mysql_fetch_array(requete("SELECT site_nom FROM webring WHERE idsite=$idsite"));
$site_nom=$row['site_nom'];
# pour afficher sur plusieurs pages la liste..
// Si classement ($classe) inféfinie
if (!$classe) { $classe="date"; }
if (!$ordre) { $ordre="ASC"; }
// Si nombre indéfinie
if (!$nombre) { $nombre=$conf['nbre']; }
// Pareil pour limite
if (!$limite) { $limite=0; }
// Limite suivante et celle d'avant
$limitesuivante=$limite+$nombre;
$limiteprecedente=$limite-$nombre;
// pour compter le nombre TOTAl de résultats dans la table...
$rqt="SELECT idsite ".
"FROM webring_com ".
"WHERE idsite='$idsite' ".
"ORDER BY $classe";
$nb=mysql_num_rows(requete($rqt));
// Requète
$rqt="SELECT idcom, auteur, texte, note, date ".
"FROM webring_com ".
"WHERE idsite='$idsite' ".
"ORDER BY '$classe' $ordre ".
"LIMIT $limite,$nombre ";
$res=requete($rqt);
//mysql_close();
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<? echo _("fr"); ?>">
<head>
<title><? echo _("Commentaires du site"). " ".$site_nom; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<? echo ("iso-8859-15"); ?>" />
<link rel="StyleSheet" type="text/css" href="styles.css" />
<!-- Attention, n'enlevez syrtout pas les lignes qui suivent -->
<?
if (!file_exists('styles_perso.css'))
{
echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"styles_perso-dist.css\" />";
}
else
{
echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"styles_perso.css\" />";
}
?>
</head>
<body>
<table width="95%" border="0" cellspacing="0" cellpadding="0" class="table1">
<tr valign="middle" align="center">
<td><a href="<? echo $PHP_SELF; ?>?idsite=<? echo $idsite; ?>&classe=date&ordre=DESC"><? echo _("+ Récent"); ?></a></td>
<td><a href="<? echo $PHP_SELF; ?>?idsite=<? echo $idsite; ?>&classe=date&ordre=ASC"><? echo _("+ Ancien"); ?></a></td>
</tr>
<tr valign="middle" align="center">
<td><a href="<? echo $PHP_SELF; ?>?idsite=<? echo $idsite; ?>&classe=note&ordre=ASC"><? echo _("+ Sympa"); ?></a></td>
<td><a href="<? echo $PHP_SELF; ?>?idsite=<? echo $idsite; ?>&classe=note&ordre=DESC"><? echo _("+ Sévère"); ?></a></td>
</tr>
</table>
<br />
<?
if ($nb)
{
while ($row=mysql_fetch_array($res))
{
$date=$row['date'];
list($an,$mois,$jour)=explode("-",$date);
?>
<table width="95%" border="0" class="table_liste">
<tr>
<td width="86%"><? echo _("Commentaire de"); ?> : <? echo StripSlashes($row['auteur']); ?> (<? echo "$jour-$mois-$an"; ?>)</td>
<td width="14%"><? echo _("Note"); ?> : <? echo $row['note']; ?></td>
</tr>
<tr>
<td colspan="2"><p align="justify"><? echo StripSlashes($row['texte']); ?></p></td>
</tr>
</table>
<br />
<?
// FIN DU WHILE
}
// Fin du if
}
else
{
echo "<pstyle=\"text-align:center;\">"._("Il n'y a pas encore de commentaire pour ce site")."</p>";
}
?>
<table width="95%" border="0" align="center">
<tr>
<td align="left" valign="top">
<?
if ($limite != 0)
{
echo "<a href=\"view_com.php?idsite=$idsite&limite=$limiteprecedente&classe=$classe&ordre=$ordre\" title=\""._("Précédents")."\"><img src=\"images/prec_comm.png\" style=\"border:0px; width=32px; height:32px\" /></a>";
}
?>
</td>
<td valign="top" align="right">
<?
if ($limitesuivante < $nb)
{
echo "<a href=\"view_com.php?idsite=$idsite&limite=$limitesuivante&classe=$classe&ordre=$ordre\" title=\""._("Suivants")."\"><img src=\"images/suite_comm.png\" style=\"border:0px; width:32px; height:32px\" /></a>";
}
?>
</td>
</tr>
<p style="text-align:center;"><a href="add_com.php?idsite=<? echo $idsite; ?>"><? echo _("Ajouter un commentaire"); ?></a></p>
</table>
</body>
</html>