aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/adm/images/phpbb_logo.gifbin3883 -> 0 bytes
-rw-r--r--phpBB/adm/images/phpbb_logo.pngbin0 -> 9313 bytes
-rw-r--r--phpBB/adm/style/acp_users_overview.html33
-rw-r--r--phpBB/adm/style/admin.css6
-rw-r--r--phpBB/assets/javascript/core.js35
-rw-r--r--phpBB/develop/add_permissions.php18
-rw-r--r--phpBB/develop/calc_email_hash.php18
-rw-r--r--phpBB/develop/change_smiley_ref.php24
-rw-r--r--phpBB/develop/check_flash_bbcodes.php4
-rw-r--r--phpBB/develop/create_schema_files.php2
-rw-r--r--phpBB/develop/create_variable_overview.php22
-rw-r--r--phpBB/develop/fill.php17
-rw-r--r--phpBB/develop/merge_attachment_tables.php18
-rw-r--r--phpBB/develop/merge_post_tables.php25
-rw-r--r--phpBB/develop/mysql_upgrader.php1
-rw-r--r--phpBB/docs/AUTHORS1
-rw-r--r--phpBB/docs/CHANGELOG.html155
-rw-r--r--phpBB/docs/INSTALL.html2
-rw-r--r--phpBB/docs/README.html8
-rw-r--r--phpBB/docs/coding-guidelines.html38
-rw-r--r--phpBB/includes/acp/acp_board.php1
-rw-r--r--phpBB/includes/acp/acp_database.php12
-rw-r--r--phpBB/includes/acp/acp_styles.php2
-rw-r--r--phpBB/includes/acp/acp_users.php8
-rw-r--r--phpBB/includes/auth/auth_ldap.php6
-rw-r--r--phpBB/includes/bbcode.php2
-rw-r--r--phpBB/includes/cache/service.php55
-rw-r--r--phpBB/includes/db/dbal.php12
-rw-r--r--phpBB/includes/db/mssql.php8
-rw-r--r--phpBB/includes/db/mssql_odbc.php8
-rw-r--r--phpBB/includes/db/mssqlnative.php8
-rw-r--r--phpBB/includes/functions.php43
-rw-r--r--phpBB/includes/functions_admin.php18
-rw-r--r--phpBB/includes/functions_display.php9
-rw-r--r--phpBB/includes/functions_install.php44
-rw-r--r--phpBB/includes/functions_posting.php4
-rw-r--r--phpBB/includes/functions_privmsgs.php166
-rw-r--r--phpBB/includes/functions_upload.php48
-rw-r--r--phpBB/includes/functions_user.php58
-rw-r--r--phpBB/includes/php/ini.php175
-rw-r--r--phpBB/includes/search/fulltext_mysql.php103
-rw-r--r--phpBB/includes/search/fulltext_postgres.php856
-rw-r--r--phpBB/includes/session.php12
-rw-r--r--phpBB/includes/startup.php6
-rw-r--r--phpBB/includes/style/style.php8
-rw-r--r--phpBB/includes/template/filter.php4
-rw-r--r--phpBB/includes/template/template.php7
-rw-r--r--phpBB/includes/ucp/info/ucp_profile.php1
-rw-r--r--phpBB/includes/ucp/ucp_pm_options.php17
-rw-r--r--phpBB/includes/ucp/ucp_profile.php54
-rw-r--r--phpBB/includes/user.php21
-rw-r--r--phpBB/install/database_update.php70
-rw-r--r--phpBB/install/install_install.php8
-rw-r--r--phpBB/install/schemas/schema_data.sql4
-rw-r--r--phpBB/language/en/acp/attachments.php2
-rw-r--r--phpBB/language/en/acp/board.php4
-rw-r--r--phpBB/language/en/acp/search.php18
-rw-r--r--phpBB/language/en/acp/users.php1
-rw-r--r--phpBB/language/en/common.php1
-rw-r--r--phpBB/language/en/search.php1
-rw-r--r--phpBB/language/en/ucp.php10
-rw-r--r--phpBB/search.php10
-rw-r--r--phpBB/styles/prosilver/template/forumlist_body.html13
-rw-r--r--phpBB/styles/prosilver/template/mcp_topic.html2
-rw-r--r--phpBB/styles/prosilver/template/overall_footer.html6
-rw-r--r--phpBB/styles/prosilver/template/posting_editor.html2
-rw-r--r--phpBB/styles/prosilver/template/quickreply_editor.html2
-rw-r--r--phpBB/styles/prosilver/template/search_results.html1
-rw-r--r--phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html53
-rw-r--r--phpBB/styles/prosilver/template/ucp_profile_reg_details.html4
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_body.html2
-rw-r--r--phpBB/styles/subsilver2/template/forumlist_body.html11
-rw-r--r--phpBB/styles/subsilver2/template/mcp_topic.html2
-rw-r--r--phpBB/styles/subsilver2/template/posting_body.html2
-rw-r--r--phpBB/styles/subsilver2/template/quickreply_editor.html2
-rw-r--r--phpBB/styles/subsilver2/template/ucp_profile_autologin_keys.html49
-rw-r--r--phpBB/styles/subsilver2/template/ucp_profile_reg_details.html2
-rw-r--r--phpBB/styles/subsilver2/template/viewforum_body.html2
-rw-r--r--phpBB/styles/subsilver2/template/viewtopic_body.html4
-rw-r--r--phpBB/viewforum.php6
-rw-r--r--phpBB/viewtopic.php12
81 files changed, 2073 insertions, 436 deletions
diff --git a/phpBB/adm/images/phpbb_logo.gif b/phpBB/adm/images/phpbb_logo.gif
deleted file mode 100644
index 239993182b..0000000000
--- a/phpBB/adm/images/phpbb_logo.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/adm/images/phpbb_logo.png b/phpBB/adm/images/phpbb_logo.png
new file mode 100644
index 0000000000..c3f9248ed7
--- /dev/null
+++ b/phpBB/adm/images/phpbb_logo.png
Binary files differ
diff --git a/phpBB/adm/style/acp_users_overview.html b/phpBB/adm/style/acp_users_overview.html
index 1f10e7f66e..ffdb4d472c 100644
--- a/phpBB/adm/style/acp_users_overview.html
+++ b/phpBB/adm/style/acp_users_overview.html
@@ -131,19 +131,24 @@
</form>
<!-- IF not S_OWN_ACCOUNT -->
- <form id="user_delete" method="post" action="{U_ACTION}">
- <fieldset>
- <legend>{L_DELETE_USER}</legend>
- <dl>
- <dt><label for="delete_type">{L_DELETE_USER}:</label><br /><span>{L_DELETE_USER_EXPLAIN}</span></dt>
- <dd><select id="delete_type" name="delete_type"><option class="sep" value="">{L_SELECT_OPTION}</option><option value="retain">{L_RETAIN_POSTS}</option><option value="remove">{L_DELETE_POSTS}</option></select></dd>
- </dl>
- <p class="quick">
- <input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
- <input type="hidden" name="delete" value="1" />
- {S_FORM_TOKEN}
- </p>
- </fieldset>
- </form>
+ <form id="user_delete" method="post" action="{U_ACTION}">
+ <fieldset>
+ <legend>{L_DELETE_USER}</legend>
+ <dl>
+ <dt><label for="delete_type">{L_DELETE_USER}:</label><br /><span>{L_DELETE_USER_EXPLAIN}</span></dt>
+ <dd>
+ <!-- IF USER_HAS_POSTS -->
+ <select id="delete_type" name="delete_type"><option class="sep" value="">{L_SELECT_OPTION}</option><option value="retain">{L_RETAIN_POSTS}</option><option value="remove">{L_DELETE_POSTS}</option></select></dd>
+ <!-- ELSE -->
+ {L_USER_NO_POSTS_TO_DELETE}<input type="hidden" id="delete_type" name="delete_type" value="retain" />
+ <!-- ENDIF -->
+ </dl>
+ <p class="quick">
+ <input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
+ <input type="hidden" name="delete" value="1" />
+ {S_FORM_TOKEN}
+ </p>
+ </fieldset>
+ </form>
<!-- ENDIF -->
<!-- ENDIF -->
diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css
index 94f421030d..08613de0dd 100644
--- a/phpBB/adm/style/admin.css
+++ b/phpBB/adm/style/admin.css
@@ -146,15 +146,15 @@ li {
#page-header {
clear: both;
text-align: right;
- background: url("../images/phpbb_logo.gif") top left no-repeat;
- height: 49px;
+ background: url("../images/phpbb_logo.png") top left no-repeat;
+ height: 54px;
font-size: 0.85em;
margin-bottom: 10px;
}
.rtl #page-header {
text-align: left;
- background: url("../images/phpbb_logo.gif") top right no-repeat;
+ background: url("../images/phpbb_logo.png") top right no-repeat;
}
#page-header h1 {
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index 958b6c9ff6..76615eb051 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -436,14 +436,47 @@ phpbb.add_ajax_callback = function(id, callback)
* the alt-text data attribute, and replaces the text in the attribute with the
* current text so that the process can be repeated.
*/
-phpbb.add_ajax_callback('alt_text', function(data) {
+phpbb.add_ajax_callback('alt_text', function() {
var el = $(this),
alt_text;
alt_text = el.attr('data-alt-text');
+ el.attr('data-alt-text', el.text());
el.attr('title', alt_text);
el.text(alt_text);
});
+/**
+ * This callback is based on the alt_text callback.
+ *
+ * It replaces the current text with the text in the alt-text data attribute,
+ * and replaces the text in the attribute with the current text so that the
+ * process can be repeated.
+ * Additionally it replaces the class of the link's parent
+ * and changes the link itself.
+ */
+phpbb.add_ajax_callback('toggle_link', function() {
+ var el = $(this),
+ toggle_text,
+ toggle_url,
+ toggle_class;
+
+ // Toggle link text
+
+ toggle_text = el.attr('data-toggle-text');
+ el.attr('data-toggle-text', el.text());
+ el.attr('title', toggle_text);
+ el.text(toggle_text);
+
+ // Toggle link url
+ toggle_url = el.attr('data-toggle-url');
+ el.attr('data-toggle-url', el.attr('href'));
+ el.attr('href', toggle_url);
+
+ // Toggle class of link parent
+ toggle_class = el.attr('data-toggle-class');
+ el.attr('data-toggle-class', el.parent().attr('class'));
+ el.parent().attr('class', toggle_class);
+});
})(jQuery); // Avoid conflicts with other libraries
diff --git a/phpBB/develop/add_permissions.php b/phpBB/develop/add_permissions.php
index 5d9af3cad5..449d931507 100644
--- a/phpBB/develop/add_permissions.php
+++ b/phpBB/develop/add_permissions.php
@@ -1,15 +1,11 @@
<?php
-// -------------------------------------------------------------
-//
-// $Id$
-//
-// FILENAME : add_permissions.php
-// STARTED : Sat Nov 06, 2004
-// COPYRIGHT : © 2004 phpBB Group
-// WWW : http://www.phpbb.com/
-// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
-//
-// -------------------------------------------------------------
+/**
+*
+* @package phpBB3
+* @copyright (c) 2004 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
//
// Security message:
diff --git a/phpBB/develop/calc_email_hash.php b/phpBB/develop/calc_email_hash.php
index 0f7540ee7d..c73fd26e17 100644
--- a/phpBB/develop/calc_email_hash.php
+++ b/phpBB/develop/calc_email_hash.php
@@ -1,15 +1,11 @@
<?php
-// -------------------------------------------------------------
-//
-// $Id$
-//
-// FILENAME : calc_email_hash.php
-// STARTED : Tue Feb 03, 2004
-// COPYRIGHT : © 2004 phpBB Group
-// WWW : http://www.phpbb.com/
-// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
-//
-// -------------------------------------------------------------
+/**
+*
+* @package phpBB3
+* @copyright (c) 2004 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
//
// Security message:
diff --git a/phpBB/develop/change_smiley_ref.php b/phpBB/develop/change_smiley_ref.php
index 75028d86f0..0a3108947a 100644
--- a/phpBB/develop/change_smiley_ref.php
+++ b/phpBB/develop/change_smiley_ref.php
@@ -1,21 +1,11 @@
<?php
-/***************************************************************************
- * merge_clean_posts.php
- * -------------------
- * begin : Tuesday, February 25, 2003
- * copyright : (C) 2003 The phpBB Group
- * email : support@phpbb.com
- *
- ***************************************************************************/
-
-/***************************************************************************
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- ***************************************************************************/
+/**
+*
+* @package phpBB3
+* @copyright (c) 2003 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
//
// Security message:
diff --git a/phpBB/develop/check_flash_bbcodes.php b/phpBB/develop/check_flash_bbcodes.php
index 2ce288ee3e..5946f685b8 100644
--- a/phpBB/develop/check_flash_bbcodes.php
+++ b/phpBB/develop/check_flash_bbcodes.php
@@ -5,10 +5,8 @@
* @copyright (c) 2009, 2010 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
-*/
-
-/**
* This script will check your database for potentially dangerous flash BBCode tags
+*
*/
//
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php
index 7a9bda32a0..0193e57f23 100644
--- a/phpBB/develop/create_schema_files.php
+++ b/phpBB/develop/create_schema_files.php
@@ -237,7 +237,7 @@ $supported_dbms = array('firebird', 'mssql', 'mysql_40', 'mysql_41', 'oracle', '
foreach ($supported_dbms as $dbms)
{
- $fp = fopen($schema_path . $dbms . '_schema.sql', 'wt');
+ $fp = fopen($schema_path . $dbms . '_schema.sql', 'wb');
$line = '';
diff --git a/phpBB/develop/create_variable_overview.php b/phpBB/develop/create_variable_overview.php
index 632930bfff..e65de130b3 100644
--- a/phpBB/develop/create_variable_overview.php
+++ b/phpBB/develop/create_variable_overview.php
@@ -1,17 +1,13 @@
<?php
-// -------------------------------------------------------------
-//
-// FILENAME : create_variable_overview.php
-// STARTED : Fri Aug 15 2003
-// COPYRIGHT : © 2003 phpBB Group
-// WWW : http://www.phpbb.com/
-// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
-//
-// -------------------------------------------------------------
-
-/*
- This script generates an index of some template vars and their use within the templates.
- It writes down all language variables used by various templates.
+/**
+*
+* @package phpBB3
+* @copyright (c) 2003 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+* This script generates an index of some template vars and their use within the templates.
+* It writes down all language variables used by various templates.
+*
*/
//
diff --git a/phpBB/develop/fill.php b/phpBB/develop/fill.php
index 5c3552265d..e3b986e163 100644
--- a/phpBB/develop/fill.php
+++ b/phpBB/develop/fill.php
@@ -1,13 +1,12 @@
<?php
-// -------------------------------------------------------------
-//
-// FILENAME : fill.php
-// STARTED : Mon Sep 15, 2003
-// COPYRIGHT : © 2001, 2003 phpBB Group
-// WWW : http://www.phpbb.com/
-// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
-//
-// -------------------------------------------------------------
+/**
+*
+* @package phpBB3
+* @copyright (c) 2001, 2003 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
//
// Security message:
//
diff --git a/phpBB/develop/merge_attachment_tables.php b/phpBB/develop/merge_attachment_tables.php
index aa6be0a26e..a66a395afa 100644
--- a/phpBB/develop/merge_attachment_tables.php
+++ b/phpBB/develop/merge_attachment_tables.php
@@ -1,15 +1,11 @@
<?php
-// -------------------------------------------------------------
-//
-// $Id$
-//
-// FILENAME : merge_attachment_tables.php
-// STARTED : Tue Nov 04, 2003
-// COPYRIGHT : © 2001, 2003 phpBB Group
-// WWW : http://www.phpbb.com/
-// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
-//
-// -------------------------------------------------------------
+/**
+*
+* @package phpBB3
+* @copyright (c) 2001, 2003 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
//
// Security message:
diff --git a/phpBB/develop/merge_post_tables.php b/phpBB/develop/merge_post_tables.php
index d13ae287b5..8edc330a0a 100644
--- a/phpBB/develop/merge_post_tables.php
+++ b/phpBB/develop/merge_post_tables.php
@@ -1,22 +1,11 @@
<?php
-/***************************************************************************
- * merge_clean_posts.php
- * -------------------
- * begin : Tuesday, February 25, 2003
- * copyright : (C) 2003 The phpBB Group
- * email : support@phpbb.com
- *
- *
- ***************************************************************************/
-
-/***************************************************************************
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- ***************************************************************************/
+/**
+*
+* @package phpBB3
+* @copyright (c) 2003 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
//
// Security message:
diff --git a/phpBB/develop/mysql_upgrader.php b/phpBB/develop/mysql_upgrader.php
index e2d8c97e8b..0498f826ab 100644
--- a/phpBB/develop/mysql_upgrader.php
+++ b/phpBB/develop/mysql_upgrader.php
@@ -9,7 +9,6 @@
*
*/
-
//
// Security message:
//
diff --git a/phpBB/docs/AUTHORS b/phpBB/docs/AUTHORS
index e945af8efa..f0b4e25549 100644
--- a/phpBB/docs/AUTHORS
+++ b/phpBB/docs/AUTHORS
@@ -23,6 +23,7 @@ involved in phpBB.
phpBB Lead Developer: naderman (Nils Adermann)
phpBB Developers: Acyd Burn (Meik Sievertsen) [Lead 09/2005 - 01/2010]
+ Arty (Vjacheslav Trushkin)
bantu (Andreas Fischer)
imkingdavid (David King)
igorw (Igor Wiedler)
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 7655aaa71f..0c56dbb2a3 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -46,6 +46,7 @@
<ol>
<li><a href="#changelog">Changelog</a>
<ol style="list-style-type: lower-roman;">
+ <li><a href="#v3010">Changes since 3.0.10</a></li>
<li><a href="#v309">Changes since 3.0.9</a></li>
<li><a href="#v308">Changes since 3.0.8</a></li>
<li><a href="#v307-PL1">Changes since 3.0.7-PL1</a></li>
@@ -84,7 +85,123 @@
<div class="content">
- <a name="v309"></a><h3>1.i. Changes since 3.0.9</h3>
+ <a name="v3010"></a><h3>1.i. Changes since 3.0.10</h3>
+
+<h4>Bug</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-7432">PHPBB3-7432</a>] - Unclear language for Inactive Users on ACP main page</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8652">PHPBB3-8652</a>] - Duplicate Emails Sent When Subscribed to Forum and Topic</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9079">PHPBB3-9079</a>] - Display backtrace on all E_USER_ERROR errors, not only SQL errors (when DEBUG_EXTRA is enabled)</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9084">PHPBB3-9084</a>] - Unable to display 'option equal to non entered value' if dropdown CPF is not required</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9089">PHPBB3-9089</a>] - PM message title box not accessible via Tab key</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9220">PHPBB3-9220</a>] - Blue border width when table in a div</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9681">PHPBB3-9681</a>] - Password length not in security settings</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9813">PHPBB3-9813</a>] - fulltext_native.php on innodb loading deadly slow for big indexes</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9831">PHPBB3-9831</a>] - Cannot change default of Boolean checkbox custom profile field</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10094">PHPBB3-10094</a>] - Clear cache before phpBB installation</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10129">PHPBB3-10129</a>] - Missing apostrophes in ACP user management -&gt; permissions</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10349">PHPBB3-10349</a>] - Unit tests do not remove comments from schemas</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10399">PHPBB3-10399</a>] - Special characters aren't parsed in style component variables</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10401">PHPBB3-10401</a>] - auth_ldap has an incorrect return value in login_ldap()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10407">PHPBB3-10407</a>] - Incorrect check for empty image file paths during conversion</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10428">PHPBB3-10428</a>] - optionget/optionset functions in session.php and acp_users.php incorrectly check whether $data is at its default value</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10456">PHPBB3-10456</a>] - Subsilver2 does not define $CAPTCHA_TAB_INDEX</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10508">PHPBB3-10508</a>] - Marking forums as read displays misleading language</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10511">PHPBB3-10511</a>] - Grammar defect in permissions language</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10512">PHPBB3-10512</a>] - Test failure when no default timezone is set in php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10532">PHPBB3-10532</a>] - Out of range $start causes a page with no search results but with pagination</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10538">PHPBB3-10538</a>] - Special character are not correctly parsed for SMTP protocol</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10542">PHPBB3-10542</a>] - Incorrect class=&quot;postlink&quot; in styles/subsilver2/template/faq_body.html</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10546">PHPBB3-10546</a>] - Argument missing for adm_back_link() in acp_captcha.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10561">PHPBB3-10561</a>] - All users can choose deactivated styles.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10569">PHPBB3-10569</a>] - template/ucp_main_front.html does not correctly handle active topic with the name &quot;0&quot;</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10580">PHPBB3-10580</a>] - Default tz in registration dropdown not the same as the board default tz</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10589">PHPBB3-10589</a>] - user_birthday does not use table alias in $leap_year_birthdays variable definition</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10605">PHPBB3-10605</a>] - Orpahned privmsgs are left in the prvmsgs table, with no ties in privmsgs_to table</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10606">PHPBB3-10606</a>] - $s_hidden_fields -&gt; incorrect array name (3 files affected)</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10611">PHPBB3-10611</a>] - Add a check for selected tables existence for ACP database backup tool</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10615">PHPBB3-10615</a>] - Static calls in utf normalizer yield E_STRICT spam on php 5.4</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10630">PHPBB3-10630</a>] - Prune Users produced unnecessarily long query; Got a packet bigger than 'max_allowed_packet' bytes</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10633">PHPBB3-10633</a>] - Users are able to get the real filename of attachment</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10639">PHPBB3-10639</a>] - negative value of ranks message</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10658">PHPBB3-10658</a>] - Rank-item is not shown on team-list</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10675">PHPBB3-10675</a>] - Use more descriptive message when disk is out of space</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10684">PHPBB3-10684</a>] - Function user_notification() prevents notifications for users with stale bans</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10689">PHPBB3-10689</a>] - Bug in the popup &quot; Find a member&quot; when select by letter.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10691">PHPBB3-10691</a>] - Search index creation CLI script incorrectly calculates indexing speed</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10699">PHPBB3-10699</a>] - Long h2 title breaks div.minitabs in MCP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10708">PHPBB3-10708</a>] - After a conversion, passwords with UTF8 characters do not work when user_pass_convert is set.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10717">PHPBB3-10717</a>] - memberlist_view.html: including admin defined profile fields doesnt work</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10723">PHPBB3-10723</a>] - Do not use SQLite on PHP 5.4 in Tests on Travis</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10731">PHPBB3-10731</a>] - JS function addquote() works incorrectly in Opera</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10751">PHPBB3-10751</a>] - MS SQL Error when searching Admin Log</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10760">PHPBB3-10760</a>] - In pre-commit git hook, syntax error is thrown, but is not specifically described</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10767">PHPBB3-10767</a>] - Git hooks do not work properly with git GUIs</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10774">PHPBB3-10774</a>] - db_tools::create_unique_index does not use specified index names on MySQL</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10790">PHPBB3-10790</a>] - Strict comparison on user_id for sending pms</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10797">PHPBB3-10797</a>] - Template var for user rank not filled</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10835">PHPBB3-10835</a>] - Misleading message in UCP when no permission to change password</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10846">PHPBB3-10846</a>] - Missing alias for MAX(post_id) in SQL query in acp_main.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10849">PHPBB3-10849</a>] - Missing BBCode Help Text in subsilver2</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10858">PHPBB3-10858</a>] - $db-&gt;sql_fetchfield returns false with mssqlnative</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10860">PHPBB3-10860</a>] - Side-by-side diff styling javascript bug</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10881">PHPBB3-10881</a>] - Some files use 0xA9 as the copyright symbol which is neither ASCII nor the UTF8 copyright symbol.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10887">PHPBB3-10887</a>] - Auto increment tests depend on varbinary handling</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10889">PHPBB3-10889</a>] - Default value for c_char_size in database unit tests is an empty string instead of a char(4)</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10890">PHPBB3-10890</a>] - test_sql_fetchrow_returns_false_when_empty() fails on MSSQL and Oracle</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10908">PHPBB3-10908</a>] - No remote avatar size limit results in files limited only by PHP memory limit</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10913">PHPBB3-10913</a>] - Admin is logged out when accessing any url under adm/ without session id</li>
+</ul>
+<h4>Improvement</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8599">PHPBB3-8599</a>] - Add &quot;Select All&quot; to &quot;Add multiple smilies&quot; screen</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8636">PHPBB3-8636</a>] - Add resync option to topic_view moderation page</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9876">PHPBB3-9876</a>] - Names and descriptions for roles &quot;Newly registered User&quot; in &quot;User roles&quot; and &quot;Forum roles&quot; must be different</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9914">PHPBB3-9914</a>] - Add backup warning to Automatic DB Updater</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9916">PHPBB3-9916</a>] - License in header not linking to version 2 of GNU GPL</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10093">PHPBB3-10093</a>] - Make commit-msg hook always not fatal</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10162">PHPBB3-10162</a>] - Allow TLDs over 6 characters in email addresses</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10280">PHPBB3-10280</a>] - Change the ACP user activation display</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10308">PHPBB3-10308</a>] - Disable Retain/Delete Posts selection if the user has no posts.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10453">PHPBB3-10453</a>] - PM viewmessage page is misplacing the online icon</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10492">PHPBB3-10492</a>] - Port functional tests to develop-olympus</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10507">PHPBB3-10507</a>] - Sort installed styles list in admin control panel - styles</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10550">PHPBB3-10550</a>] - Sort not installed styles list in admin control panel - styles</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10563">PHPBB3-10563</a>] - ACP usability improvement: show deactivated styles below active styles in styles list</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10565">PHPBB3-10565</a>] - Performance: Unneeded GROUP BY in update_forum_tracking_info</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10607">PHPBB3-10607</a>] - phpBB Credit Line Hardcoded</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10653">PHPBB3-10653</a>] - Add ability to count table rows to database abstraction layer</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10730">PHPBB3-10730</a>] - Add label tags around &quot;select&quot; text in post splitting UI in MCP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10764">PHPBB3-10764</a>] - FAQ mentions SourceForge</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10812">PHPBB3-10812</a>] - Installer should not display register globals UI for php 5.4+</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10815">PHPBB3-10815</a>] - Enable Feeds by default</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10819">PHPBB3-10819</a>] - Improve side-by-side diff styling</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10834">PHPBB3-10834</a>] - Backport general development language changes in readme files</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10836">PHPBB3-10836</a>] - Enable Avatars by default</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10891">PHPBB3-10891</a>] - Allow specifying test config file name via environment variable</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10892">PHPBB3-10892</a>] - Cosmetic improvements to RUNNING_TESTS.txt</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10898">PHPBB3-10898</a>] - Do not write ?&gt; into config.php to avoid whitespace output</li>
+</ul>
+<h4>New Feature</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10616">PHPBB3-10616</a>] - Add template inheritance by default</li>
+</ul>
+<h4>Sub-task</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10907">PHPBB3-10907</a>] - Mark (var)binary tests as incomplete on non-MySQL DBMSes</li>
+</ul>
+<h4>Task</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9896">PHPBB3-9896</a>] - Update links in docs/readme.html</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10434">PHPBB3-10434</a>] - Add a script that allows creating a search index from CLI</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10455">PHPBB3-10455</a>] - Remove NOTE from header files</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10694">PHPBB3-10694</a>] - Update notification in ACP (Olympus) for increase of minimum PHP version to 5.3.2</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10718">PHPBB3-10718</a>] - Add Travis CI</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10788">PHPBB3-10788</a>] - Update docs/AUTHORS for 3.0.11-RC1</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10909">PHPBB3-10909</a>] - Update Travis Test Configuration: Travis no longer supports PHP 5.3.2</li>
+</ul>
+
+ <a name="v309"></a><h3>1.ii. Changes since 3.0.9</h3>
<h4>Bug</h4>
<ul>
@@ -220,7 +337,7 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10480">PHPBB3-10480</a>] - Automate changelog building</li>
</ul>
- <a name="v308"></a><h3>1.ii. Changes since 3.0.8</h3>
+ <a name="v308"></a><h3>1.iii. Changes since 3.0.8</h3>
<h4> Bug
</h4>
@@ -588,7 +705,7 @@
</ul>
- <a name="v307-PL1"></a><h3>1.iii. Changes since 3.0.7-PL1</h3>
+ <a name="v307-PL1"></a><h3>1.iv. Changes since 3.0.7-PL1</h3>
<h4> Security
</h4>
<ul>
@@ -1046,13 +1163,13 @@
</ul>
- <a name="v307"></a><h3>1.iiv. Changes since 3.0.7</h3>
+ <a name="v307"></a><h3>1.iv. Changes since 3.0.7</h3>
<ul>
<li>[Sec] Do not expose forum content of forums with ACL entries but no actual permission in ATOM Feeds. (Bug #58595)</li>
</ul>
- <a name="v306"></a><h3>1.v. Changes since 3.0.6</h3>
+ <a name="v306"></a><h3>1.vi. Changes since 3.0.6</h3>
<ul>
<li>[Fix] Allow ban reason and length to be selected and copied in ACP and subsilver2 MCP. (Bug #51095)</li>
@@ -1156,7 +1273,7 @@
</ul>
- <a name="v305"></a><h3>1.vi. Changes since 3.0.5</h3>
+ <a name="v305"></a><h3>1.vii. Changes since 3.0.5</h3>
<ul>
<li>[Fix] Allow whitespaces in avatar gallery names. (Bug #44955)</li>
@@ -1378,7 +1495,7 @@
<li>[Feature] Send anonymous statistical information to phpBB on installation and update (optional).</li>
</ul>
- <a name="v304"></a><h3>1.vii. Changes since 3.0.4</h3>
+ <a name="v304"></a><h3>1.viii. Changes since 3.0.4</h3>
<ul>
<li>[Fix] Delete user entry from ban list table upon user deletion (Bug #40015 - Patch by TerraFrost)</li>
@@ -1467,7 +1584,7 @@
<li>[Sec] Only use forum id supplied for posting if global announcement detected. (Reported by nickvergessen)</li>
</ul>
- <a name="v303"></a><h3>1.viii. Changes since 3.0.3</h3>
+ <a name="v303"></a><h3>1.ix. Changes since 3.0.3</h3>
<ul>
<li>[Fix] Allow mixed-case template directories to be inherited (Bug #36725)</li>
@@ -1499,7 +1616,7 @@
<li>[Sec] Ask for forum password if post within passworded forum quoted in private message. (Reported by nickvergessen)</li>
</ul>
- <a name="v302"></a><h3>1.ix. Changes since 3.0.2</h3>
+ <a name="v302"></a><h3>1.x. Changes since 3.0.2</h3>
<ul>
<li>[Fix] Correctly set topic starter if first post in topic removed (Bug #30575 - Patch by blueray2048)</li>
@@ -1598,7 +1715,7 @@
<li>[Sec Precaution] Stricter validation of the HTTP_HOST header (Thanks to Techie-Micheal et al for pointing out possible issues in derived code)</li>
</ul>
- <a name="v301"></a><h3>1.x. Changes since 3.0.1</h3>
+ <a name="v301"></a><h3>1.xi. Changes since 3.0.1</h3>
<ul>
<li>[Fix] Ability to set permissions on non-mysql dbms (Bug #24955)</li>
@@ -1646,7 +1763,7 @@
<li>[Sec] Only allow urls gone through redirect() being used within login_box(). (thanks nookieman)</li>
</ul>
- <a name="v300"></a><h3>1.xi Changes since 3.0.0</h3>
+ <a name="v300"></a><h3>1.xii Changes since 3.0.0</h3>
<ul>
<li>[Change] Validate birthdays (Bug #15004)</li>
@@ -1717,7 +1834,7 @@
<li>[Fix] Find and display colliding usernames correctly when converting from one database to another (Bug #23925)</li>
</ul>
- <a name="v30rc8"></a><h3>1.xii. Changes since 3.0.RC8</h3>
+ <a name="v30rc8"></a><h3>1.xiii. Changes since 3.0.RC8</h3>
<ul>
<li>[Fix] Cleaned usernames contain only single spaces, so &quot;a_name&quot; and &quot;a__name&quot; are treated as the same name (Bug #15634)</li>
@@ -1726,7 +1843,7 @@
<li>[Fix] Call garbage_collection() within database updater to correctly close connections (affects Oracle for example)</li>
</ul>
- <a name="v30rc7"></a><h3>1.xiii. Changes since 3.0.RC7</h3>
+ <a name="v30rc7"></a><h3>1.xiv. Changes since 3.0.RC7</h3>
<ul>
<li>[Fix] Fixed MSSQL related bug in the update system</li>
@@ -1761,7 +1878,7 @@
<li>[Fix] No duplication of active topics (Bug #15474)</li>
</ul>
- <a name="v30rc6"></a><h3>1.xiv. Changes since 3.0.RC6</h3>
+ <a name="v30rc6"></a><h3>1.xv. Changes since 3.0.RC6</h3>
<ul>
<li>[Fix] Submitting language changes using acp_language (Bug #14736)</li>
@@ -1771,7 +1888,7 @@
<li>[Fix] Able to request new password (Bug #14743)</li>
</ul>
- <a name="v30rc5"></a><h3>1.xv. Changes since 3.0.RC5</h3>
+ <a name="v30rc5"></a><h3>1.xvi. Changes since 3.0.RC5</h3>
<ul>
<li>[Feature] Removing constant PHPBB_EMBEDDED in favor of using an exit_handler(); the constant was meant to achive this more or less.</li>
@@ -1834,7 +1951,7 @@
<li>[Sec] New password hashing mechanism for storing passwords (#i42)</li>
</ul>
- <a name="v30rc4"></a><h3>1.xvi. Changes since 3.0.RC4</h3>
+ <a name="v30rc4"></a><h3>1.xvii. Changes since 3.0.RC4</h3>
<ul>
<li>[Fix] MySQL, PostgreSQL and SQLite related database fixes (Bug #13862)</li>
@@ -1885,7 +2002,7 @@
<li>[Fix] odbc_autocommit causing existing result sets to be dropped (Bug #14182)</li>
</ul>
- <a name="v30rc3"></a><h3>1.xvii. Changes since 3.0.RC3</h3>
+ <a name="v30rc3"></a><h3>1.xviii. Changes since 3.0.RC3</h3>
<ul>
<li>[Fix] Fixing some subsilver2 and prosilver style issues</li>
@@ -1994,7 +2111,7 @@
</ul>
- <a name="v30rc2"></a><h3>1.xviii. Changes since 3.0.RC2</h3>
+ <a name="v30rc2"></a><h3>1.xviv. Changes since 3.0.RC2</h3>
<ul>
<li>[Fix] Re-allow searching within the memberlist</li>
@@ -2040,7 +2157,7 @@
</ul>
- <a name="v30rc1"></a><h3>1.xix. Changes since 3.0.RC1</h3>
+ <a name="v30rc1"></a><h3>1.xx. Changes since 3.0.RC1</h3>
<ul>
<li>[Fix] (X)HTML issues within the templates (Bug #11255, #11255)</li>
diff --git a/phpBB/docs/INSTALL.html b/phpBB/docs/INSTALL.html
index 47cf546ee8..cec11facb6 100644
--- a/phpBB/docs/INSTALL.html
+++ b/phpBB/docs/INSTALL.html
@@ -132,7 +132,7 @@
<ul>
<li>MySQL 3.23 or above (MySQLi supported)</li>
<li>PostgreSQL 7.3+</li>
- <li>SQLite 2.8.2+</li>
+ <li>SQLite 2.8.2+ (SQLite 3 is not supported)</li>
<li>Firebird 2.1+</li>
<li>MS SQL Server 2000 or above (directly or via ODBC or the native adapter)</li>
<li>Oracle</li>
diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html
index 6adc1ee7cb..cecc996c9c 100644
--- a/phpBB/docs/README.html
+++ b/phpBB/docs/README.html
@@ -126,9 +126,9 @@
<a name="i18n"></a><h3>2.i. Internationalisation (i18n)</h3>
- <p>A number of language packs and style localisations are available. You can find them on our official download page:</p>
+ <p>A number of language packs and style localisations are available. You can find them on our official language packs page:</p>
- <p><a href="http://www.phpbb.com/downloads/">http://www.phpbb.com/downloads/</a></p>
+ <p><a href="http://www.phpbb.com/languages/">http://www.phpbb.com/languages/</a></p>
<p>This is the <em>official</em> location for all supported language sets. If you download a package from a 3rd party site you do so with the understanding that we cannot offer support. So please, do not ask for help in these cases!</p>
@@ -140,7 +140,7 @@
<p>Although phpBB Group are rather proud of the included styles we realise that they may not be to everyone's tastes. Therefore phpBB3 allows styles to be switched with relative ease. Firstly you need to locate and download a style you like. We maintain such a site at</p>
- <p><a href="http://www.phpbb.com/styles/">http://www.phpbb.com/styles/</a></p>
+ <p><a href="http://www.phpbb.com/customise/db/styles-2/">http://www.phpbb.com/customise/db/styles-2/</a></p>
<p><strong>Please note</strong> that 3rd party styles downloaded for versions of phpBB2 will <strong>not</strong> work in phpBB3.</p>
@@ -152,7 +152,7 @@
<p>Although not officially supported by phpBB Group, phpBB has a thriving modification scene. These third party modifications to the standard phpBB extend its capabilities still further and can be found at:</p>
- <p><a href="http://www.phpbb.com/mods/">http://www.phpbb.com/mods/</a></p>
+ <p><a href="http://www.phpbb.com/customise/db/modifications-1/">http://www.phpbb.com/customise/db/modifications-1/</a></p>
<p><strong>Please remember</strong> that any bugs or other issues that occur after you have added any modification should <strong>NOT</strong> be reported to the bug tracker (see below). First remove the modification and see if the problem is resolved.</p>
diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html
index 3f2c142ac6..ae4655e094 100644
--- a/phpBB/docs/coding-guidelines.html
+++ b/phpBB/docs/coding-guidelines.html
@@ -295,11 +295,17 @@ PHPBB_QA (Set board to QA-Mode, which means the updater also c
<p>We will not be using any form of hungarian notation in our naming conventions. Many of us believe that hungarian naming is one of the primary code obfuscation techniques currently in use.</p>
<h4>Variable Names:</h4>
- <p>Variable names should be in all lowercase, with words separated by an underscore, example:</p>
+ <p>In PHP, variable names should be in all lowercase, with words separated by an underscore, example:</p>
<div class="indent">
<p><code>$current_user</code> is right, but <code>$currentuser</code> and <code> $currentUser</code> are not.</p>
</div>
+
+ <p>In JavaScript, variable names should use camel case:</p>
+
+ <div class="indent">
+ <p><code>currentUser</code> is right, but <code>currentuser</code> and <code>current_user</code> are not.</p>
+ </div>
<p>Names should be descriptive, but concise. We don't want huge sentences as our variable names, but typing an extra couple of characters is always better than wondering what exactly a certain variable is for. </p>
@@ -317,7 +323,7 @@ for ($i = 0; $i &lt; $outer_size; $i++)
</pre></div>
<h4>Function Names:</h4>
- <p>Functions should also be named descriptively. We're not programming in C here, we don't want to write functions called things like "stristr()". Again, all lower-case names with words separated by a single underscore character. Function names should preferably have a verb in them somewhere. Good function names are <code>print_login_status()</code>, <code>get_user_data()</code>, etc. </p>
+ <p>Functions should also be named descriptively. We're not programming in C here, we don't want to write functions called things like "stristr()". Again, all lower-case names with words separated by a single underscore character in PHP, and camel caps in JavaScript. Function names should preferably have a verb in them somewhere. Good function names are <code>print_login_status()</code>, <code>get_user_data()</code>, etc. Constructor functions in JavaScript should begin with a capital letter.</p>
<h4>Function Arguments:</h4>
<p>Arguments are subject to the same guidelines as variable names. We don't want a bunch of functions like: <code>do_stuff($a, $b, $c)</code>. In most cases, we'd like to be able to tell how to use a function by just looking at its declaration. </p>
@@ -397,7 +403,7 @@ for ($i = 0; $i &lt; size; $i++)
</pre></div>
<h4>Where to put the braces:</h4>
- <p>This one is a bit of a holy war, but we're going to use a style that can be summed up in one sentence: Braces always go on their own line. The closing brace should also always be at the same column as the corresponding opening brace, examples:</p>
+ <p>In PHP code, braces always go on their own line. The closing brace should also always be at the same column as the corresponding opening brace, examples:</p>
<div class="codebox"><pre>
if (condition)
@@ -427,6 +433,30 @@ function do_stuff()
...
}
</pre></div>
+
+ <p>In JavaScript code, braces always go on the same line:</p>
+
+ <div class="codebox"><pre>
+if (condition) {
+ while (condition2) {
+ ...
+ }
+} else {
+ ...
+}
+
+for (var i = 0; i &lt; size; i++) {
+ ...
+}
+
+while (condition) {
+ ...
+}
+
+function do_stuff() {
+ ...
+}
+ </pre></div>
<h4>Use spaces between tokens:</h4>
<p>This is another simple, easy step that helps keep code readable without much effort. Whenever you write an assignment, expression, etc.. Always leave <em>one</em> space between the tokens. Basically, write code as if it was English. Put spaces between variable names and operators. Don't put spaces just after an opening bracket or before a closing bracket. Don't put spaces just before a comma or a semicolon. This is best shown with a few examples, examples:</p>
@@ -502,7 +532,7 @@ $post_url = "{$phpbb_root_path}posting.$phpEx?mode=$mode&amp;amp;start=$start";
<p>In SQL statements mixing single and double quotes is partly allowed (following the guidelines listed here about SQL formatting), else one should try to only use one method - mostly single quotes.</p>
<h4>Commas after every array element:</h4>
- <p>If an array is defined with each element on its own line, you still have to modify the previous line to add a comma when appending a new element. PHP allows for trailing (useless) commas in array definitions. These should always be used so each element including the comma can be appended with a single line</p>
+ <p>If an array is defined with each element on its own line, you still have to modify the previous line to add a comma when appending a new element. PHP allows for trailing (useless) commas in array definitions. These should always be used so each element including the comma can be appended with a single line. In JavaScript, do not use the trailing comma, as it causes browsers to throw errors.</p>
<p class="bad">// wrong</p>
<div class="codebox"><pre>
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 951166f086..d537885ef1 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -88,6 +88,7 @@ class acp_board
'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_birthdays' => array('lang' => 'ALLOW_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
+ 'display_last_subject' => array('lang' => 'DISPLAY_LAST_SUBJECT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_quick_reply' => array('lang' => 'ALLOW_QUICK_REPLY', 'validate' => 'bool', 'type' => 'custom', 'method' => 'quick_reply', 'explain' => true),
'legend2' => 'ACP_LOAD_SETTINGS',
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php
index e66fd850c6..ebcbd28a87 100644
--- a/phpBB/includes/acp/acp_database.php
+++ b/phpBB/includes/acp/acp_database.php
@@ -20,6 +20,7 @@ if (!defined('IN_PHPBB'))
*/
class acp_database
{
+ var $db_tools;
var $u_action;
function main($id, $mode)
@@ -27,6 +28,12 @@ class acp_database
global $cache, $db, $user, $auth, $template, $table_prefix;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ if (!class_exists('phpbb_db_tools'))
+ {
+ require($phpbb_root_path . 'includes/db/db_tools.' . $phpEx);
+ }
+ $this->db_tools = new phpbb_db_tools($db);
+
$user->add_lang('acp/database');
$this->tpl_name = 'acp_database';
@@ -49,7 +56,7 @@ class acp_database
{
case 'download':
$type = request_var('type', '');
- $table = request_var('table', array(''));
+ $table = array_intersect($this->db_tools->sql_list_tables(), request_var('table', array('')));
$format = request_var('method', '');
$where = request_var('where', '');
@@ -172,8 +179,7 @@ class acp_database
break;
default:
- include($phpbb_root_path . 'includes/functions_install.' . $phpEx);
- $tables = get_tables($db);
+ $tables = $this->db_tools->sql_list_tables();
asort($tables);
foreach ($tables as $table_name)
{
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index de1f678e38..943bfe6a6f 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -21,7 +21,7 @@ if (!defined('IN_PHPBB'))
class acp_styles
{
public $u_action;
-
+
protected $u_base_action;
protected $s_hidden_fields;
protected $mode;
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 44717452e8..17687b05c7 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -1001,6 +1001,13 @@ class acp_users
$user_row['posts_in_queue'] = (int) $db->sql_fetchfield('posts_in_queue');
$db->sql_freeresult($result);
+ $sql = 'SELECT post_id
+ FROM ' . POSTS_TABLE . '
+ WHERE poster_id = '. $user_id;
+ $result = $db->sql_query_limit($sql, 1);
+ $user_row['user_has_posts'] = (bool) $db->sql_fetchfield('post_id');
+ $db->sql_freeresult($result);
+
$template->assign_vars(array(
'L_NAME_CHARS_EXPLAIN' => $user->lang($config['allow_name_chars'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_name_chars']), $user->lang('CHARACTERS', (int) $config['max_name_chars'])),
'L_CHANGE_PASSWORD_EXPLAIN' => $user->lang($config['pass_complex'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_pass_chars']), $user->lang('CHARACTERS', (int) $config['max_pass_chars'])),
@@ -1028,6 +1035,7 @@ class acp_users
'USER_EMAIL' => $user_row['user_email'],
'USER_WARNINGS' => $user_row['user_warnings'],
'USER_POSTS' => $user_row['user_posts'],
+ 'USER_HAS_POSTS' => $user_row['user_has_posts'],
'USER_INACTIVE_REASON' => $inactive_reason,
));
diff --git a/phpBB/includes/auth/auth_ldap.php b/phpBB/includes/auth/auth_ldap.php
index b2f45f046c..26029efe1e 100644
--- a/phpBB/includes/auth/auth_ldap.php
+++ b/phpBB/includes/auth/auth_ldap.php
@@ -155,7 +155,11 @@ function login_ldap(&$username, &$password)
{
if (!@ldap_bind($ldap, htmlspecialchars_decode($config['ldap_user']), htmlspecialchars_decode($config['ldap_password'])))
{
- return $user->lang['LDAP_NO_SERVER_CONNECTION'];
+ return array(
+ 'status' => LOGIN_ERROR_EXTERNAL_AUTH,
+ 'error_msg' => 'LDAP_NO_SERVER_CONNECTION',
+ 'user_row' => array('user_id' => ANONYMOUS),
+ );
}
}
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php
index fde917e5b1..444446e9c3 100644
--- a/phpBB/includes/bbcode.php
+++ b/phpBB/includes/bbcode.php
@@ -130,7 +130,7 @@ class bbcode
if (empty($this->template_filename))
{
- $this->template_bitfield = new bitfield($user->theme['bbcode_bitfield']);
+ $this->template_bitfield = new bitfield($user->style['bbcode_bitfield']);
$style_resource_locator = new phpbb_style_resource_locator();
$style_path_provider = new phpbb_style_extension_path_provider($phpbb_extension_manager, new phpbb_style_path_provider());
diff --git a/phpBB/includes/cache/service.php b/phpBB/includes/cache/service.php
index aa225ade69..37f32aa753 100644
--- a/phpBB/includes/cache/service.php
+++ b/phpBB/includes/cache/service.php
@@ -321,50 +321,39 @@ class phpbb_cache_service
/**
* Obtain cfg file data
*/
- function obtain_cfg_items($theme)
+ function obtain_cfg_items($style)
{
global $config, $phpbb_root_path;
- $parsed_items = array(
- 'theme' => array(),
- 'template' => array(),
- 'imageset' => array()
- );
+ $parsed_array = $this->driver->get('_cfg_' . $style['style_path']);
- foreach ($parsed_items as $key => $parsed_array)
+ if ($parsed_array === false)
{
- $parsed_array = $this->driver->get('_cfg_' . $key . '_' . $theme[$key . '_path']);
-
- if ($parsed_array === false)
- {
- $parsed_array = array();
- }
+ $parsed_array = array();
+ }
- $reparse = false;
- $filename = $phpbb_root_path . 'styles/' . $theme[$key . '_path'] . '/' . $key . '/' . $key . '.cfg';
+ $reparse = false;
+ $filename = $phpbb_root_path . 'styles/' . $style['style_path'] . '/style.cfg';
- if (!file_exists($filename))
- {
- continue;
- }
+ if (!file_exists($filename))
+ {
+ continue;
+ }
- if (!isset($parsed_array['filetime']) || (($config['load_tplcompile'] && @filemtime($filename) > $parsed_array['filetime'])))
- {
- $reparse = true;
- }
+ if (!isset($parsed_array['filetime']) || (($config['load_tplcompile'] && @filemtime($filename) > $parsed_array['filetime'])))
+ {
+ $reparse = true;
+ }
- // Re-parse cfg file
- if ($reparse)
- {
- $parsed_array = parse_cfg_file($filename);
- $parsed_array['filetime'] = @filemtime($filename);
+ // Re-parse cfg file
+ if ($reparse)
+ {
+ $parsed_array = parse_cfg_file($filename);
+ $parsed_array['filetime'] = @filemtime($filename);
- $this->driver->put('_cfg_' . $key . '_' . $theme[$key . '_path'], $parsed_array);
- }
- $parsed_items[$key] = $parsed_array;
+ $this->driver->put('_cfg_' . $style['style_path'], $parsed_array);
}
-
- return $parsed_items;
+ return $parsed_array;
}
/**
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php
index db469ed969..cf54d455f7 100644
--- a/phpBB/includes/db/dbal.php
+++ b/phpBB/includes/db/dbal.php
@@ -522,6 +522,18 @@ class dbal
}
/**
+ * Run LOWER() on DB column of type text (i.e. neither varchar nor char).
+ *
+ * @param string $column_name The column name to use
+ *
+ * @return string A SQL statement like "LOWER($column_name)"
+ */
+ function sql_lower_text($column_name)
+ {
+ return "LOWER($column_name)";
+ }
+
+ /**
* Run more than one insert statement.
*
* @param string $table table name to run the statements on
diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php
index fd11dbad3c..abeabc389f 100644
--- a/phpBB/includes/db/mssql.php
+++ b/phpBB/includes/db/mssql.php
@@ -325,6 +325,14 @@ class dbal_mssql extends dbal
}
/**
+ * {@inheritDoc}
+ */
+ function sql_lower_text($column_name)
+ {
+ return "LOWER(SUBSTRING($column_name, 1, DATALENGTH($column_name)))";
+ }
+
+ /**
* Build LIKE expression
* @access private
*/
diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php
index 7ead00cece..6e24f4e9e8 100644
--- a/phpBB/includes/db/mssql_odbc.php
+++ b/phpBB/includes/db/mssql_odbc.php
@@ -310,6 +310,14 @@ class dbal_mssql_odbc extends dbal
}
/**
+ * {@inheritDoc}
+ */
+ function sql_lower_text($column_name)
+ {
+ return "LOWER(SUBSTRING($column_name, 1, DATALENGTH($column_name)))";
+ }
+
+ /**
* Build LIKE expression
* @access private
*/
diff --git a/phpBB/includes/db/mssqlnative.php b/phpBB/includes/db/mssqlnative.php
index 8aac032135..8a4503f111 100644
--- a/phpBB/includes/db/mssqlnative.php
+++ b/phpBB/includes/db/mssqlnative.php
@@ -492,6 +492,14 @@ class dbal_mssqlnative extends dbal
}
/**
+ * {@inheritDoc}
+ */
+ function sql_lower_text($column_name)
+ {
+ return "LOWER(SUBSTRING($column_name, 1, DATALENGTH($column_name)))";
+ }
+
+ /**
* Build LIKE expression
* @access private
*/
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 28f06abbc1..e40df93194 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1691,14 +1691,17 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti
}
else
{
- $sql = 'SELECT t.forum_id FROM ' . TOPICS_TABLE . ' t
- LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . ')
+ $sql = 'SELECT t.forum_id
+ FROM ' . TOPICS_TABLE . ' t
+ LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt
+ ON (tt.topic_id = t.topic_id
+ AND tt.user_id = ' . $user->data['user_id'] . ')
WHERE t.forum_id = ' . $forum_id . '
AND t.topic_last_post_time > ' . $mark_time_forum . '
AND t.topic_moved_id = 0 ' .
$sql_update_unapproved . '
- AND (tt.topic_id IS NULL OR tt.mark_time < t.topic_last_post_time)
- GROUP BY t.forum_id';
+ AND (tt.topic_id IS NULL
+ OR tt.mark_time < t.topic_last_post_time)';
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -3247,7 +3250,7 @@ function get_preg_expression($mode)
case 'email':
// Regex written by James Watts and Francisco Jose Martin Moreno
// http://fightingforalostcause.net/misc/2006/compare-email-regex.php
- return '([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*(?:[\w\!\#$\%\'\*\+\-\/\=\?\^\`{\|\}\~]|&amp;)+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)';
+ return '([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*(?:[\w\!\#$\%\'\*\+\-\/\=\?\^\`{\|\}\~]|&amp;)+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,63})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)';
break;
case 'bbcode_htm':
@@ -4769,9 +4772,9 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'T_ASSETS_VERSION' => $config['assets_version'],
'T_ASSETS_PATH' => "{$web_path}assets",
- 'T_THEME_PATH' => "{$web_path}styles/" . rawurlencode($user->theme['style_path']) . '/theme',
- 'T_TEMPLATE_PATH' => "{$web_path}styles/" . rawurlencode($user->theme['style_path']) . '/template',
- 'T_SUPER_TEMPLATE_PATH' => "{$web_path}styles/" . rawurlencode($user->theme['style_path']) . '/template',
+ 'T_THEME_PATH' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme',
+ 'T_TEMPLATE_PATH' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/template',
+ 'T_SUPER_TEMPLATE_PATH' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/template',
'T_IMAGES_PATH' => "{$web_path}images/",
'T_SMILIES_PATH' => "{$web_path}{$config['smilies_path']}/",
'T_AVATAR_PATH' => "{$web_path}{$config['avatar_path']}/",
@@ -4779,16 +4782,15 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'T_ICONS_PATH' => "{$web_path}{$config['icons_path']}/",
'T_RANKS_PATH' => "{$web_path}{$config['ranks_path']}/",
'T_UPLOAD_PATH' => "{$web_path}{$config['upload_path']}/",
- 'T_STYLESHEET_LINK' => "{$web_path}styles/" . rawurlencode($user->theme['style_path']) . '/theme/stylesheet.css?assets_version=' . $config['assets_version'],
- 'T_STYLESHEET_LANG_LINK' => "{$web_path}styles/" . rawurlencode($user->theme['style_path']) . '/theme/' . $user->lang_name . '/stylesheet.css?assets_version=' . $config['assets_version'],
- 'T_STYLESHEET_NAME' => $user->theme['style_name'],
+ 'T_STYLESHEET_LINK' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/stylesheet.css?assets_version=' . $config['assets_version'],
+ 'T_STYLESHEET_LANG_LINK' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/' . $user->lang_name . '/stylesheet.css?assets_version=' . $config['assets_version'],
'T_JQUERY_LINK' => ($config['load_jquery_cdn'] && !empty($config['load_jquery_url'])) ? $config['load_jquery_url'] : "{$web_path}assets/javascript/jquery.js?assets_version=" . $config['assets_version'],
'S_JQUERY_FALLBACK' => ($config['load_jquery_cdn']) ? true : false,
- 'T_THEME_NAME' => rawurlencode($user->theme['style_path']),
+ 'T_THEME_NAME' => rawurlencode($user->style['style_path']),
'T_THEME_LANG_NAME' => $user->data['user_lang'],
- 'T_TEMPLATE_NAME' => $user->theme['style_path'],
- 'T_SUPER_TEMPLATE_NAME' => rawurlencode((isset($user->theme['style_parent_tree']) && $user->theme['style_parent_tree']) ? $user->theme['style_parent_tree'] : $user->theme['style_path']),
+ 'T_TEMPLATE_NAME' => $user->style['style_path'],
+ 'T_SUPER_TEMPLATE_NAME' => rawurlencode((isset($user->style['style_parent_tree']) && $user->style['style_parent_tree']) ? $user->style['style_parent_tree'] : $user->style['style_path']),
'T_IMAGES' => 'images',
'T_SMILIES' => $config['smilies_path'],
'T_AVATAR' => $config['avatar_path'],
@@ -4984,3 +4986,16 @@ function phpbb_pcre_utf8_support()
}
return $utf8_pcre_properties;
}
+
+/**
+* Casts a numeric string $input to an appropriate numeric type (i.e. integer or float)
+*
+* @param string $input A numeric string.
+*
+* @return int|float Integer $input if $input fits integer,
+* float $input otherwise.
+*/
+function phpbb_to_numeric($input)
+{
+ return ($input > PHP_INT_MAX) ? (float) $input : (int) $input;
+}
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 9798e514c1..3ebd6682a9 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -2292,6 +2292,21 @@ function auto_prune($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_fr
}
/**
+* remove_comments will strip the sql comment lines out of an uploaded sql file
+* specifically for mssql and postgres type files in the install....
+*
+* @deprecated Use phpbb_remove_comments() instead.
+*/
+function remove_comments(&$output)
+{
+ // Remove /* */ comments (http://ostermiller.org/findcomment.html)
+ $output = preg_replace('#/\*(.|[\r\n])*?\*/#', "\n", $output);
+
+ // Return by reference and value.
+ return $output;
+}
+
+/**
* Cache moderators, called whenever permissions are changed via admin_permissions. Changes of username
* and group names must be carried through for the moderators table
*/
@@ -2556,7 +2571,8 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
{
$sql_keywords .= $db->sql_in_set('l.log_operation', $operations) . ' OR ';
}
- $sql_keywords .= 'LOWER(l.log_data) ' . implode(' OR LOWER(l.log_data) ', $keywords) . ')';
+ $sql_lower = $db->sql_lower_text('l.log_data');
+ $sql_keywords .= "$sql_lower " . implode(" OR $sql_lower ", $keywords) . ')';
}
if ($log_count !== false)
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 18db64cc68..545f75ad67 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -397,12 +397,13 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
if ($row['forum_last_post_id'])
{
$last_post_subject = $row['forum_last_post_subject'];
+ $last_post_subject_truncated = truncate_string(censor_text($last_post_subject), 30, 255, false, $user->lang['ELLIPSIS']);
$last_post_time = $user->format_date($row['forum_last_post_time']);
$last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&amp;p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
}
else
{
- $last_post_subject = $last_post_time = $last_post_url = '';
+ $last_post_subject = $last_post_time = $last_post_url = $last_post_subject_truncated = '';
}
// Output moderator listing ... if applicable
@@ -451,6 +452,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
'S_LOCKED_FORUM' => ($row['forum_status'] == ITEM_LOCKED) ? true : false,
'S_LIST_SUBFORUMS' => ($row['display_subforum_list']) ? true : false,
'S_SUBFORUMS' => (sizeof($subforums_list)) ? true : false,
+ 'S_DISPLAY_SUBJECT' => ($last_post_subject && $config['display_last_subject'] && !$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id'])) ? true : false,
'S_FEED_ENABLED' => ($config['feed_forum'] && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $row['forum_options']) && $row['forum_type'] == FORUM_POST) ? true : false,
'FORUM_ID' => $row['forum_id'],
@@ -463,7 +465,8 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
'FORUM_FOLDER_IMG_ALT' => isset($user->lang[$folder_alt]) ? $user->lang[$folder_alt] : '',
'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '',
'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
- 'LAST_POST_SUBJECT' => censor_text($last_post_subject),
+ 'LAST_POST_SUBJECT' => (!$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id'])) ? censor_text($last_post_subject) : "",
+ 'LAST_POST_SUBJECT_TRUNCATED' => (!$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id'])) ? $last_post_subject_truncated : "",
'LAST_POST_TIME' => $last_post_time,
'LAST_POSTER' => get_username_string('username', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
'LAST_POSTER_COLOUR' => get_username_string('colour', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
@@ -1218,7 +1221,9 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
if ($can_watch)
{
$s_watching['link'] = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&amp;" . (($is_watching) ? 'unwatch' : 'watch') . "=$mode&amp;start=$start&amp;hash=" . generate_link_hash("{$mode}_$match_id"));
+ $s_watching['link_toggle'] = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&amp;" . ((!$is_watching) ? 'unwatch' : 'watch') . "=$mode&amp;start=$start&amp;hash=" . generate_link_hash("{$mode}_$match_id"));
$s_watching['title'] = $user->lang[(($is_watching) ? 'STOP' : 'START') . '_WATCHING_' . strtoupper($mode)];
+ $s_watching['title_toggle'] = $user->lang[((!$is_watching) ? 'STOP' : 'START') . '_WATCHING_' . strtoupper($mode)];
$s_watching['is_watching'] = $is_watching;
}
diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php
index 15b388728b..80f2bf940d 100644
--- a/phpBB/includes/functions_install.php
+++ b/phpBB/includes/functions_install.php
@@ -49,6 +49,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'firebird',
'MODULE' => 'interbase',
'DELIM' => ';;',
+ 'COMMENTS' => 'remove_remarks',
'DRIVER' => 'firebird',
'AVAILABLE' => true,
'2.0.x' => false,
@@ -58,6 +59,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'mysql_41',
'MODULE' => 'mysqli',
'DELIM' => ';',
+ 'COMMENTS' => 'remove_remarks',
'DRIVER' => 'mysqli',
'AVAILABLE' => true,
'2.0.x' => true,
@@ -67,6 +69,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'mysql',
'MODULE' => 'mysql',
'DELIM' => ';',
+ 'COMMENTS' => 'remove_remarks',
'DRIVER' => 'mysql',
'AVAILABLE' => true,
'2.0.x' => true,
@@ -76,6 +79,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'mssql',
'MODULE' => 'mssql',
'DELIM' => 'GO',
+ 'COMMENTS' => 'remove_comments',
'DRIVER' => 'mssql',
'AVAILABLE' => true,
'2.0.x' => true,
@@ -85,6 +89,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'mssql',
'MODULE' => 'odbc',
'DELIM' => 'GO',
+ 'COMMENTS' => 'remove_comments',
'DRIVER' => 'mssql_odbc',
'AVAILABLE' => true,
'2.0.x' => true,
@@ -94,6 +99,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'mssql',
'MODULE' => 'sqlsrv',
'DELIM' => 'GO',
+ 'COMMENTS' => 'remove_comments',
'DRIVER' => 'mssqlnative',
'AVAILABLE' => true,
'2.0.x' => false,
@@ -103,6 +109,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'oracle',
'MODULE' => 'oci8',
'DELIM' => '/',
+ 'COMMENTS' => 'remove_comments',
'DRIVER' => 'oracle',
'AVAILABLE' => true,
'2.0.x' => false,
@@ -112,6 +119,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'postgres',
'MODULE' => 'pgsql',
'DELIM' => ';',
+ 'COMMENTS' => 'remove_comments',
'DRIVER' => 'postgres',
'AVAILABLE' => true,
'2.0.x' => true,
@@ -121,6 +129,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'sqlite',
'MODULE' => 'sqlite',
'DELIM' => ';',
+ 'COMMENTS' => 'remove_remarks',
'DRIVER' => 'sqlite',
'AVAILABLE' => true,
'2.0.x' => false,
@@ -464,16 +473,39 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
/**
* Removes comments from schema files
+*
+* @deprecated Use phpbb_remove_comments() instead.
*/
-function remove_comments($sql)
+function remove_remarks(&$sql)
{
- // Remove /* */ comments (http://ostermiller.org/findcomment.html)
- $sql = preg_replace('#/\*(.|[\r\n])*?\*/#', "\n", $sql);
-
// Remove # style comments
$sql = preg_replace('/\n{2,}/', "\n", preg_replace('/^#.*$/m', "\n", $sql));
- return $sql;
+ // Return by reference
+}
+
+/**
+* Removes "/* style" as well as "# style" comments from $input.
+*
+* @param string $input Input string
+*
+* @return string Input string with comments removed
+*/
+function phpbb_remove_comments($input)
+{
+ if (!function_exists('remove_comments'))
+ {
+ global $phpbb_root_path, $phpEx;
+ require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ }
+
+ // Remove /* */ comments
+ remove_comments($input);
+
+ // Remove # style comments
+ remove_remarks($input);
+
+ return $input;
}
/**
@@ -558,7 +590,5 @@ function phpbb_create_config_file_data($data, $dbms, $load_extensions, $debug =
$config_data .= "// @define('DEBUG_EXTRA', true);\n";
}
- $config_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused!
-
return $config_data;
}
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index f77f54679f..c549f99091 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -1657,8 +1657,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
// First of all make sure the subject and topic title are having the correct length.
// To achieve this without cutting off between special chars we convert to an array and then count the elements.
- $subject = truncate_string($subject);
- $data['topic_title'] = truncate_string($data['topic_title']);
+ $subject = truncate_string($subject, 120);
+ $data['topic_title'] = truncate_string($data['topic_title'], 120);
// Collect some basic information about which tables and which rows to update/insert
$sql_data = $topic_row = array();
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 434349714b..8542e3ab0a 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -1128,6 +1128,166 @@ function delete_pm($user_id, $msg_ids, $folder_id)
}
/**
+* Delete all PM(s) for a given user and delete the ones without references
+*
+* @param int $user_id ID of the user whose private messages we want to delete
+*
+* @return boolean False if there were no pms found, true otherwise.
+*/
+function phpbb_delete_user_pms($user_id)
+{
+ global $db, $user, $phpbb_root_path, $phpEx;
+
+ $user_id = (int) $user_id;
+
+ if (!$user_id)
+ {
+ return false;
+ }
+
+ // Get PM Information for later deleting
+ // The two queries where split, so we can use our indexes
+ // Part 1: get PMs the user received
+ $sql = 'SELECT msg_id, author_id, folder_id, pm_unread, pm_new
+ FROM ' . PRIVMSGS_TO_TABLE . '
+ WHERE user_id = ' . $user_id;
+ $result = $db->sql_query($sql);
+
+ $undelivered_msg = $undelivered_user = $delete_ids = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if ($row['author_id'] == $user_id && $row['folder_id'] == PRIVMSGS_NO_BOX)
+ {
+ // Undelivered messages
+ $undelivered_msg[] = $row['msg_id'];
+
+ if (isset($undelivered_user[$row['user_id']]))
+ {
+ ++$undelivered_user[$row['user_id']];
+ }
+ else
+ {
+ $undelivered_user[$row['user_id']] = 1;
+ }
+ }
+
+ $delete_ids[(int) $row['msg_id']] = (int) $row['msg_id'];
+ }
+ $db->sql_freeresult($result);
+
+ // Part 2: get PMs the user sent
+ $sql = 'SELECT msg_id, author_id, folder_id, pm_unread, pm_new
+ FROM ' . PRIVMSGS_TO_TABLE . '
+ WHERE author_id = ' . $user_id . '
+ AND folder_id = ' . PRIVMSGS_NO_BOX;
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if ($row['author_id'] == $user_id && $row['folder_id'] == PRIVMSGS_NO_BOX)
+ {
+ // Undelivered messages
+ $undelivered_msg[] = $row['msg_id'];
+
+ if (isset($undelivered_user[$row['user_id']]))
+ {
+ ++$undelivered_user[$row['user_id']];
+ }
+ else
+ {
+ $undelivered_user[$row['user_id']] = 1;
+ }
+ }
+
+ $delete_ids[(int) $row['msg_id']] = (int) $row['msg_id'];
+ }
+ $db->sql_freeresult($result);
+
+ if (empty($delete_ids))
+ {
+ return false;
+ }
+
+ $db->sql_transaction('begin');
+
+ if (sizeof($undelivered_msg))
+ {
+ $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
+ WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg);
+ $db->sql_query($sql);
+ }
+
+ // Reset the user´s pm count to 0
+ if (isset($undelivered_user[$user_id]))
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_new_privmsg = 0,
+ user_unread_privmsg = 0
+ WHERE user_id = ' . $user_id;
+ $db->sql_query($sql);
+ unset($undelivered_user[$user_id]);
+ }
+
+ foreach ($undelivered_user as $_user_id => $count)
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_new_privmsg = user_new_privmsg - ' . $count . ',
+ user_unread_privmsg = user_unread_privmsg - ' . $count . '
+ WHERE user_id = ' . $_user_id;
+ $db->sql_query($sql);
+ }
+
+ // Delete private message data
+ $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . "
+ WHERE user_id = $user_id
+ AND " . $db->sql_in_set('msg_id', $delete_ids);
+ $db->sql_query($sql);
+
+ // Now we have to check which messages we can delete completely
+ $sql = 'SELECT msg_id
+ FROM ' . PRIVMSGS_TO_TABLE . '
+ WHERE ' . $db->sql_in_set('msg_id', $delete_ids);
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ unset($delete_ids[$row['msg_id']]);
+ }
+ $db->sql_freeresult($result);
+
+ if (!empty($delete_ids))
+ {
+ // Check if there are any attachments we need to remove
+ if (!function_exists('delete_attachments'))
+ {
+ include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ }
+
+ delete_attachments('message', $delete_ids, false);
+
+ $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
+ WHERE ' . $db->sql_in_set('msg_id', $delete_ids);
+ $db->sql_query($sql);
+ }
+
+ // Set the remaining author id to anonymous
+ // This way users are still able to read messages from users being removed
+ $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . '
+ SET author_id = ' . ANONYMOUS . '
+ WHERE author_id = ' . $user_id;
+ $db->sql_query($sql);
+
+ $sql = 'UPDATE ' . PRIVMSGS_TABLE . '
+ SET author_id = ' . ANONYMOUS . '
+ WHERE author_id = ' . $user_id;
+ $db->sql_query($sql);
+
+ $db->sql_transaction('commit');
+
+ return true;
+}
+
+/**
* Rebuild message header
*/
function rebuild_header($check_ary)
@@ -1406,12 +1566,6 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
while ($row = $db->sql_fetchrow($result))
{
- // Additionally, do not include the sender if he is in the group he wants to send to. ;)
- if ($row['user_id'] === $user->data['user_id'])
- {
- continue;
- }
-
$field = ($data['address_list']['g'][$row['group_id']] == 'to') ? 'to' : 'bcc';
$recipients[$row['user_id']] = $field;
}
diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php
index 71fe627ac8..33cb585b19 100644
--- a/phpBB/includes/functions_upload.php
+++ b/phpBB/includes/functions_upload.php
@@ -151,7 +151,8 @@ class filespec
*/
function is_image()
{
- return (strpos($this->mimetype, 'image/') !== false) ? true : false;
+ $mimetype = $this->get_mimetype($this->filename);
+ return (strpos($mimetype, 'image/') === 0);
}
/**
@@ -200,17 +201,12 @@ class filespec
}
/**
- * Get mimetype. Utilize mime_content_type if the function exist.
- * Not used at the moment...
+ * Get mimetype. Utilises the finfo class.
*/
function get_mimetype($filename)
{
- $mimetype = '';
-
- if (function_exists('mime_content_type'))
- {
- $mimetype = mime_content_type($filename);
- }
+ $finfo = new finfo(FILEINFO_MIME_TYPE);
+ $mimetype = $finfo->file($filename);
// Some browsers choke on a mimetype of application/octet-stream
if (!$mimetype || $mimetype == 'application/octet-stream')
@@ -342,6 +338,7 @@ class filespec
// Remove temporary filename
@unlink($this->filename);
+ $this->filename = $this->destination_file;
if (sizeof($this->error))
{
@@ -756,6 +753,31 @@ class fileupload
$filename = $url['path'];
$filesize = 0;
+ $remote_max_filesize = $this->max_filesize;
+ if (!$remote_max_filesize)
+ {
+ $max_filesize = @ini_get('upload_max_filesize');
+
+ if (!empty($max_filesize))
+ {
+ $unit = strtolower(substr($max_filesize, -1, 1));
+ $remote_max_filesize = (int) $max_filesize;
+
+ switch ($unit)
+ {
+ case 'g':
+ $remote_max_filesize *= 1024;
+ // no break
+ case 'm':
+ $remote_max_filesize *= 1024;
+ // no break
+ case 'k':
+ $remote_max_filesize *= 1024;
+ // no break
+ }
+ }
+ }
+
$errno = 0;
$errstr = '';
@@ -784,9 +806,9 @@ class fileupload
$block = @fread($fsock, 1024);
$filesize += strlen($block);
- if ($this->max_filesize && $filesize > $this->max_filesize)
+ if ($remote_max_filesize && $filesize > $remote_max_filesize)
{
- $max_filesize = get_formatted_filesize($this->max_filesize, false);
+ $max_filesize = get_formatted_filesize($remote_max_filesize, false);
$file = new fileerror(sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize['value'], $max_filesize['unit']));
return $file;
@@ -812,9 +834,9 @@ class fileupload
{
$length = (int) str_replace('content-length: ', '', strtolower($line));
- if ($length && $length > $this->max_filesize)
+ if ($remote_max_filesize && $length && $length > $remote_max_filesize)
{
- $max_filesize = get_formatted_filesize($this->max_filesize, false);
+ $max_filesize = get_formatted_filesize($remote_max_filesize, false);
$file = new fileerror(sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize['value'], $max_filesize['unit']));
return $file;
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 5b05c3a78d..9b102b7387 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -527,62 +527,12 @@ function user_delete($mode, $user_id, $post_username = false)
WHERE session_user_id = ' . $user_id;
$db->sql_query($sql);
- // Remove any undelivered mails...
- $sql = 'SELECT msg_id, user_id
- FROM ' . PRIVMSGS_TO_TABLE . '
- WHERE author_id = ' . $user_id . '
- AND folder_id = ' . PRIVMSGS_NO_BOX;
- $result = $db->sql_query($sql);
-
- $undelivered_msg = $undelivered_user = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $undelivered_msg[] = $row['msg_id'];
- $undelivered_user[$row['user_id']][] = true;
- }
- $db->sql_freeresult($result);
-
- if (sizeof($undelivered_msg))
+ // Clean the private messages tables from the user
+ if (!function_exists('phpbb_delete_user_pms'))
{
- $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
- WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg);
- $db->sql_query($sql);
- }
-
- $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . '
- WHERE author_id = ' . $user_id . '
- AND folder_id = ' . PRIVMSGS_NO_BOX;
- $db->sql_query($sql);
-
- // Delete all to-information
- $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . '
- WHERE user_id = ' . $user_id;
- $db->sql_query($sql);
-
- // Set the remaining author id to anonymous - this way users are still able to read messages from users being removed
- $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . '
- SET author_id = ' . ANONYMOUS . '
- WHERE author_id = ' . $user_id;
- $db->sql_query($sql);
-
- $sql = 'UPDATE ' . PRIVMSGS_TABLE . '
- SET author_id = ' . ANONYMOUS . '
- WHERE author_id = ' . $user_id;
- $db->sql_query($sql);
-
- foreach ($undelivered_user as $_user_id => $ary)
- {
- if ($_user_id == $user_id)
- {
- continue;
- }
-
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_new_privmsg = user_new_privmsg - ' . sizeof($ary) . ',
- user_unread_privmsg = user_unread_privmsg - ' . sizeof($ary) . '
- WHERE user_id = ' . $_user_id;
- $db->sql_query($sql);
+ include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
}
+ phpbb_delete_user_pms($user_id);
$db->sql_transaction('commit');
diff --git a/phpBB/includes/php/ini.php b/phpBB/includes/php/ini.php
new file mode 100644
index 0000000000..17e8c54a57
--- /dev/null
+++ b/phpBB/includes/php/ini.php
@@ -0,0 +1,175 @@
+<?php
+/**
+*
+* @package phpBB
+* @copyright (c) 2011 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* Wrapper class for ini_get function.
+*
+* Provides easier handling of the different interpretations of ini values.
+*
+* @package phpBB
+*/
+class phpbb_php_ini
+{
+ /**
+ * Simple wrapper for ini_get()
+ * See http://php.net/manual/en/function.ini-get.php
+ *
+ * @param string $varname The configuration option name.
+ * @return bool|string False if configuration option does not exist,
+ * the configuration option value (string) otherwise.
+ */
+ public function get($varname)
+ {
+ return ini_get($varname);
+ }
+
+ /**
+ * Gets the configuration option value as a trimmed string.
+ *
+ * @param string $varname The configuration option name.
+ * @return bool|string False if configuration option does not exist,
+ * the configuration option value (string) otherwise.
+ */
+ public function get_string($varname)
+ {
+ $value = $this->get($varname);
+
+ if ($value === false)
+ {
+ return false;
+ }
+
+ return trim($value);
+ }
+
+ /**
+ * Gets configuration option value as a boolean.
+ * Interprets the string value 'off' as false.
+ *
+ * @param string $varname The configuration option name.
+ * @return bool False if configuration option does not exist.
+ * False if configuration option is disabled.
+ * True otherwise.
+ */
+ public function get_bool($varname)
+ {
+ $value = $this->get_string($varname);
+
+ if (empty($value) || strtolower($value) == 'off')
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Gets configuration option value as an integer.
+ *
+ * @param string $varname The configuration option name.
+ * @return bool|int False if configuration option does not exist,
+ * false if configuration option value is not numeric,
+ * the configuration option value (integer) otherwise.
+ */
+ public function get_int($varname)
+ {
+ $value = $this->get_string($varname);
+
+ if (!is_numeric($value))
+ {
+ return false;
+ }
+
+ return (int) $value;
+ }
+
+ /**
+ * Gets configuration option value as a float.
+ *
+ * @param string $varname The configuration option name.
+ * @return bool|float False if configuration option does not exist,
+ * false if configuration option value is not numeric,
+ * the configuration option value (float) otherwise.
+ */
+ public function get_float($varname)
+ {
+ $value = $this->get_string($varname);
+
+ if (!is_numeric($value))
+ {
+ return false;
+ }
+
+ return (float) $value;
+ }
+
+ /**
+ * Gets configuration option value in bytes.
+ * Converts strings like '128M' to bytes (integer or float).
+ *
+ * @param string $varname The configuration option name.
+ * @return bool|int|float False if configuration option does not exist,
+ * false if configuration option value is not well-formed,
+ * the configuration option value otherwise.
+ */
+ public function get_bytes($varname)
+ {
+ $value = $this->get_string($varname);
+
+ if ($value === false)
+ {
+ return false;
+ }
+
+ if (is_numeric($value))
+ {
+ // Already in bytes.
+ return phpbb_to_numeric($value);
+ }
+ else if (strlen($value) < 2)
+ {
+ // Single character.
+ return false;
+ }
+ else if (strlen($value) < 3 && $value[0] === '-')
+ {
+ // Two characters but the first one is a minus.
+ return false;
+ }
+
+ $value_lower = strtolower($value);
+ $value_numeric = phpbb_to_numeric($value);
+
+ switch ($value_lower[strlen($value_lower) - 1])
+ {
+ case 'g':
+ $value_numeric *= 1024;
+ case 'm':
+ $value_numeric *= 1024;
+ case 'k':
+ $value_numeric *= 1024;
+ break;
+
+ default:
+ // It's not already in bytes (and thus numeric)
+ // and does not carry a unit.
+ return false;
+ }
+
+ return $value_numeric;
+ }
+}
diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php
index 7c94038cc9..20dcb74c0d 100644
--- a/phpBB/includes/search/fulltext_mysql.php
+++ b/phpBB/includes/search/fulltext_mysql.php
@@ -27,8 +27,6 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
var $split_words = array();
var $search_query;
var $common_words = array();
- var $pcre_properties = false;
- var $mbstring_regex = false;
public function __construct(&$error)
{
@@ -36,18 +34,6 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
$this->word_length = array('min' => $config['fulltext_mysql_min_word_len'], 'max' => $config['fulltext_mysql_max_word_len']);
- // PHP may not be linked with the bundled PCRE lib and instead with an older version
- if (phpbb_pcre_utf8_support())
- {
- $this->pcre_properties = true;
- }
-
- if (function_exists('mb_ereg'))
- {
- $this->mbstring_regex = true;
- mb_regex_encoding('UTF-8');
- }
-
$error = false;
}
@@ -70,7 +56,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
if ($db->sql_layer != 'mysql4' && $db->sql_layer != 'mysqli')
{
- return $user->lang['FULLTEXT_MYSQL_INCOMPATIBLE_VERSION'];
+ return $user->lang['FULLTEXT_MYSQL_INCOMPATIBLE_DATABASE'];
}
$result = $db->sql_query('SHOW TABLE STATUS LIKE \'' . POSTS_TABLE . '\'');
@@ -133,40 +119,10 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
$split_keywords = preg_replace("#[\n\r\t]+#", ' ', trim(htmlspecialchars_decode($keywords)));
// Split words
- if ($this->pcre_properties)
- {
- $split_keywords = preg_replace('#([^\p{L}\p{N}\'*"()])#u', '$1$1', str_replace('\'\'', '\' \'', trim($split_keywords)));
- }
- else if ($this->mbstring_regex)
- {
- $split_keywords = mb_ereg_replace('([^\w\'*"()])', '\\1\\1', str_replace('\'\'', '\' \'', trim($split_keywords)));
- }
- else
- {
- $split_keywords = preg_replace('#([^\w\'*"()])#u', '$1$1', str_replace('\'\'', '\' \'', trim($split_keywords)));
- }
-
- if ($this->pcre_properties)
- {
- $matches = array();
- preg_match_all('#(?:[^\p{L}\p{N}*"()]|^)([+\-|]?(?:[\p{L}\p{N}*"()]+\'?)*[\p{L}\p{N}*"()])(?:[^\p{L}\p{N}*"()]|$)#u', $split_keywords, $matches);
- $this->split_words = $matches[1];
- }
- else if ($this->mbstring_regex)
- {
- mb_ereg_search_init($split_keywords, '(?:[^\w*"()]|^)([+\-|]?(?:[\w*"()]+\'?)*[\w*"()])(?:[^\w*"()]|$)');
-
- while (($word = mb_ereg_search_regs()))
- {
- $this->split_words[] = $word[1];
- }
- }
- else
- {
- $matches = array();
- preg_match_all('#(?:[^\w*"()]|^)([+\-|]?(?:[\w*"()]+\'?)*[\w*"()])(?:[^\w*"()]|$)#u', $split_keywords, $matches);
- $this->split_words = $matches[1];
- }
+ $split_keywords = preg_replace('#([^\p{L}\p{N}\'*"()])#u', '$1$1', str_replace('\'\'', '\' \'', trim($split_keywords)));
+ $matches = array();
+ preg_match_all('#(?:[^\p{L}\p{N}*"()]|^)([+\-|]?(?:[\p{L}\p{N}*"()]+\'?)*[\p{L}\p{N}*"()])(?:[^\p{L}\p{N}*"()]|$)#u', $split_keywords, $matches);
+ $this->split_words = $matches[1];
// We limit the number of allowed keywords to minimize load on the database
if ($config['max_num_search_keywords'] && sizeof($this->split_words) > $config['max_num_search_keywords'])
@@ -271,41 +227,10 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
global $config;
// Split words
- if ($this->pcre_properties)
- {
- $text = preg_replace('#([^\p{L}\p{N}\'*])#u', '$1$1', str_replace('\'\'', '\' \'', trim($text)));
- }
- else if ($this->mbstring_regex)
- {
- $text = mb_ereg_replace('([^\w\'*])', '\\1\\1', str_replace('\'\'', '\' \'', trim($text)));
- }
- else
- {
- $text = preg_replace('#([^\w\'*])#u', '$1$1', str_replace('\'\'', '\' \'', trim($text)));
- }
-
- if ($this->pcre_properties)
- {
- $matches = array();
- preg_match_all('#(?:[^\p{L}\p{N}*]|^)([+\-|]?(?:[\p{L}\p{N}*]+\'?)*[\p{L}\p{N}*])(?:[^\p{L}\p{N}*]|$)#u', $text, $matches);
- $text = $matches[1];
- }
- else if ($this->mbstring_regex)
- {
- mb_ereg_search_init($text, '(?:[^\w*]|^)([+\-|]?(?:[\w*]+\'?)*[\w*])(?:[^\w*]|$)');
-
- $text = array();
- while (($word = mb_ereg_search_regs()))
- {
- $text[] = $word[1];
- }
- }
- else
- {
- $matches = array();
- preg_match_all('#(?:[^\w*]|^)([+\-|]?(?:[\w*]+\'?)*[\w*])(?:[^\w*]|$)#u', $text, $matches);
- $text = $matches[1];
- }
+ $text = preg_replace('#([^\p{L}\p{N}\'*])#u', '$1$1', str_replace('\'\'', '\' \'', trim($text)));
+ $matches = array();
+ preg_match_all('#(?:[^\p{L}\p{N}*]|^)([+\-|]?(?:[\p{L}\p{N}*]+\'?)*[\p{L}\p{N}*])(?:[^\p{L}\p{N}*]|$)#u', $text, $matches);
+ $text = $matches[1];
// remove too short or too long words
$text = array_values($text);
@@ -748,7 +673,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
{
if ($db->sql_layer == 'mysqli' || version_compare($db->sql_server_info(true), '4.1.3', '>='))
{
- //$alter[] = 'MODIFY post_subject varchar(100) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL';
+ $alter[] = 'MODIFY post_subject varchar(255) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL';
}
else
{
@@ -909,14 +834,6 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
$tpl = '
<dl>
- <dt><label>' . $user->lang['FULLTEXT_MYSQL_PCRE'] . '</label><br /><span>' . $user->lang['FULLTEXT_MYSQL_PCRE_EXPLAIN'] . '</span></dt>
- <dd>' . (($this->pcre_properties) ? $user->lang['YES'] : $user->lang['NO']) . ' (PHP ' . PHP_VERSION . ')</dd>
- </dl>
- <dl>
- <dt><label>' . $user->lang['FULLTEXT_MYSQL_MBSTRING'] . '</label><br /><span>' . $user->lang['FULLTEXT_MYSQL_MBSTRING_EXPLAIN'] . '</span></dt>
- <dd>' . (($this->mbstring_regex) ? $user->lang['YES'] : $user->lang['NO']). '</dd>
- </dl>
- <dl>
<dt><label>' . $user->lang['MIN_SEARCH_CHARS'] . ':</label><br /><span>' . $user->lang['FULLTEXT_MYSQL_MIN_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
<dd>' . $config['fulltext_mysql_min_word_len'] . '</dd>
</dl>
diff --git a/phpBB/includes/search/fulltext_postgres.php b/phpBB/includes/search/fulltext_postgres.php
new file mode 100644
index 0000000000..84ce674564
--- /dev/null
+++ b/phpBB/includes/search/fulltext_postgres.php
@@ -0,0 +1,856 @@
+<?php
+/**
+*
+* @package search
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* fulltext_postgres
+* Fulltext search for PostgreSQL
+* @package search
+*/
+class phpbb_search_fulltext_postgres extends phpbb_search_base
+{
+ private $stats = array();
+ private $split_words = array();
+ private $tsearch_usable = false;
+ private $version;
+ private $tsearch_query;
+ private $phrase_search = false;
+ public $search_query;
+ public $common_words = array();
+ public $word_length = array();
+
+ /**
+ * Constructor
+ * Creates a new phpbb_search_fulltext_postgres, which is used as a search backend.
+ *
+ * @param string|bool $error Any error that occurs is passed on through this reference variable otherwise false
+ */
+ public function __construct(&$error)
+ {
+ global $db, $config;
+
+ $this->word_length = array('min' => $config['fulltext_postgres_min_word_len'], 'max' => $config['fulltext_postgres_max_word_len']);
+
+
+ if ($db->sql_layer == 'postgres')
+ {
+ $pgsql_version = explode(',', substr($db->sql_server_info(), 10));
+ $this->version = trim($pgsql_version[0]);
+ if (version_compare($this->version, '8.3', '>='))
+ {
+ $this->tsearch_usable = true;
+ }
+ }
+
+ $error = false;
+ }
+
+ /**
+ * Returns the name of this search backend to be displayed to administrators
+ *
+ * @return string Name
+ *
+ * @access public
+ */
+ public function get_name()
+ {
+ return 'PostgreSQL Fulltext';
+ }
+
+ /**
+ * Returns if phrase search is supported or not
+ *
+ * @return bool
+ *
+ * @access public
+ */
+ public function supports_phrase_search()
+ {
+ return $this->phrase_search;
+ }
+
+ /**
+ * Checks for correct PostgreSQL version and stores min/max word length in the config
+ *
+ * @return string|bool Language key of the error/incompatiblity occured
+ *
+ * @access public
+ */
+ function init()
+ {
+ global $db, $user;
+
+ if ($db->sql_layer != 'postgres')
+ {
+ return $user->lang['FULLTEXT_POSTGRES_INCOMPATIBLE_DATABASE'];
+ }
+
+ if (!$this->tsearch_usable)
+ {
+ return $user->lang['FULLTEXT_POSTGRES_TS_NOT_USABLE'];
+ }
+
+ return false;
+ }
+
+ /**
+ * Splits keywords entered by a user into an array of words stored in $this->split_words
+ * Stores the tidied search query in $this->search_query
+ *
+ * @param string &$keywords Contains the keyword as entered by the user
+ * @param string $terms is either 'all' or 'any'
+ * @return bool false if no valid keywords were found and otherwise true
+ *
+ * @access public
+ */
+ function split_keywords(&$keywords, $terms)
+ {
+ global $config;
+
+ if ($terms == 'all')
+ {
+ $match = array('#\sand\s#iu', '#\sor\s#iu', '#\snot\s#iu', '#\+#', '#-#', '#\|#');
+ $replace = array(' +', ' |', ' -', ' +', ' -', ' |');
+
+ $keywords = preg_replace($match, $replace, $keywords);
+ }
+
+ // Filter out as above
+ $split_keywords = preg_replace("#[\"\n\r\t]+#", ' ', trim(htmlspecialchars_decode($keywords)));
+
+ // Split words
+ $split_keywords = preg_replace('#([^\p{L}\p{N}\'*"()])#u', '$1$1', str_replace('\'\'', '\' \'', trim($split_keywords)));
+ $matches = array();
+ preg_match_all('#(?:[^\p{L}\p{N}*"()]|^)([+\-|]?(?:[\p{L}\p{N}*"()]+\'?)*[\p{L}\p{N}*"()])(?:[^\p{L}\p{N}*"()]|$)#u', $split_keywords, $matches);
+ $this->split_words = $matches[1];
+
+ foreach ($this->split_words as $i => $word)
+ {
+ $clean_word = preg_replace('#^[+\-|"]#', '', $word);
+
+ // check word length
+ $clean_len = utf8_strlen(str_replace('*', '', $clean_word));
+ if (($clean_len < $config['fulltext_postgres_min_word_len']) || ($clean_len > $config['fulltext_postgres_max_word_len']))
+ {
+ $this->common_words[] = $word;
+ unset($this->split_words[$i]);
+ }
+ }
+
+ if ($terms == 'any')
+ {
+ $this->search_query = '';
+ $this->tsearch_query = '';
+ foreach ($this->split_words as $word)
+ {
+ if ((strpos($word, '+') === 0) || (strpos($word, '-') === 0) || (strpos($word, '|') === 0))
+ {
+ $word = substr($word, 1);
+ }
+ $this->search_query .= $word . ' ';
+ $this->tsearch_query .= '|' . $word . ' ';
+ }
+ }
+ else
+ {
+ $this->search_query = '';
+ $this->tsearch_query = '';
+ foreach ($this->split_words as $word)
+ {
+ if (strpos($word, '+') === 0)
+ {
+ $this->search_query .= $word . ' ';
+ $this->tsearch_query .= '&' . substr($word, 1) . ' ';
+ }
+ elseif (strpos($word, '-') === 0)
+ {
+ $this->search_query .= $word . ' ';
+ $this->tsearch_query .= '&!' . substr($word, 1) . ' ';
+ }
+ elseif (strpos($word, '|') === 0)
+ {
+ $this->search_query .= $word . ' ';
+ $this->tsearch_query .= '|' . substr($word, 1) . ' ';
+ }
+ else
+ {
+ $this->search_query .= '+' . $word . ' ';
+ $this->tsearch_query .= '&' . $word . ' ';
+ }
+ }
+ }
+
+ $this->tsearch_query = substr($this->tsearch_query, 1);
+ $this->search_query = utf8_htmlspecialchars($this->search_query);
+
+ if ($this->search_query)
+ {
+ $this->split_words = array_values($this->split_words);
+ sort($this->split_words);
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Turns text into an array of words
+ * @param string $text contains post text/subject
+ *
+ * @access public
+ */
+ function split_message($text)
+ {
+ global $config;
+
+ // Split words
+ $text = preg_replace('#([^\p{L}\p{N}\'*])#u', '$1$1', str_replace('\'\'', '\' \'', trim($text)));
+ $matches = array();
+ preg_match_all('#(?:[^\p{L}\p{N}*]|^)([+\-|]?(?:[\p{L}\p{N}*]+\'?)*[\p{L}\p{N}*])(?:[^\p{L}\p{N}*]|$)#u', $text, $matches);
+ $text = $matches[1];
+
+ // remove too short or too long words
+ $text = array_values($text);
+ for ($i = 0, $n = sizeof($text); $i < $n; $i++)
+ {
+ $text[$i] = trim($text[$i]);
+ if (utf8_strlen($text[$i]) < $config['fulltext_postgres_min_word_len'] || utf8_strlen($text[$i]) > $config['fulltext_postgres_max_word_len'])
+ {
+ unset($text[$i]);
+ }
+ }
+
+ return array_values($text);
+ }
+
+ /**
+ * Performs a search on keywords depending on display specific params. You have to run split_keywords() first.
+ *
+ * @param string $type contains either posts or topics depending on what should be searched for
+ * @param string $fields contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched)
+ * @param string $terms is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words)
+ * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query
+ * @param string $sort_key is the key of $sort_by_sql for the selected sorting
+ * @param string $sort_dir is either a or d representing ASC and DESC
+ * @param string $sort_days specifies the maximum amount of days a post may be old
+ * @param array $ex_fid_ary specifies an array of forum ids which should not be searched
+ * @param array $m_approve_fid_ary specifies an array of forum ids in which the searcher is allowed to view unapproved posts
+ * @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
+ * @param array $author_ary an array of author ids if the author should be ignored during the search the array is empty
+ * @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
+ * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
+ * @param int $start indicates the first index of the page
+ * @param int $per_page number of ids each page is supposed to contain
+ * @return boolean|int total number of results
+ *
+ * @access public
+ */
+ function keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page)
+ {
+ global $config, $db;
+
+ // No keywords? No posts.
+ if (!$this->search_query)
+ {
+ return false;
+ }
+
+ // generate a search_key from all the options to identify the results
+ $search_key = md5(implode('#', array(
+ implode(', ', $this->split_words),
+ $type,
+ $fields,
+ $terms,
+ $sort_days,
+ $sort_key,
+ $topic_id,
+ implode(',', $ex_fid_ary),
+ implode(',', $m_approve_fid_ary),
+ implode(',', $author_ary)
+ )));
+
+ // try reading the results from cache
+ $result_count = 0;
+ if ($this->obtain_ids($search_key, $result_count, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE)
+ {
+ return $result_count;
+ }
+
+ $id_ary = array();
+
+ $join_topic = ($type == 'posts') ? false : true;
+
+ // Build sql strings for sorting
+ $sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
+ $sql_sort_table = $sql_sort_join = '';
+
+ switch ($sql_sort[0])
+ {
+ case 'u':
+ $sql_sort_table = USERS_TABLE . ' u, ';
+ $sql_sort_join = ($type == 'posts') ? ' AND u.user_id = p.poster_id ' : ' AND u.user_id = t.topic_poster ';
+ break;
+
+ case 't':
+ $join_topic = true;
+ break;
+
+ case 'f':
+ $sql_sort_table = FORUMS_TABLE . ' f, ';
+ $sql_sort_join = ' AND f.forum_id = p.forum_id ';
+ break;
+ }
+
+ // Build some display specific sql strings
+ switch ($fields)
+ {
+ case 'titleonly':
+ $sql_match = 'p.post_subject';
+ $sql_match_where = ' AND p.post_id = t.topic_first_post_id';
+ $join_topic = true;
+ break;
+
+ case 'msgonly':
+ $sql_match = 'p.post_text';
+ $sql_match_where = '';
+ break;
+
+ case 'firstpost':
+ $sql_match = 'p.post_subject, p.post_text';
+ $sql_match_where = ' AND p.post_id = t.topic_first_post_id';
+ $join_topic = true;
+ break;
+
+ default:
+ $sql_match = 'p.post_subject, p.post_text';
+ $sql_match_where = '';
+ break;
+ }
+
+ if (!sizeof($m_approve_fid_ary))
+ {
+ $m_approve_fid_sql = ' AND p.post_approved = 1';
+ }
+ else if ($m_approve_fid_ary === array(-1))
+ {
+ $m_approve_fid_sql = '';
+ }
+ else
+ {
+ $m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
+ }
+
+ $sql_select = ($type == 'posts') ? 'p.post_id' : 'DISTINCT t.topic_id';
+ $sql_from = ($join_topic) ? TOPICS_TABLE . ' t, ' : '';
+ $field = ($type == 'posts') ? 'post_id' : 'topic_id';
+ $sql_author = (sizeof($author_ary) == 1) ? ' = ' . $author_ary[0] : 'IN (' . implode(', ', $author_ary) . ')';
+
+ if (sizeof($author_ary) && $author_name)
+ {
+ // first one matches post of registered users, second one guests and deleted users
+ $sql_author = '(' . $db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
+ }
+ else if (sizeof($author_ary))
+ {
+ $sql_author = ' AND ' . $db->sql_in_set('p.poster_id', $author_ary);
+ }
+ else
+ {
+ $sql_author = '';
+ }
+
+ $sql_where_options = $sql_sort_join;
+ $sql_where_options .= ($topic_id) ? ' AND p.topic_id = ' . $topic_id : '';
+ $sql_where_options .= ($join_topic) ? ' AND t.topic_id = p.topic_id' : '';
+ $sql_where_options .= (sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
+ $sql_where_options .= $m_approve_fid_sql;
+ $sql_where_options .= $sql_author;
+ $sql_where_options .= ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
+ $sql_where_options .= $sql_match_where;
+
+ $tmp_sql_match = array();
+ foreach (explode(',', $sql_match) as $sql_match_column)
+ {
+ $tmp_sql_match[] = "to_tsvector ('" . $db->sql_escape($config['fulltext_postgres_ts_name']) . "', " . $sql_match_column . ") @@ to_tsquery ('" . $db->sql_escape($config['fulltext_postgres_ts_name']) . "', '" . $db->sql_escape($this->tsearch_query) . "')";
+ }
+
+ $sql = "SELECT $sql_select
+ FROM $sql_from$sql_sort_table" . POSTS_TABLE . " p
+ WHERE (" . implode(' OR ', $tmp_sql_match) . ")
+ $sql_where_options
+ ORDER BY $sql_sort";
+ $result = $db->sql_query_limit($sql, $config['search_block_size'], $start);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $id_ary[] = $row[$field];
+ }
+ $db->sql_freeresult($result);
+
+ $id_ary = array_unique($id_ary);
+
+ if (!sizeof($id_ary))
+ {
+ return false;
+ }
+
+ // if the total result count is not cached yet, retrieve it from the db
+ if (!$result_count)
+ {
+ $result_count = sizeof ($id_ary);
+
+ if (!$result_count)
+ {
+ return false;
+ }
+ }
+
+ // store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page
+ $this->save_ids($search_key, implode(' ', $this->split_words), $author_ary, $result_count, $id_ary, $start, $sort_dir);
+ $id_ary = array_slice($id_ary, 0, (int) $per_page);
+
+ return $result_count;
+ }
+
+ /**
+ * Performs a search on an author's posts without caring about message contents. Depends on display specific params
+ *
+ * @param string $type contains either posts or topics depending on what should be searched for
+ * @param boolean $firstpost_only if true, only topic starting posts will be considered
+ * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query
+ * @param string $sort_key is the key of $sort_by_sql for the selected sorting
+ * @param string $sort_dir is either a or d representing ASC and DESC
+ * @param string $sort_days specifies the maximum amount of days a post may be old
+ * @param array $ex_fid_ary specifies an array of forum ids which should not be searched
+ * @param array $m_approve_fid_ary specifies an array of forum ids in which the searcher is allowed to view unapproved posts
+ * @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
+ * @param array $author_ary an array of author ids
+ * @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
+ * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
+ * @param int $start indicates the first index of the page
+ * @param int $per_page number of ids each page is supposed to contain
+ * @return boolean|int total number of results
+ *
+ * @access public
+ */
+ function author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page)
+ {
+ global $config, $db;
+
+ // No author? No posts.
+ if (!sizeof($author_ary))
+ {
+ return 0;
+ }
+
+ // generate a search_key from all the options to identify the results
+ $search_key = md5(implode('#', array(
+ '',
+ $type,
+ ($firstpost_only) ? 'firstpost' : '',
+ '',
+ '',
+ $sort_days,
+ $sort_key,
+ $topic_id,
+ implode(',', $ex_fid_ary),
+ implode(',', $m_approve_fid_ary),
+ implode(',', $author_ary),
+ $author_name,
+ )));
+
+ // try reading the results from cache
+ $result_count = 0;
+ if ($this->obtain_ids($search_key, $result_count, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE)
+ {
+ return $result_count;
+ }
+
+ $id_ary = array();
+
+ // Create some display specific sql strings
+ if ($author_name)
+ {
+ // first one matches post of registered users, second one guests and deleted users
+ $sql_author = '(' . $db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
+ }
+ else
+ {
+ $sql_author = $db->sql_in_set('p.poster_id', $author_ary);
+ }
+ $sql_fora = (sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
+ $sql_topic_id = ($topic_id) ? ' AND p.topic_id = ' . (int) $topic_id : '';
+ $sql_time = ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
+ $sql_firstpost = ($firstpost_only) ? ' AND p.post_id = t.topic_first_post_id' : '';
+
+ // Build sql strings for sorting
+ $sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
+ $sql_sort_table = $sql_sort_join = '';
+ switch ($sql_sort[0])
+ {
+ case 'u':
+ $sql_sort_table = USERS_TABLE . ' u, ';
+ $sql_sort_join = ($type == 'posts') ? ' AND u.user_id = p.poster_id ' : ' AND u.user_id = t.topic_poster ';
+ break;
+
+ case 't':
+ $sql_sort_table = ($type == 'posts' && !$firstpost_only) ? TOPICS_TABLE . ' t, ' : '';
+ $sql_sort_join = ($type == 'posts' && !$firstpost_only) ? ' AND t.topic_id = p.topic_id ' : '';
+ break;
+
+ case 'f':
+ $sql_sort_table = FORUMS_TABLE . ' f, ';
+ $sql_sort_join = ' AND f.forum_id = p.forum_id ';
+ break;
+ }
+
+ if (!sizeof($m_approve_fid_ary))
+ {
+ $m_approve_fid_sql = ' AND p.post_approved = 1';
+ }
+ else if ($m_approve_fid_ary == array(-1))
+ {
+ $m_approve_fid_sql = '';
+ }
+ else
+ {
+ $m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
+ }
+
+ // Build the query for really selecting the post_ids
+ if ($type == 'posts')
+ {
+ $sql = "SELECT p.post_id
+ FROM " . $sql_sort_table . POSTS_TABLE . ' p' . (($firstpost_only) ? ', ' . TOPICS_TABLE . ' t ' : ' ') . "
+ WHERE $sql_author
+ $sql_topic_id
+ $sql_firstpost
+ $m_approve_fid_sql
+ $sql_fora
+ $sql_sort_join
+ $sql_time
+ ORDER BY $sql_sort";
+ $field = 'post_id';
+ }
+ else
+ {
+ $sql = "SELECT t.topic_id
+ FROM " . $sql_sort_table . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
+ WHERE $sql_author
+ $sql_topic_id
+ $sql_firstpost
+ $m_approve_fid_sql
+ $sql_fora
+ AND t.topic_id = p.topic_id
+ $sql_sort_join
+ $sql_time
+ GROUP BY t.topic_id, $sort_by_sql[$sort_key]
+ ORDER BY $sql_sort";
+ $field = 'topic_id';
+ }
+
+ // Only read one block of posts from the db and then cache it
+ $result = $db->sql_query_limit($sql, $config['search_block_size'], $start);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $id_ary[] = $row[$field];
+ }
+ $db->sql_freeresult($result);
+
+ // retrieve the total result count if needed
+ if (!$result_count)
+ {
+ $result_count = sizeof ($id_ary);
+
+ if (!$result_count)
+ {
+ return false;
+ }
+ }
+
+ if (sizeof($id_ary))
+ {
+ $this->save_ids($search_key, '', $author_ary, $result_count, $id_ary, $start, $sort_dir);
+ $id_ary = array_slice($id_ary, 0, $per_page);
+
+ return $result_count;
+ }
+ return false;
+ }
+
+ /**
+ * Destroys cached search results, that contained one of the new words in a post so the results won't be outdated.
+ *
+ * @param string $mode contains the post mode: edit, post, reply, quote ...
+ * @param int $post_id contains the post id of the post to index
+ * @param string $message contains the post text of the post
+ * @param string $subject contains the subject of the post to index
+ * @param int $poster_id contains the user id of the poster
+ * @param int $forum_id contains the forum id of parent forum of the post
+ *
+ * @access public
+ */
+ function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id)
+ {
+ global $db;
+
+ // Split old and new post/subject to obtain array of words
+ $split_text = $this->split_message($message);
+ $split_title = ($subject) ? $this->split_message($subject) : array();
+
+ $words = array_unique(array_merge($split_text, $split_title));
+
+ unset($split_text);
+ unset($split_title);
+
+ // destroy cached search results containing any of the words removed or added
+ $this->destroy_cache($words, array($poster_id));
+
+ unset($words);
+ }
+
+ /**
+ * Destroy cached results, that might be outdated after deleting a post
+ *
+ * @access public
+ */
+ function index_remove($post_ids, $author_ids, $forum_ids)
+ {
+ $this->destroy_cache(array(), $author_ids);
+ }
+
+ /**
+ * Destroy old cache entries
+ *
+ * @access public
+ */
+ function tidy()
+ {
+ global $db, $config;
+
+ // destroy too old cached search results
+ $this->destroy_cache(array());
+
+ set_config('search_last_gc', time(), true);
+ }
+
+ /**
+ * Create fulltext index
+ *
+ * @return string|bool error string is returned incase of errors otherwise false
+ *
+ * @access public
+ */
+ function create_index($acp_module, $u_action)
+ {
+ global $db, $config;
+
+ // Make sure we can actually use PostgreSQL with fulltext indexes
+ if ($error = $this->init())
+ {
+ return $error;
+ }
+
+ if (empty($this->stats))
+ {
+ $this->get_stats();
+ }
+
+ if (!isset($this->stats['post_subject']))
+ {
+ $db->sql_query("CREATE INDEX " . POSTS_TABLE . "_" . $config['fulltext_postgres_ts_name'] . "_post_subject ON " . POSTS_TABLE . " USING gin (to_tsvector ('" . $db->sql_escape($config['fulltext_postgres_ts_name']) . "', post_subject))");
+ }
+
+ if (!isset($this->stats['post_text']))
+ {
+ $db->sql_query("CREATE INDEX " . POSTS_TABLE . "_" . $config['fulltext_postgres_ts_name'] . "_post_text ON " . POSTS_TABLE . " USING gin (to_tsvector ('" . $db->sql_escape($config['fulltext_postgres_ts_name']) . "', post_text))");
+ }
+
+ $db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE);
+
+ return false;
+ }
+
+ /**
+ * Drop fulltext index
+ *
+ * @return string|bool error string is returned incase of errors otherwise false
+ *
+ * @access public
+ */
+ function delete_index($acp_module, $u_action)
+ {
+ global $db;
+
+ // Make sure we can actually use PostgreSQL with fulltext indexes
+ if ($error = $this->init())
+ {
+ return $error;
+ }
+
+ if (empty($this->stats))
+ {
+ $this->get_stats();
+ }
+
+ if (isset($this->stats['post_subject']))
+ {
+ $db->sql_query('DROP INDEX ' . $this->stats['post_subject']['relname']);
+ }
+
+ if (isset($this->stats['post_text']))
+ {
+ $db->sql_query('DROP INDEX ' . $this->stats['post_text']['relname']);
+ }
+
+ $db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE);
+
+ return false;
+ }
+
+ /**
+ * Returns true if both FULLTEXT indexes exist
+ *
+ * @access public
+ */
+ function index_created()
+ {
+ if (empty($this->stats))
+ {
+ $this->get_stats();
+ }
+
+ return (isset($this->stats['post_text']) && isset($this->stats['post_subject'])) ? true : false;
+ }
+
+ /**
+ * Returns an associative array containing information about the indexes
+ *
+ * @access public
+ */
+ function index_stats()
+ {
+ global $user;
+
+ if (empty($this->stats))
+ {
+ $this->get_stats();
+ }
+
+ return array(
+ $user->lang['FULLTEXT_POSTGRES_TOTAL_POSTS'] => ($this->index_created()) ? $this->stats['total_posts'] : 0,
+ );
+ }
+
+ /**
+ * Computes the stats and store them in the $this->stats associative array
+ *
+ * @access private
+ */
+ function get_stats()
+ {
+ global $db, $config;
+
+ if ($db->sql_layer != 'postgres')
+ {
+ $this->stats = array();
+ return;
+ }
+
+ $sql = "SELECT c2.relname, pg_catalog.pg_get_indexdef(i.indexrelid, 0, true) AS indexdef
+ FROM pg_catalog.pg_class c1, pg_catalog.pg_index i, pg_catalog.pg_class c2
+ WHERE c1.relname = '" . POSTS_TABLE . "'
+ AND pg_catalog.pg_table_is_visible(c1.oid)
+ AND c1.oid = i.indrelid
+ AND i.indexrelid = c2.oid";
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ // deal with older PostgreSQL versions which didn't use Index_type
+ if (strpos($row['indexdef'], 'to_tsvector') !== false)
+ {
+ if ($row['relname'] == POSTS_TABLE . '_' . $config['fulltext_postgres_ts_name'] . '_post_text' || $row['relname'] == POSTS_TABLE . '_post_text')
+ {
+ $this->stats['post_text'] = $row;
+ }
+ else if ($row['relname'] == POSTS_TABLE . '_' . $config['fulltext_postgres_ts_name'] . '_post_subject' || $row['relname'] == POSTS_TABLE . '_post_subject')
+ {
+ $this->stats['post_subject'] = $row;
+ }
+ }
+ }
+ $db->sql_freeresult($result);
+
+ $this->stats['total_posts'] = $config['num_posts'];
+ }
+
+ /**
+ * Display various options that can be configured for the backend from the acp
+ *
+ * @return associative array containing template and config variables
+ *
+ * @access public
+ */
+ function acp()
+ {
+ global $user, $config, $db;
+
+ $tpl = '
+ <dl>
+ <dt><label>' . $user->lang['FULLTEXT_POSTGRES_VERSION_CHECK'] . '</label><br /><span>' . $user->lang['FULLTEXT_POSTGRES_VERSION_CHECK_EXPLAIN'] . '</span></dt>
+ <dd>' . (($this->tsearch_usable) ? $user->lang['YES'] : $user->lang['NO']) . ' (PostgreSQL ' . $this->version . ')</dd>
+ </dl>
+ <dl>
+ <dt><label>' . $user->lang['FULLTEXT_POSTGRES_TS_NAME'] . '</label><br /><span>' . $user->lang['FULLTEXT_POSTGRES_TS_NAME_EXPLAIN'] . '</span></dt>
+ <dd><select name="config[fulltext_postgres_ts_name]">';
+
+ if ($db->sql_layer == 'postgres' && $this->tsearch_usable)
+ {
+ $sql = 'SELECT cfgname AS ts_name
+ FROM pg_ts_config';
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $tpl .= '<option value="' . $row['ts_name'] . '"' . ($row['ts_name'] === $config['fulltext_postgres_ts_name'] ? ' selected="selected"' : '') . '>' . $row['ts_name'] . '</option>';
+ }
+ $db->sql_freeresult($result);
+ }
+ else
+ {
+ $tpl .= '<option value="' . $config['fulltext_postgres_ts_name'] . '" selected="selected">' . $config['fulltext_postgres_ts_name'] . '</option>';
+ }
+
+ $tpl .= '</select></dd>
+ </dl>
+ <dl>
+ <dt><label for="fulltext_postgres_min_word_len">' . $user->lang['FULLTEXT_POSTGRES_MIN_WORD_LEN'] . ':</label><br /><span>' . $user->lang['FULLTEXT_POSTGRES_MIN_WORD_LEN_EXPLAIN'] . '</span></dt>
+ <dd><input id="fulltext_postgres_min_word_len" type="text" size="3" maxlength="3" name="config[fulltext_postgres_min_word_len]" value="' . (int) $config['fulltext_postgres_min_word_len'] . '" /></dd>
+ </dl>
+ <dl>
+ <dt><label for="fulltext_postgres_max_word_len">' . $user->lang['FULLTEXT_POSTGRES_MAX_WORD_LEN'] . ':</label><br /><span>' . $user->lang['FULLTEXT_POSTGRES_MAX_WORD_LEN_EXPLAIN'] . '</span></dt>
+ <dd><input id="fulltext_postgres_max_word_len" type="text" size="3" maxlength="3" name="config[fulltext_postgres_max_word_len]" value="' . (int) $config['fulltext_postgres_max_word_len'] . '" /></dd>
+ </dl>
+ ';
+
+ // These are fields required in the config table
+ return array(
+ 'tpl' => $tpl,
+ 'config' => array('fulltext_postgres_ts_name' => 'string', 'fulltext_postgres_min_word_len' => 'integer:0:255', 'fulltext_postgres_max_word_len' => 'integer:0:255')
+ );
+ }
+}
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index bcdff54457..257ffb07f6 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -342,8 +342,16 @@ class phpbb_session
}
}
- // Is session_id is set or session_id is set and matches the url param if required
- if (!empty($this->session_id) && (!defined('NEED_SID') || (isset($_GET['sid']) && $this->session_id === request_var('sid', ''))))
+ // if no session id is set, redirect to index.php
+ $session_id = $request->variable('sid', '');
+ if (defined('NEED_SID') && (empty($session_id) || $this->session_id !== $session_id))
+ {
+ send_status_line(401, 'Not authorized');
+ redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
+ }
+
+ // if session id is set
+ if (!empty($this->session_id))
{
$sql = 'SELECT u.*, s.*
FROM ' . SESSIONS_TABLE . ' s, ' . USERS_TABLE . " u
diff --git a/phpBB/includes/startup.php b/phpBB/includes/startup.php
index f75d70e366..441eaec6b1 100644
--- a/phpBB/includes/startup.php
+++ b/phpBB/includes/startup.php
@@ -150,7 +150,7 @@ if (function_exists('date_default_timezone_set') && function_exists('date_defaul
// Autoloading of dependencies.
// Three options are supported:
// 1. If dependencies are installed with Composer, Composer will create a
-// vendor/.composer/autoload.php. If this file exists it will be
+// vendor/autoload.php. If this file exists it will be
// automatically used by phpBB. This is the default mode that phpBB
// will use when shipped.
// 2. To disable composer autoloading, PHPBB_NO_COMPOSER_AUTOLOAD can be specified.
@@ -171,11 +171,11 @@ if (getenv('PHPBB_NO_COMPOSER_AUTOLOAD'))
}
else
{
- if (!file_exists($phpbb_root_path . 'vendor/.composer/autoload.php'))
+ if (!file_exists($phpbb_root_path . 'vendor/autoload.php'))
{
trigger_error('You have not set up composer dependencies. See http://getcomposer.org/.', E_USER_ERROR);
}
- require($phpbb_root_path . 'vendor/.composer/autoload.php');
+ require($phpbb_root_path . 'vendor/autoload.php');
}
$starttime = explode(' ', microtime());
diff --git a/phpBB/includes/style/style.php b/phpBB/includes/style/style.php
index 3f470015f6..22e0f1d67a 100644
--- a/phpBB/includes/style/style.php
+++ b/phpBB/includes/style/style.php
@@ -89,9 +89,9 @@ class phpbb_style
*/
public function set_style()
{
- $style_name = $this->user->theme['style_path'];
- $style_dirs = ($this->user->theme['style_parent_id']) ? array_reverse(explode('/', $this->user->theme['style_parent_tree'])) : array();
- $paths = array($this->get_style_path($style_name));
+ $style_path = $this->user->style['style_path'];
+ $style_dirs = ($this->user->style['style_parent_id']) ? array_reverse(explode('/', $this->user->style['style_parent_tree'])) : array();
+ $paths = array($this->get_style_path($style_path));
foreach ($style_dirs as $dir)
{
$paths[] = $this->get_style_path($dir);
@@ -100,7 +100,7 @@ class phpbb_style
// Add 'all' path, used as last fallback path by hooks and extensions
$paths[] = $this->get_style_path('all');
- return $this->set_custom_style($style_name, $paths);
+ return $this->set_custom_style($style_path, $paths);
}
/**
diff --git a/phpBB/includes/template/filter.php b/phpBB/includes/template/filter.php
index 4a2593b757..ad2e35de6a 100644
--- a/phpBB/includes/template/filter.php
+++ b/phpBB/includes/template/filter.php
@@ -905,12 +905,12 @@ class phpbb_template_filter extends php_user_filter
if (substr($filename, 0, strlen($this->phpbb_root_path)) != $this->phpbb_root_path)
{
// Absolute path, include as is
- return ' $_template->_js_include(\'' . addslashes($filename) . '\', false); ';
+ return ' $_template->_js_include(\'' . addslashes($filename) . '\', false, false); ';
}
// Relative path, remove root path from it
$filename = substr($filename, strlen($this->phpbb_root_path));
- return ' global $phpbb_root_path; $_template->_js_include($phpbb_root_path . \'' . addslashes($filename) . '\', false); ';
+ return ' $_template->_js_include(\'' . addslashes($filename) . '\', false, true); ';
}
/**
diff --git a/phpBB/includes/template/template.php b/phpBB/includes/template/template.php
index e6512c8417..8ab3c44be3 100644
--- a/phpBB/includes/template/template.php
+++ b/phpBB/includes/template/template.php
@@ -496,14 +496,19 @@ class phpbb_template
*
* @param string $file file name
* @param bool $locate True if file needs to be located
+ * @param bool $relative True if path is relative to phpBB root directory. Ignored if $locate == true
*/
- public function _js_include($file, $locate = false)
+ public function _js_include($file, $locate = false, $relative = false)
{
// Locate file
if ($locate)
{
$file = $this->locator->get_first_file_location(array($file), true, true);
}
+ else if ($relative)
+ {
+ $file = $this->phpbb_root_path . $file;
+ }
$file .= (strpos($file, '?') === false) ? '?' : '&';
$file .= 'assets_version=' . $this->config['assets_version'];
diff --git a/phpBB/includes/ucp/info/ucp_profile.php b/phpBB/includes/ucp/info/ucp_profile.php
index 09c0318de9..968538a178 100644
--- a/phpBB/includes/ucp/info/ucp_profile.php
+++ b/phpBB/includes/ucp/info/ucp_profile.php
@@ -23,6 +23,7 @@ class ucp_profile_info
'signature' => array('title' => 'UCP_PROFILE_SIGNATURE', 'auth' => '', 'cat' => array('UCP_PROFILE')),
'avatar' => array('title' => 'UCP_PROFILE_AVATAR', 'auth' => 'cfg_allow_avatar && (cfg_allow_avatar_local || cfg_allow_avatar_remote || cfg_allow_avatar_upload || cfg_allow_avatar_remote_upload)', 'cat' => array('UCP_PROFILE')),
'reg_details' => array('title' => 'UCP_PROFILE_REG_DETAILS', 'auth' => '', 'cat' => array('UCP_PROFILE')),
+ 'autologin_keys'=> array('title' => 'UCP_PROFILE_AUTOLOGIN_KEYS', 'auth' => '', 'cat' => array('UCP_PROFILE')),
),
);
}
diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php
index bde5d1dfcf..bf7334b307 100644
--- a/phpBB/includes/ucp/ucp_pm_options.php
+++ b/phpBB/includes/ucp/ucp_pm_options.php
@@ -327,10 +327,23 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
trigger_error('RULE_ALREADY_DEFINED');
}
+ // Prevent users from flooding the rules table
+ $sql = 'SELECT COUNT(rule_id) AS num_rules
+ FROM ' . PRIVMSGS_RULES_TABLE . '
+ WHERE user_id = ' . (int) $user->data['user_id'];
+ $result = $db->sql_query($sql);
+ $num_rules = (int) $db->sql_fetchfield('num_rules');
+ $db->sql_freeresult($result);
+
+ if ($num_rules >= 5000)
+ {
+ trigger_error('RULE_LIMIT_REACHED');
+ }
+
$sql = 'INSERT INTO ' . PRIVMSGS_RULES_TABLE . ' ' . $db->sql_build_array('INSERT', $rule_ary);
$db->sql_query($sql);
- // Update users message rules
+ // Set the user_message_rules bit
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_message_rules = 1
WHERE user_id = ' . $user->data['user_id'];
@@ -377,7 +390,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- // Update users message rules
+ // Unset the user_message_rules bit
if (!$row)
{
$sql = 'UPDATE ' . USERS_TABLE . '
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 9d81503f0a..2ac82fb52f 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -618,6 +618,60 @@ class ucp_profile
}
break;
+
+ case 'autologin_keys':
+
+ add_form_key('ucp_autologin_keys');
+
+ if ($submit)
+ {
+ $keys = request_var('keys', array(''));
+
+ if (!check_form_key('ucp_autologin_keys'))
+ {
+ $error[] = 'FORM_INVALID';
+ }
+
+ if (!sizeof($error))
+ {
+ if (!empty($keys))
+ {
+ $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '
+ WHERE user_id = ' . (int) $user->data['user_id'] . '
+ AND ' . $db->sql_in_set('key_id', $keys) ;
+
+ $db->sql_query($sql);
+
+ meta_refresh(3, $this->u_action);
+ $message = $user->lang['AUTOLOGIN_SESSION_KEYS_DELETED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
+ trigger_error($message);
+ }
+ }
+
+ // Replace "error" strings with their real, localised form
+ $error = array_map(array($user, 'lang'), $error);
+ }
+
+ $sql = 'SELECT key_id, last_ip, last_login
+ FROM ' . SESSIONS_KEYS_TABLE . '
+ WHERE user_id = ' . (int) $user->data['user_id'];
+
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $template->assign_block_vars('sessions', array(
+ 'errors' => $error,
+
+ 'KEY' => $row['key_id'],
+ 'IP' => $row['last_ip'],
+ 'LOGIN_TIME' => $user->format_date($row['last_login']),
+ ));
+ }
+
+ $db->sql_freeresult($result);
+
+ break;
}
$template->assign_vars(array(
diff --git a/phpBB/includes/user.php b/phpBB/includes/user.php
index ce9c804f23..cf9e6b9994 100644
--- a/phpBB/includes/user.php
+++ b/phpBB/includes/user.php
@@ -27,7 +27,7 @@ class phpbb_user extends phpbb_session
{
var $lang = array();
var $help = array();
- var $theme = array();
+ var $style = array();
var $date_format;
var $timezone;
var $dst;
@@ -159,11 +159,11 @@ class phpbb_user extends phpbb_session
FROM ' . STYLES_TABLE . " s
WHERE s.style_id = $style_id";
$result = $db->sql_query($sql, 3600);
- $this->theme = $db->sql_fetchrow($result);
+ $this->style = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// User has wrong style
- if (!$this->theme && $style_id == $this->data['user_style'])
+ if (!$this->style && $style_id == $this->data['user_style'])
{
$style_id = $this->data['user_style'] = $config['default_style'];
@@ -176,20 +176,17 @@ class phpbb_user extends phpbb_session
FROM ' . STYLES_TABLE . " s
WHERE s.style_id = $style_id";
$result = $db->sql_query($sql, 3600);
- $this->theme = $db->sql_fetchrow($result);
+ $this->style = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
}
- if (!$this->theme)
+ if (!$this->style)
{
trigger_error('Could not get style data', E_USER_ERROR);
}
// Now parse the cfg file and cache it
- $parsed_items = $cache->obtain_cfg_items($this->theme);
-
- // We are only interested in the theme configuration for now
- $parsed_items = $parsed_items['theme'];
+ $parsed_items = $cache->obtain_cfg_items($this->style);
$check_for = array(
'pagination_sep' => (string) ', '
@@ -197,12 +194,12 @@ class phpbb_user extends phpbb_session
foreach ($check_for as $key => $default_value)
{
- $this->theme[$key] = (isset($parsed_items[$key])) ? $parsed_items[$key] : $default_value;
- settype($this->theme[$key], gettype($default_value));
+ $this->style[$key] = (isset($parsed_items[$key])) ? $parsed_items[$key] : $default_value;
+ settype($this->style[$key], gettype($default_value));
if (is_string($default_value))
{
- $this->theme[$key] = htmlspecialchars($this->theme[$key]);
+ $this->style[$key] = htmlspecialchars($this->style[$key]);
}
}
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 665db1f2f0..594397c815 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -1027,7 +1027,7 @@ function database_update_info()
// this column was removed from the database updater
// after 3.0.9-RC3 was released. It might still exist
// in 3.0.9-RCX installations and has to be dropped in
- // 3.0.11 after the db_tools class is capable of properly
+ // 3.0.12 after the db_tools class is capable of properly
// removing a primary key.
// 'attempt_id' => array('UINT', NULL, 'auto_increment'),
'attempt_ip' => array('VCHAR:40', ''),
@@ -1072,7 +1072,7 @@ function database_update_info()
// No changes from 3.0.10 to 3.0.11-RC1
'3.0.10' => array(),
- /** @todo DROP LOGIN_ATTEMPT_TABLE.attempt_id in 3.0.11-RC1 */
+ /** @todo DROP LOGIN_ATTEMPT_TABLE.attempt_id in 3.0.12-RC1 */
// Changes from 3.1.0-dev to 3.1.0-A1
'3.1.0-dev' => array(
@@ -2164,6 +2164,44 @@ function change_database_data(&$no_updates, $version)
_sql($sql, $errored, $error_ary);
}
+ // Delete orphan private messages
+ $batch_size = 500;
+
+ $sql_array = array(
+ 'SELECT' => 'p.msg_id',
+ 'FROM' => array(
+ PRIVMSGS_TABLE => 'p',
+ ),
+ 'LEFT_JOIN' => array(
+ array(
+ 'FROM' => array(PRIVMSGS_TO_TABLE => 't'),
+ 'ON' => 'p.msg_id = t.msg_id',
+ ),
+ ),
+ 'WHERE' => 't.user_id IS NULL',
+ );
+ $sql = $db->sql_build_query('SELECT', $sql_array);
+
+ do
+ {
+ $result = $db->sql_query_limit($sql, $batch_size);
+
+ $delete_pms = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $delete_pms[] = (int) $row['msg_id'];
+ }
+ $db->sql_freeresult($result);
+
+ if (!empty($delete_pms))
+ {
+ $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
+ WHERE ' . $db->sql_in_set('msg_id', $delete_pms);
+ _sql($sql, $errored, $error_ary);
+ }
+ }
+ while (sizeof($delete_pms) == $batch_size);
+
$no_updates = false;
break;
@@ -2207,6 +2245,21 @@ function change_database_data(&$no_updates, $version)
set_config('search_type', 'phpbb_search_' . $config['search_type']);
}
+ if (!isset($config['fulltext_postgres_ts_name']))
+ {
+ set_config('fulltext_postgres_ts_name', 'simple');
+ }
+
+ if (!isset($config['fulltext_postgres_min_word_len']))
+ {
+ set_config('fulltext_postgres_min_word_len', 4);
+ }
+
+ if (!isset($config['fulltext_postgres_max_word_len']))
+ {
+ set_config('fulltext_postgres_max_word_len', 254);
+ }
+
if (!isset($config['load_jquery_cdn']))
{
set_config('load_jquery_cdn', 0);
@@ -2305,6 +2358,13 @@ function change_database_data(&$no_updates, $version)
'auth' => 'acl_a_styles',
'cat' => 'ACP_STYLE_MANAGEMENT',
),
+ 'autologin_keys' => array(
+ 'base' => 'ucp_profile',
+ 'class' => 'ucp',
+ 'title' => 'UCP_PROFILE_AUTOLOGIN_KEYS',
+ 'auth' => '',
+ 'cat' => 'UCP_PROFILE',
+ ),
);
_add_modules($modules_to_install);
@@ -2534,6 +2594,12 @@ function change_database_data(&$no_updates, $version)
}
}
+ // Create config value for displaying last subject on forum list
+ if (!isset($config['display_last_subject']))
+ {
+ $config->set('display_last_subject', '1');
+ }
+
$no_updates = false;
if (!isset($config['assets_version']))
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index 3b963e75c0..bbd11f9a6f 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -52,11 +52,13 @@ class install_install extends module
function main($mode, $sub)
{
- global $lang, $template, $language, $phpbb_root_path;
+ global $lang, $template, $language, $phpbb_root_path, $cache;
switch ($sub)
{
case 'intro':
+ $cache->purge();
+
$this->page_title = $lang['SUB_INTRO'];
$template->assign_vars(array(
@@ -1176,7 +1178,7 @@ class install_install extends module
$sql_query = preg_replace('#phpbb_#i', $data['table_prefix'], $sql_query);
- $sql_query = remove_comments($sql_query);
+ $sql_query = phpbb_remove_comments($sql_query);
$sql_query = split_sql_file($sql_query, $delimiter);
@@ -1214,7 +1216,7 @@ class install_install extends module
// Change language strings...
$sql_query = preg_replace_callback('#\{L_([A-Z0-9\-_]*)\}#s', 'adjust_language_keys_callback', $sql_query);
- $sql_query = remove_comments($sql_query);
+ $sql_query = phpbb_remove_comments($sql_query);
$sql_query = split_sql_file($sql_query, ';');
foreach ($sql_query as $sql)
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index 2ea5eca768..deefdafbc4 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -88,6 +88,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('dbms_version', '')
INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_dateformat', 'D M d, Y g:i a');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_style', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_last_edited', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_last_subject', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_order', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('edit_time', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('delete_time', '0');
@@ -124,6 +125,9 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_co
INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_load_upd', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_max_chars', '14');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_min_chars', '3');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_postgres_max_word_len', '254');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_postgres_min_word_len', '4');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_postgres_ts_name', 'simple');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('gzip_compress', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('hot_threshold', '25');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('icons_path', 'images/icons');
diff --git a/phpBB/language/en/acp/attachments.php b/phpBB/language/en/acp/attachments.php
index e43bd1d3b0..c7d68d29c2 100644
--- a/phpBB/language/en/acp/attachments.php
+++ b/phpBB/language/en/acp/attachments.php
@@ -56,7 +56,7 @@ $lang = array_merge($lang, array(
'ATTACH_EXT_GROUPS_URL' => 'Extension groups',
'ATTACH_ID' => 'ID',
'ATTACH_MAX_FILESIZE' => 'Maximum file size',
- 'ATTACH_MAX_FILESIZE_EXPLAIN' => 'Maximum size of each file, with 0 being unlimited.',
+ 'ATTACH_MAX_FILESIZE_EXPLAIN' => 'Maximum size of each file. If this value is 0, the uploadable filesize is only limited by your PHP configuration.',
'ATTACH_MAX_PM_FILESIZE' => 'Maximum file size messaging',
'ATTACH_MAX_PM_FILESIZE_EXPLAIN' => 'Maximum size of each file, with 0 being unlimited, attached to a private message.',
'ATTACH_ORPHAN_URL' => 'Orphan attachments',
diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php
index 7e3c227893..384bce75bf 100644
--- a/phpBB/language/en/acp/board.php
+++ b/phpBB/language/en/acp/board.php
@@ -44,6 +44,8 @@ $lang = array_merge($lang, array(
'DEFAULT_STYLE' => 'Default style',
'DISABLE_BOARD' => 'Disable board',
'DISABLE_BOARD_EXPLAIN' => 'This will make the board unavailable to users. You can also enter a short (255 character) message to display if you wish.',
+ 'DISPLAY_LAST_SUBJECT' => 'Display subject of last added post on forum list',
+ 'DISPLAY_LAST_SUBJECT_EXPLAIN' => 'The subject of the last added post will be displayed in the forum list with a hyperlink to the post. Subjects from password protected forums and forums in which user doesn’t have read access are not shown.',
'OVERRIDE_STYLE' => 'Override user style',
'OVERRIDE_STYLE_EXPLAIN' => 'Replaces user’s style with the default.',
'SITE_DESC' => 'Site description',
@@ -107,7 +109,7 @@ $lang = array_merge($lang, array(
'MAX_AVATAR_SIZE' => 'Maximum avatar dimensions',
'MAX_AVATAR_SIZE_EXPLAIN' => 'Width x Height in pixels.',
'MAX_FILESIZE' => 'Maximum avatar file size',
- 'MAX_FILESIZE_EXPLAIN' => 'For uploaded avatar files.',
+ 'MAX_FILESIZE_EXPLAIN' => 'For uploaded avatar files. If this value is 0, the uploaded filesize is only limited by your PHP configuration.',
'MIN_AVATAR_SIZE' => 'Minimum avatar dimensions',
'MIN_AVATAR_SIZE_EXPLAIN' => 'Width x Height in pixels.',
));
diff --git a/phpBB/language/en/acp/search.php b/phpBB/language/en/acp/search.php
index 3dc89570bf..cd319c66a9 100644
--- a/phpBB/language/en/acp/search.php
+++ b/phpBB/language/en/acp/search.php
@@ -51,16 +51,24 @@ $lang = array_merge($lang, array(
'DELETING_INDEX_IN_PROGRESS' => 'Deleting the index in progress',
'DELETING_INDEX_IN_PROGRESS_EXPLAIN' => 'The search backend is currently cleaning its index. This can take a few minutes.',
- 'FULLTEXT_MYSQL_INCOMPATIBLE_VERSION' => 'The MySQL fulltext backend can only be used with MySQL4 and above.',
+ 'FULLTEXT_MYSQL_INCOMPATIBLE_DATABASE' => 'The MySQL fulltext backend can only be used with MySQL4 and above.',
'FULLTEXT_MYSQL_NOT_MYISAM' => 'MySQL fulltext indexes can only be used with MyISAM tables.',
'FULLTEXT_MYSQL_TOTAL_POSTS' => 'Total number of indexed posts',
- 'FULLTEXT_MYSQL_MBSTRING' => 'Support for non-latin UTF-8 characters using mbstring:',
- 'FULLTEXT_MYSQL_PCRE' => 'Support for non-latin UTF-8 characters using PCRE:',
- 'FULLTEXT_MYSQL_MBSTRING_EXPLAIN' => 'If PCRE does not have unicode character properties, the search backend will try to use mbstring’s regular expression engine.',
- 'FULLTEXT_MYSQL_PCRE_EXPLAIN' => 'This search backend requires PCRE unicode character properties, only available in PHP 4.4, 5.1 and above, if you want to search for non-latin characters.',
'FULLTEXT_MYSQL_MIN_SEARCH_CHARS_EXPLAIN' => 'Words with at least this many characters will be indexed for searching. You or your host can only change this setting by changing the mysql configuration.',
'FULLTEXT_MYSQL_MAX_SEARCH_CHARS_EXPLAIN' => 'Words with no more than this many characters will be indexed for searching. You or your host can only change this setting by changing the mysql configuration.',
+ 'FULLTEXT_POSTGRES_INCOMPATIBLE_DATABASE' => 'The PostgreSQL fulltext backend can only be used with PostgreSQL.',
+ 'FULLTEXT_POSTGRES_TS_NOT_USABLE' => 'The PostgreSQL fulltext backend can only be used with PostgreSQL 8.3 and above.',
+ 'FULLTEXT_POSTGRES_TOTAL_POSTS' => 'Total number of indexed posts',
+ 'FULLTEXT_POSTGRES_VERSION_CHECK' => 'PostgreSQL version',
+ 'FULLTEXT_POSTGRES_TS_NAME' => 'Text search Configuration Profile:',
+ 'FULLTEXT_POSTGRES_MIN_WORD_LEN' => 'Minimum word length for keywords',
+ 'FULLTEXT_POSTGRES_MAX_WORD_LEN' => 'Maximum word length for keywords',
+ 'FULLTEXT_POSTGRES_VERSION_CHECK_EXPLAIN' => 'This search backend requires PostgreSQL version 8.3 and above.',
+ 'FULLTEXT_POSTGRES_TS_NAME_EXPLAIN' => 'The Text search configuration profile used to determine the parser and dictionary.',
+ 'FULLTEXT_POSTGRES_MIN_WORD_LEN_EXPLAIN' => 'Words with at least this many characters will be included in the query to the database.',
+ 'FULLTEXT_POSTGRES_MAX_WORD_LEN_EXPLAIN' => 'Words with no more than this many characters will be included in the query to the database.',
+
'GENERAL_SEARCH_SETTINGS' => 'General search settings',
'GO_TO_SEARCH_INDEX' => 'Go to search index page',
diff --git a/phpBB/language/en/acp/users.php b/phpBB/language/en/acp/users.php
index 4496fdba7c..45cf36469b 100644
--- a/phpBB/language/en/acp/users.php
+++ b/phpBB/language/en/acp/users.php
@@ -123,6 +123,7 @@ $lang = array_merge($lang, array(
'USER_GROUP_SPECIAL' => 'Pre-defined groups user is a member of',
'USER_LIFTED_NR' => 'Successfully removed the user’s newly registered status.',
'USER_NO_ATTACHMENTS' => 'There are no attached files to display.',
+ 'USER_NO_POSTS_TO_DELETE' => 'The user has no posts to retain or delete.',
'USER_OUTBOX_EMPTIED' => 'Successfully emptied user’s private message outbox.',
'USER_OUTBOX_EMPTY' => 'The user’s private message outbox was already empty.',
'USER_OVERVIEW_UPDATED' => 'User details updated.',
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 615f5711d0..a6da52d4ef 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -169,6 +169,7 @@ $lang = array_merge($lang, array(
),
'EDIT_POST' => 'Edit post',
+ 'ELLIPSIS' => '…',
'EMAIL' => 'Email', // Short form for EMAIL_ADDRESS
'EMAIL_ADDRESS' => 'Email address',
'EMAIL_SMTP_ERROR_RESPONSE' => 'Ran into problems sending email at <strong>Line %1$s</strong>. Response: %2$s.',
diff --git a/phpBB/language/en/search.php b/phpBB/language/en/search.php
index 7bf8473579..d09b4303cd 100644
--- a/phpBB/language/en/search.php
+++ b/phpBB/language/en/search.php
@@ -72,6 +72,7 @@ $lang = array_merge($lang, array(
'WORDS_IN_NO_POST' => 'No posts were found because the words <strong>%s</strong> are not contained in any post.',
'POST_CHARACTERS' => 'characters of posts',
+ 'PHRASE_SEARCH_DISABLED' => 'Searching by exact phrase is not supported on this board.',
'RECENT_SEARCHES' => 'Recent searches',
'RESULT_DAYS' => 'Limit results to previous',
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index 2212e44628..e3971c75e2 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -87,6 +87,7 @@ $lang = array_merge($lang, array(
'ATTACHMENTS_EXPLAIN' => 'This is a list of attachments you have made in posts to this board.',
'ATTACHMENTS_DELETED' => 'Attachments successfully deleted.',
'ATTACHMENT_DELETED' => 'Attachment successfully deleted.',
+ 'AUTOLOGIN_SESSION_KEYS_DELETED'=> 'The selected persistent login keys were successfully deleted.',
'AVATAR_CATEGORY' => 'Category',
'AVATAR_EXPLAIN' => 'Maximum dimensions; width: %1$s, height: %2$s, file size: %3$.2f KiB.',
'AVATAR_FEATURES_DISABLED' => 'The avatar functionality is currently disabled.',
@@ -134,7 +135,8 @@ $lang = array_merge($lang, array(
'CREATE_FOLDER' => 'Add folder…',
'CURRENT_IMAGE' => 'Current image',
'CURRENT_PASSWORD' => 'Current password',
- 'CURRENT_PASSWORD_EXPLAIN' => 'You must confirm your current password if you wish to change it, alter your email address or username.',
+ 'CURRENT_PASSWORD_EXPLAIN' => 'You must enter your current password if you wish to alter your email address or username.',
+ 'CURRENT_CHANGE_PASSWORD_EXPLAIN' => 'To change your password, your email address, or your username, you must enter your current password.',
'CUR_PASSWORD_EMPTY' => 'You did not enter your current password.',
'CUR_PASSWORD_ERROR' => 'The current password you entered is incorrect.',
'CUSTOM_DATEFORMAT' => 'Custom…',
@@ -255,6 +257,8 @@ $lang = array_merge($lang, array(
'LINK_REMOTE_SIZE' => 'Avatar dimensions',
'LINK_REMOTE_SIZE_EXPLAIN' => 'Specify the width and height of the avatar, leave blank to attempt automatic verification.',
'LOGIN_EXPLAIN_UCP' => 'Please login in order to access the User Control Panel.',
+ 'LOGIN_KEY' => 'Login Key',
+ 'LOGIN_TIME' => 'Login Time',
'LOGIN_REDIRECT' => 'You have been successfully logged in.',
'LOGOUT_FAILED' => 'You were not logged out, as the request did not match your session. Please contact the board administrator if you continue to experience problems.',
'LOGOUT_REDIRECT' => 'You have been successfully logged out.',
@@ -376,6 +380,8 @@ $lang = array_merge($lang, array(
'PREFERENCES_UPDATED' => 'Your preferences have been updated.',
'PROFILE_INFO_NOTICE' => 'Please note that this information may be viewable to other members. Be careful when including any personal details. Any fields marked with a * must be completed.',
'PROFILE_UPDATED' => 'Your profile has been updated.',
+ 'PROFILE_AUTOLOGIN_KEYS' => 'The persistent login keys automatically log you in when you visit the board. If you logout, the persistent login key is deleted only on the computer you are using to logout. Here you can see persistent login keys created on other computers you used to access this site.',
+ 'PROFILE_NO_AUTOLOGIN_KEYS' => 'There are no saved persistent login keys.',
'RECIPIENT' => 'Recipient',
'RECIPIENTS' => 'Recipients',
@@ -398,6 +404,7 @@ $lang = array_merge($lang, array(
'RULE_ADDED' => 'Rule successfully added.',
'RULE_ALREADY_DEFINED' => 'This rule was defined previously.',
'RULE_DELETED' => 'Rule successfully removed.',
+ 'RULE_LIMIT_REACHED' => 'You cannot add more PM rules. You have reached the maximum number of rules.',
'RULE_NOT_DEFINED' => 'Rule not correctly specified.',
'RULE_REMOVED_MESSAGES' => array(
1 => '%d private message was removed due to private message filters.',
@@ -465,6 +472,7 @@ $lang = array_merge($lang, array(
'UCP_PROFILE_PROFILE_INFO' => 'Edit profile',
'UCP_PROFILE_REG_DETAILS' => 'Edit account settings',
'UCP_PROFILE_SIGNATURE' => 'Edit signature',
+ 'UCP_PROFILE_AUTOLOGIN_KEYS'=> 'Edit persistent login keys',
'UCP_USERGROUPS' => 'Usergroups',
'UCP_USERGROUPS_MEMBER' => 'Edit memberships',
diff --git a/phpBB/search.php b/phpBB/search.php
index d53ca1eb60..93cd0c31fd 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -596,6 +596,13 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$u_search .= ($search_fields != 'all') ? '&amp;sf=' . $search_fields : '';
$u_search .= ($return_chars != 300) ? '&amp;ch=' . $return_chars : '';
+ // Check if search backend supports phrase search or not
+ $phrase_search_disabled = '';
+ if (strpos(html_entity_decode($keywords), '"') !== false && method_exists($search, 'supports_phrase_search'))
+ {
+ $phrase_search_disabled = $search->supports_phrase_search() ? false : true;
+ }
+
$template->assign_vars(array(
'SEARCH_TITLE' => $l_search_title,
'SEARCH_MATCHES' => $l_search_matches,
@@ -604,6 +611,9 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'IGNORED_WORDS' => (sizeof($search->common_words)) ? implode(' ', $search->common_words) : '',
'PAGINATION' => generate_pagination($u_search, $total_match_count, $per_page, $start),
'PAGE_NUMBER' => on_page($total_match_count, $per_page, $start),
+
+ 'PHRASE_SEARCH_DISABLED' => $phrase_search_disabled,
+
'TOTAL_MATCHES' => $total_match_count,
'SEARCH_IN_RESULTS' => ($search_id) ? false : true,
diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html
index ed08aa791a..723c2ffeda 100644
--- a/phpBB/styles/prosilver/template/forumlist_body.html
+++ b/phpBB/styles/prosilver/template/forumlist_body.html
@@ -35,7 +35,12 @@
<!-- IF forumrow.MODERATORS -->
<br /><strong>{forumrow.L_MODERATOR_STR}:</strong> {forumrow.MODERATORS}
<!-- ENDIF -->
- <!-- IF forumrow.SUBFORUMS and forumrow.S_LIST_SUBFORUMS --><br /><strong>{forumrow.L_SUBFORUM_STR}</strong> {forumrow.SUBFORUMS}<!-- ENDIF -->
+ <!-- IF .forumrow.subforum and forumrow.S_LIST_SUBFORUMS -->
+ <br /><strong>{forumrow.L_SUBFORUM_STR}</strong>
+ <!-- BEGIN subforum -->
+ <a href="{forumrow.subforum.U_SUBFORUM}" class="subforum<!-- IF forumrow.subforum.S_UNREAD --> unread<!-- ELSE --> read<!-- ENDIF -->" title="<!-- IF forumrow.subforum.UNREAD -->{L_UNREAD_POSTS}<!-- ELSE -->{L_NO_UNREAD_POSTS}<!-- ENDIF -->">{forumrow.subforum.SUBFORUM_NAME}</a><!-- IF not forumrow.subforum.S_LAST_ROW -->,<!-- ENDIF -->
+ <!-- END subforum -->
+ <!-- ENDIF -->
</dt>
<!-- IF forumrow.CLICKS -->
<dd class="redirect"><span>{L_REDIRECTS}: {forumrow.CLICKS}</span></dd>
@@ -44,7 +49,11 @@
<dd class="posts">{forumrow.POSTS} <dfn>{L_POSTS}</dfn></dd>
<dd class="lastpost"><span>
<!-- IF forumrow.U_UNAPPROVED_TOPICS --><a href="{forumrow.U_UNAPPROVED_TOPICS}">{UNAPPROVED_IMG}</a><!-- ENDIF -->
- <!-- IF forumrow.LAST_POST_TIME --><dfn>{L_LAST_POST}</dfn> {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL}
+ <!-- IF forumrow.LAST_POST_TIME --><dfn>{L_LAST_POST}</dfn>
+ <!-- IF forumrow.S_DISPLAY_SUBJECT -->
+ <a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}">{forumrow.LAST_POST_SUBJECT_TRUNCATED}</a> <br />
+ <!-- ENDIF -->
+ {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL}
<!-- IF not S_IS_BOT --><a href="{forumrow.U_LAST_POST}">{LAST_POST_IMG}</a> <!-- ENDIF --><br />{forumrow.LAST_POST_TIME}<!-- ELSE -->{L_NO_POSTS}<br />&nbsp;<!-- ENDIF --></span>
</dd>
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html
index 2a6de3ce9d..8d0294d226 100644
--- a/phpBB/styles/prosilver/template/mcp_topic.html
+++ b/phpBB/styles/prosilver/template/mcp_topic.html
@@ -67,7 +67,7 @@ onload_functions.push('subPanels()');
<dl>
<dt><label for="subject">{L_SPLIT_SUBJECT}:</label></dt>
- <dd><input type="text" name="subject" id="subject" size="45" maxlength="64" tabindex="2" value="{SPLIT_SUBJECT}" title="{L_SPLIT_SUBJECT}" class="inputbox" /></dd>
+ <dd><input type="text" name="subject" id="subject" size="45" maxlength="124" tabindex="2" value="{SPLIT_SUBJECT}" title="{L_SPLIT_SUBJECT}" class="inputbox" /></dd>
</dl>
<dl>
<dt><label>{L_SPLIT_FORUM}:</label></dt>
diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html
index 2cb721073f..b473e7022c 100644
--- a/phpBB/styles/prosilver/template/overall_footer.html
+++ b/phpBB/styles/prosilver/template/overall_footer.html
@@ -8,9 +8,9 @@
<ul class="linklist">
<li class="icon-home"><a href="{U_INDEX}" accesskey="h">{L_INDEX}</a></li>
<!-- IF not S_IS_BOT -->
- <!-- IF S_WATCH_FORUM_LINK --><li <!-- IF S_WATCHING_FORUM -->class="icon-unsubscribe"<!-- ELSE -->class="icon-subscribe"<!-- ENDIF -->><a href="{S_WATCH_FORUM_LINK}" title="{S_WATCH_FORUM_TITLE}" data-ajax="alt_text" data-alt-text="<!-- IF S_WATCHING_FORUM -->{L_START_WATCHING_FORUM}<!-- ELSE -->{L_STOP_WATCHING_FORUM}<!-- ENDIF -->">{S_WATCH_FORUM_TITLE}</a></li><!-- ENDIF -->
- <!-- IF U_WATCH_TOPIC --><li <!-- IF S_WATCHING_TOPIC -->class="icon-unsubscribe"<!-- ELSE -->class="icon-subscribe"<!-- ENDIF -->><a href="{U_WATCH_TOPIC}" title="{L_WATCH_TOPIC}" data-ajax="alt_text" data-alt-text="<!-- IF S_WATCHING_TOPIC -->{L_START_WATCHING_TOPIC}<!-- ELSE -->{L_STOP_WATCHING_TOPIC}<!-- ENDIF -->">{L_WATCH_TOPIC}</a></li><!-- ENDIF -->
- <!-- IF U_BOOKMARK_TOPIC --><li class="icon-bookmark"><a href="{U_BOOKMARK_TOPIC}" title="{L_BOOKMARK_TOPIC}" data-ajax="alt_text" data-alt-text="<!-- IF S_BOOKMARKED_TOPIC -->{L_BOOKMARK_TOPIC_REAL}<!-- ELSE -->{L_BOOKMARK_TOPIC_REMOVE}<!-- ENDIF -->">{L_BOOKMARK_TOPIC}</a></li><!-- ENDIF -->
+ <!-- IF U_WATCH_FORUM_LINK --><li <!-- IF S_WATCHING_FORUM -->class="icon-unsubscribe"<!-- ELSE -->class="icon-subscribe"<!-- ENDIF -->><a href="{U_WATCH_FORUM_LINK}" title="{S_WATCH_FORUM_TITLE}" data-ajax="toggle_link" data-toggle-class="icon-<!-- IF not S_WATCHING_FORUM -->unsubscribe<!-- ELSE -->subscribe<!-- ENDIF -->" data-toggle-text="{S_WATCH_FORUM_TOGGLE}" data-toggle-url="{U_WATCH_FORUM_TOGGLE}">{S_WATCH_FORUM_TITLE}</a></li><!-- ENDIF -->
+ <!-- IF U_WATCH_TOPIC --><li <!-- IF S_WATCHING_TOPIC -->class="icon-unsubscribe"<!-- ELSE -->class="icon-subscribe"<!-- ENDIF -->><a href="{U_WATCH_TOPIC}" title="{S_WATCH_TOPIC_TITLE}" data-ajax="toggle_link" data-toggle-class="<!-- IF not S_WATCHING_TOPIC -->icon-unsubscribe<!-- ELSE -->icon-subscribe<!-- ENDIF -->" data-toggle-text="{S_WATCH_TOPIC_TOGGLE}" data-toggle-url="{U_WATCH_TOPIC_TOGGLE}">{S_WATCH_TOPIC_TITLE}</a></li><!-- ENDIF -->
+ <!-- IF U_BOOKMARK_TOPIC --><li class="icon-bookmark"><a href="{U_BOOKMARK_TOPIC}" title="{L_BOOKMARK_TOPIC}" data-ajax="alt_text" data-alt-text="{S_BOOKMARK_TOGGLE}">{S_BOOKMARK_TOPIC}</a></li><!-- ENDIF -->
<!-- IF U_BUMP_TOPIC --><li class="icon-bump"><a href="{U_BUMP_TOPIC}" title="{L_BUMP_TOPIC}" data-ajax="true">{L_BUMP_TOPIC}</a></li><!-- ENDIF -->
<!-- ENDIF -->
<li class="rightside"><!-- IF U_TEAM --><a href="{U_TEAM}">{L_THE_TEAM}</a> &bull; <!-- ENDIF --><!-- IF not S_IS_BOT --><a href="{U_DELETE_COOKIES}" data-ajax="true" data-refresh="true">{L_DELETE_COOKIES}</a> &bull; <!-- ENDIF -->{S_TIMEZONE}</li>
diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html
index 60766495c6..d1c86e7e13 100644
--- a/phpBB/styles/prosilver/template/posting_editor.html
+++ b/phpBB/styles/prosilver/template/posting_editor.html
@@ -103,7 +103,7 @@
<!-- IF S_POST_ACTION or S_PRIVMSGS or S_EDIT_DRAFT -->
<dl style="clear: left;">
<dt><label for="subject">{L_SUBJECT}:</label></dt>
- <dd><input type="text" name="subject" id="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->60<!-- ELSE -->64<!-- ENDIF -->" tabindex="2" value="{SUBJECT}{DRAFT_SUBJECT}" class="inputbox autowidth" /></dd>
+ <dd><input type="text" name="subject" id="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->120<!-- ELSE -->124<!-- ENDIF -->" tabindex="2" value="{SUBJECT}{DRAFT_SUBJECT}" class="inputbox autowidth" /></dd>
</dl>
<!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
<!-- DEFINE $CAPTCHA_TAB_INDEX = 3 -->
diff --git a/phpBB/styles/prosilver/template/quickreply_editor.html b/phpBB/styles/prosilver/template/quickreply_editor.html
index 724fdb85b8..5fcdf0f5d4 100644
--- a/phpBB/styles/prosilver/template/quickreply_editor.html
+++ b/phpBB/styles/prosilver/template/quickreply_editor.html
@@ -5,7 +5,7 @@
<fieldset class="fields1">
<dl style="clear: left;">
<dt><label for="subject">{L_SUBJECT}:</label></dt>
- <dd><input type="text" name="subject" id="subject" size="45" maxlength="64" tabindex="2" value="{SUBJECT}" class="inputbox autowidth" /></dd>
+ <dd><input type="text" name="subject" id="subject" size="45" maxlength="124" tabindex="2" value="{SUBJECT}" class="inputbox autowidth" /></dd>
</dl>
<div id="message-box">
<textarea style="height: 9em;" name="message" rows="7" cols="76" tabindex="3" class="inputbox"></textarea>
diff --git a/phpBB/styles/prosilver/template/search_results.html b/phpBB/styles/prosilver/template/search_results.html
index 61f4a82792..0a58605b31 100644
--- a/phpBB/styles/prosilver/template/search_results.html
+++ b/phpBB/styles/prosilver/template/search_results.html
@@ -3,6 +3,7 @@
<h2><!-- IF SEARCH_TITLE -->{SEARCH_TITLE}<!-- ELSE -->{SEARCH_MATCHES}<!-- ENDIF --><!-- IF SEARCH_WORDS -->: <a href="{U_SEARCH_WORDS}">{SEARCH_WORDS}</a><!-- ENDIF --></h2>
<!-- IF SEARCHED_QUERY --> <p>{L_SEARCHED_QUERY}: <strong>{SEARCHED_QUERY}</strong></p><!-- ENDIF -->
<!-- IF IGNORED_WORDS --> <p>{L_IGNORED_TERMS}: <strong>{IGNORED_WORDS}</strong></p><!-- ENDIF -->
+<!-- IF PHRASE_SEARCH_DISABLED --> <p><strong>{L_PHRASE_SEARCH_DISABLED}</strong></p><!-- ENDIF -->
<!-- IF SEARCH_TOPIC -->
<p><a class="{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH_TOPIC}">{L_RETURN_TO}: {SEARCH_TOPIC}</a></p>
diff --git a/phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html b/phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html
new file mode 100644
index 0000000000..a6c19508e2
--- /dev/null
+++ b/phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html
@@ -0,0 +1,53 @@
+<!-- INCLUDE ucp_header.html -->
+
+<form id="ucp" method="post" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}>
+
+<h2>{L_TITLE}</h2>
+<div class="panel">
+ <div class="inner">
+
+ <fieldset>
+ <!-- IF .errors -->
+ <p class="error">
+ <!-- BEGIN errors -->
+ {errors} <br />
+ <!-- END errors -->
+ </p>
+ <!-- ENDIF -->
+
+ <p>{L_PROFILE_AUTOLOGIN_KEYS}</p><br />
+ <table cellspacing="1" class="table1">
+ <thead>
+ <tr>
+ <th>{L_MARK}</th>
+ <th>{L_LOGIN_KEY}</th>
+ <th>{L_IP}</th>
+ <th>{L_LOGIN_TIME}</th>
+ </tr>
+ </thead>
+ <tbody>
+ <!-- BEGIN sessions -->
+ <!-- IF sessions.S_ROW_COUNT is even --><tr class="bg1"><!-- ELSE --><tr class="bg2"><!-- ENDIF -->
+ <td style="text-align: center"><input type="checkbox" name="keys[]" value="{sessions.KEY}" id="{sessions.KEY}"/></td>
+ <td><label for="{sessions.KEY}">{sessions.KEY}</label></td>
+ <td style="text-align: center">{sessions.IP}</td>
+ <td style="text-align: center">{sessions.LOGIN_TIME}</td>
+ </tr>
+ <!-- BEGINELSE -->
+ <tr><td colspan="4" class="bg1" style="text-align: center">{L_PROFILE_NO_AUTOLOGIN_KEYS}</td></tr>
+ <!-- END sessions -->
+ </tbody>
+ </table>
+ </fieldset>
+ </div>
+</div>
+
+<!-- IF .sessions -->
+ <fieldset class="submit-buttons">
+ {S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{L_DELETE}" class="button1" />
+ {S_FORM_TOKEN}
+ </fieldset>
+<!-- ENDIF -->
+</form>
+
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_profile_reg_details.html b/phpBB/styles/prosilver/template/ucp_profile_reg_details.html
index 4f74c7193b..5c0639fce7 100644
--- a/phpBB/styles/prosilver/template/ucp_profile_reg_details.html
+++ b/phpBB/styles/prosilver/template/ucp_profile_reg_details.html
@@ -39,7 +39,7 @@
<fieldset>
<dl>
- <dt><label for="cur_password">{L_CURRENT_PASSWORD}:</label><br /><span>{L_CURRENT_PASSWORD_EXPLAIN}</span></dt>
+ <dt><label for="cur_password">{L_CURRENT_PASSWORD}:</label><br /><span><!-- IF S_CHANGE_PASSWORD -->{L_CURRENT_CHANGE_PASSWORD_EXPLAIN}<!-- ELSE -->{L_CURRENT_PASSWORD_EXPLAIN}<!-- ENDIF --></span></dt>
<dd><input type="password" name="cur_password" id="cur_password" maxlength="255" value="{CUR_PASSWORD}" class="inputbox" title="{L_CURRENT_PASSWORD}" /></dd>
</dl>
</fieldset>
@@ -48,7 +48,7 @@
</div>
<fieldset class="submit-buttons">
- {S_HIDDEN_FIELDS}<input type="reset" value="{L_RESET}" name="reset" class="button2" />&nbsp;
+ {S_HIDDEN_FIELDS}<input type="reset" value="{L_RESET}" name="reset" class="button2" />&nbsp;
<input type="submit" name="submit" value="{L_SUBMIT}" class="button1" />
{S_FORM_TOKEN}
</fieldset>
diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html
index 9110cea4e9..1af512732d 100644
--- a/phpBB/styles/prosilver/template/viewtopic_body.html
+++ b/phpBB/styles/prosilver/template/viewtopic_body.html
@@ -263,7 +263,7 @@
<!-- INCLUDE jumpbox.html -->
<!-- IF .quickmod -->
- <form method="post" action="{S_MOD_ACTION}" id="quickmodform" data-ajax="true">
+ <form method="post" action="{S_MOD_ACTION}" id="quickmodform">
<fieldset class="quickmod">
<label for="quick-mod-select">{L_QUICK_MOD}:</label>
<select name="action" id="quick-mod-select">
diff --git a/phpBB/styles/subsilver2/template/forumlist_body.html b/phpBB/styles/subsilver2/template/forumlist_body.html
index 334fd7a968..b9a1102df0 100644
--- a/phpBB/styles/subsilver2/template/forumlist_body.html
+++ b/phpBB/styles/subsilver2/template/forumlist_body.html
@@ -48,14 +48,21 @@
<!-- IF forumrow.MODERATORS -->
<p class="forumdesc"><strong>{forumrow.L_MODERATOR_STR}:</strong> {forumrow.MODERATORS}</p>
<!-- ENDIF -->
- <!-- IF forumrow.SUBFORUMS and forumrow.S_LIST_SUBFORUMS -->
- <p class="forumdesc"><strong>{forumrow.L_SUBFORUM_STR}</strong> {forumrow.SUBFORUMS}</p>
+ <!-- IF .forumrow.subforum and forumrow.S_LIST_SUBFORUMS -->
+ <p class="forumdesc"><strong>{forumrow.L_SUBFORUM_STR}</strong>
+ <!-- BEGIN subforum -->
+ <a href="{forumrow.subforum.U_SUBFORUM}" class="subforum<!-- IF forumrow.subforum.S_UNREAD --> unread<!-- ELSE --> read<!-- ENDIF -->" title="<!-- IF forumrow.subforum.UNREAD -->{L_UNREAD_POSTS}<!-- ELSE -->{L_NO_UNREAD_POSTS}<!-- ENDIF -->">{forumrow.subforum.SUBFORUM_NAME}</a><!-- IF not forumrow.subforum.S_LAST_ROW -->,<!-- ENDIF -->
+ <!-- END subforum -->
+ </p>
<!-- ENDIF -->
</td>
<td class="row2" align="center"><p class="topicdetails">{forumrow.TOPICS}</p></td>
<td class="row2" align="center"><p class="topicdetails">{forumrow.POSTS}</p></td>
<td class="row2" align="center" nowrap="nowrap">
<!-- IF forumrow.LAST_POST_TIME -->
+ <!-- IF forumrow.S_DISPLAY_SUBJECT -->
+ <p class="topicdetails"><a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}">{forumrow.LAST_POST_SUBJECT_TRUNCATED}</a></p>
+ <!-- ENDIF -->
<p class="topicdetails"><!-- IF forumrow.U_UNAPPROVED_TOPICS --><a href="{forumrow.U_UNAPPROVED_TOPICS}" class="imageset">{UNAPPROVED_IMG}</a>&nbsp;<!-- ENDIF -->{forumrow.LAST_POST_TIME}</p>
<p class="topicdetails">{forumrow.LAST_POSTER_FULL}
<!-- IF not S_IS_BOT --><a href="{forumrow.U_LAST_POST}" class="imageset">{LAST_POST_IMG}</a><!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/mcp_topic.html b/phpBB/styles/subsilver2/template/mcp_topic.html
index 8ff648da39..6bbf13e12c 100644
--- a/phpBB/styles/subsilver2/template/mcp_topic.html
+++ b/phpBB/styles/subsilver2/template/mcp_topic.html
@@ -12,7 +12,7 @@
</tr>
<tr>
<td class="row1" nowrap="nowrap"><span class="gen">{L_SPLIT_SUBJECT}</span></td>
- <td class="row2" colspan="2"><input class="post" style="width: 350px" type="text" size="35" maxlength="64" name="subject" value="{SPLIT_SUBJECT}" /></td>
+ <td class="row2" colspan="2"><input class="post" style="width: 350px" type="text" size="35" maxlength="124" name="subject" value="{SPLIT_SUBJECT}" /></td>
</tr>
<tr>
<td class="row1" nowrap="nowrap"><span class="gen">{L_SPLIT_FORUM}</span></td>
diff --git a/phpBB/styles/subsilver2/template/posting_body.html b/phpBB/styles/subsilver2/template/posting_body.html
index 712c02b856..ae7d2f88d6 100644
--- a/phpBB/styles/subsilver2/template/posting_body.html
+++ b/phpBB/styles/subsilver2/template/posting_body.html
@@ -173,7 +173,7 @@
<tr>
<td class="row1" width="22%"><b class="genmed">{L_SUBJECT}:</b></td>
- <td class="row2" width="78%"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->60<!-- ELSE -->64<!-- ENDIF -->" tabindex="2" value="{SUBJECT}" /></td>
+ <td class="row2" width="78%"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->120<!-- ELSE -->124<!-- ENDIF -->" tabindex="2" value="{SUBJECT}" /></td>
</tr>
<tr>
<td class="row1" valign="top"><b class="genmed">{L_MESSAGE_BODY}:</b><br /><span class="gensmall">{L_MESSAGE_BODY_EXPLAIN}&nbsp;</span><br /><br />
diff --git a/phpBB/styles/subsilver2/template/quickreply_editor.html b/phpBB/styles/subsilver2/template/quickreply_editor.html
index 4c3f7a3d0b..7a68a8f605 100644
--- a/phpBB/styles/subsilver2/template/quickreply_editor.html
+++ b/phpBB/styles/subsilver2/template/quickreply_editor.html
@@ -6,7 +6,7 @@
</tr>
<tr>
<td class="row1" width="22%"><b class="genmed">{L_SUBJECT}:</b></td>
- <td class="row2" width="78%"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="64" tabindex="2" value="{SUBJECT}" /></td>
+ <td class="row2" width="78%"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="124" tabindex="2" value="{SUBJECT}" /></td>
</tr>
<tr>
<td class="row1" width="22%"><b class="genmed">{L_MESSAGE}:</b></td>
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_autologin_keys.html b/phpBB/styles/subsilver2/template/ucp_profile_autologin_keys.html
new file mode 100644
index 0000000000..1dab9acb9c
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/ucp_profile_autologin_keys.html
@@ -0,0 +1,49 @@
+<!-- INCLUDE ucp_header.html -->
+
+<table class="tablebg" width="100%" cellspacing="1">
+<tr>
+ <th colspan="4" valign="middle">{L_TITLE}</th>
+</tr>
+<!-- IF .errors -->
+ <tr>
+ <td class="row3" colspan="2" align="center"><span class="gensmall error">
+ <!-- BEGIN errors -->
+ {errors} <br />
+ <!-- END errors -->
+ </td>
+ </tr>
+<!-- ENDIF -->
+
+<tr>
+ <td colspan="4" class="row1">{L_PROFILE_AUTOLOGIN_KEYS}</td>
+</tr>
+<tr>
+ <th>{L_MARK}</th>
+ <th>{L_LOGIN_KEY}</th>
+ <th>{L_IP}</th>
+ <th>{L_LOGIN_TIME}</th>
+</tr>
+<!-- BEGIN sessions -->
+ <!-- IF sessions.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
+ <td class="genmed" style="text-align: center"><input type="checkbox" name="keys[]" value="{sessions.KEY}" id="{sessions.KEY}"/></td>
+ <td class="genmed"><label for="{sessions.KEY}">{sessions.KEY}</label></td>
+ <td class="genmed" style="text-align: center">{sessions.IP}</td>
+ <td class="genmed" style="text-align: center">{sessions.LOGIN_TIME}</td>
+ </tr>
+<!-- BEGINELSE -->
+ <tr>
+ <td colspan="4" class="row1" style="text-align: center">{L_PROFILE_NO_AUTOLOGIN_KEYS}</td>
+ </tr>
+<!-- END sessions -->
+
+<!-- IF .sessions -->
+ <tr>
+ <td class="cat" colspan="4" align="center">
+ {S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="submit" value="{L_DELETE}" />
+ {S_FORM_TOKEN}
+ </td>
+ </tr>
+<!-- ENDIF -->
+</table>
+
+<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html b/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html
index 96e2e26683..71b34499d1 100644
--- a/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html
+++ b/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html
@@ -36,7 +36,7 @@
<th colspan="2">{L_CONFIRM_CHANGES}</th>
</tr>
<tr>
- <td class="row1" width="35%"><b class="genmed">{L_CURRENT_PASSWORD}: </b><br /><span class="gensmall">{L_CURRENT_PASSWORD_EXPLAIN}</span></td>
+ <td class="row1" width="35%"><b class="genmed">{L_CURRENT_PASSWORD}: </b><br /><span class="gensmall"><!-- IF S_CHANGE_PASSWORD -->{L_CURRENT_CHANGE_PASSWORD_EXPLAIN}<!-- ELSE -->{L_CURRENT_PASSWORD_EXPLAIN}<!-- ENDIF --></span></td>
<td class="row2"><input type="password" class="post" name="cur_password" size="30" maxlength="255" value="{CUR_PASSWORD}" /></td>
</tr>
<tr>
diff --git a/phpBB/styles/subsilver2/template/viewforum_body.html b/phpBB/styles/subsilver2/template/viewforum_body.html
index f132185716..afb8426799 100644
--- a/phpBB/styles/subsilver2/template/viewforum_body.html
+++ b/phpBB/styles/subsilver2/template/viewforum_body.html
@@ -154,7 +154,7 @@
<td class="cat" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->">
<table width="100%" cellspacing="0">
<tr class="nav">
- <td valign="middle">&nbsp;<!-- IF S_WATCH_FORUM_LINK and not S_IS_BOT --><a href="{S_WATCH_FORUM_LINK}">{S_WATCH_FORUM_TITLE}</a><!-- ENDIF --></td>
+ <td valign="middle">&nbsp;<!-- IF U_WATCH_FORUM_LINK and not S_IS_BOT --><a href="{U_WATCH_FORUM_LINK}">{S_WATCH_FORUM_TITLE}</a><!-- ENDIF --></td>
<td align="{S_CONTENT_FLOW_END}" valign="middle"><!-- IF not S_IS_BOT and U_MARK_TOPICS --><a href="{U_MARK_TOPICS}">{L_MARK_TOPICS_READ}</a><!-- ENDIF -->&nbsp;</td>
</tr>
</table>
diff --git a/phpBB/styles/subsilver2/template/viewtopic_body.html b/phpBB/styles/subsilver2/template/viewtopic_body.html
index 2c5351b926..a4e2dd886a 100644
--- a/phpBB/styles/subsilver2/template/viewtopic_body.html
+++ b/phpBB/styles/subsilver2/template/viewtopic_body.html
@@ -52,8 +52,8 @@
<tr>
<td class="nav" nowrap="nowrap">&nbsp;
<!-- IF not S_IS_BOT -->
- <!-- IF U_WATCH_TOPIC --><a href="{U_WATCH_TOPIC}" title="{L_WATCH_TOPIC}">{L_WATCH_TOPIC}</a><!-- IF U_PRINT_TOPIC or U_EMAIL_TOPIC or U_BUMP_TOPIC or U_BOOKMARK_TOPIC --> | <!-- ENDIF --><!-- ENDIF -->
- <!-- IF U_BOOKMARK_TOPIC --><a href="{U_BOOKMARK_TOPIC}" title="{L_BOOKMARK_TOPIC}">{L_BOOKMARK_TOPIC}</a><!-- IF U_PRINT_TOPIC or U_EMAIL_TOPIC or U_BUMP_TOPIC --> | <!-- ENDIF --><!-- ENDIF -->
+ <!-- IF U_WATCH_TOPIC --><a href="{U_WATCH_TOPIC}" title="{S_WATCH_TOPIC_TITLE}">{S_WATCH_TOPIC_TITLE}</a><!-- IF U_PRINT_TOPIC or U_EMAIL_TOPIC or U_BUMP_TOPIC or U_BOOKMARK_TOPIC --> | <!-- ENDIF --><!-- ENDIF -->
+ <!-- IF U_BOOKMARK_TOPIC --><a href="{U_BOOKMARK_TOPIC}" title="{S_BOOKMARK_TOPIC}">{S_BOOKMARK_TOPIC}</a><!-- IF U_PRINT_TOPIC or U_EMAIL_TOPIC or U_BUMP_TOPIC --> | <!-- ENDIF --><!-- ENDIF -->
<!-- IF U_PRINT_TOPIC --><a href="{U_PRINT_TOPIC}" title="{L_PRINT_TOPIC}">{L_PRINT_TOPIC}</a><!-- IF U_EMAIL_TOPIC or U_BUMP_TOPIC --> | <!-- ENDIF --><!-- ENDIF -->
<!-- IF U_EMAIL_TOPIC --><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}">{L_EMAIL_TOPIC}</a><!-- IF U_BUMP_TOPIC --> | <!-- ENDIF --><!-- ENDIF -->
<!-- IF U_BUMP_TOPIC --><a href="{U_BUMP_TOPIC}" title="{L_BUMP_TOPIC}">{L_BUMP_TOPIC}</a><!-- ENDIF -->
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 2d91581cf4..6a39f10394 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -204,7 +204,9 @@ if (!$config['use_system_cron'])
// Forum rules and subscription info
$s_watching_forum = array(
'link' => '',
+ 'link_toggle' => '',
'title' => '',
+ 'title_toggle' => '',
'is_watching' => false,
);
@@ -318,8 +320,10 @@ $template->assign_vars(array(
'S_SELECT_SORT_KEY' => $s_sort_key,
'S_SELECT_SORT_DAYS' => $s_limit_days,
'S_TOPIC_ICONS' => ($s_display_active && sizeof($active_forum_ary)) ? max($active_forum_ary['enable_icons']) : (($forum_data['enable_icons']) ? true : false),
- 'S_WATCH_FORUM_LINK' => $s_watching_forum['link'],
+ 'U_WATCH_FORUM_LINK' => $s_watching_forum['link'],
+ 'U_WATCH_FORUM_TOGGLE' => $s_watching_forum['link_toggle'],
'S_WATCH_FORUM_TITLE' => $s_watching_forum['title'],
+ 'S_WATCH_FORUM_TOGGLE' => $s_watching_forum['title_toggle'],
'S_WATCHING_FORUM' => $s_watching_forum['is_watching'],
'S_FORUM_ACTION' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . (($start == 0) ? '' : "&amp;start=$start")),
'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('u_search') && $auth->acl_get('f_search', $forum_id) && $config['load_search']) ? true : false,
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index b75f4aeccf..0d6e9afd54 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -449,7 +449,9 @@ $viewtopic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&a
// Are we watching this topic?
$s_watching_topic = array(
'link' => '',
+ 'link_toggle' => '',
'title' => '',
+ 'title_toggle' => '',
'is_watching' => false,
);
@@ -649,13 +651,15 @@ $template->assign_vars(array(
'U_PRINT_TOPIC' => ($auth->acl_get('f_print', $forum_id)) ? $viewtopic_url . '&amp;view=print' : '',
'U_EMAIL_TOPIC' => ($auth->acl_get('f_email', $forum_id) && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&amp;t=$topic_id") : '',
- 'U_WATCH_TOPIC' => $s_watching_topic['link'],
- 'L_WATCH_TOPIC' => $s_watching_topic['title'],
+ 'U_WATCH_TOPIC' => $s_watching_topic['link'],
+ 'U_WATCH_TOPIC_TOGGLE' => $s_watching_topic['link_toggle'],
+ 'S_WATCH_TOPIC_TITLE' => $s_watching_topic['title'],
+ 'S_WATCH_TOPIC_TOGGLE' => $s_watching_topic['title_toggle'],
'S_WATCHING_TOPIC' => $s_watching_topic['is_watching'],
'U_BOOKMARK_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks']) ? $viewtopic_url . '&amp;bookmark=1&amp;hash=' . generate_link_hash("topic_$topic_id") : '',
- 'L_BOOKMARK_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks'] && $topic_data['bookmarked']) ? $user->lang['BOOKMARK_TOPIC_REMOVE'] : $user->lang['BOOKMARK_TOPIC'],
- 'L_BOOKMARK_TOPIC_REAL' => $user->lang['BOOKMARK_TOPIC'],
+ 'S_BOOKMARK_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks'] && $topic_data['bookmarked']) ? $user->lang['BOOKMARK_TOPIC_REMOVE'] : $user->lang['BOOKMARK_TOPIC'],
+ 'S_BOOKMARK_TOGGLE' => (!$user->data['is_registered'] || !$config['allow_bookmarks'] || !$topic_data['bookmarked']) ? $user->lang['BOOKMARK_TOPIC_REMOVE'] : $user->lang['BOOKMARK_TOPIC'],
'S_BOOKMARKED_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks'] && $topic_data['bookmarked']) ? true : false,
'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=post&amp;f=$forum_id") : '',