8768 sujets

Développement web côté serveur, CMS

Bonjour,
J'ai un soucis avec mon tchat tout simple sans BDD. je voudrais y ajouter une alerte son a chaque nouveau message. après de multiple recherche j'ai trouvé un code a installer dans le fichier .JS mais j'entend le son seulement quand je rafraichir la page moi même... j'ai essayé de le mettre dans le fichier server du rafraichisement automatique et là je l'entend au rafraichissement qui s'effectue toutes les 5 secondes. bref je ne sais pas comment me servir de se code et surtout si c'est celui qu'il faut.

voici le code en question :
function mySoNiceSound(s)
{
var e=document.createElement('audio');
e.setAttribute('src',s);
e.play();
}
mySoNiceSound('wav/notification.mp3');

le fichier regexp.js

function convertHTTP(chaine)
{
var exp1 = new RegExp("((ht|f)tps?://[a-z|A-z|0-9|\.|/]*)","gi");

res = chaine ;
res = res.replace(exp1,"<a href='$1' target='AUTRE'>$1</a>");





return res ;
}

function convertEmail(chaine)
{
var exp2 = new RegExp("([a-zA-Z0-9\.\-_]+@[a-zA-Z0-9\-_]+\.[a-zA-Z0-9]{2,})","g");

res = chaine ;
res = res.replace(exp2,"<a href='mailto:$1'>$1</a>");

return res ;
}






function convertSmilies(chaine)
{
res = chaine ;

res = res.replace(new RegExp("(\\:\\))","g")," <img src='./images/smilies/icon_smile.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:D)","g")," <img src='./images/smilies/icon_biggrin.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\ Smiley lol )","g")," <img src='./images/smilies/icon_biggrin.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:grin\\:)","g")," <img src='./images/smilies/icon_biggrin.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:\\))","g")," <img src='./images/smilies/icon_smile.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:-\\))","g")," <img src='./images/smilies/icon_smile.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:smile\\:)","g")," <img src='./images/smilies/icon_smile.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:\\()","g")," <img src='./images/smilies/icon_sad.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:-\\()","g")," <img src='./images/smilies/icon_sad.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:sad\\:)","g")," <img src='./images/smilies/icon_sad.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:o)","g")," <img src='./images/smilies/icon_surprised.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:-o)","g")," <img src='./images/smilies/icon_surprised.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:eek\\:)","g")," <img src='./images/smilies/icon_surprised.gif' alt='smiley' />")
res = res.replace(new RegExp("(8O)","g")," <img src='./images/smilies/icon_eek.gif' alt='smiley' />")
res = res.replace(new RegExp("(8-O)","g")," <img src='./images/smilies/icon_eek.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:shock\\:)","g")," <img src='./images/smilies/icon_eek.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:\\?)","g")," <img src='./images/smilies/icon_confused.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:-\\?)","g")," <img src='./images/smilies/icon_confused.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:\\?\\?\\?\\:)","g")," <img src='./images/smilies/icon_confused.gif' alt='smiley' />")
res = res.replace(new RegExp("(8\\))","g")," <img src='./images/smilies/icon_cool.gif' alt='smiley' />")
res = res.replace(new RegExp("(8-\\))","g")," <img src='./images/smilies/icon_cool.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:cool\\:)","g")," <img src='./images/smilies/icon_cool.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:lol\\:)","g")," <img src='./images/smilies/icon_lol.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:x)","g")," <img src='./images/smilies/icon_mad.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:-x)","g")," <img src='./images/smilies/icon_mad.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:mad\\:)","g")," <img src='./images/smilies/icon_mad.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:P)","g")," <img src='./images/smilies/icon_razz.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:-P)","g")," <img src='./images/smilies/icon_razz.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:razz\\:)","g")," <img src='./images/smilies/icon_razz.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:oops\\:)","g")," <img src='./images/smilies/icon_redface.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:cry\\:)","g")," <img src='./images/smilies/icon_cry.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:evil\\:)","g")," <img src='./images/smilies/icon_evil.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:twisted\\:)","g")," <img src='./images/smilies/icon_twisted.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:roll\\:)","g")," <img src='./images/smilies/icon_rolleyes.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:wink\\:)","g")," <img src='./images/smilies/icon_wink.gif' alt='smiley' />")
res = res.replace(new RegExp("(;\\))","g")," <img src='./images/smilies/icon_wink.gif' alt='smiley' />")
res = res.replace(new RegExp("(;-\\))","g")," <img src='./images/smilies/icon_wink.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:!\\:)","g")," <img src='./images/smilies/icon_exclaim.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:\\?\\:)","g")," <img src='./images/smilies/icon_question.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:idea\\:)","g")," <img src='./images/smilies/icon_idea.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:arrow\\:)","g")," <img src='./images/smilies/icon_arrow.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:\\|)","g")," <img src='./images/smilies/icon_neutral.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:-\\|)","g")," <img src='./images/smilies/icon_neutral.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:neutral\\:)","g")," <img src='./images/smilies/icon_neutral.gif' alt='smiley' />")
res = res.replace(new RegExp("(\\:mrgreen\\:)","g")," <img src='./images/smilies/icon_mrgreen.gif' alt='smiley' />")

return res ;
}

function protegeChaine(chaine)
{
res = chaine ;

res = res.replace(new RegExp("(\\()","g"),"\\(") ;
res = res.replace(new RegExp("(\\))","g"),"\\)") ;
res = res.replace(new RegExp("(\\{)","g"),"\\{") ;
res = res.replace(new RegExp("(\\})","g"),"\\}") ;
res = res.replace(new RegExp("(\\[)","g"),"\\[") ;
res = res.replace(new RegExp("(\\])","g"),"\\]") ;
res = res.replace(new RegExp("(\\^)","g"),"\\^") ;
res = res.replace(new RegExp("(\\.)","g"),"\\.") ;
res = res.replace(new RegExp("(\\-)","g"),"\\-") ;
res = res.replace(new RegExp("(\\*)","g"),"\\*") ;
res = res.replace(new RegExp("(\\+)","g"),"\\+") ;
res = res.replace(new RegExp("(\\?)","g"),"\\?") ;
res = res.replace(new RegExp("(\\\\)","g"),"\\") ;
res = res.replace(new RegExp("(\\,)","g"),"\\,") ;
res = res.replace(new RegExp("(\\|)","g"),"\\|") ;

return res ;
}

function convertKana(chaine)
{
var exp1 = new RegExp("(%[^%]*%)", "g");

tabmatch = chaine.match(exp1) ;

res = chaine ;

if(tabmatch != null)
{
for(i=0;i<tabmatch.length;i++)
{
res = res.replace(new RegExp("(" + protegeChaine(tabmatch) + ")"),"<strong>" + searchKana(tabmatch[i]) + "</strong>")
}
}

return res ;
}

function searchKana(chaine)
{

res = chaine.replace(new RegExp("(%)","g"),"") ;

/* KATAKANA */

res = res.replace(new RegExp("(KK)","g"),"?K") ;
res = res.replace(new RegExp("(SS)","g"),"?S") ;
res = res.replace(new RegExp("(TT)","g"),"?T") ;
res = res.replace(new RegExp("(HH)","g"),"?H") ;
res = res.replace(new RegExp("(MM)","g"),"?M") ;
res = res.replace(new RegExp("(YY)","g"),"?Y") ;
res = res.replace(new RegExp("(RR)","g"),"?R") ;
res = res.replace(new RegExp("(WW)","g"),"?W") ;
res = res.replace(new RegExp("(FF)","g"),"?F") ;
res = res.replace(new RegExp("(GG)","g"),"?G") ;
res = res.replace(new RegExp("(ZZ)","g"),"?Z") ;
res = res.replace(new RegExp("(DD)","g"),"?D") ;
res = res.replace(new RegExp("(BB)","g"),"?B") ;
res = res.replace(new RegExp("(PP)","g"),"?P") ;
res = res.replace(new RegExp("(JJ)","g"),"?J") ;

res = res.replace(new RegExp("(SHI)","g"),"?") ;

res = res.replace(new RegExp("(CHI)","g"),"?") ;
res = res.replace(new RegExp("(TSU)","g"),"?") ;
res = res.replace(new RegExp("(DSU)","g"),"?") ;

res = res.replace(new RegExp("(KYA)","g"),"??") ;
res = res.replace(new RegExp("(KYU)","g"),"??") ;
res = res.replace(new RegExp("(KYO)","g"),"??") ;

res = res.replace(new RegExp("(GYA)","g"),"??") ;
res = res.replace(new RegExp("(GYU)","g"),"??") ;
res = res.replace(new RegExp("(GYO)","g"),"??") ;

res = res.replace(new RegExp("(SHA)","g"),"??") ;
res = res.replace(new RegExp("(SHU)","g"),"??") ;
res = res.replace(new RegExp("(SHO)","g"),"??") ;

res = res.replace(new RegExp("(NYA)","g"),"??") ;
res = res.replace(new RegExp("(NYU)","g"),"??") ;
res = res.replace(new RegExp("(NYO)","g"),"??") ;

res = res.replace(new RegExp("(HYA)","g"),"??") ;
res = res.replace(new RegExp("(HYU)","g"),"??") ;
res = res.replace(new RegExp("(HYO)","g"),"??") ;

res = res.replace(new RegExp("(BYA)","g"),"??") ;
res = res.replace(new RegExp("(BYU)","g"),"??") ;
res = res.replace(new RegExp("(BYO)","g"),"??") ;

res = res.replace(new RegExp("(PYA)","g"),"??") ;
res = res.replace(new RegExp("(PYU)","g"),"??") ;
res = res.replace(new RegExp("(PYO)","g"),"??") ;

res = res.replace(new RegExp("(MYA)","g"),"??") ;
res = res.replace(new RegExp("(MYU)","g"),"??") ;
res = res.replace(new RegExp("(MYO)","g"),"??") ;

res = res.replace(new RegExp("(RYA)","g"),"??") ;
res = res.replace(new RegExp("(RYU)","g"),"??") ;
res = res.replace(new RegExp("(RYO)","g"),"??") ;

res = res.replace(new RegExp("(CHA)","g"),"??") ;
res = res.replace(new RegExp("(CHU)","g"),"??") ;
res = res.replace(new RegExp("(CHO)","g"),"??") ;

res = res.replace(new RegExp("(JA)","g"),"??") ;
res = res.replace(new RegExp("(JU)","g"),"??") ;
res = res.replace(new RegExp("(JO)","g"),"??") ;

res = res.replace(new RegExp("(KA)","g"),"?") ;
res = res.replace(new RegExp("(KI)","g"),"?") ;
res = res.replace(new RegExp("(KU)","g"),"?") ;
res = res.replace(new RegExp("(KE)","g"),"?") ;
res = res.replace(new RegExp("(KO)","g"),"?") ;

res = res.replace(new RegExp("(SA)","g"),"?") ;
res = res.replace(new RegExp("(SU)","g"),"?") ;
res = res.replace(new RegExp("(SE)","g"),"?") ;
res = res.replace(new RegExp("(SO)","g"),"?") ;

res = res.replace(new RegExp("(TA)","g"),"?") ;
res = res.replace(new RegExp("(TE)","g"),"?") ;
res = res.replace(new RegExp("(TO)","g"),"?") ;

res = res.replace(new RegExp("(NA)","g"),"?") ;
res = res.replace(new RegExp("(NI)","g"),"?") ;
res = res.replace(new RegExp("(NU)","g"),"?") ;
res = res.replace(new RegExp("(NE)","g"),"?") ;
res = res.replace(new RegExp("(NO)","g"),"?") ;

res = res.replace(new RegExp("(HA)","g"),"?") ;
res = res.replace(new RegExp("(HI)","g"),"?") ;
res = res.replace(new RegExp("(FU)","g"),"?") ;
res = res.replace(new RegExp("(HU)","g"),"?") ;
res = res.replace(new RegExp("(HE)","g"),"?") ;
res = res.replace(new RegExp("(HO)","g"),"?") ;

res = res.replace(new RegExp("(MA)","g"),"?") ;
res = res.replace(new RegExp("(MI)","g"),"?") ;
res = res.replace(new RegExp("(MU)","g"),"?") ;
res = res.replace(new RegExp("(ME)","g"),"?") ;
res = res.replace(new RegExp("(MO)","g"),"?") ;

res = res.replace(new RegExp("(RA)","g"),"?") ;
res = res.replace(new RegExp("(RI)","g"),"?") ;
res = res.replace(new RegExp("(RU)","g"),"?") ;
res = res.replace(new RegExp("(RE)","g"),"?") ;
res = res.replace(new RegExp("(RO)","g"),"?") ;

res = res.replace(new RegExp("(WA)","g"),"?") ;
res = res.replace(new RegExp("(WO)","g"),"?") ;

res = res.replace(new RegExp("(FA)","g"),"??") ;
res = res.replace(new RegExp("(FI)","g"),"??") ;
res = res.replace(new RegExp("(FE)","g"),"??") ;
res = res.replace(new RegExp("(FO)","g"),"??") ;

res = res.replace(new RegExp("(GA)","g"),"?") ;
res = res.replace(new RegExp("(GI)","g"),"?") ;
res = res.replace(new RegExp("(GU)","g"),"?") ;
res = res.replace(new RegExp("(GE)","g"),"?") ;
res = res.replace(new RegExp("(GO)","g"),"?") ;

res = res.replace(new RegExp("(ZA)","g"),"?") ;
res = res.replace(new RegExp("(JI)","g"),"?") ;
res = res.replace(new RegExp("(ZI)","g"),"?") ;
res = res.replace(new RegExp("(ZU)","g"),"?") ;
res = res.replace(new RegExp("(ZE)","g"),"?") ;
res = res.replace(new RegExp("(ZO)","g"),"?") ;

res = res.replace(new RegExp("(DA)","g"),"?") ;
res = res.replace(new RegExp("(DI)","g"),"?") ;
res = res.replace(new RegExp("(DU)","g"),"?") ;
res = res.replace(new RegExp("(DE)","g"),"?") ;
res = res.replace(new RegExp("(DO)","g"),"?") ;

res = res.replace(new RegExp("(BA)","g"),"?") ;
res = res.replace(new RegExp("(BI)","g"),"?") ;
res = res.replace(new RegExp("(BU)","g"),"?") ;
res = res.replace(new RegExp("(BE)","g"),"?") ;
res = res.replace(new RegExp("(BO)","g"),"?") ;

res = res.replace(new RegExp("(PA)","g"),"?") ;
res = res.replace(new RegExp("(PI)","g"),"?") ;
res = res.replace(new RegExp("(PU)","g"),"?") ;
res = res.replace(new RegExp("(PE)","g"),"?") ;
res = res.replace(new RegExp("(PO)","g"),"?") ;

res = res.replace(new RegExp("(YA)","g"),"?") ;
res = res.replace(new RegExp("(YU)","g"),"?") ;
res = res.replace(new RegExp("(YO)","g"),"?") ;

res = res.replace(new RegExp("(\\-)","g"),"?") ;

res = res.replace(new RegExp("(A)","g"),"?") ;
res = res.replace(new RegExp("(I)","g"),"?") ;
res = res.replace(new RegExp("(U)","g"),"?") ;
res = res.replace(new RegExp("(E)","g"),"?") ;
res = res.replace(new RegExp("(O)","g"),"?") ;

res = res.replace(new RegExp("(N)","g"),"?") ;

/* HIRAGANA */

res = res.replace(new RegExp("(kk)","g"),"?k") ;
res = res.replace(new RegExp("(ss)","g"),"?s") ;
res = res.replace(new RegExp("(tt)","g"),"?t") ;
res = res.replace(new RegExp("(hh)","g"),"?h") ;
res = res.replace(new RegExp("(mm)","g"),"?m") ;
res = res.replace(new RegExp("(yy)","g"),"?y") ;
res = res.replace(new RegExp("(rr)","g"),"?r") ;
res = res.replace(new RegExp("(ww)","g"),"?w") ;
res = res.replace(new RegExp("(ff)","g"),"?f") ;
res = res.replace(new RegExp("(gg)","g"),"?g") ;
res = res.replace(new RegExp("(zz)","g"),"?z") ;
res = res.replace(new RegExp("(dd)","g"),"?d") ;
res = res.replace(new RegExp("(bb)","g"),"?b") ;
res = res.replace(new RegExp("(pp)","g"),"?p") ;
res = res.replace(new RegExp("(jj)","g"),"?j") ;

res = res.replace(new RegExp("(shi)","g"),"?") ;

res = res.replace(new RegExp("(chi)","g"),"?") ;
res = res.replace(new RegExp("(tsu)","g"),"?") ;
res = res.replace(new RegExp("(dsu)","g"),"?") ;

res = res.replace(new RegExp("(kya)","g"),"??") ;
res = res.replace(new RegExp("(kyu)","g"),"??") ;
res = res.replace(new RegExp("(kyo)","g"),"??") ;

res = res.replace(new RegExp("(gya)","g"),"??") ;
res = res.replace(new RegExp("(gyu)","g"),"??") ;
res = res.replace(new RegExp("(gyo)","g"),"??") ;

res = res.replace(new RegExp("(sha)","g"),"??") ;
res = res.replace(new RegExp("(shu)","g"),"??") ;
res = res.replace(new RegExp("(sho)","g"),"??") ;

res = res.replace(new RegExp("(nya)","g"),"??") ;
res = res.replace(new RegExp("(nyu)","g"),"??") ;
res = res.replace(new RegExp("(nyo)","g"),"??") ;

res = res.replace(new RegExp("(hya)","g"),"??") ;
res = res.replace(new RegExp("(hyu)","g"),"??") ;
res = res.replace(new RegExp("(hyo)","g"),"??") ;

res = res.replace(new RegExp("(bya)","g"),"??") ;
res = res.replace(new RegExp("(byu)","g"),"??") ;
res = res.replace(new RegExp("(byo)","g"),"??") ;

res = res.replace(new RegExp("(pya)","g"),"??") ;
res = res.replace(new RegExp("(pyu)","g"),"??") ;
res = res.replace(new RegExp("(pyo)","g"),"??") ;

res = res.replace(new RegExp("(mya)","g"),"??") ;
res = res.replace(new RegExp("(myu)","g"),"??") ;
res = res.replace(new RegExp("(myo)","g"),"??") ;

res = res.replace(new RegExp("(rya)","g"),"??") ;
res = res.replace(new RegExp("(ryu)","g"),"??") ;
res = res.replace(new RegExp("(ryo)","g"),"??") ;

res = res.replace(new RegExp("(cha)","g"),"??") ;
res = res.replace(new RegExp("(chu)","g"),"??") ;
res = res.replace(new RegExp("(cho)","g"),"??") ;

res = res.replace(new RegExp("(ja)","g"),"??") ;
res = res.replace(new RegExp("(ju)","g"),"??") ;
res = res.replace(new RegExp("(jo)","g"),"??") ;

res = res.replace(new RegExp("(ka)","g"),"?") ;
res = res.replace(new RegExp("(ki)","g"),"?") ;
res = res.replace(new RegExp("(ku)","g"),"?") ;
res = res.replace(new RegExp("(ke)","g"),"?") ;
res = res.replace(new RegExp("(ko)","g"),"?") ;

res = res.replace(new RegExp("(sa)","g"),"?") ;
res = res.replace(new RegExp("(su)","g"),"?") ;
res = res.replace(new RegExp("(se)","g"),"?") ;
res = res.replace(new RegExp("(so)","g"),"?") ;

res = res.replace(new RegExp("(ta)","g"),"?") ;
res = res.replace(new RegExp("(te)","g"),"?") ;
res = res.replace(new RegExp("(to)","g"),"?") ;

res = res.replace(new RegExp("(na)","g"),"?") ;
res = res.replace(new RegExp("(ni)","g"),"?") ;
res = res.replace(new RegExp("(nu)","g"),"?") ;
res = res.replace(new RegExp("(ne)","g"),"?") ;
res = res.replace(new RegExp("(no)","g"),"?") ;

res = res.replace(new RegExp("(ha)","g"),"?") ;
res = res.replace(new RegExp("(hi)","g"),"?") ;
res = res.replace(new RegExp("(fu)","g"),"?") ;
res = res.replace(new RegExp("(hu)","g"),"?") ;
res = res.replace(new RegExp("(he)","g"),"?") ;
res = res.replace(new RegExp("(ho)","g"),"?") ;

res = res.replace(new RegExp("(ma)","g"),"?") ;
res = res.replace(new RegExp("(mi)","g"),"?") ;
res = res.replace(new RegExp("(mu)","g"),"?") ;
res = res.replace(new RegExp("(me)","g"),"?") ;
res = res.replace(new RegExp("(mo)","g"),"?") ;

res = res.replace(new RegExp("(ra)","g"),"?") ;
res = res.replace(new RegExp("(ri)","g"),"?") ;
res = res.replace(new RegExp("(ru)","g"),"?") ;
res = res.replace(new RegExp("(re)","g"),"?") ;
res = res.replace(new RegExp("(ro)","g"),"?") ;

res = res.replace(new RegExp("(wa)","g"),"?") ;
res = res.replace(new RegExp("(wo)","g"),"?") ;

res = res.replace(new RegExp("(fa)","g"),"??") ;
res = res.replace(new RegExp("(fi)","g"),"??") ;
res = res.replace(new RegExp("(fe)","g"),"??") ;
res = res.replace(new RegExp("(fo)","g"),"??") ;

res = res.replace(new RegExp("(ga)","g"),"?") ;
res = res.replace(new RegExp("(gi)","g"),"?") ;
res = res.replace(new RegExp("(gu)","g"),"?") ;
res = res.replace(new RegExp("(ge)","g"),"?") ;
res = res.replace(new RegExp("(go)","g"),"?") ;

res = res.replace(new RegExp("(za)","g"),"?") ;
res = res.replace(new RegExp("(ji)","g"),"?") ;
res = res.replace(new RegExp("(zi)","g"),"?") ;
res = res.replace(new RegExp("(zu)","g"),"?") ;
res = res.replace(new RegExp("(ze)","g"),"?") ;
res = res.replace(new RegExp("(zo)","g"),"?") ;

res = res.replace(new RegExp("(da)","g"),"?") ;
res = res.replace(new RegExp("(di)","g"),"?") ;
res = res.replace(new RegExp("(du)","g"),"?") ;
res = res.replace(new RegExp("(de)","g"),"?") ;
res = res.replace(new RegExp("(do)","g"),"?") ;

res = res.replace(new RegExp("(ba)","g"),"?") ;
res = res.replace(new RegExp("(bi)","g"),"?") ;
res = res.replace(new RegExp("(bu)","g"),"?") ;
res = res.replace(new RegExp("(be)","g"),"?") ;
res = res.replace(new RegExp("(bo)","g"),"?") ;

res = res.replace(new RegExp("(pa)","g"),"?") ;
res = res.replace(new RegExp("(pi)","g"),"?") ;
res = res.replace(new RegExp("(pu)","g"),"?") ;
res = res.replace(new RegExp("(pe)","g"),"?") ;
res = res.replace(new RegExp("(po)","g"),"?") ;

res = res.replace(new RegExp("(ya)","g"),"?") ;
res = res.replace(new RegExp("(yu)","g"),"?") ;
res = res.replace(new RegExp("(yo)","g"),"?") ;

res = res.replace(new RegExp("(a)","g"),"?") ;
res = res.replace(new RegExp("(i)","g"),"?") ;
res = res.replace(new RegExp("(u)","g"),"?") ;
res = res.replace(new RegExp("(e)","g"),"?") ;
res = res.replace(new RegExp("(o)","g"),"?") ;

res = res.replace(new RegExp("(n)","g"),"?") ;


return res ;
}

[b]le fichier server.php


<?
session_name("AXCHAT") ;
session_start() ;
session_cache_limiter("nocache") ;

include("chat.class.inc") ;
include("config.inc.php") ;


$nickname = $_SESSION["nickname"] ;

if($_SESSION["cmdBIS"]!="")
$cmd = $_SESSION["cmdBIS"] ;
else
$cmd = $_GET["cmd"] ;

$message = $_GET["message"] ;
$position = $_GET["position"] ;
$usersposition = $_GET["usersposition"] ;

$commandes = explode(" ",$message) ;

if($CLEAR == 0)
$chat = new Chat() ;
else
$chat = new Chat(50,300,$CLEAR) ;

$chat->setServerPosts($TEXT_ENTER, $TEXT_QUIT, $TEXT_QUIT_TIMEOUT, $TEXT_BAN, $TEXT_BAN_ENTER, $TEXT_MODERATOR, $TEXT_CLEAR) ;

if($chat->isBan($_SERVER["REMOTE_ADDR"]))
{
$chat->quit($nickname) ;
session_destroy() ;

$chat->release() ;
$chat = nothing ;

header("Location: ".$_SERVER["PHP_SELF"]."?message=Vous avez ete banni") ;
exit() ;
}

// Connexion
if($cmd=="CONNECT")
{
if(!$chat->enter($nickname, $_SERVER["REMOTE_ADDR"]))
{
session_destroy() ;

$chat->release() ;
$chat = nothing ;

header("Location: ".$_SERVER["PHP_SELF"]."?message=Connexion impossible. Pseudo deja utilise") ;
exit() ;
}
else
{
$_SESSION["cmdBIS"] = "" ;

$chat->release() ;
$chat = nothing ;

header("Location: ".$_SERVER["PHP_SELF"]) ;
exit() ;
}
}

if($nickname != "" && !$chat->isUser($nickname))
{
session_destroy() ;

$chat->release() ;
$chat = nothing ;

header("Location: ".$_SERVER["PHP_SELF"]."?message=Vous ete deconnecte") ;
exit() ;
}

// Déconnexion
if($cmd=="QUIT" || ($cmd=="POST" && $commandes[0] == "/quit"))
{
// désinscription dans la liste des utilisateurs
$chat->quit($nickname) ;
session_destroy() ;

$chat->release() ;
$chat = nothing ;

header("Location: ".$_SERVER["PHP_SELF"]."?message=A bientot !") ;
exit() ;
}

// Bannissement
if($commandes[0] == "/ban")
{
// Inscription dans la liste des bannissements grâce à l'ip
$chat->ban($nickname, $commandes[1],$chat->getIp($commandes[1]),$commandes[2]) ;

$chat->release() ;
$chat = nothing ;

header("Location: ".$_SERVER["PHP_SELF"]) ;
exit() ;
}

// Administrateur
if($commandes[0] == "/admin")
{
if($commandes[1] == $PASSWORD)
{
$chat->setAdmin($nickname) ;

$chat->release() ;
$chat = nothing ;

header("Location: ".$_SERVER["PHP_SELF"]) ;
exit() ;
}
}

// Aide
if($commandes[0] == "/help")
{
$temp = explode(";",$TEXT_HELP) ;

foreach($temp as $temp => $value)
{
$chat->postFromServer($value,ENT_QUOTES) ;
}

$chat->release() ;
$chat = nothing ;

header("Location: ".$_SERVER["PHP_SELF"]) ;
exit() ;
}

// Poster un message
if($cmd=="POST")
{
$chat->post($nickname, $message) ;

$chat->release() ;
$chat = nothing ;

header("Location: ".$_SERVER["PHP_SELF"]) ;
exit() ;



}



?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=$TITRE;?></title>
<style type='text/css' media='screen'>

/*
Declarez ici votre feuille de style
*/
body
{
background-color: #FFFFFF ;
margin: 0px 0px 0px 0px ;
}

small
{
font-family: Verdana, Arial, Helvetica, Sans-Serif ;
font-size: 10px ;
}

div#page
{
font-family: Verdana, Arial, Helvetica, Sans-Serif ;
font-size: 14px ;
}

</style>
<script type='text/javascript'>

// <![CDATA[

/*
Declarez ici vos fonctions javascript
*/





<?
if(!$_SESSION["nickname"])
{
?>
alert("<?=($_GET["message"]==""?"Vous etes deconnecte":$_GET["message"]);?>") ;
window.parent.document.location.href="login.php" ;
<?
}
else
{
?>
window.parent.getPosts('<?=$chat->printPosts($nickname, $NB_LIGNES_POSTS, $position);?>')

window.parent.getUsers('<?=$chat->printUsers($nickname);?>')

setTimeout('document.location.reload()',5000);






<?
}
?>
// ]]>



</script>
</head>

<body>

<div id='page'>

<small><?=$TITRE;?>.chat - aXChat v<?=$VERSION;?></small>

</div>

</body>

</html>
<?
$chat->release() ;
$chat = nothing ;
?>

le fichier client.php

<?
session_name("AXCHAT") ;
session_start() ;
session_cache_limiter("nocache") ;

include("config.inc.php") ;

$nickname = $_SESSION["nickname"] ;
$kana = $_GET["kana"] ;

if($nickname=="")
{
header("Location: login.php") ;
exit() ;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>

<?=$TITRE;?>.chat - aXChat v<?=$VERSION;?>

</title>

<link title="general" type="text/CSS" rel="stylesheet" href="style.css" media="screen" />

<script type='text/javascript' src='regexp.js'></script>

<script type='text/javascript'>

// <![CDATA[

/*
Declarez ici vos fonctions javascript
*/

var position = 0 ;
var Usersposition = 0 ;
var color ;


/* Fonctions appelée par le serveur */

function alwayPostsOnBottom()
{

document.getElementById("PrintIFrame").scrollTop=document.getElementById("PrintIFrame").scrollHeight ;
}

function alwayUsersOnBottom()
{
document.getElementById("PrintUsers").scrollTop=document.getElementById("PrintUsers").scrollHeight ;
}

function getPosts(msg)
{
document.getElementById("PrintIFrame").innerHTML = convertInnerHTML(msg) ;
alwayPostsOnBottom() ;
}

function getUsers(users)
{
document.getElementById("PrintUsers").innerHTML = users ;
alwayUsersOnBottom() ;
}

/* Fonctions exécutés par des évennements du client */

function mouseOver(object)
{
color = object.style.color ;
object.style.color = "#666666" ;
}

function mouseOut(object)
{
object.style.color = color ;
}

function quit()
{
document.getElementById('RSIFrame').src = "server.php?cmd=POST&message=/quit" ;hhh
}

function help()
{
document.getElementById('RSIFrame').src = "server.php?cmd=POST&message=/help" ;
}


/* Fonctions de conversion de suites de caractère : lien http, email, smilies... */

function convertInnerHTML(chaine)
{
/* Insérez ici les fonctions re remplacement d'expressions régulière */

res = chaine

res = convertHTTP(res) ;
res = convertEmail(res) ;
res = convertSmilies(res) ;







return res ;
}





// ]]>

</script>



</head>

<body>

<div id='chat'>

<div id='titre'>

<strong><?=$TITRE;?></strong><small>.chat - aXChat v<?=$VERSION;?></small>

</div>

<div id='tools'>

<small><strong><?=$_SESSION["nickname"];?></strong> - <?=($kana=="yes"?htmlentities($TEXT_CLIENT_KANA_MODE,ENT_QUOTES):htmlentities($TEXT_CLIENT_ROMAJI_MODE,ENT_QUOTES));?></small>&nbsp;

<a href='<?=$_SERVER["PHP_SELF"];?>?kana=<?=($kana=="yes"?"":"yes");?>'><img src='./images/<?=($kana=="yes"?"romaji.gif":"kana.gif");?>' alt='Mode Kana' /></a>

<a href='javascript: if(confirm("<?=$TEXT_CLIENT_QUIT;?>")) quit();'><img src='./images/quit.gif' alt='quitter' /></a>

<a href='javascript: help()'><img src='./images/aide.gif' alt='Aide' /></a>

</div>

<div id="PrintUsers"></div>

<div id="PrintIFrame"></div>

<div id='texte'>

<form name='post_message' action="server.php" target="RSIFrame" method="get" onsubmit='document.post_message.message.value=document.post_message.visible.value ; document.post_message.visible.value="" ; position = 0 ;'>

<input type="hidden" name="nickname" value="<?=htmlentities($nickname,ENT_QUOTES);?>" />
<input type="hidden" name="message" value="" />
<input type="hidden" name="cmd" value="POST""/>
<input type="text" name="visible" id='text_input' <?=($kana=="yes"?"onkeyup='setTimeout(\"document.post_message.visible.value = searchKana(document.post_message.visible.value)\",100)'":"");?> />

</form>






</div>

</div>

<iframe id="RSIFrame"
name="RSIFrame"
style="border: 0px none ; width: 0px ; height: 0px"
src="server.php">



</iframe>

<script type='text/javascript'>

document.forms["post_message"].text_input.focus() ;
setTimeout('alwayPostsOnBottom()',1000) ;
setTimeout('alwayUsersOnBottom()',1000) ;


</script>

</body>
</html>

si quelqu'un aurait la réponse à mon problème sa serait super sympa.
en esperant vous lire très bientôt




[/i][/i]
Des fois, on se pleins que la personne demandant de l'aide ne mette pas assez de code. là , y'en a trop Smiley ola