Limitation du nombre de logiciels par page (script php)

  • Auteur de la discussion Auteur de la discussion trustno1
  • Date de début Date de début
WRInaute occasionnel
Bonjour,
je cherche à Limiter le nombre de logiciels par page sur :
http://boujdourweb.online.fr/logitheque ... php3?cat=1

voici le code de la page :

Code:
<? include("conf.inc.php3"); ?>

<html>
<head>
<title>.:: LOGITHEQUE ::.</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style>
<!--
a{text-decoration=none}
a:hover{text-decoration=underline; color: <? echo $hlink ?>}
-->
</style>

</head>

<body bgcolor="#FFFFFF" text="#000000" link="<? echo $link ?>" vlink="<? echo $vlink ?>" 

alink="<? echo $alink ?>">
<p align="center"><b><font color="#336699" size="6" face="Arial, Helvetica, sans-

serif">LOGITHEQUE</font></b></p>
<table width="444" border="0" cellpadding="0" cellspacing="0" align="center">
  <tr> 
    <td width="444" height="138" valign="top"> 
      <p align="center"><font face="Arial, Helvetica, sans-serif" size="2"> 

<?

	if($cat=="nul"):
	echo("<b><font size=3 face=arial color=#000000>Recherche dans toutes les 

catégories</font></b>");
	else:
	$mysql_link = mysql_connect($host,$login,$pass);
	mysql_select_db($base, $mysql_link);
	$query = "select * from $table_categories where NB='$cat'";
	$resultat = mysql_query($query, $mysql_link);
	
		while($row = mysql_fetch_row($resultat)) {
		$categorie = $row[1];
		}

	echo("<b><font size=3 face=arial color=#000000>$categorie</font></b>");
	endif;  
	
?>
        <br>
        <a href="index.php3"><font size="1">Liste des cat&eacute;gories</font></a></font></p>
      <p align="center"><font face="Arial, Helvetica, sans-serif" size="2">Vous 
        pouvez choisir de trier les informations par <a href="details_cat.php3?tri=nom&cat=<? 

echo $cat ?>">nom</a>, 
        ou par <a href="details_cat.php3?tri=date&cat=<? echo $cat ?>">date</a>. Vous 
        pouvez &eacute;galement effectuer une recherche&nbsp;:</font></p>
      <form name="form1" method="post" action="details_cat.php3?cat=<? echo $cat ?>">
        <div align="center">
          <p> 
            <input type="text" name="recherche">
            <input type="submit" name="submit" value="Rechercher">
            <input type="hidden" name="posted" value="1">
          </p>
        </div>
      </form>
          </td>
    </tr>
</table>


<?
  
include "compteurdl.php3";

$mysql_link = mysql_connect($host,$login,$pass);
mysql_select_db($base, $mysql_link);
	if (($tri == 'nom') && ($cat!=nul)):
	$query = "select * from $table where cat='$cat' order by 'nom'";
	$resultat = mysql_query($query, $mysql_link);
	elseif (($tri == 'nom') && ($cat==nul)):
	$query = "select * from $table order by 'nom'";
	$resultat = mysql_query($query, $mysql_link);
	elseif (($tri == 'date') && ($cat!=nul)):
	$query = "select * from $table where cat='$cat' order by 'dateUS' DESC";
	$resultat = mysql_query($query, $mysql_link);
	elseif (($tri == 'date') && ($cat==nul)):
	$query = "select * from $table order by 'dateUS' DESC";
	$resultat = mysql_query($query, $mysql_link);
	elseif($posted):
		if(!$recherche):
		print("<div align=center><b><font color=red face=Arial size=2>Vous n'avez pas 

saisi de critère de recherche! Veuillez recommencer.</font></b></div>");
		$query = "select * from $table";
		$resultat = mysql_query($query, $mysql_link);
	else:
	$query  = 'SELECT * FROM ';
	$query .= $table;
	$query .= ' WHERE NOM LIKE "%' . $recherche . '%" ';
	$query .= ' ORDER BY NOM';
	$resultat = mysql_query($query, $mysql_link);
	endif;
	else:
	
	if($cat==nul):
	$query = "select * from $table";
	$resultat = mysql_query($query, $mysql_link);
	
	else:
	$query = "select * from $table where cat='$cat'";
	$resultat = mysql_query($query, $mysql_link);
	
	endif;
	
	endif;

$num = mysql_num_rows($resultat);

print("<table width=\"500\" cellspacing=\"0\" align=\"center\">\n");
print("<tr><td height=\"2\" colspan=\"6\" valign=\"top\" bgcolor=\"#ffffff\"><b><font 

color=\"#336699\" face=Arial size=2>");

	if($num==0):
	print("Aucun logiciel n'a été trouvé.");
	elseif($num==1):
	print("$num logiciel trouvé.");
	else:
	print("$num logiciels trouvés.");
	endif;

print("</font></b></td></tr>\n");
print("</table><br>");

	while ($ligne = mysql_fetch_array($resultat)) {
	echo("<table width=500 cellspacing=0 align=center>");
	print("<tr><td height=\"2\" colspan=\"6\" valign=\"top\" bgcolor=\"#336699

\"></td></tr>\n");
	print("<tr><td bgcolor=#cccccc>");
	printf("<img src='images/fleche.gif'><font color=white size=2 face=Arial>&nbsp;&nbsp;<a 

href='description.php3?id=%s&cat=%s'><b>%s v. %s</b></a></font>\n",
	$ligne["ID"], $ligne["cat"], $ligne["nom"], $ligne["version"]);
	
		if($ligne["langue"] == "français"):
		echo("&nbsp;&nbsp;<img src=images/france.gif align='middle'>");
		endif;

	print("</td><td align=right bgcolor=#cccccc>");
	$aujourdhui = date("z");
	$ajoute = $ligne["ajoute"];
	if(($aujourdhui-$ajoute)<='14'):
	echo("<b><font color=red size=1 face=verdana>Nouveau!&nbsp;&nbsp;&nbsp;</font></b>");
	endif;

	printf("<font color=black face=Arial size=2>Ajouté le %s</font></td></tr>\n",
	$ligne["dateFR"]);
	print("<tr><td bgcolor=#eeeeee colspan='2'>");
	printf("<font color=black size=2 face=verdana>%s...</font></td></tr>\n",
	substr($ligne["description"], 0, 70));
	printf("<tr><td bgcolor=white colspan=2><font color=#666666 size=2 face=arial>Taille: 

%s &nbsp;&nbsp; os: %s &nbsp;&nbsp; Licence: %s</font></td>\n",
	$ligne["taille"], $ligne["os"], $ligne["licence"]);
	printf("<tr><td bgcolor=white colspan=2><font color=#666666 size=2 face=arial><img 

src='images/tele_xfois.gif' border=0 align='absbottom'>\n",
	$ligne['ID'], $ligne['ID']);
	nbdl($ligne['ID']);
	echo(" (dernier le ");
	lastdl($ligne['ID']);
	echo(")");
	print("<tr><td height=\"2\" colspan=\"6\" valign=\"top\" bgcolor=\"#336699

\"></td></tr>\n");
	print("</font></td></tr><tr><td bgcolor=white>&nbsp;</td></tr>\n");
	echo("</table>");

	}

?>

</BODY>
</HTML>

Merci bcp
 
WRInaute impliqué
Salut,

J'ai pas eu le courage de lire tout ton code source, mais as tu pensé à ajouter un LIMIT 10 à ta requete SQL ?

Par exemple :

Code:
$query = "select * from $table_categories where NB='$cat' LIMIT 10";

Qui selectionnera uniquement les 10 premiers resultats correspondant à ta recherche.
 
WRInaute discret
Avec ca tu te retrouves avec la variable PAGE
Code:
$nb_item_page = 10;
if (empty($page)) $page = 1;
$debut = ($page - 1) * $nb_item_page;
$query = "select * from $table_categories where NB='$cat' LIMIT $debut,$nb_item_page;

$sql_nb_item = "SELECT id from $table_categories where NB='$cat'";
$req_nb_item = mysql_query($sql_nb_item);
$nb_item = mysql_num_rows($req_nb_item);
$nb_page = ceil($nb_item / $nb_item_page); //Nombre de page
 
WRInaute discret
Le code pour la pagination doit ressembler à ca pour faire simple:

Code:
for ($p=1;$p<$nb_page;$p++)
{
echo "<a href=\"http://www.example.org/index.php?page=".$p."\">$p </a>\n";
}
 
WRInaute discret
Je ne garantie rien...
Code:
<? include("conf.inc.php3"); ?> 

<html> 
<head> 
<title>.:: LOGITHEQUE ::.</title> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 

<style> 
<!-- 
a{text-decoration=none} 
a:hover{text-decoration=underline; color: <? echo $hlink ?>} 
--> 
</style> 

</head> 

<body bgcolor="#FFFFFF" text="#000000" link="<? echo $link ?>" vlink="<? echo $vlink ?>" 

alink="<? echo $alink ?>"> 
<p align="center"><b><font color="#336699" size="6" face="Arial, Helvetica, sans- 

serif">LOGITHEQUE</font></b></p> 
<table width="444" border="0" cellpadding="0" cellspacing="0" align="center"> 
  <tr> 
    <td width="444" height="138" valign="top"> 
      <p align="center"><font face="Arial, Helvetica, sans-serif" size="2"> 

<? 

   if($cat=="nul"): 
   echo("<b><font size=3 face=arial color=#000000>Recherche dans toutes les 

catégories</font></b>"); 
   else: 
   $mysql_link = mysql_connect($host,$login,$pass); 
   mysql_select_db($base, $mysql_link); 
   $query = "select * from $table_categories where NB='$cat'"; 
   $resultat = mysql_query($query, $mysql_link); 
    
      while($row = mysql_fetch_row($resultat)) { 
      $categorie = $row[1]; 
      } 

   echo("<b><font size=3 face=arial color=#000000>$categorie</font></b>"); 
   endif;  
    
?> 
        <br> 
        <a href="index.php3"><font size="1">Liste des catégories</font></a></font></p> 
      <p align="center"><font face="Arial, Helvetica, sans-serif" size="2">Vous 
        pouvez choisir de trier les informations par <a href="details_cat.php3?tri=nom&cat=<? 

echo $cat ?>">nom</a>, 
        ou par <a href="details_cat.php3?tri=date&cat=<? echo $cat ?>">date</a>. Vous 
        pouvez également effectuer une recherche&nbsp;:</font></p> 
      <form name="form1" method="post" action="details_cat.php3?cat=<? echo $cat ?>"> 
        <div align="center"> 
          <p> 
            <input type="text" name="recherche"> 
            <input type="submit" name="submit" value="Rechercher"> 
            <input type="hidden" name="posted" value="1"> 
          </p> 
        </div> 
      </form> 
          </td> 
    </tr> 
</table> 


<? 
$nb_item_page = 10; 
if (empty($page)) $page = 1; 
$debut = ($page - 1) * $nb_item_page; 

include "compteurdl.php3"; 

$mysql_link = mysql_connect($host,$login,$pass); 
mysql_select_db($base, $mysql_link); 

   if (($tri == 'nom') && ($cat!=nul)): 
   $query = "select * from $table where cat='$cat' order by 'nom' LIMIT $debut,$nb_item_page"; 
   $query2 = "select * from $table where cat='$cat' order by 'nom'"; 
   $resultat = mysql_query($query, $mysql_link); 
   $resultat2 = mysql_query($query2, $mysql_link); 
   elseif (($tri == 'nom') && ($cat==nul)): 
   $query = "select * from $table order by 'nom' LIMIT $debut,$nb_item_page"; 
   $query2 = "select * from $table order by 'nom'"; 
   $resultat = mysql_query($query, $mysql_link); 
   $resultat2 = mysql_query($query2, $mysql_link); 
   elseif (($tri == 'date') && ($cat!=nul)): 
   $query = "select * from $table where cat='$cat' order by 'dateUS' DESC LIMIT $debut,$nb_item_page"; 
   $query2 = "select * from $table where cat='$cat' order by 'dateUS' DESC"; 
   $resultat = mysql_query($query, $mysql_link);
   $resultat2 = mysql_query($query2, $mysql_link); 
   elseif (($tri == 'date') && ($cat==nul)): 
   $query = "select * from $table order by 'dateUS' DESC LIMIT $debut,$nb_item_page"; 
   $query2 = "select * from $table order by 'dateUS' DESC"; 
   $resultat = mysql_query($query, $mysql_link); 
   $resultat2 = mysql_query($query2, $mysql_link); 
   elseif($posted): 
      if(!$recherche): 
      print("<div align=center><b><font color=red face=Arial size=2>Vous n'avez pas 

saisi de critère de recherche! Veuillez recommencer.</font></b></div>"); 
      $query = "select * from $table"; 
      $resultat = mysql_query($query, $mysql_link); 
   else: 
   $query  = 'SELECT * FROM '; 
   $query .= $table; 
   $query .= ' WHERE NOM LIKE "%' . $recherche . '%" '; 
   $query .= ' ORDER BY NOM'; 
   $resultat = mysql_query($query, $mysql_link); 
   endif; 
   else: 
    
   if($cat==nul): 
   $query = "select * from $table"; 
   $resultat = mysql_query($query, $mysql_link); 
    
   else: 
   $query = "select * from $table where cat='$cat'"; 
   $resultat = mysql_query($query, $mysql_link); 
    
   endif; 
    
   endif; 

$num = mysql_num_rows($resultat); 

$nb_item = mysql_num_rows($resultat2); 
$nb_page = ceil($nb_item / $nb_item_page); //Nombre de page 

print("<table width=\"500\" cellspacing=\"0\" align=\"center\">\n"); 
print("<tr><td height=\"2\" colspan=\"6\" valign=\"top\" bgcolor=\"#ffffff\"><b><font 

color=\"#336699\" face=Arial size=2>"); 

   if($num==0): 
   print("Aucun logiciel n'a été trouvé."); 
   elseif($num==1): 
   print("$num logiciel trouvé."); 
   else: 
   print("$num logiciels trouvés."); 
   endif; 

print("</font></b></td></tr>\n"); 
print("</table><br>"); 

   while ($ligne = mysql_fetch_array($resultat)) { 
   echo("<table width=500 cellspacing=0 align=center>"); 
   print("<tr><td height=\"2\" colspan=\"6\" valign=\"top\" bgcolor=\"#336699 

\"></td></tr>\n"); 
   print("<tr><td bgcolor=#cccccc>"); 
   printf("<img src='images/fleche.gif'><font color=white size=2 face=Arial>&nbsp;&nbsp;<a 

href='description.php3?id=%s&cat=%s'><b>%s v. %s</b></a></font>\n", 
   $ligne["ID"], $ligne["cat"], $ligne["nom"], $ligne["version"]); 
    
      if($ligne["langue"] == "français"): 
      echo("&nbsp;&nbsp;<img src=images/france.gif align='middle'>"); 
      endif; 

   print("</td><td align=right bgcolor=#cccccc>"); 
   $aujourdhui = date("z"); 
   $ajoute = $ligne["ajoute"]; 
   if(($aujourdhui-$ajoute)<='14'): 
   echo("<b><font color=red size=1 face=verdana>Nouveau!&nbsp;&nbsp;&nbsp;</font></b>"); 
   endif; 

   printf("<font color=black face=Arial size=2>Ajouté le %s</font></td></tr>\n", 
   $ligne["dateFR"]); 
   print("<tr><td bgcolor=#eeeeee colspan='2'>"); 
   printf("<font color=black size=2 face=verdana>%s...</font></td></tr>\n", 
   substr($ligne["description"], 0, 70)); 
   printf("<tr><td bgcolor=white colspan=2><font color=#666666 size=2 face=arial>Taille: 

%s &nbsp;&nbsp; os: %s &nbsp;&nbsp; Licence: %s</font></td>\n", 
   $ligne["taille"], $ligne["os"], $ligne["licence"]); 
   printf("<tr><td bgcolor=white colspan=2><font color=#666666 size=2 face=arial><img 

src='images/tele_xfois.gif' border=0 align='absbottom'>\n", 
   $ligne['ID'], $ligne['ID']); 
   nbdl($ligne['ID']); 
   echo(" (dernier le "); 
   lastdl($ligne['ID']); 
   echo(")"); 
   print("<tr><td height=\"2\" colspan=\"6\" valign=\"top\" bgcolor=\"#336699 

\"></td></tr>\n"); 
   print("</font></td></tr><tr><td bgcolor=white>&nbsp;</td></tr>\n"); 
   echo("</table>"); 

   } 
for ($p=1;$p<$nb_page;$p++) 
{ 
echo "<a href=\"http://boujdourweb.online.fr/logitheque/details_cat.php3?cat=$cat&page=".$p."\">$p </a>\n"; 
}
?> 
</BODY> 
</HTML>
 
WRInaute occasionnel
merci pour tout.

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in details_cat.php3 on line 130

erreur
 
WRInaute discret
Remplace

Code:
   else: 
   $query = "select * from $table where cat='$cat'"; 
   $resultat = mysql_query($query, $mysql_link); 
    
   endif; 
    
   endif; 

$num = mysql_num_rows($resultat);

par

Code:
   else: 
   $query = "select * from $table where cat='$cat' LIMIT $debut,$nb_item_page"; 
   $query2 = "select * from $table where cat='$cat'";
   $resultat = mysql_query($query, $mysql_link); 
   $resultat2 = mysql_query($query2, $mysql_link); 
    
   endif; 
    
   endif; 

$num = @mysql_num_rows($resultat);
 
WRInaute occasionnel
merci ca marche la pagination.
mais le seul probleme c'est quand par exemple j'ai 25 logiciels, je vois s'afficher page 1 et page 2 avec 10 logiciels chacune. mais pas la page 3 qui doit afficher les 5 autres.
 
WRInaute discret
Bon tu as de la chance, j'ai tout revu le code de mon coté est tu devrais en etre content et il résoud le probleme de la pagination et des pages doublons (effacement de la variables $page quand elle est egal à 1)
Code:
<? include("conf.inc.php3"); ?> 

<html> 
<head> 
<title>.:: LOGITHEQUE ::.</title> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 

<style> 
<!-- 
a{text-decoration=none} 
a:hover{text-decoration=underline; color: <? echo $hlink ?>} 
--> 
</style> 

</head> 

<body bgcolor="#FFFFFF" text="#000000" link="<? echo $link ?>" vlink="<? echo $vlink ?>" 

alink="<? echo $alink ?>"> 
<p align="center"><b><font color="#336699" size="6" face="Arial, Helvetica, sans- 

serif">LOGITHEQUE</font></b></p> 
<table width="444" border="0" cellpadding="0" cellspacing="0" align="center"> 
  <tr> 
    <td width="444" height="138" valign="top"> 
      <p align="center"><font face="Arial, Helvetica, sans-serif" size="2"> 

<? 

   if($cat=="nul"): 
   echo("<b><font size=3 face=arial color=#000000>Recherche dans toutes les 

catégories</font></b>"); 
   else: 
   $mysql_link = mysql_connect($host,$login,$pass); 
   mysql_select_db($base, $mysql_link); 
   $query = "select * from $table_categories where NB='$cat'"; 
   $resultat = mysql_query($query, $mysql_link); 
    
      while($row = mysql_fetch_row($resultat)) { 
      $categorie = $row[1]; 
      } 

   echo("<b><font size=3 face=arial color=#000000>$categorie</font></b>"); 
   endif;  
    
?> 
        <br> 
        <a href="index.php3"><font size="1">Liste des catégories</font></a></font></p> 
      <p align="center"><font face="Arial, Helvetica, sans-serif" size="2">Vous 
        pouvez choisir de trier les informations par <a href="details_cat.php3?tri=nom&cat=<? 

echo $cat ?>">nom</a>, 
        ou par <a href="details_cat.php3?tri=date&cat=<? echo $cat ?>">date</a>. Vous 
        pouvez également effectuer une recherche&nbsp;:</font></p> 
      <form name="form1" method="post" action="details_cat.php3?cat=<? echo $cat ?>"> 
        <div align="center"> 
          <p> 
            <input type="text" name="recherche"> 
            <input type="submit" name="submit" value="Rechercher"> 
            <input type="hidden" name="posted" value="1"> 
          </p> 
        </div> 
      </form> 
          </td> 
    </tr> 
</table> 


<? 
$nb_item_page = 10; 
if (empty($page)) $page = 1; 
$debut = ($page - 1) * $nb_item_page; 

include "compteurdl.php3"; 

$mysql_link = mysql_connect($host,$login,$pass); 
mysql_select_db($base, $mysql_link); 

   if (($tri == 'nom') && ($cat!=nul)): 
   $query = "select * from $table where cat='$cat' order by 'nom' LIMIT $debut,$nb_item_page"; 
   $query2 = "select ID from $table where cat='$cat' order by 'nom'"; 
   $resultat = mysql_query($query, $mysql_link); 
   $resultat2 = mysql_query($query2, $mysql_link);
   elseif (($tri == 'nom') && ($cat==nul)): 
   $query = "select * from $table order by 'nom' LIMIT $debut,$nb_item_page"; 
   $query2 = "select ID from $table order by 'nom'"; 
   $resultat = mysql_query($query, $mysql_link); 
   $resultat2 = mysql_query($query2, $mysql_link); 
   elseif (($tri == 'date') && ($cat!=nul)): 
   $query = "select * from $table where cat='$cat' order by 'dateUS' DESC LIMIT $debut,$nb_item_page"; 
   $query2 = "select ID from $table where cat='$cat' order by 'dateUS' DESC"; 
   $resultat = mysql_query($query, $mysql_link);
   $resultat2 = mysql_query($query2, $mysql_link); 
   elseif (($tri == 'date') && ($cat==nul)): 
   $query = "select * from $table order by 'dateUS' DESC LIMIT $debut,$nb_item_page"; 
   $query2 = "select ID from $table order by 'dateUS' DESC"; 
   $resultat = mysql_query($query, $mysql_link); 
   $resultat2 = mysql_query($query2, $mysql_link); 
   elseif($posted): 
      if(!$recherche): 
      print("<div align=center><b><font color=red face=Arial size=2>Vous n'avez pas 

saisi de critère de recherche! Veuillez recommencer.</font></b></div>"); 
      $query = "select * from $table"; 
      $resultat = mysql_query($query, $mysql_link); 
   else: 
   $query  = 'SELECT * FROM '; 
   $query .= $table; 
   $query .= ' WHERE NOM LIKE "%' . $recherche . '%" '; 
   $query .= ' ORDER BY NOM  LIMIT '.$debut.','.$nb_item_page; 
   $query2  = 'SELECT ID FROM '; 
   $query2 .= $table; 
   $query2 .= ' WHERE NOM LIKE "%' . $recherche . '%" '; 
   $query2 .= ' ORDER BY NOM'; 
   $resultat = mysql_query($query, $mysql_link);
   $resultat2 = mysql_query($query2, $mysql_link); 
   endif; 
   else: 
    
   if($cat==nul): 
   $query = "select * from $table LIMIT $debut,$nb_item_page"; 
   $query2 = "select * from $table"; 
   $resultat = mysql_query($query, $mysql_link); 
   $resultat2 = mysql_query($query2, $mysql_link); 
    
   else: 
   $query = "select * from $table where cat='$cat' LIMIT $debut,$nb_item_page"; 
   $query2 = "select * from $table where cat='$cat'";
   $resultat = mysql_query($query, $mysql_link); 
   $resultat2 = mysql_query($query2, $mysql_link); 
    
   endif; 
    
   endif; 

$num = @mysql_num_rows($resultat); 

$nb_item = mysql_num_rows($resultat2); 
$nb_page = ceil($nb_item / $nb_item_page); //Nombre de page 

print("<table width=\"500\" cellspacing=\"0\" align=\"center\">\n"); 
print("<tr><td height=\"2\" colspan=\"6\" valign=\"top\" bgcolor=\"#ffffff\"><b><font 

color=\"#336699\" face=Arial size=2>"); 

   if($num==0): 
   print("Aucun logiciel n'a été trouvé."); 
   elseif($num==1): 
   print("$num logiciel trouvé."); 
   else: 
   print("$num logiciels trouvés."); 
   endif; 

print("</font></b></td></tr>\n"); 
print("</table><br>"); 

   while ($ligne = mysql_fetch_array($resultat)) { 
   echo("<table width=500 cellspacing=0 align=center>"); 
   print("<tr><td height=\"2\" colspan=\"6\" valign=\"top\" bgcolor=\"#336699 

\"></td></tr>\n"); 
   print("<tr><td bgcolor=#cccccc>"); 
   printf("<img src='images/fleche.gif'><font color=white size=2 face=Arial>&nbsp;&nbsp;<a 

href='description.php3?id=%s&cat=%s'><b>%s v. %s</b></a></font>\n", 
   $ligne["ID"], $ligne["cat"], $ligne["nom"], $ligne["version"]); 
    
      if($ligne["langue"] == "français"): 
      echo("&nbsp;&nbsp;<img src=images/france.gif align='middle'>"); 
      endif; 

   print("</td><td align=right bgcolor=#cccccc>"); 
   $aujourdhui = date("z"); 
   $ajoute = $ligne["ajoute"]; 
   if(($aujourdhui-$ajoute)<='14'): 
   echo("<b><font color=red size=1 face=verdana>Nouveau!&nbsp;&nbsp;&nbsp;</font></b>"); 
   endif; 

   printf("<font color=black face=Arial size=2>Ajouté le %s</font></td></tr>\n", 
   $ligne["dateFR"]); 
   print("<tr><td bgcolor=#eeeeee colspan='2'>"); 
   printf("<font color=black size=2 face=verdana>%s...</font></td></tr>\n", 
   substr($ligne["description"], 0, 70)); 
   printf("<tr><td bgcolor=white colspan=2><font color=#666666 size=2 face=arial>Taille: 

%s &nbsp;&nbsp; os: %s &nbsp;&nbsp; Licence: %s</font></td>\n", 
   $ligne["taille"], $ligne["os"], $ligne["licence"]); 
   printf("<tr><td bgcolor=white colspan=2><font color=#666666 size=2 face=arial><img 

src='images/tele_xfois.gif' border=0 align='absbottom'>\n", 
   $ligne['ID'], $ligne['ID']); 
   nbdl($ligne['ID']); 
   echo(" (dernier le "); 
   lastdl($ligne['ID']); 
   echo(")"); 
   print("<tr><td height=\"2\" colspan=\"6\" valign=\"top\" bgcolor=\"#336699 

\"></td></tr>\n"); 
   print("</font></td></tr><tr><td bgcolor=white>&nbsp;</td></tr>\n"); 
   echo("</table>"); 

   }
$url_parsee = @parse_url($_SERVER["REQUEST_URI"]);

if (!empty($url_parsee["query"]))
parse_str($url_parsee["query"],$tab);
$cat = "cat=".$cat;
if(!empty($tri))
$tri = "tri=".$tri."&";
for ($p=1;$p<$nb_page+1;$p++) 
{ 
if ($p==1)
echo "<a href=\"details_cat.php3?".$tri.$cat."\">$p </a>\n";
else
echo "<a href=\"details_cat.php3?".$tri.$cat."&page=".$p."\">$p </a>\n"; 
}
?> 
</BODY> 
</HTML>
 
Discussions similaires
Haut