",$mots_lies); else $mots_lies=str_replace("!!bouton_ajouter!!","",$mots_lies); } $aff_mots=str_replace("!!supprimer!!","
\n",$aff_mots); $aff_mots=str_replace("!!mots_lie!!",$mots_lies,$aff_mots); $aff_mots=str_replace("!!max_word!!",$compt,$aff_mots); } else { //pas de résultat on affiche une seule case de saisie $aff_mot_lie=str_replace("!!iword!!","0",$aff_mot_lie); $aff_mot_lie=str_replace("!!word!!","",$aff_mot_lie); $aff_mot_lie=str_replace("!!id_word!!","",$aff_mot_lie); $aff_mots=str_replace("!!mots_lie!!",$aff_mot_lie,$aff_mots); $aff_mots=str_replace("!!supprimer!!","\n",$aff_mots); $aff_mots=str_replace("!!max_word!!","1",$aff_mots); $aff_mots=str_replace("!!bouton_ajouter!!","",$aff_mots); } // $baseurl.="&word_selected=".$mot; $aff_mots=str_replace("!!mot!!",rawurlencode($mot),$aff_mots); $aff_mots=str_replace("!!id_mot!!",$id_mot,$aff_mots); $aff_mots=str_replace("!!mot_original!!",$mot,$aff_mots); } else { //si le mot est vide, on affiche le formulaire vierge $aff_mot_lie=str_replace("!!iword!!","0",$aff_mot_lie); $aff_mot_lie=str_replace("!!word!!","",$aff_mot_lie); $aff_mot_lie=str_replace("!!id_word!!","",$aff_mot_lie); $aff_mots=str_replace("!!mots_lie!!",$aff_mot_lie,$aff_mots); $aff_mots=str_replace("!!mot!!","",$aff_mots); $aff_mots=str_replace("!!mot_original!!","",$aff_mots); //on ne peut supprimer un mot inexistant $aff_mots=str_replace("!!supprimer!!","",$aff_mots); $aff_mots=str_replace("!!max_word!!","1",$aff_mots); $aff_mots=str_replace("!!id_mot!!","",$aff_mots); $aff_mots=str_replace("!!bouton_ajouter!!","",$aff_mots); } if ($word_search) $baseurl.="&action=search&word_search=".rawurlencode($word_search); $aff_mots=str_replace("!!action!!",$baseurl,$aff_mots); print $aff_mots; break; case 'modif': $bool_erreur=false; if ($word_selected) { //insertion d'un nouveau mot if ($word_code_selected)$rqt_ins = "update mots set mot='".$word_selected."' where id_mot='$word_code_selected' "; else $rqt_ins ="insert into mots set mot='".$word_selected."' "; @mysql_query($rqt_ins); if (!$word_code_selected)$word_code_selected= mysql_insert_id(); } else { $bool_erreur=true; print ""; } if ($bool_erreur==false) { $f_words=array(); //récupération des synonymes affectés au mot for ($i=$max_word-1;$i>=0 ; $i--) { $var_word = "f_word$i" ; global $$var_word; if ($$var_word && ($$var_word!=$word_selected)) { $var_word_code="f_word_code$i"; global $$var_word_code; if ($$var_word_code) $f_words[]=$$var_word_code; else { //vérification de l'existence du mot $rqt_exist="select id_mot, mot from mots left join linked_mots on (num_mot=id_mot) where mot='".$$var_word."' and id_mot not in (select num_mot from linked_mots where linked_mots.num_linked_mot=0) group by id_mot"; $query_exist=mysql_query($rqt_exist); if (!mysql_num_rows($query_exist)) { //insertion d'un nouveau mot $rqt_ins="insert into mots (mot) values ('".$$var_word."')"; @mysql_query($rqt_ins); //recherche de l'id du mot inséré $f_words[]=mysql_insert_id(); } } } } //dédoublonne le tableau $f_words=array_unique($f_words); //suppression des enregistrements existants $rqt_del = "delete from linked_mots where num_mot='".$word_code_selected."' "; $res_del = mysql_query($rqt_del, $dbh); //insertion du mot et de ses synonymes $rqt_ins = "insert into linked_mots (num_mot, num_linked_mot, type_lien, ponderation) VALUES "; //récupération des synonymes affectés au mot for ($i=0;$i".$msg["word_selected"]." | "; } else { $words_for_syn=array(); $words_for_syn1=array(); } while ($r=mysql_fetch_object($execute_query)) { if (!$word_search&&$action!='last_words') { $words_for_syn[$r->id_mot]=stripslashes($r->mot); $words_for_syn1[$r->id_mot]=convert_diacrit(pmb_strtolower(stripslashes($r->mot))); } else { if ($parity % 2) { $pair_impair = "even"; } else { $pair_impair = "odd"; } $parity += 1; $affichage_mots.="
---|
".stripslashes($r->mot)." |