aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/adm/index.php9
-rw-r--r--phpBB/adm/style/acp_groups.html7
-rw-r--r--phpBB/adm/style/acp_permissions.html9
-rw-r--r--phpBB/adm/style/acp_profile.html3
-rw-r--r--phpBB/adm/style/acp_users.html29
-rw-r--r--phpBB/adm/swatch.php9
-rw-r--r--phpBB/download.php110
-rw-r--r--phpBB/includes/acp/acp_attachments.php2
-rw-r--r--phpBB/includes/acp/acp_board.php1
-rw-r--r--phpBB/includes/acp/acp_icons.php111
-rw-r--r--phpBB/includes/acp/acp_permissions.php2
-rw-r--r--phpBB/includes/acp/acp_users.php10
-rw-r--r--phpBB/includes/functions.php24
-rw-r--r--phpBB/includes/functions_admin.php8
-rw-r--r--phpBB/includes/functions_display.php35
-rw-r--r--phpBB/includes/functions_messenger.php34
-rw-r--r--phpBB/includes/functions_user.php33
-rw-r--r--phpBB/includes/message_parser.php6
-rw-r--r--phpBB/includes/session.php7
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php20
-rw-r--r--phpBB/includes/ucp/ucp_profile.php27
-rw-r--r--phpBB/install/schemas/mysql_schema.sql4
-rw-r--r--phpBB/install/schemas/oracle_schema.sql4
-rw-r--r--phpBB/install/schemas/postgres_schema.sql4
-rw-r--r--phpBB/install/schemas/schema_data.sql1
-rw-r--r--phpBB/install/schemas/sqlite_schema.sql4
-rw-r--r--phpBB/language/en/acp/attachments.php4
-rw-r--r--phpBB/language/en/acp/board.php6
-rw-r--r--phpBB/language/en/acp/groups.php2
-rw-r--r--phpBB/language/en/common.php5
-rw-r--r--phpBB/language/en/posting.php1
-rw-r--r--phpBB/memberlist.php29
-rw-r--r--phpBB/posting.php18
-rw-r--r--phpBB/styles/subSilver/template/memberlist_leaders.html4
-rw-r--r--phpBB/styles/subSilver/template/memberlist_view.html16
-rw-r--r--phpBB/styles/subSilver/template/overall_header.html2
-rw-r--r--phpBB/styles/subSilver/template/ucp_profile_signature.html1
-rw-r--r--phpBB/viewtopic.php14
38 files changed, 296 insertions, 319 deletions
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php
index ac8725a599..0c317d3d4c 100644
--- a/phpBB/adm/index.php
+++ b/phpBB/adm/index.php
@@ -205,14 +205,7 @@ function adm_page_footer($copyright_html = true)
$template->display('body');
- // Unload cache, must be done before the DB connection if closed
- if (!empty($cache))
- {
- $cache->unload();
- }
-
- // Close our DB connection.
- $db->sql_close();
+ garbage_collection();
exit;
}
diff --git a/phpBB/adm/style/acp_groups.html b/phpBB/adm/style/acp_groups.html
index ccf4c74521..55e7220cf4 100644
--- a/phpBB/adm/style/acp_groups.html
+++ b/phpBB/adm/style/acp_groups.html
@@ -282,10 +282,13 @@
<fieldset class="quick">
<!-- IF S_GROUP_ADD -->
- {L_CREATE_GROUP}: <input type="text" name="group_name" value="" /> <input class="button2" type="submit" name="add" value="{L_SUBMIT}" />
+ {L_CREATE_GROUP}: <input type="text" name="group_name" value="" /> <input class="button2" type="submit" name="submit" value="{L_SUBMIT}" />
+ <input type="hidden" name="add" value="1" />
<!-- ENDIF -->
</fieldset>
+ </form>
+
<h1>{L_SPECIAL_GROUPS}</h1>
<p>{L_SPECIAL_GROUPS_EXPLAIN}</p>
@@ -313,8 +316,6 @@
</tbody>
</table>
- </form>
-
<!-- ENDIF -->
<!-- INCLUDE overall_footer.html --> \ No newline at end of file
diff --git a/phpBB/adm/style/acp_permissions.html b/phpBB/adm/style/acp_permissions.html
index 5069b4b162..8694125b0d 100644
--- a/phpBB/adm/style/acp_permissions.html
+++ b/phpBB/adm/style/acp_permissions.html
@@ -140,8 +140,7 @@
<fieldset class="quick">
{S_HIDDEN_FIELDS}
- <input class="button2" type="submit" name="action[delete]" value="{L_REMOVE_PERMISSIONS}" /> &nbsp;
- <input class="button1" type="submit" name="submit_edit_options" value="{L_EDIT_PERMISSIONS}" />
+ <input type="submit" class="button2" name="action[delete]" value="{L_REMOVE_PERMISSIONS}" style="width: 46% !important;" /> &nbsp; <input class="button1" type="submit" name="submit_edit_options" value="{L_EDIT_PERMISSIONS}" style="width: 46% !important;" />
</fieldset>
</form>
@@ -153,13 +152,12 @@
<p>{L_USERNAMES_EXPLAIN}</p>
<dl>
<dd class="full"><textarea id="username" name="usernames" rows="5" cols="5" style="width: 100%; height: 60px;"></textarea></dd>
- <dd class="full" style="text-align: left;"><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> &nbsp;{L_SELECT_ANONYMOUS}</dd>
+ <dd class="full" style="text-align: left;"><div style="float: right;">[ <a href="#" onclick="window.open('{U_FIND_USERNAME}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</div><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> &nbsp;{L_SELECT_ANONYMOUS}</dd>
</dl>
</fieldset>
<fieldset class="quick">
{S_HIDDEN_FIELDS}
- <input class="button2" type="submit" name="find_username" value="{L_FIND_USERNAME}" onclick="window.open('{U_FIND_USERNAME}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;" /> &nbsp;
<input class="button1" type="submit" name="submit_add_options" value="{L_ADD_PERMISSIONS}" />
</fieldset>
@@ -187,8 +185,7 @@
<fieldset class="quick">
{S_HIDDEN_FIELDS}
- <input class="button2" type="submit" name="action[delete]" value="{L_REMOVE_PERMISSIONS}" />&nbsp;
- <input class="button1" type="submit" name="submit_edit_options" value="{L_EDIT_PERMISSIONS}" />
+ <input class="button2" type="submit" name="action[delete]" value="{L_REMOVE_PERMISSIONS}" style="width: 46% !important;" /> &nbsp; <input class="button1" type="submit" name="submit_edit_options" value="{L_EDIT_PERMISSIONS}" style="width: 46% !important;" />
</fieldset>
</form>
diff --git a/phpBB/adm/style/acp_profile.html b/phpBB/adm/style/acp_profile.html
index ca5d49401f..187220673a 100644
--- a/phpBB/adm/style/acp_profile.html
+++ b/phpBB/adm/style/acp_profile.html
@@ -182,7 +182,8 @@
<fieldset class="quick">
<input class="small" type="text" name="field_ident" /> <select name="field_type">{S_TYPE_OPTIONS}</select>
- <input class="button1" type="submit" name="create" value="{L_CREATE_NEW_FIELD}" />
+ <input class="button1" type="submit" name="submit" value="{L_CREATE_NEW_FIELD}" />
+ <input type="hidden" name="create" value="1" />
</fieldset>
</form>
diff --git a/phpBB/adm/style/acp_users.html b/phpBB/adm/style/acp_users.html
index f509d4d1a2..06fdf6626f 100644
--- a/phpBB/adm/style/acp_users.html
+++ b/phpBB/adm/style/acp_users.html
@@ -537,7 +537,7 @@
// Define the bbCode tags
bbcode = new Array();
- bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]');
+ bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]'<!-- BEGIN custom_tags -->, {custom_tags.BBCODE_NAME}<!-- END custom_tags -->);
imageTag = false;
// Helpline messages
@@ -572,15 +572,17 @@
<legend>{L_SIGNATURE}</legend>
<p>{L_SIGNATURE_EXPLAIN}</p>
<div id="format-buttons">
- <input class="button2" type="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onclick="bbstyle(0)" onmouseover="helpline('b')" />
- <input class="button2" type="button" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onclick="bbstyle(2)" onmouseover="helpline('i')" />
- <input class="button2" type="button" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onclick="bbstyle(4)" onmouseover="helpline('u')" />
- <input class="button2" type="button" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" />
- <input class="button2" type="button" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" />
- <input class="button2" type="button" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" />
- <input class="button2" type="button" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" />
- <input class="button2" type="button" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" />
- <input class="button2" type="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" />
+ <input type="button" class="button2" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px;" onclick="bbstyle(0)" onmouseover="helpline('b')" />
+ <input type="button" class="button2" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px;" onclick="bbstyle(2)" onmouseover="helpline('i')" />
+ <input type="button" class="button2" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px;" onclick="bbstyle(4)" onmouseover="helpline('u')" />
+ <input type="button" class="button2" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" />
+ <input type="button" class="button2" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" />
+ <input type="button" class="button2" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" />
+ <input type="button" class="button2" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" />
+ <!-- IF S_BBCODE_IMG --><input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" /><!-- ENDIF -->
+ <input type="button" class="button2" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" />
+ <!-- IF S_BBCODE_FLASH --><input type="button" class="button2" accesskey="f" name="addbbcode18" value="Flash" onclick="bbstyle(18)" /><!-- ENDIF -->
+
{L_FONT_SIZE}: <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" onmouseover="helpline('f')">
<option value="7">{L_FONT_TINY}</option>
<option value="9">{L_FONT_SMALL}</option>
@@ -589,6 +591,13 @@
<option value="24">{L_FONT_HUGE}</option>
</select>
<a href="javascript:bbstyle(-1)" onmouseover="helpline('a')">{L_CLOSE_TAGS}</a>
+ <!-- IF .custom_tags -->
+ <br /><br />
+ <!-- BEGIN custom_tags -->
+ <input type="button" class="button2" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})" />
+ <!-- END custom_tags -->
+ <!-- ENDIF -->
+
</div>
<p><input type="text" name="helpbox" value="{L_STYLES_TIP}" class="full" style="border: 0; background: none;" /></p>
<dl>
diff --git a/phpBB/adm/swatch.php b/phpBB/adm/swatch.php
index 1051523a70..5d452218b0 100644
--- a/phpBB/adm/swatch.php
+++ b/phpBB/adm/swatch.php
@@ -36,13 +36,6 @@ $template->assign_vars(array(
$template->display('body');
-// Unload cache, must be done before the DB connection if closed
-if (!empty($cache))
-{
- $cache->unload();
-}
-
-// Close our DB connection.
-$db->sql_close();
+garbage_collection();
?> \ No newline at end of file
diff --git a/phpBB/download.php b/phpBB/download.php
index 1fe953101a..083a4343f8 100644
--- a/phpBB/download.php
+++ b/phpBB/download.php
@@ -162,84 +162,53 @@ function send_file_to_browser($attachment, $upload_dir, $category)
trigger_error($user->lang['ERROR_NO_ATTACHMENT'] . '<br /><br />' . sprintf($user->lang['FILE_NOT_FOUND_404'], $filename));
}
- // Determine the Browser the User is using, because of some nasty incompatibilities.
- // borrowed from phpMyAdmin. :)
- $user_agent = $user->browser;
-
- if (ereg('Opera(/| )([0-9].[0-9]{1,2})', $user_agent, $log_version))
- {
- $browser_version = $log_version[2];
- $browser_agent = 'opera';
- }
- else if (ereg('MSIE ([0-9].[0-9]{1,2})', $user_agent, $log_version))
- {
- $browser_version = $log_version[1];
- $browser_agent = 'ie';
- }
- else if (ereg('OmniWeb/([0-9].[0-9]{1,2})', $user_agent, $log_version))
- {
- $browser_version = $log_version[1];
- $browser_agent = 'omniweb';
- }
- else if (ereg('(Konqueror/)(.*)(;)', $user_agent, $log_version))
- {
- $browser_version = $log_version[2];
- $browser_agent = 'konqueror';
- }
- else if (ereg('Mozilla/([0-9].[0-9]{1,2})', $user_agent, $log_version) && ereg('Safari/([0-9]*)', $user_agent, $log_version2))
- {
- $browser_version = $log_version[1] . '.' . $log_version2[1];
- $browser_agent = 'safari';
- }
- else if (ereg('Mozilla/([0-9].[0-9]{1,2})', $user_agent, $log_version))
- {
- $browser_version = $log_version[1];
- $browser_agent = 'mozilla';
- }
- else
- {
- $browser_version = 0;
- $browser_agent = 'other';
- }
-
// Correct the mime type - we force application/octetstream for all files, except images
// Please do not change this, it is a security precaution
if ($category == ATTACHMENT_CATEGORY_NONE && strpos($attachment['mimetype'], 'image') === false)
{
- $attachment['mimetype'] = ($browser_agent == 'ie' || $browser_agent == 'opera') ? 'application/octetstream' : 'application/octet-stream';
+ $attachment['mimetype'] = (strpos(strtolower($user->browser), 'msie') !== false || strpos(strtolower($user->browser), 'opera') !== false) ? 'application/octetstream' : 'application/octet-stream';
}
if (@ob_get_length())
{
@ob_end_clean();
}
-
- // Now the tricky part... let's dance
- header('Pragma: public');
-
- // Send out the Headers
- header('Content-Type: ' . $attachment['mimetype'] . '; name="' . $attachment['real_filename'] . '"');
- header('Content-Disposition: inline; filename="' . $attachment['real_filename'] . '"');
// Now send the File Contents to the Browser
$size = @filesize($filename);
- if ($size)
- {
- header("Content-length: $size");
- }
- $result = @readfile($filename);
-
- if (!$result)
+
+ // Might not be ideal to store the contents, but file_get_contents is binary-safe as well as the recommended method
+ // To correctly display further errors we need to make sure we are using the correct headers for both (unsetting content-length may not work)
+ $contents = @file_get_contents($filename);
+
+ // Check if headers already sent or not able to get the file contents.
+ if (headers_sent() || $contents === false)
{
+ unset($contents);
+
// PHP track_errors setting On?
if (!empty($php_errormsg))
{
- trigger_error('Unable to deliver file.<br />Error was: ' . $php_errormsg, E_USER_ERROR);
+ trigger_error($user->lang['UNABLE_TO_DELIVER_FILE'] . '<br />' . sprintf($user->lang['TRACKED_PHP_ERROR'], $php_errormsg));
}
- trigger_error('Unable to deliver file.', E_USER_ERROR);
+ trigger_error('UNABLE_TO_DELIVER_FILE');
}
+ // Now the tricky part... let's dance
+ header('Pragma: public');
+
+ // Send out the Headers
+ header('Content-type: ' . $attachment['mimetype'] . '; name="' . $attachment['real_filename'] . '"');
+ header('Content-Disposition: inline; filename="' . $attachment['real_filename'] . '"');
+
+ if ($size)
+ {
+ header("Content-length: $size");
+ }
+ echo $contents;
+ unset($contents);
+
flush();
exit;
}
@@ -256,7 +225,7 @@ function download_allowed()
return true;
}
- $url = (getenv('HTTP_REFERER')) ? trim(getenv('HTTP_REFERER')) : trim($_SERVER['HTTP_REFERER']);
+ $url = (!empty($_SERVER['HTTP_REFERER'])) ? trim($_SERVER['HTTP_REFERER']) : trim(getenv('HTTP_REFERER'));
if (!$url)
{
@@ -264,20 +233,27 @@ function download_allowed()
}
// Split URL into domain and script part
- $url = explode('?', str_replace(array('http://', 'https://'), array('', ''), $url));
- $hostname = trim($url[0]);
+ $url = @parse_url($url);
+
+ if ($url === false)
+ {
+ return ($config['secure_allow_empty_referer']) ? true : false;
+ }
+
+ $hostname = $url['host'];
unset($url);
$allowed = ($config['secure_allow_deny']) ? false : true;
$iplist = array();
- $ip_ary = gethostbynamel($hostname);
-
- foreach ($ip_ary as $ip)
+ if (($ip_ary = @gethostbynamel($hostname)) !== false)
{
- if ($ip)
+ foreach ($ip_ary as $ip)
{
- $iplist[] = $ip;
+ if ($ip)
+ {
+ $iplist[] = $ip;
+ }
}
}
@@ -311,7 +287,7 @@ function download_allowed()
{
foreach ($iplist as $ip)
{
- if (preg_match('#^' . str_replace('*', '.*?', $site_ip) . '$#i', $ip))
+ if (preg_match('#^' . str_replace('*', '.*?', preg_quote($site_ip, '#')) . '$#i', $ip))
{
if ($row['ip_exclude'])
{
@@ -328,7 +304,7 @@ function download_allowed()
if ($site_hostname)
{
- if (preg_match('#^' . str_replace('*', '.*?', $site_hostname) . '$#i', $hostname))
+ if (preg_match('#^' . str_replace('*', '.*?', preg_quote($site_hostname, '#')) . '$#i', $hostname))
{
if ($row['ip_exclude'])
{
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index 641ceac03e..52c5460847 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -97,7 +97,7 @@ class acp_attachments
'max_attachments_pm' => array('lang' => 'MAX_ATTACHMENTS_PM', 'type' => 'text:3:3', 'explain' => false),
'secure_downloads' => array('lang' => 'SECURE_DOWNLOADS', 'type' => 'radio:yes_no', 'explain' => true),
'secure_allow_deny' => array('lang' => 'SECURE_ALLOW_DENY', 'type' => 'custom', 'method' => 'select_allow_deny', 'explain' => true),
- 'secure_allow_empty_referer' => array('lang' => 'SECURE_EMPTY_REFERER', 'type' => 'radio:yes_no', 'explain' => true),
+ 'secure_allow_empty_referer' => array('lang' => 'SECURE_EMPTY_REFERRER', 'type' => 'radio:yes_no', 'explain' => true),
'legend2' => $l_legend_cat_images,
'img_display_inlined' => array('lang' => 'DISPLAY_INLINED', 'type' => 'radio:yes_no', 'explain' => true),
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 011bbede7f..be98c6fd49 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -204,7 +204,6 @@ class acp_board
'coppa_enable' => array('lang' => 'ENABLE_COPPA', 'type' => 'radio:yes_no', 'explain' => true),
'coppa_mail' => array('lang' => 'COPPA_MAIL', 'type' => 'textarea:5:40', 'explain' => true),
'coppa_fax' => array('lang' => 'COPPA_FAX', 'type' => 'text:25:100', 'explain' => false),
- 'coppa_hide_groups' => array('lang' => 'COPPA_HIDE_GROUPS', 'type' => 'radio:yes_no', 'explain' => true),
)
);
break;
diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php
index b74e5f8b4f..0587122423 100644
--- a/phpBB/includes/acp/acp_icons.php
+++ b/phpBB/includes/acp/acp_icons.php
@@ -108,44 +108,41 @@ class acp_icons
ORDER BY {$fields}_order " . (($icon_id || $action == 'add') ? 'DESC' : 'ASC');
$result = $db->sql_query($sql);
- if ($row = $db->sql_fetchrow($result))
+ while ($row = $db->sql_fetchrow($result))
{
- do
+ if ($action == 'add')
{
- if ($action == 'add')
- {
- unset($_images[$row[$fields . '_url']]);
- }
+ unset($_images[$row[$fields . '_url']]);
+ }
- if ($row[$fields . '_id'] == $icon_id)
+ if ($row[$fields . '_id'] == $icon_id)
+ {
+ $after = true;
+ $data[$row[$fields . '_url']] = $row;
+ }
+ else
+ {
+ if ($action == 'edit' && !$icon_id)
{
- $after = true;
$data[$row[$fields . '_url']] = $row;
}
- else
- {
- if ($action == 'edit' && !$icon_id)
- {
- $data[$row[$fields . '_url']] = $row;
- }
-
- $selected = '';
- if (!empty($after))
- {
- $selected = ' selected="selected"';
- $after = false;
- }
- $after_txt = ($mode == 'smilies') ? $row['code'] : $row['icons_url'];
- $order_list = '<option value="' . ($row[$fields . '_order']) . '"' . $selected . '>' . sprintf($user->lang['AFTER_' . $lang], ' -&gt; ' . htmlspecialchars($after_txt)) . '</option>' . $order_list;
+ $selected = '';
+ if (!empty($after))
+ {
+ $selected = ' selected="selected"';
+ $after = false;
}
+
+ $after_txt = ($mode == 'smilies') ? $row['code'] : $row['icons_url'];
+ $order_list = '<option value="' . ($row[$fields . '_order']) . '"' . $selected . '>' . sprintf($user->lang['AFTER_' . $lang], ' -&gt; ' . htmlspecialchars($after_txt)) . '</option>' . $order_list;
}
- while ($row = $db->sql_fetchrow($result));
}
$db->sql_freeresult($result);
$order_list = '<option value="1"' . ((!isset($after)) ? ' selected="selected"' : '') . '>' . $user->lang['FIRST'] . '</option>' . $order_list;
+ $data = array();
if ($action == 'add')
{
$data = $_images;
@@ -231,20 +228,20 @@ class acp_icons
}
$img_sql = array(
- $fields . '_url' => $image,
- $fields . '_width' => $image_width[$image],
- $fields . '_height' => $image_height[$image],
- 'display_on_posting'=> (isset($image_display_on_posting[$image])) ? 1 : 0,
+ $fields . '_url' => $image,
+ $fields . '_width' => $image_width[$image],
+ $fields . '_height' => $image_height[$image],
+ 'display_on_posting' => (isset($image_display_on_posting[$image])) ? 1 : 0,
);
if ($mode == 'smilies')
{
$img_sql = array_merge($img_sql, array(
- 'emotion' => $image_emotion[$image],
- 'code' => $image_code[$image])
+ 'emotion' => $image_emotion[$image],
+ 'code' => $image_code[$image])
);
}
-
+
if (!empty($image_order[$image]))
{
$img_sql = array_merge($img_sql, array(
@@ -351,7 +348,10 @@ class acp_icons
$cur_img = array();
$field_sql = ($mode == 'smilies') ? 'code' : 'icons_url';
- $result = $db->sql_query("SELECT $field_sql FROM $table");
+
+ $sql = "SELECT $field_sql
+ FROM $table";
+ $result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
@@ -371,8 +371,8 @@ class acp_icons
$data = array();
if (preg_match_all("#'(.*?)', #", $pak_entry, $data))
{
- if ((sizeof($data[1]) != 3 && $mode == 'icons') ||
- (sizeof($data[1]) != 5 && $mode == 'smilies'))
+ if ((sizeof($data[1]) != 4 && $mode == 'icons') ||
+ (sizeof($data[1]) != 6 && $mode == 'smilies'))
{
trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($this->u_action));
}
@@ -381,11 +381,12 @@ class acp_icons
$img = stripslashes($data[1][0]);
$width = stripslashes($data[1][1]);
$height = stripslashes($data[1][2]);
+ $display_on_posting = stripslashes($data[1][3]);
- if (isset($data[1][3]) && isset($data[1][4]))
+ if (isset($data[1][4]) && isset($data[1][5]))
{
- $emotion = stripslashes($data[1][3]);
- $code = stripslashes($data[1][4]);
+ $emotion = stripslashes($data[1][4]);
+ $code = stripslashes($data[1][5]);
}
if ($current == 'replace' &&
@@ -394,15 +395,16 @@ class acp_icons
{
$replace_sql = ($mode == 'smilies') ? $code : $img;
$sql = array(
- $fields . '_url' => $img,
- $fields . '_height' => (int) $height,
- $fields . '_width' => (int) $width,
+ $fields . '_url' => $img,
+ $fields . '_height' => (int) $height,
+ $fields . '_width' => (int) $width,
+ 'display_on_posting' => (int) $display_on_posting,
);
if ($mode == 'smilies')
{
$sql = array_merge($sql, array(
- 'emotion' => $emotion
+ 'emotion' => $emotion,
));
}
@@ -415,17 +417,18 @@ class acp_icons
++$order;
$sql = array(
- $fields . '_url' => $img,
- $fields . '_height' => (int) $height,
- $fields . '_width' => (int) $width,
- $fields . '_order' => (int) $order,
+ $fields . '_url' => $img,
+ $fields . '_height' => (int) $height,
+ $fields . '_width' => (int) $width,
+ $fields . '_order' => (int) $order,
+ 'display_on_posting'=> (int) $display_on_posting,
);
if ($mode == 'smilies')
{
$sql = array_merge($sql, array(
- 'code' => $code,
- 'emotion' => $emotion
+ 'code' => $code,
+ 'emotion' => $emotion,
));
}
$db->sql_query("INSERT INTO $table " . $db->sql_build_array('INSERT', $sql));
@@ -435,7 +438,7 @@ class acp_icons
$cache->destroy('icons');
$cache->destroy('sql', $table);
-
+
trigger_error($user->lang[$lang . '_IMPORT_SUCCESS'] . adm_back_link($this->u_action));
}
else
@@ -476,7 +479,7 @@ class acp_icons
);
return;
-
+
break;
case 'send':
@@ -492,6 +495,7 @@ class acp_icons
$pak .= "'" . addslashes($row[$fields . '_url']) . "', ";
$pak .= "'" . addslashes($row[$fields . '_width']) . "', ";
$pak .= "'" . addslashes($row[$fields . '_height']) . "', ";
+ $pak .= "'" . addslashes($row['display_on_posting']) . "', ";
if ($mode == 'smilies')
{
@@ -505,7 +509,7 @@ class acp_icons
if ($pak != '')
{
- $db->sql_close();
+ garbage_collection();
header('Pragma: public');
@@ -519,15 +523,16 @@ class acp_icons
}
else
{
- trigger_error($user->lang['NO_' . $fields . '_EXPORT'] . adm_back_link($this->u_action));
+ trigger_error($user->lang['NO_' . strtoupper($fields) . '_EXPORT'] . adm_back_link($this->u_action));
}
break;
case 'delete':
- $db->sql_query("DELETE FROM $table
- WHERE {$fields}_id = $icon_id");
+ $sql = "DELETE FROM $table
+ WHERE {$fields}_id = $icon_id";
+ $db->sql_query($sql);
switch ($mode)
{
diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php
index 76edb094da..3619075fc8 100644
--- a/phpBB/includes/acp/acp_permissions.php
+++ b/phpBB/includes/acp/acp_permissions.php
@@ -70,7 +70,7 @@ class acp_permissions
if ($select_all_groups)
{
// Add default groups to selection
- $sql_and = ($config['coppa_hide_groups']) ? " AND group_name NOT IN ('INACTIVE_COPPA', 'REGISTERED_COPPA')" : '';
+ $sql_and = (!$config['coppa_enable']) ? " AND group_name NOT IN ('INACTIVE_COPPA', 'REGISTERED_COPPA')" : '';
$sql = 'SELECT group_id
FROM ' . GROUPS_TABLE . '
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index f8b289da5e..f6fe02e617 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -1505,6 +1505,7 @@ class acp_users
case 'sig':
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
+ include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx);
$enable_bbcode = ($config['allow_sig_bbcode']) ? request_var('enable_bbcode', $this->optionget($user_row, 'bbcode')) : false;
$enable_smilies = ($config['allow_sig_smilies']) ? request_var('enable_smilies', $this->optionget($user_row, 'smilies')) : false;
@@ -1576,9 +1577,14 @@ class acp_users
'L_SIGNATURE_EXPLAIN' => sprintf($user->lang['SIGNATURE_EXPLAIN'], $config['max_sig_chars']),
'S_BBCODE_ALLOWED' => $config['allow_sig_bbcode'],
- 'S_SMILIES_ALLOWED' => $config['allow_sig_smilies'],)
+ 'S_SMILIES_ALLOWED' => $config['allow_sig_smilies'],
+ 'S_BBCODE_IMG' => ($config['allow_sig_img']) ? true : false,
+ 'S_BBCODE_FLASH' => ($config['allow_sig_flash']) ? true : false)
);
+ // Assigning custom bbcodes
+ display_custom_bbcodes();
+
break;
case 'attach':
@@ -1808,7 +1814,7 @@ class acp_users
$s_group_options = '';
while ($row = $db->sql_fetchrow($result))
{
- if ($config['coppa_hide_groups'] && in_array($row['group_name'], array('INACTIVE_COPPA', 'REGISTERED_COPPA')))
+ if (!$config['coppa_enable'] && in_array($row['group_name'], array('INACTIVE_COPPA', 'REGISTERED_COPPA')))
{
continue;
}
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 4185837917..50cdd6a121 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1202,15 +1202,12 @@ function redirect($url)
{
global $db, $cache, $config, $user;
- if (isset($db))
+ if (empty($user->lang))
{
- $db->sql_close();
+ $user->add_lang('common');
}
- if (isset($cache))
- {
- $cache->unload();
- }
+ garbage_collection();
// Make sure no &amp;'s are in, this will break the redirect
$url = str_replace('&amp;', '&', $url);
@@ -2341,16 +2338,8 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
case E_USER_ERROR:
- if (isset($db))
- {
- $db->sql_close();
- }
+ garbage_collection();
- if (isset($cache))
- {
- $cache->unload();
- }
-
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
echo '<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">';
echo '<head>';
@@ -2499,7 +2488,9 @@ function page_header($page_title = '', $display_online_list = true)
if (!empty($_REQUEST['f']))
{
$f = request_var('f', 0);
- $reading_sql = " AND s.session_page LIKE '%f=$f%'";
+
+ // Do not change this (it is defined as _f_={forum_id}x within session.php)
+ $reading_sql = " AND s.session_page LIKE '%\_f\_={$f}x%'";
}
// Get number of online guests
@@ -2727,6 +2718,7 @@ function page_header($page_title = '', $display_online_list = true)
'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false,
'S_BOARD_DISABLED' => ($config['board_disable'] && !defined('IN_LOGIN') && $auth->acl_gets('a_', 'm_')) ? true : false,
'S_REGISTERED_USER' => $user->data['is_registered'],
+ 'S_IS_BOT' => $user->data['is_bot'],
'S_USER_PM_POPUP' => $user->optionget('popuppm'),
'S_USER_LANG' => $user->data['user_lang'],
'S_USER_BROWSER' => (isset($user->data['session_browser'])) ? $user->data['session_browser'] : $user->lang['UNKNOWN_BROWSER'],
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 76d9f66a07..dc873eff60 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -212,7 +212,7 @@ function group_select_options($group_id, $exclude_ids = false)
global $db, $user, $config;
$exclude_sql = ($exclude_ids !== false && sizeof($exclude_ids)) ? 'WHERE group_id NOT IN (' . implode(', ', array_map('intval', $exclude_ids)) . ')' : '';
- $sql_and = ($config['coppa_hide_groups']) ? (($exclude_sql) ? ' AND ' : ' WHERE ') . "group_name NOT IN ('INACTIVE_COPPA', 'REGISTERED_COPPA')" : '';
+ $sql_and = (!$config['coppa_enable']) ? (($exclude_sql) ? ' AND ' : ' WHERE ') . "group_name NOT IN ('INACTIVE_COPPA', 'REGISTERED_COPPA')" : '';
$sql = 'SELECT group_id, group_name, group_type
FROM ' . GROUPS_TABLE . "
@@ -483,7 +483,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
*/
function delete_topics($where_type, $where_ids, $auto_sync = true)
{
- global $db;
+ global $db, $config;
$forum_ids = $topic_ids = array();
@@ -546,6 +546,8 @@ function delete_topics($where_type, $where_ids, $auto_sync = true)
sync('topic_reported', $where_type, $where_ids);
}
+ set_config('num_topics', $config['num_topics'] - sizeof($return['topics']), true);
+
return $return;
}
@@ -638,6 +640,8 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
sync('forum', 'forum_id', $forum_ids, true);
}
+ set_config('num_posts', $config['num_posts'] - sizeof($post_ids), true);
+
return sizeof($post_ids);
}
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index c408f39d50..eec11408dd 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -652,7 +652,7 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold
break;
default:
- if ($replies >= $config['hot_threshold'])
+ if ($config['hot_threshold'] && $replies >= $config['hot_threshold'])
{
$folder = 'folder_hot';
$folder_new = 'folder_hot_new';
@@ -898,6 +898,39 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_
}
/**
+* Assign/Build custom bbcodes for display in screens supporting using of bbcodes
+* The custom bbcodes buttons will be placed within the template block 'custom_codes'
+*/
+function display_custom_bbcodes()
+{
+ global $db, $template;
+
+ // Start counting from 22 for the bbcode ids (every bbcode takes two ids - opening/closing)
+ $num_predefined_bbcodes = 22;
+
+ /*
+ * @todo while adjusting custom bbcodes, think about caching this query as well as correct ordering
+ */
+ $sql = 'SELECT bbcode_id, bbcode_tag
+ FROM ' . BBCODES_TABLE . '
+ WHERE display_on_posting = 1';
+ $result = $db->sql_query($sql);
+
+ $i = 0;
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $template->assign_block_vars('custom_tags', array(
+ 'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'",
+ 'BBCODE_ID' => $num_predefined_bbcodes + ($i * 2),
+ 'BBCODE_TAG' => $row['bbcode_tag'])
+ );
+
+ $i++;
+ }
+ $db->sql_freeresult($result);
+}
+
+/**
* Display reasons
*/
function display_reasons($reason_id = 0)
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index 20101f1750..21edb9fd13 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -118,7 +118,7 @@ class messenger
*/
function headers($headers)
{
- $this->extra_headers .= trim($headers) . "\n";
+ $this->extra_headers .= trim($headers) . "\r\n";
}
/**
@@ -339,22 +339,22 @@ class messenger
}
// Build header
- $headers = 'From: ' . $this->from . "\n";
- $headers .= ($cc != '') ? "Cc: $cc\n" : '';
- $headers .= ($bcc != '') ? "Bcc: $bcc\n" : '';
- $headers .= 'Reply-to: ' . $this->replyto . "\n";
- $headers .= 'Return-Path: <' . $config['board_email'] . ">\n";
- $headers .= 'Sender: <' . $config['board_email'] . ">\n";
- $headers .= "MIME-Version: 1.0\n";
- $headers .= 'Message-ID: <' . md5(unique_id(time())) . "@" . $config['server_name'] . ">\n";
- $headers .= 'Date: ' . gmdate('D, d M Y H:i:s T', time()) . "\n";
- $headers .= "Content-type: text/plain; charset={$this->encoding}\n";
- $headers .= "Content-transfer-encoding: 8bit\n";
- $headers .= "X-Priority: {$this->mail_priority}\n";
- $headers .= 'X-MSMail-Priority: ' . (($this->mail_priority == MAIL_LOW_PRIORITY) ? 'Low' : (($this->mail_priority == MAIL_NORMAL_PRIORITY) ? 'Normal' : 'High')) . "\n";
- $headers .= "X-Mailer: PhpBB\n";
- $headers .= "X-MimeOLE: phpBB\n";
- $headers .= "X-phpBB-Origin: phpbb://" . str_replace(array('http://', 'https://'), array('', ''), generate_board_url()) . "\n";
+ $headers = 'From: ' . $this->from . "\r\n";
+ $headers .= ($cc != '') ? "Cc: $cc\r\n" : '';
+ $headers .= ($bcc != '') ? "Bcc: $bcc\r\n" : '';
+ $headers .= 'Reply-to: ' . $this->replyto . "\r\n";
+ $headers .= 'Return-Path: <' . $config['board_email'] . ">\r\n";
+ $headers .= 'Sender: <' . $config['board_email'] . ">\r\n";
+ $headers .= "MIME-Version: 1.0\r\n";
+ $headers .= 'Message-ID: <' . md5(unique_id(time())) . "@" . $config['server_name'] . ">\r\n";
+ $headers .= 'Date: ' . gmdate('D, d M Y H:i:s T', time()) . "\r\n";
+ $headers .= "Content-type: text/plain; charset={$this->encoding}\r\n";
+ $headers .= "Content-transfer-encoding: 8bit\r\n";
+ $headers .= "X-Priority: {$this->mail_priority}\r\n";
+ $headers .= 'X-MSMail-Priority: ' . (($this->mail_priority == MAIL_LOW_PRIORITY) ? 'Low' : (($this->mail_priority == MAIL_NORMAL_PRIORITY) ? 'Normal' : 'High')) . "\r\n";
+ $headers .= "X-Mailer: PhpBB3\r\n";
+ $headers .= "X-MimeOLE: phpBB3\r\n";
+ $headers .= "X-phpBB-Origin: phpbb://" . str_replace(array('http://', 'https://'), array('', ''), generate_board_url()) . "\r\n";
$headers .= ($this->extra_headers != '') ? $this->extra_headers : '';
// Send message ... removed $this->encode() from subject for time being
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 4e943a2028..6bccea43ea 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -219,34 +219,6 @@ function user_add($user_row, $cp_data = false)
{
$cp_data['user_id'] = (int) $user_id;
- switch (SQL_LAYER)
- {
- case 'oracle':
- case 'firebird':
- case 'postgres':
- $right_delim = $left_delim = '"';
- break;
-
- case 'sqlite':
- case 'mssql':
- case 'mssql_odbc':
- $right_delim = ']';
- $left_delim = '[';
- break;
-
- case 'mysql':
- case 'mysql4':
- case 'mysqli':
- $right_delim = $left_delim = '`';
- break;
- }
-
- foreach ($cp_data as $key => $value)
- {
- $cp_data[$right_delim . $key . $left_delim] = $value;
- unset($cp_data[$key]);
- }
-
if (!class_exists('custom_profile'))
{
include_once($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
@@ -375,6 +347,9 @@ function user_delete($mode, $user_id, $post_username = false)
set_config('num_users', $config['num_users'] - 1, true);
+ // Adjust last post info...
+
+
$db->sql_transaction('commit');
return false;
@@ -1187,7 +1162,7 @@ function avatar_remote($data, &$error)
// Make sure getimagesize works...
if (($image_data = @getimagesize($data['remotelink'])) === false)
{
- $error[] = $user->lang['AVATAR_URL_INVALID'];
+ $error[] = $user->lang['UNABLE_GET_IMAGE_SIZE'];
return false;
}
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 85f99d349b..26e754033a 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -803,8 +803,10 @@ class bbcode_firstpass extends bbcode
{
global $config, $phpEx, $user;
+ $check_path = ($user->page['root_script_path'] != '/') ? substr($user->page['root_script_path'], 0, -1) : '/';
+
// Is the user trying to link to a php file in this domain and script path?
- if (strpos($url, ".{$phpEx}") !== false && strpos($url, substr($user->page['root_script_path'], 0, -1)) !== false)
+ if (strpos($url, ".{$phpEx}") !== false && strpos($url, $check_path) !== false)
{
$server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
@@ -816,7 +818,7 @@ class bbcode_firstpass extends bbcode
// Check again in correct order...
$pos_ext = strpos($url, ".{$phpEx}");
- $pos_path = strpos($url, substr($user->page['root_script_path'], 0, -1));
+ $pos_path = strpos($url, $check_path);
$pos_domain = strpos($url, $server_name);
if ($pos_domain !== false && $pos_path >= $pos_domain && $pos_ext >= $pos_path)
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index e6418416e0..3e340b7e16 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -51,7 +51,7 @@ class session
// Now, remove the sid and let us get a clean query string...
foreach ($args as $key => $argument)
{
- if (strpos($argument, 'sid=') === 0)
+ if (strpos($argument, 'sid=') === 0 || strpos($argument, '_f_=') === 0)
{
unset($args[$key]);
break;
@@ -143,7 +143,8 @@ class session
$this->host = (!empty($_SERVER['HTTP_HOST'])) ? (string) $_SERVER['HTTP_HOST'] : 'localhost';
$this->page = $this->extract_current_page($phpbb_root_path);
- $this->page['page'] .= (isset($_POST['f'])) ? ((strpos($this->page['page'], '?') !== false) ? '&' : '?') . 'f=' . intval($_POST['f']) : '';
+ // Add forum to the page for tracking online users - also adding a "x" to the end to properly identify the number
+ $this->page['page'] .= (isset($_REQUEST['f'])) ? ((strpos($this->page['page'], '?') !== false) ? '&' : '?') . '_f_=' . (int) $_REQUEST['f'] . 'x' : '';
if (isset($_COOKIE[$config['cookie_name'] . '_sid']) || isset($_COOKIE[$config['cookie_name'] . '_u']))
{
@@ -420,7 +421,7 @@ class session
$db->sql_freeresult($result);
}
- if ($this->data['user_id'] != ANONYMOUS)
+ if ($this->data['user_id'] != ANONYMOUS && !$bot)
{
$this->data['session_last_visit'] = (isset($this->data['session_time']) && $this->data['session_time']) ? $this->data['session_time'] : (($this->data['user_lastvisit']) ? $this->data['user_lastvisit'] : time());
}
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index e8b8606015..08f911ef64 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -18,6 +18,7 @@ function compose_pm($id, $mode, $action)
global $phpbb_root_path, $phpEx, $config;
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
+ include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
if (!$action)
@@ -572,7 +573,6 @@ function compose_pm($id, $mode, $action)
// Attachment Preview
if (sizeof($message_parser->attachment_data))
{
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
$extensions = $update_count = array();
$template->assign_var('S_HAS_ATTACHMENTS', true);
@@ -818,23 +818,7 @@ function compose_pm($id, $mode, $action)
);
// Build custom bbcodes array
- $sql = 'SELECT bbcode_id, bbcode_tag
- FROM ' . BBCODES_TABLE . '
- WHERE display_on_posting = 1';
- $result = $db->sql_query($sql);
-
- $i = 0;
- while ($row = $db->sql_fetchrow($result))
- {
- $template->assign_block_vars('custom_tags', array(
- 'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'",
- 'BBCODE_ID' => 22 + ($i * 2),
- 'BBCODE_TAG' => $row['bbcode_tag'])
- );
-
- $i++;
- }
- $db->sql_freeresult($result);
+ display_custom_bbcodes();
// Attachment entry
if ($auth->acl_get('u_pm_attach') && $config['allow_pm_attach'] && $form_enctype)
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index e7b602b0d1..c529e55223 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -225,7 +225,7 @@ class ucp_profile
'S_CHANGE_EMAIL' => ($auth->acl_get('u_chgemail')) ? true : false,
'S_CHANGE_PASSWORD' => ($auth->acl_get('u_chgpasswd')) ? true : false)
);
- break;
+ break;
case 'profile_info':
@@ -399,7 +399,7 @@ class ucp_profile
$cp->generate_profile_fields('profile', $user->get_iso_lang_id());
- break;
+ break;
case 'signature':
@@ -408,7 +408,8 @@ class ucp_profile
trigger_error('NO_AUTH_SIGNATURE');
}
- include($phpbb_root_path . 'includes/functions_posting.'.$phpEx);
+ include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
+ include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
$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('smilies')) : false;
@@ -486,23 +487,7 @@ class ucp_profile
);
// Build custom bbcodes array
- $sql = 'SELECT bbcode_id, bbcode_tag
- FROM ' . BBCODES_TABLE . '
- WHERE display_on_posting = 1';
- $result = $db->sql_query($sql);
-
- $i = 0;
- while ($row = $db->sql_fetchrow($result))
- {
- $template->assign_block_vars('custom_tags', array(
- 'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'",
- 'BBCODE_ID' => 22 + ($i * 2),
- 'BBCODE_TAG' => $row['bbcode_tag'])
- );
-
- $i++;
- }
- $db->sql_freeresult($result);
+ display_custom_bbcodes();
break;
@@ -665,7 +650,7 @@ class ucp_profile
);
}
- break;
+ break;
}
$template->assign_vars(array(
diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql
index 264543b7b8..7fa9194e81 100644
--- a/phpBB/install/schemas/mysql_schema.sql
+++ b/phpBB/install/schemas/mysql_schema.sql
@@ -291,7 +291,7 @@ CREATE TABLE phpbb_icons (
icons_url varchar(255),
icons_width tinyint(4) UNSIGNED DEFAULT '0' NOT NULL,
icons_height tinyint(4) UNSIGNED DEFAULT '0' NOT NULL,
- icons_order tinyint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ icons_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
display_on_posting tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
PRIMARY KEY (icons_id)
);
@@ -639,7 +639,7 @@ CREATE TABLE phpbb_smilies (
smiley_url varchar(50),
smiley_width tinyint(4) UNSIGNED DEFAULT '0' NOT NULL,
smiley_height tinyint(4) UNSIGNED DEFAULT '0' NOT NULL,
- smiley_order tinyint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ smiley_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
display_on_posting tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
PRIMARY KEY (smiley_id)
);
diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql
index 73c8ae8bd7..57fc56048e 100644
--- a/phpBB/install/schemas/oracle_schema.sql
+++ b/phpBB/install/schemas/oracle_schema.sql
@@ -615,7 +615,7 @@ CREATE TABLE phpbb_icons (
icons_url varchar2(255),
icons_width number(4) DEFAULT '0' NOT NULL,
icons_height number(4) DEFAULT '0' NOT NULL,
- icons_order number(4) DEFAULT '0' NOT NULL,
+ icons_order number(8) DEFAULT '0' NOT NULL,
display_on_posting number(1) DEFAULT '1' NOT NULL,
CONSTRAINT pk_phpbb_icons PRIMARY KEY (icons_id)
)
@@ -1322,7 +1322,7 @@ CREATE TABLE phpbb_smilies (
smiley_url varchar2(50),
smiley_width number(4) DEFAULT '0' NOT NULL,
smiley_height number(4) DEFAULT '0' NOT NULL,
- smiley_order number(4) DEFAULT '0' NOT NULL,
+ smiley_order number(8) DEFAULT '0' NOT NULL,
display_on_posting number(1) DEFAULT '1' NOT NULL,
CONSTRAINT pk_phpbb_smilies PRIMARY KEY (smiley_id)
)
diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql
index 9134573136..07296bf658 100644
--- a/phpBB/install/schemas/postgres_schema.sql
+++ b/phpBB/install/schemas/postgres_schema.sql
@@ -485,7 +485,7 @@ CREATE TABLE phpbb_icons (
icons_url varchar(255),
icons_width INT2 NOT NULL,
icons_height INT2 NOT NULL,
- icons_order INT2 NOT NULL,
+ icons_order INT4 NOT NULL,
display_on_posting INT2 DEFAULT '1' NOT NULL,
PRIMARY KEY (icons_id),
CHECK (icons_width>=0),
@@ -981,7 +981,7 @@ CREATE TABLE phpbb_smilies (
smiley_url varchar(50),
smiley_width INT2 NOT NULL,
smiley_height INT2 NOT NULL,
- smiley_order INT2 NOT NULL,
+ smiley_order INT4 NOT NULL,
display_on_posting INT2 DEFAULT '1' NOT NULL,
PRIMARY KEY (smiley_id),
CHECK (smiley_width>=0),
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index d577160055..8b1bb2ad20 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -65,7 +65,6 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_path', '/')
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_secure', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_enable', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_fax', '');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_hide_groups', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_mail', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('database_gc', '604800');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_dateformat', 'D M d, Y g:i a');
diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql
index 5ab3271c31..b4e38def38 100644
--- a/phpBB/install/schemas/sqlite_schema.sql
+++ b/phpBB/install/schemas/sqlite_schema.sql
@@ -315,7 +315,7 @@ CREATE TABLE phpbb_icons (
icons_url varchar(255),
icons_width tinyint(4) NOT NULL DEFAULT '0',
icons_height tinyint(4) NOT NULL DEFAULT '0',
- icons_order tinyint(4) NOT NULL DEFAULT '0',
+ icons_order mediumint(8) NOT NULL DEFAULT '0',
display_on_posting tinyint(1) NOT NULL DEFAULT '1'
);
@@ -687,7 +687,7 @@ CREATE TABLE phpbb_smilies (
smiley_url varchar(50),
smiley_width tinyint(4) NOT NULL DEFAULT '0',
smiley_height tinyint(4) NOT NULL DEFAULT '0',
- smiley_order tinyint(4) NOT NULL DEFAULT '0',
+ smiley_order mediumint(8) NOT NULL DEFAULT '0',
display_on_posting tinyint(1) NOT NULL DEFAULT '1'
);
diff --git a/phpBB/language/en/acp/attachments.php b/phpBB/language/en/acp/attachments.php
index 1393933cc8..29e622b2a7 100644
--- a/phpBB/language/en/acp/attachments.php
+++ b/phpBB/language/en/acp/attachments.php
@@ -126,8 +126,8 @@ $lang = array_merge($lang, array(
'SECURE_DOWNLOADS_EXPLAIN' => 'With this option enabled, downloads are limited to IP\'s/hostnames you defined.',
'SECURE_DOWNLOAD_NOTICE' => 'Secure Downloads are not enabled. The settings below will be applied after enabling secure downloads.',
'SECURE_DOWNLOAD_UPDATE_SUCCESS'=> 'The IP list has been updated successfully',
- 'SECURE_EMPTY_REFERER' => 'Allow empty referer',
- 'SECURE_EMPTY_REFERER_EXPLAIN' => 'Secure downloads are based on referers. Do you want to allow downloads for those ommitting the referer?',
+ 'SECURE_EMPTY_REFERRER' => 'Allow empty referrer',
+ 'SECURE_EMPTY_REFERRER_EXPLAIN' => 'Secure downloads are based on referrers. Do you want to allow downloads for those ommitting the referrer?',
'SETTINGS_CAT_IMAGES' => 'Image category settings',
'SPECIAL_CATEGORY' => 'Special Category',
'SPECIAL_CATEGORY_EXPLAIN' => 'Special Categories differ between the way presented within posts.',
diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php
index f3d0d94895..68bde04177 100644
--- a/phpBB/language/en/acp/board.php
+++ b/phpBB/language/en/acp/board.php
@@ -134,7 +134,7 @@ $lang = array_merge($lang, array(
'EDIT_TIME_EXPLAIN' => 'Limits the time available to edit a new post, zero equals infinity',
'FLOOD_INTERVAL' => 'Flood Interval',
'FLOOD_INTERVAL_EXPLAIN' => 'Number of seconds a user must wait between posting new messages. To enable users to ignore this alter their permissions.',
- 'HOT_THRESHOLD' => 'Posts for Popular Threshold',
+ 'HOT_THRESHOLD' => 'Posts for Popular Threshold, Set to 0 to disable hot topics.',
'MAX_POLL_OPTIONS' => 'Max number of poll options',
'MAX_POST_FONT_SIZE' => 'Max font size per post',
'MAX_POST_FONT_SIZE_EXPLAIN' => 'Set to 0 for unlimited font size.',
@@ -186,12 +186,10 @@ $lang = array_merge($lang, array(
'ALLOW_EMAIL_REUSE_EXPLAIN' => 'Different users can register with the same email address.',
'COPPA' => 'Coppa',
'COPPA_FAX' => 'COPPA Fax Number',
- 'COPPA_HIDE_GROUPS' => 'Hide COPPA Groups',
- 'COPPA_HIDE_GROUPS_EXPLAIN' => 'Do not display the special COPPA groups within admin-facing parts',
'COPPA_MAIL' => 'COPPA Mailing Address',
'COPPA_MAIL_EXPLAIN' => 'This is the mailing address where parents will send COPPA registration forms',
'ENABLE_COPPA' => 'Enable COPPA',
- 'ENABLE_COPPA_EXPLAIN' => 'This requires users to declare whether they are 13 or over for compliance with the U.S. COPPA act.',
+ 'ENABLE_COPPA_EXPLAIN' => 'This requires users to declare whether they are 13 or over for compliance with the U.S. COPPA act. If this is disabled the COPPA specific groups will no longer be displayed.',
'MAX_CHARS' => 'Max',
'MIN_CHARS' => 'Min',
'PASSWORD_LENGTH' => 'Password length',
diff --git a/phpBB/language/en/acp/groups.php b/phpBB/language/en/acp/groups.php
index 0ab209204a..4b22677de1 100644
--- a/phpBB/language/en/acp/groups.php
+++ b/phpBB/language/en/acp/groups.php
@@ -48,7 +48,7 @@ $lang = array_merge($lang, array(
'GROUP_COLOR_EXPLAIN' => 'Defines the colour members usernames will appear in, leave blank for user default.',
'GROUP_CREATED' => 'Group has been created successfully',
'GROUP_DEFAULT' => 'Default',
- 'GROUP_DEFS_UPDATED' => 'Default group set for all members',
+ 'GROUP_DEFS_UPDATED' => 'Default group set for all selected members',
'GROUP_DELETE' => 'Delete',
'GROUP_DELETED' => 'Group deleted and user default groups set successfully',
'GROUP_DEMOTE' => 'Demote',
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 157e172e76..1c49487d80 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -301,6 +301,7 @@ $lang = array_merge($lang, array(
'NOT_WATCHING_FORUM' => 'You are no longer subscribed to updates on this forum.',
'NOT_WATCHING_TOPIC' => 'You are no longer subscribed to this topic.',
'NO_ACCESS_ATTACHMENT' => 'You are not allowed to access this file.',
+ 'NO_ADMINISTRATORS' => 'No administrators assigned at this board.',
'NO_AUTH_ADMIN' => 'You do not have admin permissions and therefore not allowed to access the administration control panel.',
'NO_AUTH_ADMIN_USER_DIFFER' => 'You are not able to re-authenticate as a different user.',
'NO_AUTH_OPERATION' => 'You do not have the neccessary permissions to complete this operation.',
@@ -315,6 +316,7 @@ $lang = array_merge($lang, array(
'NO_GROUP_MEMBERS' => 'This group is currently not having any members assigned',
'NO_MEMBERS' => 'No members found for this search criteria',
'NO_MESSAGES' => 'No messages',
+ 'NO_MODERATORS' => 'No moderators assigned at this board.',
'NO_NEW_MESSAGES' => 'No new messages',
'NO_NEW_PM' => '<strong>0</strong> new messages',
'NO_NEW_POSTS' => 'No new posts',
@@ -516,7 +518,10 @@ $lang = array_merge($lang, array(
'TOTAL_TOPICS_ZERO' => 'Total topics <strong>0</strong>',
'TOTAL_USERS_OTHER' => 'Total members <strong>%d</strong>',
'TOTAL_USERS_ZERO' => 'Total members <strong>0</strong>',
+ 'TRACKED_PHP_ERROR' => 'Tracked PHP errors: %s',
+ 'UNABLE_GET_IMAGE_SIZE' => 'Accessing the image was impossible or file isn\'t a valid image.',
+ 'UNABLE_TO_DELIVER_FILE'=> 'Unable to deliver file.',
'UNKNOWN_BROWSER' => 'Unknown browser',
'UNMARK_ALL' => 'Unmark all',
'UNREAD_MESSAGES' => 'Unread messages',
diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php
index 817019c9c6..82cbf4af3f 100644
--- a/phpBB/language/en/posting.php
+++ b/phpBB/language/en/posting.php
@@ -180,7 +180,6 @@ $lang = array_merge($lang, array(
'TOO_MANY_USER_OPTIONS' => 'You cannot specify more Options per User than existing poll options',
'TOPIC_BUMPED' => 'Topic has been bumped successfully',
- 'UNABLE_GET_IMAGE_SIZE' => 'Accessing the image was impossible or file isn\'t a valid picture.',
'UNAUTHORISED_BBCODE' => 'You cannot use certain bbcodes: ',
'UNGLOBALISE_EXPLAIN' => 'To switch this topic back from being global to a normal topic, you need to select the forum you wish this topic to be displayed.',
'UPDATE_COMMENT' => 'Update comment',
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index c656a0431d..8f52176daa 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -100,6 +100,14 @@ switch ($mode)
$admin_id_ary = array_unique($admin_id_ary);
$mod_id_ary = array_unique($mod_id_ary);
+ // Admin group id...
+ $sql = 'SELECT group_id
+ FROM ' . GROUPS_TABLE . "
+ WHERE group_name = 'ADMINISTRATORS'";
+ $result = $db->sql_query($sql);
+ $admin_group_id = (int) $db->sql_fetchfield('group_id');
+ $db->sql_freeresult($result);
+
$sql = 'SELECT forum_id, forum_name
FROM ' . FORUMS_TABLE . '
WHERE forum_type = ' . FORUM_POST;
@@ -113,7 +121,7 @@ switch ($mode)
$db->sql_freeresult($result);
$sql = $db->sql_build_query('SELECT', array(
- 'SELECT' => 'u.user_id, u.username, u.user_colour, u.user_rank, u.user_posts, g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id as ug_user_id',
+ 'SELECT' => 'u.user_id, u.group_id as default_group, u.username, u.user_colour, u.user_rank, u.user_posts, g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id as ug_user_id',
'FROM' => array(
USERS_TABLE => 'u',
@@ -139,6 +147,25 @@ switch ($mode)
{
$which_row = (in_array($row['user_id'], $admin_id_ary)) ? 'admin' : 'mod';
+ // We sort out admins not having the admin group as default
+ // The drawback is that only those admins are displayed which are within
+ // the special group 'Administrators' and also having it assigned as their default group.
+ // - might change
+ if ($which_row == 'admin' && $row['default_group'] != $admin_group_id)
+ {
+ // Remove from admin_id_ary, because the user may be a mod instead
+ unset($admin_id_ary[array_search($row['user_id'], $admin_id_ary)]);
+
+ if (!in_array($row['user_id'], $mod_id_ary))
+ {
+ continue;
+ }
+ else
+ {
+ $which_row = 'mod';
+ }
+ }
+
$s_forum_select = '';
if (isset($forum_id_ary[$row['user_id']]))
diff --git a/phpBB/posting.php b/phpBB/posting.php
index a35cd3e7dd..29129b96b9 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -1187,23 +1187,7 @@ $template->assign_vars(array(
);
// Build custom bbcodes array
-$sql = 'SELECT bbcode_id, bbcode_tag
- FROM ' . BBCODES_TABLE . '
- WHERE display_on_posting = 1';
-$result = $db->sql_query($sql);
-
-$i = 0;
-while ($row = $db->sql_fetchrow($result))
-{
- $template->assign_block_vars('custom_tags', array(
- 'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'",
- 'BBCODE_ID' => 22 + ($i * 2),
- 'BBCODE_TAG' => $row['bbcode_tag'])
- );
-
- $i++;
-}
-$db->sql_freeresult($result);
+display_custom_bbcodes();
// Poll entry
if (($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_post_id'] && (!$post_data['poll_last_vote'] || $auth->acl_get('m_edit', $forum_id))))
diff --git a/phpBB/styles/subSilver/template/memberlist_leaders.html b/phpBB/styles/subSilver/template/memberlist_leaders.html
index 39267baf2a..009efd5555 100644
--- a/phpBB/styles/subSilver/template/memberlist_leaders.html
+++ b/phpBB/styles/subSilver/template/memberlist_leaders.html
@@ -30,7 +30,7 @@
</tr>
<!-- BEGINELSE -->
<tr>
- <td class="row1" colspan="9" align="center"><span class="gen">{L_NO_MEMBERS}</span></td>
+ <td class="row1" colspan="9" align="center"><span class="gen">{L_NO_ADMINISTRATORS}</span></td>
</tr>
<!-- END admin -->
<tr class="row3">
@@ -53,7 +53,7 @@
</tr>
<!-- BEGINELSE -->
<tr>
- <td class="row1" colspan="9" align="center"><span class="gen">{L_NO_MEMBERS}</span></td>
+ <td class="row1" colspan="9" align="center"><span class="gen">{L_NO_MODERATORS}</span></td>
</tr>
<!-- END mod -->
</table>
diff --git a/phpBB/styles/subSilver/template/memberlist_view.html b/phpBB/styles/subSilver/template/memberlist_view.html
index 18b2d33bac..b15a610c81 100644
--- a/phpBB/styles/subSilver/template/memberlist_view.html
+++ b/phpBB/styles/subSilver/template/memberlist_view.html
@@ -93,7 +93,7 @@
<table width="100%" cellspacing="1" cellpadding="2" border="0">
<tr>
<td class="gen" align="right" nowrap="nowrap">{L_EMAIL_ADDRESS}: </td>
- <td class="row1" width="100%"><!-- IF U_EMAIL --><a href="{U_EMAIL}">{EMAIL_IMG}</a><!-- ENDIF --></td>
+ <td width="100%"><!-- IF U_EMAIL --><a href="{U_EMAIL}">{EMAIL_IMG}</a><!-- ENDIF --></td>
</tr>
<!-- IF U_PM -->
<tr>
@@ -161,12 +161,14 @@
</table>
</td>
</tr>
- <tr>
- <td class="cat" colspan="2" align="center"><h4>{L_SIGNATURE}</h4></td>
- </tr>
- <tr>
- <td class="row1" colspan="2"><div class="postbody" style="padding: 10px;">{SIGNATURE}</div></td>
- </tr>
+ <!-- IF SIGNATURE -->
+ <tr>
+ <td class="cat" colspan="2" align="center"><h4>{L_SIGNATURE}</h4></td>
+ </tr>
+ <tr>
+ <td class="row1" colspan="2"><div class="postbody" style="padding: 10px;">{SIGNATURE}</div></td>
+ </tr>
+ <!-- ENDIF -->
</table>
</form>
diff --git a/phpBB/styles/subSilver/template/overall_header.html b/phpBB/styles/subSilver/template/overall_header.html
index 333d23a6e1..4a728f5230 100644
--- a/phpBB/styles/subSilver/template/overall_header.html
+++ b/phpBB/styles/subSilver/template/overall_header.html
@@ -97,7 +97,7 @@ function marklist(id, name, state)
<table width="100%" cellspacing="0">
<tr>
<td class="genmed">
- <a href="{U_LOGIN_LOGOUT}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" border="0" alt="{L_LOGIN_LOGOUT}" /> {L_LOGIN_LOGOUT}</a>&nbsp;
+ <!-- IF not S_IS_BOT --><a href="{U_LOGIN_LOGOUT}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" border="0" alt="{L_LOGIN_LOGOUT}" /> {L_LOGIN_LOGOUT}</a>&nbsp;<!-- ENDIF -->
<!-- IF U_RESTORE_PERMISSIONS --> &nbsp;<a href="{U_RESTORE_PERMISSIONS}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" border="0" alt="{L_RESTORE_PERMISSIONS}" /> {L_RESTORE_PERMISSIONS}</a><!-- ENDIF -->
<!-- IF S_BOARD_DISABLED --> &nbsp;<span style="color: red;">{L_BOARD_DISABLED}</span><!-- ENDIF -->
<!-- IF S_USER_LOGGED_IN -->
diff --git a/phpBB/styles/subSilver/template/ucp_profile_signature.html b/phpBB/styles/subSilver/template/ucp_profile_signature.html
index 3e837acc49..237c6affe6 100644
--- a/phpBB/styles/subSilver/template/ucp_profile_signature.html
+++ b/phpBB/styles/subSilver/template/ucp_profile_signature.html
@@ -77,6 +77,7 @@ e_help = "{LA_BBCODE_E_HELP}";
<input type="button" class="btnbbcode" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})" />
<!-- END custom_tags -->
</td>
+ </tr>
<!-- ENDIF -->
<tr>
<td colspan="9"><input type="text" name="helpbox" style="width:100%" maxlength="100" class="helpline" value="{L_STYLES_TIP}" /></td>
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index a449abb168..78f30c5339 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -461,7 +461,7 @@ $s_forum_rules = '';
gen_forum_auth_level('topic', $forum_id, $topic_data['forum_status']);
// Quick mod tools
-$allow_change_type = ($auth->acl_get('m_') || ($user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster'])) ? true : false;
+$allow_change_type = ($auth->acl_get('m_', $forum_id) || ($user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster'])) ? true : false;
$topic_mod = '';
$topic_mod .= ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster'])) ? (($topic_data['topic_status'] == ITEM_UNLOCKED) ? '<option value="lock">' . $user->lang['LOCK_TOPIC'] . '</option>' : '<option value="unlock">' . $user->lang['UNLOCK_TOPIC'] . '</option>') : '';
@@ -1260,7 +1260,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
if (($row['post_edit_count'] && $config['display_last_edited']) || $row['post_edit_reason'])
{
// Get usernames for all following posts if not already stored
- if (!sizeof($post_edit_list) && $row['post_edit_reason'])
+ if (!sizeof($post_edit_list) && ($row['post_edit_reason'] || ($row['post_edit_user'] && !isset($user_cache[$row['post_edit_user']]))))
{
// Remove all post_ids already parsed (we do not have to check them)
$post_storage_list = (!$store_reverse) ? array_slice($post_list, $i) : array_slice(array_reverse($post_list), $i);
@@ -1270,11 +1270,11 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
WHERE p.post_id IN (' . implode(', ', $post_storage_list) . ")
AND p.post_edit_count <> 0
AND p.post_edit_user <> 0
- AND p.post_edit_reason <> ''
AND p.post_edit_user = u.user_id";
$result2 = $db->sql_query($sql);
while ($user_edit_row = $db->sql_fetchrow($result2))
{
+ $user_edit_row['username'] = ($user_edit_row['user_colour']) ? '<span style="color:#' . $user_edit_row['user_colour'] . '">' . $user_edit_row['username'] . '</span>' : $user_edit_row['username'];
$post_edit_list[$user_edit_row['user_id']] = $user_edit_row;
}
$db->sql_freeresult($result2);
@@ -1287,10 +1287,16 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
if ($row['post_edit_reason'])
{
$user_edit_row = $post_edit_list[$row['post_edit_user']];
- $l_edited_by = sprintf($l_edit_time_total, (!$row['post_edit_user']) ? $row['poster'] : (($user_edit_row['user_colour']) ? '<span style="color:#' . $user_edit_row['user_colour'] . '">' . $user_edit_row['username'] . '</span>' : $user_edit_row['username']), $user->format_date($row['post_edit_time']), $row['post_edit_count']);
+
+ $l_edited_by = sprintf($l_edit_time_total, (!$row['post_edit_user']) ? $row['poster'] : $user_edit_row['username'], $user->format_date($row['post_edit_time']), $row['post_edit_count']);
}
else
{
+ if ($row['post_edit_user'] && !isset($user_cache[$row['post_edit_user']]))
+ {
+ $user_cache[$row['post_edit_user']] = $post_edit_list[$row['post_edit_user']];
+ }
+
$l_edited_by = sprintf($l_edit_time_total, (!$row['post_edit_user']) ? $row['poster'] : $user_cache[$row['post_edit_user']]['username'], $user->format_date($row['post_edit_time']), $row['post_edit_count']);
}
}