Pages vues depuis 25/05/2001 : 109 490 045
Index du forum »» Le coin des codeurs »» [Résolu] - function+while
function mafunction ($username){
/////Puis j'ai while avec un tableau qui utilise "$username/////
$query = mysql_query("select * from ".$NPDS where username='$username'....while (list.....
}//je ferme le while
/////Mais après j'ai besoin pour un lien de $username et là il ne s'affiche plus à cause du while je pense
echo "$username";
}
function listpalindromeauteur($username) {global $ModPath, $ModStart, $NPDS_Prefix, $ThisFile; menuprincipal();
Opentable();
$rowcolor=tablos();
//Pour la naviguation
Global $start;
!include!("modules/palindrome/pal_conf.php");
if (empty($start)) { $start = 0; }
//Total pour naviguation
$result = mysql_query("select count(*) from palindrome where username='$username'");
$nbsites=0; if ($result) { $nbsites = mysql_result($result,0); }
echo "<table width=\"80%\" align=\"center\">\n";
echo "<tr align=\"center\" $rowcolor>\n";
echo "<td class=\"titre\" colspan=\"5\">".palindrome_trad("Palindrome de ")."$username</td>\n";
echo "</tr>\n";
echo "<tr align=\"center\" $rowcolor>\n";
echo "<td width=\"10%\">".palindrome_trad("Membre")."</td>\n";
echo "<td width=\"60%\">".palindrome_trad("Phrase")."</td>\n";
echo "<td width=\"10%\">".palindrome_trad("Statut")."</td>\n";
echo "<td width=\"5%\">".palindrome_trad("Editer")."</td>\n";
echo "<td width=\"10%\">".palindrome_trad("Supprimer")."</td>\n";
echo "</tr>\n";
$query = mysql_query("select * from ".$NPDS_Prefix."palindrome where username='$username' LIMIT ". $start.",".$nb_news."");
while (list($id,$phrase,$username,$en_ligne)=mysql_fetch_array($query)) {
echo "<tr $rowcolor>\n";
echo "<td width=\"10%\" align=\"center\">$username</td>\n";
echo "<td width=\"60%\">$phrase</td>\n";
echo "<td width=\"5%\" align=\"center\">$en_ligne</td>\n";
echo "<td align=\"center\" width=\"5%\"><a href=".$ThisFile."&subop=editpalindromeauteur&id=$id&username=$username><img src=modules/palindrome/images/editer.gif border=\"0\"></a></td>\n";
echo "<td align=\"center\" width=\"10%\"><a href=".$ThisFile."&subop=suppripalauteur&id=$id&username=$username><img src=modules/palindrome/images/delete.gif border=\"0\"></a></td>\n";
echo "</tr>\n"; }
echo "</table>\n";
//Naviguation
echo "<br><table width=\"100%\" cellpadding=\"0\" cellspacing=\"3\" border=\"0\">\n";
echo "<tr>\n";
echo "<td align=\"left\"><span class=\"rouge\">"; $nombre=ceil($nbsites/$nb_news);
echo "".palindrome_trad("Page")." ".(($start/$nb_news)+1)." ".palindrome_trad("sur")." ".$nombre."</span> ";
if($nombre>1) {
for($i=1; $i<=$nombre; $i++) {
$test = (($start/$nb_news)+1);
if ($i==$test) {
echo "[$i] "; } else {
echo "[<a href=\"".$ThisFile."&subop=listpalindromeauteur&username=$username&start=".(($i-1)*$nb_news)."\">$i</a>] ";
}
}
}
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
Closetable();
}