query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Impossible de retrouver la liste des catégories et des forums.', __FILE__, __LINE__, $db->error());
$cur_category = 0;
$cat_count = 0;
while ($cur_forum = $db->fetch_assoc($result))
{
$moderators = '';
if ($cur_forum['cid'] != $cur_category) // A new category since last iteration?
{
if ($cur_category != 0)
echo "\t\t\t".''."\n\t\t\t".''."\n\t\t".''."\n\t".''."\n".''."\n\n";
++$cat_count;
?>
|
|
|
|
$pun_user['last_visit'])
{
$item_status = 'inew';
$icon_text = $lang_common['New icon'];
$icon_type = 'icon inew';
}
// Is this a redirect forum?
if ($cur_forum['redirect_url'] != '')
{
$forum_field = '';
$num_topics = $num_posts = ' ';
$item_status = 'iredirect';
$icon_text = $lang_common['Redirect icon'];
$icon_type = 'icon';
}
else
{
$forum_field = '';
$num_topics = $cur_forum['num_topics'];
$num_posts = $cur_forum['num_posts'];
}
if ($cur_forum['forum_desc'] != '')
$forum_field .= "\n\t\t\t\t\t\t\t\t".$cur_forum['forum_desc'];
// If there is a last_post/last_poster.
if ($cur_forum['last_post'] != '')
$last_post = ''.format_time($cur_forum['last_post']).' '.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).'';
else
$last_post = ' ';
if ($cur_forum['moderators'] != '')
{
$mods_array = unserialize($cur_forum['moderators']);
$moderators = array();
while (list($mod_username, $mod_id) = @each($mods_array))
$moderators[] = ''.pun_htmlspecialchars($mod_username).'';
$moderators = "\t\t\t\t\t\t\t\t".'('.$lang_common['Moderated by'].' '.implode(', ', $moderators).')
'."\n";
}
?>
>
|
|
|
|
0)
echo "\t\t\t".''."\n\t\t\t".'
'."\n\t\t".'
'."\n\t".'
'."\n".'
'."\n\n";
else
echo ''.$lang_index['Empty board'].'
';
// Collect some statistics from the database
$result = $db->query('SELECT COUNT(id)-1 FROM '.$db->prefix.'users') or error('Impossible de retrouver le nombre total d\utilisateurs', __FILE__, __LINE__, $db->error());
$stats['total_users'] = $db->result($result);
$result = $db->query('SELECT id, username FROM '.$db->prefix.'users ORDER BY registered DESC LIMIT 1') or error('Impossible de retrouver le dernier membre inscrit', __FILE__, __LINE__, $db->error());
$stats['last_user'] = $db->fetch_assoc($result);
$result = $db->query('SELECT SUM(num_topics), SUM(num_posts) FROM '.$db->prefix.'forums') or error('Impossible de retrouver le nombre de discussions et de messages', __FILE__, __LINE__, $db->error());
list($stats['total_topics'], $stats['total_posts']) = $db->fetch_row($result);
?>
- '. $stats['total_users'] ?>
- '.$stats['total_topics'] ?>
- '.$stats['total_posts'] ?>
- :
query('SELECT user_id, ident FROM '.$db->prefix.'online WHERE idle=0 ORDER BY ident', true) or error('Impossible de retrouver la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
while ($pun_user_online = $db->fetch_assoc($result))
{
if ($pun_user_online['user_id'] > 1)
$users[] = "\n\t\t\t\t".'- '.pun_htmlspecialchars($pun_user_online['ident']).'';
else
++$num_guests;
}
$num_users = count($users);
echo "\t\t\t\t".'
- '. $lang_index['Users online'].': '.$num_users.'
'."\n\t\t\t\t".'- '.$lang_index['Guests online'].': '.$num_guests.'
'."\n\t\t\t".'
'."\n";
if ($num_users > 0)
echo "\t\t\t".'
'."\n\t\t\t\t".'- '.$lang_index['Online'].':
'."\t\t\t\t".implode(', ', $users).''."\n\t\t\t".'
'."\n";
else
echo "\t\t\t".'
'."\n";
}
else
echo "\t\t".''."\n\t\t\t".'
'."\n";
?>
ATTENTION : Vous avez déjà posté exactement le même message dans la chatbox auparavant. Pour éviter d\'encombrer la chatbox, votre message n\'a pas été posté.';
$anti_blanc_msg = 'ATTENTION : Vous avez posté un message sans aucun texte ! Votre "message" n\'a pas été posté.';
$no_membre_msg = 'Vous devez être membre pour accéder à la chatbox';
$actualiser_msg = 'Actualiser';
$poster_msg = 'Poster';
require PUN_ROOT.'include/parser.php';
$tpl_parloir = file_get_contents(PUN_ROOT.$nom_fichier);
$messages = explode("", $tpl_parloir);
$nb_messages = count($messages);
$parloir = '';
$parloir_txt = '';
$anti_flood = 0;
if (isset($_GET['option']) && isset($_POST['message']) && !$pun_user['is_guest'])
$parloir_tmp_flood = ''.$pun_user['id'].''.$_POST['message'].'';
else
$parloir_tmp_flood = '';
for($i=0;$i<$nb_messages - 1;$i++)
{
$grab = ereg("(.*)", $messages[$i], $mess_id);
$grab = ereg("(.*)", $messages[$i], $mess_pseudo);
$grab = ereg("(.*)", $messages[$i], $mess_date);
$grab = ereg("(.*)", $messages[$i], $mess_texte);
$parloir .= ''.pun_htmlspecialchars($mess_pseudo[1]).' - '.format_time($mess_date[1])."\n".'
'."\n".parse_message($mess_texte[1], $hide_smilies)."\n"."\n"."\n";
if ($i+1 < $nb_messages_max)
{
$parloir_txt_flood = ''.$mess_id[1].''.$mess_texte[1].'';
if ($parloir_tmp_flood == $parloir_txt_flood)
$anti_flood = 1;
$parloir_txt .= ''."\r".' '.$mess_id[1].''."\r".' '.$mess_pseudo[1].''."\r".' '.$mess_date[1].''."\r".' '.$mess_texte[1].''."\r".''."\n\n";
}
}
if (isset($_GET['option']) && isset($_POST['message']) && !$pun_user['is_guest'])
{
if ($anti_flood == 0 && $_POST['message'] != '')
{
$fp = fopen(PUN_ROOT.$nom_fichier, "w");
if ($fp)
{
$parloir_txt = ''."\r".' '.$pun_user['id'].''."\r".' '.$pun_user['username'].''."\r".' '.time().''."\r".' '.$_POST['message'].''."\r".''."\n\n".$parloir_txt;
$r = fwrite($fp, $parloir_txt);
}
fclose($fp);
$parloir = ''.pun_htmlspecialchars($pun_user['username']).' - '.format_time(time())."\n".'
'."\n".parse_message($_POST['message'], $hide_smilies)."\n"."\n"."\n".$parloir;
}
elseif ($anti_flood == 1)
{
$parloir = $anti_flood_msg."\n".'
'."\n".'
'."\n".$parloir;
}
else
{
$parloir = $anti_blanc_msg."\n".'
'."\n".'
'."\n".$parloir;
}
}
?>