id_friends; $friends_name[] = $row->friends_name; $friends_description[] = $row->friends_description; $friends_url[] = $row->friends_url; $friends_contact[] = $row->friends_contact; $friends_img[] = $row->friends_img; } @mysql_close($db); } // SINON ON RECUPERE TOUTE LA LISTE if (!$type && !$id_friends){ $sql = "SELECT * FROM friends order by id_friends"; $res = mysql_query($sql); while ( $row=mysql_fetch_object($res)) { $friends_name[] = $row->friends_name; $friends_description[] = $row->friends_description; $friends_url[] = $row->friends_url; $friends_contact[] = $row->friends_contact; $friends_img[] = $row->friends_img; $id_friends[] = $row->id_friends; // Petit soucy de nom d'ID donc obliger.. //$smarty -> assign (array("id_friends" => $id)); //$id_friends = $id; } @mysql_close($db); } // Voir la fiche d'un seul membre if ($id_friends && $action==profil) { $sql = "SELECT * FROM friends WHERE '$id_friends' = id_friends OR '$name'=friends_name"; $res = mysql_query($sql); if (mysql_num_rows($res)==0) { $error = "Le profil est introuvable!"; @mysql_close($db); } else { $friends_name = mysql_result ($res,$i,"friends_name"); $friends_description = mysql_result ($res,$i,"friends_description"); $friends_img = mysql_result ($res,$i,"friends_img"); $type = mysql_result ($res,$i,"type"); $friends_url = mysql_result ($res,$i,"friends_url"); $friends_contact = mysql_result ($res,$i,"friends_contact"); $friends_img = mysql_result ($res,$i,"friends_img"); $smarty->assign("type_profil","$type"); $smarty->assign("profil_name","$friends_name"); $smarty->assign("profil_description","$friends_description"); $smarty->assign("profil_url","$friends_url"); $smarty->assign("profil_contact","$friends_contact"); $smarty->assign("profil_img","$friends_img"); } @mysql_close($db); } //DEF DANS LE TEMPLATE $smarty -> assign (array("id_friends" => $id_friends)); $smarty -> assign (array("friends_name" => $friends_name)); $smarty -> assign (array("friends_description" => $friends_description)); $smarty -> assign (array("friends_url" => $friends_url)); $smarty -> assign (array("friends_contact" => $friends_contact)); $smarty -> assign (array("friends_img" => $friends_img)); // VERSION UNIVERSEL POUR LES META TAG DANS LE HEADER $smarty -> assign (array("meta_title" => "Equipage NautiluStudio, $friends_name $friends_type $friends_url")); $smarty -> assign (array("meta_desc" => "$friends_name , $type $friends_description , nautilustudio, $friends_url , Friends, Amis et partenaires du Studio d'enregistrment")); // assignation de la page template $smarty->display('friends.tpl'); ?>