aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2004-11-06 14:22:04 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2004-11-06 14:22:04 +0000
commit541a04972584cb95b349fe182e164c9629d5f360 (patch)
treeb1088ab098cbda085ac2e47b68f156f1294c7a77
parent836771cfb872215c9fa43c91f532382006ad25bf (diff)
downloadforums-541a04972584cb95b349fe182e164c9629d5f360.tar
forums-541a04972584cb95b349fe182e164c9629d5f360.tar.gz
forums-541a04972584cb95b349fe182e164c9629d5f360.tar.bz2
forums-541a04972584cb95b349fe182e164c9629d5f360.tar.xz
forums-541a04972584cb95b349fe182e164c9629d5f360.zip
- a bunch of updates, most of them bbcode related
git-svn-id: file:///svn/phpbb/trunk@5023 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/includes/bbcode.php31
-rw-r--r--phpBB/includes/functions.php9
-rw-r--r--phpBB/includes/functions_admin.php2
-rw-r--r--phpBB/includes/functions_messenger.php15
-rw-r--r--phpBB/includes/functions_posting.php11
-rw-r--r--phpBB/includes/functions_user.php2
-rw-r--r--phpBB/includes/mcp/mcp_main.php14
-rw-r--r--phpBB/includes/mcp/mcp_queue.php6
-rw-r--r--phpBB/includes/message_parser.php69
-rw-r--r--phpBB/includes/ucp/ucp_profile.php52
-rw-r--r--phpBB/styles/subSilver/template/memberlist_view.html2
-rw-r--r--phpBB/styles/subSilver/template/overall_header.html1
-rw-r--r--phpBB/styles/subSilver/template/ucp_profile_signature.html10
13 files changed, 136 insertions, 88 deletions
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php
index 4e56a2be77..1e4183109d 100644
--- a/phpBB/includes/bbcode.php
+++ b/phpBB/includes/bbcode.php
@@ -71,20 +71,23 @@ class bbcode
${$type}['search'][] = str_replace('$uid', $this->bbcode_uid, $search);
${$type}['replace'][] = $replace;
}
+
+ if (sizeof($str['search']))
+ {
+ $message = str_replace($str['search'], $str['replace'], $message);
+ $str = array('search' => array(), 'replace' => array());
+ }
+
+ if (sizeof($preg['search']))
+ {
+ $message = preg_replace($preg['search'], $preg['replace'], $message);
+ $preg = array('search' => array(), 'replace' => array());
+ }
}
}
}
}
- if (count($str['search']))
- {
- $message = str_replace($str['search'], $str['replace'], $message);
- }
- if (count($preg['search']))
- {
- $message = preg_replace($preg['search'], $preg['replace'], $message);
- }
-
// Remove the uid from tags that have not been transformed into HTML
$message = str_replace(':' . $this->bbcode_uid, '', $message);
}
@@ -223,6 +226,11 @@ class bbcode
break;
case 9:
$this->bbcode_cache[$bbcode_id] = array(
+ 'preg' => array(
+ '#(\[\/?(list|\*):[mou]?:?$uid\])[\n]{1}#' => "\$1",
+ '#(\[list=([^\[]+):$uid\])[\n]{1}#' => "\$1",
+ '#\[list=([^\[]+):$uid\]#e' => "\$this->bbcode_list('\$1')",
+ ),
'str' => array(
'[list:$uid]' => $this->bbcode_tpl('ulist_open_default', $bbcode_id),
'[/list:u:$uid]' => $this->bbcode_tpl('ulist_close', $bbcode_id),
@@ -231,9 +239,6 @@ class bbcode
'[/*:$uid]' => $this->bbcode_tpl('listitem_close', $bbcode_id),
'[/*:m:$uid]' => $this->bbcode_tpl('listitem_close', $bbcode_id)
),
- 'preg' => array(
- '#\[list=([^\[]+):$uid\]#e' => "\$this->bbcode_list('\$1')",
- )
);
break;
case 10:
@@ -442,7 +447,7 @@ class bbcode
{
$tpl = 'olist_open';
$type = 'arabic-numbers';
- $start = intval($chr);
+ $start = intval($type);
}
else
{
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index ecb7e5acb1..5ac6f635b7 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -359,7 +359,7 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list
continue;
}
- if ($acl_list && !$auth->acl_get($acl_list, $row['forum_id']))
+ if ($acl_list && !$auth->acl_gets($acl_list, $row['forum_id']))
{
continue;
}
@@ -606,7 +606,7 @@ function markread($mode, $forum_id = 0, $topic_id = 0, $marktime = false)
}
// Default tracking type
- $type = TRACK_NORMAL;
+// $type = TRACK_NORMAL;
$current_time = ($marktime) ? $marktime : time();
$topic_id = (int) $topic_id;
@@ -698,12 +698,14 @@ function markread($mode, $forum_id = 0, $topic_id = 0, $marktime = false)
if ($config['load_db_lastread'] || ($config['load_db_track'] && $type == TRACK_POSTED))
{
$sql = 'UPDATE ' . TOPICS_TRACK_TABLE . "
- SET mark_type = $type, mark_time = $current_time
+ SET mark_time = $current_time
WHERE topic_id = $topic_id
AND user_id = " . $user->data['user_id'] . "
AND mark_time < $current_time";
if (!$db->sql_query($sql) || !$db->sql_affectedrows())
{
+ $type = (!isset($type)) ? TRACK_NORMAL : $type;
+
$db->sql_return_on_error(true);
$sql = 'INSERT INTO ' . TOPICS_TRACK_TABLE . ' (user_id, topic_id, mark_type, mark_time)
@@ -1017,6 +1019,7 @@ function redirect($url)
{
header('Refresh: 0; URL=' . $url);
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta http-equiv="refresh" content="0; url=' . $url . '"><title>Redirect</title></head><body><div align="center">' . sprintf($user->lang['URL_REDIRECT'], '<a href="' . $url . '">', '</a>') . '</div></body></html>';
+
exit;
}
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 3c46469d4a..7e9de1147f 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -1663,8 +1663,6 @@ function cache_moderators()
}
}
}
-
- $cache->destroy(MODERATOR_TABLE);
}
// Logging functions
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index cd3c9c2533..20acf11bf5 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -13,13 +13,12 @@
class messenger
{
- var $msg, $subject, $extra_headers, $encoding;
- var $to_address, $cc_address, $bcc_address, $reply_to, $from;
- var $queue, $jabber;
+ var $vars, $msg, $extra_headers, $replyto, $from, $subject, $necoding;
+ var $addresses = array();
var $mail_priority = MAIL_NORMAL_PRIORITY;
- var $tpl_msg = array();
var $use_queue = true;
+ var $tpl_msg = array();
function messenger($use_queue = true)
{
@@ -33,13 +32,14 @@ class messenger
}
$this->use_queue = $use_queue;
+ $this->subject = '';
}
// Resets all the data (address, template file, etc etc) to default
function reset()
{
$this->addresses = array();
- $this->vars = $this->msg = $this->extra_headers = $this->replyto = $this->from = '';
+ $this->vars = $this->msg = $this->extra_headers = $this->replyto = $this->from = $this->encoding = '';
$this->mail_priority = MAIL_NORMAL_PRIORITY;
}
@@ -261,6 +261,11 @@ class messenger
// Build to, cc and bcc strings
foreach ($this->addresses as $type => $address_ary)
{
+ if ($type == 'im')
+ {
+ continue;
+ }
+
foreach ($address_ary as $which_ary)
{
$$type .= (($$type != '') ? ', ' : '') . (($which_ary['name'] != '') ? '"' . mail_encode($which_ary['name'], $this->encoding) . '" <' . $which_ary['email'] . '>' : $which_ary['email']);
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 7b87fb83be..ea8f605a72 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -1001,7 +1001,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
$msg_list_ary = array();
foreach ($msg_users as $row)
{
- $pos = sizeof($msg_list_ary[$row['template']]);
+ $pos = (!isset($msg_list_ary[$row['template']])) ? 0 : sizeof($msg_list_ary[$row['template']]);
$msg_list_ary[$row['template']][$pos]['method'] = $row['method'];
$msg_list_ary[$row['template']][$pos]['email'] = $row['user_email'];
@@ -1050,7 +1050,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
// Handle the DB updates
$db->sql_transaction();
- if (sizeof($update_notification['topic']))
+ if (isset($update_notification['topic']) && sizeof($update_notification['topic']))
{
$db->sql_query('UPDATE ' . TOPICS_WATCH_TABLE . "
SET notify_status = 1
@@ -1058,7 +1058,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
AND user_id IN (" . implode(', ', $update_notification['topic']) . ")");
}
- if (sizeof($update_notification['forum']))
+ if (isset($update_notification['forum']) && sizeof($update_notification['forum']))
{
$db->sql_query('UPDATE ' . FORUMS_WATCH_TABLE . "
SET notify_status = 1
@@ -1067,14 +1067,14 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
}
// Now delete the user_ids not authorized to receive notifications on this topic/forum
- if (sizeof($delete_ids['topic']))
+ if (isset($delete_ids['topic']) && sizeof($delete_ids['topic']))
{
$db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . "
WHERE topic_id = $topic_id
AND user_id IN (" . implode(', ', $delete_ids['topic']) . ")");
}
- if (sizeof($delete_ids['forum']))
+ if (isset($delete_ids['forum']) && sizeof($delete_ids['forum']))
{
$db->sql_query('DELETE FROM ' . FORUMS_WATCH_TABLE . "
WHERE forum_id = $forum_id
@@ -1082,7 +1082,6 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
}
$db->sql_transaction('commit');
-
}
?> \ No newline at end of file
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 92cd42d521..0f5dc852c9 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -915,7 +915,7 @@ function avatar_remote($data, &$error)
return false;
}
- return array(AVATAR_REMOTE, $remotelink, $width, $height);
+ return array(AVATAR_REMOTE, $data['remotelink'], $width, $height);
}
function avatar_upload($data, &$error)
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index 93a430048f..44e6b5acd6 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -379,8 +379,8 @@ function change_topic_type($mode, $topic_ids)
// Move Topic
function mcp_move_topic($topic_ids)
{
- global $auth, $user, $db, $SID, $phpEx, $phpbb_root_path, $template;
- global $_POST, $_REQUEST;
+ global $auth, $user, $db, $template;
+ global $SID, $phpEx, $phpbb_root_path;
if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', 'm_move')))
{
@@ -481,10 +481,10 @@ function mcp_move_topic($topic_ids)
);
$db->sql_query('INSERT INTO ' . TOPICS_TABLE . $db->sql_build_array('INSERT', $shadow));
- $next_id = $db->sql_nextid();
-
+
+ // $next_id = $db->sql_nextid();
// Mark Shadow topic read
- markread('topic', $row['forum_id'], $next_id);
+ // markread('topic', $row['forum_id'], $next_id);
}
}
unset($topic_data);
@@ -693,8 +693,8 @@ function mcp_delete_post($post_ids)
// Fork Topic
function mcp_fork_topic($topic_ids)
{
- global $auth, $user, $db, $SID, $phpEx, $phpbb_root_path, $template, $config;
- global $_POST, $_REQUEST;
+ global $auth, $user, $db, $template, $config;
+ global $SID, $phpEx, $phpbb_root_path;
if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', 'm_')))
{
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 4ba504a988..93d1055924 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -306,7 +306,7 @@ class mcp_queue extends module
function approve_post($post_id_list)
{
global $db, $template, $user, $config;
- global $_REQUEST, $phpEx, $phpbb_root_path, $SID;
+ global $phpEx, $phpbb_root_path, $SID;
if (!($forum_id = check_ids($post_id_list, POSTS_TABLE, 'post_id', 'm_approve')))
{
@@ -527,7 +527,7 @@ function approve_post($post_id_list)
function disapprove_post($post_id_list)
{
global $db, $template, $user, $config;
- global $_REQUEST, $_POST, $phpEx, $phpbb_root_path, $SID;
+ global $phpEx, $phpbb_root_path, $SID;
if (!($forum_id = check_ids($post_id_list, POSTS_TABLE, 'post_id', 'm_approve')))
{
@@ -718,7 +718,7 @@ function disapprove_post($post_id_list)
'ADDITIONAL_MSG' => $additional_msg)
);
- confirm_box(false, 'APPROVE_POST' . ((sizeof($post_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html');
+ confirm_box(false, 'DISAPPROVE_POST' . ((sizeof($post_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html');
}
$redirect = request_var('redirect', "index.$phpEx$SID");
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index ae39c92587..f738f31967 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -50,6 +50,7 @@ class bbcode_firstpass extends bbcode
{
var $message = '';
var $warn_msg = array();
+ var $parsed_items = array();
// Parse BBCode
function parse_bbcode()
@@ -109,15 +110,17 @@ class bbcode_firstpass extends bbcode
'b' => array('bbcode_id' => 1, 'regexp' => array('#\[b\](.*?)\[/b\]#is' => '[b:' . $this->bbcode_uid . ']$1[/b:' . $this->bbcode_uid . ']')),
'i' => array('bbcode_id' => 2, 'regexp' => array('#\[i\](.*?)\[/i\]#is' => '[i:' . $this->bbcode_uid . ']$1[/i:' . $this->bbcode_uid . ']')),
'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url=?(.*?)?\](.*?)\[/url\]#ise' => "\$this->validate_url('\$1', '\$2')")),
- 'img' => array('bbcode_id' => 4, 'regexp' => array('#\[img\](https?://)([a-z0-9\-\.,\?!%\*_:;~\\&$@/=\+]+)\[/img\]#i' => '[img:' . $this->bbcode_uid . ']$1$2[/img:' . $this->bbcode_uid . ']')),
+ 'img' => array('bbcode_id' => 4, 'regexp' => array('#\[img\](https?://)([a-z0-9\-\.,\?!%\*_:;~\\&$@/=\+]+)\[/img\]#ie' => "\$this->bbcode_img('\$1\$2')")),
'size' => array('bbcode_id' => 5, 'regexp' => array('#\[size=([\-\+]?[1-2]?[0-9])\](.*?)\[/size\]#is' => '[size=$1:' . $this->bbcode_uid . ']$2[/size:' . $this->bbcode_uid . ']')),
'color' => array('bbcode_id' => 6, 'regexp' => array('!\[color=(#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/color\]!is' => '[color=$1:' . $this->bbcode_uid . ']$2[/color:' . $this->bbcode_uid . ']')),
'u' => array('bbcode_id' => 7, 'regexp' => array('#\[u\](.*?)\[/u\]#is' => '[u:' . $this->bbcode_uid . ']$1[/u:' . $this->bbcode_uid . ']')),
'list' => array('bbcode_id' => 9, 'regexp' => array('#\[list(=[a-z|0-9|(?:disc|circle|square))]+)?\].*\[/list\]#ise' => "\$this->bbcode_list('\$0')")),
'email' => array('bbcode_id' => 10, 'regexp' => array('#\[email=?(.*?)?\](.*?)\[/email\]#ise' => "\$this->validate_email('\$1', '\$2')")),
- 'flash' => array('bbcode_id' => 11, 'regexp' => array('#\[flash=([0-9]+),([0-9]+)\](.*?)\[/flash\]#i' => '[flash=$1,$2:' . $this->bbcode_uid . ']$3[/flash:' . $this->bbcode_uid . ']'))
+ 'flash' => array('bbcode_id' => 11, 'regexp' => array('#\[flash=([0-9]+),([0-9]+)\](.*?)\[/flash\]#ie' => "\$this->bbcode_flash('\$1', '\$2', '\$3')"))
);
+ $this->parsed_items = array('code' => 0, 'quote' => 0, 'attachment' => 0, 'url' => 0, 'email' => 0, 'img' => 0, 'flash' => 0);
+
if (!isset($rowset))
{
global $db;
@@ -142,9 +145,27 @@ class bbcode_firstpass extends bbcode
}
}
+ function bbcode_img($in)
+ {
+ $this->parsed_items['img']++;
+
+ $out = '[img:' . $this->bbcode_uid . ']' . $in . '[/img:' . $this->bbcode_uid . ']';
+ return $out;
+ }
+
+ function bbcode_flash($width, $height, $in)
+ {
+ $this->parsed_items['flash']++;
+
+ $out = '[flash=' . $width . ',' . $height . ':' . $this->bbcode_uid . ']' . $in . '[/flash:' . $this->bbcode_uid . ']';
+ return $out;
+ }
+
// Hardcode inline attachments [ia]
function bbcode_attachment($stx, $in)
{
+ $this->parsed_items['attachment']++;
+
$out = '[attachment=' . $stx . ':' . $this->bbcode_uid . ']<!-- ia' . $stx . ' -->' . $in . '<!-- ia' . $stx . ' -->[/attachment:' . $this->bbcode_uid . ']';
return $out;
}
@@ -152,12 +173,14 @@ class bbcode_firstpass extends bbcode
// Expects the argument to start right after the opening [code] tag and to end with [/code]
function bbcode_code($stx, $in)
{
+ $this->parsed_items['code']++;
+
// when using the /e modifier, preg_replace slashes double-quotes but does not
// seem to slash anything else
$in = str_replace("\r\n", "\n", str_replace('\"', '"', $in));
// We remove the hardcoded elements from the code block here because it is not used in code blocks
- // Having it here saves us one preg_replace per message containing a [code] blocks
+ // Having it here saves us one preg_replace per message containing [code] blocks
$htm_match = array(
'#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#',
'#<!\-\- m \-\-><a href="(.*?)" target="_blank">.*?</a><!\-\- m \-\->#',
@@ -424,6 +447,8 @@ class bbcode_firstpass extends bbcode
}
elseif (preg_match('#^quote(?:=&quot;(.*?)&quot;)?$#is', $buffer, $m))
{
+ $this->parsed_items['quote']++;
+
// the buffer holds a valid opening tag
if ($config['max_quote_depth'] && sizeof($close_tags) >= $config['max_quote_depth'])
{
@@ -531,6 +556,8 @@ class bbcode_firstpass extends bbcode
return '[email' . (($var1) ? "=$var1" : '') . ']' . $var2 . '[/email]';
}
+ $this->parsed_items['email']++;
+
if ($var1)
{
$retval = '[email=' . $email . ':' . $this->bbcode_uid . ']' . $txt . '[/email:' . $this->bbcode_uid . ']';
@@ -562,6 +589,8 @@ class bbcode_firstpass extends bbcode
if ($valid)
{
+ $this->parsed_items['url']++;
+
if (!preg_match('#^[\w]+?://.*?#i', $url))
{
$url = 'http://' . $url;
@@ -604,10 +633,12 @@ class parse_message extends bbcode_firstpass
}
// Parse Message : public
- function parse($allow_html, $allow_bbcode, $allow_magic_url, $allow_smilies, $allow_img_bbcode = true, $allow_flash_bbcode = true, $allow_quote_bbcode = true, $update_this_message = true)
+ function parse($allow_html, $allow_bbcode, $allow_magic_url, $allow_smilies, $allow_img_bbcode = true, $allow_flash_bbcode = true, $allow_quote_bbcode = true, $update_this_message = true, $mode = 'post')
{
global $config, $db, $user;
+ $mode = ($mode != 'post') ? 'sig' : 'post';
+
$this->allow_img_bbcode = $allow_img_bbcode;
$this->allow_flash_bbcode = $allow_flash_bbcode;
$this->allow_quote_bbcode = $allow_quote_bbcode;
@@ -632,9 +663,11 @@ class parse_message extends bbcode_firstpass
$this->message = preg_replace($match, $replace, trim($this->message));
// Message length check
- if (!strlen($this->message) || ($config['max_post_chars'] && strlen($this->message) > $config['max_post_chars']))
+ $msg_len = ($mode == 'post') ? strlen($this->message) : strlen(preg_replace('#\[\/?[a-z\*\+\-]+(=[\S]+)?\]#is', ' ', $this->message));
+
+ if (!$msg_len || ($config['max_' . $mode . '_chars'] && $msg_len > $config['max_' . $mode . '_chars']))
{
- $this->warn_msg[] = (!strlen($this->message)) ? $user->lang['TOO_FEW_CHARS'] : $user->lang['TOO_MANY_CHARS'];
+ $this->warn_msg[] = (!$msg_len) ? $user->lang['TOO_FEW_CHARS'] : $user->lang['TOO_MANY_CHARS'];
return $this->warn_msg;
}
@@ -647,13 +680,20 @@ class parse_message extends bbcode_firstpass
// Parse Emoticons
if ($allow_smilies)
{
- $this->emoticons($config['max_post_smilies']);
+ $this->emoticons($config['max_' . $mode . '_smilies']);
}
+ $num_urls = 0;
+
// Parse URL's
if ($allow_magic_url)
{
$this->magic_url((($config['cookie_secure']) ? 'https://' : 'http://'), $config['server_name'], $config['server_port'], $config['script_path']);
+
+ if ($config['max_' . $mode . '_urls'])
+ {
+ $num_urls += preg_match_all('#\<!-- (l|m|w|e) --\>.*?\<!-- \1 --\>#', $this->message, $matches);
+ }
}
// Parse BBCode
@@ -669,6 +709,14 @@ class parse_message extends bbcode_firstpass
}
}
$this->parse_bbcode();
+
+ $num_urls += $this->parsed_items['url'];
+ }
+
+ // Check number of links
+ if ($config['max_' . $mode . '_urls'] && $num_urls > $config['max_' . $mode . '_urls'])
+ {
+ $this->warn_msg[] = sprintf($user->lang['TOO_MANY_URLS'], $config['max_' . $mode . '_urls']);
}
if (!$update_this_message)
@@ -843,7 +891,7 @@ class parse_message extends bbcode_firstpass
if ($num_matches !== false && $num_matches > $max_smilies)
{
- $this->warn_msg[] = $user->lang['TOO_MANY_SMILIES'];
+ $this->warn_msg[] = sprintf($user->lang['TOO_MANY_SMILIES'], $max_smilies);
return;
}
}
@@ -1183,6 +1231,11 @@ class fulltext_search
$words = array();
if ($mode == 'edit')
{
+ $words['add']['post'] = array();
+ $words['add']['title'] = array();
+ $words['del']['post'] = array();
+ $words['del']['title'] = array();
+
$sql = 'SELECT w.word_id, w.word_text, m.title_match
FROM ' . SEARCH_WORD_TABLE . ' w, ' . SEARCH_MATCH_TABLE . " m
WHERE m.post_id = $post_id
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index db07ca48d7..26e9292f6f 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -367,45 +367,29 @@ class ucp_profile extends module
case 'signature':
- include($phpbb_root_path . 'includes/functions_posting.'.$phpEx);
-
- $var_ary = array(
- 'enable_html' => (bool) $config['allow_html'],
- 'enable_bbcode' => (bool) $config['allow_bbcode'],
- 'enable_smilies' => (bool) $config['allow_smilies'],
- 'enable_urls' => true,
- 'signature' => (string) $user->data['user_sig'],
-
- );
-
- foreach ($var_ary as $var => $default)
+ if (!$auth->acl_get('u_sig'))
{
- $$var = request_var($var, $default);
+ trigger_error('NO_AUTH_SIGNATURE');
}
+
+ include($phpbb_root_path . 'includes/functions_posting.'.$phpEx);
- $html_status = ($config['allow_html']) ? true : false;
- $bbcode_status = ($config['allow_bbcode']) ? true : false;
- $smilies_status = ($config['allow_smilies']) ? true : false;
-
- // NOTE: allow_img and allow_flash do not exist in config table
- $img_status = ($config['allow_img']) ? true : false;
- $flash_status = ($config['allow_flash']) ? true : false;
+ $enable_html = ($config['allow_sig_html']) ? request_var('enable_html', false) : false;
+ $enable_bbcode = ($config['allow_sig_bbcode']) ? request_var('enable_bbcode', $user->optionget('bbcode')) : false;
+ $enable_smilies = ($config['allow_sig_smilies']) ? request_var('enable_smilies', $user->optionget('smile')) : false;
+ $enable_urls = request_var('enable_urls', true);
+ $signature = request_var('signature', $user->data['user_sig']);
if ($submit || $preview)
{
include($phpbb_root_path . 'includes/message_parser.'.$phpEx);
- if (strlen($signature) > $config['max_sig_chars'])
- {
- $error[] = 'SIGNATURE_TOO_LONG';
- }
-
if (!sizeof($error))
{
$message_parser = new parse_message($signature);
// Allowing Quote BBCode
- $message_parser->parse($enable_html, $enable_bbcode, $enable_urls, $enable_smilies, $img_status, $flash_status, true);
+ $message_parser->parse($enable_html, $enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, true, 'sig');
if (sizeof($message_parser->warn_msg))
{
@@ -454,17 +438,17 @@ class ucp_profile extends module
'S_SMILIES_CHECKED' => (!$enable_smilies) ? 'checked="checked"' : '',
'S_MAGIC_URL_CHECKED' => (!$enable_urls) ? 'checked="checked"' : '',
- 'HTML_STATUS' => ($html_status) ? $user->lang['HTML_IS_ON'] : $user->lang['HTML_IS_OFF'],
- 'BBCODE_STATUS' => ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . "faq.$phpEx$SID&amp;mode=bbcode" . '" target="_phpbbcode">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . "faq.$phpEx$SID&amp;mode=bbcode" . '" target="_phpbbcode">', '</a>'),
- 'SMILIES_STATUS' => ($smilies_status) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
- 'IMG_STATUS' => ($img_status) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'],
- 'FLASH_STATUS' => ($flash_status) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'],
+ 'HTML_STATUS' => ($config['allow_sig_html']) ? $user->lang['HTML_IS_ON'] : $user->lang['HTML_IS_OFF'],
+ 'BBCODE_STATUS' => ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . "faq.$phpEx$SID&amp;mode=bbcode" . '" target="_phpbbcode">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . "faq.$phpEx$SID&amp;mode=bbcode" . '" target="_phpbbcode">', '</a>'),
+ 'SMILIES_STATUS' => ($config['allow_sig_smilies']) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
+ 'IMG_STATUS' => ($config['allow_sig_img']) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'],
+ 'FLASH_STATUS' => ($config['allow_sig_flash']) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'],
'L_SIGNATURE_EXPLAIN' => sprintf($user->lang['SIGNATURE_EXPLAIN'], $config['max_sig_chars']),
- 'S_HTML_ALLOWED' => $config['allow_html'],
- 'S_BBCODE_ALLOWED' => $config['allow_bbcode'],
- 'S_SMILIES_ALLOWED' => $config['allow_smilies'],)
+ 'S_HTML_ALLOWED' => $config['allow_sig_html'],
+ 'S_BBCODE_ALLOWED' => $config['allow_sig_bbcode'],
+ 'S_SMILIES_ALLOWED' => $config['allow_sig_smilies'],)
);
break;
diff --git a/phpBB/styles/subSilver/template/memberlist_view.html b/phpBB/styles/subSilver/template/memberlist_view.html
index c76978ca86..d139ad7ea4 100644
--- a/phpBB/styles/subSilver/template/memberlist_view.html
+++ b/phpBB/styles/subSilver/template/memberlist_view.html
@@ -37,7 +37,7 @@
</tr>
<!-- IF S_USER_LOGGED_IN -->
<tr>
- <td class="genmed" align="center">[ <a href="{U_ADD_FRIEND}">{L_ADD_FRIEND}</a> ]</td>
+ <td class="genmed" align="center">[ <a href="{U_ADD_FRIEND}">{L_ADD_FRIEND}</a> | <a href="{U_ADD_FOE}">{L_ADD_FOE}</a> ]</td>
</tr>
<!-- ENDIF -->
</table></td>
diff --git a/phpBB/styles/subSilver/template/overall_header.html b/phpBB/styles/subSilver/template/overall_header.html
index 4b2e8f7204..167cd99a81 100644
--- a/phpBB/styles/subSilver/template/overall_header.html
+++ b/phpBB/styles/subSilver/template/overall_header.html
@@ -45,6 +45,7 @@ function jumpto()
document.location.href = base_url.replace('&amp;', '&') + '&start=' + ((page - 1) * perpage);
}
}
+
//-->
</script>
</head>
diff --git a/phpBB/styles/subSilver/template/ucp_profile_signature.html b/phpBB/styles/subSilver/template/ucp_profile_signature.html
index f298a595c3..05fc81526b 100644
--- a/phpBB/styles/subSilver/template/ucp_profile_signature.html
+++ b/phpBB/styles/subSilver/template/ucp_profile_signature.html
@@ -47,7 +47,7 @@ function marklist(form_name, status)
<!-- IF ERROR -->
<tr>
- <td class="row3" colspan="2" align="center"><span class="error">{ERROR}</span></td>
+ <td class="row3" colspan="2" align="center"><span class="genmed error">{ERROR}</span></td>
</tr>
<!-- ENDIF -->
@@ -80,17 +80,17 @@ function marklist(form_name, status)
</table></td>
</tr>
<tr>
- <td colspan="9"><input class="helpline" type="text" name="helpbox" size="45" maxlength="100" value="{L_STYLES_TIP}" /></td>
+ <td colspan="9"><input class="helpline" type="text" name="helpbox" size="45" maxlength="100" style="width:100%" value="{L_STYLES_TIP}" /></td>
</tr>
<tr>
- <td colspan="9"><textarea class="post" name="signature" rows="6" cols="60" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{SIGNATURE}</textarea></td>
+ <td colspan="9"><textarea class="post" name="signature" rows="10" cols="70" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{SIGNATURE}</textarea></td>
</tr>
<tr>
- <td colspan="9"><table cellspacing="0" cellpadding="0" border="0">
+ <td colspan="9"><table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td bgcolor="black"><script language="javascript" type="text/javascript"><!--
- colorPalette('h', 14, 5)
+ colorPalette('h', 17, 5)
//--></script></td>
</tr>