aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/modules/acp/acp_words.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/modules/acp/acp_words.php')
-rw-r--r--phpBB/modules/acp/acp_words.php182
1 files changed, 0 insertions, 182 deletions
diff --git a/phpBB/modules/acp/acp_words.php b/phpBB/modules/acp/acp_words.php
deleted file mode 100644
index 62c0cfdd1a..0000000000
--- a/phpBB/modules/acp/acp_words.php
+++ /dev/null
@@ -1,182 +0,0 @@
-<?php
-/**
-*
-* @package acp
-* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* @todo [words] check regular expressions for special char replacements (stored specialchared in db)
-* @package acp
-*/
-class acp_words
-{
- var $u_action;
-
- function main($id, $mode)
- {
- phpbb::$user->add_lang('acp/posting');
-
- // Set up general vars
- $action = request_var('action', '');
- $action = (phpbb_request::is_set_post('add')) ? 'add' : ((phpbb_request::is_set_post('save')) ? 'save' : $action);
-
- $s_hidden_fields = '';
- $word_info = array();
-
- $this->tpl_name = 'acp_words';
- $this->page_title = 'ACP_WORDS';
-
- $form_name = 'acp_words';
- add_form_key($form_name);
-
- switch ($action)
- {
- case 'edit':
- $word_id = request_var('id', 0);
-
- if (!$word_id)
- {
- trigger_error(phpbb::$user->lang['NO_WORD'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- $sql = 'SELECT *
- FROM ' . WORDS_TABLE . "
- WHERE word_id = $word_id";
- $result = phpbb::$db->sql_query($sql);
- $word_info = phpbb::$db->sql_fetchrow($result);
- phpbb::$db->sql_freeresult($result);
-
- $s_hidden_fields .= '<input type="hidden" name="id" value="' . $word_id . '" />';
-
- case 'add':
-
- phpbb::$template->assign_vars(array(
- 'S_EDIT_WORD' => true,
- 'U_ACTION' => $this->u_action,
- 'U_BACK' => $this->u_action,
- 'WORD' => (isset($word_info['word'])) ? $word_info['word'] : '',
- 'REPLACEMENT' => (isset($word_info['replacement'])) ? $word_info['replacement'] : '',
- 'S_HIDDEN_FIELDS' => $s_hidden_fields,
- ));
-
- return;
-
- break;
-
- case 'save':
-
- if (!check_form_key($form_name))
- {
- trigger_error(phpbb::$user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING);
- }
- $word_id = request_var('id', 0);
- $word = utf8_normalize_nfc(request_var('word', '', true));
- $replacement = utf8_normalize_nfc(request_var('replacement', '', true));
-
- if (!$word || !$replacement)
- {
- trigger_error(phpbb::$user->lang['ENTER_WORD'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- $sql_ary = array(
- 'word' => $word,
- 'replacement' => $replacement
- );
-
- if ($word_id)
- {
- phpbb::$db->sql_query('UPDATE ' . WORDS_TABLE . ' SET ' . phpbb::$db->sql_build_array('UPDATE', $sql_ary) . ' WHERE word_id = ' . $word_id);
- }
- else
- {
- phpbb::$db->sql_query('INSERT INTO ' . WORDS_TABLE . ' ' . phpbb::$db->sql_build_array('INSERT', $sql_ary));
- }
-
- phpbb::$acm->destroy('word_censors');
-
- $log_action = ($word_id) ? 'LOG_WORD_EDIT' : 'LOG_WORD_ADD';
- add_log('admin', $log_action, $word);
-
- $message = ($word_id) ? phpbb::$user->lang['WORD_UPDATED'] : phpbb::$user->lang['WORD_ADDED'];
- trigger_error($message . adm_back_link($this->u_action));
-
- break;
-
- case 'delete':
-
- $word_id = request_var('id', 0);
-
- if (!$word_id)
- {
- trigger_error(phpbb::$user->lang['NO_WORD'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
- if (confirm_box(true))
- {
- $sql = 'SELECT word
- FROM ' . WORDS_TABLE . "
- WHERE word_id = $word_id";
- $result = phpbb::$db->sql_query($sql);
- $deleted_word = phpbb::$db->sql_fetchfield('word');
- phpbb::$db->sql_freeresult($result);
-
- $sql = 'DELETE FROM ' . WORDS_TABLE . "
- WHERE word_id = $word_id";
- phpbb::$db->sql_query($sql);
-
- phpbb::$acm->destroy('word_censors');
-
- add_log('admin', 'LOG_WORD_DELETE', $deleted_word);
-
- trigger_error(phpbb::$user->lang['WORD_REMOVED'] . adm_back_link($this->u_action));
- }
- else
- {
- confirm_box(false, phpbb::$user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
- 'i' => $id,
- 'mode' => $mode,
- 'id' => $word_id,
- 'action' => 'delete',
- )));
- }
-
- break;
- }
-
-
- phpbb::$template->assign_vars(array(
- 'U_ACTION' => $this->u_action,
- 'S_HIDDEN_FIELDS' => $s_hidden_fields,
- ));
-
- $sql = 'SELECT *
- FROM ' . WORDS_TABLE . '
- ORDER BY word';
- $result = phpbb::$db->sql_query($sql);
-
- while ($row = phpbb::$db->sql_fetchrow($result))
- {
- phpbb::$template->assign_block_vars('words', array(
- 'WORD' => $row['word'],
- 'REPLACEMENT' => $row['replacement'],
- 'U_EDIT' => $this->u_action . '&amp;action=edit&amp;id=' . $row['word_id'],
- 'U_DELETE' => $this->u_action . '&amp;action=delete&amp;id=' . $row['word_id'],
- ));
- }
- phpbb::$db->sql_freeresult($result);
- }
-}
-
-?> \ No newline at end of file