Index: trunk/web/punbb/admin_censoring.php
===================================================================
--- trunk/web/punbb/admin_censoring.php	(revision 10)
+++ trunk/web/punbb/admin_censoring.php	(revision 1)
@@ -1,23 +1,38 @@
 <?php
+/***********************************************************************
 
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+  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
+
+************************************************************************/
+
 
 // Tell header.php to use the admin template
 define('PUN_ADMIN_CONSOLE', 1);
 
-define('PUN_ROOT', dirname(__FILE__).'/');
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 require PUN_ROOT.'include/common_admin.php';
 
 
-if ($pun_user['g_id'] != PUN_ADMIN)
+if ($pun_user['g_id'] > PUN_MOD)
 	message($lang_common['No permission']);
 
-// Load the admin_censoring.php language file
-require PUN_ROOT.'lang/'.$admin_language.'/admin_censoring.php';
 
 // Add a censor word
@@ -26,20 +41,15 @@
 	confirm_referrer('admin_censoring.php');
 
-	$search_for = pun_trim($_POST['new_search_for']);
-	$replace_with = pun_trim($_POST['new_replace_with']);
+	$search_for = trim($_POST['new_search_for']);
+	$replace_with = trim($_POST['new_replace_with']);
 
-	if ($search_for == '')
-		message($lang_admin_censoring['Must enter word message']);
+	if ($search_for == '' || $replace_with == '')
+		message('Vous devez saisir Ã  la fois un mot Ã  censurer et un texte pour le remplacer.');
 
-	$db->query('INSERT INTO '.$db->prefix.'censoring (search_for, replace_with) VALUES (\''.$db->escape($search_for).'\', \''.$db->escape($replace_with).'\')') or error('Unable to add censor word', __FILE__, __LINE__, $db->error());
+	$db->query('INSERT INTO '.$db->prefix.'censoring (search_for, replace_with) VALUES (\''.$db->escape($search_for).'\', \''.$db->escape($replace_with).'\')') or error('Impossible d\'ajouter un mot Ã  censurer', __FILE__, __LINE__, $db->error());
 
-	// Regenerate the censoring cache
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
+	redirect('admin_censoring.php', 'Mot Ã  censurer ajoutÃ©. Redirection ...');
+}
 
-	generate_censoring_cache();
-
-	redirect('admin_censoring.php', $lang_admin_censoring['Word added redirect']);
-}
 
 // Update a censor word
@@ -50,20 +60,15 @@
 	$id = intval(key($_POST['update']));
 
-	$search_for = pun_trim($_POST['search_for'][$id]);
-	$replace_with = pun_trim($_POST['replace_with'][$id]);
+	$search_for = trim($_POST['search_for'][$id]);
+	$replace_with = trim($_POST['replace_with'][$id]);
 
-	if ($search_for == '')
-		message($lang_admin_censoring['Must enter word message']);
+	if ($search_for == '' || $replace_with == '')
+		message('Vous devez saisir Ã  la fois un mot Ã  censurer et un texte pour le remplacer.');
 
-	$db->query('UPDATE '.$db->prefix.'censoring SET search_for=\''.$db->escape($search_for).'\', replace_with=\''.$db->escape($replace_with).'\' WHERE id='.$id) or error('Unable to update censor word', __FILE__, __LINE__, $db->error());
+	$db->query('UPDATE '.$db->prefix.'censoring SET search_for=\''.$db->escape($search_for).'\', replace_with=\''.$db->escape($replace_with).'\' WHERE id='.$id) or error('Impossible de mettre Ã  jour le mot Ã  censurer', __FILE__, __LINE__, $db->error());
 
-	// Regenerate the censoring cache
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
+	redirect('admin_censoring.php', 'Mot Ã  censurer modifiÃ©. Redirection ...');
+}
 
-	generate_censoring_cache();
-
-	redirect('admin_censoring.php', $lang_admin_censoring['Word updated redirect']);
-}
 
 // Remove a censor word
@@ -74,18 +79,12 @@
 	$id = intval(key($_POST['remove']));
 
-	$db->query('DELETE FROM '.$db->prefix.'censoring WHERE id='.$id) or error('Unable to delete censor word', __FILE__, __LINE__, $db->error());
+	$db->query('DELETE FROM '.$db->prefix.'censoring WHERE id='.$id) or error('Impossible de supprimer le mot Ã  censurer', __FILE__, __LINE__, $db->error());
 
-	// Regenerate the censoring cache
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
-
-	generate_censoring_cache();
-
-	redirect('admin_censoring.php',  $lang_admin_censoring['Word removed redirect']);
+	redirect('admin_censoring.php', 'Mot Ã  censurer supprimÃ©. Redirection ...');
 }
 
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Censoring']);
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Mots Ã  censurer';
 $focus_element = array('censoring', 'new_search_for');
-define('PUN_ACTIVE_PAGE', 'admin');
 require PUN_ROOT.'header.php';
 
@@ -94,25 +93,25 @@
 ?>
 	<div class="blockform">
-		<h2><span><?php echo $lang_admin_censoring['Censoring head'] ?></span></h2>
+		<h2><span>Mots Ã  censurer</span></h2>
 		<div class="box">
-			<form id="censoring" method="post" action="admin_censoring.php">
+			<form id="censoring" method="post" action="admin_censoring.php?action=foo">
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_admin_censoring['Add word subhead'] ?></legend>
+						<legend>Ajouter un mot Ã  censurer</legend>
 						<div class="infldset">
-							<p><?php echo $lang_admin_censoring['Add word info'].' '.($pun_config['o_censoring'] == '1' ? sprintf($lang_admin_censoring['Censoring enabled'], '<a href="admin_options.php#censoring">'.$lang_admin_common['Options'].'</a>') : sprintf($lang_admin_censoring['Censoring disabled'], '<a href="admin_options.php#censoring">'.$lang_admin_common['Options'].'</a>')) ?></p>
-							<table cellspacing="0">
+							<p>Saisissez le mot que vous voulez censurer ainsi que le texte qui le remplacera. Les caractÃšres joker sont permis  (ex: *fleur* vÃ©rifiera Â«&#160;fleurette&#160;Â» et Â«&#160;gonfleur&#160;Â» ). Les mots censurÃ©s affectent Ã©galement les noms d'utilisateurs. Un nouvel utilisateur ne pourrait s'inscrire avec un nom d'utilisateur qui contiendrait un des mots censurÃ©s. La recherche est insensible Ã  la casse. <strong>Les mots censurÃ©s doivent Ãªtres activÃ©s Ã  la page <a href="admin_options.php#censoring">Options</a> pour qu'ils aient un quelconque effet.</strong></p>
+							<table  cellspacing="0">
 							<thead>
 								<tr>
-									<th class="tcl" scope="col"><?php echo $lang_admin_censoring['Censored word label'] ?></th>
-									<th class="tc2" scope="col"><?php echo $lang_admin_censoring['Replacement label'] ?></th>
-									<th class="hidehead" scope="col"><?php echo $lang_admin_censoring['Action label'] ?></th>
+									<th class="tcl" scope="col">Mot Ã  censurer</th>
+									<th class="tc2" scope="col">Texte de remplacement</th>
+									<th class="hidehead" scope="col">Action</th>
 								</tr>
 							</thead>
 							<tbody>
 								<tr>
-									<td class="tcl"><input type="text" name="new_search_for" size="24" maxlength="60" tabindex="1" /></td>
-									<td class="tc2"><input type="text" name="new_replace_with" size="24" maxlength="60" tabindex="2" /></td>
-									<td><input type="submit" name="add_word" value="<?php echo $lang_admin_common['Add'] ?>" tabindex="3" /></td>
+									<td><input type="text" name="new_search_for" size="24" maxlength="60" tabindex="1" /></td>
+									<td><input type="text" name="new_replace_with" size="24" maxlength="60" tabindex="2" /></td>
+									<td><input type="submit" name="add_word" value=" Add " tabindex="3" /></td>
 								</tr>
 							</tbody>
@@ -123,9 +122,9 @@
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_admin_censoring['Edit remove subhead'] ?></legend>
+						<legend>Modifier/supprimer des mots Ã  censurer</legend>
 						<div class="infldset">
 <?php
 
-$result = $db->query('SELECT id, search_for, replace_with FROM '.$db->prefix.'censoring ORDER BY id') or error('Unable to fetch censor word list', __FILE__, __LINE__, $db->error());
+$result = $db->query('SELECT id, search_for, replace_with FROM '.$db->prefix.'censoring ORDER BY id') or error('Impossible de retrouver la liste des mots Ã  censurer', __FILE__, __LINE__, $db->error());
 if ($db->num_rows($result))
 {
@@ -135,7 +134,7 @@
 							<thead>
 								<tr>
-									<th class="tcl" scope="col"><?php echo $lang_admin_censoring['Censored word label'] ?></th>
-									<th class="tc2" scope="col"><?php echo $lang_admin_censoring['Replacement label'] ?></th>
-									<th class="hidehead" scope="col"><?php echo $lang_admin_censoring['Action label'] ?></th>
+									<th class="tcl" scope="col">Mots Ã  censurer</th>
+									<th class="tc2" scope="col">Texte de remplacement</th>
+									<th class="hidehead" scope="col">Actions</th>
 								</tr>
 							</thead>
@@ -144,5 +143,5 @@
 
 	while ($cur_word = $db->fetch_assoc($result))
-		echo "\t\t\t\t\t\t\t\t".'<tr><td class="tcl"><input type="text" name="search_for['.$cur_word['id'].']" value="'.pun_htmlspecialchars($cur_word['search_for']).'" size="24" maxlength="60" /></td><td class="tc2"><input type="text" name="replace_with['.$cur_word['id'].']" value="'.pun_htmlspecialchars($cur_word['replace_with']).'" size="24" maxlength="60" /></td><td><input type="submit" name="update['.$cur_word['id'].']" value="'.$lang_admin_common['Update'].'" />&#160;<input type="submit" name="remove['.$cur_word['id'].']" value="'.$lang_admin_common['Remove'].'" /></td></tr>'."\n";
+		echo "\t\t\t\t\t\t\t\t".'<tr><td><input type="text" name="search_for['.$cur_word['id'].']" value="'.pun_htmlspecialchars($cur_word['search_for']).'" size="24" maxlength="60" /></td><td><input type="text" name="replace_with['.$cur_word['id'].']" value="'.pun_htmlspecialchars($cur_word['replace_with']).'" size="24" maxlength="60" /></td><td><input type="submit" name="update['.$cur_word['id'].']" value=" Modifier " />&#160;<input type="submit" name="remove['.$cur_word['id'].']" value=" Supprimer " /></td></tr>'."\n";
 
 ?>
@@ -153,5 +152,5 @@
 }
 else
-	echo "\t\t\t\t\t\t\t".'<p>'.$lang_admin_censoring['No words in list'].'</p>'."\n";
+	echo "\t\t\t\t\t\t\t".'<p>Aucun mot Ã  censurer dans la liste.</p>'."\n";
 
 ?>
