aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVjacheslav Trushkin <arty@phpbb.com>2012-03-24 11:45:53 +0200
committerVjacheslav Trushkin <arty@phpbb.com>2012-03-24 11:45:53 +0200
commit583da4274f91d3e8228ce58e8a849aa861ef66f8 (patch)
treed1841433f1d54768c3fc9f01af138adff6fc50c9
parentf17449e5ffb87c4a63e6c27c52036c5812f970d7 (diff)
parentcc13bac412442a1d72affcc3222b6bfca094e92a (diff)
downloadforums-583da4274f91d3e8228ce58e8a849aa861ef66f8.tar
forums-583da4274f91d3e8228ce58e8a849aa861ef66f8.tar.gz
forums-583da4274f91d3e8228ce58e8a849aa861ef66f8.tar.bz2
forums-583da4274f91d3e8228ce58e8a849aa861ef66f8.tar.xz
forums-583da4274f91d3e8228ce58e8a849aa861ef66f8.zip
Merge branch 'develop' into feature/prosilver-cleanup/duplicate-colors
* develop: (117 commits) [task/travis] Refactor php version check for dbunit install [task/travis] Exclude functional and slow tests [ticket/10719] Revert "Skip functional tests on PHP 5.2" [task/travis-develop2] Update version from 5.3 to 5.3.2 [task/travis] Dropping support for 5.2 in develop branch [task/travis] Some more small travis fixes [task/travis] Rename travis phpunit config files [task/travis] Fixing some travis issues [ticket/10684] Adjust function and parameter name, minor changes. [task/travis] Add automated testing to readme [task/travis] Removing development information [task/travis] Adding Travis Continuous Intergration Support [ticket/10704] minor typo in a comment [ticket/10717] Fix profile field sample in prosilverĀ“s memberlist_view.html [ticket/10691] Fixed the speed of creating search index [task/php54-ascraeus] Bring p_master#module_auth into PHP 5 era. [task/php54] Disable E_STRICT in Olympus when running on PHP 5.4. [task/php54] Refactor error_reporting call slightly. [ticket/10690] Fix undefined UNAPPROVED_POSTS_ZERO_TOTAL in queue [ticket/10689] Fix "First character"-option in "Find a member"-search ... Conflicts: phpBB/styles/prosilver/theme/cp.css
-rw-r--r--.gitignore1
-rw-r--r--.travis.yml25
-rw-r--r--README.md6
-rw-r--r--phpBB/adm/style/acp_users_overview.html4
-rw-r--r--phpBB/adm/style/admin.css4
-rw-r--r--phpBB/adm/style/install_update.html5
-rw-r--r--phpBB/develop/compile_template.php2
-rw-r--r--phpBB/develop/create_search_index.php3
-rw-r--r--phpBB/develop/extensions.php123
-rw-r--r--phpBB/develop/imageset_to_css.php162
-rw-r--r--phpBB/develop/search_fill.php4
-rw-r--r--phpBB/feed.php2
-rw-r--r--phpBB/includes/acp/acp_profile.php35
-rw-r--r--phpBB/includes/acp/acp_ranks.php2
-rw-r--r--phpBB/includes/acp/acp_styles.php17
-rw-r--r--phpBB/includes/acp/acp_users.php9
-rw-r--r--phpBB/includes/db/dbal.php35
-rw-r--r--phpBB/includes/db/mysql.php70
-rw-r--r--phpBB/includes/db/mysqli.php70
-rw-r--r--phpBB/includes/extension/finder.php4
-rw-r--r--phpBB/includes/extension/manager.php30
-rw-r--r--phpBB/includes/functions.php7
-rw-r--r--phpBB/includes/functions_admin.php10
-rw-r--r--phpBB/includes/functions_download.php2
-rw-r--r--phpBB/includes/functions_messenger.php113
-rw-r--r--phpBB/includes/functions_module.php26
-rw-r--r--phpBB/includes/functions_posting.php60
-rw-r--r--phpBB/includes/functions_privmsgs.php17
-rw-r--r--phpBB/includes/functions_profile_fields.php11
-rw-r--r--phpBB/includes/functions_user.php33
-rw-r--r--phpBB/includes/mcp/mcp_main.php9
-rw-r--r--phpBB/includes/mcp/mcp_post.php6
-rw-r--r--phpBB/includes/mcp/mcp_topic.php11
-rw-r--r--phpBB/includes/request/type_cast_helper.php2
-rw-r--r--phpBB/includes/search/base.php2
-rw-r--r--phpBB/includes/search/fulltext_mysql.php8
-rw-r--r--phpBB/includes/search/fulltext_native.php15
-rw-r--r--phpBB/includes/startup.php3
-rw-r--r--phpBB/includes/template/context.php19
-rw-r--r--phpBB/includes/template/template.php21
-rw-r--r--phpBB/includes/ucp/ucp_profile.php7
-rw-r--r--phpBB/includes/ucp/ucp_register.php9
-rw-r--r--phpBB/index.php2
-rw-r--r--phpBB/install/install_convert.php10
-rw-r--r--phpBB/install/install_install.php23
-rw-r--r--phpBB/language/en/acp/common.php2
-rw-r--r--phpBB/language/en/common.php2
-rw-r--r--phpBB/language/en/install.php8
-rw-r--r--phpBB/language/en/mcp.php1
-rw-r--r--phpBB/language/en/ucp.php4
-rw-r--r--phpBB/memberlist.php11
-rw-r--r--phpBB/search.php49
-rw-r--r--phpBB/styles/prosilver/template/mcp_front.html12
-rw-r--r--phpBB/styles/prosilver/template/mcp_queue.html2
-rw-r--r--phpBB/styles/prosilver/template/mcp_topic.html1
-rw-r--r--phpBB/styles/prosilver/template/memberlist_body.html2
-rw-r--r--phpBB/styles/prosilver/template/memberlist_leaders.html2
-rw-r--r--phpBB/styles/prosilver/template/memberlist_view.html2
-rw-r--r--phpBB/styles/prosilver/template/search_body.html2
-rw-r--r--phpBB/styles/prosilver/template/template.cfg5
-rw-r--r--phpBB/styles/prosilver/template/ucp_main_front.html4
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_message_header.html23
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_viewfolder.html1
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_viewmessage.html11
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html7
-rw-r--r--phpBB/styles/prosilver/template/ucp_profile_reg_details.html6
-rw-r--r--phpBB/styles/prosilver/template/ucp_register.html4
-rw-r--r--phpBB/styles/prosilver/template/viewonline_body.html2
-rw-r--r--phpBB/styles/prosilver/theme/bidi.css43
-rw-r--r--phpBB/styles/prosilver/theme/colours.css6
-rw-r--r--phpBB/styles/prosilver/theme/common.css14
-rw-r--r--phpBB/styles/prosilver/theme/cp.css28
-rw-r--r--phpBB/styles/prosilver/theme/en/stylesheet.css16
-rw-r--r--phpBB/styles/prosilver/theme/imageset.css1
-rw-r--r--phpBB/styles/prosilver/theme/tweaks.css4
-rw-r--r--phpBB/styles/subsilver2/template/captcha_default.html2
-rw-r--r--phpBB/styles/subsilver2/template/captcha_qa.html2
-rw-r--r--phpBB/styles/subsilver2/template/login_body.html2
-rw-r--r--phpBB/styles/subsilver2/template/mcp_front.html18
-rw-r--r--phpBB/styles/subsilver2/template/mcp_queue.html2
-rw-r--r--phpBB/styles/subsilver2/template/mcp_topic.html1
-rw-r--r--phpBB/styles/subsilver2/template/posting_body.html1
-rw-r--r--phpBB/styles/subsilver2/template/template.cfg4
-rw-r--r--phpBB/styles/subsilver2/template/ucp_main_front.html4
-rw-r--r--phpBB/styles/subsilver2/template/ucp_profile_reg_details.html6
-rw-r--r--phpBB/styles/subsilver2/template/ucp_register.html4
-rw-r--r--phpBB/styles/subsilver2/theme/stylesheet.css38
-rw-r--r--phpBB/viewforum.php2
-rw-r--r--phpBB/viewtopic.php2
-rw-r--r--phpunit.xml.all4
-rw-r--r--phpunit.xml.dist4
-rw-r--r--phpunit.xml.functional4
-rw-r--r--tests/bootstrap.php26
-rw-r--r--tests/dbal/select_test.php25
-rw-r--r--tests/extension/ext/foo/type/dummy/empty.txt0
-rw-r--r--tests/extension/fixtures/extensions.xml3
-rw-r--r--tests/group_positions/fixtures/group_positions.xml4
-rw-r--r--tests/template/template_inheritance_test.php9
-rw-r--r--tests/template/template_test.php36
-rw-r--r--tests/template/template_test_case.php11
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php3
-rw-r--r--travis/phpunit-mysql-travis.xml34
-rw-r--r--travis/phpunit-postgres-travis.xml36
103 files changed, 1192 insertions, 409 deletions
diff --git a/.gitignore b/.gitignore
index 1ac01d9b2d..d875beb784 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,7 @@
/phpBB/cache/*.php
/phpBB/cache/queue.php.lock
/phpBB/config.php
+/phpBB/ext/*
/phpBB/files/*
/phpBB/images/avatars/gallery/*
/phpBB/images/avatars/upload/*
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000000..d5e1231584
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,25 @@
+language: php
+php:
+ - 5.3.2
+ - 5.4
+
+env:
+ - DB=mysql
+ - DB=postgres
+
+before_script:
+ - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres; fi"
+ - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'create database phpbb_tests;' -U postgres; fi"
+ - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS phpbb_tests;'; fi"
+ - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.2' ]; then pear install --force phpunit/DbUnit; else pyrus install --force phpunit/DbUnit; fi"
+ - phpenv rehash
+
+script:
+ - phpunit --configuration travis/phpunit-$DB-travis.xml
+
+notifications:
+ email:
+ recipients:
+ - dev-team@phpbb.com
+ on_success: change
+ on_failure: change
diff --git a/README.md b/README.md
index 6b94f898a3..51e65176c6 100644
--- a/README.md
+++ b/README.md
@@ -15,6 +15,12 @@ Find support and lots more on [phpBB.com](http://www.phpbb.com)! Discuss the dev
3. [Read our Git Contribution Guidelines](http://wiki.phpbb.com/Git); if you're new to git, also read [the introduction guide](http://wiki.phpbb.com/display/DEV/Working+with+Git)
4. Send us a pull request
+## AUTOMATED TESTING
+
+We have unit and functional tests in order to prevent regressions. You can view the bamboo continuous integration [here](http://bamboo.phpbb.com) or check our travis build below.
+develop - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop)](http://travis-ci.org/phpbb/phpbb3)
+develop-olympus - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop-olympus)](http://travis-ci.org/phpbb/phpbb3)
+
## LICENSE
[GNU General Public License v2](http://opensource.org/licenses/gpl-2.0.php)
diff --git a/phpBB/adm/style/acp_users_overview.html b/phpBB/adm/style/acp_users_overview.html
index 9237e45daf..1f10e7f66e 100644
--- a/phpBB/adm/style/acp_users_overview.html
+++ b/phpBB/adm/style/acp_users_overview.html
@@ -46,10 +46,6 @@
<dd><input class="text medium" type="text" id="user_email" name="user_email" value="{USER_EMAIL}" autocomplete="off" /></dd>
</dl>
<dl>
- <dt><label for="email_confirm">{L_CONFIRM_EMAIL}:</label><br /><span>{L_CONFIRM_EMAIL_EXPLAIN}</span></dt>
- <dd><input class="text medium" type="text" id="email_confirm" name="email_confirm" value="" autocomplete="off" /></dd>
-</dl>
-<dl>
<dt><label for="new_password">{L_NEW_PASSWORD}:</label><br /><span>{L_CHANGE_PASSWORD_EXPLAIN}</span></dt>
<dd><input type="password" id="new_password" name="new_password" value="" autocomplete="off" /></dd>
</dl>
diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css
index 666f4921ba..ceda824e5a 100644
--- a/phpBB/adm/style/admin.css
+++ b/phpBB/adm/style/admin.css
@@ -1007,11 +1007,11 @@ fieldset.submit-buttons legend {
/* Input field styles
---------------------------------------- */
-input.radio, input.permissions-checkbox {
+input.radio, input.checkbox, input.permissions-checkbox {
width: auto !important;
background-color: transparent;
border: none;
- cursor: default;
+ cursor: pointer;
}
input.full,
diff --git a/phpBB/adm/style/install_update.html b/phpBB/adm/style/install_update.html
index 22d21d8314..818889c89b 100644
--- a/phpBB/adm/style/install_update.html
+++ b/phpBB/adm/style/install_update.html
@@ -43,6 +43,11 @@
<p>{WARNING_MSG}</p>
</div>
<!-- ENDIF -->
+
+ <div class="errorbox" style="margin-top: 0;">
+ <h3>{L_NOTICE}</h3>
+ <p>{L_BACKUP_NOTICE}</p>
+ </div>
<form id="install_update" method="post" action="{U_ACTION}">
diff --git a/phpBB/develop/compile_template.php b/phpBB/develop/compile_template.php
index e741e909d8..32d1d321f1 100644
--- a/phpBB/develop/compile_template.php
+++ b/phpBB/develop/compile_template.php
@@ -20,5 +20,5 @@ include($phpbb_root_path . 'includes/template_compile.'.$phpEx);
$file = $argv[1];
-$compile = new phpbb_template_compile();
+$compile = new phpbb_template_compile(false);
echo $compile->compile_file($file);
diff --git a/phpBB/develop/create_search_index.php b/phpBB/develop/create_search_index.php
index 28001035f6..f329b805a0 100644
--- a/phpBB/develop/create_search_index.php
+++ b/phpBB/develop/create_search_index.php
@@ -25,7 +25,6 @@ $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
require($phpbb_root_path . 'common.' . $phpEx);
require($phpbb_root_path . 'includes/acp/acp_search.' . $phpEx);
-require($phpbb_root_path . 'includes/search/' . $class_name . '.' . $phpEx);
$user->session_begin();
$auth->acl($user->data);
@@ -36,7 +35,6 @@ $search_errors = array();
$search = new $class_name($search_errors);
$batch_size = isset($argv[2]) ? $argv[2] : 2000;
-$time = time();
if (method_exists($search, 'create_index'))
{
@@ -68,6 +66,7 @@ else
while ($post_counter <= $max_post_id)
{
$row_count = 0;
+ $time = time();
printf("Processing posts with %d <= post_id <= %d\n",
$post_counter + 1,
diff --git a/phpBB/develop/extensions.php b/phpBB/develop/extensions.php
new file mode 100644
index 0000000000..2f7c3d1167
--- /dev/null
+++ b/phpBB/develop/extensions.php
@@ -0,0 +1,123 @@
+<?php
+/**
+*
+* @copyright (c) 2012 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+define('IN_PHPBB', 1);
+define('ANONYMOUS', 1);
+$phpEx = substr(strrchr(__FILE__, '.'), 1);
+$phpbb_root_path = __DIR__.'/../';
+
+include($phpbb_root_path . 'common.'.$phpEx);
+
+function usage()
+{
+ echo "Usage: extensions.php COMMAND [OPTION]...\n";
+ echo "Console extension manager.\n";
+ echo "\n";
+ echo "list:\n";
+ echo " Lists all extensions in the database and the filesystem.\n";
+ echo "\n";
+ echo "enable NAME:\n";
+ echo " Enables the specified extension.\n";
+ echo "\n";
+ echo "disable NAME:\n";
+ echo " Disables the specified extension.\n";
+ echo "\n";
+ echo "purge NAME:\n";
+ echo " Purges the specified extension.\n";
+ exit(2);
+}
+
+function list_extensions()
+{
+ global $phpbb_extension_manager;
+
+ $phpbb_extension_manager->load_extensions();
+
+ echo "Enabled:\n";
+ $enabled = array_keys($phpbb_extension_manager->all_enabled());
+ print_extensions($enabled);
+ echo "\n";
+
+ echo "Disabled:\n";
+ $disabled = array_keys($phpbb_extension_manager->all_disabled());
+ print_extensions($disabled);
+ echo "\n";
+
+ echo "Available:\n";
+ $all = array_keys($phpbb_extension_manager->all_available());
+ $purged = array_diff($all, $enabled, $disabled);
+ print_extensions($purged);
+}
+
+function print_extensions($exts)
+{
+ foreach ($exts as $ext)
+ {
+ echo "- $ext\n";
+ }
+}
+
+function enable_extension($name)
+{
+ global $phpbb_extension_manager;
+
+ $phpbb_extension_manager->enable($name);
+}
+
+function disable_extension($name)
+{
+ global $phpbb_extension_manager;
+
+ $phpbb_extension_manager->disable($name);
+}
+
+function purge_extension($name)
+{
+ global $phpbb_extension_manager;
+
+ $phpbb_extension_manager->purge($name);
+}
+
+function validate_argument_count($count)
+{
+ global $argv;
+
+ if (count($argv) <= $count)
+ {
+ usage();
+ }
+}
+
+validate_argument_count(1);
+
+$action = $argv[1];
+
+switch ($action)
+{
+ case 'list':
+ list_extensions();
+ break;
+
+ case 'enable':
+ validate_argument_count(2);
+ enable_extension($argv[2]);
+ break;
+
+ case 'disable':
+ validate_argument_count(2);
+ disable_extension($argv[2]);
+ break;
+
+ case 'purge':
+ validate_argument_count(2);
+ purge_extension($argv[2]);
+ break;
+
+ default:
+ usage();
+}
diff --git a/phpBB/develop/imageset_to_css.php b/phpBB/develop/imageset_to_css.php
index 3d55808319..d49fe9c741 100644
--- a/phpBB/develop/imageset_to_css.php
+++ b/phpBB/develop/imageset_to_css.php
@@ -10,21 +10,21 @@ $phpbb_root_path = '../';
$style = 'subsilver2';
$imageset_path = $phpbb_root_path . 'styles/' . $style . '/imageset';
-$theme_path = $phpbb_root_path . 'styles/' . $style . '/theme2';
+$theme_path = $phpbb_root_path . 'styles/' . $style . '/theme';
// Start output buffering
ob_start();
// Get global and English images
$images_global = get_imageset($imageset_path);
-if($images_global === false)
+if ($images_global === false)
{
echo 'imageset.cfg was not found.';
echo ob_get_clean();
return;
}
$images_en = get_imageset($imageset_path, 'en');
-if($images_en === false)
+if ($images_en === false)
{
echo 'English imageset.cfg was not found.';
echo ob_get_clean();
@@ -32,7 +32,7 @@ if($images_en === false)
}
// Remove duplicate images
-foreach($images_en as $key => $row)
+foreach ($images_en as $key => $row)
{
unset($images_global[$key]);
}
@@ -52,13 +52,16 @@ $replace = array(
// $replace = array_merge($replace, get_replacements($images_global));
$replace = array_merge($replace, get_replacements($images_global), get_replacements($images_en));
+// BIDI code
+$bidi_code = css($images_global, './images/', true);
+
// Get all CSS files, parse them
$files = list_files($theme_path, 'css');
-if($files === false || !count($files))
+if ($files === false || !count($files))
{
echo 'No CSS files found in theme directory.<br />';
}
-else for($i=0; $i<count($files); $i++)
+else for ($i=0; $i<count($files); $i++)
{
$file = $theme_path . '/' . $files[$i];
$data = file_get_contents($file);
@@ -67,12 +70,20 @@ else for($i=0; $i<count($files); $i++)
$errors = false;
for($j=0; $j<count($not_compatible); $j++)
{
- if(strpos($data, $not_compatible[$j]) !== false)
+ if (strpos($data, $not_compatible[$j]) !== false)
{
echo 'Error: ', $file, ' contains ', $not_compatible[$j], '. That variable cannot be converted.<br />';
+ continue;
}
}
- if(md5($data) == $hash)
+ if (basename($file) == 'bidi.css' && strpos($data, '/* Former imageset */') === false && strlen($bidi_code))
+ {
+ // Add bidi data
+ $data .= "\n/* Former imageset */\n" . $bidi_code;
+ $bidi_code = '';
+ echo 'Note: RTL imageset entries were added at the end of file below:<br />';
+ }
+ if (md5($data) == $hash)
{
echo 'Nothing to replace in ', $file, '<br />';
}
@@ -84,9 +95,9 @@ else for($i=0; $i<count($files); $i++)
// Check if there are invalid images in imageset
$list = array_merge($images_global, $images_en);
-foreach($list as $key => $row)
+foreach ($list as $key => $row)
{
- if($row['skip'])
+ if ($row['skip'])
{
echo 'Unable to generate code to add to CSS files because some images are missing or invalid. See errors above.';
echo ob_get_clean();
@@ -112,14 +123,22 @@ span.imageset {
/* English images for fallback */
' . css($images_en, './en/');
+if (strlen($bidi_code))
+{
+ $code .= "\n/* RTL imageset entries */\n" . $bidi_code;
+}
echo 'Code to add to CSS file:', dump_code($code, 'imageset.css');
+
$list = list_languages($imageset_path);
-for($i=0; $i<count($list); $i++)
+for ($i=0; $i<count($list); $i++)
{
$lang = $list[$i];
$images = get_imageset($imageset_path . '/' . $lang);
- if(!count($images)) continue;
+ if (!count($images))
+ {
+ continue;
+ }
$code = '/* ' . strtoupper($lang) . ' Language Pack */
' . css($images, './');
echo 'New CSS file: ', $theme_path, '/', $lang, '/stylesheet.css', dump_code($code, 'stylesheet_' . $lang . '.css');
@@ -135,26 +154,35 @@ return;
function get_imageset($path, $lang = '')
{
$cfg = $path . ($lang ? '/' . $lang : '') . '/imageset.cfg';
- if(!@file_exists($cfg)) return false;
+ if (!@file_exists($cfg))
+ {
+ return false;
+ }
$data = file($cfg);
$result = array();
- for($i=0; $i<count($data); $i++)
+ for ($i=0; $i<count($data); $i++)
{
$str = trim($data[$i]);
- if(substr($str, 0, 4) != 'img_') continue;
+ if (substr($str, 0, 4) != 'img_')
+ {
+ continue;
+ }
$list = explode('=', $data[$i]);
- if(count($list) != 2) continue;
+ if (count($list) != 2)
+ {
+ continue;
+ }
$key = trim($list[0]);
$row = explode('*', trim($list[1]));
$file = trim($row[0]);
$height = isset($row[1]) && intval($row[1]) ? intval($row[1]) : false;
$width = isset($row[2]) && intval($row[2]) ? intval($row[2]) : false;
$skip = false;
- if(strlen($file) && (!$width || !$height))
+ if (strlen($file) && (!$width || !$height))
{
// Try to detect width/height
$filename = $path . ($lang ? '/' . $lang : '') . '/' . $file;
- if(!@file_exists($filename))
+ if (!@file_exists($filename))
{
echo 'Error: file ', $filename, ' does not exist and its dimensions are not available in imageset.cfg<br />';
$skip = true;
@@ -162,7 +190,7 @@ function get_imageset($path, $lang = '')
else
{
$size = @getimagesize($filename);
- if($size === false)
+ if ($size === false)
{
echo 'Error: file ', $filename, ' is not a valid image<br />';
$skip = true;
@@ -188,7 +216,7 @@ function get_imageset($path, $lang = '')
function get_replacements($list)
{
$result = array();
- foreach($list as $key => $row)
+ foreach ($list as $key => $row)
{
$key = '{' . strtoupper($key);
$result[$key . '_SRC}'] = strlen($row['file']) ? ($row['lang'] ? './' . $row['lang'] : './images') . '/' . $row['file'] : '';
@@ -201,9 +229,12 @@ function get_replacements($list)
function list_files($dir, $ext)
{
$res = @opendir($dir);
- if($res === false) return false;
+ if ($res === false)
+ {
+ return false;
+ }
$files = array();
- while(($file = readdir($res)) !== false)
+ while (($file = readdir($res)) !== false)
{
$list = explode('.', $file);
if(count($list) > 1 && strtolower($list[count($list) - 1]) == $ext)
@@ -218,13 +249,19 @@ function list_files($dir, $ext)
function list_languages($dir)
{
$res = @opendir($dir);
- if($res === false) return array();
+ if ($res === false)
+ {
+ return array();
+ }
$files = array();
- while(($file = readdir($res)) !== false)
+ while (($file = readdir($res)) !== false)
{
- if(substr($file, 0, 1) == '.') continue;
+ if (substr($file, 0, 1) == '.')
+ {
+ continue;
+ }
$filename = $dir . '/' . $file;
- if(is_dir($filename) && file_exists($filename . '/imageset.cfg'))
+ if (is_dir($filename) && file_exists($filename . '/imageset.cfg'))
{
$files[] = $file;
}
@@ -236,7 +273,7 @@ function list_languages($dir)
function dump_code($code, $filename = 'file.txt')
{
$hash = md5($code);
- if(isset($_GET['download']) && $_GET['download'] === $hash)
+ if (isset($_GET['download']) && $_GET['download'] === $hash)
{
// Download file
ob_end_clean();
@@ -256,18 +293,81 @@ function dump_code($code, $filename = 'file.txt')
echo '<textarea id="code-', $hash, '" onfocus="this.select();" style="width: 98%; height: 200px;">', htmlspecialchars($code), '</textarea><br />';
}
-function css($list, $path = './')
+function css($list, $path = './', $bidi = false)
{
$code = '';
- foreach($list as $key => $row)
+ // Change value to true if you want images to be grouped up by size
+ $group = $bidi;
+ if ($group)
{
- if(!strlen($row['file'])) continue;
- $code .= '.imageset.' . substr($key, 4) . ' {
+ // group up images by size
+ $groups = array();
+ foreach ($list as $key => $row)
+ {
+ if (!strlen($row['file']))
+ {
+ continue;
+ }
+ $groups[$row['width'] . '*' . $row['height']][] = $key;
+ }
+ foreach ($groups as $size => $keys)
+ {
+ $extra = '';
+ for ($i=0; $i<count($keys); $i++)
+ {
+ $code .= ($i == 0 ? '' : ', ') . ($bidi ? '.rtl ' : '') . '.imageset.' . substr($keys[$i], 4);
+ if (!$bidi)
+ {
+ $extra .= '.imageset.' . substr($keys[$i], 4) . ' { background-image: url("' . $path . $list[$keys[$i]]['file'] . "\"); }\n";
+ }
+ }
+ $row = $list[$keys[0]];
+ $code .= ' {';
+ if ($bidi)
+ {
+ $code .= '
+ padding-right: ' . $row['width'] . 'px;
+ padding-left: 0;
+}
+';
+ }
+ else
+ {
+ $code .= '
+ padding-left: ' . $row['width'] . 'px;
+ padding-top: ' . $row['height'] . 'px;
+}
+' . $extra;
+ }
+ }
+ }
+ else
+ {
+ foreach ($list as $key => $row)
+ {
+ if (!strlen($row['file']))
+ {
+ continue;
+ }
+ $code .= ($bidi ? '.rtl ' : '') . '.imageset.' . substr($key, 4) . ' {';
+ if ($bidi)
+ {
+ $code .= '
+ padding-right: ' . $row['width'] . 'px;
+ padding-left: 0;
+}
+';
+ }
+ else
+ {
+ $code .= '
background-image: url("' . $path . $row['file'] . '");
padding-left: ' . $row['width'] . 'px;
padding-top: ' . $row['height'] . 'px;
}
';
+ }
+ }
}
return $code;
}
diff --git a/phpBB/develop/search_fill.php b/phpBB/develop/search_fill.php
index 371c8c74cc..4c0b607778 100644
--- a/phpBB/develop/search_fill.php
+++ b/phpBB/develop/search_fill.php
@@ -34,13 +34,11 @@ $user->setup();
$search_type = $config['search_type'];
-if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+if (!class_exists($search_type))
{
trigger_error('NO_SUCH_SEARCH_MODULE');
}
-require($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx);
-
$error = false;
$search = new $search_type($error);
diff --git a/phpBB/feed.php b/phpBB/feed.php
index 00247c1958..fcf42a83ae 100644
--- a/phpBB/feed.php
+++ b/phpBB/feed.php
@@ -1106,7 +1106,7 @@ class phpbb_feed_forums extends phpbb_feed_base
global $user;
$item_row['statistics'] = $user->lang('TOTAL_TOPICS', (int) $row['forum_topics'])
- . ' ' . $this->separator_stats . ' ' . $user->lang('TOTAL_POSTS_OTHER', (int) $row['forum_posts']);
+ . ' ' . $this->separator_stats . ' ' . $user->lang('TOTAL_POSTS_COUNT', (int) $row['forum_posts']);
}
}
}
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index 60d5def4d1..511148baf9 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -508,11 +508,34 @@ class acp_profile
}
}
}
- /* else if ($field_type == FIELD_BOOL && $key == 'field_default_value')
+ else if ($field_type == FIELD_BOOL && $key == 'field_default_value')
{
- // Get the number of options if this key is 'field_maxlen'
- $var = request_var('field_default_value', 0);
- }*/
+ // 'field_length' == 1 defines radio buttons. Possible values are 1 or 2 only.
+ // 'field_length' == 2 defines checkbox. Possible values are 0 or 1 only.
+ // If we switch the type on step 2, we have to adjust field value.
+ // 1 is a common value for the checkbox and radio buttons.
+
+ // Adjust unchecked checkbox value.
+ // If we return or save settings from 2nd/3rd page
+ // and the checkbox is unchecked, set the value to 0.
+ if (isset($_REQUEST['step']) && !isset($_REQUEST[$key]))
+ {
+ $var = 0;
+ }
+
+ // If we switch to the checkbox type but former radio buttons value was 2,
+ // which is not the case for the checkbox, set it to 0 (unchecked).
+ if ($cp->vars['field_length'] == 2 && $var == 2)
+ {
+ $var = 0;
+ }
+ // If we switch to the radio buttons but the former checkbox value was 0,
+ // which is not the case for the radio buttons, set it to 0.
+ else if ($cp->vars['field_length'] == 1 && $var == 0)
+ {
+ $var = 2;
+ }
+ }
else if ($field_type == FIELD_INT && $key == 'field_default_value')
{
// Permit an empty string
@@ -680,6 +703,10 @@ class acp_profile
{
$_new_key_ary[$key] = utf8_normalize_nfc(request_var($key, array(array('')), true));
}
+ else if ($field_type == FIELD_BOOL && $key == 'field_default_value')
+ {
+ $_new_key_ary[$key] = request_var($key, $cp->vars[$key]);
+ }
else
{
if (!isset($_REQUEST[$key]))
diff --git a/phpBB/includes/acp/acp_ranks.php b/phpBB/includes/acp/acp_ranks.php
index 97cfd35750..ec5a76df87 100644
--- a/phpBB/includes/acp/acp_ranks.php
+++ b/phpBB/includes/acp/acp_ranks.php
@@ -51,7 +51,7 @@ class acp_ranks
}
$rank_title = utf8_normalize_nfc(request_var('title', '', true));
$special_rank = request_var('special_rank', 0);
- $min_posts = ($special_rank) ? 0 : request_var('min_posts', 0);
+ $min_posts = ($special_rank) ? 0 : max(0, request_var('min_posts', 0));
$rank_image = request_var('rank_image', '');
// The rank image has to be a jpg, gif or png
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index c8fe748c02..7b449d3b35 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -83,11 +83,11 @@ version = {VERSION}
$this->template_cfg .= '
# Some configuration options
-#
-# You can use this function to inherit templates from another template.
-# The template of the given name has to be installed.
-# Templates cannot inherit from inheriting templates.
-#';
+# Template inheritance
+# See http://blog.phpbb.com/2008/07/31/templating-just-got-easier/
+# Set value to empty or this template name to ignore template inheritance.
+inherit_from = {INHERIT_FROM}
+';
// Execute overall actions
switch ($action)
@@ -1346,9 +1346,7 @@ version = {VERSION}
// Export template core code
if ($mode == 'template' || $inc_template)
{
- $template_cfg = str_replace(array('{MODE}', '{NAME}', '{COPYRIGHT}', '{VERSION}'), array($mode, $style_row['template_name'], $style_row['template_copyright'], $config['version']), $this->template_cfg);
-
- $use_template_name = '';
+ $use_template_name = $style_row['template_name'];
// Add the inherit from variable, depending on it's use...
if ($style_row['template_inherits_id'])
@@ -1362,7 +1360,8 @@ version = {VERSION}
$db->sql_freeresult($result);
}
- $template_cfg .= ($use_template_name) ? "\ninherit_from = $use_template_name" : "\n#inherit_from = ";
+ $template_cfg = str_replace(array('{MODE}', '{NAME}', '{COPYRIGHT}', '{VERSION}', '{INHERIT_FROM}'), array($mode, $style_row['template_name'], $style_row['template_copyright'], $config['version'], $use_template_name), $this->template_cfg);
+
$template_cfg .= "\n\nbbcode_bitfield = {$style_row['bbcode_bitfield']}";
$data[] = array(
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index a282ef1d7f..cf6716c322 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -128,7 +128,7 @@ class acp_users
$dropdown_modes = array();
while ($row = $db->sql_fetchrow($result))
{
- if (!$this->p_master->module_auth($row['module_auth']))
+ if (!$this->p_master->module_auth_self($row['module_auth']))
{
continue;
}
@@ -756,7 +756,6 @@ class acp_users
'username' => utf8_normalize_nfc(request_var('user', $user_row['username'], true)),
'user_founder' => request_var('user_founder', ($user_row['user_type'] == USER_FOUNDER) ? 1 : 0),
'email' => strtolower(request_var('user_email', $user_row['user_email'])),
- 'email_confirm' => strtolower(request_var('email_confirm', '')),
'new_password' => request_var('new_password', '', true),
'password_confirm' => request_var('password_confirm', '', true),
);
@@ -788,7 +787,6 @@ class acp_users
array('string', false, 6, 60),
array('email', $user_row['user_email'])
),
- 'email_confirm' => array('string', true, 6, 60)
);
}
@@ -799,11 +797,6 @@ class acp_users
$error[] = 'NEW_PASSWORD_ERROR';
}
- if ($data['email'] != $user_row['user_email'] && $data['email_confirm'] != $data['email'])
- {
- $error[] = 'NEW_EMAIL_ERROR';
- }
-
if (!check_form_key($form_name))
{
$error[] = 'FORM_INVALID';
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php
index 8564cb8426..6da854b6e2 100644
--- a/phpBB/includes/db/dbal.php
+++ b/phpBB/includes/db/dbal.php
@@ -920,6 +920,41 @@ class dbal
return true;
}
+
+ /**
+ * Gets the estimated number of rows in a specified table.
+ *
+ * @param string $table_name Table name
+ *
+ * @return string Number of rows in $table_name.
+ * Prefixed with ~ if estimated (otherwise exact).
+ *
+ * @access public
+ */
+ function get_estimated_row_count($table_name)
+ {
+ return $this->get_row_count($table_name);
+ }
+
+ /**
+ * Gets the exact number of rows in a specified table.
+ *
+ * @param string $table_name Table name
+ *
+ * @return string Exact number of rows in $table_name.
+ *
+ * @access public
+ */
+ function get_row_count($table_name)
+ {
+ $sql = 'SELECT COUNT(*) AS rows_total
+ FROM ' . $this->sql_escape($table_name);
+ $result = $this->sql_query($sql);
+ $rows_total = $this->sql_fetchfield('rows_total');
+ $this->sql_freeresult($result);
+
+ return $rows_total;
+ }
}
/**
diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php
index 317b8d123d..eb38e3e913 100644
--- a/phpBB/includes/db/mysql.php
+++ b/phpBB/includes/db/mysql.php
@@ -318,6 +318,76 @@ class dbal_mysql extends dbal
}
/**
+ * Gets the estimated number of rows in a specified table.
+ *
+ * @param string $table_name Table name
+ *
+ * @return string Number of rows in $table_name.
+ * Prefixed with ~ if estimated (otherwise exact).
+ *
+ * @access public
+ */
+ function get_estimated_row_count($table_name)
+ {
+ $table_status = $this->get_table_status($table_name);
+
+ if (isset($table_status['Engine']))
+ {
+ if ($table_status['Engine'] === 'MyISAM')
+ {
+ return $table_status['Rows'];
+ }
+ else if ($table_status['Engine'] === 'InnoDB' && $table_status['Rows'] > 100000)
+ {
+ return '~' . $table_status['Rows'];
+ }
+ }
+
+ return parent::get_row_count($table_name);
+ }
+
+ /**
+ * Gets the exact number of rows in a specified table.
+ *
+ * @param string $table_name Table name
+ *
+ * @return string Exact number of rows in $table_name.
+ *
+ * @access public
+ */
+ function get_row_count($table_name)
+ {
+ $table_status = $this->get_table_status($table_name);
+
+ if (isset($table_status['Engine']) && $table_status['Engine'] === 'MyISAM')
+ {
+ return $table_status['Rows'];
+ }
+
+ return parent::get_row_count($table_name);
+ }
+
+ /**
+ * Gets some information about the specified table.
+ *
+ * @param string $table_name Table name
+ *
+ * @return array
+ *
+ * @access protected
+ */
+ function get_table_status($table_name)
+ {
+ $sql = "SHOW TABLE STATUS
+ LIKE '" . $this->sql_escape($table_name) . "'";
+ $result = $this->sql_query($sql);
+ $table_status = $this->sql_fetchrow($result);
+ $this->sql_freeresult($result);
+
+ return $table_status;
+ }
+
+ /**
* Build LIKE expression
* @access private
*/
diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php
index d6b64bf7c8..4210a58002 100644
--- a/phpBB/includes/db/mysqli.php
+++ b/phpBB/includes/db/mysqli.php
@@ -315,6 +315,76 @@ class dbal_mysqli extends dbal
}
/**
+ * Gets the estimated number of rows in a specified table.
+ *
+ * @param string $table_name Table name
+ *
+ * @return string Number of rows in $table_name.
+ * Prefixed with ~ if estimated (otherwise exact).
+ *
+ * @access public
+ */
+ function get_estimated_row_count($table_name)
+ {
+ $table_status = $this->get_table_status($table_name);
+
+ if (isset($table_status['Engine']))
+ {
+ if ($table_status['Engine'] === 'MyISAM')
+ {
+ return $table_status['Rows'];
+ }
+ else if ($table_status['Engine'] === 'InnoDB' && $table_status['Rows'] > 100000)
+ {
+ return '~' . $table_status['Rows'];
+ }
+ }
+
+ return parent::get_row_count($table_name);
+ }
+
+ /**
+ * Gets the exact number of rows in a specified table.
+ *
+ * @param string $table_name Table name
+ *
+ * @return string Exact number of rows in $table_name.
+ *
+ * @access public
+ */
+ function get_row_count($table_name)
+ {
+ $table_status = $this->get_table_status($table_name);
+
+ if (isset($table_status['Engine']) && $table_status['Engine'] === 'MyISAM')
+ {
+ return $table_status['Rows'];
+ }
+
+ return parent::get_row_count($table_name);
+ }
+
+ /**
+ * Gets some information about the specified table.
+ *
+ * @param string $table_name Table name
+ *
+ * @return array
+ *
+ * @access protected
+ */
+ function get_table_status($table_name)
+ {
+ $sql = "SHOW TABLE STATUS
+ LIKE '" . $this->sql_escape($table_name) . "'";
+ $result = $this->sql_query($sql);
+ $table_status = $this->sql_fetchrow($result);
+ $this->sql_freeresult($result);
+
+ return $table_status;
+ }
+
+ /**
* Build LIKE expression
* @access private
*/
diff --git a/phpBB/includes/extension/finder.php b/phpBB/includes/extension/finder.php
index e5e5e4983e..23b9f1c658 100644
--- a/phpBB/includes/extension/finder.php
+++ b/phpBB/includes/extension/finder.php
@@ -375,6 +375,10 @@ class phpbb_extension_finder
{
$directory_pattern = preg_quote(DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $directory) . DIRECTORY_SEPARATOR, '#');
}
+ if ($is_dir)
+ {
+ $directory_pattern .= '$';
+ }
$directory_pattern = '#' . $directory_pattern . '#';
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST);
diff --git a/phpBB/includes/extension/manager.php b/phpBB/includes/extension/manager.php
index 438578e7e7..c38f0df32e 100644
--- a/phpBB/includes/extension/manager.php
+++ b/phpBB/includes/extension/manager.php
@@ -61,7 +61,7 @@ class phpbb_extension_manager
*
* @return null
*/
- protected function load_extensions()
+ public function load_extensions()
{
$sql = 'SELECT *
FROM ' . $this->extension_table;
@@ -167,6 +167,11 @@ class phpbb_extension_manager
$this->db->sql_query($sql);
}
+ if ($this->cache)
+ {
+ $this->cache->destroy($this->cache_name);
+ }
+
return !$active;
}
@@ -219,6 +224,11 @@ class phpbb_extension_manager
WHERE ext_name = '" . $this->db->sql_escape($name) . "'";
$this->db->sql_query($sql);
+ if ($this->cache)
+ {
+ $this->cache->destroy($this->cache_name);
+ }
+
return true;
}
@@ -234,6 +244,11 @@ class phpbb_extension_manager
WHERE ext_name = '" . $this->db->sql_escape($name) . "'";
$this->db->sql_query($sql);
+ if ($this->cache)
+ {
+ $this->cache->destroy($this->cache_name);
+ }
+
return false;
}
@@ -292,6 +307,11 @@ class phpbb_extension_manager
WHERE ext_name = '" . $this->db->sql_escape($name) . "'";
$this->db->sql_query($sql);
+ if ($this->cache)
+ {
+ $this->cache->destroy($this->cache_name);
+ }
+
return true;
}
@@ -301,6 +321,11 @@ class phpbb_extension_manager
WHERE ext_name = '" . $this->db->sql_escape($name) . "'";
$this->db->sql_query($sql);
+ if ($this->cache)
+ {
+ $this->cache->destroy($this->cache_name);
+ }
+
return false;
}
@@ -329,7 +354,8 @@ class phpbb_extension_manager
$available = array();
$iterator = new RecursiveIteratorIterator(
- new RecursiveDirectoryIterator($this->phpbb_root_path . 'ext/'));
+ new RecursiveDirectoryIterator($this->phpbb_root_path . 'ext/'),
+ RecursiveIteratorIterator::SELF_FIRST);
foreach ($iterator as $file_info)
{
if ($file_info->isFile() && $file_info->getFilename() == 'ext' . $this->phpEx)
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index a60edb5cee..9913a80a70 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -3091,6 +3091,11 @@ function parse_cfg_file($filename, $lines = false)
$parsed_items[$key] = $value;
}
+
+ if (isset($parsed_items['inherit_from']) && isset($parsed_items['name']) && $parsed_items['inherit_from'] == $parsed_items['name'])
+ {
+ unset($parsed_items['inherit_from']);
+ }
return $parsed_items;
}
@@ -4627,7 +4632,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
foreach ($_EXTRA_URL as $url_param)
{
$url_param = explode('=', $url_param, 2);
- $s_hidden_fields[$url_param[0]] = $url_param[1];
+ $s_search_hidden_fields[$url_param[0]] = $url_param[1];
}
}
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 7fdf874456..9798e514c1 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -847,15 +847,13 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
}
// Remove the message from the search index
- $search_type = basename($config['search_type']);
+ $search_type = $config['search_type'];
- if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+ if (!class_exists($search_type))
{
trigger_error('NO_SUCH_SEARCH_MODULE');
}
- include_once("{$phpbb_root_path}includes/search/$search_type.$phpEx");
-
$error = false;
$search = new $search_type($error);
@@ -2330,7 +2328,7 @@ function cache_moderators()
$ug_id_ary = array_keys($hold_ary);
// Remove users who have group memberships with DENY moderator permissions
- $sql_ary = array(
+ $sql_ary_deny = array(
'SELECT' => 'a.forum_id, ug.user_id, g.group_id',
'FROM' => array(
@@ -2357,7 +2355,7 @@ function cache_moderators()
AND ug.user_pending = 0
AND o.auth_option " . $db->sql_like_expression('m_' . $db->any_char),
);
- $sql = $db->sql_build_query('SELECT', $sql_ary);
+ $sql = $db->sql_build_query('SELECT', $sql_ary_deny);
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php
index de25e390fa..1486113013 100644
--- a/phpBB/includes/functions_download.php
+++ b/phpBB/includes/functions_download.php
@@ -126,7 +126,7 @@ function send_file_to_browser($attachment, $upload_dir, $category)
if (!@file_exists($filename))
{
send_status_line(404, 'Not Found');
- trigger_error($user->lang['ERROR_NO_ATTACHMENT'] . '<br /><br />' . sprintf($user->lang['FILE_NOT_FOUND_404'], $filename));
+ trigger_error('ERROR_NO_ATTACHMENT');
}
// Correct the mime type - we force application/octetstream for all files, except images
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index 13d9b6a5cb..f4e49b1b18 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -1136,6 +1136,7 @@ class smtp_class
{
var $server_response = '';
var $socket = 0;
+ protected $socket_tls = false;
var $responses = array();
var $commands = array();
var $numeric_response_code = 0;
@@ -1286,30 +1287,29 @@ class smtp_class
}
}
- // Try EHLO first
- $this->server_send("EHLO {$local_host}");
- if ($err_msg = $this->server_parse('250', __LINE__))
+ $hello_result = $this->hello($local_host);
+ if (!is_null($hello_result))
{
- // a 503 response code means that we're already authenticated
- if ($this->numeric_response_code == 503)
- {
- return false;
- }
-
- // If EHLO fails, we try HELO
- $this->server_send("HELO {$local_host}");
- if ($err_msg = $this->server_parse('250', __LINE__))
- {
- return ($this->numeric_response_code == 503) ? false : $err_msg;
- }
+ return $hello_result;
}
- foreach ($this->responses as $response)
+ // SMTP STARTTLS (RFC 3207)
+ if (!$this->socket_tls)
{
- $response = explode(' ', $response);
- $response_code = $response[0];
- unset($response[0]);
- $this->commands[$response_code] = implode(' ', $response);
+ $this->socket_tls = $this->starttls();
+
+ if ($this->socket_tls)
+ {
+ // Switched to TLS
+ // RFC 3207: "The client MUST discard any knowledge obtained from the server, [...]"
+ // So say hello again
+ $hello_result = $this->hello($local_host);
+
+ if (!is_null($hello_result))
+ {
+ return $hello_result;
+ }
+ }
}
// If we are not authenticated yet, something might be wrong if no username and passwd passed
@@ -1356,6 +1356,79 @@ class smtp_class
}
/**
+ * SMTP EHLO/HELO
+ *
+ * @return mixed Null if the authentication process is supposed to continue
+ * False if already authenticated
+ * Error message (string) otherwise
+ */
+ protected function hello($hostname)
+ {
+ // Try EHLO first
+ $this->server_send("EHLO $hostname");
+ if ($err_msg = $this->server_parse('250', __LINE__))
+ {
+ // a 503 response code means that we're already authenticated
+ if ($this->numeric_response_code == 503)
+ {
+ return false;
+ }
+
+ // If EHLO fails, we try HELO
+ $this->server_send("HELO $hostname");
+ if ($err_msg = $this->server_parse('250', __LINE__))
+ {
+ return ($this->numeric_response_code == 503) ? false : $err_msg;
+ }
+ }
+
+ foreach ($this->responses as $response)
+ {
+ $response = explode(' ', $response);
+ $response_code = $response[0];
+ unset($response[0]);
+ $this->commands[$response_code] = implode(' ', $response);
+ }
+ }
+
+ /**
+ * SMTP STARTTLS (RFC 3207)
+ *
+ * @return bool Returns true if TLS was started
+ * Otherwise false
+ */
+ protected function starttls()
+ {
+ if (!function_exists('stream_socket_enable_crypto'))
+ {
+ return false;
+ }
+
+ if (!isset($this->commands['STARTTLS']))
+ {
+ return false;
+ }
+
+ $this->server_send('STARTTLS');
+
+ if ($err_msg = $this->server_parse('220', __LINE__))
+ {
+ return false;
+ }
+
+ $result = false;
+ $stream_meta = stream_get_meta_data($this->socket);
+
+ if (socket_set_blocking($this->socket, 1));
+ {
+ $result = stream_socket_enable_crypto($this->socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT);
+ socket_set_blocking($this->socket, (int) $stream_meta['blocked']);
+ }
+
+ return $result;
+ }
+
+ /**
* Pop before smtp authentication
*/
function pop_before_smtp($hostname, $username, $password)
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index b7bb770031..ad76be9f2f 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -128,7 +128,7 @@ class p_master
foreach ($this->module_cache['modules'] as $key => $row)
{
// Not allowed to view module?
- if (!$this->module_auth($row['module_auth']))
+ if (!$this->module_auth_self($row['module_auth']))
{
unset($this->module_cache['modules'][$key]);
continue;
@@ -315,9 +315,23 @@ class p_master
}
/**
- * Check module authorisation
+ * Check module authorisation.
+ *
+ * This is a non-static version that uses $this->acl_forum_id
+ * for the forum id.
+ */
+ function module_auth_self($module_auth)
+ {
+ return self::module_auth($module_auth, $this->acl_forum_id);
+ }
+
+ /**
+ * Check module authorisation.
+ *
+ * This is a static version, it must be given $forum_id.
+ * See also module_auth_self.
*/
- function module_auth($module_auth, $forum_id = false)
+ static function module_auth($module_auth, $forum_id)
{
global $auth, $config;
global $request;
@@ -362,11 +376,9 @@ class p_master
$module_auth = implode(' ', $tokens);
- // Make sure $id seperation is working fine
+ // Make sure $id separation is working fine
$module_auth = str_replace(' , ', ',', $module_auth);
- $forum_id = ($forum_id === false) ? $this->acl_forum_id : $forum_id;
-
$is_auth = false;
eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z0-9_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z0-9_]+)#', '#cfg_([a-z0-9_]+)#', '#request_([a-zA-Z0-9_]+)#'), array('(int) $auth->acl_get(\'\\1\'\\2)', '(int) $forum_id', '(int) $auth->acl_getf_global(\'\\1\')', '(int) $config[\'\\1\']', '$request->variable(\'\\1\', false)'), $module_auth) . ');');
@@ -923,6 +935,6 @@ class p_master
*/
protected function is_full_class($basename)
{
- return (substr($basename, 0, 6) === 'phpbb_' || substr($basename, 0, strlen($this->p_class) + 1) === $this->p_class . '_');
+ return (preg_match('/^(phpbb|ucp|mcp|acp)_/', $basename));
}
}
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 104fc841b6..b3816baedd 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -1180,36 +1180,32 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
$topic_title = ($topic_notification) ? $topic_title : $subject;
$topic_title = censor_text($topic_title);
- // Get banned User ID's
- $sql = 'SELECT ban_userid
- FROM ' . BANLIST_TABLE . '
- WHERE ban_userid <> 0
- AND ban_exclude <> 1';
- $result = $db->sql_query($sql);
-
- $sql_ignore_users = ANONYMOUS . ', ' . $user->data['user_id'];
- while ($row = $db->sql_fetchrow($result))
+ // Exclude guests, current user and banned users from notifications
+ if (!function_exists('phpbb_get_banned_user_ids'))
{
- $sql_ignore_users .= ', ' . (int) $row['ban_userid'];
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
}
- $db->sql_freeresult($result);
+ $sql_ignore_users = phpbb_get_banned_user_ids();
+ $sql_ignore_users[ANONYMOUS] = ANONYMOUS;
+ $sql_ignore_users[$user->data['user_id']] = $user->data['user_id'];
$notify_rows = array();
// -- get forum_userids || topic_userids
$sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber
FROM ' . (($topic_notification) ? TOPICS_WATCH_TABLE : FORUMS_WATCH_TABLE) . ' w, ' . USERS_TABLE . ' u
- WHERE w.' . (($topic_notification) ? 'topic_id' : 'forum_id') . ' = ' . (($topic_notification) ? $topic_id : $forum_id) . "
- AND w.user_id NOT IN ($sql_ignore_users)
- AND w.notify_status = " . NOTIFY_YES . '
+ WHERE w.' . (($topic_notification) ? 'topic_id' : 'forum_id') . ' = ' . (($topic_notification) ? $topic_id : $forum_id) . '
+ AND ' . $db->sql_in_set('w.user_id', $sql_ignore_users, true) . '
+ AND w.notify_status = ' . NOTIFY_YES . '
AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
AND u.user_id = w.user_id';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
- $notify_rows[$row['user_id']] = array(
- 'user_id' => $row['user_id'],
+ $notify_user_id = (int) $row['user_id'];
+ $notify_rows[$notify_user_id] = array(
+ 'user_id' => $notify_user_id,
'username' => $row['username'],
'user_email' => $row['user_email'],
'user_jabber' => $row['user_jabber'],
@@ -1219,30 +1215,29 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
'method' => $row['user_notify_type'],
'allowed' => false
);
+
+ // Add users who have been already notified to ignore list
+ $sql_ignore_users[$notify_user_id] = $notify_user_id;
}
$db->sql_freeresult($result);
// forum notification is sent to those not already receiving topic notifications
if ($topic_notification)
{
- if (sizeof($notify_rows))
- {
- $sql_ignore_users .= ', ' . implode(', ', array_keys($notify_rows));
- }
-
$sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber
FROM ' . FORUMS_WATCH_TABLE . ' fw, ' . USERS_TABLE . " u
WHERE fw.forum_id = $forum_id
- AND fw.user_id NOT IN ($sql_ignore_users)
- AND fw.notify_status = " . NOTIFY_YES . '
+ AND " . $db->sql_in_set('fw.user_id', $sql_ignore_users, true) . '
+ AND fw.notify_status = ' . NOTIFY_YES . '
AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
AND u.user_id = fw.user_id';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
- $notify_rows[$row['user_id']] = array(
- 'user_id' => $row['user_id'],
+ $notify_user_id = (int) $row['user_id'];
+ $notify_rows[$notify_user_id] = array(
+ 'user_id' => $notify_user_id,
'username' => $row['username'],
'user_email' => $row['user_email'],
'user_jabber' => $row['user_jabber'],
@@ -1273,7 +1268,6 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
}
}
-
// Now, we have to do a little step before really sending, we need to distinguish our users a little bit. ;)
$msg_users = $delete_ids = $update_notification = array();
foreach ($notify_rows as $user_id => $row)
@@ -1286,6 +1280,20 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
{
$msg_users[] = $row;
$update_notification[$row['notify_type']][] = $row['user_id'];
+
+ /*
+ * We also update the forums watch table for this user when we are
+ * sending out a topic notification to prevent sending out another
+ * notification in case this user is also subscribed to the forum
+ * this topic was posted in.
+ * Since an UPDATE query is used, this has no effect on users only
+ * subscribed to the topic (i.e. no row is created) and should not
+ * be a performance issue.
+ */
+ if ($row['notify_type'] === 'topic')
+ {
+ $update_notification['forum'][] = $row['user_id'];
+ }
}
}
unset($notify_rows);
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 91e453b8e0..a6fb87536a 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -1666,6 +1666,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i
$subject = censor_text($subject);
+ // Exclude guests, current user and banned users from notifications
unset($recipients[ANONYMOUS], $recipients[$user->data['user_id']]);
if (!sizeof($recipients))
@@ -1673,18 +1674,12 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i
return;
}
- // Get banned User ID's
- $sql = 'SELECT ban_userid
- FROM ' . BANLIST_TABLE . '
- WHERE ' . $db->sql_in_set('ban_userid', array_map('intval', array_keys($recipients))) . '
- AND ban_exclude = 0';
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
+ if (!function_exists('phpbb_get_banned_user_ids'))
{
- unset($recipients[$row['ban_userid']]);
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
}
- $db->sql_freeresult($result);
+ $banned_users = phpbb_get_banned_user_ids(array_keys($recipients));
+ $recipients = array_diff(array_keys($recipients), $banned_users);
if (!sizeof($recipients))
{
@@ -1693,7 +1688,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i
$sql = 'SELECT user_id, username, user_email, user_lang, user_notify_pm, user_notify_type, user_jabber
FROM ' . USERS_TABLE . '
- WHERE ' . $db->sql_in_set('user_id', array_map('intval', array_keys($recipients)));
+ WHERE ' . $db->sql_in_set('user_id', $recipients);
$result = $db->sql_query($sql);
$msg_list_ary = array();
diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php
index 26c4283f67..34d973b3a6 100644
--- a/phpBB/includes/functions_profile_fields.php
+++ b/phpBB/includes/functions_profile_fields.php
@@ -570,7 +570,12 @@ class custom_profile
$this->get_option_lang($field_id, $lang_id, FIELD_DROPDOWN, false);
}
- if ($value == $ident_ary['data']['field_novalue'])
+ // If a dropdown field is required, users
+ // cannot choose the "no value" option.
+ // They must choose one of the other options.
+ // Therefore, here we treat a value equal to
+ // the "no value" as a lack of value, i.e. NULL.
+ if ($value == $ident_ary['data']['field_novalue'] && $ident_ary['data']['field_required'])
{
return NULL;
}
@@ -625,10 +630,10 @@ class custom_profile
$profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident'];
$user_ident = $profile_row['field_ident'];
- // checkbox - only testing for isset
+ // checkbox - set the value to "true" if it has been set to 1
if ($profile_row['field_type'] == FIELD_BOOL && $profile_row['field_length'] == 2)
{
- $value = (isset($_REQUEST[$profile_row['field_ident']])) ? true : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]);
+ $value = (isset($_REQUEST[$profile_row['field_ident']]) && request_var($profile_row['field_ident'], $default_value) == 1) ? true : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]);
}
else if ($profile_row['field_type'] == FIELD_INT)
{
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 509e1a953c..18452c27e9 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -3691,3 +3691,36 @@ function remove_newly_registered($user_id, $user_data = false)
return $user_data['group_id'];
}
+
+/**
+* Gets user ids of currently banned registered users.
+*
+* @param array $user_ids Array of users' ids to check for banning,
+* leave empty to get complete list of banned ids
+* @return array Array of banned users' ids if any, empty array otherwise
+*/
+function phpbb_get_banned_user_ids($user_ids = array())
+{
+ global $db;
+
+ $sql_user_ids = (!empty($user_ids)) ? $db->sql_in_set('ban_userid', $user_ids) : 'ban_userid <> 0';
+
+ // Get banned User ID's
+ // Ignore stale bans which were not wiped yet
+ $banned_ids_list = array();
+ $sql = 'SELECT ban_userid
+ FROM ' . BANLIST_TABLE . "
+ WHERE $sql_user_ids
+ AND ban_exclude <> 1
+ AND (ban_end > " . time() . '
+ OR ban_end = 0)';
+ $result = $db->sql_query($sql);
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $user_id = (int) $row['ban_userid'];
+ $banned_ids_list[$user_id] = $user_id;
+ }
+ $db->sql_freeresult($result);
+
+ return $banned_ids_list;
+}
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index 10e5956fc2..a21c67924d 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -907,16 +907,11 @@ function mcp_fork_topic($topic_ids)
if (!isset($search_type) && $topic_row['enable_indexing'])
{
// Select the search method and do some additional checks to ensure it can actually be utilised
- $search_type = basename($config['search_type']);
-
- if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
- {
- trigger_error('NO_SUCH_SEARCH_MODULE');
- }
+ $search_type = $config['search_type'];
if (!class_exists($search_type))
{
- include("{$phpbb_root_path}includes/search/$search_type.$phpEx");
+ trigger_error('NO_SUCH_SEARCH_MODULE');
}
$error = false;
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php
index ee79928eb1..2a52a858b3 100644
--- a/phpBB/includes/mcp/mcp_post.php
+++ b/phpBB/includes/mcp/mcp_post.php
@@ -464,12 +464,10 @@ function change_poster(&$post_info, $userdata)
}
// refresh search cache of this post
- $search_type = basename($config['search_type']);
+ $search_type = $config['search_type'];
- if (file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+ if (class_exists($search_type))
{
- require("{$phpbb_root_path}includes/search/$search_type.$phpEx");
-
// We do some additional checks in the module to ensure it can actually be utilised
$error = false;
$search = new $search_type($error);
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index 598b470663..d4ba89b04c 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -49,6 +49,16 @@ function mcp_topic_view($id, $mode, $action)
$submitted_id_list = request_var('post_ids', array(0));
$checked_ids = $post_id_list = request_var('post_id_list', array(0));
+ // Resync Topic?
+ if ($action == 'resync')
+ {
+ if (!function_exists('mcp_resync_topics'))
+ {
+ include($phpbb_root_path . 'includes/mcp/mcp_forum.' . $phpEx);
+ }
+ mcp_resync_topics(array($topic_id));
+ }
+
// Split Topic?
if ($action == 'split_all' || $action == 'split_beyond')
{
@@ -319,6 +329,7 @@ function mcp_topic_view($id, $mode, $action)
'S_CAN_APPROVE' => ($has_unapproved_posts && $auth->acl_get('m_approve', $topic_info['forum_id'])) ? true : false,
'S_CAN_LOCK' => ($auth->acl_get('m_lock', $topic_info['forum_id'])) ? true : false,
'S_CAN_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? true : false,
+ 'S_CAN_SYNC' => $auth->acl_get('m_', $topic_info['forum_id']),
'S_REPORT_VIEW' => ($action == 'reports') ? true : false,
'S_MERGE_VIEW' => ($action == 'merge') ? true : false,
'S_SPLIT_VIEW' => ($action == 'split') ? true : false,
diff --git a/phpBB/includes/request/type_cast_helper.php b/phpBB/includes/request/type_cast_helper.php
index 5aa0372328..561e8fc251 100644
--- a/phpBB/includes/request/type_cast_helper.php
+++ b/phpBB/includes/request/type_cast_helper.php
@@ -34,7 +34,7 @@ class phpbb_request_type_cast_helper implements phpbb_request_type_cast_helper_i
*/
public function __construct()
{
- if (version_compare(PHP_VERSION, '6.0.0-dev', '>='))
+ if (version_compare(PHP_VERSION, '5.4.0-dev', '>='))
{
$this->strip = false;
}
diff --git a/phpBB/includes/search/base.php b/phpBB/includes/search/base.php
index f691bc942f..b364dead9a 100644
--- a/phpBB/includes/search/base.php
+++ b/phpBB/includes/search/base.php
@@ -294,7 +294,7 @@ class phpbb_search_base
$sql_where = '';
foreach ($authors as $author)
{
- $sql_where .= (($sql_where) ? ' OR ' : '') . 'search_authors LIKE \'% ' . (int) $author . ' %\'';
+ $sql_where .= (($sql_where) ? ' OR ' : '') . 'search_authors ' . $db->sql_like_expression($db->any_char . ' ' . (int) $author . ' ' . $db->any_char);
}
$sql = 'SELECT search_key
diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php
index 5372cfac7b..7c94038cc9 100644
--- a/phpBB/includes/search/fulltext_mysql.php
+++ b/phpBB/includes/search/fulltext_mysql.php
@@ -708,7 +708,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
*/
function index_remove($post_ids, $author_ids, $forum_ids)
{
- $this->destroy_cache(array(), $author_ids);
+ $this->destroy_cache(array(), array_unique($author_ids));
}
/**
@@ -897,11 +897,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
}
$db->sql_freeresult($result);
- $sql = 'SELECT COUNT(post_id) as total_posts
- FROM ' . POSTS_TABLE;
- $result = $db->sql_query($sql);
- $this->stats['total_posts'] = (int) $db->sql_fetchfield('total_posts');
- $db->sql_freeresult($result);
+ $this->stats['total_posts'] = empty($this->stats) ? 0 : $db->get_estimated_row_count(POSTS_TABLE);
}
/**
diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php
index b9085695ac..3e029c86d0 100644
--- a/phpBB/includes/search/fulltext_native.php
+++ b/phpBB/includes/search/fulltext_native.php
@@ -1335,7 +1335,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
$db->sql_query($sql);
}
- $this->destroy_cache(array_unique($word_texts), $author_ids);
+ $this->destroy_cache(array_unique($word_texts), array_unique($author_ids));
}
/**
@@ -1462,17 +1462,8 @@ class phpbb_search_fulltext_native extends phpbb_search_base
{
global $db;
- $sql = 'SELECT COUNT(*) as total_words
- FROM ' . SEARCH_WORDLIST_TABLE;
- $result = $db->sql_query($sql);
- $this->stats['total_words'] = (int) $db->sql_fetchfield('total_words');
- $db->sql_freeresult($result);
-
- $sql = 'SELECT COUNT(*) as total_matches
- FROM ' . SEARCH_WORDMATCH_TABLE;
- $result = $db->sql_query($sql);
- $this->stats['total_matches'] = (int) $db->sql_fetchfield('total_matches');
- $db->sql_freeresult($result);
+ $this->stats['total_words'] = $db->get_estimated_row_count(SEARCH_WORDLIST_TABLE);
+ $this->stats['total_matches'] = $db->get_estimated_row_count(SEARCH_WORDMATCH_TABLE);
}
/**
diff --git a/phpBB/includes/startup.php b/phpBB/includes/startup.php
index 2100fbd97e..fc45cd882b 100644
--- a/phpBB/includes/startup.php
+++ b/phpBB/includes/startup.php
@@ -19,7 +19,8 @@ if (!defined('E_DEPRECATED'))
{
define('E_DEPRECATED', 8192);
}
-error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
+$level = E_ALL & ~E_NOTICE & ~E_DEPRECATED;
+error_reporting($level);
/*
* Remove variables created by register_globals from the global scope
diff --git a/phpBB/includes/template/context.php b/phpBB/includes/template/context.php
index 65a3531bc5..ec09da1cf3 100644
--- a/phpBB/includes/template/context.php
+++ b/phpBB/includes/template/context.php
@@ -53,7 +53,9 @@ class phpbb_template_context
}
/**
- * Assign a single variable to a single key
+ * Assign a single scalar value to a single key.
+ *
+ * Value can be a string, an integer or a boolean.
*
* @param string $varname Variable name
* @param string $varval Value to assign to variable
@@ -66,6 +68,21 @@ class phpbb_template_context
}
/**
+ * Append text to the string value stored in a key.
+ *
+ * Text is appended using the string concatenation operator (.).
+ *
+ * @param string $varname Variable name
+ * @param string $varval Value to append to variable
+ */
+ public function append_var($varname, $varval)
+ {
+ $this->rootref[$varname] = (isset($this->rootref[$varname]) ? $this->rootref[$varname] : '') . $varval;
+
+ return true;
+ }
+
+ /**
* Returns a reference to template data array.
*
* This function is public so that template renderer may invoke it.
diff --git a/phpBB/includes/template/template.php b/phpBB/includes/template/template.php
index 989322320b..bac5445511 100644
--- a/phpBB/includes/template/template.php
+++ b/phpBB/includes/template/template.php
@@ -128,7 +128,7 @@ class phpbb_template
{
$templates = array($template_name => $template_path);
- if ($fallback_template_path !== false)
+ if ($fallback_template_name !== false)
{
$templates[$fallback_template_name] = $fallback_template_path;
}
@@ -306,7 +306,7 @@ class phpbb_template
*
* @param string $handle Handle of the template to load
* @return phpbb_template_renderer Template renderer object, or null on failure
- * @uses template_compile is used to compile template source
+ * @uses phpbb_template_compile is used to compile template source
*/
private function _tpl_load($handle)
{
@@ -378,7 +378,9 @@ class phpbb_template
}
/**
- * Assign a single variable to a single key
+ * Assign a single scalar value to a single key.
+ *
+ * Value can be a string, an integer or a boolean.
*
* @param string $varname Variable name
* @param string $varval Value to assign to variable
@@ -388,6 +390,19 @@ class phpbb_template
$this->context->assign_var($varname, $varval);
}
+ /**
+ * Append text to the string value stored in a key.
+ *
+ * Text is appended using the string concatenation operator (.).
+ *
+ * @param string $varname Variable name
+ * @param string $varval Value to append to variable
+ */
+ public function append_var($varname, $varval)
+ {
+ $this->context->append_var($varname, $varval);
+ }
+
// Docstring is copied from phpbb_template_context method with the same name.
/**
* Assign key variable pairs from an array to a specified block
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index d0df70d2f5..9d81503f0a 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -46,7 +46,6 @@ class ucp_profile
$data = array(
'username' => utf8_normalize_nfc(request_var('username', $user->data['username'], true)),
'email' => strtolower(request_var('email', $user->data['user_email'])),
- 'email_confirm' => strtolower(request_var('email_confirm', '')),
'new_password' => request_var('new_password', '', true),
'cur_password' => request_var('cur_password', '', true),
'password_confirm' => request_var('password_confirm', '', true),
@@ -65,7 +64,6 @@ class ucp_profile
'email' => array(
array('string', false, 6, 60),
array('email')),
- 'email_confirm' => array('string', true, 6, 60),
);
if ($auth->acl_get('u_chgname') && $config['allow_namechange'])
@@ -78,11 +76,6 @@ class ucp_profile
$error = validate_data($data, $check_ary);
- if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email'] && $data['email_confirm'] != $data['email'])
- {
- $error[] = ($data['email_confirm']) ? 'NEW_EMAIL_ERROR' : 'NEW_EMAIL_CONFIRM_EMPTY';
- }
-
if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && $data['password_confirm'] != $data['new_password'])
{
$error[] = ($data['password_confirm']) ? 'NEW_PASSWORD_ERROR' : 'NEW_PASSWORD_CONFIRM_EMPTY';
diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php
index 91729c7844..5d85029e62 100644
--- a/phpBB/includes/ucp/ucp_register.php
+++ b/phpBB/includes/ucp/ucp_register.php
@@ -99,7 +99,6 @@ class ucp_register
$s_hidden_fields = array_merge($s_hidden_fields, array(
'username' => utf8_normalize_nfc(request_var('username', '', true)),
'email' => strtolower(request_var('email', '')),
- 'email_confirm' => strtolower(request_var('email_confirm', '')),
'lang' => $user->lang_name,
'tz' => request_var('tz', (float) $config['board_timezone']),
));
@@ -172,7 +171,6 @@ class ucp_register
'new_password' => request_var('new_password', '', true),
'password_confirm' => request_var('password_confirm', '', true),
'email' => strtolower(request_var('email', '')),
- 'email_confirm' => strtolower(request_var('email_confirm', '')),
'lang' => basename(request_var('lang', $user->lang_name)),
'tz' => request_var('tz', (float) $timezone),
);
@@ -191,7 +189,6 @@ class ucp_register
'email' => array(
array('string', false, 6, 60),
array('email')),
- 'email_confirm' => array('string', false, 6, 60),
'tz' => array('num', false, -14, 14),
'lang' => array('language_iso_name'),
));
@@ -236,11 +233,6 @@ class ucp_register
{
$error[] = $user->lang['NEW_PASSWORD_ERROR'];
}
-
- if ($data['email'] != $data['email_confirm'])
- {
- $error[] = $user->lang['NEW_EMAIL_ERROR'];
- }
}
if (!sizeof($error))
@@ -455,7 +447,6 @@ class ucp_register
'PASSWORD' => $data['new_password'],
'PASSWORD_CONFIRM' => $data['password_confirm'],
'EMAIL' => $data['email'],
- 'EMAIL_CONFIRM' => $data['email_confirm'],
'L_REG_COND' => $l_reg_cond,
'L_USERNAME_EXPLAIN' => $user->lang($config['allow_name_chars'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_name_chars']), $user->lang('CHARACTERS', (int) $config['max_name_chars'])),
diff --git a/phpBB/index.php b/phpBB/index.php
index 5f2254ac7f..f1243bb336 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -114,7 +114,7 @@ if ($config['load_birthdays'] && $config['allow_birthdays'] && $auth->acl_gets('
// Assign index specific vars
$template->assign_vars(array(
- 'TOTAL_POSTS' => $user->lang('TOTAL_POSTS', (int) $config['num_posts']),
+ 'TOTAL_POSTS' => $user->lang('TOTAL_POSTS_COUNT', (int) $config['num_posts']),
'TOTAL_TOPICS' => $user->lang('TOTAL_TOPICS', (int) $config['num_topics']),
'TOTAL_USERS' => $user->lang('TOTAL_USERS', (int) $config['num_users']),
'NEWEST_USER' => $user->lang('NEWEST_USER', get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])),
diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php
index 5a868004ef..db974f9903 100644
--- a/phpBB/install/install_convert.php
+++ b/phpBB/install/install_convert.php
@@ -735,22 +735,20 @@ class install_convert extends module
$this->p_master->error(sprintf($user->lang['COULD_NOT_FIND_PATH'], $convert->options['forum_path']), __LINE__, __FILE__);
}
- $search_type = basename(trim($config['search_type']));
+ $search_type = $config['search_type'];
// For conversions we are a bit less strict and set to a search backend we know exist...
- if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+ if (!class_exists($search_type))
{
- $search_type = 'fulltext_native';
+ $search_type = 'phpbb_search_fulltext_native';
set_config('search_type', $search_type);
}
- if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+ if (!class_exists($search_type))
{
trigger_error('NO_SUCH_SEARCH_MODULE');
}
- require($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx);
-
$error = false;
$convert->fulltext_search = new $search_type($error);
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index df9e47ddec..4663b5204e 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -689,7 +689,7 @@ class install_install extends module
$error = array();
// Check the entered email address and password
- if ($data['admin_name'] == '' || $data['admin_pass1'] == '' || $data['admin_pass2'] == '' || $data['board_email1'] == '' || $data['board_email2'] == '')
+ if ($data['admin_name'] == '' || $data['admin_pass1'] == '' || $data['admin_pass2'] == '' || $data['board_email'] == '')
{
$error[] = $lang['INST_ERR_MISSING_DATA'];
}
@@ -721,12 +721,7 @@ class install_install extends module
$error[] = $lang['INST_ERR_PASSWORD_TOO_LONG'];
}
- if ($data['board_email1'] != $data['board_email2'] && $data['board_email1'] != '')
- {
- $error[] = $lang['INST_ERR_EMAIL_MISMATCH'];
- }
-
- if ($data['board_email1'] != '' && !preg_match('/^' . get_preg_expression('email') . '$/i', $data['board_email1']))
+ if ($data['board_email'] != '' && !preg_match('/^' . get_preg_expression('email') . '$/i', $data['board_email']))
{
$error[] = $lang['INST_ERR_EMAIL_INVALID'];
}
@@ -1250,11 +1245,11 @@ class install_install extends module
WHERE config_name = 'server_port'",
'UPDATE ' . $data['table_prefix'] . "config
- SET config_value = '" . $db->sql_escape($data['board_email1']) . "'
+ SET config_value = '" . $db->sql_escape($data['board_email']) . "'
WHERE config_name = 'board_email'",
'UPDATE ' . $data['table_prefix'] . "config
- SET config_value = '" . $db->sql_escape($data['board_email1']) . "'
+ SET config_value = '" . $db->sql_escape($data['board_email']) . "'
WHERE config_name = 'board_contact'",
'UPDATE ' . $data['table_prefix'] . "config
@@ -1314,7 +1309,7 @@ class install_install extends module
WHERE config_name = 'avatar_salt'",
'UPDATE ' . $data['table_prefix'] . "users
- SET username = '" . $db->sql_escape($data['admin_name']) . "', user_password='" . $db->sql_escape(md5($data['admin_pass1'])) . "', user_ip = '" . $db->sql_escape($user_ip) . "', user_lang = '" . $db->sql_escape($data['default_lang']) . "', user_email='" . $db->sql_escape($data['board_email1']) . "', user_dateformat='" . $db->sql_escape($lang['default_dateformat']) . "', user_email_hash = " . $db->sql_escape(phpbb_email_hash($data['board_email1'])) . ", username_clean = '" . $db->sql_escape(utf8_clean_string($data['admin_name'])) . "'
+ SET username = '" . $db->sql_escape($data['admin_name']) . "', user_password='" . $db->sql_escape(md5($data['admin_pass1'])) . "', user_ip = '" . $db->sql_escape($user_ip) . "', user_lang = '" . $db->sql_escape($data['default_lang']) . "', user_email='" . $db->sql_escape($data['board_email']) . "', user_dateformat='" . $db->sql_escape($lang['default_dateformat']) . "', user_email_hash = " . $db->sql_escape(phpbb_email_hash($data['board_email'])) . ", username_clean = '" . $db->sql_escape(utf8_clean_string($data['admin_name'])) . "'
WHERE username = 'Admin'",
'UPDATE ' . $data['table_prefix'] . "moderator_cache
@@ -1830,7 +1825,7 @@ class install_install extends module
$messenger->template('installed', $data['language']);
- $messenger->to($data['board_email1'], $data['admin_name']);
+ $messenger->to($data['board_email'], $data['admin_name']);
$messenger->anti_abuse_headers($config, $user);
@@ -1889,8 +1884,7 @@ class install_install extends module
'admin_name' => utf8_normalize_nfc(request_var('admin_name', '', true)),
'admin_pass1' => request_var('admin_pass1', '', true),
'admin_pass2' => request_var('admin_pass2', '', true),
- 'board_email1' => strtolower(request_var('board_email1', '')),
- 'board_email2' => strtolower(request_var('board_email2', '')),
+ 'board_email' => strtolower(request_var('board_email', '')),
'img_imagick' => request_var('img_imagick', ''),
'ftp_path' => request_var('ftp_path', ''),
'ftp_user' => request_var('ftp_user', ''),
@@ -1929,8 +1923,7 @@ class install_install extends module
'admin_name' => array('lang' => 'ADMIN_USERNAME', 'type' => 'text:25:100', 'explain' => true),
'admin_pass1' => array('lang' => 'ADMIN_PASSWORD', 'type' => 'password:25:100', 'explain' => true),
'admin_pass2' => array('lang' => 'ADMIN_PASSWORD_CONFIRM', 'type' => 'password:25:100', 'explain' => false),
- 'board_email1' => array('lang' => 'CONTACT_EMAIL', 'type' => 'text:25:100', 'explain' => false),
- 'board_email2' => array('lang' => 'CONTACT_EMAIL_CONFIRM', 'type' => 'text:25:100', 'explain' => false),
+ 'board_email' => array('lang' => 'CONTACT_EMAIL', 'type' => 'text:25:100', 'explain' => false),
);
var $advanced_config_options = array(
'legend1' => 'ACP_EMAIL_SETTINGS',
diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php
index bee27d3c39..7f1ecb5c01 100644
--- a/phpBB/language/en/acp/common.php
+++ b/phpBB/language/en/acp/common.php
@@ -418,7 +418,7 @@ $lang = array_merge($lang, array(
'INACTIVE_REASON_UNKNOWN' => 'Unknown',
'INACTIVE_USERS' => 'Inactive users',
'INACTIVE_USERS_EXPLAIN' => 'This is a list of users who have registered but whose accounts are inactive. You can activate, delete or remind (by sending an e-mail) these users if you wish.',
- 'INACTIVE_USERS_EXPLAIN_INDEX' => 'This is a list of the last 10 registered users who have inactive accounts. A full list is available from the appropriate menu item or by following the link below from where you can activate, delete or remind (by sending an e-mail) these users if you wish.',
+ 'INACTIVE_USERS_EXPLAIN_INDEX' => 'This is a list of the last 10 registered users who have inactive accounts. Accounts are inactive either because account activation was enabled in user registration settings and these usersā€™ accounts have not yet been activated, or because these accounts have been deactivated. A full list is available by following the link below from where you can activate, delete or remind (by sending an e-mail) these users if you wish.',
'NO_INACTIVE_USERS' => 'No inactive users',
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 631805afc2..7741ff8d1f 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -613,7 +613,6 @@ $lang = array_merge($lang, array(
'TOO_LONG_USER_PASSWORD' => 'The password you entered is too long.',
'TOO_LONG_USERNAME' => 'The username you entered is too long.',
'TOO_LONG_EMAIL' => 'The e-mail address you entered is too long.',
- 'TOO_LONG_EMAIL_CONFIRM' => 'The e-mail address confirmation you entered is too long.',
'TOO_LONG_WEBSITE' => 'The website address you entered is too long.',
'TOO_LONG_YIM' => 'The Yahoo! Messenger name you entered is too long.',
@@ -635,7 +634,6 @@ $lang = array_merge($lang, array(
'TOO_SHORT_USER_PASSWORD' => 'The password you entered is too short.',
'TOO_SHORT_USERNAME' => 'The username you entered is too short.',
'TOO_SHORT_EMAIL' => 'The e-mail address you entered is too short.',
- 'TOO_SHORT_EMAIL_CONFIRM' => 'The e-mail address confirmation you entered is too short.',
'TOO_SHORT_WEBSITE' => 'The website address you entered is too short.',
'TOO_SHORT_YIM' => 'The Yahoo! Messenger name you entered is too short.',
diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php
index 858065b643..254db4a5c1 100644
--- a/phpBB/language/en/install.php
+++ b/phpBB/language/en/install.php
@@ -51,6 +51,7 @@ $lang = array_merge($lang, array(
'BLANK_PREFIX_FOUND' => 'A scan of your tables has shown a valid installation using no table prefix.',
'BOARD_NOT_INSTALLED' => 'No installation found',
'BOARD_NOT_INSTALLED_EXPLAIN' => 'The phpBB Unified Convertor Framework requires a default installation of phpBB3 to function, please <a href="%s">proceed by first installing phpBB3</a>.',
+ 'BACKUP_NOTICE' => 'Please backup your board before updating in case any problems arise during the update process.',
'CATEGORY' => 'Category',
'CACHE_STORE' => 'Cache type',
@@ -71,14 +72,13 @@ $lang = array_merge($lang, array(
'CONFIG_FILE_WRITTEN' => 'The configuration file has been written. You may now proceed to the next step of the installation.',
'CONFIG_PHPBB_EMPTY' => 'The phpBB3 config variable for ā€œ%sā€ is empty.',
'CONFIG_RETRY' => 'Retry',
- 'CONTACT_EMAIL_CONFIRM' => 'Confirm contact e-mail',
'CONTINUE_CONVERT' => 'Continue conversion',
'CONTINUE_CONVERT_BODY' => 'A previous conversion attempt has been determined. You are now able to choose between starting a new conversion or continuing the conversion.',
'CONTINUE_LAST' => 'Continue last statements',
'CONTINUE_OLD_CONVERSION' => 'Continue previously started conversion',
'CONVERT' => 'Convert',
'CONVERT_COMPLETE' => 'Conversion completed',
- 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3.0. You can now login and <a href="../">access your board</a>. Please ensure that the settings were transferred correctly before enabling your board by deleting the install directory. Remember that help on using phpBB is available online via the <a href="http://www.phpbb.com/support/documentation/3.0/">Documentation</a> and the <a href="http://www.phpbb.com/community/viewforum.php?f=46">support forums</a>.',
+ 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3.1. You can now login and <a href="../">access your board</a>. Please ensure that the settings were transferred correctly before enabling your board by deleting the install directory. Remember that help on using phpBB is available online via the <a href="http://www.phpbb.com/support/documentation/3.0/">Documentation</a> and the <a href="http://www.phpbb.com/community/viewforum.php?f=46">support forums</a>.',
'CONVERT_INTRO' => 'Welcome to the phpBB Unified Convertor Framework',
'CONVERT_INTRO_BODY' => 'From here, you are able to import data from other (installed) board systems. The list below shows all the conversion modules currently available. If there is no convertor shown in this list for the board software you wish to convert from, please check our website where further conversion modules may be available for download.',
'CONVERT_NEW_CONVERSION' => 'New conversion',
@@ -155,7 +155,7 @@ $lang = array_merge($lang, array(
'DLL_XML' => 'XML support [ Jabber ]',
'DLL_ZLIB' => 'zlib compression support [ gz, .tar.gz, .zip ]',
'DL_CONFIG' => 'Download config',
- 'DL_CONFIG_EXPLAIN' => 'You may download the complete config.php to your own PC. You will then need to upload the file manually, replacing any existing config.php in your phpBB 3.0 root directory. Please remember to upload the file in ASCII format (see your FTP application documentation if you are unsure how to achieve this). When you have uploaded the config.php please click ā€œDoneā€ to move to the next stage.',
+ 'DL_CONFIG_EXPLAIN' => 'You may download the complete config.php to your own PC. You will then need to upload the file manually, replacing any existing config.php in your phpBB 3.1 root directory. Please remember to upload the file in ASCII format (see your FTP application documentation if you are unsure how to achieve this). When you have uploaded the config.php please click ā€œDoneā€ to move to the next stage.',
'DL_DOWNLOAD' => 'Download',
'DONE' => 'Done',
@@ -331,7 +331,7 @@ $lang = array_merge($lang, array(
'STAGE_ADVANCED_EXPLAIN' => 'The settings on this page are only necessary to set if you know that you require something different from the default. If you are unsure, just proceed to the next page, as these settings can be altered from the Administration Control Panel later.',
'STAGE_CONFIG_FILE' => 'Configuration file',
'STAGE_CREATE_TABLE' => 'Create database tables',
- 'STAGE_CREATE_TABLE_EXPLAIN' => 'The database tables used by phpBB 3.0 have been created and populated with some initial data. Proceed to the next screen to finish installing phpBB.',
+ 'STAGE_CREATE_TABLE_EXPLAIN' => 'The database tables used by phpBB 3.1 have been created and populated with some initial data. Proceed to the next screen to finish installing phpBB.',
'STAGE_DATABASE' => 'Database settings',
'STAGE_FINAL' => 'Final stage',
'STAGE_INTRO' => 'Introduction',
diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php
index 664365b1ec..bd25d403ab 100644
--- a/phpBB/language/en/mcp.php
+++ b/phpBB/language/en/mcp.php
@@ -238,6 +238,7 @@ $lang = array_merge($lang, array(
'NO_POST' => 'You have to select a post in order to warn the user for a post.',
'NO_POST_REPORT' => 'This post was not reported.',
'NO_POST_SELECTED' => 'You must select at least one post to perform this action.',
+ 'NO_POSTS_QUEUE' => 'There are no posts waiting for approval.',
'NO_REASON_DISAPPROVAL' => 'Please give an appropriate reason for disapproval.',
'NO_REPORT' => 'No report found',
'NO_REPORTS' => 'No reports found',
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index 264b6ed4d8..aa1e9c27ce 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -122,8 +122,6 @@ $lang = array_merge($lang, array(
'CLICK_RETURN_FOLDER' => '%1$sReturn to your ā€œ%3$sā€ folder%2$s',
'CONFIRMATION' => 'Confirmation of registration',
'CONFIRM_CHANGES' => 'Confirm changes',
- 'CONFIRM_EMAIL' => 'Confirm e-mail address',
- 'CONFIRM_EMAIL_EXPLAIN' => 'You only need to specify this if you are changing your e-mail address.',
'CONFIRM_EXPLAIN' => 'To prevent automated registrations the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.',
'VC_REFRESH' => 'Refresh confirmation code',
'VC_REFRESH_EXPLAIN' => 'If you cannot read the code you can request a new one by clicking the button.',
@@ -282,8 +280,6 @@ $lang = array_merge($lang, array(
'MOVE_TO_FOLDER' => 'Move to folder',
'MOVE_UP' => 'Move up',
- 'NEW_EMAIL_CONFIRM_EMPTY' => 'You did not enter a confirm e-mail address.',
- 'NEW_EMAIL_ERROR' => 'The e-mail addresses you entered do not match.',
'NEW_FOLDER_NAME' => 'New folder name',
'NEW_PASSWORD' => 'New password',
'NEW_PASSWORD_CONFIRM_EMPTY' => 'You did not enter a confirm password.',
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index 1201aceff9..741ac2f430 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -571,11 +571,11 @@ switch ($mode)
$module->list_modules('ucp');
$module->list_modules('mcp');
- $user_notes_enabled = ($module->loaded('notes', 'user_notes')) ? true : false;
- $warn_user_enabled = ($module->loaded('warn', 'warn_user')) ? true : false;
- $zebra_enabled = ($module->loaded('zebra')) ? true : false;
- $friends_enabled = ($module->loaded('zebra', 'friends')) ? true : false;
- $foes_enabled = ($module->loaded('zebra', 'foes')) ? true : false;
+ $user_notes_enabled = ($module->loaded('mcp_notes', 'user_notes')) ? true : false;
+ $warn_user_enabled = ($module->loaded('mcp_warn', 'warn_user')) ? true : false;
+ $zebra_enabled = ($module->loaded('ucp_zebra')) ? true : false;
+ $friends_enabled = ($module->loaded('ucp_zebra', 'friends')) ? true : false;
+ $foes_enabled = ($module->loaded('ucp_zebra', 'foes')) ? true : false;
unset($module);
}
@@ -1347,6 +1347,7 @@ switch ($mode)
if ($mode)
{
$params[] = "mode=$mode";
+ $u_first_char_params[] = "mode=$mode";
}
$sort_params[] = "mode=$mode";
diff --git a/phpBB/search.php b/phpBB/search.php
index 4f30cdc1dd..2b463aec9c 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -465,33 +465,60 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$per_page = ($show_results == 'posts') ? $config['posts_per_page'] : $config['topics_per_page'];
$total_match_count = 0;
+ // Set limit for the $total_match_count to reduce server load
+ $total_matches_limit = 1000;
+ $found_more_search_matches = false;
+
if ($search_id)
{
if ($sql)
{
- // only return up to 1000 ids (the last one will be removed later)
- $result = $db->sql_query_limit($sql, 1001 - $start, $start);
+ // Only return up to $total_matches_limit+1 ids (the last one will be removed later)
+ $result = $db->sql_query_limit($sql, $total_matches_limit + 1);
while ($row = $db->sql_fetchrow($result))
{
$id_ary[] = (int) $row[$field];
}
$db->sql_freeresult($result);
-
- $total_match_count = sizeof($id_ary) + $start;
- $id_ary = array_slice($id_ary, 0, $per_page);
}
else if ($search_id == 'unreadposts')
{
- $id_ary = array_keys(get_unread_topics($user->data['user_id'], $sql_where, $sql_sort, 1001 - $start, $start));
-
- $total_match_count = sizeof($id_ary) + $start;
- $id_ary = array_slice($id_ary, 0, $per_page);
+ // Only return up to $total_matches_limit+1 ids (the last one will be removed later)
+ $id_ary = array_keys(get_unread_topics($user->data['user_id'], $sql_where, $sql_sort, $total_matches_limit + 1));
}
else
{
$search_id = '';
}
+
+ $total_match_count = sizeof($id_ary);
+ if ($total_match_count)
+ {
+ // Limit the number to $total_matches_limit for pre-made searches
+ if ($total_match_count > $total_matches_limit)
+ {
+ $found_more_search_matches = true;
+ $total_match_count = $total_matches_limit;
+ }
+
+ // Make sure $start is set to the last page if it exceeds the amount
+ if ($start < 0)
+ {
+ $start = 0;
+ }
+ else if ($start >= $total_match_count)
+ {
+ $start = floor(($total_match_count - 1) / $per_page) * $per_page;
+ }
+
+ $id_ary = array_slice($id_ary, $start, $per_page);
+ }
+ else
+ {
+ // Set $start to 0 if no matches were found
+ $start = 0;
+ }
}
// make sure that some arrays are always in the same order
@@ -539,10 +566,8 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$icons = $cache->obtain_icons();
// Output header
- if ($search_id && ($total_match_count > 1000))
+ if ($found_more_search_matches)
{
- // limit the number to 1000 for pre-made searches
- $total_match_count--;
$l_search_matches = $user->lang('FOUND_MORE_SEARCH_MATCHES', (int) $total_match_count);
}
else
diff --git a/phpBB/styles/prosilver/template/mcp_front.html b/phpBB/styles/prosilver/template/mcp_front.html
index 21431b4bc1..e9635e528c 100644
--- a/phpBB/styles/prosilver/template/mcp_front.html
+++ b/phpBB/styles/prosilver/template/mcp_front.html
@@ -10,7 +10,7 @@
<div class="inner"><span class="corners-top"><span></span></span>
<h3>{L_LATEST_UNAPPROVED}</h3>
- <!-- IF S_HAS_UNAPPROVED_POSTS --><p>{L_UNAPPROVED_TOTAL}</p><!-- ENDIF -->
+ <p>{L_UNAPPROVED_TOTAL}</p>
<!-- IF .unapproved -->
<ul class="topiclist">
@@ -40,8 +40,6 @@
</li>
<!-- END unapproved -->
</ul>
- <!-- ELSE -->
- <p>{L_UNAPPROVED_POSTS_ZERO_TOTAL}</p>
<!-- ENDIF -->
<span class="corners-bottom"><span></span></span></div>
@@ -64,7 +62,7 @@
<div class="inner"><span class="corners-top"><span></span></span>
<h3>{L_LATEST_REPORTED}</h3>
- <!-- IF S_HAS_REPORTS --><p>{L_REPORTS_TOTAL}</p><!-- ENDIF -->
+ <p>{L_REPORTS_TOTAL}</p>
<!-- IF .report -->
<ul class="topiclist">
@@ -92,8 +90,6 @@
</li>
<!-- END report -->
</ul>
- <!-- ELSE -->
- <p>{L_REPORTS_ZERO_TOTAL}</p>
<!-- ENDIF -->
<span class="corners-bottom"><span></span></span></div>
@@ -105,7 +101,7 @@
<div class="inner"><span class="corners-top"><span></span></span>
<h3>{L_LATEST_REPORTED_PMS}</h3>
- <!-- IF S_HAS_PM_REPORTS --><p>{L_PM_REPORTS_TOTAL}</p><!-- ENDIF -->
+ <p>{L_PM_REPORTS_TOTAL}</p>
<!-- IF .pm_report -->
<ul class="topiclist">
@@ -133,8 +129,6 @@
</li>
<!-- END pm_report -->
</ul>
- <!-- ELSE -->
- <p>{L_PM_REPORTS_ZERO_TOTAL}</p>
<!-- ENDIF -->
<span class="corners-bottom"><span></span></span></div>
diff --git a/phpBB/styles/prosilver/template/mcp_queue.html b/phpBB/styles/prosilver/template/mcp_queue.html
index 5f16ebe7d0..f86678ebe4 100644
--- a/phpBB/styles/prosilver/template/mcp_queue.html
+++ b/phpBB/styles/prosilver/template/mcp_queue.html
@@ -78,7 +78,7 @@
</li>
</ul>
<!-- ELSE -->
- <p class="notopics"><strong><!-- IF S_TOPICS -->{L_NO_TOPICS_QUEUE}<!-- ELSE -->{L_UNAPPROVED_POSTS_ZERO_TOTAL}<!-- ENDIF --></strong></p>
+ <p class="notopics"><strong><!-- IF S_TOPICS -->{L_NO_TOPICS_QUEUE}<!-- ELSE -->{L_NO_POSTS_QUEUE}<!-- ENDIF --></strong></p>
<!-- ENDIF -->
<span class="corners-bottom"><span></span></span></div>
diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html
index 6943dd41b3..85c87b8cca 100644
--- a/phpBB/styles/prosilver/template/mcp_topic.html
+++ b/phpBB/styles/prosilver/template/mcp_topic.html
@@ -158,6 +158,7 @@ onload_functions.push('subPanels()');
<!-- IF S_CAN_DELETE --><option value="delete_post">{L_DELETE_POSTS}</option><!-- ENDIF -->
<!-- IF S_CAN_MERGE --><option value="merge_posts"<!-- IF S_MERGE_VIEW --> selected="selected"<!-- ENDIF -->>{L_MERGE_POSTS}</option><!-- ENDIF -->
<!-- IF S_CAN_SPLIT --><option value="split_all"<!-- IF S_SPLIT_VIEW --> selected="selected"<!-- ENDIF -->>{L_SPLIT_POSTS}</option><option value="split_beyond">{L_SPLIT_AFTER}</option><!-- ENDIF -->
+ <!-- IF S_CAN_SYNC --><option value="resync">{L_RESYNC}</option><!-- ENDIF -->
</select>&nbsp;
<input class="button1" type="submit" name="mcp_topic_submit" value="{L_SUBMIT}" />
<div><a href="#" onclick="marklist('mcp', 'post', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', 'post', false); return false;">{L_UNMARK_ALL}</a></div>
diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html
index ff53e42119..504d1b80ef 100644
--- a/phpBB/styles/prosilver/template/memberlist_body.html
+++ b/phpBB/styles/prosilver/template/memberlist_body.html
@@ -80,7 +80,7 @@
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- ENDIF -->
-<div class="forumbg">
+<div class="forumbg forumbg-table">
<div class="inner"><span class="corners-top"><span></span></span>
<table class="table1" cellspacing="1">
diff --git a/phpBB/styles/prosilver/template/memberlist_leaders.html b/phpBB/styles/prosilver/template/memberlist_leaders.html
index 1a63793bc3..bce1a69619 100644
--- a/phpBB/styles/prosilver/template/memberlist_leaders.html
+++ b/phpBB/styles/prosilver/template/memberlist_leaders.html
@@ -5,7 +5,7 @@
<form method="post" action="{S_MODE_ACTION}">
<!-- BEGIN group -->
-<div class="forumbg">
+<div class="forumbg forumbg-table">
<div class="inner"><span class="corners-top"><span></span></span>
<table class="table1" cellspacing="1">
diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html
index 4b41693ded..f10ec64975 100644
--- a/phpBB/styles/prosilver/template/memberlist_view.html
+++ b/phpBB/styles/prosilver/template/memberlist_view.html
@@ -69,7 +69,7 @@
<!-- IF U_JABBER and S_JABBER_ENABLED --><dt>{L_JABBER}:</dt> <dd><a href="{U_JABBER}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_JABBER_MESSAGE}</a></dd><!-- ELSEIF USER_JABBER --><dt>{L_JABBER}:</dt> <dd>{USER_JABBER}</dd><!-- ENDIF -->
<!-- IF S_PROFILE_FIELD1 -->
<!-- NOTE: Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
- <dt>{postrow.PROFILE_FIELD1_NAME}:</dt> <dd>{postrow.PROFILE_FIELD1_VALUE}</dd>
+ <dt>{PROFILE_FIELD1_NAME}:</dt> <dd>{PROFILE_FIELD1_VALUE}</dd>
<!-- ENDIF -->
</dl>
</div>
diff --git a/phpBB/styles/prosilver/template/search_body.html b/phpBB/styles/prosilver/template/search_body.html
index 6616b95a73..4b1d30d77d 100644
--- a/phpBB/styles/prosilver/template/search_body.html
+++ b/phpBB/styles/prosilver/template/search_body.html
@@ -98,7 +98,7 @@
</form>
<!-- IF .recentsearch -->
-<div class="forumbg">
+<div class="forumbg forumbg-table">
<div class="inner"><span class="corners-top"><span></span></span>
<table class="table1" cellspacing="1">
diff --git a/phpBB/styles/prosilver/template/template.cfg b/phpBB/styles/prosilver/template/template.cfg
index 8d976247bc..22ca73b487 100644
--- a/phpBB/styles/prosilver/template/template.cfg
+++ b/phpBB/styles/prosilver/template/template.cfg
@@ -23,3 +23,8 @@ version = 3.1.0-dev
# Defining a different template bitfield
template_bitfield = lNg=
+
+# Template inheritance
+# See http://blog.phpbb.com/2008/07/31/templating-just-got-easier/
+# Set value to empty to ignore template inheritance
+inherit_from = prosilver
diff --git a/phpBB/styles/prosilver/template/ucp_main_front.html b/phpBB/styles/prosilver/template/ucp_main_front.html
index 68f89edf12..20afd119cc 100644
--- a/phpBB/styles/prosilver/template/ucp_main_front.html
+++ b/phpBB/styles/prosilver/template/ucp_main_front.html
@@ -34,8 +34,8 @@
<dt>{L_JOINED}:</dt> <dd>{JOINED}</dd>
<dt>{L_VISITED}:</dt> <dd>{LAST_VISIT_YOU}</dd>
<dt>{L_TOTAL_POSTS}:</dt> <dd><!-- IF POSTS_PCT -->{POSTS}<!-- IF S_DISPLAY_SEARCH --> | <strong><a href="{U_SEARCH_USER}">{L_SEARCH_YOUR_POSTS}</a></strong><!-- ENDIF --><br />({POSTS_DAY} / {POSTS_PCT})<!-- ELSE -->{POSTS}<!-- ENDIF --></dd>
- <!-- IF ACTIVE_FORUM --><dt>{L_ACTIVE_IN_FORUM}:</dt> <dd><strong><a href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></strong><br />({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT})</dd><!-- ENDIF -->
- <!-- IF ACTIVE_TOPIC --><dt>{L_ACTIVE_IN_TOPIC}:</dt> <dd><strong><a href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></strong><br />({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT})</dd><!-- ENDIF -->
+ <!-- IF ACTIVE_FORUM != '' --><dt>{L_ACTIVE_IN_FORUM}:</dt> <dd><strong><a href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></strong><br />({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT})</dd><!-- ENDIF -->
+ <!-- IF ACTIVE_TOPIC != '' --><dt>{L_ACTIVE_IN_TOPIC}:</dt> <dd><strong><a href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></strong><br />({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT})</dd><!-- ENDIF -->
<!-- IF WARNINGS --><dt>{L_YOUR_WARNINGS}:</dt> <dd class="error">{WARNING_IMG} [{WARNINGS}]</dd><!-- ENDIF -->
</dl>
diff --git a/phpBB/styles/prosilver/template/ucp_pm_message_header.html b/phpBB/styles/prosilver/template/ucp_pm_message_header.html
index fcebab0868..ae66dd0a36 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_message_header.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_message_header.html
@@ -1,25 +1,22 @@
<h2>{L_TITLE}<!-- IF CUR_FOLDER_NAME -->: {CUR_FOLDER_NAME}<!-- ENDIF --></h2>
-<div class="panel clearfix pm-panel-header<!-- IF S_VIEW_MESSAGE --> pm<!-- ENDIF -->">
+<form id="viewfolder" method="post" action="{S_PM_ACTION}">
+
+<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<!-- IF FOLDER_STATUS and FOLDER_MAX_MESSAGES neq 0 --><p>{FOLDER_STATUS}</p><!-- ENDIF -->
-
<!-- IF U_POST_REPLY_PM or U_POST_NEW_TOPIC or U_FORWARD_PM -->
<div class="buttons">
- <!-- IF U_POST_REPLY_PM --><div class="pmreply-icon clearfix"><a title="{L_POST_REPLY_PM}" href="{U_POST_REPLY_PM}"><span></span>{L_POST_REPLY_PM}</a></div>
+ <!-- IF U_POST_REPLY_PM --><div class="pmreply-icon"><a title="{L_POST_REPLY_PM}" href="{U_POST_REPLY_PM}"><span></span>{L_POST_REPLY_PM}</a></div>
<!-- ELSEIF U_POST_NEW_TOPIC --><div class="newpm-icon"><a href="{U_POST_NEW_TOPIC}" accesskey="n" title="{L_UCP_PM_COMPOSE}"><span></span>{L_UCP_PM_COMPOSE}</a></div><!-- ENDIF -->
<!-- IF U_FORWARD_PM --><div class="forwardpm-icon"><a title="{L_POST_FORWARD_PM}" href="{U_FORWARD_PM}"><span></span>{L_FORWARD_PM}</a></div><!-- ENDIF -->
+ <!-- IF U_POST_REPLY_PM and S_PM_RECIPIENTS gt 1 --><div class="reply-all"><a class="left" title="{L_REPLY_TO_ALL}" href="{U_POST_REPLY_ALL}">{L_REPLY_TO_ALL}</a></div><!-- ENDIF -->
</div>
-
- <!-- IF U_POST_REPLY_PM and S_PM_RECIPIENTS gt 1 -->
- <div class="reply-all"><a title="{L_REPLY_TO_ALL}" href="{U_POST_REPLY_ALL}">&raquo; {L_REPLY_TO_ALL}</a></div>
- <!-- ENDIF -->
-
<!-- ENDIF -->
- <!-- IF TOTAL_MESSAGES or S_VIEW_MESSAGE -->
- <ul class="linklist pm-return-to">
+ <!-- IF TOTAL_MESSAGES or S_VIEW_MESSAGE -->
+ <ul class="linklist">
<li class="rightside pagination">
<!-- IF S_VIEW_MESSAGE --><a class="{S_CONTENT_FLOW_BEGIN}" href="{U_CURRENT_FOLDER}">{L_RETURN_TO} {CUR_FOLDER_NAME}</a><!-- ENDIF -->
<!-- IF FOLDER_CUR_MESSAGES neq 0 -->
@@ -28,8 +25,4 @@
<!-- ENDIF -->
</li>
</ul>
- <!-- ENDIF -->
- </div>
-</div>
-
-<form id="viewfolder" method="post" action="{S_PM_ACTION}">
+ <!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html b/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html
index d5f1608425..dac03c3505 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html
@@ -2,7 +2,6 @@
<!-- IF not PROMPT -->
<!-- INCLUDE ucp_pm_message_header.html -->
- <div class="panel pm-panel-message"><div>
<!-- ENDIF -->
<!-- IF PROMPT -->
diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
index 5317068d89..5411fda572 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
@@ -1,18 +1,21 @@
- <!-- INCLUDE ucp_header.html -->
+<!-- INCLUDE ucp_header.html -->
<!-- INCLUDE ucp_pm_message_header.html -->
+ <span class="corners-bottom"><span></span></span></div>
+</div>
+
<!-- IF S_DISPLAY_HISTORY and (U_VIEW_PREVIOUS_HISTORY or U_VIEW_NEXT_HISTORY) -->
- <fieldset class="display-options clearfix bg1 pm-message-nav">
+ <fieldset class="display-options clearfix">
<!-- IF U_VIEW_PREVIOUS_HISTORY --><a href="{U_VIEW_PREVIOUS_HISTORY}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_VIEW_PREVIOUS_HISTORY}</a><!-- ENDIF -->
<!-- IF U_VIEW_NEXT_HISTORY --><a href="{U_VIEW_NEXT_HISTORY}" class="right-box {S_CONTENT_FLOW_END}">{L_VIEW_NEXT_HISTORY}</a><!-- ENDIF -->
</fieldset>
<!-- ENDIF -->
-<div id="post-{MESSAGE_ID}" class="panel clearfix post pm-panel-message pm<!-- IF S_POST_UNAPPROVED or S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF S_ONLINE --> online<!-- ENDIF -->">
-<div>
+<div id="post-{MESSAGE_ID}" class="post pm<!-- IF S_POST_UNAPPROVED or S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF S_ONLINE --> online<!-- ENDIF -->">
+<div class="inner"><span class="corners-top"><span></span></span>
<div class="postbody">
diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html
index e72d9bba6e..bafb64dbc8 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html
@@ -1,10 +1,7 @@
<!DOCTYPE html>
<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
-
-<meta http-equiv="imagetoolbar" content="no" />
-<meta name="resource-type" content="document" />
-<meta name="distribution" content="global" />
+<meta charset="utf-8">
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="robots" content="noindex" />
@@ -16,7 +13,7 @@
<body id="phpbb">
<div id="wrap">
- <a id="top" name="top" accesskey="t"></a>
+ <a id="top" accesskey="t"></a>
<div id="page-header">
<h1>{SITENAME}</h1>
diff --git a/phpBB/styles/prosilver/template/ucp_profile_reg_details.html b/phpBB/styles/prosilver/template/ucp_profile_reg_details.html
index 9c3e98d053..9d4a9e3463 100644
--- a/phpBB/styles/prosilver/template/ucp_profile_reg_details.html
+++ b/phpBB/styles/prosilver/template/ucp_profile_reg_details.html
@@ -20,12 +20,6 @@
<dt><label for="email">{L_EMAIL_ADDRESS}:</label></dt>
<dd><!-- IF S_CHANGE_EMAIL --><input type="text" name="email" id="email" maxlength="100" value="{EMAIL}" class="inputbox" title="{L_EMAIL_ADDRESS}" /><!-- ELSE --><strong>{EMAIL}</strong><!-- ENDIF --></dd>
</dl>
- <!-- IF S_CHANGE_EMAIL -->
- <dl>
- <dt><label for="email_confirm">{L_CONFIRM_EMAIL}:</label><br /><span>{L_CONFIRM_EMAIL_EXPLAIN}</span></dt>
- <dd><input type="text" name="email_confirm" id="email_confirm" maxlength="100" value="{CONFIRM_EMAIL}" class="inputbox" title="{L_CONFIRM_EMAIL}" /></dd>
- </dl>
- <!-- ENDIF -->
<!-- IF S_CHANGE_PASSWORD -->
<dl>
<dt><label for="new_password">{L_NEW_PASSWORD}:</label><br /><span>{L_CHANGE_PASSWORD_EXPLAIN}</span></dt>
diff --git a/phpBB/styles/prosilver/template/ucp_register.html b/phpBB/styles/prosilver/template/ucp_register.html
index dd0e5ad02a..30ed37eecc 100644
--- a/phpBB/styles/prosilver/template/ucp_register.html
+++ b/phpBB/styles/prosilver/template/ucp_register.html
@@ -39,10 +39,6 @@
<dd><input type="text" tabindex="2" name="email" id="email" size="25" maxlength="100" value="{EMAIL}" class="inputbox autowidth" title="{L_EMAIL_ADDRESS}" /></dd>
</dl>
<dl>
- <dt><label for="email_confirm">{L_CONFIRM_EMAIL}:</label></dt>
- <dd><input type="text" tabindex="3" name="email_confirm" id="email_confirm" size="25" maxlength="100" value="{EMAIL_CONFIRM}" class="inputbox autowidth" title="{L_CONFIRM_EMAIL}" /></dd>
- </dl>
- <dl>
<dt><label for="new_password">{L_PASSWORD}:</label><br /><span>{L_PASSWORD_EXPLAIN}</span></dt>
<dd><input type="password" tabindex="4" name="new_password" id="new_password" size="25" value="{PASSWORD}" class="inputbox autowidth" title="{L_NEW_PASSWORD}" /></dd>
</dl>
diff --git a/phpBB/styles/prosilver/template/viewonline_body.html b/phpBB/styles/prosilver/template/viewonline_body.html
index b111d743f9..3f1f0e64bf 100644
--- a/phpBB/styles/prosilver/template/viewonline_body.html
+++ b/phpBB/styles/prosilver/template/viewonline_body.html
@@ -7,7 +7,7 @@
<li class="rightside pagination"><!-- IF PAGINATION --><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE -->{PAGE_NUMBER}<!-- ENDIF --></li>
</ul>
-<div class="forumbg">
+<div class="forumbg forumbg-table">
<div class="inner"><span class="corners-top"><span></span></span>
<table class="table1" cellspacing="1">
diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css
index 815e55b6de..5cff0a811b 100644
--- a/phpBB/styles/prosilver/theme/bidi.css
+++ b/phpBB/styles/prosilver/theme/bidi.css
@@ -591,6 +591,19 @@
/* PM Styles
----------------------------------------*/
+/* PM panel adjustments */
+.rtl .reply-all a.right {
+ background-position: 5% 60%;
+}
+
+.rtl .reply-all a.right:hover {
+ background-position: 3% 60%;
+}
+
+.rtl .reply-all {
+ padding-left: 5px;
+}
+
/* Defined rules list for PM options */
.rtl ol.def-rules {
padding-right: 0;
@@ -755,3 +768,33 @@
.rtl #wrap, .rtl .headerbar, .rtl #site-description, .rtl .navbar {
position: relative;
}
+
+/* Former imageset */
+.rtl .imageset.site_logo {
+ padding-right: 139px;
+ padding-left: 0;
+}
+.rtl .imageset.forum_link, .rtl .imageset.forum_read, .rtl .imageset.forum_read_locked, .rtl .imageset.forum_read_subforum, .rtl .imageset.forum_unread, .rtl .imageset.forum_unread_locked, .rtl .imageset.forum_unread_subforum, .rtl .imageset.topic_moved, .rtl .imageset.topic_read, .rtl .imageset.topic_read_mine, .rtl .imageset.topic_read_hot, .rtl .imageset.topic_read_hot_mine, .rtl .imageset.topic_read_locked, .rtl .imageset.topic_read_locked_mine, .rtl .imageset.topic_unread, .rtl .imageset.topic_unread_mine, .rtl .imageset.topic_unread_hot, .rtl .imageset.topic_unread_hot_mine, .rtl .imageset.topic_unread_locked, .rtl .imageset.topic_unread_locked_mine, .rtl .imageset.sticky_read, .rtl .imageset.sticky_read_mine, .rtl .imageset.sticky_read_locked, .rtl .imageset.sticky_read_locked_mine, .rtl .imageset.sticky_unread, .rtl .imageset.sticky_unread_mine, .rtl .imageset.sticky_unread_locked, .rtl .imageset.sticky_unread_locked_mine, .rtl .imageset.announce_read, .rtl .imageset.announce_read_mine, .rtl .imageset.announce_read_locked, .rtl .imageset.announce_read_locked_mine, .rtl .imageset.announce_unread, .rtl .imageset.announce_unread_mine, .rtl .imageset.announce_unread_locked, .rtl .imageset.announce_unread_locked_mine, .rtl .imageset.global_read, .rtl .imageset.global_read_mine, .rtl .imageset.global_read_locked, .rtl .imageset.global_read_locked_mine, .rtl .imageset.global_unread, .rtl .imageset.global_unread_mine, .rtl .imageset.global_unread_locked, .rtl .imageset.global_unread_locked_mine, .rtl .imageset.pm_read, .rtl .imageset.pm_unread {
+ padding-right: 27px;
+ padding-left: 0;
+}
+.rtl .imageset.subforum_read, .rtl .imageset.subforum_unread, .rtl .imageset.icon_post_target, .rtl .imageset.icon_post_target_unread, .rtl .imageset.icon_topic_latest, .rtl .imageset.icon_topic_newest {
+ padding-right: 11px;
+ padding-left: 0;
+}
+.rtl .imageset.icon_back_top {
+ padding-right: 11px;
+ padding-left: 0;
+}
+.rtl .imageset.icon_contact_aim, .rtl .imageset.icon_contact_email, .rtl .imageset.icon_contact_icq, .rtl .imageset.icon_contact_jabber, .rtl .imageset.icon_contact_msnm, .rtl .imageset.icon_contact_www, .rtl .imageset.icon_contact_yahoo, .rtl .imageset.icon_post_delete, .rtl .imageset.icon_post_info, .rtl .imageset.icon_post_report, .rtl .imageset.icon_user_warn {
+ padding-right: 20px;
+ padding-left: 0;
+}
+.rtl .imageset.icon_topic_attach {
+ padding-right: 7px;
+ padding-left: 0;
+}
+.rtl .imageset.icon_topic_reported, .rtl .imageset.icon_topic_unapproved {
+ padding-right: 16px;
+ padding-left: 0;
+}
diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css
index f6826f8056..42f6efc5b1 100644
--- a/phpBB/styles/prosilver/theme/colours.css
+++ b/phpBB/styles/prosilver/theme/colours.css
@@ -933,12 +933,6 @@ dl.mini dt {
color: #000000 !important;
}
-/* PM panel adjustments */
-.pm-panel-header,
-#cp-main .pm-message-nav {
- border-bottom-color: #A4B3BF;
-}
-
/* PM marking colours */
.pmlist li.pm_message_reported_colour, .pm_message_reported_colour {
border-left-color: #BC2A4D;
diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css
index f59728447f..885d5ad2af 100644
--- a/phpBB/styles/prosilver/theme/common.css
+++ b/phpBB/styles/prosilver/theme/common.css
@@ -376,7 +376,19 @@ table.info tbody th {
}
.forumbg table.table1 {
- margin: 0 -2px -1px -1px;
+ margin: 0;
+}
+
+.forumbg-table > .inner {
+ margin: 0 -1px;
+}
+
+.forumbg-table > .inner > span.corners-top {
+ margin: 0 -4px -1px -4px;
+}
+
+.forumbg-table > .inner > span.corners-bottom {
+ margin: -1px -4px 0 -4px;
}
/* Misc layout styles
diff --git a/phpBB/styles/prosilver/theme/cp.css b/phpBB/styles/prosilver/theme/cp.css
index 62e8513733..74f11e47a6 100644
--- a/phpBB/styles/prosilver/theme/cp.css
+++ b/phpBB/styles/prosilver/theme/cp.css
@@ -306,31 +306,17 @@ dl.mini dd {
}
/* PM panel adjustments */
-.pm-panel-header {
- margin: 0;
- padding-bottom: 10px;
- border-bottom: 1px dashed transparent;
+.reply-all a.left {
+ background-position: 3px 60%;
}
-.reply-all {
- display: block;
- padding-top: 4px;
- clear: both;
- float: left;
-}
-
-.pm-panel-message {
- padding-top: 10px;
+.reply-all a.left:hover {
+ background-position: 0px 60%;
}
-.pm-return-to {
- padding-top: 23px;
-}
-
-#cp-main .pm-message-nav {
- margin: 0;
- padding: 2px 10px 5px 10px;
- border-bottom: 1px dashed transparent;
+.reply-all {
+ font-size: 11px;
+ padding-top: 5px;
}
/* Defined rules list for PM options */
diff --git a/phpBB/styles/prosilver/theme/en/stylesheet.css b/phpBB/styles/prosilver/theme/en/stylesheet.css
index 62d6b86726..d17f9a5be4 100644
--- a/phpBB/styles/prosilver/theme/en/stylesheet.css
+++ b/phpBB/styles/prosilver/theme/en/stylesheet.css
@@ -11,6 +11,22 @@ ul.profile-icons li.pm-icon { width: 28px; height: 20px; }
ul.profile-icons li.quote-icon { width: 54px; height: 20px; }
ul.profile-icons li.edit-icon { width: 42px; height: 20px; }
+/* Online image */
+.online { background-image: url("./icon_user_online.gif"); }
+
+/* Big button images */
+.reply-icon span { background-image: url("./button_topic_reply.gif"); }
+.post-icon span { background-image: url("./button_topic_new.gif"); }
+.locked-icon span { background-image: url("./button_topic_locked.gif"); }
+.pmreply-icon span { background-image: url("./button_pm_reply.gif") ;}
+.newpm-icon span { background-image: url("./button_pm_new.gif") ;}
+.forwardpm-icon span { background-image: url("./button_pm_forward.gif") ;}
+
+/* Icon images */
+.pm-icon, .pm-icon a { background-image: url("./icon_contact_pm.gif"); }
+.quote-icon, .quote-icon a { background-image: url("./icon_post_quote.gif"); }
+.edit-icon, .edit-icon a { background-image: url("./icon_post_edit.gif"); }
+
/* EN Language Pack */
.imageset.icon_contact_pm {
background-image: url("./icon_contact_pm.gif");
diff --git a/phpBB/styles/prosilver/theme/imageset.css b/phpBB/styles/prosilver/theme/imageset.css
index cebab7845d..cb99e9e715 100644
--- a/phpBB/styles/prosilver/theme/imageset.css
+++ b/phpBB/styles/prosilver/theme/imageset.css
@@ -4,7 +4,6 @@ span.imageset {
background: transparent none 0 0 no-repeat;
margin: 0;
padding: 0;
- padding-right: 0 !important;
width: 0;
height: 0;
overflow: hidden;
diff --git a/phpBB/styles/prosilver/theme/tweaks.css b/phpBB/styles/prosilver/theme/tweaks.css
index 089bc6f764..ae724e1419 100644
--- a/phpBB/styles/prosilver/theme/tweaks.css
+++ b/phpBB/styles/prosilver/theme/tweaks.css
@@ -87,10 +87,6 @@ dl.icon {
float: none;
}
-* html .forumbg table.table1 {
- margin: 0 -2px 0px -1px;
-}
-
/* Headerbar height fix for IE7 and below */
* html #site-description p {
margin-bottom: 1.0em;
diff --git a/phpBB/styles/subsilver2/template/captcha_default.html b/phpBB/styles/subsilver2/template/captcha_default.html
index 4c65f81643..e2edf0b810 100644
--- a/phpBB/styles/subsilver2/template/captcha_default.html
+++ b/phpBB/styles/subsilver2/template/captcha_default.html
@@ -12,6 +12,6 @@
</tr>
<tr>
<td class="row1"><b class="genmed">{L_CONFIRM_CODE}:</b><br /><span class="gensmall">{L_CONFIRM_CODE_EXPLAIN}</span></td>
- <td class="row2"><input class="post" type="text" name="confirm_code" size="8" maxlength="8" />
+ <td class="row2"><input class="post" type="text" name="confirm_code" size="8" maxlength="8"<!-- IF $CAPTCHA_TAB_INDEX --> tabindex="{$CAPTCHA_TAB_INDEX}"<!-- ENDIF --> />
<!-- IF S_CONFIRM_REFRESH --><input type="submit" name="refresh_vc" id="refresh_vc" class="btnlite" value="{L_VC_REFRESH}" /><!-- ENDIF --></td>
</tr>
diff --git a/phpBB/styles/subsilver2/template/captcha_qa.html b/phpBB/styles/subsilver2/template/captcha_qa.html
index 23d2a92f68..acc9cdcdfb 100644
--- a/phpBB/styles/subsilver2/template/captcha_qa.html
+++ b/phpBB/styles/subsilver2/template/captcha_qa.html
@@ -3,6 +3,6 @@
</tr>
<tr>
<td class="row1"><b class="genmed">{QA_CONFIRM_QUESTION}:</b><br /><span class="gensmall">{L_CONFIRM_QUESTION_EXPLAIN}</span></td>
- <td class="row2"><input class="post" type="text" name="qa_answer" size="80" /></td>
+ <td class="row2"><input class="post" type="text" name="qa_answer" size="80"<!-- IF $CAPTCHA_TAB_INDEX --> tabindex="{$CAPTCHA_TAB_INDEX}"<!-- ENDIF --> /></td>
<input type="hidden" name="qa_confirm_id" id="confirm_id" value="{QA_CONFIRM_ID}" /></td>
</tr>
diff --git a/phpBB/styles/subsilver2/template/login_body.html b/phpBB/styles/subsilver2/template/login_body.html
index 262341e0c0..ba316517a9 100644
--- a/phpBB/styles/subsilver2/template/login_body.html
+++ b/phpBB/styles/subsilver2/template/login_body.html
@@ -68,7 +68,7 @@
<!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
</table>
<table class="tablebg" width="100%" cellspacing="1">
-
+ <!-- DEFINE $CAPTCHA_TAB_INDEX = 4 -->
<!-- INCLUDE {CAPTCHA_TEMPLATE} -->
<!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/mcp_front.html b/phpBB/styles/subsilver2/template/mcp_front.html
index f4b146f4c5..7c17e13c52 100644
--- a/phpBB/styles/subsilver2/template/mcp_front.html
+++ b/phpBB/styles/subsilver2/template/mcp_front.html
@@ -24,16 +24,10 @@
<td class="row1" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gensmall">{unapproved.POST_TIME}</span></td>
<td class="row2" align="center"><input type="checkbox" class="radio" name="post_id_list[]" value="{unapproved.POST_ID}" /></td>
</tr>
- <!-- BEGINELSE -->
- <tr>
- <td class="row1" colspan="6" align="center"><span class="gen">{L_UNAPPROVED_POSTS_ZERO_TOTAL}</span></td>
- </tr>
<!-- END unapproved -->
- <!-- IF S_HAS_UNAPPROVED_POSTS -->
<tr>
<td class="row3" colspan="6"><span class="gensmall">{L_UNAPPROVED_TOTAL}</span></td>
</tr>
- <!-- ENDIF -->
<tr>
<td class="cat" colspan="6" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="action[approve]" value="{L_APPROVE}" />&nbsp;&nbsp;<input class="btnlite" type="submit" name="action[disapprove]" value="{L_DISAPPROVE}" /></td>
</tr>
@@ -70,16 +64,10 @@
<td class="row2" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen">{report.REPORTER_FULL}</span></td>
<td class="row1" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gensmall">{report.REPORT_TIME}</span></td>
</tr>
- <!-- BEGINELSE -->
- <tr>
- <td class="row1" colspan="5" align="center"><span class="gen">{L_REPORTS_ZERO_TOTAL}</span></td>
- </tr>
<!-- END report -->
- <!-- IF S_HAS_REPORTS -->
<tr>
<td class="row3" colspan="5"><span class="gensmall">{L_REPORTS_TOTAL}</span></td>
</tr>
- <!-- ENDIF -->
</table>
<br clear="all" /><br />
@@ -107,16 +95,10 @@
<td class="row1" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen">{pm_report.REPORTER_FULL}</span></td>
<td class="row2" align="center" width="10%" nowrap="nowrap" valign="top"><span class="gensmall">{pm_report.REPORT_TIME}</span></td>
</tr>
- <!-- BEGINELSE -->
- <tr>
- <td class="row1" colspan="6" align="center"><span class="gen">{L_PM_REPORTS_ZERO_TOTAL}</span></td>
- </tr>
<!-- END pm_report -->
- <!-- IF S_HAS_PM_REPORTS -->
<tr>
<td class="row3" colspan="6"><span class="gensmall">{L_PM_REPORTS_TOTAL}</span></td>
</tr>
- <!-- ENDIF -->
</table>
<br clear="all" /><br />
diff --git a/phpBB/styles/subsilver2/template/mcp_queue.html b/phpBB/styles/subsilver2/template/mcp_queue.html
index 6e39ccd272..d13af91888 100644
--- a/phpBB/styles/subsilver2/template/mcp_queue.html
+++ b/phpBB/styles/subsilver2/template/mcp_queue.html
@@ -27,7 +27,7 @@
</tr>
<!-- BEGINELSE -->
<tr>
- <td class="row1" colspan="4" height="30" align="center" valign="middle"><span class="gen"><!-- IF S_TOPICS -->{L_NO_TOPICS_QUEUE}<!-- ELSE -->{L_UNAPPROVED_POSTS_ZERO_TOTAL}<!-- ENDIF --></span></td>
+ <td class="row1" colspan="4" height="30" align="center" valign="middle"><span class="gen"><!-- IF S_TOPICS -->{L_NO_TOPICS_QUEUE}<!-- ELSE -->{L_NO_POSTS_QUEUE}<!-- ENDIF --></span></td>
</tr>
<!-- END postrow -->
<tr>
diff --git a/phpBB/styles/subsilver2/template/mcp_topic.html b/phpBB/styles/subsilver2/template/mcp_topic.html
index 83c95c4ff9..8ff648da39 100644
--- a/phpBB/styles/subsilver2/template/mcp_topic.html
+++ b/phpBB/styles/subsilver2/template/mcp_topic.html
@@ -135,6 +135,7 @@
<!-- IF S_CAN_DELETE --><option value="delete_post">{L_DELETE_POSTS}</option><!-- ENDIF -->
<!-- IF S_CAN_MERGE --><option value="merge_posts"<!-- IF ACTION eq 'merge' --> selected="selected"<!-- ENDIF -->>{L_MERGE_POSTS}</option><!-- ENDIF -->
<!-- IF S_CAN_SPLIT --><option value="split_all"<!-- IF ACTION eq 'split' --> selected="selected"<!-- ENDIF -->>{L_SPLIT_POSTS}</option><option value="split_beyond">{L_SPLIT_AFTER}</option><!-- ENDIF -->
+ <!-- IF S_CAN_SYNC --><option value="resync">{L_RESYNC}</option><!-- ENDIF -->
</select>&nbsp;<input class="btnmain" type="submit" name="mcp_topic_submit" value="{L_SUBMIT}" /></td>
</tr>
</table>
diff --git a/phpBB/styles/subsilver2/template/posting_body.html b/phpBB/styles/subsilver2/template/posting_body.html
index 67ef1443ab..0b44446abd 100644
--- a/phpBB/styles/subsilver2/template/posting_body.html
+++ b/phpBB/styles/subsilver2/template/posting_body.html
@@ -333,6 +333,7 @@
<!-- ENDIF -->
<!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
+ <!-- DEFINE $CAPTCHA_TAB_INDEX = 4 -->
<!-- INCLUDE {CAPTCHA_TEMPLATE} -->
<!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/template.cfg b/phpBB/styles/subsilver2/template/template.cfg
index 82d3d2681b..cf5562a8a4 100644
--- a/phpBB/styles/subsilver2/template/template.cfg
+++ b/phpBB/styles/subsilver2/template/template.cfg
@@ -21,3 +21,7 @@ name = subsilver2
copyright = &copy; phpBB Group, 2003
version = 3.1.0-dev
+# Template inheritance
+# See http://blog.phpbb.com/2008/07/31/templating-just-got-easier/
+# Set value to empty to ignore template inheritance
+inherit_from = subsilver2
diff --git a/phpBB/styles/subsilver2/template/ucp_main_front.html b/phpBB/styles/subsilver2/template/ucp_main_front.html
index 2290a392e1..1445a71a1b 100644
--- a/phpBB/styles/subsilver2/template/ucp_main_front.html
+++ b/phpBB/styles/subsilver2/template/ucp_main_front.html
@@ -48,11 +48,11 @@
<!-- IF S_SHOW_ACTIVITY -->
<tr>
<td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_ACTIVE_IN_FORUM}: </b></td>
- <td><!-- IF ACTIVE_FORUM --><b><a class="gen" href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></b><br /><span class="genmed">[ {ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT} ]</span><!-- ELSE --><span class="gen">-</span><!-- ENDIF --></td>
+ <td><!-- IF ACTIVE_FORUM != '' --><b><a class="gen" href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></b><br /><span class="genmed">[ {ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT} ]</span><!-- ELSE --><span class="gen">-</span><!-- ENDIF --></td>
</tr>
<tr>
<td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_ACTIVE_IN_TOPIC}: </b></td>
- <td><!-- IF ACTIVE_TOPIC --><b><a class="gen" href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></b><br /><span class="genmed">[ {ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT} ]</span><!-- ELSE --><span class="gen">-</span><!-- ENDIF --></td>
+ <td><!-- IF ACTIVE_TOPIC != '' --><b><a class="gen" href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></b><br /><span class="genmed">[ {ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT} ]</span><!-- ELSE --><span class="gen">-</span><!-- ENDIF --></td>
</tr>
<!-- ENDIF -->
<!-- IF WARNINGS -->
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html b/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html
index 1b1c28fa3b..96e2e26683 100644
--- a/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html
+++ b/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html
@@ -22,12 +22,6 @@
<td class="row1" width="35%"><b class="genmed">{L_EMAIL_ADDRESS}: </b></td>
<td class="row2"><!-- IF S_CHANGE_EMAIL --><input type="text" class="post" name="email" size="30" maxlength="100" value="{EMAIL}" /><!-- ELSE --><b class="gen">{EMAIL}</b><!-- ENDIF --></td>
</tr>
-<!-- IF S_CHANGE_EMAIL -->
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_CONFIRM_EMAIL}: </b><br /><span class="gensmall">{L_CONFIRM_EMAIL_EXPLAIN}</span></td>
- <td class="row2"><input type="text" class="post" name="email_confirm" size="30" maxlength="100" value="{CONFIRM_EMAIL}" /></td>
- </tr>
-<!-- ENDIF -->
<!-- IF S_CHANGE_PASSWORD -->
<tr>
<td class="row1" width="35%"><b class="genmed">{L_NEW_PASSWORD}: </b><br /><span class="gensmall">{L_CHANGE_PASSWORD_EXPLAIN}</span></td>
diff --git a/phpBB/styles/subsilver2/template/ucp_register.html b/phpBB/styles/subsilver2/template/ucp_register.html
index ad6fb8d056..0c3533292d 100644
--- a/phpBB/styles/subsilver2/template/ucp_register.html
+++ b/phpBB/styles/subsilver2/template/ucp_register.html
@@ -42,10 +42,6 @@
<td class="row2"><input class="post" type="text" name="email" size="25" maxlength="100" value="{EMAIL}" /></td>
</tr>
<tr>
- <td class="row1"><b class="genmed">{L_CONFIRM_EMAIL}: </b></td>
- <td class="row2"><input class="post" type="text" name="email_confirm" size="25" maxlength="100" value="{EMAIL_CONFIRM}" /></td>
-</tr>
-<tr>
<td class="row1"><b class="genmed">{L_PASSWORD}: </b><br /><span class="gensmall">{L_PASSWORD_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="password" name="new_password" size="25" value="{PASSWORD}" /></td>
</tr>
diff --git a/phpBB/styles/subsilver2/theme/stylesheet.css b/phpBB/styles/subsilver2/theme/stylesheet.css
index ee1a8f44dc..18d15a8d41 100644
--- a/phpBB/styles/subsilver2/theme/stylesheet.css
+++ b/phpBB/styles/subsilver2/theme/stylesheet.css
@@ -1094,3 +1094,41 @@ a.imageset {
padding-left: 97px;
padding-top: 27px;
}
+
+/* RTL imageset entries */
+.rtl .imageset.site_logo {
+ padding-right: 170px;
+ padding-left: 0;
+}
+.rtl .imageset.upload_bar {
+ padding-right: 280px;
+ padding-left: 0;
+}
+.rtl .imageset.poll_left, .rtl .imageset.poll_right {
+ padding-right: 4px;
+ padding-left: 0;
+}
+.rtl .imageset.poll_center {
+ padding-right: 1px;
+ padding-left: 0;
+}
+.rtl .imageset.forum_link, .rtl .imageset.forum_read, .rtl .imageset.forum_read_locked, .rtl .imageset.forum_read_subforum, .rtl .imageset.forum_unread, .rtl .imageset.forum_unread_locked, .rtl .imageset.forum_unread_subforum {
+ padding-right: 46px;
+ padding-left: 0;
+}
+.rtl .imageset.topic_moved, .rtl .imageset.topic_read, .rtl .imageset.topic_read_mine, .rtl .imageset.topic_read_hot, .rtl .imageset.topic_read_hot_mine, .rtl .imageset.topic_read_locked, .rtl .imageset.topic_read_locked_mine, .rtl .imageset.topic_unread, .rtl .imageset.topic_unread_mine, .rtl .imageset.topic_unread_hot, .rtl .imageset.topic_unread_hot_mine, .rtl .imageset.topic_unread_locked, .rtl .imageset.topic_unread_locked_mine, .rtl .imageset.sticky_read, .rtl .imageset.sticky_read_mine, .rtl .imageset.sticky_read_locked, .rtl .imageset.sticky_read_locked_mine, .rtl .imageset.sticky_unread, .rtl .imageset.sticky_unread_mine, .rtl .imageset.sticky_unread_locked, .rtl .imageset.sticky_unread_locked_mine, .rtl .imageset.announce_read, .rtl .imageset.announce_read_mine, .rtl .imageset.announce_read_locked, .rtl .imageset.announce_read_locked_mine, .rtl .imageset.announce_unread, .rtl .imageset.announce_unread_mine, .rtl .imageset.announce_unread_locked, .rtl .imageset.announce_unread_locked_mine, .rtl .imageset.global_read, .rtl .imageset.global_read_mine, .rtl .imageset.global_read_locked, .rtl .imageset.global_read_locked_mine, .rtl .imageset.global_unread, .rtl .imageset.global_unread_mine, .rtl .imageset.global_unread_locked, .rtl .imageset.global_unread_locked_mine, .rtl .imageset.pm_read, .rtl .imageset.pm_unread, .rtl .imageset.icon_topic_reported, .rtl .imageset.icon_topic_unapproved {
+ padding-right: 19px;
+ padding-left: 0;
+}
+.rtl .imageset.icon_post_target, .rtl .imageset.icon_post_target_unread {
+ padding-right: 12px;
+ padding-left: 0;
+}
+.rtl .imageset.icon_topic_attach {
+ padding-right: 14px;
+ padding-left: 0;
+}
+.rtl .imageset.icon_topic_latest, .rtl .imageset.icon_topic_newest {
+ padding-right: 18px;
+ padding-left: 0;
+}
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 76dcfe22a3..2d91581cf4 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -282,7 +282,7 @@ if (!empty($_EXTRA_URL))
foreach ($_EXTRA_URL as $url_param)
{
$url_param = explode('=', $url_param, 2);
- $s_hidden_fields[$url_param[0]] = $url_param[1];
+ $s_search_hidden_fields[$url_param[0]] = $url_param[1];
}
}
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index cb6edf8423..7cb6df3660 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -567,7 +567,7 @@ if (!empty($_EXTRA_URL))
foreach ($_EXTRA_URL as $url_param)
{
$url_param = explode('=', $url_param, 2);
- $s_hidden_fields[$url_param[0]] = $url_param[1];
+ $s_search_hidden_fields[$url_param[0]] = $url_param[1];
}
}
diff --git a/phpunit.xml.all b/phpunit.xml.all
index b835a38c20..fde3bbb1a7 100644
--- a/phpunit.xml.all
+++ b/phpunit.xml.all
@@ -14,10 +14,6 @@
<testsuites>
<testsuite name="phpBB Test Suite">
<directory suffix="_test.php">./tests/</directory>
- <exclude>./tests/functional</exclude>
- </testsuite>
- <testsuite name="phpBB Functional Tests">
- <directory suffix="_test.php" phpVersion="5.3.0" phpVersionOperator=">=">./tests/functional</directory>
</testsuite>
</testsuites>
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index da31dce5e3..27dee48aac 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -14,10 +14,6 @@
<testsuites>
<testsuite name="phpBB Test Suite">
<directory suffix="_test.php">./tests/</directory>
- <exclude>./tests/functional</exclude>
- </testsuite>
- <testsuite name="phpBB Functional Tests">
- <directory suffix="_test.php" phpVersion="5.3.0" phpVersionOperator=">=">./tests/functional</directory>
</testsuite>
</testsuites>
diff --git a/phpunit.xml.functional b/phpunit.xml.functional
index 91d569e65b..9facbcff8b 100644
--- a/phpunit.xml.functional
+++ b/phpunit.xml.functional
@@ -14,10 +14,6 @@
<testsuites>
<testsuite name="phpBB Test Suite">
<directory suffix="_test.php">./tests/</directory>
- <exclude>./tests/functional</exclude>
- </testsuite>
- <testsuite name="phpBB Functional Tests">
- <directory suffix="_test.php" phpVersion="5.3.0" phpVersionOperator=">=">./tests/functional</directory>
</testsuite>
</testsuites>
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index bf946df381..f103d8f15a 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -10,25 +10,9 @@
define('IN_PHPBB', true);
$phpbb_root_path = 'phpBB/';
$phpEx = 'php';
-$table_prefix = 'phpbb_';
-
-if (!defined('E_DEPRECATED'))
-{
- define('E_DEPRECATED', 8192);
-}
-error_reporting(E_ALL & ~E_DEPRECATED);
-
-// If we are on PHP >= 6.0.0 we do not need some code
-if (version_compare(PHP_VERSION, '6.0.0-dev', '>='))
-{
- define('STRIP', false);
-}
-else
-{
- @set_magic_quotes_runtime(0);
- define('STRIP', (get_magic_quotes_gpc()) ? true : false);
-}
+require_once $phpbb_root_path . 'includes/startup.php';
+$table_prefix = 'phpbb_';
require_once $phpbb_root_path . 'includes/constants.php';
require_once $phpbb_root_path . 'includes/class_loader.' . $phpEx;
@@ -41,8 +25,4 @@ require_once 'test_framework/phpbb_test_case_helpers.php';
require_once 'test_framework/phpbb_test_case.php';
require_once 'test_framework/phpbb_database_test_case.php';
require_once 'test_framework/phpbb_database_test_connection_manager.php';
-
-if (version_compare(PHP_VERSION, '5.3.0-dev', '>='))
-{
- require_once 'test_framework/phpbb_functional_test_case.php';
-}
+require_once 'test_framework/phpbb_functional_test_case.php';
diff --git a/tests/dbal/select_test.php b/tests/dbal/select_test.php
index 05b0e68e29..21b12777dc 100644
--- a/tests/dbal/select_test.php
+++ b/tests/dbal/select_test.php
@@ -357,4 +357,29 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$this->assertSame(false, $row);
}
+
+ public function test_get_row_count()
+ {
+ $this->assertSame(
+ 3,
+ (int) $this->new_dbal()->get_row_count('phpbb_users'),
+ "Failed asserting that user table has exactly 3 rows."
+ );
+ }
+
+ public function test_get_estimated_row_count()
+ {
+ $actual = $this->new_dbal()->get_estimated_row_count('phpbb_users');
+
+ if (is_string($actual) && isset($actual[0]) && $actual[0] === '~')
+ {
+ $actual = substr($actual, 1);
+ }
+
+ $this->assertGreaterThan(
+ 1,
+ $actual,
+ "Failed asserting that estimated row count of user table is greater than 1."
+ );
+ }
}
diff --git a/tests/extension/ext/foo/type/dummy/empty.txt b/tests/extension/ext/foo/type/dummy/empty.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/extension/ext/foo/type/dummy/empty.txt
diff --git a/tests/extension/fixtures/extensions.xml b/tests/extension/fixtures/extensions.xml
index 65cb71c7a4..6eb6fd11a5 100644
--- a/tests/extension/fixtures/extensions.xml
+++ b/tests/extension/fixtures/extensions.xml
@@ -3,13 +3,16 @@
<table name="phpbb_ext">
<column>ext_name</column>
<column>ext_active</column>
+ <column>ext_state</column>
<row>
<value>foo</value>
<value>1</value>
+ <value></value>
</row>
<row>
<value>vendor/moo</value>
<value>0</value>
+ <value></value>
</row>
</table>
</dataset>
diff --git a/tests/group_positions/fixtures/group_positions.xml b/tests/group_positions/fixtures/group_positions.xml
index 55b1c2e08d..00ea18fe4f 100644
--- a/tests/group_positions/fixtures/group_positions.xml
+++ b/tests/group_positions/fixtures/group_positions.xml
@@ -4,20 +4,24 @@
<column>group_id</column>
<column>group_teampage</column>
<column>group_legend</column>
+ <column>group_desc</column>
<row>
<value>1</value>
<value>0</value>
<value>0</value>
+ <value></value>
</row>
<row>
<value>2</value>
<value>1</value>
<value>0</value>
+ <value></value>
</row>
<row>
<value>3</value>
<value>2</value>
<value>1</value>
+ <value></value>
</row>
</table>
</dataset>
diff --git a/tests/template/template_inheritance_test.php b/tests/template/template_inheritance_test.php
index 3a03de6427..6987ae6c73 100644
--- a/tests/template/template_inheritance_test.php
+++ b/tests/template/template_inheritance_test.php
@@ -62,15 +62,18 @@ class phpbb_template_template_inheritance_test extends phpbb_template_template_t
$this->run_template($file, $vars, $block_vars, $destroy, $expected, $cache_file);
}
- protected function setup_engine()
+ protected function setup_engine(array $new_config = array())
{
- global $phpbb_root_path, $phpEx, $config, $user;
+ global $phpbb_root_path, $phpEx, $user;
+
+ $defaults = $this->config_defaults();
+ $config = new phpbb_config(array_merge($defaults, $new_config));
$this->template_path = dirname(__FILE__) . '/templates';
$this->parent_template_path = dirname(__FILE__) . '/parent_templates';
$this->template_locator = new phpbb_template_locator();
$this->template_provider = new phpbb_template_path_provider();
$this->template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $this->template_locator, $this->template_provider);
- $this->template->set_custom_template($this->template_path, 'tests', $this->parent_template_path);
+ $this->template->set_custom_template($this->template_path, 'tests', $this->parent_template_path, 'parent');
}
}
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 419c90bd2a..76b1af68d8 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -347,6 +347,42 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
$this->assertEquals($expected, $this->display('container'), "Testing assign_display($file)");
}
+ public function test_append_var_without_assign_var()
+ {
+ $this->template->set_filenames(array(
+ 'append_var' => 'variable.html'
+ ));
+
+ $items = array('This ', 'is ', 'a ', 'test');
+ $expecting = implode('', $items);
+
+ foreach ($items as $word)
+ {
+ $this->template->append_var('VARIABLE', $word);
+ }
+
+ $this->assertEquals($expecting, $this->display('append_var'));
+ }
+
+ public function test_append_var_with_assign_var()
+ {
+ $this->template->set_filenames(array(
+ 'append_var' => 'variable.html'
+ ));
+
+ $start = 'This ';
+ $items = array('is ', 'a ', 'test');
+ $expecting = $start . implode('', $items);
+
+ $this->template->assign_var('VARIABLE', $start);
+ foreach ($items as $word)
+ {
+ $this->template->append_var('VARIABLE', $word);
+ }
+
+ $this->assertEquals($expecting, $this->display('append_var'));
+ }
+
public function test_php()
{
$this->setup_engine(array('tpl_allow_php' => true));
diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php
index a78837516b..5b60785fee 100644
--- a/tests/template/template_test_case.php
+++ b/tests/template/template_test_case.php
@@ -46,15 +46,20 @@ class phpbb_template_template_test_case extends phpbb_test_case
return str_replace("\n\n", "\n", implode("\n", array_map('trim', explode("\n", trim($result)))));
}
- protected function setup_engine(array $new_config = array())
+ protected function config_defaults()
{
- global $phpbb_root_path, $phpEx, $user;
-
$defaults = array(
'load_tplcompile' => true,
'tpl_allow_php' => false,
);
+ return $defaults;
+ }
+
+ protected function setup_engine(array $new_config = array())
+ {
+ global $phpbb_root_path, $phpEx, $user;
+ $defaults = $this->config_defaults();
$config = new phpbb_config(array_merge($defaults, $new_config));
$this->template_path = dirname(__FILE__) . '/templates';
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index ca52d24b7e..b5e6f7e377 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -102,8 +102,7 @@ class phpbb_functional_test_case extends phpbb_test_case
'admin_name' => 'admin',
'admin_pass1' => 'admin',
'admin_pass2' => 'admin',
- 'board_email1' => 'nobody@example.com',
- 'board_email2' => 'nobody@example.com',
+ 'board_email' => 'nobody@example.com',
));
$parseURL = parse_url(self::$config['phpbb_functional_url']);
diff --git a/travis/phpunit-mysql-travis.xml b/travis/phpunit-mysql-travis.xml
new file mode 100644
index 0000000000..79215c8de1
--- /dev/null
+++ b/travis/phpunit-mysql-travis.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit backupGlobals="true"
+ backupStaticAttributes="true"
+ colors="true"
+ convertErrorsToExceptions="true"
+ convertNoticesToExceptions="true"
+ convertWarningsToExceptions="true"
+ processIsolation="false"
+ stopOnFailure="false"
+ syntaxCheck="true"
+ strict="true"
+ bootstrap="../tests/bootstrap.php">
+ <testsuites>
+ <testsuite name="phpBB Test Suite">
+ <directory suffix="_test.php">../tests/</directory>
+ </testsuite>
+ </testsuites>
+
+ <groups>
+ <exclude>
+ <group>slow</group>
+ </exclude>
+ </groups>
+
+ <php>
+ <const name="dbms" value="mysqli"/>
+ <const name="dbhost" value="0.0.0.0" />
+ <const name="dbport" value="3306" />
+ <const name="dbname" value="phpbb_tests" />
+ <const name="dbuser" value="root" />
+ <const name="dbpasswd" value="" />
+ <const name="table_prefix" value="phpbb_"/>
+ </php>
+</phpunit>
diff --git a/travis/phpunit-postgres-travis.xml b/travis/phpunit-postgres-travis.xml
new file mode 100644
index 0000000000..02db76ae78
--- /dev/null
+++ b/travis/phpunit-postgres-travis.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit backupGlobals="true"
+ backupStaticAttributes="true"
+ colors="true"
+ convertErrorsToExceptions="true"
+ convertNoticesToExceptions="true"
+ convertWarningsToExceptions="true"
+ processIsolation="false"
+ stopOnFailure="false"
+ syntaxCheck="true"
+ strict="true"
+ bootstrap="../tests/bootstrap.php">
+ <testsuites>
+ <testsuite name="phpBB Test Suite">
+ <directory suffix="_test.php">../tests/</directory>
+ </testsuite>
+ </testsuites>
+
+ <groups>
+ <exclude>
+ <group>slow</group>
+ </exclude>
+ </groups>
+
+ <php>
+ <!-- "Real" test database -->
+ <!-- uncomment, otherwise sqlite memory runs -->
+ <const name="dbms" value="postgres"/>
+ <const name="dbhost" value="localhost" />
+ <const name="dbport" value="5432" />
+ <const name="dbname" value="phpbb_tests" />
+ <const name="dbuser" value="postgres" />
+ <const name="dbpasswd" value="" />
+ <const name="table_prefix" value="phpbb_"/>
+ </php>
+</phpunit>