mirror of
https://github.com/phpbb/phpbb.git
synced 2025-01-19 07:08:09 +01:00
Merge branch 'develop' into feature/dic
* develop: (441 commits) [feature/new-tz-handling] Don't use global user but make it a parameter [feature/new-tz-handling] Fix size of suggestion button in chrome [feature/new-tz-handling] Fall back to UTC, if the timezone is invalid [feature/new-tz-handling] Add previous selected value to validation if valid [feature/new-tz-handling] Display suggestion when a different value is selected [ticket/10998] Add border-radius to forum rules block - prosilver [feature/new-tz-handling] Remove additional marking of selected items [feature/new-tz-handling] Move update helper function to new class [feature/new-tz-handling] Fix unit test [feature/new-tz-handling] Delete old variable which is not used anymore [feature/new-tz-handling] Rename $user->tz back to $user->timezone [feature/pagination-as-list] New parameter for name of start var [feature/pagination-as-list] Updates for nils comments [feature/pagination-as-list] Rename and deprecate functions [feature/pagination-as-list] Various fixes and improvements [ticket/10968] Render pagination within the template [feature/new-tz-handling] Remove "timezone might be numeric" [feature/new-tz-handling] Add function to update the timezone [feature/new-tz-handling] Correctly update user and board timezones on update [ticket/10996] Use correct DBMS name in Travis config for PostgreSQL ... Conflicts: phpBB/common.php phpBB/composer.json phpBB/composer.lock tests/cron/task_provider_test.php
This commit is contained in:
commit
5d57caee58
12
.travis.yml
12
.travis.yml
@ -1,6 +1,7 @@
|
||||
language: php
|
||||
php:
|
||||
- 5.3.2
|
||||
- 5.3.3
|
||||
- 5.3
|
||||
- 5.4
|
||||
|
||||
env:
|
||||
@ -8,14 +9,13 @@ env:
|
||||
- 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' = 'postgres' ]; then psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres; fi"
|
||||
- sh -c "if [ '$DB' = 'postgres' ]; 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"
|
||||
- pyrus install --force phpunit/DbUnit
|
||||
- phpenv rehash
|
||||
- cd phpBB
|
||||
- curl -s http://getcomposer.org/installer | php
|
||||
- php composer.phar install
|
||||
- php ../composer.phar install --dev
|
||||
- cd ../
|
||||
|
||||
script:
|
||||
|
@ -13,8 +13,7 @@ Find support and lots more on [phpBB.com](http://www.phpbb.com)! Discuss the dev
|
||||
To be able to run an installation from the repo (and not from a pre-built package) you need to run the following commands to install phpBB's dependencies.
|
||||
|
||||
cd phpBB
|
||||
curl -s http://getcomposer.org/installer | php
|
||||
php composer.phar install
|
||||
php ../composer.phar install
|
||||
|
||||
|
||||
## CONTRIBUTE
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
<project name="phpBB" description="The phpBB forum software" default="all" basedir="../">
|
||||
<!-- a few settings for the build -->
|
||||
<property name="newversion" value="3.0.10" />
|
||||
<property name="prevversion" value="3.0.9" />
|
||||
<property name="olderversions" value="3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.7-PL1, 3.0.8, 3.0.10-RC1, 3.0.10-RC2, 3.0.10-RC3" />
|
||||
<property name="newversion" value="3.0.11-RC1" />
|
||||
<property name="prevversion" value="3.0.10" />
|
||||
<property name="olderversions" value="3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.7-PL1, 3.0.8, 3.0.9" />
|
||||
<!-- no configuration should be needed beyond this point -->
|
||||
|
||||
<property name="oldversions" value="${olderversions}, ${prevversion}" />
|
||||
@ -45,13 +45,7 @@
|
||||
|
||||
<target name="composer" depends="clean,prepare">
|
||||
<exec dir="./phpBB/"
|
||||
command="curl -s http://getcomposer.org/installer | php"
|
||||
passthru="true" />
|
||||
<exec dir="./phpBB/"
|
||||
command="php composer.phar install"
|
||||
passthru="true" />
|
||||
<exec dir="./phpBB/"
|
||||
command="rm composer.phar"
|
||||
command="php ../composer.phar install"
|
||||
passthru="true" />
|
||||
</target>
|
||||
|
||||
@ -169,13 +163,7 @@
|
||||
checkreturn="true" />
|
||||
|
||||
<exec dir="${dir}"
|
||||
command="curl -s http://getcomposer.org/installer | php"
|
||||
passthru="true" />
|
||||
<exec dir="${dir}"
|
||||
command="php composer.phar install"
|
||||
passthru="true" />
|
||||
<exec dir="${dir}"
|
||||
command="rm composer.phar"
|
||||
command="php ../composer.phar install"
|
||||
passthru="true" />
|
||||
|
||||
<delete file="${dir}/config.php" />
|
||||
|
BIN
composer.phar
Executable file
BIN
composer.phar
Executable file
Binary file not shown.
@ -12,6 +12,13 @@
|
||||
# ln -s ../../git-tools/hooks/commit-msg \\
|
||||
# .git/hooks/commit-msg
|
||||
#
|
||||
# You can configure whether invalid commit messages abort commits:
|
||||
#
|
||||
# git config phpbb.hooks.commit-msg.fatal true (abort)
|
||||
# git config phpbb.hooks.commit-msg.fatal false (warn only, do not abort)
|
||||
#
|
||||
# The default is to warn only.
|
||||
#
|
||||
# Warning/error messages use color by default if the output is a terminal
|
||||
# ("output" here is normally standard error when you run git commit).
|
||||
# To force or disable the use of color:
|
||||
@ -21,6 +28,15 @@
|
||||
|
||||
config_ns="phpbb.hooks.commit-msg";
|
||||
|
||||
if [ "$(git config --bool $config_ns.fatal)" = "true" ]
|
||||
then
|
||||
fatal=1;
|
||||
severity=Error;
|
||||
else
|
||||
fatal=0;
|
||||
severity=Warning;
|
||||
fi
|
||||
|
||||
debug_level=$(git config --int $config_ns.debug || echo 0);
|
||||
|
||||
# Error codes
|
||||
@ -47,9 +63,19 @@ debug()
|
||||
|
||||
quit()
|
||||
{
|
||||
# Now we always exit with success, since git will trash
|
||||
# entered commit message if commit-msg hook exits with a failure.
|
||||
exit 0
|
||||
if [ $1 -eq 0 ] || [ $1 -eq $ERR_UNKNOWN ]
|
||||
then
|
||||
# success
|
||||
exit 0;
|
||||
elif [ $fatal -eq 0 ]
|
||||
then
|
||||
# problems found but fatal is false
|
||||
complain 'Please run `git commit --amend` and fix the problems mentioned.' 1>&2
|
||||
exit 0;
|
||||
else
|
||||
complain "Aborting commit." 1>&2
|
||||
exit $1;
|
||||
fi
|
||||
}
|
||||
|
||||
use_color()
|
||||
@ -170,7 +196,7 @@ do
|
||||
# Don't be too strict.
|
||||
# Commits may be temporary, intended to be squashed later.
|
||||
# Just issue a warning here.
|
||||
complain "Warning: heading should be a sentence beginning with a capital letter." 1>&2
|
||||
complain "$severity: heading should be a sentence beginning with a capital letter." 1>&2
|
||||
complain "You entered:" 1>&2
|
||||
complain "$line" 1>&2
|
||||
fi
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 3.8 KiB |
BIN
phpBB/adm/images/phpbb_logo.png
Normal file
BIN
phpBB/adm/images/phpbb_logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.1 KiB |
@ -51,8 +51,8 @@ $module_id = request_var('i', '');
|
||||
$mode = request_var('mode', '');
|
||||
|
||||
// Set custom style for admin area
|
||||
$style->set_ext_dir_prefix('adm/');
|
||||
$style->set_custom_style('admin', $phpbb_admin_path . 'style', '');
|
||||
$phpbb_style->set_ext_dir_prefix('adm/');
|
||||
$phpbb_style->set_custom_style('admin', $phpbb_admin_path . 'style', '');
|
||||
$template->assign_var('T_ASSETS_PATH', $phpbb_root_path . 'assets');
|
||||
$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');
|
||||
|
||||
|
@ -378,11 +378,17 @@
|
||||
<fieldset class="tabulated">
|
||||
<legend>{L_TITLE}</legend>
|
||||
|
||||
<!-- IF PAGINATION or TOTAL_FILES -->
|
||||
<div class="pagination">
|
||||
{L_NUMBER_FILES}: {TOTAL_FILES} • {L_TOTAL_SIZE}: {TOTAL_SIZE}<!-- IF S_ON_PAGE --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {S_ON_PAGE}<!-- ENDIF --><!-- ENDIF -->
|
||||
</div>
|
||||
<!-- IF .pagination or TOTAL_FILES -->
|
||||
{L_NUMBER_FILES}: {TOTAL_FILES} • {L_TOTAL_SIZE}: {TOTAL_SIZE}
|
||||
<!-- IF .pagination -->
|
||||
•
|
||||
<!-- INCLUDE pagination.html -->
|
||||
<!-- ELSE -->
|
||||
{S_ON_PAGE}
|
||||
<!-- ENDIF -->
|
||||
<!-- ENDIF -->
|
||||
</div>
|
||||
|
||||
<table cellspacing="1">
|
||||
<thead>
|
||||
|
@ -239,11 +239,11 @@
|
||||
<!-- END member -->
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- IF PAGINATION -->
|
||||
<div class="pagination">
|
||||
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span>
|
||||
</div>
|
||||
<!-- IF .pagination -->
|
||||
<!-- INCLUDE pagination.html -->
|
||||
<!-- ENDIF -->
|
||||
</div>
|
||||
|
||||
<fieldset class="quick">
|
||||
<select name="action"><option class="sep" value="">{L_SELECT_OPTION}</option>{S_ACTION_OPTIONS}</select>
|
||||
|
@ -255,7 +255,11 @@
|
||||
<!-- END items -->
|
||||
</tbody>
|
||||
</table>
|
||||
<div>{PAGINATION}</div>
|
||||
<div class="pagination">
|
||||
<!-- IF .pagination -->
|
||||
<!-- INCLUDE pagination.html -->
|
||||
<!-- ENDIF -->
|
||||
</div>
|
||||
<p class="quick">
|
||||
<input class="button2" name="add" type="submit" value="{L_ICON_ADD}" /> <input class="button2" type="submit" name="edit" value="{L_ICON_EDIT}" />
|
||||
</p>
|
||||
|
@ -10,11 +10,11 @@
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<!-- IF PAGINATION -->
|
||||
<div class="pagination">
|
||||
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span>
|
||||
</div>
|
||||
<!-- IF .pagination -->
|
||||
<!-- INCLUDE pagination.html -->
|
||||
<!-- ENDIF -->
|
||||
</div>
|
||||
|
||||
<table cellspacing="1">
|
||||
<thead>
|
||||
|
@ -12,11 +12,11 @@
|
||||
{L_SEARCH_KEYWORDS}: <input type="text" name="keywords" value="{S_KEYWORDS}" /> <input type="submit" class="button2" name="filter" value="{L_SEARCH}" />
|
||||
</fieldset>
|
||||
|
||||
<!-- IF PAGINATION -->
|
||||
<div class="pagination" style="float: right; margin: 15px 0 2px 0">
|
||||
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span>
|
||||
</div>
|
||||
<!-- IF .pagination -->
|
||||
<!-- INCLUDE pagination.html -->
|
||||
<!-- ENDIF -->
|
||||
</div>
|
||||
|
||||
<div class="clearfix"> </div>
|
||||
<div><br style="clear: both;" /></div>
|
||||
|
@ -157,11 +157,11 @@
|
||||
<form id="user_attachments" method="post" action="{U_ACTION}">
|
||||
|
||||
|
||||
<!-- IF PAGINATION -->
|
||||
<div class="pagination">
|
||||
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span>
|
||||
</div>
|
||||
<!-- IF .pagination -->
|
||||
<!-- INCLUDE pagination.html -->
|
||||
<!-- ENDIF -->
|
||||
</div>
|
||||
|
||||
<!-- IF .attach -->
|
||||
<table cellspacing="1">
|
||||
@ -196,11 +196,11 @@
|
||||
<input class="button2" type="submit" value="{L_GO}" name="sort" />
|
||||
</fieldset>
|
||||
<hr />
|
||||
<!-- IF PAGINATION -->
|
||||
<div class="pagination">
|
||||
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span>
|
||||
</div>
|
||||
<!-- IF .pagination -->
|
||||
<!-- INCLUDE pagination.html -->
|
||||
<!-- ENDIF -->
|
||||
</div>
|
||||
|
||||
<fieldset class="quick">
|
||||
<input class="button2" type="submit" name="delmarked" value="{L_DELETE_MARKED}" />
|
||||
|
@ -1,10 +1,10 @@
|
||||
<form id="list" method="post" action="{U_ACTION}">
|
||||
|
||||
<!-- IF PAGINATION -->
|
||||
<div class="pagination">
|
||||
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span>
|
||||
</div>
|
||||
<!-- IF .pagination -->
|
||||
<!-- INCLUDE pagination.html -->
|
||||
<!-- ENDIF -->
|
||||
</div>
|
||||
|
||||
<!-- IF .log -->
|
||||
<table cellspacing="1">
|
||||
@ -44,11 +44,11 @@
|
||||
<input class="button2" type="submit" value="{L_GO}" name="sort" />
|
||||
</fieldset>
|
||||
<hr />
|
||||
<!-- IF PAGINATION -->
|
||||
<div class="pagination">
|
||||
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span>
|
||||
</div>
|
||||
<!-- IF .pagination -->
|
||||
<!-- INCLUDE pagination.html -->
|
||||
<!-- ENDIF -->
|
||||
</div>
|
||||
|
||||
<!-- IF S_CLEARLOGS -->
|
||||
<fieldset class="quick">
|
||||
|
@ -131,19 +131,24 @@
|
||||
</form>
|
||||
|
||||
<!-- IF not S_OWN_ACCOUNT -->
|
||||
<form id="user_delete" method="post" action="{U_ACTION}">
|
||||
<fieldset>
|
||||
<legend>{L_DELETE_USER}</legend>
|
||||
<dl>
|
||||
<dt><label for="delete_type">{L_DELETE_USER}:</label><br /><span>{L_DELETE_USER_EXPLAIN}</span></dt>
|
||||
<dd><select id="delete_type" name="delete_type"><option class="sep" value="">{L_SELECT_OPTION}</option><option value="retain">{L_RETAIN_POSTS}</option><option value="remove">{L_DELETE_POSTS}</option></select></dd>
|
||||
</dl>
|
||||
<p class="quick">
|
||||
<input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
|
||||
<input type="hidden" name="delete" value="1" />
|
||||
{S_FORM_TOKEN}
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
<form id="user_delete" method="post" action="{U_ACTION}">
|
||||
<fieldset>
|
||||
<legend>{L_DELETE_USER}</legend>
|
||||
<dl>
|
||||
<dt><label for="delete_type">{L_DELETE_USER}:</label><br /><span>{L_DELETE_USER_EXPLAIN}</span></dt>
|
||||
<dd>
|
||||
<!-- IF USER_HAS_POSTS -->
|
||||
<select id="delete_type" name="delete_type"><option class="sep" value="">{L_SELECT_OPTION}</option><option value="retain">{L_RETAIN_POSTS}</option><option value="remove">{L_DELETE_POSTS}</option></select></dd>
|
||||
<!-- ELSE -->
|
||||
{L_USER_NO_POSTS_TO_DELETE}<input type="hidden" id="delete_type" name="delete_type" value="retain" />
|
||||
<!-- ENDIF -->
|
||||
</dl>
|
||||
<p class="quick">
|
||||
<input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
|
||||
<input type="hidden" name="delete" value="1" />
|
||||
{S_FORM_TOKEN}
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
<!-- ENDIF -->
|
||||
<!-- ENDIF -->
|
||||
|
@ -52,15 +52,7 @@
|
||||
<dt><label for="style">{L_BOARD_STYLE}:</label></dt>
|
||||
<dd><select id="style" name="style">{S_STYLE_OPTIONS}</select></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="tz">{L_BOARD_TIMEZONE}:</label></dt>
|
||||
<dd><select id="tz" name="tz" style="width: 100%;">{S_TZ_OPTIONS}</select></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="dst">{L_BOARD_DST}:</label></dt>
|
||||
<dd><label><input type="radio" class="radio" name="dst" value="1"<!-- IF DST --> id="dst" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" class="radio" name="dst" value="0"<!-- IF not DST --> id="dst" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
|
||||
</dl>
|
||||
<!-- INCLUDE timezone_option.html -->
|
||||
<dl>
|
||||
<dt><label for="dateoptions">{L_BOARD_DATE_FORMAT}:</label><br /><span>{L_BOARD_DATE_FORMAT_EXPLAIN}</span></dt>
|
||||
<dd><select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){dE('custom_date',1);}else{dE('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }">{S_DATEFORMAT_OPTIONS}</select></dd>
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* phpBB 3.0 Admin Style Sheet
|
||||
/* phpBB 3.1 Admin Style Sheet
|
||||
------------------------------------------------------------------------
|
||||
Original author: subBlue ( http://www.subblue.com/ )
|
||||
Copyright 2007 phpBB Group ( http://www.phpbb.com/ )
|
||||
@ -146,15 +146,15 @@ li {
|
||||
#page-header {
|
||||
clear: both;
|
||||
text-align: right;
|
||||
background: url("../images/phpbb_logo.gif") top left no-repeat;
|
||||
height: 49px;
|
||||
background: url("../images/phpbb_logo.png") top left no-repeat;
|
||||
height: 54px;
|
||||
font-size: 0.85em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.rtl #page-header {
|
||||
text-align: left;
|
||||
background: url("../images/phpbb_logo.gif") top right no-repeat;
|
||||
background: url("../images/phpbb_logo.png") top right no-repeat;
|
||||
}
|
||||
|
||||
#page-header h1 {
|
||||
|
@ -28,7 +28,8 @@ phpbb.add_ajax_callback('forum_down', function() {
|
||||
|
||||
phpbb.ajaxify({
|
||||
selector: el.parents('span').siblings('.up').children('a'),
|
||||
callback: 'forum_up'
|
||||
callback: 'forum_up',
|
||||
overlay: false
|
||||
});
|
||||
}
|
||||
|
||||
@ -43,7 +44,8 @@ phpbb.add_ajax_callback('forum_down', function() {
|
||||
|
||||
phpbb.ajaxify({
|
||||
selector: tr.prev().find('.down').children('a'),
|
||||
callback: 'forum_down'
|
||||
callback: 'forum_down',
|
||||
overlay: false
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -61,7 +63,8 @@ phpbb.add_ajax_callback('forum_up', function() {
|
||||
|
||||
phpbb.ajaxify({
|
||||
selector: el.parents('span').siblings('.down').children('a'),
|
||||
callback: 'forum_down'
|
||||
callback: 'forum_down',
|
||||
overlay: false
|
||||
});
|
||||
}
|
||||
|
||||
@ -76,7 +79,8 @@ phpbb.add_ajax_callback('forum_up', function() {
|
||||
|
||||
phpbb.ajaxify({
|
||||
selector: tr.next().find('.up').children('a'),
|
||||
callback: 'forum_up'
|
||||
callback: 'forum_up',
|
||||
overlay: false
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -11,12 +11,12 @@
|
||||
// <![CDATA[
|
||||
function resize_panel()
|
||||
{
|
||||
var block = document.getElementById('codepanel');
|
||||
var block = document.getElementById('diff_content');
|
||||
var height;
|
||||
|
||||
if (window.innerHeight)
|
||||
{
|
||||
height = window.innerHeight - 150;
|
||||
height = window.innerHeight - 200;
|
||||
block.style.height = height + 'px';
|
||||
}
|
||||
else
|
||||
@ -115,6 +115,7 @@ table.hrdiff {
|
||||
overflow: hidden;
|
||||
border-bottom: 1px solid #999;
|
||||
table-layout: fixed;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
table.hrdiff th {
|
||||
@ -124,7 +125,8 @@ table.hrdiff th {
|
||||
font-family: Verdana,Helvetica,sans-serif;
|
||||
font-size: 11px;
|
||||
border-bottom: 1px solid #999;
|
||||
background: transparent;
|
||||
border-right: 1px solid #999;
|
||||
background: #D9D9D9;
|
||||
}
|
||||
|
||||
table.hrdiff thead th {
|
||||
@ -138,29 +140,23 @@ table.hrdiff tr:first-child th {
|
||||
}
|
||||
|
||||
table.hrdiff tbody th {
|
||||
padding: 2em 1px 1px 1px;
|
||||
font-size: 80%;
|
||||
border-top: 1px solid #999;
|
||||
}
|
||||
|
||||
table.hrdiff tbody td.old {
|
||||
border-left: 1px solid #999;
|
||||
border-right: 1px solid #999;
|
||||
}
|
||||
table.hrdiff tbody td.new {
|
||||
table.hrdiff tbody td {
|
||||
border-right: 1px solid #999;
|
||||
}
|
||||
|
||||
table.hrdiff td pre {
|
||||
overflow: auto;
|
||||
display: block;
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
display: block;
|
||||
font-family: "Consolas", monospace;
|
||||
font-size: 1.1em;
|
||||
white-space: pre-wrap; /* css-3 */
|
||||
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
||||
}
|
||||
|
||||
table.hrdiff .unmodified {
|
||||
background: #fff;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
table.hrdiff .added {
|
||||
|
@ -37,8 +37,8 @@
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="{T_JQUERY_LINK}"></script>
|
||||
<!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
|
||||
<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js"></script>
|
||||
<!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
|
||||
<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script>
|
||||
<!-- INCLUDEJS ajax.js -->
|
||||
{SCRIPTS}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<!-- IF META -->{META}<!-- ENDIF -->
|
||||
<title>{PAGE_TITLE}</title>
|
||||
|
||||
<link href="style/admin.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
<link href="style/admin.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet" type="text/css" media="screen" />
|
||||
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
|
12
phpBB/adm/style/pagination.html
Normal file
12
phpBB/adm/style/pagination.html
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> •
|
||||
<ul>
|
||||
<!-- BEGIN pagination -->
|
||||
<!-- IF pagination.S_IS_PREV --><li><a href="{pagination.PAGE_URL}">{L_PREVIOUS}</a></li>
|
||||
<!-- ELSEIF pagination.S_IS_CURRENT --><li class="active"><span>{pagination.PAGE_NUMBER}</span></li>
|
||||
<!-- ELSEIF pagination.S_IS_ELLIPSIS --><li class="ellipsis"><span>{L_ELLIPSIS}</span></li>
|
||||
<!-- ELSEIF pagination.S_IS_NEXT --><li><a href="{pagination.PAGE_URL}">{L_NEXT}</a></li>
|
||||
<!-- ELSE --><li><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a></li>
|
||||
<!-- ENDIF -->
|
||||
<!-- END pagination -->
|
||||
</ul>
|
@ -17,7 +17,7 @@
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="{T_JQUERY_LINK}"></script>
|
||||
<!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
|
||||
<!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<!-- IF META -->{META}<!-- ENDIF -->
|
||||
<title>{PAGE_TITLE}</title>
|
||||
|
||||
<link href="style/admin.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
<link href="style/admin.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet" type="text/css" media="screen" />
|
||||
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
|
11
phpBB/adm/style/timezone.js
Normal file
11
phpBB/adm/style/timezone.js
Normal file
@ -0,0 +1,11 @@
|
||||
(function($) { // Avoid conflicts with other libraries
|
||||
|
||||
$('#tz_date').change(function() {
|
||||
phpbb.timezone_switch_date(false);
|
||||
});
|
||||
|
||||
$(document).ready(
|
||||
phpbb.timezone_enable_date_selection
|
||||
);
|
||||
|
||||
})(jQuery); // Avoid conflicts with other libraries
|
19
phpBB/adm/style/timezone_option.html
Normal file
19
phpBB/adm/style/timezone_option.html
Normal file
@ -0,0 +1,19 @@
|
||||
<dl>
|
||||
<dt><label for="timezone">{L_BOARD_TIMEZONE}:</label></dt>
|
||||
<!-- IF S_TZ_DATE_OPTIONS -->
|
||||
<dd id="tz_select_date" style="display: none;">
|
||||
<select name="tz_date" id="tz_date" class="autowidth tz_select">
|
||||
<option value="">{L_SELECT_CURRENT_TIME}</option>
|
||||
{S_TZ_DATE_OPTIONS}
|
||||
</select>
|
||||
</dd>
|
||||
<!-- ENDIF -->
|
||||
<dd>
|
||||
<select name="tz" id="timezone" class="autowidth tz_select">
|
||||
<option value="">{L_SELECT_TIMEZONE}</option>
|
||||
{S_TZ_OPTIONS}
|
||||
</select>
|
||||
|
||||
<!-- INCLUDEJS timezone.js -->
|
||||
</dd>
|
||||
</dl>
|
@ -245,6 +245,7 @@ phpbb.ajaxify = function(options) {
|
||||
var elements = $(options.selector),
|
||||
refresh = options.refresh,
|
||||
callback = options.callback,
|
||||
overlay = (typeof options.overlay !== 'undefined') ? options.overlay : true,
|
||||
is_form = elements.is('form'),
|
||||
event_name = is_form ? 'submit' : 'click';
|
||||
|
||||
@ -382,7 +383,10 @@ phpbb.ajaxify = function(options) {
|
||||
return;
|
||||
}
|
||||
|
||||
phpbb.loading_alert();
|
||||
if (overlay)
|
||||
{
|
||||
phpbb.loading_alert();
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: action,
|
||||
@ -407,6 +411,99 @@ phpbb.ajaxify = function(options) {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide the optgroups that are not the selected timezone
|
||||
*
|
||||
* @param bool keep_selection Shall we keep the value selected, or shall the user be forced to repick one.
|
||||
*/
|
||||
phpbb.timezone_switch_date = function(keep_selection) {
|
||||
$('#timezone > optgroup').css('display', 'none');
|
||||
$("#timezone > optgroup[label='" + $('#tz_date').val() + "']").css('display', 'block');
|
||||
|
||||
if ($('#tz_date').val() == $('#tz_select_date_suggest').attr('data-suggested-tz')) {
|
||||
$('#tz_select_date_suggest').css('display', 'none');
|
||||
} else {
|
||||
$('#tz_select_date_suggest').css('display', 'inline');
|
||||
}
|
||||
|
||||
if ($("#timezone > optgroup[label='" + $('#tz_date').val() + "'] > option").size() == 1) {
|
||||
// If there is only one timezone for the selected date, we just select that automatically.
|
||||
$("#timezone > optgroup[label='" + $('#tz_date').val() + "'] > option:first").attr('selected', true);
|
||||
keep_selection = true;
|
||||
}
|
||||
|
||||
if (typeof keep_selection !== 'undefined' && !keep_selection) {
|
||||
$('#timezone > option:first').attr('selected', true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the date/time select
|
||||
*/
|
||||
phpbb.timezone_enable_date_selection = function() {
|
||||
$('#tz_select_date').css('display', 'block');
|
||||
}
|
||||
|
||||
/**
|
||||
* Preselect a date/time or suggest one, if it is not picked.
|
||||
*
|
||||
* @param bool force_selector Shall we select the suggestion?
|
||||
*/
|
||||
phpbb.timezone_preselect_select = function(force_selector) {
|
||||
|
||||
// The offset returned here is in minutes and negated.
|
||||
// http://www.w3schools.com/jsref/jsref_getTimezoneOffset.asp
|
||||
var offset = (new Date()).getTimezoneOffset();
|
||||
|
||||
if (offset < 0) {
|
||||
var sign = '+';
|
||||
offset = -offset;
|
||||
} else {
|
||||
var sign = '-';
|
||||
}
|
||||
|
||||
var minutes = offset % 60;
|
||||
var hours = (offset - minutes) / 60;
|
||||
|
||||
if (hours < 10) {
|
||||
hours = '0' + hours.toString();
|
||||
} else {
|
||||
hours = hours.toString();
|
||||
}
|
||||
|
||||
if (minutes < 10) {
|
||||
minutes = '0' + minutes.toString();
|
||||
} else {
|
||||
minutes = minutes.toString();
|
||||
}
|
||||
|
||||
var prefix = 'GMT' + sign + hours + ':' + minutes;
|
||||
var prefix_length = prefix.length;
|
||||
var selector_options = $('#tz_date > option');
|
||||
|
||||
for (var i = 0; i < selector_options.length; ++i) {
|
||||
var option = selector_options[i];
|
||||
|
||||
if (option.value.substring(0, prefix_length) == prefix) {
|
||||
if ($('#tz_date').val() != option.value && !force_selector) {
|
||||
// We do not select the option for the user, but notify him,
|
||||
// that we would suggest a different setting.
|
||||
$('#tz_select_date_suggest').css('display', 'inline');
|
||||
$('#tz_select_date_suggest').attr('title', $('#tz_select_date_suggest').attr('data-l-suggestion').replace("%s", option.innerHTML));
|
||||
$('#tz_select_date_suggest').attr('value', $('#tz_select_date_suggest').attr('data-l-suggestion').replace("%s", option.innerHTML.substring(0, 9)));
|
||||
$('#tz_select_date_suggest').attr('data-suggested-tz', option.innerHTML);
|
||||
phpbb.timezone_switch_date(true);
|
||||
} else {
|
||||
option.selected = true;
|
||||
phpbb.timezone_switch_date(!force_selector);
|
||||
$('#tz_select_date_suggest').attr('data-suggested-tz', option.innerHTML);
|
||||
$('#tz_select_date_suggest').css('display', 'none');
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
phpbb.ajax_callbacks = {};
|
||||
|
||||
/**
|
||||
@ -432,14 +529,47 @@ phpbb.add_ajax_callback = function(id, callback)
|
||||
* the alt-text data attribute, and replaces the text in the attribute with the
|
||||
* current text so that the process can be repeated.
|
||||
*/
|
||||
phpbb.add_ajax_callback('alt_text', function(data) {
|
||||
phpbb.add_ajax_callback('alt_text', function() {
|
||||
var el = $(this),
|
||||
alt_text;
|
||||
|
||||
alt_text = el.attr('data-alt-text');
|
||||
el.attr('data-alt-text', el.text());
|
||||
el.attr('title', alt_text);
|
||||
el.text(alt_text);
|
||||
});
|
||||
|
||||
/**
|
||||
* This callback is based on the alt_text callback.
|
||||
*
|
||||
* It replaces the current text with the text in the alt-text data attribute,
|
||||
* and replaces the text in the attribute with the current text so that the
|
||||
* process can be repeated.
|
||||
* Additionally it replaces the class of the link's parent
|
||||
* and changes the link itself.
|
||||
*/
|
||||
phpbb.add_ajax_callback('toggle_link', function() {
|
||||
var el = $(this),
|
||||
toggle_text,
|
||||
toggle_url,
|
||||
toggle_class;
|
||||
|
||||
// Toggle link text
|
||||
|
||||
toggle_text = el.attr('data-toggle-text');
|
||||
el.attr('data-toggle-text', el.text());
|
||||
el.attr('title', toggle_text);
|
||||
el.text(toggle_text);
|
||||
|
||||
// Toggle link url
|
||||
toggle_url = el.attr('data-toggle-url');
|
||||
el.attr('data-toggle-url', el.attr('href'));
|
||||
el.attr('href', toggle_url);
|
||||
|
||||
// Toggle class of link parent
|
||||
toggle_class = el.attr('data-toggle-class');
|
||||
el.attr('data-toggle-class', el.parent().attr('class'));
|
||||
el.parent().attr('class', toggle_class);
|
||||
});
|
||||
|
||||
})(jQuery); // Avoid conflicts with other libraries
|
||||
|
@ -124,7 +124,7 @@ $phpbb_extension_manager = $phpbb_container->get('ext.manager');
|
||||
$phpbb_subscriber_loader = $phpbb_container->get('event.subscriber_loader');
|
||||
|
||||
$template = $phpbb_container->get('template');
|
||||
$style = $phpbb_container->get('style');
|
||||
$phpbb_style = $phpbb_container->get('style');
|
||||
|
||||
// Add own hook handler
|
||||
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
|
||||
|
@ -1,8 +1,13 @@
|
||||
{
|
||||
"minimum-stability": "beta",
|
||||
"require": {
|
||||
"symfony/config": "2.0.*",
|
||||
"symfony/dependency-injection": "2.0.*",
|
||||
"symfony/event-dispatcher": "2.1.*",
|
||||
"symfony/event-dispatcher": "2.0.*",
|
||||
"symfony/yaml": "2.0.*"
|
||||
}
|
||||
},
|
||||
"require-dev": {
|
||||
"fabpot/goutte": "1.0.x-dev"
|
||||
}
|
||||
}
|
||||
|
19
phpBB/composer.lock
generated
19
phpBB/composer.lock
generated
@ -1,22 +1,29 @@
|
||||
{
|
||||
"hash": "b1e9c3bcfcee0c5630742abb3e49685f",
|
||||
"hash": "e4f5efe460878599e6fed6bb13584cfd",
|
||||
"packages": [
|
||||
{
|
||||
"package": "symfony/config",
|
||||
"version": "v2.0.12"
|
||||
"version": "v2.0.16"
|
||||
},
|
||||
{
|
||||
"package": "symfony/dependency-injection",
|
||||
"version": "v2.0.12"
|
||||
"version": "v2.0.16"
|
||||
},
|
||||
{
|
||||
"package": "symfony/event-dispatcher",
|
||||
"version": "v2.0.12"
|
||||
"version": "v2.0.16"
|
||||
},
|
||||
{
|
||||
"package": "symfony/yaml",
|
||||
"version": "v2.0.12"
|
||||
"version": "v2.0.16"
|
||||
}
|
||||
],
|
||||
"aliases": []
|
||||
"packages-dev": null,
|
||||
"aliases": [
|
||||
|
||||
],
|
||||
"minimum-stability": "beta",
|
||||
"stability-flags": {
|
||||
"fabpot/goutte": 20
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ parameters:
|
||||
dbal.dbhost:
|
||||
dbal.dbuser: root
|
||||
dbal.dbpasswd:
|
||||
dbal.dbname: phpbb_dev
|
||||
dbal.dbname: phpbb
|
||||
dbal.dbport:
|
||||
dbal.new_link: false
|
||||
tables.config: %core.table_prefix%config
|
||||
|
@ -79,7 +79,7 @@ services:
|
||||
class: phpbb_style_path_provider
|
||||
|
||||
template:
|
||||
class: phpbb_style_template
|
||||
class: phpbb_template
|
||||
arguments:
|
||||
- %core.root_path%
|
||||
- %core.php_ext%
|
||||
|
@ -1,15 +1,11 @@
|
||||
<?php
|
||||
// -------------------------------------------------------------
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// FILENAME : add_permissions.php
|
||||
// STARTED : Sat Nov 06, 2004
|
||||
// COPYRIGHT : © 2004 phpBB Group
|
||||
// WWW : http://www.phpbb.com/
|
||||
// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
/**
|
||||
*
|
||||
* @package phpBB3
|
||||
* @copyright (c) 2004 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
//
|
||||
// Security message:
|
||||
|
@ -1,15 +1,11 @@
|
||||
<?php
|
||||
// -------------------------------------------------------------
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// FILENAME : calc_email_hash.php
|
||||
// STARTED : Tue Feb 03, 2004
|
||||
// COPYRIGHT : © 2004 phpBB Group
|
||||
// WWW : http://www.phpbb.com/
|
||||
// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
/**
|
||||
*
|
||||
* @package phpBB3
|
||||
* @copyright (c) 2004 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
//
|
||||
// Security message:
|
||||
|
@ -1,21 +1,11 @@
|
||||
<?php
|
||||
/***************************************************************************
|
||||
* merge_clean_posts.php
|
||||
* -------------------
|
||||
* begin : Tuesday, February 25, 2003
|
||||
* copyright : (C) 2003 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* @package phpBB3
|
||||
* @copyright (c) 2003 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
//
|
||||
// Security message:
|
||||
|
@ -5,10 +5,8 @@
|
||||
* @copyright (c) 2009, 2010 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* This script will check your database for potentially dangerous flash BBCode tags
|
||||
*
|
||||
*/
|
||||
|
||||
//
|
||||
|
@ -237,7 +237,7 @@ $supported_dbms = array('firebird', 'mssql', 'mysql_40', 'mysql_41', 'oracle', '
|
||||
|
||||
foreach ($supported_dbms as $dbms)
|
||||
{
|
||||
$fp = fopen($schema_path . $dbms . '_schema.sql', 'wt');
|
||||
$fp = fopen($schema_path . $dbms . '_schema.sql', 'wb');
|
||||
|
||||
$line = '';
|
||||
|
||||
@ -397,7 +397,7 @@ foreach ($supported_dbms as $dbms)
|
||||
}
|
||||
}
|
||||
|
||||
// Adjust default value if db-dependant specified
|
||||
// Adjust default value if db-dependent specified
|
||||
if (is_array($column_data[1]))
|
||||
{
|
||||
$column_data[1] = (isset($column_data[1][$dbms])) ? $column_data[1][$dbms] : $column_data[1]['default'];
|
||||
@ -1794,8 +1794,7 @@ function get_schema_struct()
|
||||
'user_inactive_time' => array('TIMESTAMP', 0),
|
||||
'user_posts' => array('UINT', 0),
|
||||
'user_lang' => array('VCHAR:30', ''),
|
||||
'user_timezone' => array('DECIMAL', 0),
|
||||
'user_dst' => array('BOOL', 0),
|
||||
'user_timezone' => array('VCHAR:100', 'UTC'),
|
||||
'user_dateformat' => array('VCHAR_UNI:30', 'd M Y H:i'),
|
||||
'user_style' => array('UINT', 0),
|
||||
'user_rank' => array('UINT', 0),
|
||||
|
@ -1,17 +1,13 @@
|
||||
<?php
|
||||
// -------------------------------------------------------------
|
||||
//
|
||||
// FILENAME : create_variable_overview.php
|
||||
// STARTED : Fri Aug 15 2003
|
||||
// COPYRIGHT : © 2003 phpBB Group
|
||||
// WWW : http://www.phpbb.com/
|
||||
// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
|
||||
/*
|
||||
This script generates an index of some template vars and their use within the templates.
|
||||
It writes down all language variables used by various templates.
|
||||
/**
|
||||
*
|
||||
* @package phpBB3
|
||||
* @copyright (c) 2003 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
* This script generates an index of some template vars and their use within the templates.
|
||||
* It writes down all language variables used by various templates.
|
||||
*
|
||||
*/
|
||||
|
||||
//
|
||||
|
@ -1,13 +1,12 @@
|
||||
<?php
|
||||
// -------------------------------------------------------------
|
||||
//
|
||||
// FILENAME : fill.php
|
||||
// STARTED : Mon Sep 15, 2003
|
||||
// COPYRIGHT : © 2001, 2003 phpBB Group
|
||||
// WWW : http://www.phpbb.com/
|
||||
// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
/**
|
||||
*
|
||||
* @package phpBB3
|
||||
* @copyright (c) 2001, 2003 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
//
|
||||
// Security message:
|
||||
//
|
||||
@ -39,8 +38,8 @@ $posts_per_topic = 500;
|
||||
|
||||
|
||||
// general vars
|
||||
$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : 'generate';
|
||||
$start = (isset($_REQUEST['start'])) ? intval($_REQUEST['start']) : 0;
|
||||
$mode = request_var('mode', 'generate');
|
||||
$start = request_var('start', 0);
|
||||
|
||||
switch ($mode)
|
||||
{
|
||||
|
@ -1,15 +1,11 @@
|
||||
<?php
|
||||
// -------------------------------------------------------------
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// FILENAME : merge_attachment_tables.php
|
||||
// STARTED : Tue Nov 04, 2003
|
||||
// COPYRIGHT : © 2001, 2003 phpBB Group
|
||||
// WWW : http://www.phpbb.com/
|
||||
// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
/**
|
||||
*
|
||||
* @package phpBB3
|
||||
* @copyright (c) 2001, 2003 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
//
|
||||
// Security message:
|
||||
|
@ -1,22 +1,11 @@
|
||||
<?php
|
||||
/***************************************************************************
|
||||
* merge_clean_posts.php
|
||||
* -------------------
|
||||
* begin : Tuesday, February 25, 2003
|
||||
* copyright : (C) 2003 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* @package phpBB3
|
||||
* @copyright (c) 2003 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
//
|
||||
// Security message:
|
||||
|
@ -9,7 +9,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
//
|
||||
// Security message:
|
||||
//
|
||||
@ -176,7 +175,7 @@ foreach ($schema_data as $table_name => $table_data)
|
||||
$column_type = $dbms_type_map['mysql_41'][$column_data[0]];
|
||||
}
|
||||
|
||||
// Adjust default value if db-dependant specified
|
||||
// Adjust default value if db-dependent specified
|
||||
if (is_array($column_data[1]))
|
||||
{
|
||||
$column_data[1] = (isset($column_data[1][$dbms])) ? $column_data[1][$dbms] : $column_data[1]['default'];
|
||||
@ -1230,8 +1229,7 @@ function get_schema_struct()
|
||||
'user_inactive_time' => array('TIMESTAMP', 0),
|
||||
'user_posts' => array('UINT', 0),
|
||||
'user_lang' => array('VCHAR:30', ''),
|
||||
'user_timezone' => array('DECIMAL', 0),
|
||||
'user_dst' => array('BOOL', 0),
|
||||
'user_timezone' => array('VCHAR:100', 'UTC'),
|
||||
'user_dateformat' => array('VCHAR_UNI:30', 'd M Y H:i'),
|
||||
'user_style' => array('UINT', 0),
|
||||
'user_rank' => array('UINT', 0),
|
||||
|
@ -128,7 +128,7 @@ function add_bots($bots)
|
||||
'user_email' => '',
|
||||
'user_lang' => $config['default_lang'],
|
||||
'user_style' => 1,
|
||||
'user_timezone' => 0,
|
||||
'user_timezone' => 'UTC',
|
||||
'user_allow_massemail' => 0,
|
||||
);
|
||||
|
||||
|
@ -23,10 +23,10 @@ involved in phpBB.
|
||||
phpBB Lead Developer: naderman (Nils Adermann)
|
||||
|
||||
phpBB Developers: Acyd Burn (Meik Sievertsen) [Lead 09/2005 - 01/2010]
|
||||
Arty (Vjacheslav Trushkin)
|
||||
bantu (Andreas Fischer)
|
||||
ckwalsh (Cullen Walsh)
|
||||
imkingdavid (David King)
|
||||
igorw (Igor Wiedler)
|
||||
kellanved (Henry Sudhof)
|
||||
nickvergessen (Joas Schilling)
|
||||
Oleg (Oleg Pudeyev)
|
||||
rxu (Ruslan Uzdenov)
|
||||
@ -48,9 +48,11 @@ phpBB Developers: A_Jelly_Doughnut (Josh Woody) [01/2010 - 11/2010]
|
||||
APTX (Marek A. Ruszczyński) [12/2007 - 04/2011]
|
||||
Ashe (Ludovic Arnaud) [10/2002 - 11/2003, 06/2006 - 10/2006]
|
||||
BartVB (Bart van Bragt) [11/2000 - 03/2006]
|
||||
ckwalsh (Cullen Walsh) [01/2010 - 07/2011]
|
||||
DavidMJ (David M.) [12/2005 - 08/2009]
|
||||
dhn (Dominik Dröscher) [05/2007 - 01/2011]
|
||||
GrahamJE (Graham Eames) [09/2005 - 11/2006]
|
||||
kellanved (Henry Sudhof) [04/2007 - 03/2011]
|
||||
TerraFrost (Jim Wigginton) [04/2009 - 01/2011]
|
||||
Vic D'Elfant (Vic D'Elfant) [04/2007 - 04/2009]
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="keywords" content="" />
|
||||
<meta name="description" content="phpBB 3.0.x Changelog" />
|
||||
<meta name="description" content="phpBB 3.1.x Changelog" />
|
||||
<title>phpBB3 • Changelog</title>
|
||||
|
||||
<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
<div id="doc-description">
|
||||
<a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a>
|
||||
<h1>phpBB 3.0.x Changelog</h1>
|
||||
<h1>phpBB 3.1.x Changelog</h1>
|
||||
<p style="display: none;"><a href="#start_here">Skip</a></p>
|
||||
</div>
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
|
||||
<!-- BEGIN DOCUMENT -->
|
||||
|
||||
<p>This is a non-exhaustive (but still near complete) changelog for phpBB 3.0.x including release candidate versions. Our thanks to all those people who've contributed bug reports and code fixes.</p>
|
||||
<p>This is a non-exhaustive (but still near complete) changelog for phpBB 3.1.x including release candidate versions. Our thanks to all those people who've contributed bug reports and code fixes.</p>
|
||||
|
||||
<h1>Changelog</h1>
|
||||
|
||||
@ -46,6 +46,7 @@
|
||||
<ol>
|
||||
<li><a href="#changelog">Changelog</a>
|
||||
<ol style="list-style-type: lower-roman;">
|
||||
<li><a href="#v3010">Changes since 3.0.10</a></li>
|
||||
<li><a href="#v309">Changes since 3.0.9</a></li>
|
||||
<li><a href="#v308">Changes since 3.0.8</a></li>
|
||||
<li><a href="#v307-PL1">Changes since 3.0.7-PL1</a></li>
|
||||
@ -84,7 +85,123 @@
|
||||
|
||||
<div class="content">
|
||||
|
||||
<a name="v309"></a><h3>1.i. Changes since 3.0.9</h3>
|
||||
<a name="v3010"></a><h3>1.i. Changes since 3.0.10</h3>
|
||||
|
||||
<h4>Bug</h4>
|
||||
<ul>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-7432">PHPBB3-7432</a>] - Unclear language for Inactive Users on ACP main page</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8652">PHPBB3-8652</a>] - Duplicate Emails Sent When Subscribed to Forum and Topic</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9079">PHPBB3-9079</a>] - Display backtrace on all E_USER_ERROR errors, not only SQL errors (when DEBUG_EXTRA is enabled)</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9084">PHPBB3-9084</a>] - Unable to display 'option equal to non entered value' if dropdown CPF is not required</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9089">PHPBB3-9089</a>] - PM message title box not accessible via Tab key</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9220">PHPBB3-9220</a>] - Blue border width when table in a div</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9681">PHPBB3-9681</a>] - Password length not in security settings</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9813">PHPBB3-9813</a>] - fulltext_native.php on innodb loading deadly slow for big indexes</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9831">PHPBB3-9831</a>] - Cannot change default of Boolean checkbox custom profile field</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10094">PHPBB3-10094</a>] - Clear cache before phpBB installation</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10129">PHPBB3-10129</a>] - Missing apostrophes in ACP user management -> permissions</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10349">PHPBB3-10349</a>] - Unit tests do not remove comments from schemas</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10399">PHPBB3-10399</a>] - Special characters aren't parsed in style component variables</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10401">PHPBB3-10401</a>] - auth_ldap has an incorrect return value in login_ldap()</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10407">PHPBB3-10407</a>] - Incorrect check for empty image file paths during conversion</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10428">PHPBB3-10428</a>] - optionget/optionset functions in session.php and acp_users.php incorrectly check whether $data is at its default value</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10456">PHPBB3-10456</a>] - Subsilver2 does not define $CAPTCHA_TAB_INDEX</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10508">PHPBB3-10508</a>] - Marking forums as read displays misleading language</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10511">PHPBB3-10511</a>] - Grammar defect in permissions language</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10512">PHPBB3-10512</a>] - Test failure when no default timezone is set in php</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10532">PHPBB3-10532</a>] - Out of range $start causes a page with no search results but with pagination</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10538">PHPBB3-10538</a>] - Special character are not correctly parsed for SMTP protocol</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10542">PHPBB3-10542</a>] - Incorrect class="postlink" in styles/subsilver2/template/faq_body.html</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10546">PHPBB3-10546</a>] - Argument missing for adm_back_link() in acp_captcha.php</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10561">PHPBB3-10561</a>] - All users can choose deactivated styles.</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10569">PHPBB3-10569</a>] - template/ucp_main_front.html does not correctly handle active topic with the name "0"</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10580">PHPBB3-10580</a>] - Default tz in registration dropdown not the same as the board default tz</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10589">PHPBB3-10589</a>] - user_birthday does not use table alias in $leap_year_birthdays variable definition</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10605">PHPBB3-10605</a>] - Orpahned privmsgs are left in the prvmsgs table, with no ties in privmsgs_to table</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10606">PHPBB3-10606</a>] - $s_hidden_fields -> incorrect array name (3 files affected)</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10611">PHPBB3-10611</a>] - Add a check for selected tables existence for ACP database backup tool</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10615">PHPBB3-10615</a>] - Static calls in utf normalizer yield E_STRICT spam on php 5.4</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10630">PHPBB3-10630</a>] - Prune Users produced unnecessarily long query; Got a packet bigger than 'max_allowed_packet' bytes</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10633">PHPBB3-10633</a>] - Users are able to get the real filename of attachment</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10639">PHPBB3-10639</a>] - negative value of ranks message</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10658">PHPBB3-10658</a>] - Rank-item is not shown on team-list</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10675">PHPBB3-10675</a>] - Use more descriptive message when disk is out of space</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10684">PHPBB3-10684</a>] - Function user_notification() prevents notifications for users with stale bans</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10689">PHPBB3-10689</a>] - Bug in the popup " Find a member" when select by letter.</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10691">PHPBB3-10691</a>] - Search index creation CLI script incorrectly calculates indexing speed</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10699">PHPBB3-10699</a>] - Long h2 title breaks div.minitabs in MCP</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10708">PHPBB3-10708</a>] - After a conversion, passwords with UTF8 characters do not work when user_pass_convert is set.</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10717">PHPBB3-10717</a>] - memberlist_view.html: including admin defined profile fields doesnt work</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10723">PHPBB3-10723</a>] - Do not use SQLite on PHP 5.4 in Tests on Travis</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10731">PHPBB3-10731</a>] - JS function addquote() works incorrectly in Opera</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10751">PHPBB3-10751</a>] - MS SQL Error when searching Admin Log</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10760">PHPBB3-10760</a>] - In pre-commit git hook, syntax error is thrown, but is not specifically described</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10767">PHPBB3-10767</a>] - Git hooks do not work properly with git GUIs</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10774">PHPBB3-10774</a>] - db_tools::create_unique_index does not use specified index names on MySQL</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10790">PHPBB3-10790</a>] - Strict comparison on user_id for sending pms</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10797">PHPBB3-10797</a>] - Template var for user rank not filled</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10835">PHPBB3-10835</a>] - Misleading message in UCP when no permission to change password</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10846">PHPBB3-10846</a>] - Missing alias for MAX(post_id) in SQL query in acp_main.php</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10849">PHPBB3-10849</a>] - Missing BBCode Help Text in subsilver2</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10858">PHPBB3-10858</a>] - $db->sql_fetchfield returns false with mssqlnative</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10860">PHPBB3-10860</a>] - Side-by-side diff styling javascript bug</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10881">PHPBB3-10881</a>] - Some files use 0xA9 as the copyright symbol which is neither ASCII nor the UTF8 copyright symbol.</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10887">PHPBB3-10887</a>] - Auto increment tests depend on varbinary handling</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10889">PHPBB3-10889</a>] - Default value for c_char_size in database unit tests is an empty string instead of a char(4)</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10890">PHPBB3-10890</a>] - test_sql_fetchrow_returns_false_when_empty() fails on MSSQL and Oracle</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10908">PHPBB3-10908</a>] - No remote avatar size limit results in files limited only by PHP memory limit</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10913">PHPBB3-10913</a>] - Admin is logged out when accessing any url under adm/ without session id</li>
|
||||
</ul>
|
||||
<h4>Improvement</h4>
|
||||
<ul>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8599">PHPBB3-8599</a>] - Add "Select All" to "Add multiple smilies" screen</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8636">PHPBB3-8636</a>] - Add resync option to topic_view moderation page</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9876">PHPBB3-9876</a>] - Names and descriptions for roles "Newly registered User" in "User roles" and "Forum roles" must be different</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9914">PHPBB3-9914</a>] - Add backup warning to Automatic DB Updater</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9916">PHPBB3-9916</a>] - License in header not linking to version 2 of GNU GPL</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10093">PHPBB3-10093</a>] - Make commit-msg hook always not fatal</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10162">PHPBB3-10162</a>] - Allow TLDs over 6 characters in email addresses</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10280">PHPBB3-10280</a>] - Change the ACP user activation display</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10308">PHPBB3-10308</a>] - Disable Retain/Delete Posts selection if the user has no posts.</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10453">PHPBB3-10453</a>] - PM viewmessage page is misplacing the online icon</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10492">PHPBB3-10492</a>] - Port functional tests to develop-olympus</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10507">PHPBB3-10507</a>] - Sort installed styles list in admin control panel - styles</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10550">PHPBB3-10550</a>] - Sort not installed styles list in admin control panel - styles</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10563">PHPBB3-10563</a>] - ACP usability improvement: show deactivated styles below active styles in styles list</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10565">PHPBB3-10565</a>] - Performance: Unneeded GROUP BY in update_forum_tracking_info</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10607">PHPBB3-10607</a>] - phpBB Credit Line Hardcoded</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10653">PHPBB3-10653</a>] - Add ability to count table rows to database abstraction layer</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10730">PHPBB3-10730</a>] - Add label tags around "select" text in post splitting UI in MCP</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10764">PHPBB3-10764</a>] - FAQ mentions SourceForge</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10812">PHPBB3-10812</a>] - Installer should not display register globals UI for php 5.4+</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10815">PHPBB3-10815</a>] - Enable Feeds by default</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10819">PHPBB3-10819</a>] - Improve side-by-side diff styling</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10834">PHPBB3-10834</a>] - Backport general development language changes in readme files</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10836">PHPBB3-10836</a>] - Enable Avatars by default</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10891">PHPBB3-10891</a>] - Allow specifying test config file name via environment variable</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10892">PHPBB3-10892</a>] - Cosmetic improvements to RUNNING_TESTS.txt</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10898">PHPBB3-10898</a>] - Do not write ?> into config.php to avoid whitespace output</li>
|
||||
</ul>
|
||||
<h4>New Feature</h4>
|
||||
<ul>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10616">PHPBB3-10616</a>] - Add template inheritance by default</li>
|
||||
</ul>
|
||||
<h4>Sub-task</h4>
|
||||
<ul>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10907">PHPBB3-10907</a>] - Mark (var)binary tests as incomplete on non-MySQL DBMSes</li>
|
||||
</ul>
|
||||
<h4>Task</h4>
|
||||
<ul>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9896">PHPBB3-9896</a>] - Update links in docs/readme.html</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10434">PHPBB3-10434</a>] - Add a script that allows creating a search index from CLI</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10455">PHPBB3-10455</a>] - Remove NOTE from header files</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10694">PHPBB3-10694</a>] - Update notification in ACP (Olympus) for increase of minimum PHP version to 5.3.2</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10718">PHPBB3-10718</a>] - Add Travis CI</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10788">PHPBB3-10788</a>] - Update docs/AUTHORS for 3.0.11-RC1</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10909">PHPBB3-10909</a>] - Update Travis Test Configuration: Travis no longer supports PHP 5.3.2</li>
|
||||
</ul>
|
||||
|
||||
<a name="v309"></a><h3>1.ii. Changes since 3.0.9</h3>
|
||||
|
||||
<h4>Bug</h4>
|
||||
<ul>
|
||||
@ -220,7 +337,7 @@
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10480">PHPBB3-10480</a>] - Automate changelog building</li>
|
||||
</ul>
|
||||
|
||||
<a name="v308"></a><h3>1.ii. Changes since 3.0.8</h3>
|
||||
<a name="v308"></a><h3>1.iii. Changes since 3.0.8</h3>
|
||||
|
||||
<h4> Bug
|
||||
</h4>
|
||||
@ -588,7 +705,7 @@
|
||||
</ul>
|
||||
|
||||
|
||||
<a name="v307-PL1"></a><h3>1.iii. Changes since 3.0.7-PL1</h3>
|
||||
<a name="v307-PL1"></a><h3>1.iv. Changes since 3.0.7-PL1</h3>
|
||||
<h4> Security
|
||||
</h4>
|
||||
<ul>
|
||||
@ -1046,13 +1163,13 @@
|
||||
</ul>
|
||||
|
||||
|
||||
<a name="v307"></a><h3>1.iiv. Changes since 3.0.7</h3>
|
||||
<a name="v307"></a><h3>1.iv. Changes since 3.0.7</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Sec] Do not expose forum content of forums with ACL entries but no actual permission in ATOM Feeds. (Bug #58595)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v306"></a><h3>1.v. Changes since 3.0.6</h3>
|
||||
<a name="v306"></a><h3>1.vi. Changes since 3.0.6</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Allow ban reason and length to be selected and copied in ACP and subsilver2 MCP. (Bug #51095)</li>
|
||||
@ -1156,7 +1273,7 @@
|
||||
|
||||
</ul>
|
||||
|
||||
<a name="v305"></a><h3>1.vi. Changes since 3.0.5</h3>
|
||||
<a name="v305"></a><h3>1.vii. Changes since 3.0.5</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Allow whitespaces in avatar gallery names. (Bug #44955)</li>
|
||||
@ -1378,7 +1495,7 @@
|
||||
<li>[Feature] Send anonymous statistical information to phpBB on installation and update (optional).</li>
|
||||
</ul>
|
||||
|
||||
<a name="v304"></a><h3>1.vii. Changes since 3.0.4</h3>
|
||||
<a name="v304"></a><h3>1.viii. Changes since 3.0.4</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Delete user entry from ban list table upon user deletion (Bug #40015 - Patch by TerraFrost)</li>
|
||||
@ -1467,7 +1584,7 @@
|
||||
<li>[Sec] Only use forum id supplied for posting if global announcement detected. (Reported by nickvergessen)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v303"></a><h3>1.viii. Changes since 3.0.3</h3>
|
||||
<a name="v303"></a><h3>1.ix. Changes since 3.0.3</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Allow mixed-case template directories to be inherited (Bug #36725)</li>
|
||||
@ -1499,7 +1616,7 @@
|
||||
<li>[Sec] Ask for forum password if post within passworded forum quoted in private message. (Reported by nickvergessen)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v302"></a><h3>1.ix. Changes since 3.0.2</h3>
|
||||
<a name="v302"></a><h3>1.x. Changes since 3.0.2</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Correctly set topic starter if first post in topic removed (Bug #30575 - Patch by blueray2048)</li>
|
||||
@ -1598,7 +1715,7 @@
|
||||
<li>[Sec Precaution] Stricter validation of the HTTP_HOST header (Thanks to Techie-Micheal et al for pointing out possible issues in derived code)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v301"></a><h3>1.x. Changes since 3.0.1</h3>
|
||||
<a name="v301"></a><h3>1.xi. Changes since 3.0.1</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Ability to set permissions on non-mysql dbms (Bug #24955)</li>
|
||||
@ -1646,7 +1763,7 @@
|
||||
<li>[Sec] Only allow urls gone through redirect() being used within login_box(). (thanks nookieman)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v300"></a><h3>1.xi Changes since 3.0.0</h3>
|
||||
<a name="v300"></a><h3>1.xii Changes since 3.0.0</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Change] Validate birthdays (Bug #15004)</li>
|
||||
@ -1717,7 +1834,7 @@
|
||||
<li>[Fix] Find and display colliding usernames correctly when converting from one database to another (Bug #23925)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v30rc8"></a><h3>1.xii. Changes since 3.0.RC8</h3>
|
||||
<a name="v30rc8"></a><h3>1.xiii. Changes since 3.0.RC8</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Cleaned usernames contain only single spaces, so "a_name" and "a__name" are treated as the same name (Bug #15634)</li>
|
||||
@ -1726,7 +1843,7 @@
|
||||
<li>[Fix] Call garbage_collection() within database updater to correctly close connections (affects Oracle for example)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v30rc7"></a><h3>1.xiii. Changes since 3.0.RC7</h3>
|
||||
<a name="v30rc7"></a><h3>1.xiv. Changes since 3.0.RC7</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Fixed MSSQL related bug in the update system</li>
|
||||
@ -1761,7 +1878,7 @@
|
||||
<li>[Fix] No duplication of active topics (Bug #15474)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v30rc6"></a><h3>1.xiv. Changes since 3.0.RC6</h3>
|
||||
<a name="v30rc6"></a><h3>1.xv. Changes since 3.0.RC6</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Submitting language changes using acp_language (Bug #14736)</li>
|
||||
@ -1771,7 +1888,7 @@
|
||||
<li>[Fix] Able to request new password (Bug #14743)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v30rc5"></a><h3>1.xv. Changes since 3.0.RC5</h3>
|
||||
<a name="v30rc5"></a><h3>1.xvi. Changes since 3.0.RC5</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Feature] Removing constant PHPBB_EMBEDDED in favor of using an exit_handler(); the constant was meant to achive this more or less.</li>
|
||||
@ -1834,7 +1951,7 @@
|
||||
<li>[Sec] New password hashing mechanism for storing passwords (#i42)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v30rc4"></a><h3>1.xvi. Changes since 3.0.RC4</h3>
|
||||
<a name="v30rc4"></a><h3>1.xvii. Changes since 3.0.RC4</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] MySQL, PostgreSQL and SQLite related database fixes (Bug #13862)</li>
|
||||
@ -1885,7 +2002,7 @@
|
||||
<li>[Fix] odbc_autocommit causing existing result sets to be dropped (Bug #14182)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v30rc3"></a><h3>1.xvii. Changes since 3.0.RC3</h3>
|
||||
<a name="v30rc3"></a><h3>1.xviii. Changes since 3.0.RC3</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Fixing some subsilver2 and prosilver style issues</li>
|
||||
@ -1994,7 +2111,7 @@
|
||||
|
||||
</ul>
|
||||
|
||||
<a name="v30rc2"></a><h3>1.xviii. Changes since 3.0.RC2</h3>
|
||||
<a name="v30rc2"></a><h3>1.xviv. Changes since 3.0.RC2</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Re-allow searching within the memberlist</li>
|
||||
@ -2040,7 +2157,7 @@
|
||||
|
||||
</ul>
|
||||
|
||||
<a name="v30rc1"></a><h3>1.xix. Changes since 3.0.RC1</h3>
|
||||
<a name="v30rc1"></a><h3>1.xx. Changes since 3.0.RC1</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] (X)HTML issues within the templates (Bug #11255, #11255)</li>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="keywords" content="" />
|
||||
<meta name="description" content="phpBB 3.0.x frequently asked questions" />
|
||||
<meta name="description" content="phpBB 3.1.x frequently asked questions" />
|
||||
<title>phpBB3 • FAQ</title>
|
||||
|
||||
<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
|
||||
@ -20,8 +20,8 @@
|
||||
|
||||
<div id="doc-description">
|
||||
<a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a>
|
||||
<h1>phpBB 3.0.x FAQ</h1>
|
||||
<p>phpBB 3.0.x frequently asked questions</p>
|
||||
<h1>phpBB 3.1.x FAQ</h1>
|
||||
<p>phpBB 3.1.x frequently asked questions</p>
|
||||
<p style="display: none;"><a href="#start_here">Skip</a></p>
|
||||
</div>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="keywords" content="" />
|
||||
<meta name="description" content="phpBB 3.0.x Installation, updating and conversion informations" />
|
||||
<meta name="description" content="phpBB 3.1.x Installation, updating and conversion informations" />
|
||||
<title>phpBB3 • Install</title>
|
||||
|
||||
<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
|
||||
@ -20,8 +20,8 @@
|
||||
|
||||
<div id="doc-description">
|
||||
<a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a>
|
||||
<h1>phpBB 3.0.x Install</h1>
|
||||
<p>phpBB 3.0.x Installation, updating and conversion informations</p>
|
||||
<h1>phpBB 3.1.x Install</h1>
|
||||
<p>phpBB 3.1.x Installation, updating and conversion informations</p>
|
||||
<p style="display: none;"><a href="#start_here">Skip</a></p>
|
||||
</div>
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
<li><a href="#quickinstall">Quick install</a></li>
|
||||
<li><a href="#require">Requirements</a></li>
|
||||
<li><a href="#install">New installation</a></li>
|
||||
<li><a href="#update">Updating from stable releases of phpBB 3.0.x</a>
|
||||
<li><a href="#update">Updating from stable releases of phpBB 3.1.x</a>
|
||||
<ol style="list-style-type: lower-roman;">
|
||||
<li><a href="#update_full">Full package</a></li>
|
||||
<li><a href="#update_files">Changed files only</a></li>
|
||||
@ -61,7 +61,7 @@
|
||||
<li><a href="#update_all">All package types</a></li>
|
||||
</ol>
|
||||
</li>
|
||||
<li><a href="#convert">Conversion from phpBB 2.0.x to phpBB 3.0.x</a>
|
||||
<li><a href="#convert">Conversion from phpBB 2.0.x to phpBB 3.1.x</a>
|
||||
<ol style="list-style-type: lower-roman;">
|
||||
<li><a href="#prereq">Requirements before converting</a></li>
|
||||
<li><a href="#conversion">Converting</a></li>
|
||||
@ -124,7 +124,7 @@
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>phpBB3 has a few requirements which must be met before you are able to install and use it.</p>
|
||||
<p>phpBB 3.1.x has a few requirements which must be met before you are able to install and use it.</p>
|
||||
|
||||
<ul>
|
||||
<li>A webserver or web hosting account running on any major Operating System with support for PHP</li>
|
||||
@ -132,15 +132,19 @@
|
||||
<ul>
|
||||
<li>MySQL 3.23 or above (MySQLi supported)</li>
|
||||
<li>PostgreSQL 7.3+</li>
|
||||
<li>SQLite 2.8.2+</li>
|
||||
<li>SQLite 2.8.2+ (SQLite 3 is not supported)</li>
|
||||
<li>Firebird 2.1+</li>
|
||||
<li>MS SQL Server 2000 or above (directly or via ODBC)</li>
|
||||
<li>MS SQL Server 2000 or above (directly or via ODBC or the native adapter)</li>
|
||||
<li>Oracle</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>PHP 5.3.2+</strong> with support for the database you intend to use.</li>
|
||||
<li>The following PHP modules are required:</li>
|
||||
<ul>
|
||||
<li>json</li>
|
||||
</ul>
|
||||
<li>getimagesize() function need to be enabled.</li>
|
||||
<li>These optional presence of the following modules within PHP will provide access to additional features, but they are not required.
|
||||
<li>Presence of the following modules within PHP will provide access to additional features, but they are not required:
|
||||
<ul>
|
||||
<li>zlib Compression support</li>
|
||||
<li>Remote FTP support</li>
|
||||
@ -151,7 +155,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>If your server or hosting account does not meet the requirements above we are afraid phpBB3 is not for you.</p>
|
||||
<p>If your server or hosting account does not meet the requirements above we are afraid phpBB 3.1.x is not for you.</p>
|
||||
|
||||
</div>
|
||||
|
||||
@ -175,7 +179,7 @@
|
||||
|
||||
<p>All .php, .inc, .sql, .cfg, .html and .txt files should be uploaded in <strong>ASCII</strong> mode, while all graphics should be uploaded in <strong>BINARY</strong> mode. If you are unfamiliar with what this means please refer to your FTP client documentation. In most cases this is all handled transparantly by your ftp client but if you encounter problems later you should be sure the files where uploaded correctly as described here.</p>
|
||||
|
||||
<p>phpBB3 comes supplied with english as its standard language. However a number of separate packs for different languages are available. If you are not a native english speaker you may wish to install one or more of these packages before continuing. The installation process below will allow you to select a default language from those available (you can of course change this default at a later stage). For more details of language packs, where to obtain them and how to install them please see the <a href="README.html#i18n">README</a>.</p>
|
||||
<p>phpBB3 comes supplied with British English as its standard language. However a number of separate packs for different languages are available. If you are not a native English speaker you may wish to install one or more of these packages before continuing. The installation process below will allow you to select a default language from those available (you can of course change this default at a later stage). For more details of language packs, where to obtain them and how to install them please see the <a href="README.html#i18n">README</a>.</p>
|
||||
|
||||
<p>Once all the files have been uploaded to your site you should point your browser at this location with the addition of <code>install/</code>. For example if your domain name is <em>www.mydomain.tld</em> and you placed phpBB3 in a directory /phpBB3 off your web root you would enter <em>http://www.mydomain.tld/phpBB3/install/</em> or (alternatively) <em>http://www.mydomain.tld/phpBB3/install/index.php</em> into your browser. When you have done this you should see the phpBB3 Installation screen appear.</p>
|
||||
|
||||
@ -242,7 +246,7 @@
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="update"></a><h2>4. Updating from stable releases of phpBB 3.0.x</h2>
|
||||
<a name="update"></a><h2>4. Updating from stable releases of phpBB 3.1.x</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="inner"><span class="corners-top"><span></span></span>
|
||||
@ -267,7 +271,7 @@
|
||||
|
||||
<p>This package is meant for those wanting to only replace changed files from a previous version to the latest version. This package normally contains the changed files from up to five previous versions.</p>
|
||||
|
||||
<p>This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have <samp>3.0.9</samp> you should select the phpBB-3.0.9_to_3.0.10.zip/tar.gz file.</p>
|
||||
<p>This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have <samp>3.1.0</samp> you should select the phpBB-3.1.0_to_3.1.1.zip/tar.gz file.</p>
|
||||
|
||||
<p>The directory structure has been preserved enabling you (if you wish) to simply upload the contents of the archive to the appropriate location on your server, i.e. simply overwrite the existing files with the new versions. Do not forget that if you have installed any MODs these files will overwrite the originals possibly destroying them in the process. You will need to re-add MODs to any affected file before uploading.</p>
|
||||
|
||||
@ -279,7 +283,7 @@
|
||||
|
||||
<p>The patch file is one solution for those with many Modifications (MODs) or other changes who do not want to re-add them back to all the changed files if they use the method explained above. To use this you will need command line access to a standard UNIX type <strong>patch</strong> application. If you do not have access to such an application but still want to use this update approach, we strongly recommend the <a href="#update_auto">Automatic update package</a> explained below. It is also the recommended update method.</p>
|
||||
|
||||
<p>A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is <samp>3.0.9</samp> you need the phpBB-3.0.9_to_3.0.10.patch file. Place the correct patch in the parent directory containing the phpBB3 core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: <strong>patch -cl -d [PHPBB DIRECTORY] -p1 < [PATCH NAME]</strong> (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB3, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.</p>
|
||||
<p>A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is <samp>3.1.0</samp> you need the phpBB-3.1.0_to_3.1.1.patch file. Place the correct patch in the parent directory containing the phpBB3 core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: <strong>patch -cl -d [PHPBB DIRECTORY] -p1 < [PATCH NAME]</strong> (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB3, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.</p>
|
||||
|
||||
<p>If you do get failures you should look at using the <a href="#update_files">Changed files only</a> package to replace the files which failed to patch, please note that you will need to manually re-add any Modifications (MODs) to these particular files. Alternatively if you know how you can examine the .rej files to determine what failed where and make manual adjustments to the relevant source.</p>
|
||||
|
||||
@ -316,7 +320,7 @@
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="convert"></a><h2>5. Conversion from phpBB 2.0.x to phpBB 3.0.x</h2>
|
||||
<a name="convert"></a><h2>5. Conversion from phpBB 2.0.x to phpBB 3.1.x</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="inner"><span class="corners-top"><span></span></span>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="keywords" content="" />
|
||||
<meta name="description" content="phpBB 3.0.x Readme" />
|
||||
<meta name="description" content="phpBB 3.1.x Readme" />
|
||||
<title>phpBB3 • Readme</title>
|
||||
|
||||
<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
<div id="doc-description">
|
||||
<a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a>
|
||||
<h1>phpBB 3.0.x Readme</h1>
|
||||
<h1>phpBB 3.1.x Readme</h1>
|
||||
<p style="display: none;"><a href="#start_here">Skip</a></p>
|
||||
</div>
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
<li><a href="#install">Installing phpBB3</a></li>
|
||||
<li><a href="#run">Running phpBB3</a>
|
||||
<ol style="list-style-type: lower-roman;">
|
||||
<li><a href="#i18n">Internationalisation (i18n)</a></li>
|
||||
<li><a href="#i18n">Languages (Internationalisation - i18n)</a></li>
|
||||
<li><a href="#styles">Styles</a></li>
|
||||
<li><a href="#mods">Modifications</a></li>
|
||||
</ol>
|
||||
@ -55,8 +55,9 @@
|
||||
<li><a href="#help">Getting help with phpBB3</a>
|
||||
<ol style="list-style-type: lower-roman;">
|
||||
<li><a href="#docs">Documentation</a></li>
|
||||
<li><a href="#kb">Knowledge Base</a></li>
|
||||
<li><a href="#website">Community Forums</a></li>
|
||||
<li><a href="#irc">Internet Relay Chat</a></li>
|
||||
<li><a href="#irc">Internet Relay Chat (IRC)</a></li>
|
||||
</ol>
|
||||
</li>
|
||||
<li><a href="#status">Status of this version</a></li>
|
||||
@ -84,23 +85,26 @@
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>Installation, update and conversion instructions can be found in the <a href="INSTALL.html">INSTALL</a> document contained in this distribution. If you are intending to convert from a previous phpBB 2.0.x installation we highly recommend you backup any existing data before proceeding!</p>
|
||||
<p>Installation, update and conversion instructions can be found in the <a href="INSTALL.html">INSTALL</a> document contained in this distribution. If you are intending to convert from a previous phpBB 2.0.x or 3.0.x installation we highly recommend you backup any existing data before proceeding!</p>
|
||||
|
||||
<p>Users of phpBB3 Beta versions cannot directly update.</p>
|
||||
<p>Users of phpBB 3.0 and 3.1 Beta versions cannot directly update.</p>
|
||||
|
||||
<p>Please note that we won't support the following installation types:</p>
|
||||
<ul>
|
||||
<li>Updates from phpBB3 Beta versions to phpBB3 RC1 and higher</li>
|
||||
<li>Conversions from phpBB 2.0.x to phpBB3 Beta versions</li>
|
||||
<li>phpBB3 Beta installations</li>
|
||||
<li>Updates from phpBB 3.0 Beta versions to phpBB 3.0 RC1 and higher</li>
|
||||
<li>Updates from phpBB 3.1 Beta versions to phpBB 3.1 RC1 and higher</li>
|
||||
<li>Conversions from phpBB 2.0.x to phpBB 3.0 or 3.1 Beta versions</li>
|
||||
<li>phpBB 3.0 or 3.1 Beta installations</li>
|
||||
</ul>
|
||||
|
||||
<p>We give support for the following installation types:</p>
|
||||
|
||||
<ul>
|
||||
<li>Updates from phpBB3 RC1 to the latest version</li>
|
||||
<li>Updates from phpBB 3.0 RC1 and 3.1 RC1 to the latest version</li>
|
||||
<li>Note: if using the <em>Automatic Update Package</em>, updates are supported from phpBB 3.0.2 onward. To update a pre-3.0.2 installation, first update to 3.0.2 and then update to the current version.</li>
|
||||
<li>Conversions from phpBB 2.0.x to the latest version</li>
|
||||
<li>New installations of phpBB3 - always only the latest released version</li>
|
||||
<li>New installations of phpBB 3.0.x - always only the latest released version</li>
|
||||
<li>New installations of phpBB 3.1.x - always only the latest released version</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
@ -119,41 +123,41 @@
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>Once installed phpBB is easily managed by both admin and moderator control panels. If you need help or advice with phpBB please see <a href="#help">Section 3</a> below.</p>
|
||||
<p>Once installed, phpBB is easily managed via the Administration and Moderator Control Panels. If you need help or advice with phpBB, please see <a href="#help">Section 3</a> below.</p>
|
||||
|
||||
<a name="i18n"></a><h3>2.i. Internationalisation (i18n)</h3>
|
||||
<a name="i18n"></a><h3>2.i. Languages (Internationalisation - i18n)</h3>
|
||||
|
||||
<p>A number of language packs and style localisations are available. You can find them on our official download page:</p>
|
||||
<p>A number of language packs with included style localisations are available. You can find them listed in the <a href="http://www.phpbb.com/languages/">Language Packs</a> pages of our downloads section or from the <a href="http://www.phpbb.com/customise/db/language_packs-25/">Language Packs</a> section of the <a href="http://www.phpbb.com/customise/db/">Customisation Database</a>.</p>
|
||||
|
||||
<p><a href="http://www.phpbb.com/downloads/">http://www.phpbb.com/downloads/</a></p>
|
||||
<p>For more information about language packs, please see: <a href="http://www.phpbb.com/languages/">http://www.phpbb.com/languages/</a></p>
|
||||
|
||||
<p>This is the <em>official</em> location for all supported language sets. If you download a package from a 3rd party site you do so with the understanding that we cannot offer support. So please, do not ask for help in these cases!</p>
|
||||
|
||||
<p>Installation of these packages is straightforward, simply download the required language pack and unarchive it into the <samp>languages/</samp> folder. Please ensure you retain the directory structure when doing this! Once uploaded go to the <code>Admin->System->Language Packs</code> and install the now appeared new language pack. To install the style imageset you should download the imageset for your language and unarchive the file/s into the relevant imageset directory (styles/prosilver/imageset or styles/subsilver2/imageset), again you must retain the directory structure. Once installed the imageset will become immediately available.</p>
|
||||
<p>Installation of these packages is straightforward: simply download the required language pack, uncompress (unzip) it and via FTP transfer the included <code>language</code> and <code>styles</code> folders to the root of your board installation. The language can then be installed via the Administration Control Panel of your board: <code>System tab -> General Tasks -> Language packs</code>. A more detailed description of the process is in the Knowledge Base article, <a href="http://www.phpbb.com/kb/article/how-to-install-a-language-pack/">How to Install a Language Pack</a>.</p>
|
||||
|
||||
<p>If your language is not available please visit our forums where you will find a topic listing translations currently available or in preparation. This topic also gives you information should you wish to volunteer to translate a language not currently listed.</p>
|
||||
<p>If your language is not available, please visit our <a href="http://www.phpbb.com/community/viewforum.php?f=66">[3.0.x] Translations</a> forum where you will find topics on translations in progress. Should you wish to volunteer to translate a language not currently available or assist in maintaining an existing language pack, you can <a href="http://www.phpbb.com/languages/apply.php">Apply to become a translator</a>.</p>
|
||||
|
||||
<a name="styles"></a><h3>2.ii. Styles</h3>
|
||||
|
||||
<p>Although phpBB Group are rather proud of the included styles we realise that it may not be to everyones tastes. Therefore phpBB3 allows styles to be switched with relative ease. Firstly you need to locate and download a style you like. We maintain such a site at</p>
|
||||
<p>Although the phpBB Group is rather proud of the included styles, we realise that they may not be to everyone's taste. Therefore, phpBB3 allows styles to be switched with relative ease. First, you need to locate and download a style you like. You can find them listed in the <a href="http://www.phpbb.com/customise/db/styles-2/">Styles</a> section of our <a href="http://www.phpbb.com/customise/db/">Customisation Database</a>.</p>
|
||||
|
||||
<p><a href="http://www.phpbb.com/styles/">http://www.phpbb.com/styles/</a></p>
|
||||
<p>For more information about styles, please see: <a href="http://www.phpbb.com/styles/">http://www.phpbb.com/styles/</a></p>
|
||||
|
||||
<p><strong>Please note</strong> that 3rd party styles downloaded for versions of phpBB2 will <strong>not</strong> work in phpBB3.</p>
|
||||
<p><strong>Please note</strong> that 3rd party styles downloaded for versions of phpBB2 will <strong>not</strong> work in phpBB3. It is also important to ensure that the style is updated to match the current version of the phpBB software you are using.</p>
|
||||
|
||||
<p>Once you have downloaded a style the usual next step is to unarchive (or upload the unarchived contents of) the package into your <samp>styles/</samp> directory. You then need to visit <code>Administration -> Styles</code>, you should see the new style available, click install and it will become available for all your users.</p>
|
||||
<p>Once you have downloaded a style, the usual next step is to unarchive (or upload the unarchived contents of) the package into your <code>styles/</code> directory. You then need to visit <code>Administration Control Panel -> Styles tab</code> where you should see the new style available. Click "Install" to install the style.</p>
|
||||
|
||||
<p><strong>Please note</strong> that if you create your own style or modify existing ones, please remember to enable the "Recompile stale style components" setting within the <code>Admin->General->Load Settings</code> screen. This setting allows the cache to detect changes made to the style and automatically refresh it. If this setting is disabled, you will not see your changes taking effect.</p>
|
||||
<p><strong>Please note</strong> that to improve efficiency, the software caches certain data. For this reason, if you create your own style or modify existing ones, please remember to "Refresh" the appropriate style components <code>Administration Control Panel -> Styles tab -> Style Components</code> screen. You may also need to reload the page you have changed in your web browser to overcome browser caching. If the changed components are not refreshed you will not see your changes taking effect.</p>
|
||||
|
||||
<a name="mods"></a><h3>2.iii. Modifications</h3>
|
||||
|
||||
<p>Although not officially supported by phpBB Group, phpBB has a thriving modification scene. These third party modifications to the standard phpBB extend its capabilities still further and can be found at:</p>
|
||||
<p>Although not officially supported by the phpBB Group, phpBB has a thriving modification scene. These third party modifications to the standard phpBB software, known as <strong>MODs</strong>, extend its capabilities still further. You can browse through many of the MODs in the <a href="http://www.phpbb.com/customise/db/modifications-1/">Modifications</a> section of our <a href="http://www.phpbb.com/customise/db/">Customisation Database</a>.</p>
|
||||
|
||||
<p><a href="http://www.phpbb.com/mods/">http://www.phpbb.com/mods/</a></p>
|
||||
<p>For more information about MODs, please see: <a href="http://www.phpbb.com/mods/">http://www.phpbb.com/mods/</a></p>
|
||||
|
||||
<p><strong>Please remember</strong> that any bugs or other issues that occur after you have added any modification should <strong>NOT</strong> be reported to the bug tracker (see below). First remove the modification and see if the problem is resolved.</p>
|
||||
<p><strong>Please remember</strong> that any bugs or other issues that occur after you have added any modification should <strong>NOT</strong> be reported to the bug tracker (see below). First remove the MOD and see if the problem is resolved. Any support for a MOD should only be sought in the "Discussion/Support" forum for that MOD.</p>
|
||||
|
||||
<p>Also remember that any modifications which modify the database in any way may render upgrading your forum to future versions more difficult unless we state otherwise. With all this said many users have and continue to utilise many of the mods already available with great success.</p>
|
||||
<p>Also remember that any modifications, particularly those which modify the database in any way, may render upgrading your forum to future versions more difficult. With all this said, many users have and continue to utilise many of the MODs already available with great success.</p>
|
||||
|
||||
</div>
|
||||
|
||||
@ -181,17 +185,25 @@
|
||||
|
||||
<p>This covers everything from installation through setting permissions and managing users.</p>
|
||||
|
||||
<a name="website"></a><h3>3.ii. Community Forums</h3>
|
||||
<a name="kb"></a><h3>3.ii. Knowledge Base</h3>
|
||||
|
||||
<p>phpBB Group maintains a thriving community where a number of people have generously decided to donate their time to help support users. This site can be found at:</p>
|
||||
<p>The Knowledge Base consists of a number of detailed articles on some common issues phpBB users may encounter while using the product. The Knowledge Base can be found at:</p>
|
||||
|
||||
<p><a href="http://www.phpbb.com/">http://www.phpbb.com/</a></p>
|
||||
<p><a href="http://www.phpbb.com/kb/">http://www.phpbb.com/kb/</a></p>
|
||||
|
||||
<a name="website"></a><h3>3.iii. Community Forums</h3>
|
||||
|
||||
<p>The phpBB Group maintains a thriving community where a number of people have generously decided to donate their time to help support users. This site can be found at:</p>
|
||||
|
||||
<p><a href="http://www.phpbb.com/community/">http://www.phpbb.com/community/</a></p>
|
||||
|
||||
<p>If you do seek help via our forums please be sure to do a Search before posting. This may well save both you and us time and allow the developer, moderator and support groups to spend more time responding to people with unknown issues and problems. Please also remember that phpBB is an entirely volunteer effort, no one receives any compensation for the time they give, this includes moderators as well as developers. So please be respectful and mindful when awaiting responses.</p>
|
||||
|
||||
<a name="irc"></a><h3>3.iii Internet Relay Chat</h3>
|
||||
<a name="irc"></a><h3>3.iv Internet Relay Chat</h3>
|
||||
|
||||
<p>Another place you may find help is our IRC channel. This operates on the Freenode IRC network, <em>irc.freenode.net</em> and the channel is <em>#phpbb</em> and can be accessed by any good IRC client such as mIRC, XChat, etc. Again, please do not abuse this service and be respectful of other users.</p>
|
||||
<p>Another place you may find help is our IRC channel. This operates on the Freenode IRC network, <a href="irc://irc.freenode.net">irc.freenode.net</a> and the channel is <em>#phpbb</em> and can be accessed by any decent IRC client such as mIRC, XChat, etc. Again, please do not abuse this service and be respectful of other users.</p>
|
||||
|
||||
<p>There are other IRC channels available, please see <a href="http://www.phpbb.com/support/irc/">http://www.phpbb.com/support/irc/</a> for the complete list.</p>
|
||||
|
||||
</div>
|
||||
|
||||
@ -209,13 +221,13 @@
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>This is the third stable release of phpBB. The 3.0.x line is essentially feature frozen, with only point releases seeing fixes for bugs and security issues, though feature alterations and minor feature additions may be done if deemed absolutely required. Our next major release will be phpBB 3.2 and the planning phase has begun (the unstable development version is 3.1). Please do not post questions asking when 3.2 will be available, no release date has been set.</p>
|
||||
<p>This is a stable release of phpBB. The 3.1.x line is feature frozen, with point releases principally including fixes for bugs and security issues. Feature alterations and minor feature additions may be done if deemed absolutely required. The next major release will be phpBB 3.2 which is currently under development. Please do not post questions asking when 3.2 will be available, no release date has been set.</p>
|
||||
|
||||
<p>For those interested in the development of phpBB should keep an eye on the community forums to see how things are progressing:</p>
|
||||
<p>Those interested in the development of phpBB should keep an eye on the development forums to see how things are progressing:</p>
|
||||
|
||||
<p><a href="http://area51.phpbb.com/phpBB/">http://area51.phpbb.com/phpBB/</a></p>
|
||||
|
||||
<p>Please note that this forum should <strong>NOT</strong> be used to obtain support for or ask questions about phpBB 2.0.x or phpBB 3.0.x, the main community forums are the place for this. Any such posts will be locked and go unanswered.</p>
|
||||
<p>Please note that the development forums should <strong>NOT</strong> be used to seek support for phpBB, the main community forums are the place for this.</p>
|
||||
|
||||
</div>
|
||||
|
||||
@ -233,31 +245,33 @@
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>The phpBB Group uses a bug tracking system to store, list and manage all reported bugs, it can be found at the location listed below. Please <strong>DO NOT</strong> post bug reports to our forums, they will be locked. In addition please <strong>DO NOT</strong> use the bug tracker for support requests. Posting such a request will only see you directed to the support forums (while taking time away from working on real bugs).</p>
|
||||
<p>The phpBB Group uses a bug tracking system to store, list and manage all reported bugs, it can be found at the location listed below. Please <strong>DO NOT</strong> post bug reports to our forums. In addition please <strong>DO NOT</strong> use the bug tracker for support requests. Posting such a request will only see you directed to the support forums (while taking time away from working on real bugs).</p>
|
||||
|
||||
<p><a href="http://tracker.phpbb.com/">http://tracker.phpbb.com/</a></p>
|
||||
<p><a href="http://tracker.phpbb.com/browse/PHPBB3">http://tracker.phpbb.com/browse/PHPBB3</a></p>
|
||||
|
||||
<p>While we very much appreciate receiving bug reports (the more reports the more stable phpBB will be) we ask you carry out a few steps before adding new entries:</p>
|
||||
|
||||
<ul>
|
||||
<li>Firstly determine if your bug is reproduceable, how to determine this depends on the bug in question. Only if the bug is reproduceable it is likely to be a problem with phpBB3 (or in some way connected). If something cannot be reproduced it may turn out to have been your hosting provider working on something, a user doing something silly, etc. Bug reports for non-reproduceable events can slow down our attempts to fix real, reproduceable issues<br /><br /></li>
|
||||
<li>Next please read or search through the existing bug reports to see if <em>your</em> bug (or one very similar to it) is already listed. If it is please add to that existing bug rather than creating a new duplicate entry (all this does is slow us down).<br /><br /></li>
|
||||
<li>Check the forums (use search!) to see if people have discussed anything that sounds similar to what you are seeing. However, as noted above please <strong>DO NOT</strong> post your particular bug to the forum unless it's non-reproduceable or you are sure it's related to something you have done rather phpBB3<br /><br /></li>
|
||||
<li>First, determine if your bug is reproduceable; how to determine this depends on the bug in question. Only if the bug is reproduceable is it likely to be a problem with phpBB3 (or in some way connected). If something cannot be reproduced it may turn out to have been your hosting provider working on something, a user doing something silly, etc. Bug reports for non-reproduceable events can slow down our attempts to fix real, reproduceable issues<br /><br /></li>
|
||||
<li>Next, please read or search through the existing bug reports to see if <em>your</em> bug (or one very similar to it) is already listed. If it is please add to that existing bug rather than creating a new duplicate entry (all this does is slow us down).<br /><br /></li>
|
||||
<li>Check the forums (use search!) to see if people have discussed anything that sounds similar to what you are seeing. However, as noted above please <strong>DO NOT</strong> post your particular bug to the forum unless it's non-reproduceable or you are sure it’s related to something you have done rather than phpBB3<br /><br /></li>
|
||||
<li>If no existing bug exists then please feel free to add it</li>
|
||||
</ul>
|
||||
|
||||
<p>If you do post a new bug (i.e. one that isn't already listed in the bug tracker) firstly make sure you have logged in (your username and password are the same as for the community forums) then please include the following details:</p>
|
||||
<p>If you do post a new bug (i.e. one that isn't already listed in the bug tracker) first make sure that you have logged in (your username and password are the same as for the community forums) then please include the following details:</p>
|
||||
|
||||
<ul>
|
||||
<li>Your server type/version, e.g. Apache 1.3.28, IIS 4, Sambar, etc.</li>
|
||||
<li>PHP version and mode of operation, e.g. PHP 5.1.1 as a module, PHP 4.4.4 running as CGI, etc.</li>
|
||||
<li>DB type/version, e.g. MySQL 4.0.1, PostgreSQL 7.3.2, MSSQL Server 2000 SP1, etc.</li>
|
||||
<li>Your server type/version, e.g. Apache 2.2.3, IIS 7, Sambar, etc.</li>
|
||||
<li>PHP version and mode of operation, e.g. PHP 5.3.2 as a module, PHP 5.4.0 running as CGI, etc.</li>
|
||||
<li>DB type/version, e.g. MySQL 5.0.77, PostgreSQL 9.0.6, MSSQL Server 2000 SP1, etc.</li>
|
||||
</ul>
|
||||
|
||||
<p>The relevant database type/version is listed within the administration control panel</p>
|
||||
<p>The relevant database type/version is listed within the administration control panel.</p>
|
||||
|
||||
<p>Please also be as detailed as you can in your report, if possible list the steps required to duplicate the problem. If you have a patch that fixes the issue, please attach it to the ticket or submit a pull request <a href="https://github.com/phpbb/phpbb3">on GitHub</a>.</p>
|
||||
|
||||
<p>If you create a patch, it is very much appreciated (but not required) if you follow the phpBB coding guidelines. Please note that the coding guidelines are somewhat different between different versions of phpBB. For phpBB 3.1.x the coding guidelines may be found here: <a href="http://area51.phpbb.com/docs/31x/coding-guidelines.html">http://area51.phpbb.com/docs/31x/coding-guidelines.html</a></p>
|
||||
|
||||
<p>Once a bug has been submitted you will be emailed any follow up comments added to it. <strong>Please</strong> if you are requested to supply additional information, do so! It is frustrating for us to receive bug reports, ask for additional information but get nothing. In these cases we have a policy of closing the bug, which may leave a very real problem in place. Obviously we would rather not have this situation arise.</p>
|
||||
|
||||
<a name="securitybugs"></a><h3>5.i. Security related bugs</h3>
|
||||
@ -282,7 +296,7 @@
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>This list is not complete but does represent those bugs which may effect users on a wider scale. Other bugs listed in the tracker have typically been shown to be limited to certain setups or methods of installation, updating and/or conversions.</p>
|
||||
<p>This list is not complete but does represent those bugs which may affect users on a wider scale. Other bugs listed in the tracker have typically been shown to be limited to certain setups or methods of installation, updating and/or conversions.</p>
|
||||
|
||||
<ul>
|
||||
<li>Conversions may fail to complete on large boards under some hosts</li>
|
||||
@ -306,11 +320,15 @@
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>phpBB is no longer supported on PHP4 due to several compatibility issues and we recommend that you upgrade to the latest stable release of PHP5 to run phpBB. The minimum version required is PHP 5.3.2.</p>
|
||||
<p>phpBB 3.1.x takes advantage of new features added in PHP 5.3. We recommend that you upgrade to the latest stable release of PHP5 to run phpBB. The minimum version required is PHP 5.3.2.</p>
|
||||
|
||||
<p>Please remember that running any application on a developmental version of PHP can lead to strange/unexpected results which may appear to be bugs in the application (which may not be true). Therefore we recommend you upgrade to the newest stable version of PHP before running phpBB3. If you are running a developmental version of PHP please check any bugs you find on a system running a stable release before submitting.</p>
|
||||
|
||||
<p>This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQL 3.23, 4.x, 5.x, MSSQL Server 2000, PostgreSQL 7.x, Oracle 8, SQLite and Firebird. Versions of PHP used range from 5.3.2 to 5.4.x without problem.</p>
|
||||
<<<<<<< HEAD
|
||||
<p>This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQL 3.23, 4.x, 5.x, MSSQL Server 2000, PostgreSQL 8.x, Oracle 8, SQLite and Firebird. Versions of PHP used range from 5.3.x to 5.4.x without problem.</p>
|
||||
=======
|
||||
<p>This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQL 3.23, 4.x, 5.x, MSSQL Server 2000, PostgreSQL 7.x, Oracle 8, SQLite 2 and Firebird. Versions of PHP used range from 4.3.3 to 5.4.x without problem. </p>
|
||||
>>>>>>> develop-olympus
|
||||
|
||||
<a name="phpsec"></a><h3>7.i. Notice on PHP security issues</h3>
|
||||
|
||||
@ -332,7 +350,7 @@
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) <a href="http://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
|
||||
<p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright © <a href="http://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -295,11 +295,17 @@ PHPBB_QA (Set board to QA-Mode, which means the updater also c
|
||||
<p>We will not be using any form of hungarian notation in our naming conventions. Many of us believe that hungarian naming is one of the primary code obfuscation techniques currently in use.</p>
|
||||
|
||||
<h4>Variable Names:</h4>
|
||||
<p>Variable names should be in all lowercase, with words separated by an underscore, example:</p>
|
||||
<p>In PHP, variable names should be in all lowercase, with words separated by an underscore, example:</p>
|
||||
|
||||
<div class="indent">
|
||||
<p><code>$current_user</code> is right, but <code>$currentuser</code> and <code> $currentUser</code> are not.</p>
|
||||
</div>
|
||||
|
||||
<p>In JavaScript, variable names should use camel case:</p>
|
||||
|
||||
<div class="indent">
|
||||
<p><code>currentUser</code> is right, but <code>currentuser</code> and <code>current_user</code> are not.</p>
|
||||
</div>
|
||||
|
||||
<p>Names should be descriptive, but concise. We don't want huge sentences as our variable names, but typing an extra couple of characters is always better than wondering what exactly a certain variable is for. </p>
|
||||
|
||||
@ -317,7 +323,7 @@ for ($i = 0; $i < $outer_size; $i++)
|
||||
</pre></div>
|
||||
|
||||
<h4>Function Names:</h4>
|
||||
<p>Functions should also be named descriptively. We're not programming in C here, we don't want to write functions called things like "stristr()". Again, all lower-case names with words separated by a single underscore character. Function names should preferably have a verb in them somewhere. Good function names are <code>print_login_status()</code>, <code>get_user_data()</code>, etc. </p>
|
||||
<p>Functions should also be named descriptively. We're not programming in C here, we don't want to write functions called things like "stristr()". Again, all lower-case names with words separated by a single underscore character in PHP, and camel caps in JavaScript. Function names should preferably have a verb in them somewhere. Good function names are <code>print_login_status()</code>, <code>get_user_data()</code>, etc. Constructor functions in JavaScript should begin with a capital letter.</p>
|
||||
|
||||
<h4>Function Arguments:</h4>
|
||||
<p>Arguments are subject to the same guidelines as variable names. We don't want a bunch of functions like: <code>do_stuff($a, $b, $c)</code>. In most cases, we'd like to be able to tell how to use a function by just looking at its declaration. </p>
|
||||
@ -356,7 +362,7 @@ phpbb_dir_subdir_class_name - includes/dir/subdir/class_name.php
|
||||
<p>The basic philosophy here is to not hurt code clarity for the sake of laziness. This has to be balanced by a little bit of common sense, though; <code>print_login_status_for_a_given_user()</code> goes too far, for example -- that function would be better named <code>print_user_login_status()</code>, or just <code>print_login_status()</code>.</p>
|
||||
|
||||
<h4>Special Namings: </h4>
|
||||
<p>For all emoticons use the term <code>smiley</code> in singular and <code>smilies</code> in plural.</p>
|
||||
<p>For all emoticons use the term <code>smiley</code> in singular and <code>smilies</code> in plural. For emails we use the term <code>email</code> (without dash between “e” and “m”).</p>
|
||||
|
||||
<a name="codelayout"></a><h3>2.ii. Code Layout</h3>
|
||||
|
||||
@ -397,7 +403,7 @@ for ($i = 0; $i < size; $i++)
|
||||
</pre></div>
|
||||
|
||||
<h4>Where to put the braces:</h4>
|
||||
<p>This one is a bit of a holy war, but we're going to use a style that can be summed up in one sentence: Braces always go on their own line. The closing brace should also always be at the same column as the corresponding opening brace, examples:</p>
|
||||
<p>In PHP code, braces always go on their own line. The closing brace should also always be at the same column as the corresponding opening brace, examples:</p>
|
||||
|
||||
<div class="codebox"><pre>
|
||||
if (condition)
|
||||
@ -427,6 +433,30 @@ function do_stuff()
|
||||
...
|
||||
}
|
||||
</pre></div>
|
||||
|
||||
<p>In JavaScript code, braces always go on the same line:</p>
|
||||
|
||||
<div class="codebox"><pre>
|
||||
if (condition) {
|
||||
while (condition2) {
|
||||
...
|
||||
}
|
||||
} else {
|
||||
...
|
||||
}
|
||||
|
||||
for (var i = 0; i < size; i++) {
|
||||
...
|
||||
}
|
||||
|
||||
while (condition) {
|
||||
...
|
||||
}
|
||||
|
||||
function do_stuff() {
|
||||
...
|
||||
}
|
||||
</pre></div>
|
||||
|
||||
<h4>Use spaces between tokens:</h4>
|
||||
<p>This is another simple, easy step that helps keep code readable without much effort. Whenever you write an assignment, expression, etc.. Always leave <em>one</em> space between the tokens. Basically, write code as if it was English. Put spaces between variable names and operators. Don't put spaces just after an opening bracket or before a closing bracket. Don't put spaces just before a comma or a semicolon. This is best shown with a few examples, examples:</p>
|
||||
@ -502,7 +532,7 @@ $post_url = "{$phpbb_root_path}posting.$phpEx?mode=$mode&amp;start=$start";
|
||||
<p>In SQL statements mixing single and double quotes is partly allowed (following the guidelines listed here about SQL formatting), else one should try to only use one method - mostly single quotes.</p>
|
||||
|
||||
<h4>Commas after every array element:</h4>
|
||||
<p>If an array is defined with each element on its own line, you still have to modify the previous line to add a comma when appending a new element. PHP allows for trailing (useless) commas in array definitions. These should always be used so each element including the comma can be appended with a single line</p>
|
||||
<p>If an array is defined with each element on its own line, you still have to modify the previous line to add a comma when appending a new element. PHP allows for trailing (useless) commas in array definitions. These should always be used so each element including the comma can be appended with a single line. In JavaScript, do not use the trailing comma, as it causes browsers to throw errors.</p>
|
||||
|
||||
<p class="bad">// wrong</p>
|
||||
<div class="codebox"><pre>
|
||||
|
@ -254,16 +254,8 @@ function feed_format_date($time)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$zone_offset = (int) $user->timezone + (int) $user->dst;
|
||||
|
||||
$sign = ($zone_offset < 0) ? '-' : '+';
|
||||
$time_offset = abs($zone_offset);
|
||||
|
||||
$offset_seconds = $time_offset % 3600;
|
||||
$offset_minutes = $offset_seconds / 60;
|
||||
$offset_hours = ($time_offset - $offset_seconds) / 3600;
|
||||
|
||||
$offset_string = sprintf("%s%02d:%02d", $sign, $offset_hours, $offset_minutes);
|
||||
$zone_offset = $user->create_datetime()->getOffset();
|
||||
$offset_string = phpbb_format_timezone_offset($zone_offset);
|
||||
}
|
||||
|
||||
return gmdate("Y-m-d\TH:i:s", $time + $zone_offset) . $offset_string;
|
||||
|
@ -1222,12 +1222,14 @@ class acp_attachments
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$base_url = $this->u_action . "&$u_sort_param";
|
||||
phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $num_files, $attachments_per_page, $start);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'TOTAL_FILES' => $num_files,
|
||||
'TOTAL_SIZE' => get_formatted_filesize($total_size),
|
||||
'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param", $num_files, $attachments_per_page, $start, true),
|
||||
|
||||
'S_ON_PAGE' => on_page($num_files, $attachments_per_page, $start),
|
||||
'S_ON_PAGE' => phpbb_on_page($template, $user, $base_url, $num_files, $attachments_per_page, $start),
|
||||
'S_LIMIT_DAYS' => $s_limit_days,
|
||||
'S_SORT_KEY' => $s_sort_key,
|
||||
'S_SORT_DIR' => $s_sort_dir)
|
||||
|
@ -57,8 +57,7 @@ class acp_board
|
||||
'board_disable_msg' => false,
|
||||
'default_lang' => array('lang' => 'DEFAULT_LANGUAGE', 'validate' => 'lang', 'type' => 'select', 'function' => 'language_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false),
|
||||
'default_dateformat' => array('lang' => 'DEFAULT_DATE_FORMAT', 'validate' => 'string', 'type' => 'custom', 'method' => 'dateformat_select', 'explain' => true),
|
||||
'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'validate' => 'string', 'type' => 'select', 'function' => 'tz_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => true),
|
||||
'board_dst' => array('lang' => 'SYSTEM_DST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'validate' => 'timezone', 'type' => 'custom', 'method' => 'timezone_select', 'explain' => true),
|
||||
'default_style' => array('lang' => 'DEFAULT_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => false),
|
||||
'override_user_style' => array('lang' => 'OVERRIDE_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
|
||||
@ -88,6 +87,7 @@ class acp_board
|
||||
'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'allow_birthdays' => array('lang' => 'ALLOW_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'display_last_subject' => array('lang' => 'DISPLAY_LAST_SUBJECT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'allow_quick_reply' => array('lang' => 'ALLOW_QUICK_REPLY', 'validate' => 'bool', 'type' => 'custom', 'method' => 'quick_reply', 'explain' => true),
|
||||
|
||||
'legend2' => 'ACP_LOAD_SETTINGS',
|
||||
@ -98,7 +98,6 @@ class acp_board
|
||||
'load_cpf_pm' => array('lang' => 'LOAD_CPF_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
'load_cpf_viewtopic' => array('lang' => 'LOAD_CPF_VIEWTOPIC', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
'load_jquery_cdn' => array('lang' => 'LOAD_JQUERY_CDN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
|
||||
'legend3' => 'ACP_SUBMIT_CHANGES',
|
||||
)
|
||||
@ -324,7 +323,8 @@ class acp_board
|
||||
'load_moderators' => array('lang' => 'YES_MODERATORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
'load_user_activity' => array('lang' => 'LOAD_USER_ACTIVITY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'load_tplcompile' => array('lang' => 'RECOMPILE_STYLES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'load_tplcompile' => array('lang' => 'RECOMPILE_STYLES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'load_jquery_cdn' => array('lang' => 'LOAD_JQUERY_CDN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
|
||||
'legend3' => 'CUSTOM_PROFILE_FIELDS',
|
||||
'load_cpf_memberlist' => array('lang' => 'LOAD_CPF_MEMBERLIST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
@ -896,6 +896,18 @@ class acp_board
|
||||
'<br /><br /><input class="button2" type="submit" id="' . $key . '_enable" name="' . $key . '_enable" value="' . $user->lang['ALLOW_QUICK_REPLY_BUTTON'] . '" />';
|
||||
}
|
||||
|
||||
/**
|
||||
* Select guest timezone
|
||||
*/
|
||||
function timezone_select($value, $key)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$timezone_select = phpbb_timezone_select($user, $value, true);
|
||||
$timezone_select['tz_select'];
|
||||
|
||||
return '<select name="config[' . $key . ']" id="' . $key . '">' . $timezone_select['tz_select'] . '</select>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Select default dateformat
|
||||
@ -906,10 +918,14 @@ class acp_board
|
||||
|
||||
// Let the format_date function operate with the acp values
|
||||
$old_tz = $user->timezone;
|
||||
$old_dst = $user->dst;
|
||||
|
||||
$user->timezone = $config['board_timezone'] * 3600;
|
||||
$user->dst = $config['board_dst'] * 3600;
|
||||
try
|
||||
{
|
||||
$user->timezone = new DateTimeZone($config['board_timezone']);
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
// If the board timezone is invalid, we just use the users timezone.
|
||||
}
|
||||
|
||||
$dateformat_options = '';
|
||||
|
||||
@ -929,7 +945,6 @@ class acp_board
|
||||
|
||||
// Reset users date options
|
||||
$user->timezone = $old_tz;
|
||||
$user->dst = $old_dst;
|
||||
|
||||
return "<select name=\"dateoptions\" id=\"dateoptions\" onchange=\"if (this.value == 'custom') { document.getElementById('" . addslashes($key) . "').value = '" . addslashes($value) . "'; } else { document.getElementById('" . addslashes($key) . "').value = this.value; }\">$dateformat_options</select>
|
||||
<input type=\"text\" name=\"config[$key]\" id=\"$key\" value=\"$value\" maxlength=\"30\" />";
|
||||
|
@ -20,6 +20,7 @@ if (!defined('IN_PHPBB'))
|
||||
*/
|
||||
class acp_database
|
||||
{
|
||||
var $db_tools;
|
||||
var $u_action;
|
||||
|
||||
function main($id, $mode)
|
||||
@ -27,6 +28,12 @@ class acp_database
|
||||
global $cache, $db, $user, $auth, $template, $table_prefix;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
|
||||
if (!class_exists('phpbb_db_tools'))
|
||||
{
|
||||
require($phpbb_root_path . 'includes/db/db_tools.' . $phpEx);
|
||||
}
|
||||
$this->db_tools = new phpbb_db_tools($db);
|
||||
|
||||
$user->add_lang('acp/database');
|
||||
|
||||
$this->tpl_name = 'acp_database';
|
||||
@ -49,7 +56,7 @@ class acp_database
|
||||
{
|
||||
case 'download':
|
||||
$type = request_var('type', '');
|
||||
$table = request_var('table', array(''));
|
||||
$table = array_intersect($this->db_tools->sql_list_tables(), request_var('table', array('')));
|
||||
$format = request_var('method', '');
|
||||
$where = request_var('where', '');
|
||||
|
||||
@ -172,8 +179,7 @@ class acp_database
|
||||
break;
|
||||
|
||||
default:
|
||||
include($phpbb_root_path . 'includes/functions_install.' . $phpEx);
|
||||
$tables = get_tables($db);
|
||||
$tables = $this->db_tools->sql_list_tables();
|
||||
asort($tables);
|
||||
foreach ($tables as $table_name)
|
||||
{
|
||||
|
@ -682,13 +682,15 @@ class acp_groups
|
||||
$s_action_options .= '<option value="' . $option . '">' . $user->lang['GROUP_' . $lang] . '</option>';
|
||||
}
|
||||
|
||||
$base_url = $this->u_action . "&action=$action&g=$group_id";
|
||||
phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $total_members, $config['topics_per_page'], $start);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_LIST' => true,
|
||||
'S_GROUP_SPECIAL' => ($group_row['group_type'] == GROUP_SPECIAL) ? true : false,
|
||||
'S_ACTION_OPTIONS' => $s_action_options,
|
||||
|
||||
'S_ON_PAGE' => on_page($total_members, $config['topics_per_page'], $start),
|
||||
'PAGINATION' => generate_pagination($this->u_action . "&action=$action&g=$group_id", $total_members, $config['topics_per_page'], $start, true),
|
||||
'S_ON_PAGE' => phpbb_on_page($template, $user, $base_url, $total_members, $config['topics_per_page'], $start),
|
||||
'GROUP_NAME' => ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'],
|
||||
|
||||
'U_ACTION' => $this->u_action . "&g=$group_id",
|
||||
|
@ -927,10 +927,8 @@ class acp_icons
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$template->assign_var('PAGINATION',
|
||||
generate_pagination($this->u_action, $item_count, $config['smilies_per_page'], $pagination_start, true)
|
||||
);
|
||||
|
||||
phpbb_generate_template_pagination($template, $this->u_action, 'pagination', 'start', $item_count, $config['smilies_per_page'], $pagination_start);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -136,6 +136,8 @@ class acp_inactive
|
||||
add_log('admin', 'LOG_USER_ACTIVE', $row['username']);
|
||||
add_log('user', $row['user_id'], 'LOG_USER_ACTIVE_USER');
|
||||
}
|
||||
|
||||
trigger_error(sprintf($user->lang['LOG_INACTIVE_ACTIVATE'], implode($user->lang['COMMA_SEPARATOR'], $user_affected) . ' ' . adm_back_link($this->u_action)));
|
||||
}
|
||||
|
||||
// For activate we really need to redirect, else a refresh can result in users being deactivated again
|
||||
@ -159,6 +161,8 @@ class acp_inactive
|
||||
}
|
||||
|
||||
add_log('admin', 'LOG_INACTIVE_' . strtoupper($action), implode(', ', $user_affected));
|
||||
|
||||
trigger_error(sprintf($user->lang['LOG_INACTIVE_DELETE'], implode($user->lang['COMMA_SEPARATOR'], $user_affected) . ' ' . adm_back_link($this->u_action)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -230,7 +234,8 @@ class acp_inactive
|
||||
$db->sql_query($sql);
|
||||
|
||||
add_log('admin', 'LOG_INACTIVE_REMIND', implode(', ', $usernames));
|
||||
unset($usernames);
|
||||
|
||||
trigger_error(sprintf($user->lang['LOG_INACTIVE_REMIND'], implode($user->lang['COMMA_SEPARATOR'], $usernames) . ' ' . adm_back_link($this->u_action)));
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
@ -283,6 +288,9 @@ class acp_inactive
|
||||
$option_ary += array('remind' => 'REMIND');
|
||||
}
|
||||
|
||||
$base_url = $this->u_action . "&$u_sort_param&users_per_page=$per_page";
|
||||
phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $inactive_count, $per_page, $start);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_INACTIVE_USERS' => true,
|
||||
'S_INACTIVE_OPTIONS' => build_select($option_ary),
|
||||
@ -290,8 +298,8 @@ class acp_inactive
|
||||
'S_LIMIT_DAYS' => $s_limit_days,
|
||||
'S_SORT_KEY' => $s_sort_key,
|
||||
'S_SORT_DIR' => $s_sort_dir,
|
||||
'S_ON_PAGE' => on_page($inactive_count, $per_page, $start),
|
||||
'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param&users_per_page=$per_page", $inactive_count, $per_page, $start, true),
|
||||
'S_ON_PAGE' => phpbb_on_page($template, $user, $base_url, $inactive_count, $per_page, $start),
|
||||
|
||||
'USERS_PER_PAGE' => $per_page,
|
||||
|
||||
'U_ACTION' => $this->u_action . "&$u_sort_param&users_per_page=$per_page&start=$start",
|
||||
|
@ -129,13 +129,15 @@ class acp_logs
|
||||
$log_count = 0;
|
||||
$start = view_log($mode, $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, 0, 0, $sql_where, $sql_sort, $keywords);
|
||||
|
||||
$base_url = $this->u_action . "&$u_sort_param$keywords_param";
|
||||
phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $log_count, $config['topics_per_page'], $start);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'L_TITLE' => $l_title,
|
||||
'L_EXPLAIN' => $l_title_explain,
|
||||
'U_ACTION' => $this->u_action . "&$u_sort_param$keywords_param&start=$start",
|
||||
|
||||
'S_ON_PAGE' => on_page($log_count, $config['topics_per_page'], $start),
|
||||
'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start, true),
|
||||
'S_ON_PAGE' => phpbb_on_page($template, $user, $base_url, $log_count, $config['topics_per_page'], $start),
|
||||
|
||||
'S_LIMIT_DAYS' => $s_limit_days,
|
||||
'S_SORT_KEY' => $s_sort_key,
|
||||
|
@ -210,7 +210,7 @@ class acp_main
|
||||
// No maximum post id? :o
|
||||
if (!$max_post_id)
|
||||
{
|
||||
$sql = 'SELECT MAX(post_id)
|
||||
$sql = 'SELECT MAX(post_id) as max_post_id
|
||||
FROM ' . POSTS_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
$max_post_id = (int) $db->sql_fetchfield('max_post_id');
|
||||
|
@ -21,7 +21,7 @@ if (!defined('IN_PHPBB'))
|
||||
class acp_styles
|
||||
{
|
||||
public $u_action;
|
||||
|
||||
|
||||
protected $u_base_action;
|
||||
protected $s_hidden_fields;
|
||||
protected $mode;
|
||||
@ -1056,7 +1056,7 @@ class acp_styles
|
||||
*/
|
||||
protected function read_style_cfg($dir)
|
||||
{
|
||||
static $required = array('name', 'version', 'copyright');
|
||||
static $required = array('name', 'phpbb_version', 'copyright');
|
||||
$cfg = parse_cfg_file($this->styles_path . $dir . '/style.cfg');
|
||||
|
||||
// Check if it is a valid file
|
||||
|
@ -1001,6 +1001,13 @@ class acp_users
|
||||
$user_row['posts_in_queue'] = (int) $db->sql_fetchfield('posts_in_queue');
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = 'SELECT post_id
|
||||
FROM ' . POSTS_TABLE . '
|
||||
WHERE poster_id = '. $user_id;
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
$user_row['user_has_posts'] = (bool) $db->sql_fetchfield('post_id');
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'L_NAME_CHARS_EXPLAIN' => $user->lang($config['allow_name_chars'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_name_chars']), $user->lang('CHARACTERS', (int) $config['max_name_chars'])),
|
||||
'L_CHANGE_PASSWORD_EXPLAIN' => $user->lang($config['pass_complex'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_pass_chars']), $user->lang('CHARACTERS', (int) $config['max_pass_chars'])),
|
||||
@ -1028,6 +1035,7 @@ class acp_users
|
||||
'USER_EMAIL' => $user_row['user_email'],
|
||||
'USER_WARNINGS' => $user_row['user_warnings'],
|
||||
'USER_POSTS' => $user_row['user_posts'],
|
||||
'USER_HAS_POSTS' => $user_row['user_has_posts'],
|
||||
'USER_INACTIVE_REASON' => $inactive_reason,
|
||||
));
|
||||
|
||||
@ -1112,10 +1120,12 @@ class acp_users
|
||||
$log_count = 0;
|
||||
$start = view_log('user', $log_data, $log_count, $config['topics_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort);
|
||||
|
||||
$base_url = $this->u_action . "&u=$user_id&$u_sort_param";
|
||||
phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $log_count, $config['topics_per_page'], $start);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_FEEDBACK' => true,
|
||||
'S_ON_PAGE' => on_page($log_count, $config['topics_per_page'], $start),
|
||||
'PAGINATION' => generate_pagination($this->u_action . "&u=$user_id&$u_sort_param", $log_count, $config['topics_per_page'], $start, true),
|
||||
'S_ON_PAGE' => phpbb_on_page($template, $user, $base_url, $log_count, $config['topics_per_page'], $start),
|
||||
|
||||
'S_LIMIT_DAYS' => $s_limit_days,
|
||||
'S_SORT_KEY' => $s_sort_key,
|
||||
@ -1450,9 +1460,8 @@ class acp_users
|
||||
$data = array(
|
||||
'dateformat' => utf8_normalize_nfc(request_var('dateformat', $user_row['user_dateformat'], true)),
|
||||
'lang' => basename(request_var('lang', $user_row['user_lang'])),
|
||||
'tz' => request_var('tz', (float) $user_row['user_timezone']),
|
||||
'tz' => request_var('tz', $user_row['user_timezone']),
|
||||
'style' => request_var('style', $user_row['user_style']),
|
||||
'dst' => request_var('dst', $user_row['user_dst']),
|
||||
'viewemail' => request_var('viewemail', $user_row['user_allow_viewemail']),
|
||||
'massemail' => request_var('massemail', $user_row['user_allow_massemail']),
|
||||
'hideonline' => request_var('hideonline', !$user_row['user_allow_viewonline']),
|
||||
@ -1487,7 +1496,7 @@ class acp_users
|
||||
$error = validate_data($data, array(
|
||||
'dateformat' => array('string', false, 1, 30),
|
||||
'lang' => array('match', false, '#^[a-z_\-]{2,}$#i'),
|
||||
'tz' => array('num', false, -14, 14),
|
||||
'tz' => array('timezone'),
|
||||
|
||||
'topic_sk' => array('string', false, 1, 1),
|
||||
'topic_sd' => array('string', false, 1, 1),
|
||||
@ -1523,7 +1532,6 @@ class acp_users
|
||||
'user_notify_type' => $data['notifymethod'],
|
||||
'user_notify_pm' => $data['notifypm'],
|
||||
|
||||
'user_dst' => $data['dst'],
|
||||
'user_dateformat' => $data['dateformat'],
|
||||
'user_lang' => $data['lang'],
|
||||
'user_timezone' => $data['tz'],
|
||||
@ -1633,6 +1641,7 @@ class acp_users
|
||||
${'s_sort_' . $sort_option . '_dir'} .= '</select>';
|
||||
}
|
||||
|
||||
$timezone_selects = phpbb_timezone_select($user, $data['tz'], true);
|
||||
$template->assign_vars(array(
|
||||
'S_PREFS' => true,
|
||||
'S_JABBER_DISABLED' => ($config['jab_enable'] && $user_row['user_jabber'] && @extension_loaded('xml')) ? false : true,
|
||||
@ -1646,7 +1655,6 @@ class acp_users
|
||||
'NOTIFY_BOTH' => ($data['notifymethod'] == NOTIFY_BOTH) ? true : false,
|
||||
'NOTIFY_PM' => $data['notifypm'],
|
||||
'POPUP_PM' => $data['popuppm'],
|
||||
'DST' => $data['dst'],
|
||||
'BBCODE' => $data['bbcode'],
|
||||
'SMILIES' => $data['smilies'],
|
||||
'ATTACH_SIG' => $data['sig'],
|
||||
@ -1673,7 +1681,8 @@ class acp_users
|
||||
|
||||
'S_LANG_OPTIONS' => language_select($data['lang']),
|
||||
'S_STYLE_OPTIONS' => style_select($data['style']),
|
||||
'S_TZ_OPTIONS' => tz_select($data['tz'], true),
|
||||
'S_TZ_OPTIONS' => $timezone_selects['tz_select'],
|
||||
'S_TZ_DATE_OPTIONS' => $timezone_selects['tz_dates'],
|
||||
)
|
||||
);
|
||||
|
||||
@ -2027,14 +2036,15 @@ class acp_users
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$base_url = $this->u_action . "&u=$user_id&sk=$sort_key&sd=$sort_dir";
|
||||
phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $num_attachments, $config['topics_per_page'], $start);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_ATTACHMENTS' => true,
|
||||
'S_ON_PAGE' => on_page($num_attachments, $config['topics_per_page'], $start),
|
||||
'S_ON_PAGE' => phpbb_on_page($template, $user, $base_url, $num_attachments, $config['topics_per_page'], $start),
|
||||
'S_SORT_KEY' => $s_sort_key,
|
||||
'S_SORT_DIR' => $s_sort_dir,
|
||||
|
||||
'PAGINATION' => generate_pagination($this->u_action . "&u=$user_id&sk=$sort_key&sd=$sort_dir", $num_attachments, $config['topics_per_page'], $start, true))
|
||||
);
|
||||
));
|
||||
|
||||
break;
|
||||
|
||||
|
@ -155,7 +155,11 @@ function login_ldap(&$username, &$password)
|
||||
{
|
||||
if (!@ldap_bind($ldap, htmlspecialchars_decode($config['ldap_user']), htmlspecialchars_decode($config['ldap_password'])))
|
||||
{
|
||||
return $user->lang['LDAP_NO_SERVER_CONNECTION'];
|
||||
return array(
|
||||
'status' => LOGIN_ERROR_EXTERNAL_AUTH,
|
||||
'error_msg' => 'LDAP_NO_SERVER_CONNECTION',
|
||||
'user_row' => array('user_id' => ANONYMOUS),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -130,11 +130,11 @@ class bbcode
|
||||
|
||||
if (empty($this->template_filename))
|
||||
{
|
||||
$this->template_bitfield = new bitfield($user->theme['bbcode_bitfield']);
|
||||
$this->template_bitfield = new bitfield($user->style['bbcode_bitfield']);
|
||||
|
||||
$style_resource_locator = new phpbb_style_resource_locator();
|
||||
$style_path_provider = new phpbb_style_extension_path_provider($phpbb_extension_manager, new phpbb_style_path_provider());
|
||||
$template = new phpbb_style_template($phpbb_root_path, $phpEx, $config, $user, $style_resource_locator, $style_path_provider);
|
||||
$template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $style_resource_locator);
|
||||
$style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $style_resource_locator, $style_path_provider, $template);
|
||||
$style->set_style();
|
||||
$template->set_filenames(array('bbcode.html' => 'bbcode.html'));
|
||||
|
63
phpBB/includes/cache/service.php
vendored
63
phpBB/includes/cache/service.php
vendored
@ -321,50 +321,39 @@ class phpbb_cache_service
|
||||
/**
|
||||
* Obtain cfg file data
|
||||
*/
|
||||
function obtain_cfg_items($theme)
|
||||
function obtain_cfg_items($style)
|
||||
{
|
||||
global $config, $phpbb_root_path;
|
||||
|
||||
$parsed_items = array(
|
||||
'theme' => array(),
|
||||
'template' => array(),
|
||||
'imageset' => array()
|
||||
);
|
||||
$parsed_array = $this->driver->get('_cfg_' . $style['style_path']);
|
||||
|
||||
foreach ($parsed_items as $key => $parsed_array)
|
||||
if ($parsed_array === false)
|
||||
{
|
||||
$parsed_array = $this->driver->get('_cfg_' . $key . '_' . $theme[$key . '_path']);
|
||||
|
||||
if ($parsed_array === false)
|
||||
{
|
||||
$parsed_array = array();
|
||||
}
|
||||
|
||||
$reparse = false;
|
||||
$filename = $phpbb_root_path . 'styles/' . $theme[$key . '_path'] . '/' . $key . '/' . $key . '.cfg';
|
||||
|
||||
if (!file_exists($filename))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($parsed_array['filetime']) || (($config['load_tplcompile'] && @filemtime($filename) > $parsed_array['filetime'])))
|
||||
{
|
||||
$reparse = true;
|
||||
}
|
||||
|
||||
// Re-parse cfg file
|
||||
if ($reparse)
|
||||
{
|
||||
$parsed_array = parse_cfg_file($filename);
|
||||
$parsed_array['filetime'] = @filemtime($filename);
|
||||
|
||||
$this->driver->put('_cfg_' . $key . '_' . $theme[$key . '_path'], $parsed_array);
|
||||
}
|
||||
$parsed_items[$key] = $parsed_array;
|
||||
$parsed_array = array();
|
||||
}
|
||||
|
||||
return $parsed_items;
|
||||
$reparse = false;
|
||||
$filename = $phpbb_root_path . 'styles/' . $style['style_path'] . '/style.cfg';
|
||||
|
||||
if (!file_exists($filename))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($parsed_array['filetime']) || (($config['load_tplcompile'] && @filemtime($filename) > $parsed_array['filetime'])))
|
||||
{
|
||||
$reparse = true;
|
||||
}
|
||||
|
||||
// Re-parse cfg file
|
||||
if ($reparse)
|
||||
{
|
||||
$parsed_array = parse_cfg_file($filename);
|
||||
$parsed_array['filetime'] = @filemtime($filename);
|
||||
|
||||
$this->driver->put('_cfg_' . $style['style_path'], $parsed_array);
|
||||
}
|
||||
return $parsed_array;
|
||||
}
|
||||
|
||||
/**
|
||||
|
158
phpBB/includes/datetime.php
Normal file
158
phpBB/includes/datetime.php
Normal file
@ -0,0 +1,158 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package phpBB3
|
||||
* @copyright (c) 2012 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*/
|
||||
|
||||
/**
|
||||
* phpBB custom extensions to the PHP DateTime class
|
||||
* This handles the relative formats phpBB employs
|
||||
*/
|
||||
class phpbb_datetime extends DateTime
|
||||
{
|
||||
/**
|
||||
* String used to wrap the date segment which should be replaced by today/tomorrow/yesterday
|
||||
*/
|
||||
const RELATIVE_WRAPPER = '|';
|
||||
|
||||
/**
|
||||
* @var user User who is the context for this DateTime instance
|
||||
*/
|
||||
protected $user;
|
||||
|
||||
/**
|
||||
* @var array Date formats are preprocessed by phpBB, to save constant recalculation they are cached.
|
||||
*/
|
||||
static protected $format_cache = array();
|
||||
|
||||
/**
|
||||
* Constructs a new instance of phpbb_datetime, expanded to include an argument to inject
|
||||
* the user context and modify the timezone to the users selected timezone if one is not set.
|
||||
*
|
||||
* @param string $time String in a format accepted by strtotime().
|
||||
* @param DateTimeZone $timezone Time zone of the time.
|
||||
* @param user User object for context.
|
||||
*/
|
||||
public function __construct($user, $time = 'now', DateTimeZone $timezone = null)
|
||||
{
|
||||
$this->user = $user;
|
||||
$timezone = $timezone ?: $this->user->timezone;
|
||||
|
||||
parent::__construct($time, $timezone);
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats the current date time into the specified format
|
||||
*
|
||||
* @param string $format Optional format to use for output, defaults to users chosen format
|
||||
* @param boolean $force_absolute Force output of a non relative date
|
||||
* @return string Formatted date time
|
||||
*/
|
||||
public function format($format = '', $force_absolute = false)
|
||||
{
|
||||
$format = $format ? $format : $this->user->date_format;
|
||||
$format = self::format_cache($format, $this->user);
|
||||
$relative = ($format['is_short'] && !$force_absolute);
|
||||
$now = new self($this->user, 'now', $this->user->timezone);
|
||||
|
||||
$timestamp = $this->getTimestamp();
|
||||
$now_ts = $now->getTimeStamp();
|
||||
|
||||
$delta = $now_ts - $timestamp;
|
||||
|
||||
if ($relative)
|
||||
{
|
||||
/*
|
||||
* Check the delta is less than or equal to 1 hour
|
||||
* and the delta not more than a minute in the past
|
||||
* and the delta is either greater than -5 seconds or timestamp
|
||||
* and current time are of the same minute (they must be in the same hour already)
|
||||
* finally check that relative dates are supported by the language pack
|
||||
*/
|
||||
if ($delta <= 3600 && $delta > -60 &&
|
||||
($delta >= -5 || (($now_ts / 60) % 60) == (($timestamp / 60) % 60))
|
||||
&& isset($this->user->lang['datetime']['AGO']))
|
||||
{
|
||||
return $this->user->lang(array('datetime', 'AGO'), max(0, (int) floor($delta / 60)));
|
||||
}
|
||||
else
|
||||
{
|
||||
$midnight = clone $now;
|
||||
$midnight->setTime(0, 0, 0);
|
||||
|
||||
$midnight = $midnight->getTimestamp();
|
||||
|
||||
$day = false;
|
||||
|
||||
if ($timestamp > $midnight + 86400)
|
||||
{
|
||||
$day = 'TOMORROW';
|
||||
}
|
||||
else if ($timestamp > $midnight)
|
||||
{
|
||||
$day = 'TODAY';
|
||||
}
|
||||
else if ($timestamp > $midnight - 86400)
|
||||
{
|
||||
$day = 'YESTERDAY';
|
||||
}
|
||||
|
||||
if ($day !== false)
|
||||
{
|
||||
// Format using the short formatting and finally swap out the relative token placeholder with the correct value
|
||||
return str_replace(self::RELATIVE_WRAPPER . self::RELATIVE_WRAPPER, $this->user->lang['datetime'][$day], strtr(parent::format($format['format_short']), $format['lang']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return strtr(parent::format($format['format_long']), $format['lang']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic method to convert DateTime object to string
|
||||
*
|
||||
* @return Formatted date time, according to the users default settings.
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->format();
|
||||
}
|
||||
|
||||
/**
|
||||
* Pre-processes the specified date format
|
||||
*
|
||||
* @param string $format Output format
|
||||
* @param user $user User object to use for localisation
|
||||
* @return array Processed date format
|
||||
*/
|
||||
static protected function format_cache($format, $user)
|
||||
{
|
||||
$lang = $user->lang_name;
|
||||
|
||||
if (!isset(self::$format_cache[$lang]))
|
||||
{
|
||||
self::$format_cache[$lang] = array();
|
||||
}
|
||||
|
||||
if (!isset(self::$format_cache[$lang][$format]))
|
||||
{
|
||||
// Is the user requesting a friendly date format (i.e. 'Today 12:42')?
|
||||
self::$format_cache[$lang][$format] = array(
|
||||
'is_short' => strpos($format, self::RELATIVE_WRAPPER) !== false,
|
||||
'format_short' => substr($format, 0, strpos($format, self::RELATIVE_WRAPPER)) . self::RELATIVE_WRAPPER . self::RELATIVE_WRAPPER . substr(strrchr($format, self::RELATIVE_WRAPPER), 1),
|
||||
'format_long' => str_replace(self::RELATIVE_WRAPPER, '', $format),
|
||||
'lang' => $user->lang['datetime'],
|
||||
);
|
||||
|
||||
// Short representation of month in format? Some languages use different terms for the long and short format of May
|
||||
if ((strpos($format, '\M') === false && strpos($format, 'M') !== false) || (strpos($format, '\r') === false && strpos($format, 'r') !== false))
|
||||
{
|
||||
self::$format_cache[$lang][$format]['lang']['May'] = $user->lang['datetime']['May_short'];
|
||||
}
|
||||
}
|
||||
|
||||
return self::$format_cache[$lang][$format];
|
||||
}
|
||||
}
|
@ -1503,7 +1503,7 @@ class phpbb_db_tools
|
||||
$column_type = $this->dbms_type_map[$this->sql_layer][$column_data[0]];
|
||||
}
|
||||
|
||||
// Adjust default value if db-dependant specified
|
||||
// Adjust default value if db-dependent specified
|
||||
if (is_array($column_data[1]))
|
||||
{
|
||||
$column_data[1] = (isset($column_data[1][$this->sql_layer])) ? $column_data[1][$this->sql_layer] : $column_data[1]['default'];
|
||||
@ -2114,7 +2114,7 @@ class phpbb_db_tools
|
||||
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
$statements[] = 'ALTER TABLE ' . $table_name . ' ADD UNIQUE INDEX (' . implode(', ', $column) . ')';
|
||||
$statements[] = 'ALTER TABLE ' . $table_name . ' ADD UNIQUE INDEX ' . $index_name . '(' . implode(', ', $column) . ')';
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
|
@ -193,6 +193,49 @@ class dbal
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Seek to given row number
|
||||
* rownum is zero-based
|
||||
*/
|
||||
function sql_rowseek($rownum, &$query_id)
|
||||
{
|
||||
global $cache;
|
||||
|
||||
if ($query_id === false)
|
||||
{
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
{
|
||||
return $cache->sql_rowseek($rownum, $query_id);
|
||||
}
|
||||
|
||||
if ($query_id === false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->sql_freeresult($query_id);
|
||||
$query_id = $this->sql_query($this->last_query_text);
|
||||
|
||||
if ($query_id === false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// We do not fetch the row for rownum == 0 because then the next resultset would be the second row
|
||||
for ($i = 0; $i < $rownum; $i++)
|
||||
{
|
||||
if (!$this->sql_fetchrow($query_id))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch field
|
||||
* if rownum is false, the current row is used, else it is pointing to the row (zero-based)
|
||||
@ -240,6 +283,37 @@ class dbal
|
||||
return $this->_sql_like_expression('LIKE \'' . $this->sql_escape($expression) . '\'');
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a case expression
|
||||
*
|
||||
* Note: The two statements action_true and action_false must have the same data type (int, vchar, ...) in the database!
|
||||
*
|
||||
* @param string $condition The condition which must be true, to use action_true rather then action_else
|
||||
* @param string $action_true SQL expression that is used, if the condition is true
|
||||
* @param string $action_else SQL expression that is used, if the condition is false, optional
|
||||
* @return string CASE expression including the condition and statements
|
||||
*/
|
||||
public function sql_case($condition, $action_true, $action_false = false)
|
||||
{
|
||||
$sql_case = 'CASE WHEN ' . $condition;
|
||||
$sql_case .= ' THEN ' . $action_true;
|
||||
$sql_case .= ($action_false !== false) ? ' ELSE ' . $action_false : '';
|
||||
$sql_case .= ' END';
|
||||
return $sql_case;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a concatenated expression
|
||||
*
|
||||
* @param string $expr1 Base SQL expression where we append the second one
|
||||
* @param string $expr2 SQL expression that is appended to the first expression
|
||||
* @return string Concatenated string
|
||||
*/
|
||||
public function sql_concatenate($expr1, $expr2)
|
||||
{
|
||||
return $expr1 . ' || ' . $expr2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether results of a query need to be buffered to run a transaction while iterating over them.
|
||||
*
|
||||
@ -478,6 +552,18 @@ class dbal
|
||||
return $expression;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run LOWER() on DB column of type text (i.e. neither varchar nor char).
|
||||
*
|
||||
* @param string $column_name The column name to use
|
||||
*
|
||||
* @return string A SQL statement like "LOWER($column_name)"
|
||||
*/
|
||||
function sql_lower_text($column_name)
|
||||
{
|
||||
return "LOWER($column_name)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Run more than one insert statement.
|
||||
*
|
||||
|
@ -358,49 +358,6 @@ class dbal_firebird extends dbal
|
||||
return (sizeof($row)) ? $row : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Seek to given row number
|
||||
* rownum is zero-based
|
||||
*/
|
||||
function sql_rowseek($rownum, &$query_id)
|
||||
{
|
||||
global $cache;
|
||||
|
||||
if ($query_id === false)
|
||||
{
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
{
|
||||
return $cache->sql_rowseek($rownum, $query_id);
|
||||
}
|
||||
|
||||
if ($query_id === false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$this->sql_freeresult($query_id);
|
||||
$query_id = $this->sql_query($this->last_query_text);
|
||||
|
||||
if ($query_id === false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// We do not fetch the row for rownum == 0 because then the next resultset would be the second row
|
||||
for ($i = 0; $i < $rownum; $i++)
|
||||
{
|
||||
if (!$this->sql_fetchrow($query_id))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get last inserted id after insert statement
|
||||
*/
|
||||
|
@ -91,6 +91,14 @@ class dbal_mssql extends dbal
|
||||
return ($this->sql_server_version) ? 'MSSQL<br />' . $this->sql_server_version : 'MSSQL';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function sql_concatenate($expr1, $expr2)
|
||||
{
|
||||
return $expr1 . ' + ' . $expr2;
|
||||
}
|
||||
|
||||
/**
|
||||
* SQL Transaction
|
||||
* @access private
|
||||
@ -324,6 +332,14 @@ class dbal_mssql extends dbal
|
||||
return str_replace(array("'", "\0"), array("''", ''), $msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
function sql_lower_text($column_name)
|
||||
{
|
||||
return "LOWER(SUBSTRING($column_name, 1, DATALENGTH($column_name)))";
|
||||
}
|
||||
|
||||
/**
|
||||
* Build LIKE expression
|
||||
* @access private
|
||||
|
@ -109,6 +109,14 @@ class dbal_mssql_odbc extends dbal
|
||||
return ($this->sql_server_version) ? 'MSSQL (ODBC)<br />' . $this->sql_server_version : 'MSSQL (ODBC)';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function sql_concatenate($expr1, $expr2)
|
||||
{
|
||||
return $expr1 . ' + ' . $expr2;
|
||||
}
|
||||
|
||||
/**
|
||||
* SQL Transaction
|
||||
* @access private
|
||||
@ -254,49 +262,6 @@ class dbal_mssql_odbc extends dbal
|
||||
return ($query_id !== false) ? @odbc_fetch_array($query_id) : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Seek to given row number
|
||||
* rownum is zero-based
|
||||
*/
|
||||
function sql_rowseek($rownum, &$query_id)
|
||||
{
|
||||
global $cache;
|
||||
|
||||
if ($query_id === false)
|
||||
{
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
{
|
||||
return $cache->sql_rowseek($rownum, $query_id);
|
||||
}
|
||||
|
||||
if ($query_id === false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->sql_freeresult($query_id);
|
||||
$query_id = $this->sql_query($this->last_query_text);
|
||||
|
||||
if ($query_id === false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// We do not fetch the row for rownum == 0 because then the next resultset would be the second row
|
||||
for ($i = 0; $i < $rownum; $i++)
|
||||
{
|
||||
if (!$this->sql_fetchrow($query_id))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get last inserted id after insert statement
|
||||
*/
|
||||
@ -352,6 +317,14 @@ class dbal_mssql_odbc extends dbal
|
||||
return str_replace(array("'", "\0"), array("''", ''), $msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
function sql_lower_text($column_name)
|
||||
{
|
||||
return "LOWER(SUBSTRING($column_name, 1, DATALENGTH($column_name)))";
|
||||
}
|
||||
|
||||
/**
|
||||
* Build LIKE expression
|
||||
* @access private
|
||||
|
@ -257,6 +257,14 @@ class dbal_mssqlnative extends dbal
|
||||
return ($this->sql_server_version) ? 'MSSQL<br />' . $this->sql_server_version : 'MSSQL';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function sql_concatenate($expr1, $expr2)
|
||||
{
|
||||
return $expr1 . ' + ' . $expr2;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@ -435,25 +443,7 @@ class dbal_mssqlnative extends dbal
|
||||
unset($row['line2'], $row['line3']);
|
||||
}
|
||||
}
|
||||
return $row;
|
||||
}
|
||||
|
||||
/**
|
||||
* Seek to given row number
|
||||
* rownum is zero-based
|
||||
*/
|
||||
function sql_rowseek($rownum, &$query_id)
|
||||
{
|
||||
global $cache;
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
{
|
||||
return $cache->sql_rowseek($rownum, $query_id);
|
||||
}
|
||||
|
||||
$seek = new result_mssqlnative($query_id);
|
||||
$row = $seek->seek($rownum);
|
||||
return ($row = $seek->fetch()) ? $row : false;
|
||||
return (sizeof($row)) ? $row : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -509,6 +499,14 @@ class dbal_mssqlnative extends dbal
|
||||
return str_replace(array("'", "\0"), array("''", ''), $msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
function sql_lower_text($column_name)
|
||||
{
|
||||
return "LOWER(SUBSTRING($column_name, 1, DATALENGTH($column_name)))";
|
||||
}
|
||||
|
||||
/**
|
||||
* Build LIKE expression
|
||||
* @access private
|
||||
|
@ -119,6 +119,14 @@ class dbal_mysql extends dbal
|
||||
return ($raw) ? $this->sql_server_version : 'MySQL ' . $this->sql_server_version;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function sql_concatenate($expr1, $expr2)
|
||||
{
|
||||
return 'CONCAT(' . $expr1 . ', ' . $expr2 . ')';
|
||||
}
|
||||
|
||||
/**
|
||||
* SQL Transaction
|
||||
* @access private
|
||||
|
@ -122,6 +122,14 @@ class dbal_mysqli extends dbal
|
||||
return ($raw) ? $this->sql_server_version : 'MySQL(i) ' . $this->sql_server_version;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function sql_concatenate($expr1, $expr2)
|
||||
{
|
||||
return 'CONCAT(' . $expr1 . ', ' . $expr2 . ')';
|
||||
}
|
||||
|
||||
/**
|
||||
* SQL Transaction
|
||||
* @access private
|
||||
|
@ -343,7 +343,7 @@ function still_on_time($extra_time = 15)
|
||||
|
||||
/**
|
||||
*
|
||||
* @version Version 0.1 / slightly modified for phpBB 3.0.x (using $H$ as hash type identifier)
|
||||
* @version Version 0.1 / slightly modified for phpBB 3.1.x (using $H$ as hash type identifier)
|
||||
*
|
||||
* Portable PHP password hashing framework.
|
||||
*
|
||||
@ -1068,33 +1068,210 @@ function style_select($default = '', $all = false)
|
||||
return $style_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the timezone offset with hours and minutes
|
||||
*
|
||||
* @param int $tz_offset Timezone offset in seconds
|
||||
* @return string Normalized offset string: -7200 => -02:00
|
||||
* 16200 => +04:30
|
||||
*/
|
||||
function phpbb_format_timezone_offset($tz_offset)
|
||||
{
|
||||
$sign = ($tz_offset < 0) ? '-' : '+';
|
||||
$time_offset = abs($tz_offset);
|
||||
|
||||
$offset_seconds = $time_offset % 3600;
|
||||
$offset_minutes = $offset_seconds / 60;
|
||||
$offset_hours = ($time_offset - $offset_seconds) / 3600;
|
||||
|
||||
$offset_string = sprintf("%s%02d:%02d", $sign, $offset_hours, $offset_minutes);
|
||||
return $offset_string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares two time zone labels.
|
||||
* Arranges them in increasing order by timezone offset.
|
||||
* Places UTC before other timezones in the same offset.
|
||||
*/
|
||||
function phpbb_tz_select_compare($a, $b)
|
||||
{
|
||||
$a_sign = $a[3];
|
||||
$b_sign = $b[3];
|
||||
if ($a_sign != $b_sign)
|
||||
{
|
||||
return $a_sign == '-' ? -1 : 1;
|
||||
}
|
||||
|
||||
$a_offset = substr($a, 4, 5);
|
||||
$b_offset = substr($b, 4, 5);
|
||||
if ($a_offset == $b_offset)
|
||||
{
|
||||
$a_name = substr($a, 12);
|
||||
$b_name = substr($b, 12);
|
||||
if ($a_name == $b_name)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if ($a_name == 'UTC')
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else if ($b_name == 'UTC')
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $a_name < $b_name ? -1 : 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($a_sign == '-')
|
||||
{
|
||||
return $a_offset > $b_offset ? -1 : 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $a_offset < $b_offset ? -1 : 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of timezone identifiers
|
||||
* We also add the selected timezone if we can create an object with it.
|
||||
* DateTimeZone::listIdentifiers seems to not add all identifiers to the list,
|
||||
* because some are only kept for backward compatible reasons. If the user has
|
||||
* a deprecated value, we add it here, so it can still be kept. Once the user
|
||||
* changed his value, there is no way back to deprecated values.
|
||||
*
|
||||
* @param string $selected_timezone Additional timezone that shall
|
||||
* be added to the list of identiers
|
||||
* @return array DateTimeZone::listIdentifiers and additional
|
||||
* selected_timezone if it is a valid timezone.
|
||||
*/
|
||||
function phpbb_get_timezone_identifiers($selected_timezone)
|
||||
{
|
||||
$timezones = DateTimeZone::listIdentifiers();
|
||||
|
||||
if (!in_array($selected_timezone, $timezones))
|
||||
{
|
||||
try
|
||||
{
|
||||
// Add valid timezones that are currently selected but not returned
|
||||
// by DateTimeZone::listIdentifiers
|
||||
$validate_timezone = new DateTimeZone($selected_timezone);
|
||||
$timezones[] = $selected_timezone;
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
return $timezones;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pick a timezone
|
||||
*
|
||||
* @param string $default A timezone to select
|
||||
* @param boolean $truncate Shall we truncate the options text
|
||||
*
|
||||
* @return string Returns the options for timezone selector only
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
function tz_select($default = '', $truncate = false)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$tz_select = '';
|
||||
foreach ($user->lang['tz_zones'] as $offset => $zone)
|
||||
$timezone_select = phpbb_timezone_select($user, $default, $truncate);
|
||||
return $timezone_select['tz_select'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Options to pick a timezone and date/time
|
||||
*
|
||||
* @param phpbb_user $user Object of the current user
|
||||
* @param string $default A timezone to select
|
||||
* @param boolean $truncate Shall we truncate the options text
|
||||
*
|
||||
* @return array Returns an array, also containing the options for the time selector.
|
||||
*/
|
||||
function phpbb_timezone_select($user, $default = '', $truncate = false)
|
||||
{
|
||||
static $timezones;
|
||||
|
||||
$default_offset = '';
|
||||
if (!isset($timezones))
|
||||
{
|
||||
if ($truncate)
|
||||
$unsorted_timezones = phpbb_get_timezone_identifiers($default);
|
||||
|
||||
$timezones = array();
|
||||
foreach ($unsorted_timezones as $timezone)
|
||||
{
|
||||
$zone_trunc = truncate_string($zone, 50, 255, false, '...');
|
||||
$tz = new DateTimeZone($timezone);
|
||||
$dt = new phpbb_datetime($user, 'now', $tz);
|
||||
$offset = $dt->getOffset();
|
||||
$current_time = $dt->format($user->lang['DATETIME_FORMAT'], true);
|
||||
$offset_string = phpbb_format_timezone_offset($offset);
|
||||
$timezones['GMT' . $offset_string . ' - ' . $timezone] = array(
|
||||
'tz' => $timezone,
|
||||
'offest' => 'GMT' . $offset_string,
|
||||
'current' => $current_time,
|
||||
);
|
||||
if ($timezone === $default)
|
||||
{
|
||||
$default_offset = 'GMT' . $offset_string;
|
||||
}
|
||||
}
|
||||
unset($unsorted_timezones);
|
||||
|
||||
uksort($timezones, 'phpbb_tz_select_compare');
|
||||
}
|
||||
|
||||
$tz_select = $tz_dates = $opt_group = '';
|
||||
|
||||
foreach ($timezones as $timezone)
|
||||
{
|
||||
if ($opt_group != $timezone['offest'])
|
||||
{
|
||||
$tz_select .= ($opt_group) ? '</optgroup>' : '';
|
||||
$tz_select .= '<optgroup label="' . $timezone['offest'] . ' - ' . $timezone['current'] . '">';
|
||||
$opt_group = $timezone['offest'];
|
||||
|
||||
$selected = ($default_offset == $timezone['offest']) ? ' selected="selected"' : '';
|
||||
$tz_dates .= '<option value="' . $timezone['offest'] . ' - ' . $timezone['current'] . '"' . $selected . '>' . $timezone['offest'] . ' - ' . $timezone['current'] . '</option>';
|
||||
}
|
||||
|
||||
if (isset($user->lang['timezones'][$timezone['tz']]))
|
||||
{
|
||||
$title = $label = $user->lang['timezones'][$timezone['tz']];
|
||||
}
|
||||
else
|
||||
{
|
||||
$zone_trunc = $zone;
|
||||
// No label, we'll figure one out
|
||||
$bits = explode('/', str_replace('_', ' ', $timezone['tz']));
|
||||
|
||||
$label = implode(' - ', $bits);
|
||||
$title = $timezone['offest'] . ' - ' . $label;
|
||||
}
|
||||
|
||||
if (is_numeric($offset))
|
||||
if ($truncate)
|
||||
{
|
||||
$selected = ($offset == $default) ? ' selected="selected"' : '';
|
||||
$tz_select .= '<option title="' . $zone . '" value="' . $offset . '"' . $selected . '>' . $zone_trunc . '</option>';
|
||||
$label = truncate_string($label, 50, 255, false, '...');
|
||||
}
|
||||
}
|
||||
|
||||
return $tz_select;
|
||||
$selected = ($timezone['tz'] === $default) ? ' selected="selected"' : '';
|
||||
$tz_select .= '<option title="' . $title . '" value="' . $timezone['tz'] . '"' . $selected . '>' . $label . '</option>';
|
||||
}
|
||||
$tz_select .= '</optgroup>';
|
||||
|
||||
return array(
|
||||
'tz_select' => $tz_select,
|
||||
'tz_dates' => $tz_dates,
|
||||
);
|
||||
}
|
||||
|
||||
// Functions handling topic/post tracking/marking
|
||||
@ -1691,14 +1868,17 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = 'SELECT t.forum_id FROM ' . TOPICS_TABLE . ' t
|
||||
LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . ')
|
||||
$sql = 'SELECT t.forum_id
|
||||
FROM ' . TOPICS_TABLE . ' t
|
||||
LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt
|
||||
ON (tt.topic_id = t.topic_id
|
||||
AND tt.user_id = ' . $user->data['user_id'] . ')
|
||||
WHERE t.forum_id = ' . $forum_id . '
|
||||
AND t.topic_last_post_time > ' . $mark_time_forum . '
|
||||
AND t.topic_moved_id = 0 ' .
|
||||
$sql_update_unapproved . '
|
||||
AND (tt.topic_id IS NULL OR tt.mark_time < t.topic_last_post_time)
|
||||
GROUP BY t.forum_id';
|
||||
AND (tt.topic_id IS NULL
|
||||
OR tt.mark_time < t.topic_last_post_time)';
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
@ -1878,105 +2058,152 @@ function tracking_unserialize($string, $max_depth = 3)
|
||||
// Pagination functions
|
||||
|
||||
/**
|
||||
* Pagination routine, generates page number sequence
|
||||
* tpl_prefix is for using different pagination blocks at one page
|
||||
* Generate template rendered pagination
|
||||
* Allows full control of rendering of pagination with the template
|
||||
*
|
||||
* @param object $template the template object
|
||||
* @param string $base_url is url prepended to all links generated within the function
|
||||
* @param string $block_var_name is the name assigned to the pagination data block within the template (example: <!-- BEGIN pagination -->)
|
||||
* @param string $start_name is the name of the parameter containing the first item of the given page (example: start=20)
|
||||
* @param int $num_items the total number of items, posts, etc., used to determine the number of pages to produce
|
||||
* @param int $per_page the number of items, posts, etc. to display per page, used to determine the number of pages to produce
|
||||
* @param int $start_item the item which should be considered currently active, used to determine the page we're on
|
||||
* @param bool $reverse_count determines whether we weight display of the list towards the start (false) or end (true) of the list
|
||||
* @param bool $ignore_on_page decides whether we enable an active (unlinked) item, used primarily for embedded lists
|
||||
* @return null
|
||||
*/
|
||||
function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = false, $tpl_prefix = '')
|
||||
function phpbb_generate_template_pagination($template, $base_url, $block_var_name, $start_name, $num_items, $per_page, $start_item = 1, $reverse_count = false, $ignore_on_page = false)
|
||||
{
|
||||
global $template, $user;
|
||||
|
||||
// Make sure $per_page is a valid value
|
||||
$per_page = ($per_page <= 0) ? 1 : $per_page;
|
||||
|
||||
$separator = '<span class="page-sep">' . $user->lang['COMMA_SEPARATOR'] . '</span>';
|
||||
$total_pages = ceil($num_items / $per_page);
|
||||
|
||||
if ($total_pages == 1 || !$num_items)
|
||||
{
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
$on_page = floor($start_item / $per_page) + 1;
|
||||
$url_delim = (strpos($base_url, '?') === false) ? '?' : ((strpos($base_url, '?') === strlen($base_url) - 1) ? '' : '&');
|
||||
|
||||
$page_string = ($on_page == 1) ? '<strong>1</strong>' : '<a href="' . $base_url . '">1</a>';
|
||||
|
||||
if ($total_pages > 5)
|
||||
|
||||
if ($reverse_count)
|
||||
{
|
||||
$start_cnt = min(max(1, $on_page - 4), $total_pages - 5);
|
||||
$end_cnt = max(min($total_pages, $on_page + 4), 6);
|
||||
|
||||
$page_string .= ($start_cnt > 1) ? '<span class="page-dots"> ... </span>' : $separator;
|
||||
|
||||
for ($i = $start_cnt + 1; $i < $end_cnt; $i++)
|
||||
{
|
||||
$page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href="' . $base_url . "{$url_delim}start=" . (($i - 1) * $per_page) . '">' . $i . '</a>';
|
||||
if ($i < $end_cnt - 1)
|
||||
{
|
||||
$page_string .= $separator;
|
||||
}
|
||||
}
|
||||
|
||||
$page_string .= ($end_cnt < $total_pages) ? '<span class="page-dots"> ... </span>' : $separator;
|
||||
$start_page = ($total_pages > 5) ? $total_pages - 4 : 1;
|
||||
$end_page = $total_pages;
|
||||
}
|
||||
else
|
||||
{
|
||||
$page_string .= $separator;
|
||||
|
||||
for ($i = 2; $i < $total_pages; $i++)
|
||||
{
|
||||
$page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href="' . $base_url . "{$url_delim}start=" . (($i - 1) * $per_page) . '">' . $i . '</a>';
|
||||
if ($i < $total_pages)
|
||||
{
|
||||
$page_string .= $separator;
|
||||
}
|
||||
}
|
||||
// What we're doing here is calculating what the "start" and "end" pages should be. We
|
||||
// do this by assuming pagination is "centered" around the currently active page with
|
||||
// the three previous and three next page links displayed. Anything more than that and
|
||||
// we display the ellipsis, likewise anything less.
|
||||
//
|
||||
// $start_page is the page at which we start creating the list. When we have five or less
|
||||
// pages we start at page 1 since there will be no ellipsis displayed. Anymore than that
|
||||
// and we calculate the start based on the active page. This is the min/max calculation.
|
||||
// First (max) would we end up starting on a page less than 1? Next (min) would we end
|
||||
// up starting so close to the end that we'd not display our minimum number of pages.
|
||||
//
|
||||
// $end_page is the last page in the list to display. Like $start_page we use a min/max to
|
||||
// determine this number. Again at most five pages? Then just display them all. More than
|
||||
// five and we first (min) determine whether we'd end up listing more pages than exist.
|
||||
// We then (max) ensure we're displaying the minimum number of pages.
|
||||
$start_page = ($total_pages > 5) ? min(max(1, $on_page - 3), $total_pages - 4) : 1;
|
||||
$end_page = ($total_pages > 5) ? max(min($total_pages, $on_page + 3), 5) : $total_pages;
|
||||
}
|
||||
|
||||
$page_string .= ($on_page == $total_pages) ? '<strong>' . $total_pages . '</strong>' : '<a href="' . $base_url . "{$url_delim}start=" . (($total_pages - 1) * $per_page) . '">' . $total_pages . '</a>';
|
||||
|
||||
if ($add_prevnext_text)
|
||||
if ($on_page != $total_pages)
|
||||
{
|
||||
if ($on_page != 1)
|
||||
{
|
||||
$page_string = '<a href="' . $base_url . "{$url_delim}start=" . (($on_page - 2) * $per_page) . '">' . $user->lang['PREVIOUS'] . '</a> ' . $page_string;
|
||||
}
|
||||
$template->assign_block_vars($block_var_name, array(
|
||||
'PAGE_NUMBER' => '',
|
||||
'PAGE_URL' => $base_url . $url_delim . $start_name . '=' . ($on_page * $per_page),
|
||||
'S_IS_CURRENT' => false,
|
||||
'S_IS_PREV' => false,
|
||||
'S_IS_NEXT' => true,
|
||||
'S_IS_ELLIPSIS' => false,
|
||||
));
|
||||
}
|
||||
|
||||
if ($on_page != $total_pages)
|
||||
// This do...while exists purely to negate the need for start and end assign_block_vars, i.e.
|
||||
// to display the first and last page in the list plus any ellipsis. We use this loop to jump
|
||||
// around a little within the list depending on where we're starting (and ending).
|
||||
$at_page = 1;
|
||||
do
|
||||
{
|
||||
$page_url = $base_url . (($at_page == 1) ? '' : $url_delim . $start_name . '=' . (($at_page - 1) * $per_page));
|
||||
|
||||
// We decide whether to display the ellipsis during the loop. The ellipsis is always
|
||||
// displayed as either the second or penultimate item in the list. So are we at either
|
||||
// of those points and of course do we even need to display it, i.e. is the list starting
|
||||
// on at least page 3 and ending three pages before the final item.
|
||||
$template->assign_block_vars($block_var_name, array(
|
||||
'PAGE_NUMBER' => $at_page,
|
||||
'PAGE_URL' => $page_url,
|
||||
'S_IS_CURRENT' => (!$ignore_on_page && $at_page == $on_page),
|
||||
'S_IS_NEXT' => false,
|
||||
'S_IS_PREV' => false,
|
||||
'S_IS_ELLIPSIS' => ($at_page == 2 && $start_page > 2) || ($at_page == $total_pages - 1 && $end_page < $total_pages - 1),
|
||||
));
|
||||
|
||||
// We may need to jump around in the list depending on whether we have or need to display
|
||||
// the ellipsis. Are we on page 2 and are we more than one page away from the start
|
||||
// of the list? Yes? Then we jump to the start of the list. Likewise are we at the end of
|
||||
// the list and are there more than two pages left in total? Yes? Then jump to the penultimate
|
||||
// page (so we can display the ellipsis next pass). Else, increment the counter and keep
|
||||
// going
|
||||
if ($at_page == 2 && $at_page < $start_page - 1)
|
||||
{
|
||||
$page_string .= ' <a href="' . $base_url . "{$url_delim}start=" . ($on_page * $per_page) . '">' . $user->lang['NEXT'] . '</a>';
|
||||
$at_page = $start_page;
|
||||
}
|
||||
else if ($at_page == $end_page && $end_page < $total_pages - 1)
|
||||
{
|
||||
$at_page = $total_pages - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$at_page++;
|
||||
}
|
||||
}
|
||||
while ($at_page <= $total_pages);
|
||||
|
||||
$template->assign_vars(array(
|
||||
$tpl_prefix . 'BASE_URL' => $base_url,
|
||||
'A_' . $tpl_prefix . 'BASE_URL' => addslashes($base_url),
|
||||
$tpl_prefix . 'PER_PAGE' => $per_page,
|
||||
|
||||
$tpl_prefix . 'PREVIOUS_PAGE' => ($on_page == 1) ? '' : $base_url . "{$url_delim}start=" . (($on_page - 2) * $per_page),
|
||||
$tpl_prefix . 'NEXT_PAGE' => ($on_page == $total_pages) ? '' : $base_url . "{$url_delim}start=" . ($on_page * $per_page),
|
||||
$tpl_prefix . 'TOTAL_PAGES' => $total_pages,
|
||||
$tpl_prefix . 'CURRENT_PAGE' => $on_page,
|
||||
));
|
||||
|
||||
return $page_string;
|
||||
if ($on_page != 1)
|
||||
{
|
||||
$template->assign_block_vars($block_var_name, array(
|
||||
'PAGE_NUMBER' => '',
|
||||
'PAGE_URL' => $base_url . $url_delim . $start_name . '=' . (($on_page - 2) * $per_page),
|
||||
'S_IS_CURRENT' => false,
|
||||
'S_IS_PREV' => true,
|
||||
'S_IS_NEXT' => false,
|
||||
'S_IS_ELLIPSIS' => false,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return current page (pagination)
|
||||
* Return current page
|
||||
* This function also sets certain specific template variables
|
||||
*
|
||||
* @param object $template the template object
|
||||
* @param object $user the user object
|
||||
* @param string $base_url the base url used to call this page, used by Javascript for popup jump to page
|
||||
* @param int $num_items the total number of items, posts, topics, etc.
|
||||
* @param int $per_page the number of items, posts, etc. per page
|
||||
* @param int $start the item which should be considered currently active, used to determine the page we're on
|
||||
* @return null
|
||||
*/
|
||||
function on_page($num_items, $per_page, $start)
|
||||
function phpbb_on_page($template, $user, $base_url, $num_items, $per_page, $start)
|
||||
{
|
||||
global $template, $user;
|
||||
|
||||
// Make sure $per_page is a valid value
|
||||
$per_page = ($per_page <= 0) ? 1 : $per_page;
|
||||
|
||||
$on_page = floor($start / $per_page) + 1;
|
||||
|
||||
$template->assign_vars(array(
|
||||
'ON_PAGE' => $on_page)
|
||||
);
|
||||
'PER_PAGE' => $per_page,
|
||||
'ON_PAGE' => $on_page,
|
||||
|
||||
'A_BASE_URL' => addslashes($base_url),
|
||||
));
|
||||
|
||||
return sprintf($user->lang['PAGE_OF'], $on_page, max(ceil($num_items / $per_page), 1));
|
||||
}
|
||||
@ -3247,7 +3474,7 @@ function get_preg_expression($mode)
|
||||
case 'email':
|
||||
// Regex written by James Watts and Francisco Jose Martin Moreno
|
||||
// http://fightingforalostcause.net/misc/2006/compare-email-regex.php
|
||||
return '([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*(?:[\w\!\#$\%\'\*\+\-\/\=\?\^\`{\|\}\~]|&)+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)';
|
||||
return '([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*(?:[\w\!\#$\%\'\*\+\-\/\=\?\^\`{\|\}\~]|&)+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,63})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)';
|
||||
break;
|
||||
|
||||
case 'bbcode_htm':
|
||||
@ -4651,9 +4878,6 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
|
||||
$board_url = generate_board_url() . '/';
|
||||
$web_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? $board_url : $phpbb_root_path;
|
||||
|
||||
// Which timezone?
|
||||
$tz = ($user->data['user_id'] != ANONYMOUS) ? strval(doubleval($user->data['user_timezone'])) : strval(doubleval($config['board_timezone']));
|
||||
|
||||
// Send a proper content-language to the output
|
||||
$user_lang = $user->lang['USER_LANG'];
|
||||
if (strpos($user_lang, '-x-') !== false)
|
||||
@ -4676,6 +4900,14 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
|
||||
}
|
||||
}
|
||||
|
||||
$dt = new phpbb_datetime($user, 'now', $user->timezone);
|
||||
$timezone_offset = 'GMT' . phpbb_format_timezone_offset($dt->getOffset());
|
||||
$timezone_name = $user->timezone->getName();
|
||||
if (isset($user->lang['timezones'][$timezone_name]))
|
||||
{
|
||||
$timezone_name = $user->lang['timezones'][$timezone_name];
|
||||
}
|
||||
|
||||
// The following assigns all _common_ variables that may be used at any point in a template.
|
||||
$template->assign_vars(array(
|
||||
'SITENAME' => $config['sitename'],
|
||||
@ -4743,7 +4975,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
|
||||
'S_CONTENT_FLOW_BEGIN' => ($user->lang['DIRECTION'] == 'ltr') ? 'left' : 'right',
|
||||
'S_CONTENT_FLOW_END' => ($user->lang['DIRECTION'] == 'ltr') ? 'right' : 'left',
|
||||
'S_CONTENT_ENCODING' => 'UTF-8',
|
||||
'S_TIMEZONE' => ($user->data['user_dst'] || ($user->data['user_id'] == ANONYMOUS && $config['board_dst'])) ? sprintf($user->lang['ALL_TIMES'], $user->lang['tz'][$tz], $user->lang['tz']['dst']) : sprintf($user->lang['ALL_TIMES'], $user->lang['tz'][$tz], ''),
|
||||
'S_TIMEZONE' => sprintf($user->lang['ALL_TIMES'], $timezone_offset, $timezone_name),
|
||||
'S_DISPLAY_ONLINE_LIST' => ($l_online_time) ? 1 : 0,
|
||||
'S_DISPLAY_SEARCH' => (!$config['load_search']) ? 0 : (isset($auth) ? ($auth->acl_get('u_search') && $auth->acl_getf_global('f_search')) : 1),
|
||||
'S_DISPLAY_PM' => ($config['allow_privmsg'] && !empty($user->data['is_registered']) && ($auth->acl_get('u_readpm') || $auth->acl_get('u_sendpm'))) ? true : false,
|
||||
@ -4767,10 +4999,11 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
|
||||
|
||||
'S_SEARCH_HIDDEN_FIELDS' => build_hidden_fields($s_search_hidden_fields),
|
||||
|
||||
'T_ASSETS_VERSION' => $config['assets_version'],
|
||||
'T_ASSETS_PATH' => "{$web_path}assets",
|
||||
'T_THEME_PATH' => "{$web_path}styles/" . rawurlencode($user->theme['style_path']) . '/theme',
|
||||
'T_TEMPLATE_PATH' => "{$web_path}styles/" . rawurlencode($user->theme['style_path']) . '/template',
|
||||
'T_SUPER_TEMPLATE_PATH' => "{$web_path}styles/" . rawurlencode($user->theme['style_path']) . '/template',
|
||||
'T_THEME_PATH' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme',
|
||||
'T_TEMPLATE_PATH' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/template',
|
||||
'T_SUPER_TEMPLATE_PATH' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/template',
|
||||
'T_IMAGES_PATH' => "{$web_path}images/",
|
||||
'T_SMILIES_PATH' => "{$web_path}{$config['smilies_path']}/",
|
||||
'T_AVATAR_PATH' => "{$web_path}{$config['avatar_path']}/",
|
||||
@ -4778,16 +5011,15 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
|
||||
'T_ICONS_PATH' => "{$web_path}{$config['icons_path']}/",
|
||||
'T_RANKS_PATH' => "{$web_path}{$config['ranks_path']}/",
|
||||
'T_UPLOAD_PATH' => "{$web_path}{$config['upload_path']}/",
|
||||
'T_STYLESHEET_LINK' => "{$web_path}styles/" . rawurlencode($user->theme['style_path']) . '/theme/stylesheet.css',
|
||||
'T_STYLESHEET_LANG_LINK' => "{$web_path}styles/" . rawurlencode($user->theme['style_path']) . '/theme/' . $user->lang_name . '/stylesheet.css',
|
||||
'T_STYLESHEET_NAME' => $user->theme['style_name'],
|
||||
'T_JQUERY_LINK' => ($config['load_jquery_cdn'] && !empty($config['load_jquery_url'])) ? $config['load_jquery_url'] : "{$web_path}assets/javascript/jquery.js",
|
||||
'T_STYLESHEET_LINK' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/stylesheet.css?assets_version=' . $config['assets_version'],
|
||||
'T_STYLESHEET_LANG_LINK' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/' . $user->lang_name . '/stylesheet.css?assets_version=' . $config['assets_version'],
|
||||
'T_JQUERY_LINK' => ($config['load_jquery_cdn'] && !empty($config['load_jquery_url'])) ? $config['load_jquery_url'] : "{$web_path}assets/javascript/jquery.js?assets_version=" . $config['assets_version'],
|
||||
'S_JQUERY_FALLBACK' => ($config['load_jquery_cdn']) ? true : false,
|
||||
|
||||
'T_THEME_NAME' => rawurlencode($user->theme['style_path']),
|
||||
'T_THEME_NAME' => rawurlencode($user->style['style_path']),
|
||||
'T_THEME_LANG_NAME' => $user->data['user_lang'],
|
||||
'T_TEMPLATE_NAME' => $user->theme['style_path'],
|
||||
'T_SUPER_TEMPLATE_NAME' => rawurlencode((isset($user->theme['style_parent_tree']) && $user->theme['style_parent_tree']) ? $user->theme['style_parent_tree'] : $user->theme['style_path']),
|
||||
'T_TEMPLATE_NAME' => $user->style['style_path'],
|
||||
'T_SUPER_TEMPLATE_NAME' => rawurlencode((isset($user->style['style_parent_tree']) && $user->style['style_parent_tree']) ? $user->style['style_parent_tree'] : $user->style['style_path']),
|
||||
'T_IMAGES' => 'images',
|
||||
'T_SMILIES' => $config['smilies_path'],
|
||||
'T_AVATAR' => $config['avatar_path'],
|
||||
@ -4983,3 +5215,16 @@ function phpbb_pcre_utf8_support()
|
||||
}
|
||||
return $utf8_pcre_properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Casts a numeric string $input to an appropriate numeric type (i.e. integer or float)
|
||||
*
|
||||
* @param string $input A numeric string.
|
||||
*
|
||||
* @return int|float Integer $input if $input fits integer,
|
||||
* float $input otherwise.
|
||||
*/
|
||||
function phpbb_to_numeric($input)
|
||||
{
|
||||
return ($input > PHP_INT_MAX) ? (float) $input : (int) $input;
|
||||
}
|
||||
|
@ -2556,7 +2556,8 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
||||
{
|
||||
$sql_keywords .= $db->sql_in_set('l.log_operation', $operations) . ' OR ';
|
||||
}
|
||||
$sql_keywords .= 'LOWER(l.log_data) ' . implode(' OR LOWER(l.log_data) ', $keywords) . ')';
|
||||
$sql_lower = $db->sql_lower_text('l.log_data');
|
||||
$sql_keywords .= "$sql_lower " . implode(" OR $sql_lower ", $keywords) . ')';
|
||||
}
|
||||
|
||||
if ($log_count !== false)
|
||||
|
@ -1884,7 +1884,7 @@ function add_bots()
|
||||
'user_email' => '',
|
||||
'user_lang' => $config['default_lang'],
|
||||
'user_style' => 1,
|
||||
'user_timezone' => 0,
|
||||
'user_timezone' => 'UTC',
|
||||
'user_allow_massemail' => 0,
|
||||
);
|
||||
|
||||
|
@ -397,12 +397,13 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||
if ($row['forum_last_post_id'])
|
||||
{
|
||||
$last_post_subject = $row['forum_last_post_subject'];
|
||||
$last_post_subject_truncated = truncate_string(censor_text($last_post_subject), 30, 255, false, $user->lang['ELLIPSIS']);
|
||||
$last_post_time = $user->format_date($row['forum_last_post_time']);
|
||||
$last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$last_post_subject = $last_post_time = $last_post_url = '';
|
||||
$last_post_subject = $last_post_time = $last_post_url = $last_post_subject_truncated = '';
|
||||
}
|
||||
|
||||
// Output moderator listing ... if applicable
|
||||
@ -451,6 +452,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||
'S_LOCKED_FORUM' => ($row['forum_status'] == ITEM_LOCKED) ? true : false,
|
||||
'S_LIST_SUBFORUMS' => ($row['display_subforum_list']) ? true : false,
|
||||
'S_SUBFORUMS' => (sizeof($subforums_list)) ? true : false,
|
||||
'S_DISPLAY_SUBJECT' => ($last_post_subject && $config['display_last_subject'] && !$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id'])) ? true : false,
|
||||
'S_FEED_ENABLED' => ($config['feed_forum'] && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $row['forum_options']) && $row['forum_type'] == FORUM_POST) ? true : false,
|
||||
|
||||
'FORUM_ID' => $row['forum_id'],
|
||||
@ -463,7 +465,8 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||
'FORUM_FOLDER_IMG_ALT' => isset($user->lang[$folder_alt]) ? $user->lang[$folder_alt] : '',
|
||||
'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '',
|
||||
'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
|
||||
'LAST_POST_SUBJECT' => censor_text($last_post_subject),
|
||||
'LAST_POST_SUBJECT' => (!$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id'])) ? censor_text($last_post_subject) : "",
|
||||
'LAST_POST_SUBJECT_TRUNCATED' => (!$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id'])) ? $last_post_subject_truncated : "",
|
||||
'LAST_POST_TIME' => $last_post_time,
|
||||
'LAST_POSTER' => get_username_string('username', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
|
||||
'LAST_POSTER_COLOUR' => get_username_string('colour', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
|
||||
@ -636,48 +639,6 @@ function get_forum_parents(&$forum_data)
|
||||
return $forum_parents;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate topic pagination
|
||||
*/
|
||||
function topic_generate_pagination($replies, $url)
|
||||
{
|
||||
global $config, $user;
|
||||
|
||||
// Make sure $per_page is a valid value
|
||||
$per_page = ($config['posts_per_page'] <= 0) ? 1 : $config['posts_per_page'];
|
||||
|
||||
if (($replies + 1) > $per_page)
|
||||
{
|
||||
$total_pages = ceil(($replies + 1) / $per_page);
|
||||
$pagination = '';
|
||||
|
||||
$times = 1;
|
||||
for ($j = 0; $j < $replies + 1; $j += $per_page)
|
||||
{
|
||||
$pagination .= '<a href="' . $url . ($j == 0 ? '' : '&start=' . $j) . '">' . $times . '</a>';
|
||||
if ($times == 1 && $total_pages > 5)
|
||||
{
|
||||
$pagination .= '<span class="page-dots"> ... </span>';
|
||||
|
||||
// Display the last three pages
|
||||
$times = $total_pages - 3;
|
||||
$j += ($total_pages - 4) * $per_page;
|
||||
}
|
||||
else if ($times < $total_pages)
|
||||
{
|
||||
$pagination .= '<span class="page-sep">' . $user->lang['COMMA_SEPARATOR'] . '</span>';
|
||||
}
|
||||
$times++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$pagination = '';
|
||||
}
|
||||
|
||||
return $pagination;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain list of moderators of each forum
|
||||
*/
|
||||
@ -1218,7 +1179,9 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||
if ($can_watch)
|
||||
{
|
||||
$s_watching['link'] = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&" . (($is_watching) ? 'unwatch' : 'watch') . "=$mode&start=$start&hash=" . generate_link_hash("{$mode}_$match_id"));
|
||||
$s_watching['link_toggle'] = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&" . ((!$is_watching) ? 'unwatch' : 'watch') . "=$mode&start=$start&hash=" . generate_link_hash("{$mode}_$match_id"));
|
||||
$s_watching['title'] = $user->lang[(($is_watching) ? 'STOP' : 'START') . '_WATCHING_' . strtoupper($mode)];
|
||||
$s_watching['title_toggle'] = $user->lang[((!$is_watching) ? 'STOP' : 'START') . '_WATCHING_' . strtoupper($mode)];
|
||||
$s_watching['is_watching'] = $is_watching;
|
||||
}
|
||||
|
||||
|
@ -463,17 +463,21 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes comments from schema files
|
||||
* Removes "/* style" as well as "# style" comments from $input.
|
||||
*
|
||||
* @param string $input Input string
|
||||
*
|
||||
* @return string Input string with comments removed
|
||||
*/
|
||||
function remove_comments($sql)
|
||||
function phpbb_remove_comments($input)
|
||||
{
|
||||
// Remove /* */ comments (http://ostermiller.org/findcomment.html)
|
||||
$sql = preg_replace('#/\*(.|[\r\n])*?\*/#', "\n", $sql);
|
||||
$input = preg_replace('#/\*(.|[\r\n])*?\*/#', "\n", $input);
|
||||
|
||||
// Remove # style comments
|
||||
$sql = preg_replace('/\n{2,}/', "\n", preg_replace('/^#.*$/m', "\n", $sql));
|
||||
$input = preg_replace('/\n{2,}/', "\n", preg_replace('/^#.*$/m', "\n", $input));
|
||||
|
||||
return $sql;
|
||||
return $input;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -511,12 +515,22 @@ function adjust_language_keys_callback($matches)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the output to be stored in a phpBB config.php file
|
||||
*
|
||||
* @param array $data Array containing the database connection information
|
||||
* @param string $dbms The name of the DBAL class to use
|
||||
* @param array $load_extensions Array of additional extensions that should be loaded
|
||||
* @param bool $debug If the debug constants should be enabled by default or not
|
||||
*
|
||||
* @return string The output to write to the file
|
||||
*/
|
||||
function phpbb_create_config_file_data($data, $dbms, $load_extensions, $debug = false)
|
||||
{
|
||||
$load_extensions = implode(',', $load_extensions);
|
||||
|
||||
$config_data = "<?php\n";
|
||||
$config_data .= "// phpBB 3.0.x auto-generated configuration file\n// Do not change anything in this file!\n";
|
||||
$config_data .= "// phpBB 3.1.x auto-generated configuration file\n// Do not change anything in this file!\n";
|
||||
|
||||
$config_data_array = array(
|
||||
'dbms' => $dbms,
|
||||
@ -548,7 +562,5 @@ function phpbb_create_config_file_data($data, $dbms, $load_extensions, $debug =
|
||||
$config_data .= "// @define('DEBUG_EXTRA', true);\n";
|
||||
}
|
||||
|
||||
$config_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused!
|
||||
|
||||
return $config_data;
|
||||
}
|
||||
|
@ -210,8 +210,9 @@ class messenger
|
||||
{
|
||||
$style_resource_locator = new phpbb_style_resource_locator();
|
||||
$style_path_provider = new phpbb_style_extension_path_provider($phpbb_extension_manager, new phpbb_style_path_provider());
|
||||
$tpl = new phpbb_style_template($phpbb_root_path, $phpEx, $config, $user, $style_resource_locator, $style_path_provider);
|
||||
$stl = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $style_resource_locator, $style_path_provider, $tpl);
|
||||
$tpl = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $style_resource_locator);
|
||||
$style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $style_resource_locator, $style_path_provider, $tpl);
|
||||
|
||||
$this->tpl_msg[$template_lang . $template_file] = $tpl;
|
||||
|
||||
$fallback_template_path = false;
|
||||
@ -230,7 +231,7 @@ class messenger
|
||||
}
|
||||
}
|
||||
|
||||
$stl->set_custom_style($template_lang . '_email', array($template_path, $fallback_template_path), '');
|
||||
$style->set_custom_style($template_lang . '_email', array($template_path, $fallback_template_path), '');
|
||||
|
||||
$tpl->set_filenames(array(
|
||||
'body' => $template_file . '.txt',
|
||||
|
@ -61,10 +61,7 @@ function generate_smilies($mode, $forum_id)
|
||||
'body' => 'posting_smilies.html')
|
||||
);
|
||||
|
||||
$template->assign_var('PAGINATION',
|
||||
generate_pagination(append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&f=' . $forum_id),
|
||||
$smiley_count, $config['smilies_per_page'], $start, true)
|
||||
);
|
||||
generate_pagination(append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&f=' . $forum_id), $smiley_count, $config['smilies_per_page'], $start);
|
||||
}
|
||||
|
||||
$display_link = false;
|
||||
@ -1657,8 +1654,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
|
||||
// First of all make sure the subject and topic title are having the correct length.
|
||||
// To achieve this without cutting off between special chars we convert to an array and then count the elements.
|
||||
$subject = truncate_string($subject);
|
||||
$data['topic_title'] = truncate_string($data['topic_title']);
|
||||
$subject = truncate_string($subject, 120);
|
||||
$data['topic_title'] = truncate_string($data['topic_title'], 120);
|
||||
|
||||
// Collect some basic information about which tables and which rows to update/insert
|
||||
$sql_data = $topic_row = array();
|
||||
|
@ -1127,6 +1127,166 @@ function delete_pm($user_id, $msg_ids, $folder_id)
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all PM(s) for a given user and delete the ones without references
|
||||
*
|
||||
* @param int $user_id ID of the user whose private messages we want to delete
|
||||
*
|
||||
* @return boolean False if there were no pms found, true otherwise.
|
||||
*/
|
||||
function phpbb_delete_user_pms($user_id)
|
||||
{
|
||||
global $db, $user, $phpbb_root_path, $phpEx;
|
||||
|
||||
$user_id = (int) $user_id;
|
||||
|
||||
if (!$user_id)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get PM Information for later deleting
|
||||
// The two queries where split, so we can use our indexes
|
||||
// Part 1: get PMs the user received
|
||||
$sql = 'SELECT msg_id, author_id, folder_id, pm_unread, pm_new
|
||||
FROM ' . PRIVMSGS_TO_TABLE . '
|
||||
WHERE user_id = ' . $user_id;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$undelivered_msg = $undelivered_user = $delete_ids = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if ($row['author_id'] == $user_id && $row['folder_id'] == PRIVMSGS_NO_BOX)
|
||||
{
|
||||
// Undelivered messages
|
||||
$undelivered_msg[] = $row['msg_id'];
|
||||
|
||||
if (isset($undelivered_user[$row['user_id']]))
|
||||
{
|
||||
++$undelivered_user[$row['user_id']];
|
||||
}
|
||||
else
|
||||
{
|
||||
$undelivered_user[$row['user_id']] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$delete_ids[(int) $row['msg_id']] = (int) $row['msg_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Part 2: get PMs the user sent
|
||||
$sql = 'SELECT msg_id, author_id, folder_id, pm_unread, pm_new
|
||||
FROM ' . PRIVMSGS_TO_TABLE . '
|
||||
WHERE author_id = ' . $user_id . '
|
||||
AND folder_id = ' . PRIVMSGS_NO_BOX;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if ($row['author_id'] == $user_id && $row['folder_id'] == PRIVMSGS_NO_BOX)
|
||||
{
|
||||
// Undelivered messages
|
||||
$undelivered_msg[] = $row['msg_id'];
|
||||
|
||||
if (isset($undelivered_user[$row['user_id']]))
|
||||
{
|
||||
++$undelivered_user[$row['user_id']];
|
||||
}
|
||||
else
|
||||
{
|
||||
$undelivered_user[$row['user_id']] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$delete_ids[(int) $row['msg_id']] = (int) $row['msg_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (empty($delete_ids))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$db->sql_transaction('begin');
|
||||
|
||||
if (sizeof($undelivered_msg))
|
||||
{
|
||||
$sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg);
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
// Reset the user´s pm count to 0
|
||||
if (isset($undelivered_user[$user_id]))
|
||||
{
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET user_new_privmsg = 0,
|
||||
user_unread_privmsg = 0
|
||||
WHERE user_id = ' . $user_id;
|
||||
$db->sql_query($sql);
|
||||
unset($undelivered_user[$user_id]);
|
||||
}
|
||||
|
||||
foreach ($undelivered_user as $_user_id => $count)
|
||||
{
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET user_new_privmsg = user_new_privmsg - ' . $count . ',
|
||||
user_unread_privmsg = user_unread_privmsg - ' . $count . '
|
||||
WHERE user_id = ' . $_user_id;
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
// Delete private message data
|
||||
$sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . "
|
||||
WHERE user_id = $user_id
|
||||
AND " . $db->sql_in_set('msg_id', $delete_ids);
|
||||
$db->sql_query($sql);
|
||||
|
||||
// Now we have to check which messages we can delete completely
|
||||
$sql = 'SELECT msg_id
|
||||
FROM ' . PRIVMSGS_TO_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('msg_id', $delete_ids);
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
unset($delete_ids[$row['msg_id']]);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!empty($delete_ids))
|
||||
{
|
||||
// Check if there are any attachments we need to remove
|
||||
if (!function_exists('delete_attachments'))
|
||||
{
|
||||
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
||||
}
|
||||
|
||||
delete_attachments('message', $delete_ids, false);
|
||||
|
||||
$sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('msg_id', $delete_ids);
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
// Set the remaining author id to anonymous
|
||||
// This way users are still able to read messages from users being removed
|
||||
$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . '
|
||||
SET author_id = ' . ANONYMOUS . '
|
||||
WHERE author_id = ' . $user_id;
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql = 'UPDATE ' . PRIVMSGS_TABLE . '
|
||||
SET author_id = ' . ANONYMOUS . '
|
||||
WHERE author_id = ' . $user_id;
|
||||
$db->sql_query($sql);
|
||||
|
||||
$db->sql_transaction('commit');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild message header
|
||||
*/
|
||||
@ -1406,12 +1566,6 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
// Additionally, do not include the sender if he is in the group he wants to send to. ;)
|
||||
if ($row['user_id'] === $user->data['user_id'])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$field = ($data['address_list']['g'][$row['group_id']] == 'to') ? 'to' : 'bcc';
|
||||
$recipients[$row['user_id']] = $field;
|
||||
}
|
||||
|
@ -554,9 +554,12 @@ class custom_profile
|
||||
else if ($day && $month && $year)
|
||||
{
|
||||
global $user;
|
||||
// Date should display as the same date for every user regardless of timezone, so remove offset
|
||||
// to compensate for the offset added by phpbb_user::format_date()
|
||||
return $user->format_date(gmmktime(0, 0, 0, $month, $day, $year) - ($user->timezone + $user->dst), $user->lang['DATE_FORMAT'], true);
|
||||
// Date should display as the same date for every user regardless of timezone
|
||||
|
||||
return $user->create_datetime()
|
||||
->setDate($year, $month, $day)
|
||||
->setTime(0, 0, 0)
|
||||
->format($user->lang['DATE_FORMAT'], true);
|
||||
}
|
||||
|
||||
return $value;
|
||||
|
@ -151,7 +151,7 @@ class filespec
|
||||
*/
|
||||
function is_image()
|
||||
{
|
||||
return (strpos($this->mimetype, 'image/') !== false) ? true : false;
|
||||
return (strpos($this->mimetype, 'image/') === 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -756,6 +756,31 @@ class fileupload
|
||||
$filename = $url['path'];
|
||||
$filesize = 0;
|
||||
|
||||
$remote_max_filesize = $this->max_filesize;
|
||||
if (!$remote_max_filesize)
|
||||
{
|
||||
$max_filesize = @ini_get('upload_max_filesize');
|
||||
|
||||
if (!empty($max_filesize))
|
||||
{
|
||||
$unit = strtolower(substr($max_filesize, -1, 1));
|
||||
$remote_max_filesize = (int) $max_filesize;
|
||||
|
||||
switch ($unit)
|
||||
{
|
||||
case 'g':
|
||||
$remote_max_filesize *= 1024;
|
||||
// no break
|
||||
case 'm':
|
||||
$remote_max_filesize *= 1024;
|
||||
// no break
|
||||
case 'k':
|
||||
$remote_max_filesize *= 1024;
|
||||
// no break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$errno = 0;
|
||||
$errstr = '';
|
||||
|
||||
@ -784,9 +809,9 @@ class fileupload
|
||||
$block = @fread($fsock, 1024);
|
||||
$filesize += strlen($block);
|
||||
|
||||
if ($this->max_filesize && $filesize > $this->max_filesize)
|
||||
if ($remote_max_filesize && $filesize > $remote_max_filesize)
|
||||
{
|
||||
$max_filesize = get_formatted_filesize($this->max_filesize, false);
|
||||
$max_filesize = get_formatted_filesize($remote_max_filesize, false);
|
||||
|
||||
$file = new fileerror(sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize['value'], $max_filesize['unit']));
|
||||
return $file;
|
||||
@ -812,9 +837,9 @@ class fileupload
|
||||
{
|
||||
$length = (int) str_replace('content-length: ', '', strtolower($line));
|
||||
|
||||
if ($length && $length > $this->max_filesize)
|
||||
if ($remote_max_filesize && $length && $length > $remote_max_filesize)
|
||||
{
|
||||
$max_filesize = get_formatted_filesize($this->max_filesize, false);
|
||||
$max_filesize = get_formatted_filesize($remote_max_filesize, false);
|
||||
|
||||
$file = new fileerror(sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize['value'], $max_filesize['unit']));
|
||||
return $file;
|
||||
|
@ -197,7 +197,6 @@ function user_add($user_row, $cp_data = false)
|
||||
'user_lastpost_time' => 0,
|
||||
'user_lastpage' => '',
|
||||
'user_posts' => 0,
|
||||
'user_dst' => (int) $config['board_dst'],
|
||||
'user_colour' => '',
|
||||
'user_occ' => '',
|
||||
'user_interests' => '',
|
||||
@ -527,62 +526,12 @@ function user_delete($mode, $user_id, $post_username = false)
|
||||
WHERE session_user_id = ' . $user_id;
|
||||
$db->sql_query($sql);
|
||||
|
||||
// Remove any undelivered mails...
|
||||
$sql = 'SELECT msg_id, user_id
|
||||
FROM ' . PRIVMSGS_TO_TABLE . '
|
||||
WHERE author_id = ' . $user_id . '
|
||||
AND folder_id = ' . PRIVMSGS_NO_BOX;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$undelivered_msg = $undelivered_user = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
// Clean the private messages tables from the user
|
||||
if (!function_exists('phpbb_delete_user_pms'))
|
||||
{
|
||||
$undelivered_msg[] = $row['msg_id'];
|
||||
$undelivered_user[$row['user_id']][] = true;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (sizeof($undelivered_msg))
|
||||
{
|
||||
$sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg);
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
$sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . '
|
||||
WHERE author_id = ' . $user_id . '
|
||||
AND folder_id = ' . PRIVMSGS_NO_BOX;
|
||||
$db->sql_query($sql);
|
||||
|
||||
// Delete all to-information
|
||||
$sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . '
|
||||
WHERE user_id = ' . $user_id;
|
||||
$db->sql_query($sql);
|
||||
|
||||
// Set the remaining author id to anonymous - this way users are still able to read messages from users being removed
|
||||
$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . '
|
||||
SET author_id = ' . ANONYMOUS . '
|
||||
WHERE author_id = ' . $user_id;
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql = 'UPDATE ' . PRIVMSGS_TABLE . '
|
||||
SET author_id = ' . ANONYMOUS . '
|
||||
WHERE author_id = ' . $user_id;
|
||||
$db->sql_query($sql);
|
||||
|
||||
foreach ($undelivered_user as $_user_id => $ary)
|
||||
{
|
||||
if ($_user_id == $user_id)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET user_new_privmsg = user_new_privmsg - ' . sizeof($ary) . ',
|
||||
user_unread_privmsg = user_unread_privmsg - ' . sizeof($ary) . '
|
||||
WHERE user_id = ' . $_user_id;
|
||||
$db->sql_query($sql);
|
||||
include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
|
||||
}
|
||||
phpbb_delete_user_pms($user_id);
|
||||
|
||||
$db->sql_transaction('commit');
|
||||
|
||||
@ -727,8 +676,10 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
||||
if (sizeof($ban_other) == 3 && ((int)$ban_other[0] < 9999) &&
|
||||
(strlen($ban_other[0]) == 4) && (strlen($ban_other[1]) == 2) && (strlen($ban_other[2]) == 2))
|
||||
{
|
||||
$time_offset = (isset($user->timezone) && isset($user->dst)) ? (int) $user->timezone + (int) $user->dst : 0;
|
||||
$ban_end = max($current_time, gmmktime(0, 0, 0, (int)$ban_other[1], (int)$ban_other[2], (int)$ban_other[0]) - $time_offset);
|
||||
$ban_end = max($current_time, $user->create_datetime()
|
||||
->setDate((int) $ban_other[0], (int) $ban_other[1], (int) $ban_other[2])
|
||||
->setTime(0, 0, 0)
|
||||
->getTimestamp() + $user->timezone->getOffset(new DateTime('UTC')));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1297,10 +1248,21 @@ function validate_data($data, $val_ary)
|
||||
$function = array_shift($validate);
|
||||
array_unshift($validate, $data[$var]);
|
||||
|
||||
if ($result = call_user_func_array('validate_' . $function, $validate))
|
||||
if (function_exists('phpbb_validate_' . $function))
|
||||
{
|
||||
// Since errors are checked later for their language file existence, we need to make sure custom errors are not adjusted.
|
||||
$error[] = (empty($user->lang[$result . '_' . strtoupper($var)])) ? $result : $result . '_' . strtoupper($var);
|
||||
if ($result = call_user_func_array('phpbb_validate_' . $function, $validate))
|
||||
{
|
||||
// Since errors are checked later for their language file existence, we need to make sure custom errors are not adjusted.
|
||||
$error[] = (empty($user->lang[$result . '_' . strtoupper($var)])) ? $result : $result . '_' . strtoupper($var);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($result = call_user_func_array('validate_' . $function, $validate))
|
||||
{
|
||||
// Since errors are checked later for their language file existence, we need to make sure custom errors are not adjusted.
|
||||
$error[] = (empty($user->lang[$result . '_' . strtoupper($var)])) ? $result : $result . '_' . strtoupper($var);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1445,6 +1407,22 @@ function validate_language_iso_name($lang_iso)
|
||||
return ($lang_id) ? false : 'WRONG_DATA';
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Timezone Name
|
||||
*
|
||||
* Tests whether a timezone name is valid
|
||||
*
|
||||
* @param string $timezone The timezone string to test
|
||||
*
|
||||
* @return bool|string Either false if validation succeeded or
|
||||
* a string which will be used as the error message
|
||||
* (with the variable name appended)
|
||||
*/
|
||||
function phpbb_validate_timezone($timezone)
|
||||
{
|
||||
return (in_array($timezone, phpbb_get_timezone_identifiers($timezone))) ? false : 'TIMEZONE_INVALID';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to see if the username has been taken, or if it is disallowed.
|
||||
* Also checks if it includes the " character, which we don't allow in usernames.
|
||||
|
@ -101,6 +101,9 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
|
||||
$forum_topics = ($total == -1) ? $forum_info['forum_topics'] : $total;
|
||||
$limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : '';
|
||||
|
||||
$base_url = $url . "&i=$id&action=$action&mode=$mode&sd=$sort_dir&sk=$sort_key&st=$sort_days" . (($merge_select) ? $selected_ids : '');
|
||||
phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $forum_topics, $topics_per_page, $start);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'ACTION' => $action,
|
||||
'FORUM_NAME' => $forum_info['forum_name'],
|
||||
@ -129,8 +132,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
|
||||
|
||||
'S_MCP_ACTION' => $url . "&i=$id&forum_action=$action&mode=$mode&start=$start" . (($merge_select) ? $selected_ids : ''),
|
||||
|
||||
'PAGINATION' => generate_pagination($url . "&i=$id&action=$action&mode=$mode&sd=$sort_dir&sk=$sort_key&st=$sort_days" . (($merge_select) ? $selected_ids : ''), $forum_topics, $topics_per_page, $start),
|
||||
'PAGE_NUMBER' => on_page($forum_topics, $topics_per_page, $start),
|
||||
'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $forum_topics, $topics_per_page, $start),
|
||||
'TOTAL_TOPICS' => $user->lang('VIEW_FORUM_TOPICS', (int) $forum_topics),
|
||||
));
|
||||
|
||||
|
@ -171,10 +171,12 @@ class mcp_logs
|
||||
$log_count = 0;
|
||||
$start = view_log('mod', $log_data, $log_count, $config['topics_per_page'], $start, $forum_list, $topic_id, 0, $sql_where, $sql_sort, $keywords);
|
||||
|
||||
$base_url = $this->u_action . "&$u_sort_param$keywords_param";
|
||||
phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $log_count, $config['topics_per_page'], $start);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'PAGE_NUMBER' => on_page($log_count, $config['topics_per_page'], $start),
|
||||
'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $log_count, $config['topics_per_page'], $start),
|
||||
'TOTAL' => $user->lang('TOTAL_LOGS', (int) $log_count),
|
||||
'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start),
|
||||
|
||||
'L_TITLE' => $user->lang['MCP_LOGS'],
|
||||
|
||||
|
@ -215,6 +215,9 @@ class mcp_notes
|
||||
}
|
||||
}
|
||||
|
||||
$base_url = $this->u_action . "&$u_sort_param$keywords_param";
|
||||
phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $log_count, $config['topics_per_page'], $start);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'U_POST_ACTION' => $this->u_action,
|
||||
'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false,
|
||||
@ -225,8 +228,7 @@ class mcp_notes
|
||||
|
||||
'L_TITLE' => $user->lang['MCP_NOTES_USER'],
|
||||
|
||||
'PAGE_NUMBER' => on_page($log_count, $config['topics_per_page'], $start),
|
||||
'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start),
|
||||
'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $log_count, $config['topics_per_page'], $start),
|
||||
'TOTAL_REPORTS' => $user->lang('LIST_REPORTS', (int) $log_count),
|
||||
|
||||
'RANK_TITLE' => $rank_title,
|
||||
|
@ -297,7 +297,10 @@ class mcp_pm_reports
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$base_url = $this->u_action . "&st=$sort_days&sk=$sort_key&sd=$sort_dir";
|
||||
phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $total, $config['topics_per_page'], $start);
|
||||
|
||||
// Now display the page
|
||||
$template->assign_vars(array(
|
||||
'L_EXPLAIN' => ($mode == 'pm_reports') ? $user->lang['MCP_PM_REPORTS_OPEN_EXPLAIN'] : $user->lang['MCP_PM_REPORTS_CLOSED_EXPLAIN'],
|
||||
@ -307,8 +310,7 @@ class mcp_pm_reports
|
||||
'S_MCP_ACTION' => $this->u_action,
|
||||
'S_CLOSED' => ($mode == 'pm_reports_closed') ? true : false,
|
||||
|
||||
'PAGINATION' => generate_pagination($this->u_action . "&st=$sort_days&sk=$sort_key&sd=$sort_dir", $total, $config['topics_per_page'], $start),
|
||||
'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start),
|
||||
'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $total, $config['topics_per_page'], $start),
|
||||
'TOTAL' => $total,
|
||||
'TOTAL_REPORTS' => $user->lang('LIST_REPORTS', (int) $total),
|
||||
)
|
||||
|
@ -268,8 +268,6 @@ class mcp_queue
|
||||
trigger_error('NOT_MODERATOR');
|
||||
}
|
||||
|
||||
$forum_list = implode(', ', $forum_list);
|
||||
|
||||
$sql = 'SELECT SUM(forum_topics) as sum_forum_topics
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('forum_id', $forum_list);
|
||||
@ -421,6 +419,9 @@ class mcp_queue
|
||||
}
|
||||
unset($rowset, $forum_names);
|
||||
|
||||
$base_url = $this->u_action . "&f=$forum_id&st=$sort_days&sk=$sort_key&sd=$sort_dir";
|
||||
phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $total, $config['topics_per_page'], $start);
|
||||
|
||||
// Now display the page
|
||||
$template->assign_vars(array(
|
||||
'L_DISPLAY_ITEMS' => ($mode == 'unapproved_posts') ? $user->lang['DISPLAY_POSTS'] : $user->lang['DISPLAY_TOPICS'],
|
||||
@ -432,8 +433,7 @@ class mcp_queue
|
||||
'S_MCP_ACTION' => build_url(array('t', 'f', 'sd', 'st', 'sk')),
|
||||
'S_TOPICS' => ($mode == 'unapproved_posts') ? false : true,
|
||||
|
||||
'PAGINATION' => generate_pagination($this->u_action . "&f=$forum_id&st=$sort_days&sk=$sort_key&sd=$sort_dir", $total, $config['topics_per_page'], $start),
|
||||
'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start),
|
||||
'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $total, $config['topics_per_page'], $start),
|
||||
'TOPIC_ID' => $topic_id,
|
||||
'TOTAL' => $user->lang((($mode == 'unapproved_posts') ? 'VIEW_TOPIC_POSTS' : 'VIEW_FORUM_TOPICS'), (int) $total),
|
||||
));
|
||||
|
@ -411,6 +411,9 @@ class mcp_reports
|
||||
unset($report_ids, $row);
|
||||
}
|
||||
|
||||
$base_url = $this->u_action . "&f=$forum_id&t=$topic_id&st=$sort_days&sk=$sort_key&sd=$sort_dir";
|
||||
phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $total, $config['topics_per_page'], $start);
|
||||
|
||||
// Now display the page
|
||||
$template->assign_vars(array(
|
||||
'L_EXPLAIN' => ($mode == 'reports') ? $user->lang['MCP_REPORTS_OPEN_EXPLAIN'] : $user->lang['MCP_REPORTS_CLOSED_EXPLAIN'],
|
||||
@ -421,8 +424,7 @@ class mcp_reports
|
||||
'S_FORUM_OPTIONS' => $forum_options,
|
||||
'S_CLOSED' => ($mode == 'reports_closed') ? true : false,
|
||||
|
||||
'PAGINATION' => generate_pagination($this->u_action . "&f=$forum_id&t=$topic_id&st=$sort_days&sk=$sort_key&sd=$sort_dir", $total, $config['topics_per_page'], $start),
|
||||
'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start),
|
||||
'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $total, $config['topics_per_page'], $start),
|
||||
'TOPIC_ID' => $topic_id,
|
||||
'TOTAL' => $total,
|
||||
'TOTAL_REPORTS' => $user->lang('LIST_REPORTS', (int) $total),
|
||||
|
@ -306,6 +306,12 @@ function mcp_topic_view($id, $mode, $action)
|
||||
'post_ids' => $post_id_list,
|
||||
));
|
||||
|
||||
$base_url = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&t={$topic_info['topic_id']}&mode=$mode&action=$action&to_topic_id=$to_topic_id&posts_per_page=$posts_per_page&st=$sort_days&sk=$sort_key&sd=$sort_dir");
|
||||
if ($posts_per_page)
|
||||
{
|
||||
phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $total, $posts_per_page, $start);
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'TOPIC_TITLE' => $topic_info['topic_title'],
|
||||
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $topic_info['forum_id'] . '&t=' . $topic_info['topic_id']),
|
||||
@ -344,8 +350,7 @@ function mcp_topic_view($id, $mode, $action)
|
||||
'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$topic_info['forum_id']}&t={$topic_info['topic_id']}&start=$start") . '">', '</a>'),
|
||||
'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f={$topic_info['forum_id']}&start=$start") . '">', '</a>'),
|
||||
|
||||
'PAGE_NUMBER' => on_page($total, $posts_per_page, $start),
|
||||
'PAGINATION' => (!$posts_per_page) ? '' : generate_pagination(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&t={$topic_info['topic_id']}&mode=$mode&action=$action&to_topic_id=$to_topic_id&posts_per_page=$posts_per_page&st=$sort_days&sk=$sort_key&sd=$sort_dir"), $total, $posts_per_page, $start),
|
||||
'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $total, $posts_per_page, $start),
|
||||
'TOTAL_POSTS' => $user->lang('VIEW_TOPIC_POSTS', (int) $total),
|
||||
));
|
||||
}
|
||||
|
@ -175,6 +175,9 @@ class mcp_warn
|
||||
));
|
||||
}
|
||||
|
||||
$base_url = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=warn&mode=list&st=$st&sk=$sk&sd=$sd");
|
||||
phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $user_count, $config['topics_per_page'], $start);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'U_POST_ACTION' => $this->u_action,
|
||||
'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false,
|
||||
@ -182,8 +185,7 @@ class mcp_warn
|
||||
'S_SELECT_SORT_KEY' => $s_sort_key,
|
||||
'S_SELECT_SORT_DAYS' => $s_limit_days,
|
||||
|
||||
'PAGE_NUMBER' => on_page($user_count, $config['topics_per_page'], $start),
|
||||
'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=warn&mode=list&st=$st&sk=$sk&sd=$sd"), $user_count, $config['topics_per_page'], $start),
|
||||
'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $user_count, $config['topics_per_page'], $start),
|
||||
'TOTAL_USERS' => $user->lang('LIST_USERS', (int) $user_count),
|
||||
));
|
||||
}
|
||||
@ -307,7 +309,7 @@ class mcp_warn
|
||||
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
||||
}
|
||||
|
||||
$rank_title = $rank_img = '';
|
||||
get_user_rank($user_row['user_rank'], $user_row['user_posts'], $rank_title, $rank_img, $rank_img_src);
|
||||
$avatar_img = get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']);
|
||||
|
||||
$template->assign_vars(array(
|
||||
@ -412,7 +414,7 @@ class mcp_warn
|
||||
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
||||
}
|
||||
|
||||
$rank_title = $rank_img = '';
|
||||
get_user_rank($user_row['user_rank'], $user_row['user_posts'], $rank_title, $rank_img, $rank_img_src);
|
||||
$avatar_img = get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']);
|
||||
|
||||
// OK, they didn't submit a warning so lets build the page for them to do so
|
||||
|
175
phpBB/includes/php/ini.php
Normal file
175
phpBB/includes/php/ini.php
Normal file
@ -0,0 +1,175 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package phpBB
|
||||
* @copyright (c) 2011 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper class for ini_get function.
|
||||
*
|
||||
* Provides easier handling of the different interpretations of ini values.
|
||||
*
|
||||
* @package phpBB
|
||||
*/
|
||||
class phpbb_php_ini
|
||||
{
|
||||
/**
|
||||
* Simple wrapper for ini_get()
|
||||
* See http://php.net/manual/en/function.ini-get.php
|
||||
*
|
||||
* @param string $varname The configuration option name.
|
||||
* @return bool|string False if configuration option does not exist,
|
||||
* the configuration option value (string) otherwise.
|
||||
*/
|
||||
public function get($varname)
|
||||
{
|
||||
return ini_get($varname);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the configuration option value as a trimmed string.
|
||||
*
|
||||
* @param string $varname The configuration option name.
|
||||
* @return bool|string False if configuration option does not exist,
|
||||
* the configuration option value (string) otherwise.
|
||||
*/
|
||||
public function get_string($varname)
|
||||
{
|
||||
$value = $this->get($varname);
|
||||
|
||||
if ($value === false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return trim($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets configuration option value as a boolean.
|
||||
* Interprets the string value 'off' as false.
|
||||
*
|
||||
* @param string $varname The configuration option name.
|
||||
* @return bool False if configuration option does not exist.
|
||||
* False if configuration option is disabled.
|
||||
* True otherwise.
|
||||
*/
|
||||
public function get_bool($varname)
|
||||
{
|
||||
$value = $this->get_string($varname);
|
||||
|
||||
if (empty($value) || strtolower($value) == 'off')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets configuration option value as an integer.
|
||||
*
|
||||
* @param string $varname The configuration option name.
|
||||
* @return bool|int False if configuration option does not exist,
|
||||
* false if configuration option value is not numeric,
|
||||
* the configuration option value (integer) otherwise.
|
||||
*/
|
||||
public function get_int($varname)
|
||||
{
|
||||
$value = $this->get_string($varname);
|
||||
|
||||
if (!is_numeric($value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return (int) $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets configuration option value as a float.
|
||||
*
|
||||
* @param string $varname The configuration option name.
|
||||
* @return bool|float False if configuration option does not exist,
|
||||
* false if configuration option value is not numeric,
|
||||
* the configuration option value (float) otherwise.
|
||||
*/
|
||||
public function get_float($varname)
|
||||
{
|
||||
$value = $this->get_string($varname);
|
||||
|
||||
if (!is_numeric($value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return (float) $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets configuration option value in bytes.
|
||||
* Converts strings like '128M' to bytes (integer or float).
|
||||
*
|
||||
* @param string $varname The configuration option name.
|
||||
* @return bool|int|float False if configuration option does not exist,
|
||||
* false if configuration option value is not well-formed,
|
||||
* the configuration option value otherwise.
|
||||
*/
|
||||
public function get_bytes($varname)
|
||||
{
|
||||
$value = $this->get_string($varname);
|
||||
|
||||
if ($value === false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_numeric($value))
|
||||
{
|
||||
// Already in bytes.
|
||||
return phpbb_to_numeric($value);
|
||||
}
|
||||
else if (strlen($value) < 2)
|
||||
{
|
||||
// Single character.
|
||||
return false;
|
||||
}
|
||||
else if (strlen($value) < 3 && $value[0] === '-')
|
||||
{
|
||||
// Two characters but the first one is a minus.
|
||||
return false;
|
||||
}
|
||||
|
||||
$value_lower = strtolower($value);
|
||||
$value_numeric = phpbb_to_numeric($value);
|
||||
|
||||
switch ($value_lower[strlen($value_lower) - 1])
|
||||
{
|
||||
case 'g':
|
||||
$value_numeric *= 1024;
|
||||
case 'm':
|
||||
$value_numeric *= 1024;
|
||||
case 'k':
|
||||
$value_numeric *= 1024;
|
||||
break;
|
||||
|
||||
default:
|
||||
// It's not already in bytes (and thus numeric)
|
||||
// and does not carry a unit.
|
||||
return false;
|
||||
}
|
||||
|
||||
return $value_numeric;
|
||||
}
|
||||
}
|
@ -304,7 +304,6 @@ class phpbb_questionnaire_phpbb_data_provider
|
||||
'avatar_max_width' => true,
|
||||
'avatar_min_height' => true,
|
||||
'avatar_min_width' => true,
|
||||
'board_dst' => true,
|
||||
'board_email_form' => true,
|
||||
'board_hide_emails' => true,
|
||||
'board_timezone' => true,
|
||||
|
@ -27,8 +27,6 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
|
||||
var $split_words = array();
|
||||
var $search_query;
|
||||
var $common_words = array();
|
||||
var $pcre_properties = false;
|
||||
var $mbstring_regex = false;
|
||||
|
||||
public function __construct(&$error)
|
||||
{
|
||||
@ -36,18 +34,6 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
|
||||
|
||||
$this->word_length = array('min' => $config['fulltext_mysql_min_word_len'], 'max' => $config['fulltext_mysql_max_word_len']);
|
||||
|
||||
// PHP may not be linked with the bundled PCRE lib and instead with an older version
|
||||
if (phpbb_pcre_utf8_support())
|
||||
{
|
||||
$this->pcre_properties = true;
|
||||
}
|
||||
|
||||
if (function_exists('mb_ereg'))
|
||||
{
|
||||
$this->mbstring_regex = true;
|
||||
mb_regex_encoding('UTF-8');
|
||||
}
|
||||
|
||||
$error = false;
|
||||
}
|
||||
|
||||
@ -70,7 +56,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
|
||||
|
||||
if ($db->sql_layer != 'mysql4' && $db->sql_layer != 'mysqli')
|
||||
{
|
||||
return $user->lang['FULLTEXT_MYSQL_INCOMPATIBLE_VERSION'];
|
||||
return $user->lang['FULLTEXT_MYSQL_INCOMPATIBLE_DATABASE'];
|
||||
}
|
||||
|
||||
$result = $db->sql_query('SHOW TABLE STATUS LIKE \'' . POSTS_TABLE . '\'');
|
||||
@ -133,40 +119,10 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
|
||||
$split_keywords = preg_replace("#[\n\r\t]+#", ' ', trim(htmlspecialchars_decode($keywords)));
|
||||
|
||||
// Split words
|
||||
if ($this->pcre_properties)
|
||||
{
|
||||
$split_keywords = preg_replace('#([^\p{L}\p{N}\'*"()])#u', '$1$1', str_replace('\'\'', '\' \'', trim($split_keywords)));
|
||||
}
|
||||
else if ($this->mbstring_regex)
|
||||
{
|
||||
$split_keywords = mb_ereg_replace('([^\w\'*"()])', '\\1\\1', str_replace('\'\'', '\' \'', trim($split_keywords)));
|
||||
}
|
||||
else
|
||||
{
|
||||
$split_keywords = preg_replace('#([^\w\'*"()])#u', '$1$1', str_replace('\'\'', '\' \'', trim($split_keywords)));
|
||||
}
|
||||
|
||||
if ($this->pcre_properties)
|
||||
{
|
||||
$matches = array();
|
||||
preg_match_all('#(?:[^\p{L}\p{N}*"()]|^)([+\-|]?(?:[\p{L}\p{N}*"()]+\'?)*[\p{L}\p{N}*"()])(?:[^\p{L}\p{N}*"()]|$)#u', $split_keywords, $matches);
|
||||
$this->split_words = $matches[1];
|
||||
}
|
||||
else if ($this->mbstring_regex)
|
||||
{
|
||||
mb_ereg_search_init($split_keywords, '(?:[^\w*"()]|^)([+\-|]?(?:[\w*"()]+\'?)*[\w*"()])(?:[^\w*"()]|$)');
|
||||
|
||||
while (($word = mb_ereg_search_regs()))
|
||||
{
|
||||
$this->split_words[] = $word[1];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$matches = array();
|
||||
preg_match_all('#(?:[^\w*"()]|^)([+\-|]?(?:[\w*"()]+\'?)*[\w*"()])(?:[^\w*"()]|$)#u', $split_keywords, $matches);
|
||||
$this->split_words = $matches[1];
|
||||
}
|
||||
$split_keywords = preg_replace('#([^\p{L}\p{N}\'*"()])#u', '$1$1', str_replace('\'\'', '\' \'', trim($split_keywords)));
|
||||
$matches = array();
|
||||
preg_match_all('#(?:[^\p{L}\p{N}*"()]|^)([+\-|]?(?:[\p{L}\p{N}*"()]+\'?)*[\p{L}\p{N}*"()])(?:[^\p{L}\p{N}*"()]|$)#u', $split_keywords, $matches);
|
||||
$this->split_words = $matches[1];
|
||||
|
||||
// We limit the number of allowed keywords to minimize load on the database
|
||||
if ($config['max_num_search_keywords'] && sizeof($this->split_words) > $config['max_num_search_keywords'])
|
||||
@ -271,41 +227,10 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
|
||||
global $config;
|
||||
|
||||
// Split words
|
||||
if ($this->pcre_properties)
|
||||
{
|
||||
$text = preg_replace('#([^\p{L}\p{N}\'*])#u', '$1$1', str_replace('\'\'', '\' \'', trim($text)));
|
||||
}
|
||||
else if ($this->mbstring_regex)
|
||||
{
|
||||
$text = mb_ereg_replace('([^\w\'*])', '\\1\\1', str_replace('\'\'', '\' \'', trim($text)));
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = preg_replace('#([^\w\'*])#u', '$1$1', str_replace('\'\'', '\' \'', trim($text)));
|
||||
}
|
||||
|
||||
if ($this->pcre_properties)
|
||||
{
|
||||
$matches = array();
|
||||
preg_match_all('#(?:[^\p{L}\p{N}*]|^)([+\-|]?(?:[\p{L}\p{N}*]+\'?)*[\p{L}\p{N}*])(?:[^\p{L}\p{N}*]|$)#u', $text, $matches);
|
||||
$text = $matches[1];
|
||||
}
|
||||
else if ($this->mbstring_regex)
|
||||
{
|
||||
mb_ereg_search_init($text, '(?:[^\w*]|^)([+\-|]?(?:[\w*]+\'?)*[\w*])(?:[^\w*]|$)');
|
||||
|
||||
$text = array();
|
||||
while (($word = mb_ereg_search_regs()))
|
||||
{
|
||||
$text[] = $word[1];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$matches = array();
|
||||
preg_match_all('#(?:[^\w*]|^)([+\-|]?(?:[\w*]+\'?)*[\w*])(?:[^\w*]|$)#u', $text, $matches);
|
||||
$text = $matches[1];
|
||||
}
|
||||
$text = preg_replace('#([^\p{L}\p{N}\'*])#u', '$1$1', str_replace('\'\'', '\' \'', trim($text)));
|
||||
$matches = array();
|
||||
preg_match_all('#(?:[^\p{L}\p{N}*]|^)([+\-|]?(?:[\p{L}\p{N}*]+\'?)*[\p{L}\p{N}*])(?:[^\p{L}\p{N}*]|$)#u', $text, $matches);
|
||||
$text = $matches[1];
|
||||
|
||||
// remove too short or too long words
|
||||
$text = array_values($text);
|
||||
@ -748,7 +673,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
|
||||
{
|
||||
if ($db->sql_layer == 'mysqli' || version_compare($db->sql_server_info(true), '4.1.3', '>='))
|
||||
{
|
||||
//$alter[] = 'MODIFY post_subject varchar(100) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL';
|
||||
$alter[] = 'MODIFY post_subject varchar(255) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -908,14 +833,6 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
|
||||
global $user, $config;
|
||||
|
||||
$tpl = '
|
||||
<dl>
|
||||
<dt><label>' . $user->lang['FULLTEXT_MYSQL_PCRE'] . '</label><br /><span>' . $user->lang['FULLTEXT_MYSQL_PCRE_EXPLAIN'] . '</span></dt>
|
||||
<dd>' . (($this->pcre_properties) ? $user->lang['YES'] : $user->lang['NO']) . ' (PHP ' . PHP_VERSION . ')</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label>' . $user->lang['FULLTEXT_MYSQL_MBSTRING'] . '</label><br /><span>' . $user->lang['FULLTEXT_MYSQL_MBSTRING_EXPLAIN'] . '</span></dt>
|
||||
<dd>' . (($this->mbstring_regex) ? $user->lang['YES'] : $user->lang['NO']). '</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label>' . $user->lang['MIN_SEARCH_CHARS'] . ':</label><br /><span>' . $user->lang['FULLTEXT_MYSQL_MIN_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
|
||||
<dd>' . $config['fulltext_mysql_min_word_len'] . '</dd>
|
||||
|
856
phpBB/includes/search/fulltext_postgres.php
Normal file
856
phpBB/includes/search/fulltext_postgres.php
Normal file
@ -0,0 +1,856 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package search
|
||||
* @copyright (c) 2005 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* fulltext_postgres
|
||||
* Fulltext search for PostgreSQL
|
||||
* @package search
|
||||
*/
|
||||
class phpbb_search_fulltext_postgres extends phpbb_search_base
|
||||
{
|
||||
private $stats = array();
|
||||
private $split_words = array();
|
||||
private $tsearch_usable = false;
|
||||
private $version;
|
||||
private $tsearch_query;
|
||||
private $phrase_search = false;
|
||||
public $search_query;
|
||||
public $common_words = array();
|
||||
public $word_length = array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* Creates a new phpbb_search_fulltext_postgres, which is used as a search backend.
|
||||
*
|
||||
* @param string|bool $error Any error that occurs is passed on through this reference variable otherwise false
|
||||
*/
|
||||
public function __construct(&$error)
|
||||
{
|
||||
global $db, $config;
|
||||
|
||||
$this->word_length = array('min' => $config['fulltext_postgres_min_word_len'], 'max' => $config['fulltext_postgres_max_word_len']);
|
||||
|
||||
|
||||
if ($db->sql_layer == 'postgres')
|
||||
{
|
||||
$pgsql_version = explode(',', substr($db->sql_server_info(), 10));
|
||||
$this->version = trim($pgsql_version[0]);
|
||||
if (version_compare($this->version, '8.3', '>='))
|
||||
{
|
||||
$this->tsearch_usable = true;
|
||||
}
|
||||
}
|
||||
|
||||
$error = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of this search backend to be displayed to administrators
|
||||
*
|
||||
* @return string Name
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function get_name()
|
||||
{
|
||||
return 'PostgreSQL Fulltext';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if phrase search is supported or not
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function supports_phrase_search()
|
||||
{
|
||||
return $this->phrase_search;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for correct PostgreSQL version and stores min/max word length in the config
|
||||
*
|
||||
* @return string|bool Language key of the error/incompatiblity occured
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
global $db, $user;
|
||||
|
||||
if ($db->sql_layer != 'postgres')
|
||||
{
|
||||
return $user->lang['FULLTEXT_POSTGRES_INCOMPATIBLE_DATABASE'];
|
||||
}
|
||||
|
||||
if (!$this->tsearch_usable)
|
||||
{
|
||||
return $user->lang['FULLTEXT_POSTGRES_TS_NOT_USABLE'];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Splits keywords entered by a user into an array of words stored in $this->split_words
|
||||
* Stores the tidied search query in $this->search_query
|
||||
*
|
||||
* @param string &$keywords Contains the keyword as entered by the user
|
||||
* @param string $terms is either 'all' or 'any'
|
||||
* @return bool false if no valid keywords were found and otherwise true
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function split_keywords(&$keywords, $terms)
|
||||
{
|
||||
global $config;
|
||||
|
||||
if ($terms == 'all')
|
||||
{
|
||||
$match = array('#\sand\s#iu', '#\sor\s#iu', '#\snot\s#iu', '#\+#', '#-#', '#\|#');
|
||||
$replace = array(' +', ' |', ' -', ' +', ' -', ' |');
|
||||
|
||||
$keywords = preg_replace($match, $replace, $keywords);
|
||||
}
|
||||
|
||||
// Filter out as above
|
||||
$split_keywords = preg_replace("#[\"\n\r\t]+#", ' ', trim(htmlspecialchars_decode($keywords)));
|
||||
|
||||
// Split words
|
||||
$split_keywords = preg_replace('#([^\p{L}\p{N}\'*"()])#u', '$1$1', str_replace('\'\'', '\' \'', trim($split_keywords)));
|
||||
$matches = array();
|
||||
preg_match_all('#(?:[^\p{L}\p{N}*"()]|^)([+\-|]?(?:[\p{L}\p{N}*"()]+\'?)*[\p{L}\p{N}*"()])(?:[^\p{L}\p{N}*"()]|$)#u', $split_keywords, $matches);
|
||||
$this->split_words = $matches[1];
|
||||
|
||||
foreach ($this->split_words as $i => $word)
|
||||
{
|
||||
$clean_word = preg_replace('#^[+\-|"]#', '', $word);
|
||||
|
||||
// check word length
|
||||
$clean_len = utf8_strlen(str_replace('*', '', $clean_word));
|
||||
if (($clean_len < $config['fulltext_postgres_min_word_len']) || ($clean_len > $config['fulltext_postgres_max_word_len']))
|
||||
{
|
||||
$this->common_words[] = $word;
|
||||
unset($this->split_words[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
if ($terms == 'any')
|
||||
{
|
||||
$this->search_query = '';
|
||||
$this->tsearch_query = '';
|
||||
foreach ($this->split_words as $word)
|
||||
{
|
||||
if ((strpos($word, '+') === 0) || (strpos($word, '-') === 0) || (strpos($word, '|') === 0))
|
||||
{
|
||||
$word = substr($word, 1);
|
||||
}
|
||||
$this->search_query .= $word . ' ';
|
||||
$this->tsearch_query .= '|' . $word . ' ';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->search_query = '';
|
||||
$this->tsearch_query = '';
|
||||
foreach ($this->split_words as $word)
|
||||
{
|
||||
if (strpos($word, '+') === 0)
|
||||
{
|
||||
$this->search_query .= $word . ' ';
|
||||
$this->tsearch_query .= '&' . substr($word, 1) . ' ';
|
||||
}
|
||||
elseif (strpos($word, '-') === 0)
|
||||
{
|
||||
$this->search_query .= $word . ' ';
|
||||
$this->tsearch_query .= '&!' . substr($word, 1) . ' ';
|
||||
}
|
||||
elseif (strpos($word, '|') === 0)
|
||||
{
|
||||
$this->search_query .= $word . ' ';
|
||||
$this->tsearch_query .= '|' . substr($word, 1) . ' ';
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->search_query .= '+' . $word . ' ';
|
||||
$this->tsearch_query .= '&' . $word . ' ';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->tsearch_query = substr($this->tsearch_query, 1);
|
||||
$this->search_query = utf8_htmlspecialchars($this->search_query);
|
||||
|
||||
if ($this->search_query)
|
||||
{
|
||||
$this->split_words = array_values($this->split_words);
|
||||
sort($this->split_words);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns text into an array of words
|
||||
* @param string $text contains post text/subject
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function split_message($text)
|
||||
{
|
||||
global $config;
|
||||
|
||||
// Split words
|
||||
$text = preg_replace('#([^\p{L}\p{N}\'*])#u', '$1$1', str_replace('\'\'', '\' \'', trim($text)));
|
||||
$matches = array();
|
||||
preg_match_all('#(?:[^\p{L}\p{N}*]|^)([+\-|]?(?:[\p{L}\p{N}*]+\'?)*[\p{L}\p{N}*])(?:[^\p{L}\p{N}*]|$)#u', $text, $matches);
|
||||
$text = $matches[1];
|
||||
|
||||
// remove too short or too long words
|
||||
$text = array_values($text);
|
||||
for ($i = 0, $n = sizeof($text); $i < $n; $i++)
|
||||
{
|
||||
$text[$i] = trim($text[$i]);
|
||||
if (utf8_strlen($text[$i]) < $config['fulltext_postgres_min_word_len'] || utf8_strlen($text[$i]) > $config['fulltext_postgres_max_word_len'])
|
||||
{
|
||||
unset($text[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
return array_values($text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a search on keywords depending on display specific params. You have to run split_keywords() first.
|
||||
*
|
||||
* @param string $type contains either posts or topics depending on what should be searched for
|
||||
* @param string $fields contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched)
|
||||
* @param string $terms is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words)
|
||||
* @param array $sort_by_sql contains SQL code for the ORDER BY part of a query
|
||||
* @param string $sort_key is the key of $sort_by_sql for the selected sorting
|
||||
* @param string $sort_dir is either a or d representing ASC and DESC
|
||||
* @param string $sort_days specifies the maximum amount of days a post may be old
|
||||
* @param array $ex_fid_ary specifies an array of forum ids which should not be searched
|
||||
* @param array $m_approve_fid_ary specifies an array of forum ids in which the searcher is allowed to view unapproved posts
|
||||
* @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
|
||||
* @param array $author_ary an array of author ids if the author should be ignored during the search the array is empty
|
||||
* @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
|
||||
* @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
|
||||
* @param int $start indicates the first index of the page
|
||||
* @param int $per_page number of ids each page is supposed to contain
|
||||
* @return boolean|int total number of results
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page)
|
||||
{
|
||||
global $config, $db;
|
||||
|
||||
// No keywords? No posts.
|
||||
if (!$this->search_query)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// generate a search_key from all the options to identify the results
|
||||
$search_key = md5(implode('#', array(
|
||||
implode(', ', $this->split_words),
|
||||
$type,
|
||||
$fields,
|
||||
$terms,
|
||||
$sort_days,
|
||||
$sort_key,
|
||||
$topic_id,
|
||||
implode(',', $ex_fid_ary),
|
||||
implode(',', $m_approve_fid_ary),
|
||||
implode(',', $author_ary)
|
||||
)));
|
||||
|
||||
// try reading the results from cache
|
||||
$result_count = 0;
|
||||
if ($this->obtain_ids($search_key, $result_count, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE)
|
||||
{
|
||||
return $result_count;
|
||||
}
|
||||
|
||||
$id_ary = array();
|
||||
|
||||
$join_topic = ($type == 'posts') ? false : true;
|
||||
|
||||
// Build sql strings for sorting
|
||||
$sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
|
||||
$sql_sort_table = $sql_sort_join = '';
|
||||
|
||||
switch ($sql_sort[0])
|
||||
{
|
||||
case 'u':
|
||||
$sql_sort_table = USERS_TABLE . ' u, ';
|
||||
$sql_sort_join = ($type == 'posts') ? ' AND u.user_id = p.poster_id ' : ' AND u.user_id = t.topic_poster ';
|
||||
break;
|
||||
|
||||
case 't':
|
||||
$join_topic = true;
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
$sql_sort_table = FORUMS_TABLE . ' f, ';
|
||||
$sql_sort_join = ' AND f.forum_id = p.forum_id ';
|
||||
break;
|
||||
}
|
||||
|
||||
// Build some display specific sql strings
|
||||
switch ($fields)
|
||||
{
|
||||
case 'titleonly':
|
||||
$sql_match = 'p.post_subject';
|
||||
$sql_match_where = ' AND p.post_id = t.topic_first_post_id';
|
||||
$join_topic = true;
|
||||
break;
|
||||
|
||||
case 'msgonly':
|
||||
$sql_match = 'p.post_text';
|
||||
$sql_match_where = '';
|
||||
break;
|
||||
|
||||
case 'firstpost':
|
||||
$sql_match = 'p.post_subject, p.post_text';
|
||||
$sql_match_where = ' AND p.post_id = t.topic_first_post_id';
|
||||
$join_topic = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
$sql_match = 'p.post_subject, p.post_text';
|
||||
$sql_match_where = '';
|
||||
break;
|
||||
}
|
||||
|
||||
if (!sizeof($m_approve_fid_ary))
|
||||
{
|
||||
$m_approve_fid_sql = ' AND p.post_approved = 1';
|
||||
}
|
||||
else if ($m_approve_fid_ary === array(-1))
|
||||
{
|
||||
$m_approve_fid_sql = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
|
||||
}
|
||||
|
||||
$sql_select = ($type == 'posts') ? 'p.post_id' : 'DISTINCT t.topic_id';
|
||||
$sql_from = ($join_topic) ? TOPICS_TABLE . ' t, ' : '';
|
||||
$field = ($type == 'posts') ? 'post_id' : 'topic_id';
|
||||
$sql_author = (sizeof($author_ary) == 1) ? ' = ' . $author_ary[0] : 'IN (' . implode(', ', $author_ary) . ')';
|
||||
|
||||
if (sizeof($author_ary) && $author_name)
|
||||
{
|
||||
// first one matches post of registered users, second one guests and deleted users
|
||||
$sql_author = '(' . $db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
|
||||
}
|
||||
else if (sizeof($author_ary))
|
||||
{
|
||||
$sql_author = ' AND ' . $db->sql_in_set('p.poster_id', $author_ary);
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql_author = '';
|
||||
}
|
||||
|
||||
$sql_where_options = $sql_sort_join;
|
||||
$sql_where_options .= ($topic_id) ? ' AND p.topic_id = ' . $topic_id : '';
|
||||
$sql_where_options .= ($join_topic) ? ' AND t.topic_id = p.topic_id' : '';
|
||||
$sql_where_options .= (sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
|
||||
$sql_where_options .= $m_approve_fid_sql;
|
||||
$sql_where_options .= $sql_author;
|
||||
$sql_where_options .= ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
|
||||
$sql_where_options .= $sql_match_where;
|
||||
|
||||
$tmp_sql_match = array();
|
||||
foreach (explode(',', $sql_match) as $sql_match_column)
|
||||
{
|
||||
$tmp_sql_match[] = "to_tsvector ('" . $db->sql_escape($config['fulltext_postgres_ts_name']) . "', " . $sql_match_column . ") @@ to_tsquery ('" . $db->sql_escape($config['fulltext_postgres_ts_name']) . "', '" . $db->sql_escape($this->tsearch_query) . "')";
|
||||
}
|
||||
|
||||
$sql = "SELECT $sql_select
|
||||
FROM $sql_from$sql_sort_table" . POSTS_TABLE . " p
|
||||
WHERE (" . implode(' OR ', $tmp_sql_match) . ")
|
||||
$sql_where_options
|
||||
ORDER BY $sql_sort";
|
||||
$result = $db->sql_query_limit($sql, $config['search_block_size'], $start);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$id_ary[] = $row[$field];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$id_ary = array_unique($id_ary);
|
||||
|
||||
if (!sizeof($id_ary))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// if the total result count is not cached yet, retrieve it from the db
|
||||
if (!$result_count)
|
||||
{
|
||||
$result_count = sizeof ($id_ary);
|
||||
|
||||
if (!$result_count)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page
|
||||
$this->save_ids($search_key, implode(' ', $this->split_words), $author_ary, $result_count, $id_ary, $start, $sort_dir);
|
||||
$id_ary = array_slice($id_ary, 0, (int) $per_page);
|
||||
|
||||
return $result_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a search on an author's posts without caring about message contents. Depends on display specific params
|
||||
*
|
||||
* @param string $type contains either posts or topics depending on what should be searched for
|
||||
* @param boolean $firstpost_only if true, only topic starting posts will be considered
|
||||
* @param array $sort_by_sql contains SQL code for the ORDER BY part of a query
|
||||
* @param string $sort_key is the key of $sort_by_sql for the selected sorting
|
||||
* @param string $sort_dir is either a or d representing ASC and DESC
|
||||
* @param string $sort_days specifies the maximum amount of days a post may be old
|
||||
* @param array $ex_fid_ary specifies an array of forum ids which should not be searched
|
||||
* @param array $m_approve_fid_ary specifies an array of forum ids in which the searcher is allowed to view unapproved posts
|
||||
* @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
|
||||
* @param array $author_ary an array of author ids
|
||||
* @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
|
||||
* @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
|
||||
* @param int $start indicates the first index of the page
|
||||
* @param int $per_page number of ids each page is supposed to contain
|
||||
* @return boolean|int total number of results
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page)
|
||||
{
|
||||
global $config, $db;
|
||||
|
||||
// No author? No posts.
|
||||
if (!sizeof($author_ary))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// generate a search_key from all the options to identify the results
|
||||
$search_key = md5(implode('#', array(
|
||||
'',
|
||||
$type,
|
||||
($firstpost_only) ? 'firstpost' : '',
|
||||
'',
|
||||
'',
|
||||
$sort_days,
|
||||
$sort_key,
|
||||
$topic_id,
|
||||
implode(',', $ex_fid_ary),
|
||||
implode(',', $m_approve_fid_ary),
|
||||
implode(',', $author_ary),
|
||||
$author_name,
|
||||
)));
|
||||
|
||||
// try reading the results from cache
|
||||
$result_count = 0;
|
||||
if ($this->obtain_ids($search_key, $result_count, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE)
|
||||
{
|
||||
return $result_count;
|
||||
}
|
||||
|
||||
$id_ary = array();
|
||||
|
||||
// Create some display specific sql strings
|
||||
if ($author_name)
|
||||
{
|
||||
// first one matches post of registered users, second one guests and deleted users
|
||||
$sql_author = '(' . $db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql_author = $db->sql_in_set('p.poster_id', $author_ary);
|
||||
}
|
||||
$sql_fora = (sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
|
||||
$sql_topic_id = ($topic_id) ? ' AND p.topic_id = ' . (int) $topic_id : '';
|
||||
$sql_time = ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
|
||||
$sql_firstpost = ($firstpost_only) ? ' AND p.post_id = t.topic_first_post_id' : '';
|
||||
|
||||
// Build sql strings for sorting
|
||||
$sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
|
||||
$sql_sort_table = $sql_sort_join = '';
|
||||
switch ($sql_sort[0])
|
||||
{
|
||||
case 'u':
|
||||
$sql_sort_table = USERS_TABLE . ' u, ';
|
||||
$sql_sort_join = ($type == 'posts') ? ' AND u.user_id = p.poster_id ' : ' AND u.user_id = t.topic_poster ';
|
||||
break;
|
||||
|
||||
case 't':
|
||||
$sql_sort_table = ($type == 'posts' && !$firstpost_only) ? TOPICS_TABLE . ' t, ' : '';
|
||||
$sql_sort_join = ($type == 'posts' && !$firstpost_only) ? ' AND t.topic_id = p.topic_id ' : '';
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
$sql_sort_table = FORUMS_TABLE . ' f, ';
|
||||
$sql_sort_join = ' AND f.forum_id = p.forum_id ';
|
||||
break;
|
||||
}
|
||||
|
||||
if (!sizeof($m_approve_fid_ary))
|
||||
{
|
||||
$m_approve_fid_sql = ' AND p.post_approved = 1';
|
||||
}
|
||||
else if ($m_approve_fid_ary == array(-1))
|
||||
{
|
||||
$m_approve_fid_sql = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
|
||||
}
|
||||
|
||||
// Build the query for really selecting the post_ids
|
||||
if ($type == 'posts')
|
||||
{
|
||||
$sql = "SELECT p.post_id
|
||||
FROM " . $sql_sort_table . POSTS_TABLE . ' p' . (($firstpost_only) ? ', ' . TOPICS_TABLE . ' t ' : ' ') . "
|
||||
WHERE $sql_author
|
||||
$sql_topic_id
|
||||
$sql_firstpost
|
||||
$m_approve_fid_sql
|
||||
$sql_fora
|
||||
$sql_sort_join
|
||||
$sql_time
|
||||
ORDER BY $sql_sort";
|
||||
$field = 'post_id';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "SELECT t.topic_id
|
||||
FROM " . $sql_sort_table . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
|
||||
WHERE $sql_author
|
||||
$sql_topic_id
|
||||
$sql_firstpost
|
||||
$m_approve_fid_sql
|
||||
$sql_fora
|
||||
AND t.topic_id = p.topic_id
|
||||
$sql_sort_join
|
||||
$sql_time
|
||||
GROUP BY t.topic_id, $sort_by_sql[$sort_key]
|
||||
ORDER BY $sql_sort";
|
||||
$field = 'topic_id';
|
||||
}
|
||||
|
||||
// Only read one block of posts from the db and then cache it
|
||||
$result = $db->sql_query_limit($sql, $config['search_block_size'], $start);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$id_ary[] = $row[$field];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// retrieve the total result count if needed
|
||||
if (!$result_count)
|
||||
{
|
||||
$result_count = sizeof ($id_ary);
|
||||
|
||||
if (!$result_count)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($id_ary))
|
||||
{
|
||||
$this->save_ids($search_key, '', $author_ary, $result_count, $id_ary, $start, $sort_dir);
|
||||
$id_ary = array_slice($id_ary, 0, $per_page);
|
||||
|
||||
return $result_count;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys cached search results, that contained one of the new words in a post so the results won't be outdated.
|
||||
*
|
||||
* @param string $mode contains the post mode: edit, post, reply, quote ...
|
||||
* @param int $post_id contains the post id of the post to index
|
||||
* @param string $message contains the post text of the post
|
||||
* @param string $subject contains the subject of the post to index
|
||||
* @param int $poster_id contains the user id of the poster
|
||||
* @param int $forum_id contains the forum id of parent forum of the post
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id)
|
||||
{
|
||||
global $db;
|
||||
|
||||
// Split old and new post/subject to obtain array of words
|
||||
$split_text = $this->split_message($message);
|
||||
$split_title = ($subject) ? $this->split_message($subject) : array();
|
||||
|
||||
$words = array_unique(array_merge($split_text, $split_title));
|
||||
|
||||
unset($split_text);
|
||||
unset($split_title);
|
||||
|
||||
// destroy cached search results containing any of the words removed or added
|
||||
$this->destroy_cache($words, array($poster_id));
|
||||
|
||||
unset($words);
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy cached results, that might be outdated after deleting a post
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function index_remove($post_ids, $author_ids, $forum_ids)
|
||||
{
|
||||
$this->destroy_cache(array(), $author_ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy old cache entries
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function tidy()
|
||||
{
|
||||
global $db, $config;
|
||||
|
||||
// destroy too old cached search results
|
||||
$this->destroy_cache(array());
|
||||
|
||||
set_config('search_last_gc', time(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create fulltext index
|
||||
*
|
||||
* @return string|bool error string is returned incase of errors otherwise false
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function create_index($acp_module, $u_action)
|
||||
{
|
||||
global $db, $config;
|
||||
|
||||
// Make sure we can actually use PostgreSQL with fulltext indexes
|
||||
if ($error = $this->init())
|
||||
{
|
||||
return $error;
|
||||
}
|
||||
|
||||
if (empty($this->stats))
|
||||
{
|
||||
$this->get_stats();
|
||||
}
|
||||
|
||||
if (!isset($this->stats['post_subject']))
|
||||
{
|
||||
$db->sql_query("CREATE INDEX " . POSTS_TABLE . "_" . $config['fulltext_postgres_ts_name'] . "_post_subject ON " . POSTS_TABLE . " USING gin (to_tsvector ('" . $db->sql_escape($config['fulltext_postgres_ts_name']) . "', post_subject))");
|
||||
}
|
||||
|
||||
if (!isset($this->stats['post_text']))
|
||||
{
|
||||
$db->sql_query("CREATE INDEX " . POSTS_TABLE . "_" . $config['fulltext_postgres_ts_name'] . "_post_text ON " . POSTS_TABLE . " USING gin (to_tsvector ('" . $db->sql_escape($config['fulltext_postgres_ts_name']) . "', post_text))");
|
||||
}
|
||||
|
||||
$db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Drop fulltext index
|
||||
*
|
||||
* @return string|bool error string is returned incase of errors otherwise false
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function delete_index($acp_module, $u_action)
|
||||
{
|
||||
global $db;
|
||||
|
||||
// Make sure we can actually use PostgreSQL with fulltext indexes
|
||||
if ($error = $this->init())
|
||||
{
|
||||
return $error;
|
||||
}
|
||||
|
||||
if (empty($this->stats))
|
||||
{
|
||||
$this->get_stats();
|
||||
}
|
||||
|
||||
if (isset($this->stats['post_subject']))
|
||||
{
|
||||
$db->sql_query('DROP INDEX ' . $this->stats['post_subject']['relname']);
|
||||
}
|
||||
|
||||
if (isset($this->stats['post_text']))
|
||||
{
|
||||
$db->sql_query('DROP INDEX ' . $this->stats['post_text']['relname']);
|
||||
}
|
||||
|
||||
$db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if both FULLTEXT indexes exist
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function index_created()
|
||||
{
|
||||
if (empty($this->stats))
|
||||
{
|
||||
$this->get_stats();
|
||||
}
|
||||
|
||||
return (isset($this->stats['post_text']) && isset($this->stats['post_subject'])) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an associative array containing information about the indexes
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function index_stats()
|
||||
{
|
||||
global $user;
|
||||
|
||||
if (empty($this->stats))
|
||||
{
|
||||
$this->get_stats();
|
||||
}
|
||||
|
||||
return array(
|
||||
$user->lang['FULLTEXT_POSTGRES_TOTAL_POSTS'] => ($this->index_created()) ? $this->stats['total_posts'] : 0,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes the stats and store them in the $this->stats associative array
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
function get_stats()
|
||||
{
|
||||
global $db, $config;
|
||||
|
||||
if ($db->sql_layer != 'postgres')
|
||||
{
|
||||
$this->stats = array();
|
||||
return;
|
||||
}
|
||||
|
||||
$sql = "SELECT c2.relname, pg_catalog.pg_get_indexdef(i.indexrelid, 0, true) AS indexdef
|
||||
FROM pg_catalog.pg_class c1, pg_catalog.pg_index i, pg_catalog.pg_class c2
|
||||
WHERE c1.relname = '" . POSTS_TABLE . "'
|
||||
AND pg_catalog.pg_table_is_visible(c1.oid)
|
||||
AND c1.oid = i.indrelid
|
||||
AND i.indexrelid = c2.oid";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
// deal with older PostgreSQL versions which didn't use Index_type
|
||||
if (strpos($row['indexdef'], 'to_tsvector') !== false)
|
||||
{
|
||||
if ($row['relname'] == POSTS_TABLE . '_' . $config['fulltext_postgres_ts_name'] . '_post_text' || $row['relname'] == POSTS_TABLE . '_post_text')
|
||||
{
|
||||
$this->stats['post_text'] = $row;
|
||||
}
|
||||
else if ($row['relname'] == POSTS_TABLE . '_' . $config['fulltext_postgres_ts_name'] . '_post_subject' || $row['relname'] == POSTS_TABLE . '_post_subject')
|
||||
{
|
||||
$this->stats['post_subject'] = $row;
|
||||
}
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$this->stats['total_posts'] = $config['num_posts'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Display various options that can be configured for the backend from the acp
|
||||
*
|
||||
* @return associative array containing template and config variables
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function acp()
|
||||
{
|
||||
global $user, $config, $db;
|
||||
|
||||
$tpl = '
|
||||
<dl>
|
||||
<dt><label>' . $user->lang['FULLTEXT_POSTGRES_VERSION_CHECK'] . '</label><br /><span>' . $user->lang['FULLTEXT_POSTGRES_VERSION_CHECK_EXPLAIN'] . '</span></dt>
|
||||
<dd>' . (($this->tsearch_usable) ? $user->lang['YES'] : $user->lang['NO']) . ' (PostgreSQL ' . $this->version . ')</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label>' . $user->lang['FULLTEXT_POSTGRES_TS_NAME'] . '</label><br /><span>' . $user->lang['FULLTEXT_POSTGRES_TS_NAME_EXPLAIN'] . '</span></dt>
|
||||
<dd><select name="config[fulltext_postgres_ts_name]">';
|
||||
|
||||
if ($db->sql_layer == 'postgres' && $this->tsearch_usable)
|
||||
{
|
||||
$sql = 'SELECT cfgname AS ts_name
|
||||
FROM pg_ts_config';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$tpl .= '<option value="' . $row['ts_name'] . '"' . ($row['ts_name'] === $config['fulltext_postgres_ts_name'] ? ' selected="selected"' : '') . '>' . $row['ts_name'] . '</option>';
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
$tpl .= '<option value="' . $config['fulltext_postgres_ts_name'] . '" selected="selected">' . $config['fulltext_postgres_ts_name'] . '</option>';
|
||||
}
|
||||
|
||||
$tpl .= '</select></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="fulltext_postgres_min_word_len">' . $user->lang['FULLTEXT_POSTGRES_MIN_WORD_LEN'] . ':</label><br /><span>' . $user->lang['FULLTEXT_POSTGRES_MIN_WORD_LEN_EXPLAIN'] . '</span></dt>
|
||||
<dd><input id="fulltext_postgres_min_word_len" type="text" size="3" maxlength="3" name="config[fulltext_postgres_min_word_len]" value="' . (int) $config['fulltext_postgres_min_word_len'] . '" /></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="fulltext_postgres_max_word_len">' . $user->lang['FULLTEXT_POSTGRES_MAX_WORD_LEN'] . ':</label><br /><span>' . $user->lang['FULLTEXT_POSTGRES_MAX_WORD_LEN_EXPLAIN'] . '</span></dt>
|
||||
<dd><input id="fulltext_postgres_max_word_len" type="text" size="3" maxlength="3" name="config[fulltext_postgres_max_word_len]" value="' . (int) $config['fulltext_postgres_max_word_len'] . '" /></dd>
|
||||
</dl>
|
||||
';
|
||||
|
||||
// These are fields required in the config table
|
||||
return array(
|
||||
'tpl' => $tpl,
|
||||
'config' => array('fulltext_postgres_ts_name' => 'string', 'fulltext_postgres_min_word_len' => 'integer:0:255', 'fulltext_postgres_max_word_len' => 'integer:0:255')
|
||||
);
|
||||
}
|
||||
}
|
@ -342,8 +342,16 @@ class phpbb_session
|
||||
}
|
||||
}
|
||||
|
||||
// Is session_id is set or session_id is set and matches the url param if required
|
||||
if (!empty($this->session_id) && (!defined('NEED_SID') || (isset($_GET['sid']) && $this->session_id === request_var('sid', ''))))
|
||||
// if no session id is set, redirect to index.php
|
||||
$session_id = $request->variable('sid', '');
|
||||
if (defined('NEED_SID') && (empty($session_id) || $this->session_id !== $session_id))
|
||||
{
|
||||
send_status_line(401, 'Not authorized');
|
||||
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
|
||||
}
|
||||
|
||||
// if session id is set
|
||||
if (!empty($this->session_id))
|
||||
{
|
||||
$sql = 'SELECT u.*, s.*
|
||||
FROM ' . SESSIONS_TABLE . ' s, ' . USERS_TABLE . " u
|
||||
|
@ -150,7 +150,7 @@ if (function_exists('date_default_timezone_set') && function_exists('date_defaul
|
||||
// Autoloading of dependencies.
|
||||
// Three options are supported:
|
||||
// 1. If dependencies are installed with Composer, Composer will create a
|
||||
// vendor/.composer/autoload.php. If this file exists it will be
|
||||
// vendor/autoload.php. If this file exists it will be
|
||||
// automatically used by phpBB. This is the default mode that phpBB
|
||||
// will use when shipped.
|
||||
// 2. To disable composer autoloading, PHPBB_NO_COMPOSER_AUTOLOAD can be specified.
|
||||
@ -171,11 +171,11 @@ if (getenv('PHPBB_NO_COMPOSER_AUTOLOAD'))
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!file_exists($phpbb_root_path . 'vendor/.composer/autoload.php'))
|
||||
if (!file_exists($phpbb_root_path . 'vendor/autoload.php'))
|
||||
{
|
||||
trigger_error('You have not set up composer dependencies. See http://getcomposer.org/.', E_USER_ERROR);
|
||||
}
|
||||
require($phpbb_root_path . 'vendor/.composer/autoload.php');
|
||||
require($phpbb_root_path . 'vendor/autoload.php');
|
||||
}
|
||||
|
||||
$starttime = explode(' ', microtime());
|
||||
|
@ -30,7 +30,7 @@ if (!defined('IN_PHPBB'))
|
||||
*
|
||||
* @package phpBB3
|
||||
*/
|
||||
class phpbb_style_resource_locator
|
||||
class phpbb_style_resource_locator implements phpbb_template_locator
|
||||
{
|
||||
/**
|
||||
* Paths to style directories.
|
||||
|
@ -22,28 +22,33 @@ if (!defined('IN_PHPBB'))
|
||||
class phpbb_style
|
||||
{
|
||||
/**
|
||||
* @var phpbb_style_template Template class.
|
||||
* Template class.
|
||||
* Handles everything related to templates.
|
||||
* @var phpbb_template
|
||||
*/
|
||||
private $template;
|
||||
|
||||
/**
|
||||
* @var string phpBB root path
|
||||
* phpBB root path
|
||||
* @var string
|
||||
*/
|
||||
private $phpbb_root_path;
|
||||
|
||||
/**
|
||||
* @var phpEx PHP file extension
|
||||
* PHP file extension
|
||||
* @var string
|
||||
*/
|
||||
private $phpEx;
|
||||
|
||||
/**
|
||||
* @var phpbb_config phpBB config instance
|
||||
* phpBB config instance
|
||||
* @var phpbb_config
|
||||
*/
|
||||
private $config;
|
||||
|
||||
/**
|
||||
* @var user current user
|
||||
* Current user
|
||||
* @var phpbb_user
|
||||
*/
|
||||
private $user;
|
||||
|
||||
@ -66,9 +71,9 @@ class phpbb_style
|
||||
* @param user $user current user
|
||||
* @param phpbb_style_resource_locator $locator style resource locator
|
||||
* @param phpbb_style_path_provider $provider style path provider
|
||||
* @param phpbb_style_template $template template
|
||||
* @param phpbb_template $template template
|
||||
*/
|
||||
public function __construct($phpbb_root_path, $phpEx, $config, $user, phpbb_style_resource_locator $locator, phpbb_style_path_provider_interface $provider, phpbb_style_template $template)
|
||||
public function __construct($phpbb_root_path, $phpEx, $config, $user, phpbb_style_resource_locator $locator, phpbb_style_path_provider_interface $provider, phpbb_template $template)
|
||||
{
|
||||
$this->phpbb_root_path = $phpbb_root_path;
|
||||
$this->phpEx = $phpEx;
|
||||
@ -84,9 +89,9 @@ class phpbb_style
|
||||
*/
|
||||
public function set_style()
|
||||
{
|
||||
$style_name = $this->user->theme['style_path'];
|
||||
$style_dirs = ($this->user->theme['style_parent_id']) ? array_reverse(explode('/', $this->user->theme['style_parent_tree'])) : array();
|
||||
$paths = array($this->get_style_path($style_name));
|
||||
$style_path = $this->user->style['style_path'];
|
||||
$style_dirs = ($this->user->style['style_parent_id']) ? array_reverse(explode('/', $this->user->style['style_parent_tree'])) : array();
|
||||
$paths = array($this->get_style_path($style_path));
|
||||
foreach ($style_dirs as $dir)
|
||||
{
|
||||
$paths[] = $this->get_style_path($dir);
|
||||
@ -95,7 +100,7 @@ class phpbb_style
|
||||
// Add 'all' path, used as last fallback path by hooks and extensions
|
||||
$paths[] = $this->get_style_path('all');
|
||||
|
||||
return $this->set_custom_style($style_name, $paths);
|
||||
return $this->set_custom_style($style_path, $paths);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -119,7 +124,7 @@ class phpbb_style
|
||||
|
||||
$this->template->cachepath = $this->phpbb_root_path . 'cache/tpl_' . str_replace('_', '-', $name) . '_';
|
||||
|
||||
$this->template->context = new phpbb_style_template_context();
|
||||
$this->template->context = new phpbb_template_context();
|
||||
|
||||
if ($template_path !== false)
|
||||
{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user