Accueil   Accueil    Forum   Forum    Download   Download    Livre d'or   Livre d'or    Contact   Contact    Liens Web   Liens Web

[TChat] Module de Tchat Communautaire - CMS KwsPHP - Le site clés en main

Colonne de gauche

Espace membre

Privé Masquer le formulaire de connexion


Se souvenir de moi ?


Mot de passe oublié

Menu

Forum

Sujets Importants

fleche basForum : Masquer l’entête

Accès rapide :

 

Effectuer une Recherche avancée OU


fleche bas[TChat] Module de Tchat Communautaire  [22 réponses]

puce Index du Forum  » Portail & Modules  » Modifications et Créations des modules


Répondre


fleche bas

σGothicae
starsj6.png
Dieu
Ultra Méchant


avatar
Hors ligne

Nombre de posts: 1583 (0.22/Jour)
Inscrit(e) le: 13 avril 2007
Visiter son site
Imprimer Permalien mercredi 4 janvier 2012 à 09:31  
Bonjour,

Je vous présente un petit module de Tchat que j'ai réalisé pour les besoins de mon site.

Télécharger : Lien ICI

Démonstration : http://www.design.bouliz.com/tchatche.html

Ce module est largement inspiré du module ajash00t par défaut, mais à l'avantage de pouvoir être retouché plus facilement point de vue design, il possède également une liste d'utilisateurs en ligne.

J'attends vos retours sur ce module afin de le faire évoluer, et de vous en faire profiter par la même occasion.

Bonne journée à tous.

Comtois , rends toi! Neni ma foi! | http://www.design.bouliz.com | http://www.bouliz.com
Qui c'est les plus forts, évidemment c'est les verts!!!
userbar_112987970.png


Infos CMS KwsPHP


Informations : Avant de poster un sujet sur le forum

Veuillez avant tout vérifiez la comparaison de vos fichiers sur votre site
Mon compte / Outils / Comparaison


La recherche avancée du forum (en ciblant au mieux les options de la recherche)
La Faq - La documentation - La documentation en vidéo - Le sujet "Install et Mise à jour"
Vous devez lire en priorité le topic de la 1.6 pour en découvrir ses fonctionnalités


Afficher



Musicgroove

stars7.png
Mega Cool


avatar
Hors ligne

Nombre de posts: 1411 (0.21/Jour)
Inscrit(e) le: 1er mars 2008
Visiter son site
Imprimer Permalien lundi 9 janvier 2012 à 23:48  
salut, j'ai testé le module tchache, je l'ai installé tous ce passe bien mais quand j'écris et j'appui sur le bouton chacher il se passe rien

Musicgroovemillenium.png


banniere.jpg


Musicgroove-Hightec.gif


johnny_hallyday.jpg


CMS
starsj3.png
Habitué


avatar
Hors ligne

Nombre de posts: 267 (0.05/Jour)
Inscrit(e) le: 20 octobre 2010
Visiter son site
Imprimer Permalien mardi 10 janvier 2012 à 08:05  
bonjour
moi je vient de l'installer aussi, j'ai le meme probleme j'ecrit mon text et je fait entrée et rien ne se passe... pas d'ecriture !

CMS
site =>Barjot Team des Pôtes


σGothicae
starsj6.png
Dieu
Ultra Méchant


avatar
Hors ligne

Nombre de posts: 1583 (0.22/Jour)
Inscrit(e) le: 13 avril 2007
Visiter son site
Imprimer Permalien mardi 10 janvier 2012 à 08:58  
Merci pour ces remontées,


Essayer de remplacer le fichier tchatche.php dans modules/tchatche/tchatche.php par


Code PHP (php) :
Pour copier le contenu exact du code,
Veuillez citer le message
  1.  
  2. <?php
  3.  
  4. class tpl{
  5.  
  6.     function tchatche_main(){
  7.     
  8.     global $K_user,$K_mod,$K_theme;
  9.         
  10.         $main = null;
  11.         $main .= '<script type="text/javascript">'."\n";
  12.         
  13.         $main .= '
  14.         
  15.         function ajax()
  16.         {
  17.             var http_request=null;
  18.             
  19.             if (window.XMLHttpRequest) { 
  20.                 http_request = new XMLHttpRequest();
  21.             }
  22.             else if (window.ActiveXObject) 
  23.             {
  24.                 http_request = new ActiveXObject("Microsoft.XMLHTTP");
  25.             }
  26.             //on définit l\'appel de la fonction au retour serveur
  27.             http_request.onreadystatechange = function() { alert_ajax(http_request); };
  28.             
  29.             //on appelle le fichier reponse.txt
  30.             http_request.open("GET", "modules/tchatche/comments.php?cmd=show", true);
  31.             http_request.send(null);
  32.         }
  33.  
  34.         function alert_ajax(http_request)
  35.         {
  36.             if (http_request.readyState == 4)
  37.                     {
  38.                         if (http_request.status == 200)
  39.                         {
  40.                             document.getElementById(\'c_cont\').innerHTML=http_request.responseText;
  41.                             
  42.                         }
  43.                         else
  44.                         {
  45.                             alert(\'There was a problem with the request.\');
  46.                         }
  47.                     }
  48.         }
  49.         
  50.         
  51.         setInterval(\'ajax()\', 3000);
  52.         window.onload = ajax();
  53.         '."\n";
  54.         $main .= '</script>'."\n";
  55.                     
  56.         $main .= '<div id="c_cont"></div>'."\n";            
  57.         $main .= '<div id="u_online"></div>'."\n";
  58.         $main .= '<div class="clearer"></div>'."\n";        
  59.                 
  60.         echo $main;
  61.  
  62.         
  63.  
  64.     }//FIN FUNCTION tchatche_MAIN
  65.     
  66.     function tchatche_publish()
  67.     {
  68.     global $K_user,$K_mod,$K_theme;
  69.     
  70.         $main = null;        
  71.         
  72.         $main .= '<script type="text/javascript">'."\n";
  73.         $main .= '        
  74.         function submitComment(text,id)
  75.         { 
  76.         
  77.             if(text == \'\')
  78.             {
  79.         
  80.                 alert("Vous n\'avez pas rempli le champ input");
  81.                 return false;
  82.             }
  83.             else
  84.             {
  85.                 var xhr; 
  86.                 try {  xhr = new ActiveXObject(\'Msxml2.XMLHTTP\');   }
  87.                 catch (e) 
  88.                 {
  89.                     try {   xhr = new ActiveXObject(\'Microsoft.XMLHTTP\'); }
  90.                     catch (e2) 
  91.                     {
  92.                        try {  xhr = new XMLHttpRequest();  }
  93.                        catch (e3) {  xhr = false;   }
  94.                      }
  95.                 }
  96.              
  97.                 xhr.onreadystatechange  = function() 
  98.                 { 
  99.                    if(xhr.readyState  == 4)
  100.                    {
  101.                     if(xhr.status  == 200) 
  102.                     {                    
  103.                     document.getElementById(\'reponse\').innerHTML = \'<img class="tchatche-submit-success" src="'.(file_exists('modules/'.$K_mod.'/theme/ok.png') ? 'modules/'.$K_mod.'/theme/ok.png' : 'themes/'.$K_theme.'/images/ok.png' ).'" alt="" />\';
  104.                         document.getElementById(\'text\').value = \'\';
  105.                     }
  106.                     else 
  107.                     {
  108.                         document.getElementById(\'reponse\').innerHTML = \'<h5 class="tchatche-submit-error">Une erreur est intervenue dans la publication de votre commentaire</h5>\';
  109.                     }
  110.                     }
  111.                 };
  112.                 
  113.                 if(text == \'delete\')
  114.                 {
  115.                 
  116.                 xhr.open( \'POST\', "modules/'.$K_mod.'/comments.php?cmd=remove",  true); 
  117.                 xhr.setRequestHeader(\'Content-Type\', \'application/x-www-form-urlencoded\');
  118.                 
  119.                 xhr.send(\'id=\'+id);
  120.                 
  121.                 }
  122.                 
  123.                 if(text != \'delete\' && text != \'abus\')
  124.                 {
  125.  
  126.                 xhr.open( \'POST\', "modules/'.$K_mod.'/comments.php?cmd=add",  true); 
  127.                 xhr.setRequestHeader(\'Content-Type\', \'application/x-www-form-urlencoded\');                
  128.                 xhr.send(\'text=\'+text,\'\');
  129.  
  130.                 }
  131.                 
  132.                 if(text == \'abus\')
  133.                 {
  134.  
  135.                 xhr.open( \'POST\', "modules/'.$K_mod.'/comments.php?cmd=abus",  true); 
  136.                 xhr.setRequestHeader(\'Content-Type\', \'application/x-www-form-urlencoded\');
  137.                 
  138.                 xhr.send(\'id=\'+id);
  139.  
  140.                 }
  141.                 
  142.                 
  143.             }    
  144.         }
  145.  
  146.         '."\n";
  147.         $main .= '</script>'."\n";
  148.         
  149.         $main .= '<div class="tchatche-comments-box">'."\n";
  150.         
  151.         $main .= '<form action="index.php">'."\n";
  152.         $main .= '<img class="tchatche-user-infos" src="'.$K_user->avatar.'"  alt="" />'."\n";
  153.         $main .= '<input type="text" name="text" id="text" />'."\n";
  154.         $main .= '<input type="button" value="Tchater" title="Valider avec la touche entrée" onclick="submitComment(escape(document.getElementById(\'text\').value));" /><span id="reponse"></span>'."\n";
  155.         $main .= '</form>'."\n";
  156.         $main .= '<p class="clearer"></p>'."\n";
  157.         $main .= '</div>'."\n";
  158.                 
  159.         echo $main;
  160.     
  161.     }
  162.     
  163.     function tchatche_comment($data)
  164.     {
  165.     global $K_user,$K_mod,$K_theme;
  166.     
  167.  
  168.         $main  = '<div class="tchatche-comments">'."\n";
  169.         $main .=  '<img src="'.$data->u_avatar.'" alt="" class="tchatche-comments-avatar" title="'.$data->userName.'"/>'."\n";
  170.         $main .= '<div class="tchatche-comments-text"><span class="tchatche-comments-date">'.date('H:i:s',$data->time).' :</span> '. bbcode($data->text,1, 0, 0, 0, 0, 0).'</div>'."\n";
  171.         $main .= '<img src="'.(file_exists('modules/tchatche/theme/abus.png') ? 'modules/tchatche/theme/abus.png' : 'themes/'.$K_theme.'/images/abus.png' ).'" alt="" class="tchatche-abus-img" onclick="submitComment(\'abus\',\''.$data->id.'\');" title="Signaler un abus" />'."\n";
  172.         if(get_grade() >= GRD_MODOF)
  173.         {
  174.         $main .= '<img src="'.(file_exists('modules/tchatche/theme/delete.png') ? 'modules/tchatche/theme/delete.png' : 'themes/'.$K_theme.'/images/delete.png' ).'" alt="" class="tchatche-delete-img" onclick="submitComment(\'delete\',\''.$data->id.'\');" title="Supprimer"/>'."\n";
  175.         }
  176.         $main .=  '<div class="clearer"></div>'."\n";
  177.         $main .=  '</div>'."\n";
  178.         
  179.         echo $main;
  180.     
  181.     }
  182.     
  183.     function tchatche_comment_ADM($data)
  184.     {
  185.     global $K_user,$K_mod,$K_theme;
  186.     
  187.  
  188.         $main  = '<div class="tchatche-comments">'."\n";
  189.         $main .=  '<img src="'.$data->u_avatar.'" alt="" class="tchatche-comments-avatar" title="'.$data->userName.'"/>'."\n";
  190.         $main .= '<div class="tchatche-comments-text"><span class="tchatche-comments-date">'.date('H:i:s',$data->time).' :</span> '. bbcode($data->text,1, 0, 0, 0, 0, 0).'</div>'."\n";
  191.         $main .= '<a href="index.php?mod='.$K_mod.'&amp;ac=gestion&amp;cmd=valid&amp;id='.$data->id.'"><img src="'.(file_exists('modules/tchatche/theme/check.png') ? 'modules/tchatche/theme/check.png' : 'themes/'.$K_theme.'/images/check.png' ).'" alt="" class="tchatche-check-img" /></a>'."\n";
  192.         if(get_grade() >= GRD_MODOF)
  193.         {
  194.         $main .= '<a href="index.php?mod='.$K_mod.'&amp;ac=gestion&amp;cmd=remove&amp;id='.$data->id.'"><img src="'.(file_exists('modules/tchatche/theme/delete.png') ? 'modules/tchatche/theme/delete.png' : 'themes/'.$K_theme.'/images/delete.png' ).'" alt="" class="tchatche-delete-img" /></a>'."\n";
  195.         }
  196.         $main .=  '<div class="clearer"></div>'."\n";
  197.         $main .=  '</div>'."\n";
  198.         
  199.         echo $main;
  200.     
  201.     }
  202.     
  203.     function tchatche_onlineh()
  204.     {
  205.     
  206.     $main = null;
  207.     
  208.     $main .= '<h5 class="tchatche-user-online">Membres connect&eacute;s (sur 60 secondes)</h5>'."\n";
  209.     $main .= "\n".'<ul class="tchatche-online-list">'."\n";
  210.     
  211.     echo $main;
  212.     
  213.     }
  214.     
  215.     function tchatche_online($data)
  216.     {
  217.     global $K_user,$K_mod,$K_theme;
  218.     
  219.     $main = null;
  220.     $main .= '<script type="text/javascript">'."\n";
  221.     $main .= 'function online()
  222.         {
  223.             var user_online=null;
  224.             
  225.             if (window.XMLHttpRequest) { 
  226.                 user_online = new XMLHttpRequest();
  227.             }
  228.             else if (window.ActiveXObject) 
  229.             {
  230.                 user_online = new ActiveXObject("Microsoft.XMLHTTP");
  231.             }
  232.             //on définit l\'appel de la fonction au retour serveur
  233.             user_online.onreadystatechange = function() { alert_online(user_online); };
  234.             
  235.             //on appelle le fichier reponse.txt
  236.             user_online.open("GET", "modules/tchatche/online.php", true);
  237.             user_online.send(null);
  238.         }
  239.  
  240.         function alert_online(user_online)
  241.         {
  242.             if (user_online.readyState == 4)
  243.                     {
  244.                         if (user_online.status == 200)
  245.                         {
  246.                             document.getElementById(\'u_online\').innerHTML=user_online.responseText;
  247.                             
  248.                         }
  249.                         else
  250.                         {
  251.                             alert(\'There was a problem with the request.\');
  252.                         }
  253.                     }
  254.         }
  255.         
  256.         
  257.         setInterval(\'online()\', 60000);
  258.         window.onload = online();
  259.         '."\n";
  260.         $main .= '</script>'."\n";
  261.         
  262.         if(!empty($data))
  263.         {
  264.         $main .= '<li><img src="'.(file_exists('modules/tchatche/theme/user.png') ? 'modules/tchatche/theme/user.png' : 'themes/'.$K_theme.'/images/user.png' ).'" alt="" /> <a href="'.url_rw('index.php?mod=espace_membre&amp;ac=profil&amp;id='.$data->user,array($data->userName)).'" title="Dernière connexion : '.date('H:i:s',$data->last_time).'">'.$data->userName.'</a></li>'."\n";
  265.         }
  266.         
  267.         echo $main;    
  268.     }
  269.     
  270.     function tchatche_onlinef()
  271.     {
  272.     
  273.     $main = null;
  274.     $main .= '</ul>'."\n";
  275.     
  276.     echo $main;
  277.     
  278.     }
  279.  
  280. } // FIN CLASS
  281.  
  282. ?>
  283.  


Comtois , rends toi! Neni ma foi! | http://www.design.bouliz.com | http://www.bouliz.com
Qui c'est les plus forts, évidemment c'est les verts!!!
userbar_112987970.png


Musicgroove

stars7.png
Mega Cool


avatar
Hors ligne

Nombre de posts: 1411 (0.21/Jour)
Inscrit(e) le: 1er mars 2008
Visiter son site
Imprimer Permalien mardi 10 janvier 2012 à 13:48  
salut, j'ai ajouté le fichier tchatche.php car il exitait pas mais même soucis

Musicgroovemillenium.png


banniere.jpg


Musicgroove-Hightec.gif


johnny_hallyday.jpg


σGothicae
starsj6.png
Dieu
Ultra Méchant


avatar
Hors ligne

Nombre de posts: 1583 (0.22/Jour)
Inscrit(e) le: 13 avril 2007
Visiter son site
Imprimer Permalien mardi 10 janvier 2012 à 17:53  
Le fichier tchatche.php existe, mais le problème vient "encore" d'internet explorer, fait un essai sous Firefox, tu verras ça fonctionne.

Je vais voir pour corriger le problème afin que cela fonctionne sous IE et FF

Comtois , rends toi! Neni ma foi! | http://www.design.bouliz.com | http://www.bouliz.com
Qui c'est les plus forts, évidemment c'est les verts!!!
userbar_112987970.png


Musicgroove

stars7.png
Mega Cool


avatar
Hors ligne

Nombre de posts: 1411 (0.21/Jour)
Inscrit(e) le: 1er mars 2008
Visiter son site
Imprimer Permalien mardi 10 janvier 2012 à 19:19  
salut, oui ça fonctionne sous ff mais pas sous ie dommage quand même

Musicgroovemillenium.png


banniere.jpg


Musicgroove-Hightec.gif


johnny_hallyday.jpg


Imprimer Permalien mardi 10 janvier 2012 à 19:45  
Quelle version de IE ?


Musicgroove

stars7.png
Mega Cool


avatar
Hors ligne

Nombre de posts: 1411 (0.21/Jour)
Inscrit(e) le: 1er mars 2008
Visiter son site
Imprimer Permalien mardi 10 janvier 2012 à 21:28  
salut, IE9

Musicgroovemillenium.png


banniere.jpg


Musicgroove-Hightec.gif


johnny_hallyday.jpg


CMS
starsj3.png
Habitué


avatar
Hors ligne

Nombre de posts: 267 (0.05/Jour)
Inscrit(e) le: 20 octobre 2010
Visiter son site
Imprimer Permalien mercredi 11 janvier 2012 à 09:05  
salut
oui il serais bien de le mettre en compatibilité avec tous les navigateur, tien nous au jus est merci Gothicae pour se module.


CMS
site =>Barjot Team des Pôtes


σGothicae
starsj6.png
Dieu
Ultra Méchant


avatar
Hors ligne

Nombre de posts: 1583 (0.22/Jour)
Inscrit(e) le: 13 avril 2007
Visiter son site
Imprimer Permalien jeudi 12 janvier 2012 à 00:37  
Le module devrait fonctionner avec cette modification :

Remplacer le contenu du ficher "modules/tchatche/theme/tchatche.php" par :


Code PHP :
Pour copier le contenu exact du code,
Veuillez citer le message
  1.  
  2. <?php
  3.  
  4. class tpl{
  5.  
  6.     function tchatche_main(){
  7.     
  8.     global $K_user,$K_mod,$K_theme;
  9.         
  10.         $main = null;
  11.         $main .= '<script type="text/javascript">'."\n";
  12.         
  13.         $main .= '
  14.         
  15.         function ajax()
  16.         {
  17.             var http_request;
  18.             
  19.             if (window.XMLHttpRequest)    //  Objet standard
  20.             { 
  21.                 http_request = new XMLHttpRequest();     //  Firefox, Safari, ...
  22.             } 
  23.             else  if (window.ActiveXObject)      //  Internet Explorer
  24.             {
  25.                 http_request = new ActiveXObject("Microsoft.XMLHTTP");
  26.             }
  27.  
  28.             http_request.onreadystatechange = function() { alert_ajax(http_request); };
  29.  
  30.             http_request.open("POST", "modules/tchatche/comments.php?cmd=show", true);
  31.             http_request.send(null);
  32.         }
  33.  
  34.         function alert_ajax(http_request)
  35.         {
  36.         
  37.             if (http_request.readyState == 4)
  38.                     {
  39.                         if (http_request.status == 200)
  40.                         {
  41.                             document.getElementById(\'c_cont\').innerHTML=http_request.responseText;
  42.                             
  43.                         }
  44.                         
  45.                     }
  46.         }
  47.         
  48.         
  49.         setInterval(\'ajax()\', 3000);
  50.         window.onload = ajax();'."\n";
  51.         
  52.         $main .= '</script>'."\n";
  53.                     
  54.         $main .= '<div id="c_cont"></div>'."\n";            
  55.         $main .= '<div id="u_online"></div>'."\n";
  56.         $main .= '<div class="clearer"></div>'."\n";        
  57.                 
  58.         echo $main;
  59.  
  60.         
  61.  
  62.     }//FIN FUNCTION tchatche_MAIN
  63.     
  64.     function tchatche_publish()
  65.     {
  66.     global $K_user,$K_mod,$K_theme;
  67.     
  68.         $main = null;        
  69.         
  70.         $main .= '<script type="text/javascript">'."\n";
  71.         $main .= '        
  72.         function submitComment(text,id)
  73.         { 
  74.         
  75.             if(text == \'\')
  76.             {
  77.         
  78.                 alert("Vous n\'avez pas rempli le champ input");
  79.                 return false;
  80.             }
  81.             else
  82.             {
  83.                 var xhr; 
  84.                 if (window.XMLHttpRequest)    //  Objet standard
  85.                 { 
  86.                     xhr = new XMLHttpRequest();     //  Firefox, Safari, ...
  87.                 } 
  88.                 else  if (window.ActiveXObject)      //  Internet Explorer
  89.                 {
  90.                     xhr = new ActiveXObject("Microsoft.XMLHTTP");
  91.                 }
  92.              
  93.                 xhr.onreadystatechange  = function() 
  94.                 { 
  95.                    if(xhr.readyState  == 4)
  96.                    {
  97.                     if(xhr.status  == 200) 
  98.                     {                    
  99.                     document.getElementById(\'reponse\').innerHTML = \'<img class="tchatche-submit-success" src="'.(file_exists('modules/'.$K_mod.'/theme/ok.png') ? 'modules/'.$K_mod.'/theme/ok.png' : 'themes/'.$K_theme.'/images/ok.png' ).'" alt="" />\';
  100.                         document.getElementById(\'text\').value = \'\';
  101.                     }
  102.                     else 
  103.                     {
  104.                         document.getElementById(\'reponse\').innerHTML = \'<h5 class="tchatche-submit-error">Une erreur est intervenue dans la publication de votre commentaire</h5>\';
  105.                     }
  106.                     }
  107.                 };
  108.                 
  109.                 if(text == \'delete\')
  110.                 {
  111.                 
  112.                 xhr.open( \'POST\', "modules/'.$K_mod.'/comments.php?cmd=remove",  true); 
  113.                 xhr.setRequestHeader(\'Content-Type\', \'application/x-www-form-urlencoded\');
  114.                 
  115.                 xhr.send(\'id=\'+id);
  116.                 
  117.                 }
  118.                 
  119.                 if(text != \'delete\' && text != \'abus\')
  120.                 {
  121.  
  122.                 xhr.open( \'POST\', "modules/'.$K_mod.'/comments.php?cmd=add",  true); 
  123.                 xhr.setRequestHeader(\'Content-Type\', \'application/x-www-form-urlencoded\');                
  124.                 xhr.send(\'text=\'+text,\'\');
  125.  
  126.                 }
  127.                 
  128.                 if(text == \'abus\')
  129.                 {
  130.  
  131.                 xhr.open( \'POST\', "modules/'.$K_mod.'/comments.php?cmd=abus",  true); 
  132.                 xhr.setRequestHeader(\'Content-Type\', \'application/x-www-form-urlencoded\');
  133.                 
  134.                 xhr.send(\'id=\'+id);
  135.  
  136.                 }
  137.                 
  138.                 
  139.             }    
  140.         }
  141.  
  142.         '."\n";
  143.         $main .= '</script>'."\n";
  144.         
  145.         $main .= '<div class="tchatche-comments-box">'."\n";
  146.         
  147.         $main .= '<form action="index.php">'."\n";
  148.         //$main .= '<form action="index.php" onkeypress="if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {submitComment(escape(document.getElementById(\'text\').value));return false;}} else {return true}; ">'."\n";
  149.         $main .= '<img class="tchatche-user-infos" src="'.$K_user->avatar.'"  alt="" />'."\n";
  150.         $main .= '<input type="text" name="text" id="text" />'."\n";
  151.         $main .= '<input type="button" value="Tchater" title="Valider avec la touche entrée" onclick="submitComment(escape(document.getElementById(\'text\').value));" /><span id="reponse"></span>'."\n";
  152.         $main .= '</form>'."\n";
  153.         $main .= '<p class="clearer"></p>'."\n";
  154.         $main .= '</div>'."\n";
  155.                 
  156.         echo $main;
  157.     
  158.     }
  159.     
  160.     function tchatche_comment($data)
  161.     {
  162.     global $K_user,$K_mod,$K_theme;
  163.     
  164.  
  165.         $main  = '<div class="tchatche-comments">'."\n";
  166.         $main .=  '<img src="'.$data->u_avatar.'" alt="" class="tchatche-comments-avatar" title="'.$data->userName.'"/>'."\n";
  167.         $main .= '<div class="tchatche-comments-text"><span class="tchatche-comments-date">'.date('H:i:s',$data->time).' :</span> '. bbcode($data->text,1, 0, 0, 0, 0, 0).'</div>'."\n";
  168.         $main .= '<img src="'.(file_exists('modules/tchatche/theme/abus.png') ? 'modules/tchatche/theme/abus.png' : 'themes/'.$K_theme.'/images/abus.png' ).'" alt="" class="tchatche-abus-img" onclick="submitComment(\'abus\',\''.$data->id.'\');" title="Signaler un abus" />'."\n";
  169.         if(get_grade() >= GRD_MODOF)
  170.         {
  171.         $main .= '<img src="'.(file_exists('modules/tchatche/theme/delete.png') ? 'modules/tchatche/theme/delete.png' : 'themes/'.$K_theme.'/images/delete.png' ).'" alt="" class="tchatche-delete-img" onclick="submitComment(\'delete\',\''.$data->id.'\');" title="Supprimer"/>'."\n";
  172.         }
  173.         $main .=  '<div class="clearer"></div>'."\n";
  174.         $main .=  '</div>'."\n";
  175.         
  176.         echo $main;
  177.     
  178.     }
  179.     
  180.     function tchatche_comment_ADM($data)
  181.     {
  182.     global $K_user,$K_mod,$K_theme;
  183.     
  184.  
  185.         $main  = '<div class="tchatche-comments">'."\n";
  186.         $main .=  '<img src="'.$data->u_avatar.'" alt="" class="tchatche-comments-avatar" title="'.$data->userName.'"/>'."\n";
  187.         $main .= '<div class="tchatche-comments-text"><span class="tchatche-comments-date">'.date('H:i:s',$data->time).' :</span> '. bbcode($data->text,1, 0, 0, 0, 0, 0).'</div>'."\n";
  188.         $main .= '<a href="index.php?mod='.$K_mod.'&amp;ac=gestion&amp;cmd=valid&amp;id='.$data->id.'"><img src="'.(file_exists('modules/tchatche/theme/check.png') ? 'modules/tchatche/theme/check.png' : 'themes/'.$K_theme.'/images/check.png' ).'" alt="" class="tchatche-check-img" /></a>'."\n";
  189.         if(get_grade() >= GRD_MODOF)
  190.         {
  191.         $main .= '<a href="index.php?mod='.$K_mod.'&amp;ac=gestion&amp;cmd=remove&amp;id='.$data->id.'"><img src="'.(file_exists('modules/tchatche/theme/delete.png') ? 'modules/tchatche/theme/delete.png' : 'themes/'.$K_theme.'/images/delete.png' ).'" alt="" class="tchatche-delete-img" /></a>'."\n";
  192.         }
  193.         $main .=  '<div class="clearer"></div>'."\n";
  194.         $main .=  '</div>'."\n";
  195.         
  196.         echo $main;
  197.     
  198.     }
  199.     
  200.     function tchatche_onlineh()
  201.     {
  202.     
  203.     $main = null;
  204.     
  205.     $main .= '<h5 class="tchatche-user-online">Membres connect&eacute;s (sur 60 secondes)</h5>'."\n";
  206.     $main .= "\n".'<ul class="tchatche-online-list">'."\n";
  207.     
  208.     echo $main;
  209.     
  210.     }
  211.     
  212.     function tchatche_online($data)
  213.     {
  214.     global $K_user,$K_mod,$K_theme;
  215.     
  216.     $main = null;
  217.     $main .= '<script type="text/javascript">'."\n";
  218.     $main .= 'function online()
  219.         {
  220.             var user_online;
  221.             
  222.             if (window.XMLHttpRequest)    //  Objet standard
  223.             { 
  224.                 user_online = new XMLHttpRequest();     //  Firefox, Safari, ...
  225.             } 
  226.             else  if (window.ActiveXObject)      //  Internet Explorer
  227.             {
  228.                 user_online = new ActiveXObject("Microsoft.XMLHTTP");
  229.             }
  230.  
  231.             user_online.onreadystatechange = function() { alert_online(user_online); };
  232.             user_online.open("POST", "modules/tchatche/online.php", true);
  233.             user_online.send(null);
  234.         }
  235.  
  236.         function alert_online(user_online)
  237.         {
  238.             if (user_online.readyState == 4)
  239.                     {
  240.                         if (user_online.status == 200)
  241.                         {
  242.                             document.getElementById(\'u_online\').innerHTML=user_online.responseText;
  243.                             
  244.                         }
  245.                     }
  246.         }
  247.         
  248.         
  249.         setInterval(\'online()\', 60000);
  250.         window.onload = online();
  251.         '."\n";
  252.         $main .= '</script>'."\n";
  253.         
  254.         if(!empty($data))
  255.         {
  256.         $main .= '<li><img src="'.(file_exists('modules/tchatche/theme/user.png') ? 'modules/tchatche/theme/user.png' : 'themes/'.$K_theme.'/images/user.png' ).'" alt="" /> <a href="'.url_rw('index.php?mod=espace_membre&amp;ac=profil&amp;id='.$data->user,array($data->userName)).'" title="Dernière connexion : '.date('H:i:s',$data->last_time).'">'.$data->userName.'</a></li>'."\n";
  257.         }
  258.         
  259.         echo $main;    
  260.     }
  261.     
  262.     function tchatche_onlinef()
  263.     {
  264.     
  265.     $main = null;
  266.     $main .= '</ul>'."\n";
  267.     
  268.     echo $main;
  269.     
  270.     }
  271.  
  272. } // FIN CLASS
  273.  
  274. ?>
  275.  
  276.  


Comtois , rends toi! Neni ma foi! | http://www.design.bouliz.com | http://www.bouliz.com
Qui c'est les plus forts, évidemment c'est les verts!!!
userbar_112987970.png


fleche bas[TChat] Module de Tchat Communautaire  [22 réponses]

Répondre



puce Index du Forum  » Portail & Modules  » Modifications et Créations des modules