1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-08 01:36:57 +02:00

- put consoring and smilie processing into functions (we use them all over the place) for better changing and consistency.

- changed docs/AUTHORS to reflect the recent code re-use in functions_messenger.php
- pleasing the users a little bit more by using table constants. :D
- login box if "mode" is not allowed -> posting (thought about trigger_error integration, but we do not need this that often).


git-svn-id: file:///svn/phpbb/trunk@4836 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2004-02-21 12:47:35 +00:00
parent 9c12fe83db
commit c74d2538ec
26 changed files with 211 additions and 254 deletions

View File

@@ -1049,7 +1049,7 @@ function login_forum_box(&$forum_data)
if ($password == $forum_data['forum_password'])
{
$sql = 'INSERT INTO phpbb_forum_access (forum_id, user_id, session_id)
$sql = 'INSERT INTO ' . FORUMS_ACCESS_TABLE . ' (forum_id, user_id, session_id)
VALUES (' . $forum_data['forum_id'] . ', ' . $user->data['user_id'] . ", '" . $db->sql_escape($user->session_id) . "')";
$db->sql_query($sql);
@@ -1066,7 +1066,7 @@ function login_forum_box(&$forum_data)
page_footer();
}
// Bump Topic Check - used by posting and viewtopic (do not want another included file)
// Bump Topic Check - used by posting and viewtopic
function bump_topic_allowed($forum_id, $topic_bumped, $last_post_time, $topic_poster, $last_topic_poster)
{
global $config, $auth, $user;
@@ -1097,6 +1097,38 @@ function bump_topic_allowed($forum_id, $topic_bumped, $last_post_time, $topic_po
return $bump_time;
}
// Censoring
function censor_text($text)
{
global $censors, $user;
if (!isset($censors))
{
$censors = array();
// For ANONYMOUS, this option should be enabled by default
if ($user->optionget('viewcensors'))
{
obtain_word_list($censors);
}
}
if (sizeof($censors) && $user->optionget('viewcensors'))
{
return preg_replace($censors['match'], $censors['replace'], $text);
}
return $text;
}
// Smilie processing
function smilie_text($text, $force_option = false)
{
global $config, $user, $phpbb_root_path;
return ($force_option || !$config['allow_smilies'] || !$user->optionget('viewsmilies')) ? preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILE_PATH\}\/.*? \/><!\-\- s\1 \-\->#', '\1', $text) : str_replace('<img src="{SMILE_PATH}', '<img src="' . $phpbb_root_path . $config['smilies_path'], $text);
}
// Error and message handler, call with trigger_error if reqd
function msg_handler($errno, $msg_text, $errfile, $errline)
{