Les archives de FluxBB.fr
Vous n'êtes pas identifié(e).
Nop, mais là c'est un problème JS fin plutôt AJAX, donc j'te dirais bien de regarder via firebug si ya une erreur, mais ca t'avanceras pas. Essayes de remettre à nouveau les fichiers originaux
(principalement le fichier JS)
Hors ligne
Merci, j'ai eu un problème donc 'jai tout réinstallé mais maintenant, ya plus rien. Je commance à l'étape 1, sava j'écrit 2-3 messages, j'actualise et paf, yen a plus qu'un.
Ensuite les couleurs ne marchent pas. :'( je suis maudit.
Hors ligne
Houla O__o
J'te dirais bien files moi tout tes fichiers, mais ca fait pas mal de taff à tout regarder, donc là .. Ca sera sans moi :x
Tu peux vérifier que tout est ok niveau bdd (insertion des messages).
Pour les couleurs ya aucune raison que ça ne marchent pas, si les modifs sont bien faites.
Hors ligne
..........
Dernière modification par jokerz (24-05-2011 12:22:16)
Hors ligne
Yop,
Alors pour les rang perso c'est pas installer, suffit de relire mes post précédant pour le refaire.
Pareil pour la fonction /clean..
En gros, à vue d'oeil il s'agit du fichier original principal, et sans vouloir te prendre pour ce que tu n'es surement pas. Pourquoi me demander de vérifier un fichier sur lequel tu n'as absolument rien fait
?
J'veux bien être gentil, sympa et serviable, mais faut pas me prendre pour un con non plus..
Pour les demandes de ce genre, j'te conseille vraiment de faire un tour sur le site du zero, et de te mettre au php/mysql et ajax au passage (même si là en l'occurrence il t'est inutile).
Toutes les modifications ont été données, ya absolument pas de raison que cela ne fonctionne pas. A toi d'apprendre de tes erreurs et de les corriger maintenant 
Hors ligne
Oui, je m'embale. Je viens de tout refaire. Diverses problèmes arrivent e tje ne sais quoi faire. Certains, supprimer else, d'autre le }
Je ne sais que faire.
J'ai pourtant tout refait.
Faut t'il changer ses else et } aux lignes 692, 282 et d'autres ?
en gros ça me donne ceci;
<?php
/***********************************************************************
Copyright (C) 2002-2005 Rickard Andersson (rickard@punbb.org)
This file is part of PunBB.
PunBB is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
PunBB is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
Contributeur: Traduction française
Patrice Bourgeois ©2006 www.libravis.com ®
Rajout de la possibilité de modifier/supprimer les messages de la ChatBox by chico200987 for Toxitrip.
************************************************************************/
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
require PUN_ROOT.'include/parser.php';
if (!$pun_config['cb_pbb_version'])
message('Poki BB Chatbox n\'est pas installée correctement. Assurez-vous d\'avoir lancé le fichier install_mod.php');
if ($pun_user['g_read_board'] == '0')
message($lang_common['No view']);
// Load the chatbox.php and post.php language file
require PUN_ROOT.'lang/'.$pun_user['language'].'/chatbox.php';
require PUN_ROOT.'lang/'.$pun_user['language'].'/post.php';
// Same funtion that php native rawurldecode() but with utf8 support
function utf8RawUrlDecode ($source) {
$decodedStr = "";
$pos = 0;
$len = strlen ($source);
while ($pos < $len) {
$charAt = substr ($source, $pos, 1);
if ($charAt == '%') {
$pos++;
$charAt = substr ($source, $pos, 1);
if ($charAt == 'u') {
// We got a unicode character
$pos++;
$unicodeHexVal = substr ($source, $pos, 4);
$unicode = hexdec ($unicodeHexVal);
$entity = "&#". $unicode . ';';
$decodedStr .= utf8_encode ($entity);
$pos += 4;
}
else {
// We have an escaped ascii character
$hexVal = substr ($source, $pos, 2);
$decodedStr .= chr (hexdec ($hexVal));
$pos += 2;
}
} else {
$decodedStr .= $charAt;
$pos++;
}
}
return $decodedStr;
}
// Error function for ajax queries
function error_ajax($message, $file, $line, $db_error = false)
{
global $pun_config, $lang_chatbox;
// Defaut error reponse
$error = $pun_config['cb_space'].$pun_config['cb_ajax_errors'];
$error = str_replace('<pun_error>', $lang_chatbox['Error Title'], $error);
$error = str_replace('<pun_date>', format_time(time()), $error);
$error_ajax_msg = '';
if (!defined('PUN_DEBUG') && $file != false && $line != false)
{
$error_ajax_msg .= '<strong>File:</strong> '.$file.'<br /><strong>Line:</strong> '.$line.'<br /><br /><strong>PunBB reported</strong>: '.$message;
if ($db_error)
{
$error_ajax_msg .= '<br /><br /><strong>Database reported:</strong> '.pun_htmlspecialchars($db_error['error_msg']).(($db_error['error_no']) ? ' (Errno: '.$db_error['error_no'].')' : '');
if ($db_error['error_sql'] != '')
$error_ajax_msg .= '<br /><br /><strong>Failed query:</strong> '.pun_htmlspecialchars($db_error['error_sql']);
}
}
else
$error_ajax_msg .= $message;
// If a database connection was established (before this error) we close it
if ($db_error)
$GLOBALS['db']->close();
exit('error:chat'.str_replace('<pun_error_text>', $error_ajax_msg, $error));
}
// If it's AJAX request
if (isset($_POST['ajax']) || isset($_GET['ajax'])) {
// Send no-cache headers
header('Expires: Thu, 21 Jul 1977 07:30:00 GMT'); // When yours truly first set eyes on this world! :)
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache'); // For HTTP/1.0 compability
header('Content-type: text/html; charset='.$lang_common['lang_encoding']);
// If new message was submit
if (isset($_POST['ajax'])) {
// Decode
$_POST['req_message'] = utf8RawUrlDecode($_POST['req_message']);
$_POST['form_user'] = utf8RawUrlDecode($_POST['form_user']);
$_POST['req_username'] = utf8RawUrlDecode($_POST['req_username']);
$_POST['req_email'] = utf8RawUrlDecode($_POST['req_email']);
$_POST['email'] = utf8RawUrlDecode($_POST['email']);
// Defaut error reponse
$error = $pun_config['cb_space'].$pun_config['cb_ajax_errors'];
$error = str_replace('<pun_error>', $lang_chatbox['Error Title'], $error);
$error = str_replace('<pun_date>', format_time(time()), $error);
// Make sure form_user is correct
if (($pun_user['is_guest'] && $_POST['form_user'] != 'Guest') || (!$pun_user['is_guest'] && $_POST['form_user'] != $pun_user['username']))
error_ajax(parse_message($lang_common['Bad request'], 0), false, false, false);
// Do we have permission to post?
if ($pun_user['g_post_chatbox'] != '1')
error_ajax(parse_message($lang_chatbox['No Post Permission'], 0), false, false, false);
// Flood protection
if (!$pun_user['is_guest'] && $pun_user['last_post_chatbox'] != '' && (time() - $pun_user['last_post_chatbox']) < $pun_user['g_post_flood_chatbox'])
error_ajax(parse_message($lang_post['Flood start'].' '.$pun_user['g_post_flood_chatbox'].' '.$lang_post['flood end'], 0), false, false, false);
// If it's Guest
if ($pun_user['is_guest']) {
$result = $db->query('SELECT id, poster_ip, posted FROM '.$db->prefix.'chatbox_msg WHERE poster_ip=\''.get_remote_address().'\' ORDER BY posted DESC LIMIT 1') or error_ajax('Unable to fetch messages for flood protection', __FILE__, __LINE__, $db->error());
$cur_post = $db->fetch_assoc($result);
if ((time() - $cur_post['posted']) < $pun_user['g_post_flood_chatbox'])
error_ajax(parse_message($lang_post['Flood start'].' '.$pun_user['g_post_flood_chatbox'].' '.$lang_post['flood end'], 0), false, false, false);
}
// If the user is logged in we get the username and e-mail from $pun_user
if (!$pun_user['is_guest']) {
$username = $pun_user['username'];
$email = $pun_user['email'];
}
// Otherwise it should be in $_POST
else {
$username = trim($_POST['req_username']);
$email = strtolower(trim(($pun_config['p_force_guest_email'] == '1') ? $_POST['req_email'] : $_POST['email']));
// Load the register.php/profile.php language files
require PUN_ROOT.'lang/'.$pun_user['language'].'/prof_reg.php';
require PUN_ROOT.'lang/'.$pun_user['language'].'/register.php';
// It's a guest, so we have to validate the username
if (strlen($username) < 2)
error_ajax(parse_message($lang_prof_reg['Username too short'], 0), false, false, false);
else if (!strcasecmp($username, 'Guest') || !strcasecmp($username, $lang_common['Guest']))
error_ajax(parse_message($lang_prof_reg['Username guest'], 0), false, false, false);
else if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $username))
error_ajax(parse_message($lang_prof_reg['Username IP'], 0), false, false, false);
if ((strpos($username, '[') !== false || strpos($username, ']') !== false) && strpos($username, '\'') !== false && strpos($username, '"') !== false)
error_ajax(parse_message($lang_prof_reg['Username reserved chars'], 0), false, false, false);
if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[quote=|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username))
error_ajax(parse_message($lang_prof_reg['Username BBCode'], 0), false, false, false);
// Check username for any censored words
$temp = censor_words($username);
if ($temp != $username)
error_ajax(parse_message($lang_register['Username censor'], 0), false, false, false);
// Check that the username (or a too similar username) is not already registered
$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE username=\''.$db->escape($username).'\' OR username=\''.$db->escape(preg_replace('/[^\w]/', '', $username)).'\'') or error_ajax('Unable to fetch user info', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result)) {
$busy = $db->result($result);
error_ajax(parse_message($lang_register['Username dupe 1'].' '.pun_htmlspecialchars($busy).'. '.$lang_register['Username dupe 2'], 0), false, false, false);
}
if ($pun_config['p_force_guest_email'] == '1' || $email != '') {
require PUN_ROOT.'include/email.php';
if (!is_valid_email($email))
error_ajax(parse_message($lang_common['Invalid e-mail'], 0), false, false, false);
}
}
// Clean up message from POST
$message = pun_linebreaks(pun_trim($_POST['req_message']));
if(preg_match('#^\/clean$#',$message) && $pun_user['group_id'] == 1){
// Ta fonction clean
$message = 'La chatbox a été vidée, merci d\'actualiser la page.';
$db->query('DELETE FROM '.$db->prefix.'chatbox_msg') or die ('LA REQUETE EST FAUSSE !!!!!!');
}
if ($message == '')
error_ajax(parse_message($lang_chatbox['Error No message'], 0), false, false, false);
else if (strlen($message) > $pun_config['cb_msg_maxlength'])
error_ajax(parse_message($lang_chatbox['Error Too long message'], 0), false, false, false);
else if ($pun_config['p_message_all_caps'] == '0' && strtoupper($message) == $message && $pun_user['g_id'] > PUN_MOD)
$message = ucwords(strtolower($message));
$parse_errors = '';
// Validate BBCode syntax
if ($pun_config['p_message_bbcode'] == '1' && strpos($message, '[') !== false && strpos($message, ']') !== false)
$message = preparse_bbcode($message, $parse_errors);
if ($parse_errors != '')
error_ajax(parse_message($parse_errors[0], 0), false, false, false);
// Get the time
$now = time();
if (!$pun_user['is_guest']) {
// Insert message
$db->query('INSERT INTO '.$db->prefix.'chatbox_msg (poster, poster_id, poster_ip, message, posted) VALUES(\''.$db->escape($username).'\', '.$pun_user['id'].', \''.get_remote_address().'\', \''.$db->escape($message).'\', '.$now.')') or error_ajax('Unable to post message', __FILE__, __LINE__, $db->error());
// Increment his/her chatbox post count
$low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';
$db->query('UPDATE '.$low_prio.$db->prefix.'users SET num_posts_chatbox=num_posts_chatbox+1, last_post_chatbox='.$now.' WHERE id='.$pun_user['id']) or error_ajax('Unable to update user', __FILE__, __LINE__, $db->error());
}
else {
// Insert message
$email_sql = ($pun_config['p_force_guest_email'] == '1' || $email != '') ? '\''.$email.'\'' : 'NULL';
$db->query('INSERT INTO '.$db->prefix.'chatbox_msg (poster, poster_id, poster_ip, poster_email, message, posted) VALUES(\''.$db->escape($username).'\', '.$pun_user['id'].', \''.get_remote_address().'\', '.$email_sql.', \''.$db->escape($message).'\', '.$now.')') or error_ajax('Unable to post message', __FILE__, __LINE__, $db->error());
}
$count = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'chatbox_msg') or error_ajax('Unable to fetch chatbox post count', __FILE__, __LINE__, $db->error());
$num_post = $db->result($count);
$limit = ($num_post-$pun_config['cb_max_msg'] <= 0) ? 0 : $num_post-$pun_config['cb_max_msg'];
$result = $db->query('SELECT id,posted FROM '.$db->prefix.'chatbox_msg ORDER BY posted ASC LIMIT '.$limit) or error_ajax('Unable to select post to delete', __FILE__, __LINE__, $db->error());
while ($del_msg = $db->fetch_assoc($result))
$db->query('DELETE FROM '.$db->prefix.'chatbox_msg WHERE id = '.$del_msg['id'].' LIMIT 1') or error_ajax('Unable to delete post', __FILE__, __LINE__, $db->error());
exit('PostedInDB');
}
// Now we list all new message
$cur_msg_txt = '';
$response = '';
$count_id = array();
// Define last message timestamp
$last_msg_time = intval($_GET['last_msg']);
$messages = $db->query('SELECT u.id, u.group_id, u.num_posts_chatbox, u.title, m.id AS m_id, m.poster_id, m.poster, m.poster_ip, m.poster_email, m.message, m.posted, g.g_id, g.g_color, g.g_title_chatbox FROM '.$db->prefix.'chatbox_msg AS m INNER JOIN '.$db->prefix.'users AS u ON u.id=m.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE m.posted > '.$last_msg_time.' ORDER BY m.posted ASC LIMIT 0,50') or error_ajax('Unable to fetch messages', __FILE__, __LINE__, $db->error());
while ($cur_msg = $db->fetch_assoc($messages)) {
if(!is_null($cur_msg['title'])){
$cur_msg_txt = $pun_config['cb_space'].$cur_msg['title'].$pun_config['cb_disposition'];
}else
if(!is_null($cur_msg['title']) && $cur_msg['group_id'] !=1){
$title = '<strong><span style="color:'.$cur_msg['g_color'].'">['.$cur_msg['title'].']</span></strong>';
$cur_msg_txt = $pun_config['cb_space'].$title.$pun_config['cb_disposition'];
}elseif($cur_msg['group_id'] ==1){
if($cur_msg['poster_id'] == 1){
$title = '<strong><font color="green">Administrateur N°1</font color></b></strong>';
}else if($cur_msg['poster_id'] == 3){
$title = '<strong><font color="green">Administrateur N°2</font color></b></strong>';
}else if ($cur_msg['poster_id'] == 4){
$title = '<strong><font color="green">Administrateur N°4</font color></b></strong>';
}
$cur_msg_txt = $pun_config['cb_space'].$title.$pun_config['cb_disposition'];
}else
$cur_msg_txt = $pun_config['cb_space'].$cur_msg['g_title_chatbox'].$pun_config['cb_disposition'];
}else
$cur_msg_txt = $pun_config['cb_space'].$cur_msg['g_title_chatbox'].$pun_config['cb_disposition'];
}else
$cur_msg_txt = $pun_config['cb_space'].$cur_msg['g_title_chatbox'].$pun_config['cb_disposition']; // Define last message timestamp
$last_msg_time = intval($cur_msg['posted']);
// Replace <pun_username>
if ($cur_msg['g_id'] != PUN_GUEST)
$cur_msg_txt = str_replace('<pun_username>', '<a href="profile.php?id='.$cur_msg['id'].'">'.pun_htmlspecialchars($cur_msg['poster']).'</a>', $cur_msg_txt);
else
$cur_msg_txt = str_replace('<pun_username>', pun_htmlspecialchars($cur_msg['poster']), $cur_msg_txt);
// Replace <pun_date>
$cur_msg_txt = str_replace('<pun_date>', format_time($cur_msg['posted']), $cur_msg_txt);
// Replace <pun_nbpost>
if ($cur_msg['g_id'] != PUN_GUEST)
$cur_msg_txt = str_replace('<pun_nbpost>', $cur_msg['num_posts_chatbox'], $cur_msg_txt);
else {
if (!isset($count_id[$cur_msg['poster']])) {
$like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';
$count = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'chatbox_msg WHERE poster '.$like_command.' \''.$db->escape(str_replace('*', '%', $cur_msg['poster'])).'\'') or error_ajax('Unable to fetch user chatbox post count', __FILE__, __LINE__, $db->error());
$num_post = $db->result($count);
$count_id[$cur_msg['poster']] = $num_post;
}
else
$num_post = $count_id[$cur_msg['poster']];
$cur_msg_txt = str_replace('<pun_nbpost>', $num_post, $cur_msg_txt);
}
// Replace <pun_nbpost_txt>
$cur_msg_txt = str_replace('<pun_nbpost_txt>', $lang_chatbox['Posts'], $cur_msg_txt);
// Add admin feature and replace <pun_admin>
if ($pun_user['g_id'] < PUN_GUEST) {
$cur_msg_admin = ' [ <a href="chatbox.php?get_host='.$cur_msg['m_id'].'">'.$cur_msg['poster_ip'].'</a>';
/*********************** Petite modification ici ***********************/
if ($cur_msg['poster_email'])
{
$cur_msg_admin .= ' | <a href="mailto:'.$cur_msg['poster_email'].'">'.$lang_common['E-mail'].'</a> ] ';
$cur_msg_admin .= '[ <a href="chatbox.php?mod_post='.$cur_msg['m_id'].'"> Modifier </a> ] [ <a href="chatbox.php?del_post='.$cur_msg['m_id'].'"> Supprimer </a> ]';
}
else
{
$cur_msg_admin .= ' ] ';
$cur_msg_admin .= '[ <a href="chatbox.php?mod_post='.$cur_msg['m_id'].'"> Modifier </a> ] [ <a href="chatbox.php?del_post='.$cur_msg['m_id'].'"> Supprimer </a> ]';
}
/*********************** Fin modification ****************************/
}
else
$cur_msg_admin = '';
$cur_msg_txt = str_replace('<pun_admin>', $cur_msg_admin, $cur_msg_txt);
// Replace <pun_message>
$cur_msg_txt = str_replace('<pun_message>', parse_message($cur_msg['message'], 0), $cur_msg_txt);
$response .= $cur_msg_txt . "\n";
}
// If no new message we return the timestamp
if (!$response)
$response = $last_msg_time;
else
$response = $last_msg_time.$response;
$response = pun_trim($response);
exit($response);
}
// This particular function doesn't require forum-based moderator access. It can be used
// by all moderators and admins.
/**************************** Début des nouvelles fonctions *******************************/
// Si l'on a cliqué sur Modifier
if(isset($_GET['del_post']))
{
// On vérifie si on a les droits
if ($pun_user['g_id'] > PUN_MOD)
message($lang_common['No permission']);
// On récupère l'id du post à supprimer
$adel = $_GET['del_post'];
// On la supprime de la base
$db->query('DELETE FROM '.$db->prefix.'chatbox_msg WHERE id='.$adel) or error('Unable to delete message', __FILE__, __LINE__, $db->error());
}
//Si l'on a cliqué sur Modifier
if (isset($_GET['mod_post']))
{
//On vérifie qu'on a les droits
if ($pun_user['g_id'] > PUN_MOD)
message($lang_common['No permission']);
// On récupere l'id du post à modifier
$amod = $_GET['mod_post'];
// Si on modifie le message
if (isset($_POST['txtMod']))
{
// On récupère le nouveau message
$txtMod = $_POST['txtMod'];
// Et on modifie la base !
$db->query('UPDATE '.$db->prefix.'chatbox_msg SET message="'.$txtMod.'" WHERE id="'.$amod.'"') or error('Unable to modify message', __FILE__, __LINE__, $db->error());
}
else
{
// Sinon on récupère le texte à modifier
$res = $db->query('SELECT message FROM '.$db->prefix.'chatbox_msg WHERE id='.$amod) or error('Unable to mod message', __FILE__, __LINE__, $db->error());
$msg = $db->result($res);
//Et on l'insère dans un formulaire contenant un TextBox
message('<form name="frmMod" method="POST"><input type="texte" value="'.$msg.'" name="txtMod" /><input type="submit"></form>');
}
}
/**************************** Fin des nouvelles fonctions *******************************/
if (isset($_GET['get_host']))
{
if ($pun_user['g_id'] > PUN_MOD)
message($lang_common['No permission']);
// Is get_host an IP address or a post ID?
if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $_GET['get_host']))
$ip = $_GET['get_host'];
else {
$get_host = intval($_GET['get_host']);
if ($get_host < 1)
message($lang_common['Bad request']);
$result = $db->query('SELECT poster_ip FROM '.$db->prefix.'chatbox_msg WHERE id='.$get_host) or error('Unable to fetch post IP address', __FILE__, __LINE__, $db->error());
if (!$db->num_rows($result))
message($lang_common['Bad request']);
$ip = $db->result($result);
}
message('The IP address is: '.$ip.'<br />The host name is: '.@gethostbyaddr($ip).'<br /><br /><a href="admin_users.php?show_users='.$ip.'">Show more users for this IP</a>');
}
$page_title = pun_htmlspecialchars($lang_chatbox['Page_title']);
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';
if ($pun_user['g_read_chatbox'] != '1')
message($lang_chatbox['No Read Permission']);
// Did someone just hit "Submit"?
if (isset($_POST['form_sent'])) {
// Make sure form_user is correct
if (($pun_user['is_guest'] && $_POST['form_user'] != 'Guest') || (!$pun_user['is_guest'] && $_POST['form_user'] != $pun_user['username']))
message($lang_common['Bad request']);
// Do we have permission to post?
if ($pun_user['g_post_chatbox'] != '1')
message($lang_chatbox['No Post Permission']);
// Start with a clean slate
$errors = array();
// Flood protection
if (!$pun_user['is_guest'] && $pun_user['last_post_chatbox'] != '' && (time() - $pun_user['last_post_chatbox']) < $pun_user['g_post_flood_chatbox'])
$errors[] = $lang_post['Flood start'].' '.$pun_user['g_post_flood_chatbox'].' '.$lang_post['flood end'];
if ($pun_user['is_guest']) {
$result = $db->query('SELECT id, poster_ip, posted FROM '.$db->prefix.'chatbox_msg WHERE poster_ip=\''.get_remote_address().'\' ORDER BY posted DESC LIMIT 1') or error('Unable to fetch messages for flood protection', __FILE__, __LINE__, $db->error());
$cur_post = $db->fetch_assoc($result);
if ((time() - $cur_post['posted']) < $pun_user['g_post_flood_chatbox'])
$errors[] = $lang_post['Flood start'].' '.$pun_user['g_post_flood_chatbox'].' '.$lang_post['flood end'];
}
// If the user is logged in we get the username and e-mail from $pun_user
if (!$pun_user['is_guest']) {
$username = $pun_user['username'];
$email = $pun_user['email'];
}
// Otherwise it should be in $_POST
else
{
$username = trim($_POST['req_username']);
$email = strtolower(trim(($pun_config['p_force_guest_email'] == '1') ? $_POST['req_email'] : $_POST['email']));
// Load the register.php/profile.php language files
require PUN_ROOT.'lang/'.$pun_user['language'].'/prof_reg.php';
require PUN_ROOT.'lang/'.$pun_user['language'].'/register.php';
// It's a guest, so we have to validate the username
if (strlen($username) < 2)
$errors[] = $lang_prof_reg['Username too short'];
else if (!strcasecmp($username, 'Guest') || !strcasecmp($username, $lang_common['Guest']))
$errors[] = $lang_prof_reg['Username guest'];
else if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $username))
$errors[] = $lang_prof_reg['Username IP'];
if ((strpos($username, '[') !== false || strpos($username, ']') !== false) && strpos($username, '\'') !== false && strpos($username, '"') !== false)
$errors[] = $lang_prof_reg['Username reserved chars'];
if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[quote=|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username))
$errors[] = $lang_prof_reg['Username BBCode'];
// Check username for any censored words
$temp = censor_words($username);
if ($temp != $username)
$errors[] = $lang_register['Username censor'];
// Check that the username (or a too similar username) is not already registered
$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE username=\''.$db->escape($username).'\' OR username=\''.$db->escape(preg_replace('/[^\w]/', '', $username)).'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result)) {
$busy = $db->result($result);
$errors[] = $lang_register['Username dupe 1'].' '.pun_htmlspecialchars($busy).'. '.$lang_register['Username dupe 2'];
}
if ($pun_config['p_force_guest_email'] == '1' || $email != '') {
require PUN_ROOT.'include/email.php';
if (!is_valid_email($email))
$errors[] = $lang_common['Invalid e-mail'];
}
}
// Clean up message from POST
$message = pun_linebreaks(pun_trim($_POST['req_message']));
if(preg_match('#^\/clean$#',$message) && $pun_user['group_id'] == 1){
// Ta fonction clean
$message = 'La chatbox a été vidée, merci d\'actualiser la page';
$db->query('DELETE FROM '.$db->prefix.'chatbox_msg') or die ('LA REQUETE EST FAUSSE !!!!!!');
}
if ($message == '')
$errors[] = $lang_chatbox['Error No message'];
else if (strlen($message) > $pun_config['cb_msg_maxlength'])
$errors[] = $lang_chatbox['Error Too long message'];
else if ($pun_config['p_message_all_caps'] == '0' && strtoupper($message) == $message && $pun_user['g_id'] > PUN_MOD)
$message = ucwords(strtolower($message));
// Validate BBCode syntax
if ($pun_config['p_message_bbcode'] == '1' && strpos($message, '[') !== false && strpos($message, ']') !== false)
$message = preparse_bbcode($message, $errors);
// Did everything go according to plan?
if (empty($errors)) {
$now = time();
if (!$pun_user['is_guest']) {
// Insert message
$db->query('INSERT INTO '.$db->prefix.'chatbox_msg (poster, poster_id, poster_ip, message, posted) VALUES(\''.$db->escape($username).'\', '.$pun_user['id'].', \''.get_remote_address().'\', \''.$db->escape($message).'\', '.$now.')') or error('Unable to post message', __FILE__, __LINE__, $db->error());
// Increment his/her chatbox post count
$low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';
$db->query('UPDATE '.$low_prio.$db->prefix.'users SET num_posts_chatbox=num_posts_chatbox+1, last_post_chatbox='.$now.' WHERE id='.$pun_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());
}
else {
// Insert message
$email_sql = ($pun_config['p_force_guest_email'] == '1' || $email != '') ? '\''.$email.'\'' : 'NULL';
$db->query('INSERT INTO '.$db->prefix.'chatbox_msg (poster, poster_id, poster_ip, poster_email, message, posted) VALUES(\''.$db->escape($username).'\', '.$pun_user['id'].', \''.get_remote_address().'\', '.$email_sql.', \''.$db->escape($message).'\', '.$now.')') or error('Unable to post message', __FILE__, __LINE__, $db->error());
}
$count = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'chatbox_msg') or error('Unable to fetch chatbox post count', __FILE__, __LINE__, $db->error());
$num_post = $db->result($count);
$limit = ($num_post-$pun_config['cb_max_msg'] <= 0) ? 0 : $num_post-$pun_config['cb_max_msg'];
$result = $db->query('SELECT id,posted FROM '.$db->prefix.'chatbox_msg ORDER BY posted ASC LIMIT '.$limit) or error('Unable to select post to delete', __FILE__, __LINE__, $db->error());
while ($del_msg = $db->fetch_assoc($result))
$db->query('DELETE FROM '.$db->prefix.'chatbox_msg WHERE id = '.$del_msg['id'].' LIMIT 1') or error('Unable to delete post', __FILE__, __LINE__, $db->error());
$_POST['req_message'] = NULL;
}
}
// If there are errors, we display them
if (!empty($errors))
{
?>
<div id="posterror" class="block">
<h2><span><?php echo $lang_post['Post errors'] ?></span></h2>
<div class="box">
<div class="inbox">
<p><?php echo $lang_post['Post errors info'] ?></p>
<ul>
<?php
while (list(, $cur_error) = each($errors))
echo "\t\t\t\t".'<li><strong>'.$cur_error.'</strong></li>'."\n";
?>
</ul>
</div>
</div>
</div>
<?php
}
?>
<script type="text/javascript" src="include/lib/js/prototype.js"></script>
<script type="text/javascript" src="include/lib/js/chatbox.js"></script>
<div class="block">
<h2>
<span>
<span class="conr" ><img style="display:none;" id="loading" name="loading" src="img/chatbox/loading.gif" /></span>
<?php echo $lang_chatbox['Chatbox'] ?> <span style="font-size:7px;vertical-align:super;">© PBB ChatBox <?php if ($pun_config['o_show_version'] == '1') echo ' '.$pun_config['cb_pbb_version']; ?></span>
</span>
</h2>
<div class="box">
<div id="chatbox" class="inbox" style="overflow:auto;height:<?php echo $pun_config['cb_height'] ?>px;">
<?php
$cur_msg_txt = '';
$last_msg_time = '';
$count_id = array();
$result = $db->query('SELECT u.id, u.group_id, u.num_posts_chatbox, u.title, m.id AS m_id, m.poster_id, m.poster, m.poster_ip, m.poster_email, m.message, m.posted, g.g_id, g.g_color, g.g_title_chatbox FROM '.$db->prefix.'chatbox_msg AS m INNER JOIN '.$db->prefix.'users AS u ON u.id=m.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id ORDER BY m.posted DESC LIMIT '.$pun_config['cb_max_msg']) or error('Unable to fetch messages', __FILE__, __LINE__, $db->error());
$new_msg_time = false;
while ($cur_msg = $db->fetch_assoc($result)) {
// Get newest timestamp
if ($new_msg_time == false) {
$last_msg_time = $cur_msg['posted'];
$new_msg_time = true;
}
if(!is_null($cur_msg['title'])){
$cur_msg_txt = $pun_config['cb_space'].$cur_msg['title'].$pun_config['cb_disposition'];
}else
if(!is_null($cur_msg['title']) && $cur_msg['group_id'] !=1){
$title = '<strong><span style="color:'.$cur_msg['g_color'].'">['.$cur_msg['title'].']</span></strong>';
$cur_msg_txt = $pun_config['cb_space'].$title.$pun_config['cb_disposition'];
}elseif($cur_msg['group_id'] ==1){
if($cur_msg['poster_id'] == 1){
$title = '<strong><font color="green">Administrateur N°1</font color></b></strong>';
}else if($cur_msg['poster_id'] == 3){
$title = '<strong><font color="green">Administrateur N°2</font color></b></strong>';
}else if ($cur_msg['poster_id'] == 4){
$title = '<strong><font color="green">Administrateur N°4</font color></b></strong>';
}
$cur_msg_txt = $pun_config['cb_space'].$title.$pun_config['cb_disposition'];
}else
$cur_msg_txt = $pun_config['cb_space'].$cur_msg['g_title_chatbox'].$pun_config['cb_disposition'];
}else
$cur_msg_txt = $pun_config['cb_space'].$cur_msg['g_title_chatbox'].$pun_config['cb_disposition'];
}else
$cur_msg_txt = $pun_config['cb_space'].$cur_msg['g_title_chatbox'].$pun_config['cb_disposition']; if ($cur_msg['g_id'] != PUN_GUEST)
$cur_msg_txt = str_replace('<pun_username>', '<a href="profile.php?id='.$cur_msg['id'].'">'.pun_htmlspecialchars($cur_msg['poster']).'</a>', $cur_msg_txt);
else
$cur_msg_txt = str_replace('<pun_username>', pun_htmlspecialchars($cur_msg['poster']), $cur_msg_txt);
$cur_msg_txt = str_replace('<pun_date>', format_time($cur_msg['posted']), $cur_msg_txt);
if ($cur_msg['g_id'] != PUN_GUEST)
$cur_msg_txt = str_replace('<pun_nbpost>', $cur_msg['num_posts_chatbox'], $cur_msg_txt);
else {
if (!isset($count_id[$cur_msg['poster']])) {
$like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';
$count = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'chatbox_msg WHERE poster '.$like_command.' \''.$db->escape(str_replace('*', '%', $cur_msg['poster'])).'\'') or error('Unable to fetch user chatbox post count', __FILE__, __LINE__, $db->error());
$num_post = $db->result($count);
$count_id[$cur_msg['poster']] = $num_post;
}
else
$num_post = $count_id[$cur_msg['poster']];
$cur_msg_txt = str_replace('<pun_nbpost>', $num_post, $cur_msg_txt);
}
$cur_msg_txt = str_replace('<pun_nbpost_txt>', $lang_chatbox['Posts'], $cur_msg_txt);
/**************************** Dernière modif ici ****************************** */
if ($pun_user['g_id'] < PUN_GUEST) {
$cur_msg_admin = ' [ <a href="chatbox.php?get_host='.$cur_msg['m_id'].'">'.$cur_msg['poster_ip'].'</a>';
if ($cur_msg['poster_email'])
{
$cur_msg_admin .= ' | <a href="mailto:'.$cur_msg['poster_email'].'">'.$lang_common['E-mail'].'</a> ]';
$cur_msg_admin .= '[ <a href="chatbox.php?mod_post='.$cur_msg['m_id'].'"> Modifier </a> ] [ <a href="chatbox.php?del_post='.$cur_msg['m_id'].'"> Supprimer </a> ]';
}
else
{
$cur_msg_admin .= ' ] ';
$cur_msg_admin .= '[ <a href="chatbox.php?mod_post='.$cur_msg['m_id'].'"> Modifier </a> ] [ <a href="chatbox.php?del_post='.$cur_msg['m_id'].'"> Supprimer </a> ]';
}
}
else
$cur_msg_admin = '';
/**************************** Fin dernière modif ****************************** */
$cur_msg_txt = str_replace('<pun_admin>', $cur_msg_admin, $cur_msg_txt);
$cur_msg_txt = str_replace('<pun_message>', parse_message($cur_msg['message'], 0), $cur_msg_txt);
}
if (!$cur_msg_txt)
echo $lang_chatbox['No Message'];
else
echo "\t\t\t".$cur_msg_txt."\n";
?>
</div>
</div>
<h2>
<span>
<script language="javascript">
<!--
// This checkbox is utterly useless, unless we have javascript enabled. As such, we won't display it until then.
document.write('<span class="conr" style="width:150px;" ><?php echo $lang_chatbox['Autoscroll'] ?>: <input type="checkbox" id="autoscroll" value="" checked tabindex="<?php echo $cur_index++ ?>" /></span>');
// -->
</script>
<?php
if ($pun_user['g_post_chatbox'] == '1') {
$cur_index = 1;
?>
<form id="post" method="post" name="formulaire" action="chatbox.php" onsubmit="send_message(); return false;">
<input type="hidden" name="form_sent" value="1" />
<input type="hidden" name="form_user" id="form_user" value="<?php echo (!$pun_user['is_guest']) ? pun_htmlspecialchars($pun_user['username']) : 'Guest'; ?>" />
<?php
if ($pun_user['is_guest']) {
$email_label = ($pun_config['p_force_guest_email'] == '1') ? '<strong>'.$lang_common['E-mail'].':</strong>' : $lang_common['E-mail'];
$email_form_name = ($pun_config['p_force_guest_email'] == '1') ? 'req_email' : 'email';
if($email_form_name = 'req_email')
echo "\t".'<input type="hidden" name="email" id="email" value="" />'."\n";
else
echo "\t".'<input type="hidden" name="req_email" id="req_email" value="" />'."\n";
?>
<strong><?php echo $lang_post['Guest name'] ?>:</strong> <input type="text" name="req_username" id="req_username" value="<?php if (isset($_POST['req_username'])) echo pun_htmlspecialchars($username); ?>" size="15" maxlength="25" tabindex="<?php echo $cur_index++ ?>" />
<?php echo $email_label ?> <input type="text" name="<?php echo $email_form_name ?>" id="<?php echo $email_form_name ?>" value="<?php if (isset($_POST[$email_form_name])) echo pun_htmlspecialchars($email); ?>" size="15" maxlength="50" tabindex="<?php echo $cur_index++ ?>" />
<?php
}
else {
?>
<input type="hidden" name="req_username" id="req_username" value="" />
<input type="hidden" name="email" id="email" value="" />
<input type="hidden" name="req_email" id="req_email" value="" />
<?php
}
?>
<strong><?php echo $lang_chatbox['Message'] ?>:</strong> <input type="text" name="req_message" id="req_message" value="<?php if (isset($_POST['req_message'])) echo pun_htmlspecialchars($message); ?>" size="35" maxlength="<?php echo $pun_config['cb_msg_maxlength'] ?>" tabindex="<?php echo $cur_index++ ?>" />
<input type="submit" name="submit" value="<?php echo $lang_chatbox['Btn Send'] ?>" accesskey="s" tabindex="<?php echo $cur_index++ ?>" />
<script language="javascript">
<!--
document.formulaire.req_message.focus();
// -->
</script>
</form>
<?php
}
else
echo $lang_chatbox['No Post Permission'];
?>
</span>
</h2>
</div>
<script language="javascript">
// Begin getting messages
var LastMsg = '<?php echo $last_msg_time; ?>';
$('autoscroll').value = 'true';
get_messages();
checker = new PeriodicalExecuter(get_messages, <?php echo $pun_config['cb_ajax_refresh']; ?>);
</script>
<?php
require PUN_ROOT.'footer.php';Hors ligne
Tu repose les mêmes questions qu'il y a deux jours, c'est si difficile que ça de te relire,ainsi que les replys de WinuX ...
Dit voir, tu as quel version de FluxBB ? Car tu demande de l'aide dans les deux branches ..
Hors ligne
Houla, je sais pas ce que t'as fait, mais t'as rajouter plein de choses inutile (pourtant j'pouvais pas être plus clair dans mes post precedant
)
J'ai pas testé, mais bon j'ai bien pris mon temps à vérifier :
<?php
/***********************************************************************
Copyright (C) 2002-2005 Rickard Andersson (rickard@punbb.org)
This file is part of PunBB.
PunBB is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
PunBB is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
Contributeur: Traduction française
Patrice Bourgeois ©2006 www.libravis.com ®
Rajout de la possibilité de modifier/supprimer les messages de la ChatBox by chico200987 for Toxitrip.
************************************************************************/
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
require PUN_ROOT.'include/parser.php';
if (!$pun_config['cb_pbb_version'])
message('Poki BB Chatbox n\'est pas installée correctement. Assurez-vous d\'avoir lancé le fichier install_mod.php');
if ($pun_user['g_read_board'] == '0')
message($lang_common['No view']);
// Load the chatbox.php and post.php language file
require PUN_ROOT.'lang/'.$pun_user['language'].'/chatbox.php';
require PUN_ROOT.'lang/'.$pun_user['language'].'/post.php';
// Same funtion that php native rawurldecode() but with utf8 support
function utf8RawUrlDecode ($source) {
$decodedStr = "";
$pos = 0;
$len = strlen ($source);
while ($pos < $len) {
$charAt = substr ($source, $pos, 1);
if ($charAt == '%') {
$pos++;
$charAt = substr ($source, $pos, 1);
if ($charAt == 'u') {
// We got a unicode character
$pos++;
$unicodeHexVal = substr ($source, $pos, 4);
$unicode = hexdec ($unicodeHexVal);
$entity = "&#". $unicode . ';';
$decodedStr .= utf8_encode ($entity);
$pos += 4;
}
else {
// We have an escaped ascii character
$hexVal = substr ($source, $pos, 2);
$decodedStr .= chr (hexdec ($hexVal));
$pos += 2;
}
} else {
$decodedStr .= $charAt;
$pos++;
}
}
return $decodedStr;
}
// Error function for ajax queries
function error_ajax($message, $file, $line, $db_error = false)
{
global $pun_config, $lang_chatbox;
// Defaut error reponse
$error = $pun_config['cb_space'].$pun_config['cb_ajax_errors'];
$error = str_replace('<pun_error>', $lang_chatbox['Error Title'], $error);
$error = str_replace('<pun_date>', format_time(time()), $error);
$error_ajax_msg = '';
if (!defined('PUN_DEBUG') && $file != false && $line != false)
{
$error_ajax_msg .= '<strong>File:</strong> '.$file.'<br /><strong>Line:</strong> '.$line.'<br /><br /><strong>PunBB reported</strong>: '.$message;
if ($db_error)
{
$error_ajax_msg .= '<br /><br /><strong>Database reported:</strong> '.pun_htmlspecialchars($db_error['error_msg']).(($db_error['error_no']) ? ' (Errno: '.$db_error['error_no'].')' : '');
if ($db_error['error_sql'] != '')
$error_ajax_msg .= '<br /><br /><strong>Failed query:</strong> '.pun_htmlspecialchars($db_error['error_sql']);
}
}
else
$error_ajax_msg .= $message;
// If a database connection was established (before this error) we close it
if ($db_error)
$GLOBALS['db']->close();
exit('error:chat'.str_replace('<pun_error_text>', $error_ajax_msg, $error));
}
// If it's AJAX request
if (isset($_POST['ajax']) || isset($_GET['ajax'])) {
// Send no-cache headers
header('Expires: Thu, 21 Jul 1977 07:30:00 GMT'); // When yours truly first set eyes on this world! :)
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache'); // For HTTP/1.0 compability
header('Content-type: text/html; charset='.$lang_common['lang_encoding']);
// If new message was submit
if (isset($_POST['ajax'])) {
// Decode
$_POST['req_message'] = utf8RawUrlDecode($_POST['req_message']);
$_POST['form_user'] = utf8RawUrlDecode($_POST['form_user']);
$_POST['req_username'] = utf8RawUrlDecode($_POST['req_username']);
$_POST['req_email'] = utf8RawUrlDecode($_POST['req_email']);
$_POST['email'] = utf8RawUrlDecode($_POST['email']);
// Defaut error reponse
$error = $pun_config['cb_space'].$pun_config['cb_ajax_errors'];
$error = str_replace('<pun_error>', $lang_chatbox['Error Title'], $error);
$error = str_replace('<pun_date>', format_time(time()), $error);
// Make sure form_user is correct
if (($pun_user['is_guest'] && $_POST['form_user'] != 'Guest') || (!$pun_user['is_guest'] && $_POST['form_user'] != $pun_user['username']))
error_ajax(parse_message($lang_common['Bad request'], 0), false, false, false);
// Do we have permission to post?
if ($pun_user['g_post_chatbox'] != '1')
error_ajax(parse_message($lang_chatbox['No Post Permission'], 0), false, false, false);
// Flood protection
if (!$pun_user['is_guest'] && $pun_user['last_post_chatbox'] != '' && (time() - $pun_user['last_post_chatbox']) < $pun_user['g_post_flood_chatbox'])
error_ajax(parse_message($lang_post['Flood start'].' '.$pun_user['g_post_flood_chatbox'].' '.$lang_post['flood end'], 0), false, false, false);
// If it's Guest
if ($pun_user['is_guest']) {
$result = $db->query('SELECT id, poster_ip, posted FROM '.$db->prefix.'chatbox_msg WHERE poster_ip=\''.get_remote_address().'\' ORDER BY posted DESC LIMIT 1') or error_ajax('Unable to fetch messages for flood protection', __FILE__, __LINE__, $db->error());
$cur_post = $db->fetch_assoc($result);
if ((time() - $cur_post['posted']) < $pun_user['g_post_flood_chatbox'])
error_ajax(parse_message($lang_post['Flood start'].' '.$pun_user['g_post_flood_chatbox'].' '.$lang_post['flood end'], 0), false, false, false);
}
// If the user is logged in we get the username and e-mail from $pun_user
if (!$pun_user['is_guest']) {
$username = $pun_user['username'];
$email = $pun_user['email'];
}
// Otherwise it should be in $_POST
else {
$username = trim($_POST['req_username']);
$email = strtolower(trim(($pun_config['p_force_guest_email'] == '1') ? $_POST['req_email'] : $_POST['email']));
// Load the register.php/profile.php language files
require PUN_ROOT.'lang/'.$pun_user['language'].'/prof_reg.php';
require PUN_ROOT.'lang/'.$pun_user['language'].'/register.php';
// It's a guest, so we have to validate the username
if (strlen($username) < 2)
error_ajax(parse_message($lang_prof_reg['Username too short'], 0), false, false, false);
else if (!strcasecmp($username, 'Guest') || !strcasecmp($username, $lang_common['Guest']))
error_ajax(parse_message($lang_prof_reg['Username guest'], 0), false, false, false);
else if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $username))
error_ajax(parse_message($lang_prof_reg['Username IP'], 0), false, false, false);
if ((strpos($username, '[') !== false || strpos($username, ']') !== false) && strpos($username, '\'') !== false && strpos($username, '"') !== false)
error_ajax(parse_message($lang_prof_reg['Username reserved chars'], 0), false, false, false);
if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[quote=|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username))
error_ajax(parse_message($lang_prof_reg['Username BBCode'], 0), false, false, false);
// Check username for any censored words
$temp = censor_words($username);
if ($temp != $username)
error_ajax(parse_message($lang_register['Username censor'], 0), false, false, false);
// Check that the username (or a too similar username) is not already registered
$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE username=\''.$db->escape($username).'\' OR username=\''.$db->escape(preg_replace('/[^\w]/', '', $username)).'\'') or error_ajax('Unable to fetch user info', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result)) {
$busy = $db->result($result);
error_ajax(parse_message($lang_register['Username dupe 1'].' '.pun_htmlspecialchars($busy).'. '.$lang_register['Username dupe 2'], 0), false, false, false);
}
if ($pun_config['p_force_guest_email'] == '1' || $email != '') {
require PUN_ROOT.'include/email.php';
if (!is_valid_email($email))
error_ajax(parse_message($lang_common['Invalid e-mail'], 0), false, false, false);
}
}
// Clean up message from POST
$message = pun_linebreaks(pun_trim($_POST['req_message']));
if(preg_match('#^\/clean$#',$message) && $pun_user['group_id'] == 1){
// Ta fonction clean
$message = 'La chatbox a été vidée, merci d\'actualiser la page.';
$db->query('DELETE FROM '.$db->prefix.'chatbox_msg') or die ('LA REQUETE EST FAUSSE !!!!!!');
}
if ($message == '')
error_ajax(parse_message($lang_chatbox['Error No message'], 0), false, false, false);
else if (strlen($message) > $pun_config['cb_msg_maxlength'])
error_ajax(parse_message($lang_chatbox['Error Too long message'], 0), false, false, false);
else if ($pun_config['p_message_all_caps'] == '0' && strtoupper($message) == $message && $pun_user['g_id'] > PUN_MOD)
$message = ucwords(strtolower($message));
$parse_errors = '';
// Validate BBCode syntax
if ($pun_config['p_message_bbcode'] == '1' && strpos($message, '[') !== false && strpos($message, ']') !== false)
$message = preparse_bbcode($message, $parse_errors);
if ($parse_errors != '')
error_ajax(parse_message($parse_errors[0], 0), false, false, false);
// Get the time
$now = time();
if (!$pun_user['is_guest']) {
// Insert message
$db->query('INSERT INTO '.$db->prefix.'chatbox_msg (poster, poster_id, poster_ip, message, posted) VALUES(\''.$db->escape($username).'\', '.$pun_user['id'].', \''.get_remote_address().'\', \''.$db->escape($message).'\', '.$now.')') or error_ajax('Unable to post message', __FILE__, __LINE__, $db->error());
// Increment his/her chatbox post count
$low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';
$db->query('UPDATE '.$low_prio.$db->prefix.'users SET num_posts_chatbox=num_posts_chatbox+1, last_post_chatbox='.$now.' WHERE id='.$pun_user['id']) or error_ajax('Unable to update user', __FILE__, __LINE__, $db->error());
}
else {
// Insert message
$email_sql = ($pun_config['p_force_guest_email'] == '1' || $email != '') ? '\''.$email.'\'' : 'NULL';
$db->query('INSERT INTO '.$db->prefix.'chatbox_msg (poster, poster_id, poster_ip, poster_email, message, posted) VALUES(\''.$db->escape($username).'\', '.$pun_user['id'].', \''.get_remote_address().'\', '.$email_sql.', \''.$db->escape($message).'\', '.$now.')') or error_ajax('Unable to post message', __FILE__, __LINE__, $db->error());
}
$count = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'chatbox_msg') or error_ajax('Unable to fetch chatbox post count', __FILE__, __LINE__, $db->error());
$num_post = $db->result($count);
$limit = ($num_post-$pun_config['cb_max_msg'] <= 0) ? 0 : $num_post-$pun_config['cb_max_msg'];
$result = $db->query('SELECT id,posted FROM '.$db->prefix.'chatbox_msg ORDER BY posted ASC LIMIT '.$limit) or error_ajax('Unable to select post to delete', __FILE__, __LINE__, $db->error());
while ($del_msg = $db->fetch_assoc($result))
$db->query('DELETE FROM '.$db->prefix.'chatbox_msg WHERE id = '.$del_msg['id'].' LIMIT 1') or error_ajax('Unable to delete post', __FILE__, __LINE__, $db->error());
exit('PostedInDB');
}
// Now we list all new message
$cur_msg_txt = '';
$response = '';
$count_id = array();
// Define last message timestamp
$last_msg_time = intval($_GET['last_msg']);
$messages = $db->query('SELECT u.id, u.group_id, u.num_posts_chatbox, u.title, m.id AS m_id, m.poster_id, m.poster, m.poster_ip, m.poster_email, m.message, m.posted, g.g_id, g.g_color, g.g_title_chatbox FROM '.$db->prefix.'chatbox_msg AS m INNER JOIN '.$db->prefix.'users AS u ON u.id=m.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE m.posted > '.$last_msg_time.' ORDER BY m.posted ASC LIMIT 0,50') or error_ajax('Unable to fetch messages', __FILE__, __LINE__, $db->error());
while ($cur_msg = $db->fetch_assoc($messages)) {
if(!is_null($cur_msg['title']) && $cur_msg['group_id'] !=1){ // Si ce n'est pas un admin et que le membre a un titre
$title = '<strong><span style="color:'.$cur_msg['g_color'].'">['.$cur_msg['title'].']</span></strong>';
$cur_msg_txt = $pun_config['cb_space'].$title.$pun_config['cb_disposition'];
}elseif($cur_msg['group_id'] ==1){ // Si c'est un admin
if($cur_msg['poster_id'] == 1){
$title = '<strong><font color="green">Administrateur N°1</font color></b></strong>'; // Premier Admin, titre à définir ainsi que l'id (poster_id)
}else if($cur_msg['poster_id'] == 3){
$title = '<strong><font color="green">Administrateur N°2</font color></b></strong>'; // Deuxieme Admin, titre à définir ainsi que l'id (poster_id)
}else if ($cur_msg['poster_id'] == 4){
$title = '<strong><font color="green">Administrateur N°4</font color></b></strong>'; // Troisième Admin, titre à définir ainsi que l'id (poster_id)
}
$cur_msg_txt = $pun_config['cb_space'].$title.$pun_config['cb_disposition'];
}else
$cur_msg_txt = $pun_config['cb_space'].$cur_msg['g_title_chatbox'].$pun_config['cb_disposition'];
// Define last message timestamp
$last_msg_time = intval($cur_msg['posted']);
// Replace <pun_username>
if ($cur_msg['g_id'] != PUN_GUEST)
$cur_msg_txt = str_replace('<pun_username>', '<a href="profile.php?id='.$cur_msg['id'].'">'.pun_htmlspecialchars($cur_msg['poster']).'</a>', $cur_msg_txt);
else
$cur_msg_txt = str_replace('<pun_username>', pun_htmlspecialchars($cur_msg['poster']), $cur_msg_txt);
// Replace <pun_date>
$cur_msg_txt = str_replace('<pun_date>', format_time($cur_msg['posted']), $cur_msg_txt);
// Replace <pun_nbpost>
if ($cur_msg['g_id'] != PUN_GUEST)
$cur_msg_txt = str_replace('<pun_nbpost>', $cur_msg['num_posts_chatbox'], $cur_msg_txt);
else {
if (!isset($count_id[$cur_msg['poster']])) {
$like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';
$count = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'chatbox_msg WHERE poster '.$like_command.' \''.$db->escape(str_replace('*', '%', $cur_msg['poster'])).'\'') or error_ajax('Unable to fetch user chatbox post count', __FILE__, __LINE__, $db->error());
$num_post = $db->result($count);
$count_id[$cur_msg['poster']] = $num_post;
}
else
$num_post = $count_id[$cur_msg['poster']];
$cur_msg_txt = str_replace('<pun_nbpost>', $num_post, $cur_msg_txt);
}
// Replace <pun_nbpost_txt>
$cur_msg_txt = str_replace('<pun_nbpost_txt>', $lang_chatbox['Posts'], $cur_msg_txt);
// Add admin feature and replace <pun_admin>
if ($pun_user['g_id'] < PUN_GUEST) {
$cur_msg_admin = ' [ <a href="chatbox.php?get_host='.$cur_msg['m_id'].'">'.$cur_msg['poster_ip'].'</a>';
/*********************** Petite modification ici ***********************/
if ($cur_msg['poster_email'])
{
$cur_msg_admin .= ' | <a href="mailto:'.$cur_msg['poster_email'].'">'.$lang_common['E-mail'].'</a> ] ';
$cur_msg_admin .= '[ <a href="chatbox.php?mod_post='.$cur_msg['m_id'].'"> Modifier </a> ] [ <a href="chatbox.php?del_post='.$cur_msg['m_id'].'"> Supprimer </a> ]';
}
else
{
$cur_msg_admin .= ' ] ';
$cur_msg_admin .= '[ <a href="chatbox.php?mod_post='.$cur_msg['m_id'].'"> Modifier </a> ] [ <a href="chatbox.php?del_post='.$cur_msg['m_id'].'"> Supprimer </a> ]';
}
/*********************** Fin modification ****************************/
}
else
$cur_msg_admin = '';
$cur_msg_txt = str_replace('<pun_admin>', $cur_msg_admin, $cur_msg_txt);
// Replace <pun_message>
$cur_msg_txt = str_replace('<pun_message>', parse_message($cur_msg['message'], 0), $cur_msg_txt);
$response .= $cur_msg_txt . "\n";
}
// If no new message we return the timestamp
if (!$response)
$response = $last_msg_time;
else
$response = $last_msg_time.$response;
$response = pun_trim($response);
exit($response);
}
// This particular function doesn't require forum-based moderator access. It can be used
// by all moderators and admins.
/**************************** Début des nouvelles fonctions *******************************/
// Si l'on a cliqué sur Modifier
if(isset($_GET['del_post']))
{
// On vérifie si on a les droits
if ($pun_user['g_id'] > PUN_MOD)
message($lang_common['No permission']);
// On récupère l'id du post à supprimer
$adel = $_GET['del_post'];
// On la supprime de la base
$db->query('DELETE FROM '.$db->prefix.'chatbox_msg WHERE id='.$adel) or error('Unable to delete message', __FILE__, __LINE__, $db->error());
}
//Si l'on a cliqué sur Modifier
if (isset($_GET['mod_post']))
{
//On vérifie qu'on a les droits
if ($pun_user['g_id'] > PUN_MOD)
message($lang_common['No permission']);
// On récupere l'id du post à modifier
$amod = $_GET['mod_post'];
// Si on modifie le message
if (isset($_POST['txtMod']))
{
// On récupère le nouveau message
$txtMod = $_POST['txtMod'];
// Et on modifie la base !
$db->query('UPDATE '.$db->prefix.'chatbox_msg SET message="'.$txtMod.'" WHERE id="'.$amod.'"') or error('Unable to modify message', __FILE__, __LINE__, $db->error());
}
else
{
// Sinon on récupère le texte à modifier
$res = $db->query('SELECT message FROM '.$db->prefix.'chatbox_msg WHERE id='.$amod) or error('Unable to mod message', __FILE__, __LINE__, $db->error());
$msg = $db->result($res);
//Et on l'insère dans un formulaire contenant un TextBox
message('<form name="frmMod" method="POST"><input type="texte" value="'.$msg.'" name="txtMod" /><input type="submit"></form>');
}
}
/**************************** Fin des nouvelles fonctions *******************************/
if (isset($_GET['get_host']))
{
if ($pun_user['g_id'] > PUN_MOD)
message($lang_common['No permission']);
// Is get_host an IP address or a post ID?
if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $_GET['get_host']))
$ip = $_GET['get_host'];
else {
$get_host = intval($_GET['get_host']);
if ($get_host < 1)
message($lang_common['Bad request']);
$result = $db->query('SELECT poster_ip FROM '.$db->prefix.'chatbox_msg WHERE id='.$get_host) or error('Unable to fetch post IP address', __FILE__, __LINE__, $db->error());
if (!$db->num_rows($result))
message($lang_common['Bad request']);
$ip = $db->result($result);
}
message('The IP address is: '.$ip.'<br />The host name is: '.@gethostbyaddr($ip).'<br /><br /><a href="admin_users.php?show_users='.$ip.'">Show more users for this IP</a>');
}
$page_title = pun_htmlspecialchars($lang_chatbox['Page_title']);
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';
if ($pun_user['g_read_chatbox'] != '1')
message($lang_chatbox['No Read Permission']);
// Did someone just hit "Submit"?
if (isset($_POST['form_sent'])) {
// Make sure form_user is correct
if (($pun_user['is_guest'] && $_POST['form_user'] != 'Guest') || (!$pun_user['is_guest'] && $_POST['form_user'] != $pun_user['username']))
message($lang_common['Bad request']);
// Do we have permission to post?
if ($pun_user['g_post_chatbox'] != '1')
message($lang_chatbox['No Post Permission']);
// Start with a clean slate
$errors = array();
// Flood protection
if (!$pun_user['is_guest'] && $pun_user['last_post_chatbox'] != '' && (time() - $pun_user['last_post_chatbox']) < $pun_user['g_post_flood_chatbox'])
$errors[] = $lang_post['Flood start'].' '.$pun_user['g_post_flood_chatbox'].' '.$lang_post['flood end'];
if ($pun_user['is_guest']) {
$result = $db->query('SELECT id, poster_ip, posted FROM '.$db->prefix.'chatbox_msg WHERE poster_ip=\''.get_remote_address().'\' ORDER BY posted DESC LIMIT 1') or error('Unable to fetch messages for flood protection', __FILE__, __LINE__, $db->error());
$cur_post = $db->fetch_assoc($result);
if ((time() - $cur_post['posted']) < $pun_user['g_post_flood_chatbox'])
$errors[] = $lang_post['Flood start'].' '.$pun_user['g_post_flood_chatbox'].' '.$lang_post['flood end'];
}
// If the user is logged in we get the username and e-mail from $pun_user
if (!$pun_user['is_guest']) {
$username = $pun_user['username'];
$email = $pun_user['email'];
}
// Otherwise it should be in $_POST
else
{
$username = trim($_POST['req_username']);
$email = strtolower(trim(($pun_config['p_force_guest_email'] == '1') ? $_POST['req_email'] : $_POST['email']));
// Load the register.php/profile.php language files
require PUN_ROOT.'lang/'.$pun_user['language'].'/prof_reg.php';
require PUN_ROOT.'lang/'.$pun_user['language'].'/register.php';
// It's a guest, so we have to validate the username
if (strlen($username) < 2)
$errors[] = $lang_prof_reg['Username too short'];
else if (!strcasecmp($username, 'Guest') || !strcasecmp($username, $lang_common['Guest']))
$errors[] = $lang_prof_reg['Username guest'];
else if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $username))
$errors[] = $lang_prof_reg['Username IP'];
if ((strpos($username, '[') !== false || strpos($username, ']') !== false) && strpos($username, '\'') !== false && strpos($username, '"') !== false)
$errors[] = $lang_prof_reg['Username reserved chars'];
if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[quote=|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username))
$errors[] = $lang_prof_reg['Username BBCode'];
// Check username for any censored words
$temp = censor_words($username);
if ($temp != $username)
$errors[] = $lang_register['Username censor'];
// Check that the username (or a too similar username) is not already registered
$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE username=\''.$db->escape($username).'\' OR username=\''.$db->escape(preg_replace('/[^\w]/', '', $username)).'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result)) {
$busy = $db->result($result);
$errors[] = $lang_register['Username dupe 1'].' '.pun_htmlspecialchars($busy).'. '.$lang_register['Username dupe 2'];
}
if ($pun_config['p_force_guest_email'] == '1' || $email != '') {
require PUN_ROOT.'include/email.php';
if (!is_valid_email($email))
$errors[] = $lang_common['Invalid e-mail'];
}
}
// Clean up message from POST
$message = pun_linebreaks(pun_trim($_POST['req_message']));
if(preg_match('#^\/clean$#',$message) && $pun_user['group_id'] == 1){
// Ta fonction clean
$message = 'La chatbox a été vidée, merci d\'actualiser la page';
$db->query('DELETE FROM '.$db->prefix.'chatbox_msg') or die ('LA REQUETE EST FAUSSE !!!!!!');
}
if ($message == '')
$errors[] = $lang_chatbox['Error No message'];
else if (strlen($message) > $pun_config['cb_msg_maxlength'])
$errors[] = $lang_chatbox['Error Too long message'];
else if ($pun_config['p_message_all_caps'] == '0' && strtoupper($message) == $message && $pun_user['g_id'] > PUN_MOD)
$message = ucwords(strtolower($message));
// Validate BBCode syntax
if ($pun_config['p_message_bbcode'] == '1' && strpos($message, '[') !== false && strpos($message, ']') !== false)
$message = preparse_bbcode($message, $errors);
// Did everything go according to plan?
if (empty($errors)) {
$now = time();
if (!$pun_user['is_guest']) {
// Insert message
$db->query('INSERT INTO '.$db->prefix.'chatbox_msg (poster, poster_id, poster_ip, message, posted) VALUES(\''.$db->escape($username).'\', '.$pun_user['id'].', \''.get_remote_address().'\', \''.$db->escape($message).'\', '.$now.')') or error('Unable to post message', __FILE__, __LINE__, $db->error());
// Increment his/her chatbox post count
$low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';
$db->query('UPDATE '.$low_prio.$db->prefix.'users SET num_posts_chatbox=num_posts_chatbox+1, last_post_chatbox='.$now.' WHERE id='.$pun_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());
}
else {
// Insert message
$email_sql = ($pun_config['p_force_guest_email'] == '1' || $email != '') ? '\''.$email.'\'' : 'NULL';
$db->query('INSERT INTO '.$db->prefix.'chatbox_msg (poster, poster_id, poster_ip, poster_email, message, posted) VALUES(\''.$db->escape($username).'\', '.$pun_user['id'].', \''.get_remote_address().'\', '.$email_sql.', \''.$db->escape($message).'\', '.$now.')') or error('Unable to post message', __FILE__, __LINE__, $db->error());
}
$count = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'chatbox_msg') or error('Unable to fetch chatbox post count', __FILE__, __LINE__, $db->error());
$num_post = $db->result($count);
$limit = ($num_post-$pun_config['cb_max_msg'] <= 0) ? 0 : $num_post-$pun_config['cb_max_msg'];
$result = $db->query('SELECT id,posted FROM '.$db->prefix.'chatbox_msg ORDER BY posted ASC LIMIT '.$limit) or error('Unable to select post to delete', __FILE__, __LINE__, $db->error());
while ($del_msg = $db->fetch_assoc($result))
$db->query('DELETE FROM '.$db->prefix.'chatbox_msg WHERE id = '.$del_msg['id'].' LIMIT 1') or error('Unable to delete post', __FILE__, __LINE__, $db->error());
$_POST['req_message'] = NULL;
}
}
// If there are errors, we display them
if (!empty($errors))
{
?>
<div id="posterror" class="block">
<h2><span><?php echo $lang_post['Post errors'] ?></span></h2>
<div class="box">
<div class="inbox">
<p><?php echo $lang_post['Post errors info'] ?></p>
<ul>
<?php
while (list(, $cur_error) = each($errors))
echo "\t\t\t\t".'<li><strong>'.$cur_error.'</strong></li>'."\n";
?>
</ul>
</div>
</div>
</div>
<?php
}
?>
<script type="text/javascript" src="include/lib/js/prototype.js"></script>
<script type="text/javascript" src="include/lib/js/chatbox.js"></script>
<div class="block">
<h2>
<span>
<span class="conr" ><img style="display:none;" id="loading" name="loading" src="img/chatbox/loading.gif" /></span>
<?php echo $lang_chatbox['Chatbox'] ?> <span style="font-size:7px;vertical-align:super;">© PBB ChatBox <?php if ($pun_config['o_show_version'] == '1') echo ' '.$pun_config['cb_pbb_version']; ?></span>
</span>
</h2>
<div class="box">
<div id="chatbox" class="inbox" style="overflow:auto;height:<?php echo $pun_config['cb_height'] ?>px;">
<?php
$cur_msg_txt = '';
$last_msg_time = '';
$count_id = array();
$result = $db->query('SELECT u.id, u.group_id, u.num_posts_chatbox, u.title, m.id AS m_id, m.poster_id, m.poster, m.poster_ip, m.poster_email, m.message, m.posted, g.g_id, g.g_color, g.g_title_chatbox FROM '.$db->prefix.'chatbox_msg AS m INNER JOIN '.$db->prefix.'users AS u ON u.id=m.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id ORDER BY m.posted DESC LIMIT '.$pun_config['cb_max_msg']) or error('Unable to fetch messages', __FILE__, __LINE__, $db->error());
$new_msg_time = false;
while ($cur_msg = $db->fetch_assoc($result)) {
// Get newest timestamp
if ($new_msg_time == false) {
$last_msg_time = $cur_msg['posted'];
$new_msg_time = true;
}
if(!is_null($cur_msg['title']) && $cur_msg['group_id'] !=1){ // Si ce n'est pas un admin et que le membre a un titre
$title = '<strong><span style="color:'.$cur_msg['g_color'].'">['.$cur_msg['title'].']</span></strong>';
$cur_msg_txt = $pun_config['cb_space'].$title.$pun_config['cb_disposition'];
}elseif($cur_msg['group_id'] ==1){ // Si c'est un admin
if($cur_msg['poster_id'] == 1){
$title = '<strong><font color="green">Administrateur N°1</font color></b></strong>'; // Premier Admin, titre à définir ainsi que l'id (poster_id)
}else if($cur_msg['poster_id'] == 3){
$title = '<strong><font color="green">Administrateur N°2</font color></b></strong>'; // Deuxieme Admin, titre à définir ainsi que l'id (poster_id)
}else if ($cur_msg['poster_id'] == 4){
$title = '<strong><font color="green">Administrateur N°4</font color></b></strong>'; // Troisième Admin, titre à définir ainsi que l'id (poster_id)
}
$cur_msg_txt = $pun_config['cb_space'].$title.$pun_config['cb_disposition'];
}else
$cur_msg_txt = $pun_config['cb_space'].$cur_msg['g_title_chatbox'].$pun_config['cb_disposition'];
if ($cur_msg['g_id'] != PUN_GUEST)
$cur_msg_txt = str_replace('<pun_username>', '<a href="profile.php?id='.$cur_msg['id'].'">'.pun_htmlspecialchars($cur_msg['poster']).'</a>', $cur_msg_txt);
else
$cur_msg_txt = str_replace('<pun_username>', pun_htmlspecialchars($cur_msg['poster']), $cur_msg_txt);
$cur_msg_txt = str_replace('<pun_date>', format_time($cur_msg['posted']), $cur_msg_txt);
if ($cur_msg['g_id'] != PUN_GUEST)
$cur_msg_txt = str_replace('<pun_nbpost>', $cur_msg['num_posts_chatbox'], $cur_msg_txt);
else {
if (!isset($count_id[$cur_msg['poster']])) {
$like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';
$count = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'chatbox_msg WHERE poster '.$like_command.' \''.$db->escape(str_replace('*', '%', $cur_msg['poster'])).'\'') or error('Unable to fetch user chatbox post count', __FILE__, __LINE__, $db->error());
$num_post = $db->result($count);
$count_id[$cur_msg['poster']] = $num_post;
}
else
$num_post = $count_id[$cur_msg['poster']];
$cur_msg_txt = str_replace('<pun_nbpost>', $num_post, $cur_msg_txt);
}
$cur_msg_txt = str_replace('<pun_nbpost_txt>', $lang_chatbox['Posts'], $cur_msg_txt);
/**************************** Dernière modif ici ****************************** */
if ($pun_user['g_id'] < PUN_GUEST) {
$cur_msg_admin = ' [ <a href="chatbox.php?get_host='.$cur_msg['m_id'].'">'.$cur_msg['poster_ip'].'</a>';
if ($cur_msg['poster_email'])
{
$cur_msg_admin .= ' | <a href="mailto:'.$cur_msg['poster_email'].'">'.$lang_common['E-mail'].'</a> ]';
$cur_msg_admin .= '[ <a href="chatbox.php?mod_post='.$cur_msg['m_id'].'"> Modifier </a> ] [ <a href="chatbox.php?del_post='.$cur_msg['m_id'].'"> Supprimer </a> ]';
}
else
{
$cur_msg_admin .= ' ] ';
$cur_msg_admin .= '[ <a href="chatbox.php?mod_post='.$cur_msg['m_id'].'"> Modifier </a> ] [ <a href="chatbox.php?del_post='.$cur_msg['m_id'].'"> Supprimer </a> ]';
}
}
else
$cur_msg_admin = '';
/**************************** Fin dernière modif ****************************** */
$cur_msg_txt = str_replace('<pun_admin>', $cur_msg_admin, $cur_msg_txt);
$cur_msg_txt = str_replace('<pun_message>', parse_message($cur_msg['message'], 0), $cur_msg_txt);
}
if (!$cur_msg_txt)
echo $lang_chatbox['No Message'];
else
echo "\t\t\t".$cur_msg_txt."\n";
?>
</div>
</div>
<h2>
<span>
<script language="javascript">
<!--
// This checkbox is utterly useless, unless we have javascript enabled. As such, we won't display it until then.
document.write('<span class="conr" style="width:150px;" ><?php echo $lang_chatbox['Autoscroll'] ?>: <input type="checkbox" id="autoscroll" value="" checked tabindex="<?php echo $cur_index++ ?>" /></span>');
// -->
</script>
<?php
if ($pun_user['g_post_chatbox'] == '1') {
$cur_index = 1;
?>
<form id="post" method="post" name="formulaire" action="chatbox.php" onsubmit="send_message(); return false;">
<input type="hidden" name="form_sent" value="1" />
<input type="hidden" name="form_user" id="form_user" value="<?php echo (!$pun_user['is_guest']) ? pun_htmlspecialchars($pun_user['username']) : 'Guest'; ?>" />
<?php
if ($pun_user['is_guest']) {
$email_label = ($pun_config['p_force_guest_email'] == '1') ? '<strong>'.$lang_common['E-mail'].':</strong>' : $lang_common['E-mail'];
$email_form_name = ($pun_config['p_force_guest_email'] == '1') ? 'req_email' : 'email';
if($email_form_name = 'req_email')
echo "\t".'<input type="hidden" name="email" id="email" value="" />'."\n";
else
echo "\t".'<input type="hidden" name="req_email" id="req_email" value="" />'."\n";
?>
<strong><?php echo $lang_post['Guest name'] ?>:</strong> <input type="text" name="req_username" id="req_username" value="<?php if (isset($_POST['req_username'])) echo pun_htmlspecialchars($username); ?>" size="15" maxlength="25" tabindex="<?php echo $cur_index++ ?>" />
<?php echo $email_label ?> <input type="text" name="<?php echo $email_form_name ?>" id="<?php echo $email_form_name ?>" value="<?php if (isset($_POST[$email_form_name])) echo pun_htmlspecialchars($email); ?>" size="15" maxlength="50" tabindex="<?php echo $cur_index++ ?>" />
<?php
}
else {
?>
<input type="hidden" name="req_username" id="req_username" value="" />
<input type="hidden" name="email" id="email" value="" />
<input type="hidden" name="req_email" id="req_email" value="" />
<?php
}
?>
<strong><?php echo $lang_chatbox['Message'] ?>:</strong> <input type="text" name="req_message" id="req_message" value="<?php if (isset($_POST['req_message'])) echo pun_htmlspecialchars($message); ?>" size="35" maxlength="<?php echo $pun_config['cb_msg_maxlength'] ?>" tabindex="<?php echo $cur_index++ ?>" />
<input type="submit" name="submit" value="<?php echo $lang_chatbox['Btn Send'] ?>" accesskey="s" tabindex="<?php echo $cur_index++ ?>" />
<script language="javascript">
<!--
document.formulaire.req_message.focus();
// -->
</script>
</form>
<?php
}
else
echo $lang_chatbox['No Post Permission'];
?>
</span>
</h2>
</div>
<script language="javascript">
// Begin getting messages
var LastMsg = '<?php echo $last_msg_time; ?>';
$('autoscroll').value = 'true';
get_messages();
checker = new PeriodicalExecuter(get_messages, <?php echo $pun_config['cb_ajax_refresh']; ?>);
</script>
<?php
require PUN_ROOT.'footer.php';Hors ligne
J'ai fait exactement ce que tu ma dis.
je vais retester.
Hors ligne
Bonjour, après une petite absence, j'ai tut refait,
j'obtient ce code:
<?php
/***********************************************************************
Copyright (C) 2002-2005 Rickard Andersson (rickard@punbb.org)
This file is part of PunBB.
PunBB is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
PunBB is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
Contributeur: Traduction française
Patrice Bourgeois ©2006 www.libravis.com ®
Rajout de la possibilité de modifier/supprimer les messages de la ChatBox by chico200987 for Toxitrip.
************************************************************************/
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
require PUN_ROOT.'include/parser.php';
if (!$pun_config['cb_pbb_version'])
message('Poki BB Chatbox n\'est pas installée correctement. Assurez-vous d\'avoir lancé le fichier install_mod.php');
if ($pun_user['g_read_board'] == '0')
message($lang_common['No view']);
// Load the chatbox.php and post.php language file
require PUN_ROOT.'lang/'.$pun_user['language'].'/chatbox.php';
require PUN_ROOT.'lang/'.$pun_user['language'].'/post.php';
// Same funtion that php native rawurldecode() but with utf8 support
function utf8RawUrlDecode ($source) {
$decodedStr = "";
$pos = 0;
$len = strlen ($source);
while ($pos < $len) {
$charAt = substr ($source, $pos, 1);
if ($charAt == '%') {
$pos++;
$charAt = substr ($source, $pos, 1);
if ($charAt == 'u') {
// We got a unicode character
$pos++;
$unicodeHexVal = substr ($source, $pos, 4);
$unicode = hexdec ($unicodeHexVal);
$entity = "&#". $unicode . ';';
$decodedStr .= utf8_encode ($entity);
$pos += 4;
}
else {
// We have an escaped ascii character
$hexVal = substr ($source, $pos, 2);
$decodedStr .= chr (hexdec ($hexVal));
$pos += 2;
}
} else {
$decodedStr .= $charAt;
$pos++;
}
}
return $decodedStr;
}
// Error function for ajax queries
function error_ajax($message, $file, $line, $db_error = false)
{
global $pun_config, $lang_chatbox;
// Defaut error reponse
$error = $pun_config['cb_space'].$pun_config['cb_ajax_errors'];
$error = str_replace('<pun_error>', $lang_chatbox['Error Title'], $error);
$error = str_replace('<pun_date>', format_time(time()), $error);
$error_ajax_msg = '';
if (!defined('PUN_DEBUG') && $file != false && $line != false)
{
$error_ajax_msg .= '<strong>File:</strong> '.$file.'<br /><strong>Line:</strong> '.$line.'<br /><br /><strong>PunBB reported</strong>: '.$message;
if ($db_error)
{
$error_ajax_msg .= '<br /><br /><strong>Database reported:</strong> '.pun_htmlspecialchars($db_error['error_msg']).(($db_error['error_no']) ? ' (Errno: '.$db_error['error_no'].')' : '');
if ($db_error['error_sql'] != '')
$error_ajax_msg .= '<br /><br /><strong>Failed query:</strong> '.pun_htmlspecialchars($db_error['error_sql']);
}
}
else
$error_ajax_msg .= $message;
// If a database connection was established (before this error) we close it
if ($db_error)
$GLOBALS['db']->close();
exit('error:chat'.str_replace('<pun_error_text>', $error_ajax_msg, $error));
}
// If it's AJAX request
if (isset($_POST['ajax']) || isset($_GET['ajax'])) {
// Send no-cache headers
header('Expires: Thu, 21 Jul 1977 07:30:00 GMT'); // When yours truly first set eyes on this world! :)
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache'); // For HTTP/1.0 compability
header('Content-type: text/html; charset='.$lang_common['lang_encoding']);
// If new message was submit
if (isset($_POST['ajax'])) {
// Decode
$_POST['req_message'] = utf8RawUrlDecode($_POST['req_message']);
$_POST['form_user'] = utf8RawUrlDecode($_POST['form_user']);
$_POST['req_username'] = utf8RawUrlDecode($_POST['req_username']);
$_POST['req_email'] = utf8RawUrlDecode($_POST['req_email']);
$_POST['email'] = utf8RawUrlDecode($_POST['email']);
// Defaut error reponse
$error = $pun_config['cb_space'].$pun_config['cb_ajax_errors'];
$error = str_replace('<pun_error>', $lang_chatbox['Error Title'], $error);
$error = str_replace('<pun_date>', format_time(time()), $error);
// Make sure form_user is correct
if (($pun_user['is_guest'] && $_POST['form_user'] != 'Guest') || (!$pun_user['is_guest'] && $_POST['form_user'] != $pun_user['username']))
error_ajax(parse_message($lang_common['Bad request'], 0), false, false, false);
// Do we have permission to post?
if ($pun_user['g_post_chatbox'] != '1')
error_ajax(parse_message($lang_chatbox['No Post Permission'], 0), false, false, false);
// Flood protection
if (!$pun_user['is_guest'] && $pun_user['last_post_chatbox'] != '' && (time() - $pun_user['last_post_chatbox']) < $pun_user['g_post_flood_chatbox'])
error_ajax(parse_message($lang_post['Flood start'].' '.$pun_user['g_post_flood_chatbox'].' '.$lang_post['flood end'], 0), false, false, false);
// If it's Guest
if ($pun_user['is_guest']) {
$result = $db->query('SELECT id, poster_ip, posted FROM '.$db->prefix.'chatbox_msg WHERE poster_ip=\''.get_remote_address().'\' ORDER BY posted DESC LIMIT 1') or error_ajax('Unable to fetch messages for flood protection', __FILE__, __LINE__, $db->error());
$cur_post = $db->fetch_assoc($result);
if ((time() - $cur_post['posted']) < $pun_user['g_post_flood_chatbox'])
error_ajax(parse_message($lang_post['Flood start'].' '.$pun_user['g_post_flood_chatbox'].' '.$lang_post['flood end'], 0), false, false, false);
}
// If the user is logged in we get the username and e-mail from $pun_user
if (!$pun_user['is_guest']) {
$username = $pun_user['username'];
$email = $pun_user['email'];
}
// Otherwise it should be in $_POST
else {
$username = trim($_POST['req_username']);
$email = strtolower(trim(($pun_config['p_force_guest_email'] == '1') ? $_POST['req_email'] : $_POST['email']));
// Load the register.php/profile.php language files
require PUN_ROOT.'lang/'.$pun_user['language'].'/prof_reg.php';
require PUN_ROOT.'lang/'.$pun_user['language'].'/register.php';
// It's a guest, so we have to validate the username
if (strlen($username) < 2)
error_ajax(parse_message($lang_prof_reg['Username too short'], 0), false, false, false);
else if (!strcasecmp($username, 'Guest') || !strcasecmp($username, $lang_common['Guest']))
error_ajax(parse_message($lang_prof_reg['Username guest'], 0), false, false, false);
else if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $username))
error_ajax(parse_message($lang_prof_reg['Username IP'], 0), false, false, false);
if ((strpos($username, '[') !== false || strpos($username, ']') !== false) && strpos($username, '\'') !== false && strpos($username, '"') !== false)
error_ajax(parse_message($lang_prof_reg['Username reserved chars'], 0), false, false, false);
if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[quote=|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username))
error_ajax(parse_message($lang_prof_reg['Username BBCode'], 0), false, false, false);
// Check username for any censored words
$temp = censor_words($username);
if ($temp != $username)
error_ajax(parse_message($lang_register['Username censor'], 0), false, false, false);
// Check that the username (or a too similar username) is not already registered
$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE username=\''.$db->escape($username).'\' OR username=\''.$db->escape(preg_replace('/[^\w]/', '', $username)).'\'') or error_ajax('Unable to fetch user info', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result)) {
$busy = $db->result($result);
error_ajax(parse_message($lang_register['Username dupe 1'].' '.pun_htmlspecialchars($busy).'. '.$lang_register['Username dupe 2'], 0), false, false, false);
}
if ($pun_config['p_force_guest_email'] == '1' || $email != '') {
require PUN_ROOT.'include/email.php';
if (!is_valid_email($email))
error_ajax(parse_message($lang_common['Invalid e-mail'], 0), false, false, false);
}
}
// Clean up message from POST
$message = pun_linebreaks(pun_trim($_POST['req_message']));
if(preg_match('#^\/clean$#',$message) && $pun_user['group_id'] == 1){
// Ta fonction clean
$message = 'Chabox vidée, merci de réactualiser la page.';
$db->query('DELETE FROM '.$db->prefix.'chatbox_msg') or die ('LA REQUETE EST FAUSSE !!!!!!');
}
if ($message == '')
error_ajax(parse_message($lang_chatbox['Error No message'], 0), false, false, false);
else if (strlen($message) > $pun_config['cb_msg_maxlength'])
error_ajax(parse_message($lang_chatbox['Error Too long message'], 0), false, false, false);
else if ($pun_config['p_message_all_caps'] == '0' && strtoupper($message) == $message && $pun_user['g_id'] > PUN_MOD)
$message = ucwords(strtolower($message));
$parse_errors = '';
// Validate BBCode syntax
if ($pun_config['p_message_bbcode'] == '1' && strpos($message, '[') !== false && strpos($message, ']') !== false)
$message = preparse_bbcode($message, $parse_errors);
if ($parse_errors != '')
error_ajax(parse_message($parse_errors[0], 0), false, false, false);
// Get the time
$now = time();
if (!$pun_user['is_guest']) {
// Insert message
$db->query('INSERT INTO '.$db->prefix.'chatbox_msg (poster, poster_id, poster_ip, message, posted) VALUES(\''.$db->escape($username).'\', '.$pun_user['id'].', \''.get_remote_address().'\', \''.$db->escape($message).'\', '.$now.')') or error_ajax('Unable to post message', __FILE__, __LINE__, $db->error());
// Increment his/her chatbox post count
$low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';
$db->query('UPDATE '.$low_prio.$db->prefix.'users SET num_posts_chatbox=num_posts_chatbox+1, last_post_chatbox='.$now.' WHERE id='.$pun_user['id']) or error_ajax('Unable to update user', __FILE__, __LINE__, $db->error());
}
else {
// Insert message
$email_sql = ($pun_config['p_force_guest_email'] == '1' || $email != '') ? '\''.$email.'\'' : 'NULL';
$db->query('INSERT INTO '.$db->prefix.'chatbox_msg (poster, poster_id, poster_ip, poster_email, message, posted) VALUES(\''.$db->escape($username).'\', '.$pun_user['id'].', \''.get_remote_address().'\', '.$email_sql.', \''.$db->escape($message).'\', '.$now.')') or error_ajax('Unable to post message', __FILE__, __LINE__, $db->error());
}
$count = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'chatbox_msg') or error_ajax('Unable to fetch chatbox post count', __FILE__, __LINE__, $db->error());
$num_post = $db->result($count);
$limit = ($num_post-$pun_config['cb_max_msg'] <= 0) ? 0 : $num_post-$pun_config['cb_max_msg'];
$result = $db->query('SELECT id,posted FROM '.$db->prefix.'chatbox_msg ORDER BY posted ASC LIMIT '.$limit) or error_ajax('Unable to select post to delete', __FILE__, __LINE__, $db->error());
while ($del_msg = $db->fetch_assoc($result))
$db->query('DELETE FROM '.$db->prefix.'chatbox_msg WHERE id = '.$del_msg['id'].' LIMIT 1') or error_ajax('Unable to delete post', __FILE__, __LINE__, $db->error());
exit('PostedInDB');
}
// Now we list all new message
$cur_msg_txt = '';
$response = '';
$count_id = array();
// Define last message timestamp
$last_msg_time = intval($_GET['last_msg']);
$messages = $db->query('SELECT u.id, u.group_id, u.num_posts_chatbox, m.id AS m_id, m.poster_id, m.poster, m.poster_ip, m.poster_email, m.message, m.posted, g.g_id, g.g_title_chatbox FROM '.$db->prefix.'chatbox_msg AS m INNER JOIN '.$db->prefix.'users AS u ON u.id=m.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE m.posted > '.$last_msg_time.' ORDER BY m.posted ASC LIMIT 0,50') or error_ajax('Unable to fetch messages', __FILE__, __LINE__, $db->error());
while ($cur_msg = $db->fetch_assoc($messages)) {
if(!is_null($cur_msg['title']) && $cur_msg['group_id'] !=1){
$title = '<strong><span style="color:'.$cur_msg['g_color'].'">['.$cur_msg['title'].']</span></strong>';
$cur_msg_txt = $pun_config['cb_space'].$title.$pun_config['cb_disposition'];
}elseif($cur_msg['group_id'] ==1){
if($cur_msg['poster_id'] == 2){
$title = '<strong><font color="green">Administrateur N°1</font color></b></strong>';
}else if($cur_msg['poster_id'] == 3){
$title = '<strong><font color="green">Administrateur N°2</font color></b></strong>';
}else if ($cur_msg['poster_id'] == 4){
$title = '<strong><font color="green">Administrateur N°4</font color></b></strong>';
}
$cur_msg_txt = $pun_config['cb_space'].$title.$pun_config['cb_disposition'];
}else
$cur_msg_txt = $pun_config['cb_space'].$cur_msg['g_title_chatbox'].$pun_config['cb_disposition'];
// Define last message timestamp
$last_msg_time = intval($cur_msg['posted']);
// Replace <pun_username>
if ($cur_msg['g_id'] != PUN_GUEST)
$cur_msg_txt = str_replace('<pun_username>', '<a href="profile.php?id='.$cur_msg['id'].'">'.pun_htmlspecialchars($cur_msg['poster']).'</a>', $cur_msg_txt);
else
$cur_msg_txt = str_replace('<pun_username>', pun_htmlspecialchars($cur_msg['poster']), $cur_msg_txt);
// Replace <pun_date>
$cur_msg_txt = str_replace('<pun_date>', format_time($cur_msg['posted']), $cur_msg_txt);
// Replace <pun_nbpost>
if ($cur_msg['g_id'] != PUN_GUEST)
$cur_msg_txt = str_replace('<pun_nbpost>', $cur_msg['num_posts_chatbox'], $cur_msg_txt);
else {
if (!isset($count_id[$cur_msg['poster']])) {
$like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';
$count = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'chatbox_msg WHERE poster '.$like_command.' \''.$db->escape(str_replace('*', '%', $cur_msg['poster'])).'\'') or error_ajax('Unable to fetch user chatbox post count', __FILE__, __LINE__, $db->error());
$num_post = $db->result($count);
$count_id[$cur_msg['poster']] = $num_post;
}
else
$num_post = $count_id[$cur_msg['poster']];
$cur_msg_txt = str_replace('<pun_nbpost>', $num_post, $cur_msg_txt);
}
// Replace <pun_nbpost_txt>
$cur_msg_txt = str_replace('<pun_nbpost_txt>', $lang_chatbox['Posts'], $cur_msg_txt);
// Add admin feature and replace <pun_admin>
if ($pun_user['g_id'] < PUN_GUEST) {
$cur_msg_admin = ' [ <a href="chatbox.php?get_host='.$cur_msg['m_id'].'">'.$cur_msg['poster_ip'].'</a>';
/*********************** Petite modification ici ***********************/
if ($cur_msg['poster_email'])
{
$cur_msg_admin .= ' | <a href="mailto:'.$cur_msg['poster_email'].'">'.$lang_common['E-mail'].'</a> ] ';
$cur_msg_admin .= '[ <a href="chatbox.php?mod_post='.$cur_msg['m_id'].'"> Modifier </a> ] [ <a href="chatbox.php?del_post='.$cur_msg['m_id'].'"> Supprimer </a> ]';
}
else
{
$cur_msg_admin .= ' ] ';
$cur_msg_admin .= '[ <a href="chatbox.php?mod_post='.$cur_msg['m_id'].'"> Modifier </a> ] [ <a href="chatbox.php?del_post='.$cur_msg['m_id'].'"> Supprimer </a> ]';
}
/*********************** Fin modification ****************************/
}
else
$cur_msg_admin = '';
$cur_msg_txt = str_replace('<pun_admin>', $cur_msg_admin, $cur_msg_txt);
// Replace <pun_message>
$cur_msg_txt = str_replace('<pun_message>', parse_message($cur_msg['message'], 0), $cur_msg_txt);
$response .= $cur_msg_txt . "\n";
}
// If no new message we return the timestamp
if (!$response)
$response = $last_msg_time;
else
$response = $last_msg_time.$response;
$response = pun_trim($response);
exit($response);
}
// This particular function doesn't require forum-based moderator access. It can be used
// by all moderators and admins.
/**************************** Début des nouvelles fonctions *******************************/
// Si l'on a cliqué sur Modifier
if(isset($_GET['del_post']))
{
// On vérifie si on a les droits
if ($pun_user['g_id'] > PUN_MOD)
message($lang_common['No permission']);
// On récupère l'id du post à supprimer
$adel = $_GET['del_post'];
// On la supprime de la base
$db->query('DELETE FROM '.$db->prefix.'chatbox_msg WHERE id='.$adel) or error('Unable to delete message', __FILE__, __LINE__, $db->error());
}
//Si l'on a cliqué sur Modifier
if (isset($_GET['mod_post']))
{
//On vérifie qu'on a les droits
if ($pun_user['g_id'] > PUN_MOD)
message($lang_common['No permission']);
// On récupere l'id du post à modifier
$amod = $_GET['mod_post'];
// Si on modifie le message
if (isset($_POST['txtMod']))
{
// On récupère le nouveau message
$txtMod = $_POST['txtMod'];
// Et on modifie la base !
$db->query('UPDATE '.$db->prefix.'chatbox_msg SET message="'.$txtMod.'" WHERE id="'.$amod.'"') or error('Unable to modify message', __FILE__, __LINE__, $db->error());
}
else
{
// Sinon on récupère le texte à modifier
$res = $db->query('SELECT message FROM '.$db->prefix.'chatbox_msg WHERE id='.$amod) or error('Unable to mod message', __FILE__, __LINE__, $db->error());
$msg = $db->result($res);
//Et on l'insère dans un formulaire contenant un TextBox
message('<form name="frmMod" method="POST"><input type="texte" value="'.$msg.'" name="txtMod" /><input type="submit"></form>');
}
}
/**************************** Fin des nouvelles fonctions *******************************/
if (isset($_GET['get_host']))
{
if ($pun_user['g_id'] > PUN_MOD)
message($lang_common['No permission']);
// Is get_host an IP address or a post ID?
if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $_GET['get_host']))
$ip = $_GET['get_host'];
else {
$get_host = intval($_GET['get_host']);
if ($get_host < 1)
message($lang_common['Bad request']);
$result = $db->query('SELECT poster_ip FROM '.$db->prefix.'chatbox_msg WHERE id='.$get_host) or error('Unable to fetch post IP address', __FILE__, __LINE__, $db->error());
if (!$db->num_rows($result))
message($lang_common['Bad request']);
$ip = $db->result($result);
}
message('The IP address is: '.$ip.'<br />The host name is: '.@gethostbyaddr($ip).'<br /><br /><a href="admin_users.php?show_users='.$ip.'">Show more users for this IP</a>');
}
$page_title = pun_htmlspecialchars($lang_chatbox['Page_title']);
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';
if ($pun_user['g_read_chatbox'] != '1')
message($lang_chatbox['No Read Permission']);
// Did someone just hit "Submit"?
if (isset($_POST['form_sent'])) {
// Make sure form_user is correct
if (($pun_user['is_guest'] && $_POST['form_user'] != 'Guest') || (!$pun_user['is_guest'] && $_POST['form_user'] != $pun_user['username']))
message($lang_common['Bad request']);
// Do we have permission to post?
if ($pun_user['g_post_chatbox'] != '1')
message($lang_chatbox['No Post Permission']);
// Start with a clean slate
$errors = array();
// Flood protection
if (!$pun_user['is_guest'] && $pun_user['last_post_chatbox'] != '' && (time() - $pun_user['last_post_chatbox']) < $pun_user['g_post_flood_chatbox'])
$errors[] = $lang_post['Flood start'].' '.$pun_user['g_post_flood_chatbox'].' '.$lang_post['flood end'];
if ($pun_user['is_guest']) {
$result = $db->query('SELECT id, poster_ip, posted FROM '.$db->prefix.'chatbox_msg WHERE poster_ip=\''.get_remote_address().'\' ORDER BY posted DESC LIMIT 1') or error('Unable to fetch messages for flood protection', __FILE__, __LINE__, $db->error());
$cur_post = $db->fetch_assoc($result);
if ((time() - $cur_post['posted']) < $pun_user['g_post_flood_chatbox'])
$errors[] = $lang_post['Flood start'].' '.$pun_user['g_post_flood_chatbox'].' '.$lang_post['flood end'];
}
// If the user is logged in we get the username and e-mail from $pun_user
if (!$pun_user['is_guest']) {
$username = $pun_user['username'];
$email = $pun_user['email'];
}
// Otherwise it should be in $_POST
else
{
$username = trim($_POST['req_username']);
$email = strtolower(trim(($pun_config['p_force_guest_email'] == '1') ? $_POST['req_email'] : $_POST['email']));
// Load the register.php/profile.php language files
require PUN_ROOT.'lang/'.$pun_user['language'].'/prof_reg.php';
require PUN_ROOT.'lang/'.$pun_user['language'].'/register.php';
// It's a guest, so we have to validate the username
if (strlen($username) < 2)
$errors[] = $lang_prof_reg['Username too short'];
else if (!strcasecmp($username, 'Guest') || !strcasecmp($username, $lang_common['Guest']))
$errors[] = $lang_prof_reg['Username guest'];
else if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $username))
$errors[] = $lang_prof_reg['Username IP'];
if ((strpos($username, '[') !== false || strpos($username, ']') !== false) && strpos($username, '\'') !== false && strpos($username, '"') !== false)
$errors[] = $lang_prof_reg['Username reserved chars'];
if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[quote=|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username))
$errors[] = $lang_prof_reg['Username BBCode'];
// Check username for any censored words
$temp = censor_words($username);
if ($temp != $username)
$errors[] = $lang_register['Username censor'];
// Check that the username (or a too similar username) is not already registered
$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE username=\''.$db->escape($username).'\' OR username=\''.$db->escape(preg_replace('/[^\w]/', '', $username)).'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result)) {
$busy = $db->result($result);
$errors[] = $lang_register['Username dupe 1'].' '.pun_htmlspecialchars($busy).'. '.$lang_register['Username dupe 2'];
}
if ($pun_config['p_force_guest_email'] == '1' || $email != '') {
require PUN_ROOT.'include/email.php';
if (!is_valid_email($email))
$errors[] = $lang_common['Invalid e-mail'];
}
}
// Clean up message from POST
$message = pun_linebreaks(pun_trim($_POST['req_message']));
if(preg_match('#^\/clean$#',$message) && $pun_user['group_id'] == 1){
// Ta fonction clean
$message = 'Chabox vidée, merci de réactualiser la page.';
$db->query('DELETE FROM '.$db->prefix.'chatbox_msg') or die ('LA REQUETE EST FAUSSE !!!!!!');
}
if ($message == '')
$errors[] = $lang_chatbox['Error No message'];
else if (strlen($message) > $pun_config['cb_msg_maxlength'])
$errors[] = $lang_chatbox['Error Too long message'];
else if ($pun_config['p_message_all_caps'] == '0' && strtoupper($message) == $message && $pun_user['g_id'] > PUN_MOD)
$message = ucwords(strtolower($message));
// Validate BBCode syntax
if ($pun_config['p_message_bbcode'] == '1' && strpos($message, '[') !== false && strpos($message, ']') !== false)
$message = preparse_bbcode($message, $errors);
// Did everything go according to plan?
if (empty($errors)) {
$now = time();
if (!$pun_user['is_guest']) {
// Insert message
$db->query('INSERT INTO '.$db->prefix.'chatbox_msg (poster, poster_id, poster_ip, message, posted) VALUES(\''.$db->escape($username).'\', '.$pun_user['id'].', \''.get_remote_address().'\', \''.$db->escape($message).'\', '.$now.')') or error('Unable to post message', __FILE__, __LINE__, $db->error());
// Increment his/her chatbox post count
$low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';
$db->query('UPDATE '.$low_prio.$db->prefix.'users SET num_posts_chatbox=num_posts_chatbox+1, last_post_chatbox='.$now.' WHERE id='.$pun_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());
}
else {
// Insert message
$email_sql = ($pun_config['p_force_guest_email'] == '1' || $email != '') ? '\''.$email.'\'' : 'NULL';
$db->query('INSERT INTO '.$db->prefix.'chatbox_msg (poster, poster_id, poster_ip, poster_email, message, posted) VALUES(\''.$db->escape($username).'\', '.$pun_user['id'].', \''.get_remote_address().'\', '.$email_sql.', \''.$db->escape($message).'\', '.$now.')') or error('Unable to post message', __FILE__, __LINE__, $db->error());
}
$count = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'chatbox_msg') or error('Unable to fetch chatbox post count', __FILE__, __LINE__, $db->error());
$num_post = $db->result($count);
$limit = ($num_post-$pun_config['cb_max_msg'] <= 0) ? 0 : $num_post-$pun_config['cb_max_msg'];
$result = $db->query('SELECT id,posted FROM '.$db->prefix.'chatbox_msg ORDER BY posted ASC LIMIT '.$limit) or error('Unable to select post to delete', __FILE__, __LINE__, $db->error());
while ($del_msg = $db->fetch_assoc($result))
$db->query('DELETE FROM '.$db->prefix.'chatbox_msg WHERE id = '.$del_msg['id'].' LIMIT 1') or error('Unable to delete post', __FILE__, __LINE__, $db->error());
$_POST['req_message'] = NULL;
}
}
// If there are errors, we display them
if (!empty($errors))
{
?>
<div id="posterror" class="block">
<h2><span><?php echo $lang_post['Post errors'] ?></span></h2>
<div class="box">
<div class="inbox">
<p><?php echo $lang_post['Post errors info'] ?></p>
<ul>
<?php
while (list(, $cur_error) = each($errors))
echo "\t\t\t\t".'<li><strong>'.$cur_error.'</strong></li>'."\n";
?>
</ul>
</div>
</div>
</div>
<?php
}
?>
<script type="text/javascript" src="include/lib/js/prototype.js"></script>
<script type="text/javascript" src="include/lib/js/chatbox.js"></script>
<div class="block">
<h2>
<span>
<span class="conr" ><img style="display:none;" id="loading" name="loading" src="img/chatbox/loading.gif" /></span>
<?php echo $lang_chatbox['Chatbox'] ?> <span style="font-size:7px;vertical-align:super;">© PBB ChatBox <?php if ($pun_config['o_show_version'] == '1') echo ' '.$pun_config['cb_pbb_version']; ?></span>
</span>
</h2>
<div class="box">
<div id="chatbox" class="inbox" style="overflow:auto;height:<?php echo $pun_config['cb_height'] ?>px;">
<?php
$cur_msg_txt = '';
$last_msg_time = '';
$count_id = array();
$result = $db->query('SELECT u.id, u.group_id, u.num_posts_chatbox, m.id AS m_id, m.poster_id, m.poster, m.poster_ip, m.poster_email, m.message, m.posted, g.g_id, g.g_title_chatbox FROM '.$db->prefix.'chatbox_msg AS m INNER JOIN '.$db->prefix.'users AS u ON u.id=m.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id ORDER BY m.posted DESC LIMIT '.$pun_config['cb_max_msg']) or error('Unable to fetch messages', __FILE__, __LINE__, $db->error());
$new_msg_time = false;
while ($cur_msg = $db->fetch_assoc($result)) {
// Get newest timestamp
if ($new_msg_time == false) {
$last_msg_time = $cur_msg['posted'];
$new_msg_time = true;
}
if(!is_null($cur_msg['title']) && $cur_msg['group_id'] !=1){
$title = '<strong><span style="color:'.$cur_msg['g_color'].'">['.$cur_msg['title'].']</span></strong>';
$cur_msg_txt = $pun_config['cb_space'].$title.$pun_config['cb_disposition'];
}elseif($cur_msg['group_id'] ==1){
if($cur_msg['poster_id'] == 2){
$title = '<strong><font color="green">Administrateur N°1</font color></b></strong>';
}else if($cur_msg['poster_id'] == 3){
$title = '<strong><font color="green">Administrateur N°2</font color></b></strong>';
}else if ($cur_msg['poster_id'] == 4){
$title = '<strong><font color="green">Administrateur N°4</font color></b></strong>';
}
$cur_msg_txt = $pun_config['cb_space'].$title.$pun_config['cb_disposition'];
}else
$cur_msg_txt = $pun_config['cb_space'].$cur_msg['g_title_chatbox'].$pun_config['cb_disposition'];
if ($cur_msg['g_id'] != PUN_GUEST)
$cur_msg_txt = str_replace('<pun_username>', '<a href="profile.php?id='.$cur_msg['id'].'">'.pun_htmlspecialchars($cur_msg['poster']).'</a>', $cur_msg_txt);
else
$cur_msg_txt = str_replace('<pun_username>', pun_htmlspecialchars($cur_msg['poster']), $cur_msg_txt);
$cur_msg_txt = str_replace('<pun_date>', format_time($cur_msg['posted']), $cur_msg_txt);
if ($cur_msg['g_id'] != PUN_GUEST)
$cur_msg_txt = str_replace('<pun_nbpost>', $cur_msg['num_posts_chatbox'], $cur_msg_txt);
else {
if (!isset($count_id[$cur_msg['poster']])) {
$like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';
$count = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'chatbox_msg WHERE poster '.$like_command.' \''.$db->escape(str_replace('*', '%', $cur_msg['poster'])).'\'') or error('Unable to fetch user chatbox post count', __FILE__, __LINE__, $db->error());
$num_post = $db->result($count);
$count_id[$cur_msg['poster']] = $num_post;
}
else
$num_post = $count_id[$cur_msg['poster']];
$cur_msg_txt = str_replace('<pun_nbpost>', $num_post, $cur_msg_txt);
}
$cur_msg_txt = str_replace('<pun_nbpost_txt>', $lang_chatbox['Posts'], $cur_msg_txt);
/**************************** Dernière modif ici ****************************** */
if ($pun_user['g_id'] < PUN_GUEST) {
$cur_msg_admin = ' [ <a href="chatbox.php?get_host='.$cur_msg['m_id'].'">'.$cur_msg['poster_ip'].'</a>';
if ($cur_msg['poster_email'])
{
$cur_msg_admin .= ' | <a href="mailto:'.$cur_msg['poster_email'].'">'.$lang_common['E-mail'].'</a> ]';
$cur_msg_admin .= '[ <a href="chatbox.php?mod_post='.$cur_msg['m_id'].'"> Modifier </a> ] [ <a href="chatbox.php?del_post='.$cur_msg['m_id'].'"> Supprimer </a> ]';
}
else
{
$cur_msg_admin .= ' ] ';
$cur_msg_admin .= '[ <a href="chatbox.php?mod_post='.$cur_msg['m_id'].'"> Modifier </a> ] [ <a href="chatbox.php?del_post='.$cur_msg['m_id'].'"> Supprimer </a> ]';
}
}
else
$cur_msg_admin = '';
/**************************** Fin dernière modif ****************************** */
$cur_msg_txt = str_replace('<pun_admin>', $cur_msg_admin, $cur_msg_txt);
$cur_msg_txt = str_replace('<pun_message>', parse_message($cur_msg['message'], 0), $cur_msg_txt);
}
if (!$cur_msg_txt)
echo $lang_chatbox['No Message'];
else
echo "\t\t\t".$cur_msg_txt."\n";
?>
</div>
</div>
<h2>
<span>
<script language="javascript">
<!--
// This checkbox is utterly useless, unless we have javascript enabled. As such, we won't display it until then.
document.write('<span class="conr" style="width:150px;" ><?php echo $lang_chatbox['Autoscroll'] ?>: <input type="checkbox" id="autoscroll" value="" checked tabindex="<?php echo $cur_index++ ?>" /></span>');
// -->
</script>
<?php
if ($pun_user['g_post_chatbox'] == '1') {
$cur_index = 1;
?>
<form id="post" method="post" name="formulaire" action="chatbox.php" onsubmit="send_message(); return false;">
<input type="hidden" name="form_sent" value="1" />
<input type="hidden" name="form_user" id="form_user" value="<?php echo (!$pun_user['is_guest']) ? pun_htmlspecialchars($pun_user['username']) : 'Guest'; ?>" />
<?php
if ($pun_user['is_guest']) {
$email_label = ($pun_config['p_force_guest_email'] == '1') ? '<strong>'.$lang_common['E-mail'].':</strong>' : $lang_common['E-mail'];
$email_form_name = ($pun_config['p_force_guest_email'] == '1') ? 'req_email' : 'email';
if($email_form_name = 'req_email')
echo "\t".'<input type="hidden" name="email" id="email" value="" />'."\n";
else
echo "\t".'<input type="hidden" name="req_email" id="req_email" value="" />'."\n";
?>
<strong><?php echo $lang_post['Guest name'] ?>:</strong> <input type="text" name="req_username" id="req_username" value="<?php if (isset($_POST['req_username'])) echo pun_htmlspecialchars($username); ?>" size="15" maxlength="25" tabindex="<?php echo $cur_index++ ?>" />
<?php echo $email_label ?> <input type="text" name="<?php echo $email_form_name ?>" id="<?php echo $email_form_name ?>" value="<?php if (isset($_POST[$email_form_name])) echo pun_htmlspecialchars($email); ?>" size="15" maxlength="50" tabindex="<?php echo $cur_index++ ?>" />
<?php
}
else {
?>
<input type="hidden" name="req_username" id="req_username" value="" />
<input type="hidden" name="email" id="email" value="" />
<input type="hidden" name="req_email" id="req_email" value="" />
<?php
}
?>
<strong><?php echo $lang_chatbox['Message'] ?>:</strong> <input type="text" name="req_message" id="req_message" value="<?php if (isset($_POST['req_message'])) echo pun_htmlspecialchars($message); ?>" size="35" maxlength="<?php echo $pun_config['cb_msg_maxlength'] ?>" tabindex="<?php echo $cur_index++ ?>" />
<input type="submit" name="submit" value="<?php echo $lang_chatbox['Btn Send'] ?>" accesskey="s" tabindex="<?php echo $cur_index++ ?>" />
<script language="javascript">
<!--
document.formulaire.req_message.focus();
// -->
</script>
</form>
<?php
}
else
echo $lang_chatbox['No Post Permission'];
?>
</span>
</h2>
</div>
<script language="javascript">
// Begin getting messages
var LastMsg = '<?php echo $last_msg_time; ?>';
$('autoscroll').value = 'true';
get_messages();
checker = new PeriodicalExecuter(get_messages, <?php echo $pun_config['cb_ajax_refresh']; ?>);
</script>
<?php
require PUN_ROOT.'footer.php';La fonction /clean fonctionne, mais pour les grades, sa s'affiche mais après une ré actualisation, la chatbox est vidée.
Faut il encore ajouter une condition ?
Hors ligne
T'as une requête incomplète.
Cherches :
$messages = $db->query('SELECT u.id, u.group_id, u.num_posts_chatbox, m.id AS m_id, m.poster_id, m.poster, m.poster_ip, m.poster_email, m.message, m.posted, g.g_id, g.g_title_chatbox FROM '.$db->prefix.'chatbox_msg AS m INNER JOIN '.$db->prefix.'users AS u ON u.id=m.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE m.posted > '.$last_msg_time.' ORDER BY m.posted ASC LIMIT 0,50') or error_ajax('Unable to fetch messages', __FILE__, __LINE__, $db->error());Remplace par :
$messages = $db->query('SELECT u.id, u.group_id, u.title, u.num_posts_chatbox, m.id AS m_id, m.poster_id, m.poster, m.poster_ip, m.poster_email, m.message, m.posted, g.g_id, g.g_color, g.g_title_chatbox FROM '.$db->prefix.'chatbox_msg AS m INNER JOIN '.$db->prefix.'users AS u ON u.id=m.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE m.posted > '.$last_msg_time.' ORDER BY m.posted ASC LIMIT 0,50') or error_ajax('Unable to fetch messages', __FILE__, __LINE__, $db->error());Ah et j'oubliais, le "Administrateur N°1", "Administrateur N°2" et "Administrateur N°3" faut les remplacer par le titre que tu voudrais leur mettre à ces admins. Faut aussi remplacer les ids et les couleurs que tu voudrais mettre.
EDIT :
Ah en fait, t'as pas modifier les requêtes..
Cherches aussi :
$result = $db->query('SELECT u.id, u.group_id, u.num_posts_chatbox, m.id AS m_id, m.poster_id, m.poster, m.poster_ip, m.poster_email, m.message, m.posted, g.g_id, g.g_title_chatbox FROM '.$db->prefix.'chatbox_msg AS m INNER JOIN '.$db->prefix.'users AS u ON u.id=m.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id ORDER BY m.posted DESC LIMIT '.$pun_config['cb_max_msg']) or error('Unable to fetch messages', __FILE__, __LINE__, $db->error());Remplaces par :
$result = $db->query('SELECT u.id, u.group_id, u.title, u.num_posts_chatbox, m.id AS m_id, m.poster_id, m.poster, m.poster_ip, m.poster_email, m.message, m.posted, g.g_id, g.g_color, g.g_title_chatbox FROM '.$db->prefix.'chatbox_msg AS m INNER JOIN '.$db->prefix.'users AS u ON u.id=m.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id ORDER BY m.posted DESC LIMIT '.$pun_config['cb_max_msg']) or error('Unable to fetch messages', __FILE__, __LINE__, $db->error());En fait ce fichier voit ses fonctions dédoublées pour la simple est bonne raison qu'il va d'abord chercher les message pour l'affichage par défaut. Pis ensuite, il affiche les message au fur et à mesure des rafraichissements. C'est pour ca que toutes les modifs concernant les messages sont à faire 2 fois.
Cordialement, WinuX
Dernière modification par WinuX (04-06-2011 13:58:59)
Hors ligne
Merci mais c'est toujours pareil, par exemple j'écris:
Il n'y a actuellement aucun message dans la ChatBox.
Administrateur N°1Jokerz - Aujourd'hui 15:33:56 - [ 13 ChatBox Posts ] [ ] [ Modifier ] [ Supprimer ]
test
Administrateur N°1Jokerz - Aujourd'hui 15:33:58 - [ 14 ChatBox Posts ] [ ] [ Modifier ] [ Supprimer ]
test
Administrateur N°1Jokerz - Aujourd'hui 15:34:00 - [ 15 ChatBox Posts ] [ ] [ Modifier ] [ Supprimer ]
testj'actualise et j'obtient:
Administrateur N°1Jokerz - Aujourd'hui 15:33:56 - [ 13 ChatBox Posts ] [ ] [ Modifier ] [ Supprimer ]
testIl y a bien la couleur mais sa ne marche toujours pas. il ne faut donc pas ajouter de condition ?
Hors ligne
bonsoir
le chatbox fonction t-il avec la revision 1.4.5
cordialement akira
function j_ai_besoin() {
if (ça existe) j'utilise;
if (ça existe mais c'est incomplet) j'améliore et je partage;
if (ça n'existe pas) je développe et je partage;
if (je réclame) exit;
Return "code amélioré" or "developpeur satisfait" or die;}
Hors ligne
Bonsoir,
Pour la 1.4 : http://fluxbb.org/resources/mods/poki-bb-chatbox/
I don't play against a team in particular. I play to fight against the idea to lose... Life is beautiful.
Quelque #ID et beaucoup de .CLASS
Hors ligne
Bonjour, je viens de remarquer que cette chat box empêchait aux visiteurs de lire les forums. Je m'explique.
Chatbox installée, en mode visiteur on ne voit aucun forum et chat box enlevée, les forum apparait. Y a -til une solution ?
Merci
Hors ligne
As-tu survolées les pages du topic ???
Hors ligne
Bonjour
Le chatbox fonction t-il avec la version 1.4.6 ?
CDT
Je débute en FTP + XHTML + CSS + FluxBB 1.4.7. J'apprend le PHP
Mais avant tout, un fana et pilote de chasse, avec pour Facteur de charge: +9,7 g / -3,6 g 
"Le pilote qui a vu l'autre en premier détient la moitié de la victoire."
Hors ligne
I don't play against a team in particular. I play to fight against the idea to lose... Life is beautiful.
Quelque #ID et beaucoup de .CLASS
Hors ligne
Salut tout le monde !
Je cherche comment ajouter un espace entre la chatbox et son environnement.
Comme vous pouvez le voir sur le message, entre l'espace pour écrire les message de chat et le titre "discutions générale sur l'ipad" il y a très peut d'espace. Comment agrandir cet espace ?
L'image :
Merci d'avance
Hors ligne
Bonjour,
Tu ajoutes les extensions Firebug et/ou Web Developper et tu regardes quelle est la div qui encadre la ChatBox et, dans les css, tu ajoutes margin-bottom:15px;
Ce n'est pas parce que l'erreur se propage qu'elle devient vérité. Gandhi
Sont différents : ça et sa - est et ait - à et a - ce et se - mes et mais ou met - été et était - c'est et ces - ce-si et ceci
La vie sans musique est tout simplement une erreur, une fatigue, un exil. Friedrich Nietzsche
Hors ligne
okay j'essaye ça !
[EDIT] Impecable ! Ca m'a en plus permis de comprendre un peut firebug !
Dernière modification par a-snowboard (01-10-2011 15:02:50)
Hors ligne
Merci pour ce mod que je viens de mettre en place .
Je rencontres quelques difficultés :
- Impossible de mettre les messages poster à côté du pseudo
-Impossible de mettre la couleur du message correspondant au grade
- J aimerai savoir comment faire pour que les smilies apparaissent en dessous de la shout
- et voir si il est possible d'ajouter une fonction du style " nouveau sujet posté par .....cliquez ici (pour voir le sujet)
J'ai fait le tour de ce topic mais je n ai pas vu de réponse bien clair .
Merci pour votre aide
Hors ligne
Et pour la 1.2.24, il y a pas la chatbox?
Hors ligne
Ce chat fonctionne probablement sans probleme pour la 1.2.24.
Mais bon il serait temps de passer en 1.4.8 
Hors ligne