diff options
author | Nathan Guse <nathaniel.guse@gmail.com> | 2012-12-07 18:11:38 -0600 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2012-12-07 18:11:38 -0600 |
commit | 92ec214537d041076187cc013d08175e8cff3fe8 (patch) | |
tree | 24ccc13c2205faf1a2ba98ae159078ddbe1d90f4 | |
parent | b25efd744db56f7565453caccf26630404db07c7 (diff) | |
parent | 108a6c35a6d718166a8bfd17042cac5f2ccc6d20 (diff) | |
download | forums-92ec214537d041076187cc013d08175e8cff3fe8.tar forums-92ec214537d041076187cc013d08175e8cff3fe8.tar.gz forums-92ec214537d041076187cc013d08175e8cff3fe8.tar.bz2 forums-92ec214537d041076187cc013d08175e8cff3fe8.tar.xz forums-92ec214537d041076187cc013d08175e8cff3fe8.zip |
Merge branch 'develop' of git://github.com/phpbb/phpbb3 into ticket/8323
Conflicts:
phpBB/viewtopic.php
606 files changed, 19831 insertions, 4322 deletions
diff --git a/.travis.yml b/.travis.yml index 20c0c6bf4f..f296f10230 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,14 +9,14 @@ 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" + - pyrus set auto_discover 1 - 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: @@ -1,4 +1,4 @@ -[![phpBB](http://www.phpbb.com/theme/images/logos/blue/160x52.png)](http://www.phpbb.com) +[![phpBB](https://www.phpbb.com/theme/images/logos/blue/160x52.png)](http://www.phpbb.com) ## ABOUT @@ -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 --dev ## CONTRIBUTE diff --git a/build/build.xml b/build/build.xml index 1b8d42a660..28dd36bea8 100644 --- a/build/build.xml +++ b/build/build.xml @@ -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.11-RC1" /> + <property name="newversion" value="3.0.11" /> <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" /> + <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, 3.0.11-RC1, 3.0.11-RC2" /> <!-- no configuration should be needed beyond this point --> <property name="oldversions" value="${olderversions}, ${prevversion}" /> diff --git a/code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php b/code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php index ba2b40ecba..68e9e6bb86 100644 --- a/code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php +++ b/code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php @@ -35,7 +35,7 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff * @param int $stackPtr The position of the current token * in the stack passed in $tokens. * - * @return void + * @return null */ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) { @@ -120,7 +120,7 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff * @param integer The stack pointer for the first comment token. * @param array(string=>array) $tags The found file doc comment tags. * - * @return void + * @return null */ protected function processPackage(PHP_CodeSniffer_File $phpcsFile, $ptr, $tags) { @@ -143,7 +143,7 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff * @param integer The stack pointer for the first comment token. * @param array(string=>array) $tags The found file doc comment tags. * - * @return void + * @return null */ protected function processVersion(PHP_CodeSniffer_File $phpcsFile, $ptr, $tags) { @@ -166,7 +166,7 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff * @param integer The stack pointer for the first comment token. * @param array(string=>array) $tags The found file doc comment tags. * - * @return void + * @return null */ protected function processCopyright(PHP_CodeSniffer_File $phpcsFile, $ptr, $tags) { @@ -189,7 +189,7 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff * @param integer The stack pointer for the first comment token. * @param array(string=>array) $tags The found file doc comment tags. * - * @return void + * @return null */ protected function processLicense(PHP_CodeSniffer_File $phpcsFile, $ptr, $tags) { diff --git a/composer.phar b/composer.phar Binary files differindex 3572477546..af7b8c1a67 100755 --- a/composer.phar +++ b/composer.phar diff --git a/phpBB/adm/style/acp_attachments.html b/phpBB/adm/style/acp_attachments.html index c2f8b34792..266b7e48b4 100644 --- a/phpBB/adm/style/acp_attachments.html +++ b/phpBB/adm/style/acp_attachments.html @@ -54,7 +54,7 @@ <!-- ELSE --> <dl> - <dt><label for="{options.KEY}">{options.TITLE}:</label><!-- IF options.S_EXPLAIN --><br /><span>{options.TITLE_EXPLAIN}</span><!-- ENDIF --></dt> + <dt><label for="{options.KEY}">{options.TITLE}{L_COLON}</label><!-- IF options.S_EXPLAIN --><br /><span>{options.TITLE_EXPLAIN}</span><!-- ENDIF --></dt> <dd>{options.CONTENT}</dd> </dl> @@ -78,11 +78,11 @@ <legend>{L_SECURE_TITLE}</legend> <p>{L_DOWNLOAD_ADD_IPS_EXPLAIN}</p> <dl> - <dt><label for="ip_hostname">{L_IP_HOSTNAME}:</label></dt> + <dt><label for="ip_hostname">{L_IP_HOSTNAME}{L_COLON}</label></dt> <dd><textarea id="ip_hostname" cols="40" rows="3" name="ips"></textarea></dd> </dl> <dl> - <dt><label for="exclude">{L_IP_EXCLUDE}:</label><br /><span>{L_EXCLUDE_ENTERED_IP}</span></dt> + <dt><label for="exclude">{L_IP_EXCLUDE}{L_COLON}</label><br /><span>{L_EXCLUDE_ENTERED_IP}</span></dt> <dd><label><input type="radio" id="exclude" name="ipexclude" value="1" class="radio" /> {L_YES}</label> <label><input type="radio" name="ipexclude" value="0" checked="checked" class="radio" /> {L_NO}</label></dd> </dl> @@ -97,7 +97,7 @@ <!-- IF S_DEFINED_IPS --> <p>{L_DOWNLOAD_REMOVE_IPS_EXPLAIN}</p> <dl> - <dt><label for="remove_ip_hostname">{L_IP_HOSTNAME}:</label></dt> + <dt><label for="remove_ip_hostname">{L_IP_HOSTNAME}{L_COLON}</label></dt> <dd><select name="unip[]" id="remove_ip_hostname" multiple="multiple" size="10">{DEFINED_IPS}</select></dd> </dl> @@ -172,39 +172,39 @@ <legend>{L_LEGEND}</legend> <dl> - <dt><label for="group_name">{L_GROUP_NAME}:</label></dt> + <dt><label for="group_name">{L_GROUP_NAME}{L_COLON}</label></dt> <dd><input type="text" id="group_name" size="20" maxlength="100" name="group_name" value="{GROUP_NAME}" /></dd> </dl> <dl> - <dt><label for="category">{L_SPECIAL_CATEGORY}:</label><br /><span>{L_SPECIAL_CATEGORY_EXPLAIN}</span></dt> + <dt><label for="category">{L_SPECIAL_CATEGORY}{L_COLON}</label><br /><span>{L_SPECIAL_CATEGORY_EXPLAIN}</span></dt> <dd>{S_CATEGORY_SELECT}</dd> </dl> <dl> - <dt><label for="allowed">{L_ALLOWED}:</label></dt> + <dt><label for="allowed">{L_ALLOWED}{L_COLON}</label></dt> <dd><input type="checkbox" class="radio" id="allowed" name="allow_group" value="1"<!-- IF ALLOW_GROUP --> checked="checked"<!-- ENDIF --> /></dd> </dl> <dl> - <dt><label for="allow_in_pm">{L_ALLOW_IN_PM}:</label></dt> + <dt><label for="allow_in_pm">{L_ALLOW_IN_PM}{L_COLON}</label></dt> <dd><input type="checkbox" class="radio" id="allow_in_pm" name="allow_in_pm" value="1"<!-- IF ALLOW_IN_PM --> checked="checked"<!-- ENDIF --> /></dd> </dl> <dl> - <dt><label for="upload_icon">{L_UPLOAD_ICON}:</label></dt> + <dt><label for="upload_icon">{L_UPLOAD_ICON}{L_COLON}</label></dt> <dd><select name="upload_icon" id="upload_icon" onchange="update_image(this.options[selectedIndex].value);"> <option value="no_image"<!-- IF S_NO_IMAGE --> selected="selected"<!-- ENDIF -->>{L_NO_IMAGE}</option>{S_FILENAME_LIST} </select></dd> <dd> <img <!-- IF S_NO_IMAGE -->src="{PHPBB_ROOT_PATH}images/spacer.gif"<!-- ELSE -->src="{UPLOAD_ICON_SRC}"<!-- ENDIF --> id="image_upload_icon" alt="" title="" /> </dd> </dl> <dl> - <dt><label for="extgroup_filesize">{L_MAX_EXTGROUP_FILESIZE}:</label></dt> + <dt><label for="extgroup_filesize">{L_MAX_EXTGROUP_FILESIZE}{L_COLON}</label></dt> <dd><input type="text" id="extgroup_filesize" size="3" maxlength="15" name="max_filesize" value="{EXTGROUP_FILESIZE}" /> <select name="size_select">{S_EXT_GROUP_SIZE_OPTIONS}</select></dd> </dl> <dl> - <dt><label for="assigned_extensions">{L_ASSIGNED_EXTENSIONS}:</label></dt> + <dt><label for="assigned_extensions">{L_ASSIGNED_EXTENSIONS}{L_COLON}</label></dt> <dd><div id="ext">{ASSIGNED_EXTENSIONS}</div> <span>[<a href="{U_EXTENSIONS}">{L_GO_TO_EXTENSIONS}</a> ]</span></dd> <dd><select name="extensions[]" id="assigned_extensions" class="narrow" onchange="show_extensions(this);" multiple="multiple" size="8">{S_EXTENSION_OPTIONS}</select></dd> </dl> <dl> - <dt><label for="allowed_forums">{L_ALLOWED_FORUMS}:</label><br /><span>{L_ALLOWED_FORUMS_EXPLAIN}</span></dt> + <dt><label for="allowed_forums">{L_ALLOWED_FORUMS}{L_COLON}</label><br /><span>{L_ALLOWED_FORUMS_EXPLAIN}</span></dt> <dd><label><input type="radio" id="allowed_forums" class="radio" name="forum_select" value="0"<!-- IF not S_FORUM_IDS --> checked="checked"<!-- ENDIF --> /> {L_ALLOW_ALL_FORUMS}</label> <label><input type="radio" class="radio" name="forum_select" value="1"<!-- IF S_FORUM_IDS --> checked="checked"<!-- ENDIF --> /> {L_ALLOW_SELECTED_FORUMS}</label></dd> <dd><select name="allowed_forums[]" multiple="multiple" size="8">{S_FORUM_ID_OPTIONS}</select></dd> @@ -254,7 +254,7 @@ </tbody> </table> <p class="quick"> - {L_CREATE_GROUP}: <input type="text" name="group_name" maxlength="30" /> + {L_CREATE_GROUP}{L_COLON} <input type="text" name="group_name" maxlength="30" /> <input class="button2" name="add" type="submit" value="{L_SUBMIT}" /> </p> {S_FORM_TOKEN} @@ -348,7 +348,7 @@ <td><a href="{orphan.U_FILE}">{orphan.REAL_FILENAME}</a></td> <td>{orphan.FILETIME}</td> <td>{orphan.FILESIZE}</td> - <td><strong>{L_ATTACH_ID}: </strong><input type="text" name="post_id[{orphan.ATTACH_ID}]" size="7" maxlength="10" value="{orphan.POST_ID}" /></td> + <td><strong>{L_ATTACH_ID}{L_COLON} </strong><input type="text" name="post_id[{orphan.ATTACH_ID}]" size="7" maxlength="10" value="{orphan.POST_ID}" /></td> <td><input type="checkbox" class="radio" name="add[{orphan.ATTACH_ID}]" /></td> <td><input type="checkbox" class="radio" name="delete[{orphan.ATTACH_ID}]" /></td> </tr> @@ -378,11 +378,16 @@ <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}{L_COLON} {TOTAL_FILES} • {L_TOTAL_SIZE}{L_COLON} {TOTAL_SIZE} + <!-- IF .pagination --> + • <!-- INCLUDE pagination.html --> + <!-- ELSE --> + • {S_ON_PAGE} + <!-- ENDIF --> <!-- ENDIF --> + </div> <table cellspacing="1"> <thead> @@ -397,8 +402,8 @@ <!-- BEGIN attachments --> <!-- IF attachments.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> <td> - <!-- IF attachments.S_IN_MESSAGE -->{L_EXTENSION_GROUP}: <strong><!-- IF attachments.EXT_GROUP_NAME -->{attachments.EXT_GROUP_NAME}<!-- ELSE -->{L_NO_EXT_GROUP}<!-- ENDIF --></strong><br />{attachments.L_DOWNLOAD_COUNT}<br />{L_IN} {L_PRIVATE_MESSAGE} - <!-- ELSE --><a href="{attachments.U_FILE}" style="font-weight: bold;">{attachments.REAL_FILENAME}</a><br /><!-- IF attachments.COMMENT -->{attachments.COMMENT}<br /><!-- ENDIF -->{attachments.L_DOWNLOAD_COUNT}<br />{L_TOPIC}: <a href="{attachments.U_VIEW_TOPIC}">{attachments.TOPIC_TITLE}</a><!-- ENDIF --> + <!-- IF attachments.S_IN_MESSAGE -->{L_EXTENSION_GROUP}{L_COLON} <strong><!-- IF attachments.EXT_GROUP_NAME -->{attachments.EXT_GROUP_NAME}<!-- ELSE -->{L_NO_EXT_GROUP}<!-- ENDIF --></strong><br />{attachments.L_DOWNLOAD_COUNT}<br />{L_IN} {L_PRIVATE_MESSAGE} + <!-- ELSE --><a href="{attachments.U_FILE}" style="font-weight: bold;">{attachments.REAL_FILENAME}</a><br /><!-- IF attachments.COMMENT -->{attachments.COMMENT}<br /><!-- ENDIF -->{attachments.L_DOWNLOAD_COUNT}<br />{L_TOPIC}{L_COLON} <a href="{attachments.U_VIEW_TOPIC}">{attachments.TOPIC_TITLE}</a><!-- ENDIF --> </td> <td>{attachments.FILETIME}<br />{L_POST_BY_AUTHOR} {attachments.ATTACHMENT_POSTER}</td> <td>{attachments.FILESIZE}</td> @@ -414,14 +419,19 @@ <!-- IF TOTAL_FILES --> <fieldset class="display-options"> - {L_DISPLAY_LOG}: {S_LIMIT_DAYS} {L_SORT_BY}: {S_SORT_KEY} {S_SORT_DIR} + {L_DISPLAY_LOG}{L_COLON} {S_LIMIT_DAYS} {L_SORT_BY}{L_COLON} {S_SORT_KEY} {S_SORT_DIR} <input class="button2" type="submit" value="{L_GO}" name="sort" /> </fieldset> <hr /> <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 --> + {L_NUMBER_FILES}{L_COLON} {TOTAL_FILES} • {L_TOTAL_SIZE}{L_COLON} {TOTAL_SIZE} + <!-- IF .pagination --> + • <!-- INCLUDE pagination.html --> + <!-- ELSE --> + • {S_ON_PAGE} + <!-- ENDIF --> </div> <!-- ENDIF --> diff --git a/phpBB/adm/style/acp_ban.html b/phpBB/adm/style/acp_ban.html index d564e89312..71c737de70 100644 --- a/phpBB/adm/style/acp_ban.html +++ b/phpBB/adm/style/acp_ban.html @@ -44,26 +44,26 @@ <fieldset> <legend>{L_TITLE}</legend> <dl> - <dt><label for="ban">{L_BAN_CELL}:</label></dt> + <dt><label for="ban">{L_BAN_CELL}{L_COLON}</label></dt> <dd><textarea name="ban" cols="40" rows="3" id="ban"></textarea></dd> <!-- IF S_USERNAME_BAN --><dd>[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</dd><!-- ENDIF --> </dl> <dl> - <dt><label for="banlength">{L_BAN_LENGTH}:</label></dt> + <dt><label for="banlength">{L_BAN_LENGTH}{L_COLON}</label></dt> <dd><label for="banlength"><select name="banlength" id="banlength" onchange="if(this.value==-1){document.getElementById('banlengthother').style.display = 'block';}else{document.getElementById('banlengthother').style.display='none';}">{S_BAN_END_OPTIONS}</select></label></dd> <dd id="banlengthother" style="display: none;"><label><input type="text" name="banlengthother" class="inputbox" /><br /><span>{L_YEAR_MONTH_DAY}</span></label></dd> </dl> <dl> - <dt><label for="banexclude">{L_BAN_EXCLUDE}:</label><br /><span>{L_BAN_EXCLUDE_EXPLAIN}</span></dt> + <dt><label for="banexclude">{L_BAN_EXCLUDE}{L_COLON}</label><br /><span>{L_BAN_EXCLUDE_EXPLAIN}</span></dt> <dd><label><input type="radio" name="banexclude" value="1" class="radio" /> {L_YES}</label> <label><input type="radio" name="banexclude" id="banexclude" value="0" checked="checked" class="radio" /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="banreason">{L_BAN_REASON}:</label></dt> + <dt><label for="banreason">{L_BAN_REASON}{L_COLON}</label></dt> <dd><input name="banreason" type="text" class="text medium" maxlength="255" id="banreason" /></dd> </dl> <dl> - <dt><label for="bangivereason">{L_BAN_GIVE_REASON}:</label></dt> + <dt><label for="bangivereason">{L_BAN_GIVE_REASON}{L_COLON}</label></dt> <dd><input name="bangivereason" type="text" class="text medium" maxlength="255" id="bangivereason" /></dd> </dl> @@ -88,19 +88,19 @@ <!-- IF S_BANNED_OPTIONS --> <dl> - <dt><label for="unban">{L_BAN_CELL}:</label></dt> + <dt><label for="unban">{L_BAN_CELL}{L_COLON}</label></dt> <dd><select id="unban" name="unban[]" multiple="multiple" size="10" style="width: 50%" onchange="if (this.selectedIndex > -1) display_details(this.options[this.selectedIndex].value); else display_details(-1);">{BANNED_OPTIONS}</select></dd> </dl> <dl> - <dt><label for="unbanlength">{L_BAN_LENGTH}:</label></dt> + <dt><label for="unbanlength">{L_BAN_LENGTH}{L_COLON}</label></dt> <dd><input style="border: 0;" type="text" class="text full" readonly="readonly" name="unbanlength" id="unbanlength" /></dd> </dl> <dl> - <dt><label for="unbanreason">{L_BAN_REASON}:</label></dt> + <dt><label for="unbanreason">{L_BAN_REASON}{L_COLON}</label></dt> <dd><textarea style="border: 0;" class="text full" readonly="readonly" name="unbanreason" id="unbanreason" rows="5" cols="80"> </textarea></dd> </dl> <dl> - <dt><label for="unbangivereason">{L_BAN_GIVE_REASON}:</label></dt> + <dt><label for="unbangivereason">{L_BAN_GIVE_REASON}{L_COLON}</label></dt> <dd><textarea style="border: 0;" class="text full" readonly="readonly" name="unbangivereason" id="unbangivereason" rows="5" cols="80"> </textarea></dd> </dl> diff --git a/phpBB/adm/style/acp_board.html b/phpBB/adm/style/acp_board.html index 781f5c6bce..6b8ceb3ef6 100644 --- a/phpBB/adm/style/acp_board.html +++ b/phpBB/adm/style/acp_board.html @@ -25,7 +25,7 @@ <!-- ELSE --> <dl> - <dt><label for="{options.KEY}">{options.TITLE}:</label><!-- IF options.S_EXPLAIN --><br /><span>{options.TITLE_EXPLAIN}</span><!-- ENDIF --></dt> + <dt><label for="{options.KEY}">{options.TITLE}{L_COLON}</label><!-- IF options.S_EXPLAIN --><br /><span>{options.TITLE_EXPLAIN}</span><!-- ENDIF --></dt> <dd>{options.CONTENT}</dd> </dl> diff --git a/phpBB/adm/style/acp_bots.html b/phpBB/adm/style/acp_bots.html index 87679fc33a..cdd0fd4a93 100644 --- a/phpBB/adm/style/acp_bots.html +++ b/phpBB/adm/style/acp_bots.html @@ -22,27 +22,27 @@ <fieldset> <legend>{L_TITLE}</legend> <dl> - <dt><label for="bot_name">{L_BOT_NAME}:</label><br /><span>{L_BOT_NAME_EXPLAIN}</span></dt> + <dt><label for="bot_name">{L_BOT_NAME}{L_COLON}</label><br /><span>{L_BOT_NAME_EXPLAIN}</span></dt> <dd><input name="bot_name" type="text" id="bot_name" value="{BOT_NAME}" maxlength="255" /></dd> </dl> <dl> - <dt><label for="bot_style">{L_BOT_STYLE}:</label><br /><span>{L_BOT_STYLE_EXPLAIN}</span></dt> + <dt><label for="bot_style">{L_BOT_STYLE}{L_COLON}</label><br /><span>{L_BOT_STYLE_EXPLAIN}</span></dt> <dd><select id="bot_style" name="bot_style">{S_STYLE_OPTIONS}</select></dd> </dl> <dl> - <dt><label for="bot_lang">{L_BOT_LANG}:</label><br /><span>{L_BOT_LANG_EXPLAIN}</span></dt> + <dt><label for="bot_lang">{L_BOT_LANG}{L_COLON}</label><br /><span>{L_BOT_LANG_EXPLAIN}</span></dt> <dd><select id="bot_lang" name="bot_lang">{S_LANG_OPTIONS}</select></dd> </dl> <dl> - <dt><label for="bot_active">{L_BOT_ACTIVE}:</label></dt> + <dt><label for="bot_active">{L_BOT_ACTIVE}{L_COLON}</label></dt> <dd><select id="bot_active" name="bot_active">{S_ACTIVE_OPTIONS}</select></dd> </dl> <dl> - <dt><label for="bot_agent">{L_BOT_AGENT}:</label><br /><span>{L_BOT_AGENT_EXPLAIN}</span></dt> + <dt><label for="bot_agent">{L_BOT_AGENT}{L_COLON}</label><br /><span>{L_BOT_AGENT_EXPLAIN}</span></dt> <dd><input name="bot_agent" type="text" id="bot_agent" value="{BOT_AGENT}" maxlength="255" /></dd> </dl> <dl> - <dt><label for="bot_ip">{L_BOT_IP}:</label><br /><span>{L_BOT_IP_EXPLAIN}</span></dt> + <dt><label for="bot_ip">{L_BOT_IP}{L_COLON}</label><br /><span>{L_BOT_IP_EXPLAIN}</span></dt> <dd><input name="bot_ip" type="text" id="bot_ip" value="{BOT_IP}" maxlength="255" /></dd> </dl> diff --git a/phpBB/adm/style/acp_captcha.html b/phpBB/adm/style/acp_captcha.html index 83314ab633..ab5e207e0d 100644 --- a/phpBB/adm/style/acp_captcha.html +++ b/phpBB/adm/style/acp_captcha.html @@ -13,25 +13,25 @@ <legend>{L_GENERAL_OPTIONS}</legend> <dl> - <dt><label for="enable_confirm">{L_VISUAL_CONFIRM_REG}:</label><br /><span>{L_VISUAL_CONFIRM_REG_EXPLAIN}</span></dt> + <dt><label for="enable_confirm">{L_VISUAL_CONFIRM_REG}{L_COLON}</label><br /><span>{L_VISUAL_CONFIRM_REG_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" id="enable_confirm" name="enable_confirm" value="1"<!-- IF REG_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_ENABLED}</label> <label><input type="radio" class="radio" name="enable_confirm" value="0"<!-- IF not REG_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label></dd> </dl> <dl> - <dt><label for="max_reg_attempts">{L_REG_LIMIT}:</label><br /><span>{L_REG_LIMIT_EXPLAIN}</span></dt> + <dt><label for="max_reg_attempts">{L_REG_LIMIT}{L_COLON}</label><br /><span>{L_REG_LIMIT_EXPLAIN}</span></dt> <dd><input id="max_reg_attempts" type="text" size="4" maxlength="4" name="max_reg_attempts" value="{REG_LIMIT}" /></dd> </dl> <dl> - <dt><label for="max_login_attempts">{L_MAX_LOGIN_ATTEMPTS}:</label><br /><span>{L_MAX_LOGIN_ATTEMPTS_EXPLAIN}</span></dt> + <dt><label for="max_login_attempts">{L_MAX_LOGIN_ATTEMPTS}{L_COLON}</label><br /><span>{L_MAX_LOGIN_ATTEMPTS_EXPLAIN}</span></dt> <dd><input id="max_login_attempts" type="text" size="4" maxlength="4" name="max_login_attempts" value="{MAX_LOGIN_ATTEMPTS}" /></dd> </dl> <dl> - <dt><label for="enable_post_confirm">{L_VISUAL_CONFIRM_POST}:</label><br /><span>{L_VISUAL_CONFIRM_POST_EXPLAIN}</span></dt> + <dt><label for="enable_post_confirm">{L_VISUAL_CONFIRM_POST}{L_COLON}</label><br /><span>{L_VISUAL_CONFIRM_POST_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" id="enable_post_confirm" name="enable_post_confirm" value="1"<!-- IF POST_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_ENABLED}</label> <label><input type="radio" class="radio" name="enable_post_confirm" value="0"<!-- IF not POST_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label></dd> </dl> <dl> - <dt><label for="confirm_refresh">{L_VISUAL_CONFIRM_REFRESH}:</label><br /><span>{L_VISUAL_CONFIRM_REFRESH_EXPLAIN}</span></dt> + <dt><label for="confirm_refresh">{L_VISUAL_CONFIRM_REFRESH}{L_COLON}</label><br /><span>{L_VISUAL_CONFIRM_REFRESH_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" id="confirm_refresh" name="confirm_refresh" value="1"<!-- IF CONFIRM_REFRESH --> checked="checked"<!-- ENDIF --> /> {L_ENABLED}</label> <label><input type="radio" class="radio" name="confirm_refresh" value="0"<!-- IF not CONFIRM_REFRESH --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label></dd> </dl> @@ -40,12 +40,12 @@ <fieldset> <legend>{L_AVAILABLE_CAPTCHAS}</legend> <dl> - <dt><label for="captcha_select">{L_CAPTCHA_SELECT}:</label><br /><span>{L_CAPTCHA_SELECT_EXPLAIN}</span></dt> + <dt><label for="captcha_select">{L_CAPTCHA_SELECT}{L_COLON}</label><br /><span>{L_CAPTCHA_SELECT_EXPLAIN}</span></dt> <dd><select id="captcha_select" name="select_captcha" onchange="(document.getElementById('acp_captcha')).submit()" >{CAPTCHA_SELECT}</select></dd> </dl> <!-- IF S_CAPTCHA_HAS_CONFIG --> <dl> - <dt><label for="configure">{L_CAPTCHA_CONFIGURE}:</label><br /><span>{L_CAPTCHA_CONFIGURE_EXPLAIN}</span></dt> + <dt><label for="configure">{L_CAPTCHA_CONFIGURE}{L_COLON}</label><br /><span>{L_CAPTCHA_CONFIGURE_EXPLAIN}</span></dt> <dd><input class="button2" type="submit" id="configure" name="configure" value="{L_CONFIGURE}" /></dd> </dl> <!-- ENDIF --> diff --git a/phpBB/adm/style/acp_database.html b/phpBB/adm/style/acp_database.html index 28ac2db1b9..bf0c80bcd9 100644 --- a/phpBB/adm/style/acp_database.html +++ b/phpBB/adm/style/acp_database.html @@ -13,7 +13,7 @@ <fieldset> <legend>{L_RESTORE_OPTIONS}</legend> <dl> - <dt><label for="file">{L_SELECT_FILE}:</label></dt> + <dt><label for="file">{L_SELECT_FILE}{L_COLON}</label></dt> <dd><select id="file" name="file" size="10"><!-- BEGIN files --><option value="{files.FILE}"<!-- IF files.S_LAST_ROW --> selected="selected"<!-- ENDIF -->>{files.NAME}</option><!-- END files --></select></dd> </dl> @@ -57,26 +57,26 @@ <fieldset> <legend>{L_BACKUP_OPTIONS}</legend> <dl> - <dt><label for="type">{L_BACKUP_TYPE}:</label></dt> + <dt><label for="type">{L_BACKUP_TYPE}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="type" value="full" id="type" checked="checked" /> {L_FULL_BACKUP}</label> <label><input type="radio" name="type" class="radio" value="structure" /> {L_STRUCTURE_ONLY}</label> <label><input type="radio" class="radio" name="type" value="data" /> {L_DATA_ONLY}</label></dd> </dl> <dl> - <dt><label for="method">{L_FILE_TYPE}:</label></dt> + <dt><label for="method">{L_FILE_TYPE}{L_COLON}</label></dt> <dd><!-- BEGIN methods --> <label><input name="method"<!-- IF methods.S_FIRST_ROW --> id="method" checked="checked"<!-- ENDIF --> type="radio" class="radio" value="{methods.TYPE}" /> {methods.TYPE}</label> <!-- END methods --></dd> </dl> <dl> - <dt><label for="where">{L_ACTION}:</label></dt> + <dt><label for="where">{L_ACTION}{L_COLON}</label></dt> <dd> <label><input id="where" type="radio" class="radio" name="where" value="store" checked="checked" /> {L_STORE_LOCAL}</label> <label><input type="radio" class="radio" name="where" value="download" /> {L_DOWNLOAD}</label> </dd> </dl> <dl> - <dt><label for="table">{L_TABLE_SELECT}:</label></dt> + <dt><label for="table">{L_TABLE_SELECT}{L_COLON}</label></dt> <dd><select id="table" name="table[]" size="10" multiple="multiple"> <!-- BEGIN tables --> <option value="{tables.TABLE}">{tables.TABLE}</option> diff --git a/phpBB/adm/style/acp_disallow.html b/phpBB/adm/style/acp_disallow.html index 776f54d66c..0608f29474 100644 --- a/phpBB/adm/style/acp_disallow.html +++ b/phpBB/adm/style/acp_disallow.html @@ -11,7 +11,7 @@ <fieldset> <legend>{L_ADD_DISALLOW_TITLE}</legend> <dl> - <dt><label for="user">{L_USERNAME}:</label><br /><span>{L_ADD_DISALLOW_EXPLAIN}</span></dt> + <dt><label for="user">{L_USERNAME}{L_COLON}</label><br /><span>{L_ADD_DISALLOW_EXPLAIN}</span></dt> <dd><input id="user" type="text" class="text medium" maxlength="255" name="disallowed_user" /></dd> </dl> @@ -28,7 +28,7 @@ <legend>{L_DELETE_DISALLOW_TITLE}</legend> <!-- IF S_DISALLOWED_NAMES --> <dl> - <dt><label for="disallowed">{L_USERNAME}:</label></dt> + <dt><label for="disallowed">{L_USERNAME}{L_COLON}</label></dt> <dd><select name="disallowed_id" id="disallowed">{S_DISALLOWED_NAMES}</select></dd> </dl> diff --git a/phpBB/adm/style/acp_email.html b/phpBB/adm/style/acp_email.html index 1339ac6529..950ecb40b0 100644 --- a/phpBB/adm/style/acp_email.html +++ b/phpBB/adm/style/acp_email.html @@ -18,32 +18,32 @@ <fieldset> <legend>{L_COMPOSE}</legend> <dl> - <dt><label for="group">{L_SEND_TO_GROUP}:</label></dt> + <dt><label for="group">{L_SEND_TO_GROUP}{L_COLON}</label></dt> <dd><select id="group" name="g">{S_GROUP_OPTIONS}</select></dd> </dl> <dl> - <dt><label for="usernames">{L_SEND_TO_USERS}:</label><br /><span>{L_SEND_TO_USERS_EXPLAIN}</span></dt> + <dt><label for="usernames">{L_SEND_TO_USERS}{L_COLON}</label><br /><span>{L_SEND_TO_USERS_EXPLAIN}</span></dt> <dd><textarea name="usernames" id="usernames" rows="5" cols="40">{USERNAMES}</textarea></dd> <dd>[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</dd> </dl> <dl> - <dt><label for="subject">{L_SUBJECT}:</label></dt> + <dt><label for="subject">{L_SUBJECT}{L_COLON}</label></dt> <dd><input name="subject" type="text" id="subject" value="{SUBJECT}" /></dd> </dl> <dl> - <dt><label for="message">{L_MASS_MESSAGE}:</label><br /><span>{L_MASS_MESSAGE_EXPLAIN}</span></dt> + <dt><label for="message">{L_MASS_MESSAGE}{L_COLON}</label><br /><span>{L_MASS_MESSAGE_EXPLAIN}</span></dt> <dd><textarea id="message" name="message" rows="10" cols="60">{MESSAGE}</textarea></dd> </dl> <dl> - <dt><label for="priority">{L_MAIL_PRIORITY}:</label></dt> + <dt><label for="priority">{L_MAIL_PRIORITY}{L_COLON}</label></dt> <dd><select id="priority" name="mail_priority_flag">{S_PRIORITY_OPTIONS}</select></dd> </dl> <dl> - <dt><label for="banned">{L_MAIL_BANNED}:</label><br /><span>{L_MAIL_BANNED_EXPLAIN}</span></dt> + <dt><label for="banned">{L_MAIL_BANNED}{L_COLON}</label><br /><span>{L_MAIL_BANNED_EXPLAIN}</span></dt> <dd><input id="banned" name="mail_banned_flag" type="checkbox" class="radio" /></dd> </dl> <dl> - <dt><label for="send">{L_SEND_IMMEDIATELY}:</label></dt> + <dt><label for="send">{L_SEND_IMMEDIATELY}{L_COLON}</label></dt> <dd><input id="send" type="checkbox" class="radio" name="send_immediately" checked="checked" /></dd> </dl> diff --git a/phpBB/adm/style/acp_ext_details.html b/phpBB/adm/style/acp_ext_details.html new file mode 100644 index 0000000000..18786d80f9 --- /dev/null +++ b/phpBB/adm/style/acp_ext_details.html @@ -0,0 +1,97 @@ +<!-- INCLUDE overall_header.html --> + +<a name="maincontent"></a> + + <a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">« {L_BACK}</a> + + <h1>{L_EXTENSIONS_ADMIN}</h1> + + <fieldset> + <legend>{L_EXT_DETAILS}</legend> + <!-- IF META_DISPLAY_NAME --> + <dl> + <dt><label for="meta_display_name">{L_DISPLAY_NAME}{L_COLON}</label></dt> + <dd><strong id="meta_display_name">{META_DISPLAY_NAME}</strong></dd> + </dl> + <!-- ENDIF --> + <dl> + <dt><label for="meta_name">{L_CLEAN_NAME}{L_COLON}</label></dt> + <dd><strong id="meta_name">{META_NAME}</strong></dd> + </dl> + <!-- IF META_DESCRIPTION --> + <dl> + <dt><label for="meta_description">{L_DESCRIPTION}{L_COLON}</label></dt> + <dd><p id="meta_description">{META_DESCRIPTION}</p></dd> + </dl> + <!-- ENDIF --> + <dl> + <dt><label for="meta_version">{L_VERSION}{L_COLON}</label></dt> + <dd><p id="meta_version">{META_VERSION}</p></dd> + </dl> + <!-- IF META_HOMEPAGE --> + <dl> + <dt><label for="meta_homepage">{L_HOMEPAGE}{L_COLON}</label></dt> + <dd><p id="meta_homepage">{META_HOMEPAGE}</p></dd> + </dl> + <!-- ENDIF --> + <!-- IF META_TIME --> + <dl> + <dt><label for="meta_time">{L_TIME}{L_COLON}</label></dt> + <dd><p id="meta_time">{META_TIME}</p></dd> + </dl> + <!-- ENDIF --> + <dl> + <dt><label for="meta_license">{L_LICENCE}{L_COLON}</label></dt> + <dd><p id="meta_license">{META_LICENCE}</p></dd> + </dl> + </fieldset> + + <!-- IF META_REQUIRE_PHPBB || META_REQUIRE_PHP --> + <fieldset> + <legend>{L_REQUIREMENTS}</legend> + <!-- IF META_REQUIRE_PHPBB --> + <dl<!-- IF META_REQUIRE_PHPBB_FAIL --> class="requirements_not_met"<!-- ENDIF -->> + <dt><label for="require_phpbb">{L_PHPBB_VERSION}{L_COLON}</label></dt> + <dd><p id="require_phpbb">{META_REQUIRE_PHPBB}</p></dd> + </dl> + <!-- ENDIF --> + <!-- IF META_REQUIRE_PHP --> + <dl<!-- IF META_REQUIRE_PHP_FAIL --> class="requirements_not_met"<!-- ENDIF -->> + <dt><label for="require_php">{L_PHP_VERSION}{L_COLON}</label></dt> + <dd><p id="require_php">{META_REQUIRE_PHP}</p></dd> + </dl> + <!-- ENDIF --> + </fieldset> + <!-- ENDIF --> + + <fieldset> + <legend>{L_AUTHOR_INFORMATION}</legend> + <!-- BEGIN meta_authors --> + <fieldset> + <dl> + <dt><label for="meta_author_name">{L_AUTHOR_NAME}{L_COLON}</label></dt> + <dd><strong id="meta_author_name">{meta_authors.AUTHOR_NAME}</strong></dd> + </dl> + <!-- IF meta_authors.AUTHOR_EMAIL --> + <dl> + <dt><label for="meta_author_email">{L_AUTHOR_EMAIL}{L_COLON}</label></dt> + <dd><strong id="meta_author_email"><a href="mailto:{meta_authors.AUTHOR_EMAIL}">{meta_authors.AUTHOR_EMAIL}</a></strong></dd> + </dl> + <!-- ENDIF --> + <!-- IF meta_authors.AUTHOR_HOMEPAGE --> + <dl> + <dt><label for="meta_author_url">{L_AUTHOR_HOMEPAGE}{L_COLON}</label></dt> + <dd><strong id="meta_author_url"><a href="{meta_authors.AUTHOR_HOMEPAGE}">{meta_authors.AUTHOR_HOMEPAGE}</a></strong></dd> + </dl> + <!-- ENDIF --> + <!-- IF meta_authors.AUTHOR_ROLE --> + <dl> + <dt><label for="author_role">{L_AUTHOR_ROLE}{L_COLON}</label></dt> + <dd><strong id="meta_author_role">{meta_authors.AUTHOR_ROLE}</strong></dd> + </dl> + <!-- ENDIF --> + </fieldset> + <!-- END meta_authors --> + </fieldset> + +<!-- INCLUDE overall_footer.html --> diff --git a/phpBB/adm/style/acp_ext_disable.html b/phpBB/adm/style/acp_ext_disable.html new file mode 100644 index 0000000000..7dc3f6ec97 --- /dev/null +++ b/phpBB/adm/style/acp_ext_disable.html @@ -0,0 +1,34 @@ +<!-- INCLUDE overall_header.html --> + + <a name="maincontent"></a> + + <h1>{L_EXTENSIONS_ADMIN}</h1> + + <p>{L_EXTENSIONS_EXPLAIN}</p> + <p>{L_DISABLE_EXPLAIN}</p> + + <!-- IF PRE --> + <div class="errorbox"> + <p>{L_DISABLE_CONFIRM}</p> + </div> + + <form id="acp_extensions" method="post" action="{U_DISABLE}"> + <fieldset class="submit-buttons"> + <legend>{L_DISABLE}</legend> + <input class="button1" type="submit" name="disable" value="{L_DISABLE}" /> + <input class="button2" type="submit" name="cancel" value="{L_CANCEL}" /> + </fieldset> + </form> + <!-- ELSEIF S_NEXT_STEP --> + <div class="errorbox"> + <p>{L_DISABLE_IN_PROGRESS}</p> + </div> + <!-- ELSE --> + <div class="successbox"> + <p>{L_DISABLE_SUCCESS}</p> + <br /> + <p><a href="{U_RETURN}">{L_RETURN}</a></p> + </div> + <!-- ENDIF --> + +<!-- INCLUDE overall_footer.html --> diff --git a/phpBB/adm/style/acp_ext_enable.html b/phpBB/adm/style/acp_ext_enable.html new file mode 100644 index 0000000000..3f7be2c847 --- /dev/null +++ b/phpBB/adm/style/acp_ext_enable.html @@ -0,0 +1,34 @@ +<!-- INCLUDE overall_header.html --> + + <a name="maincontent"></a> + + <h1>{L_EXTENSIONS_ADMIN}</h1> + + <p>{L_EXTENSIONS_EXPLAIN}</p> + <p>{L_ENABLE_EXPLAIN}</p> + + <!-- IF PRE --> + <div class="errorbox"> + <p>{L_ENABLE_CONFIRM}</p> + </div> + + <form id="acp_extensions" method="post" action="{U_ENABLE}"> + <fieldset class="submit-buttons"> + <legend>{L_ENABLE}</legend> + <input class="button1" type="submit" name="enable" value="{L_ENABLE}" /> + <input class="button2" type="submit" name="cancel" value="{L_CANCEL}" /> + </fieldset> + </form> + <!-- ELSEIF S_NEXT_STEP --> + <div class="errorbox"> + <p>{L_ENABLE_IN_PROGRESS}</p> + </div> + <!-- ELSE --> + <div class="successbox"> + <p>{L_ENABLE_SUCCESS}</p> + <br /> + <p><a href="{U_RETURN}">{L_RETURN}</a></p> + </div> + <!-- ENDIF --> + +<!-- INCLUDE overall_footer.html --> diff --git a/phpBB/adm/style/acp_ext_list.html b/phpBB/adm/style/acp_ext_list.html new file mode 100644 index 0000000000..53de0b4d12 --- /dev/null +++ b/phpBB/adm/style/acp_ext_list.html @@ -0,0 +1,61 @@ +<!-- INCLUDE overall_header.html --> + +<a name="maincontent"></a> + + <h1>{L_EXTENSIONS_ADMIN}</h1> + + <p>{L_EXTENSIONS_EXPLAIN}</p> + + <table cellspacing="1"> + <col class="row1" ><col class="row2" ><col class="row2" > + <thead> + <tr> + <th>{L_EXTENSION_NAME}</th> + <th>{L_EXTENSION_OPTIONS}</th> + <th>{L_EXTENSION_ACTIONS}</th> + </tr> + </thead> + <tbody> + <!-- IF .enabled --> + <tr> + <td class="row3" colspan="3"> + <strong>{L_ENABLED} {L_EXTENSIONS}</strong> + </td> + </tr> + <!-- BEGIN enabled --> + <tr class="ext_enabled"> + <td><strong>{enabled.META_DISPLAY_NAME}</strong></a></td> + <td style="text-align: center;"><a href="{enabled.U_DETAILS}">{L_DETAILS}</a></td> + <td style="text-align: center;"> + <!-- BEGIN actions --> + <a href="{enabled.actions.U_ACTION}" alt="{enabled.actions.L_ACTION}">{enabled.actions.L_ACTION}</a> + <!-- IF not enabled.actions.S_LAST_ROW --> | <!-- ENDIF --> + <!-- END actions --> + </td> + </tr> + <!-- END enabled --> + <!-- ENDIF --> + + <!-- IF .disabled --> + <tr> + <td class="row3" colspan="3"><strong>{L_DISABLED} {L_EXTENSIONS}</strong></td> + </tr> + <!-- BEGIN disabled --> + <tr class="ext_disabled"> + <td><strong>{disabled.META_DISPLAY_NAME}</strong></a></td> + <td style="text-align: center;"> + <!-- IF disabled.U_DETAILS --><a href="{disabled.U_DETAILS}">{L_DETAILS}</a><!-- ENDIF --> + </td> + <td style="text-align: center;"> + <!-- BEGIN actions --> + <a href="{disabled.actions.U_ACTION}" alt="{disabled.actions.L_ACTION}">{disabled.actions.L_ACTION}</a> + <!-- IF not disabled.actions.S_LAST_ROW --> | <!-- ENDIF --> + <!-- END actions --> + </td> + </tr> + <!-- END disabled --> + <!-- ENDIF --> + </tbody> + </table> + +<!-- INCLUDE overall_footer.html --> diff --git a/phpBB/adm/style/acp_ext_purge.html b/phpBB/adm/style/acp_ext_purge.html new file mode 100644 index 0000000000..00a58721cb --- /dev/null +++ b/phpBB/adm/style/acp_ext_purge.html @@ -0,0 +1,34 @@ +<!-- INCLUDE overall_header.html --> + + <a name="maincontent"></a> + + <h1>{L_EXTENSIONS_ADMIN}</h1> + + <p>{L_EXTENSIONS_EXPLAIN}</p> + <p>{L_PURGE_EXPLAIN}</p> + + <!-- IF PRE --> + <div class="errorbox"> + <p>{L_PURGE_CONFIRM}</p> + </div> + + <form id="acp_extensions" method="post" action="{U_PURGE}"> + <fieldset class="submit-buttons"> + <legend>{L_PURGE}</legend> + <input class="button1" type="submit" name="purge" value="{L_PURGE}" /> + <input class="button2" type="submit" name="cancel" value="{L_CANCEL}" /> + </fieldset> + </form> + <!-- ELSEIF S_NEXT_STEP --> + <div class="errorbox"> + <p>{L_PURGE_IN_PROGRESS}</p> + </div> + <!-- ELSE --> + <div class="successbox"> + <p>{L_PURGE_SUCCESS}</p> + <br /> + <p><a href="{U_RETURN}">{L_RETURN}</a></p> + </div> + <!-- ENDIF --> + +<!-- INCLUDE overall_footer.html --> diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index 048a24a328..9a3706c2f0 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -112,13 +112,13 @@ <fieldset> <legend>{L_FORUM_SETTINGS}</legend> <dl> - <dt><label for="forum_type">{L_FORUM_TYPE}:</label></dt> + <dt><label for="forum_type">{L_FORUM_TYPE}{L_COLON}</label></dt> <dd><select id="forum_type" name="forum_type" onchange="display_options(this.options[this.selectedIndex].value);">{S_FORUM_TYPE_OPTIONS}</select></dd> </dl> <!-- IF not S_ADD_ACTION and S_FORUM_ORIG_POST --> <div id="type_actions"> <dl> - <dt><label for="type_action">{L_DECIDE_MOVE_DELETE_CONTENT}:</label></dt> + <dt><label for="type_action">{L_DECIDE_MOVE_DELETE_CONTENT}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="type_action" value="delete"<!-- IF not S_MOVE_FORUM_OPTIONS --> checked="checked" id="type_action"<!-- ENDIF --> /> {L_DELETE_ALL_POSTS}</label></dd> <!-- IF S_MOVE_FORUM_OPTIONS --><dd><label><input type="radio" class="radio" name="type_action" id="type_action" value="move" checked="checked" /> {L_MOVE_POSTS_TO}</label> <select name="to_forum_id">{S_MOVE_FORUM_OPTIONS}</select></dd><!-- ENDIF --> </dl> @@ -127,7 +127,7 @@ <!-- IF not S_ADD_ACTION and S_FORUM_ORIG_CAT and S_HAS_SUBFORUMS --> <div id="cat_to_link_actions"> <dl> - <dt><label for="action_subforums">{L_DECIDE_MOVE_DELETE_SUBFORUMS}:</label></dt> + <dt><label for="action_subforums">{L_DECIDE_MOVE_DELETE_SUBFORUMS}{L_COLON}</label></dt> <!-- IF S_FORUMS_LIST --> <dd><label><input type="radio" class="radio" id="action_subforums" name="action_subforums" value="move" checked="checked" /> {L_MOVE_SUBFORUMS_TO}</label> <select name="subforums_to_id">{S_FORUMS_LIST}</select></dd> <!-- ELSE --> @@ -137,49 +137,49 @@ </div> <!-- ENDIF --> <dl> - <dt><label for="parent">{L_FORUM_PARENT}:</label></dt> + <dt><label for="parent">{L_FORUM_PARENT}{L_COLON}</label></dt> <dd><select id="parent" name="forum_parent_id"><option value="0"<!-- IF not S_FORUM_PARENT_ID --> selected="selected"<!-- ENDIF -->>{L_NO_PARENT}</option>{S_PARENT_OPTIONS}</select></dd> </dl> <!-- IF S_CAN_COPY_PERMISSIONS --> <dl> - <dt><label for="forum_perm_from">{L_COPY_PERMISSIONS}:</label><br /><span>{L_COPY_PERMISSIONS_EXPLAIN}</span></dt> + <dt><label for="forum_perm_from">{L_COPY_PERMISSIONS}{L_COLON}</label><br /><span>{L_COPY_PERMISSIONS_EXPLAIN}</span></dt> <dd><select id="forum_perm_from" name="forum_perm_from"><option value="0">{L_NO_PERMISSIONS}</option>{S_FORUM_OPTIONS}</select></dd> </dl> <!-- ENDIF --> <dl> - <dt><label for="forum_name">{L_FORUM_NAME}:</label></dt> + <dt><label for="forum_name">{L_FORUM_NAME}{L_COLON}</label></dt> <dd><input class="text medium" type="text" id="forum_name" name="forum_name" value="{FORUM_NAME}" maxlength="255" /></dd> </dl> <dl> - <dt><label for="forum_desc">{L_FORUM_DESC}:</label><br /><span>{L_FORUM_DESC_EXPLAIN}</span></dt> + <dt><label for="forum_desc">{L_FORUM_DESC}{L_COLON}</label><br /><span>{L_FORUM_DESC_EXPLAIN}</span></dt> <dd><textarea id="forum_desc" name="forum_desc" rows="5" cols="45">{FORUM_DESC}</textarea></dd> <dd><label><input type="checkbox" class="radio" name="desc_parse_bbcode"<!-- IF S_DESC_BBCODE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_BBCODE}</label> <label><input type="checkbox" class="radio" name="desc_parse_smilies"<!-- IF S_DESC_SMILIES_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_SMILIES}</label> <label><input type="checkbox" class="radio" name="desc_parse_urls"<!-- IF S_DESC_URLS_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_URLS}</label></dd> </dl> <dl> - <dt><label for="forum_image">{L_FORUM_IMAGE}:</label><br /><span>{L_FORUM_IMAGE_EXPLAIN}</span></dt> + <dt><label for="forum_image">{L_FORUM_IMAGE}{L_COLON}</label><br /><span>{L_FORUM_IMAGE_EXPLAIN}</span></dt> <dd><input class="text medium" type="text" id="forum_image" name="forum_image" value="{FORUM_IMAGE}" maxlength="255" /></dd> <!-- IF FORUM_IMAGE_SRC --> <dd><img src="{FORUM_IMAGE_SRC}" alt="{L_FORUM_IMAGE}" /></dd> <!-- ENDIF --> </dl> <dl> - <dt><label for="forum_password">{L_FORUM_PASSWORD}:</label><br /><span>{L_FORUM_PASSWORD_EXPLAIN}</span></dt> + <dt><label for="forum_password">{L_FORUM_PASSWORD}{L_COLON}</label><br /><span>{L_FORUM_PASSWORD_EXPLAIN}</span></dt> <dd><input type="password" id="forum_password" name="forum_password" value="<!-- IF S_FORUM_PASSWORD_SET -->      <!-- ENDIF -->" autocomplete="off" /></dd> </dl> <dl> - <dt><label for="forum_password_confirm">{L_FORUM_PASSWORD_CONFIRM}:</label><br /><span>{L_FORUM_PASSWORD_CONFIRM_EXPLAIN}</span></dt> + <dt><label for="forum_password_confirm">{L_FORUM_PASSWORD_CONFIRM}{L_COLON}</label><br /><span>{L_FORUM_PASSWORD_CONFIRM_EXPLAIN}</span></dt> <dd><input type="password" id="forum_password_confirm" name="forum_password_confirm" value="<!-- IF S_FORUM_PASSWORD_SET -->      <!-- ENDIF -->" autocomplete="off" /></dd> </dl> <!-- IF S_FORUM_PASSWORD_SET --> <dl> - <dt><label for="forum_password_unset">{L_FORUM_PASSWORD_UNSET}:</label><br /><span>{L_FORUM_PASSWORD_UNSET_EXPLAIN}</span></dt> + <dt><label for="forum_password_unset">{L_FORUM_PASSWORD_UNSET}{L_COLON}</label><br /><span>{L_FORUM_PASSWORD_UNSET_EXPLAIN}</span></dt> <dd><input id="forum_password_unset" name="forum_password_unset" type="checkbox" /></dd> </dl> <!-- ENDIF --> <dl> - <dt><label for="forum_style">{L_FORUM_STYLE}:</label></dt> + <dt><label for="forum_style">{L_FORUM_STYLE}{L_COLON}</label></dt> <dd><select id="forum_style" name="forum_style"><option value="0">{L_DEFAULT_STYLE}</option>{S_STYLES_OPTIONS}</select></dd> </dl> </fieldset> @@ -188,7 +188,7 @@ <fieldset> <legend>{L_GENERAL_FORUM_SETTINGS}</legend> <dl> - <dt><label for="display_active">{L_DISPLAY_ACTIVE_TOPICS}:</label><br /><span>{L_DISPLAY_ACTIVE_TOPICS_EXPLAIN}</span></dt> + <dt><label for="display_active">{L_DISPLAY_ACTIVE_TOPICS}{L_COLON}</label><br /><span>{L_DISPLAY_ACTIVE_TOPICS_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" name="display_active" value="1"<!-- IF S_ENABLE_ACTIVE_TOPICS --> id="display_active" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="display_active" value="0"<!-- IF not S_ENABLE_ACTIVE_TOPICS --> id="display_active" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> @@ -199,46 +199,46 @@ <fieldset> <legend>{L_GENERAL_FORUM_SETTINGS}</legend> <dl> - <dt><label for="forum_status">{L_FORUM_STATUS}:</label></dt> + <dt><label for="forum_status">{L_FORUM_STATUS}{L_COLON}</label></dt> <dd><select id="forum_status" name="forum_status">{S_STATUS_OPTIONS}</select></dd> </dl> <dl> - <dt><label for="display_subforum_list">{L_LIST_SUBFORUMS}:</label><br /><span>{L_LIST_SUBFORUMS_EXPLAIN}</span></dt> + <dt><label for="display_subforum_list">{L_LIST_SUBFORUMS}{L_COLON}</label><br /><span>{L_LIST_SUBFORUMS_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" name="display_subforum_list" value="1"<!-- IF S_DISPLAY_SUBFORUM_LIST --> id="display_subforum_list" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="display_subforum_list" value="0"<!-- IF not S_DISPLAY_SUBFORUM_LIST --> id="display_subforum_list" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="display_on_index">{L_LIST_INDEX}:</label><br /><span>{L_LIST_INDEX_EXPLAIN}</span></dt> + <dt><label for="display_on_index">{L_LIST_INDEX}{L_COLON}</label><br /><span>{L_LIST_INDEX_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" name="display_on_index" value="1"<!-- IF S_DISPLAY_ON_INDEX --> id="display_on_index" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="display_on_index" value="0"<!-- IF not S_DISPLAY_ON_INDEX --> id="display_on_index" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="enable_post_review">{L_ENABLE_POST_REVIEW}:</label><br /><span>{L_ENABLE_POST_REVIEW_EXPLAIN}</span></dt> + <dt><label for="enable_post_review">{L_ENABLE_POST_REVIEW}{L_COLON}</label><br /><span>{L_ENABLE_POST_REVIEW_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" name="enable_post_review" value="1"<!-- IF S_ENABLE_POST_REVIEW --> id="enable_post_review" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="enable_post_review" value="0"<!-- IF not S_ENABLE_POST_REVIEW --> id="enable_post_review" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="enable_quick_reply">{L_ENABLE_QUICK_REPLY}:</label><br /><span>{L_ENABLE_QUICK_REPLY_EXPLAIN}</span></dt> + <dt><label for="enable_quick_reply">{L_ENABLE_QUICK_REPLY}{L_COLON}</label><br /><span>{L_ENABLE_QUICK_REPLY_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" name="enable_quick_reply" value="1"<!-- IF S_ENABLE_QUICK_REPLY --> id="enable_quick_reply" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="enable_quick_reply" value="0"<!-- IF not S_ENABLE_QUICK_REPLY --> id="enable_quick_reply" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="enable_indexing">{L_ENABLE_INDEXING}:</label><br /><span>{L_ENABLE_INDEXING_EXPLAIN}</span></dt> + <dt><label for="enable_indexing">{L_ENABLE_INDEXING}{L_COLON}</label><br /><span>{L_ENABLE_INDEXING_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" name="enable_indexing" value="1"<!-- IF S_ENABLE_INDEXING --> id="enable_indexing" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="enable_indexing" value="0"<!-- IF not S_ENABLE_INDEXING --> id="enable_indexing" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="enable_icons">{L_ENABLE_TOPIC_ICONS}:</label></dt> + <dt><label for="enable_icons">{L_ENABLE_TOPIC_ICONS}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="enable_icons" value="1"<!-- IF S_TOPIC_ICONS --> id="enable_icons" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="enable_icons" value="0"<!-- IF not S_TOPIC_ICONS --> id="enable_icons" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="display_recent">{L_ENABLE_RECENT}:</label><br /><span>{L_ENABLE_RECENT_EXPLAIN}</span></dt> + <dt><label for="display_recent">{L_ENABLE_RECENT}{L_COLON}</label><br /><span>{L_ENABLE_RECENT_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" name="display_recent" value="1"<!-- IF S_DISPLAY_ACTIVE_TOPICS --> id="display_recent" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="display_recent" value="0"<!-- IF not S_DISPLAY_ACTIVE_TOPICS --> id="display_recent" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="topics_per_page">{L_FORUM_TOPICS_PAGE}:</label><br /><span>{L_FORUM_TOPICS_PAGE_EXPLAIN}</span></dt> + <dt><label for="topics_per_page">{L_FORUM_TOPICS_PAGE}{L_COLON}</label><br /><span>{L_FORUM_TOPICS_PAGE_EXPLAIN}</span></dt> <dd><input type="text" id="topics_per_page" name="topics_per_page" value="{TOPICS_PER_PAGE}" size="4" maxlength="4" /></dd> </dl> </fieldset> @@ -246,34 +246,34 @@ <fieldset> <legend>{L_FORUM_PRUNE_SETTINGS}</legend> <dl> - <dt><label for="enable_prune">{L_FORUM_AUTO_PRUNE}:</label><br /><span>{L_FORUM_AUTO_PRUNE_EXPLAIN}</span></dt> + <dt><label for="enable_prune">{L_FORUM_AUTO_PRUNE}{L_COLON}</label><br /><span>{L_FORUM_AUTO_PRUNE_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" name="enable_prune" value="1"<!-- IF S_PRUNE_ENABLE --> id="enable_prune" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="enable_prune" value="0"<!-- IF not S_PRUNE_ENABLE --> id="enable_prune" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="prune_freq">{L_AUTO_PRUNE_FREQ}:</label><br /><span>{L_AUTO_PRUNE_FREQ_EXPLAIN}</span></dt> + <dt><label for="prune_freq">{L_AUTO_PRUNE_FREQ}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_FREQ_EXPLAIN}</span></dt> <dd><input type="text" id="prune_freq" name="prune_freq" value="{PRUNE_FREQ}" maxlength="4" size="4" /> {L_DAYS}</dd> </dl> <dl> - <dt><label for="prune_days">{L_AUTO_PRUNE_DAYS}:</label><br /><span>{L_AUTO_PRUNE_DAYS_EXPLAIN}</span></dt> + <dt><label for="prune_days">{L_AUTO_PRUNE_DAYS}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_DAYS_EXPLAIN}</span></dt> <dd><input type="text" id="prune_days" name="prune_days" value="{PRUNE_DAYS}" maxlength="4" size="4" /> {L_DAYS}</dd> </dl> <dl> - <dt><label for="prune_viewed">{L_AUTO_PRUNE_VIEWED}:</label><br /><span>{L_AUTO_PRUNE_VIEWED_EXPLAIN}</span></dt> + <dt><label for="prune_viewed">{L_AUTO_PRUNE_VIEWED}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_VIEWED_EXPLAIN}</span></dt> <dd><input type="text" id="prune_viewed" name="prune_viewed" value="{PRUNE_VIEWED}" maxlength="4" size="4" /> {L_DAYS}</dd> </dl> <dl> - <dt><label for="prune_old_polls">{L_PRUNE_OLD_POLLS}:</label><br /><span>{L_PRUNE_OLD_POLLS_EXPLAIN}</span></dt> + <dt><label for="prune_old_polls">{L_PRUNE_OLD_POLLS}{L_COLON}</label><br /><span>{L_PRUNE_OLD_POLLS_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" name="prune_old_polls" value="1"<!-- IF S_PRUNE_OLD_POLLS --> id="prune_old_polls" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="prune_old_polls" value="0"<!-- IF not S_PRUNE_OLD_POLLS --> id="prune_old_polls" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="prune_announce">{L_PRUNE_ANNOUNCEMENTS}:</label></dt> + <dt><label for="prune_announce">{L_PRUNE_ANNOUNCEMENTS}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="prune_announce" value="1"<!-- IF S_PRUNE_ANNOUNCE --> id="prune_announce" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="prune_announce" value="0"<!-- IF not S_PRUNE_ANNOUNCE --> id="prune_announce" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="prune_sticky">{L_PRUNE_STICKY}:</label></dt> + <dt><label for="prune_sticky">{L_PRUNE_STICKY}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="prune_sticky" value="1"<!-- IF S_PRUNE_STICKY --> id="prune_sticky" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="prune_sticky" value="0"<!-- IF not S_PRUNE_STICKY --> id="prune_sticky" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> @@ -284,16 +284,16 @@ <fieldset> <legend>{L_GENERAL_FORUM_SETTINGS}</legend> <dl> - <dt><label for="link_display_on_index">{L_LIST_INDEX}:</label><br /><span>{L_LIST_INDEX_EXPLAIN}</span></dt> + <dt><label for="link_display_on_index">{L_LIST_INDEX}{L_COLON}</label><br /><span>{L_LIST_INDEX_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" name="link_display_on_index" value="1"<!-- IF S_DISPLAY_ON_INDEX --> id="link_display_on_index" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="link_display_on_index" value="0"<!-- IF not S_DISPLAY_ON_INDEX --> id="link_display_on_index" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="forum_link">{L_FORUM_LINK}:</label><br /><span>{L_FORUM_LINK_EXPLAIN}</span></dt> + <dt><label for="forum_link">{L_FORUM_LINK}{L_COLON}</label><br /><span>{L_FORUM_LINK_EXPLAIN}</span></dt> <dd><input class="text medium" type="text" id="forum_link" name="forum_link" value="{FORUM_DATA_LINK}" maxlength="255" /></dd> </dl> <dl> - <dt><label for="forum_link_track">{L_FORUM_LINK_TRACK}:</label><br /><span>{L_FORUM_LINK_TRACK_EXPLAIN}</span></dt> + <dt><label for="forum_link_track">{L_FORUM_LINK_TRACK}{L_COLON}</label><br /><span>{L_FORUM_LINK_TRACK_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" name="forum_link_track" value="1"<!-- IF S_FORUM_LINK_TRACK --> id="forum_link_track" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="forum_link_track" value="0"<!-- IF not S_FORUM_LINK_TRACK --> id="forum_link_track" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> @@ -304,17 +304,17 @@ <fieldset> <legend>{L_FORUM_RULES}</legend> <dl> - <dt><label for="forum_rules_link">{L_FORUM_RULES_LINK}:</label><br /><span>{L_FORUM_RULES_LINK_EXPLAIN}</span></dt> + <dt><label for="forum_rules_link">{L_FORUM_RULES_LINK}{L_COLON}</label><br /><span>{L_FORUM_RULES_LINK_EXPLAIN}</span></dt> <dd><input class="text medium" type="text" id="forum_rules_link" name="forum_rules_link" value="{FORUM_RULES_LINK}" maxlength="255" /></dd> </dl> <!-- IF FORUM_RULES_PREVIEW --> <dl> - <dt><label>{L_FORUM_RULES_PREVIEW}:</label></dt> + <dt><label>{L_FORUM_RULES_PREVIEW}{L_COLON}</label></dt> <dd>{FORUM_RULES_PREVIEW}</dd> </dl> <!-- ENDIF --> <dl> - <dt><label for="forum_rules">{L_FORUM_RULES}:</label><br /><span>{L_FORUM_RULES_EXPLAIN}</span></dt> + <dt><label for="forum_rules">{L_FORUM_RULES}{L_COLON}</label><br /><span>{L_FORUM_RULES_EXPLAIN}</span></dt> <dd><textarea id="forum_rules" name="forum_rules" rows="4" cols="70">{FORUM_RULES_PLAIN}</textarea></dd> <dd><label><input type="checkbox" class="radio" name="rules_parse_bbcode"<!-- IF S_BBCODE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_BBCODE}</label> <label><input type="checkbox" class="radio" name="rules_parse_smilies"<!-- IF S_SMILIES_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_SMILIES}</label> @@ -351,12 +351,12 @@ <fieldset> <legend>{L_FORUM_DELETE}</legend> <dl> - <dt><label>{L_FORUM_NAME}:</label></dt> + <dt><label>{L_FORUM_NAME}{L_COLON}</label></dt> <dd><strong>{FORUM_NAME}</strong></dd> </dl> <!-- IF S_FORUM_POST --> <dl> - <dt><label for="delete_action">{L_ACTION}:</label></dt> + <dt><label for="delete_action">{L_ACTION}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" id="delete_action" name="action_posts" value="delete" checked="checked" /> {L_DELETE_ALL_POSTS}</label></dd> <!-- IF S_MOVE_FORUM_OPTIONS --> <dd><label><input type="radio" class="radio" name="action_posts" value="move" /> {L_MOVE_POSTS_TO}</label> <select name="posts_to_id">{S_MOVE_FORUM_OPTIONS}</select></dd> @@ -365,7 +365,7 @@ <!-- ENDIF --> <!-- IF S_HAS_SUBFORUMS --> <dl> - <dt><label for="sub_delete_action">{L_ACTION}:</label></dt> + <dt><label for="sub_delete_action">{L_ACTION}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" id="sub_delete_action" name="action_subforums" value="delete" checked="checked" /> {L_DELETE_SUBFORUMS}</label></dd> <!-- IF S_FORUMS_LIST --> <dd><label><input type="radio" class="radio" name="action_subforums" value="move" /> {L_MOVE_SUBFORUMS_TO}</label> <select name="subforums_to_id">{S_FORUMS_LIST}</select></dd> @@ -449,17 +449,17 @@ <!-- IF forums.FORUM_IMAGE --><div style="float: {S_CONTENT_FLOW_BEGIN}; margin-right: 5px;">{forums.FORUM_IMAGE}</div><!-- ENDIF --> <strong><!-- IF forums.S_FORUM_LINK -->{forums.FORUM_NAME}<!-- ELSE --><a href="{forums.U_FORUM}">{forums.FORUM_NAME}</a><!-- ENDIF --></strong> <!-- IF forums.FORUM_DESCRIPTION --><br /><span>{forums.FORUM_DESCRIPTION}</span><!-- ENDIF --> - <!-- IF forums.S_FORUM_POST --><br /><br /><span>{L_TOPICS}: <strong>{forums.FORUM_TOPICS}</strong> / {L_POSTS}: <strong>{forums.FORUM_POSTS}</strong></span><!-- ENDIF --> + <!-- IF forums.S_FORUM_POST --><br /><br /><span>{L_TOPICS}{L_COLON} <strong>{forums.FORUM_TOPICS}</strong> / {L_POSTS}{L_COLON} <strong>{forums.FORUM_POSTS}</strong></span><!-- ENDIF --> </td> <td style="vertical-align: top; width: 100px; text-align: right; white-space: nowrap;"> <!-- IF forums.S_FIRST_ROW && not forums.S_LAST_ROW --> <span class="up">{ICON_MOVE_UP_DISABLED}</span> - <span class="down"><a href="{forums.U_MOVE_DOWN}" data-ajax="forum_down">{ICON_MOVE_DOWN}</a></span> + <span class="down"><a href="{forums.U_MOVE_DOWN}" data-ajax="row_down" data-overlay="false">{ICON_MOVE_DOWN}</a></span> <!-- ELSEIF not forums.S_FIRST_ROW && not forums.S_LAST_ROW --> - <span class="up"><a href="{forums.U_MOVE_UP}" data-ajax="forum_up">{ICON_MOVE_UP}</a></span> - <span class="down"><a href="{forums.U_MOVE_DOWN}" data-ajax="forum_down">{ICON_MOVE_DOWN}</a></span> + <span class="up"><a href="{forums.U_MOVE_UP}" data-ajax="row_up" data-overlay="false">{ICON_MOVE_UP}</a></span> + <span class="down"><a href="{forums.U_MOVE_DOWN}" data-ajax="row_down" data-overlay="false">{ICON_MOVE_DOWN}</a></span> <!-- ELSEIF forums.S_LAST_ROW && not forums.S_FIRST_ROW --> - <span class="up"><a href="{forums.U_MOVE_UP}" data-ajax="forum_up">{ICON_MOVE_UP}</a></span> + <span class="up"><a href="{forums.U_MOVE_UP}" data-ajax="row_up" data-overlay="false">{ICON_MOVE_UP}</a></span> <span class="down">{ICON_MOVE_DOWN_DISABLED}</span> <!-- ELSE --> <span class="up">{ICON_MOVE_UP_DISABLED}</span> @@ -482,7 +482,7 @@ <form id="fselect" method="post" action="{U_SEL_ACTION}"> <fieldset class="quick"> - {L_SELECT_FORUM}: <select name="parent_id" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit(); }">{FORUM_BOX}</select> + {L_SELECT_FORUM}{L_COLON} <select name="parent_id" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit(); }">{FORUM_BOX}</select> <input class="button2" type="submit" value="{L_GO}" /> {S_FORM_TOKEN} diff --git a/phpBB/adm/style/acp_forums_copy_perm.html b/phpBB/adm/style/acp_forums_copy_perm.html index acec3c1967..1fcf2f62a4 100644 --- a/phpBB/adm/style/acp_forums_copy_perm.html +++ b/phpBB/adm/style/acp_forums_copy_perm.html @@ -9,7 +9,7 @@ <fieldset> <dl> - <dt><label for="forum_perm_from">{L_COPY_PERMISSIONS}:</label><br /><span>{L_COPY_PERMISSIONS_EXPLAIN}</span></dt> + <dt><label for="forum_perm_from">{L_COPY_PERMISSIONS}{L_COLON}</label><br /><span>{L_COPY_PERMISSIONS_EXPLAIN}</span></dt> <dd><select id="forum_perm_from" name="forum_perm_from"><option value="0">{L_NO_PERMISSIONS}</option>{S_FORUM_OPTIONS}</select></dd> </dl> <div style="text-align: center;">{S_FORM_TOKEN}{S_HIDDEN_FIELDS} diff --git a/phpBB/adm/style/acp_groups.html b/phpBB/adm/style/acp_groups.html index ed94fa985e..4701bf702f 100644 --- a/phpBB/adm/style/acp_groups.html +++ b/phpBB/adm/style/acp_groups.html @@ -22,11 +22,11 @@ <fieldset> <legend>{L_GROUP_DETAILS}</legend> <dl> - <dt><label<!-- IF not S_SPECIAL_GROUP --> for="group_name"<!-- ENDIF -->>{L_GROUP_NAME}:</label></dt> + <dt><label<!-- IF not S_SPECIAL_GROUP --> for="group_name"<!-- ENDIF -->>{L_GROUP_NAME}{L_COLON}</label></dt> <dd><!-- IF S_SPECIAL_GROUP --><strong>{GROUP_NAME}</strong><!-- ENDIF --><input name="group_name" type="<!-- IF S_SPECIAL_GROUP -->hidden<!-- ELSE -->text<!-- ENDIF -->" id="group_name" value="{GROUP_INTERNAL_NAME}" /></dd> </dl> <dl> - <dt><label for="group_desc">{L_GROUP_DESC}:</label></dt> + <dt><label for="group_desc">{L_GROUP_DESC}{L_COLON}</label></dt> <dd><textarea id="group_desc" name="group_desc" rows="5" cols="45">{GROUP_DESC}</textarea></dd> <dd><label><input type="checkbox" class="radio" name="desc_parse_bbcode"<!-- IF S_DESC_BBCODE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_BBCODE}</label> <label><input type="checkbox" class="radio" name="desc_parse_smilies"<!-- IF S_DESC_SMILIES_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_SMILIES}</label> @@ -34,7 +34,7 @@ </dl> <!-- IF not S_SPECIAL_GROUP --> <dl> - <dt><label for="group_type">{L_GROUP_TYPE}:</label><br /><span>{L_GROUP_TYPE_EXPLAIN}</span></dt> + <dt><label for="group_type">{L_GROUP_TYPE}{L_COLON}</label><br /><span>{L_GROUP_TYPE_EXPLAIN}</span></dt> <dd> <label><input name="group_type" type="radio" class="radio" id="group_type" value="{GROUP_TYPE_FREE}"{GROUP_FREE} /> {L_GROUP_OPEN}</label> <label><input name="group_type" type="radio" class="radio" value="{GROUP_TYPE_OPEN}"{GROUP_OPEN} /> {L_GROUP_REQUEST}</label> @@ -48,7 +48,7 @@ <!-- IF S_ADD_GROUP and S_GROUP_PERM --> <dl> - <dt><label for="group_perm_from">{L_COPY_PERMISSIONS}:</label><br /><span>{L_COPY_PERMISSIONS_EXPLAIN}</span></dt> + <dt><label for="group_perm_from">{L_COPY_PERMISSIONS}{L_COLON}</label><br /><span>{L_COPY_PERMISSIONS_EXPLAIN}</span></dt> <dd><select id="group_perm_from" name="group_perm_from"><option value="0">{L_NO_PERMISSIONS}</option>{S_GROUP_OPTIONS}</select></dd> </dl> <!-- ENDIF --> @@ -58,24 +58,24 @@ <legend>{L_GROUP_OPTIONS_SAVE}</legend> <!-- IF S_USER_FOUNDER --> <dl> - <dt><label for="group_founder_manage">{L_GROUP_FOUNDER_MANAGE}:</label><br /><span>{L_GROUP_FOUNDER_MANAGE_EXPLAIN}</span></dt> + <dt><label for="group_founder_manage">{L_GROUP_FOUNDER_MANAGE}{L_COLON}</label><br /><span>{L_GROUP_FOUNDER_MANAGE_EXPLAIN}</span></dt> <dd><input name="group_founder_manage" type="checkbox" value="1" class="radio" id="group_founder_manage"{GROUP_FOUNDER_MANAGE} /></dd> </dl> <!-- ENDIF --> <dl> - <dt><label for="group_skip_auth">{L_GROUP_SKIP_AUTH}:</label><br /><span>{L_GROUP_SKIP_AUTH_EXPLAIN}</span></dt> + <dt><label for="group_skip_auth">{L_GROUP_SKIP_AUTH}{L_COLON}</label><br /><span>{L_GROUP_SKIP_AUTH_EXPLAIN}</span></dt> <dd><input name="group_skip_auth" type="checkbox" value="1" class="radio" id="group_skip_auth"{GROUP_SKIP_AUTH} /></dd> </dl> <dl> - <dt><label for="group_legend">{L_GROUP_LEGEND}:</label></dt> + <dt><label for="group_legend">{L_GROUP_LEGEND}{L_COLON}</label></dt> <dd><input name="group_legend" type="checkbox" value="1" class="radio" id="group_legend"{GROUP_LEGEND} /></dd> </dl> <dl> - <dt><label for="group_teampage">{L_GROUP_TEAMPAGE}:</label></dt> + <dt><label for="group_teampage">{L_GROUP_TEAMPAGE}{L_COLON}</label></dt> <dd><input name="group_teampage" type="checkbox" value="1" class="radio" id="group_teampage"{GROUP_TEAMPAGE} /></dd> </dl> <dl> - <dt><label for="group_receive_pm">{L_GROUP_RECEIVE_PM}:</label><br /><span>{L_GROUP_RECEIVE_PM_EXPLAIN}</span></dt> + <dt><label for="group_receive_pm">{L_GROUP_RECEIVE_PM}{L_COLON}</label><br /><span>{L_GROUP_RECEIVE_PM_EXPLAIN}</span></dt> <dd><input name="group_receive_pm" type="checkbox" value="1" class="radio" id="group_receive_pm"{GROUP_RECEIVE_PM} /></dd> </dl> </fieldset> @@ -83,19 +83,19 @@ <fieldset> <legend>{L_GROUP_SETTINGS_SAVE}</legend> <dl> - <dt><label for="group_message_limit">{L_GROUP_MESSAGE_LIMIT}:</label><br /><span>{L_GROUP_MESSAGE_LIMIT_EXPLAIN}</span></dt> + <dt><label for="group_message_limit">{L_GROUP_MESSAGE_LIMIT}{L_COLON}</label><br /><span>{L_GROUP_MESSAGE_LIMIT_EXPLAIN}</span></dt> <dd><input name="group_message_limit" type="text" id="group_message_limit" maxlength="4" size="4" value="{GROUP_MESSAGE_LIMIT}" /></dd> </dl> <dl> - <dt><label for="group_max_recipients">{L_GROUP_MAX_RECIPIENTS}:</label><br /><span>{L_GROUP_MAX_RECIPIENTS_EXPLAIN}</span></dt> + <dt><label for="group_max_recipients">{L_GROUP_MAX_RECIPIENTS}{L_COLON}</label><br /><span>{L_GROUP_MAX_RECIPIENTS_EXPLAIN}</span></dt> <dd><input name="group_max_recipients" type="text" id="group_max_recipients" maxlength="10" size="4" value="{GROUP_MAX_RECIPIENTS}" /></dd> </dl> <dl> - <dt><label for="group_colour">{L_GROUP_COLOR}:</label><br /><span>{L_GROUP_COLOR_EXPLAIN}</span></dt> + <dt><label for="group_colour">{L_GROUP_COLOR}{L_COLON}</label><br /><span>{L_GROUP_COLOR_EXPLAIN}</span></dt> <dd><input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="6" maxlength="6" /><!-- IF GROUP_COLOUR --> <span style="background-color: #{GROUP_COLOUR}"> </span><!-- ENDIF --> <span>[ <a href="{U_SWATCH}" onclick="popup(this.href, 636, 150, '_swatch'); return false">{L_COLOUR_SWATCH}</a> ]</span></dd> </dl> <dl> - <dt><label for="group_rank">{L_GROUP_RANK}:</label></dt> + <dt><label for="group_rank">{L_GROUP_RANK}{L_COLON}</label></dt> <dd><select name="group_rank" id="group_rank">{S_RANK_OPTIONS}</select></dd> </dl> </fieldset> @@ -103,32 +103,32 @@ <fieldset> <legend>{L_GROUP_AVATAR}</legend> <dl> - <dt><label>{L_CURRENT_IMAGE}:</label><br /><span>{L_AVATAR_EXPLAIN}</span></dt> + <dt><label>{L_CURRENT_IMAGE}{L_COLON}</label><br /><span>{L_AVATAR_EXPLAIN}</span></dt> <dd>{AVATAR_IMAGE}</dd> <dd><label><input type="checkbox" class="radio" name="delete" /> {L_DELETE_AVATAR}</label></dd> </dl> <!-- IF not S_IN_AVATAR_GALLERY --> <!-- IF S_CAN_UPLOAD --> <dl> - <dt><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}:</label></dt> + <dt><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}{L_COLON}</label></dt> <dd><input type="file" id="uploadfile" name="uploadfile" /></dd> </dl> <dl> - <dt><label for="uploadurl">{L_UPLOAD_AVATAR_URL}:</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></dt> + <dt><label for="uploadurl">{L_UPLOAD_AVATAR_URL}{L_COLON}</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></dt> <dd><input name="uploadurl" type="text" id="uploadurl" value="" /></dd> </dl> <!-- ENDIF --> <dl> - <dt><label for="remotelink">{L_LINK_REMOTE_AVATAR}:</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></dt> + <dt><label for="remotelink">{L_LINK_REMOTE_AVATAR}{L_COLON}</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></dt> <dd><input name="remotelink" type="text" id="remotelink" value="" /></dd> </dl> <dl> - <dt><label for="width">{L_LINK_REMOTE_SIZE}:</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt> + <dt><label for="width">{L_LINK_REMOTE_SIZE}{L_COLON}</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt> <dd><input name="width" type="text" id="width" size="3" value="{AVATAR_WIDTH}" /> <span>{L_PIXEL} × </span> <input type="text" name="height" size="3" value="{AVATAR_HEIGHT}" /> <span>{L_PIXEL}</span></dd> </dl> <!-- IF S_DISPLAY_GALLERY --> <dl> - <dt><label>{L_AVATAR_GALLERY}:</label></dt> + <dt><label>{L_AVATAR_GALLERY}{L_COLON}</label></dt> <dd><input class="button2" type="submit" name="display_gallery" value="{L_DISPLAY_GALLERY}" /></dd> </dl> <!-- ENDIF --> @@ -138,7 +138,7 @@ <fieldset> <legend>{L_AVATAR_GALLERY}</legend> <dl> - <dt><label for="category">{L_AVATAR_CATEGORY}:</label></dt> + <dt><label for="category">{L_AVATAR_CATEGORY}{L_COLON}</label></dt> <dd><select name="category" id="category">{S_CAT_OPTIONS}</select> <input class="button2" type="submit" value="{L_GO}" name="display_gallery" /></dd> </dl> <dl> @@ -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> @@ -258,17 +258,17 @@ <fieldset> <legend>{L_ADD_USERS}</legend> <dl> - <dt><label for="leader">{L_USER_GROUP_LEADER}:</label></dt> + <dt><label for="leader">{L_USER_GROUP_LEADER}{L_COLON}</label></dt> <dd><label><input name="leader" type="radio" class="radio" value="1" /> {L_YES}</label> <label><input name="leader" type="radio" class="radio" id="leader" value="0" checked="checked" /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="default">{L_USER_GROUP_DEFAULT}:</label><br /><span>{L_USER_GROUP_DEFAULT_EXPLAIN}</span></dt> + <dt><label for="default">{L_USER_GROUP_DEFAULT}{L_COLON}</label><br /><span>{L_USER_GROUP_DEFAULT_EXPLAIN}</span></dt> <dd><label><input name="default" type="radio" class="radio" value="1" /> {L_YES}</label> <label><input name="default" type="radio" class="radio" id="default" value="0" checked="checked" /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="usernames">{L_USERNAME}:</label><br /><span>{L_USERNAMES_EXPLAIN}</span></dt> + <dt><label for="usernames">{L_USERNAME}{L_COLON}</label><br /><span>{L_USERNAMES_EXPLAIN}</span></dt> <dd><textarea id="usernames" name="usernames" cols="40" rows="5"></textarea></dd> <dd>[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</dd> </dl> @@ -322,7 +322,7 @@ <fieldset class="quick"> <!-- IF S_GROUP_ADD --> - {L_CREATE_GROUP}: <input type="text" name="group_name" value="" /> <input class="button2" type="submit" name="submit" value="{L_SUBMIT}" /> + {L_CREATE_GROUP}{L_COLON} <input type="text" name="group_name" value="" /> <input class="button2" type="submit" name="submit" value="{L_SUBMIT}" /> <input type="hidden" name="add" value="1" /> <!-- ENDIF --> {S_FORM_TOKEN} diff --git a/phpBB/adm/style/acp_groups_position.html b/phpBB/adm/style/acp_groups_position.html index 3a03573756..1e309d4cbc 100644 --- a/phpBB/adm/style/acp_groups_position.html +++ b/phpBB/adm/style/acp_groups_position.html @@ -9,7 +9,7 @@ <fieldset> <legend>{L_LEGEND_SETTINGS}</legend> <dl> - <dt><label for="legend_sort_groupname">{L_LEGEND_SORT_GROUPNAME}:</label><br /><span>{L_LEGEND_SORT_GROUPNAME_EXPLAIN}</span></dt> + <dt><label for="legend_sort_groupname">{L_LEGEND_SORT_GROUPNAME}{L_COLON}</label><br /><span>{L_LEGEND_SORT_GROUPNAME_EXPLAIN}</span></dt> <dd> <label><input type="radio" name="legend_sort_groupname" class="radio" value="1"<!-- IF LEGEND_SORT_GROUPNAME --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" name="legend_sort_groupname" class="radio" value="0"<!-- IF not LEGEND_SORT_GROUPNAME --> checked="checked"<!-- ENDIF --> /> {L_NO}</label> @@ -82,7 +82,7 @@ <fieldset> <legend>{L_TEAMPAGE_SETTINGS}</legend> <dl> - <dt><label for="teampage_multiple">{L_TEAMPAGE_MEMBERSHIPS}:</label></dt> + <dt><label for="teampage_multiple">{L_TEAMPAGE_MEMBERSHIPS}{L_COLON}</label></dt> <dd> <label><input type="radio" name="teampage_memberships" class="radio" value="0"<!-- IF DISPLAY_MEMBERSHIPS == 0 --> checked="checked"<!-- ENDIF --> /> {L_TEAMPAGE_DISP_FIRST}</label><br /> <label><input type="radio" name="teampage_memberships" class="radio" value="1"<!-- IF DISPLAY_MEMBERSHIPS == 1 --> checked="checked"<!-- ENDIF --> /> {L_TEAMPAGE_DISP_DEFAULT}</label><br /> @@ -90,7 +90,7 @@ </dd> </dl> <dl> - <dt><label for="teampage_forums">{L_TEAMPAGE_FORUMS}:</label><br /><span>{L_TEAMPAGE_FORUMS_EXPLAIN}</span></dt> + <dt><label for="teampage_forums">{L_TEAMPAGE_FORUMS}{L_COLON}</label><br /><span>{L_TEAMPAGE_FORUMS_EXPLAIN}</span></dt> <dd> <label><input type="radio" name="teampage_forums" class="radio" value="1"<!-- IF DISPLAY_FORUMS --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" name="teampage_forums" class="radio" value="0"<!-- IF not DISPLAY_FORUMS --> checked="checked"<!-- ENDIF --> /> {L_NO}</label> diff --git a/phpBB/adm/style/acp_icons.html b/phpBB/adm/style/acp_icons.html index a8864d42f7..b9af20d5a2 100644 --- a/phpBB/adm/style/acp_icons.html +++ b/phpBB/adm/style/acp_icons.html @@ -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> diff --git a/phpBB/adm/style/acp_inactive.html b/phpBB/adm/style/acp_inactive.html index 0889eaf400..726c8c8b32 100644 --- a/phpBB/adm/style/acp_inactive.html +++ b/phpBB/adm/style/acp_inactive.html @@ -10,9 +10,9 @@ <div class="clearfix"></div> -<!-- IF PAGINATION --> +<!-- IF .pagination --> <div class="pagination"> - <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span> + <!-- INCLUDE pagination.html --> </div> <!-- ENDIF --> @@ -33,7 +33,7 @@ <td style="vertical-align: top;"> {inactive.USERNAME_FULL} - <!-- IF inactive.POSTS --><br />{L_POSTS}: <strong>{inactive.POSTS}</strong> [<a href="{inactive.U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a>]<!-- ENDIF --> + <!-- IF inactive.POSTS --><br />{L_POSTS}{L_COLON} <strong>{inactive.POSTS}</strong> [<a href="{inactive.U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a>]<!-- ENDIF --> </td> <td style="vertical-align: top;">{inactive.JOINED}</td> <td style="vertical-align: top;">{inactive.INACTIVE_DATE}</td> @@ -53,15 +53,15 @@ </table> <fieldset class="display-options"> - {L_DISPLAY_LOG}: {S_LIMIT_DAYS} {L_SORT_BY}: {S_SORT_KEY} {S_SORT_DIR}<!-- IF PAGINATION --> Users per page: <input class="inputbox autowidth" type="text" name="users_per_page" id="users_per_page" size="3" value="{USERS_PER_PAGE}" /><!-- ENDIF --> + {L_DISPLAY_LOG}{L_COLON} {S_LIMIT_DAYS} {L_SORT_BY}{L_COLON} {S_SORT_KEY} {S_SORT_DIR}<!-- IF .pagination --> Users per page{L_COLON} <input class="inputbox autowidth" type="text" name="users_per_page" id="users_per_page" size="3" value="{USERS_PER_PAGE}" /><!-- ENDIF --> <input class="button2" type="submit" value="{L_GO}" name="sort" /> </fieldset> <hr /> -<!-- IF PAGINATION --> +<!-- IF .pagination --> <div class="pagination"> - <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span> + <!-- INCLUDE pagination.html --> </div> <!-- ENDIF --> diff --git a/phpBB/adm/style/acp_jabber.html b/phpBB/adm/style/acp_jabber.html index 2ba1424bda..639bcd221f 100644 --- a/phpBB/adm/style/acp_jabber.html +++ b/phpBB/adm/style/acp_jabber.html @@ -21,35 +21,35 @@ <p>{L_JAB_GTALK_NOTE}</p> <!-- ENDIF --> <dl> - <dt><label for="jab_enable">{L_JAB_ENABLE}:</label><br /><span>{L_JAB_ENABLE_EXPLAIN}</span></dt> + <dt><label for="jab_enable">{L_JAB_ENABLE}{L_COLON}</label><br /><span>{L_JAB_ENABLE_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" id="jab_enable" name="jab_enable" value="1"<!-- IF JAB_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_ENABLED}</label> <label><input type="radio" class="radio" name="jab_enable" value="0"<!-- IF not JAB_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label></dd> </dl> <dl> - <dt><label for="jab_host">{L_JAB_SERVER}:</label><br /><span>{L_JAB_SERVER_EXPLAIN}</span></dt> + <dt><label for="jab_host">{L_JAB_SERVER}{L_COLON}</label><br /><span>{L_JAB_SERVER_EXPLAIN}</span></dt> <dd><input type="text" id="jab_host" name="jab_host" value="{JAB_HOST}" /></dd> </dl> <dl> - <dt><label for="jab_port">{L_JAB_PORT}:</label><br /><span>{L_JAB_PORT_EXPLAIN}</span></dt> + <dt><label for="jab_port">{L_JAB_PORT}{L_COLON}</label><br /><span>{L_JAB_PORT_EXPLAIN}</span></dt> <dd><input type="text" id="jab_port" name="jab_port" value="{JAB_PORT}" maxlength="5" size="5" /></dd> </dl> <dl> - <dt><label for="jab_username">{L_JAB_USERNAME}:</label><br /><span>{L_JAB_USERNAME_EXPLAIN}</span></dt> + <dt><label for="jab_username">{L_JAB_USERNAME}{L_COLON}</label><br /><span>{L_JAB_USERNAME_EXPLAIN}</span></dt> <dd><input type="text" id="jab_username" name="jab_username" value="{JAB_USERNAME}" /></dd> </dl> <dl> - <dt><label for="jab_password">{L_JAB_PASSWORD}:</label><br /><span>{L_JAB_PASSWORD_EXPLAIN}</span></dt> + <dt><label for="jab_password">{L_JAB_PASSWORD}{L_COLON}</label><br /><span>{L_JAB_PASSWORD_EXPLAIN}</span></dt> <dd><input type="password" id="jab_password" name="jab_password" value="{JAB_PASSWORD}" /></dd> </dl> <!-- IF S_CAN_USE_SSL --> <dl> - <dt><label for="jab_use_ssl">{L_JAB_USE_SSL}:</label><br /><span>{L_JAB_USE_SSL_EXPLAIN}</span></dt> + <dt><label for="jab_use_ssl">{L_JAB_USE_SSL}{L_COLON}</label><br /><span>{L_JAB_USE_SSL_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" id="jab_use_ssl" name="jab_use_ssl" value="1"<!-- IF JAB_USE_SSL --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="jab_use_ssl" value="0"<!-- IF not JAB_USE_SSL --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <!-- ENDIF --> <dl> - <dt><label for="jab_package_size">{L_JAB_PACKAGE_SIZE}:</label><br /><span>{L_JAB_PACKAGE_SIZE_EXPLAIN}</span></dt> + <dt><label for="jab_package_size">{L_JAB_PACKAGE_SIZE}{L_COLON}</label><br /><span>{L_JAB_PACKAGE_SIZE_EXPLAIN}</span></dt> <dd><input type="text" id="jab_package_size" name="jab_package_size" value="{JAB_PACKAGE_SIZE}" maxlength="5" size="5" /></dd> </dl> diff --git a/phpBB/adm/style/acp_language.html b/phpBB/adm/style/acp_language.html index 81276287c1..c400437049 100644 --- a/phpBB/adm/style/acp_language.html +++ b/phpBB/adm/style/acp_language.html @@ -13,7 +13,7 @@ <fieldset> <legend>{L_DOWNLOAD_AS}</legend> <dl> - <dt><label for="use_method">{L_DOWNLOAD_AS}:</label></dt> + <dt><label for="use_method">{L_DOWNLOAD_AS}{L_COLON}</label></dt> <dd>{RADIO_BUTTONS}</dd> </dl> @@ -35,19 +35,19 @@ <fieldset> <legend>{LANG_LOCAL_NAME}</legend> <dl> - <dt><label for="lang_english_name">{L_LANG_ENGLISH_NAME}:</label></dt> + <dt><label for="lang_english_name">{L_LANG_ENGLISH_NAME}{L_COLON}</label></dt> <dd><input type="text" id="lang_english_name" name="lang_english_name" value="{LANG_ENGLISH_NAME}" maxlength="100" /></dd> </dl> <dl> - <dt><label for="lang_local_name">{L_LANG_LOCAL_NAME}:</label></dt> + <dt><label for="lang_local_name">{L_LANG_LOCAL_NAME}{L_COLON}</label></dt> <dd><input type="text" id="lang_local_name" name="lang_local_name" value="{LANG_LOCAL_NAME}" maxlength="255" /></dd> </dl> <dl> - <dt><label>{L_LANG_ISO_CODE}:</label></dt> + <dt><label>{L_LANG_ISO_CODE}{L_COLON}</label></dt> <dd><strong>{LANG_ISO}</strong></dd> </dl> <dl> - <dt><label for="lang_author">{L_LANG_AUTHOR}:</label></dt> + <dt><label for="lang_author">{L_LANG_AUTHOR}{L_COLON}</label></dt> <dd><input type="text" id="lang_author" name="lang_author" value="{LANG_AUTHOR}" maxlength="255" /></dd> </dl> @@ -147,7 +147,7 @@ </tr> <tr> <td class="row3" style="text-align: right;"> - <!-- IF ALLOW_UPLOAD --> {L_UPLOAD_METHOD}: <!-- BEGIN buttons--><input type="radio" class="radio"<!-- IF buttons.S_FIRST_ROW --> id="method" checked="checked"<!-- ENDIF --> value="{buttons.VALUE}" name="method" /> {buttons.VALUE} <!-- END buttons --><input type="submit" name="upload_file" class="button2" value="{L_SUBMIT_AND_UPLOAD}" /><!-- ENDIF --></td> + <!-- IF ALLOW_UPLOAD --> {L_UPLOAD_METHOD}{L_COLON} <!-- BEGIN buttons--><input type="radio" class="radio"<!-- IF buttons.S_FIRST_ROW --> id="method" checked="checked"<!-- ENDIF --> value="{buttons.VALUE}" name="method" /> {buttons.VALUE} <!-- END buttons --><input type="submit" name="upload_file" class="button2" value="{L_SUBMIT_AND_UPLOAD}" /><!-- ENDIF --></td> </tr> </thead> <tbody> @@ -186,12 +186,12 @@ <fieldset> <legend>{L_UPLOAD_SETTINGS}</legend> <dl> - <dt><label>{L_UPLOAD_METHOD}:</label></dt> + <dt><label>{L_UPLOAD_METHOD}{L_COLON}</label></dt> <dd><strong>{NAME}</strong></dd> </dl> <!-- BEGIN data --> <dl> - <dt><label for="{data.DATA}">{data.NAME}:</label><br /><span>{data.EXPLAIN}</span></dt> + <dt><label for="{data.DATA}">{data.NAME}{L_COLON}</label><br /><span>{data.EXPLAIN}</span></dt> <dd><input type="<!-- IF data.DATA == 'password' -->password<!-- ELSE -->text<!-- ENDIF -->" id="{data.DATA}" name="{data.DATA}" value="{data.DEFAULT}" /></dd> </dl> <!-- END data --> diff --git a/phpBB/adm/style/acp_logs.html b/phpBB/adm/style/acp_logs.html index f1c770d33b..e13196f65d 100644 --- a/phpBB/adm/style/acp_logs.html +++ b/phpBB/adm/style/acp_logs.html @@ -9,12 +9,12 @@ <form id="list" method="post" action="{U_ACTION}"> <fieldset class="display-options" style="float: left"> - {L_SEARCH_KEYWORDS}: <input type="text" name="keywords" value="{S_KEYWORDS}" /> <input type="submit" class="button2" name="filter" value="{L_SEARCH}" /> + {L_SEARCH_KEYWORDS}{L_COLON} <input type="text" name="keywords" value="{S_KEYWORDS}" /> <input type="submit" class="button2" name="filter" value="{L_SEARCH}" /> </fieldset> -<!-- IF PAGINATION --> +<!-- 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> + <!-- INCLUDE pagination.html --> </div> <!-- ENDIF --> @@ -54,9 +54,9 @@ </tbody> </table> -<!-- IF PAGINATION --> +<!-- IF .pagination --> <div class="pagination"> - <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span> + <!-- INCLUDE pagination.html --> </div> <!-- ENDIF --> @@ -67,7 +67,7 @@ <!-- ENDIF --> <fieldset class="display-options"> - {L_DISPLAY_LOG}: {S_LIMIT_DAYS} {L_SORT_BY}: {S_SORT_KEY} {S_SORT_DIR} + {L_DISPLAY_LOG}{L_COLON} {S_LIMIT_DAYS} {L_SORT_BY}{L_COLON} {S_SORT_KEY} {S_SORT_DIR} <input class="button2" type="submit" value="{L_GO}" name="sort" /> {S_FORM_TOKEN} </fieldset> @@ -75,7 +75,7 @@ <!-- IF S_SHOW_FORUMS --> <fieldset class="quick"> - {L_SELECT_FORUM}: <select name="f" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit(); }">{S_FORUM_BOX}</select> + {L_SELECT_FORUM}{L_COLON} <select name="f" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit(); }">{S_FORUM_BOX}</select> <input class="button2" type="submit" value="{L_GO}" /> </fieldset> <!-- ENDIF --> diff --git a/phpBB/adm/style/acp_main.html b/phpBB/adm/style/acp_main.html index d9f833d878..8b591294d4 100644 --- a/phpBB/adm/style/acp_main.html +++ b/phpBB/adm/style/acp_main.html @@ -89,56 +89,56 @@ </thead> <tbody> <tr> - <td>{L_NUMBER_POSTS}: </td> + <td>{L_NUMBER_POSTS}{L_COLON} </td> <td><strong>{TOTAL_POSTS}</strong></td> - <td>{L_POSTS_PER_DAY}: </td> + <td>{L_POSTS_PER_DAY}{L_COLON} </td> <td><strong>{POSTS_PER_DAY}</strong></td> </tr> <tr> - <td>{L_NUMBER_TOPICS}: </td> + <td>{L_NUMBER_TOPICS}{L_COLON} </td> <td><strong>{TOTAL_TOPICS}</strong></td> - <td>{L_TOPICS_PER_DAY}: </td> + <td>{L_TOPICS_PER_DAY}{L_COLON} </td> <td><strong>{TOPICS_PER_DAY}</strong></td> </tr> <tr> - <td>{L_NUMBER_USERS}: </td> + <td>{L_NUMBER_USERS}{L_COLON} </td> <td><strong>{TOTAL_USERS}</strong></td> - <td>{L_USERS_PER_DAY}: </td> + <td>{L_USERS_PER_DAY}{L_COLON} </td> <td><strong>{USERS_PER_DAY}</strong></td> </tr> <tr> - <td>{L_NUMBER_FILES}: </td> + <td>{L_NUMBER_FILES}{L_COLON} </td> <td><strong>{TOTAL_FILES}</strong></td> - <td>{L_FILES_PER_DAY}: </td> + <td>{L_FILES_PER_DAY}{L_COLON} </td> <td><strong>{FILES_PER_DAY}</strong></td> </tr> <tr> - <td>{L_BOARD_STARTED}: </td> + <td>{L_BOARD_STARTED}{L_COLON} </td> <td><strong>{START_DATE}</strong></td> - <td>{L_AVATAR_DIR_SIZE}: </td> + <td>{L_AVATAR_DIR_SIZE}{L_COLON} </td> <td><strong>{AVATAR_DIR_SIZE}</strong></td> </tr> <tr> - <td>{L_DATABASE_SIZE}: </td> + <td>{L_DATABASE_SIZE}{L_COLON} </td> <td><strong>{DBSIZE}</strong></td> - <td>{L_UPLOAD_DIR_SIZE}: </td> + <td>{L_UPLOAD_DIR_SIZE}{L_COLON} </td> <td><strong>{UPLOAD_DIR_SIZE}</strong></td> </tr> <tr> - <td>{L_DATABASE_SERVER_INFO}: </td> + <td>{L_DATABASE_SERVER_INFO}{L_COLON} </td> <td><strong>{DATABASE_INFO}</strong></td> - <td>{L_GZIP_COMPRESSION}: </td> + <td>{L_GZIP_COMPRESSION}{L_COLON} </td> <td><strong>{GZIP_COMPRESSION}</strong></td> </tr> <tr> - <td>{L_BOARD_VERSION}: </td> + <td>{L_BOARD_VERSION}{L_COLON} </td> <td> <strong><a href="{U_VERSIONCHECK}" <!-- IF S_VERSION_UP_TO_DATE -->style="color: #228822;"<!-- ELSE -->style="color: #BC2A4D;"<!-- ENDIF --> title="{L_MORE_INFORMATION}">{BOARD_VERSION}</a></strong> [ <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a> ] </td> <!-- IF S_TOTAL_ORPHAN --> - <td>{L_NUMBER_ORPHAN}: </td> + <td>{L_NUMBER_ORPHAN}{L_COLON} </td> <td><strong>{TOTAL_ORPHAN}</strong></td> <!-- ELSE --> <td> </td> @@ -261,7 +261,7 @@ <td style="vertical-align: top;"> {inactive.USERNAME_FULL} - <!-- IF inactive.POSTS --><br />{L_POSTS}: <strong>{inactive.POSTS}</strong> [<a href="{inactive.U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a>]<!-- ENDIF --> + <!-- IF inactive.POSTS --><br />{L_POSTS}{L_COLON} <strong>{inactive.POSTS}</strong> [<a href="{inactive.U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a>]<!-- ENDIF --> </td> <td style="vertical-align: top;">{inactive.JOINED}</td> <td style="vertical-align: top;">{inactive.INACTIVE_DATE}</td> diff --git a/phpBB/adm/style/acp_modules.html b/phpBB/adm/style/acp_modules.html index 6c4645e80c..1e49198725 100644 --- a/phpBB/adm/style/acp_modules.html +++ b/phpBB/adm/style/acp_modules.html @@ -72,37 +72,37 @@ <fieldset> <legend>{L_GENERAL_OPTIONS}</legend> <dl> - <dt><label for="module_langname">{L_MODULE_LANGNAME}:</label><br /> + <dt><label for="module_langname">{L_MODULE_LANGNAME}{L_COLON}</label><br /> <span>{L_MODULE_LANGNAME_EXPLAIN}</span></dt> <dd><input name="module_langname" type="text" class="text medium" id="module_langname" value="{MODULE_LANGNAME}" /></dd> </dl> <dl> - <dt><label for="module_type">{L_MODULE_TYPE}:</label></dt> + <dt><label for="module_type">{L_MODULE_TYPE}{L_COLON}</label></dt> <dd><select name="module_type" id="module_type" onchange="display_options(this.value);"><option value="category"<!-- IF S_IS_CAT --> selected="selected"<!-- ENDIF -->>{L_CATEGORY}</option><option value="module"<!-- IF not S_IS_CAT --> selected="selected"<!-- ENDIF -->>{L_MODULE}</option></select></dd> </dl> <dl> - <dt><label for="parent_id">{L_PARENT}:</label></dt> + <dt><label for="parent_id">{L_PARENT}{L_COLON}</label></dt> <dd><select name="module_parent_id" id="parent_id">{S_CAT_OPTIONS}</select></dd> </dl> <hr /> <dl> - <dt><label for="module_enabled">{L_MODULE_ENABLED}:</label></dt> + <dt><label for="module_enabled">{L_MODULE_ENABLED}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="module_enabled" id="module_enabled" value="1"<!-- IF MODULE_ENABLED --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="module_enabled" value="0"<!-- IF not MODULE_ENABLED --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <div id="modoptions"<!-- IF S_IS_CAT --> style="display: none;"<!-- ENDIF -->> <dl> - <dt><label for="module_display">{L_MODULE_DISPLAYED}:</label><br /><span>{L_MODULE_DISPLAYED_EXPLAIN}</span></dt> + <dt><label for="module_display">{L_MODULE_DISPLAYED}{L_COLON}</label><br /><span>{L_MODULE_DISPLAYED_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" name="module_display" id="module_display" value="1"<!-- IF MODULE_DISPLAY --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="module_display" value="0"<!-- IF not MODULE_DISPLAY --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="module_basename">{L_CHOOSE_MODULE}:</label><br /> + <dt><label for="module_basename">{L_CHOOSE_MODULE}{L_COLON}</label><br /> <span>{L_CHOOSE_MODULE_EXPLAIN}</span></dt> <dd><select name="module_basename" id="module_basename" onchange="display_modes(this.value);">{S_MODULE_NAMES}</select></dd> </dl> <dl> - <dt><label for="module_mode">{L_CHOOSE_MODE}:</label><br /> + <dt><label for="module_mode">{L_CHOOSE_MODE}{L_COLON}</label><br /> <span>{L_CHOOSE_MODE_EXPLAIN}</span></dt> <dd><select name="module_mode" id="module_mode">{S_MODULE_MODES}</select></dd> </dl> @@ -201,7 +201,7 @@ <form id="mselect" method="post" action="{U_SEL_ACTION}"> <fieldset class="quick"> - {L_SELECT_MODULE}: <select name="parent_id" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit(); }">{MODULE_BOX}</select> + {L_SELECT_MODULE}{L_COLON} <select name="parent_id" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit(); }">{MODULE_BOX}</select> <input class="button2" type="submit" value="{L_GO}" /> </fieldset> diff --git a/phpBB/adm/style/acp_permission_roles.html b/phpBB/adm/style/acp_permission_roles.html index 2ac77af25d..d654c320ca 100644 --- a/phpBB/adm/style/acp_permission_roles.html +++ b/phpBB/adm/style/acp_permission_roles.html @@ -36,11 +36,11 @@ <fieldset> <legend>{L_ROLE_DETAILS}</legend> <dl> - <dt><label for="role_name">{L_ROLE_NAME}:</label></dt> + <dt><label for="role_name">{L_ROLE_NAME}{L_COLON}</label></dt> <dd><input name="role_name" type="text" id="role_name" value="{ROLE_NAME}" maxlength="255" /></dd> </dl> <dl> - <dt><label for="role_description">{L_ROLE_DESCRIPTION}:</label><br /><span>{L_ROLE_DESCRIPTION_EXPLAIN}</span></dt> + <dt><label for="role_description">{L_ROLE_DESCRIPTION}{L_COLON}</label><br /><span>{L_ROLE_DESCRIPTION_EXPLAIN}</span></dt> <dd><textarea id="role_description" name="role_description" rows="3" cols="45">{ROLE_DESCRIPTION}</textarea></dd> </dl> @@ -182,7 +182,7 @@ </table> <fieldset class="quick"> - {L_CREATE_ROLE}: <input type="text" name="role_name" value="" maxlength="255" /><!-- IF S_ROLE_OPTIONS --> <select name="options_from"><option value="0" selected="selected">{L_CREATE_ROLE_FROM}</option>{S_ROLE_OPTIONS}</select><!-- ENDIF --> <input class="button2" type="submit" name="add" value="{L_SUBMIT}" /><br /> + {L_CREATE_ROLE}{L_COLON} <input type="text" name="role_name" value="" maxlength="255" /><!-- IF S_ROLE_OPTIONS --> <select name="options_from"><option value="0" selected="selected">{L_CREATE_ROLE_FROM}</option>{S_ROLE_OPTIONS}</select><!-- ENDIF --> <input class="button2" type="submit" name="add" value="{L_SUBMIT}" /><br /> {S_FORM_TOKEN} </fieldset> </form> diff --git a/phpBB/adm/style/acp_permissions.html b/phpBB/adm/style/acp_permissions.html index b44cca782e..88a82532a1 100644 --- a/phpBB/adm/style/acp_permissions.html +++ b/phpBB/adm/style/acp_permissions.html @@ -19,7 +19,7 @@ <p>{L_EXPLAIN}</p> <!-- IF S_FORUM_NAMES --> - <p><strong>{L_FORUMS}:</strong> {FORUM_NAMES}</p> + <p><strong>{L_FORUMS}{L_COLON}</strong> {FORUM_NAMES}</p> <!-- ENDIF --> <!-- IF S_SELECT_FORUM --> @@ -30,7 +30,7 @@ <legend>{L_LOOK_UP_FORUM}</legend> <!-- IF S_FORUM_MULTIPLE --><p>{L_LOOK_UP_FORUMS_EXPLAIN}</p><!-- ENDIF --> <dl> - <dt><label for="forum">{L_LOOK_UP_FORUM}:</label></dt> + <dt><label for="forum">{L_LOOK_UP_FORUM}{L_COLON}</label></dt> <dd><select id="forum" name="forum_id[]"<!-- IF S_FORUM_MULTIPLE --> multiple="multiple"<!-- ENDIF --> size="10">{S_FORUM_OPTIONS}</select></dd> <!-- IF S_FORUM_ALL --><dd><label><input type="checkbox" class="radio" name="all_forums" value="1" /> {L_ALL_FORUMS}</label></dd><!-- ENDIF --> </dl> @@ -52,7 +52,7 @@ <legend>{L_LOOK_UP_FORUM}</legend> <p>{L_SELECT_FORUM_SUBFORUM_EXPLAIN}</p> <dl> - <dt><label for="sforum">{L_LOOK_UP_FORUM}:</label></dt> + <dt><label for="sforum">{L_LOOK_UP_FORUM}{L_COLON}</label></dt> <dd><select id="sforum" name="subforum_id">{S_SUBFORUM_OPTIONS}</select></dd> </dl> @@ -74,7 +74,7 @@ <fieldset> <legend>{L_LOOK_UP_USER}</legend> <dl> - <dt><label for="username">{L_FIND_USERNAME}:</label></dt> + <dt><label for="username">{L_FIND_USERNAME}{L_COLON}</label></dt> <dd><input class="text medium" type="text" id="username" name="username[]" /></dd> <dd>[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</dd> <dd class="full" style="text-align: left;"><label><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> {L_SELECT_ANONYMOUS}</label></dd> @@ -95,7 +95,7 @@ <fieldset> <legend>{L_LOOK_UP_GROUP}</legend> <dl> - <dt><label for="group">{L_LOOK_UP_GROUP}:</label></dt> + <dt><label for="group">{L_LOOK_UP_GROUP}{L_COLON}</label></dt> <dd><select name="group_id[]" id="group">{S_GROUP_OPTIONS}</select></dd> </dl> @@ -225,7 +225,7 @@ <fieldset> <legend>{L_LOOK_UP_USER}</legend> <dl> - <dt><label for="username">{L_FIND_USERNAME}:</label></dt> + <dt><label for="username">{L_FIND_USERNAME}{L_COLON}</label></dt> <dd><input type="text" id="username" name="username[]" /></dd> <dd>[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</dd> <dd class="full" style="text-align: left;"><label><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> {L_SELECT_ANONYMOUS}</label></dd> @@ -266,7 +266,7 @@ <fieldset> <legend>{L_LOOK_UP_GROUP}</legend> <dl> - <dt><label for="group_select">{L_LOOK_UP_GROUP}:</label></dt> + <dt><label for="group_select">{L_LOOK_UP_GROUP}{L_COLON}</label></dt> <dd><select name="group_id[]" id="group_select">{S_ADD_GROUP_OPTIONS}</select></dd> <dd> </dd> </dl> @@ -317,7 +317,7 @@ <fieldset class="quick" style="float: {S_CONTENT_FLOW_BEGIN};"> {S_HIDDEN_FIELDS} {S_FORM_TOKEN} - {L_SELECT_TYPE}: <select name="type">{S_PERMISSION_DROPDOWN}</select> + {L_SELECT_TYPE}{L_COLON} <select name="type">{S_PERMISSION_DROPDOWN}</select> <input class="button2" type="submit" name="submit" value="{L_GO}" /> </fieldset> diff --git a/phpBB/adm/style/acp_profile.html b/phpBB/adm/style/acp_profile.html index 4a6df768a8..13be669f70 100644 --- a/phpBB/adm/style/acp_profile.html +++ b/phpBB/adm/style/acp_profile.html @@ -24,22 +24,22 @@ <fieldset> <legend>{L_TITLE}</legend> <dl> - <dt><label>{L_FIELD_TYPE}:</label><br /><span>{L_FIELD_TYPE_EXPLAIN}</span></dt> + <dt><label>{L_FIELD_TYPE}{L_COLON}</label><br /><span>{L_FIELD_TYPE_EXPLAIN}</span></dt> <dd><strong>{FIELD_TYPE}</strong></dd> </dl> <!-- IF S_EDIT_MODE --> <dl> - <dt><label>{L_FIELD_IDENT}:</label><br /><span>{L_FIELD_IDENT_EXPLAIN}</span></dt> + <dt><label>{L_FIELD_IDENT}{L_COLON}</label><br /><span>{L_FIELD_IDENT_EXPLAIN}</span></dt> <dd><input type="hidden" name="field_ident" value="{FIELD_IDENT}" /><strong>{FIELD_IDENT}</strong></dd> </dl> <!-- ELSE --> <dl> - <dt><label for="field_ident">{L_FIELD_IDENT}:</label><br /><span>{L_FIELD_IDENT_EXPLAIN}</span></dt> + <dt><label for="field_ident">{L_FIELD_IDENT}{L_COLON}</label><br /><span>{L_FIELD_IDENT_EXPLAIN}</span></dt> <dd><input class="text medium" type="text" id="field_ident" name="field_ident" value="{FIELD_IDENT}" /></dd> </dl> <!-- ENDIF --> <dl> - <dt><label for="field_no_view">{L_DISPLAY_PROFILE_FIELD}:</label><br /><span>{L_DISPLAY_PROFILE_FIELD_EXPLAIN}</span></dt> + <dt><label for="field_no_view">{L_DISPLAY_PROFILE_FIELD}{L_COLON}</label><br /><span>{L_DISPLAY_PROFILE_FIELD_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" id="field_no_view" name="field_no_view" value="0"<!-- IF not S_FIELD_NO_VIEW --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="field_no_view" value="1"<!-- IF S_FIELD_NO_VIEW --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> @@ -48,27 +48,31 @@ <fieldset> <legend>{L_VISIBILITY_OPTION}</legend> <dl> - <dt><label for="field_show_profile">{L_DISPLAY_AT_PROFILE}:</label><br /><span>{L_DISPLAY_AT_PROFILE_EXPLAIN}</span></dt> + <dt><label for="field_show_profile">{L_DISPLAY_AT_PROFILE}{L_COLON}</label><br /><span>{L_DISPLAY_AT_PROFILE_EXPLAIN}</span></dt> <dd><input type="checkbox" class="radio" id="field_show_profile" name="field_show_profile" value="1"<!-- IF S_SHOW_PROFILE --> checked="checked"<!-- ENDIF --> /></dd> </dl> <dl> - <dt><label for="field_show_on_reg">{L_DISPLAY_AT_REGISTER}:</label><br /><span>{L_DISPLAY_AT_REGISTER_EXPLAIN}</span></dt> + <dt><label for="field_show_on_reg">{L_DISPLAY_AT_REGISTER}{L_COLON}</label><br /><span>{L_DISPLAY_AT_REGISTER_EXPLAIN}</span></dt> <dd><input type="checkbox" class="radio" id="field_show_on_reg" name="field_show_on_reg" value="1"<!-- IF S_SHOW_ON_REG --> checked="checked"<!-- ENDIF --> /></dd> </dl> <dl> - <dt><label for="field_show_on_pm">{L_DISPLAY_ON_PM}:</label><br /><span>{L_DISPLAY_ON_PM_EXPLAIN}</span></dt> + <dt><label for="field_show_on_pm">{L_DISPLAY_ON_PM}{L_COLON}</label><br /><span>{L_DISPLAY_ON_PM_EXPLAIN}</span></dt> <dd><input type="checkbox" class="radio" id="field_show_on_pm" name="field_show_on_pm" value="1"<!-- IF S_SHOW_ON_PM --> checked="checked"<!-- ENDIF --> /></dd> </dl> <dl> - <dt><label for="field_show_on_vt">{L_DISPLAY_ON_VT}:</label><br /><span>{L_DISPLAY_ON_VT_EXPLAIN}</span></dt> + <dt><label for="field_show_on_vt">{L_DISPLAY_ON_VT}{L_COLON}</label><br /><span>{L_DISPLAY_ON_VT_EXPLAIN}</span></dt> <dd><input type="checkbox" class="radio" id="field_show_on_vt" name="field_show_on_vt" value="1"<!-- IF S_SHOW_ON_VT --> checked="checked"<!-- ENDIF --> /></dd> </dl> <dl> - <dt><label for="field_required">{L_REQUIRED_FIELD}:</label><br /><span>{L_REQUIRED_FIELD_EXPLAIN}</span></dt> + <dt><label for="field_required">{L_REQUIRED_FIELD}{L_COLON}</label><br /><span>{L_REQUIRED_FIELD_EXPLAIN}</span></dt> <dd><input type="checkbox" class="radio" id="field_required" name="field_required" value="1"<!-- IF S_FIELD_REQUIRED --> checked="checked"<!-- ENDIF --> /></dd> </dl> <dl> - <dt><label for="field_hide">{L_HIDE_PROFILE_FIELD}:</label><br /><span>{L_HIDE_PROFILE_FIELD_EXPLAIN}</span></dt> + <dt><label for="field_show_novalue">{L_SHOW_NOVALUE_FIELD}{L_COLON}</label><br /><span>{L_SHOW_NOVALUE_FIELD_EXPLAIN}</span></dt> + <dd><input type="checkbox" class="radio" id="field_show_novalue" name="field_show_novalue" value="1"<!-- IF S_FIELD_SHOW_NOVALUE --> checked="checked"<!-- ENDIF --> /></dd> + </dl> + <dl> + <dt><label for="field_hide">{L_HIDE_PROFILE_FIELD}{L_COLON}</label><br /><span>{L_HIDE_PROFILE_FIELD_EXPLAIN}</span></dt> <dd><input type="checkbox" class="radio" id="field_hide" name="field_hide" value="1"<!-- IF S_FIELD_HIDE --> checked="checked"<!-- ENDIF --> /></dd> </dl> </fieldset> @@ -82,22 +86,22 @@ <fieldset> <legend>{L_LANG_SPECIFIC}</legend> <dl> - <dt><label for="lang_name">{L_USER_FIELD_NAME}:</label></dt> + <dt><label for="lang_name">{L_USER_FIELD_NAME}{L_COLON}</label></dt> <dd><input class="text medium" type="text" id="lang_name" name="lang_name" value="{LANG_NAME}" /></dd> </dl> <dl> - <dt><label for="lang_explain">{L_FIELD_DESCRIPTION}:</label><br /><span>{L_FIELD_DESCRIPTION_EXPLAIN}</span></dt> + <dt><label for="lang_explain">{L_FIELD_DESCRIPTION}{L_COLON}</label><br /><span>{L_FIELD_DESCRIPTION_EXPLAIN}</span></dt> <dd><textarea id="lang_explain" name="lang_explain" rows="3" cols="80">{LANG_EXPLAIN}</textarea></dd> </dl> <!-- IF S_TEXT or S_STRING --> <dl> - <dt><label for="lang_default_value">{L_DEFAULT_VALUE}:</label><br /><span>{L_DEFAULT_VALUE_EXPLAIN}</span></dt> + <dt><label for="lang_default_value">{L_DEFAULT_VALUE}{L_COLON}</label><br /><span>{L_DEFAULT_VALUE_EXPLAIN}</span></dt> <dd><!-- IF S_STRING --><input class="text medium" type="text" id="lang_default_value" name="lang_default_value" value="{LANG_DEFAULT_VALUE}" /><!-- ELSE --><textarea id="lang_default_value" name="lang_default_value" rows="5" cols="80">{LANG_DEFAULT_VALUE}</textarea><!-- ENDIF --></dd> </dl> <!-- ENDIF --> <!-- IF S_BOOL or S_DROPDOWN --> <dl> - <dt><label for="lang_options">{L_ENTRIES}:</label> + <dt><label for="lang_options">{L_ENTRIES}{L_COLON}</label> <!-- IF S_EDIT_MODE and S_DROPDOWN --> <br /><span>{L_EDIT_DROPDOWN_LANG_EXPLAIN}</span> <!-- ELSE --> @@ -126,7 +130,7 @@ <legend>{L_TITLE}</legend> <!-- BEGIN option --> <dl> - <dt><label>{option.TITLE}:</label><!-- IF option.EXPLAIN --><br /><span>{option.EXPLAIN}</span><!-- ENDIF --></dt> + <dt><label>{option.TITLE}{L_COLON}</label><!-- IF option.EXPLAIN --><br /><span>{option.EXPLAIN}</span><!-- ENDIF --></dt> <dd>{option.FIELD}</dd> </dl> <!-- END option --> @@ -149,7 +153,7 @@ <legend>{options.LANGUAGE}</legend> <!-- BEGIN field --> <dl> - <dt><label>{options.field.L_TITLE}:</label><!-- IF options.field.L_EXPLAIN --><br /><span>{options.field.L_EXPLAIN}</span><!-- ENDIF --></dt> + <dt><label>{options.field.L_TITLE}{L_COLON}</label><!-- IF options.field.L_EXPLAIN --><br /><span>{options.field.L_EXPLAIN}</span><!-- ENDIF --></dt> {options.field.FIELD} </dl> <!-- END field --> diff --git a/phpBB/adm/style/acp_prune_forums.html b/phpBB/adm/style/acp_prune_forums.html index dfc5827117..aede662bcb 100644 --- a/phpBB/adm/style/acp_prune_forums.html +++ b/phpBB/adm/style/acp_prune_forums.html @@ -43,7 +43,7 @@ <legend>{L_SELECT_FORUM}</legend> <p>{L_LOOK_UP_FORUMS_EXPLAIN}</p> <dl> - <dt><label for="forum">{L_LOOK_UP_FORUM}:</label></dt> + <dt><label for="forum">{L_LOOK_UP_FORUM}{L_COLON}</label></dt> <dd><select id="forum" name="f[]" multiple="multiple" size="10">{S_FORUM_OPTIONS}</select></dd> <dd><label><input type="checkbox" class="radio" name="all_forums" value="1" /> {L_ALL_FORUMS}</label></dd> </dl> @@ -65,32 +65,32 @@ <h2>{L_FORUM}</h2> - <p>{L_SELECTED_FORUMS}: {FORUM_LIST}</p> + <p>{L_SELECTED_FORUMS}{L_COLON} {FORUM_LIST}</p> <form id="acp_prune" method="post" action="{U_ACTION}"> <fieldset> <legend>{L_FORUM_PRUNE}</legend> <dl> - <dt><label for="prune_days">{L_PRUNE_NOT_POSTED}:</label></dt> + <dt><label for="prune_days">{L_PRUNE_NOT_POSTED}{L_COLON}</label></dt> <dd><input type="text" id="prune_days" name="prune_days" /></dd> </dl> <dl> - <dt><label for="prune_vieweddays">{L_PRUNE_NOT_VIEWED}:</label></dt> + <dt><label for="prune_vieweddays">{L_PRUNE_NOT_VIEWED}{L_COLON}</label></dt> <dd><input type="text" id="prune_vieweddays" name="prune_vieweddays" /></dd> </dl> <dl> - <dt><label for="polls">{L_PRUNE_OLD_POLLS}:</label><br /><span>{L_PRUNE_OLD_POLLS_EXPLAIN}</span></dt> + <dt><label for="polls">{L_PRUNE_OLD_POLLS}{L_COLON}</label><br /><span>{L_PRUNE_OLD_POLLS_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" name="prune_old_polls" value="1" /> {L_YES}</label> <label><input type="radio" class="radio" id="polls" name="prune_old_polls" value="0" checked="checked" /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="announce">{L_PRUNE_ANNOUNCEMENTS}:</label></dt> + <dt><label for="announce">{L_PRUNE_ANNOUNCEMENTS}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="prune_announce" value="1" /> {L_YES}</label> <label><input type="radio" class="radio" id="announce" name="prune_announce" value="0" checked="checked" /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="sticky">{L_PRUNE_STICKY}:</label></dt> + <dt><label for="sticky">{L_PRUNE_STICKY}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="prune_sticky" value="1" /> {L_YES}</label> <label><input type="radio" class="radio" id="sticky" name="prune_sticky" value="0" checked="checked" /> {L_NO}</label></dd> </dl> diff --git a/phpBB/adm/style/acp_prune_users.html b/phpBB/adm/style/acp_prune_users.html index 968d307832..75fa04a157 100644 --- a/phpBB/adm/style/acp_prune_users.html +++ b/phpBB/adm/style/acp_prune_users.html @@ -9,39 +9,64 @@ <form id="acp_prune" method="post" action="{U_ACTION}"> <fieldset> - <legend>{L_ACP_PRUNE_USERS}</legend> + <legend>{L_CRITERIA}</legend> <dl> - <dt><label for="username">{L_USERNAME}:</label></dt> + <dt><label for="username">{L_USERNAME}{L_COLON}</label></dt> <dd><input type="text" id="username" name="username" /></dd> </dl> <dl> - <dt><label for="email">{L_EMAIL}:</label></dt> + <dt><label for="email">{L_EMAIL}{L_COLON}</label></dt> <dd><input type="text" id="email" name="email" /></dd> </dl> <dl> - <dt><label for="joined">{L_JOINED}:</label><br /><span>{L_JOINED_EXPLAIN}</span></dt> - <dd><select name="joined_select">{S_JOINED_OPTIONS}</select> <input type="text" id="joined" name="joined" /></dd> + <dt><label for="email">{L_WEBSITE}{L_COLON}</label></dt> + <dd><input type="text" id="website" name="website" /></dd> </dl> <dl> - <dt><label for="active">{L_LAST_ACTIVE}:</label><br /><span>{L_LAST_ACTIVE_EXPLAIN}</span></dt> + <dt><label for="joined">{L_JOINED}{L_COLON}</label><br /><span>{L_JOINED_EXPLAIN}</span></dt> + <dd> + <strong>{L_AFTER}</strong> <input type="text" id="joined_after" name="joined_after" /> + <br /> <br /> <strong>{L_BEFORE}</strong> <input type="text" id="joined_before" name="joined_before" /> + </dd> +</dl> +<dl> + <dt><label for="active">{L_LAST_ACTIVE}{L_COLON}</label><br /><span>{L_LAST_ACTIVE_EXPLAIN}</span></dt> <dd><select name="active_select">{S_ACTIVE_OPTIONS}</select> <input type="text" id="active" name="active" /></dd> </dl> <dl> - <dt><label for="count">{L_POSTS}:</label></dt> + <dt><label for="count">{L_POSTS}{L_COLON}</label></dt> <dd><select name="count_select">{S_COUNT_OPTIONS}</select> <input type="text" id="count" name="count" /></dd> </dl> <dl> - <dt><label for="users">{L_ACP_PRUNE_USERS}:</label><br /><span>{L_SELECT_USERS_EXPLAIN}</span></dt> + <dt><label for="posts_on_queue">{L_POSTS_ON_QUEUE}{L_COLON}</label></dt> + <dd><select name="queue_select">{S_COUNT_OPTIONS}</select> <input type="text" id="posts_on_queue" name="posts_on_queue" /></select> +</dl> +<!-- IF S_GROUP_LIST --> +<dl> + <dt><label for="group_id">{L_GROUP}{L_COLON}</label><br /><span>{L_PRUNE_USERS_GROUP_EXPLAIN}</dt> + <dd><select name="group_id">{S_GROUP_LIST}</select></dd> +</dl> +<!-- ENDIF --> +</fieldset> + +<fieldset> + <legend>{L_USERNAMES}</legend> +<dl> + <dt><label for="users">{L_ACP_PRUNE_USERS}{L_COLON}</label><br /><span>{L_SELECT_USERS_EXPLAIN}</span></dt> <dd><textarea id="users" name="users" cols="40" rows="5"></textarea></dd> <dd>[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</dd> </dl> +</fieldset> + +<fieldset> + <legend>{L_OPTIONS}</legend> <dl> - <dt><label for="deleteposts">{L_DELETE_USER_POSTS}:</label><br /><span>{L_DELETE_USER_POSTS_EXPLAIN}</span></dt> + <dt><label for="deleteposts">{L_DELETE_USER_POSTS}{L_COLON}</label><br /><span>{L_DELETE_USER_POSTS_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" name="deleteposts" value="1" /> {L_YES}</label> <label><input type="radio" class="radio" id="deleteposts" name="deleteposts" value="0" checked="checked" /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="deactivate">{L_DEACTIVATE_DELETE}:</label><br /><span>{L_DEACTIVATE_DELETE_EXPLAIN}</span></dt> + <dt><label for="deactivate">{L_DEACTIVATE_DELETE}{L_COLON}</label><br /><span>{L_DEACTIVATE_DELETE_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" name="action" value="delete" /> {L_DELETE_USERS}</label> <label><input type="radio" class="radio" id="deactivate" name="action" value="deactivate" checked="checked" /> {L_DEACTIVATE}</label></dd> </dl> diff --git a/phpBB/adm/style/acp_ranks.html b/phpBB/adm/style/acp_ranks.html index 7fb7da7095..a475370f73 100644 --- a/phpBB/adm/style/acp_ranks.html +++ b/phpBB/adm/style/acp_ranks.html @@ -25,22 +25,22 @@ <fieldset> <legend>{L_ACP_RANKS}</legend> <dl> - <dt><label for="title">{L_RANK_TITLE}:</label></dt> + <dt><label for="title">{L_RANK_TITLE}{L_COLON}</label></dt> <dd><input name="title" type="text" id="title" value="{RANK_TITLE}" maxlength="255" /></dd> </dl> <dl> - <dt><label for="rank_image">{L_RANK_IMAGE}:</label></dt> + <dt><label for="rank_image">{L_RANK_IMAGE}{L_COLON}</label></dt> <dd><select name="rank_image" id="rank_image" onchange="update_image(this.options[selectedIndex].value);">{S_FILENAME_LIST}</select></dd> <dd><img src="{RANK_IMAGE}" id="image" alt="" /></dd> </dl> <dl> - <dt><label for="special_rank">{L_RANK_SPECIAL}:</label></dt> + <dt><label for="special_rank">{L_RANK_SPECIAL}{L_COLON}</label></dt> <dd><label><input onclick="dE('posts', -1)" type="radio" class="radio" name="special_rank" value="1" id="special_rank"<!-- IF S_SPECIAL_RANK --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input onclick="dE('posts', 1)" type="radio" class="radio" name="special_rank" value="0"<!-- IF not S_SPECIAL_RANK --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <!-- IF S_SPECIAL_RANK --><div id="posts" style="display: none;"><!-- ELSE --><div id="posts"><!-- ENDIF --> <dl> - <dt><label for="min_posts">{L_RANK_MINIMUM}:</label></dt> + <dt><label for="min_posts">{L_RANK_MINIMUM}{L_COLON}</label></dt> <dd><input name="min_posts" type="text" id="min_posts" maxlength="10" value="{MIN_POSTS}" /></dd> </dl> </div> diff --git a/phpBB/adm/style/acp_reasons.html b/phpBB/adm/style/acp_reasons.html index 7cf2cce4c9..2f39f64614 100644 --- a/phpBB/adm/style/acp_reasons.html +++ b/phpBB/adm/style/acp_reasons.html @@ -29,7 +29,7 @@ <legend>{L_TITLE}</legend> <p><!-- IF S_TRANSLATED -->{L_IS_TRANSLATED_EXPLAIN}<!-- ELSE -->{L_IS_NOT_TRANSLATED_EXPLAIN}<!-- ENDIF --></p> <dl> - <dt><label for="reason_title">{L_REASON_TITLE}:</label></dt> + <dt><label for="reason_title">{L_REASON_TITLE}{L_COLON}</label></dt> <dd><input name="reason_title" type="text" id="reason_title" value="{REASON_TITLE}" maxlength="255" /></dd> </dl> <!-- IF S_TRANSLATED --> @@ -39,7 +39,7 @@ </dl> <!-- ENDIF --> <dl> - <dt><label for="reason_description">{L_REASON_DESCRIPTION}:</label></dt> + <dt><label for="reason_description">{L_REASON_DESCRIPTION}{L_COLON}</label></dt> <dd><textarea name="reason_description" id="reason_description" rows="8" cols="80">{REASON_DESCRIPTION}</textarea></dd> </dl> <!-- IF S_TRANSLATED --> diff --git a/phpBB/adm/style/acp_search.html b/phpBB/adm/style/acp_search.html index ff83f6b792..3da70bc0c8 100644 --- a/phpBB/adm/style/acp_search.html +++ b/phpBB/adm/style/acp_search.html @@ -12,32 +12,32 @@ <fieldset> <legend>{L_GENERAL_SEARCH_SETTINGS}</legend> <dl> - <dt><label for="load_search">{L_YES_SEARCH}:</label><br /><span>{L_YES_SEARCH_EXPLAIN}</span></dt> + <dt><label for="load_search">{L_YES_SEARCH}{L_COLON}</label><br /><span>{L_YES_SEARCH_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" id="load_search" name="config[load_search]" value="1"<!-- IF S_YES_SEARCH --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="config[load_search]" value="0"<!-- IF not S_YES_SEARCH --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="search_interval">{L_SEARCH_INTERVAL}:</label><br /><span>{L_SEARCH_INTERVAL_EXPLAIN}</span></dt> + <dt><label for="search_interval">{L_SEARCH_INTERVAL}{L_COLON}</label><br /><span>{L_SEARCH_INTERVAL_EXPLAIN}</span></dt> <dd><input id="search_interval" type="text" size="4" maxlength="4" name="config[search_interval]" value="{SEARCH_INTERVAL}" /> {L_SECONDS}</dd> </dl> <dl> - <dt><label for="search_anonymous_interval">{L_SEARCH_GUEST_INTERVAL}:</label><br /><span>{L_SEARCH_GUEST_INTERVAL_EXPLAIN}</span></dt> + <dt><label for="search_anonymous_interval">{L_SEARCH_GUEST_INTERVAL}{L_COLON}</label><br /><span>{L_SEARCH_GUEST_INTERVAL_EXPLAIN}</span></dt> <dd><input id="search_anonymous_interval" type="text" size="4" maxlength="4" name="config[search_anonymous_interval]" value="{SEARCH_GUEST_INTERVAL}" /> {L_SECONDS}</dd> </dl> <dl> - <dt><label for="limit_search_load">{L_LIMIT_SEARCH_LOAD}:</label><br /><span>{L_LIMIT_SEARCH_LOAD_EXPLAIN}</span></dt> + <dt><label for="limit_search_load">{L_LIMIT_SEARCH_LOAD}{L_COLON}</label><br /><span>{L_LIMIT_SEARCH_LOAD_EXPLAIN}</span></dt> <dd><input id="limit_search_load" type="text" size="4" maxlength="4" name="config[limit_search_load]" value="{LIMIT_SEARCH_LOAD}" /></dd> </dl> <dl> - <dt><label for="min_search_author_chars">{L_MIN_SEARCH_AUTHOR_CHARS}:</label><br /><span>{L_MIN_SEARCH_AUTHOR_CHARS_EXPLAIN}</span></dt> + <dt><label for="min_search_author_chars">{L_MIN_SEARCH_AUTHOR_CHARS}{L_COLON}</label><br /><span>{L_MIN_SEARCH_AUTHOR_CHARS_EXPLAIN}</span></dt> <dd><input id="min_search_author_chars" type="text" size="4" maxlength="4" name="config[min_search_author_chars]" value="{MIN_SEARCH_AUTHOR_CHARS}" /></dd> </dl> <dl> - <dt><label for="max_num_search_keywords">{L_MAX_NUM_SEARCH_KEYWORDS}:</label><br /><span>{L_MAX_NUM_SEARCH_KEYWORDS_EXPLAIN}</span></dt> + <dt><label for="max_num_search_keywords">{L_MAX_NUM_SEARCH_KEYWORDS}{L_COLON}</label><br /><span>{L_MAX_NUM_SEARCH_KEYWORDS_EXPLAIN}</span></dt> <dd><input id="max_num_search_keywords" type="text" size="4" maxlength="4" name="config[max_num_search_keywords]" value="{MAX_NUM_SEARCH_KEYWORDS}" /></dd> </dl> <dl> - <dt><label for="search_store_results">{L_SEARCH_STORE_RESULTS}:</label><br /><span>{L_SEARCH_STORE_RESULTS_EXPLAIN}</span></dt> + <dt><label for="search_store_results">{L_SEARCH_STORE_RESULTS}{L_COLON}</label><br /><span>{L_SEARCH_STORE_RESULTS_EXPLAIN}</span></dt> <dd><input id="search_store_results" type="text" size="4" maxlength="6" name="config[search_store_results]" value="{SEARCH_STORE_RESULTS}" /> {L_SECONDS}</dd> </dl> </fieldset> @@ -45,7 +45,7 @@ <fieldset> <legend>{L_SEARCH_TYPE}</legend> <dl> - <dt><label for="search_type">{L_SEARCH_TYPE}:</label><br /><span>{L_SEARCH_TYPE_EXPLAIN}</span></dt> + <dt><label for="search_type">{L_SEARCH_TYPE}{L_COLON}</label><br /><span>{L_SEARCH_TYPE_EXPLAIN}</span></dt> <dd><select id="search_type" name="config[search_type]">{S_SEARCH_TYPES}</select></dd> </dl> </fieldset> @@ -110,7 +110,7 @@ {backend.S_HIDDEN_FIELDS} - <legend>{L_INDEX_STATS}: {backend.L_NAME} <!-- IF backend.S_ACTIVE -->({L_ACTIVE}) <!-- ENDIF --></legend> + <legend>{L_INDEX_STATS}{L_COLON} {backend.L_NAME} <!-- IF backend.S_ACTIVE -->({L_ACTIVE}) <!-- ENDIF --></legend> <table cellspacing="1"> <caption>{backend.L_NAME} <!-- IF backend.S_ACTIVE -->({L_ACTIVE}) <!-- ENDIF --></caption> @@ -126,9 +126,9 @@ <tbody> <!-- BEGIN data --> <tr> - <td>{backend.data.STATISTIC_1}:</td> + <td>{backend.data.STATISTIC_1}{L_COLON}</td> <td>{backend.data.VALUE_1}</td> - <td>{backend.data.STATISTIC_2}<!-- IF backend.data.STATISTIC_2 -->:<!-- ENDIF --></td> + <td>{backend.data.STATISTIC_2}<!-- IF backend.data.STATISTIC_2 -->{L_COLON}<!-- ENDIF --></td> <td>{backend.data.VALUE_2}</td> </tr> <!-- END data --> diff --git a/phpBB/adm/style/acp_styles.html b/phpBB/adm/style/acp_styles.html index b09cbafc95..3dc4c2d616 100644 --- a/phpBB/adm/style/acp_styles.html +++ b/phpBB/adm/style/acp_styles.html @@ -36,7 +36,7 @@ <input type="hidden" name="id" value="{STYLE_ID}" /> <fieldset> <dl> - <dt><label for="name">{L_STYLE_NAME}:</label></dt> + <dt><label for="name">{L_STYLE_NAME}{L_COLON}</label></dt> <dd><input type="text" id="name" name="style_name" value="{STYLE_NAME}" /></dd> </dl> <dl> @@ -44,11 +44,11 @@ <dd><strong>{STYLE_PATH}</strong></dd> </dl> <dl> - <dt><label for="name">{L_COPYRIGHT}:</label></dt> + <dt><label for="name">{L_COPYRIGHT}{L_COLON}</label></dt> <dd><strong>{STYLE_COPYRIGHT}</strong></dd> </dl> <dl> - <dt><label for="style_parent">{L_INHERITING_FROM}:</label></dt> + <dt><label for="style_parent">{L_INHERITING_FROM}{L_COLON}</label></dt> <dd><select id="style_parent" name="style_parent"> <option value=""<!-- IF STYLE_PARENT == 0 --> selected="selected"<!-- ENDIF -->> - </option> <!-- BEGIN parent_styles --> @@ -57,13 +57,13 @@ </select></dd> </dl> <dl> - <dt><label for="style_active">{L_STYLE_ACTIVE}:</label></dt> + <dt><label for="style_active">{L_STYLE_ACTIVE}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="style_active" value="1"<!-- IF S_STYLE_ACTIVE --> id="style_active" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="style_active" value="0"<!-- IF not S_STYLE_ACTIVE --> id="style_active" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <!-- IF not S_STYLE_DEFAULT --> <dl> - <dt><label for="style_default">{L_STYLE_DEFAULT}:</label></dt> + <dt><label for="style_default">{L_STYLE_DEFAULT}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="style_default" value="1" /> {L_YES}</label> <label><input type="radio" class="radio" id="style_default" name="style_default" value="0" checked="checked" /> {L_NO}</label></dd> </dl> diff --git a/phpBB/adm/style/acp_users.html b/phpBB/adm/style/acp_users.html index a8794176a9..96c9de6ebb 100644 --- a/phpBB/adm/style/acp_users.html +++ b/phpBB/adm/style/acp_users.html @@ -13,7 +13,7 @@ <fieldset> <legend>{L_SELECT_USER}</legend> <dl> - <dt><label for="username">{L_ENTER_USERNAME}:</label></dt> + <dt><label for="username">{L_ENTER_USERNAME}{L_COLON}</label></dt> <dd><input class="text medium" type="text" id="username" name="username" /></dd> <dd>[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</dd> <dd class="full" style="text-align: left;"><label><input type="checkbox" class="radio" id="anonymous" name="u" value="{ANONYMOUS_USER_ID}" /> {L_SELECT_ANONYMOUS}</label></dd> @@ -68,7 +68,7 @@ <form id="mode_select" method="post" action="{U_MODE_SELECT}"> <fieldset class="quick"> - {L_SELECT_FORM}: <select name="mode" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();">{S_FORM_OPTIONS}</select> <input class="button2" type="submit" value="{L_GO}" /> + {L_SELECT_FORM}{L_COLON} <select name="mode" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();">{S_FORM_OPTIONS}</select> <input class="button2" type="submit" value="{L_GO}" /> {S_FORM_TOKEN} </fieldset> </form> @@ -106,7 +106,7 @@ <fieldset> <legend>{L_ACP_USER_RANK}</legend> <dl> - <dt><label for="user_rank">{L_USER_RANK}:</label></dt> + <dt><label for="user_rank">{L_USER_RANK}{L_COLON}</label></dt> <dd><select name="user_rank" id="user_rank">{S_RANK_OPTIONS}</select></dd> </dl> </fieldset> @@ -146,7 +146,7 @@ <!-- IF S_GROUP_OPTIONS --> <fieldset class="quick"> - {L_USER_GROUP_ADD}: <select name="g">{S_GROUP_OPTIONS}</select> <input class="button1" type="submit" name="update" value="{L_SUBMIT}" /> + {L_USER_GROUP_ADD}{L_COLON} <select name="g">{S_GROUP_OPTIONS}</select> <input class="button1" type="submit" name="update" value="{L_SUBMIT}" /> {S_FORM_TOKEN} </fieldset> <!-- ENDIF --> @@ -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"> @@ -177,7 +177,7 @@ <tbody> <!-- BEGIN attach --> <!-- IF attach.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> - <td><a href="{attach.U_DOWNLOAD}">{attach.REAL_FILENAME}</a><br /><span class="small"><!-- IF attach.S_IN_MESSAGE --><strong>{L_PM}: </strong><!-- ELSE --><strong>{L_POST}: </strong><!-- ENDIF --><a href="{attach.U_VIEW_TOPIC}">{attach.TOPIC_TITLE}</a></span></td> + <td><a href="{attach.U_DOWNLOAD}">{attach.REAL_FILENAME}</a><br /><span class="small"><!-- IF attach.S_IN_MESSAGE --><strong>{L_PM}{L_COLON} </strong><!-- ELSE --><strong>{L_POST}{L_COLON} </strong><!-- ENDIF --><a href="{attach.U_VIEW_TOPIC}">{attach.TOPIC_TITLE}</a></span></td> <td style="text-align: center">{attach.POST_TIME}</td> <td style="text-align: center">{attach.SIZE}</td> <td style="text-align: center">{attach.DOWNLOAD_COUNT}</td> @@ -192,15 +192,15 @@ </div> <!-- ENDIF --> <fieldset class="display-options"> - {L_SORT_BY}: <select name="sk">{S_SORT_KEY}</select> <select name="sd">{S_SORT_DIR}</select> + {L_SORT_BY}{L_COLON} <select name="sk">{S_SORT_KEY}</select> <select name="sd">{S_SORT_DIR}</select> <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}" /> @@ -219,7 +219,7 @@ <form id="select_forum" method="post" action="{U_ACTION}"> <fieldset class="quick" style="text-align: left;"> - {L_SELECT_FORUM}: <select name="f">{S_FORUM_OPTIONS}</select> + {L_SELECT_FORUM}{L_COLON} <select name="f">{S_FORUM_OPTIONS}</select> <input class="button2" type="submit" value="{L_GO}" name="select" /> {S_FORM_TOKEN} </fieldset> diff --git a/phpBB/adm/style/acp_users_avatar.html b/phpBB/adm/style/acp_users_avatar.html index 35d8374237..2135b52fb9 100644 --- a/phpBB/adm/style/acp_users_avatar.html +++ b/phpBB/adm/style/acp_users_avatar.html @@ -3,36 +3,36 @@ <fieldset> <legend>{L_ACP_USER_AVATAR}</legend> <dl> - <dt><label>{L_CURRENT_IMAGE}:</label><br /><span>{L_AVATAR_EXPLAIN}</span></dt> + <dt><label>{L_CURRENT_IMAGE}{L_COLON}</label><br /><span>{L_AVATAR_EXPLAIN}</span></dt> <dd>{AVATAR_IMAGE}</dd> <dd><label><input type="checkbox" class="radio" name="delete" /> {L_DELETE_AVATAR}</label></dd> </dl> <!-- IF not S_IN_AVATAR_GALLERY --> <!-- IF S_UPLOAD_FILE --> <dl> - <dt><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}:</label></dt> + <dt><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}{L_COLON}</label></dt> <dd><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_MAX_FILESIZE}" /><input type="file" id="uploadfile" name="uploadfile" /></dd> </dl> <!-- ENDIF --> <!-- IF S_REMOTE_UPLOAD --> <dl> - <dt><label for="uploadurl">{L_UPLOAD_AVATAR_URL}:</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></dt> + <dt><label for="uploadurl">{L_UPLOAD_AVATAR_URL}{L_COLON}</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></dt> <dd><input name="uploadurl" type="text" id="uploadurl" value="" /></dd> </dl> <!-- ENDIF --> <!-- IF S_ALLOW_REMOTE --> <dl> - <dt><label for="remotelink">{L_LINK_REMOTE_AVATAR}:</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></dt> + <dt><label for="remotelink">{L_LINK_REMOTE_AVATAR}{L_COLON}</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></dt> <dd><input name="remotelink" type="text" id="remotelink" value="" /></dd> </dl> <dl> - <dt><label for="width">{L_LINK_REMOTE_SIZE}:</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt> + <dt><label for="width">{L_LINK_REMOTE_SIZE}{L_COLON}</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt> <dd><input name="width" type="text" id="width" size="3" value="{USER_AVATAR_WIDTH}" /> <span>{L_PIXEL} × </span> <input type="text" name="height" size="3" value="{USER_AVATAR_HEIGHT}" /> <span>{L_PIXEL}</span></dd> </dl> <!-- ENDIF --> <!-- IF S_DISPLAY_GALLERY --> <dl> - <dt><label>{L_AVATAR_GALLERY}:</label></dt> + <dt><label>{L_AVATAR_GALLERY}{L_COLON}</label></dt> <dd><input class="button2" type="submit" name="display_gallery" value="{L_DISPLAY_GALLERY}" /></dd> </dl> <!-- ENDIF --> @@ -42,7 +42,7 @@ <fieldset> <legend>{L_AVATAR_GALLERY}</legend> <dl> - <dt><label for="category">{L_AVATAR_CATEGORY}:</label></dt> + <dt><label for="category">{L_AVATAR_CATEGORY}{L_COLON}</label></dt> <dd><select name="category" id="category">{S_CAT_OPTIONS}</select> <input class="button2" type="submit" value="{L_GO}" name="display_gallery" /></dd> </dl> <dl> diff --git a/phpBB/adm/style/acp_users_feedback.html b/phpBB/adm/style/acp_users_feedback.html index aa92353807..d1a4f59445 100644 --- a/phpBB/adm/style/acp_users_feedback.html +++ b/phpBB/adm/style/acp_users_feedback.html @@ -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"> @@ -40,15 +40,15 @@ <!-- ENDIF --> <fieldset class="display-options"> - {L_DISPLAY_LOG}: {S_LIMIT_DAYS} {L_SORT_BY}: {S_SORT_KEY} {S_SORT_DIR} + {L_DISPLAY_LOG}{L_COLON} {S_LIMIT_DAYS} {L_SORT_BY}{L_COLON} {S_SORT_KEY} {S_SORT_DIR} <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"> diff --git a/phpBB/adm/style/acp_users_overview.html b/phpBB/adm/style/acp_users_overview.html index ffdb4d472c..b7e3a9822e 100644 --- a/phpBB/adm/style/acp_users_overview.html +++ b/phpBB/adm/style/acp_users_overview.html @@ -3,54 +3,54 @@ <fieldset> <legend>{L_ACP_USER_OVERVIEW}</legend> <dl> - <dt><label for="user">{L_USERNAME}:</label><br /><span>{L_NAME_CHARS_EXPLAIN}</span></dt> + <dt><label for="user">{L_USERNAME}{L_COLON}</label><br /><span>{L_NAME_CHARS_EXPLAIN}</span></dt> <dd><input type="text" id="user" name="user" value="{USER}" /></dd> <!-- IF U_SWITCH_PERMISSIONS --><dd>[ <a href="{U_SWITCH_PERMISSIONS}">{L_USE_PERMISSIONS}</a> ]</dd><!-- ENDIF --> </dl> <!-- IF S_USER_INACTIVE --> <dl> - <dt><label>{L_USER_IS_INACTIVE}:</label></dt> + <dt><label>{L_USER_IS_INACTIVE}{L_COLON}</label></dt> <dd><strong>{USER_INACTIVE_REASON}</strong></dd> </dl> <!-- ENDIF --> <dl> - <dt><label>{L_REGISTERED}:</label></dt> + <dt><label>{L_REGISTERED}{L_COLON}</label></dt> <dd><strong>{USER_REGISTERED}</strong></dd> </dl> <!-- IF S_USER_IP --> <dl> - <dt><label>{L_REGISTERED_IP}:</label></dt> + <dt><label>{L_REGISTERED_IP}{L_COLON}</label></dt> <dd><a href="{U_SHOW_IP}">{REGISTERED_IP}</a></dd> <dd>[ <a href="{U_WHOIS}" onclick="popup(this.href, 700, 500, '_whois'); return false;">{L_WHOIS}</a> ]</dd> </dl> <!-- ENDIF --> <dl> - <dt><label>{L_LAST_ACTIVE}:</label></dt> + <dt><label>{L_LAST_ACTIVE}{L_COLON}</label></dt> <dd><strong>{USER_LASTACTIVE}</strong></dd> </dl> <dl> - <dt><label>{L_POSTS}:</label></dt> + <dt><label>{L_POSTS}{L_COLON}</label></dt> <dd><strong>{USER_POSTS}</strong><!-- IF POSTS_IN_QUEUE and U_MCP_QUEUE --> (<a href="{U_MCP_QUEUE}">{L_POSTS_IN_QUEUE}</a>)<!-- ELSEIF POSTS_IN_QUEUE --> ({L_POSTS_IN_QUEUE})<!-- ENDIF --></dd> </dl> <dl> - <dt><label>{L_WARNINGS}:</label></dt> + <dt><label>{L_WARNINGS}{L_COLON}</label></dt> <dd><strong>{USER_WARNINGS}</strong></dd> </dl> <dl> - <dt><label for="user_founder">{L_FOUNDER}:</label><br /><span>{L_FOUNDER_EXPLAIN}</span></dt> + <dt><label for="user_founder">{L_FOUNDER}{L_COLON}</label><br /><span>{L_FOUNDER_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" name="user_founder" value="1"<!-- IF S_USER_FOUNDER --> id="user_founder" checked="checked"<!-- ENDIF --><!-- IF not S_FOUNDER --> disabled="disabled"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="user_founder" value="0"<!-- IF not S_USER_FOUNDER --> id="user_founder" checked="checked"<!-- ENDIF --><!-- IF not S_FOUNDER --> disabled="disabled"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="user_email">{L_EMAIL}:</label></dt> + <dt><label for="user_email">{L_EMAIL}{L_COLON}</label></dt> <dd><input class="text medium" type="text" id="user_email" name="user_email" value="{USER_EMAIL}" autocomplete="off" /></dd> </dl> <dl> - <dt><label for="new_password">{L_NEW_PASSWORD}:</label><br /><span>{L_CHANGE_PASSWORD_EXPLAIN}</span></dt> + <dt><label for="new_password">{L_NEW_PASSWORD}{L_COLON}</label><br /><span>{L_CHANGE_PASSWORD_EXPLAIN}</span></dt> <dd><input type="password" id="new_password" name="new_password" value="" autocomplete="off" /></dd> </dl> <dl> - <dt><label for="password_confirm">{L_CONFIRM_PASSWORD}:</label><br /><span>{L_CONFIRM_PASSWORD_EXPLAIN}</span></dt> + <dt><label for="password_confirm">{L_CONFIRM_PASSWORD}{L_COLON}</label><br /><span>{L_CONFIRM_PASSWORD_EXPLAIN}</span></dt> <dd><input type="password" id="password_confirm" name="password_confirm" value="" autocomplete="off" /></dd> </dl> @@ -107,16 +107,16 @@ <fieldset> <legend>{L_USER_TOOLS}</legend> <dl> - <dt><label for="quicktools">{L_QUICK_TOOLS}:</label></dt> + <dt><label for="quicktools">{L_QUICK_TOOLS}{L_COLON}</label></dt> <dd><select id="quicktools" name="action" onchange="display_reason(this.options[this.selectedIndex].value);">{S_ACTION_OPTIONS}</select></dd> </dl> <div style="display: none;" id="reasons"> <dl> - <dt><label for="ban_reason">{L_BAN_REASON}:</label></dt> + <dt><label for="ban_reason">{L_BAN_REASON}{L_COLON}</label></dt> <dd><input name="ban_reason" type="text" class="text medium" maxlength="3000" id="ban_reason" /></dd> </dl> <dl> - <dt><label for="ban_give_reason">{L_BAN_GIVE_REASON}:</label></dt> + <dt><label for="ban_give_reason">{L_BAN_GIVE_REASON}{L_COLON}</label></dt> <dd><input name="ban_give_reason" type="text" class="text medium" maxlength="3000" id="ban_give_reason" /></dd> </dl> </div> @@ -135,13 +135,14 @@ <fieldset> <legend>{L_DELETE_USER}</legend> <dl> - <dt><label for="delete_type">{L_DELETE_USER}:</label><br /><span>{L_DELETE_USER_EXPLAIN}</span></dt> + <dt><label for="delete_type">{L_DELETE_USER}{L_COLON}</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> + <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> <!-- ELSE --> {L_USER_NO_POSTS_TO_DELETE}<input type="hidden" id="delete_type" name="delete_type" value="retain" /> <!-- ENDIF --> + </dd> </dl> <p class="quick"> <input class="button1" type="submit" name="update" value="{L_SUBMIT}" /> diff --git a/phpBB/adm/style/acp_users_prefs.html b/phpBB/adm/style/acp_users_prefs.html index a519447b2f..f1b9e28a66 100644 --- a/phpBB/adm/style/acp_users_prefs.html +++ b/phpBB/adm/style/acp_users_prefs.html @@ -9,60 +9,52 @@ <fieldset> <legend>{L_UCP_PREFS_PERSONAL}</legend> <dl> - <dt><label for="viewemail">{L_SHOW_EMAIL}:</label></dt> + <dt><label for="viewemail">{L_SHOW_EMAIL}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="viewemail" value="1"<!-- IF VIEW_EMAIL --> id="viewemail" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="viewemail" value="0"<!-- IF not VIEW_EMAIL --> id="viewemail" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="massemail">{L_ADMIN_EMAIL}:</label></dt> + <dt><label for="massemail">{L_ADMIN_EMAIL}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="massemail" value="1"<!-- IF MASS_EMAIL --> id="massemail" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="massemail" value="0"<!-- IF not MASS_EMAIL --> id="massemail" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="allowpm">{L_ALLOW_PM}:</label><br /><span>{L_ALLOW_PM_EXPLAIN}</span></dt> + <dt><label for="allowpm">{L_ALLOW_PM}{L_COLON}</label><br /><span>{L_ALLOW_PM_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" name="allowpm" value="1"<!-- IF ALLOW_PM --> id="allowpm" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="allowpm" value="0"<!-- IF not ALLOW_PM --> id="allowpm" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="hideonline">{L_HIDE_ONLINE}:</label></dt> + <dt><label for="hideonline">{L_HIDE_ONLINE}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="hideonline" value="1"<!-- IF HIDE_ONLINE --> id="hideonline" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="hideonline" value="0"<!-- IF not HIDE_ONLINE --> id="hideonline" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="notifymethod">{L_NOTIFY_METHOD}:</label><br /><span>{L_NOTIFY_METHOD_EXPLAIN}</span></dt> + <dt><label for="notifymethod">{L_NOTIFY_METHOD}{L_COLON}</label><br /><span>{L_NOTIFY_METHOD_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" name="notifymethod" value="0"<!-- IF NOTIFY_EMAIL --> id="notifymethod" checked="checked"<!-- ENDIF --> /> {L_NOTIFY_METHOD_EMAIL}</label> <label><input type="radio" class="radio" name="notifymethod" value="1"<!-- IF NOTIFY_IM --> id="notifymethod" checked="checked"<!-- ENDIF --><!-- IF S_JABBER_DISABLED --> disabled="disabled"<!-- ENDIF --> /> {L_NOTIFY_METHOD_IM}</label> <label><input type="radio" class="radio" name="notifymethod" value="2"<!-- IF NOTIFY_BOTH --> id="notifymethod" checked="checked"<!-- ENDIF --> /> {L_NOTIFY_METHOD_BOTH}</label></dd> </dl> <dl> - <dt><label for="notifypm">{L_NOTIFY_ON_PM}:</label></dt> + <dt><label for="notifypm">{L_NOTIFY_ON_PM}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="notifypm" value="1"<!-- IF NOTIFY_PM --> id="notifypm" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="notifypm" value="0"<!-- IF not NOTIFY_PM --> id="notifypm" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="popuppm">{L_POPUP_ON_PM}:</label></dt> + <dt><label for="popuppm">{L_POPUP_ON_PM}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="popuppm" value="1"<!-- IF POPUP_PM --> id="popuppm" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="popuppm" value="0"<!-- IF not POPUP_PM --> id="popuppm" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="lang">{L_BOARD_LANGUAGE}:</label></dt> + <dt><label for="lang">{L_BOARD_LANGUAGE}{L_COLON}</label></dt> <dd><select id="lang" name="lang">{S_LANG_OPTIONS}</select></dd> </dl> <dl> - <dt><label for="style">{L_BOARD_STYLE}:</label></dt> + <dt><label for="style">{L_BOARD_STYLE}{L_COLON}</label></dt> <dd><select id="style" name="style">{S_STYLE_OPTIONS}</select></dd> </dl> + <!-- INCLUDE timezone_option.html --> <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> - <dl> - <dt><label for="dateoptions">{L_BOARD_DATE_FORMAT}:</label><br /><span>{L_BOARD_DATE_FORMAT_EXPLAIN}</span></dt> + <dt><label for="dateoptions">{L_BOARD_DATE_FORMAT}{L_COLON}</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> <dd><div id="custom_date"<!-- IF not S_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="30" /></div></dd> </dl> @@ -71,22 +63,22 @@ <fieldset> <legend>{L_UCP_PREFS_POST}</legend> <dl> - <dt><label for="bbcode">{L_DEFAULT_BBCODE}:</label></dt> + <dt><label for="bbcode">{L_DEFAULT_BBCODE}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="bbcode" value="1"<!-- IF BBCODE --> id="bbcode" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="bbcode" value="0"<!-- IF not BBCODE --> id="bbcode" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="smilies">{L_DEFAULT_SMILIES}:</label></dt> + <dt><label for="smilies">{L_DEFAULT_SMILIES}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="smilies" value="1"<!-- IF SMILIES --> id="smilies" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="smilies" value="0"<!-- IF not SMILIES --> id="smilies" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="sig">{L_DEFAULT_ADD_SIG}:</label></dt> + <dt><label for="sig">{L_DEFAULT_ADD_SIG}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="sig" value="1"<!-- IF ATTACH_SIG --> id="sig" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="sig" value="0"<!-- IF not ATTACH_SIG --> id="sig" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="notify">{L_DEFAULT_NOTIFY}:</label></dt> + <dt><label for="notify">{L_DEFAULT_NOTIFY}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="notify" value="1"<!-- IF NOTIFY --> id="notify" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="notify" value="0"<!-- IF not NOTIFY --> id="notify" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> @@ -95,57 +87,57 @@ <fieldset> <legend>{L_UCP_PREFS_VIEW}</legend> <dl> - <dt><label for="view_images">{L_VIEW_IMAGES}:</label></dt> + <dt><label for="view_images">{L_VIEW_IMAGES}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="view_images" value="1"<!-- IF VIEW_IMAGES --> id="view_images" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="view_images" value="0"<!-- IF not VIEW_IMAGES --> id="view_images" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="view_flash">{L_VIEW_FLASH}:</label></dt> + <dt><label for="view_flash">{L_VIEW_FLASH}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="view_flash" value="1"<!-- IF VIEW_FLASH --> id="view_flash" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="view_flash" value="0"<!-- IF not VIEW_FLASH --> id="view_flash" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="view_smilies">{L_VIEW_SMILIES}:</label></dt> + <dt><label for="view_smilies">{L_VIEW_SMILIES}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="view_smilies" value="1"<!-- IF VIEW_SMILIES --> id="view_smilies" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="view_smilies" value="0"<!-- IF not VIEW_SMILIES --> id="view_smilies" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="view_sigs">{L_VIEW_SIGS}:</label></dt> + <dt><label for="view_sigs">{L_VIEW_SIGS}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="view_sigs" value="1"<!-- IF VIEW_SIGS --> id="view_sigs" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="view_sigs" value="0"<!-- IF not VIEW_SIGS --> id="view_sigss" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="view_avatars">{L_VIEW_AVATARS}:</label></dt> + <dt><label for="view_avatars">{L_VIEW_AVATARS}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="view_avatars" value="1"<!-- IF VIEW_AVATARS --> id="view_avatars" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="view_avatars" value="0"<!-- IF not VIEW_AVATARS --> id="view_avatars" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="view_wordcensor">{L_DISABLE_CENSORS}:</label></dt> + <dt><label for="view_wordcensor">{L_DISABLE_CENSORS}{L_COLON}</label></dt> <dd><label><input type="radio" class="radio" name="view_wordcensor" value="1"<!-- IF VIEW_WORDCENSOR --> id="view_wordcensor" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="view_wordcensor" value="0"<!-- IF not VIEW_WORDCENSOR --> id="view_wordcensor" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label>{L_VIEW_TOPICS_DAYS}:</label></dt> + <dt><label>{L_VIEW_TOPICS_DAYS}{L_COLON}</label></dt> <dd>{S_TOPIC_SORT_DAYS}</dd> </dl> <dl> - <dt><label>{L_VIEW_TOPICS_KEY}:</label></dt> + <dt><label>{L_VIEW_TOPICS_KEY}{L_COLON}</label></dt> <dd>{S_TOPIC_SORT_KEY}</dd> </dl> <dl> - <dt><label>{L_VIEW_TOPICS_DIR}:</label></dt> + <dt><label>{L_VIEW_TOPICS_DIR}{L_COLON}</label></dt> <dd>{S_TOPIC_SORT_DIR}</dd> </dl> <dl> - <dt><label>{L_VIEW_POSTS_DAYS}:</label></dt> + <dt><label>{L_VIEW_POSTS_DAYS}{L_COLON}</label></dt> <dd>{S_POST_SORT_DAYS}</dd> </dl> <dl> - <dt><label>{L_VIEW_POSTS_KEY}:</label></dt> + <dt><label>{L_VIEW_POSTS_KEY}{L_COLON}</label></dt> <dd>{S_POST_SORT_KEY}</dd> </dl> <dl> - <dt><label>{L_VIEW_POSTS_DIR}:</label></dt> + <dt><label>{L_VIEW_POSTS_DIR}{L_COLON}</label></dt> <dd>{S_POST_SORT_DIR}</dd> </dl> </fieldset> diff --git a/phpBB/adm/style/acp_users_profile.html b/phpBB/adm/style/acp_users_profile.html index ea7204e2e4..3232e8d1f5 100644 --- a/phpBB/adm/style/acp_users_profile.html +++ b/phpBB/adm/style/acp_users_profile.html @@ -3,44 +3,44 @@ <fieldset> <legend>{L_USER_PROFILE}</legend> <dl> - <dt><label for="icq">{L_UCP_ICQ}:</label></dt> + <dt><label for="icq">{L_UCP_ICQ}{L_COLON}</label></dt> <dd><input type="text" id="icq" name="icq" value="{ICQ}" /></dd> </dl> <dl> - <dt><label for="aim">{L_UCP_AIM}:</label></dt> + <dt><label for="aim">{L_UCP_AIM}{L_COLON}</label></dt> <dd><input type="text" id="aim" name="aim" value="{AIM}" /></dd> </dl> <dl> - <dt><label for="msn">{L_UCP_MSNM}:</label></dt> + <dt><label for="msn">{L_UCP_MSNM}{L_COLON}</label></dt> <dd><input type="text" id="msn" name="msn" value="{MSN}" /></dd> </dl> <dl> - <dt><label for="yim">{L_UCP_YIM}:</label></dt> + <dt><label for="yim">{L_UCP_YIM}{L_COLON}</label></dt> <dd><input type="text" id="yim" name="yim" value="{YIM}" /></dd> </dl> <dl> - <dt><label for="jabber">{L_UCP_JABBER}:</label></dt> + <dt><label for="jabber">{L_UCP_JABBER}{L_COLON}</label></dt> <dd><input type="text" id="jabber" name="jabber" value="{JABBER}" /></dd> </dl> <dl> - <dt><label for="website">{L_WEBSITE}:</label></dt> + <dt><label for="website">{L_WEBSITE}{L_COLON}</label></dt> <dd><input type="text" id="website" name="website" value="{WEBSITE}" /></dd> </dl> <dl> - <dt><label for="location">{L_LOCATION}:</label></dt> + <dt><label for="location">{L_LOCATION}{L_COLON}</label></dt> <dd><input type="text" id="location" name="location" value="{LOCATION}" /></dd> </dl> <dl> - <dt><label for="occupation">{L_OCCUPATION}:</label></dt> + <dt><label for="occupation">{L_OCCUPATION}{L_COLON}</label></dt> <dd><textarea id="occupation" name="occupation" rows="3" cols="30">{OCCUPATION}</textarea></dd> </dl> <dl> - <dt><label for="interests">{L_INTERESTS}:</label></dt> + <dt><label for="interests">{L_INTERESTS}{L_COLON}</label></dt> <dd><textarea id="interests" name="interests" rows="3" cols="30">{INTERESTS}</textarea></dd> </dl> <dl> - <dt><label for="birthday">{L_BIRTHDAY}:</label><br /><span>{L_BIRTHDAY_EXPLAIN}</span></dt> - <dd>{L_DAY}: <select id="birthday" name="bday_day">{S_BIRTHDAY_DAY_OPTIONS}</select> {L_MONTH}: <select name="bday_month">{S_BIRTHDAY_MONTH_OPTIONS}</select> {L_YEAR}: <select name="bday_year">{S_BIRTHDAY_YEAR_OPTIONS}</select></dd> + <dt><label for="birthday">{L_BIRTHDAY}{L_COLON}</label><br /><span>{L_BIRTHDAY_EXPLAIN}</span></dt> + <dd>{L_DAY}{L_COLON} <select id="birthday" name="bday_day">{S_BIRTHDAY_DAY_OPTIONS}</select> {L_MONTH}{L_COLON} <select name="bday_month">{S_BIRTHDAY_MONTH_OPTIONS}</select> {L_YEAR}{L_COLON} <select name="bday_year">{S_BIRTHDAY_YEAR_OPTIONS}</select></dd> </dl> </fieldset> @@ -49,7 +49,7 @@ <legend>{L_USER_CUSTOM_PROFILE_FIELDS}</legend> <!-- BEGIN profile_fields --> <dl> - <dt><label<!-- IF profile_fields.FIELD_ID --> for="{profile_fields.FIELD_ID}"<!-- ENDIF -->>{profile_fields.LANG_NAME}:</label><!-- IF profile_fields.LANG_EXPLAIN --><br /><span>{profile_fields.LANG_EXPLAIN}</span><!-- ENDIF --></dt> + <dt><label<!-- IF profile_fields.FIELD_ID --> for="{profile_fields.FIELD_ID}"<!-- ENDIF -->>{profile_fields.LANG_NAME}{L_COLON}</label><!-- IF profile_fields.LANG_EXPLAIN --><br /><span>{profile_fields.LANG_EXPLAIN}</span><!-- ENDIF --></dt> <dd>{profile_fields.FIELD}</dd> <!-- IF profile_fields.ERROR --> <dd><span class="small" style="color: red;">{profile_fields.ERROR}</span></dd> diff --git a/phpBB/adm/style/acp_users_signature.html b/phpBB/adm/style/acp_users_signature.html index d55deac808..c9cc053eec 100644 --- a/phpBB/adm/style/acp_users_signature.html +++ b/phpBB/adm/style/acp_users_signature.html @@ -26,7 +26,7 @@ d: '{LA_BBCODE_D_HELP}', tip: '{L_STYLES_TIP}' <!-- BEGIN custom_tags --> - ,cb_{custom_tags.BBCODE_ID}: '{custom_tags.A_BBCODE_HELPLINE}' + ,cb_{custom_tags.BBCODE_ID}{L_COLON} '{custom_tags.A_BBCODE_HELPLINE}' <!-- END custom_tags --> } @@ -66,7 +66,7 @@ <input type="button" class="button2" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" onmouseover="helpline('d')" onmouseout="helpline('tip')" /> <!-- ENDIF --> - {L_FONT_SIZE}: <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" title="{L_FONT_SIZE}" onmouseover="helpline('f')" onmouseout="helpline('tip')"> + {L_FONT_SIZE}{L_COLON} <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" title="{L_FONT_SIZE}" onmouseover="helpline('f')" onmouseout="helpline('tip')"> <option value="50">{L_FONT_TINY}</option> <option value="85">{L_FONT_SMALL}</option> <option value="100" selected="selected">{L_FONT_NORMAL}</option> @@ -92,8 +92,8 @@ // ]]> </script> </dt> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 90px;"><textarea name="signature" rows="10" cols="60" style="width: 95%;" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();">{SIGNATURE}</textarea></dd> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 90px; margin-top: 5px;"> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 90px;"><textarea name="signature" rows="10" cols="60" style="width: 95%;" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();">{SIGNATURE}</textarea></dd> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 90px; margin-top: 5px;"> <!-- IF S_BBCODE_ALLOWED --> <label><input type="checkbox" class="radio" name="disable_bbcode"{S_BBCODE_CHECKED} /> {L_DISABLE_BBCODE}</label> <!-- ENDIF --> @@ -104,7 +104,7 @@ <label><input type="checkbox" class="radio" name="disable_magic_url"{S_MAGIC_URL_CHECKED} /> {L_DISABLE_MAGIC_URL}</label> <!-- ENDIF --> </dd> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 90px; margin-top: 10px;"><strong>{L_OPTIONS}: </strong>{BBCODE_STATUS} :: {IMG_STATUS} :: {FLASH_STATUS} :: {URL_STATUS} :: {SMILIES_STATUS}</dd> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 90px; margin-top: 10px;"><strong>{L_OPTIONS}{L_COLON} </strong>{BBCODE_STATUS} :: {IMG_STATUS} :: {FLASH_STATUS} :: {URL_STATUS} :: {SMILIES_STATUS}</dd> </dl> </fieldset> diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index 08613de0dd..8551c952c7 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -1148,55 +1148,79 @@ input.disabled { width: auto; text-align: right; margin-top: 5px; - font-size: 0.85em; - padding-bottom: 2px; + float: right; } .rtl .pagination { text-align: left; + float: left; } -.pagination strong, -.pagination b { - font-weight: normal; +li.pagination { + margin-top: 0; } -.pagination span.page-sep { - display:none; +.pagination img { + vertical-align: middle; } -.pagination span strong { - padding: 0 2px; - margin: 0 2px; - font-weight: normal; - font-size: 0.85em; - color: #FFFFFF; - background: #4692BF; - border: 1px solid #4692BF; +.pagination ul { + display: inline-block; + *display: inline; /* IE7 inline-block hack */ + *zoom: 1; + margin-left: 0; + margin-bottom: 0; } -.pagination span a, .pagination span a:link, .pagination span a:visited, .pagination span a:active { +li.pagination ul { + margin-top: -2px; + vertical-align: middle; +} + +.pagination ul li, dl .pagination ul li, dl.icon .pagination ul li { + display: inline; + padding: 0; + font-size: 100%; + line-height: normal; +} + +.pagination li a, .pagnation li span, li .pagination li a, li .pagnation li span, .pagination li.active span, .pagination li.ellipsis span { font-weight: normal; - font-size: 0.85em; text-decoration: none; - color: #5C758C; - margin: 0 2px; padding: 0 2px; - background: #ECEDEE; - border: 1px solid #B4BAC0; + border: 1px solid transparent; + font-size: 0.9em; + line-height: 1.5em; } -.pagination span a:hover { - border-color: #368AD2; - background: #368AD2; +.pagination li a, .pagination li a:link, .pagination li a:visited { + color: #5C758C; + background-color: #ECEDEE; + border-color: #B4BAC0; +} + +.pagination li.ellipsis span { + background-color: transparent; + color: #000000; +} + +.pagination li.active span { color: #FFFFFF; - text-decoration: none; + background-color: #4692BF; + border-color: #4692BF; } -.pagination img { - vertical-align: middle; +.pagination li a:hover, .pagination .active a:hover { + color: #FFFFFF; + background-color: #368AD2; + border-color: #368AD2; } +.pagination li a:active, .pagination li.active a:active { + color: #5C758C; + background-color: #ECEDEE; + border-color: #B4BAC0; +} /* Action Highlighting ---------------------------------------- */ @@ -1718,3 +1742,13 @@ fieldset.permissions .padding { .phpinfo td, .phpinfo th, .phpinfo h2, .phpinfo h1 { text-align: left; } + +.requirements_not_met { + padding: 5px; + background-color: #BC2A4D; +} + +.requirements_not_met dt label, .requirements_not_met dd p { + color: #FFFFFF; + font-size: 1.4em; +} diff --git a/phpBB/adm/style/ajax.js b/phpBB/adm/style/ajax.js index 12541cb057..3ccb368665 100644 --- a/phpBB/adm/style/ajax.js +++ b/phpBB/adm/style/ajax.js @@ -10,76 +10,98 @@ var img_templates = { }; /** - * The following callbacks are for reording forums in acp_forums. forum_down - * is triggered when a forum is moved down, and forum_up is triggered when - * a forum is moved up. It moves the row up or down, and deactivates / + * The following callbacks are for reording items. row_down + * is triggered when an item is moved down, and row_up is triggered when + * an item is moved up. It moves the row up or down, and deactivates / * activates any up / down icons that require it (the ones at the top or bottom). */ -phpbb.add_ajax_callback('forum_down', function() { +phpbb.add_ajax_callback('row_down', function() { var el = $(this), - tr = el.parents('tr'); - + tr = el.parents('tr'), + tr_swap = tr.next(); + + /* + * If the element was the first one, we have to: + * - Add the up-link to the row we moved + * - Remove the up-link on the next row + */ if (tr.is(':first-child')) { var up_img = img_templates.up.clone().attr('href', tr.attr('data-up')); - el.parents('span').siblings('.up').html(up_img); - - tr.next().find('.up').html(img_templates.up_disabled); + tr.find('.up').html(up_img); phpbb.ajaxify({ - selector: el.parents('span').siblings('.up').children('a'), - callback: 'forum_up', + selector: tr.find('.up').children('a'), + callback: 'row_up', overlay: false }); + + tr_swap.find('.up').html(img_templates.up_disabled.clone()); } - tr.insertAfter(tr.next()); + tr.insertAfter(tr_swap); + /* + * As well as: + * - Remove the down-link on the moved row, if it is now the last row + * - Add the down-link to the next row, if it was the last row + */ if (tr.is(':last-child')) { - el.replaceWith(img_templates.down_disabled); + tr.find('.down').html(img_templates.down_disabled.clone()); - var down_img = img_templates.down.clone().attr('href', tr.attr('data-down')); - tr.prev().find('.down').html(down_img); + var down_img = img_templates.down.clone().attr('href', tr_swap.attr('data-down')); + tr_swap.find('.down').html(down_img); phpbb.ajaxify({ - selector: tr.prev().find('.down').children('a'), - callback: 'forum_down', + selector: tr_swap.find('.down').children('a'), + callback: 'row_down', overlay: false }); } }); -phpbb.add_ajax_callback('forum_up', function() { +phpbb.add_ajax_callback('row_up', function() { var el = $(this), - tr = el.parents('tr'); - + tr = el.parents('tr'), + tr_swap = tr.prev(); + + /* + * If the element was the last one, we have to: + * - Add the down-link to the row we moved + * - Remove the down-link on the next row + */ if (tr.is(':last-child')) { var down_img = img_templates.down.clone().attr('href', tr.attr('data-down')); - el.parents('span').siblings('.down').html(down_img); - - tr.prev().find('.down').html(img_templates.down_disabled); + tr.find('.down').html(down_img); phpbb.ajaxify({ - selector: el.parents('span').siblings('.down').children('a'), - callback: 'forum_down', + selector: tr.find('.down').children('a'), + callback: 'row_down', overlay: false }); + + tr_swap.find('.down').html(img_templates.down_disabled.clone()); } - tr.insertBefore(tr.prev()); + tr.insertBefore(tr_swap); + /* + * As well as: + * - Remove the up-link on the moved row, if it is now the first row + * - Add the up-link to the previous row, if it was the first row + */ if (tr.is(':first-child')) { - el.replaceWith(img_templates.up_disabled); + tr.find('.up').html(img_templates.up_disabled.clone()); - var up_img = img_templates.up.clone().attr('href', tr.attr('data-up')); - tr.next().find('.up').html(up_img); + var up_img = img_templates.up.clone().attr('href', tr_swap.attr('data-up')); + tr_swap.find('.up').html(up_img); phpbb.ajaxify({ - selector: tr.next().find('.up').children('a'), - callback: 'forum_up', + selector: tr_swap.find('.up').children('a'), + callback: 'row_up', overlay: false }); } diff --git a/phpBB/adm/style/captcha_default_acp_demo.html b/phpBB/adm/style/captcha_default_acp_demo.html index 0b1434f7e0..0f137f28df 100644 --- a/phpBB/adm/style/captcha_default_acp_demo.html +++ b/phpBB/adm/style/captcha_default_acp_demo.html @@ -1,4 +1,4 @@ <dl> - <dt><label for="captcha_preview">{L_PREVIEW}:</label><br /><span>{L_CAPTCHA_PREVIEW_EXPLAIN}</span></dt> + <dt><label for="captcha_preview">{L_PREVIEW}{L_COLON}</label><br /><span>{L_CAPTCHA_PREVIEW_EXPLAIN}</span></dt> <dd><img src="{CONFIRM_IMAGE}" alt="{L_PREVIEW}" width="360" height="96" id="captcha_preview" /></dd> </dl> diff --git a/phpBB/adm/style/captcha_gd_acp.html b/phpBB/adm/style/captcha_gd_acp.html index e2804bbc7d..b333d9205c 100644 --- a/phpBB/adm/style/captcha_gd_acp.html +++ b/phpBB/adm/style/captcha_gd_acp.html @@ -14,32 +14,32 @@ <legend>{L_GENERAL_OPTIONS}</legend> <dl> - <dt><label for="captcha_gd_foreground_noise">{L_CAPTCHA_GD_FOREGROUND_NOISE}:</label><br /><span>{L_CAPTCHA_GD_FOREGROUND_NOISE_EXPLAIN}</span></dt> + <dt><label for="captcha_gd_foreground_noise">{L_CAPTCHA_GD_FOREGROUND_NOISE}{L_COLON}</label><br /><span>{L_CAPTCHA_GD_FOREGROUND_NOISE_EXPLAIN}</span></dt> <dd><label><input id="captcha_gd_foreground_noise" name="captcha_gd_foreground_noise" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_FOREGROUND_NOISE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input name="captcha_gd_foreground_noise" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD_FOREGROUND_NOISE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="captcha_gd_x_grid">{L_CAPTCHA_GD_X_GRID}:</label><br /><span>{L_CAPTCHA_GD_X_GRID_EXPLAIN}</span></dt> + <dt><label for="captcha_gd_x_grid">{L_CAPTCHA_GD_X_GRID}{L_COLON}</label><br /><span>{L_CAPTCHA_GD_X_GRID_EXPLAIN}</span></dt> <dd><input id="captcha_gd_x_grid" name="captcha_gd_x_grid" value="{CAPTCHA_GD_X_GRID}" type="text" /></dd> </dl> <dl> - <dt><label for="captcha_gd_y_grid">{L_CAPTCHA_GD_Y_GRID}:</label><br /><span>{L_CAPTCHA_GD_Y_GRID_EXPLAIN}</span></dt> + <dt><label for="captcha_gd_y_grid">{L_CAPTCHA_GD_Y_GRID}{L_COLON}</label><br /><span>{L_CAPTCHA_GD_Y_GRID_EXPLAIN}</span></dt> <dd><input id="captcha_gd_y_grid" name="captcha_gd_y_grid" value="{CAPTCHA_GD_Y_GRID}" type="text" /></dd> </dl> <dl> - <dt><label for="captcha_gd_wave">{L_CAPTCHA_GD_WAVE}:</label><br /><span>{L_CAPTCHA_GD_WAVE_EXPLAIN}</span></dt> + <dt><label for="captcha_gd_wave">{L_CAPTCHA_GD_WAVE}{L_COLON}</label><br /><span>{L_CAPTCHA_GD_WAVE_EXPLAIN}</span></dt> <dd><label><input id="captcha_gd_wave" name="captcha_gd_wave" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_WAVE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input name="captcha_gd_wave" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD_WAVE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label> </dd> </dl> <dl> - <dt><label for="captcha_gd_3d_noise">{L_CAPTCHA_GD_3D_NOISE}:</label><br /><span>{L_CAPTCHA_GD_3D_NOISE_EXPLAIN}</span></dt> + <dt><label for="captcha_gd_3d_noise">{L_CAPTCHA_GD_3D_NOISE}{L_COLON}</label><br /><span>{L_CAPTCHA_GD_3D_NOISE_EXPLAIN}</span></dt> <dd><label><input id="captcha_gd_3d_noise" name="captcha_gd_3d_noise" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_3D_NOISE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input name="captcha_gd_3d_noise" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD_3D_NOISE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label> </dd> </dl> <dl> - <dt><label for="captcha_gd_fonts">{L_CAPTCHA_GD_FONTS}:</label><br /><span>{L_CAPTCHA_GD_FONTS_EXPLAIN}</span></dt> + <dt><label for="captcha_gd_fonts">{L_CAPTCHA_GD_FONTS}{L_COLON}</label><br /><span>{L_CAPTCHA_GD_FONTS_EXPLAIN}</span></dt> <dd><label><input id="captcha_gd_fonts" name="captcha_gd_fonts" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_FONTS == 1 --> checked="checked"<!-- ENDIF --> /> {L_CAPTCHA_FONT_DEFAULT}</label> <label><input name="captcha_gd_fonts" value="2" class="radio" type="radio"<!-- IF CAPTCHA_GD_FONTS == 2 --> checked="checked"<!-- ENDIF --> /> {L_CAPTCHA_FONT_NEW}</label> <label><input name="captcha_gd_fonts" value="3" class="radio" type="radio"<!-- IF CAPTCHA_GD_FONTS == 3 --> checked="checked"<!-- ENDIF --> /> {L_CAPTCHA_FONT_LOWER}</label> diff --git a/phpBB/adm/style/captcha_qa_acp.html b/phpBB/adm/style/captcha_qa_acp.html index 4eb46d2d3c..99f3f24f70 100644 --- a/phpBB/adm/style/captcha_qa_acp.html +++ b/phpBB/adm/style/captcha_qa_acp.html @@ -59,7 +59,7 @@ <fieldset> <legend>{L_EDIT_QUESTION}</legend> <dl> - <dt><label for="strict">{L_QUESTION_STRICT}:</label><br /><span>{L_QUESTION_STRICT_EXPLAIN}</span></dt> + <dt><label for="strict">{L_QUESTION_STRICT}{L_COLON}</label><br /><span>{L_QUESTION_STRICT_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" name="strict" value="1"<!-- IF STRICT --> id="strict" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="strict" value="0"<!-- IF not STRICT --> id="strict" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> diff --git a/phpBB/adm/style/captcha_qa_acp_demo.html b/phpBB/adm/style/captcha_qa_acp_demo.html index 0ea2d6a024..79170e27c6 100644 --- a/phpBB/adm/style/captcha_qa_acp_demo.html +++ b/phpBB/adm/style/captcha_qa_acp_demo.html @@ -1,5 +1,5 @@ <dl> - <dt><label for="answer"><!-- IF QA_CONFIRM_QUESTION --> {QA_CONFIRM_QUESTION} <!-- ELSE --> {L_CONFIRM_QUESTION} <!-- ENDIF -->:</label><br /><span>{L_CONFIRM_QUESTION_EXPLAIN}</span></dt> + <dt><label for="answer"><!-- IF QA_CONFIRM_QUESTION --> {QA_CONFIRM_QUESTION} <!-- ELSE --> {L_CONFIRM_QUESTION} <!-- ENDIF -->{L_COLON}</label><br /><span>{L_CONFIRM_QUESTION_EXPLAIN}</span></dt> <dd> <input type="text" tabindex="10" name="answer" id="answer" size="45" class="inputbox autowidth" title="{L_ANSWER}" /> diff --git a/phpBB/adm/style/captcha_recaptcha_acp.html b/phpBB/adm/style/captcha_recaptcha_acp.html index 34912c7955..67176ebd07 100644 --- a/phpBB/adm/style/captcha_recaptcha_acp.html +++ b/phpBB/adm/style/captcha_recaptcha_acp.html @@ -13,11 +13,11 @@ <legend>{L_GENERAL_OPTIONS}</legend> <dl> - <dt><label for="recaptcha_pubkey">{L_RECAPTCHA_PUBLIC}:</label><br /><span>{L_RECAPTCHA_PUBLIC_EXPLAIN}</span></dt> + <dt><label for="recaptcha_pubkey">{L_RECAPTCHA_PUBLIC}{L_COLON}</label><br /><span>{L_RECAPTCHA_PUBLIC_EXPLAIN}</span></dt> <dd><input id="recaptcha_pubkey" name="recaptcha_pubkey" value="{RECAPTCHA_PUBKEY}" size="50" type="text" /></dd> </dl> <dl> - <dt><label for="recaptcha_privkey">{L_RECAPTCHA_PRIVATE}:</label><br /><span>{L_RECAPTCHA_PRIVATE_EXPLAIN}</span></dt> + <dt><label for="recaptcha_privkey">{L_RECAPTCHA_PRIVATE}{L_COLON}</label><br /><span>{L_RECAPTCHA_PRIVATE_EXPLAIN}</span></dt> <dd><input id="recaptcha_privkey" name="recaptcha_privkey" value="{RECAPTCHA_PRIVKEY}" size="50" type="text" /></dd> </dl> diff --git a/phpBB/adm/style/confirm_body_prune.html b/phpBB/adm/style/confirm_body_prune.html index 9481386231..4c00ac2c3d 100644 --- a/phpBB/adm/style/confirm_body_prune.html +++ b/phpBB/adm/style/confirm_body_prune.html @@ -2,6 +2,23 @@ <form id="confirm" method="post" action="{S_CONFIRM_ACTION}"> +<fieldset id="userlist"> + <h2>{L_PRUNE_USERS_LIST}</h2> + <!-- IF S_DEACTIVATE --><p>{L_PRUNE_USERS_LIST_DEACTIVATE}</p><!-- ELSE --><p>{L_PRUNE_USERS_LIST_DELETE}</p><!-- ENDIF --> + + <br /> + <!-- BEGIN users --> + » <input type="checkbox" name="user_ids[]" value="{users.USER_ID}" checked="checked" /> + <a href="{users.U_PROFILE}">{users.USERNAME}</a> + <!-- IF users.U_USER_ADMIN --> [ <a href="{users.U_USER_ADMIN}">{L_USER_ADMIN}</a> ]<!-- ENDIF --><br /> + <!-- END users --> + <br /> + <span class="small"> + <a href="#" onclick="marklist('userlist', 'user_ids', true)">{L_MARK_ALL}</a> • + <a href="#" onclick="marklist('userlist', 'user_ids', false)">{L_UNMARK_ALL}</a> + </span> +</fieldset> + <fieldset> <h1>{MESSAGE_TITLE}</h1> <p>{MESSAGE_TEXT}</p> @@ -12,17 +29,6 @@ <input type="submit" name="confirm" value="{L_YES}" class="button2" /> <input type="submit" name="cancel" value="{L_NO}" class="button2" /> </div> - - <h2>{L_PRUNE_USERS_LIST}</h2> - <!-- IF S_DEACTIVATE --><p>{L_PRUNE_USERS_LIST_DEACTIVATE}</p><!-- ELSE --><p>{L_PRUNE_USERS_LIST_DELETE}</p><!-- ENDIF --> - - <br /> - <!-- BEGIN users --> - » <a href="{users.U_PROFILE}">{users.USERNAME}</a><!-- IF users.U_USER_ADMIN --> [<a href="{users.U_USER_ADMIN}">{L_USER_ADMIN}</a>]<!-- ENDIF --><br /> - <!-- END users --> - - <br /><br /> - </fieldset> </form> diff --git a/phpBB/adm/style/custom_profile_fields.html b/phpBB/adm/style/custom_profile_fields.html index 351397d3c7..982356bfa7 100644 --- a/phpBB/adm/style/custom_profile_fields.html +++ b/phpBB/adm/style/custom_profile_fields.html @@ -26,7 +26,7 @@ <!-- END int --> <!-- BEGIN date --> - <span>{L_DAY}:</span> <select name="{date.FIELD_IDENT}_day" id="{date.FIELD_IDENT}_day">{date.S_DAY_OPTIONS}</select> - <span>{L_MONTH}:</span> <select name="{date.FIELD_IDENT}_month" id="{date.FIELD_IDENT}_month">{date.S_MONTH_OPTIONS}</select> - <span>{L_YEAR}:</span> <select name="{date.FIELD_IDENT}_year" id="{date.FIELD_IDENT}_year">{date.S_YEAR_OPTIONS}</select> + <span>{L_DAY}{L_COLON}</span> <select name="{date.FIELD_IDENT}_day" id="{date.FIELD_IDENT}_day">{date.S_DAY_OPTIONS}</select> + <span>{L_MONTH}{L_COLON}</span> <select name="{date.FIELD_IDENT}_month" id="{date.FIELD_IDENT}_month">{date.S_MONTH_OPTIONS}</select> + <span>{L_YEAR}{L_COLON}</span> <select name="{date.FIELD_IDENT}_year" id="{date.FIELD_IDENT}_year">{date.S_YEAR_OPTIONS}</select> <!-- END date --> diff --git a/phpBB/adm/style/install_convert.html b/phpBB/adm/style/install_convert.html index cf78f30b50..5fec8c4789 100644 --- a/phpBB/adm/style/install_convert.html +++ b/phpBB/adm/style/install_convert.html @@ -86,7 +86,7 @@ <!-- ELSE --> <dl> - <dt><label>{checks.TITLE}:</label><!-- IF checks.S_EXPLAIN --><br /><span class="explain">{checks.TITLE_EXPLAIN}</span><!-- ENDIF --></dt> + <dt><label>{checks.TITLE}{L_COLON}</label><!-- IF checks.S_EXPLAIN --><br /><span class="explain">{checks.TITLE_EXPLAIN}</span><!-- ENDIF --></dt> <dd>{checks.RESULT}</dd> </dl> <!-- ENDIF --> @@ -109,7 +109,7 @@ <!-- ELSE --> <dl> - <dt><label for="{options.KEY}">{options.TITLE}:</label><!-- IF options.S_EXPLAIN --><br /><span class="explain">{options.TITLE_EXPLAIN}</span><!-- ENDIF --></dt> + <dt><label for="{options.KEY}">{options.TITLE}{L_COLON}</label><!-- IF options.S_EXPLAIN --><br /><span class="explain">{options.TITLE_EXPLAIN}</span><!-- ENDIF --></dt> <dd>{options.CONTENT}</dd> </dl> diff --git a/phpBB/adm/style/install_footer.html b/phpBB/adm/style/install_footer.html index a3b2294025..73c3f5a6b9 100644 --- a/phpBB/adm/style/install_footer.html +++ b/phpBB/adm/style/install_footer.html @@ -8,7 +8,7 @@ </div> <div id="page-footer"> - Powered by <a href="http://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Group + Powered by <a href="https://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Group </div> </div> diff --git a/phpBB/adm/style/install_header.html b/phpBB/adm/style/install_header.html index e306d8f6bf..6826654ded 100644 --- a/phpBB/adm/style/install_header.html +++ b/phpBB/adm/style/install_header.html @@ -42,7 +42,7 @@ function dE(n, s, type) <!-- IF S_LANG_SELECT --> <form method="post" action=""> <fieldset class="nobg"> - <label for="language">{L_SELECT_LANG}:</label> + <label for="language">{L_SELECT_LANG}{L_COLON}</label> {S_LANG_SELECT} <input class="button1" type="submit" id="change_lang" name="change_lang" value="{L_CHANGE}" /> </fieldset> diff --git a/phpBB/adm/style/install_install.html b/phpBB/adm/style/install_install.html index 79006fba69..1a809a3588 100644 --- a/phpBB/adm/style/install_install.html +++ b/phpBB/adm/style/install_install.html @@ -20,7 +20,7 @@ <!-- ELSE --> <dl> - <dt>{checks.TITLE}:<!-- IF checks.S_EXPLAIN --><br /><span class="explain">{checks.TITLE_EXPLAIN}</span><!-- ENDIF --></dt> + <dt>{checks.TITLE}{L_COLON}<!-- IF checks.S_EXPLAIN --><br /><span class="explain">{checks.TITLE_EXPLAIN}</span><!-- ENDIF --></dt> <dd>{checks.RESULT}</dd> </dl> <!-- ENDIF --> @@ -43,7 +43,7 @@ <!-- ELSE --> <dl> - <dt><label for="{options.KEY}">{options.TITLE}:</label><!-- IF options.S_EXPLAIN --><br /><span class="explain">{options.TITLE_EXPLAIN}</span><!-- ENDIF --></dt> + <dt><label for="{options.KEY}">{options.TITLE}{L_COLON}</label><!-- IF options.S_EXPLAIN --><br /><span class="explain">{options.TITLE_EXPLAIN}</span><!-- ENDIF --></dt> <dd>{options.CONTENT}</dd> </dl> diff --git a/phpBB/adm/style/install_update.html b/phpBB/adm/style/install_update.html index 818889c89b..b5fa46dbf6 100644 --- a/phpBB/adm/style/install_update.html +++ b/phpBB/adm/style/install_update.html @@ -221,13 +221,13 @@ <!-- BEGIN new --> <dl> <dt style="width: 60%;"><strong><!-- IF new.DIR_PART -->{new.DIR_PART}<br /><!-- ENDIF -->{new.FILE_PART}</strong> - <!-- IF new.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{new.CUSTOM_ORIGINAL}</span><!-- ENDIF --> + <!-- IF new.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{new.CUSTOM_ORIGINAL}</span><!-- ENDIF --> </dt> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"> <!-- IF not new.S_BINARY -->[<a href="{new.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --> </dd> <!-- IF new.S_CUSTOM --> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"><label><input type="checkbox" name="no_update[]" value="{new.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{new.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd> <!-- ENDIF --> </dl> <!-- END new --> @@ -245,11 +245,11 @@ <!-- BEGIN not_modified --> <dl> <dt style="width: 60%;"><strong><!-- IF not_modified.DIR_PART -->{not_modified.DIR_PART}<br /><!-- ENDIF -->{not_modified.FILE_PART}</strong> - <!-- IF not_modified.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{not_modified.CUSTOM_ORIGINAL}</span><!-- ENDIF --> + <!-- IF not_modified.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{not_modified.CUSTOM_ORIGINAL}</span><!-- ENDIF --> </dt> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"><!-- IF not not_modified.S_BINARY -->[<a href="{not_modified.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{not_modified.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><!-- IF not not_modified.S_BINARY -->[<a href="{not_modified.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{not_modified.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd> <!-- IF not_modified.S_CUSTOM --> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"><label><input type="checkbox" name="no_update[]" value="{not_modified.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{not_modified.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd> <!-- ENDIF --> </dl> <!-- END not_modified --> @@ -266,24 +266,24 @@ <legend><img src="{T_IMAGE_PATH}file_modified.gif" alt="{L_STATUS_MODIFIED}" /></legend> <dl> <dt style="width: 60%;"><strong><!-- IF modified.DIR_PART -->{modified.DIR_PART}<br /><!-- ENDIF -->{modified.FILE_PART}</strong> - <!-- IF modified.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{modified.CUSTOM_ORIGINAL}</span><!-- ENDIF --> + <!-- IF modified.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{modified.CUSTOM_ORIGINAL}</span><!-- ENDIF --> </dt> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"> </dd> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"> </dd> <!-- IF modified.S_CUSTOM --> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"><label><input type="checkbox" name="no_update[]" value="{modified.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{modified.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd> <!-- ENDIF --> </dl> <dl> <dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{modified.FILENAME}]" value="0" checked="checked" /> {L_MERGE_MODIFICATIONS_OPTION}</label></dt> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"><!-- IF not modified.S_BINARY -->[<a href="{modified.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{modified.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><!-- IF not modified.S_BINARY -->[<a href="{modified.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{modified.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd> </dl> <dl> <dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{modified.FILENAME}]" value="1" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"><!-- IF not modified.S_BINARY -->[<a href="{modified.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE --> <!-- ENDIF --></dd> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><!-- IF not modified.S_BINARY -->[<a href="{modified.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE --> <!-- ENDIF --></dd> </dl> <dl> <dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{modified.FILENAME}]" value="2" /> {L_MERGE_NO_MERGE_MOD_OPTION}</label></dt> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"><!-- IF not modified.S_BINARY -->[<a href="{modified.U_VIEW_NO_MERGE_MOD}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE --> <!-- ENDIF --></dd> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><!-- IF not modified.S_BINARY -->[<a href="{modified.U_VIEW_NO_MERGE_MOD}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE --> <!-- ENDIF --></dd> </dl> </fieldset> <!-- END modified --> @@ -299,13 +299,13 @@ <!-- BEGIN new_conflict --> <dl> <dt style="width: 60%;"><strong><!-- IF new_conflict.DIR_PART -->{new_conflict.DIR_PART}<br /><!-- ENDIF -->{new_conflict.FILE_PART}</strong> - <!-- IF new_conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{new_conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF --> + <!-- IF new_conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{new_conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF --> </dt> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"> <!-- IF not new_conflict.S_BINARY -->[<a href="{new_conflict.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new_conflict.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --> </dd> <!-- IF new_conflict.S_CUSTOM --> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"><label><input type="checkbox" name="no_update[]" value="{new_conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{new_conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd> <!-- ENDIF --> </dl> <!-- END new_conflict --> @@ -322,38 +322,38 @@ <legend><img src="{T_IMAGE_PATH}file_conflict.gif" alt="{L_STATUS_CONFLICT}" /></legend> <dl> <dt style="width: 60%;"><strong><!-- IF conflict.DIR_PART -->{conflict.DIR_PART}<br /><!-- ENDIF -->{conflict.FILE_PART}</strong> - <!-- IF conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF --> - <!-- IF conflict.NUM_CONFLICTS --><br /><span>{L_NUM_CONFLICTS}: {conflict.NUM_CONFLICTS}</span><!-- ENDIF --> + <!-- IF conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF --> + <!-- IF conflict.NUM_CONFLICTS --><br /><span>{L_NUM_CONFLICTS}{L_COLON} {conflict.NUM_CONFLICTS}</span><!-- ENDIF --> </dt> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"> <!-- IF not conflict.S_BINARY -->[<a href="{conflict.U_SHOW_DIFF}">{L_DOWNLOAD_CONFLICTS}</a>]<br />{L_DOWNLOAD_CONFLICTS_EXPLAIN} <!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --> </dd> <!-- IF conflict.S_CUSTOM --> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"><label><input type="checkbox" name="no_update[]" value="{conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd> <!-- ENDIF --> </dl> <!-- IF conflict.S_BINARY --> <dl> <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="1" checked="checked" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"> </dd> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"> </dd> </dl> <!-- ELSE --> <dl> <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="3" checked="checked" /> {L_MERGE_NEW_FILE_OPTION}</label></dt> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;">[<a href="{conflict.U_VIEW_NEW_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_MODIFIED}</a>]</dd> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_NEW_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_MODIFIED}</a>]</dd> </dl> <dl> <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="4" /> {L_MERGE_MOD_FILE_OPTION}</label></dt> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;">[<a href="{conflict.U_VIEW_MOD_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_MODIFIED}</a>]</dd> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_MOD_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_MODIFIED}</a>]</dd> </dl> <dl> <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="1" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;">[<a href="{conflict.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd> </dl> <dl> <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="2" /> {L_MERGE_NO_MERGE_MOD_OPTION}</label></dt> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;">[<a href="{conflict.U_VIEW_NO_MERGE_MOD}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_NO_MERGE_MOD}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd> </dl> <!-- ENDIF --> </fieldset> @@ -392,7 +392,7 @@ <fieldset> <legend>{L_SELECT_DOWNLOAD_FORMAT}</legend> <dl> - <dt><label for="use_method">{L_DOWNLOAD_AS}:</label></dt> + <dt><label for="use_method">{L_DOWNLOAD_AS}{L_COLON}</label></dt> <dd>{RADIO_BUTTONS}</dd> </dl> </fieldset> @@ -455,12 +455,12 @@ <fieldset> <legend>{L_FTP_SETTINGS}</legend> <dl> - <dt><label>{L_UPLOAD_METHOD}:</label></dt> + <dt><label>{L_UPLOAD_METHOD}{L_COLON}</label></dt> <dd><strong>{UPLOAD_METHOD}</strong></dd> </dl> <!-- BEGIN data --> <dl> - <dt><label for="{data.DATA}">{data.NAME}:</label><br /><span>{data.EXPLAIN}</span></dt> + <dt><label for="{data.DATA}">{data.NAME}{L_COLON}</label><br /><span>{data.EXPLAIN}</span></dt> <dd><input type="<!-- IF data.DATA == 'password' -->password<!-- ELSE -->text<!-- ENDIF -->" id="{data.DATA}" name="{data.DATA}" value="{data.DEFAULT}" /></dd> </dl> <!-- END data --> diff --git a/phpBB/adm/style/install_update_diff.html b/phpBB/adm/style/install_update_diff.html index b5d25e82f2..ecdc40e157 100644 --- a/phpBB/adm/style/install_update_diff.html +++ b/phpBB/adm/style/install_update_diff.html @@ -223,7 +223,7 @@ table.hrdiff caption span { <p id="skip"><a href="#acp">{L_SKIP}</a></p> <form method="post" action=""> <fieldset class="quick"> - <label for="diff_mode">{L_SELECT_DIFF_MODE}:</label> + <label for="diff_mode">{L_SELECT_DIFF_MODE}{L_COLON}</label> <select name="diff_mode" id="diff_mode">{S_DIFF_MODE_OPTIONS}</select> <input class="button1" type="submit" id="submit" name="submit" value="{L_CHANGE}" /> @@ -231,7 +231,7 @@ table.hrdiff caption span { </form> <!-- ENDIF --> <!-- IF S_DIFF_CONFLICT_FILE --> - <div style="float: {S_CONTENT_FLOW_BEGIN};"><strong>{L_NUM_CONFLICTS}: {NUM_CONFLICTS}</strong></div> + <div style="float: {S_CONTENT_FLOW_BEGIN};"><strong>{L_NUM_CONFLICTS}{L_COLON} {NUM_CONFLICTS}</strong></div> <br style="clear: both;" /> <!-- ENDIF --> </div> diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html index f79c0318b5..f7902e6d2e 100644 --- a/phpBB/adm/style/overall_header.html +++ b/phpBB/adm/style/overall_header.html @@ -9,7 +9,7 @@ <script type="text/javascript"> // <![CDATA[ -var jump_page = '{LA_JUMP_PAGE}:'; +var jump_page = '{LA_JUMP_PAGE}{L_COLON}'; var on_page = '{ON_PAGE}'; var per_page = '{PER_PAGE}'; var base_url = '{A_BASE_URL}'; @@ -62,11 +62,7 @@ function dE(n, s, type) */ function marklist(id, name, state) { - var parent = document.getElementById(id); - if (!parent) - { - eval('parent = document.' + id); - } + var parent = document.getElementById(id) || document[id]; if (!parent) { diff --git a/phpBB/adm/style/pagination.html b/phpBB/adm/style/pagination.html new file mode 100644 index 0000000000..d62d0b6a81 --- /dev/null +++ b/phpBB/adm/style/pagination.html @@ -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> diff --git a/phpBB/adm/style/permission_forum_copy.html b/phpBB/adm/style/permission_forum_copy.html index a4c00c12ae..1e012a9347 100644 --- a/phpBB/adm/style/permission_forum_copy.html +++ b/phpBB/adm/style/permission_forum_copy.html @@ -12,7 +12,7 @@ <legend>{L_LOOK_UP_FORUM}</legend> <dl> - <dt><label for="src_forum">{L_COPY_PERMISSIONS_FROM}:</label><br /><span>{L_COPY_PERMISSIONS_FORUM_FROM_EXPLAIN}</span></dt> + <dt><label for="src_forum">{L_COPY_PERMISSIONS_FROM}{L_COLON}</label><br /><span>{L_COPY_PERMISSIONS_FORUM_FROM_EXPLAIN}</span></dt> <dd><select id="src_forum" name="src_forum_id"><option value="0">{L_SELECT_FORUM}</option><option value="-1">------------------</option>{S_FORUM_OPTIONS}</select></dd> </dl> </fieldset> @@ -22,7 +22,7 @@ <p>{L_LOOK_UP_FORUMS_EXPLAIN}</p> <dl> - <dt><label for="dest_forums">{L_COPY_PERMISSIONS_TO}:</label><br /><span>{L_COPY_PERMISSIONS_FORUM_TO_EXPLAIN}</span></dt> + <dt><label for="dest_forums">{L_COPY_PERMISSIONS_TO}{L_COLON}</label><br /><span>{L_COPY_PERMISSIONS_FORUM_TO_EXPLAIN}</span></dt> <dd><select id="dest_forums" name="dest_forum_ids[]" multiple="multiple" size="10">{S_FORUM_OPTIONS}</select></dd> </dl> </fieldset> diff --git a/phpBB/adm/style/permission_mask.html b/phpBB/adm/style/permission_mask.html index e29609b8b6..4d52b901c3 100644 --- a/phpBB/adm/style/permission_mask.html +++ b/phpBB/adm/style/permission_mask.html @@ -38,9 +38,9 @@ <a href="#" onclick="swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '0', true); return false;">{L_ADVANCED_PERMISSIONS}</a><!-- IF not p_mask.S_VIEW and p_mask.f_mask.S_CUSTOM --> *<!-- ENDIF --> </div> <dl class="permissions-simple"> - <dt style="width: 20%"><label for="role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}">{L_ROLE}:</label></dt> + <dt style="width: 20%"><label for="role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}">{L_ROLE}{L_COLON}</label></dt> <!-- IF p_mask.f_mask.S_ROLE_OPTIONS --> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 20%"><select id="role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}" name="role[{p_mask.f_mask.UG_ID}][{p_mask.f_mask.FORUM_ID}]" onchange="set_role_settings(this.options[selectedIndex].value, 'advanced{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); init_colours('{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}')">{p_mask.f_mask.S_ROLE_OPTIONS}</select></dd> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 20%"><select id="role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}" name="role[{p_mask.f_mask.UG_ID}][{p_mask.f_mask.FORUM_ID}]" onchange="set_role_settings(this.options[selectedIndex].value, 'advanced{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); init_colours('{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}')">{p_mask.f_mask.S_ROLE_OPTIONS}</select></dd> <!-- ELSE --> <dd>{L_NO_ROLE_AVAILABLE}</dd> <!-- ENDIF --> @@ -118,7 +118,7 @@ </div> <!-- IF not p_mask.S_VIEW --> - <fieldset class="quick" style="margin-{S_CONTENT_FLOW_END}: 11px;"> + <fieldset class="quick" style="margin-{S_CONTENT_FLOW_END}{L_COLON} 11px;"> <p class="small">{L_APPLY_PERMISSIONS_EXPLAIN}</p> <input class="button1" type="submit" name="psubmit[{p_mask.f_mask.UG_ID}][{p_mask.f_mask.FORUM_ID}]" value="{L_APPLY_PERMISSIONS}" /> <!-- IF .p_mask.f_mask gt 1 or .p_mask gt 1 --> diff --git a/phpBB/adm/style/permission_roles_mask.html b/phpBB/adm/style/permission_roles_mask.html index 485858da74..277310edbf 100644 --- a/phpBB/adm/style/permission_roles_mask.html +++ b/phpBB/adm/style/permission_roles_mask.html @@ -2,7 +2,7 @@ <!-- BEGIN role_mask --> <table cellspacing="1"> - <caption><!-- IF role_mask.FORUM_ID -->{L_FORUM}: <!-- ENDIF -->{role_mask.NAME}</caption> + <caption><!-- IF role_mask.FORUM_ID -->{L_FORUM}{L_COLON} <!-- ENDIF -->{role_mask.NAME}</caption> <tbody> <tr> <th>{L_USERS}</th> diff --git a/phpBB/adm/style/permission_trace.html b/phpBB/adm/style/permission_trace.html index 186bb28b67..744ad3293e 100644 --- a/phpBB/adm/style/permission_trace.html +++ b/phpBB/adm/style/permission_trace.html @@ -4,7 +4,7 @@ <!-- IF U_BACK --><a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">« {L_BACK}</a><!-- ENDIF --> - <h3>{L_TRACE_FOR}: {PERMISSION_USERNAME} / <!-- IF FORUM_NAME -->{FORUM_NAME} / <!-- ENDIF -->{PERMISSION} </h3> + <h3>{L_TRACE_FOR}{L_COLON} {PERMISSION_USERNAME} / <!-- IF FORUM_NAME -->{FORUM_NAME} / <!-- ENDIF -->{PERMISSION} </h3> <br /> diff --git a/phpBB/adm/style/simple_header.html b/phpBB/adm/style/simple_header.html index d4cbcb6cbe..0ba445ca2a 100644 --- a/phpBB/adm/style/simple_header.html +++ b/phpBB/adm/style/simple_header.html @@ -9,7 +9,7 @@ <script type="text/javascript"> // <![CDATA[ -var jump_page = '{LA_JUMP_PAGE}:'; +var jump_page = '{LA_JUMP_PAGE}{L_COLON}'; var on_page = '{ON_PAGE}'; var per_page = '{PER_PAGE}'; var base_url = '{A_BASE_URL}'; diff --git a/phpBB/adm/style/timezone.js b/phpBB/adm/style/timezone.js new file mode 100644 index 0000000000..4556ea5f94 --- /dev/null +++ b/phpBB/adm/style/timezone.js @@ -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 diff --git a/phpBB/adm/style/timezone_option.html b/phpBB/adm/style/timezone_option.html new file mode 100644 index 0000000000..7a799b69c6 --- /dev/null +++ b/phpBB/adm/style/timezone_option.html @@ -0,0 +1,19 @@ +<dl> + <dt><label for="timezone">{L_BOARD_TIMEZONE}{L_COLON}</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> diff --git a/phpBB/adm/swatch.php b/phpBB/adm/swatch.php index 434b00e542..86498a255f 100644 --- a/phpBB/adm/swatch.php +++ b/phpBB/adm/swatch.php @@ -21,8 +21,10 @@ $user->session_begin(false); $auth->acl($user->data); $user->setup(); +$phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : './'; + // Set custom template for admin area -$template->set_custom_template($phpbb_root_path . 'adm/style', 'admin'); +$phpbb_style->set_custom_style('admin', $phpbb_admin_path . 'style', ''); $template->set_filenames(array( 'body' => 'colour_swatch.html') diff --git a/phpBB/app.php b/phpBB/app.php new file mode 100644 index 0000000000..d93208d585 --- /dev/null +++ b/phpBB/app.php @@ -0,0 +1,31 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +*/ + +/** +* @ignore +*/ +define('IN_PHPBB', true); +$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; +$phpEx = substr(strrchr(__FILE__, '.'), 1); +include($phpbb_root_path . 'common.' . $phpEx); +include($phpbb_root_path . 'includes/functions_url_matcher.' . $phpEx); + +// Start session management +$user->session_begin(); +$auth->acl($user->data); +$user->setup('app'); + +$symfony_request = phpbb_create_symfony_request($request); +$http_kernel = $phpbb_container->get('http_kernel'); +$response = $http_kernel->handle($symfony_request); +$response->send(); +$http_kernel->terminate($symfony_request, $response); diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index 958b6c9ff6..f7d6688f68 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -383,7 +383,7 @@ phpbb.ajaxify = function(options) { return; } - if (overlay) + if (overlay && (typeof $this.attr('data-overlay') === 'undefined' || $this.attr('data-overlay') == 'true')) { phpbb.loading_alert(); } @@ -411,6 +411,112 @@ 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) { + if ($('#timezone_copy').length == 0) { + // We make a backup of the original dropdown, so we can remove optgroups + // instead of setting display to none, because IE and chrome will not + // hide options inside of optgroups and selects via css + $('#timezone').clone().attr('id', 'timezone_copy').css('display', 'none').attr('name', 'tz_copy').insertAfter('#timezone'); + } else { + // Copy the content of our backup, so we can remove all unneeded options + $('#timezone').replaceWith($('#timezone_copy').clone().attr('id', 'timezone').css('display', 'block').attr('name', 'tz')); + } + + if ($('#tz_date').val() != '') { + $('#timezone > optgroup').remove(":not([label='" + $('#tz_date').val() + "'])"); + } + + 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. + phpbb.timezone_switch_date(true); + $('#tz_select_date_suggest').css('display', 'inline'); + } else { + option.selected = true; + phpbb.timezone_switch_date(!force_selector); + $('#tz_select_date_suggest').css('display', 'none'); + } + + $('#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); + + // Found the suggestion, there cannot be more, so return from here. + return; + } + } +} + phpbb.ajax_callbacks = {}; /** @@ -436,14 +542,47 @@ phpbb.add_ajax_callback = function(id, callback) * the alt-text data attribute, and replaces the text in the attribute with the * current text so that the process can be repeated. */ -phpbb.add_ajax_callback('alt_text', function(data) { +phpbb.add_ajax_callback('alt_text', function() { var el = $(this), alt_text; alt_text = el.attr('data-alt-text'); + el.attr('data-alt-text', el.text()); el.attr('title', alt_text); el.text(alt_text); }); +/** + * This callback is based on the alt_text callback. + * + * It replaces the current text with the text in the alt-text data attribute, + * and replaces the text in the attribute with the current text so that the + * process can be repeated. + * Additionally it replaces the class of the link's parent + * and changes the link itself. + */ +phpbb.add_ajax_callback('toggle_link', function() { + var el = $(this), + toggle_text, + toggle_url, + toggle_class; + + // Toggle link text + + toggle_text = el.attr('data-toggle-text'); + el.attr('data-toggle-text', el.text()); + el.attr('title', toggle_text); + el.text(toggle_text); + + // Toggle link url + toggle_url = el.attr('data-toggle-url'); + el.attr('data-toggle-url', el.attr('href')); + el.attr('href', toggle_url); + + // Toggle class of link parent + toggle_class = el.attr('data-toggle-class'); + el.attr('data-toggle-class', el.parent().attr('class')); + el.parent().attr('class', toggle_class); +}); })(jQuery); // Avoid conflicts with other libraries diff --git a/phpBB/common.php b/phpBB/common.php index 81fe275008..e99b9edee5 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -5,7 +5,7 @@ * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * -* Minimum Requirement: PHP 5.3.2 +* Minimum Requirement: PHP 5.3.3 */ /** @@ -15,8 +15,6 @@ if (!defined('IN_PHPBB')) exit; } -use Symfony\Component\EventDispatcher\EventDispatcher; - require($phpbb_root_path . 'includes/startup.' . $phpEx); if (file_exists($phpbb_root_path . 'config.' . $phpEx)) @@ -27,6 +25,8 @@ if (file_exists($phpbb_root_path . 'config.' . $phpEx)) if (!defined('PHPBB_INSTALLED')) { // Redirect the user to the installer + require($phpbb_root_path . 'includes/functions.' . $phpEx); + // We have to generate a full HTTP/1.1 header here since we can't guarantee to have any of the information // available as used by the redirect function $server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME')); @@ -39,10 +39,13 @@ if (!defined('PHPBB_INSTALLED')) $script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI'); } + // $phpbb_root_path accounts for redirects from e.g. /adm + $script_path = trim(dirname($script_name)) . '/' . $phpbb_root_path . 'install/index.' . $phpEx; // Replace any number of consecutive backslashes and/or slashes with a single slash // (could happen on some proxy setups and/or Windows servers) - $script_path = trim(dirname($script_name)) . '/install/index.' . $phpEx; $script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path); + // Eliminate . and .. from the path + $script_path = phpbb_clean_path($script_path); $url = (($secure) ? 'https://' : 'http://') . $server_name; @@ -60,79 +63,71 @@ if (!defined('PHPBB_INSTALLED')) exit; } -// Load Extensions -// dl() is deprecated and disabled by default as of PHP 5.3. -if (!empty($load_extensions) && function_exists('dl')) -{ - $load_extensions = explode(',', $load_extensions); - - foreach ($load_extensions as $extension) - { - @dl(trim($extension)); - } -} - // Include files require($phpbb_root_path . 'includes/class_loader.' . $phpEx); require($phpbb_root_path . 'includes/functions.' . $phpEx); require($phpbb_root_path . 'includes/functions_content.' . $phpEx); +require($phpbb_root_path . 'includes/functions_container.' . $phpEx); require($phpbb_root_path . 'includes/constants.' . $phpEx); -require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx); +require($phpbb_root_path . 'includes/db/' . ltrim($dbms, 'dbal_') . '.' . $phpEx); require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); // Set PHP error handler to ours set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler'); // Setup class loader first -$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', $phpbb_root_path . 'ext/', ".$phpEx"); -$phpbb_class_loader_ext->register(); -$phpbb_class_loader = new phpbb_class_loader('phpbb_', $phpbb_root_path . 'includes/', ".$phpEx"); +$phpbb_class_loader = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}includes/", ".$phpEx"); $phpbb_class_loader->register(); +$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', "{$phpbb_root_path}ext/", ".$phpEx"); +$phpbb_class_loader_ext->register(); + +// Set up container +$phpbb_container = phpbb_create_dumped_container_unless_debug( + array( + new phpbb_di_extension_config($phpbb_root_path . 'config.' . $phpEx), + new phpbb_di_extension_core($phpbb_root_path), + ), + array( + new phpbb_di_pass_collection_pass(), + new phpbb_di_pass_kernel_pass(), + ), + $phpbb_root_path, + $phpEx +); + +$phpbb_class_loader->set_cache($phpbb_container->get('cache.driver')); +$phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver')); // set up caching -$cache_factory = new phpbb_cache_factory($acm_type); -$cache = $cache_factory->get_service(); -$phpbb_class_loader_ext->set_cache($cache->get_driver()); -$phpbb_class_loader->set_cache($cache->get_driver()); +$cache = $phpbb_container->get('cache'); // Instantiate some basic classes -$phpbb_dispatcher = new phpbb_event_dispatcher(); -$request = new phpbb_request(); -$user = new phpbb_user(); -$auth = new phpbb_auth(); -$db = new $sql_db(); +$phpbb_dispatcher = $phpbb_container->get('dispatcher'); +$request = $phpbb_container->get('request'); +$user = $phpbb_container->get('user'); +$auth = $phpbb_container->get('auth'); +$db = $phpbb_container->get('dbal.conn'); // make sure request_var uses this request instance request_var('', 0, false, false, $request); // "dependency injection" for a function -// Connect to DB -$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, defined('PHPBB_DB_NEW_LINK') ? PHPBB_DB_NEW_LINK : false); - -// We do not need this any longer, unset for safety purposes -unset($dbpasswd); - // Grab global variables, re-cache if necessary -$config = new phpbb_config_db($db, $cache->get_driver(), CONFIG_TABLE); +$config = $phpbb_container->get('config'); set_config(null, null, null, $config); set_config_count(null, null, null, $config); // load extensions -$phpbb_extension_manager = new phpbb_extension_manager($db, EXT_TABLE, $phpbb_root_path, ".$phpEx", $cache->get_driver()); +$phpbb_extension_manager = $phpbb_container->get('ext.manager'); +$phpbb_subscriber_loader = $phpbb_container->get('event.subscriber_loader'); -// Initialize style -$phpbb_style_resource_locator = new phpbb_style_resource_locator(); -$phpbb_style_path_provider = new phpbb_style_extension_path_provider($phpbb_extension_manager, new phpbb_style_path_provider()); -$template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $phpbb_style_resource_locator); -$phpbb_style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $phpbb_style_resource_locator, $phpbb_style_path_provider, $template); - -$phpbb_subscriber_loader = new phpbb_event_extension_subscriber_loader($phpbb_dispatcher, $phpbb_extension_manager); -$phpbb_subscriber_loader->load(); +$template = $phpbb_container->get('template'); +$phpbb_style = $phpbb_container->get('style'); // Add own hook handler require($phpbb_root_path . 'includes/hooks/index.' . $phpEx); -$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display'))); +$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('phpbb_template', 'display'))); foreach ($cache->obtain_hooks() as $hook) { @@ -141,5 +136,20 @@ foreach ($cache->obtain_hooks() as $hook) if (!$config['use_system_cron']) { - $cron = new phpbb_cron_manager(new phpbb_cron_task_provider($phpbb_extension_manager), $cache->get_driver()); + $cron = $phpbb_container->get('cron.manager'); } + +/** +* Main event which is triggered on every page +* +* You can use this event to load function files and initiate objects +* +* NOTE: At this point the global session ($user) and permissions ($auth) +* do NOT exist yet. If you need to use the user object +* (f.e. to include language files) or need to check permissions, +* please use the core.user_setup event instead! +* +* @event core.common +* @since 3.1-A1 +*/ +$phpbb_dispatcher->dispatch('core.common'); diff --git a/phpBB/composer.json b/phpBB/composer.json index 1059b97f84..d2536a73cf 100644 --- a/phpBB/composer.json +++ b/phpBB/composer.json @@ -1,5 +1,14 @@ { - "require": { - "symfony/event-dispatcher": "2.0.*" - } + "minimum-stability": "beta", + "require": { + "symfony/config": "2.1.*", + "symfony/dependency-injection": "2.1.*", + "symfony/event-dispatcher": "2.1.*", + "symfony/http-kernel": "2.1.*", + "symfony/routing": "2.1.*", + "symfony/yaml": "2.1.*" + }, + "require-dev": { + "fabpot/goutte": "v0.1.0" + } } diff --git a/phpBB/composer.lock b/phpBB/composer.lock index 062ad4b3aa..e96c15fe8b 100644 --- a/phpBB/composer.lock +++ b/phpBB/composer.lock @@ -1,10 +1,778 @@ { - "hash": "9bada3748ec2933fe0864dcfafbcd671", + "hash": "c1a76530df6b9daa16b8033d61b76503", "packages": [ { - "package": "symfony/event-dispatcher", - "version": "v2.0.10" + "name": "symfony/config", + "version": "v2.1.3", + "target-dir": "Symfony/Component/Config", + "source": { + "type": "git", + "url": "https://github.com/symfony/Config", + "reference": "v2.1.3" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/Config/zipball/v2.1.3", + "reference": "v2.1.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2012-10-20 00:10:30", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\Config": "" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/dependency-injection", + "version": "v2.1.3", + "target-dir": "Symfony/Component/DependencyInjection", + "source": { + "type": "git", + "url": "https://github.com/symfony/DependencyInjection", + "reference": "v2.1.3" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/DependencyInjection/zipball/v2.1.3", + "reference": "v2.1.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/yaml": "2.1.*", + "symfony/config": "2.1.*" + }, + "suggest": { + "symfony/yaml": "2.1.*", + "symfony/config": "2.1.*" + }, + "time": "2012-10-22 07:37:12", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\DependencyInjection": "" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony DependencyInjection Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.1.3", + "target-dir": "Symfony/Component/EventDispatcher", + "source": { + "type": "git", + "url": "https://github.com/symfony/EventDispatcher", + "reference": "v2.1.3" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/EventDispatcher/zipball/v2.1.3", + "reference": "v2.1.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/dependency-injection": "2.1.*" + }, + "suggest": { + "symfony/dependency-injection": "2.1.*", + "symfony/http-kernel": "2.1.*" + }, + "time": "2012-10-04 08:17:57", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\EventDispatcher": "" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/http-foundation", + "version": "v2.1.3", + "target-dir": "Symfony/Component/HttpFoundation", + "source": { + "type": "git", + "url": "https://github.com/symfony/HttpFoundation", + "reference": "v2.1.3" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/HttpFoundation/zipball/v2.1.3", + "reference": "v2.1.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2012-10-20 00:10:30", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\HttpFoundation": "", + "SessionHandlerInterface": "Symfony/Component/HttpFoundation/Resources/stubs" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony HttpFoundation Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/http-kernel", + "version": "v2.1.3", + "target-dir": "Symfony/Component/HttpKernel", + "source": { + "type": "git", + "url": "https://github.com/symfony/HttpKernel", + "reference": "v2.1.3" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/HttpKernel/zipball/v2.1.3", + "reference": "v2.1.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/event-dispatcher": "2.1.*", + "symfony/http-foundation": "2.1.*" + }, + "require-dev": { + "symfony/browser-kit": "2.1.*", + "symfony/class-loader": "2.1.*", + "symfony/config": "2.1.*", + "symfony/console": "2.1.*", + "symfony/dependency-injection": "2.1.*", + "symfony/finder": "2.1.*", + "symfony/process": "2.1.*", + "symfony/routing": "2.1.*" + }, + "suggest": { + "symfony/browser-kit": "2.1.*", + "symfony/class-loader": "2.1.*", + "symfony/config": "2.1.*", + "symfony/console": "2.1.*", + "symfony/dependency-injection": "2.1.*", + "symfony/finder": "2.1.*" + }, + "time": "2012-10-30 01:14:14", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\HttpKernel": "" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony HttpKernel Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/routing", + "version": "v2.1.3", + "target-dir": "Symfony/Component/Routing", + "source": { + "type": "git", + "url": "https://github.com/symfony/Routing", + "reference": "v2.1.3" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/Routing/zipball/v2.1.3", + "reference": "v2.1.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/config": "2.1.*", + "symfony/yaml": "2.1.*", + "symfony/http-kernel": "2.1.*", + "doctrine/common": ">=2.2,<2.4-dev" + }, + "suggest": { + "symfony/config": "2.1.*", + "symfony/yaml": "2.1.*", + "doctrine/common": ">=2.2,<2.4-dev" + }, + "time": "2012-10-26 02:26:42", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\Routing": "" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Routing Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/yaml", + "version": "v2.1.3", + "target-dir": "Symfony/Component/Yaml", + "source": { + "type": "git", + "url": "https://github.com/symfony/Yaml", + "reference": "v2.1.3" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/Yaml/zipball/v2.1.3", + "reference": "v2.1.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2012-10-29 04:15:41", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\Yaml": "" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "http://symfony.com" + } + ], + "packages-dev": [ + { + "name": "fabpot/goutte", + "version": "v0.1.0", + "source": { + "type": "git", + "url": "https://github.com/fabpot/Goutte", + "reference": "v0.1.0" + }, + "dist": { + "type": "zip", + "url": "https://github.com/fabpot/Goutte/archive/v0.1.0.zip", + "reference": "v0.1.0", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "ext-curl": "*", + "symfony/browser-kit": "2.1.*", + "symfony/css-selector": "2.1.*", + "symfony/dom-crawler": "2.1.*", + "symfony/finder": "2.1.*", + "symfony/process": "2.1.*", + "guzzle/guzzle": "3.0.*" + }, + "time": "2012-12-02 13:44:35", + "type": "application", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "installation-source": "source", + "autoload": { + "psr-0": { + "Goutte": "." + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "A simple PHP Web Scraper", + "homepage": "https://github.com/fabpot/Goutte", + "keywords": [ + "scraper" + ] + }, + { + "name": "guzzle/guzzle", + "version": "v3.0.5", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle", + "reference": "v3.0.5" + }, + "dist": { + "type": "zip", + "url": "https://github.com/guzzle/guzzle/archive/v3.0.5.zip", + "reference": "v3.0.5", + "shasum": "" + }, + "require": { + "php": ">=5.3.2", + "ext-curl": "*", + "symfony/event-dispatcher": "2.1.*" + }, + "replace": { + "guzzle/batch": "self.version", + "guzzle/cache": "self.version", + "guzzle/common": "self.version", + "guzzle/http": "self.version", + "guzzle/inflection": "self.version", + "guzzle/iterator": "self.version", + "guzzle/log": "self.version", + "guzzle/parser": "self.version", + "guzzle/plugin": "self.version", + "guzzle/plugin-async": "self.version", + "guzzle/plugin-backoff": "self.version", + "guzzle/plugin-cache": "self.version", + "guzzle/plugin-cookie": "self.version", + "guzzle/plugin-curlauth": "self.version", + "guzzle/plugin-history": "self.version", + "guzzle/plugin-log": "self.version", + "guzzle/plugin-md5": "self.version", + "guzzle/plugin-mock": "self.version", + "guzzle/plugin-oauth": "self.version", + "guzzle/service": "self.version", + "guzzle/stream": "self.version" + }, + "require-dev": { + "doctrine/common": "*", + "symfony/class-loader": "*", + "monolog/monolog": "1.*", + "zendframework/zend-cache": "2.0.*", + "zendframework/zend-log": "2.0.*", + "zend/zend-log1": "1.12", + "zend/zend-cache1": "1.12", + "phpunit/phpunit": "3.7.*" + }, + "time": "2012-11-19 00:15:33", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "Guzzle\\Tests": "tests/", + "Guzzle": "src/" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Guzzle Community", + "homepage": "https://github.com/guzzle/guzzle/contributors" + } + ], + "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "framework", + "curl", + "http", + "rest", + "http client", + "client", + "web service" + ] + }, + { + "name": "symfony/browser-kit", + "version": "v2.1.3", + "target-dir": "Symfony/Component/BrowserKit", + "source": { + "type": "git", + "url": "https://github.com/symfony/BrowserKit", + "reference": "v2.1.3" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/BrowserKit/zipball/v2.1.3", + "reference": "v2.1.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/dom-crawler": "2.1.*" + }, + "require-dev": { + "symfony/process": "2.1.*", + "symfony/css-selector": "2.1.*" + }, + "suggest": { + "symfony/process": "2.1.*" + }, + "time": "2012-10-25 06:11:50", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\BrowserKit": "" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony BrowserKit Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/css-selector", + "version": "v2.1.3", + "target-dir": "Symfony/Component/CssSelector", + "source": { + "type": "git", + "url": "https://github.com/symfony/CssSelector", + "reference": "v2.1.3" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/CssSelector/zipball/v2.1.3", + "reference": "v2.1.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2012-10-04 08:17:57", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\CssSelector": "" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony CssSelector Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/dom-crawler", + "version": "v2.1.3", + "target-dir": "Symfony/Component/DomCrawler", + "source": { + "type": "git", + "url": "https://github.com/symfony/DomCrawler", + "reference": "v2.1.3" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/DomCrawler/zipball/v2.1.3", + "reference": "v2.1.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/css-selector": "2.1.*" + }, + "suggest": { + "symfony/css-selector": "2.1.*" + }, + "time": "2012-10-18 14:16:01", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\DomCrawler": "" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony DomCrawler Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/finder", + "version": "v2.1.3", + "target-dir": "Symfony/Component/Finder", + "source": { + "type": "git", + "url": "https://github.com/symfony/Finder", + "reference": "v2.1.3" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/Finder/zipball/v2.1.3", + "reference": "v2.1.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2012-10-20 00:10:30", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\Finder": "" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/process", + "version": "v2.1.3", + "target-dir": "Symfony/Component/Process", + "source": { + "type": "git", + "url": "https://github.com/symfony/Process", + "reference": "v2.1.3" + }, + "dist": { + "type": "zip", + "url": "https://github.com/symfony/Process/zipball/v2.1.3", + "reference": "v2.1.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2012-10-20 00:10:30", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\Process": "" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "http://symfony.com" } ], - "aliases": [] + "aliases": [ + + ], + "minimum-stability": "beta", + "stability-flags": [ + + ] } diff --git a/phpBB/config/.htaccess b/phpBB/config/.htaccess new file mode 100644 index 0000000000..4128d345ab --- /dev/null +++ b/phpBB/config/.htaccess @@ -0,0 +1,4 @@ +<Files *> + Order Allow,Deny + Deny from All +</Files> diff --git a/phpBB/config/cron_tasks.yml b/phpBB/config/cron_tasks.yml new file mode 100644 index 0000000000..74f57e449d --- /dev/null +++ b/phpBB/config/cron_tasks.yml @@ -0,0 +1,75 @@ +services: + cron.task.core.prune_all_forums: + class: phpbb_cron_task_core_prune_all_forums + arguments: + - %core.root_path% + - %core.php_ext% + - @config + - @dbal.conn + tags: + - { name: cron.task } + + cron.task.core.prune_forum: + class: phpbb_cron_task_core_prune_forum + arguments: + - %core.root_path% + - %core.php_ext% + - @config + - @dbal.conn + tags: + - { name: cron.task } + + cron.task.core.queue: + class: phpbb_cron_task_core_queue + arguments: + - %core.root_path% + - %core.php_ext% + - @config + tags: + - { name: cron.task } + + cron.task.core.tidy_cache: + class: phpbb_cron_task_core_tidy_cache + arguments: + - @config + - @cache.driver + tags: + - { name: cron.task } + + cron.task.core.tidy_database: + class: phpbb_cron_task_core_tidy_database + arguments: + - %core.root_path% + - %core.php_ext% + - @config + tags: + - { name: cron.task } + + cron.task.core.tidy_search: + class: phpbb_cron_task_core_tidy_search + arguments: + - %core.root_path% + - %core.php_ext% + - @auth + - @config + - @dbal.conn + - @user + tags: + - { name: cron.task } + + cron.task.core.tidy_sessions: + class: phpbb_cron_task_core_tidy_sessions + arguments: + - @config + - @user + tags: + - { name: cron.task } + + cron.task.core.tidy_warnings: + class: phpbb_cron_task_core_tidy_warnings + arguments: + - %core.root_path% + - %core.php_ext% + - @config + tags: + - { name: cron.task } diff --git a/phpBB/config/routing.yml b/phpBB/config/routing.yml new file mode 100644 index 0000000000..d8e890d063 --- /dev/null +++ b/phpBB/config/routing.yml @@ -0,0 +1,9 @@ +# Structure: +# +# foo_controller: +# pattern: /foo +# defaults: { _controller: foo_sevice:method } +# +# The above will be accessed via app.php?controller=foo and it will +# instantiate the "foo_service" service and call the "method" method. +# diff --git a/phpBB/config/services.yml b/phpBB/config/services.yml new file mode 100644 index 0000000000..37e6c0b5df --- /dev/null +++ b/phpBB/config/services.yml @@ -0,0 +1,197 @@ +imports: + - { resource: tables.yml } + - { resource: cron_tasks.yml } + +services: + auth: + class: phpbb_auth + + cache: + class: phpbb_cache_service + arguments: + - @cache.driver + + cache.driver: + class: %cache.driver.class% + + cache.driver.install: + class: phpbb_cache_driver_file + + class_loader: + class: phpbb_class_loader + arguments: + - phpbb_ + - %core.root_path%includes/ + - .%core.php_ext% + calls: + - [register, []] + - [set_cache, [@cache.driver]] + + class_loader.ext: + class: phpbb_class_loader + arguments: + - phpbb_ext_ + - %core.root_path%ext/ + - .%core.php_ext% + calls: + - [register, []] + - [set_cache, [@cache.driver]] + + config: + class: phpbb_config_db + arguments: + - @dbal.conn + - @cache.driver + - %tables.config% + + controller.helper: + class: phpbb_controller_helper + arguments: + - @template + - @user + - %core.root_path% + - .%core.php_ext% + + controller.resolver: + class: phpbb_controller_resolver + arguments: + - @user + - @service_container + - @ext.finder + + controller.route_collection: + class: phpbb_controller_route_collection + arguments: + - @ext.finder + - @controller.provider + + controller.provider: + class: phpbb_controller_provider + + cron.task_collection: + class: phpbb_di_service_collection + arguments: + - @service_container + tags: + - { name: service_collection, tag: cron.task } + + cron.manager: + class: phpbb_cron_manager + arguments: + - @cron.task_collection + - %core.root_path% + - %core.php_ext% + + cron.lock_db: + class: phpbb_lock_db + arguments: + - cron_lock + - @config + - @dbal.conn + + dispatcher: + class: phpbb_event_dispatcher + arguments: + - @service_container + + dbal.conn: + class: %dbal.driver.class% + calls: + - [sql_connect, [%dbal.dbhost%, %dbal.dbuser%, %dbal.dbpasswd%, %dbal.dbname%, %dbal.dbport%, false, %dbal.new_link%]] + + event.subscriber_loader: + class: phpbb_event_extension_subscriber_loader + arguments: + - @dispatcher + - @ext.manager + calls: + - [load, []] + + ext.manager: + class: phpbb_extension_manager + arguments: + - @dbal.conn + - @config + - %tables.ext% + - %core.root_path% + - .%core.php_ext% + - @cache.driver + + ext.finder: + class: phpbb_extension_finder + arguments: + - @ext.manager + - %core.root_path% + - @cache.driver + - .%core.php_ext% + - _ext_finder + + http_kernel: + class: Symfony\Component\HttpKernel\HttpKernel + arguments: + - @dispatcher + - @controller.resolver + + kernel_request_subscriber: + class: phpbb_event_kernel_request_subscriber + arguments: + - @ext.finder + - %core.root_path% + - .%core.php_ext% + tags: + - { name: kernel.event_subscriber } + + kernel_exception_subscriber: + class: phpbb_event_kernel_exception_subscriber + arguments: + - @template + - @user + tags: + - { name: kernel.event_subscriber } + + kernel_terminate_subscriber: + class: phpbb_event_kernel_terminate_subscriber + tags: + - { name: kernel.event_subscriber } + + request: + class: phpbb_request + + style: + class: phpbb_style + arguments: + - %core.root_path% + - %core.php_ext% + - @config + - @user + - @style.resource_locator + - @style.path_provider_ext + - @template + + style.resource_locator: + class: phpbb_style_resource_locator + + style.path_provider_ext: + class: phpbb_style_extension_path_provider + arguments: + - @ext.manager + - @style.path_provider + + style.path_provider: + class: phpbb_style_path_provider + + template: + class: phpbb_template + arguments: + - %core.root_path% + - %core.php_ext% + - @config + - @user + - @style.resource_locator + - @template_context + + template_context: + class: phpbb_template_context + + user: + class: phpbb_user diff --git a/phpBB/config/tables.yml b/phpBB/config/tables.yml new file mode 100644 index 0000000000..cfc6dbcfed --- /dev/null +++ b/phpBB/config/tables.yml @@ -0,0 +1,3 @@ +parameters: + tables.config: %core.table_prefix%config + tables.ext: %core.table_prefix%ext diff --git a/phpBB/cron.php b/phpBB/cron.php index 36b771f1b7..787183f689 100644 --- a/phpBB/cron.php +++ b/phpBB/cron.php @@ -39,7 +39,7 @@ function do_cron($cron_lock, $run_tasks) foreach ($run_tasks as $task) { - if (defined('DEBUG_EXTRA') && $config['use_system_cron']) + if (defined('DEBUG') && $config['use_system_cron']) { echo "[phpBB cron] Running task '{$task->get_name()}'\n"; } @@ -57,11 +57,11 @@ function do_cron($cron_lock, $run_tasks) // // Attempt to alleviate the problem by doing setup outside of the lock as much as possible. // -// If DEBUG_EXTRA is defined and cron lock cannot be obtained, a message will be printed. +// If DEBUG is defined and cron lock cannot be obtained, a message will be printed. if ($config['use_system_cron']) { - $cron = new phpbb_cron_manager(new phpbb_cron_task_provider($phpbb_extension_manager), $cache->get_driver()); + $cron = $phpbb_container->get('cron.manager'); } else { @@ -71,7 +71,7 @@ else output_image(); } -$cron_lock = new phpbb_lock_db('cron_lock', $config, $db); +$cron_lock = $phpbb_container->get('cron.lock_db'); if ($cron_lock->acquire()) { if ($config['use_system_cron']) @@ -100,7 +100,7 @@ if ($cron_lock->acquire()) } else { - if (defined('DEBUG_EXTRA')) + if (defined('DEBUG')) { echo "Could not obtain cron lock.\n"; } diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 0193e57f23..3d3e478032 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1461,6 +1461,7 @@ function get_schema_struct() 'field_default_value' => array('VCHAR_UNI', ''), 'field_validation' => array('VCHAR_UNI:20', ''), 'field_required' => array('BOOL', 0), + 'field_show_novalue' => array('BOOL', 0), 'field_show_on_reg' => array('BOOL', 0), 'field_show_on_pm' => array('BOOL', 0), 'field_show_on_vt' => array('BOOL', 0), @@ -1519,16 +1520,18 @@ function get_schema_struct() $schema_data['phpbb_reports'] = array( 'COLUMNS' => array( - 'report_id' => array('UINT', NULL, 'auto_increment'), - 'reason_id' => array('USINT', 0), - 'post_id' => array('UINT', 0), - 'pm_id' => array('UINT', 0), - 'user_id' => array('UINT', 0), - 'user_notify' => array('BOOL', 0), - 'report_closed' => array('BOOL', 0), - 'report_time' => array('TIMESTAMP', 0), - 'report_text' => array('MTEXT_UNI', ''), - 'reported_post_text' => array('MTEXT_UNI', ''), + 'report_id' => array('UINT', NULL, 'auto_increment'), + 'reason_id' => array('USINT', 0), + 'post_id' => array('UINT', 0), + 'pm_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'user_notify' => array('BOOL', 0), + 'report_closed' => array('BOOL', 0), + 'report_time' => array('TIMESTAMP', 0), + 'report_text' => array('MTEXT_UNI', ''), + 'reported_post_text' => array('MTEXT_UNI', ''), + 'reported_post_uid' => array('VCHAR:8', ''), + 'reported_post_bitfield' => array('VCHAR:255', ''), ), 'PRIMARY_KEY' => 'report_id', 'KEYS' => array( @@ -1794,8 +1797,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), diff --git a/phpBB/develop/generate_utf_casefold.php b/phpBB/develop/generate_utf_casefold.php index 5b99f3e55e..ad511a6153 100644 --- a/phpBB/develop/generate_utf_casefold.php +++ b/phpBB/develop/generate_utf_casefold.php @@ -111,7 +111,7 @@ function my_var_export($var) * Download a file to the develop/ dir * * @param string $url URL of the file to download -* @return void +* @return null */ function download($url) { diff --git a/phpBB/develop/generate_utf_confusables.php b/phpBB/develop/generate_utf_confusables.php index 027d75b661..763d8ee875 100644 --- a/phpBB/develop/generate_utf_confusables.php +++ b/phpBB/develop/generate_utf_confusables.php @@ -199,7 +199,7 @@ function my_var_export($var) * Download a file to the develop/ dir * * @param string $url URL of the file to download -* @return void +* @return null */ function download($url) { diff --git a/phpBB/develop/generate_utf_tables.php b/phpBB/develop/generate_utf_tables.php index 71a5bea851..e5d907d6a5 100644 --- a/phpBB/develop/generate_utf_tables.php +++ b/phpBB/develop/generate_utf_tables.php @@ -481,7 +481,7 @@ function my_var_export($var) * Download a file to the develop/ dir * * @param string $url URL of the file to download -* @return void +* @return null */ function download($url) { diff --git a/phpBB/develop/mysql_upgrader.php b/phpBB/develop/mysql_upgrader.php index 0498f826ab..7f82ebfeab 100644 --- a/phpBB/develop/mysql_upgrader.php +++ b/phpBB/develop/mysql_upgrader.php @@ -1229,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), diff --git a/phpBB/develop/repair_bots.php b/phpBB/develop/repair_bots.php index 790d3d9f2f..2c6e9ce091 100644 --- a/phpBB/develop/repair_bots.php +++ b/phpBB/develop/repair_bots.php @@ -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, ); diff --git a/phpBB/develop/search_fill.php b/phpBB/develop/search_fill.php index 4c0b607778..2a4dfb212c 100644 --- a/phpBB/develop/search_fill.php +++ b/phpBB/develop/search_fill.php @@ -40,7 +40,7 @@ if (!class_exists($search_type)) } $error = false; -$search = new $search_type($error); +$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user); if ($error) { diff --git a/phpBB/develop/utf_normalizer_test.php b/phpBB/develop/utf_normalizer_test.php index 186e10fea2..af8556507f 100644 --- a/phpBB/develop/utf_normalizer_test.php +++ b/phpBB/develop/utf_normalizer_test.php @@ -222,7 +222,7 @@ die("\n\nALL TESTS PASSED SUCCESSFULLY\n"); * Download a file to the develop/ dir * * @param string $url URL of the file to download -* @return void +* @return null */ function download($url) { diff --git a/phpBB/docs/AUTHORS b/phpBB/docs/AUTHORS index f0b4e25549..c63bd743a7 100644 --- a/phpBB/docs/AUTHORS +++ b/phpBB/docs/AUTHORS @@ -22,15 +22,12 @@ involved in phpBB. phpBB Lead Developer: naderman (Nils Adermann) -phpBB Developers: Acyd Burn (Meik Sievertsen) [Lead 09/2005 - 01/2010] - Arty (Vjacheslav Trushkin) - bantu (Andreas Fischer) - imkingdavid (David King) +phpBB Developers: bantu (Andreas Fischer) igorw (Igor Wiedler) + imkingdavid (David King) nickvergessen (Joas Schilling) Oleg (Oleg Pudeyev) rxu (Ruslan Uzdenov) - ToonArmy (Chris Smith) Contributions by: leviatan21 (Gabriel Vazquez) Raimon (Raimon Meuldijk) @@ -39,13 +36,16 @@ Contributions by: leviatan21 (Gabriel Vazquez) -- Former Contributors -- -phpBB Project Manager: theFinn (James Atkinson) [Founder - 04/2007] +phpBB Project Manager: theFinn (James Atkinson) [Founder - 04/2007] SHS` (Jonathan Stanley) -phpBB Lead Developer: psoTFX (Paul S. Owen) [2001 - 09/2005] +phpBB Lead Developer: Acyd Burn (Meik Sievertsen) [09/2005 - 01/2010] + psoTFX (Paul S. Owen) [2001 - 09/2005] phpBB Developers: A_Jelly_Doughnut (Josh Woody) [01/2010 - 11/2010] + Acyd Burn (Meik Sievertsen) [02/2003 - 09/2005] APTX (Marek A. Ruszczyński) [12/2007 - 04/2011] + Arty (Vjacheslav Trushkin) [02/2012 - 07/2012] 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] @@ -54,6 +54,7 @@ phpBB Developers: A_Jelly_Doughnut (Josh Woody) [01/2010 - 11/2010] GrahamJE (Graham Eames) [09/2005 - 11/2006] kellanved (Henry Sudhof) [04/2007 - 03/2011] TerraFrost (Jim Wigginton) [04/2009 - 01/2011] + ToonArmy (Chris Smith) [06/2008 - 11/2011] Vic D'Elfant (Vic D'Elfant) [04/2007 - 04/2009] -- Copyrights -- @@ -75,6 +76,7 @@ Jabber Class (c) 2006 Flyspray.org, http://www.flyspray.org/ Chora (c) 2000-2006, The Horde Project. http://horde.org/chora/ Horde Project (c) 2000-2006, The Horde Project. http://horde.org/ jQuery (c) 2011, John Resig. http://jquery.com/ +Sphinx Technologies Inc (c) 2001-2012 Andrew Aksyonoff, http://sphinxsearch.com/ PHP License, version 3.0: Pear (c) 2001-2004 PHP Group, http://pear.php.net diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 0c56dbb2a3..942912a593 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -151,6 +151,14 @@ <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> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10441">PHPBB3-10441</a>] - Update to docs/README.html</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10773">PHPBB3-10773</a>] - ACP phpBB logo needs registered trademark symbol</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10935">PHPBB3-10935</a>] - Limit number of PM rules per user</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10937">PHPBB3-10937</a>] - Comment removal functions: Backward compatibility broken</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10950">PHPBB3-10950</a>] - Deleting user with undelivered PMs causes SQL error</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10952">PHPBB3-10952</a>] - includes/constants.php version number incorrect</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10965">PHPBB3-10965</a>] - Dropdown CPF now shows in profile when no value is selected</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10978">PHPBB3-10978</a>] - Typo in prosilvers ucp_groups_membership.html</li> </ul> <h4>Improvement</h4> <ul> @@ -181,6 +189,7 @@ <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> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10925">PHPBB3-10925</a>] - Clarify that SQLite3 is not supported for phpBB 3.0.x</li> </ul> <h4>New Feature</h4> <ul> diff --git a/phpBB/docs/INSTALL.html b/phpBB/docs/INSTALL.html index cec11facb6..58aeb904c7 100644 --- a/phpBB/docs/INSTALL.html +++ b/phpBB/docs/INSTALL.html @@ -55,7 +55,7 @@ <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> + <li><a href="#update_files">Changed files</a></li> <li><a href="#update_patch">Patch file</a></li> <li><a href="#update_auto">Automatic update package</a></li> <li><a href="#update_all">All package types</a></li> @@ -75,6 +75,7 @@ <li><a href="#webserver_configuration">Webserver configuration</a></li> </ol> </li> + <li><a href="#anti_spam">Anti-Spam Measures</a></li> <li><a href="#disclaimer">Copyright and disclaimer</a></li> </ol> @@ -100,10 +101,10 @@ <li>Change the permissions on config.php to be writable by all (666 or -rw-rw-rw- within your FTP Client)</li> <li>Change the permissions on the following directories to be writable by all (777 or -rwxrwxrwx within your FTP Client):<br /> <code>store/</code>, <code>cache/</code>, <code>files/</code> and <code>images/avatars/upload/</code>.</li> - <li>Using your web browser visit the location you placed phpBB3 with the addition of install/index.php or pointing directly to install/, e.g. http://www.mydomain.com/phpBB3/install/, http://www.mydomain.com/forum/install/ etc.</li> - <li>Click the <em>INSTALL</em> tab, follow the steps and fill out all the requested information.</li> + <li>Point your web browser to the location where you uploaded the phpBB3 files with the addition of <code>install/index.php</code> or simply <code>install/</code>, e.g. <code>http://www.example.com/phpBB3/install/index.php</code>, <code>http://www.example.com/forum/install/</code>.</li> + <li>Click the <strong><em>INSTALL</em></strong> tab, follow the steps and fill out all the requested information.</li> <li>Change the permissions on config.php to be writable only by yourself (644 or -rw-r--r-- within your FTP Client)</li> - <li>phpBB3 should now be available, please <strong>MAKE SURE</strong> you read at least <a href="#postinstall">Section 6</a> below for important, security related post-installation instructions.</li> + <li>phpBB3 should now be available, please <strong>MAKE SURE</strong> you read at least <a href="#postinstall">Section 6</a> below for important, security related post-installation instructions, and also take note of <a href="#anti_spam">Section 7</a> regarding anti-spam measures.</li> </ol> <p>If you experienced problems or do not know how to proceed with any of the steps above please read the rest of this document.</p> @@ -131,19 +132,19 @@ <li>A SQL database system, <strong>one of</strong>: <ul> <li>MySQL 3.23 or above (MySQLi supported)</li> - <li>PostgreSQL 7.3+</li> + <li>PostgreSQL 8.3+</li> <li>SQLite 2.8.2+ (SQLite 3 is not supported)</li> <li>Firebird 2.1+</li> <li>MS SQL Server 2000 or above (directly or via ODBC or the native adapter)</li> <li>Oracle</li> </ul> </li> - <li><strong>PHP 5.3.2+</strong> with support for the database you intend to use.</li> + <li><strong>PHP 5.3.3+</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>getimagesize() function must be enabled.</li> <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> @@ -155,7 +156,7 @@ </li> </ul> - <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> + <p>If your server or hosting account does not meet the requirements above then you will be unable to install phpBB 3.1.x.</p> </div> @@ -175,21 +176,21 @@ <p>Installation of phpBB3 will vary according to your server and database. If you have <em>shell access</em> to your account (via telnet or ssh for example) you may want to upload the entire phpBB3 archive (in binary mode!) to a directory on your host and unarchive it there.</p> - <p>If you do not have shell access or do not wish to use it you will need to decompress the phpBB3 archive to a local directory on your system using your favourite compression program, e.g. winzip, rar, zip, etc. From there you must FTP <strong>ALL</strong> the files it contains (being sure to retain the directory structure and filenames) to your host. Please ensure that the cases of filenames are retained, do <strong>NOT</strong> force filenames to all lower or upper case doing so will cause errors later.</p> + <p>If you do not have shell access or do not wish to use it, you will need to decompress the phpBB3 archive to a local directory on your system using your favourite compression program, e.g. winzip, rar, zip, etc. From there you must FTP <strong>ALL</strong> the files it contains (being sure to retain the directory structure and filenames) to your host. Please ensure that the cases of filenames are retained, do <strong>NOT</strong> force filenames to all lower or upper case as doing so will cause errors later.</p> - <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>All .php, .sql, .cfg, .css, .js, .html, .htaccess 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 were uploaded correctly as described here.</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>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 on 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> + <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 <code>www.example.com</code> and you placed the phpBB3 files in the directory <code>/phpBB3</code> off your web root you would enter <code>http://www.example.com/phpBB3/install/</code> or (alternatively) <code>http://www.example.com/phpBB3/install/index.php</code> into your browser. When you have done this, you should see the <strong><em>phpBB3 Introduction</em></strong> screen appear.</p> <h4>Introduction:</h4> - <p>The installation screen gives you a short introduction into phpBB. It allows you to read the license phpBB3 is released under (General Public License) and provides information about how you can receive support. To start the installation, use the <em>Install</em> button.</p> + <p>The initial screen gives you a short introduction into phpBB. It allows you to read the license phpBB3 is released under (General Public License v2) and provides information about how you can receive support. To start the installation, use the <strong><em>INSTALL</em></strong> tab.</p> <h4>Requirements</h4> - <p>The first page you will see after starting the installation is the Requirements list. phpBB3 checks automatically whether everything that it needs to run properly is installed on your server. You need to have at least the minimum PHP version installed, and at least one database available to continue the installation. Also important, is that all shown folders are available and do have the correct permissions. Please see the description of each section to find out whether they are optional or required for phpBB3 to run. If everything is in order, you can continue the installation with <em>Start Install</em>.</p> + <p>The first page you will see after starting the installation is the Requirements list. phpBB3 automatically checks whether everything that it needs to run properly is installed on your server. You need to have at least the minimum PHP version installed, and at least one database available to continue the installation. Also important, is that all shown folders are available and have the correct permissions. Please see the description of each section to find out whether they are optional or required for phpBB3 to run. If everything is in order, you can continue the installation with <em>Start Install</em>.</p> <h4>Database settings</h4> @@ -207,33 +208,33 @@ <p><strong>Note:</strong> if you are installing using SQLite, you should enter the full path to your database file in the DSN field and leave the username and password fields blank. For security reasons, you should make sure that the database file is not stored in a location accessible from the web.</p> </div> - <p>You don't need to change the Prefix for tables in database setting, unless you plan on using multipe phpBB installations on one database. In this case you can use a different prefix for each installation to make it work.</p> + <p>You don't need to change the Prefix for tables in database setting, unless you plan on using multipe phpBB installations on one database. In this case, you can use a different prefix for each installation to make it work.</p> - <p>After you entered your details, you can continue with the Proceed to next step button. Now phpBB3 will check whether the data you entered will lead to a successful database connection and whether tables with the same prefix already exist.</p> + <p>After you entered your details, you can continue with the <em>Proceed to next step</em> button. Now phpBB3 will check whether the data you entered will lead to a successful database connection and whether tables with the same prefix already exist.</p> <p>A <em>Could not connect to the database</em> error means that you didn't enter the database data correctly and it is not possible for phpBB to connect. Make sure that everything you entered is in order and try again. Again, if you are unsure about your database settings, please contact your host.</p> <p>If you installed another version of phpBB before on the same database with the same prefix, phpBB will inform you and you just need to enter a different database prefix.</p> - <p>If you see the Successful Connection message, you can continue to the next step.</p> + <p>If you see the <em>Successful Connection</em> message, you can continue to the next step.</p> <h4>Administrator details</h4> - <p>Now you have to create your administration user. This user will have full administration access and he/she will be the first user on your forum. All fields on this page are required. You can also set the default language of your forum on this page. In a vanilla phpBB3 installation we only include English. You can download further languages from <a href="http://www.phpbb.com/">www.phpbb.com</a>, and add them before installing or later.</p> + <p>Now you have to create your administration user. This user will have full administration access and he/she will be the first user on your forum. All fields on this page are required. You can also set the default language of your forum on this page. In a vanilla phpBB3 installation, we only include British English. You can download further languages from <a href="http://www.phpbb.com/">www.phpbb.com</a>, and add them before installing or later.</p> <h4>Configuration file</h4> - <p>In this step, phpBB will try to write the configuration file automatically. The forum needs the configuration to run properly. It contains all database settings, so without it, phpBB will not be able to access the database.</p> + <p>In this step, phpBB will try to write the configuration file automatically. The forum needs the configuration file in order to operate. It contains all the database settings, so without it, phpBB will not be able to access the database.</p> - <p>Usually writing the configuration file automatically works fine. But in some cases it can fail due to wrong file permissions, for instance. In this case, you need to upload the file manually. phpBB asks you to download the config.php file and tells you what to do with it. Please read the instructions carefully. After you have uploaded the file, use <em>Done</em> to get to the last step. If <em>Done</em> returns you to the same page as before, and does not return a success message, you did not upload the file correctly.</p> + <p>Usually, writing the configuration file automatically works fine. If the file permissions are not set correctly, this process can fail. In this case, you need to upload the file manually. phpBB asks you to download the <code>config.php</code> file and tells you what to do with it. Please read the instructions carefully. After you have uploaded the file, use <em>Done</em> to get to the last step. If <em>Done</em> returns you to the same page as before, and does not return a success message, you did not upload the file correctly.</p> <h4>Advanced settings</h4> - <p>The Advanced settings allow you to set some parameters of the board configuration. They are optional, and you can always change them later. So if you are not sure what these settings mean, proceed to the final step and finish the installation.</p> + <p>The Advanced settings allow you to set additional parameters of the board configuration. They are optional and you can always change them later. So, even if you are not sure what these settings mean, you can still proceed to the final step and finish the installation.</p> - <p>If the installation was successful, you can now use the Login button to visit the Administration Control Panel. Congratulations, you have installed phpBB3 successfully. But there is still work ahead!</p> + <p>If the installation was successful, you can now use the <em>Login</em> button to visit the Administration Control Panel. Congratulations, you have installed phpBB successfully. But there is still work ahead!</p> - <p>If you are unable to get phpBB3 installed even after reading this guide, please look at the support section to find out where you can ask for further assistance.</p> + <p>If you are unable to get phpBB3 installed even after reading this guide, please look at the support section of the installer's introduction page to find out where you can ask for further assistance.</p> <p>At this point if you are converting from phpBB 2.0.x, you should refer to the <a href="#convert">conversion steps</a> for further information. If not, you should remove the install directory from your server as you will only be able to access the Administration Control Panel whilst it is present.</p> @@ -253,55 +254,55 @@ <div class="content"> -<p>If you are currently using a stable release of phpBB3 updating to this version is straightforward. You would have downloaded one of four packages and your choice determines what you need to do. <strong>Please Note</strong>: That before updating we heavily recommend you do a <em>full backup of your database and existing phpBB3 files</em>! If you are unsure how to achieve this please ask your hosting provider for advice.</p> +<p>If you are currently using a stable release of phpBB3, updating to this version is straightforward. You would have downloaded one of four packages and your choice determines what you need to do. <strong>Note</strong>: Before updating, we heavily recommend you do a <em>full backup of your database and existing phpBB3 files</em>! If you are unsure how to achieve this please ask your hosting provider for advice.</p> <p><strong>Please make sure you update your phpBB3 source files too, even if you run the <code>database_update.php</code> file.</strong></p> <a name="update_full"></a><h3>4.i. Full package</h3> - <p>The full package is normally meant for new installations only, but if you want to replace all source files this package comes in handy.</p> + <p>The full package is normally meant for new installations only, but if you want to replace all source files, this package comes in handy.</p> - <p>First you should make a copy of your existing <em>config.php</em> file, keep it in a safe place! Next delete all the existing phpBB3 files, you may want to leave your <code>files/</code> and <code>images/</code> directory in place. You can leave alternative styles in-place too. With this complete you can upload the new phpBB3 files (see <a href="#install">New installation</a> for details if necessary). Once complete copy back your saved <em>config.php</em>, replacing the new one. Another method is to just <strong>replace</strong> the existing files with the files from the full package - though make sure you do <strong>not</strong> overwrite your config.php file.</p> + <p>First, you should make a copy of your existing <code>config.php</code> file; keep it in a safe place! Next, delete all the existing phpBB3 files, you may want to leave your <code>files/</code> and <code>images/</code> directorie in place. You can leave alternative styles in place too. With this complete, you can upload the new phpBB files (see <a href="#install">New installation</a> for details if necessary). Once complete, copy back your saved <code>config.php</code>, replacing the new one. Another method is to just <strong>replace</strong> the existing files with the files from the full package - though make sure you do <strong>not</strong> overwrite your config.php file.</p> - <p>You should now run <code>install/database_update.php</code> which, depending on your previous version, will make a number of database changes. You may receive <em>FAILURES</em> during this procedure, they should not be a cause for concern unless you see an actual <em>ERROR</em>, in which case the script will stop (in this case you should seek help via our forums or bug tracker).</p> + <p>You should now run <code>install/database_update.php</code> which, depending on your previous version, will make a number of database changes. You may receive <em>FAILURES</em> during this procedure. They should not be a cause for concern unless you see an actual <em>ERROR</em>, in which case the script will stop (in this case you should seek help via our forums or bug tracker).</p> - <p>Once the install/database_update.php has completed you may proceed to the Administration Control Panel and check remove the install directory as advised.</p> + <p>Once <code>install/database_update.php</code> has completed, you may proceed to the Administration Control Panel and then remove the install directory as advised.</p> -<a name="update_files"></a><h3>4.ii. Changed files only</h3> +<a name="update_files"></a><h3>4.ii. Changed files</h3> - <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 is meant for those wanting to only replace the files that were changed between a previous version and the latest version.</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>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 <strong>3.1.0</strong> you should select the appropriate <code>phpBB-3.1.1-files.zip/tar.bz2</code> 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> + <p>The directory structure has been preserved, enabling you (if you wish) to simply upload the uncompressed 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 modifications (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> - <p>As for the other update procedures you should run <b>install/database_update.php</b> after you have finished updating the files. This will update your database schema and increment the version number.</p> + <p>As for the other update procedures, you should run <code>install/database_update.php</code> after you have finished updating the files. This will update your database schema and increment the version number.</p> <a name="update_patch"></a><h3>4.iii. Patch file</h3> - <p>The patch file package is for those wanting to update through the patch application, and being comfortable with it.</p> + <p>The patch file package is for those wanting to update through the patch application, and should only be used by those who are comfortable with it.</p> - <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>The patch file is one solution for those with many Modifications (MODs) or other changes and do not want to re-add them back to all the changed files. 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.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>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 <strong>3.1.0</strong>, you need the <code>phpBB-3.1.1-patch.zip/tar.bz2</code> file. Place the correct patch in the parent directory containing the phpBB core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: <code>patch -cl -d [PHPBB DIRECTORY] -p1 < [PATCH NAME]</code> (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB, 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> + <p>If you do get failures, you should look at using the <a href="#update_files">Changed Files</a> package to replace the files which failed to patch. Please note that you will need to manually re-add any 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> - <p>You should of course delete the patch file (or files) after use. As for the other update procedures you should run <code>install/database_update.php</code> after you have finished updating the files. This will update your database schema and data (if appropriate) and increment the version number.</p> + <p>You should, of course, delete the patch file (or files) after use. As for the other update procedures, you should run <code>install/database_update.php</code> after you have finished updating the files. This will update your database schema and data (if appropriate) and increment the version number.</p> <a name="update_auto"></a><h3>4.iv. Automatic update package</h3> - <p>This update method is the recommended method for updating. This package allows detecting changed files automatically and merges changes if needed.</p> + <p>This update method is the recommended method for updating. This package detects changed files automatically and merges in changes if needed.</p> - <p>The automatic update package contains - contrary to the others - only the information required to update the previous release version to the latest available version. These packages are meant for use with the automatic update tool.</p> + <p>The automatic update package will update the board from a given version to the latest version. A number of automatic update files are available, and you should choose the one that corresponds to the version of the board that you are currently running. For example, if your current version is <strong>3.0.10</strong>, you need the <code>phpBB-3.0.10_to_3.0.11.zip/tar.bz2</code> file.</p> - <p>To perform the update, either follow the instructions from the <code>Administration Control Panel->System</code> Tab - this should point out that you are running an outdated version and will guide you through the update - or follow the instructions listed below.</p> + <p>To perform the update, either follow the instructions from the <strong>Administration Control Panel->System</strong> Tab - this should point out that you are running an outdated version and will guide you through the update - or follow the instructions listed below.</p> <ul> <li>Go to the <a href="http://www.phpbb.com/downloads/">downloads page</a> and download the latest update package listed there, matching your current version.</li> - <li>Upload the archives contents to your phpBB installation - only the install folder is required. Upload the whole install folder, retaining the file structure.</li> + <li>Upload the uncompressed archive contents to your phpBB installation - only the install folder is required. Upload the whole install folder, retaining the file structure.</li> <li>After the install folder is present, phpBB3 will go offline automatically.</li> - <li>Point your browser to the install directory, for example <samp>http://www.example.com/phpBB3/install/</samp></li> + <li>Point your browser to the install directory, for example <code>http://www.example.com/phpBB3/install/</code></li> <li>Choose the "Update" Tab and follow the instructions</li> </ul> @@ -309,7 +310,9 @@ <a name="update_all"></a><h3>4.v. All package types</h3> - <p>If you have non-English language packs installed you may want to see if a new version has been made available. A number of missing strings may have been added which, though not essential, may be beneficial to users. Please note that at this time not all language packs have been updated so you should be prepared to periodically check for updates.</p> + <p>If you have non-English language packs installed, you may want to see if a new version has been made available. A number of missing strings may have been added which, though not essential, may be beneficial to users. Please note that at this time not all language packs have been updated so you should be prepared to periodically check for updates.</p> + + <p>These update methods will only update the standard styles, <code>prosilver</code> and <code>subsilver2</code>, any other styles you have installed for your board will usually also need to be updated.</p> </div> @@ -331,47 +334,47 @@ <a name="prereq"></a><h3>5.i. Requirements before converting</h3> - <p>Before converting we heavily recommend you do a <em>full backup of your database and files</em>! If you are unsure how to achieve this please ask your hosting provider for advice. You basically need to follow the basic instructions given for <a href="#install">New installations</a>. Please <strong>do not</strong> overwrite any old files - install phpBB3 at a different location.</p> + <p>Before converting, we heavily recommend you do a <em>full backup of your database and files</em>! If you are unsure how to achieve this, please ask your hosting provider for advice. You basically need to follow the instructions given for <a href="#install">New installations</a>. Please <strong>do not</strong> overwrite any old files - install phpBB3 at a different location.</p> <p>Once you made a backup of everything and also have a brand new phpBB3 installation, you can now begin the conversion.</p> - <p>Note that the conversion requires CREATE and DROP privileges for the phpBB3's database user account.</p> + <p>Note that the conversion requires <code>CREATE</code> and <code>DROP</code> privileges for the phpBB3 database user account.</p> <a name="conversion"></a><h3>5.ii. Converting</h3> - <p>To begin the conversion visit the install folder of your phpBB3 installation (the same as you have done for installing). Now you will see a new tab <em>Convert</em>. Click this tab.</p> + <p>To begin the conversion, visit the <code>install/</code> folder of your phpBB3 installation (the same as you have done for installing). Now you will see a new tab <em>Convert</em>. Click this tab.</p> - <p>As with install the conversion is automated. Your previous 2.0.x database tables will not be changed as well as the original 2.0.x files remaining unaltered. The conversion is actually only filling your phpBB3 database tables and copying additional data over to your phpBB3 installation. This has the benefit that if something goes wrong you are able to either re-run the conversion or continue a conversion, while your old board is still accessible. We really recommend you disable your old installation while converting, else you may have inconsistent data after the conversion.</p> + <p>As with install, the conversion is automated. Your previous 2.0.x database tables will not be changed and the original 2.0.x files will remain unaltered. The conversion is actually only filling your phpBB3 database tables and copying additional data over to your phpBB3 installation. This has the benefit that if something goes wrong, you are able to either re-run the conversion or continue a conversion, while your old board is still accessible. We really recommend that you disable your old installation while converting, else you may have inconsistent data after the conversion.</p> - <p>Please note that this conversion process may take quite some time and depending on your hosting provider this may result in it failing (due to web server or other timeout issues). If this is the case you should ask your provider if they are willing to allow the convert script to temporarily exceed their limits (be nice and they will probably be quite helpful).</p> + <p>Please note that this conversion process may take quite some time and depending on your hosting provider this may result in it failing (due to web server resource limits or other timeout issues). If this is the case, you should ask your provider if they are willing to allow the convert script to temporarily exceed their limits (be nice and they will probably be quite helpful). If your host is unwilling to increase the limits to run the convertor, please see this article for performing the conversion on your local machine: <a href="http://www.phpbb.com/kb/article/offline-conversions/">Knowledge Base - Offline Conversions</a></p> - <p>Once completed your board should be immediately available. If you encountered errors you should report the problems to our bug tracker or seek help via our forums (see <a href="README.html">README</a> for details).</p> + <p>Once completed, your board should be immediately available. If you encountered errors, you should report the problems to our bug tracker or seek help via our forums (see <a href="README.html">README</a> for details).</p> <a name="postreq"></a><h3>5.iii. Things to do after conversion</h3> - <p>After successful conversion there may be a few items you need to do - apart from checking if the installation is accessible and everything displayed correctly.</p> + <p>After a successful conversion, there may be a few items you need to do - apart from checking if the installation is accessible and everything displayed correctly.</p> - <p>The first thing you may want to do is going to the administration control panel and checking every configuration item within the general tab. Thereafter you may want to adjust the forum descriptions/names if you entered HTML there. You also may want to access the other administrative sections, e.g. adjusting permissions, smilies, icons, ranks, etc.</p> + <p>The first thing you may want to do is to go to the administration control panel and check every configuration item within the general tab. Thereafter, you may want to adjust the forum descriptions/names if you entered HTML there. You also may want to access the other administrative sections, e.g. adjusting permissions, smilies, icons, ranks, etc.</p> - <p>Within the conversion the search index has not been created or transferred. This means after conversion you are not able to find any matches if you want to search for something. We recommend you rebuild your search index within <code>Admin -> Maintenance -> Database -> Search Index</code>.</p> + <p>During the conversion, the search index is not created or transferred. This means after conversion you are not able to find any matches if you want to search for something. We recommend you rebuild your search index within <strong>Administration Control Panel -> Maintenance -> Database -> Search Index</strong>.</p> <p>After verifying the settings in the ACP, you can delete the install directory to enable the board. The board will stay disabled until you do so.</p> - <p>Once you are pleased with your new installation you may want to give it the name of your old installation, changing the directory name. With phpBB3 this is possible without any problems - but you may still want to check your cookie settings within the administration panel, if the cookie path need to be adjusted prior to renaming.</p> + <p>Once you are pleased with your new installation, you may want to give it the name of your old installation, changing the directory name. With phpBB3 this is possible without any problems, but you may still want to check your cookie settings within the administration panel; in case your cookie path needs to be adjusted prior to renaming.</p> <a name="convprob"></a><h3>5.iv. Common conversion problems</h3> <p><strong>Broken non-latin characters</strong> The conversion script assumes that the database encoding in the source phpBB2 matches the encoding defined in the <code>lang_main.php</code> file of the default language pack of the source installation. Edit that file to match the database's encoding and re-start the conversion procedure.</p> - <p><strong>http 500 / white pages</strong> The conversion is a load-heavy procedure. Restrictions imposed by some server hosting providers can cause problems. The most common causes are: too low values for the php settings <code>memory_limit</code> and <code>max_execution_time</code>. Limits on the allowed CPU time are also a frequent cause for such errors, as are caps on the number of database queries allowed. If you cannot change such settings, then contact your hosting provider or run the conversion procedure on a different computer. The phpBB.com forums are also an excellent location to ask for support.</p> + <p><strong>http 500 / white pages</strong> The conversion is a load-heavy procedure. Restrictions imposed by some server hosting providers can cause problems. The most common causes are: values too low for the PHP settings <code>memory_limit</code> and <code>max_execution_time</code>. Limits on the allowed CPU time are also a frequent cause for such errors, as are limits on the number of database queries allowed. If you cannot change such settings, then contact your hosting provider or run the conversion procedure on a different computer. The phpBB.com forums are also an excellent location to ask for support.</p> - <p><strong>Password conversion</strong> Due to the utf-8 based handling of passwords in phpBB3, it is not always possible to transfer all passwords. For passwords "lost in translation" the easiest workaround is to use the "forgotten password" function.</p> + <p><strong>Password conversion</strong> Due to the utf-8 based handling of passwords in phpBB3, it is not always possible to transfer all passwords. For passwords "lost in translation" the easiest workaround is to use the <em>I forgot my password</em> link on the login page.</p> - <p><strong>Path to your former board</strong> The converter expects the relative path to your old board's files. So, - for instance - if the old board is located at <code>http://www.yourdomain.com/forum</code> and the phpBB3 installation is located at <code>http://www.yourdomain.com/phpBB3</code>, then the correct value would be <code>../forum</code>. Note that the webserver user must be able to access the source installation's files.</p> + <p><strong>Path to your former board</strong> The convertor expects the relative path to your old board's files. So, for instance, if the old board is located at <code>http://www.yourdomain.com/forum</code> and the phpBB3 installation is located at <code>http://www.yourdomain.com/phpBB3</code>, then the correct value would be <code>../forum</code>. Note that the webserver user must be able to access the source installation's files.</p> <p><strong>Missing images</strong> If your default board language's language pack does not include all images, then some images might be missing in your installation. Always use a complete language pack as default language.</p> - <p><strong>Smilies</strong> During the conversion you might see warnings about image files where the copying failed. That can happen if the old board's smilies have the same file names as those on the new board. Copy those files manually after the conversion, if you want to continue using the old smilies.</p> + <p><strong>Smilies</strong> During the conversion you might see warnings about image files where the copying failed. This can happen if the old board's smilies have the same file names as those on the new board. Copy those files manually after the conversion, if you want to continue using the old smilies.</p> </div> @@ -390,28 +393,44 @@ <div class="content"> - <p>Once you have successfully installed phpBB3 you <strong>MUST</strong> ensure you remove the entire install/ directory. Leaving the install directory in place is a <em>very serious potential security issue</em> which may lead to deletion or alteration of files, etc. Please note that until this directory is removed, phpBB3 will not operate and a warning message will be displayed. Beyond this <strong>essential</strong> deletion, you may also wish to delete the docs/ directories if you wish.</p> + <p>Once you have successfully installed phpBB3 you <strong>MUST</strong> ensure you remove the entire <code>install/</code> directory. Leaving the install directory in place is a <em>very serious potential security issue</em> which may lead to deletion or alteration of files, etc. Please note that until this directory is removed, phpBB will not operate and a warning message will be displayed. Beyond this <strong>essential</strong> deletion, you may also wish to delete the docs/ directory if you wish.</p> - <p>With these directories deleted you should proceed to the administration panel. Depending on how the installation completed you may have been directed there automatically. If not, login as the administrator you specified during install/conversion and click the <strong>Administration Panel</strong> link at the bottom of any page. Ensure that details specified in <code>Admin -> General</code> are correct!</p> + <p>With these directories deleted, you should proceed to the administration panel. Depending on how the installation completed, you may have been directed there automatically. If not, login as the administrator you specified during install/conversion and click the <strong>Administration Control Panel</strong> link at the bottom of any page. Ensure that details specified on the <strong>General</strong> tab are correct!</p> <a name="avatars"></a><h3>6.i. Uploadable avatars</h3> <p>phpBB3 supports several methods for allowing users to select their own <em>avatar</em> (an avatar is a small image generally unique to a user and displayed just below their username in posts).</p> - <p>Two of these options allow users to upload an avatar from their machine or a remote location (via a URL). If you wish to enable this function you should first ensure the correct paths for uploadeable avatars is set in <code>Admin -> General -> Board Configuration -> Avatar settings</code>. By default this is <em>images/avatars/uploads</em> but you can set it to whatever you like, just ensure the configuration setting is updated. You must also ensure this directory can be written to by the webserver. Usually this means you have to alter its permissions to allow anyone to read and write to. Exactly how you should do this depends on your ftp client or server operating system.</p> + <p>Two of these options allow users to upload an avatar from their machine or a remote location (via a URL). If you wish to enable this function you should first ensure the correct path for uploadable avatars is set in <strong>Administration Control Panel -> General -> Board Configuration -> Avatar settings</strong>. By default this is <code>images/avatars/uploads</code>, but you can set it to whatever you like, just ensure the configuration setting is updated. You must also ensure this directory can be written to by the webserver. Usually this means you have to alter its permissions to allow anyone to read and write to it. Exactly how you should do this depends on your FTP client or server operating system.</p> - <p>On UNIX systems for example you set the directory to a+rwx (or ugo+rwx or even 777). This can be done from a command line on your server using chmod or via your FTP client (using the Change Permissions, chmod or other Permissions dialoge box, see your FTP clients documentation for help). Most FTP clients list permissions in the form of User (Read, Write, Execute), Group (Read, Write, Execute) and Other (Read, Write, Execute). You need to tick all of these boxes to set correct permissions.</p> + <p>On UNIX systems, for example, you set the directory to a+rwx (or ugo+rwx or even 777). This can be done from a command line on your server using chmod or via your FTP client (using the Change Permissions, chmod or other Permissions dialog box, see your FTP client's documentation for help). Most FTP clients list permissions in the form of User (Read, Write, Execute), Group (Read, Write, Execute) and Other (Read, Write, Execute). You need to tick all of these boxes to set correct permissions.</p> - <p>On Windows system you need to ensure the directory is not write-protected and that it has global write permissions (see your servers documentation or contact your hosting provider if you are unsure on how to achieve this).</p> + <p>On Windows systems, you need to ensure the directory is not write-protected and that it has global write permissions (see your server's documentation or contact your hosting provider if you are unsure on how to achieve this).</p> - <p>Please be aware that setting a directories permissions to global write access is a potential security issue. While it is unlikely that anything nasty will occur (such as all the avatars being deleted) there are always people out there to cause trouble. Therefore you should monitor this directory and if possible make regular backups.</p> + <p>Please be aware that setting a directory's permissions to global write access is a potential security issue. While it is unlikely that anything nasty will occur (such as all the avatars being deleted) there are always people out there to cause trouble. Therefore you should monitor this directory and if possible make regular backups.</p> <a name="webserver_configuration"></a><h3>6.ii. Webserver configuration</h3> - <p>Depending on your web server you may have to configure your server to deny web access to the <code>cache/</code>, <code>files/</code>, <code>store/</code> and other directories. This is to prevent users from accessing sensitive files.</p> + <p>Depending on your web server, you may have to configure your server to deny web access to the <code>cache/</code>, <code>files/</code>, <code>store/</code> and other directories. This is to prevent users from accessing sensitive files.</p> + + <p>For <strong>Apache</strong> there are <code>.htaccess</code> files already in place to do this for you. Similarly, for <strong>Windows</strong> based servers using <strong>IIS</strong> there are <code>web.config</code> files already in place to do this for you. For other webservers, you will have to adjust the configuration yourself. Sample files for <strong>nginx</strong> and <strong>lighttpd</strong> to help you get started may be found in <code>docs/</code> directory.</p> - <p>For <strong>apache</strong> there are <code>.htaccess</code> files already in place to do this for you. For other webservers you will have to adjust the configuration yourself. Sample files for <strong>nginx</strong> and <strong>lighttpd</strong> to help you get started may be found in docs directory.</p> + </div> + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + + <span class="corners-bottom"><span></span></span></div> + </div> + + <hr /> + +<a name="anti_spam"></a><h2>7. Anti-Spam Measures</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> + <p>Like any online site that allows user input, your board could be subject to unwanted posts; often referred to as <a href="http://en.wikipedia.org/wiki/Forum_spam">forum spam</a>. The vast majority of these attacks will be from automated computer programs known as <a href="http://en.wikipedia.org/wiki/Spambot">spambots</a>. The attacks, generally, are not personal as the spammers are just trying to find accessible targets. phpBB has a number of anti-spam measures built in, including a range of CAPTCHAs. However, administrators are strongly urged to read and follow the advice for <a href="http://www.phpbb.com/support/spam/">Preventing Spam in phpBB</a> as soon as possible after completing the installation of your board.</p> </div> <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> @@ -421,14 +440,14 @@ <hr /> -<a name="disclaimer"></a><h2>7. Copyright and disclaimer</h2> +<a name="disclaimer"></a><h2>8. Copyright and disclaimer</h2> <div class="paragraph"> <div class="inner"><span class="corners-top"><span></span></span> <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 the source code and <code>docs/</code> 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> diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html index cecc996c9c..164c4a2f55 100644 --- a/phpBB/docs/README.html +++ b/phpBB/docs/README.html @@ -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> @@ -122,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 language packs 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/languages/">http://www.phpbb.com/languages/</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 appearing 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 they may not be to everyone's tastes. Therefore phpBB3 allows styles to be switched with relative ease. Firstly you need to locate and download a style you like. We maintain such a site at</p> + <p>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/customise/db/styles-2/">http://www.phpbb.com/customise/db/styles-2/</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/customise/db/modifications-1/">http://www.phpbb.com/customise/db/modifications-1/</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> @@ -184,17 +185,23 @@ <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/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> @@ -220,7 +227,7 @@ <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 phpBB, the main community forums are the place for this.</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> @@ -245,17 +252,17 @@ <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>If no existing bug exists then please feel free to add it.</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 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>PHP version and mode of operation, e.g. PHP 5.3.3 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> @@ -289,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> @@ -313,11 +320,11 @@ <div class="content"> - <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>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.3.</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 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 8.x, Oracle 8, SQLite 2 and Firebird. Versions of PHP used range from 5.3.x to 5.4.x without problem.</p> <a name="phpsec"></a><h3>7.i. Notice on PHP security issues</h3> @@ -339,7 +346,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> diff --git a/phpBB/docs/auth_api.html b/phpBB/docs/auth_api.html index 2302140030..249ceebfbc 100644 --- a/phpBB/docs/auth_api.html +++ b/phpBB/docs/auth_api.html @@ -193,7 +193,7 @@ $user_id = 2; $auth->acl_clear_prefetch($user_id); </pre></div> - <p>This method returns void.</p> + <p>This method returns null.</p> <a name="acl_get_list"></a><h3>2.viii. acl_get_list</h3> diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index ae4655e094..eb569d12d5 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -740,7 +740,7 @@ static private function f() <a name="sql"></a><h3>2.iii. SQL/SQL Layout</h3> <h4>Common SQL Guidelines: </h4> - <p>All SQL should be cross-DB compatible, if DB specific SQL is used alternatives must be provided which work on all supported DB's (MySQL3/4/5, MSSQL (7.0 and 2000), PostgreSQL (7.0+), Firebird, SQLite, Oracle8, ODBC (generalised if possible)).</p> + <p>All SQL should be cross-DB compatible, if DB specific SQL is used alternatives must be provided which work on all supported DB's (MySQL3/4/5, MSSQL (7.0 and 2000), PostgreSQL (8.3+), Firebird, SQLite, Oracle8, ODBC (generalised if possible)).</p> <p>All SQL commands should utilise the DataBase Abstraction Layer (DBAL)</p> <h4>SQL code layout:</h4> @@ -2382,7 +2382,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) <div class="codebox"><pre> ... -'FOO_BAR' => 'PHP version < 5.3.2.<br /> +'FOO_BAR' => 'PHP version < 5.3.3.<br /> Visit "Downloads" at <a href="http://www.php.net/">www.php.net</a>.', ... </pre></div> @@ -2391,7 +2391,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) <div class="codebox"><pre> ... -'FOO_BAR' => 'PHP version &lt; 5.3.2.<br /> +'FOO_BAR' => 'PHP version &lt; 5.3.3.<br /> Visit &quot;Downloads&quot; at <a href="http://www.php.net/">www.php.net</a>.', ... </pre></div> @@ -2400,7 +2400,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) <div class="codebox"><pre> ... -'FOO_BAR' => 'PHP version &lt; 5.3.2.<br /> +'FOO_BAR' => 'PHP version &lt; 5.3.3.<br /> Visit “Downloads” at <a href="http://www.php.net/">www.php.net</a>.', ... </pre></div> diff --git a/phpBB/docs/sphinx.sample.conf b/phpBB/docs/sphinx.sample.conf new file mode 100644 index 0000000000..aa0e8d905d --- /dev/null +++ b/phpBB/docs/sphinx.sample.conf @@ -0,0 +1,96 @@ +source source_phpbb_{SPHINX_ID}_main +{ + type = mysql #mysql or pgsql + sql_host = localhost #SQL server host sphinx connects to + sql_user = username + sql_pass = password + sql_db = db_name + sql_port = 3306 #optional, default is 3306 for mysql and 5432 for pgsql + sql_query_pre = SET NAMES 'utf8' + sql_query_pre = UPDATE phpbb_sphinx SET max_doc_id = MAX(post_id) WHERE counter_id = 1 + sql_query_range = SELECT MIN(post_id), MAX(post_id) FROM phpbb_posts + sql_range_step = 5000 + sql_query = SELECT
\ + p.post_id AS id,
\ + p.forum_id,
\ + p.topic_id,
\ + p.poster_id,
\ + CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post,
\ + p.post_time,
\ + p.post_subject,
\ + p.post_subject as title,
\ + p.post_text as data,
\ + t.topic_last_post_time,
\ + 0 as deleted
\ + FROM phpbb_posts p, phpbb_topics t
\ + WHERE
\ + p.topic_id = t.topic_id
\ + AND p.post_id >= $start AND p.post_id <= $end + sql_query_post = + sql_query_post_index = UPDATE phpbb_sphinx SET max_doc_id = $maxid WHERE counter_id = 1 + sql_query_info = SELECT * FROM phpbb_posts WHERE post_id = $id + sql_attr_uint = forum_id + sql_attr_uint = topic_id + sql_attr_uint = poster_id + sql_attr_bool = topic_first_post + sql_attr_bool = deleted + sql_attr_timestamp = post_time + sql_attr_timestamp = topic_last_post_time + sql_attr_str2ordinal = post_subject +} +source source_phpbb_{SPHINX_ID}_delta : source_phpbb_{SPHINX_ID}_main +{ + sql_query_range = + sql_range_step = + sql_query = SELECT
\ + p.post_id AS id,
\ + p.forum_id,
\ + p.topic_id,
\ + p.poster_id,
\ + CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post,
\ + p.post_time,
\ + p.post_subject,
\ + p.post_subject as title,
\ + p.post_text as data,
\ + t.topic_last_post_time,
\ + 0 as deleted
\ + FROM phpbb_posts p, phpbb_topics t
\ + WHERE
\ + p.topic_id = t.topic_id
\ + AND p.post_id >= ( SELECT max_doc_id FROM phpbb_sphinx WHERE counter_id=1 ) + sql_query_pre = +} +index index_phpbb_{SPHINX_ID}_main +{ + path = {DATA_PATH}/index_phpbb_{SPHINX_ID}_main + source = source_phpbb_{SPHINX_ID}_main + docinfo = extern + morphology = none + stopwords = + min_word_len = 2 + charset_type = utf-8 + charset_table = U+FF10..U+FF19->0..9, 0..9, U+FF41..U+FF5A->a..z, U+FF21..U+FF3A->a..z, A..Z->a..z, a..z, U+0149, U+017F, U+0138, U+00DF, U+00FF, U+00C0..U+00D6->U+00E0..U+00F6, U+00E0..U+00F6, U+00D8..U+00DE->U+00F8..U+00FE, U+00F8..U+00FE, U+0100->U+0101, U+0101, U+0102->U+0103, U+0103, U+0104->U+0105, U+0105, U+0106->U+0107, U+0107, U+0108->U+0109, U+0109, U+010A->U+010B, U+010B, U+010C->U+010D, U+010D, U+010E->U+010F, U+010F, U+0110->U+0111, U+0111, U+0112->U+0113, U+0113, U+0114->U+0115, U+0115, U+0116->U+0117, U+0117, U+0118->U+0119, U+0119, U+011A->U+011B, U+011B, U+011C->U+011D, U+011D, U+011E->U+011F, U+011F, U+0130->U+0131, U+0131, U+0132->U+0133, U+0133, U+0134->U+0135, U+0135, U+0136->U+0137, U+0137, U+0139->U+013A, U+013A, U+013B->U+013C, U+013C, U+013D->U+013E, U+013E, U+013F->U+0140, U+0140, U+0141->U+0142, U+0142, U+0143->U+0144, U+0144, U+0145->U+0146, U+0146, U+0147->U+0148, U+0148, U+014A->U+014B, U+014B, U+014C->U+014D, U+014D, U+014E->U+014F, U+014F, U+0150->U+0151, U+0151, U+0152->U+0153, U+0153, U+0154->U+0155, U+0155, U+0156->U+0157, U+0157, U+0158->U+0159, U+0159, U+015A->U+015B, U+015B, U+015C->U+015D, U+015D, U+015E->U+015F, U+015F, U+0160->U+0161, U+0161, U+0162->U+0163, U+0163, U+0164->U+0165, U+0165, U+0166->U+0167, U+0167, U+0168->U+0169, U+0169, U+016A->U+016B, U+016B, U+016C->U+016D, U+016D, U+016E->U+016F, U+016F, U+0170->U+0171, U+0171, U+0172->U+0173, U+0173, U+0174->U+0175, U+0175, U+0176->U+0177, U+0177, U+0178->U+00FF, U+00FF, U+0179->U+017A, U+017A, U+017B->U+017C, U+017C, U+017D->U+017E, U+017E, U+0410..U+042F->U+0430..U+044F, U+0430..U+044F, U+4E00..U+9FFF + min_prefix_len = 0 + min_infix_len = 0 +} +index index_phpbb_{SPHINX_ID}_delta : index_phpbb_{SPHINX_ID}_main +{ + path = {DATA_PATH}/index_phpbb_{SPHINX_ID}_delta + source = source_phpbb_{SPHINX_ID}_delta +} +indexer +{ + mem_limit = 512M +} +searchd +{ + compat_sphinxql_magics = 0 + listen = localhost:9312 + log = {DATA_PATH}/log/searchd.log + query_log = {DATA_PATH}/log/sphinx-query.log + read_timeout = 5 + max_children = 30 + pid_file = {DATA_PATH}/searchd.pid + max_matches = 20000 + binlog_path = {DATA_PATH} +} diff --git a/phpBB/download/file.php b/phpBB/download/file.php index c01b0789de..73b9e0a9f2 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -7,6 +7,10 @@ * */ +use Symfony\Component\Config\FileLocator; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; + /** * @ignore */ @@ -14,7 +18,6 @@ define('IN_PHPBB', true); $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); - // Thank you sun. if (isset($_SERVER['CONTENT_TYPE'])) { @@ -39,26 +42,43 @@ if (isset($_GET['avatar'])) } require($phpbb_root_path . 'includes/class_loader.' . $phpEx); + require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx); require($phpbb_root_path . 'includes/constants.' . $phpEx); require($phpbb_root_path . 'includes/functions.' . $phpEx); + require($phpbb_root_path . 'includes/functions_container.' . $phpEx); require($phpbb_root_path . 'includes/functions_download' . '.' . $phpEx); require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); - $phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', $phpbb_root_path . 'ext/', ".$phpEx"); - $phpbb_class_loader_ext->register(); - $phpbb_class_loader = new phpbb_class_loader('phpbb_', $phpbb_root_path . 'includes/', ".$phpEx"); + // Setup class loader first + $phpbb_class_loader = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}includes/", ".$phpEx"); $phpbb_class_loader->register(); + $phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', "{$phpbb_root_path}ext/", ".$phpEx"); + $phpbb_class_loader_ext->register(); + + // Set up container + $phpbb_container = phpbb_create_dumped_container_unless_debug( + array( + new phpbb_di_extension_config($phpbb_root_path . 'config.' . $phpEx), + new phpbb_di_extension_core($phpbb_root_path), + ), + array( + new phpbb_di_pass_collection_pass(), + new phpbb_di_pass_kernel_pass(), + ), + $phpbb_root_path, + $phpEx + ); + + $phpbb_class_loader->set_cache($phpbb_container->get('cache.driver')); + $phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver')); // set up caching - $cache_factory = new phpbb_cache_factory($acm_type); - $cache = $cache_factory->get_service(); - $phpbb_class_loader_ext->set_cache($cache->get_driver()); - $phpbb_class_loader->set_cache($cache->get_driver()); + $cache = $phpbb_container->get('cache'); - $phpbb_dispatcher = new phpbb_event_dispatcher(); - $request = new phpbb_request(); - $db = new $sql_db(); + $phpbb_dispatcher = $phpbb_container->get('dispatcher'); + $request = $phpbb_container->get('request'); + $db = $phpbb_container->get('dbal.conn'); // Connect to DB if (!@$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false)) @@ -69,18 +89,16 @@ if (isset($_GET['avatar'])) request_var('', 0, false, false, $request); - // worst-case default - $browser = strtolower($request->header('User-Agent', 'msie 6.0')); - - $config = new phpbb_config_db($db, $cache->get_driver(), CONFIG_TABLE); + $config = $phpbb_container->get('config'); set_config(null, null, null, $config); set_config_count(null, null, null, $config); // load extensions - $phpbb_extension_manager = new phpbb_extension_manager($db, EXT_TABLE, $phpbb_root_path, ".$phpEx", $cache->get_driver()); + $phpbb_extension_manager = $phpbb_container->get('ext.manager'); + $phpbb_subscriber_loader = $phpbb_container->get('event.subscriber_loader'); - $phpbb_subscriber_loader = new phpbb_event_extension_subscriber_loader($phpbb_dispatcher, $phpbb_extension_manager); - $phpbb_subscriber_loader->load(); + // worst-case default + $browser = strtolower($request->header('User-Agent', 'msie 6.0')); $filename = request_var('avatar', ''); $avatar_group = false; @@ -134,6 +152,9 @@ include($phpbb_root_path . 'common.' . $phpEx); require($phpbb_root_path . 'includes/functions_download' . '.' . $phpEx); $download_id = request_var('id', 0); +$topic_id = $request->variable('topic_id', 0); +$post_msg_id = $request->variable('post_msg_id', 0); +$archive = $request->variable('archive', '.tar'); $mode = request_var('mode', ''); $thumbnail = request_var('t', false); @@ -142,195 +163,268 @@ $user->session_begin(false); $auth->acl($user->data); $user->setup('viewtopic'); -if (!$download_id) +if (!$config['allow_attachments'] && !$config['allow_pm_attach']) { send_status_line(404, 'Not Found'); - trigger_error('NO_ATTACHMENT_SELECTED'); + trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED'); } -if (!$config['allow_attachments'] && !$config['allow_pm_attach']) +if ($download_id) +{ + // Attachment id (only 1 attachment) + $sql_where = "attach_id = $download_id"; +} +else if ($post_msg_id) +{ + // Post id or private message id (multiple attachments) + $sql_where = "post_msg_id = $post_msg_id AND is_orphan = 0"; +} +else if ($topic_id) +{ + // Topic id (multiple attachments) + $sql_where = "topic_id = $topic_id AND is_orphan = 0"; +} +else { send_status_line(404, 'Not Found'); - trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED'); + trigger_error('NO_ATTACHMENT_SELECTED'); } -$sql = 'SELECT attach_id, in_message, post_msg_id, extension, is_orphan, poster_id, filetime +$sql = 'SELECT attach_id, post_msg_id, topic_id, in_message, is_orphan, physical_filename, real_filename, extension, mimetype, filesize, filetime FROM ' . ATTACHMENTS_TABLE . " - WHERE attach_id = $download_id"; -$result = $db->sql_query_limit($sql, 1); -$attachment = $db->sql_fetchrow($result); + WHERE $sql_where"; +$result = $db->sql_query($sql); + +$attachments = $attachment_ids = array(); +while ($row = $db->sql_fetchrow($result)) +{ + $attachment_id = (int) $row['attach_id']; + + $row['physical_filename'] = utf8_basename($row['physical_filename']); + + $attachment_ids[$attachment_id] = $attachment_id; + $attachments[$attachment_id] = $row; +} $db->sql_freeresult($result); -if (!$attachment) +// Make $attachment the first of the attachments we fetched. +$attachment = current($attachments); + +if (empty($attachments)) { send_status_line(404, 'Not Found'); trigger_error('ERROR_NO_ATTACHMENT'); } - -if ((!$attachment['in_message'] && !$config['allow_attachments']) || ($attachment['in_message'] && !$config['allow_pm_attach'])) +else if (!download_allowed()) { - send_status_line(404, 'Not Found'); - trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED'); + send_status_line(403, 'Forbidden'); + trigger_error($user->lang['LINKAGE_FORBIDDEN']); } - -$row = array(); - -if ($attachment['is_orphan']) +else if ($download_id) { - // We allow admins having attachment permissions to see orphan attachments... - $own_attachment = ($auth->acl_get('a_attach') || $attachment['poster_id'] == $user->data['user_id']) ? true : false; + // sizeof($attachments) == 1 - if (!$own_attachment || ($attachment['in_message'] && !$auth->acl_get('u_pm_download')) || (!$attachment['in_message'] && !$auth->acl_get('u_download'))) + if (!$attachment['in_message'] && !$config['allow_attachments'] || $attachment['in_message'] && !$config['allow_pm_attach']) { send_status_line(404, 'Not Found'); - trigger_error('ERROR_NO_ATTACHMENT'); + trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED'); } - // Obtain all extensions... - $extensions = $cache->obtain_attach_extensions(true); -} -else -{ - if (!$attachment['in_message']) + if ($attachment['is_orphan']) { - // - $sql = 'SELECT p.forum_id, f.forum_password, f.parent_id - FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f - WHERE p.post_id = ' . $attachment['post_msg_id'] . ' - AND p.forum_id = f.forum_id'; - $result = $db->sql_query_limit($sql, 1); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - $f_download = $auth->acl_get('f_download', $row['forum_id']); - - if ($auth->acl_get('u_download') && $f_download) - { - if ($row && $row['forum_password']) - { - // Do something else ... ? - login_forum_box($row); - } - } - else + // We allow admins having attachment permissions to see orphan attachments... + $own_attachment = ($auth->acl_get('a_attach') || $attachment['poster_id'] == $user->data['user_id']) ? true : false; + + if (!$own_attachment || ($attachment['in_message'] && !$auth->acl_get('u_pm_download')) || (!$attachment['in_message'] && !$auth->acl_get('u_download'))) { - send_status_line(403, 'Forbidden'); - trigger_error('SORRY_AUTH_VIEW_ATTACH'); + send_status_line(404, 'Not Found'); + trigger_error('ERROR_NO_ATTACHMENT'); } + + // Obtain all extensions... + $extensions = $cache->obtain_attach_extensions(true); } else { - $row['forum_id'] = false; - if (!$auth->acl_get('u_pm_download')) + if (!$attachment['in_message']) { - send_status_line(403, 'Forbidden'); - trigger_error('SORRY_AUTH_VIEW_ATTACH'); + phpbb_download_handle_forum_auth($db, $auth, $attachment['topic_id']); + } + else + { + // Attachment is in a private message. + $row['forum_id'] = false; + phpbb_download_handle_pm_auth($db, $auth, $user->data['user_id'], $attachment['post_msg_id']); } - // Check if the attachment is within the users scope... - $sql = 'SELECT user_id, author_id - FROM ' . PRIVMSGS_TO_TABLE . ' - WHERE msg_id = ' . $attachment['post_msg_id']; - $result = $db->sql_query($sql); + $extensions = array(); + if (!extension_allowed($row['forum_id'], $attachment['extension'], $extensions)) + { + send_status_line(404, 'Forbidden'); + trigger_error(sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension'])); + } + } - $allowed = false; - while ($user_row = $db->sql_fetchrow($result)) + $download_mode = (int) $extensions[$attachment['extension']]['download_mode']; + $display_cat = $extensions[$attachment['extension']]['display_cat']; + + if (($display_cat == ATTACHMENT_CATEGORY_IMAGE || $display_cat == ATTACHMENT_CATEGORY_THUMB) && !$user->optionget('viewimg')) + { + $display_cat = ATTACHMENT_CATEGORY_NONE; + } + + if ($display_cat == ATTACHMENT_CATEGORY_FLASH && !$user->optionget('viewflash')) + { + $display_cat = ATTACHMENT_CATEGORY_NONE; + } + + if ($thumbnail) + { + $attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename']; + } + else if ($display_cat == ATTACHMENT_CATEGORY_NONE && !$attachment['is_orphan'] && !phpbb_http_byte_range($attachment['filesize'])) + { + // Update download count + phpbb_increment_downloads($db, $attachment['attach_id']); + } + + if ($display_cat == ATTACHMENT_CATEGORY_IMAGE && $mode === 'view' && (strpos($attachment['mimetype'], 'image') === 0) && ((strpos(strtolower($user->browser), 'msie') !== false) && (strpos(strtolower($user->browser), 'msie 8.0') === false))) + { + wrap_img_in_html(append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'id=' . $attachment['attach_id']), $attachment['real_filename']); + file_gc(); + } + else + { + // Determine the 'presenting'-method + if ($download_mode == PHYSICAL_LINK) { - if ($user->data['user_id'] == $user_row['user_id'] || $user->data['user_id'] == $user_row['author_id']) + // This presenting method should no longer be used + if (!@is_dir($phpbb_root_path . $config['upload_path'])) { - $allowed = true; - break; + send_status_line(500, 'Internal Server Error'); + trigger_error($user->lang['PHYSICAL_DOWNLOAD_NOT_POSSIBLE']); } - } - $db->sql_freeresult($result); - if (!$allowed) + redirect($phpbb_root_path . $config['upload_path'] . '/' . $attachment['physical_filename']); + file_gc(); + } + else { - send_status_line(403, 'Forbidden'); - trigger_error('ERROR_NO_ATTACHMENT'); + send_file_to_browser($attachment, $config['upload_path'], $display_cat); + file_gc(); } } +} +else +{ + // sizeof($attachments) >= 1 + if ($attachment['in_message']) + { + phpbb_download_handle_pm_auth($db, $auth, $user->data['user_id'], $attachment['post_msg_id']); + } + else + { + phpbb_download_handle_forum_auth($db, $auth, $attachment['topic_id']); + } - // disallowed? - $extensions = array(); - if (!extension_allowed($row['forum_id'], $attachment['extension'], $extensions)) + if (!class_exists('compress')) { - send_status_line(404, 'Forbidden'); - trigger_error(sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension'])); + require $phpbb_root_path . 'includes/functions_compress.' . $phpEx; } -} -if (!download_allowed()) -{ - send_status_line(403, 'Forbidden'); - trigger_error($user->lang['LINKAGE_FORBIDDEN']); -} + if (!in_array($archive, compress::methods())) + { + $archive = '.tar'; + } -$download_mode = (int) $extensions[$attachment['extension']]['download_mode']; + if ($post_msg_id) + { + if ($attachment['in_message']) + { + $sql = 'SELECT message_subject AS attach_subject + FROM ' . PRIVMSGS_TABLE . " + WHERE msg_id = $post_msg_id"; + } + else + { + $sql = 'SELECT post_subject AS attach_subject, forum_id + FROM ' . POSTS_TABLE . " + WHERE post_id = $post_msg_id"; + } + } + else + { + $sql = 'SELECT topic_title AS attach_subject, forum_id + FROM ' . TOPICS_TABLE . " + WHERE topic_id = $topic_id"; + } -// Fetching filename here to prevent sniffing of filename -$sql = 'SELECT attach_id, is_orphan, in_message, post_msg_id, extension, physical_filename, real_filename, mimetype, filesize, filetime - FROM ' . ATTACHMENTS_TABLE . " - WHERE attach_id = $download_id"; -$result = $db->sql_query_limit($sql, 1); -$attachment = $db->sql_fetchrow($result); -$db->sql_freeresult($result); + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); -if (!$attachment) -{ - send_status_line(404, 'Not Found'); - trigger_error('ERROR_NO_ATTACHMENT'); -} + if (empty($row)) + { + send_status_line(404, 'Not Found'); + trigger_error('ERROR_NO_ATTACHMENT'); + } -$attachment['physical_filename'] = utf8_basename($attachment['physical_filename']); -$display_cat = $extensions[$attachment['extension']]['display_cat']; + $clean_name = phpbb_download_clean_filename($row['attach_subject']); + $suffix = '_' . (($post_msg_id) ? $post_msg_id : $topic_id) . '_' . $clean_name; + $archive_name = 'attachments' . $suffix; -if (($display_cat == ATTACHMENT_CATEGORY_IMAGE || $display_cat == ATTACHMENT_CATEGORY_THUMB) && !$user->optionget('viewimg')) -{ - $display_cat = ATTACHMENT_CATEGORY_NONE; -} + $store_name = 'att_' . time() . '_' . unique_id(); + $archive_path = "{$phpbb_root_path}store/{$store_name}{$archive}"; -if ($display_cat == ATTACHMENT_CATEGORY_FLASH && !$user->optionget('viewflash')) -{ - $display_cat = ATTACHMENT_CATEGORY_NONE; -} + if ($archive === '.zip') + { + $compress = new compress_zip('w', $archive_path); + } + else + { + $compress = new compress_tar('w', $archive_path, $archive); + } -if ($thumbnail) -{ - $attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename']; -} -else if (($display_cat == ATTACHMENT_CATEGORY_NONE/* || $display_cat == ATTACHMENT_CATEGORY_IMAGE*/) && !$attachment['is_orphan'] && !phpbb_http_byte_range($attachment['filesize'])) -{ - // Update download count - $sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' - SET download_count = download_count + 1 - WHERE attach_id = ' . $attachment['attach_id']; - $db->sql_query($sql); -} + $extensions = array(); + $files_added = 0; + $forum_id = ($attachment['in_message']) ? false : (int) $row['forum_id']; + $disallowed = array(); -if ($display_cat == ATTACHMENT_CATEGORY_IMAGE && $mode === 'view' && (strpos($attachment['mimetype'], 'image') === 0) && ((strpos(strtolower($user->browser), 'msie') !== false) && (strpos(strtolower($user->browser), 'msie 8.0') === false))) -{ - wrap_img_in_html(append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'id=' . $attachment['attach_id']), $attachment['real_filename']); - file_gc(); -} -else -{ - // Determine the 'presenting'-method - if ($download_mode == PHYSICAL_LINK) + foreach ($attachments as $attach) { - // This presenting method should no longer be used - if (!@is_dir($phpbb_root_path . $config['upload_path'])) + if (!extension_allowed($forum_id, $attach['extension'], $extensions)) { - send_status_line(500, 'Internal Server Error'); - trigger_error($user->lang['PHYSICAL_DOWNLOAD_NOT_POSSIBLE']); + $disallowed[$attach['extension']] = $attach['extension']; + continue; } - redirect($phpbb_root_path . $config['upload_path'] . '/' . $attachment['physical_filename']); - file_gc(); + $prefix = ''; + if ($topic_id) + { + $prefix = $attach['post_msg_id'] . '_'; + } + + $compress->add_custom_file("{$phpbb_root_path}files/{$attach['physical_filename']}", "{$prefix}{$attach['real_filename']}"); + $files_added++; } - else + + $compress->close(); + + if ($files_added) { - send_file_to_browser($attachment, $config['upload_path'], $display_cat); - file_gc(); + phpbb_increment_downloads($db, $attachment_ids); + $compress->download($store_name, $archive_name); } + + unlink($archive_path); + + if (!$files_added) + { + // None of the attachments had a valid extension + $disallowed = implode($user->lang['COMMA_SEPARATOR'], $disallowed); + send_status_line(404, 'Forbidden'); + trigger_error($user->lang('EXTENSION_DISABLED_AFTER_POSTING', $disallowed)); + } + + file_gc(); } diff --git a/phpBB/feed.php b/phpBB/feed.php index fcf42a83ae..0dce22fb0c 100644 --- a/phpBB/feed.php +++ b/phpBB/feed.php @@ -150,7 +150,7 @@ if ($config['gzip_compress']) } // IF debug extra is enabled and admin want to "explain" the page we need to set other headers... -if (defined('DEBUG_EXTRA') && request_var('explain', 0) && $auth->acl_get('a_')) +if (defined('DEBUG') && request_var('explain', 0) && $auth->acl_get('a_')) { header('Content-type: text/html; charset=UTF-8'); header('Cache-Control: private, no-cache="set-cookie"'); @@ -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; @@ -563,12 +555,6 @@ class phpbb_feed_base $forum_ids = array_flip($this->get_moderator_approve_forums()); } - if (!$forum_id) - { - // Global announcement, your a moderator in any forum than it's okay. - return (!empty($forum_ids)) ? true : false; - } - return (isset($forum_ids[$forum_id])) ? true : false; } diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index abe304c282..9d6c2d5de1 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -98,7 +98,7 @@ class acp_attachments } $db->sql_freeresult($result); - $l_legend_cat_images = $user->lang['SETTINGS_CAT_IMAGES'] . ' [' . $user->lang['ASSIGNED_GROUP'] . ': ' . ((!empty($s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE])) ? implode(', ', $s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE]) : $user->lang['NO_EXT_GROUP']) . ']'; + $l_legend_cat_images = $user->lang['SETTINGS_CAT_IMAGES'] . ' [' . $user->lang['ASSIGNED_GROUP'] . ': ' . ((!empty($s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE])) ? implode($user->lang['COMMA_SEPARATOR'], $s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE]) : $user->lang['NO_EXT_GROUP']) . ']'; $display_vars = array( 'title' => 'ACP_ATTACHMENT_SETTINGS', @@ -917,7 +917,7 @@ class acp_attachments $db->sql_query($sql); add_log('admin', 'LOG_ATTACH_ORPHAN_DEL', implode(', ', $delete_files)); - $notify[] = sprintf($user->lang['LOG_ATTACH_ORPHAN_DEL'], implode(', ', $delete_files)); + $notify[] = sprintf($user->lang['LOG_ATTACH_ORPHAN_DEL'], implode($user->lang['COMMA_SEPARATOR'], $delete_files)); } $upload_list = array(); @@ -1074,7 +1074,7 @@ class acp_attachments $error[] = $user->lang['FILES_GONE']; } add_log('admin', 'LOG_ATTACHMENTS_DELETED', implode(', ', $deleted_filenames)); - $notify[] = sprintf($user->lang['LOG_ATTACHMENTS_DELETED'], implode(', ', $deleted_filenames)); + $notify[] = sprintf($user->lang['LOG_ATTACHMENTS_DELETED'], implode($user->lang['COMMA_SEPARATOR'], $deleted_filenames)); } else { @@ -1163,7 +1163,7 @@ class acp_attachments $template->assign_vars(array( 'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? true : false, 'U_ACTION' => $this->u_action,) - ); + ); } // Make sure $start is set to the last page if it exceeds the amount @@ -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) diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php index d275c7f10c..3ed9c225f5 100644 --- a/phpBB/includes/acp/acp_ban.php +++ b/phpBB/includes/acp/acp_ban.php @@ -97,7 +97,7 @@ class acp_ban break; } - $this->display_ban_options($mode); + self::display_ban_options($mode); $template->assign_vars(array( 'L_TITLE' => $this->page_title, @@ -118,7 +118,7 @@ class acp_ban /** * Display ban options */ - function display_ban_options($mode) + static public function display_ban_options($mode) { global $user, $db, $template; diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index d537885ef1..322e1c55d8 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -53,12 +53,13 @@ class acp_board 'legend1' => 'ACP_BOARD_SETTINGS', 'sitename' => array('lang' => 'SITE_NAME', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => false), 'site_desc' => array('lang' => 'SITE_DESC', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => false), + 'site_home_url' => array('lang' => 'SITE_HOME_URL', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true), + 'site_home_text' => array('lang' => 'SITE_HOME_TEXT', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true), 'board_disable' => array('lang' => 'DISABLE_BOARD', 'validate' => 'bool', 'type' => 'custom', 'method' => 'board_disable', 'explain' => true), '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), @@ -897,6 +898,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 @@ -907,10 +920,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 = ''; @@ -930,7 +947,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\" />"; diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php index 51b5dd3301..c7c64ae56b 100644 --- a/phpBB/includes/acp/acp_captcha.php +++ b/phpBB/includes/acp/acp_captcha.php @@ -29,7 +29,8 @@ class acp_captcha $user->add_lang('acp/board'); include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx); - $captchas = phpbb_captcha_factory::get_captcha_types(); + $factory = new phpbb_captcha_factory(); + $captchas = $factory->get_captcha_types(); $selected = request_var('select_captcha', $config['captcha_plugin']); $selected = (isset($captchas['available'][$selected]) || isset($captchas['unavailable'][$selected])) ? $selected : $config['captcha_plugin']; diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php new file mode 100644 index 0000000000..a0bcf62ecc --- /dev/null +++ b/phpBB/includes/acp/acp_extensions.php @@ -0,0 +1,303 @@ +<?php +/** +* +* @package acp +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** +* @package acp +*/ +class acp_extensions +{ + var $u_action; + + private $db; + private $config; + private $template; + private $user; + + function main() + { + // Start the page + global $config, $user, $template, $request, $phpbb_extension_manager, $db, $phpbb_root_path, $phpEx; + + $this->db = $db; + $this->config = $config; + $this->template = $template; + $this->user = $user; + + $user->add_lang(array('install', 'acp/extensions')); + + $this->page_title = 'ACP_EXTENSIONS'; + + $action = $request->variable('action', 'list'); + $ext_name = $request->variable('ext_name', ''); + + // Cancel action + if ($request->is_set_post('cancel')) + { + $action = 'list'; + $ext_name = ''; + } + + // If they've specified an extension, let's load the metadata manager and validate it. + if ($ext_name) + { + $md_manager = new phpbb_extension_metadata_manager($ext_name, $db, $phpbb_extension_manager, $phpbb_root_path, ".$phpEx", $template, $config); + + try + { + $md_manager->get_metadata('all'); + } + catch(phpbb_extension_exception $e) + { + trigger_error($e); + } + } + + // What are we doing? + switch ($action) + { + case 'list': + default: + $this->list_enabled_exts($phpbb_extension_manager); + $this->list_disabled_exts($phpbb_extension_manager); + $this->list_available_exts($phpbb_extension_manager); + + $this->tpl_name = 'acp_ext_list'; + break; + + case 'enable_pre': + if (!$md_manager->validate_enable()) + { + trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action)); + } + + if ($phpbb_extension_manager->enabled($ext_name)) + { + redirect($this->u_action); + } + + $this->tpl_name = 'acp_ext_enable'; + + $template->assign_vars(array( + 'PRE' => true, + 'U_ENABLE' => $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name), + )); + break; + + case 'enable': + if (!$md_manager->validate_enable()) + { + trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action)); + } + + if ($phpbb_extension_manager->enable_step($ext_name)) + { + $template->assign_var('S_NEXT_STEP', true); + + meta_refresh(0, $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name)); + } + + $this->tpl_name = 'acp_ext_enable'; + + $template->assign_vars(array( + 'U_RETURN' => $this->u_action . '&action=list', + )); + break; + + case 'disable_pre': + if (!$phpbb_extension_manager->enabled($ext_name)) + { + redirect($this->u_action); + } + + $this->tpl_name = 'acp_ext_disable'; + + $template->assign_vars(array( + 'PRE' => true, + 'U_DISABLE' => $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name), + )); + break; + + case 'disable': + if ($phpbb_extension_manager->disable_step($ext_name)) + { + $template->assign_var('S_NEXT_STEP', true); + + meta_refresh(0, $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name)); + } + + $this->tpl_name = 'acp_ext_disable'; + + $template->assign_vars(array( + 'U_RETURN' => $this->u_action . '&action=list', + )); + break; + + case 'purge_pre': + $this->tpl_name = 'acp_ext_purge'; + + $template->assign_vars(array( + 'PRE' => true, + 'U_PURGE' => $this->u_action . '&action=purge&ext_name=' . urlencode($ext_name), + )); + break; + + case 'purge': + if ($phpbb_extension_manager->purge_step($ext_name)) + { + $template->assign_var('S_NEXT_STEP', true); + + meta_refresh(0, $this->u_action . '&action=purge&ext_name=' . urlencode($ext_name)); + } + + $this->tpl_name = 'acp_ext_purge'; + + $template->assign_vars(array( + 'U_RETURN' => $this->u_action . '&action=list', + )); + break; + + case 'details': + // Output it to the template + $md_manager->output_template_data(); + + $template->assign_var('U_BACK', $this->u_action . '&action=list'); + + $this->tpl_name = 'acp_ext_details'; + break; + } + } + + /** + * Lists all the enabled extensions and dumps to the template + * + * @param $phpbb_extension_manager An instance of the extension manager + * @return null + */ + public function list_enabled_exts(phpbb_extension_manager $phpbb_extension_manager) + { + foreach ($phpbb_extension_manager->all_enabled() as $name => $location) + { + $md_manager = $phpbb_extension_manager->create_extension_metadata_manager($name, $this->template); + + try + { + $this->template->assign_block_vars('enabled', array( + 'META_DISPLAY_NAME' => $md_manager->get_metadata('display-name'), + + 'U_DETAILS' => $this->u_action . '&action=details&ext_name=' . urlencode($name), + )); + + $this->output_actions('enabled', array( + 'DISABLE' => $this->u_action . '&action=disable_pre&ext_name=' . urlencode($name), + 'PURGE' => $this->u_action . '&action=purge_pre&ext_name=' . urlencode($name), + )); + } + catch(phpbb_extension_exception $e) + { + $this->template->assign_block_vars('disabled', array( + 'META_DISPLAY_NAME' => $this->user->lang('EXTENSION_INVALID_LIST', $name, $e), + )); + } + } + } + + /** + * Lists all the disabled extensions and dumps to the template + * + * @param $phpbb_extension_manager An instance of the extension manager + * @return null + */ + public function list_disabled_exts(phpbb_extension_manager $phpbb_extension_manager) + { + foreach ($phpbb_extension_manager->all_disabled() as $name => $location) + { + $md_manager = $phpbb_extension_manager->create_extension_metadata_manager($name, $this->template); + + try + { + $this->template->assign_block_vars('disabled', array( + 'META_DISPLAY_NAME' => $md_manager->get_metadata('display-name'), + + 'U_DETAILS' => $this->u_action . '&action=details&ext_name=' . urlencode($name), + )); + + $this->output_actions('disabled', array( + 'ENABLE' => $this->u_action . '&action=enable_pre&ext_name=' . urlencode($name), + 'PURGE' => $this->u_action . '&action=purge_pre&ext_name=' . urlencode($name), + )); + } + catch(phpbb_extension_exception $e) + { + $this->template->assign_block_vars('disabled', array( + 'META_DISPLAY_NAME' => $this->user->lang('EXTENSION_INVALID_LIST', $name, $e), + )); + } + } + } + + /** + * Lists all the available extensions and dumps to the template + * + * @param $phpbb_extension_manager An instance of the extension manager + * @return null + */ + public function list_available_exts(phpbb_extension_manager $phpbb_extension_manager) + { + $uninstalled = array_diff_key($phpbb_extension_manager->all_available(), $phpbb_extension_manager->all_configured()); + + foreach ($uninstalled as $name => $location) + { + $md_manager = $phpbb_extension_manager->create_extension_metadata_manager($name, $this->template); + + try + { + $this->template->assign_block_vars('disabled', array( + 'META_DISPLAY_NAME' => $md_manager->get_metadata('display-name'), + + 'U_DETAILS' => $this->u_action . '&action=details&ext_name=' . urlencode($name), + )); + + $this->output_actions('disabled', array( + 'ENABLE' => $this->u_action . '&action=enable_pre&ext_name=' . urlencode($name), + )); + } + catch(phpbb_extension_exception $e) + { + $this->template->assign_block_vars('disabled', array( + 'META_DISPLAY_NAME' => $this->user->lang('EXTENSION_INVALID_LIST', $name, $e), + )); + } + } + } + + /** + * Output actions to a block + * + * @param string $block + * @param array $actions + */ + private function output_actions($block, $actions) + { + foreach ($actions as $lang => $url) + { + $this->template->assign_block_vars($block . '.actions', array( + 'L_ACTION' => $this->user->lang($lang), + 'U_ACTION' => $url, + )); + } + } +} diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 3a3b2021eb..c6dbf5eb9c 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -25,7 +25,7 @@ class acp_forums function main($id, $mode) { - global $db, $user, $auth, $template, $cache, $request; + global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher; global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx; $user->add_lang('acp/forums'); @@ -150,6 +150,17 @@ class acp_forums 'forum_password_unset' => request_var('forum_password_unset', false), ); + /** + * Request forum data and operate on it (parse texts, etc.) + * + * @event core.acp_manage_forums_request_data + * @var string action Type of the action: add|edit + * @var array forum_data Array with new forum data + * @since 3.1-A1 + */ + $vars = array('action', 'forum_data'); + extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_request_data', compact($vars))); + // On add, add empty forum_options... else do not consider it (not updating it) if ($action == 'add') { @@ -386,6 +397,9 @@ class acp_forums $forum_data['forum_flags'] += (request_var('enable_quick_reply', false)) ? FORUM_FLAG_QUICK_REPLY : 0; } + // Initialise $row, so we always have it in the event + $row = array(); + // Show form to create/modify a forum if ($action == 'edit') { @@ -453,6 +467,24 @@ class acp_forums } } + /** + * Initialise data before we display the add/edit form + * + * @event core.acp_manage_forums_initialise_data + * @var string action Type of the action: add|edit + * @var bool update Do we display the form only + * or did the user press submit + * @var int forum_id When editing: the forum id, + * when creating: the parent forum id + * @var array row Array with current forum data + * empty when creating new forum + * @var array forum_data Array with new forum data + * @var string parents_list List of parent options + * @since 3.1-A1 + */ + $vars = array('action', 'update', 'forum_id', 'row', 'forum_data', 'parents_list'); + extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_initialise_data', compact($vars))); + $forum_rules_data = array( 'text' => $forum_data['forum_rules'], 'allow_bbcode' => true, @@ -582,7 +614,7 @@ class acp_forums $errors[] = $user->lang['FORUM_PASSWORD_OLD']; } - $template->assign_vars(array( + $template_data = array( 'S_EDIT_FORUM' => true, 'S_ERROR' => (sizeof($errors)) ? true : false, 'S_PARENT_ID' => $this->parent_id, @@ -647,7 +679,31 @@ class acp_forums 'S_ENABLE_POST_REVIEW' => ($forum_data['forum_flags'] & FORUM_FLAG_POST_REVIEW) ? true : false, 'S_ENABLE_QUICK_REPLY' => ($forum_data['forum_flags'] & FORUM_FLAG_QUICK_REPLY) ? true : false, 'S_CAN_COPY_PERMISSIONS' => ($action != 'edit' || empty($forum_id) || ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth'))) ? true : false, - )); + ); + + /** + * Modify forum template data before we display the form + * + * @event core.acp_manage_forums_display_form + * @var string action Type of the action: add|edit + * @var bool update Do we display the form only + * or did the user press submit + * @var int forum_id When editing: the forum id, + * when creating: the parent forum id + * @var array row Array with current forum data + * empty when creating new forum + * @var array forum_data Array with new forum data + * @var string parents_list List of parent options + * @var array errors Array of errors, if you add errors + * ensure to update the template variables + * S_ERROR and ERROR_MSG to display it + * @var array template_data Array with new forum data + * @since 3.1-A1 + */ + $vars = array('action', 'update', 'forum_id', 'row', 'forum_data', 'parents_list', 'errors', 'template_data'); + extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_display_form', compact($vars))); + + $template->assign_vars($template_data); return; @@ -872,10 +928,22 @@ class acp_forums */ function update_forum_data(&$forum_data) { - global $db, $user, $cache, $phpbb_root_path; + global $db, $user, $cache, $phpbb_root_path, $phpbb_dispatcher; $errors = array(); + /** + * Validate the forum data before we create/update the forum + * + * @event core.acp_manage_forums_validate_data + * @var array forum_data Array with new forum data + * @var array errors Array of errors, should be strings and not + * language key. + * @since 3.1-A1 + */ + $vars = array('forum_data', 'errors'); + extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_validate_data', compact($vars))); + if ($forum_data['forum_name'] == '') { $errors[] = $user->lang['FORUM_NAME_EMPTY']; @@ -968,7 +1036,22 @@ class acp_forums } unset($forum_data_sql['forum_password_unset']); - if (!isset($forum_data_sql['forum_id'])) + /** + * Remove invalid values from forum_data_sql that should not be updated + * + * @event core.acp_manage_forums_update_data_before + * @var array forum_data Array with forum data + * @var array forum_data_sql Array with data we are going to update + * If forum_data_sql[forum_id] is set, we update + * that forum, otherwise a new one is created. + * @since 3.1-A1 + */ + $vars = array('forum_data', 'forum_data_sql'); + extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_update_data_before', compact($vars))); + + $is_new_forum = !isset($forum_data_sql['forum_id']); + + if ($is_new_forum) { // no forum_id means we're creating a new forum unset($forum_data_sql['type_action']); @@ -1239,6 +1322,22 @@ class acp_forums add_log('admin', 'LOG_FORUM_EDIT', $forum_data['forum_name']); } + /** + * Event after a forum was updated or created + * + * @event core.acp_manage_forums_update_data_after + * @var array forum_data Array with forum data + * @var array forum_data_sql Array with data we updated + * @var bool is_new_forum Did we create a forum or update one + * If you want to overwrite this value, + * ensure to set forum_data_sql[forum_id] + * @var array errors Array of errors, should be strings and not + * language key. + * @since 3.1-A1 + */ + $vars = array('forum_data', 'forum_data_sql', 'is_new_forum', 'errors'); + extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_update_data_after', compact($vars))); + return $errors; } @@ -1247,7 +1346,7 @@ class acp_forums */ function move_forum($from_id, $to_id) { - global $db, $user; + global $db, $user, $phpbb_dispatcher; $to_data = $moved_ids = $errors = array(); @@ -1259,10 +1358,30 @@ class acp_forums if ($to_data['forum_type'] == FORUM_LINK) { $errors[] = $user->lang['PARENT_IS_LINK_FORUM']; - return $errors; } } + /** + * Event when we move all children of one forum to another + * + * This event may be triggered, when a forum is deleted + * + * @event core.acp_manage_forums_move_children + * @var int from_id If of the current parent forum + * @var int to_id If of the new parent forum + * @var array errors Array of errors, should be strings and not + * language key. + * @since 3.1-A1 + */ + $vars = array('from_id', 'to_id', 'errors'); + extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_move_children', compact($vars))); + + // Return if there were errors + if (!empty($errors)) + { + return $errors; + } + $moved_forums = get_forum_branch($from_id, 'children', 'descending'); $from_data = $moved_forums[0]; $diff = sizeof($moved_forums) * 2; @@ -1342,7 +1461,30 @@ class acp_forums */ function move_forum_content($from_id, $to_id, $sync = true) { - global $db; + global $db, $phpbb_dispatcher; + + $errors = array(); + + /** + * Event when we move content from one forum to another + * + * @event core.acp_manage_forums_move_children + * @var int from_id If of the current parent forum + * @var int to_id If of the new parent forum + * @var bool sync Shall we sync the "to"-forum's data + * @var array errors Array of errors, should be strings and not + * language key. If this array is not empty, + * The content will not be moved. + * @since 3.1-A1 + */ + $vars = array('from_id', 'to_id', 'sync', 'errors'); + extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_move_content', compact($vars))); + + // Return if there were errors + if (!empty($errors)) + { + return $errors; + } $table_ary = array(LOG_TABLE, POSTS_TABLE, TOPICS_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE); diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index 607254adb5..b604e20094 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -26,6 +26,7 @@ class acp_groups { global $config, $db, $user, $auth, $template, $cache; global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads; + global $request; $user->add_lang('acp/groups'); $this->tpl_name = 'acp_groups'; @@ -323,7 +324,8 @@ class acp_groups $submit_ary['founder_manage'] = isset($_REQUEST['group_founder_manage']) ? 1 : 0; } - if (!empty($_FILES['uploadfile']['tmp_name']) || $data['uploadurl'] || $data['remotelink']) + $uploadfile = $request->file('uploadfile'); + if (!empty($uploadfile['tmp_name']) || $data['uploadurl'] || $data['remotelink']) { // Avatar stuff $var_ary = array( @@ -337,7 +339,7 @@ class acp_groups { $data['user_id'] = "g$group_id"; - if ((!empty($_FILES['uploadfile']['tmp_name']) || $data['uploadurl']) && $can_upload) + if ((!empty($uploadfile['tmp_name']) || $data['uploadurl']) && $can_upload) { list($submit_ary['avatar_type'], $submit_ary['avatar'], $submit_ary['avatar_width'], $submit_ary['avatar_height']) = avatar_upload($data, $error); } @@ -682,13 +684,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", diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index bfe17c5007..db4b4263b0 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -928,9 +928,7 @@ 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); } /** diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php index 78d6a0b2f3..e61115f681 100644 --- a/phpBB/includes/acp/acp_inactive.php +++ b/phpBB/includes/acp/acp_inactive.php @@ -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 @@ -153,12 +155,11 @@ class acp_inactive trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); } - foreach ($mark as $user_id) - { - user_delete('retain', $user_id, $user_affected[$user_id]); - } + user_delete('retain', $mark, true); 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 +231,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 +285,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 +295,7 @@ 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", diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index 2b19f93c75..2be1ccfc41 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -100,11 +100,25 @@ class acp_language switch ($method) { case 'ftp': - $transfer = new ftp(request_var('host', ''), request_var('username', ''), request_var('password', ''), request_var('root_path', ''), request_var('port', ''), request_var('timeout', '')); + $transfer = new ftp( + request_var('host', ''), + request_var('username', ''), + htmlspecialchars_decode($request->untrimmed_variable('password', '')), + request_var('root_path', ''), + request_var('port', ''), + request_var('timeout', '') + ); break; case 'ftp_fsock': - $transfer = new ftp_fsock(request_var('host', ''), request_var('username', ''), request_var('password', ''), request_var('root_path', ''), request_var('port', ''), request_var('timeout', '')); + $transfer = new ftp_fsock( + request_var('host', ''), + request_var('username', ''), + htmlspecialchars_decode($request->untrimmed_variable('password', '')), + request_var('root_path', ''), + request_var('port', ''), + request_var('timeout', '') + ); break; default: @@ -404,7 +418,14 @@ class acp_language trigger_error($user->lang['INVALID_UPLOAD_METHOD'], E_USER_ERROR); } - $transfer = new $method(request_var('host', ''), request_var('username', ''), request_var('password', ''), request_var('root_path', ''), request_var('port', ''), request_var('timeout', '')); + $transfer = new $method( + request_var('host', ''), + request_var('username', ''), + htmlspecialchars_decode($request->untrimmed_variable('password', '')), + request_var('root_path', ''), + request_var('port', ''), + request_var('timeout', '') + ); if (($result = $transfer->open_session()) !== true) { diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php index 6b67175220..d86521532c 100644 --- a/phpBB/includes/acp/acp_logs.php +++ b/phpBB/includes/acp/acp_logs.php @@ -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, diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index eb613535bf..d419bc3b99 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -426,7 +426,7 @@ class acp_main // Version check $user->add_lang('install'); - if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.3.2', '<')) + if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.3.3', '<')) { $template->assign_vars(array( 'S_PHP_VERSION_OLD' => true, diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index d728744c04..dd071074de 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -497,7 +497,7 @@ class acp_permissions $template->assign_vars(array( 'S_FORUM_NAMES' => (sizeof($forum_names)) ? true : false, - 'FORUM_NAMES' => implode(', ', $forum_names)) + 'FORUM_NAMES' => implode($user->lang['COMMA_SEPARATOR'], $forum_names)) ); } diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index 3ffffd3047..849160f1fa 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -383,6 +383,7 @@ class acp_profile $field_row = array_merge($default_values[$field_type], array( 'field_ident' => str_replace(' ', '_', utf8_clean_string(request_var('field_ident', '', true))), 'field_required' => 0, + 'field_show_novalue'=> 0, 'field_hide' => 0, 'field_show_profile'=> 0, 'field_no_view' => 0, @@ -399,7 +400,7 @@ class acp_profile // $exclude contains the data we gather in each step $exclude = array( - 1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_pm', 'field_show_on_vt', 'field_required', 'field_hide', 'field_show_profile', 'field_no_view'), + 1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_pm', 'field_show_on_vt', 'field_required', 'field_show_novalue', 'field_hide', 'field_show_profile', 'field_no_view'), 2 => array('field_length', 'field_maxlen', 'field_minlen', 'field_validation', 'field_novalue', 'field_default_value'), 3 => array('l_lang_name', 'l_lang_explain', 'l_lang_default_value', 'l_lang_options') ); @@ -424,6 +425,7 @@ class acp_profile // Visibility Options... $visibility_ary = array( 'field_required', + 'field_show_novalue', 'field_show_on_reg', 'field_show_on_pm', 'field_show_on_vt', @@ -779,6 +781,7 @@ class acp_profile $template->assign_vars(array( 'S_STEP_ONE' => true, 'S_FIELD_REQUIRED' => ($cp->vars['field_required']) ? true : false, + 'S_FIELD_SHOW_NOVALUE'=> ($cp->vars['field_show_novalue']) ? true : false, 'S_SHOW_ON_REG' => ($cp->vars['field_show_on_reg']) ? true : false, 'S_SHOW_ON_PM' => ($cp->vars['field_show_on_pm']) ? true : false, 'S_SHOW_ON_VT' => ($cp->vars['field_show_on_vt']) ? true : false, @@ -1096,6 +1099,7 @@ class acp_profile 'field_default_value' => $cp->vars['field_default_value'], 'field_validation' => $cp->vars['field_validation'], 'field_required' => $cp->vars['field_required'], + 'field_show_novalue' => $cp->vars['field_show_novalue'], 'field_show_on_reg' => $cp->vars['field_show_on_reg'], 'field_show_on_pm' => $cp->vars['field_show_on_pm'], 'field_show_on_vt' => $cp->vars['field_show_on_vt'], diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php index 240e3596ba..a5dc02849a 100644 --- a/phpBB/includes/acp/acp_prune.php +++ b/phpBB/includes/acp/acp_prune.php @@ -242,8 +242,8 @@ class acp_prune if (confirm_box(true)) { $user_ids = $usernames = array(); - $this->get_prune_users($user_ids, $usernames); + $this->get_prune_users($user_ids, $usernames); if (sizeof($user_ids)) { if ($action == 'deactivate') @@ -255,19 +255,13 @@ class acp_prune { if ($deleteposts) { - foreach ($user_ids as $user_id) - { - user_delete('remove', $user_id); - } + user_delete('remove', $user_ids); $l_log = 'LOG_PRUNE_USER_DEL_DEL'; } else { - foreach ($user_ids as $user_id) - { - user_delete('retain', $user_id, $usernames[$user_id]); - } + user_delete('retain', $user_ids, true); $l_log = 'LOG_PRUNE_USER_DEL_ANON'; } @@ -299,6 +293,7 @@ class acp_prune { $template->assign_block_vars('users', array( 'USERNAME' => $usernames[$user_id], + 'USER_ID' => $user_id, 'U_PROFILE' => append_sid($phpbb_root_path . 'memberlist.' . $phpEx, 'mode=viewprofile&u=' . $user_id), 'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&mode=overview&u=' . $user_id, true, $user->session_id) : '', )); @@ -314,17 +309,7 @@ class acp_prune 'mode' => $mode, 'prune' => 1, - 'users' => utf8_normalize_nfc(request_var('users', '', true)), - 'username' => utf8_normalize_nfc(request_var('username', '', true)), - 'email' => request_var('email', ''), - 'joined_select' => request_var('joined_select', ''), - 'joined' => request_var('joined', ''), - 'active_select' => request_var('active_select', ''), - 'active' => request_var('active', ''), - 'count_select' => request_var('count_select', ''), - 'count' => request_var('count', ''), 'deleteposts' => request_var('deleteposts', 0), - 'action' => request_var('action', ''), )), 'confirm_body_prune.html'); } @@ -340,22 +325,29 @@ class acp_prune } $find_time = array('lt' => $user->lang['BEFORE'], 'gt' => $user->lang['AFTER']); - $s_find_join_time = ''; - foreach ($find_time as $key => $value) - { - $s_find_join_time .= '<option value="' . $key . '">' . $value . '</option>'; - } - $s_find_active_time = ''; foreach ($find_time as $key => $value) { $s_find_active_time .= '<option value="' . $key . '">' . $value . '</option>'; } + $s_group_list = ''; + $sql = 'SELECT group_id, group_name + FROM ' . GROUPS_TABLE . ' + WHERE group_type <> ' . GROUP_SPECIAL . ' + ORDER BY group_name ASC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $s_group_list .= '<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</select>'; + } + $db->sql_freeresult($result); + $template->assign_vars(array( 'U_ACTION' => $this->u_action, - 'S_JOINED_OPTIONS' => $s_find_join_time, 'S_ACTIVE_OPTIONS' => $s_find_active_time, + 'S_GROUP_LIST' => $s_group_list, 'S_COUNT_OPTIONS' => $s_find_count, 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=acp_prune&field=users'), )); @@ -368,33 +360,70 @@ class acp_prune { global $user, $db; - $users = utf8_normalize_nfc(request_var('users', '', true)); - - if ($users) + $users_by_name = request_var('users', '', true); + $users_by_id = request_var('user_ids', array(0)); + $group_id = request_var('group_id', 0); + $posts_on_queue = request_var('posts_on_queue', 0); + + if ($users_by_name) { - $users = explode("\n", $users); + $users = explode("\n", $users_by_name); $where_sql = ' AND ' . $db->sql_in_set('username_clean', array_map('utf8_clean_string', $users)); } + else if (!empty($users_by_id)) + { + $user_ids = $users_by_id; + user_get_id_name($user_ids, $usernames); + + $where_sql = ' AND ' . $db->sql_in_set('user_id', $user_ids); + } else { - $username = utf8_normalize_nfc(request_var('username', '', true)); + $username = request_var('username', '', true); $email = request_var('email', ''); + $website = request_var('website', ''); - $joined_select = request_var('joined_select', 'lt'); $active_select = request_var('active_select', 'lt'); $count_select = request_var('count_select', 'eq'); - $joined = request_var('joined', ''); + $queue_select = request_var('queue_select', 'gt'); + $joined_before = request_var('joined_before', ''); + $joined_after = request_var('joined_after', ''); $active = request_var('active', ''); + $count = request_var('count', 0); + $active = ($active) ? explode('-', $active) : array(); - $joined = ($joined) ? explode('-', $joined) : array(); + $joined_before = ($joined_before) ? explode('-', $joined_before) : array(); + $joined_after = ($joined_after) ? explode('-', $joined_after) : array(); - if ((sizeof($active) && sizeof($active) != 3) || (sizeof($joined) && sizeof($joined) != 3)) + // calculate the conditions required by the join time criteria + $joined_sql = ''; + if (!empty($joined_before) && !empty($joined_after)) { - trigger_error($user->lang['WRONG_ACTIVE_JOINED_DATE'] . adm_back_link($this->u_action), E_USER_WARNING); + // if the two entered dates are equal, we need to adjust + // so that our time range is a full day instead of 1 second + if ($joined_after == $joined_before) + { + $joined_after[2] += 1; + } + + $joined_sql = ' AND user_regdate BETWEEN ' . gmmktime(0, 0, 0, (int) $joined_after[1], (int) $joined_after[2], (int) $joined_after[0]) . + ' AND ' . gmmktime(0, 0, 0, (int) $joined_before[1], (int) $joined_before[2], (int) $joined_before[0]); } + else if (empty($joined_before) && !empty($joined_after)) + { + $joined_sql = ' AND user_regdate > ' . gmmktime(0, 0, 0, (int) $joined_after[1], (int) $joined_after[2], (int) $joined_after[0]); + } + else if (empty($joined_after) && !empty($joined_before)) + { + $joined_sql = ' AND user_regdate < ' . gmmktime(0, 0, 0, (int) $joined_before[1], (int) $joined_before[2], (int) $joined_before[0]); + } + // implicit else when both arrays are empty do nothing - $count = request_var('count', ''); + if ((sizeof($active) && sizeof($active) != 3) || (sizeof($joined_before) && sizeof($joined_before) != 3) || (sizeof($joined_after) && sizeof($joined_after) != 3)) + { + trigger_error($user->lang['WRONG_ACTIVE_JOINED_DATE'] . adm_back_link($this->u_action), E_USER_WARNING); + } $key_match = array('lt' => '<', 'gt' => '>', 'eq' => '='); $sort_by_types = array('username', 'user_email', 'user_posts', 'user_regdate', 'user_lastvisit'); @@ -402,8 +431,9 @@ class acp_prune $where_sql = ''; $where_sql .= ($username) ? ' AND username_clean ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($username))) : ''; $where_sql .= ($email) ? ' AND user_email ' . $db->sql_like_expression(str_replace('*', $db->any_char, $email)) . ' ' : ''; - $where_sql .= (sizeof($joined)) ? " AND user_regdate " . $key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, (int) $joined[1], (int) $joined[2], (int) $joined[0]) : ''; - $where_sql .= ($count !== '') ? " AND user_posts " . $key_match[$count_select] . ' ' . (int) $count . ' ' : ''; + $where_sql .= ($website) ? ' AND user_website ' . $db->sql_like_expression(str_replace('*', $db->any_char, $website)) . ' ' : ''; + $where_sql .= $joined_sql; + $where_sql .= ($count) ? " AND user_posts " . $key_match[$count_select] . ' ' . (int) $count . ' ' : ''; // First handle pruning of users who never logged in, last active date is 0000-00-00 if (sizeof($active) && (int) $active[0] == 0 && (int) $active[1] == 0 && (int) $active[2] == 0) @@ -446,7 +476,6 @@ class acp_prune $where_sql"; $result = $db->sql_query($sql); - $where_sql = ''; $user_ids = $usernames = array(); while ($row = $db->sql_fetchrow($result)) @@ -459,5 +488,53 @@ class acp_prune } } $db->sql_freeresult($result); + + if ($group_id) + { + $sql = 'SELECT user_id + FROM ' . USER_GROUP_TABLE . ' + WHERE group_id = ' . (int) $group_id . ' + AND user_pending = 0 + AND ' . $db->sql_in_set('user_id', $user_ids, false, true); + $result = $db->sql_query($sql); + + // we're performing an intersection operation, so all the relevant users + // come from this most recent query (which was limited to the results of the + // previous query) + $user_ids = $usernames = array(); + while ($row = $db->sql_fetchrow($result)) + { + $user_ids[] = $row['poster_id']; + } + $db->sql_freeresult($result); + + // only get usernames if they are needed (not part of some later query) + if (!$posts_on_queue) + { + // this is an additional query aginst the users table + user_get_id_name($user_ids, $usernames); + } + } + + if ($posts_on_queue) + { + $sql = 'SELECT poster_id, COUNT(post_id) AS queue_posts + FROM ' . POSTS_TABLE . ' + WHERE ' . $db->sql_in_set('poster_id', $user_ids, false, true) . ' + GROUP BY poster_id + HAVING queue_posts ' . $key_match[$queue_select] . ' ' . $posts_on_queue; + $result = $db->sql_query($result); + + // same intersection logic as the above group ID portion + $user_ids = $usernames = array(); + while ($row = $db->sql_fetchrow($result)) + { + $user_ids[] = $row['poster_id']; + } + $db->sql_freeresult($result); + + // do an additional query to get the correct set of usernames + user_get_id_name($user_ids, $usernames); + } } } diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php index 479fcfba81..71e9108c2c 100644 --- a/phpBB/includes/acp/acp_reasons.php +++ b/phpBB/includes/acp/acp_reasons.php @@ -113,7 +113,7 @@ class acp_reasons $result = $db->sql_query($sql); $max_order = (int) $db->sql_fetchfield('max_reason_order'); $db->sql_freeresult($result); - + $sql_ary = array( 'reason_title' => (string) $reason_row['reason_title'], 'reason_description' => (string) $reason_row['reason_description'], @@ -171,14 +171,14 @@ class acp_reasons 'U_ACTION' => $this->u_action . "&id=$reason_id&action=$action", 'U_BACK' => $this->u_action, 'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '', - + 'REASON_TITLE' => $reason_row['reason_title'], 'REASON_DESCRIPTION' => $reason_row['reason_description'], 'TRANSLATED_TITLE' => ($translated) ? $user->lang['report_reasons']['TITLE'][strtoupper($reason_row['reason_title'])] : '', 'TRANSLATED_DESCRIPTION'=> ($translated) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason_row['reason_title'])] : '', - 'S_AVAILABLE_TITLES' => implode(', ', array_map('htmlspecialchars', array_keys($user->lang['report_reasons']['TITLE']))), + 'S_AVAILABLE_TITLES' => implode($user->lang['COMMA_SEPARATOR'], array_map('htmlspecialchars', array_keys($user->lang['report_reasons']['TITLE']))), 'S_EDIT_REASON' => true, 'S_TRANSLATED' => $translated, 'S_ERROR' => (sizeof($error)) ? true : false, @@ -303,7 +303,7 @@ class acp_reasons do { ++$order; - + if ($row['reason_order'] != $order) { $sql = 'UPDATE ' . REPORTS_REASONS_TABLE . " diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php index 54a3e7aaa1..6618e2c3f9 100644 --- a/phpBB/includes/acp/acp_search.php +++ b/phpBB/includes/acp/acp_search.php @@ -596,16 +596,16 @@ class acp_search */ function init_search($type, &$search, &$error) { - global $phpbb_root_path, $phpEx, $user; + global $phpbb_root_path, $phpEx, $user, $auth, $config, $db; - if (!class_exists($type) || !method_exists($type, 'get_name')) + if (!class_exists($type) || !method_exists($type, 'keyword_search')) { $error = $user->lang['NO_SUCH_SEARCH_MODULE']; return $error; } $error = false; - $search = new $type($error); + $search = new $type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user); return $error; } diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 943bfe6a6f..db77825ae7 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -36,7 +36,7 @@ class acp_styles protected $cache; protected $auth; protected $phpbb_root_path; - protected $phpEx; + protected $php_ext; public function main($id, $mode) { @@ -50,12 +50,12 @@ class acp_styles $this->auth = $auth; $this->config = $config; $this->phpbb_root_path = $phpbb_root_path; - $this->phpEx = $phpEx; + $this->php_ext = $phpEx; $this->default_style = $config['default_style']; $this->styles_path = $this->phpbb_root_path . $this->styles_path_absolute . '/'; - $this->u_base_action = append_sid("{$phpbb_admin_path}index.$phpEx", "i={$id}"); + $this->u_base_action = append_sid("{$phpbb_admin_path}index.{$this->php_ext}", "i={$id}"); $this->s_hidden_fields = array( 'mode' => $mode, ); @@ -939,7 +939,7 @@ class acp_styles // Preview $actions[] = array( - 'U_ACTION' => append_sid($this->phpbb_root_path . 'index.' . $this->phpEx, 'style=' . $style['style_id']), + 'U_ACTION' => append_sid($this->phpbb_root_path . 'index.' . $this->php_ext, 'style=' . $style['style_id']), 'L_ACTION' => $this->user->lang['PREVIEW'] ); } diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 17687b05c7..82d8ef5cbb 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -32,6 +32,7 @@ class acp_users { global $config, $db, $user, $auth, $template, $cache; global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads; + global $phpbb_dispatcher, $request; $user->add_lang(array('posting', 'ucp', 'acp/users')); $this->tpl_name = 'acp_users'; @@ -749,6 +750,19 @@ class acp_users } break; + + default: + /** + * Run custom quicktool code + * + * @event core.acp_users_overview_run_quicktool + * @var array user_row Current user data + * @var string action Quick tool that should be run + * @since 3.1-A1 + */ + $vars = array('action', 'user_row'); + extract($phpbb_dispatcher->trigger_event('core.acp_users_overview_run_quicktool', compact($vars))); + break; } // Handle registration info updates @@ -756,8 +770,8 @@ class acp_users 'username' => utf8_normalize_nfc(request_var('user', $user_row['username'], true)), 'user_founder' => request_var('user_founder', ($user_row['user_type'] == USER_FOUNDER) ? 1 : 0), 'email' => strtolower(request_var('user_email', $user_row['user_email'])), - 'new_password' => request_var('new_password', '', true), - 'password_confirm' => request_var('password_confirm', '', true), + 'new_password' => $request->variable('new_password', '', true), + 'password_confirm' => $request->variable('password_confirm', '', true), ); // Validation data - we do not check the password complexity setting here @@ -855,6 +869,18 @@ class acp_users } } + /** + * Modify user data before we update it + * + * @event core.acp_users_overview_modify_data + * @var array user_row Current user data + * @var array data Submitted user data + * @var array sql_ary User data we udpate + * @since 3.1-A1 + */ + $vars = array('user_row', 'data', 'sql_ary'); + extract($phpbb_dispatcher->trigger_event('core.acp_users_overview_modify_data', compact($vars))); + if ($update_username !== false) { $sql_ary['username'] = $update_username; @@ -945,12 +971,6 @@ class acp_users } } - $s_action_options = '<option class="sep" value="">' . $user->lang['SELECT_OPTION'] . '</option>'; - foreach ($quick_tool_ary as $value => $lang) - { - $s_action_options .= '<option value="' . $value . '">' . $user->lang['USER_ADMIN_' . $lang] . '</option>'; - } - if ($config['load_onlinetrack']) { $sql = 'SELECT MAX(session_time) AS session_time, MIN(session_viewonline) AS session_viewonline @@ -965,6 +985,23 @@ class acp_users unset($row); } + /** + * Add additional quick tool options and overwrite user data + * + * @event core.acp_users_display_overview + * @var array user_row Array with user data + * @var array quick_tool_ary Ouick tool options + * @since 3.1-A1 + */ + $vars = array('user_row', 'quick_tool_ary'); + extract($phpbb_dispatcher->trigger_event('core.acp_users_display_overview', compact($vars))); + + $s_action_options = '<option class="sep" value="">' . $user->lang['SELECT_OPTION'] . '</option>'; + foreach ($quick_tool_ary as $value => $lang) + { + $s_action_options .= '<option value="' . $value . '">' . $user->lang['USER_ADMIN_' . $lang] . '</option>'; + } + $last_visit = (!empty($user_row['session_time'])) ? $user_row['session_time'] : $user_row['user_lastvisit']; $inactive_reason = ''; @@ -1120,10 +1157,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, @@ -1458,9 +1497,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']), @@ -1495,7 +1533,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), @@ -1531,7 +1569,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'], @@ -1641,6 +1678,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, @@ -1654,7 +1692,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'], @@ -1681,7 +1718,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'], ) ); @@ -1942,7 +1980,7 @@ class acp_users $message = (sizeof($log_attachments) == 1) ? $user->lang['ATTACHMENT_DELETED'] : $user->lang['ATTACHMENTS_DELETED']; - add_log('admin', 'LOG_ATTACHMENTS_DELETED', implode(', ', $log_attachments)); + add_log('admin', 'LOG_ATTACHMENTS_DELETED', implode($user->lang['COMMA_SEPARATOR'], $log_attachments)); trigger_error($message . adm_back_link($this->u_action . '&u=' . $user_id)); } else @@ -2035,14 +2073,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; diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index 7d9fd267ff..6b1da46a12 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -529,8 +529,8 @@ class auth_admin extends phpbb_auth 'NAME' => $ug_name, 'CATEGORIES' => implode('</th><th>', $categories), - 'USER_GROUPS_DEFAULT' => ($user_mode == 'user' && isset($user_groups_default[$ug_id]) && sizeof($user_groups_default[$ug_id])) ? implode(', ', $user_groups_default[$ug_id]) : '', - 'USER_GROUPS_CUSTOM' => ($user_mode == 'user' && isset($user_groups_custom[$ug_id]) && sizeof($user_groups_custom[$ug_id])) ? implode(', ', $user_groups_custom[$ug_id]) : '', + 'USER_GROUPS_DEFAULT' => ($user_mode == 'user' && isset($user_groups_default[$ug_id]) && sizeof($user_groups_default[$ug_id])) ? implode($user->lang['COMMA_SEPARATOR'], $user_groups_default[$ug_id]) : '', + 'USER_GROUPS_CUSTOM' => ($user_mode == 'user' && isset($user_groups_custom[$ug_id]) && sizeof($user_groups_custom[$ug_id])) ? implode($user->lang['COMMA_SEPARATOR'], $user_groups_custom[$ug_id]) : '', 'L_ACL_TYPE' => $l_acl_type, 'S_LOCAL' => ($local) ? true : false, diff --git a/phpBB/includes/acp/info/acp_extensions.php b/phpBB/includes/acp/info/acp_extensions.php new file mode 100644 index 0000000000..f5953fb1dd --- /dev/null +++ b/phpBB/includes/acp/info/acp_extensions.php @@ -0,0 +1,34 @@ +<?php +/** +* +* @package acp +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @package module_install +*/ +class acp_extensions_info +{ + function module() + { + return array( + 'filename' => 'acp_extensions', + 'title' => 'ACP_EXTENSIONS', + 'version' => '1.0.0', + 'modes' => array( + 'main' => array('title' => 'ACP_EXTENSIONS', 'auth' => 'acl_a_extensions', 'cat' => array('ACP_GENERAL_TASKS')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} diff --git a/phpBB/includes/auth/auth_db.php b/phpBB/includes/auth/auth_db.php index 76790e4dad..ac944532a5 100644 --- a/phpBB/includes/auth/auth_db.php +++ b/phpBB/includes/auth/auth_db.php @@ -41,6 +41,10 @@ function login_db($username, $password, $ip = '', $browser = '', $forwarded_for global $db, $config; global $request; + // Auth plugins get the password untrimmed. + // For compatibility we trim() here. + $password = trim($password); + // do not allow empty password if (!$password) { diff --git a/phpBB/includes/auth/auth_ldap.php b/phpBB/includes/auth/auth_ldap.php index 26029efe1e..24823f9ce7 100644 --- a/phpBB/includes/auth/auth_ldap.php +++ b/phpBB/includes/auth/auth_ldap.php @@ -309,35 +309,35 @@ function acp_ldap(&$new) $tpl = ' <dl> - <dt><label for="ldap_server">' . $user->lang['LDAP_SERVER'] . ':</label><br /><span>' . $user->lang['LDAP_SERVER_EXPLAIN'] . '</span></dt> + <dt><label for="ldap_server">' . $user->lang['LDAP_SERVER'] . $user->lang['COLON'] . '</label><br /><span>' . $user->lang['LDAP_SERVER_EXPLAIN'] . '</span></dt> <dd><input type="text" id="ldap_server" size="40" name="config[ldap_server]" value="' . $new['ldap_server'] . '" /></dd> </dl> <dl> - <dt><label for="ldap_port">' . $user->lang['LDAP_PORT'] . ':</label><br /><span>' . $user->lang['LDAP_PORT_EXPLAIN'] . '</span></dt> + <dt><label for="ldap_port">' . $user->lang['LDAP_PORT'] . $user->lang['COLON'] . '</label><br /><span>' . $user->lang['LDAP_PORT_EXPLAIN'] . '</span></dt> <dd><input type="text" id="ldap_port" size="40" name="config[ldap_port]" value="' . $new['ldap_port'] . '" /></dd> </dl> <dl> - <dt><label for="ldap_dn">' . $user->lang['LDAP_DN'] . ':</label><br /><span>' . $user->lang['LDAP_DN_EXPLAIN'] . '</span></dt> + <dt><label for="ldap_dn">' . $user->lang['LDAP_DN'] . $user->lang['COLON'] . '</label><br /><span>' . $user->lang['LDAP_DN_EXPLAIN'] . '</span></dt> <dd><input type="text" id="ldap_dn" size="40" name="config[ldap_base_dn]" value="' . $new['ldap_base_dn'] . '" /></dd> </dl> <dl> - <dt><label for="ldap_uid">' . $user->lang['LDAP_UID'] . ':</label><br /><span>' . $user->lang['LDAP_UID_EXPLAIN'] . '</span></dt> + <dt><label for="ldap_uid">' . $user->lang['LDAP_UID'] . $user->lang['COLON'] . '</label><br /><span>' . $user->lang['LDAP_UID_EXPLAIN'] . '</span></dt> <dd><input type="text" id="ldap_uid" size="40" name="config[ldap_uid]" value="' . $new['ldap_uid'] . '" /></dd> </dl> <dl> - <dt><label for="ldap_user_filter">' . $user->lang['LDAP_USER_FILTER'] . ':</label><br /><span>' . $user->lang['LDAP_USER_FILTER_EXPLAIN'] . '</span></dt> + <dt><label for="ldap_user_filter">' . $user->lang['LDAP_USER_FILTER'] . $user->lang['COLON'] . '</label><br /><span>' . $user->lang['LDAP_USER_FILTER_EXPLAIN'] . '</span></dt> <dd><input type="text" id="ldap_user_filter" size="40" name="config[ldap_user_filter]" value="' . $new['ldap_user_filter'] . '" /></dd> </dl> <dl> - <dt><label for="ldap_email">' . $user->lang['LDAP_EMAIL'] . ':</label><br /><span>' . $user->lang['LDAP_EMAIL_EXPLAIN'] . '</span></dt> + <dt><label for="ldap_email">' . $user->lang['LDAP_EMAIL'] . $user->lang['COLON'] . '</label><br /><span>' . $user->lang['LDAP_EMAIL_EXPLAIN'] . '</span></dt> <dd><input type="text" id="ldap_email" size="40" name="config[ldap_email]" value="' . $new['ldap_email'] . '" /></dd> </dl> <dl> - <dt><label for="ldap_user">' . $user->lang['LDAP_USER'] . ':</label><br /><span>' . $user->lang['LDAP_USER_EXPLAIN'] . '</span></dt> + <dt><label for="ldap_user">' . $user->lang['LDAP_USER'] . $user->lang['COLON'] . '</label><br /><span>' . $user->lang['LDAP_USER_EXPLAIN'] . '</span></dt> <dd><input type="text" id="ldap_user" size="40" name="config[ldap_user]" value="' . $new['ldap_user'] . '" /></dd> </dl> <dl> - <dt><label for="ldap_password">' . $user->lang['LDAP_PASSWORD'] . ':</label><br /><span>' . $user->lang['LDAP_PASSWORD_EXPLAIN'] . '</span></dt> + <dt><label for="ldap_password">' . $user->lang['LDAP_PASSWORD'] . $user->lang['COLON'] . '</label><br /><span>' . $user->lang['LDAP_PASSWORD_EXPLAIN'] . '</span></dt> <dd><input type="password" id="ldap_password" size="40" name="config[ldap_password]" value="' . $new['ldap_password'] . '" autocomplete="off" /></dd> </dl> '; diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index 444446e9c3..b9ffa8091c 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -134,7 +134,7 @@ class bbcode $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_template($phpbb_root_path, $phpEx, $config, $user, $style_resource_locator); + $template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $style_resource_locator, new phpbb_template_context()); $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')); diff --git a/phpBB/includes/cache/driver/apc.php b/phpBB/includes/cache/driver/apc.php index dc0144fac3..0516b669c8 100644 --- a/phpBB/includes/cache/driver/apc.php +++ b/phpBB/includes/cache/driver/apc.php @@ -26,7 +26,7 @@ class phpbb_cache_driver_apc extends phpbb_cache_driver_memory /** * Purge cache data * - * @return void + * @return null */ function purge() { diff --git a/phpBB/includes/cache/driver/eaccelerator.php b/phpBB/includes/cache/driver/eaccelerator.php index 7939f043c9..257b90c76e 100644 --- a/phpBB/includes/cache/driver/eaccelerator.php +++ b/phpBB/includes/cache/driver/eaccelerator.php @@ -30,7 +30,7 @@ class phpbb_cache_driver_eaccelerator extends phpbb_cache_driver_memory /** * Purge cache data * - * @return void + * @return null */ function purge() { @@ -47,7 +47,7 @@ class phpbb_cache_driver_eaccelerator extends phpbb_cache_driver_memory /** * Perform cache garbage collection * - * @return void + * @return null */ function tidy() { diff --git a/phpBB/includes/cache/driver/file.php b/phpBB/includes/cache/driver/file.php index 0d3b06f621..691abe0438 100644 --- a/phpBB/includes/cache/driver/file.php +++ b/phpBB/includes/cache/driver/file.php @@ -214,7 +214,12 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base while (($entry = readdir($dir)) !== false) { - if (strpos($entry, 'sql_') !== 0 && strpos($entry, 'data_') !== 0 && strpos($entry, 'ctpl_') !== 0 && strpos($entry, 'tpl_') !== 0) + if (strpos($entry, 'container_') !== 0 && + strpos($entry, 'url_matcher') !== 0 && + strpos($entry, 'sql_') !== 0 && + strpos($entry, 'data_') !== 0 && + strpos($entry, 'ctpl_') !== 0 && + strpos($entry, 'tpl_') !== 0) { continue; } @@ -364,7 +369,7 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base /** * Save sql query */ - function sql_save($query, &$query_result, $ttl) + function sql_save($query, $query_result, $ttl) { global $db; @@ -383,8 +388,10 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base if ($this->_write('sql_' . md5($query), $this->sql_rowset[$query_id], $ttl + time(), $query)) { - $query_result = $query_id; + return $query_id; } + + return $query_result; } /** @@ -646,10 +653,11 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base $file = "{$this->cache_dir}$filename.$phpEx"; + $lock = new phpbb_lock_flock($file); + $lock->acquire(); + if ($handle = @fopen($file, 'wb')) { - @flock($handle, LOCK_EX); - // File header fwrite($handle, '<' . '?php exit; ?' . '>'); @@ -690,7 +698,6 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base fwrite($handle, $data); } - @flock($handle, LOCK_UN); fclose($handle); if (!function_exists('phpbb_chmod')) @@ -701,10 +708,16 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base phpbb_chmod($file, CHMOD_READ | CHMOD_WRITE); - return true; + $return_value = true; + } + else + { + $return_value = false; } - return false; + $lock->release(); + + return $return_value; } /** diff --git a/phpBB/includes/cache/driver/interface.php b/phpBB/includes/cache/driver/interface.php index 313a2d4b31..d403bbcd71 100644 --- a/phpBB/includes/cache/driver/interface.php +++ b/phpBB/includes/cache/driver/interface.php @@ -63,42 +63,81 @@ interface phpbb_cache_driver_interface public function destroy($var_name, $table = ''); /** - * Check if a given cache entry exist + * Check if a given cache entry exists */ public function _exists($var_name); /** - * Load cached sql query + * Load result of an SQL query from cache. + * + * @param string $query SQL query + * + * @return int|bool Query ID (integer) if cache contains a rowset + * for the specified query. + * False otherwise. */ public function sql_load($query); /** - * Save sql query + * Save result of an SQL query in cache. + * + * In persistent cache stores, this function stores the query + * result to persistent storage. In other words, there is no need + * to call save() afterwards. + * + * @param string $query SQL query, should be used for generating storage key + * @param mixed $query_result The result from dbal::sql_query, to be passed to + * dbal::sql_fetchrow to get all rows and store them + * in cache. + * @param int $ttl Time to live, after this timeout the query should + * expire from the cache. + * @return int|mixed If storing in cache succeeded, an integer $query_id + * representing the query should be returned. Otherwise + * the original $query_result should be returned. */ - public function sql_save($query, &$query_result, $ttl); + public function sql_save($query, $query_result, $ttl); /** - * Ceck if a given sql query exist in cache + * Check if result for a given SQL query exists in cache. + * + * @param int $query_id + * @return bool */ public function sql_exists($query_id); /** * Fetch row from cache (database) + * + * @param int $query_id + * @return array|bool The query result if found in the cache, otherwise + * false. */ public function sql_fetchrow($query_id); /** * Fetch a field from the current row of a cached database result (database) + * + * @param int $query_id + * @param $field The name of the column. + * @return string|bool The field of the query result if found in the cache, + * otherwise false. */ public function sql_fetchfield($query_id, $field); /** * Seek a specific row in an a cached database result (database) + * + * @param int $rownum Row to seek to. + * @param int $query_id + * @return bool */ public function sql_rowseek($rownum, $query_id); /** * Free memory used for a cached database result (database) + * + * @param int $query_id + * @return bool */ public function sql_freeresult($query_id); } diff --git a/phpBB/includes/cache/driver/memcache.php b/phpBB/includes/cache/driver/memcache.php index 9fe70f8b44..3fd16b23b0 100644 --- a/phpBB/includes/cache/driver/memcache.php +++ b/phpBB/includes/cache/driver/memcache.php @@ -64,7 +64,7 @@ class phpbb_cache_driver_memcache extends phpbb_cache_driver_memory /** * Unload the cache resources * - * @return void + * @return null */ function unload() { @@ -76,7 +76,7 @@ class phpbb_cache_driver_memcache extends phpbb_cache_driver_memory /** * Purge cache data * - * @return void + * @return null */ function purge() { diff --git a/phpBB/includes/cache/driver/memory.php b/phpBB/includes/cache/driver/memory.php index e25c9229a1..c39f9f7850 100644 --- a/phpBB/includes/cache/driver/memory.php +++ b/phpBB/includes/cache/driver/memory.php @@ -19,7 +19,7 @@ if (!defined('IN_PHPBB')) * ACM Abstract Memory Class * @package acm */ -class phpbb_cache_driver_memory extends phpbb_cache_driver_base +abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base { var $key_prefix; @@ -162,7 +162,12 @@ class phpbb_cache_driver_memory extends phpbb_cache_driver_base while (($entry = readdir($dir)) !== false) { - if (strpos($entry, 'sql_') !== 0 && strpos($entry, 'data_') !== 0 && strpos($entry, 'ctpl_') !== 0 && strpos($entry, 'tpl_') !== 0) + if (strpos($entry, 'container_') !== 0 && + strpos($entry, 'url_matcher') !== 0 && + strpos($entry, 'sql_') !== 0 && + strpos($entry, 'data_') !== 0 && + strpos($entry, 'ctpl_') !== 0 && + strpos($entry, 'tpl_') !== 0) { continue; } @@ -280,7 +285,7 @@ class phpbb_cache_driver_memory extends phpbb_cache_driver_base /** * Save sql query */ - function sql_save($query, &$query_result, $ttl) + function sql_save($query, $query_result, $ttl) { global $db; @@ -294,7 +299,7 @@ class phpbb_cache_driver_memory extends phpbb_cache_driver_base if (!preg_match('/FROM \\(?(`?\\w+`?(?: \\w+)?(?:, ?`?\\w+`?(?: \\w+)?)*)\\)?/', $query, $regs)) { // Bail out if the match fails. - return; + return $query_result; } $tables = array_map('trim', explode(',', $regs[1])); @@ -334,7 +339,7 @@ class phpbb_cache_driver_memory extends phpbb_cache_driver_base $this->_write('sql_' . $hash, $this->sql_rowset[$query_id], $ttl); - $query_result = $query_id; + return $query_id; } /** diff --git a/phpBB/includes/cache/driver/null.php b/phpBB/includes/cache/driver/null.php index c143803d0e..687604d14f 100644 --- a/phpBB/includes/cache/driver/null.php +++ b/phpBB/includes/cache/driver/null.php @@ -107,8 +107,9 @@ class phpbb_cache_driver_null extends phpbb_cache_driver_base /** * Save sql query */ - function sql_save($query, &$query_result, $ttl) + function sql_save($query, $query_result, $ttl) { + return $query_result; } /** diff --git a/phpBB/includes/cache/driver/redis.php b/phpBB/includes/cache/driver/redis.php index a768885962..960735b673 100755..100644 --- a/phpBB/includes/cache/driver/redis.php +++ b/phpBB/includes/cache/driver/redis.php @@ -39,13 +39,39 @@ class phpbb_cache_driver_redis extends phpbb_cache_driver_memory var $redis; + /** + * Creates a redis cache driver. + * + * The following global constants affect operation: + * + * PHPBB_ACM_REDIS_HOST + * PHPBB_ACM_REDIS_PORT + * PHPBB_ACM_REDIS_PASSWORD + * PHPBB_ACM_REDIS_DB + * + * There are no publicly documented constructor parameters. + */ function __construct() { // Call the parent constructor parent::__construct(); $this->redis = new Redis(); - $this->redis->connect(PHPBB_ACM_REDIS_HOST, PHPBB_ACM_REDIS_PORT); + + $args = func_get_args(); + if (!empty($args)) + { + $ok = call_user_func_array(array($this->redis, 'connect'), $args); + } + else + { + $ok = $this->redis->connect(PHPBB_ACM_REDIS_HOST, PHPBB_ACM_REDIS_PORT); + } + + if (!$ok) + { + trigger_error('Could not connect to redis server'); + } if (defined('PHPBB_ACM_REDIS_PASSWORD')) { @@ -74,7 +100,7 @@ class phpbb_cache_driver_redis extends phpbb_cache_driver_memory /** * Unload the cache resources * - * @return void + * @return null */ function unload() { @@ -86,7 +112,7 @@ class phpbb_cache_driver_redis extends phpbb_cache_driver_memory /** * Purge cache data * - * @return void + * @return null */ function purge() { diff --git a/phpBB/includes/cache/driver/wincache.php b/phpBB/includes/cache/driver/wincache.php index fa9eb95f88..58f3b4a581 100644 --- a/phpBB/includes/cache/driver/wincache.php +++ b/phpBB/includes/cache/driver/wincache.php @@ -26,7 +26,7 @@ class phpbb_cache_driver_wincache extends phpbb_cache_driver_memory /** * Purge cache data * - * @return void + * @return null */ function purge() { diff --git a/phpBB/includes/cache/driver/xcache.php b/phpBB/includes/cache/driver/xcache.php index 0b768bdb3e..06c5fafd97 100644 --- a/phpBB/includes/cache/driver/xcache.php +++ b/phpBB/includes/cache/driver/xcache.php @@ -41,7 +41,7 @@ class phpbb_cache_driver_xcache extends phpbb_cache_driver_memory /** * Purge cache data * - * @return void + * @return null */ function purge() { diff --git a/phpBB/includes/cache/factory.php b/phpBB/includes/cache/factory.php deleted file mode 100644 index 01c4d0b901..0000000000 --- a/phpBB/includes/cache/factory.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** -* -* @package acm -* @copyright (c) 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 -* -*/ - -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** -* @package acm -*/ -class phpbb_cache_factory -{ - private $acm_type; - - public function __construct($acm_type) - { - $this->acm_type = $acm_type; - } - - public function get_driver() - { - $class_name = 'phpbb_cache_driver_' . $this->acm_type; - return new $class_name(); - } - - public function get_service() - { - $driver = $this->get_driver(); - $service = new phpbb_cache_service($driver); - return $service; - } -} diff --git a/phpBB/includes/cache/service.php b/phpBB/includes/cache/service.php index 37f32aa753..e63ec6e33a 100644 --- a/phpBB/includes/cache/service.php +++ b/phpBB/includes/cache/service.php @@ -332,27 +332,22 @@ class phpbb_cache_service $parsed_array = array(); } - $reparse = false; $filename = $phpbb_root_path . 'styles/' . $style['style_path'] . '/style.cfg'; if (!file_exists($filename)) { - continue; + return $parsed_array; } if (!isset($parsed_array['filetime']) || (($config['load_tplcompile'] && @filemtime($filename) > $parsed_array['filetime']))) { - $reparse = true; - } - - // Re-parse cfg file - if ($reparse) - { + // Re-parse cfg file $parsed_array = parse_cfg_file($filename); $parsed_array['filetime'] = @filemtime($filename); $this->driver->put('_cfg_' . $style['style_path'], $parsed_array); } + return $parsed_array; } diff --git a/phpBB/includes/captcha/captcha_factory.php b/phpBB/includes/captcha/captcha_factory.php index d57b333c69..1ed8e119b5 100644 --- a/phpBB/includes/captcha/captcha_factory.php +++ b/phpBB/includes/captcha/captcha_factory.php @@ -25,7 +25,7 @@ class phpbb_captcha_factory /** * return an instance of class $name in file $name_plugin.php */ - public static function get_instance($name) + static public function get_instance($name) { global $phpbb_root_path, $phpEx; diff --git a/phpBB/includes/captcha/plugins/phpbb_captcha_gd_plugin.php b/phpBB/includes/captcha/plugins/phpbb_captcha_gd_plugin.php index 6c1f3bf00b..c0c355f33b 100644 --- a/phpBB/includes/captcha/plugins/phpbb_captcha_gd_plugin.php +++ b/phpBB/includes/captcha/plugins/phpbb_captcha_gd_plugin.php @@ -49,27 +49,15 @@ class phpbb_captcha_gd extends phpbb_default_captcha } } - public static function get_instance() + static public function get_instance() { $instance = new phpbb_captcha_gd(); return $instance; } - function is_available() + static public function is_available() { - global $phpbb_root_path, $phpEx; - - if (@extension_loaded('gd')) - { - return true; - } - - if (!function_exists('can_load_dll')) - { - include($phpbb_root_path . 'includes/functions_install.' . $phpEx); - } - - return can_load_dll('gd'); + return @extension_loaded('gd'); } /** @@ -80,7 +68,7 @@ class phpbb_captcha_gd extends phpbb_default_captcha return true; } - function get_name() + static public function get_name() { return 'CAPTCHA_GD'; } diff --git a/phpBB/includes/captcha/plugins/phpbb_captcha_gd_wave_plugin.php b/phpBB/includes/captcha/plugins/phpbb_captcha_gd_wave_plugin.php index a5588178bb..0d4b8bd451 100644 --- a/phpBB/includes/captcha/plugins/phpbb_captcha_gd_wave_plugin.php +++ b/phpBB/includes/captcha/plugins/phpbb_captcha_gd_wave_plugin.php @@ -39,29 +39,17 @@ class phpbb_captcha_gd_wave extends phpbb_default_captcha } } - public static function get_instance() + static public function get_instance() { return new phpbb_captcha_gd_wave(); } - function is_available() + static public function is_available() { - global $phpbb_root_path, $phpEx; - - if (@extension_loaded('gd')) - { - return true; - } - - if (!function_exists('can_load_dll')) - { - include($phpbb_root_path . 'includes/functions_install.' . $phpEx); - } - - return can_load_dll('gd'); + return @extension_loaded('gd'); } - function get_name() + static public function get_name() { return 'CAPTCHA_GD_3D'; } diff --git a/phpBB/includes/captcha/plugins/phpbb_captcha_nogd_plugin.php b/phpBB/includes/captcha/plugins/phpbb_captcha_nogd_plugin.php index 96f13fbe1b..c5ef8c78b0 100644 --- a/phpBB/includes/captcha/plugins/phpbb_captcha_nogd_plugin.php +++ b/phpBB/includes/captcha/plugins/phpbb_captcha_nogd_plugin.php @@ -39,18 +39,18 @@ class phpbb_captcha_nogd extends phpbb_default_captcha } } - public static function get_instance() + static public function get_instance() { $instance = new phpbb_captcha_nogd(); return $instance; } - function is_available() + static public function is_available() { return true; } - function get_name() + static public function get_name() { return 'CAPTCHA_NO_GD'; } diff --git a/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php b/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php index 99813189d7..ec7636f511 100644 --- a/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php +++ b/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php @@ -98,7 +98,7 @@ class phpbb_captcha_qa /** * API function */ - public static function get_instance() + static public function get_instance() { $instance = new phpbb_captcha_qa(); @@ -108,7 +108,7 @@ class phpbb_captcha_qa /** * See if the captcha has created its tables. */ - function is_installed() + static public function is_installed() { global $db, $phpbb_root_path, $phpEx; @@ -124,14 +124,14 @@ class phpbb_captcha_qa /** * API function - for the captcha to be available, it must have installed itself and there has to be at least one question in the board's default lang */ - function is_available() + static public function is_available() { global $config, $db, $phpbb_root_path, $phpEx, $user; // load language file for pretty display in the ACP dropdown $user->add_lang('captcha_qa'); - if (!phpbb_captcha_qa::is_installed()) + if (!self::is_installed()) { return false; } @@ -157,7 +157,7 @@ class phpbb_captcha_qa /** * API function */ - function get_name() + static public function get_name() { return 'CAPTCHA_QA'; } @@ -612,7 +612,7 @@ class phpbb_captcha_qa $user->add_lang('acp/board'); $user->add_lang('captcha_qa'); - if (!$this->is_installed()) + if (!self::is_installed()) { $this->install(); } diff --git a/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php b/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php index 70c24a8c30..83d40bbba7 100644 --- a/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php +++ b/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php @@ -54,13 +54,13 @@ class phpbb_recaptcha extends phpbb_default_captcha $this->response = request_var('recaptcha_response_field', ''); } - public static function get_instance() + static public function get_instance() { $instance = new phpbb_recaptcha(); return $instance; } - function is_available() + static public function is_available() { global $config, $user; $user->add_lang('captcha_recaptcha'); @@ -75,7 +75,7 @@ class phpbb_recaptcha extends phpbb_default_captcha return true; } - function get_name() + static public function get_name() { return 'CAPTCHA_RECAPTCHA'; } @@ -163,7 +163,7 @@ class phpbb_recaptcha extends phpbb_default_captcha 'RECAPTCHA_SERVER' => $this->recaptcha_server, 'RECAPTCHA_PUBKEY' => isset($config['recaptcha_pubkey']) ? $config['recaptcha_pubkey'] : '', 'RECAPTCHA_ERRORGET' => '', - 'S_RECAPTCHA_AVAILABLE' => $this->is_available(), + 'S_RECAPTCHA_AVAILABLE' => self::is_available(), 'S_CONFIRM_CODE' => true, 'S_TYPE' => $this->type, 'L_CONFIRM_EXPLAIN' => $explain, diff --git a/phpBB/includes/config/config.php b/phpBB/includes/config/config.php index 12a4a418b2..4b533dd55c 100644 --- a/phpBB/includes/config/config.php +++ b/phpBB/includes/config/config.php @@ -109,7 +109,7 @@ class phpbb_config implements ArrayAccess, IteratorAggregate, Countable * @param String $key The configuration option's name * @param bool $use_cache Whether this variable should be cached or if it * changes too frequently to be efficiently cached - * @return void + * @return null */ public function delete($key, $use_cache = true) { diff --git a/phpBB/includes/config/db.php b/phpBB/includes/config/db.php index 993a764a7f..45f9f1cb21 100644 --- a/phpBB/includes/config/db.php +++ b/phpBB/includes/config/db.php @@ -96,7 +96,7 @@ class phpbb_config_db extends phpbb_config * @param String $key The configuration option's name * @param bool $use_cache Whether this variable should be cached or if it * changes too frequently to be efficiently cached - * @return void + * @return null */ public function delete($key, $use_cache = true) { diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 66d2a003c6..68af41ab20 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -260,6 +260,7 @@ define('SESSIONS_TABLE', $table_prefix . 'sessions'); define('SESSIONS_KEYS_TABLE', $table_prefix . 'sessions_keys'); define('SITELIST_TABLE', $table_prefix . 'sitelist'); define('SMILIES_TABLE', $table_prefix . 'smilies'); +define('SPHINX_TABLE', $table_prefix . 'sphinx'); define('STYLES_TABLE', $table_prefix . 'styles'); define('STYLES_TEMPLATE_TABLE', $table_prefix . 'styles_template'); define('STYLES_TEMPLATE_DATA_TABLE',$table_prefix . 'styles_template_data'); diff --git a/phpBB/includes/controller/exception.php b/phpBB/includes/controller/exception.php new file mode 100644 index 0000000000..faa8b6b584 --- /dev/null +++ b/phpBB/includes/controller/exception.php @@ -0,0 +1,24 @@ +<?php +/** +* +* @package controller +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** +* Controller exception class +* @package phpBB3 +*/ +class phpbb_controller_exception extends RuntimeException +{ +} diff --git a/phpBB/includes/controller/helper.php b/phpBB/includes/controller/helper.php new file mode 100644 index 0000000000..6cacc8fefa --- /dev/null +++ b/phpBB/includes/controller/helper.php @@ -0,0 +1,117 @@ +<?php +/** +* +* @package controller +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +use Symfony\Component\HttpFoundation\Response; + +/** +* Controller helper class, contains methods that do things for controllers +* @package phpBB3 +*/ +class phpbb_controller_helper +{ + /** + * Template object + * @var phpbb_template + */ + protected $template; + + /** + * User object + * @var phpbb_user + */ + protected $user; + + /** + * phpBB root path + * @var string + */ + protected $phpbb_root_path; + + /** + * PHP extension + * @var string + */ + protected $php_ext; + + /** + * Constructor + * + * @param phpbb_template $template Template object + * @param phpbb_user $user User object + * @param string $phpbb_root_path phpBB root path + * @param string $php_ext PHP extension + */ + public function __construct(phpbb_template $template, phpbb_user $user, $phpbb_root_path, $php_ext) + { + $this->template = $template; + $this->user = $user; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + } + + /** + * Automate setting up the page and creating the response object. + * + * @param string $handle The template handle to render + * @param string $page_title The title of the page to output + * @param int $status_code The status code to be sent to the page header + * @return Response object containing rendered page + */ + public function render($template_file, $page_title = '', $status_code = 200) + { + page_header($page_title); + + $this->template->set_filenames(array( + 'body' => $template_file, + )); + + page_footer(true, false, false); + + return new Response($this->template->assign_display('body'), $status_code); + } + + /** + * Easily generate a URL + * + * @param array $url_parts Each array element is a 'folder' + * i.e. array('my', 'ext') maps to ./app.php/my/ext + * @param mixed $query The Query string, passed directly into the second + * argument of append_sid() + * @return string A URL that has already been run through append_sid() + */ + public function url(array $url_parts, $query = '') + { + return append_sid($this->phpbb_root_path . implode('/', $url_parts), $query); + } + + /** + * Output an error, effectively the same thing as trigger_error + * + * @param string $message The error message + * @param string $code The error code (e.g. 404, 500, 503, etc.) + * @return Response A Reponse instance + */ + public function error($message, $code = 500) + { + $this->template->assign_vars(array( + 'MESSAGE_TEXT' => $message, + 'MESSAGE_TITLE' => $this->user->lang('INFORMATION'), + )); + + return $this->render('message_body.html', $this->user->lang('INFORMATION'), $code); + } +} diff --git a/phpBB/includes/controller/provider.php b/phpBB/includes/controller/provider.php new file mode 100644 index 0000000000..b2a5b9f6b2 --- /dev/null +++ b/phpBB/includes/controller/provider.php @@ -0,0 +1,82 @@ +<?php +/** +* +* @package controller +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +use Symfony\Component\Routing\RouteCollection; +use Symfony\Component\Routing\Loader\YamlFileLoader; +use Symfony\Component\Config\FileLocator; + +/** +* Controller interface +* @package phpBB3 +*/ +class phpbb_controller_provider +{ + /** + * YAML file(s) containing route information + * @var array + */ + protected $routing_paths; + + /** + * Construct method + * + * @param array() $routing_paths Array of strings containing paths + * to YAML files holding route information + */ + public function __construct($routing_paths = array()) + { + $this->routing_paths = $routing_paths; + } + + /** + * Locate paths containing routing files + * This sets an internal property but does not return the paths. + * + * @return The current instance of this object for method chaining + */ + public function import_paths_from_finder(phpbb_extension_finder $finder) + { + // We hardcode the path to the core config directory + // because the finder cannot find it + $this->routing_paths = array_merge(array('config'), array_map('dirname', array_keys($finder + ->directory('config') + ->prefix('routing') + ->suffix('yml') + ->find() + ))); + + return $this; + } + + /** + * Get a list of controllers and return it + * + * @param string $base_path Base path to prepend to file paths + * @return array Array of controllers and their route information + */ + public function find($base_path = '') + { + $routes = new RouteCollection; + foreach ($this->routing_paths as $path) + { + $loader = new YamlFileLoader(new FileLocator($base_path . $path)); + $routes->addCollection($loader->load('routing.yml')); + } + + return $routes; + } +} diff --git a/phpBB/includes/controller/resolver.php b/phpBB/includes/controller/resolver.php new file mode 100644 index 0000000000..ee469aa9c8 --- /dev/null +++ b/phpBB/includes/controller/resolver.php @@ -0,0 +1,128 @@ +<?php +/** +* +* @package controller +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\HttpFoundation\Request; + +/** +* Controller manager class +* @package phpBB3 +*/ +class phpbb_controller_resolver implements ControllerResolverInterface +{ + /** + * User object + * @var phpbb_user + */ + protected $user; + + /** + * ContainerInterface object + * @var ContainerInterface + */ + protected $container; + + /** + * Construct method + * + * @param phpbb_user $user User Object + * @param ContainerInterface $container ContainerInterface object + */ + public function __construct(phpbb_user $user, ContainerInterface $container) + { + $this->user = $user; + $this->container = $container; + } + + /** + * Load a controller callable + * + * @param Symfony\Component\HttpFoundation\Request $request Symfony Request object + * @return bool|Callable Callable or false + * @throws phpbb_controller_exception + */ + public function getController(Request $request) + { + $controller = $request->attributes->get('_controller'); + + if (!$controller) + { + throw new phpbb_controller_exception($this->user->lang['CONTROLLER_NOT_SPECIFIED']); + } + + // Require a method name along with the service name + if (stripos($controller, ':') === false) + { + throw new phpbb_controller_exception($this->user->lang['CONTROLLER_METHOD_NOT_SPECIFIED']); + } + + list($service, $method) = explode(':', $controller); + + if (!$this->container->has($service)) + { + throw new phpbb_controller_exception($this->user->lang('CONTROLLER_SERVICE_UNDEFINED', $service)); + } + + $controller_object = $this->container->get($service); + + return array($controller_object, $method); + } + + /** + * Dependencies should be specified in the service definition and can be + * then accessed in __construct(). Arguments are sent through the URL path + * and should match the parameters of the method you are using as your + * controller. + * + * @param Symfony\Component\HttpFoundation\Request $request Symfony Request object + * @param mixed $controller A callable (controller class, method) + * @return bool False + * @throws phpbb_controller_exception + */ + public function getArguments(Request $request, $controller) + { + // At this point, $controller contains the object and method name + list($object, $method) = $controller; + $mirror = new ReflectionMethod($object, $method); + + $arguments = array(); + $parameters = $mirror->getParameters(); + $attributes = $request->attributes->all(); + foreach ($parameters as $param) + { + if (array_key_exists($param->name, $attributes)) + { + $arguments[] = $attributes[$param->name]; + } + else if ($param->getClass() && $param->getClass()->isInstance($request)) + { + $arguments[] = $request; + } + else if ($param->isDefaultValueAvailable()) + { + $arguments[] = $param->getDefaultValue(); + } + else + { + throw new phpbb_controller_exception($this->user->lang('CONTROLLER_ARGUMENT_VALUE_MISSING', $param->getPosition() + 1, get_class($object) . ':' . $method, $param->name)); + } + } + + return $arguments; + } +} diff --git a/phpBB/includes/cron/manager.php b/phpBB/includes/cron/manager.php index 7a78a1b054..84c9650830 100644 --- a/phpBB/includes/cron/manager.php +++ b/phpBB/includes/cron/manager.php @@ -32,31 +32,35 @@ class phpbb_cron_manager */ protected $tasks = array(); + protected $phpbb_root_path; + protected $php_ext; + /** * Constructor. Loads all available tasks. * - * @param array|Traversable $task_names Provides an iterable set of task names + * @param array|Traversable $tasks Provides an iterable set of task names */ - public function __construct($task_names) + public function __construct($tasks, $phpbb_root_path, $php_ext) { - $this->load_tasks($task_names); + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + + $this->load_tasks($tasks); } /** * Loads tasks given by name, wraps them * and puts them into $this->tasks. * - * @param array|Traversable $task_names Array of strings + * @param array|Traversable $tasks Array of instances of phpbb_cron_task * - * @return void + * @return null */ - public function load_tasks($task_names) + public function load_tasks($tasks) { - foreach ($task_names as $task_name) + foreach ($tasks as $task) { - $task = new $task_name(); - $wrapper = new phpbb_cron_task_wrapper($task); - $this->tasks[] = $wrapper; + $this->tasks[] = $this->wrap_task($task); } } @@ -122,25 +126,13 @@ class phpbb_cron_manager } /** - * Creates an instance of parametrized cron task $name with args $args. - * The constructed task is wrapped with cron task wrapper before being returned. - * - * @param string $name The task name, which is the same as cron task class name. - * @param array $args Will be passed to the task class's constructor. + * Wraps a task inside an instance of phpbb_cron_task_wrapper. * - * @return phpbb_cron_task_wrapper|null + * @param phpbb_cron_task $task The task. + * @return phpbb_cron_task_wrapper The wrapped task. */ - public function instantiate_task($name, array $args) + public function wrap_task(phpbb_cron_task $task) { - $task = $this->find_task($name); - if ($task) - { - // task here is actually an instance of cron task wrapper - $class = $task->get_name(); - $task = new $class($args); - // need to wrap the new task too - $task = new phpbb_cron_task_wrapper($task); - } - return $task; + return new phpbb_cron_task_wrapper($task, $this->phpbb_root_path, $this->php_ext); } } diff --git a/phpBB/includes/cron/task/base.php b/phpBB/includes/cron/task/base.php index c05fb9a87c..94a2f267b4 100644 --- a/phpBB/includes/cron/task/base.php +++ b/phpBB/includes/cron/task/base.php @@ -28,6 +28,28 @@ if (!defined('IN_PHPBB')) */ abstract class phpbb_cron_task_base implements phpbb_cron_task { + private $name; + + /** + * Returns the name of the task. + * + * @return string Name of wrapped task. + */ + public function get_name() + { + return $this->name; + } + + /** + * Sets the name of the task. + * + * @param string $name The task name + */ + public function set_name($name) + { + $this->name = $name; + } + /** * Returns whether this cron task can run, given current board configuration. * diff --git a/phpBB/includes/cron/task/core/prune_all_forums.php b/phpBB/includes/cron/task/core/prune_all_forums.php index 15b93a9ca6..ee0b5f7626 100644 --- a/phpBB/includes/cron/task/core/prune_all_forums.php +++ b/phpBB/includes/cron/task/core/prune_all_forums.php @@ -26,26 +26,45 @@ if (!defined('IN_PHPBB')) */ class phpbb_cron_task_core_prune_all_forums extends phpbb_cron_task_base { + protected $phpbb_root_path; + protected $php_ext; + protected $config; + protected $db; + + /** + * Constructor. + * + * @param string $phpbb_root_path The root path + * @param string $php_ext The PHP extension + * @param phpbb_config $config The config + * @param dbal $db The db connection + */ + public function __construct($phpbb_root_path, $php_ext, phpbb_config $config, dbal $db) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->config = $config; + $this->db = $db; + } + /** * Runs this cron task. * - * @return void + * @return null */ public function run() { - global $phpbb_root_path, $phpEx, $db; - if (!function_exists('auto_prune')) { - include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + include($this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext); } $sql = 'SELECT forum_id, prune_next, enable_prune, prune_days, prune_viewed, forum_flags, prune_freq FROM ' . FORUMS_TABLE . " - WHERE enable_prune = 1 + WHERE enable_prune = 1 AND prune_next < " . time(); - $result = $db->sql_query($sql); - while ($row = $db->sql_fetchrow($result)) + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) { if ($row['prune_days']) { @@ -57,7 +76,7 @@ class phpbb_cron_task_core_prune_all_forums extends phpbb_cron_task_base auto_prune($row['forum_id'], 'viewed', $row['forum_flags'], $row['prune_viewed'], $row['prune_freq']); } } - $db->sql_freeresult($result); + $this->db->sql_freeresult($result); } /** @@ -69,7 +88,6 @@ class phpbb_cron_task_core_prune_all_forums extends phpbb_cron_task_base */ public function is_runnable() { - global $config; - return (bool) $config['use_system_cron']; + return (bool) $this->config['use_system_cron']; } } diff --git a/phpBB/includes/cron/task/core/prune_forum.php b/phpBB/includes/cron/task/core/prune_forum.php index 7686fd4281..fa7a761d88 100644 --- a/phpBB/includes/cron/task/core/prune_forum.php +++ b/phpBB/includes/cron/task/core/prune_forum.php @@ -26,44 +26,57 @@ if (!defined('IN_PHPBB')) */ class phpbb_cron_task_core_prune_forum extends phpbb_cron_task_base implements phpbb_cron_task_parametrized { - private $forum_data; + protected $phpbb_root_path; + protected $php_ext; + protected $config; + protected $db; /** - * Constructor. - * * If $forum_data is given, it is assumed to contain necessary information * about a single forum that is to be pruned. * * If $forum_data is not given, forum id will be retrieved via request_var * and a database query will be performed to load the necessary information * about the forum. + */ + protected $forum_data; + + /** + * Constructor. + * + * @param string $phpbb_root_path The root path + * @param string $php_ext The PHP extension + * @param phpbb_config $config The config + * @param dbal $db The db connection + */ + public function __construct($phpbb_root_path, $php_ext, phpbb_config $config, dbal $db) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->config = $config; + $this->db = $db; + } + + /** + * Manually set forum data. * * @param array $forum_data Information about a forum to be pruned. */ - public function __construct($forum_data = null) + public function set_forum_data($forum_data) { - global $db; - if ($forum_data) - { - $this->forum_data = $forum_data; - } - else - { - $this->forum_data = null; - } + $this->forum_data = $forum_data; } /** * Runs this cron task. * - * @return void + * @return null */ public function run() { - global $phpbb_root_path, $phpEx; if (!function_exists('auto_prune')) { - include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + include($this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext); } if ($this->forum_data['prune_days']) @@ -90,8 +103,7 @@ class phpbb_cron_task_core_prune_forum extends phpbb_cron_task_base implements p */ public function is_runnable() { - global $config; - return !$config['use_system_cron'] && $this->forum_data; + return !$this->config['use_system_cron'] && $this->forum_data; } /** @@ -126,12 +138,10 @@ class phpbb_cron_task_core_prune_forum extends phpbb_cron_task_base implements p * * @param phpbb_request_interface $request Request object. * - * @return void + * @return null */ public function parse_parameters(phpbb_request_interface $request) { - global $db; - $this->forum_data = null; if ($request->is_set('f')) { @@ -140,9 +150,9 @@ class phpbb_cron_task_core_prune_forum extends phpbb_cron_task_base implements p $sql = 'SELECT forum_id, prune_next, enable_prune, prune_days, prune_viewed, forum_flags, prune_freq FROM ' . FORUMS_TABLE . " WHERE forum_id = $forum_id"; - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); + $result = $this->db->sql_query($sql); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); if ($row) { diff --git a/phpBB/includes/cron/task/core/queue.php b/phpBB/includes/cron/task/core/queue.php index 1c72eec7c7..732f9c6bea 100644 --- a/phpBB/includes/cron/task/core/queue.php +++ b/phpBB/includes/cron/task/core/queue.php @@ -22,17 +22,34 @@ if (!defined('IN_PHPBB')) */ class phpbb_cron_task_core_queue extends phpbb_cron_task_base { + protected $phpbb_root_path; + protected $php_ext; + protected $config; + + /** + * Constructor. + * + * @param string $phpbb_root_path The root path + * @param string $php_ext The PHP extension + * @param phpbb_config $config The config + */ + public function __construct($phpbb_root_path, $php_ext, phpbb_config $config) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->config = $config; + } + /** * Runs this cron task. * - * @return void + * @return null */ public function run() { - global $phpbb_root_path, $phpEx; if (!class_exists('queue')) { - include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + include($this->phpbb_root_path . 'includes/functions_messenger.' . $this->php_ext); } $queue = new queue(); $queue->process(); @@ -47,8 +64,7 @@ class phpbb_cron_task_core_queue extends phpbb_cron_task_base */ public function is_runnable() { - global $phpbb_root_path, $phpEx; - return file_exists($phpbb_root_path . 'cache/queue.' . $phpEx); + return file_exists($this->phpbb_root_path . 'cache/queue.' . $this->php_ext); } /** @@ -61,7 +77,6 @@ class phpbb_cron_task_core_queue extends phpbb_cron_task_base */ public function should_run() { - global $config; - return $config['last_queue_run'] < time() - $config['queue_interval_config']; + return $this->config['last_queue_run'] < time() - $this->config['queue_interval_config']; } } diff --git a/phpBB/includes/cron/task/core/tidy_cache.php b/phpBB/includes/cron/task/core/tidy_cache.php index c9dc0bd9ae..16a45dae7c 100644 --- a/phpBB/includes/cron/task/core/tidy_cache.php +++ b/phpBB/includes/cron/task/core/tidy_cache.php @@ -22,15 +22,29 @@ if (!defined('IN_PHPBB')) */ class phpbb_cron_task_core_tidy_cache extends phpbb_cron_task_base { + protected $config; + protected $cache; + + /** + * Constructor. + * + * @param phpbb_config $config The config + * @param phpbb_cache_driver_interface $cache The cache driver + */ + public function __construct(phpbb_config $config, phpbb_cache_driver_interface $cache) + { + $this->config = $config; + $this->cache = $cache; + } + /** * Runs this cron task. * - * @return void + * @return null */ public function run() { - global $cache; - $cache->tidy(); + $this->cache->tidy(); } /** @@ -43,8 +57,7 @@ class phpbb_cron_task_core_tidy_cache extends phpbb_cron_task_base */ public function is_runnable() { - global $cache; - return method_exists($cache, 'tidy'); + return true; } /** @@ -58,7 +71,6 @@ class phpbb_cron_task_core_tidy_cache extends phpbb_cron_task_base */ public function should_run() { - global $config; - return $config['cache_last_gc'] < time() - $config['cache_gc']; + return $this->config['cache_last_gc'] < time() - $this->config['cache_gc']; } } diff --git a/phpBB/includes/cron/task/core/tidy_database.php b/phpBB/includes/cron/task/core/tidy_database.php index 80a1901b1e..b882e7b500 100644 --- a/phpBB/includes/cron/task/core/tidy_database.php +++ b/phpBB/includes/cron/task/core/tidy_database.php @@ -22,17 +22,34 @@ if (!defined('IN_PHPBB')) */ class phpbb_cron_task_core_tidy_database extends phpbb_cron_task_base { + protected $phpbb_root_path; + protected $php_ext; + protected $config; + + /** + * Constructor. + * + * @param string $phpbb_root_path The root path + * @param string $php_ext The PHP extension + * @param phpbb_config $config The config + */ + public function __construct($phpbb_root_path, $php_ext, phpbb_config $config) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->config = $config; + } + /** * Runs this cron task. * - * @return void + * @return null */ public function run() { - global $phpbb_root_path, $phpEx; if (!function_exists('tidy_database')) { - include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + include($this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext); } tidy_database(); } @@ -48,7 +65,6 @@ class phpbb_cron_task_core_tidy_database extends phpbb_cron_task_base */ public function should_run() { - global $config; - return $config['database_last_gc'] < time() - $config['database_gc']; + return $this->config['database_last_gc'] < time() - $this->config['database_gc']; } } diff --git a/phpBB/includes/cron/task/core/tidy_search.php b/phpBB/includes/cron/task/core/tidy_search.php index 8a0b1b690a..fdbe31346e 100644 --- a/phpBB/includes/cron/task/core/tidy_search.php +++ b/phpBB/includes/cron/task/core/tidy_search.php @@ -24,26 +24,51 @@ if (!defined('IN_PHPBB')) */ class phpbb_cron_task_core_tidy_search extends phpbb_cron_task_base { + protected $phpbb_root_path; + protected $php_ext; + protected $auth; + protected $config; + protected $db; + protected $user; + + /** + * Constructor. + * + * @param string $phpbb_root_path The root path + * @param string $php_ext The PHP extension + * @param phpbb_auth $auth The auth + * @param phpbb_config $config The config + * @param dbal $db The db connection + * @param phpbb_user $user The user + */ + public function __construct($phpbb_root_path, $php_ext, phpbb_auth $auth, phpbb_config $config, dbal $db, phpbb_user $user) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->auth = $auth; + $this->config = $config; + $this->db = $db; + $this->user = $user; + } + /** * Runs this cron task. * - * @return void + * @return null */ public function run() { - global $phpbb_root_path, $phpEx, $config, $error; - // Select the search method - $search_type = basename($config['search_type']); + $search_type = basename($this->config['search_type']); if (!class_exists($search_type)) { - include("{$phpbb_root_path}includes/search/$search_type.$phpEx"); + include($this->phpbb_root_path . "includes/search/$search_type." . $this->php_ext); } // We do some additional checks in the module to ensure it can actually be utilised $error = false; - $search = new $search_type($error); + $search = new $search_type($error, $this->phpbb_root_path, $this->php_ext, $this->auth, $this->config, $this->db, $this->user); if (!$error) { @@ -62,12 +87,10 @@ class phpbb_cron_task_core_tidy_search extends phpbb_cron_task_base */ public function is_runnable() { - global $phpbb_root_path, $phpEx, $config; - // Select the search method - $search_type = basename($config['search_type']); + $search_type = basename($this->config['search_type']); - return file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx); + return file_exists($this->phpbb_root_path . 'includes/search/' . $search_type . '.' . $this->php_ext); } /** @@ -81,7 +104,6 @@ class phpbb_cron_task_core_tidy_search extends phpbb_cron_task_base */ public function should_run() { - global $config; - return $config['search_last_gc'] < time() - $config['search_gc']; + return $this->config['search_last_gc'] < time() - $this->config['search_gc']; } } diff --git a/phpBB/includes/cron/task/core/tidy_sessions.php b/phpBB/includes/cron/task/core/tidy_sessions.php index ae7bb242b8..95f55235c9 100644 --- a/phpBB/includes/cron/task/core/tidy_sessions.php +++ b/phpBB/includes/cron/task/core/tidy_sessions.php @@ -22,15 +22,29 @@ if (!defined('IN_PHPBB')) */ class phpbb_cron_task_core_tidy_sessions extends phpbb_cron_task_base { + protected $config; + protected $user; + + /** + * Constructor. + * + * @param phpbb_config $config The config + * @param phpbb_user $user The user + */ + public function __construct(phpbb_config $config, phpbb_user $user) + { + $this->config = $config; + $this->user = $user; + } + /** * Runs this cron task. * - * @return void + * @return null */ public function run() { - global $user; - $user->session_gc(); + $this->user->session_gc(); } /** @@ -44,7 +58,6 @@ class phpbb_cron_task_core_tidy_sessions extends phpbb_cron_task_base */ public function should_run() { - global $config; - return $config['session_last_gc'] < time() - $config['session_gc']; + return $this->config['session_last_gc'] < time() - $this->config['session_gc']; } } diff --git a/phpBB/includes/cron/task/core/tidy_warnings.php b/phpBB/includes/cron/task/core/tidy_warnings.php index e1434e7087..2a7798e56e 100644 --- a/phpBB/includes/cron/task/core/tidy_warnings.php +++ b/phpBB/includes/cron/task/core/tidy_warnings.php @@ -24,17 +24,34 @@ if (!defined('IN_PHPBB')) */ class phpbb_cron_task_core_tidy_warnings extends phpbb_cron_task_base { + protected $phpbb_root_path; + protected $php_ext; + protected $config; + + /** + * Constructor. + * + * @param string $phpbb_root_path The root path + * @param string $php_ext The PHP extension + * @param phpbb_config $config The config + */ + public function __construct($phpbb_root_path, $php_ext, phpbb_config $config) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->config = $config; + } + /** * Runs this cron task. * - * @return void + * @return null */ public function run() { - global $phpbb_root_path, $phpEx; if (!function_exists('tidy_warnings')) { - include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + include($this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext); } tidy_warnings(); } @@ -48,8 +65,7 @@ class phpbb_cron_task_core_tidy_warnings extends phpbb_cron_task_base */ public function is_runnable() { - global $config; - return (bool) $config['warnings_expire_days']; + return (bool) $this->config['warnings_expire_days']; } /** @@ -63,7 +79,6 @@ class phpbb_cron_task_core_tidy_warnings extends phpbb_cron_task_base */ public function should_run() { - global $config; - return $config['warnings_last_gc'] < time() - $config['warnings_gc']; + return $this->config['warnings_last_gc'] < time() - $this->config['warnings_gc']; } } diff --git a/phpBB/includes/cron/task/parametrized.php b/phpBB/includes/cron/task/parametrized.php index 0714b2e701..5f0e46eafc 100644 --- a/phpBB/includes/cron/task/parametrized.php +++ b/phpBB/includes/cron/task/parametrized.php @@ -46,7 +46,7 @@ interface phpbb_cron_task_parametrized extends phpbb_cron_task * * @param phpbb_request_interface $request Request object. * - * @return void + * @return null */ public function parse_parameters(phpbb_request_interface $request); } diff --git a/phpBB/includes/cron/task/provider.php b/phpBB/includes/cron/task/provider.php deleted file mode 100644 index 1482051699..0000000000 --- a/phpBB/includes/cron/task/provider.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -/** -* -* @package phpBB3 -* @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; -} - -/** -* Provides cron manager with tasks -* -* Finds installed cron tasks and makes them available to the cron manager. -* -* @package phpBB3 -*/ -class phpbb_cron_task_provider extends phpbb_extension_provider -{ - /** - * Finds cron task names using the extension manager. - * - * All PHP files in includes/cron/task/core/ are considered tasks. Tasks - * in extensions have to be located in a directory called cron or a subdir - * of a directory called cron. The class and filename must end in a _task - * suffix. Additionally all PHP files in includes/cron/task/core/ are - * tasks. - * - * @return array List of task names - */ - protected function find() - { - $finder = $this->extension_manager->get_finder(); - - return $finder - ->extension_suffix('_task') - ->extension_directory('/cron') - ->core_path('includes/cron/task/core/') - ->get_classes(); - } -} diff --git a/phpBB/includes/cron/task/task.php b/phpBB/includes/cron/task/task.php index 2f2a9e51f9..2d585df96d 100644 --- a/phpBB/includes/cron/task/task.php +++ b/phpBB/includes/cron/task/task.php @@ -22,9 +22,16 @@ if (!defined('IN_PHPBB')) interface phpbb_cron_task { /** + * Returns the name of the task. + * + * @return string Name of wrapped task. + */ + public function get_name(); + + /** * Runs this cron task. * - * @return void + * @return null */ public function run(); diff --git a/phpBB/includes/cron/task/wrapper.php b/phpBB/includes/cron/task/wrapper.php index 66c45189e5..386fb5b383 100644 --- a/phpBB/includes/cron/task/wrapper.php +++ b/phpBB/includes/cron/task/wrapper.php @@ -23,6 +23,10 @@ if (!defined('IN_PHPBB')) */ class phpbb_cron_task_wrapper { + protected $task; + protected $phpbb_root_path; + protected $php_ext; + /** * Constructor. * @@ -30,9 +34,11 @@ class phpbb_cron_task_wrapper * * @param phpbb_cron_task $task The cron task to wrap. */ - public function __construct(phpbb_cron_task $task) + public function __construct(phpbb_cron_task $task, $phpbb_root_path, $php_ext) { $this->task = $task; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; } /** @@ -62,16 +68,6 @@ class phpbb_cron_task_wrapper } /** - * Returns the name of wrapped task. It is the same as the wrapped class's class name. - * - * @return string Class name of wrapped task. - */ - public function get_name() - { - return get_class($this->task); - } - - /** * Returns a url through which this task may be invoked via web. * * When system cron is not in use, running a cron task is accomplished @@ -82,8 +78,6 @@ class phpbb_cron_task_wrapper */ public function get_url() { - global $phpbb_root_path, $phpEx; - $name = $this->get_name(); if ($this->is_parametrized()) { @@ -98,7 +92,7 @@ class phpbb_cron_task_wrapper { $extra = ''; } - $url = append_sid($phpbb_root_path . 'cron.' . $phpEx, 'cron_type=' . $name . $extra); + $url = append_sid($this->phpbb_root_path . 'cron.' . $this->php_ext, 'cron_type=' . $name . $extra); return $url; } diff --git a/phpBB/includes/datetime.php b/phpBB/includes/datetime.php new file mode 100644 index 0000000000..b3462ddf67 --- /dev/null +++ b/phpBB/includes/datetime.php @@ -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]; + } +} diff --git a/phpBB/includes/db/db_tools.php b/phpBB/includes/db/db_tools.php index 73eae4e967..6df3aac9ce 100644 --- a/phpBB/includes/db/db_tools.php +++ b/phpBB/includes/db/db_tools.php @@ -20,7 +20,6 @@ if (!defined('IN_PHPBB')) * Currently not supported is returning SQL for creating tables. * * @package dbal -* @note currently not used within phpBB3, but may be utilized later. */ class phpbb_db_tools { diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index cf54d455f7..ef1dd7d14d 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -206,7 +206,7 @@ class dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_rowseek($rownum, $query_id); } @@ -256,7 +256,7 @@ class dbal $this->sql_rowseek($rownum, $query_id); } - if (!is_object($query_id) && isset($cache->sql_rowset[$query_id])) + if (!is_object($query_id) && $cache->sql_exists($query_id)) { return $cache->sql_fetchfield($query_id, $field); } @@ -284,6 +284,37 @@ class dbal } /** + * 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. * * @return bool Whether buffering is required. @@ -735,8 +766,8 @@ class dbal // Show complete SQL error and path to administrators only // Additionally show complete error on installation or if extended debug mode is enabled - // The DEBUG_EXTRA constant is for development only! - if ((isset($auth) && $auth->acl_get('a_')) || defined('IN_INSTALL') || defined('DEBUG_EXTRA')) + // The DEBUG constant is for development only! + if ((isset($auth) && $auth->acl_get('a_')) || defined('IN_INSTALL') || defined('DEBUG')) { $message .= ($sql) ? '<br /><br />SQL<br /><br />' . htmlspecialchars($sql) : ''; } diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index 7709e8fdf5..5728eb901c 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -150,13 +150,13 @@ class dbal_firebird extends dbal global $cache; // EXPLAIN only in extra debug mode - if (defined('DEBUG_EXTRA')) + if (defined('DEBUG')) { $this->sql_report('start', $query); } $this->last_query_text = $query; - $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; + $this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); if ($this->query_result === false) @@ -251,7 +251,7 @@ class dbal_firebird extends dbal $this->sql_error($query); } - if (defined('DEBUG_EXTRA')) + if (defined('DEBUG')) { $this->sql_report('stop', $query); } @@ -269,17 +269,17 @@ class dbal_firebird extends dbal } } - if ($cache_ttl && method_exists($cache, 'sql_save')) + if ($cache_ttl) { $this->open_queries[(int) $this->query_result] = $this->query_result; - $cache->sql_save($query, $this->query_result, $cache_ttl); + $this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl); } else if (strpos($query, 'SELECT') === 0 && $this->query_result) { $this->open_queries[(int) $this->query_result] = $this->query_result; } } - else if (defined('DEBUG_EXTRA')) + else if (defined('DEBUG')) { $this->sql_report('fromcache', $query); } @@ -332,7 +332,7 @@ class dbal_firebird extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_fetchrow($query_id); } @@ -398,7 +398,7 @@ class dbal_firebird extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_freeresult($query_id); } diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php index abeabc389f..1ec8517308 100644 --- a/phpBB/includes/db/mssql.php +++ b/phpBB/includes/db/mssql.php @@ -92,6 +92,14 @@ class dbal_mssql extends dbal } /** + * {@inheritDoc} + */ + public function sql_concatenate($expr1, $expr2) + { + return $expr1 . ' + ' . $expr2; + } + + /** * SQL Transaction * @access private */ @@ -131,12 +139,12 @@ class dbal_mssql extends dbal global $cache; // EXPLAIN only in extra debug mode - if (defined('DEBUG_EXTRA')) + if (defined('DEBUG')) { $this->sql_report('start', $query); } - $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; + $this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); if ($this->query_result === false) @@ -146,22 +154,22 @@ class dbal_mssql extends dbal $this->sql_error($query); } - if (defined('DEBUG_EXTRA')) + if (defined('DEBUG')) { $this->sql_report('stop', $query); } - if ($cache_ttl && method_exists($cache, 'sql_save')) + if ($cache_ttl) { $this->open_queries[(int) $this->query_result] = $this->query_result; - $cache->sql_save($query, $this->query_result, $cache_ttl); + $this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl); } else if (strpos($query, 'SELECT') === 0 && $this->query_result) { $this->open_queries[(int) $this->query_result] = $this->query_result; } } - else if (defined('DEBUG_EXTRA')) + else if (defined('DEBUG')) { $this->sql_report('fromcache', $query); } @@ -226,7 +234,7 @@ class dbal_mssql extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_fetchrow($query_id); } @@ -263,7 +271,7 @@ class dbal_mssql extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_rowseek($rownum, $query_id); } @@ -302,7 +310,7 @@ class dbal_mssql extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_freeresult($query_id); } diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php index 6e24f4e9e8..7c1ffbc808 100644 --- a/phpBB/includes/db/mssql_odbc.php +++ b/phpBB/includes/db/mssql_odbc.php @@ -110,6 +110,14 @@ class dbal_mssql_odbc extends dbal } /** + * {@inheritDoc} + */ + public function sql_concatenate($expr1, $expr2) + { + return $expr1 . ' + ' . $expr2; + } + + /** * SQL Transaction * @access private */ @@ -149,13 +157,13 @@ class dbal_mssql_odbc extends dbal global $cache; // EXPLAIN only in extra debug mode - if (defined('DEBUG_EXTRA')) + if (defined('DEBUG')) { $this->sql_report('start', $query); } $this->last_query_text = $query; - $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; + $this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); if ($this->query_result === false) @@ -165,22 +173,22 @@ class dbal_mssql_odbc extends dbal $this->sql_error($query); } - if (defined('DEBUG_EXTRA')) + if (defined('DEBUG')) { $this->sql_report('stop', $query); } - if ($cache_ttl && method_exists($cache, 'sql_save')) + if ($cache_ttl) { $this->open_queries[(int) $this->query_result] = $this->query_result; - $cache->sql_save($query, $this->query_result, $cache_ttl); + $this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl); } else if (strpos($query, 'SELECT') === 0 && $this->query_result) { $this->open_queries[(int) $this->query_result] = $this->query_result; } } - else if (defined('DEBUG_EXTRA')) + else if (defined('DEBUG')) { $this->sql_report('fromcache', $query); } @@ -246,7 +254,7 @@ class dbal_mssql_odbc extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_fetchrow($query_id); } @@ -287,7 +295,7 @@ class dbal_mssql_odbc extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_freeresult($query_id); } diff --git a/phpBB/includes/db/mssqlnative.php b/phpBB/includes/db/mssqlnative.php index 8a4503f111..e9191fae8a 100644 --- a/phpBB/includes/db/mssqlnative.php +++ b/phpBB/includes/db/mssqlnative.php @@ -218,7 +218,6 @@ class dbal_mssqlnative extends dbal $this->server = $sqlserver . (($port) ? $port_delimiter . $port : ''); //connect to database - error_reporting(E_ALL); $this->db_connect_id = sqlsrv_connect($this->server, array( 'Database' => $this->dbname, 'UID' => $this->user, @@ -260,6 +259,14 @@ class dbal_mssqlnative extends dbal /** * {@inheritDoc} */ + public function sql_concatenate($expr1, $expr2) + { + return $expr1 . ' + ' . $expr2; + } + + /** + * {@inheritDoc} + */ function sql_buffer_nested_transactions() { return true; @@ -304,13 +311,13 @@ class dbal_mssqlnative extends dbal global $cache; // EXPLAIN only in extra debug mode - if (defined('DEBUG_EXTRA')) + if (defined('DEBUG')) { $this->sql_report('start', $query); } $this->last_query_text = $query; - $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; + $this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); if ($this->query_result === false) @@ -322,22 +329,22 @@ class dbal_mssqlnative extends dbal // reset options for next query $this->query_options = array(); - if (defined('DEBUG_EXTRA')) + if (defined('DEBUG')) { $this->sql_report('stop', $query); } - if ($cache_ttl && method_exists($cache, 'sql_save')) + if ($cache_ttl) { $this->open_queries[(int) $this->query_result] = $this->query_result; - $cache->sql_save($query, $this->query_result, $cache_ttl); + $this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl); } else if (strpos($query, 'SELECT') === 0 && $this->query_result) { $this->open_queries[(int) $this->query_result] = $this->query_result; } } - else if (defined('DEBUG_EXTRA')) + else if (defined('DEBUG')) { $this->sql_report('fromcache', $query); } @@ -410,7 +417,7 @@ class dbal_mssqlnative extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_fetchrow($query_id); } @@ -435,7 +442,7 @@ class dbal_mssqlnative extends dbal unset($row['line2'], $row['line3']); } } - return $row; + return (sizeof($row)) ? $row : false; } /** @@ -470,7 +477,7 @@ class dbal_mssqlnative extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_freeresult($query_id); } diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php index eb38e3e913..f685ab055c 100644 --- a/phpBB/includes/db/mysql.php +++ b/phpBB/includes/db/mysql.php @@ -120,6 +120,14 @@ class dbal_mysql extends dbal } /** + * {@inheritDoc} + */ + public function sql_concatenate($expr1, $expr2) + { + return 'CONCAT(' . $expr1 . ', ' . $expr2 . ')'; + } + + /** * SQL Transaction * @access private */ @@ -159,12 +167,12 @@ class dbal_mysql extends dbal global $cache; // EXPLAIN only in extra debug mode - if (defined('DEBUG_EXTRA')) + if (defined('DEBUG')) { $this->sql_report('start', $query); } - $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; + $this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); if ($this->query_result === false) @@ -174,22 +182,22 @@ class dbal_mysql extends dbal $this->sql_error($query); } - if (defined('DEBUG_EXTRA')) + if (defined('DEBUG')) { $this->sql_report('stop', $query); } - if ($cache_ttl && method_exists($cache, 'sql_save')) + if ($cache_ttl) { $this->open_queries[(int) $this->query_result] = $this->query_result; - $cache->sql_save($query, $this->query_result, $cache_ttl); + $this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl); } else if (strpos($query, 'SELECT') === 0 && $this->query_result) { $this->open_queries[(int) $this->query_result] = $this->query_result; } } - else if (defined('DEBUG_EXTRA')) + else if (defined('DEBUG')) { $this->sql_report('fromcache', $query); } @@ -241,7 +249,7 @@ class dbal_mysql extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_fetchrow($query_id); } @@ -262,7 +270,7 @@ class dbal_mysql extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_rowseek($rownum, $query_id); } @@ -290,7 +298,7 @@ class dbal_mysql extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_freeresult($query_id); } diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php index 4210a58002..6d81b8bc3e 100644 --- a/phpBB/includes/db/mysqli.php +++ b/phpBB/includes/db/mysqli.php @@ -123,6 +123,14 @@ class dbal_mysqli extends dbal } /** + * {@inheritDoc} + */ + public function sql_concatenate($expr1, $expr2) + { + return 'CONCAT(' . $expr1 . ', ' . $expr2 . ')'; + } + + /** * SQL Transaction * @access private */ @@ -166,12 +174,12 @@ class dbal_mysqli extends dbal global $cache; // EXPLAIN only in extra debug mode - if (defined('DEBUG_EXTRA')) + if (defined('DEBUG')) { $this->sql_report('start', $query); } - $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; + $this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); if ($this->query_result === false) @@ -181,17 +189,17 @@ class dbal_mysqli extends dbal $this->sql_error($query); } - if (defined('DEBUG_EXTRA')) + if (defined('DEBUG')) { $this->sql_report('stop', $query); } - if ($cache_ttl && method_exists($cache, 'sql_save')) + if ($cache_ttl) { - $cache->sql_save($query, $this->query_result, $cache_ttl); + $this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl); } } - else if (defined('DEBUG_EXTRA')) + else if (defined('DEBUG')) { $this->sql_report('fromcache', $query); } @@ -243,7 +251,7 @@ class dbal_mysqli extends dbal $query_id = $this->query_result; } - if (!is_object($query_id) && isset($cache->sql_rowset[$query_id])) + if (!is_object($query_id) && $cache->sql_exists($query_id)) { return $cache->sql_fetchrow($query_id); } @@ -270,7 +278,7 @@ class dbal_mysqli extends dbal $query_id = $this->query_result; } - if (!is_object($query_id) && isset($cache->sql_rowset[$query_id])) + if (!is_object($query_id) && $cache->sql_exists($query_id)) { return $cache->sql_rowseek($rownum, $query_id); } @@ -298,7 +306,7 @@ class dbal_mysqli extends dbal $query_id = $this->query_result; } - if (!is_object($query_id) && isset($cache->sql_rowset[$query_id])) + if (!is_object($query_id) && $cache->sql_exists($query_id)) { return $cache->sql_freeresult($query_id); } diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php index 2e801532f0..6d9339b2d8 100644 --- a/phpBB/includes/db/oracle.php +++ b/phpBB/includes/db/oracle.php @@ -236,13 +236,13 @@ class dbal_oracle extends dbal global $cache; // EXPLAIN only in extra debug mode - if (defined('DEBUG_EXTRA')) + if (defined('DEBUG')) { $this->sql_report('start', $query); } $this->last_query_text = $query; - $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; + $this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); if ($this->query_result === false) @@ -413,22 +413,22 @@ class dbal_oracle extends dbal } } - if (defined('DEBUG_EXTRA')) + if (defined('DEBUG')) { $this->sql_report('stop', $query); } - if ($cache_ttl && method_exists($cache, 'sql_save')) + if ($cache_ttl) { $this->open_queries[(int) $this->query_result] = $this->query_result; - $cache->sql_save($query, $this->query_result, $cache_ttl); + $this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl); } else if (strpos($query, 'SELECT') === 0 && $this->query_result) { $this->open_queries[(int) $this->query_result] = $this->query_result; } } - else if (defined('DEBUG_EXTRA')) + else if (defined('DEBUG')) { $this->sql_report('fromcache', $query); } @@ -473,7 +473,7 @@ class dbal_oracle extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_fetchrow($query_id); } @@ -525,7 +525,7 @@ class dbal_oracle extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_rowseek($rownum, $query_id); } @@ -594,7 +594,7 @@ class dbal_oracle extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_freeresult($query_id); } diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php index bf22cffafa..8dfbfc3b60 100644 --- a/phpBB/includes/db/postgres.php +++ b/phpBB/includes/db/postgres.php @@ -194,13 +194,13 @@ class dbal_postgres extends dbal global $cache; // EXPLAIN only in extra debug mode - if (defined('DEBUG_EXTRA')) + if (defined('DEBUG')) { $this->sql_report('start', $query); } $this->last_query_text = $query; - $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; + $this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); if ($this->query_result === false) @@ -210,22 +210,22 @@ class dbal_postgres extends dbal $this->sql_error($query); } - if (defined('DEBUG_EXTRA')) + if (defined('DEBUG')) { $this->sql_report('stop', $query); } - if ($cache_ttl && method_exists($cache, 'sql_save')) + if ($cache_ttl) { $this->open_queries[(int) $this->query_result] = $this->query_result; - $cache->sql_save($query, $this->query_result, $cache_ttl); + $this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl); } else if (strpos($query, 'SELECT') === 0 && $this->query_result) { $this->open_queries[(int) $this->query_result] = $this->query_result; } } - else if (defined('DEBUG_EXTRA')) + else if (defined('DEBUG')) { $this->sql_report('fromcache', $query); } @@ -285,7 +285,7 @@ class dbal_postgres extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_fetchrow($query_id); } @@ -306,7 +306,7 @@ class dbal_postgres extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_rowseek($rownum, $query_id); } @@ -355,7 +355,7 @@ class dbal_postgres extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_freeresult($query_id); } diff --git a/phpBB/includes/db/sqlite.php b/phpBB/includes/db/sqlite.php index 86bfa75a13..5fc89ced18 100644 --- a/phpBB/includes/db/sqlite.php +++ b/phpBB/includes/db/sqlite.php @@ -112,12 +112,12 @@ class dbal_sqlite extends dbal global $cache; // EXPLAIN only in extra debug mode - if (defined('DEBUG_EXTRA')) + if (defined('DEBUG')) { $this->sql_report('start', $query); } - $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; + $this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); if ($this->query_result === false) @@ -127,22 +127,22 @@ class dbal_sqlite extends dbal $this->sql_error($query); } - if (defined('DEBUG_EXTRA')) + if (defined('DEBUG')) { $this->sql_report('stop', $query); } - if ($cache_ttl && method_exists($cache, 'sql_save')) + if ($cache_ttl) { $this->open_queries[(int) $this->query_result] = $this->query_result; - $cache->sql_save($query, $this->query_result, $cache_ttl); + $this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl); } else if (strpos($query, 'SELECT') === 0 && $this->query_result) { $this->open_queries[(int) $this->query_result] = $this->query_result; } } - else if (defined('DEBUG_EXTRA')) + else if (defined('DEBUG')) { $this->sql_report('fromcache', $query); } @@ -193,7 +193,7 @@ class dbal_sqlite extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_fetchrow($query_id); } @@ -214,7 +214,7 @@ class dbal_sqlite extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_rowseek($rownum, $query_id); } @@ -242,7 +242,7 @@ class dbal_sqlite extends dbal $query_id = $this->query_result; } - if (isset($cache->sql_rowset[$query_id])) + if ($cache->sql_exists($query_id)) { return $cache->sql_freeresult($query_id); } diff --git a/phpBB/includes/di/extension/config.php b/phpBB/includes/di/extension/config.php new file mode 100644 index 0000000000..fb5ca90070 --- /dev/null +++ b/phpBB/includes/di/extension/config.php @@ -0,0 +1,83 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\HttpKernel\DependencyInjection\Extension; +use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; +use Symfony\Component\Config\FileLocator; + +/** +* Container config extension +*/ +class phpbb_di_extension_config extends Extension +{ + public function __construct($config_file) + { + $this->config_file = $config_file; + } + + /** + * Loads a specific configuration. + * + * @param array $config An array of configuration values + * @param ContainerBuilder $container A ContainerBuilder instance + * + * @throws InvalidArgumentException When provided tag is not defined in this extension + */ + public function load(array $config, ContainerBuilder $container) + { + require($this->config_file); + + $container->setParameter('core.table_prefix', $table_prefix); + $container->setParameter('cache.driver.class', $this->fix_acm_type($acm_type)); + $container->setParameter('dbal.driver.class', 'dbal_'.$dbms); + $container->setParameter('dbal.dbhost', $dbhost); + $container->setParameter('dbal.dbuser', $dbuser); + $container->setParameter('dbal.dbpasswd', $dbpasswd); + $container->setParameter('dbal.dbname', $dbname); + $container->setParameter('dbal.dbport', $dbport); + $container->setParameter('dbal.new_link', defined('PHPBB_DB_NEW_LINK') && PHPBB_DB_NEW_LINK); + } + + /** + * Returns the recommended alias to use in XML. + * + * This alias is also the mandatory prefix to use when using YAML. + * + * @return string The alias + */ + public function getAlias() + { + return 'config'; + } + + /** + * Convert old (3.0) values to 3.1 class names + * + * @param style $acm_type ACM type + * @return ACM type class + */ + protected function fix_acm_type($acm_type) + { + if (preg_match('#^[a-z]+$#', $acm_type)) + { + return 'phpbb_cache_driver_'.$acm_type; + } + + return $acm_type; + } +} diff --git a/phpBB/includes/di/extension/core.php b/phpBB/includes/di/extension/core.php new file mode 100644 index 0000000000..9c36ba2fc4 --- /dev/null +++ b/phpBB/includes/di/extension/core.php @@ -0,0 +1,69 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\HttpKernel\DependencyInjection\Extension; +use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; +use Symfony\Component\Config\FileLocator; + +/** +* Container core extension +*/ +class phpbb_di_extension_core extends Extension +{ + /** + * phpBB Root path + * @var string + */ + protected $root_path; + + /** + * Constructor + * + * @param string $root_path Root path + */ + public function __construct($root_path) + { + $this->root_path = $root_path; + } + + /** + * Loads a specific configuration. + * + * @param array $config An array of configuration values + * @param ContainerBuilder $container A ContainerBuilder instance + * + * @throws InvalidArgumentException When provided tag is not defined in this extension + */ + public function load(array $config, ContainerBuilder $container) + { + $loader = new YamlFileLoader($container, new FileLocator(phpbb_realpath($this->root_path . 'config'))); + $loader->load('services.yml'); + } + + /** + * Returns the recommended alias to use in XML. + * + * This alias is also the mandatory prefix to use when using YAML. + * + * @return string The alias + */ + public function getAlias() + { + return 'core'; + } +} diff --git a/phpBB/includes/di/extension/ext.php b/phpBB/includes/di/extension/ext.php new file mode 100644 index 0000000000..7d9b433751 --- /dev/null +++ b/phpBB/includes/di/extension/ext.php @@ -0,0 +1,69 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\HttpKernel\DependencyInjection\Extension; +use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; +use Symfony\Component\Config\FileLocator; + +/** +* Container ext extension +*/ +class phpbb_di_extension_ext extends Extension +{ + protected $paths = array(); + + public function __construct($enabled_extensions) + { + foreach ($enabled_extensions as $ext => $path) + { + $this->paths[] = $path; + } + } + + /** + * Loads a specific configuration. + * + * @param array $config An array of configuration values + * @param ContainerBuilder $container A ContainerBuilder instance + * + * @throws InvalidArgumentException When provided tag is not defined in this extension + */ + public function load(array $config, ContainerBuilder $container) + { + foreach ($this->paths as $path) + { + if (file_exists($path . '/config/services.yml')) + { + $loader = new YamlFileLoader($container, new FileLocator(phpbb_realpath($path . '/config'))); + $loader->load('services.yml'); + } + } + } + + /** + * Returns the recommended alias to use in XML. + * + * This alias is also the mandatory prefix to use when using YAML. + * + * @return string The alias + */ + public function getAlias() + { + return 'ext'; + } +} diff --git a/phpBB/includes/di/pass/collection_pass.php b/phpBB/includes/di/pass/collection_pass.php new file mode 100644 index 0000000000..63a5c7dfc4 --- /dev/null +++ b/phpBB/includes/di/pass/collection_pass.php @@ -0,0 +1,46 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; + +/** +* Appends an add method call to the definition of each collection service for +* the services tagged with the appropriate name defined in the collection's +* service_collection tag. +*/ +class phpbb_di_pass_collection_pass implements CompilerPassInterface +{ + /** + * Modify the container before it is passed to the rest of the code + * + * @param ContainerBuilder $container ContainerBuilder object + * @return null + */ + public function process(ContainerBuilder $container) + { + foreach ($container->findTaggedServiceIds('service_collection') as $id => $data) + { + $definition = $container->getDefinition($id); + + foreach ($container->findTaggedServiceIds($data[0]['tag']) as $service_id => $service_data) + { + $definition->addMethodCall('add', array($service_id)); + } + } + } +} diff --git a/phpBB/includes/di/pass/kernel_pass.php b/phpBB/includes/di/pass/kernel_pass.php new file mode 100644 index 0000000000..a701ebcfa6 --- /dev/null +++ b/phpBB/includes/di/pass/kernel_pass.php @@ -0,0 +1,68 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; + +class phpbb_di_pass_kernel_pass implements CompilerPassInterface +{ + /** + * Modify the container before it is passed to the rest of the code + * + * @param ContainerBuilder $container ContainerBuilder object + * @return null + */ + public function process(ContainerBuilder $container) + { + $definition = $container->getDefinition('dispatcher'); + + foreach ($container->findTaggedServiceIds('kernel.event_listener') as $id => $events) + { + foreach ($events as $event) + { + $priority = isset($event['priority']) ? $event['priority'] : 0; + + if (!isset($event['event'])) + { + throw new InvalidArgumentException(sprintf('Service "%1$s" must define the "event" attribute on "kernel.event_listener" tags.', $id)); + } + + if (!isset($event['method'])) + { + throw new InvalidArgumentException(sprintf('Service "%1$s" must define the "method" attribute on "kernel.event_listener" tags.', $id)); + } + + $definition->addMethodCall('addListenerService', array($event['event'], array($id, $event['method']), $priority)); + } + } + + foreach ($container->findTaggedServiceIds('kernel.event_subscriber') as $id => $attributes) + { + // We must assume that the class value has been correctly filled, even if the service is created by a factory + $class = $container->getDefinition($id)->getClass(); + + $refClass = new ReflectionClass($class); + $interface = 'Symfony\Component\EventDispatcher\EventSubscriberInterface'; + if (!$refClass->implementsInterface($interface)) + { + throw new InvalidArgumentException(sprintf('Service "%1$s" must implement interface "%2$s".', $id, $interface)); + } + + $definition->addMethodCall('addSubscriberService', array($id, $class)); + } + } +} diff --git a/phpBB/includes/di/service_collection.php b/phpBB/includes/di/service_collection.php new file mode 100644 index 0000000000..60323c8dba --- /dev/null +++ b/phpBB/includes/di/service_collection.php @@ -0,0 +1,49 @@ +<?php +/** +* +* @package phpBB3 +* @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; +} + +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** +* Collection of services to be configured at container compile time. +* +* @package phpBB3 +*/ +class phpbb_di_service_collection extends ArrayObject +{ + /** + * Constructor + * + * @param ContainerInterface $container Container object + */ + public function __construct(ContainerInterface $container) + { + $this->container = $container; + } + + /** + * Add a service to the collection + * + * @param string $name The service name + * @return null + */ + public function add($name) + { + $task = $this->container->get($name); + $task->set_name($name); + $this->offsetSet($name, $task); + } +} diff --git a/phpBB/includes/event/dispatcher.php b/phpBB/includes/event/dispatcher.php index 2bf46b9b06..4f637ce3bb 100644 --- a/phpBB/includes/event/dispatcher.php +++ b/phpBB/includes/event/dispatcher.php @@ -15,7 +15,7 @@ if (!defined('IN_PHPBB')) exit; } -use Symfony\Component\EventDispatcher\EventDispatcher; +use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher; /** * Extension of the Symfony2 EventDispatcher @@ -31,7 +31,7 @@ use Symfony\Component\EventDispatcher\EventDispatcher; * extract($phpbb_dispatcher->trigger_event('core.index', compact($vars))); * */ -class phpbb_event_dispatcher extends EventDispatcher +class phpbb_event_dispatcher extends ContainerAwareEventDispatcher { public function trigger_event($eventName, $data = array()) { diff --git a/phpBB/includes/event/kernel_exception_subscriber.php b/phpBB/includes/event/kernel_exception_subscriber.php new file mode 100644 index 0000000000..f90989a74c --- /dev/null +++ b/phpBB/includes/event/kernel_exception_subscriber.php @@ -0,0 +1,85 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; +use Symfony\Component\HttpKernel\Exception\HttpException; +use Symfony\Component\HttpFoundation\Response; + +class phpbb_event_kernel_exception_subscriber implements EventSubscriberInterface +{ + /** + * Template object + * @var phpbb_template + */ + protected $template; + + /** + * User object + * @var phpbb_user + */ + protected $user; + + /** + * Construct method + * + * @param phpbb_template $template Template object + * @param phpbb_user $user User object + */ + public function __construct(phpbb_template $template, phpbb_user $user) + { + $this->template = $template; + $this->user = $user; + } + + /** + * This listener is run when the KernelEvents::EXCEPTION event is triggered + * + * @param GetResponseForExceptionEvent $event + * @return null + */ + public function on_kernel_exception(GetResponseForExceptionEvent $event) + { + page_header($this->user->lang('INFORMATION')); + + $exception = $event->getException(); + + $this->template->assign_vars(array( + 'MESSAGE_TITLE' => $this->user->lang('INFORMATION'), + 'MESSAGE_TEXT' => $exception->getMessage(), + )); + + $this->template->set_filenames(array( + 'body' => 'message_body.html', + )); + + page_footer(true, false, false); + + + $status_code = $exception instanceof HttpException ? $exception->getStatusCode() : 500; + $response = new Response($this->template->assign_display('body'), $status_code); + $event->setResponse($response); + } + + public static function getSubscribedEvents() + { + return array( + KernelEvents::EXCEPTION => 'on_kernel_exception', + ); + } +} diff --git a/phpBB/includes/event/kernel_request_subscriber.php b/phpBB/includes/event/kernel_request_subscriber.php new file mode 100644 index 0000000000..afb8464f80 --- /dev/null +++ b/phpBB/includes/event/kernel_request_subscriber.php @@ -0,0 +1,83 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\HttpKernel\Event\GetResponseEvent; +use Symfony\Component\HttpKernel\EventListener\RouterListener; +use Symfony\Component\Routing\RequestContext; + +class phpbb_event_kernel_request_subscriber implements EventSubscriberInterface +{ + /** + * Extension finder object + * @var phpbb_extension_finder + */ + protected $finder; + + /** + * PHP extension + * @var string + */ + protected $php_ext; + + /** + * Root path + * @var string + */ + protected $root_path; + + /** + * Construct method + * + * @param phpbb_extension_finder $finder Extension finder object + * @param string $root_path Root path + * @param string $php_ext PHP extension + */ + public function __construct(phpbb_extension_finder $finder, $root_path, $php_ext) + { + $this->finder = $finder; + $this->root_path = $root_path; + $this->php_ext = $php_ext; + } + + /** + * This listener is run when the KernelEvents::REQUEST event is triggered + * + * This is responsible for setting up the routing information + * + * @param GetResponseEvent $event + * @return null + */ + public function on_kernel_request(GetResponseEvent $event) + { + $request = $event->getRequest(); + $context = new RequestContext(); + $context->fromRequest($request); + + $matcher = phpbb_get_url_matcher($this->finder, $context, $this->root_path, $this->php_ext); + $router_listener = new RouterListener($matcher, $context); + $router_listener->onKernelRequest($event); + } + + public static function getSubscribedEvents() + { + return array( + KernelEvents::REQUEST => 'on_kernel_request', + ); + } +} diff --git a/phpBB/includes/event/kernel_terminate_subscriber.php b/phpBB/includes/event/kernel_terminate_subscriber.php new file mode 100644 index 0000000000..1eaf890e42 --- /dev/null +++ b/phpBB/includes/event/kernel_terminate_subscriber.php @@ -0,0 +1,43 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\HttpKernel\Event\PostResponseEvent; + +class phpbb_event_kernel_terminate_subscriber implements EventSubscriberInterface +{ + /** + * This listener is run when the KernelEvents::TERMINATE event is triggered + * This comes after a Response has been sent to the server; this is + * primarily cleanup stuff. + * + * @param PostResponseEvent $event + * @return null + */ + public function on_kernel_terminate(PostResponseEvent $event) + { + exit_handler(); + } + + public static function getSubscribedEvents() + { + return array( + KernelEvents::TERMINATE => 'on_kernel_terminate', + ); + } +} diff --git a/phpBB/includes/extension/controller.php b/phpBB/includes/extension/controller.php deleted file mode 100644 index c7fd439a19..0000000000 --- a/phpBB/includes/extension/controller.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php -/** -* -* @package extension -* @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; -} - -/** -* Abstract class extended by extension front controller classes -* -* @package extension -*/ -abstract class phpbb_extension_controller implements phpbb_extension_controller_interface -{ - /** - * @var phpbb_request Request class object - */ - protected $request; - - /** - * @var dbal DBAL class object - */ - protected $db; - - /** - * @var user User class object - */ - protected $user; - - /** - * @var phpbb_template Template class object - */ - protected $template; - - /** - * @var array Config array - */ - protected $config; - - /** - * @var string PHP Extension - */ - protected $phpEx; - - /** - * @var string Relative path to board root - */ - protected $phpbb_root_path; - - /** - * Constructor method that provides the common phpBB objects as inherited class - * properties for automatic availability in extension controllers - */ - public function __construct() - { - global $request, $db, $user, $template, $config; - global $phpEx, $phpbb_root_path; - - $this->request = $request; - $this->db = $db; - $this->user = $user; - $this->template = $template; - $this->config = $config; - $this->phpEx = $phpEx; - $this->phpbb_root_path = $phpbb_root_path; - } -} diff --git a/phpBB/includes/extension/controller_interface.php b/phpBB/includes/extension/controller_interface.php deleted file mode 100644 index 2b88925388..0000000000 --- a/phpBB/includes/extension/controller_interface.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -/** -* -* @package extension -* @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; -} - -/** -* The interface that extension classes have to implement to run front pages -* -* @package extension -*/ -interface phpbb_extension_controller_interface -{ - /** - * Handle the request to display a page from an extension - * - * @return null - */ - public function handle(); -} diff --git a/phpBB/includes/extension/exception.php b/phpBB/includes/extension/exception.php new file mode 100644 index 0000000000..e08a8912ea --- /dev/null +++ b/phpBB/includes/extension/exception.php @@ -0,0 +1,27 @@ +<?php +/** +* +* @package extension +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** + * Exception class for metadata + */ +class phpbb_extension_exception extends UnexpectedValueException +{ + public function __toString() + { + return $this->getMessage(); + } +}
\ No newline at end of file diff --git a/phpBB/includes/extension/finder.php b/phpBB/includes/extension/finder.php index 87ca40917d..fb19b98429 100644 --- a/phpBB/includes/extension/finder.php +++ b/phpBB/includes/extension/finder.php @@ -25,7 +25,7 @@ class phpbb_extension_finder protected $extension_manager; protected $phpbb_root_path; protected $cache; - protected $phpEx; + protected $php_ext; /** * The cache variable name used to store $this->cached_queries in $this->cache. @@ -56,16 +56,16 @@ class phpbb_extension_finder * extensions and their locations * @param string $phpbb_root_path Path to the phpbb root directory * @param phpbb_cache_driver_interface $cache A cache instance or null - * @param string $phpEx php file extension + * @param string $php_ext php file extension * @param string $cache_name The name of the cache variable, defaults to * _ext_finder */ - public function __construct(phpbb_extension_manager $extension_manager, $phpbb_root_path = '', phpbb_cache_driver_interface $cache = null, $phpEx = '.php', $cache_name = '_ext_finder') + public function __construct(phpbb_extension_manager $extension_manager, $phpbb_root_path = '', phpbb_cache_driver_interface $cache = null, $php_ext = '.php', $cache_name = '_ext_finder') { $this->extension_manager = $extension_manager; $this->phpbb_root_path = $phpbb_root_path; $this->cache = $cache; - $this->phpEx = $phpEx; + $this->php_ext = $php_ext; $this->cache_name = $cache_name; $this->query = array( @@ -251,8 +251,8 @@ class phpbb_extension_finder */ public function get_classes($cache = true) { - $this->query['extension_suffix'] .= $this->phpEx; - $this->query['core_suffix'] .= $this->phpEx; + $this->query['extension_suffix'] .= $this->php_ext; + $this->query['core_suffix'] .= $this->php_ext; $files = $this->find($cache, false); @@ -261,7 +261,7 @@ class phpbb_extension_finder { $file = preg_replace('#^includes/#', '', $file); - $classes[] = 'phpbb_' . str_replace('/', '_', substr($file, 0, -strlen($this->phpEx))); + $classes[] = 'phpbb_' . str_replace('/', '_', substr($file, 0, -strlen($this->php_ext))); } return $classes; } diff --git a/phpBB/includes/extension/manager.php b/phpBB/includes/extension/manager.php index 537c19aff8..bfd4edde93 100644 --- a/phpBB/includes/extension/manager.php +++ b/phpBB/includes/extension/manager.php @@ -22,8 +22,10 @@ if (!defined('IN_PHPBB')) */ class phpbb_extension_manager { + protected $db; + protected $config; protected $cache; - protected $phpEx; + protected $php_ext; protected $extensions; protected $extension_table; protected $phpbb_root_path; @@ -33,18 +35,20 @@ class phpbb_extension_manager * Creates a manager and loads information from database * * @param dbal $db A database connection + * @param phpbb_config $config phpbb_config * @param string $extension_table The name of the table holding extensions * @param string $phpbb_root_path Path to the phpbb includes directory. - * @param string $phpEx php file extension + * @param string $php_ext php file extension * @param phpbb_cache_driver_interface $cache A cache instance or null * @param string $cache_name The name of the cache variable, defaults to _ext */ - public function __construct(dbal $db, $extension_table, $phpbb_root_path, $phpEx = '.php', phpbb_cache_driver_interface $cache = null, $cache_name = '_ext') + public function __construct(dbal $db, phpbb_config $config, $extension_table, $phpbb_root_path, $php_ext = '.php', phpbb_cache_driver_interface $cache = null, $cache_name = '_ext') { $this->phpbb_root_path = $phpbb_root_path; $this->db = $db; + $this->config = $config; $this->cache = $cache; - $this->phpEx = $phpEx; + $this->php_ext = $php_ext; $this->extension_table = $extension_table; $this->cache_name = $cache_name; @@ -63,6 +67,17 @@ class phpbb_extension_manager */ public function load_extensions() { + $this->extensions = array(); + + // Do not try to load any extensions when installing or updating + // Note: database updater invokes this code, and in 3.0 + // there is no extension table therefore the rest of this function + // fails + if (defined('IN_INSTALL')) + { + return; + } + $sql = 'SELECT * FROM ' . $this->extension_table; @@ -70,7 +85,6 @@ class phpbb_extension_manager $extensions = $this->db->sql_fetchrowset($result); $this->db->sql_freeresult($result); - $this->extensions = array(); foreach ($extensions as $extension) { $extension['ext_path'] = $this->get_extension_path($extension['ext_name']); @@ -121,6 +135,18 @@ class phpbb_extension_manager } /** + * Instantiates the metadata manager for the extension with the given name + * + * @param string $name The extension name + * @param string $template The template manager + * @return phpbb_extension_metadata_manager Instance of the metadata manager + */ + public function create_extension_metadata_manager($name, phpbb_template $template) + { + return new phpbb_extension_metadata_manager($name, $this->db, $this, $this->phpbb_root_path, $this->php_ext, $template, $this->config); + } + + /** * Runs a step of the extension enabling process. * * Allows the exentension to enable in a long running script that works @@ -169,7 +195,7 @@ class phpbb_extension_manager if ($this->cache) { - $this->cache->destroy($this->cache_name); + $this->cache->purge(); } return !$active; @@ -226,7 +252,7 @@ class phpbb_extension_manager if ($this->cache) { - $this->cache->destroy($this->cache_name); + $this->cache->purge(); } return true; @@ -246,7 +272,7 @@ class phpbb_extension_manager if ($this->cache) { - $this->cache->destroy($this->cache_name); + $this->cache->purge(); } return false; @@ -309,7 +335,7 @@ class phpbb_extension_manager if ($this->cache) { - $this->cache->destroy($this->cache_name); + $this->cache->purge(); } return true; @@ -323,7 +349,7 @@ class phpbb_extension_manager if ($this->cache) { - $this->cache->destroy($this->cache_name); + $this->cache->purge(); } return false; @@ -362,7 +388,7 @@ class phpbb_extension_manager RecursiveIteratorIterator::SELF_FIRST); foreach ($iterator as $file_info) { - if ($file_info->isFile() && $file_info->getFilename() == 'ext' . $this->phpEx) + if ($file_info->isFile() && $file_info->getFilename() == 'ext' . $this->php_ext) { $ext_name = $iterator->getInnerIterator()->getSubPath(); @@ -432,7 +458,7 @@ class phpbb_extension_manager } return $disabled; } - + /** * Check to see if a given extension is available on the filesystem * @@ -462,6 +488,6 @@ class phpbb_extension_manager */ public function get_finder() { - return new phpbb_extension_finder($this, $this->phpbb_root_path, $this->cache, $this->phpEx, $this->cache_name . '_finder'); + return new phpbb_extension_finder($this, $this->phpbb_root_path, $this->cache, $this->php_ext, $this->cache_name . '_finder'); } } diff --git a/phpBB/includes/extension/metadata_manager.php b/phpBB/includes/extension/metadata_manager.php new file mode 100644 index 0000000000..ea85bd3c4e --- /dev/null +++ b/phpBB/includes/extension/metadata_manager.php @@ -0,0 +1,338 @@ +<?php +/** +* +* @package extension +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** +* The extension metadata manager validates and gets meta-data for extensions +* +* @package extension +*/ +class phpbb_extension_metadata_manager +{ + protected $phpEx; + protected $extension_manager; + protected $db; + protected $phpbb_root_path; + protected $template; + protected $ext_name; + protected $metadata; + protected $metadata_file; + + /** + * Creates the metadata manager + * + * @param dbal $db A database connection + * @param string $extension_manager An instance of the phpbb extension manager + * @param string $phpbb_root_path Path to the phpbb includes directory. + * @param string $phpEx php file extension + */ + public function __construct($ext_name, dbal $db, phpbb_extension_manager $extension_manager, $phpbb_root_path, $phpEx = '.php', phpbb_template $template, phpbb_config $config) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->db = $db; + $this->config = $config; + $this->phpEx = $phpEx; + $this->template = $template; + $this->extension_manager = $extension_manager; + $this->ext_name = $ext_name; + $this->metadata = array(); + $this->metadata_file = ''; + } + + /** + * Processes and gets the metadata requested + * + * @param string $element All for all metadata that it has and is valid, otherwise specify which section you want by its shorthand term. + * @return array Contains all of the requested metadata, throws an exception on failure + */ + public function get_metadata($element = 'all') + { + $this->set_metadata_file(); + + // Fetch the metadata + $this->fetch_metadata(); + + // Clean the metadata + $this->clean_metadata_array(); + + switch ($element) + { + case 'all': + default: + // Validate the metadata + if (!$this->validate()) + { + return false; + } + + return $this->metadata; + break; + + case 'name': + return ($this->validate('name')) ? $this->metadata['name'] : false; + break; + + case 'display-name': + if (isset($this->metadata['extra']['display-name'])) + { + return $this->metadata['extra']['display-name']; + } + else + { + return ($this->validate('name')) ? $this->metadata['name'] : false; + } + break; + } + } + + /** + * Sets the filepath of the metadata file + * + * @return boolean Set to true if it exists, throws an exception on failure + */ + private function set_metadata_file() + { + $ext_filepath = $this->extension_manager->get_extension_path($this->ext_name); + $metadata_filepath = $this->phpbb_root_path . $ext_filepath . 'composer.json'; + + $this->metadata_file = $metadata_filepath; + + if (!file_exists($this->metadata_file)) + { + throw new phpbb_extension_exception('The required file does not exist: ' . $this->metadata_file); + } + } + + /** + * Gets the contents of the composer.json file + * + * @return bool True if success, throws an exception on failure + */ + private function fetch_metadata() + { + if (!file_exists($this->metadata_file)) + { + throw new phpbb_extension_exception('The required file does not exist: ' . $this->metadata_file); + } + else + { + if (!($file_contents = file_get_contents($this->metadata_file))) + { + throw new phpbb_extension_exception('file_get_contents failed on ' . $this->metadata_file); + } + + if (($metadata = json_decode($file_contents, true)) === NULL) + { + throw new phpbb_extension_exception('json_decode failed on ' . $this->metadata_file); + } + + $this->metadata = $metadata; + + return true; + } + } + + /** + * This array handles the cleaning of the array + * + * @return array Contains the cleaned metadata array + */ + private function clean_metadata_array() + { + return $this->metadata; + } + + /** + * Validate fields + * + * @param string $name ("all" for display and enable validation + * "display" for name, type, and authors + * "name", "type") + * @return Bool True if valid, throws an exception if invalid + */ + public function validate($name = 'display') + { + // Basic fields + $fields = array( + 'name' => '#^[a-zA-Z0-9_\x7f-\xff]{2,}/[a-zA-Z0-9_\x7f-\xff]{2,}$#', + 'type' => '#^phpbb3-extension$#', + 'licence' => '#.+#', + 'version' => '#.+#', + ); + + switch ($name) + { + case 'all': + $this->validate('display'); + + $this->validate_enable(); + break; + + case 'display': + foreach ($fields as $field => $data) + { + $this->validate($field); + } + + $this->validate_authors(); + break; + + default: + if (isset($fields[$name])) + { + if (!isset($this->metadata[$name])) + { + throw new phpbb_extension_exception("Required meta field '$name' has not been set."); + } + + if (!preg_match($fields[$name], $this->metadata[$name])) + { + throw new phpbb_extension_exception("Meta field '$name' is invalid."); + } + } + break; + } + + return true; + } + + /** + * Validates the contents of the authors field + * + * @return boolean True when passes validation, throws exception if invalid + */ + public function validate_authors() + { + if (empty($this->metadata['authors'])) + { + throw new phpbb_extension_exception("Required meta field 'authors' has not been set."); + } + + foreach ($this->metadata['authors'] as $author) + { + if (!isset($author['name'])) + { + throw new phpbb_extension_exception("Required meta field 'author name' has not been set."); + } + } + + return true; + } + + /** + * This array handles the verification that this extension can be enabled on this board + * + * @return bool True if validation succeeded, False if failed + */ + public function validate_enable() + { + // Check for phpBB, PHP versions + if (!$this->validate_require_phpbb() || !$this->validate_require_php()) + { + return false; + } + + return true; + } + + + /** + * Validates the contents of the phpbb requirement field + * + * @return boolean True when passes validation + */ + public function validate_require_phpbb() + { + if (!isset($this->metadata['require']['phpbb'])) + { + return true; + } + + return $this->_validate_version($this->metadata['require']['phpbb'], $this->config['version']); + } + + /** + * Validates the contents of the php requirement field + * + * @return boolean True when passes validation + */ + public function validate_require_php() + { + if (!isset($this->metadata['require']['php'])) + { + return true; + } + + return $this->_validate_version($this->metadata['require']['php'], phpversion()); + } + + /** + * Version validation helper + * + * @param string $string The string for comparing to a version + * @param string $current_version The version to compare to + * @return bool True/False if meets version requirements + */ + private function _validate_version($string, $current_version) + { + // Allow them to specify their own comparison operator (ex: <3.1.2, >=3.1.0) + $comparison_matches = false; + preg_match('#[=<>]+#', $string, $comparison_matches); + + if (!empty($comparison_matches)) + { + return version_compare($current_version, str_replace(array($comparison_matches[0], ' '), '', $string), $comparison_matches[0]); + } + + return version_compare($current_version, $string, '>='); + } + + /** + * Outputs the metadata into the template + * + * @return null + */ + public function output_template_data() + { + $this->template->assign_vars(array( + 'META_NAME' => htmlspecialchars($this->metadata['name']), + 'META_TYPE' => htmlspecialchars($this->metadata['type']), + 'META_DESCRIPTION' => (isset($this->metadata['description'])) ? htmlspecialchars($this->metadata['description']) : '', + 'META_HOMEPAGE' => (isset($this->metadata['homepage'])) ? $this->metadata['homepage'] : '', + 'META_VERSION' => (isset($this->metadata['version'])) ? htmlspecialchars($this->metadata['version']) : '', + 'META_TIME' => (isset($this->metadata['time'])) ? htmlspecialchars($this->metadata['time']) : '', + 'META_LICENCE' => htmlspecialchars($this->metadata['licence']), + + 'META_REQUIRE_PHP' => (isset($this->metadata['require']['php'])) ? htmlspecialchars($this->metadata['require']['php']) : '', + 'META_REQUIRE_PHP_FAIL' => !$this->validate_require_php(), + + 'META_REQUIRE_PHPBB' => (isset($this->metadata['require']['phpbb'])) ? htmlspecialchars($this->metadata['require']['phpbb']) : '', + 'META_REQUIRE_PHPBB_FAIL' => !$this->validate_require_phpbb(), + + 'META_DISPLAY_NAME' => (isset($this->metadata['extra']['display-name'])) ? htmlspecialchars($this->metadata['extra']['display-name']) : '', + )); + + foreach ($this->metadata['authors'] as $author) + { + $this->template->assign_block_vars('meta_authors', array( + 'AUTHOR_NAME' => htmlspecialchars($author['name']), + 'AUTHOR_EMAIL' => (isset($author['email'])) ? $author['email'] : '', + 'AUTHOR_HOMEPAGE' => (isset($author['homepage'])) ? $author['homepage'] : '', + 'AUTHOR_ROLE' => (isset($author['role'])) ? htmlspecialchars($author['role']) : '', + )); + } + } +} diff --git a/phpBB/includes/extension/provider.php b/phpBB/includes/extension/provider.php index d0541fa007..45b55e5cab 100644 --- a/phpBB/includes/extension/provider.php +++ b/phpBB/includes/extension/provider.php @@ -16,7 +16,15 @@ if (!defined('IN_PHPBB')) } /** -* Provides a set of items found in extensions +* Provides a set of items found in extensions. +* +* This abstract class is essentially a wrapper around item-specific +* finding logic. It handles storing the extension manager via constructor +* for the finding logic to use to find the items, and provides an +* iterator interface over the items found by the finding logic. +* +* Items could be anything, for example template paths or cron task names. +* Derived classes completely define what the items are. * * @package extension */ @@ -45,7 +53,7 @@ abstract class phpbb_extension_provider implements IteratorAggregate } /** - * Finds template paths using the extension manager. + * Finds items using the extension manager. * * @return array List of task names */ diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index e40df93194..ebe9a9918d 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -7,6 +7,8 @@ * */ +use Symfony\Component\HttpFoundation\Request; + /** * @ignore */ @@ -229,7 +231,8 @@ function phpbb_gmgetdate($time = false) /** * Return formatted string for filesizes * -* @param int $value filesize in bytes +* @param mixed $value filesize in bytes +* (non-negative number; int, float or string) * @param bool $string_only true if language string should be returned * @param array $allowed_units only allow these units (data array indexes) * @@ -241,6 +244,12 @@ function get_formatted_filesize($value, $string_only = true, $allowed_units = fa global $user; $available_units = array( + 'tb' => array( + 'min' => 1099511627776, // pow(2, 40) + 'index' => 4, + 'si_unit' => 'TB', + 'iec_unit' => 'TIB', + ), 'gb' => array( 'min' => 1073741824, // pow(2, 30) 'index' => 3, @@ -1018,6 +1027,36 @@ else } } +/** +* Eliminates useless . and .. components from specified path. +* +* @param string $path Path to clean +* @return string Cleaned path +*/ +function phpbb_clean_path($path) +{ + $exploded = explode('/', $path); + $filtered = array(); + foreach ($exploded as $part) + { + if ($part === '.' && !empty($filtered)) + { + continue; + } + + if ($part === '..' && !empty($filtered) && $filtered[sizeof($filtered) - 1] !== '..') + { + array_pop($filtered); + } + else + { + $filtered[] = $part; + } + } + $path = implode('/', $filtered); + return $path; +} + // functions used for building option fields /** @@ -1069,32 +1108,209 @@ function style_select($default = '', $all = false) } /** +* 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) + { + $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']) { - $zone_trunc = truncate_string($zone, 50, 255, false, '...'); + $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, '...'); } + + $selected = ($timezone['tz'] === $default) ? ' selected="selected"' : ''; + $tz_select .= '<option title="' . $title . '" value="' . $timezone['tz'] . '"' . $selected . '>' . $label . '</option>'; } + $tz_select .= '</optgroup>'; - return $tz_select; + return array( + 'tz_select' => $tz_select, + 'tz_dates' => $tz_dates, + ); } // Functions handling topic/post tracking/marking @@ -1103,6 +1319,10 @@ function tz_select($default = '', $truncate = false) * Marks a topic/forum as read * Marks a topic as posted to * +* @param string $mode (all, topics, topic, post) +* @param int|bool $forum_id Used in all, topics, and topic mode +* @param int|bool $topic_id Used in topic and post mode +* @param int $post_time 0 means current time(), otherwise to set a specific mark time * @param int $user_id can only be used with $mode == 'post' */ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $user_id = 0) @@ -1110,6 +1330,8 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ global $db, $user, $config; global $request; + $post_time = ($post_time === 0 || $post_time > time()) ? time() : (int) $post_time; + if ($mode == 'all') { if ($forum_id === false || !sizeof($forum_id)) @@ -1117,9 +1339,20 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ if ($config['load_db_lastread'] && $user->data['is_registered']) { // Mark all forums read (index page) - $db->sql_query('DELETE FROM ' . TOPICS_TRACK_TABLE . " WHERE user_id = {$user->data['user_id']}"); - $db->sql_query('DELETE FROM ' . FORUMS_TRACK_TABLE . " WHERE user_id = {$user->data['user_id']}"); - $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_lastmark = ' . time() . " WHERE user_id = {$user->data['user_id']}"); + $tables = array(TOPICS_TRACK_TABLE, FORUMS_TRACK_TABLE); + foreach ($tables as $table) + { + $sql = 'DELETE FROM ' . $table . " + WHERE user_id = {$user->data['user_id']} + AND mark_time < $post_time"; + $db->sql_query($sql); + } + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_lastmark = $post_time + WHERE user_id = {$user->data['user_id']} + AND user_lastmark < $post_time"; + $db->sql_query($sql); } else if ($config['load_anon_lastread'] || $user->data['is_registered']) { @@ -1129,16 +1362,20 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ unset($tracking_topics['tf']); unset($tracking_topics['t']); unset($tracking_topics['f']); - $tracking_topics['l'] = base_convert(time() - $config['board_startdate'], 10, 36); + $tracking_topics['l'] = base_convert($post_time - $config['board_startdate'], 10, 36); - $user->set_cookie('track', tracking_serialize($tracking_topics), time() + 31536000); + $user->set_cookie('track', tracking_serialize($tracking_topics), $post_time + 31536000); $request->overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking_topics), phpbb_request_interface::COOKIE); unset($tracking_topics); if ($user->data['is_registered']) { - $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_lastmark = ' . time() . " WHERE user_id = {$user->data['user_id']}"); + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_lastmark = $post_time + WHERE user_id = {$user->data['user_id']} + AND user_lastmark < $post_time"; + $db->sql_query($sql); } } } @@ -1160,12 +1397,14 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ { $sql = 'DELETE FROM ' . TOPICS_TRACK_TABLE . " WHERE user_id = {$user->data['user_id']} + AND mark_time < $post_time AND " . $db->sql_in_set('forum_id', $forum_id); $db->sql_query($sql); $sql = 'SELECT forum_id FROM ' . FORUMS_TRACK_TABLE . " WHERE user_id = {$user->data['user_id']} + AND mark_time < $post_time AND " . $db->sql_in_set('forum_id', $forum_id); $result = $db->sql_query($sql); @@ -1178,9 +1417,10 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ if (sizeof($sql_update)) { - $sql = 'UPDATE ' . FORUMS_TRACK_TABLE . ' - SET mark_time = ' . time() . " + $sql = 'UPDATE ' . FORUMS_TRACK_TABLE . " + SET mark_time = $post_time WHERE user_id = {$user->data['user_id']} + AND mark_time < $post_time AND " . $db->sql_in_set('forum_id', $sql_update); $db->sql_query($sql); } @@ -1193,7 +1433,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ $sql_ary[] = array( 'user_id' => (int) $user->data['user_id'], 'forum_id' => (int) $f_id, - 'mark_time' => time() + 'mark_time' => $post_time, ); } @@ -1224,7 +1464,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ unset($tracking['f'][$f_id]); } - $tracking['f'][$f_id] = base_convert(time() - $config['board_startdate'], 10, 36); + $tracking['f'][$f_id] = base_convert($post_time - $config['board_startdate'], 10, 36); } if (isset($tracking['tf']) && empty($tracking['tf'])) @@ -1232,7 +1472,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ unset($tracking['tf']); } - $user->set_cookie('track', tracking_serialize($tracking), time() + 31536000); + $user->set_cookie('track', tracking_serialize($tracking), $post_time + 31536000); $request->overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking), phpbb_request_interface::COOKIE); unset($tracking); @@ -1249,9 +1489,10 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ if ($config['load_db_lastread'] && $user->data['is_registered']) { - $sql = 'UPDATE ' . TOPICS_TRACK_TABLE . ' - SET mark_time = ' . (($post_time) ? $post_time : time()) . " + $sql = 'UPDATE ' . TOPICS_TRACK_TABLE . " + SET mark_time = $post_time WHERE user_id = {$user->data['user_id']} + AND mark_time < $post_time AND topic_id = $topic_id"; $db->sql_query($sql); @@ -1264,7 +1505,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ 'user_id' => (int) $user->data['user_id'], 'topic_id' => (int) $topic_id, 'forum_id' => (int) $forum_id, - 'mark_time' => ($post_time) ? (int) $post_time : time(), + 'mark_time' => $post_time, ); $db->sql_query('INSERT INTO ' . TOPICS_TRACK_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); @@ -1284,7 +1525,6 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ $tracking['tf'][$forum_id][$topic_id36] = true; } - $post_time = ($post_time) ? $post_time : time(); $tracking['t'][$topic_id36] = base_convert($post_time - $config['board_startdate'], 10, 36); // If the cookie grows larger than 10000 characters we will remove the smallest value @@ -1320,7 +1560,12 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ if ($user->data['is_registered']) { $user->data['user_lastmark'] = intval(base_convert(max($time_keys) + $config['board_startdate'], 36, 10)); - $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_lastmark = ' . $user->data['user_lastmark'] . " WHERE user_id = {$user->data['user_id']}"); + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_lastmark = $post_time + WHERE user_id = {$user->data['user_id']} + AND mark_time < $post_time"; + $db->sql_query($sql); } else { @@ -1328,7 +1573,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ } } - $user->set_cookie('track', tracking_serialize($tracking), time() + 31536000); + $user->set_cookie('track', tracking_serialize($tracking), $post_time + 31536000); $request->overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking), phpbb_request_interface::COOKIE); } @@ -1350,7 +1595,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ $sql_ary = array( 'user_id' => (int) $use_user_id, 'topic_id' => (int) $topic_id, - 'topic_posted' => 1 + 'topic_posted' => 1, ); $db->sql_query('INSERT INTO ' . TOPICS_POSTED_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); @@ -1881,105 +2126,190 @@ 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; + } + + 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, + )); } - $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) + // 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 { - if ($on_page != 1) + $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 - 2) * $per_page) . '">' . $user->lang['PREVIOUS'] . '</a> ' . $page_string; + $at_page = $start_page; } - - if ($on_page != $total_pages) + else if ($at_page == $end_page && $end_page < $total_pages - 1) + { + $at_page = $total_pages - 1; + } + else { - $page_string .= ' <a href="' . $base_url . "{$url_delim}start=" . ($on_page * $per_page) . '">' . $user->lang['NEXT'] . '</a>'; + $at_page++; } } + while ($at_page <= $total_pages); - $template->assign_vars(array( + if ($on_page != $total_pages) + { + $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 the block_var_name is a nested block, we will use the last (most + // inner) block as a prefix for the template variables. If the last block + // name is pagination, the prefix is empty. If the rest of the + // block_var_name is not empty, we will modify the last row of that block + // and add our pagination items. + $tpl_block_name = $tpl_prefix = ''; + if (strrpos($block_var_name, '.') !== false) + { + $tpl_block_name = substr($block_var_name, 0, strrpos($block_var_name, '.')); + $tpl_prefix = strtoupper(substr($block_var_name, strrpos($block_var_name, '.') + 1)); + } + else + { + $tpl_prefix = strtoupper($block_var_name); + } + $tpl_prefix = ($tpl_prefix == 'PAGINATION') ? '' : $tpl_prefix . '_'; + + $previous_page = ($on_page != 1) ? $base_url . $url_delim . $start_name . '=' . (($on_page - 2) * $per_page) : ''; + + $template_array = array( $tpl_prefix . 'BASE_URL' => $base_url, - 'A_' . $tpl_prefix . 'BASE_URL' => addslashes($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 . 'PREVIOUS_PAGE' => $previous_page, + $tpl_prefix . 'PREV_PAGE' => $previous_page, + $tpl_prefix . 'NEXT_PAGE' => ($on_page != $total_pages) ? $base_url . $url_delim . $start_name . '=' . ($on_page * $per_page) : '', $tpl_prefix . 'TOTAL_PAGES' => $total_pages, $tpl_prefix . 'CURRENT_PAGE' => $on_page, - )); + ); - return $page_string; + if ($tpl_block_name) + { + $template->alter_block_array($tpl_block_name, $template_array, true, 'change'); + } + else + { + $template->assign_vars($template_array); + } } /** -* 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)); } @@ -2007,6 +2337,7 @@ function on_page($num_items, $per_page, $start) function append_sid($url, $params = false, $is_amp = true, $session_id = false) { global $_SID, $_EXTRA_URL, $phpbb_hook; + global $phpbb_dispatcher; if ($params === '' || (is_array($params) && empty($params))) { @@ -2014,6 +2345,39 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false) $params = false; } + $append_sid_overwrite = false; + + /** + * This event can either supplement or override the append_sid() function + * + * To override this function, the event must set $append_sid_overwrite to + * the new URL value, which will be returned following the event + * + * @event core.append_sid + * @var string url The url the session id needs + * to be appended to (can have + * params) + * @var mixed params String or array of additional + * url parameters + * @var bool is_amp Is url using & (true) or + * & (false) + * @var bool|string session_id Possibility to use a custom + * session id (string) instead of + * the global one (false) + * @var bool|string append_sid_overwrite Overwrite function (string + * URL) or not (false) + * @since 3.1-A1 + */ + $vars = array('url', 'params', 'is_amp', 'session_id', 'append_sid_overwrite'); + extract($phpbb_dispatcher->trigger_event('core.append_sid', compact($vars))); + + if ($append_sid_overwrite) + { + return $append_sid_overwrite; + } + + // The following hook remains for backwards compatibility, though use of + // the event above is preferred. // Developers using the hook function need to globalise the $_SID and $_EXTRA_URL on their own and also handle it appropriately. // They could mimic most of what is within this function if (!empty($phpbb_hook) && $phpbb_hook->call_hook(__FUNCTION__, $url, $params, $is_amp, $session_id)) @@ -2492,12 +2856,10 @@ function meta_refresh($time, $url, $disable_cd_check = false) * * @param int $code HTTP status code * @param string $message Message for the status code -* @return void +* @return null */ function send_status_line($code, $message) { - global $request; - if (substr(strtolower(@php_sapi_name()), 0, 3) === 'cgi') { // in theory, we shouldn't need that due to php doing it. Reality offers a differing opinion, though @@ -2505,18 +2867,35 @@ function send_status_line($code, $message) } else { - if ($request->server('SERVER_PROTOCOL')) - { - $version = $request->server('SERVER_PROTOCOL'); - } - else - { - $version = 'HTTP/1.0'; - } + $version = phpbb_request_http_version(); header("$version $code $message", true, $code); } } +/** +* Returns the HTTP version used in the current request. +* +* Handles the case of being called before $request is present, +* in which case it falls back to the $_SERVER superglobal. +* +* @return string HTTP version +*/ +function phpbb_request_http_version() +{ + global $request; + + if ($request && $request->server('SERVER_PROTOCOL')) + { + return $request->server('SERVER_PROTOCOL'); + } + else if (isset($_SERVER['SERVER_PROTOCOL'])) + { + return $_SERVER['SERVER_PROTOCOL']; + } + + return 'HTTP/1.0'; +} + //Form validation @@ -2597,7 +2976,7 @@ function check_form_key($form_name, $timespan = false, $return_page = '', $trigg $diff = time() - $creation_time; // If creation_time and the time() now is zero we can assume it was not a human doing this (the check for if ($diff)... - if ($diff && ($diff <= $timespan || $timespan === -1)) + if (defined('DEBUG_TEST') || $diff && ($diff <= $timespan || $timespan === -1)) { $token_sid = ($user->data['user_id'] == ANONYMOUS && !empty($config['form_token_sid_guests'])) ? $user->session_id : ''; $key = sha1($creation_time . $user->data['user_form_salt'] . $form_name . $token_sid); @@ -2786,11 +3165,11 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa trigger_error('NO_AUTH_ADMIN'); } - $password = request_var('password_' . $credential, '', true); + $password = $request->untrimmed_variable('password_' . $credential, '', true); } else { - $password = request_var('password', '', true); + $password = $request->untrimmed_variable('password', '', true); } $username = request_var('username', '', true); @@ -3119,7 +3498,7 @@ function parse_cfg_file($filename, $lines = false) $parsed_items[$key] = $value; } - + if (isset($parsed_items['parent']) && isset($parsed_items['name']) && $parsed_items['parent'] == $parsed_items['name']) { unset($parsed_items['parent']); @@ -3836,12 +4215,12 @@ function msg_handler($errno, $msg_text, $errfile, $errline) $log_text .= '<br /><br />BACKTRACE<br />' . $backtrace; } - if (defined('IN_INSTALL') || defined('DEBUG_EXTRA') || isset($auth) && $auth->acl_get('a_')) + if (defined('IN_INSTALL') || defined('DEBUG') || isset($auth) && $auth->acl_get('a_')) { $msg_text = $log_text; } - if ((defined('DEBUG') || defined('IN_CRON') || defined('IMAGE_OUTPUT')) && isset($db)) + if ((defined('IN_CRON') || defined('IMAGE_OUTPUT')) && isset($db)) { // let's avoid loops $db->sql_return_on_error(true); @@ -3889,7 +4268,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline) echo ' </div>'; echo ' </div>'; echo ' <div id="page-footer">'; - echo ' Powered by <a href="http://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Group'; + echo ' Powered by <a href="https://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Group'; echo ' </div>'; echo '</div>'; echo '</body>'; @@ -4416,7 +4795,7 @@ function phpbb_get_plural_form($rule, $number) * * @param array $param Parameter array, see $param_defaults array. * -* @return void +* @return null */ function phpbb_http_login($param) { @@ -4529,6 +4908,31 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0 define('HEADER_INC', true); + // A listener can set this variable to `true` when it overrides this function + $page_header_override = false; + + /** + * Execute code and/or overwrite page_header() + * + * @event core.page_header + * @var string page_title Page title + * @var bool display_online_list Do we display online users list + * @var string item Restrict online users to a certain + * session item, e.g. forum for + * session_forum_id + * @var int item_id Restrict online users to item id + * @var bool page_header_override Shall we return instead of running + * the rest of page_header() + * @since 3.1-A1 + */ + $vars = array('page_title', 'display_online_list', 'item_id', 'item', 'page_header_override'); + extract($phpbb_dispatcher->trigger_event('core.page_header', compact($vars))); + + if ($page_header_override) + { + return; + } + // gzip_compression if ($config['gzip_compress']) { @@ -4654,9 +5058,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) @@ -4679,6 +5080,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'], @@ -4706,6 +5115,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0 'L_LOGIN_LOGOUT' => $l_login_logout, 'L_INDEX' => $user->lang['FORUM_INDEX'], + 'L_SITE_HOME' => ($config['site_home_text'] !== '') ? $config['site_home_text'] : $user->lang['HOME'], 'L_ONLINE_EXPLAIN' => $l_online_time, 'U_PRIVATEMSGS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox'), @@ -4717,6 +5127,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0 'U_LOGIN_LOGOUT' => $u_login_logout, 'U_INDEX' => append_sid("{$phpbb_root_path}index.$phpEx"), 'U_SEARCH' => append_sid("{$phpbb_root_path}search.$phpEx"), + 'U_SITE_HOME' => $config['site_home_url'], 'U_REGISTER' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'), 'U_PROFILE' => append_sid("{$phpbb_root_path}ucp.$phpEx"), 'U_MODCP' => append_sid("{$phpbb_root_path}mcp.$phpEx", false, true, $user->session_id), @@ -4746,7 +5157,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, @@ -4804,9 +5215,6 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0 'A_COOKIE_SETTINGS' => addslashes('; path=' . $config['cookie_path'] . ((!$config['cookie_domain'] || $config['cookie_domain'] == 'localhost' || $config['cookie_domain'] == '127.0.0.1') ? '' : '; domain=' . $config['cookie_domain']) . ((!$config['cookie_secure']) ? '' : '; secure')), )); - $vars = array('page_title', 'display_online_list', 'item_id', 'item'); - extract($phpbb_dispatcher->trigger_event('core.page_header', compact($vars))); - // application/xhtml+xml not used because of IE header('Content-type: text/html; charset=UTF-8'); @@ -4825,11 +5233,35 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0 /** * Generate page footer +* +* @param bool $run_cron Whether or not to run the cron +* @param bool $display_template Whether or not to display the template +* @param bool $exit_handler Whether or not to run the exit_handler() */ -function page_footer($run_cron = true) +function page_footer($run_cron = true, $display_template = true, $exit_handler = true) { global $db, $config, $template, $user, $auth, $cache, $starttime, $phpbb_root_path, $phpEx; - global $request; + global $request, $phpbb_dispatcher; + + // A listener can set this variable to `true` when it overrides this function + $page_footer_override = false; + + /** + * Execute code and/or overwrite page_footer() + * + * @event core.page_footer + * @var bool run_cron Shall we run cron tasks + * @var bool page_footer_override Shall we return instead of running + * the rest of page_footer() + * @since 3.1-A1 + */ + $vars = array('run_cron', 'page_footer_override'); + extract($phpbb_dispatcher->trigger_event('core.page_footer', compact($vars))); + + if ($page_footer_override) + { + return; + } // Output page creation time if (defined('DEBUG')) @@ -4837,14 +5269,14 @@ function page_footer($run_cron = true) $mtime = explode(' ', microtime()); $totaltime = $mtime[0] + $mtime[1] - $starttime; - if ($request->variable('explain', false) && $auth->acl_get('a_') && defined('DEBUG_EXTRA') && method_exists($db, 'sql_report')) + if ($request->variable('explain', false) && $auth->acl_get('a_') && defined('DEBUG') && method_exists($db, 'sql_report')) { $db->sql_report('display'); } $debug_output = sprintf('Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . (($config['gzip_compress'] && @extension_loaded('zlib')) ? 'On' : 'Off') . (($user->load) ? ' | Load : ' . $user->load : ''), $totaltime); - if ($auth->acl_get('a_') && defined('DEBUG_EXTRA')) + if ($auth->acl_get('a_') && defined('DEBUG')) { if (function_exists('memory_get_peak_usage')) { @@ -4863,7 +5295,7 @@ function page_footer($run_cron = true) $template->assign_vars(array( 'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '', 'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '', - 'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="http://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Group'), + 'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="https://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Group'), 'U_ACP' => ($auth->acl_get('a_') && !empty($user->data['is_registered'])) ? append_sid("{$phpbb_root_path}adm/index.$phpEx", false, true, $user->session_id) : '') ); @@ -4901,10 +5333,17 @@ function page_footer($run_cron = true) } } - $template->display('body'); + if ($display_template) + { + $template->display('body'); + } garbage_collection(); - exit_handler(); + + if ($exit_handler) + { + exit_handler(); + } } /** @@ -4914,6 +5353,18 @@ function page_footer($run_cron = true) function garbage_collection() { global $cache, $db; + global $phpbb_dispatcher; + + /** + * Unload some objects, to free some memory, before we finish our task + * + * @event core.garbage_collection + * @since 3.1-A1 + */ + if (!empty($phpbb_dispatcher)) + { + $phpbb_dispatcher->dispatch('core.garbage_collection'); + } // Unload cache, must be done before the DB connection if closed if (!empty($cache)) @@ -4999,3 +5450,49 @@ function phpbb_to_numeric($input) { return ($input > PHP_INT_MAX) ? (float) $input : (int) $input; } + +/** +* Create a Symfony Request object from phpbb_request object +* +* @param phpbb_request $request Request object +* @return Request A Symfony Request object +*/ +function phpbb_create_symfony_request(phpbb_request $request) +{ + // This function is meant to sanitize the global input arrays + $sanitizer = function(&$value, $key) { + $type_cast_helper = new phpbb_request_type_cast_helper(); + $type_cast_helper->set_var($value, $value, gettype($value), true); + }; + + // We need to re-enable the super globals so we can access them here + $request->enable_super_globals(); + $get_parameters = $_GET; + $post_parameters = $_POST; + $server_parameters = $_SERVER; + $files_parameters = $_FILES; + $cookie_parameters = $_COOKIE; + // And now disable them again for security + $request->disable_super_globals(); + + array_walk_recursive($get_parameters, $sanitizer); + array_walk_recursive($post_parameters, $sanitizer); + + // Until we fix the issue with relative paths, we have to fake path info + // to allow urls like app.php?controller=foo/bar + $controller = $request->variable('controller', ''); + $path_info = '/' . $controller; + $request_uri = $server_parameters['REQUEST_URI']; + + // Remove the query string from REQUEST_URI + if ($pos = strpos($request_uri, '?')) + { + $request_uri = substr($request_uri, 0, $pos); + } + + // Add the path info (i.e. controller route) to the REQUEST_URI + $server_parameters['REQUEST_URI'] = $request_uri . $path_info; + $server_parameters['SCRIPT_NAME'] = ''; + + return new Request($get_parameters, $post_parameters, array(), $cookie_parameters, $files_parameters, $server_parameters); +} diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index dc61859363..2f3fd7bac0 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -22,6 +22,7 @@ function adm_page_header($page_title) { global $config, $db, $user, $template; global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID; + global $phpbb_dispatcher; if (defined('HEADER_INC')) { @@ -30,6 +31,26 @@ function adm_page_header($page_title) define('HEADER_INC', true); + // A listener can set this variable to `true` when it overrides this function + $adm_page_header_override = false; + + /** + * Execute code and/or overwrite adm_page_header() + * + * @event core.adm_page_header + * @var string page_title Page title + * @var bool adm_page_header_override Shall we return instead of + * running the rest of adm_page_header() + * @since 3.1-A1 + */ + $vars = array('page_title', 'adm_page_header_override'); + extract($phpbb_dispatcher->trigger_event('core.adm_page_header', compact($vars))); + + if ($adm_page_header_override) + { + return; + } + // gzip_compression if ($config['gzip_compress']) { @@ -96,7 +117,27 @@ function adm_page_footer($copyright_html = true) { global $db, $config, $template, $user, $auth, $cache; global $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx; - global $request; + global $request, $phpbb_dispatcher; + + // A listener can set this variable to `true` when it overrides this function + $adm_page_footer_override = false; + + /** + * Execute code and/or overwrite adm_page_footer() + * + * @event core.adm_page_footer + * @var bool copyright_html Shall we display the copyright? + * @var bool adm_page_footer_override Shall we return instead of + * running the rest of adm_page_footer() + * @since 3.1-A1 + */ + $vars = array('copyright_html', 'adm_page_footer_override'); + extract($phpbb_dispatcher->trigger_event('core.adm_page_footer', compact($vars))); + + if ($adm_page_footer_override) + { + return; + } // Output page creation time if (defined('DEBUG')) @@ -104,14 +145,14 @@ function adm_page_footer($copyright_html = true) $mtime = explode(' ', microtime()); $totaltime = $mtime[0] + $mtime[1] - $starttime; - if ($request->variable('explain', false) && $auth->acl_get('a_') && defined('DEBUG_EXTRA') && method_exists($db, 'sql_report')) + if ($request->variable('explain', false) && $auth->acl_get('a_') && defined('DEBUG') && method_exists($db, 'sql_report')) { $db->sql_report('display'); } $debug_output = sprintf('Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . (($config['gzip_compress']) ? 'On' : 'Off') . (($user->load) ? ' | Load : ' . $user->load : ''), $totaltime); - if ($auth->acl_get('a_') && defined('DEBUG_EXTRA')) + if ($auth->acl_get('a_') && defined('DEBUG')) { if (function_exists('memory_get_peak_usage')) { @@ -131,7 +172,7 @@ function adm_page_footer($copyright_html = true) 'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '', 'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '', 'S_COPYRIGHT_HTML' => $copyright_html, - 'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="http://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Group'), + 'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="https://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Group'), 'T_JQUERY_LINK' => ($config['load_jquery_cdn'] && !empty($config['load_jquery_url'])) ? $config['load_jquery_url'] : "{$phpbb_root_path}assets/javascript/jquery.js", 'S_JQUERY_FALLBACK' => ($config['load_jquery_cdn']) ? true : false, 'VERSION' => $config['version']) @@ -193,7 +234,7 @@ function h_radio($name, $input_ary, $input_default = false, $id = false, $key = */ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) { - global $user, $module; + global $user, $module, $phpbb_dispatcher; $tpl = ''; $name = 'config[' . $config_key . ']'; @@ -305,6 +346,24 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) $tpl .= $vars['append']; } + /** + * Overwrite the html code we display for the config value + * + * @event core.build_config_template + * @var array tpl_type Config type array: + * 0 => data type + * 1 [optional] => string: size, int: minimum + * 2 [optional] => string: max. length, int: maximum + * @var string key Should be used for the id attribute in html + * @var array new Array with the config values we display + * @var string name Should be used for the name attribute + * @var array vars Array with the options for the config + * @var string tpl The resulting html code we display + * @since 3.1-A1 + */ + $vars = array('tpl_type', 'key', 'new', 'name', 'vars', 'tpl'); + extract($phpbb_dispatcher->trigger_event('core.build_config_template', compact($vars))); + return $tpl; } @@ -314,7 +373,8 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) */ function validate_config_vars($config_vars, &$cfg_array, &$error) { - global $phpbb_root_path, $user; + global $phpbb_root_path, $user, $phpbb_dispatcher; + $type = 0; $min = 1; $max = 2; @@ -489,6 +549,24 @@ function validate_config_vars($config_vars, &$cfg_array, &$error) } break; + + default: + /** + * Validate a config value + * + * @event core.validate_config_variable + * @var array cfg_array Array with config values + * @var string config_name Name of the config we validate + * @var array config_definition Array with the options for + * this config + * @var array error Array of errors, the errors should + * be strings only, language keys are + * not replaced afterwards + * @since 3.1-A1 + */ + $vars = array('cfg_array', 'config_name', 'config_definition', 'error'); + extract($phpbb_dispatcher->trigger_event('core.validate_config_variable', compact($vars))); + break; } } diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 5d19cd7adb..15930f9a2c 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -723,7 +723,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s */ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = true, $post_count_sync = true, $call_delete_topics = true) { - global $db, $config, $phpbb_root_path, $phpEx; + global $db, $config, $phpbb_root_path, $phpEx, $auth, $user; if ($where_type === 'range') { @@ -855,7 +855,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = } $error = false; - $search = new $search_type($error); + $search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user); if ($error) { @@ -3308,7 +3308,7 @@ function obtain_latest_version_info($force_update = false, $warn_fail = false, $ * @param int $flag The binary flag which is OR-ed with the current column value * @param string $sql_more This string is attached to the sql query generated to update the table. * - * @return void + * @return null */ function enable_bitfield_column_flag($table_name, $column_name, $flag, $sql_more = '') { diff --git a/phpBB/includes/functions_compress.php b/phpBB/includes/functions_compress.php index 72d8eabe76..c79a31930e 100644 --- a/phpBB/includes/functions_compress.php +++ b/phpBB/includes/functions_compress.php @@ -24,6 +24,11 @@ class compress var $fp = 0; /** + * @var array + */ + protected $filelist = array(); + + /** * Add file to archive */ function add_file($src, $src_rm_prefix = '', $src_add_prefix = '', $skip_files = '') @@ -123,9 +128,41 @@ class compress } /** + * Checks if a file by that name as already been added and, if it has, + * returns a new, unique name. + * + * @param string $name The filename + * @return string A unique filename + */ + protected function unique_filename($name) + { + if (isset($this->filelist[$name])) + { + $start = $name; + $ext = ''; + $this->filelist[$name]++; + + // Separate the extension off the end of the filename to preserve it + $pos = strrpos($name, '.'); + if ($pos !== false) + { + $start = substr($name, 0, $pos); + $ext = substr($name, $pos); + } + + return $start . '_' . $this->filelist[$name] . $ext; + } + + $this->filelist[$name] = 0; + return $name; + } + + /** * Return available methods + * + * @return array Array of strings of available compression methods (.tar, .tar.gz, .zip, etc.) */ - function methods() + static public function methods() { $methods = array('.tar'); $available_methods = array('.tar.gz' => 'zlib', '.tar.bz2' => 'bz2', '.zip' => 'zlib'); @@ -361,6 +398,7 @@ class compress_zip extends compress function data($name, $data, $is_dir = false, $stat) { $name = str_replace('\\', '/', $name); + $name = $this->unique_filename($name); $hexdtime = pack('V', $this->unix_to_dos_time($stat[9])); @@ -633,6 +671,7 @@ class compress_tar extends compress */ function data($name, $data, $is_dir = false, $stat) { + $name = $this->unique_filename($name); $this->wrote = true; $fzwrite = ($this->isbz && function_exists('bzwrite')) ? 'bzwrite' : (($this->isgz && @extension_loaded('zlib')) ? 'gzwrite' : 'fwrite'); diff --git a/phpBB/includes/functions_container.php b/phpBB/includes/functions_container.php new file mode 100644 index 0000000000..8014574443 --- /dev/null +++ b/phpBB/includes/functions_container.php @@ -0,0 +1,142 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2005 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +use Symfony\Component\Config\FileLocator; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Dumper\PhpDumper; +use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** +* Create the ContainerBuilder object +* +* @param array $extensions Array of Container extension objects +* @param string $phpbb_root_path Root path +* @param string $php_ext PHP Extension +* @return ContainerBuilder object +*/ +function phpbb_create_container(array $extensions, $phpbb_root_path, $php_ext) +{ + $container = new ContainerBuilder(); + + foreach ($extensions as $extension) + { + $container->registerExtension($extension); + $container->loadFromExtension($extension->getAlias()); + } + + $container->setParameter('core.root_path', $phpbb_root_path); + $container->setParameter('core.php_ext', $php_ext); + + return $container; +} + +/** +* Create installer container +* +* @param string $phpbb_root_path Root path +* @param string $php_ext PHP Extension +* @return ContainerBuilder object +*/ +function phpbb_create_install_container($phpbb_root_path, $php_ext) +{ + $core = new phpbb_di_extension_core($phpbb_root_path); + $container = phpbb_create_container(array($core), $phpbb_root_path, $php_ext); + + $container->setParameter('core.root_path', $phpbb_root_path); + $container->setParameter('core.php_ext', $php_ext); + $container->setParameter('core.table_prefix', ''); + + $container->register('dbal.conn')->setSynthetic(true); + + $container->setAlias('cache.driver', 'cache.driver.install'); + + $container->compile(); + + return $container; +} + +/** +* Create a compiled ContainerBuilder object +* +* @param array $extensions Array of Container extension objects +* @param array $passes Array of Compiler Pass objects +* @param string $phpbb_root_path Root path +* @param string $php_ext PHP Extension +* @return ContainerBuilder object (compiled) +*/ +function phpbb_create_compiled_container(array $extensions, array $passes, $phpbb_root_path, $php_ext) +{ + // Create a temporary container for access to the ext.manager service + $tmp_container = phpbb_create_container($extensions, $phpbb_root_path, $php_ext); + $tmp_container->compile(); + + // XXX stop writing to global $cache when + // http://tracker.phpbb.com/browse/PHPBB3-11203 is fixed + $GLOBALS['cache'] = $tmp_container->get('cache'); + $installed_exts = $tmp_container->get('ext.manager')->all_enabled(); + + // Now pass the enabled extension paths into the ext compiler extension + $extensions[] = new phpbb_di_extension_ext($installed_exts); + + // Create the final container to be compiled and cached + $container = phpbb_create_container($extensions, $phpbb_root_path, $php_ext); + + // Compile the container + foreach ($passes as $pass) + { + $container->addCompilerPass($pass); + } + $container->compile(); + + return $container; +} + +function phpbb_create_dumped_container(array $extensions, array $passes, $phpbb_root_path, $php_ext) +{ + // Check for our cached container; if it exists, use it + $container_filename = phpbb_container_filename($phpbb_root_path, $php_ext); + if (file_exists($container_filename)) + { + require($container_filename); + return new phpbb_cache_container(); + } + + $container = phpbb_create_compiled_container($extensions, $passes, $phpbb_root_path, $php_ext); + + // Lastly, we create our cached container class + $dumper = new PhpDumper($container); + $cached_container_dump = $dumper->dump(array( + 'class' => 'phpbb_cache_container', + 'base_class' => 'Symfony\\Component\\DependencyInjection\\ContainerBuilder', + )); + + file_put_contents($container_filename, $cached_container_dump); + + return $container; +} + +function phpbb_create_dumped_container_unless_debug(array $extensions, array $passes, $phpbb_root_path, $php_ext) +{ + $container_factory = defined('DEBUG') ? 'phpbb_create_compiled_container' : 'phpbb_create_dumped_container'; + return $container_factory($extensions, $passes, $phpbb_root_path, $php_ext); +} + +function phpbb_container_filename($phpbb_root_path, $php_ext) +{ + $filename = str_replace(array('/', '.'), array('slash', 'dot'), $phpbb_root_path); + return $phpbb_root_path . 'cache/container_' . $filename . '.' . $php_ext; +} diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 6b2ee98d7a..c54cc25f34 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -408,16 +408,34 @@ function strip_bbcode(&$text, $uid = '') * For display of custom parsed text on user-facing pages * Expects $text to be the value directly from the database (stored value) */ -function generate_text_for_display($text, $uid, $bitfield, $flags) +function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text = true) { static $bbcode; + global $phpbb_dispatcher; if (!$text) { return ''; } - $text = censor_text($text); + /** + * Use this event to modify the text before it is parsed + * + * @event core.modify_text_for_display_before + * @var string text The text to parse + * @var string uid The BBCode UID + * @var string bitfield The BBCode Bitfield + * @var int flags The BBCode Flags + * @var bool censor_text Whether or not to apply word censors + * @since 3.1-A1 + */ + $vars = array('text', 'uid', 'bitfield', 'flags', 'censor_text'); + extract($phpbb_dispatcher->trigger_event('core.modify_text_for_display_before', compact($vars))); + + if ($censor_text) + { + $text = censor_text($text); + } // Parse bbcode if bbcode uid stored and bbcode enabled if ($uid && ($flags & OPTION_FLAG_BBCODE)) @@ -443,6 +461,19 @@ function generate_text_for_display($text, $uid, $bitfield, $flags) $text = bbcode_nl2br($text); $text = smiley_text($text, !($flags & OPTION_FLAG_SMILIES)); + /** + * Use this event to modify the text after it is parsed + * + * @event core.modify_text_for_display_after + * @var string text The text to parse + * @var string uid The BBCode UID + * @var string bitfield The BBCode Bitfield + * @var int flags The BBCode Flags + * @since 3.1-A1 + */ + $vars = array('text', 'uid', 'bitfield', 'flags'); + extract($phpbb_dispatcher->trigger_event('core.modify_text_for_display_after', compact($vars))); + return $text; } @@ -453,7 +484,23 @@ function generate_text_for_display($text, $uid, $bitfield, $flags) */ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bbcode = false, $allow_urls = false, $allow_smilies = false) { - global $phpbb_root_path, $phpEx; + global $phpbb_root_path, $phpEx, $phpbb_dispatcher; + + /** + * Use this event to modify the text before it is prepared for storage + * + * @event core.modify_text_for_storage_before + * @var string text The text to parse + * @var string uid The BBCode UID + * @var string bitfield The BBCode Bitfield + * @var int flags The BBCode Flags + * @var bool allow_bbcode Whether or not to parse BBCode + * @var bool allow_urls Whether or not to parse URLs + * @var bool allow_smilies Whether or not to parse Smilies + * @since 3.1-A1 + */ + $vars = array('text', 'uid', 'bitfield', 'flags', 'allow_bbcode', 'allow_urls', 'allow_smilies'); + extract($phpbb_dispatcher->trigger_event('core.modify_text_for_storage_before', compact($vars))); $uid = $bitfield = ''; $flags = (($allow_bbcode) ? OPTION_FLAG_BBCODE : 0) + (($allow_smilies) ? OPTION_FLAG_SMILIES : 0) + (($allow_urls) ? OPTION_FLAG_LINKS : 0); @@ -482,6 +529,19 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb $bitfield = $message_parser->bbcode_bitfield; + /** + * Use this event to modify the text after it is prepared for storage + * + * @event core.modify_text_for_storage_after + * @var string text The text to parse + * @var string uid The BBCode UID + * @var string bitfield The BBCode Bitfield + * @var int flags The BBCode Flags + * @since 3.1-A1 + */ + $vars = array('text', 'uid', 'bitfield', 'flags'); + extract($phpbb_dispatcher->trigger_event('core.modify_text_for_storage_after', compact($vars))); + return; } @@ -491,10 +551,33 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb */ function generate_text_for_edit($text, $uid, $flags) { - global $phpbb_root_path, $phpEx; + global $phpbb_root_path, $phpEx, $phpbb_dispatcher; + + /** + * Use this event to modify the text before it is decoded for editing + * + * @event core.modify_text_for_edit_before + * @var string text The text to parse + * @var string uid The BBCode UID + * @var int flags The BBCode Flags + * @since 3.1-A1 + */ + $vars = array('text', 'uid', 'flags'); + extract($phpbb_dispatcher->trigger_event('core.modify_text_for_edit_before', compact($vars))); decode_message($text, $uid); + /** + * Use this event to modify the text after it is decoded for editing + * + * @event core.modify_text_for_edit_after + * @var string text The text to parse + * @var int flags The BBCode Flags + * @since 3.1-A1 + */ + $vars = array('text', 'flags'); + extract($phpbb_dispatcher->trigger_event('core.modify_text_for_edit_after', compact($vars))); + return array( 'allow_bbcode' => ($flags & OPTION_FLAG_BBCODE) ? 1 : 0, 'allow_smilies' => ($flags & OPTION_FLAG_SMILIES) ? 1 : 0, @@ -1175,6 +1258,7 @@ function truncate_string($string, $max_length = 60, $max_store_length = 255, $al function get_username_string($mode, $user_id, $username, $username_colour = '', $guest_username = false, $custom_profile_url = false) { static $_profile_cache; + global $phpbb_dispatcher; // We cache some common variables we need within this function if (empty($_profile_cache)) @@ -1252,10 +1336,34 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', if (($mode == 'full' && !$profile_url) || $mode == 'no_profile') { - return str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_noprofile'] : $_profile_cache['tpl_noprofile_colour']); + $username_string = str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_noprofile'] : $_profile_cache['tpl_noprofile_colour']); + } + else + { + $username_string = str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_profile'] : $_profile_cache['tpl_profile_colour']); } + + /** + * Use this event to change the output of get_username_string() + * + * @event core.modify_username_string + * @var string mode profile|username|colour|full|no_profile + * @var int user_id String or array of additional url + * parameters + * @var string username The user's username + * @var string username_colour The user's colour + * @var string guest_username Optional parameter to specify the + * guest username. + * @var string custom_profile_url Optional parameter to specify a + * profile url. + * @var string username_string The string that has been generated + * @var array _profile_cache Array of original return templates + * @since 3.1-A1 + */ + $vars = array('mode', 'user_id', 'username', 'username_colour', 'guest_username', 'custom_profile_url', 'username_string', '_profile_cache'); + extract($phpbb_dispatcher->trigger_event('core.modify_username_string', compact($vars))); - return str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_profile'] : $_profile_cache['tpl_profile_colour']); + return $username_string; } /** diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index e9ec153c50..ac791e0d9b 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -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, ); diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 1f45d5e8e1..73129803ee 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -22,7 +22,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod { global $db, $auth, $user, $template; global $phpbb_root_path, $phpEx, $config; - global $request; + global $request, $phpbb_dispatcher; $forum_rows = $subforums = $forum_ids = $forum_ids_moderator = $forum_moderators = $active_forum_ary = array(); $parent_id = $visible_forums = 0; @@ -54,12 +54,12 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod // Handle marking everything read if ($mark_read == 'all') { - $redirect = build_url(array('mark', 'hash')); + $redirect = build_url(array('mark', 'hash', 'mark_time')); meta_refresh(3, $redirect); if (check_link_hash(request_var('hash', ''), 'global')) { - markread('all'); + markread('all', false, false, request_var('mark_time', 0)); trigger_error( $user->lang['FORUMS_MARKED'] . '<br /><br />' . @@ -119,6 +119,16 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'ORDER_BY' => 'f.left_id', ); + /** + * Event to modify the SQL query before the forum data is queried + * + * @event core.display_forums_modify_sql + * @var array sql_ary The SQL array to get the data of the forums + * @since 3.1-A1 + */ + $vars = array('sql_ary'); + extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_sql', compact($vars))); + $sql = $db->sql_build_query('SELECT', $sql_ary); $result = $db->sql_query($sql); @@ -127,6 +137,19 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod while ($row = $db->sql_fetchrow($result)) { + /** + * Event to modify the data set of a forum + * + * This event is triggered once per forum + * + * @event core.display_forums_modify_row + * @var int branch_root_id Last top-level forum + * @var array row The data of the forum + * @since 3.1-A1 + */ + $vars = array('branch_root_id', 'row'); + extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_row', compact($vars))); + $forum_id = $row['forum_id']; // Mark forums read? @@ -260,17 +283,33 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $forum_rows[$parent_id]['forum_id_last_post'] = $forum_id; } } + + /** + * Event to modify the forum rows data set + * + * This event is triggered once per forum + * + * @event core.display_forums_modify_forum_rows + * @var array forum_rows Data array of all forums we display + * @var array subforums Data array of all subforums we display + * @var int branch_root_id Current top-level forum + * @var int parent_id Current parent forum + * @var array row The data of the forum + * @since 3.1-A1 + */ + $vars = array('forum_rows', 'subforums', 'branch_root_id', 'parent_id', 'row'); + extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_forum_rows', compact($vars))); } $db->sql_freeresult($result); // Handle marking posts if ($mark_read == 'forums') { - $redirect = build_url(array('mark', 'hash')); + $redirect = build_url(array('mark', 'hash', 'mark_time')); $token = request_var('hash', ''); if (check_link_hash($token, 'global')) { - markread('topics', $forum_ids); + markread('topics', $forum_ids, false, request_var('mark_time', 0)); $message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>'); meta_refresh(3, $redirect); @@ -411,7 +450,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod if ($display_moderators && !empty($forum_moderators[$forum_id])) { $l_moderator = (sizeof($forum_moderators[$forum_id]) == 1) ? $user->lang['MODERATOR'] : $user->lang['MODERATORS']; - $moderators_list = implode(', ', $forum_moderators[$forum_id]); + $moderators_list = implode($user->lang['COMMA_SEPARATOR'], $forum_moderators[$forum_id]); } $l_post_click_count = ($row['forum_type'] == FORUM_LINK) ? 'CLICKS' : 'POSTS'; @@ -422,7 +461,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod { $s_subforums_list[] = '<a href="' . $subforum['link'] . '" class="subforum ' . (($subforum['unread']) ? 'unread' : 'read') . '" title="' . (($subforum['unread']) ? $user->lang['UNREAD_POSTS'] : $user->lang['NO_UNREAD_POSTS']) . '">' . $subforum['name'] . '</a>'; } - $s_subforums_list = (string) implode(', ', $s_subforums_list); + $s_subforums_list = (string) implode($user->lang['COMMA_SEPARATOR'], $s_subforums_list); $catless = ($row['parent_id'] == $root_data['forum_id']) ? true : false; if ($row['forum_type'] != FORUM_LINK) @@ -443,7 +482,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod } } - $template->assign_block_vars('forumrow', array( + $forum_row = array( 'S_IS_CAT' => false, 'S_NO_CAT' => $catless && !$last_catless, 'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false, @@ -480,9 +519,24 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'U_UNAPPROVED_TOPICS' => ($row['forum_id_unapproved_topics']) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=unapproved_topics&f=' . $row['forum_id_unapproved_topics']) : '', 'U_VIEWFORUM' => $u_viewforum, 'U_LAST_POSTER' => get_username_string('profile', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']), - 'U_LAST_POST' => $last_post_url) + 'U_LAST_POST' => $last_post_url, ); + /** + * Modify the template data block of the forum + * + * This event is triggered once per forum + * + * @event core.display_forums_modify_template_vars + * @var array forum_row Template data of the forum + * @var array row The data of the forum + * @since 3.1-A1 + */ + $vars = array('forum_row', 'row'); + extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_template_vars', compact($vars))); + + $template->assign_block_vars('forumrow', $forum_row); + // Assign subforums loop for style authors foreach ($subforums_list as $subforum) { @@ -497,7 +551,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod } $template->assign_vars(array( - 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . '&f=' . $root_data['forum_id'] . '&mark=forums') : '', + 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . '&f=' . $root_data['forum_id'] . '&mark=forums&mark_time=' . time()) : '', 'S_HAS_SUBFORUM' => ($visible_forums) ? true : false, 'L_SUBFORUM' => ($visible_forums == 1) ? $user->lang['SUBFORUM'] : $user->lang['SUBFORUMS'], 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'), @@ -640,48 +694,6 @@ function get_forum_parents(&$forum_data) } /** -* 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 */ function get_moderators(&$forum_moderators, $forum_id = false) @@ -872,7 +884,7 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold */ function display_custom_bbcodes() { - global $db, $template, $user; + global $db, $template, $user, $phpbb_dispatcher; // Start counting from 22 for the bbcode ids (every bbcode takes two ids - opening/closing) $num_predefined_bbcodes = 22; @@ -892,17 +904,40 @@ function display_custom_bbcodes() $row['bbcode_helpline'] = $user->lang[strtoupper($row['bbcode_helpline'])]; } - $template->assign_block_vars('custom_tags', array( + $custom_tags = array( 'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'", 'BBCODE_ID' => $num_predefined_bbcodes + ($i * 2), 'BBCODE_TAG' => $row['bbcode_tag'], 'BBCODE_HELPLINE' => $row['bbcode_helpline'], 'A_BBCODE_HELPLINE' => str_replace(array('&', '"', "'", '<', '>'), array('&', '"', "\'", '<', '>'), $row['bbcode_helpline']), - )); + ); + + /** + * Modify the template data block of a bbcode + * + * This event is triggered once per bbcode + * + * @event core.display_custom_bbcodes_modify_row + * @var array custom_tags Template data of the bbcode + * @var array row The data of the bbcode + * @since 3.1-A1 + */ + $vars = array('custom_tags', 'row'); + extract($phpbb_dispatcher->trigger_event('core.display_custom_bbcodes_modify_row', compact($vars))); + + $template->assign_block_vars('custom_tags', $custom_tags); $i++; } $db->sql_freeresult($result); + + /** + * Display custom bbcodes + * + * @event core.display_custom_bbcodes + * @since 3.1-A1 + */ + $phpbb_dispatcher->dispatch('core.display_custom_bbcodes'); } /** @@ -1221,7 +1256,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; } @@ -1288,6 +1325,31 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR', $ignore_config = false) { global $user, $config, $phpbb_root_path, $phpEx; + global $phpbb_dispatcher; + + $overwrite_avatar = ''; + + /** + * Overwrite users avatar + * + * @event core.display_custom_bbcodes_modify_row + * @var string avatar Users assigned avatar name + * @var int avatar_type Type of avatar + * @var string avatar_width Width of users avatar + * @var string avatar_height Height of users avatar + * @var string alt Language string for alt tag within image + * Can be a language key or text + * @var bool ignore_config Ignores config and force displaying avatar + * @var string overwrite_avatar If set, this string will be the avatar + * @since 3.1-A1 + */ + $vars = array('avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'alt', 'ignore_config', 'overwrite_avatar'); + extract($phpbb_dispatcher->trigger_event('core.user_get_avatar', compact($vars))); + + if ($overwrite_avatar) + { + return $overwrite_avatar; + } if (empty($avatar) || !$avatar_type || (!$config['allow_avatar'] && !$ignore_config)) { @@ -1325,3 +1387,39 @@ function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $ $avatar_img .= $avatar; return '<img src="' . (str_replace(' ', '%20', $avatar_img)) . '" width="' . $avatar_width . '" height="' . $avatar_height . '" alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />'; } + +/** +* Generate a list of archive types available for compressing attachments +* +* @param string $param_key Either topic_id or post_id +* @param string $param_val The value of the topic or post id +* @param string $phpbb_root_path The root path of the phpBB installation +* @param string $phpEx The PHP extension +* +* @return array Array containing the link and the type of compression +*/ +function phpbb_gen_download_links($param_key, $param_val, $phpbb_root_path, $phpEx) +{ + if (!class_exists('compress')) + { + require $phpbb_root_path . 'includes/functions_compress.' . $phpEx; + } + + $methods = compress::methods(); + $links = array(); + + foreach ($methods as $method) + { + $exploded = explode('.', $method); + $type = array_pop($exploded); + $params = array('archive' => $method); + $params[$param_key] = $param_val; + + $links[] = array( + 'LINK' => append_sid("{$phpbb_root_path}download/file.$phpEx", $params), + 'TYPE' => $type, + ); + } + + return $links; +} diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php index 1486113013..fc6f1cc762 100644 --- a/phpBB/includes/functions_download.php +++ b/phpBB/includes/functions_download.php @@ -433,7 +433,7 @@ function set_modified_headers($stamp, $browser) * * @param bool $exit Whether to die or not. * -* @return void +* @return null */ function file_gc($exit = true) { @@ -592,3 +592,132 @@ function phpbb_parse_range_request($request_array, $filesize) ); } } + +/** +* Increments the download count of all provided attachments +* +* @param dbal $db The database object +* @param array|int $ids The attach_id of each attachment +* +* @return null +*/ +function phpbb_increment_downloads($db, $ids) +{ + if (!is_array($ids)) + { + $ids = array($ids); + } + + $sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' + SET download_count = download_count + 1 + WHERE ' . $db->sql_in_set('attach_id', $ids); + $db->sql_query($sql); +} + +/** +* Handles authentication when downloading attachments from a post or topic +* +* @param dbal $db The database object +* @param phpbb_auth $auth The authentication object +* @param int $topic_id The id of the topic that we are downloading from +* +* @return null +*/ +function phpbb_download_handle_forum_auth($db, $auth, $topic_id) +{ + $sql = 'SELECT t.forum_id, f.forum_password, f.parent_id + FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f + WHERE t.topic_id = " . (int) $topic_id . " + AND t.forum_id = f.forum_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id'])) + { + if ($row && $row['forum_password']) + { + // Do something else ... ? + login_forum_box($row); + } + } + else + { + send_status_line(403, 'Forbidden'); + trigger_error('SORRY_AUTH_VIEW_ATTACH'); + } +} + +/** +* Handles authentication when downloading attachments from PMs +* +* @param dbal $db The database object +* @param phpbb_auth $auth The authentication object +* @param int $user_id The user id +* @param int $msg_id The id of the PM that we are downloading from +* +* @return null +*/ +function phpbb_download_handle_pm_auth($db, $auth, $user_id, $msg_id) +{ + if (!$auth->acl_get('u_pm_download')) + { + send_status_line(403, 'Forbidden'); + trigger_error('SORRY_AUTH_VIEW_ATTACH'); + } + + $allowed = phpbb_download_check_pm_auth($db, $user_id, $msg_id); + + if (!$allowed) + { + send_status_line(403, 'Forbidden'); + trigger_error('ERROR_NO_ATTACHMENT'); + } +} + +/** +* Checks whether a user can download from a particular PM +* +* @param dbal $db The database object +* @param int $user_id The user id +* @param int $msg_id The id of the PM that we are downloading from +* +* @return bool Whether the user is allowed to download from that PM or not +*/ +function phpbb_download_check_pm_auth($db, $user_id, $msg_id) +{ + // Check if the attachment is within the users scope... + $sql = 'SELECT msg_id + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE msg_id = ' . (int) $msg_id . ' + AND ( + user_id = ' . (int) $user_id . ' + OR author_id = ' . (int) $user_id . ' + )'; + $result = $db->sql_query_limit($sql, 1); + $allowed = (bool) $db->sql_fetchfield('msg_id'); + $db->sql_freeresult($result); + + return $allowed; +} + +/** +* Cleans a filename of any characters that could potentially cause a problem on +* a user's filesystem. +* +* @param string $filename The filename to clean +* +* @return string The cleaned filename +*/ +function phpbb_download_clean_filename($filename) +{ + $bad_chars = array("'", "\\", ' ', '/', ':', '*', '?', '"', '<', '>', '|'); + + // rawurlencode to convert any potentially 'bad' characters that we missed + $filename = rawurlencode(str_replace($bad_chars, '_', $filename)); + + // Turn the %xx entities created by rawurlencode to _ + $filename = preg_replace("/%(\w{2})/", '_', $filename); + + return $filename; +} diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index 50af8fe019..ab6b3ea009 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -16,27 +16,6 @@ if (!defined('IN_PHPBB')) } /** -* Determine if we are able to load a specified PHP module and do so if possible -*/ -function can_load_dll($dll) -{ - // SQLite2 is a tricky thing, from 5.0.0 it requires PDO; if PDO is not loaded we must state that SQLite is unavailable - // as the installer doesn't understand that the extension has a prerequisite. - // - // On top of this sometimes the SQLite extension is compiled for a different version of PDO - // by some Linux distributions which causes phpBB to bomb out with a blank page. - // - // Net result we'll disable automatic inclusion of SQLite support - // - // See: r9618 and #56105 - if ($dll == 'sqlite') - { - return false; - } - return ((@ini_get('enable_dl') || strtolower(@ini_get('enable_dl')) == 'on') && (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') && function_exists('dl') && @dl($dll . '.' . PHP_SHLIB_SUFFIX)) ? true : false; -} - -/** * Returns an array of available DBMS with some data, if a DBMS is specified it will only * return data for that DBMS and will load its extension if necessary. */ @@ -108,7 +87,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20 '2.0.x' => false, ), 'postgres' => array( - 'LABEL' => 'PostgreSQL 7.x/8.x', + 'LABEL' => 'PostgreSQL 8.3+', 'SCHEMA' => 'postgres', 'MODULE' => 'pgsql', 'DELIM' => ';', @@ -159,18 +138,15 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20 if (!@extension_loaded($dll)) { - if (!can_load_dll($dll)) + if ($return_unavailable) { - if ($return_unavailable) - { - $available_dbms[$db_name]['AVAILABLE'] = false; - } - else - { - unset($available_dbms[$db_name]); - } - continue; + $available_dbms[$db_name]['AVAILABLE'] = false; } + else + { + unset($available_dbms[$db_name]); + } + continue; } $any_db_support = true; } @@ -463,17 +439,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; } /** @@ -516,15 +496,14 @@ function adjust_language_keys_callback($matches) * * @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 +* @param bool $debug_test If the DEBUG_TEST constant should be added +* NOTE: Only for use within the testing framework * * @return string The output to write to the file */ -function phpbb_create_config_file_data($data, $dbms, $load_extensions, $debug = false) +function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_test = false) { - $load_extensions = implode(',', $load_extensions); - $config_data = "<?php\n"; $config_data .= "// phpBB 3.1.x auto-generated configuration file\n// Do not change anything in this file!\n"; @@ -536,8 +515,7 @@ function phpbb_create_config_file_data($data, $dbms, $load_extensions, $debug = 'dbuser' => $data['dbuser'], 'dbpasswd' => htmlspecialchars_decode($data['dbpasswd']), 'table_prefix' => $data['table_prefix'], - 'acm_type' => 'file', - 'load_extensions' => $load_extensions, + 'acm_type' => 'phpbb_cache_driver_file', ); foreach ($config_data_array as $key => $value) @@ -550,12 +528,15 @@ function phpbb_create_config_file_data($data, $dbms, $load_extensions, $debug = if ($debug) { $config_data .= "@define('DEBUG', true);\n"; - $config_data .= "@define('DEBUG_EXTRA', true);\n"; } else { $config_data .= "// @define('DEBUG', true);\n"; - $config_data .= "// @define('DEBUG_EXTRA', true);\n"; + } + + if ($debug_test) + { + $config_data .= "@define('DEBUG_TEST', true);\n"; } return $config_data; diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php index d76309d5bb..3d8e403f4b 100644 --- a/phpBB/includes/functions_jabber.php +++ b/phpBB/includes/functions_jabber.php @@ -68,7 +68,7 @@ class jabber } $this->password = $password; - $this->use_ssl = ($use_ssl && $this->can_use_ssl()) ? true : false; + $this->use_ssl = ($use_ssl && self::can_use_ssl()) ? true : false; // Change port if we use SSL if ($this->port == 5222 && $this->use_ssl) @@ -83,7 +83,7 @@ class jabber /** * Able to use the SSL functionality? */ - function can_use_ssl() + static public function can_use_ssl() { // Will not work with PHP >= 5.2.1 or < 5.2.3RC2 until timeout problem with ssl hasn't been fixed (http://bugs.php.net/41236) return ((version_compare(PHP_VERSION, '5.2.1', '<') || version_compare(PHP_VERSION, '5.2.3RC2', '>=')) && @extension_loaded('openssl')) ? true : false; @@ -92,7 +92,7 @@ class jabber /** * Able to use TLS? */ - function can_use_tls() + static public function can_use_tls() { if (!@extension_loaded('openssl') || !function_exists('stream_socket_enable_crypto') || !function_exists('stream_get_meta_data') || !function_exists('socket_set_blocking') || !function_exists('stream_get_wrappers')) { @@ -442,7 +442,7 @@ class jabber } // Let's use TLS if SSL is not enabled and we can actually use it - if (!$this->session['ssl'] && $this->can_use_tls() && $this->can_use_ssl() && isset($xml['stream:features'][0]['#']['starttls'])) + if (!$this->session['ssl'] && self::can_use_tls() && self::can_use_ssl() && isset($xml['stream:features'][0]['#']['starttls'])) { $this->add_to_log('Switching to TLS.'); $this->send("<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>\n"); diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index e9073553d0..a18aeddabd 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -210,7 +210,7 @@ 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_template($phpbb_root_path, $phpEx, $config, $user, $style_resource_locator); + $tpl = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $style_resource_locator, new phpbb_template_context()); $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; @@ -651,64 +651,6 @@ class queue } /** - * Obtains exclusive lock on queue cache file. - * Returns resource representing the lock - */ - function lock() - { - // For systems that can't have two processes opening - // one file for writing simultaneously - if (file_exists($this->cache_file . '.lock')) - { - $mode = 'rb'; - } - else - { - $mode = 'wb'; - } - - $lock_fp = @fopen($this->cache_file . '.lock', $mode); - - if ($mode == 'wb') - { - if (!$lock_fp) - { - // Two processes may attempt to create lock file at the same time. - // Have the losing process try opening the lock file again for reading - // on the assumption that the winning process created it - $mode = 'rb'; - $lock_fp = @fopen($this->cache_file . '.lock', $mode); - } - else - { - // Only need to set mode when the lock file is written - @chmod($this->cache_file . '.lock', 0666); - } - } - - if ($lock_fp) - { - @flock($lock_fp, LOCK_EX); - } - - return $lock_fp; - } - - /** - * Releases lock on queue cache file, using resource obtained from lock() - */ - function unlock($lock_fp) - { - // lock() will return null if opening lock file, and thus locking, failed. - // Accept null values here so that client code does not need to check them - if ($lock_fp) - { - @flock($lock_fp, LOCK_UN); - fclose($lock_fp); - } - } - - /** * Process queue * Using lock file */ @@ -716,16 +658,24 @@ class queue { global $db, $config, $phpEx, $phpbb_root_path, $user; - $lock_fp = $this->lock(); + $lock = new phpbb_lock_flock($this->cache_file); + $lock->acquire(); - set_config('last_queue_run', time(), true); - - if (!file_exists($this->cache_file) || filemtime($this->cache_file) > time() - $config['queue_interval']) + // avoid races, check file existence once + $have_cache_file = file_exists($this->cache_file); + if (!$have_cache_file || $config['last_queue_run'] > time() - $config['queue_interval']) { - $this->unlock($lock_fp); + if (!$have_cache_file) + { + set_config('last_queue_run', time(), true); + } + + $lock->release(); return; } + set_config('last_queue_run', time(), true); + include($this->cache_file); foreach ($this->queue_data as $object => $data_ary) @@ -789,7 +739,7 @@ class queue break; default: - $this->unlock($lock_fp); + $lock->release(); return; } @@ -865,7 +815,7 @@ class queue } } - $this->unlock($lock_fp); + $lock->release(); } /** @@ -878,7 +828,8 @@ class queue return; } - $lock_fp = $this->lock(); + $lock = new phpbb_lock_flock($this->cache_file); + $lock->acquire(); if (file_exists($this->cache_file)) { @@ -905,7 +856,7 @@ class queue phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE); } - $this->unlock($lock_fp); + $lock->release(); } } diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index ad76be9f2f..0d387ace6d 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -759,7 +759,26 @@ class p_master } } - $u_title = $module_url . $delim . 'i=' . (($item_ary['cat']) ? $item_ary['id'] : $item_ary['name'] . (($item_ary['is_duplicate']) ? '&icat=' . $current_id : '') . '&mode=' . $item_ary['mode']); + $u_title = $module_url . $delim . 'i='; + // if the item has a name use it, else use its id + if (empty($item_ary['name'])) + { + $u_title .= $item_ary['id']; + } + else + { + // if the category has a name, then use it. + $u_title .= $item_ary['name']; + } + // If the item is not a category append the mode + if (!$item_ary['cat']) + { + if ($item_ary['is_duplicate']) + { + $u_title .= '&icat=' . $current_id; + } + $u_title .= '&mode=' . $item_ary['mode']; + } // Was not allowed in categories before - /*!$item_ary['cat'] && */ $u_title .= (isset($item_ary['url_extra'])) ? $item_ary['url_extra'] : ''; diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index c549f99091..171cf988ce 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -20,7 +20,7 @@ if (!defined('IN_PHPBB')) */ function generate_smilies($mode, $forum_id) { - global $db, $user, $config, $template; + global $db, $user, $config, $template, $phpbb_dispatcher; global $phpEx, $phpbb_root_path; $start = request_var('start', 0); @@ -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; @@ -126,6 +123,18 @@ function generate_smilies($mode, $forum_id) } } + /** + * This event is called after the smilies are populated + * + * @event core.generate_smilies_after + * @var string mode Mode of the smilies: window|inline + * @var int forum_id The forum ID we are currently in + * @var bool display_link Shall we display the "more smilies" link? + * @since 3.1-A1 + */ + $vars = array('mode', 'forum_id', 'display_link'); + extract($phpbb_dispatcher->trigger_event('core.generate_smilies_after', compact($vars))); + if ($mode == 'inline' && $display_link) { $template->assign_vars(array( @@ -287,13 +296,15 @@ function posting_gen_topic_icons($mode, $icon_id) if (sizeof($icons)) { + $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_root_path; + foreach ($icons as $id => $data) { if ($data['display']) { $template->assign_block_vars('topic_icon', array( 'ICON_ID' => $id, - 'ICON_IMG' => $phpbb_root_path . $config['icons_path'] . '/' . $data['img'], + 'ICON_IMG' => $root_path . $config['icons_path'] . '/' . $data['img'], 'ICON_WIDTH' => $data['width'], 'ICON_HEIGHT' => $data['height'], @@ -1167,7 +1178,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id /** * User Notification */ -function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id, $topic_id, $post_id) +function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id, $topic_id, $post_id, $author_name = '') { global $db, $user, $config, $phpbb_root_path, $phpEx, $auth; @@ -1338,6 +1349,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id 'USERNAME' => htmlspecialchars_decode($addr['name']), 'TOPIC_TITLE' => htmlspecialchars_decode($topic_title), 'FORUM_NAME' => htmlspecialchars_decode($forum_name), + 'AUTHOR_NAME' => htmlspecialchars_decode($author_name), 'U_FORUM' => generate_board_url() . "/viewforum.$phpEx?f=$forum_id", 'U_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id", @@ -2373,7 +2385,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u } $error = false; - $search = new $search_type($error); + $search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user); if ($error) { @@ -2443,7 +2455,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u // Send Notifications if (($mode == 'reply' || $mode == 'quote' || $mode == 'post') && $post_approval) { - user_notification($mode, $subject, $data['topic_title'], $data['forum_name'], $data['forum_id'], $data['topic_id'], $data['post_id']); + $username = ($username) ? $username : $user->data['username']; + user_notification($mode, $subject, $data['topic_title'], $data['forum_name'], $data['forum_id'], $data['topic_id'], $data['post_id'], $username); } $params = $add_anchor = ''; diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index f254014a5b..57c872d91a 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1145,141 +1145,197 @@ function phpbb_delete_user_pms($user_id) return false; } + return phpbb_delete_users_pms(array($user_id)); +} + +/** +* Delete all PM(s) for given users and delete the ones without references +* +* @param array $user_ids IDs of the users whose private messages we want to delete +* +* @return boolean False if there were no pms found, true otherwise. +*/ +function phpbb_delete_users_pms($user_ids) +{ + global $db, $user, $phpbb_root_path, $phpEx; + + $user_id_sql = $db->sql_in_set('user_id', $user_ids); + $author_id_sql = $db->sql_in_set('author_id', $user_ids); + // Get PM Information for later deleting // The two queries where split, so we can use our indexes + $undelivered_msg = $delete_ids = array(); + // Part 1: get PMs the user received - $sql = 'SELECT msg_id, author_id, folder_id, pm_unread, pm_new + $sql = 'SELECT msg_id FROM ' . PRIVMSGS_TO_TABLE . ' - WHERE user_id = ' . $user_id; + WHERE ' . $user_id_sql; $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']; + $msg_id = (int) $row['msg_id']; + $delete_ids[$msg_id] = $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 + // Part 2: get PMs the users sent, but are yet to be received. + // We cannot simply delete them. First we have to check + // whether another user already received and read the message. + $sql = 'SELECT msg_id FROM ' . PRIVMSGS_TO_TABLE . ' - WHERE author_id = ' . $user_id . ' - AND folder_id = ' . PRIVMSGS_NO_BOX; + WHERE ' . $author_id_sql . ' + 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']; + $msg_id = (int) $row['msg_id']; + $undelivered_msg[$msg_id] = $msg_id; } $db->sql_freeresult($result); - if (empty($delete_ids)) + if (empty($delete_ids) && empty($undelivered_msg)) { 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); - } + if (!empty($undelivered_msg)) + { + // A pm is delivered, if for any recipient the message was moved + // from their NO_BOX to another folder. We do not delete such + // messages, but only delete them for users, who have not yet + // received them. + $sql = 'SELECT msg_id + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE ' . $author_id_sql . ' + AND folder_id <> ' . PRIVMSGS_NO_BOX . ' + AND folder_id <> ' . PRIVMSGS_OUTBOX . ' + AND folder_id <> ' . PRIVMSGS_SENTBOX; + $result = $db->sql_query($sql); - // Reset the users 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]); - } + $delivered_msg = array(); + while ($row = $db->sql_fetchrow($result)) + { + $msg_id = (int) $row['msg_id']; + $delivered_msg[$msg_id] = $msg_id; + unset($undelivered_msg[$msg_id]); + } + $db->sql_freeresult($result); - 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); - } + $undelivered_user = array(); - // 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); + // Count the messages we delete, so we can correct the user pm data + $sql = 'SELECT user_id, COUNT(msg_id) as num_undelivered_privmsgs + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE ' . $author_id_sql . ' + AND folder_id = ' . PRIVMSGS_NO_BOX . ' + AND ' . $db->sql_in_set('msg_id', array_merge($undelivered_msg, $delivered_msg)) . ' + GROUP BY user_id'; + $result = $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)) + { + $num_pms = (int) $row['num_undelivered_privmsgs']; + $undelivered_user[$num_pms][] = (int) $row['user_id']; - while ($row = $db->sql_fetchrow($result)) - { - unset($delete_ids[$row['msg_id']]); + if (sizeof($undelivered_user[$num_pms]) > 50) + { + // If there are too many users affected the query might get + // too long, so we update the value for the first bunch here. + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_new_privmsg = user_new_privmsg - ' . $num_pms . ', + user_unread_privmsg = user_unread_privmsg - ' . $num_pms . ' + WHERE ' . $db->sql_in_set('user_id', $undelivered_user[$num_pms]); + $db->sql_query($sql); + unset($undelivered_user[$num_pms]); + } + } + $db->sql_freeresult($result); + + foreach ($undelivered_user as $num_pms => $undelivered_user_set) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_new_privmsg = user_new_privmsg - ' . $num_pms . ', + user_unread_privmsg = user_unread_privmsg - ' . $num_pms . ' + WHERE ' . $db->sql_in_set('user_id', $undelivered_user_set); + $db->sql_query($sql); + } + + if (!empty($delivered_msg)) + { + $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE folder_id = ' . PRIVMSGS_NO_BOX . ' + AND ' . $db->sql_in_set('msg_id', $delivered_msg); + $db->sql_query($sql); + } + + if (!empty($undelivered_msg)) + { + $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg); + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' + WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg); + $db->sql_query($sql); + } } - $db->sql_freeresult($result); + + // Reset the user's pm count to 0 + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_new_privmsg = 0, + user_unread_privmsg = 0 + WHERE ' . $user_id_sql; + $db->sql_query($sql); + + // Delete private message data of the user + $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE ' . $user_id_sql; + $db->sql_query($sql); if (!empty($delete_ids)) { - // Check if there are any attachments we need to remove - if (!function_exists('delete_attachments')) + // 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)) { - include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + unset($delete_ids[$row['msg_id']]); } + $db->sql_freeresult($result); - delete_attachments('message', $delete_ids, false); + 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); + } - $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' - WHERE ' . $db->sql_in_set('msg_id', $delete_ids); - $db->sql_query($sql); + 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; + WHERE ' . $author_id_sql; $db->sql_query($sql); $sql = 'UPDATE ' . PRIVMSGS_TABLE . ' SET author_id = ' . ANONYMOUS . ' - WHERE author_id = ' . $user_id; + WHERE ' . $author_id_sql; $db->sql_query($sql); $db->sql_transaction('commit'); @@ -2052,7 +2108,7 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode 'SUBJECT' => $subject, 'SENT_DATE' => $user->format_date($row['message_time']), 'MESSAGE' => $message, - 'FOLDER' => implode(', ', $row['folder']), + 'FOLDER' => implode($user->lang['COMMA_SEPARATOR'], $row['folder']), 'DECODED_MESSAGE' => $decoded_message, 'S_CURRENT_MSG' => ($row['msg_id'] == $msg_id), diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 3399334f94..10af997bff 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -121,7 +121,7 @@ class custom_profile case FIELD_BOOL: $field_value = (bool) $field_value; - + if (!$field_value && $field_data['field_required']) { return 'FIELD_REQUIRED'; @@ -133,7 +133,7 @@ class custom_profile { return false; } - + $field_value = (int) $field_value; if ($field_value < $field_data['field_minlen']) @@ -455,6 +455,8 @@ class custom_profile $user_fields = array(); + $user_ids = $user_id; + // Go through the fields in correct order foreach (array_keys($this->profile_cache) as $used_ident) { @@ -463,6 +465,15 @@ class custom_profile $user_fields[$user_id][$used_ident]['value'] = $row['pf_' . $used_ident]; $user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident]; } + + foreach ($user_ids as $user_id) + { + if (!isset($user_fields[$user_id][$used_ident]) && $this->profile_cache[$used_ident]['field_show_novalue']) + { + $user_fields[$user_id][$used_ident]['value'] = ''; + $user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident]; + } + } } return $user_fields; @@ -520,7 +531,7 @@ class custom_profile switch ($this->profile_types[$field_type]) { case 'int': - if ($value === '') + if ($value === '' && !$ident_ary['data']['field_show_novalue']) { return NULL; } @@ -529,7 +540,7 @@ class custom_profile case 'string': case 'text': - if (!$value) + if (!$value && !$ident_ary['data']['field_show_novalue']) { return NULL; } @@ -547,16 +558,19 @@ class custom_profile $month = (isset($date[1])) ? (int) $date[1] : 0; $year = (isset($date[2])) ? (int) $date[2] : 0; - if (!$day && !$month && !$year) + if (!$day && !$month && !$year && !$ident_ary['data']['field_show_novalue']) { return NULL; } 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; @@ -570,12 +584,7 @@ class custom_profile $this->get_option_lang($field_id, $lang_id, FIELD_DROPDOWN, false); } - // If a dropdown field is required, users - // cannot choose the "no value" option. - // They must choose one of the other options. - // Therefore, here we treat a value equal to - // the "no value" as a lack of value, i.e. NULL. - if ($value == $ident_ary['data']['field_novalue'] && $ident_ary['data']['field_required']) + if ($value == $ident_ary['data']['field_novalue'] && !$ident_ary['data']['field_show_novalue']) { return NULL; } @@ -585,7 +594,14 @@ class custom_profile // User not having a value assigned if (!isset($this->options_lang[$field_id][$lang_id][$value])) { - return NULL; + if ($ident_ary['data']['field_show_novalue']) + { + $value = $ident_ary['data']['field_novalue']; + } + else + { + return NULL; + } } return $this->options_lang[$field_id][$lang_id][$value]; @@ -599,6 +615,11 @@ class custom_profile $this->get_option_lang($field_id, $lang_id, FIELD_BOOL, false); } + if (!$value && $ident_ary['data']['field_show_novalue']) + { + $value = $ident_ary['data']['field_default_value']; + } + if ($ident_ary['data']['field_length'] == 1) { return (isset($this->options_lang[$field_id][$lang_id][(int) $value])) ? $this->options_lang[$field_id][$lang_id][(int) $value] : NULL; diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index f70e20e616..b467aa93d1 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -151,7 +151,7 @@ class filespec */ function is_image() { - return (strpos($this->mimetype, 'image/') !== false) ? true : false; + return (strpos($this->mimetype, 'image/') === 0); } /** @@ -566,10 +566,11 @@ class fileupload */ function form_upload($form_name) { - global $user; + global $user, $request; - unset($_FILES[$form_name]['local_mode']); - $file = new filespec($_FILES[$form_name], $this); + $upload = $request->file($form_name); + unset($upload['local_mode']); + $file = new filespec($upload, $this); if ($file->init_error) { @@ -578,9 +579,9 @@ class fileupload } // Error array filled? - if (isset($_FILES[$form_name]['error'])) + if (isset($upload['error'])) { - $error = $this->assign_internal_error($_FILES[$form_name]['error']); + $error = $this->assign_internal_error($upload['error']); if ($error !== false) { @@ -590,7 +591,7 @@ class fileupload } // Check if empty file got uploaded (not catched by is_uploaded_file) - if (isset($_FILES[$form_name]['size']) && $_FILES[$form_name]['size'] == 0) + if (isset($upload['size']) && $upload['size'] == 0) { $file->error[] = $user->lang[$this->error_prefix . 'EMPTY_FILEUPLOAD']; return $file; @@ -631,17 +632,17 @@ class fileupload */ function local_upload($source_file, $filedata = false) { - global $user; + global $user, $request; - $form_name = 'local'; + $upload = array(); - $_FILES[$form_name]['local_mode'] = true; - $_FILES[$form_name]['tmp_name'] = $source_file; + $upload['local_mode'] = true; + $upload['tmp_name'] = $source_file; if ($filedata === false) { - $_FILES[$form_name]['name'] = utf8_basename($source_file); - $_FILES[$form_name]['size'] = 0; + $upload['name'] = utf8_basename($source_file); + $upload['size'] = 0; $mimetype = ''; if (function_exists('mime_content_type')) @@ -655,16 +656,16 @@ class fileupload $mimetype = 'application/octetstream'; } - $_FILES[$form_name]['type'] = $mimetype; + $upload['type'] = $mimetype; } else { - $_FILES[$form_name]['name'] = $filedata['realname']; - $_FILES[$form_name]['size'] = $filedata['size']; - $_FILES[$form_name]['type'] = $filedata['type']; + $upload['name'] = $filedata['realname']; + $upload['size'] = $filedata['size']; + $upload['type'] = $filedata['type']; } - $file = new filespec($_FILES[$form_name], $this); + $file = new filespec($upload, $this); if ($file->init_error) { @@ -672,9 +673,9 @@ class fileupload return $file; } - if (isset($_FILES[$form_name]['error'])) + if (isset($upload['error'])) { - $error = $this->assign_internal_error($_FILES[$form_name]['error']); + $error = $this->assign_internal_error($upload['error']); if ($error !== false) { @@ -709,6 +710,7 @@ class fileupload } $this->common_checks($file); + $request->overwrite('local', $upload, phpbb_request_interface::FILES); return $file; } @@ -1001,7 +1003,10 @@ class fileupload */ function is_valid($form_name) { - return (isset($_FILES[$form_name]) && $_FILES[$form_name]['name'] != 'none') ? true : false; + global $request; + $upload = $request->file($form_name); + + return (!empty($upload) && $upload['name'] !== 'none'); } diff --git a/phpBB/includes/functions_url_matcher.php b/phpBB/includes/functions_url_matcher.php new file mode 100644 index 0000000000..7280cb74eb --- /dev/null +++ b/phpBB/includes/functions_url_matcher.php @@ -0,0 +1,106 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2005 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +use Symfony\Component\Routing\Matcher\Dumper\PhpMatcherDumper; +use Symfony\Component\Routing\Matcher\UrlMatcher; +use Symfony\Component\Routing\RequestContext; + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** +* Create a new UrlMatcher class and dump it into the cache file +* +* @param phpbb_extension_finder $finder Extension finder +* @param RequestContext $context Symfony RequestContext object +* @param string $root_path Root path +* @param string $php_ext PHP extension +* @return null +*/ +function phpbb_get_url_matcher(phpbb_extension_finder $finder, RequestContext $context, $root_path, $php_ext) +{ + if (defined('DEBUG')) + { + return phpbb_create_url_matcher($finder, $context); + } + + if (!phpbb_url_matcher_dumped($root_path, $php_ext)) + { + phpbb_create_dumped_url_matcher($finder, $root_path, $php_ext); + } + + return phpbb_load_url_matcher($context, $root_path, $php_ext); +} + +/** +* Create a new UrlMatcher class and dump it into the cache file +* +* @param phpbb_extension_finder $finder Extension finder +* @param string $root_path Root path +* @param string $php_ext PHP extension +* @return null +*/ +function phpbb_create_dumped_url_matcher(phpbb_extension_finder $finder, $root_path, $php_ext) +{ + $provider = new phpbb_controller_provider(); + $routes = $provider->import_paths_from_finder($finder)->find(); + $dumper = new PhpMatcherDumper($routes); + $cached_url_matcher_dump = $dumper->dump(array( + 'class' => 'phpbb_url_matcher', + )); + + file_put_contents($root_path . 'cache/url_matcher' . $php_ext, $cached_url_matcher_dump); +} + +/** +* Create a non-cached UrlMatcher +* +* @param phpbb_extension_finder $finder Extension finder +* @param RequestContext $context Symfony RequestContext object +* @return UrlMatcher +*/ +function phpbb_create_url_matcher(phpbb_extension_finder $finder, RequestContext $context) +{ + $provider = new phpbb_controller_provider(); + $routes = $provider->import_paths_from_finder($finder)->find(); + return new UrlMatcher($routes, $context); +} + +/** +* Load the cached phpbb_url_matcher class +* +* @param RequestContext $context Symfony RequestContext object +* @param string $root_path Root path +* @param string $php_ext PHP extension +* @return phpbb_url_matcher +*/ +function phpbb_load_url_matcher(RequestContext $context, $root_path, $php_ext) +{ + require($root_path . 'cache/url_matcher' . $php_ext); + return new phpbb_url_matcher($context); +} + +/** +* Determine whether we have our dumped URL matcher +* +* The class is automatically dumped to the cache directory +* +* @param string $root_path Root path +* @param string $php_ext PHP extension +* @return bool True if it exists, false if not +*/ +function phpbb_url_matcher_dumped($root_path, $php_ext) +{ + return file_exists($root_path . 'cache/url_matcher' . $php_ext); +} diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 8533e47bc4..aeb9c8dd5c 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -112,7 +112,7 @@ function update_last_username() */ function user_update_name($old_name, $new_name) { - global $config, $db, $cache; + global $config, $db, $cache, $phpbb_dispatcher; $update_ary = array( FORUMS_TABLE => array('forum_last_poster_name'), @@ -137,6 +137,17 @@ function user_update_name($old_name, $new_name) set_config('newest_username', $new_name, true); } + /** + * Update a username when it is changed + * + * @event core.update_username + * @var string old_name The old username that is replaced + * @var string new_name The new username + * @since 3.1-A1 + */ + $vars = array('old_name', 'new_name'); + extract($phpbb_dispatcher->trigger_event('core.update_username', compact($vars))); + // Because some tables/caches use username-specific data we need to purge this here. $cache->destroy('sql', MODERATOR_CACHE_TABLE); } @@ -151,6 +162,7 @@ function user_update_name($old_name, $new_name) function user_add($user_row, $cp_data = false) { global $db, $user, $auth, $config, $phpbb_root_path, $phpEx; + global $phpbb_dispatcher; if (empty($user_row['username']) || !isset($user_row['group_id']) || !isset($user_row['user_email']) || !isset($user_row['user_type'])) { @@ -197,7 +209,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' => '', @@ -245,6 +256,16 @@ function user_add($user_row, $cp_data = false) } } + /** + * Use this event to modify the values to be inserted when a user is added + * + * @event core.user_add_modify_data + * @var array sql_ary Array of data to be inserted when a user is added + * @since 3.1-A1 + */ + $vars = array('sql_ary'); + extract($phpbb_dispatcher->trigger_event('core.user_add_modify_data', compact($vars))); + $sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); $db->sql_query($sql); @@ -329,28 +350,54 @@ function user_add($user_row, $cp_data = false) /** * Remove User +* @param $mode Either 'retain' or 'remove' */ -function user_delete($mode, $user_id, $post_username = false) +function user_delete($mode, $user_ids, $retain_username = true) { - global $cache, $config, $db, $user, $auth; + global $cache, $config, $db, $user, $auth, $phpbb_dispatcher; global $phpbb_root_path, $phpEx; + $db->sql_transaction('begin'); + + $user_rows = array(); + if (!is_array($user_ids)) + { + $user_ids = array($user_ids); + } + + $user_id_sql = $db->sql_in_set('user_id', $user_ids); + $sql = 'SELECT * FROM ' . USERS_TABLE . ' - WHERE user_id = ' . $user_id; + WHERE ' . $user_id_sql; $result = $db->sql_query($sql); - $user_row = $db->sql_fetchrow($result); + while ($row = $db->sql_fetchrow($result)) + { + $user_rows[(int) $row['user_id']] = $row; + } $db->sql_freeresult($result); - if (!$user_row) + if (empty($user_rows)) { return false; } + /** + * Event before a user is deleted + * + * @event core.delete_user_before + * @var string mode Mode of deletion (retain/delete posts) + * @var int user_id ID of the deleted user + * @var mixed post_username Guest username that is being used or false + * @since 3.1-A1 + */ + $vars = array('mode', 'user_id', 'post_username'); + extract($phpbb_dispatcher->trigger_event('core.delete_user_before', compact($vars))); + // Before we begin, we will remove the reports the user issued. $sql = 'SELECT r.post_id, p.topic_id FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p - WHERE r.user_id = ' . $user_id . ' + WHERE ' . $db->sql_in_set('r.user_id', $user_ids) . ' AND p.post_id = r.post_id'; $result = $db->sql_query($sql); @@ -404,97 +451,124 @@ function user_delete($mode, $user_id, $post_username = false) } // Remove reports - $db->sql_query('DELETE FROM ' . REPORTS_TABLE . ' WHERE user_id = ' . $user_id); + $db->sql_query('DELETE FROM ' . REPORTS_TABLE . ' WHERE ' . $user_id_sql); - if ($user_row['user_avatar'] && $user_row['user_avatar_type'] == AVATAR_UPLOAD) - { - avatar_delete('user', $user_row); - } + $num_users_delta = 0; - switch ($mode) + // Some things need to be done in the loop (if the query changes based + // on which user is currently being deleted) + $added_guest_posts = 0; + foreach ($user_rows as $user_id => $user_row) { - case 'retain': - - $db->sql_transaction('begin'); - - if ($post_username === false) - { - $post_username = $user->lang['GUEST']; - } + if ($user_row['user_avatar'] && $user_row['user_avatar_type'] == AVATAR_UPLOAD) + { + avatar_delete('user', $user_row); + } - // If the user is inactive and newly registered we assume no posts from this user being there... - if ($user_row['user_type'] == USER_INACTIVE && $user_row['user_inactive_reason'] == INACTIVE_REGISTER && !$user_row['user_posts']) - { - } - else - { - $sql = 'UPDATE ' . FORUMS_TABLE . ' - SET forum_last_poster_id = ' . ANONYMOUS . ", forum_last_poster_name = '" . $db->sql_escape($post_username) . "', forum_last_poster_colour = '' - WHERE forum_last_poster_id = $user_id"; - $db->sql_query($sql); + // Decrement number of users if this user is active + if ($user_row['user_type'] != USER_INACTIVE && $user_row['user_type'] != USER_IGNORE) + { + --$num_users_delta; + } - $sql = 'UPDATE ' . POSTS_TABLE . ' - SET poster_id = ' . ANONYMOUS . ", post_username = '" . $db->sql_escape($post_username) . "' - WHERE poster_id = $user_id"; - $db->sql_query($sql); + switch ($mode) + { + case 'retain': + if ($retain_username === false) + { + $post_username = $user->lang['GUEST']; + } + else + { + $post_username = $user_row['username']; + } - $sql = 'UPDATE ' . POSTS_TABLE . ' - SET post_edit_user = ' . ANONYMOUS . " - WHERE post_edit_user = $user_id"; - $db->sql_query($sql); + // If the user is inactive and newly registered + // we assume no posts from the user, and save + // the queries + if ($user_row['user_type'] != USER_INACTIVE || $user_row['user_inactive_reason'] != INACTIVE_REGISTER || $user_row['user_posts']) + { + // When we delete these users and retain the posts, we must assign all the data to the guest user + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET forum_last_poster_id = ' . ANONYMOUS . ", forum_last_poster_name = '" . $db->sql_escape($post_username) . "', forum_last_poster_colour = '' + WHERE forum_last_poster_id = $user_id"; + $db->sql_query($sql); - $sql = 'UPDATE ' . TOPICS_TABLE . ' - SET topic_poster = ' . ANONYMOUS . ", topic_first_poster_name = '" . $db->sql_escape($post_username) . "', topic_first_poster_colour = '' - WHERE topic_poster = $user_id"; - $db->sql_query($sql); + $sql = 'UPDATE ' . POSTS_TABLE . ' + SET poster_id = ' . ANONYMOUS . ", post_username = '" . $db->sql_escape($post_username) . "' + WHERE poster_id = $user_id"; + $db->sql_query($sql); - $sql = 'UPDATE ' . TOPICS_TABLE . ' - SET topic_last_poster_id = ' . ANONYMOUS . ", topic_last_poster_name = '" . $db->sql_escape($post_username) . "', topic_last_poster_colour = '' - WHERE topic_last_poster_id = $user_id"; - $db->sql_query($sql); + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_poster = ' . ANONYMOUS . ", topic_first_poster_name = '" . $db->sql_escape($post_username) . "', topic_first_poster_colour = '' + WHERE topic_poster = $user_id"; + $db->sql_query($sql); - $sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' - SET poster_id = ' . ANONYMOUS . " - WHERE poster_id = $user_id"; - $db->sql_query($sql); + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_last_poster_id = ' . ANONYMOUS . ", topic_last_poster_name = '" . $db->sql_escape($post_username) . "', topic_last_poster_colour = '' + WHERE topic_last_poster_id = $user_id"; + $db->sql_query($sql); - // Since we change every post by this author, we need to count this amount towards the anonymous user + // Since we change every post by this author, we need to count this amount towards the anonymous user - // Update the post count for the anonymous user - if ($user_row['user_posts']) - { - $sql = 'UPDATE ' . USERS_TABLE . ' - SET user_posts = user_posts + ' . $user_row['user_posts'] . ' - WHERE user_id = ' . ANONYMOUS; - $db->sql_query($sql); + if ($user_row['user_posts']) + { + $added_guest_posts += $user_row['user_posts']; + } } - } - - $db->sql_transaction('commit'); + break; - break; + case 'remove': + // there is nothing variant specific to deleting posts + break; + } + } - case 'remove': + if ($num_users_delta != 0) + { + set_config_count('num_users', $num_users_delta, true); + } - if (!function_exists('delete_posts')) - { - include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); - } + // Now do the invariant tasks + // all queries performed in one call of this function are in a single transaction + // so this is kosher + if ($mode == 'retain') + { + // Assign more data to the Anonymous user + $sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' + SET poster_id = ' . ANONYMOUS . ' + WHERE ' . $db->sql_in_set('poster_id', $user_ids); + $db->sql_query($sql); - // Delete posts, attachments, etc. - delete_posts('poster_id', $user_id); + $sql = 'UPDATE ' . POSTS_TABLE . ' + SET post_edit_user = ' . ANONYMOUS . ' + WHERE ' . $db->sql_in_set('post_edit_user', $user_ids); + $db->sql_query($sql); - break; + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_posts = user_posts + ' . $added_guest_posts . ' + WHERE user_id = ' . ANONYMOUS; + $db->sql_query($sql); } + else if ($mode == 'remove') + { + if (!function_exists('delete_posts')) + { + include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + } - $db->sql_transaction('begin'); + // Delete posts, attachments, etc. + // delete_posts can handle any number of IDs in its second argument + delete_posts('poster_id', $user_ids); + } $table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE, SESSIONS_KEYS_TABLE, PRIVMSGS_FOLDER_TABLE, PRIVMSGS_RULES_TABLE); + // Delete the miscellaneous (non-post) data for the user foreach ($table_ary as $table) { $sql = "DELETE FROM $table - WHERE user_id = $user_id"; + WHERE " . $user_id_sql; $db->sql_query($sql); } @@ -502,29 +576,29 @@ function user_delete($mode, $user_id, $post_username = false) // Delete user log entries about this user $sql = 'DELETE FROM ' . LOG_TABLE . ' - WHERE reportee_id = ' . $user_id; + WHERE ' . $db->sql_in_set('reportee_id', $user_ids); $db->sql_query($sql); // Change user_id to anonymous for this users triggered events $sql = 'UPDATE ' . LOG_TABLE . ' SET user_id = ' . ANONYMOUS . ' - WHERE user_id = ' . $user_id; + WHERE ' . $user_id_sql; $db->sql_query($sql); // Delete the user_id from the zebra table $sql = 'DELETE FROM ' . ZEBRA_TABLE . ' - WHERE user_id = ' . $user_id . ' - OR zebra_id = ' . $user_id; + WHERE ' . $user_id_sql . ' + OR ' . $db->sql_in_set('zebra_id', $user_ids); $db->sql_query($sql); // Delete the user_id from the banlist $sql = 'DELETE FROM ' . BANLIST_TABLE . ' - WHERE ban_userid = ' . $user_id; + WHERE ' . $db->sql_in_set('ban_userid', $user_ids); $db->sql_query($sql); // Delete the user_id from the session table $sql = 'DELETE FROM ' . SESSIONS_TABLE . ' - WHERE session_user_id = ' . $user_id; + WHERE ' . $db->sql_in_set('session_user_id', $user_ids); $db->sql_query($sql); // Clean the private messages tables from the user @@ -532,22 +606,28 @@ function user_delete($mode, $user_id, $post_username = false) { include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); } - phpbb_delete_user_pms($user_id); + phpbb_delete_users_pms($user_ids); $db->sql_transaction('commit'); + /** + * Event after a user is deleted + * + * @event core.delete_user_after + * @var string mode Mode of deletion (retain/delete posts) + * @var int user_id ID of the deleted user + * @var mixed post_username Guest username that is being used or false + * @since 3.1-A1 + */ + $vars = array('mode', 'user_id', 'post_username'); + extract($phpbb_dispatcher->trigger_event('core.delete_user_after', compact($vars))); + // Reset newest user info if appropriate - if ($config['newest_user_id'] == $user_id) + if (in_array($config['newest_user_id'], $user_ids)) { update_last_username(); } - // Decrement number of users if this user is active - if ($user_row['user_type'] != USER_INACTIVE && $user_row['user_type'] != USER_IGNORE) - { - set_config_count('num_users', -1, true); - } - return false; } @@ -677,8 +757,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 { @@ -1247,10 +1329,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); + } } } } @@ -1396,6 +1489,22 @@ function validate_language_iso_name($lang_iso) } /** +* 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. * Used for registering, changing names, and posting anonymously with a username @@ -2031,13 +2140,14 @@ function avatar_remote($data, &$error) */ function avatar_upload($data, &$error) { - global $phpbb_root_path, $config, $db, $user, $phpEx; + global $phpbb_root_path, $config, $db, $user, $phpEx, $request; // Init upload class include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx); $upload = new fileupload('AVATAR_', array('jpg', 'jpeg', 'gif', 'png'), $config['avatar_filesize'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], (isset($config['mime_triggers']) ? explode('|', $config['mime_triggers']) : false)); - if (!empty($_FILES['uploadfile']['name'])) + $uploadfile = $request->file('uploadfile'); + if (!empty($uploadfile['name'])) { $file = $upload->form_upload('uploadfile'); } @@ -2260,7 +2370,7 @@ function avatar_get_dimensions($avatar, $avatar_type, &$error, $current_x = 0, $ */ function avatar_process_user(&$error, $custom_userdata = false, $can_upload = null) { - global $config, $phpbb_root_path, $auth, $user, $db; + global $config, $phpbb_root_path, $auth, $user, $db, $request; $data = array( 'uploadurl' => request_var('uploadurl', ''), @@ -2302,7 +2412,8 @@ function avatar_process_user(&$error, $custom_userdata = false, $can_upload = nu $can_upload = ($config['allow_avatar_upload'] && file_exists($phpbb_root_path . $config['avatar_path']) && phpbb_is_writable($phpbb_root_path . $config['avatar_path']) && $change_avatar && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false; } - if ((!empty($_FILES['uploadfile']['name']) || $data['uploadurl']) && $can_upload) + $uploadfile = $request->file('uploadfile'); + if ((!empty($uploadfile['name']) || $data['uploadurl']) && $can_upload) { list($sql_ary['user_avatar_type'], $sql_ary['user_avatar'], $sql_ary['user_avatar_width'], $sql_ary['user_avatar_height']) = avatar_upload($data, $error); } @@ -2731,7 +2842,7 @@ function avatar_remove_db($avatar_name) */ function group_delete($group_id, $group_name = false) { - global $db, $phpbb_root_path, $phpEx; + global $db, $phpbb_root_path, $phpEx, $phpbb_dispatcher; if (!$group_name) { @@ -2790,6 +2901,17 @@ function group_delete($group_id, $group_name = false) WHERE group_id = $group_id"; $db->sql_query($sql); + /** + * Event after a group is deleted + * + * @event core.delete_group_after + * @var int group_id ID of the deleted group + * @var string group_name Name of the deleted group + * @since 3.1-A1 + */ + $vars = array('group_id', 'group_name'); + extract($phpbb_dispatcher->trigger_event('core.delete_group_after', compact($vars))); + // Re-cache moderators if (!function_exists('cache_moderators')) { @@ -2912,7 +3034,7 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false, */ function group_user_del($group_id, $user_id_ary = false, $username_ary = false, $group_name = false) { - global $db, $auth, $config; + global $db, $auth, $config, $phpbb_dispatcher; if ($config['coppa_enable']) { @@ -3011,6 +3133,19 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false, } unset($special_group_data); + /** + * Event before users are removed from a group + * + * @event core.group_delete_user_before + * @var int group_id ID of the group from which users are deleted + * @var string group_name Name of the group + * @var array user_id_ary IDs of the users which are removed + * @var array username_ary names of the users which are removed + * @since 3.1-A1 + */ + $vars = array('group_id', 'group_name', 'user_id_ary', 'username_ary'); + extract($phpbb_dispatcher->trigger_event('core.group_delete_user_before', compact($vars))); + $sql = 'DELETE FROM ' . USER_GROUP_TABLE . " WHERE group_id = $group_id AND " . $db->sql_in_set('user_id', $user_id_ary); @@ -3328,7 +3463,7 @@ function group_validate_groupname($group_id, $group_name) */ function group_set_user_default($group_id, $user_id_ary, $group_attributes = false, $update_listing = false) { - global $cache, $db; + global $cache, $db, $phpbb_dispatcher; if (empty($user_id_ary)) { @@ -3424,6 +3559,20 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal } } + /** + * Event when the default group is set for an array of users + * + * @event core.user_set_default_group + * @var int group_id ID of the group + * @var array user_id_ary IDs of the users + * @var array group_attributes Group attributes which were changed + * @var array update_listing Update the list of moderators and foes + * @var array sql_ary User attributes which were changed + * @since 3.1-A1 + */ + $vars = array('group_id', 'user_id_ary', 'group_attributes', 'update_listing', 'sql_ary'); + extract($phpbb_dispatcher->trigger_event('core.user_set_default_group', compact($vars))); + if ($update_listing) { group_update_listings($group_id); diff --git a/phpBB/includes/group_positions.php b/phpBB/includes/group_positions.php index 74de3516cb..60352ed97d 100644 --- a/phpBB/includes/group_positions.php +++ b/phpBB/includes/group_positions.php @@ -104,7 +104,7 @@ class phpbb_group_positions * Addes a group by group_id * * @param int $group_id group_id of the group to be added - * @return void + * @return null */ public function add_group($group_id) { @@ -128,7 +128,7 @@ class phpbb_group_positions * * @param int $group_id group_id of the group to be deleted * @param bool $skip_group Skip setting the group to GROUP_DISABLED, to save the query, when you need to update it anyway. - * @return void + * @return null */ public function delete_group($group_id, $skip_group = false) { @@ -159,7 +159,7 @@ class phpbb_group_positions * Moves a group up by group_id * * @param int $group_id group_id of the group to be moved - * @return void + * @return null */ public function move_up($group_id) { @@ -170,7 +170,7 @@ class phpbb_group_positions * Moves a group down by group_id * * @param int $group_id group_id of the group to be moved - * @return void + * @return null */ public function move_down($group_id) { @@ -184,7 +184,7 @@ class phpbb_group_positions * @param int $delta number of steps: * - positive = move up * - negative = move down - * @return void + * @return null */ public function move($group_id, $delta) { diff --git a/phpBB/includes/lock/db.php b/phpBB/includes/lock/db.php index fa559d6887..6e94dd5a85 100644 --- a/phpBB/includes/lock/db.php +++ b/phpBB/includes/lock/db.php @@ -125,7 +125,7 @@ class phpbb_lock_db * Note: Attempting to release a lock that is already released, * that is, calling release() multiple times, is harmless. * - * @return void + * @return null */ public function release() { diff --git a/phpBB/includes/lock/flock.php b/phpBB/includes/lock/flock.php new file mode 100644 index 0000000000..97bc7dd2b9 --- /dev/null +++ b/phpBB/includes/lock/flock.php @@ -0,0 +1,133 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** +* File locking class +* @package phpBB3 +*/ +class phpbb_lock_flock +{ + /** + * Path to the file to which access is controlled + * + * @var string + */ + private $path; + + /** + * File pointer for the lock file + * @var string + */ + private $lock_fp; + + /** + * Constructor. + * + * You have to call acquire() to actually acquire the lock. + * + * @param string $path Path to the file to which access is controlled + */ + public function __construct($path) + { + $this->path = $path; + $this->lock_fp = null; + } + + /** + * Tries to acquire the lock. + * + * If the lock is already held by another process, this call will block + * until the other process releases the lock. If a lock is acquired and + * is not released before script finishes but the process continues to + * live (apache/fastcgi) then subsequent processes trying to acquire + * the same lock will be blocked forever. + * + * If the lock is already held by the same process via another instance + * of this class, this call will block forever. + * + * If flock function is disabled in php or fails to work, lock + * acquisition will fail and false will be returned. + * + * @return bool true if lock was acquired + * false otherwise + */ + public function acquire() + { + if ($this->lock_fp) + { + return false; + } + + // For systems that can't have two processes opening + // one file for writing simultaneously + if (file_exists($this->path . '.lock')) + { + $mode = 'rb'; + } + else + { + $mode = 'wb'; + } + + $this->lock_fp = @fopen($this->path . '.lock', $mode); + + if ($mode == 'wb') + { + if (!$this->lock_fp) + { + // Two processes may attempt to create lock file at the same time. + // Have the losing process try opening the lock file again for reading + // on the assumption that the winning process created it + $mode = 'rb'; + $this->lock_fp = @fopen($this->path . '.lock', $mode); + } + else + { + // Only need to set mode when the lock file is written + @chmod($this->path . '.lock', 0666); + } + } + + if ($this->lock_fp) + { + @flock($this->lock_fp, LOCK_EX); + } + + return (bool) $this->lock_fp; + } + + /** + * Releases the lock. + * + * The lock must have been previously obtained, that is, acquire() call + * was issued and returned true. + * + * Note: Attempting to release a lock that is already released, + * that is, calling release() multiple times, is harmless. + * + * @return null + */ + public function release() + { + if ($this->lock_fp) + { + @flock($this->lock_fp, LOCK_UN); + fclose($this->lock_fp); + $this->lock_fp = null; + } + } +} diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index fec1edc872..4dd5e5856a 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -22,7 +22,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) { global $template, $db, $user, $auth, $cache, $module; global $phpEx, $phpbb_root_path, $config; - global $request; + global $request, $phpbb_dispatcher; $user->add_lang(array('viewtopic', 'viewforum')); @@ -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), )); @@ -286,6 +288,17 @@ function mcp_forum_view($id, $mode, $action, $forum_info) )); } + /** + * Modify the topic data before it is assigned to the template in MCP + * + * @event core.mcp_view_forum_modify_topicrow + * @var array row Array with topic data + * @var array topic_row Template array with topic data + * @since 3.1-A1 + */ + $vars = array('row', 'topic_row'); + extract($phpbb_dispatcher->trigger_event('core.mcp_view_forum_modify_topicrow', compact($vars))); + $template->assign_block_vars('topicrow', $topic_row); } unset($topic_rows); @@ -433,7 +446,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id) confirm_box(false, 'MERGE_TOPICS', $s_hidden_fields); } - $redirect = request_var('redirect', "index.$phpEx"); + $redirect = request_var('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&t=$to_topic_id"); $redirect = reapply_sid($redirect); if (!$success_msg) @@ -442,7 +455,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id) } else { - meta_refresh(3, append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$to_forum_id&t=$to_topic_id")); + meta_refresh(3, $redirect); trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link); } } diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index 13398e62bc..ba4b15895a 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -251,7 +251,7 @@ function mcp_front_view($id, $mode, $action) 'ORDER_BY' => 'p.message_time DESC', ); - $sql_ary = $db->sql_build_query('SELECT', $sql_ary); + $sql = $db->sql_build_query('SELECT', $sql_ary); $result = $db->sql_query_limit($sql, 5); $pm_by_id = $pm_list = array(); diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php index 848bad40a3..f706840492 100644 --- a/phpBB/includes/mcp/mcp_logs.php +++ b/phpBB/includes/mcp/mcp_logs.php @@ -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'], diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index a21c67924d..95ca7c2e1b 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -915,7 +915,7 @@ function mcp_fork_topic($topic_ids) } $error = false; - $search = new $search_type($error); + $search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user); $search_mode = 'post'; if ($error) diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php index 99dbb8d86d..59cdf3c27e 100644 --- a/phpBB/includes/mcp/mcp_notes.php +++ b/phpBB/includes/mcp/mcp_notes.php @@ -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, diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php index d242929a80..be18dba944 100644 --- a/phpBB/includes/mcp/mcp_pm_reports.php +++ b/phpBB/includes/mcp/mcp_pm_reports.php @@ -291,13 +291,16 @@ class mcp_pm_reports 'REPORT_ID' => $row['report_id'], 'REPORT_TIME' => $user->format_date($row['report_time']), - 'RECIPIENTS' => implode(', ', $address_list[$row['msg_id']]), + 'RECIPIENTS' => implode($user->lang['COMMA_SEPARATOR'], $address_list[$row['msg_id']]), 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $row['message_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', )); } } } + $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), ) diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index 2a52a858b3..520c964228 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -393,7 +393,7 @@ function mcp_post_details($id, $mode, $action) */ function change_poster(&$post_info, $userdata) { - global $auth, $db, $config, $phpbb_root_path, $phpEx; + global $auth, $db, $config, $phpbb_root_path, $phpEx, $user; if (empty($userdata) || $userdata['user_id'] == $post_info['user_id']) { @@ -470,7 +470,7 @@ function change_poster(&$post_info, $userdata) { // We do some additional checks in the module to ensure it can actually be utilised $error = false; - $search = new $search_type($error); + $search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user); if (!$error && method_exists($search, 'destroy_cache')) { diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 4d720a435c..0b195aa9d8 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -419,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'], @@ -430,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), )); diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index 69c6a4cfff..3426d62cdb 100644 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -71,7 +71,7 @@ class mcp_reports // closed reports are accessed by report id $report_id = request_var('r', 0); - $sql = 'SELECT r.post_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, r.reported_post_text, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour + $sql = 'SELECT r.post_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, r.reported_post_text, r.reported_post_uid, r.reported_post_bitfield, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . ' u WHERE ' . (($report_id) ? 'r.report_id = ' . $report_id : "r.post_id = $post_id") . ' AND rr.reason_id = r.reason_id @@ -227,7 +227,7 @@ class mcp_reports 'REPORTER_NAME' => get_username_string('username', $report['user_id'], $report['username'], $report['user_colour']), 'U_VIEW_REPORTER_PROFILE' => get_username_string('profile', $report['user_id'], $report['username'], $report['user_colour']), - 'POST_PREVIEW' => bbcode_nl2br($report['reported_post_text']), + 'POST_PREVIEW' => generate_text_for_display($report['reported_post_text'], $report['reported_post_uid'], $report['reported_post_bitfield'], OPTION_FLAG_BBCODE | OPTION_FLAG_SMILIES, false), 'POST_SUBJECT' => ($post_info['post_subject']) ? $post_info['post_subject'] : $user->lang['NO_SUBJECT'], 'POST_DATE' => $user->format_date($post_info['post_time']), 'POST_IP' => $post_info['poster_ip'], @@ -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), diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index d4ba89b04c..63ff7bed72 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -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), )); } @@ -529,7 +534,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) confirm_box(false, ($action == 'split_all') ? 'SPLIT_TOPIC_ALL' : 'SPLIT_TOPIC_BEYOND', $s_hidden_fields); } - $redirect = request_var('redirect', "index.$phpEx"); + $redirect = request_var('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&t=$to_topic_id"); $redirect = reapply_sid($redirect); if (!$success_msg) @@ -538,7 +543,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) } else { - meta_refresh(3, append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$to_forum_id&t=$to_topic_id")); + meta_refresh(3, $redirect); trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link); } } @@ -635,7 +640,7 @@ function merge_posts($topic_id, $to_topic_id) confirm_box(false, 'MERGE_POSTS', $s_hidden_fields); } - $redirect = request_var('redirect', "index.$phpEx"); + $redirect = request_var('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&t=$to_topic_id"); $redirect = reapply_sid($redirect); if (!$success_msg) @@ -644,7 +649,7 @@ function merge_posts($topic_id, $to_topic_id) } else { - meta_refresh(3, append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$to_forum_id&t=$to_topic_id")); + meta_refresh(3, $redirect); trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link); } } diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index c614beea3b..6a8fb4c5d5 100644 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -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), )); } diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 6695047b56..1cd2a46fa1 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1363,13 +1363,14 @@ class parse_message extends bbcode_firstpass */ function parse_attachments($form_name, $mode, $forum_id, $submit, $preview, $refresh, $is_message = false) { - global $config, $auth, $user, $phpbb_root_path, $phpEx, $db; + global $config, $auth, $user, $phpbb_root_path, $phpEx, $db, $request; $error = array(); $num_attachments = sizeof($this->attachment_data); $this->filename_data['filecomment'] = utf8_normalize_nfc(request_var('filecomment', '', true)); - $upload_file = (isset($_FILES[$form_name]) && $_FILES[$form_name]['name'] != 'none' && trim($_FILES[$form_name]['name'])) ? true : false; + $upload = $request->file($form_name); + $upload_file = (!empty($upload) && $upload['name'] !== 'none' && trim($upload['name'])); $add_file = (isset($_POST['add_file'])) ? true : false; $delete_file = (isset($_POST['delete_file'])) ? true : false; diff --git a/phpBB/includes/questionnaire/questionnaire.php b/phpBB/includes/questionnaire/questionnaire.php index 46a743d7e9..2d29fe978e 100644 --- a/phpBB/includes/questionnaire/questionnaire.php +++ b/phpBB/includes/questionnaire/questionnaire.php @@ -70,7 +70,7 @@ class phpbb_questionnaire_data_collector /** * Collect info into the data property. * - * @return void + * @return null */ function collect() { @@ -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, @@ -477,7 +476,6 @@ class phpbb_questionnaire_phpbb_data_provider $result['dbms'] = $dbms; $result['acm_type'] = $acm_type; - $result['load_extensions'] = $load_extensions; $result['user_agent'] = 'Unknown'; $result['dbms_version'] = $db->sql_server_info(true); diff --git a/phpBB/includes/request/interface.php b/phpBB/includes/request/interface.php index afd53002e3..741db35917 100644 --- a/phpBB/includes/request/interface.php +++ b/phpBB/includes/request/interface.php @@ -30,6 +30,7 @@ interface phpbb_request_interface const REQUEST = 2; const COOKIE = 3; const SERVER = 4; + const FILES = 5; /**#@-*/ /** diff --git a/phpBB/includes/request/request.php b/phpBB/includes/request/request.php index 4e425dbd27..ae3c526d89 100644 --- a/phpBB/includes/request/request.php +++ b/phpBB/includes/request/request.php @@ -34,6 +34,7 @@ class phpbb_request implements phpbb_request_interface phpbb_request_interface::REQUEST => '_REQUEST', phpbb_request_interface::COOKIE => '_COOKIE', phpbb_request_interface::SERVER => '_SERVER', + phpbb_request_interface::FILES => '_FILES', ); /** @@ -200,46 +201,31 @@ class phpbb_request implements phpbb_request_interface */ public function variable($var_name, $default, $multibyte = false, $super_global = phpbb_request_interface::REQUEST) { - $path = false; - - // deep direct access to multi dimensional arrays - if (is_array($var_name)) - { - $path = $var_name; - // make sure at least the variable name is specified - if (empty($path)) - { - return (is_array($default)) ? array() : $default; - } - // the variable name is the first element on the path - $var_name = array_shift($path); - } - - if (!isset($this->input[$super_global][$var_name])) - { - return (is_array($default)) ? array() : $default; - } - $var = $this->input[$super_global][$var_name]; - - if ($path) - { - // walk through the array structure and find the element we are looking for - foreach ($path as $key) - { - if (is_array($var) && isset($var[$key])) - { - $var = $var[$key]; - } - else - { - return (is_array($default)) ? array() : $default; - } - } - } - - $this->type_cast_helper->recursive_set_var($var, $default, $multibyte); + return $this->_variable($var_name, $default, $multibyte, $super_global, true); + } - return $var; + /** + * Get a variable, but without trimming strings. + * Same functionality as variable(), except does not run trim() on strings. + * This method should be used when handling passwords. + * + * @param string|array $var_name The form variable's name from which data shall be retrieved. + * If the value is an array this may be an array of indizes which will give + * direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a") + * then specifying array("var", 1) as the name will return "a". + * @param mixed $default A default value that is returned if the variable was not set. + * This function will always return a value of the same type as the default. + * @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters + * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks + * @param phpbb_request_interface::POST|GET|REQUEST|COOKIE $super_global + * Specifies which super global should be used + * + * @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the + * the same as that of $default. If the variable is not set $default is returned. + */ + public function untrimmed_variable($var_name, $default, $multibyte, $super_global = phpbb_request_interface::REQUEST) + { + return $this->_variable($var_name, $default, $multibyte, $super_global, false); } /** @@ -284,6 +270,19 @@ class phpbb_request implements phpbb_request_interface } /** + * Shortcut method to retrieve $_FILES variables + * + * @param string $form_name The name of the file input form element + * + * @return array The uploaded file's information or an empty array if the + * variable does not exist in _FILES. + */ + public function file($form_name) + { + return $this->variable($form_name, array('name' => 'none'), false, phpbb_request_interface::FILES); + } + + /** * Checks whether a certain variable was sent via POST. * To make sure that a request was sent using POST you should call this function * on at least one variable. @@ -351,4 +350,66 @@ class phpbb_request implements phpbb_request_interface return array_keys($this->input[$super_global]); } + + /** + * Helper function used by variable() and untrimmed_variable(). + * + * @param string|array $var_name The form variable's name from which data shall be retrieved. + * If the value is an array this may be an array of indizes which will give + * direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a") + * then specifying array("var", 1) as the name will return "a". + * @param mixed $default A default value that is returned if the variable was not set. + * This function will always return a value of the same type as the default. + * @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters + * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks + * @param phpbb_request_interface::POST|GET|REQUEST|COOKIE $super_global + * Specifies which super global should be used + * @param bool $trim Indicates whether trim() should be applied to string values. + * + * @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the + * the same as that of $default. If the variable is not set $default is returned. + */ + protected function _variable($var_name, $default, $multibyte = false, $super_global = phpbb_request_interface::REQUEST, $trim = true) + { + $path = false; + + // deep direct access to multi dimensional arrays + if (is_array($var_name)) + { + $path = $var_name; + // make sure at least the variable name is specified + if (empty($path)) + { + return (is_array($default)) ? array() : $default; + } + // the variable name is the first element on the path + $var_name = array_shift($path); + } + + if (!isset($this->input[$super_global][$var_name])) + { + return (is_array($default)) ? array() : $default; + } + $var = $this->input[$super_global][$var_name]; + + if ($path) + { + // walk through the array structure and find the element we are looking for + foreach ($path as $key) + { + if (is_array($var) && isset($var[$key])) + { + $var = $var[$key]; + } + else + { + return (is_array($default)) ? array() : $default; + } + } + } + + $this->type_cast_helper->recursive_set_var($var, $default, $multibyte, $trim); + + return $var; + } } diff --git a/phpBB/includes/request/type_cast_helper.php b/phpBB/includes/request/type_cast_helper.php index 561e8fc251..1a5274ed14 100644 --- a/phpBB/includes/request/type_cast_helper.php +++ b/phpBB/includes/request/type_cast_helper.php @@ -93,15 +93,23 @@ class phpbb_request_type_cast_helper implements phpbb_request_type_cast_helper_i * @param mixed $type The variable type. Will be used with {@link settype()} * @param bool $multibyte Indicates whether string values may contain UTF-8 characters. * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks. + * @param bool $trim Indicates whether trim() should be applied to string values. + * Default is true. */ - public function set_var(&$result, $var, $type, $multibyte = false) + public function set_var(&$result, $var, $type, $multibyte = false, $trim = true) { settype($var, $type); $result = $var; if ($type == 'string') { - $result = trim(str_replace(array("\r\n", "\r", "\0"), array("\n", "\n", ''), $result)); + $result = str_replace(array("\r\n", "\r", "\0"), array("\n", "\n", ''), $result); + + if ($trim) + { + $result = trim($result); + } + $result = htmlspecialchars($result, ENT_COMPAT, 'UTF-8'); if ($multibyte) @@ -141,8 +149,10 @@ class phpbb_request_type_cast_helper implements phpbb_request_type_cast_helper_i * @param bool $multibyte Indicates whether string keys and values may contain UTF-8 characters. * Default is false, causing all bytes outside the ASCII range (0-127) to * be replaced with question marks. + * @param bool $trim Indicates whether trim() should be applied to string values. + * Default is true. */ - public function recursive_set_var(&$var, $default, $multibyte) + public function recursive_set_var(&$var, $default, $multibyte, $trim = true) { if (is_array($var) !== is_array($default)) { @@ -153,7 +163,7 @@ class phpbb_request_type_cast_helper implements phpbb_request_type_cast_helper_i if (!is_array($default)) { $type = gettype($default); - $this->set_var($var, $var, $type, $multibyte); + $this->set_var($var, $var, $type, $multibyte, $trim); } else { @@ -174,9 +184,9 @@ class phpbb_request_type_cast_helper implements phpbb_request_type_cast_helper_i foreach ($_var as $k => $v) { - $this->set_var($k, $k, $key_type, $multibyte, $multibyte); + $this->set_var($k, $k, $key_type, $multibyte); - $this->recursive_set_var($v, $default_value, $multibyte); + $this->recursive_set_var($v, $default_value, $multibyte, $trim); $var[$k] = $v; } } diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 20dcb74c0d..ff2e24aa05 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -22,17 +22,77 @@ if (!defined('IN_PHPBB')) */ class phpbb_search_fulltext_mysql extends phpbb_search_base { - var $stats = array(); - var $word_length = array(); - var $split_words = array(); - var $search_query; - var $common_words = array(); + /** + * Associative array holding index stats + * @var array + */ + protected $stats = array(); + + /** + * Holds the words entered by user, obtained by splitting the entered query on whitespace + * @var array + */ + protected $split_words = array(); + + /** + * Config object + * @var phpbb_config + */ + protected $config; + + /** + * DBAL object + * @var dbal + */ + protected $db; + + /** + * User object + * @var phpbb_user + */ + protected $user; + + /** + * Associative array stores the min and max word length to be searched + * @var array + */ + protected $word_length = array(); + + /** + * Contains tidied search query. + * Operators are prefixed in search query and common words excluded + * @var string + */ + protected $search_query; + + /** + * Contains common words. + * Common words are words with length less/more than min/max length + * @var array + */ + protected $common_words = array(); - public function __construct(&$error) + /** + * Constructor + * Creates a new phpbb_search_fulltext_mysql, 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, $phpbb_root_path, $phpEx, $auth, $config, $db, $user) { - global $config; + $this->config = $config; + $this->db = $db; + $this->user = $user; + + $this->word_length = array('min' => $this->config['fulltext_mysql_min_word_len'], 'max' => $this->config['fulltext_mysql_max_word_len']); - $this->word_length = array('min' => $config['fulltext_mysql_min_word_len'], 'max' => $config['fulltext_mysql_max_word_len']); + /** + * Load the UTF tools + */ + if (!function_exists('utf8_strlen')) + { + include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); + } $error = false; } @@ -48,20 +108,50 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base } /** + * Returns the search_query + * + * @return string search query + */ + public function get_search_query() + { + return $this->search_query; + } + + /** + * Returns the common_words array + * + * @return array common words that are ignored by search backend + */ + public function get_common_words() + { + return $this->common_words; + } + + /** + * Returns the word_length array + * + * @return array min and max word length for searching + */ + public function get_word_length() + { + return $this->word_length; + } + + /** * Checks for correct MySQL version and stores min/max word length in the config + * + * @return string|bool Language key of the error/incompatiblity occured */ - function init() + public function init() { - global $db, $user; - - if ($db->sql_layer != 'mysql4' && $db->sql_layer != 'mysqli') + if ($this->db->sql_layer != 'mysql4' && $this->db->sql_layer != 'mysqli') { - return $user->lang['FULLTEXT_MYSQL_INCOMPATIBLE_DATABASE']; + return $this->user->lang['FULLTEXT_MYSQL_INCOMPATIBLE_DATABASE']; } - $result = $db->sql_query('SHOW TABLE STATUS LIKE \'' . POSTS_TABLE . '\''); - $info = $db->sql_fetchrow($result); - $db->sql_freeresult($result); + $result = $this->db->sql_query('SHOW TABLE STATUS LIKE \'' . POSTS_TABLE . '\''); + $info = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); $engine = ''; if (isset($info['Engine'])) @@ -75,19 +165,19 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base if ($engine != 'MyISAM') { - return $user->lang['FULLTEXT_MYSQL_NOT_MYISAM']; + return $this->user->lang['FULLTEXT_MYSQL_NOT_MYISAM']; } $sql = 'SHOW VARIABLES LIKE \'ft\_%\''; - $result = $db->sql_query($sql); + $result = $this->db->sql_query($sql); $mysql_info = array(); - while ($row = $db->sql_fetchrow($result)) + while ($row = $this->db->sql_fetchrow($result)) { $mysql_info[$row['Variable_name']] = $row['Value']; } - $db->sql_freeresult($result); + $this->db->sql_freeresult($result); set_config('fulltext_mysql_max_word_len', $mysql_info['ft_max_word_len']); set_config('fulltext_mysql_min_word_len', $mysql_info['ft_min_word_len']); @@ -103,10 +193,8 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base * @param string $terms is either 'all' or 'any' * @return bool false if no valid keywords were found and otherwise true */ - function split_keywords(&$keywords, $terms) + public function split_keywords(&$keywords, $terms) { - global $config, $user; - if ($terms == 'all') { $match = array('#\sand\s#iu', '#\sor\s#iu', '#\snot\s#iu', '#(^|\s)\+#', '#(^|\s)-#', '#(^|\s)\|#'); @@ -125,9 +213,9 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base $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']) + if ($this->config['max_num_search_keywords'] && sizeof($this->split_words) > $this->config['max_num_search_keywords']) { - trigger_error($user->lang('MAX_NUM_SEARCH_KEYWORDS_REFINE', $config['max_num_search_keywords'], sizeof($this->split_words))); + trigger_error($this->user->lang('MAX_NUM_SEARCH_KEYWORDS_REFINE', $this->config['max_num_search_keywords'], sizeof($this->split_words))); } // to allow phrase search, we need to concatenate quoted words @@ -150,7 +238,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base } else { - $tmp_split_words[] = $word . ' '; + $tmp_split_words[] = $word; } } if ($phrase) @@ -169,7 +257,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base // check word length $clean_len = utf8_strlen(str_replace('*', '', $clean_word)); - if (($clean_len < $config['fulltext_mysql_min_word_len']) || ($clean_len > $config['fulltext_mysql_max_word_len'])) + if (($clean_len < $this->config['fulltext_mysql_min_word_len']) || ($clean_len > $this->config['fulltext_mysql_max_word_len'])) { $this->common_words[] = $word; unset($this->split_words[$i]); @@ -221,11 +309,10 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base /** * Turns text into an array of words + * @param string $text contains post text/subject */ - function split_message($text) + 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(); @@ -237,7 +324,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base for ($i = 0, $n = sizeof($text); $i < $n; $i++) { $text[$i] = trim($text[$i]); - if (utf8_strlen($text[$i]) < $config['fulltext_mysql_min_word_len'] || utf8_strlen($text[$i]) > $config['fulltext_mysql_max_word_len']) + if (utf8_strlen($text[$i]) < $this->config['fulltext_mysql_min_word_len'] || utf8_strlen($text[$i]) > $this->config['fulltext_mysql_max_word_len']) { unset($text[$i]); } @@ -247,7 +334,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base } /** - * Performs a search on keywords depending on display specific params. You have to run split_keywords() first. + * 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) @@ -265,14 +352,10 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base * @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) + 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. + // No keywords? No posts if (!$this->search_query) { return false; @@ -360,7 +443,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base } else { - $m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')'; + $m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $this->db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')'; } $sql_select = (!$result_count) ? 'SQL_CALC_FOUND_ROWS ' : ''; @@ -370,11 +453,11 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base if (sizeof($author_ary) && $author_name) { // first one matches post of registered users, second one guests and deleted users - $sql_author = ' AND (' . $db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')'; + $sql_author = ' AND (' . $this->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); + $sql_author = ' AND ' . $this->db->sql_in_set('p.poster_id', $author_ary); } else { @@ -384,7 +467,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base $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 .= (sizeof($ex_fid_ary)) ? ' AND ' . $this->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)) : ''; @@ -392,16 +475,16 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base $sql = "SELECT $sql_select FROM $sql_from$sql_sort_table" . POSTS_TABLE . " p - WHERE MATCH ($sql_match) AGAINST ('" . $db->sql_escape(htmlspecialchars_decode($this->search_query)) . "' IN BOOLEAN MODE) + WHERE MATCH ($sql_match) AGAINST ('" . $this->db->sql_escape(htmlspecialchars_decode($this->search_query)) . "' IN BOOLEAN MODE) $sql_where_options ORDER BY $sql_sort"; - $result = $db->sql_query_limit($sql, $config['search_block_size'], $start); + $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start); - while ($row = $db->sql_fetchrow($result)) + while ($row = $this->db->sql_fetchrow($result)) { $id_ary[] = (int) $row[$field]; } - $db->sql_freeresult($result); + $this->db->sql_freeresult($result); $id_ary = array_unique($id_ary); @@ -414,9 +497,9 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base if (!$result_count) { $sql = 'SELECT FOUND_ROWS() as result_count'; - $result = $db->sql_query($sql); - $result_count = (int) $db->sql_fetchfield('result_count'); - $db->sql_freeresult($result); + $result = $this->db->sql_query($sql); + $result_count = (int) $this->db->sql_fetchfield('result_count'); + $this->db->sql_freeresult($result); if (!$result_count) { @@ -449,14 +532,10 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base * @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) + 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. + // No author? No posts if (!sizeof($author_ary)) { return 0; @@ -491,13 +570,13 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base 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 . ')'; + $sql_author = '(' . $this->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_author = $this->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_fora = (sizeof($ex_fid_ary)) ? ' AND ' . $this->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' : ''; @@ -533,7 +612,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base } else { - $m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')'; + $m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $this->db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')'; } // If the cache was completely empty count the results @@ -572,21 +651,21 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base } // Only read one block of posts from the db and then cache it - $result = $db->sql_query_limit($sql, $config['search_block_size'], $start); + $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start); - while ($row = $db->sql_fetchrow($result)) + while ($row = $this->db->sql_fetchrow($result)) { $id_ary[] = (int) $row[$field]; } - $db->sql_freeresult($result); + $this->db->sql_freeresult($result); // retrieve the total result count if needed if (!$result_count) { $sql = 'SELECT FOUND_ROWS() as result_count'; - $result = $db->sql_query($sql); - $result_count = (int) $db->sql_fetchfield('result_count'); - $db->sql_freeresult($result); + $result = $this->db->sql_query($sql); + $result_count = (int) $this->db->sql_fetchfield('result_count'); + $this->db->sql_freeresult($result); if (!$result_count) { @@ -605,14 +684,17 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base } /** - * Destroys cached search results, that contained one of the new words in a post so the results won't be outdated. + * 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 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 */ - function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id) + 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(); @@ -631,7 +713,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base /** * Destroy cached results, that might be outdated after deleting a post */ - function index_remove($post_ids, $author_ids, $forum_ids) + public function index_remove($post_ids, $author_ids, $forum_ids) { $this->destroy_cache(array(), array_unique($author_ids)); } @@ -639,10 +721,8 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base /** * Destroy old cache entries */ - function tidy() + public function tidy() { - global $db, $config; - // destroy too old cached search results $this->destroy_cache(array()); @@ -651,11 +731,11 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base /** * Create fulltext index + * + * @return string|bool error string is returned incase of errors otherwise false */ - function create_index($acp_module, $u_action) + public function create_index($acp_module, $u_action) { - global $db; - // Make sure we can actually use MySQL with fulltext indexes if ($error = $this->init()) { @@ -671,7 +751,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base if (!isset($this->stats['post_subject'])) { - if ($db->sql_layer == 'mysqli' || version_compare($db->sql_server_info(true), '4.1.3', '>=')) + if ($this->db->sql_layer == 'mysqli' || version_compare($this->db->sql_server_info(true), '4.1.3', '>=')) { $alter[] = 'MODIFY post_subject varchar(255) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL'; } @@ -684,7 +764,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base if (!isset($this->stats['post_text'])) { - if ($db->sql_layer == 'mysqli' || version_compare($db->sql_server_info(true), '4.1.3', '>=')) + if ($this->db->sql_layer == 'mysqli' || version_compare($this->db->sql_server_info(true), '4.1.3', '>=')) { $alter[] = 'MODIFY post_text mediumtext COLLATE utf8_unicode_ci NOT NULL'; } @@ -702,21 +782,21 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base if (sizeof($alter)) { - $db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ' . implode(', ', $alter)); + $this->db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ' . implode(', ', $alter)); } - $db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE); + $this->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 */ - function delete_index($acp_module, $u_action) + public function delete_index($acp_module, $u_action) { - global $db; - // Make sure we can actually use MySQL with fulltext indexes if ($error = $this->init()) { @@ -747,10 +827,10 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base if (sizeof($alter)) { - $db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ' . implode(', ', $alter)); + $this->db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ' . implode(', ', $alter)); } - $db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE); + $this->db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE); return false; } @@ -758,7 +838,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base /** * Returns true if both FULLTEXT indexes exist */ - function index_created() + public function index_created() { if (empty($this->stats)) { @@ -771,25 +851,24 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base /** * Returns an associative array containing information about the indexes */ - function index_stats() + public function index_stats() { - global $user; - if (empty($this->stats)) { $this->get_stats(); } return array( - $user->lang['FULLTEXT_MYSQL_TOTAL_POSTS'] => ($this->index_created()) ? $this->stats['total_posts'] : 0, + $this->user->lang['FULLTEXT_MYSQL_TOTAL_POSTS'] => ($this->index_created()) ? $this->stats['total_posts'] : 0, ); } - function get_stats() + /** + * Computes the stats and store them in the $this->stats associative array + */ + protected function get_stats() { - global $db; - - if (strpos($db->sql_layer, 'mysql') === false) + if (strpos($this->db->sql_layer, 'mysql') === false) { $this->stats = array(); return; @@ -797,9 +876,9 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base $sql = 'SHOW INDEX FROM ' . POSTS_TABLE; - $result = $db->sql_query($sql); + $result = $this->db->sql_query($sql); - while ($row = $db->sql_fetchrow($result)) + while ($row = $this->db->sql_fetchrow($result)) { // deal with older MySQL versions which didn't use Index_type $index_type = (isset($row['Index_type'])) ? $row['Index_type'] : $row['Comment']; @@ -820,26 +899,26 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base } } } - $db->sql_freeresult($result); + $this->db->sql_freeresult($result); - $this->stats['total_posts'] = empty($this->stats) ? 0 : $db->get_estimated_row_count(POSTS_TABLE); + $this->stats['total_posts'] = empty($this->stats) ? 0 : $this->db->get_estimated_row_count(POSTS_TABLE); } /** * Display a note, that UTF-8 support is not available with certain versions of PHP + * + * @return associative array containing template and config variables */ - function acp() + public function acp() { - global $user, $config; - $tpl = ' <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> + <dt><label>' . $this->user->lang['MIN_SEARCH_CHARS'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_MYSQL_MIN_SEARCH_CHARS_EXPLAIN'] . '</span></dt> + <dd>' . $this->config['fulltext_mysql_min_word_len'] . '</dd> </dl> <dl> - <dt><label>' . $user->lang['MAX_SEARCH_CHARS'] . ':</label><br /><span>' . $user->lang['FULLTEXT_MYSQL_MAX_SEARCH_CHARS_EXPLAIN'] . '</span></dt> - <dd>' . $config['fulltext_mysql_max_word_len'] . '</dd> + <dt><label>' . $this->user->lang['MAX_SEARCH_CHARS'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_MYSQL_MAX_SEARCH_CHARS_EXPLAIN'] . '</span></dt> + <dd>' . $this->config['fulltext_mysql_max_word_len'] . '</dd> </dl> '; diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 3e029c86d0..4623326fc7 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -22,32 +22,105 @@ if (!defined('IN_PHPBB')) */ class phpbb_search_fulltext_native extends phpbb_search_base { - var $stats = array(); - var $word_length = array(); - var $search_query; - var $common_words = array(); + /** + * Associative array holding index stats + * @var array + */ + protected $stats = array(); + + /** + * Associative array stores the min and max word length to be searched + * @var array + */ + protected $word_length = array(); + + /** + * Contains tidied search query. + * Operators are prefixed in search query and common words excluded + * @var string + */ + protected $search_query; + + /** + * Contains common words. + * Common words are words with length less/more than min/max length + * @var array + */ + protected $common_words = array(); - var $must_contain_ids = array(); - var $must_not_contain_ids = array(); - var $must_exclude_one_ids = array(); + /** + * Post ids of posts containing words that are to be included + * @var array + */ + protected $must_contain_ids = array(); + + /** + * Post ids of posts containing words that should not be included + * @var array + */ + protected $must_not_contain_ids = array(); + + /** + * Post ids of posts containing atleast one word that needs to be excluded + * @var array + */ + protected $must_exclude_one_ids = array(); + + /** + * Relative path to board root + * @var string + */ + protected $phpbb_root_path; /** - * Initialises the fulltext_native search backend with min/max word length and makes sure the UTF-8 normalizer is loaded. + * PHP Extension + * @var string + */ + protected $php_ext; + + /** + * Config object + * @var phpbb_config + */ + protected $config; + + /** + * DBAL object + * @var dbal + */ + protected $db; + + /** + * User object + * @var phpbb_user + */ + protected $user; + + /** + * Initialises the fulltext_native search backend with min/max word length and makes sure the UTF-8 normalizer is loaded * - * @param boolean|string &$error is passed by reference and should either be set to false on success or an error message on failure. + * @param boolean|string &$error is passed by reference and should either be set to false on success or an error message on failure */ - public function __construct(&$error) + public function __construct(&$error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user) { - global $phpbb_root_path, $phpEx, $config; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $phpEx; + $this->config = $config; + $this->db = $db; + $this->user = $user; - $this->word_length = array('min' => $config['fulltext_native_min_chars'], 'max' => $config['fulltext_native_max_chars']); + $this->word_length = array('min' => $this->config['fulltext_native_min_chars'], 'max' => $this->config['fulltext_native_max_chars']); /** * Load the UTF tools */ if (!class_exists('utf_normalizer')) { - include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx); + include($this->phpbb_root_path . 'includes/utf/utf_normalizer.' . $this->php_ext); + } + if (!function_exists('utf8_decode_ncr')) + { + include($this->phpbb_root_path . 'includes/utf/utf_tools.' . $this->php_ext); } $error = false; @@ -64,26 +137,52 @@ class phpbb_search_fulltext_native extends phpbb_search_base } /** - * This function fills $this->search_query with the cleaned user search query. + * Returns the search_query + * + * @return string search query + */ + public function get_search_query() + { + return $this->search_query; + } + + /** + * Returns the common_words array + * + * @return array common words that are ignored by search backend + */ + public function get_common_words() + { + return $this->common_words; + } + + /** + * Returns the word_length array + * + * @return array min and max word length for searching + */ + public function get_word_length() + { + return $this->word_length; + } + + /** + * This function fills $this->search_query with the cleaned user search query * * If $terms is 'any' then the words will be extracted from the search query * and combined with | inside brackets. They will afterwards be treated like * an standard search query. * * Then it analyses the query and fills the internal arrays $must_not_contain_ids, - * $must_contain_ids and $must_exclude_one_ids which are later used by keyword_search(). + * $must_contain_ids and $must_exclude_one_ids which are later used by keyword_search() * * @param string $keywords contains the search query string as entered by the user * @param string $terms is either 'all' (use search query as entered, default words to 'must be contained in post') * or 'any' (find all posts containing at least one of the given words) * @return boolean false if no valid keywords were found and otherwise true - * - * @access public */ - function split_keywords($keywords, $terms) + public function split_keywords($keywords, $terms) { - global $db, $user, $config; - $tokens = '+-|()*'; $keywords = trim($this->cleanup($keywords, $tokens)); @@ -182,9 +281,9 @@ class phpbb_search_fulltext_native extends phpbb_search_base $num_keywords = sizeof(explode(' ', $keywords)); // We limit the number of allowed keywords to minimize load on the database - if ($config['max_num_search_keywords'] && $num_keywords > $config['max_num_search_keywords']) + if ($this->config['max_num_search_keywords'] && $num_keywords > $this->config['max_num_search_keywords']) { - trigger_error($user->lang('MAX_NUM_SEARCH_KEYWORDS_REFINE', $config['max_num_search_keywords'], $num_keywords)); + trigger_error($this->user->lang('MAX_NUM_SEARCH_KEYWORDS_REFINE', $this->config['max_num_search_keywords'], $num_keywords)); } // $keywords input format: each word separated by a space, words in a bracket are not separated @@ -214,12 +313,12 @@ class phpbb_search_fulltext_native extends phpbb_search_base { $sql = 'SELECT word_id, word_text, word_common FROM ' . SEARCH_WORDLIST_TABLE . ' - WHERE ' . $db->sql_in_set('word_text', $exact_words) . ' + WHERE ' . $this->db->sql_in_set('word_text', $exact_words) . ' ORDER BY word_count ASC'; - $result = $db->sql_query($sql); + $result = $this->db->sql_query($sql); // store an array of words and ids, remove common words - while ($row = $db->sql_fetchrow($result)) + while ($row = $this->db->sql_fetchrow($result)) { if ($row['word_common']) { @@ -230,7 +329,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base $words[$row['word_text']] = (int) $row['word_id']; } - $db->sql_freeresult($result); + $this->db->sql_freeresult($result); } unset($exact_words); @@ -301,7 +400,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base { if (strpos($word_part, '*') !== false) { - $id_words[] = '\'' . $db->sql_escape(str_replace('*', '%', $word_part)) . '\''; + $id_words[] = '\'' . $this->db->sql_escape(str_replace('*', '%', $word_part)) . '\''; $non_common_words[] = $word_part; } else if (isset($words[$word_part])) @@ -334,7 +433,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base // throw an error if we shall not ignore unexistant words else if (!$ignore_no_id && sizeof($non_common_words)) { - trigger_error(sprintf($user->lang['WORDS_IN_NO_POST'], implode(', ', $non_common_words))); + trigger_error(sprintf($user->lang['WORDS_IN_NO_POST'], implode($user->lang['COMMA_SEPARATOR'], $non_common_words))); } unset($non_common_words); } @@ -346,7 +445,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base $len = utf8_strlen(str_replace('*', '', $word)); if ($len >= $this->word_length['min'] && $len <= $this->word_length['max']) { - $this->{$mode . '_ids'}[] = '\'' . $db->sql_escape(str_replace('*', '%', $word)) . '\''; + $this->{$mode . '_ids'}[] = '\'' . $this->db->sql_escape(str_replace('*', '%', $word)) . '\''; } else { @@ -366,7 +465,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base $len = utf8_strlen($word); if ($len >= $this->word_length['min'] && $len <= $this->word_length['max']) { - trigger_error(sprintf($user->lang['WORD_IN_NO_POST'], $word)); + trigger_error(sprintf($this->user->lang['WORD_IN_NO_POST'], $word)); } else { @@ -398,7 +497,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base } /** - * Performs a search on keywords depending on display specific params. You have to run split_keywords() first. + * 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) @@ -416,13 +515,9 @@ class phpbb_search_fulltext_native extends phpbb_search_base * @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) + 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 (empty($this->search_query)) { @@ -537,7 +632,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base } } - $sql_where[] = $db->sql_in_set("m$m_num.word_id", $word_ids); + $sql_where[] = $this->db->sql_in_set("m$m_num.word_id", $word_ids); unset($word_id_sql); unset($word_ids); @@ -591,7 +686,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base { $sql_array['LEFT_JOIN'][] = array( 'FROM' => array(SEARCH_WORDMATCH_TABLE => 'm' . $m_num), - 'ON' => $db->sql_in_set("m$m_num.word_id", $this->must_not_contain_ids) . (($title_match) ? " AND m$m_num.$title_match" : '') . " AND m$m_num.post_id = m0.post_id" + 'ON' => $this->db->sql_in_set("m$m_num.word_id", $this->must_not_contain_ids) . (($title_match) ? " AND m$m_num.$title_match" : '') . " AND m$m_num.post_id = m0.post_id" ); $sql_where[] = "m$m_num.word_id IS NULL"; @@ -632,7 +727,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base } else if ($m_approve_fid_ary !== array(-1)) { - $sql_where[] = '(p.post_approved = 1 OR ' . $db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')'; + $sql_where[] = '(p.post_approved = 1 OR ' . $this->db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')'; } if ($topic_id) @@ -645,18 +740,18 @@ class phpbb_search_fulltext_native extends phpbb_search_base 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 . ')'; + $sql_author = '(' . $this->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_author = $this->db->sql_in_set('p.poster_id', $author_ary); } $sql_where[] = $sql_author; } if (sizeof($ex_fid_ary)) { - $sql_where[] = $db->sql_in_set('p.forum_id', $ex_fid_ary, true); + $sql_where[] = $this->db->sql_in_set('p.forum_id', $ex_fid_ary, true); } if ($sort_days) @@ -681,7 +776,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base ); } - switch ($db->sql_layer) + switch ($this->db->sql_layer) { case 'mysql4': case 'mysqli': @@ -695,17 +790,17 @@ class phpbb_search_fulltext_native extends phpbb_search_base case 'sqlite': $sql_array_count['SELECT'] = ($type == 'posts') ? 'DISTINCT p.post_id' : 'DISTINCT p.topic_id'; $sql = 'SELECT COUNT(' . (($type == 'posts') ? 'post_id' : 'topic_id') . ') as total_results - FROM (' . $db->sql_build_query('SELECT', $sql_array_count) . ')'; + FROM (' . $this->db->sql_build_query('SELECT', $sql_array_count) . ')'; // no break default: $sql_array_count['SELECT'] = ($type == 'posts') ? 'COUNT(DISTINCT p.post_id) AS total_results' : 'COUNT(DISTINCT p.topic_id) AS total_results'; - $sql = (!$sql) ? $db->sql_build_query('SELECT', $sql_array_count) : $sql; + $sql = (!$sql) ? $this->db->sql_build_query('SELECT', $sql_array_count) : $sql; - $result = $db->sql_query($sql); - $total_results = (int) $db->sql_fetchfield('total_results'); - $db->sql_freeresult($result); + $result = $this->db->sql_query($sql); + $total_results = (int) $this->db->sql_fetchfield('total_results'); + $this->db->sql_freeresult($result); if (!$total_results) { @@ -751,14 +846,14 @@ class phpbb_search_fulltext_native extends phpbb_search_base unset($sql_where, $sql_sort, $group_by); - $sql = $db->sql_build_query('SELECT', $sql_array); - $result = $db->sql_query_limit($sql, $config['search_block_size'], $start); + $sql = $this->db->sql_build_query('SELECT', $sql_array); + $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start); - while ($row = $db->sql_fetchrow($result)) + while ($row = $this->db->sql_fetchrow($result)) { $id_ary[] = (int) $row[(($type == 'posts') ? 'post_id' : 'topic_id')]; } - $db->sql_freeresult($result); + $this->db->sql_freeresult($result); if (!sizeof($id_ary)) { @@ -768,20 +863,20 @@ class phpbb_search_fulltext_native extends phpbb_search_base // if we use mysql and the total result count is not cached yet, retrieve it from the db if (!$total_results && $is_mysql) { - // Count rows for the executed queries. Replace $select within $sql with SQL_CALC_FOUND_ROWS, and run it. + // Count rows for the executed queries. Replace $select within $sql with SQL_CALC_FOUND_ROWS, and run it $sql_array_copy = $sql_array; $sql_array_copy['SELECT'] = 'SQL_CALC_FOUND_ROWS p.post_id '; - $sql = $db->sql_build_query('SELECT', $sql_array_copy); + $sql = $this->db->sql_build_query('SELECT', $sql_array_copy); unset($sql_array_copy); - $db->sql_query($sql); - $db->sql_freeresult($result); + $this->db->sql_query($sql); + $this->db->sql_freeresult($result); $sql = 'SELECT FOUND_ROWS() as total_results'; - $result = $db->sql_query($sql); - $total_results = (int) $db->sql_fetchfield('total_results'); - $db->sql_freeresult($result); + $result = $this->db->sql_query($sql); + $total_results = (int) $this->db->sql_fetchfield('total_results'); + $this->db->sql_freeresult($result); if (!$total_results) { @@ -814,14 +909,10 @@ class phpbb_search_fulltext_native extends phpbb_search_base * @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) + 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. + // No author? No posts if (!sizeof($author_ary)) { return 0; @@ -856,13 +947,13 @@ class phpbb_search_fulltext_native extends phpbb_search_base 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 . ')'; + $sql_author = '(' . $this->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_author = $this->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_fora = (sizeof($ex_fid_ary)) ? ' AND ' . $this->db->sql_in_set('p.forum_id', $ex_fid_ary, true) : ''; $sql_time = ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : ''; $sql_topic_id = ($topic_id) ? ' AND p.topic_id = ' . (int) $topic_id : ''; $sql_firstpost = ($firstpost_only) ? ' AND p.post_id = t.topic_first_post_id' : ''; @@ -898,7 +989,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base } else { - $m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')'; + $m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $this->db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')'; } $select = ($type == 'posts') ? 'p.post_id' : 't.topic_id'; @@ -907,7 +998,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base // If the cache was completely empty count the results if (!$total_results) { - switch ($db->sql_layer) + switch ($this->db->sql_layer) { case 'mysql4': case 'mysqli': @@ -929,7 +1020,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base } else { - if ($db->sql_layer == 'sqlite') + if ($this->db->sql_layer == 'sqlite') { $sql = 'SELECT COUNT(topic_id) as total_results FROM (SELECT DISTINCT t.topic_id'; @@ -946,12 +1037,12 @@ class phpbb_search_fulltext_native extends phpbb_search_base $m_approve_fid_sql $sql_fora AND t.topic_id = p.topic_id - $sql_time" . (($db->sql_layer == 'sqlite') ? ')' : ''); + $sql_time" . (($this->db->sql_layer == 'sqlite') ? ')' : ''); } - $result = $db->sql_query($sql); + $result = $this->db->sql_query($sql); - $total_results = (int) $db->sql_fetchfield('total_results'); - $db->sql_freeresult($result); + $total_results = (int) $this->db->sql_fetchfield('total_results'); + $this->db->sql_freeresult($result); if (!$total_results) { @@ -994,26 +1085,26 @@ class phpbb_search_fulltext_native extends phpbb_search_base } // Only read one block of posts from the db and then cache it - $result = $db->sql_query_limit($sql, $config['search_block_size'], $start); + $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start); - while ($row = $db->sql_fetchrow($result)) + while ($row = $this->db->sql_fetchrow($result)) { $id_ary[] = (int) $row[$field]; } - $db->sql_freeresult($result); + $this->db->sql_freeresult($result); if (!$total_results && $is_mysql) { // Count rows for the executed queries. Replace $select within $sql with SQL_CALC_FOUND_ROWS, and run it. $sql = str_replace('SELECT ' . $select, 'SELECT DISTINCT SQL_CALC_FOUND_ROWS p.post_id', $sql); - $db->sql_query($sql); - $db->sql_freeresult($result); + $this->db->sql_query($sql); + $this->db->sql_freeresult($result); $sql = 'SELECT FOUND_ROWS() as total_results'; - $result = $db->sql_query($sql); - $total_results = (int) $db->sql_fetchfield('total_results'); - $db->sql_freeresult($result); + $result = $this->db->sql_query($sql); + $total_results = (int) $this->db->sql_fetchfield('total_results'); + $this->db->sql_freeresult($result); if (!$total_results) { @@ -1041,13 +1132,9 @@ class phpbb_search_fulltext_native extends phpbb_search_base * * @param string $text Text to split, encoded in UTF-8 * @return array Array of UTF-8 words - * - * @access private */ - function split_message($text) + public function split_message($text) { - global $phpbb_root_path, $phpEx, $user; - $match = $words = array(); /** @@ -1120,14 +1207,10 @@ class phpbb_search_fulltext_native extends phpbb_search_base * @param string &$subject New or updated post subject * @param int $poster_id Post author's user id * @param int $forum_id The id of the forum in which the post is located - * - * @access public */ - function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id) + public function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id) { - global $config, $db, $user; - - if (!$config['fulltext_native_load_upd']) + if (!$this->config['fulltext_native_load_upd']) { /** * The search indexer is disabled, return @@ -1153,14 +1236,14 @@ class phpbb_search_fulltext_native extends phpbb_search_base FROM ' . SEARCH_WORDLIST_TABLE . ' w, ' . SEARCH_WORDMATCH_TABLE . " m WHERE m.post_id = $post_id AND w.word_id = m.word_id"; - $result = $db->sql_query($sql); + $result = $this->db->sql_query($sql); - while ($row = $db->sql_fetchrow($result)) + while ($row = $this->db->sql_fetchrow($result)) { $which = ($row['title_match']) ? 'title' : 'post'; $cur_words[$which][$row['word_text']] = $row['word_id']; } - $db->sql_freeresult($result); + $this->db->sql_freeresult($result); $words['add']['post'] = array_diff($split_text, array_keys($cur_words['post'])); $words['add']['title'] = array_diff($split_title, array_keys($cur_words['title'])); @@ -1188,18 +1271,18 @@ class phpbb_search_fulltext_native extends phpbb_search_base { $sql = 'SELECT word_id, word_text FROM ' . SEARCH_WORDLIST_TABLE . ' - WHERE ' . $db->sql_in_set('word_text', $unique_add_words); - $result = $db->sql_query($sql); + WHERE ' . $this->db->sql_in_set('word_text', $unique_add_words); + $result = $this->db->sql_query($sql); $word_ids = array(); - while ($row = $db->sql_fetchrow($result)) + while ($row = $this->db->sql_fetchrow($result)) { $word_ids[$row['word_text']] = $row['word_id']; } - $db->sql_freeresult($result); + $this->db->sql_freeresult($result); $new_words = array_diff($unique_add_words, array_keys($word_ids)); - $db->sql_transaction('begin'); + $this->db->sql_transaction('begin'); if (sizeof($new_words)) { $sql_ary = array(); @@ -1208,15 +1291,15 @@ class phpbb_search_fulltext_native extends phpbb_search_base { $sql_ary[] = array('word_text' => (string) $word, 'word_count' => 0); } - $db->sql_return_on_error(true); - $db->sql_multi_insert(SEARCH_WORDLIST_TABLE, $sql_ary); - $db->sql_return_on_error(false); + $this->db->sql_return_on_error(true); + $this->db->sql_multi_insert(SEARCH_WORDLIST_TABLE, $sql_ary); + $this->db->sql_return_on_error(false); } unset($new_words, $sql_ary); } else { - $db->sql_transaction('begin'); + $this->db->sql_transaction('begin'); } // now update the search match table, remove links to removed words and add links to new words @@ -1233,22 +1316,22 @@ class phpbb_search_fulltext_native extends phpbb_search_base } $sql = 'DELETE FROM ' . SEARCH_WORDMATCH_TABLE . ' - WHERE ' . $db->sql_in_set('word_id', $sql_in) . ' + WHERE ' . $this->db->sql_in_set('word_id', $sql_in) . ' AND post_id = ' . intval($post_id) . " AND title_match = $title_match"; - $db->sql_query($sql); + $this->db->sql_query($sql); $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . ' SET word_count = word_count - 1 - WHERE ' . $db->sql_in_set('word_id', $sql_in) . ' + WHERE ' . $this->db->sql_in_set('word_id', $sql_in) . ' AND word_count > 0'; - $db->sql_query($sql); + $this->db->sql_query($sql); unset($sql_in); } } - $db->sql_return_on_error(true); + $this->db->sql_return_on_error(true); foreach ($words['add'] as $word_in => $word_ary) { $title_match = ($word_in == 'title') ? 1 : 0; @@ -1258,18 +1341,18 @@ class phpbb_search_fulltext_native extends phpbb_search_base $sql = 'INSERT INTO ' . SEARCH_WORDMATCH_TABLE . ' (post_id, word_id, title_match) SELECT ' . (int) $post_id . ', word_id, ' . (int) $title_match . ' FROM ' . SEARCH_WORDLIST_TABLE . ' - WHERE ' . $db->sql_in_set('word_text', $word_ary); - $db->sql_query($sql); + WHERE ' . $this->db->sql_in_set('word_text', $word_ary); + $this->db->sql_query($sql); $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . ' SET word_count = word_count + 1 - WHERE ' . $db->sql_in_set('word_text', $word_ary); - $db->sql_query($sql); + WHERE ' . $this->db->sql_in_set('word_text', $word_ary); + $this->db->sql_query($sql); } } - $db->sql_return_on_error(false); + $this->db->sql_return_on_error(false); - $db->sql_transaction('commit'); + $this->db->sql_transaction('commit'); // destroy cached search results containing any of the words removed or added $this->destroy_cache(array_unique(array_merge($words['add']['post'], $words['add']['title'], $words['del']['post'], $words['del']['title'])), array($poster_id)); @@ -1282,20 +1365,18 @@ class phpbb_search_fulltext_native extends phpbb_search_base /** * Removes entries from the wordmatch table for the specified post_ids */ - function index_remove($post_ids, $author_ids, $forum_ids) + public function index_remove($post_ids, $author_ids, $forum_ids) { - global $db; - if (sizeof($post_ids)) { $sql = 'SELECT w.word_id, w.word_text, m.title_match FROM ' . SEARCH_WORDMATCH_TABLE . ' m, ' . SEARCH_WORDLIST_TABLE . ' w - WHERE ' . $db->sql_in_set('m.post_id', $post_ids) . ' + WHERE ' . $this->db->sql_in_set('m.post_id', $post_ids) . ' AND w.word_id = m.word_id'; - $result = $db->sql_query($sql); + $result = $this->db->sql_query($sql); $message_word_ids = $title_word_ids = $word_texts = array(); - while ($row = $db->sql_fetchrow($result)) + while ($row = $this->db->sql_fetchrow($result)) { if ($row['title_match']) { @@ -1307,32 +1388,32 @@ class phpbb_search_fulltext_native extends phpbb_search_base } $word_texts[] = $row['word_text']; } - $db->sql_freeresult($result); + $this->db->sql_freeresult($result); if (sizeof($title_word_ids)) { $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . ' SET word_count = word_count - 1 - WHERE ' . $db->sql_in_set('word_id', $title_word_ids) . ' + WHERE ' . $this->db->sql_in_set('word_id', $title_word_ids) . ' AND word_count > 0'; - $db->sql_query($sql); + $this->db->sql_query($sql); } if (sizeof($message_word_ids)) { $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . ' SET word_count = word_count - 1 - WHERE ' . $db->sql_in_set('word_id', $message_word_ids) . ' + WHERE ' . $this->db->sql_in_set('word_id', $message_word_ids) . ' AND word_count > 0'; - $db->sql_query($sql); + $this->db->sql_query($sql); } unset($title_word_ids); unset($message_word_ids); $sql = 'DELETE FROM ' . SEARCH_WORDMATCH_TABLE . ' - WHERE ' . $db->sql_in_set('post_id', $post_ids); - $db->sql_query($sql); + WHERE ' . $this->db->sql_in_set('post_id', $post_ids); + $this->db->sql_query($sql); } $this->destroy_cache(array_unique($word_texts), array_unique($author_ids)); @@ -1342,13 +1423,11 @@ class phpbb_search_fulltext_native extends phpbb_search_base * Tidy up indexes: Tag 'common words' and remove * words no longer referenced in the match table */ - function tidy() + public function tidy() { - global $db, $config; - // Is the fulltext indexer disabled? If yes then we need not // carry on ... it's okay ... I know when I'm not wanted boo hoo - if (!$config['fulltext_native_load_upd']) + if (!$this->config['fulltext_native_load_upd']) { set_config('search_last_gc', time(), true); return; @@ -1357,31 +1436,31 @@ class phpbb_search_fulltext_native extends phpbb_search_base $destroy_cache_words = array(); // Remove common words - if ($config['num_posts'] >= 100 && $config['fulltext_native_common_thres']) + if ($this->config['num_posts'] >= 100 && $this->config['fulltext_native_common_thres']) { - $common_threshold = ((double) $config['fulltext_native_common_thres']) / 100.0; + $common_threshold = ((double) $this->config['fulltext_native_common_thres']) / 100.0; // First, get the IDs of common words $sql = 'SELECT word_id, word_text FROM ' . SEARCH_WORDLIST_TABLE . ' - WHERE word_count > ' . floor($config['num_posts'] * $common_threshold) . ' + WHERE word_count > ' . floor($this->config['num_posts'] * $common_threshold) . ' OR word_common = 1'; - $result = $db->sql_query($sql); + $result = $this->db->sql_query($sql); $sql_in = array(); - while ($row = $db->sql_fetchrow($result)) + while ($row = $this->db->sql_fetchrow($result)) { $sql_in[] = $row['word_id']; $destroy_cache_words[] = $row['word_text']; } - $db->sql_freeresult($result); + $this->db->sql_freeresult($result); if (sizeof($sql_in)) { // Flag the words $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . ' SET word_common = 1 - WHERE ' . $db->sql_in_set('word_id', $sql_in); - $db->sql_query($sql); + WHERE ' . $this->db->sql_in_set('word_id', $sql_in); + $this->db->sql_query($sql); // by setting search_last_gc to the new time here we make sure that if a user reloads because the // following query takes too long, he won't run into it again @@ -1389,8 +1468,8 @@ class phpbb_search_fulltext_native extends phpbb_search_base // Delete the matches $sql = 'DELETE FROM ' . SEARCH_WORDMATCH_TABLE . ' - WHERE ' . $db->sql_in_set('word_id', $sql_in); - $db->sql_query($sql); + WHERE ' . $this->db->sql_in_set('word_id', $sql_in); + $this->db->sql_query($sql); } unset($sql_in); } @@ -1407,23 +1486,21 @@ class phpbb_search_fulltext_native extends phpbb_search_base /** * Deletes all words from the index */ - function delete_index($acp_module, $u_action) + public function delete_index($acp_module, $u_action) { - global $db; - - switch ($db->sql_layer) + switch ($this->db->sql_layer) { case 'sqlite': case 'firebird': - $db->sql_query('DELETE FROM ' . SEARCH_WORDLIST_TABLE); - $db->sql_query('DELETE FROM ' . SEARCH_WORDMATCH_TABLE); - $db->sql_query('DELETE FROM ' . SEARCH_RESULTS_TABLE); + $this->db->sql_query('DELETE FROM ' . SEARCH_WORDLIST_TABLE); + $this->db->sql_query('DELETE FROM ' . SEARCH_WORDMATCH_TABLE); + $this->db->sql_query('DELETE FROM ' . SEARCH_RESULTS_TABLE); break; default: - $db->sql_query('TRUNCATE TABLE ' . SEARCH_WORDLIST_TABLE); - $db->sql_query('TRUNCATE TABLE ' . SEARCH_WORDMATCH_TABLE); - $db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE); + $this->db->sql_query('TRUNCATE TABLE ' . SEARCH_WORDLIST_TABLE); + $this->db->sql_query('TRUNCATE TABLE ' . SEARCH_WORDMATCH_TABLE); + $this->db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE); break; } } @@ -1431,7 +1508,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base /** * Returns true if both FULLTEXT indexes exist */ - function index_created() + public function index_created() { if (!sizeof($this->stats)) { @@ -1444,26 +1521,22 @@ class phpbb_search_fulltext_native extends phpbb_search_base /** * Returns an associative array containing information about the indexes */ - function index_stats() + public function index_stats() { - global $user; - if (!sizeof($this->stats)) { $this->get_stats(); } return array( - $user->lang['TOTAL_WORDS'] => $this->stats['total_words'], - $user->lang['TOTAL_MATCHES'] => $this->stats['total_matches']); + $this->user->lang['TOTAL_WORDS'] => $this->stats['total_words'], + $this->user->lang['TOTAL_MATCHES'] => $this->stats['total_matches']); } - function get_stats() + protected function get_stats() { - global $db; - - $this->stats['total_words'] = $db->get_estimated_row_count(SEARCH_WORDLIST_TABLE); - $this->stats['total_matches'] = $db->get_estimated_row_count(SEARCH_WORDMATCH_TABLE); + $this->stats['total_words'] = $this->db->get_estimated_row_count(SEARCH_WORDLIST_TABLE); + $this->stats['total_matches'] = $this->db->get_estimated_row_count(SEARCH_WORDMATCH_TABLE); } /** @@ -1481,9 +1554,8 @@ class phpbb_search_fulltext_native extends phpbb_search_base * * @todo normalizer::cleanup being able to be used? */ - function cleanup($text, $allowed_chars = null, $encoding = 'utf-8') + protected function cleanup($text, $allowed_chars = null, $encoding = 'utf-8') { - global $phpbb_root_path, $phpEx; static $conv = array(), $conv_loaded = array(); $words = $allow = array(); @@ -1680,7 +1752,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base if (!isset($conv_loaded[$idx])) { $conv_loaded[$idx] = 1; - $file = $phpbb_root_path . 'includes/utf/data/search_indexer_' . $idx . '.' . $phpEx; + $file = $this->phpbb_root_path . 'includes/utf/data/search_indexer_' . $idx . '.' . $this->php_ext; if (file_exists($file)) { @@ -1711,31 +1783,28 @@ class phpbb_search_fulltext_native extends phpbb_search_base /** * Returns a list of options for the ACP to display */ - function acp() + public function acp() { - global $user, $config; - - /** * if we need any options, copied from fulltext_native for now, will have to be adjusted or removed */ $tpl = ' <dl> - <dt><label for="fulltext_native_load_upd">' . $user->lang['YES_SEARCH_UPDATE'] . ':</label><br /><span>' . $user->lang['YES_SEARCH_UPDATE_EXPLAIN'] . '</span></dt> - <dd><label><input type="radio" id="fulltext_native_load_upd" name="config[fulltext_native_load_upd]" value="1"' . (($config['fulltext_native_load_upd']) ? ' checked="checked"' : '') . ' class="radio" /> ' . $user->lang['YES'] . '</label><label><input type="radio" name="config[fulltext_native_load_upd]" value="0"' . ((!$config['fulltext_native_load_upd']) ? ' checked="checked"' : '') . ' class="radio" /> ' . $user->lang['NO'] . '</label></dd> + <dt><label for="fulltext_native_load_upd">' . $this->user->lang['YES_SEARCH_UPDATE'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['YES_SEARCH_UPDATE_EXPLAIN'] . '</span></dt> + <dd><label><input type="radio" id="fulltext_native_load_upd" name="config[fulltext_native_load_upd]" value="1"' . (($this->config['fulltext_native_load_upd']) ? ' checked="checked"' : '') . ' class="radio" /> ' . $this->user->lang['YES'] . '</label><label><input type="radio" name="config[fulltext_native_load_upd]" value="0"' . ((!$this->config['fulltext_native_load_upd']) ? ' checked="checked"' : '') . ' class="radio" /> ' . $this->user->lang['NO'] . '</label></dd> </dl> <dl> - <dt><label for="fulltext_native_min_chars">' . $user->lang['MIN_SEARCH_CHARS'] . ':</label><br /><span>' . $user->lang['MIN_SEARCH_CHARS_EXPLAIN'] . '</span></dt> - <dd><input id="fulltext_native_min_chars" type="text" size="3" maxlength="3" name="config[fulltext_native_min_chars]" value="' . (int) $config['fulltext_native_min_chars'] . '" /></dd> + <dt><label for="fulltext_native_min_chars">' . $this->user->lang['MIN_SEARCH_CHARS'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['MIN_SEARCH_CHARS_EXPLAIN'] . '</span></dt> + <dd><input id="fulltext_native_min_chars" type="text" size="3" maxlength="3" name="config[fulltext_native_min_chars]" value="' . (int) $this->config['fulltext_native_min_chars'] . '" /></dd> </dl> <dl> - <dt><label for="fulltext_native_max_chars">' . $user->lang['MAX_SEARCH_CHARS'] . ':</label><br /><span>' . $user->lang['MAX_SEARCH_CHARS_EXPLAIN'] . '</span></dt> - <dd><input id="fulltext_native_max_chars" type="text" size="3" maxlength="3" name="config[fulltext_native_max_chars]" value="' . (int) $config['fulltext_native_max_chars'] . '" /></dd> + <dt><label for="fulltext_native_max_chars">' . $this->user->lang['MAX_SEARCH_CHARS'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['MAX_SEARCH_CHARS_EXPLAIN'] . '</span></dt> + <dd><input id="fulltext_native_max_chars" type="text" size="3" maxlength="3" name="config[fulltext_native_max_chars]" value="' . (int) $this->config['fulltext_native_max_chars'] . '" /></dd> </dl> <dl> - <dt><label for="fulltext_native_common_thres">' . $user->lang['COMMON_WORD_THRESHOLD'] . ':</label><br /><span>' . $user->lang['COMMON_WORD_THRESHOLD_EXPLAIN'] . '</span></dt> - <dd><input id="fulltext_native_common_thres" type="text" size="3" maxlength="3" name="config[fulltext_native_common_thres]" value="' . (double) $config['fulltext_native_common_thres'] . '" /> %</dd> + <dt><label for="fulltext_native_common_thres">' . $this->user->lang['COMMON_WORD_THRESHOLD'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['COMMON_WORD_THRESHOLD_EXPLAIN'] . '</span></dt> + <dd><input id="fulltext_native_common_thres" type="text" size="3" maxlength="3" name="config[fulltext_native_common_thres]" value="' . (double) $this->config['fulltext_native_common_thres'] . '" /> %</dd> </dl> '; diff --git a/phpBB/includes/search/fulltext_postgres.php b/phpBB/includes/search/fulltext_postgres.php new file mode 100644 index 0000000000..2880610655 --- /dev/null +++ b/phpBB/includes/search/fulltext_postgres.php @@ -0,0 +1,910 @@ +<?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 +{ + /** + * Associative array holding index stats + * @var array + */ + protected $stats = array(); + + /** + * Holds the words entered by user, obtained by splitting the entered query on whitespace + * @var array + */ + protected $split_words = array(); + + /** + * True if PostgreSQL version supports tsearch + * @var boolean + */ + protected $tsearch_usable = false; + + /** + * Stores the PostgreSQL version + * @var string + */ + protected $version; + + /** + * Stores the tsearch query + * @var string + */ + protected $tsearch_query; + + /** + * True if phrase search is supported. + * PostgreSQL fulltext currently doesn't support it + * @var boolean + */ + protected $phrase_search = false; + + /** + * Config object + * @var phpbb_config + */ + protected $config; + + /** + * DBAL object + * @var dbal + */ + protected $db; + + /** + * User object + * @var phpbb_user + */ + protected $user; + + /** + * Contains tidied search query. + * Operators are prefixed in search query and common words excluded + * @var string + */ + protected $search_query; + + /** + * Contains common words. + * Common words are words with length less/more than min/max length + * @var array + */ + protected $common_words = array(); + + /** + * Associative array stores the min and max word length to be searched + * @var array + */ + protected $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, $phpbb_root_path, $phpEx, $auth, $config, $db, $user) + { + $this->config = $config; + $this->db = $db; + $this->user = $user; + + $this->word_length = array('min' => $this->config['fulltext_postgres_min_word_len'], 'max' => $this->config['fulltext_postgres_max_word_len']); + + if ($this->db->sql_layer == 'postgres') + { + $pgsql_version = explode(',', substr($this->db->sql_server_info(), 10)); + $this->version = trim($pgsql_version[0]); + if (version_compare($this->version, '8.3', '>=')) + { + $this->tsearch_usable = true; + } + } + + /** + * Load the UTF tools + */ + if (!function_exists('utf8_strlen')) + { + include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); + } + + $error = false; + } + + /** + * Returns the name of this search backend to be displayed to administrators + * + * @return string Name + */ + public function get_name() + { + return 'PostgreSQL Fulltext'; + } + + /** + * Returns the search_query + * + * @return string search query + */ + public function get_search_query() + { + return $this->search_query; + } + + /** + * Returns the common_words array + * + * @return array common words that are ignored by search backend + */ + public function get_common_words() + { + return $this->common_words; + } + + /** + * Returns the word_length array + * + * @return array min and max word length for searching + */ + public function get_word_length() + { + return $this->word_length; + } + + /** + * Returns if phrase search is supported or not + * + * @return bool + */ + 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 + */ + public function init() + { + if ($this->db->sql_layer != 'postgres') + { + return $this->user->lang['FULLTEXT_POSTGRES_INCOMPATIBLE_DATABASE']; + } + + if (!$this->tsearch_usable) + { + return $this->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 + */ + public function split_keywords(&$keywords, $terms) + { + 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 < $this->config['fulltext_postgres_min_word_len']) || ($clean_len > $this->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 + */ + public function split_message($text) + { + // 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]) < $this->config['fulltext_postgres_min_word_len'] || utf8_strlen($text[$i]) > $this->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 + */ + 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) + { + // No keywords? No posts + if (!$this->search_query) + { + return false; + } + + // When search query contains queries like -foo + if (strpos($this->search_query, '+') === false) + { + 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 ' . $this->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 = '(' . $this->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 ' . $this->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 ' . $this->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 ('" . $this->db->sql_escape($this->config['fulltext_postgres_ts_name']) . "', " . $sql_match_column . ") @@ to_tsquery ('" . $this->db->sql_escape($this->config['fulltext_postgres_ts_name']) . "', '" . $this->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 = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start); + + while ($row = $this->db->sql_fetchrow($result)) + { + $id_ary[] = $row[$field]; + } + $this->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 + */ + 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) + { + // 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 = '(' . $this->db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')'; + } + else + { + $sql_author = $this->db->sql_in_set('p.poster_id', $author_ary); + } + $sql_fora = (sizeof($ex_fid_ary)) ? ' AND ' . $this->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 ' . $this->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 = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start); + + while ($row = $this->db->sql_fetchrow($result)) + { + $id_ary[] = $row[$field]; + } + $this->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 + */ + public function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id) + { + // 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 + */ + public function index_remove($post_ids, $author_ids, $forum_ids) + { + $this->destroy_cache(array(), $author_ids); + } + + /** + * Destroy old cache entries + */ + public function tidy() + { + // 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 + */ + public function create_index($acp_module, $u_action) + { + // 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'])) + { + $this->db->sql_query("CREATE INDEX " . POSTS_TABLE . "_" . $this->config['fulltext_postgres_ts_name'] . "_post_subject ON " . POSTS_TABLE . " USING gin (to_tsvector ('" . $this->db->sql_escape($this->config['fulltext_postgres_ts_name']) . "', post_subject))"); + } + + if (!isset($this->stats['post_text'])) + { + $this->db->sql_query("CREATE INDEX " . POSTS_TABLE . "_" . $this->config['fulltext_postgres_ts_name'] . "_post_text ON " . POSTS_TABLE . " USING gin (to_tsvector ('" . $this->db->sql_escape($this->config['fulltext_postgres_ts_name']) . "', post_text))"); + } + + $this->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 + */ + public function delete_index($acp_module, $u_action) + { + // 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'])) + { + $this->db->sql_query('DROP INDEX ' . $this->stats['post_subject']['relname']); + } + + if (isset($this->stats['post_text'])) + { + $this->db->sql_query('DROP INDEX ' . $this->stats['post_text']['relname']); + } + + $this->db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE); + + return false; + } + + /** + * Returns true if both FULLTEXT indexes exist + */ + 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 + */ + public function index_stats() + { + if (empty($this->stats)) + { + $this->get_stats(); + } + + return array( + $this->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 + */ + protected function get_stats() + { + if ($this->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 = $this->db->sql_query($sql); + + while ($row = $this->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 . '_' . $this->config['fulltext_postgres_ts_name'] . '_post_text' || $row['relname'] == POSTS_TABLE . '_post_text') + { + $this->stats['post_text'] = $row; + } + else if ($row['relname'] == POSTS_TABLE . '_' . $this->config['fulltext_postgres_ts_name'] . '_post_subject' || $row['relname'] == POSTS_TABLE . '_post_subject') + { + $this->stats['post_subject'] = $row; + } + } + } + $this->db->sql_freeresult($result); + + $this->stats['total_posts'] = $this->config['num_posts']; + } + + /** + * Display various options that can be configured for the backend from the acp + * + * @return associative array containing template and config variables + */ + public function acp() + { + $tpl = ' + <dl> + <dt><label>' . $this->user->lang['FULLTEXT_POSTGRES_VERSION_CHECK'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_POSTGRES_VERSION_CHECK_EXPLAIN'] . '</span></dt> + <dd>' . (($this->tsearch_usable) ? $this->user->lang['YES'] : $this->user->lang['NO']) . ' (PostgreSQL ' . $this->version . ')</dd> + </dl> + <dl> + <dt><label>' . $this->user->lang['FULLTEXT_POSTGRES_TS_NAME'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_POSTGRES_TS_NAME_EXPLAIN'] . '</span></dt> + <dd><select name="config[fulltext_postgres_ts_name]">'; + + if ($this->db->sql_layer == 'postgres' && $this->tsearch_usable) + { + $sql = 'SELECT cfgname AS ts_name + FROM pg_ts_config'; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $tpl .= '<option value="' . $row['ts_name'] . '"' . ($row['ts_name'] === $this->config['fulltext_postgres_ts_name'] ? ' selected="selected"' : '') . '>' . $row['ts_name'] . '</option>'; + } + $this->db->sql_freeresult($result); + } + else + { + $tpl .= '<option value="' . $this->config['fulltext_postgres_ts_name'] . '" selected="selected">' . $this->config['fulltext_postgres_ts_name'] . '</option>'; + } + + $tpl .= '</select></dd> + </dl> + <dl> + <dt><label for="fulltext_postgres_min_word_len">' . $this->user->lang['FULLTEXT_POSTGRES_MIN_WORD_LEN'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->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) $this->config['fulltext_postgres_min_word_len'] . '" /></dd> + </dl> + <dl> + <dt><label for="fulltext_postgres_max_word_len">' . $this->user->lang['FULLTEXT_POSTGRES_MAX_WORD_LEN'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->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) $this->config['fulltext_postgres_max_word_len'] . '" /></dd> + </dl> + '; + + // These are fields required in the config table + return array( + 'tpl' => $tpl, + 'config' => array('fulltext_postgres_ts_name' => 'string', 'fulltext_postgres_min_word_len' => 'integer:0:255', 'fulltext_postgres_max_word_len' => 'integer:0:255') + ); + } +} diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php new file mode 100644 index 0000000000..dd5634b623 --- /dev/null +++ b/phpBB/includes/search/fulltext_sphinx.php @@ -0,0 +1,892 @@ +<?php +/** +* +* @package search +* @copyright (c) 2005 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** +* @ignore +*/ +define('SPHINX_MAX_MATCHES', 20000); +define('SPHINX_CONNECT_RETRIES', 3); +define('SPHINX_CONNECT_WAIT_TIME', 300); + +/** +* fulltext_sphinx +* Fulltext search based on the sphinx search deamon +* @package search +*/ +class phpbb_search_fulltext_sphinx +{ + /** + * Associative array holding index stats + * @var array + */ + protected $stats = array(); + + /** + * Holds the words entered by user, obtained by splitting the entered query on whitespace + * @var array + */ + protected $split_words = array(); + + /** + * Holds unique sphinx id + * @var string + */ + protected $id; + + /** + * Stores the names of both main and delta sphinx indexes + * separated by a semicolon + * @var string + */ + protected $indexes; + + /** + * Sphinx searchd client object + * @var SphinxClient + */ + protected $sphinx; + + /** + * Relative path to board root + * @var string + */ + protected $phpbb_root_path; + + /** + * PHP Extension + * @var string + */ + protected $php_ext; + + /** + * Auth object + * @var phpbb_auth + */ + protected $auth; + + /** + * Config object + * @var phpbb_config + */ + protected $config; + + /** + * DBAL object + * @var dbal + */ + protected $db; + + /** + * Database Tools object + * @var phpbb_db_tools + */ + protected $db_tools; + + /** + * Stores the database type if supported by sphinx + * @var string + */ + protected $dbtype; + + /** + * User object + * @var phpbb_user + */ + protected $user; + + /** + * Stores the generated content of the sphinx config file + * @var string + */ + protected $config_file_data = ''; + + /** + * Contains tidied search query. + * Operators are prefixed in search query and common words excluded + * @var string + */ + protected $search_query; + + /** + * 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, $phpbb_root_path, $phpEx, $auth, $config, $db, $user) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $phpEx; + $this->config = $config; + $this->user = $user; + $this->db = $db; + $this->auth = $auth; + + if (!class_exists('phpbb_db_tools')) + { + require($this->phpbb_root_path . 'includes/db/db_tools.' . $this->php_ext); + } + + // Initialize phpbb_db_tools object + $this->db_tools = new phpbb_db_tools($this->db); + + if(!$this->config['fulltext_sphinx_id']) + { + set_config('fulltext_sphinx_id', unique_id()); + } + $this->id = $this->config['fulltext_sphinx_id']; + $this->indexes = 'index_phpbb_' . $this->id . '_delta;index_phpbb_' . $this->id . '_main'; + + if (!class_exists('SphinxClient')) + { + require($this->phpbb_root_path . 'includes/sphinxapi.' . $this->php_ext); + } + + // Initialize sphinx client + $this->sphinx = new SphinxClient(); + + $this->sphinx->SetServer(($this->config['fulltext_sphinx_host'] ? $this->config['fulltext_sphinx_host'] : 'localhost'), ($this->config['fulltext_sphinx_port'] ? (int) $this->config['fulltext_sphinx_port'] : 9312)); + + $error = false; + } + + /** + * Returns the name of this search backend to be displayed to administrators + * + * @return string Name + */ + public function get_name() + { + return 'Sphinx Fulltext'; + } + + /** + * Returns the search_query + * + * @return string search query + */ + public function get_search_query() + { + return $this->search_query; + } + + /** + * Returns false as there is no word_len array + * + * @return false + */ + public function get_word_length() + { + return false; + } + + /** + * Returns an empty array as there are no common_words + * + * @return array common words that are ignored by search backend + */ + public function get_common_words() + { + return array(); + } + + /** + * Checks permissions and paths, if everything is correct it generates the config file + * + * @return string|bool Language key of the error/incompatiblity encountered, or false if successful + */ + public function init() + { + if ($this->db->sql_layer != 'mysql' && $this->db->sql_layer != 'mysql4' && $this->db->sql_layer != 'mysqli' && $this->db->sql_layer != 'postgres') + { + return $this->user->lang['FULLTEXT_SPHINX_WRONG_DATABASE']; + } + + // Move delta to main index each hour + set_config('search_gc', 3600); + + return false; + } + + /** + * Generates content of sphinx.conf + * + * @return bool True if sphinx.conf content is correctly generated, false otherwise + */ + protected function config_generate() + { + // Check if Database is supported by Sphinx + if ($this->db->sql_layer =='mysql' || $this->db->sql_layer == 'mysql4' || $this->db->sql_layer == 'mysqli') + { + $this->dbtype = 'mysql'; + } + else if ($this->db->sql_layer == 'postgres') + { + $this->dbtype = 'pgsql'; + } + else + { + $this->config_file_data = $this->user->lang('FULLTEXT_SPHINX_WRONG_DATABASE'); + return false; + } + + // Check if directory paths have been filled + if (!$this->config['fulltext_sphinx_data_path']) + { + $this->config_file_data = $this->user->lang('FULLTEXT_SPHINX_NO_CONFIG_DATA'); + return false; + } + + include($this->phpbb_root_path . 'config.' . $this->php_ext); + + /* Now that we're sure everything was entered correctly, + generate a config for the index. We use a config value + fulltext_sphinx_id for this, as it should be unique. */ + $config_object = new phpbb_search_sphinx_config($this->config_file_data); + $config_data = array( + 'source source_phpbb_' . $this->id . '_main' => array( + array('type', $this->dbtype), + // This config value sql_host needs to be changed incase sphinx and sql are on different servers + array('sql_host', $dbhost), + array('sql_user', $dbuser), + array('sql_pass', $dbpasswd), + array('sql_db', $dbname), + array('sql_port', $dbport), + array('sql_query_pre', 'SET NAMES \'utf8\''), + array('sql_query_pre', 'UPDATE ' . SPHINX_TABLE . ' SET max_doc_id = (SELECT MAX(post_id) FROM ' . POSTS_TABLE . ') WHERE counter_id = 1'), + array('sql_query_range', 'SELECT MIN(post_id), MAX(post_id) FROM ' . POSTS_TABLE . ''), + array('sql_range_step', '5000'), + array('sql_query', 'SELECT + p.post_id AS id, + p.forum_id, + p.topic_id, + p.poster_id, + CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post, + p.post_time, + p.post_subject, + p.post_subject as title, + p.post_text as data, + t.topic_last_post_time, + 0 as deleted + FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t + WHERE + p.topic_id = t.topic_id + AND p.post_id >= $start AND p.post_id <= $end'), + array('sql_query_post', ''), + array('sql_query_post_index', 'UPDATE ' . SPHINX_TABLE . ' SET max_doc_id = $maxid WHERE counter_id = 1'), + array('sql_query_info', 'SELECT * FROM ' . POSTS_TABLE . ' WHERE post_id = $id'), + array('sql_attr_uint', 'forum_id'), + array('sql_attr_uint', 'topic_id'), + array('sql_attr_uint', 'poster_id'), + array('sql_attr_bool', 'topic_first_post'), + array('sql_attr_bool', 'deleted'), + array('sql_attr_timestamp' , 'post_time'), + array('sql_attr_timestamp' , 'topic_last_post_time'), + array('sql_attr_str2ordinal', 'post_subject'), + ), + 'source source_phpbb_' . $this->id . '_delta : source_phpbb_' . $this->id . '_main' => array( + array('sql_query_pre', ''), + array('sql_query_range', ''), + array('sql_range_step', ''), + array('sql_query', 'SELECT + p.post_id AS id, + p.forum_id, + p.topic_id, + p.poster_id, + CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post, + p.post_time, + p.post_subject, + p.post_subject as title, + p.post_text as data, + t.topic_last_post_time, + 0 as deleted + FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t + WHERE + p.topic_id = t.topic_id + AND p.post_id >= ( SELECT max_doc_id FROM ' . SPHINX_TABLE . ' WHERE counter_id=1 )'), + ), + 'index index_phpbb_' . $this->id . '_main' => array( + array('path', $this->config['fulltext_sphinx_data_path'] . 'index_phpbb_' . $this->id . '_main'), + array('source', 'source_phpbb_' . $this->id . '_main'), + array('docinfo', 'extern'), + array('morphology', 'none'), + array('stopwords', ''), + array('min_word_len', '2'), + array('charset_type', 'utf-8'), + array('charset_table', 'U+FF10..U+FF19->0..9, 0..9, U+FF41..U+FF5A->a..z, U+FF21..U+FF3A->a..z, A..Z->a..z, a..z, U+0149, U+017F, U+0138, U+00DF, U+00FF, U+00C0..U+00D6->U+00E0..U+00F6, U+00E0..U+00F6, U+00D8..U+00DE->U+00F8..U+00FE, U+00F8..U+00FE, U+0100->U+0101, U+0101, U+0102->U+0103, U+0103, U+0104->U+0105, U+0105, U+0106->U+0107, U+0107, U+0108->U+0109, U+0109, U+010A->U+010B, U+010B, U+010C->U+010D, U+010D, U+010E->U+010F, U+010F, U+0110->U+0111, U+0111, U+0112->U+0113, U+0113, U+0114->U+0115, U+0115, U+0116->U+0117, U+0117, U+0118->U+0119, U+0119, U+011A->U+011B, U+011B, U+011C->U+011D, U+011D, U+011E->U+011F, U+011F, U+0130->U+0131, U+0131, U+0132->U+0133, U+0133, U+0134->U+0135, U+0135, U+0136->U+0137, U+0137, U+0139->U+013A, U+013A, U+013B->U+013C, U+013C, U+013D->U+013E, U+013E, U+013F->U+0140, U+0140, U+0141->U+0142, U+0142, U+0143->U+0144, U+0144, U+0145->U+0146, U+0146, U+0147->U+0148, U+0148, U+014A->U+014B, U+014B, U+014C->U+014D, U+014D, U+014E->U+014F, U+014F, U+0150->U+0151, U+0151, U+0152->U+0153, U+0153, U+0154->U+0155, U+0155, U+0156->U+0157, U+0157, U+0158->U+0159, U+0159, U+015A->U+015B, U+015B, U+015C->U+015D, U+015D, U+015E->U+015F, U+015F, U+0160->U+0161, U+0161, U+0162->U+0163, U+0163, U+0164->U+0165, U+0165, U+0166->U+0167, U+0167, U+0168->U+0169, U+0169, U+016A->U+016B, U+016B, U+016C->U+016D, U+016D, U+016E->U+016F, U+016F, U+0170->U+0171, U+0171, U+0172->U+0173, U+0173, U+0174->U+0175, U+0175, U+0176->U+0177, U+0177, U+0178->U+00FF, U+00FF, U+0179->U+017A, U+017A, U+017B->U+017C, U+017C, U+017D->U+017E, U+017E, U+0410..U+042F->U+0430..U+044F, U+0430..U+044F, U+4E00..U+9FFF'), + array('min_prefix_len', '0'), + array('min_infix_len', '0'), + ), + 'index index_phpbb_' . $this->id . '_delta : index_phpbb_' . $this->id . '_main' => array( + array('path', $this->config['fulltext_sphinx_data_path'] . 'index_phpbb_' . $this->id . '_delta'), + array('source', 'source_phpbb_' . $this->id . '_delta'), + ), + 'indexer' => array( + array('mem_limit', $this->config['fulltext_sphinx_indexer_mem_limit'] . 'M'), + ), + 'searchd' => array( + array('compat_sphinxql_magics' , '0'), + array('listen' , ($this->config['fulltext_sphinx_host'] ? $this->config['fulltext_sphinx_host'] : 'localhost') . ':' . ($this->config['fulltext_sphinx_port'] ? $this->config['fulltext_sphinx_port'] : '9312')), + array('log', $this->config['fulltext_sphinx_data_path'] . 'log/searchd.log'), + array('query_log', $this->config['fulltext_sphinx_data_path'] . 'log/sphinx-query.log'), + array('read_timeout', '5'), + array('max_children', '30'), + array('pid_file', $this->config['fulltext_sphinx_data_path'] . 'searchd.pid'), + array('max_matches', (string) SPHINX_MAX_MATCHES), + array('binlog_path', $this->config['fulltext_sphinx_data_path']), + ), + ); + + $non_unique = array('sql_query_pre' => true, 'sql_attr_uint' => true, 'sql_attr_timestamp' => true, 'sql_attr_str2ordinal' => true, 'sql_attr_bool' => true); + $delete = array('sql_group_column' => true, 'sql_date_column' => true, 'sql_str2ordinal_column' => true); + foreach ($config_data as $section_name => $section_data) + { + $section = $config_object->get_section_by_name($section_name); + if (!$section) + { + $section = $config_object->add_section($section_name); + } + + foreach ($delete as $key => $void) + { + $section->delete_variables_by_name($key); + } + + foreach ($non_unique as $key => $void) + { + $section->delete_variables_by_name($key); + } + + foreach ($section_data as $entry) + { + $key = $entry[0]; + $value = $entry[1]; + + if (!isset($non_unique[$key])) + { + $variable = $section->get_variable_by_name($key); + if (!$variable) + { + $variable = $section->create_variable($key, $value); + } + else + { + $variable->set_value($value); + } + } + else + { + $variable = $section->create_variable($key, $value); + } + } + } + $this->config_file_data = $config_object->get_data(); + + return true; + } + + /** + * 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 false if no valid keywords were found and otherwise true + */ + public function split_keywords(&$keywords, $terms) + { + if ($terms == 'all') + { + $match = array('#\sand\s#i', '#\sor\s#i', '#\snot\s#i', '#\+#', '#-#', '#\|#', '#@#'); + $replace = array(' & ', ' | ', ' - ', ' +', ' -', ' |', ''); + + $replacements = 0; + $keywords = preg_replace($match, $replace, $keywords); + $this->sphinx->SetMatchMode(SPH_MATCH_EXTENDED); + } + else + { + $this->sphinx->SetMatchMode(SPH_MATCH_ANY); + } + + // Keep quotes and new lines + $keywords = str_replace(array('"', "\n"), array('"', ' '), trim($keywords)); + + if (strlen($keywords) > 0) + { + $this->search_query = str_replace('"', '"', $keywords); + return true; + } + + return false; + } + + /** + * 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 + */ + 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) + { + // No keywords? No posts. + if (!strlen($this->search_query) && !sizeof($author_ary)) + { + return false; + } + + $id_ary = array(); + + $join_topic = ($type != 'posts'); + + // Sorting + + if ($type == 'topics') + { + switch ($sort_key) + { + case 'a': + $this->sphinx->SetGroupBy('topic_id', SPH_GROUPBY_ATTR, 'poster_id ' . (($sort_dir == 'a') ? 'ASC' : 'DESC')); + break; + + case 'f': + $this->sphinx->SetGroupBy('topic_id', SPH_GROUPBY_ATTR, 'forum_id ' . (($sort_dir == 'a') ? 'ASC' : 'DESC')); + break; + + case 'i': + + case 's': + $this->sphinx->SetGroupBy('topic_id', SPH_GROUPBY_ATTR, 'post_subject ' . (($sort_dir == 'a') ? 'ASC' : 'DESC')); + break; + + case 't': + + default: + $this->sphinx->SetGroupBy('topic_id', SPH_GROUPBY_ATTR, 'topic_last_post_time ' . (($sort_dir == 'a') ? 'ASC' : 'DESC')); + break; + } + } + else + { + switch ($sort_key) + { + case 'a': + $this->sphinx->SetSortMode(($sort_dir == 'a') ? SPH_SORT_ATTR_ASC : SPH_SORT_ATTR_DESC, 'poster_id'); + break; + + case 'f': + $this->sphinx->SetSortMode(($sort_dir == 'a') ? SPH_SORT_ATTR_ASC : SPH_SORT_ATTR_DESC, 'forum_id'); + break; + + case 'i': + + case 's': + $this->sphinx->SetSortMode(($sort_dir == 'a') ? SPH_SORT_ATTR_ASC : SPH_SORT_ATTR_DESC, 'post_subject'); + break; + + case 't': + + default: + $this->sphinx->SetSortMode(($sort_dir == 'a') ? SPH_SORT_ATTR_ASC : SPH_SORT_ATTR_DESC, 'post_time'); + break; + } + } + + // Most narrow filters first + if ($topic_id) + { + $this->sphinx->SetFilter('topic_id', array($topic_id)); + } + + $search_query_prefix = ''; + + switch ($fields) + { + case 'titleonly': + // Only search the title + if ($terms == 'all') + { + $search_query_prefix = '@title '; + } + // Weight for the title + $this->sphinx->SetFieldWeights(array("title" => 5, "data" => 1)); + // 1 is first_post, 0 is not first post + $this->sphinx->SetFilter('topic_first_post', array(1)); + break; + + case 'msgonly': + // Only search the body + if ($terms == 'all') + { + $search_query_prefix = '@data '; + } + // Weight for the body + $this->sphinx->SetFieldWeights(array("title" => 1, "data" => 5)); + break; + + case 'firstpost': + // More relative weight for the title, also search the body + $this->sphinx->SetFieldWeights(array("title" => 5, "data" => 1)); + // 1 is first_post, 0 is not first post + $this->sphinx->SetFilter('topic_first_post', array(1)); + break; + + default: + // More relative weight for the title, also search the body + $this->sphinx->SetFieldWeights(array("title" => 5, "data" => 1)); + break; + } + + if (sizeof($author_ary)) + { + $this->sphinx->SetFilter('poster_id', $author_ary); + } + + if (sizeof($ex_fid_ary)) + { + // All forums that a user is allowed to access + $fid_ary = array_unique(array_intersect(array_keys($this->auth->acl_getf('f_read', true)), array_keys($this->auth->acl_getf('f_search', true)))); + // All forums that the user wants to and can search in + $search_forums = array_diff($fid_ary, $ex_fid_ary); + + if (sizeof($search_forums)) + { + $this->sphinx->SetFilter('forum_id', $search_forums); + } + } + + $this->sphinx->SetFilter('deleted', array(0)); + + $this->sphinx->SetLimits($start, (int) $per_page, SPHINX_MAX_MATCHES); + $result = $this->sphinx->Query($search_query_prefix . str_replace('"', '"', $this->search_query), $this->indexes); + + // Could be connection to localhost:9312 failed (errno=111, + // msg=Connection refused) during rotate, retry if so + $retries = SPHINX_CONNECT_RETRIES; + while (!$result && (strpos($this->sphinx->GetLastError(), "errno=111,") !== false) && $retries--) + { + usleep(SPHINX_CONNECT_WAIT_TIME); + $result = $this->sphinx->Query($search_query_prefix . str_replace('"', '"', $this->search_query), $this->indexes); + } + + if ($this->sphinx->GetLastError()) + { + add_log('critical', 'LOG_SPHINX_ERROR', $this->sphinx->GetLastError()); + if ($this->auth->acl_get('a_')) + { + trigger_error($this->user->lang('SPHINX_SEARCH_FAILED', $this->sphinx->GetLastError())); + } + else + { + trigger_error($this->user->lang('SPHINX_SEARCH_FAILED_LOG')); + } + } + + $id_ary = array(); + if (isset($result['matches'])) + { + if ($type == 'posts') + { + $id_ary = array_keys($result['matches']); + } + else + { + foreach ($result['matches'] as $key => $value) + { + $id_ary[] = $value['attrs']['topic_id']; + } + } + } + else + { + return false; + } + + $result_count = $result['total_found']; + + $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 + */ + 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) + { + $this->search_query = ''; + + $this->sphinx->SetMatchMode(SPH_MATCH_FULLSCAN); + $fields = ($firstpost_only) ? 'firstpost' : 'all'; + $terms = 'all'; + return $this->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); + } + + /** + * Updates wordlist and wordmatch tables when a message is posted or changed + * + * @param string $mode Contains the post mode: edit, post, reply, quote + * @param int $post_id The id of the post which is modified/created + * @param string &$message New or updated post content + * @param string &$subject New or updated post subject + * @param int $poster_id Post author's user id + * @param int $forum_id The id of the forum in which the post is located + */ + public function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id) + { + if ($mode == 'edit') + { + $this->sphinx->UpdateAttributes($this->indexes, array('forum_id', 'poster_id'), array((int)$post_id => array((int)$forum_id, (int)$poster_id))); + } + else if ($mode != 'post' && $post_id) + { + // Update topic_last_post_time for full topic + $sql_array = array( + 'SELECT' => 'p1.post_id', + 'FROM' => array( + POSTS_TABLE => 'p1', + ), + 'LEFT_JOIN' => array(array( + 'FROM' => array( + POSTS_TABLE => 'p2' + ), + 'ON' => 'p1.topic_id = p2.topic_id', + )), + ); + + $sql = $this->db->sql_build_query('SELECT', $sql_array); + $result = $this->db->sql_query($sql); + + $post_updates = array(); + $post_time = time(); + while ($row = $this->db->sql_fetchrow($result)) + { + $post_updates[(int)$row['post_id']] = array($post_time); + } + $this->db->sql_freeresult($result); + + if (sizeof($post_updates)) + { + $this->sphinx->UpdateAttributes($this->indexes, array('topic_last_post_time'), $post_updates); + } + } + } + + /** + * Delete a post from the index after it was deleted + */ + public function index_remove($post_ids, $author_ids, $forum_ids) + { + $values = array(); + foreach ($post_ids as $post_id) + { + $values[$post_id] = array(1); + } + + $this->sphinx->UpdateAttributes($this->indexes, array('deleted'), $values); + } + + /** + * Nothing needs to be destroyed + */ + public function tidy($create = false) + { + set_config('search_last_gc', time(), true); + } + + /** + * Create sphinx table + * + * @return string|bool error string is returned incase of errors otherwise false + */ + public function create_index($acp_module, $u_action) + { + if (!$this->index_created()) + { + $table_data = array( + 'COLUMNS' => array( + 'counter_id' => array('UINT', 0), + 'max_doc_id' => array('UINT', 0), + ), + 'PRIMARY_KEY' => 'counter_id', + ); + $this->db_tools->sql_create_table(SPHINX_TABLE, $table_data); + + $sql = 'TRUNCATE TABLE ' . SPHINX_TABLE; + $this->db->sql_query($sql); + + $data = array( + 'counter_id' => '1', + 'max_doc_id' => '0', + ); + $sql = 'INSERT INTO ' . SPHINX_TABLE . ' ' . $this->db->sql_build_array('INSERT', $data); + $this->db->sql_query($sql); + } + + return false; + } + + /** + * Drop sphinx table + * + * @return string|bool error string is returned incase of errors otherwise false + */ + public function delete_index($acp_module, $u_action) + { + if (!$this->index_created()) + { + return false; + } + + $this->db_tools->sql_table_drop(SPHINX_TABLE); + + return false; + } + + /** + * Returns true if the sphinx table was created + * + * @return bool true if sphinx table was created + */ + public function index_created($allow_new_files = true) + { + $created = false; + + if ($this->db_tools->sql_table_exists(SPHINX_TABLE)) + { + $created = true; + } + + return $created; + } + + /** + * Returns an associative array containing information about the indexes + * + * @return string|bool Language string of error false otherwise + */ + public function index_stats() + { + if (empty($this->stats)) + { + $this->get_stats(); + } + + return array( + $this->user->lang['FULLTEXT_SPHINX_MAIN_POSTS'] => ($this->index_created()) ? $this->stats['main_posts'] : 0, + $this->user->lang['FULLTEXT_SPHINX_DELTA_POSTS'] => ($this->index_created()) ? $this->stats['total_posts'] - $this->stats['main_posts'] : 0, + $this->user->lang['FULLTEXT_MYSQL_TOTAL_POSTS'] => ($this->index_created()) ? $this->stats['total_posts'] : 0, + ); + } + + /** + * Collects stats that can be displayed on the index maintenance page + */ + protected function get_stats() + { + if ($this->index_created()) + { + $sql = 'SELECT COUNT(post_id) as total_posts + FROM ' . POSTS_TABLE; + $result = $this->db->sql_query($sql); + $this->stats['total_posts'] = (int) $this->db->sql_fetchfield('total_posts'); + $this->db->sql_freeresult($result); + + $sql = 'SELECT COUNT(p.post_id) as main_posts + FROM ' . POSTS_TABLE . ' p, ' . SPHINX_TABLE . ' m + WHERE p.post_id <= m.max_doc_id + AND m.counter_id = 1'; + $result = $this->db->sql_query($sql); + $this->stats['main_posts'] = (int) $this->db->sql_fetchfield('main_posts'); + $this->db->sql_freeresult($result); + } + } + + /** + * Returns a list of options for the ACP to display + * + * @return associative array containing template and config variables + */ + public function acp() + { + $config_vars = array( + 'fulltext_sphinx_data_path' => 'string', + 'fulltext_sphinx_host' => 'string', + 'fulltext_sphinx_port' => 'string', + 'fulltext_sphinx_indexer_mem_limit' => 'int', + ); + + $tpl = ' + <span class="error">' . $this->user->lang['FULLTEXT_SPHINX_CONFIGURE']. '</span> + <dl> + <dt><label for="fulltext_sphinx_data_path">' . $this->user->lang['FULLTEXT_SPHINX_DATA_PATH'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_DATA_PATH_EXPLAIN'] . '</span></dt> + <dd><input id="fulltext_sphinx_data_path" type="text" size="40" maxlength="255" name="config[fulltext_sphinx_data_path]" value="' . $this->config['fulltext_sphinx_data_path'] . '" /></dd> + </dl> + <dl> + <dt><label for="fulltext_sphinx_host">' . $this->user->lang['FULLTEXT_SPHINX_HOST'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_HOST_EXPLAIN'] . '</span></dt> + <dd><input id="fulltext_sphinx_host" type="text" size="40" maxlength="255" name="config[fulltext_sphinx_host]" value="' . $this->config['fulltext_sphinx_host'] . '" /></dd> + </dl> + <dl> + <dt><label for="fulltext_sphinx_port">' . $this->user->lang['FULLTEXT_SPHINX_PORT'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_PORT_EXPLAIN'] . '</span></dt> + <dd><input id="fulltext_sphinx_port" type="text" size="4" maxlength="10" name="config[fulltext_sphinx_port]" value="' . $this->config['fulltext_sphinx_port'] . '" /></dd> + </dl> + <dl> + <dt><label for="fulltext_sphinx_indexer_mem_limit">' . $this->user->lang['FULLTEXT_SPHINX_INDEXER_MEM_LIMIT'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_INDEXER_MEM_LIMIT_EXPLAIN'] . '</span></dt> + <dd><input id="fulltext_sphinx_indexer_mem_limit" type="text" size="4" maxlength="10" name="config[fulltext_sphinx_indexer_mem_limit]" value="' . $this->config['fulltext_sphinx_indexer_mem_limit'] . '" />' . $this->user->lang['MIB'] . '</dd> + </dl> + <dl> + <dt><label for="fulltext_sphinx_config_file">' . $this->user->lang['FULLTEXT_SPHINX_CONFIG_FILE'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_CONFIG_FILE_EXPLAIN'] . '</dt> + <dd>' . (($this->config_generate()) ? '<textarea readonly="readonly" rows="6">' . $this->config_file_data . '</textarea>' : $this->config_file_data) . '</dd> + <dl> + '; + + // These are fields required in the config table + return array( + 'tpl' => $tpl, + 'config' => $config_vars + ); + } +} diff --git a/phpBB/includes/search/sphinx/config.php b/phpBB/includes/search/sphinx/config.php new file mode 100644 index 0000000000..f1864f0c8c --- /dev/null +++ b/phpBB/includes/search/sphinx/config.php @@ -0,0 +1,288 @@ +<?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; +} + +/** +* phpbb_search_sphinx_config +* An object representing the sphinx configuration +* Can read it from file and write it back out after modification +* @package search +*/ +class phpbb_search_sphinx_config +{ + private $sections = array(); + + /** + * Constructor which optionally loads data from a variable + * + * @param string $config_data Variable containing the sphinx configuration data + * + * @access public + */ + function __construct($config_data) + { + if ($config_data != '') + { + $this->read($config_data); + } + } + + /** + * Get a section object by its name + * + * @param string $name The name of the section that shall be returned + * @return phpbb_search_sphinx_config_section The section object or null if none was found + * + * @access public + */ + function get_section_by_name($name) + { + for ($i = 0, $size = sizeof($this->sections); $i < $size; $i++) + { + // Make sure this is really a section object and not a comment + if (($this->sections[$i] instanceof phpbb_search_sphinx_config_section) && $this->sections[$i]->get_name() == $name) + { + return $this->sections[$i]; + } + } + } + + /** + * Appends a new empty section to the end of the config + * + * @param string $name The name for the new section + * @return phpbb_search_sphinx_config_section The newly created section object + * + * @access public + */ + function add_section($name) + { + $this->sections[] = new phpbb_search_sphinx_config_section($name, ''); + return $this->sections[sizeof($this->sections) - 1]; + } + + /** + * Reads the config file data + * + * @param string $config_data The config file data + * + * @access private + */ + function read($config_data) + { + $this->sections = array(); + + $section = null; + $found_opening_bracket = false; + $in_value = false; + + foreach ($config_data as $i => $line) + { + // If the value of a variable continues to the next line because the line + // break was escaped then we don't trim leading space but treat it as a part of the value + if ($in_value) + { + $line = rtrim($line); + } + else + { + $line = trim($line); + } + + // If we're not inside a section look for one + if (!$section) + { + // Add empty lines and comments as comment objects to the section list + // that way they're not deleted when reassembling the file from the sections + if (!$line || $line[0] == '#') + { + $this->sections[] = new phpbb_search_sphinx_config_comment($config_file[$i]); + continue; + } + else + { + // Otherwise we scan the line reading the section name until we find + // an opening curly bracket or a comment + $section_name = ''; + $section_name_comment = ''; + $found_opening_bracket = false; + for ($j = 0, $length = strlen($line); $j < $length; $j++) + { + if ($line[$j] == '#') + { + $section_name_comment = substr($line, $j); + break; + } + + if ($found_opening_bracket) + { + continue; + } + + if ($line[$j] == '{') + { + $found_opening_bracket = true; + continue; + } + + $section_name .= $line[$j]; + } + + // And then we create the new section object + $section_name = trim($section_name); + $section = new phpbb_search_sphinx_config_section($section_name, $section_name_comment); + } + } + else + { + // If we're looking for variables inside a section + $skip_first = false; + + // If we're not in a value continuing over the line feed + if (!$in_value) + { + // Then add empty lines and comments as comment objects to the variable list + // of this section so they're not deleted on reassembly + if (!$line || $line[0] == '#') + { + $section->add_variable(new phpbb_search_sphinx_config_comment($config_file[$i])); + continue; + } + + // As long as we haven't yet actually found an opening bracket for this section + // we treat everything as comments so it's not deleted either + if (!$found_opening_bracket) + { + if ($line[0] == '{') + { + $skip_first = true; + $line = substr($line, 1); + $found_opening_bracket = true; + } + else + { + $section->add_variable(new phpbb_search_sphinx_config_comment($config_file[$i])); + continue; + } + } + } + + // If we did not find a comment in this line or still add to the previous + // line's value ... + if ($line || $in_value) + { + if (!$in_value) + { + $name = ''; + $value = ''; + $comment = ''; + $found_assignment = false; + } + $in_value = false; + $end_section = false; + + /* ... then we should prase this line char by char: + - first there's the variable name + - then an equal sign + - the variable value + - possibly a backslash before the linefeed in this case we need to continue + parsing the value in the next line + - a # indicating that the rest of the line is a comment + - a closing curly bracket indicating the end of this section*/ + for ($j = 0, $length = strlen($line); $j < $length; $j++) + { + if ($line[$j] == '#') + { + $comment = substr($line, $j); + break; + } + else if ($line[$j] == '}') + { + $comment = substr($line, $j + 1); + $end_section = true; + break; + } + else if (!$found_assignment) + { + if ($line[$j] == '=') + { + $found_assignment = true; + } + else + { + $name .= $line[$j]; + } + } + else + { + if ($line[$j] == '\\' && $j == $length - 1) + { + $value .= "\n"; + $in_value = true; + // Go to the next line and keep processing the value in there + continue 2; + } + $value .= $line[$j]; + } + } + + // If a name and an equal sign were found then we have append a + // new variable object to the section + if ($name && $found_assignment) + { + $section->add_variable(new phpbb_search_sphinx_config_variable(trim($name), trim($value), ($end_section) ? '' : $comment)); + continue; + } + + /* If we found a closing curly bracket this section has been completed + and we can append it to the section list and continue with looking for + the next section */ + if ($end_section) + { + $section->set_end_comment($comment); + $this->sections[] = $section; + $section = null; + continue; + } + } + + // If we did not find anything meaningful up to here, then just treat it + // as a comment + $comment = ($skip_first) ? "\t" . substr(ltrim($config_file[$i]), 1) : $config_file[$i]; + $section->add_variable(new phpbb_search_sphinx_config_comment($comment)); + } + } + + } + + /** + * Returns the config data + * + * @return string $data The config data that is generated + * + * @access public + */ + function get_data() + { + $data = ""; + foreach ($this->sections as $section) + { + $data .= $section->to_string(); + } + + return $data; + } +} diff --git a/phpBB/includes/search/sphinx/config_comment.php b/phpBB/includes/search/sphinx/config_comment.php new file mode 100644 index 0000000000..7f695dbf0c --- /dev/null +++ b/phpBB/includes/search/sphinx/config_comment.php @@ -0,0 +1,49 @@ +<?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; +} + +/** +* phpbb_search_sphinx_config_comment +* Represents a comment inside the sphinx configuration +*/ +class phpbb_search_sphinx_config_comment +{ + private $exact_string; + + /** + * Create a new comment + * + * @param string $exact_string The content of the comment including newlines, leading whitespace, etc. + * + * @access public + */ + function __construct($exact_string) + { + $this->exact_string = $exact_string; + } + + /** + * Simply returns the comment as it was created + * + * @return string The exact string that was specified in the constructor + * + * @access public + */ + function to_string() + { + return $this->exact_string; + } +} diff --git a/phpBB/includes/search/sphinx/config_section.php b/phpBB/includes/search/sphinx/config_section.php new file mode 100644 index 0000000000..79c9c8563d --- /dev/null +++ b/phpBB/includes/search/sphinx/config_section.php @@ -0,0 +1,162 @@ +<?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; +} + +/** +* phpbb_search_sphinx_config_section +* Represents a single section inside the sphinx configuration +*/ +class phpbb_search_sphinx_config_section +{ + private $name; + private $comment; + private $end_comment; + private $variables = array(); + + /** + * Construct a new section + * + * @param string $name Name of the section + * @param string $comment Comment that should be appended after the name in the + * textual format. + * + * @access public + */ + function __construct($name, $comment) + { + $this->name = $name; + $this->comment = $comment; + $this->end_comment = ''; + } + + /** + * Add a variable object to the list of variables in this section + * + * @param phpbb_search_sphinx_config_variable $variable The variable object + * + * @access public + */ + function add_variable($variable) + { + $this->variables[] = $variable; + } + + /** + * Adds a comment after the closing bracket in the textual representation + * + * @param string $end_comment + * + * @access public + */ + function set_end_comment($end_comment) + { + $this->end_comment = $end_comment; + } + + /** + * Getter for the name of this section + * + * @return string Section's name + * + * @access public + */ + function get_name() + { + return $this->name; + } + + /** + * Get a variable object by its name + * + * @param string $name The name of the variable that shall be returned + * @return phpbb_search_sphinx_config_section The first variable object from this section with the + * given name or null if none was found + * + * @access public + */ + function get_variable_by_name($name) + { + for ($i = 0, $size = sizeof($this->variables); $i < $size; $i++) + { + // Make sure this is a variable object and not a comment + if (($this->variables[$i] instanceof phpbb_search_sphinx_config_variable) && $this->variables[$i]->get_name() == $name) + { + return $this->variables[$i]; + } + } + } + + /** + * Deletes all variables with the given name + * + * @param string $name The name of the variable objects that are supposed to be removed + * + * @access public + */ + function delete_variables_by_name($name) + { + for ($i = 0, $size = sizeof($this->variables); $i < $size; $i++) + { + // Make sure this is a variable object and not a comment + if (($this->variables[$i] instanceof phpbb_search_sphinx_config_variable) && $this->variables[$i]->get_name() == $name) + { + array_splice($this->variables, $i, 1); + $i--; + } + } + } + + /** + * Create a new variable object and append it to the variable list of this section + * + * @param string $name The name for the new variable + * @param string $value The value for the new variable + * @return phpbb_search_sphinx_config_variable Variable object that was created + * + * @access public + */ + function create_variable($name, $value) + { + $this->variables[] = new phpbb_search_sphinx_config_variable($name, $value, ''); + return $this->variables[sizeof($this->variables) - 1]; + } + + /** + * Turns this object into a string which can be written to a config file + * + * @return string Config data in textual form, parsable for sphinx + * + * @access public + */ + function to_string() + { + $content = $this->name . ' ' . $this->comment . "\n{\n"; + + // Make sure we don't get too many newlines after the opening bracket + while (trim($this->variables[0]->to_string()) == '') + { + array_shift($this->variables); + } + + foreach ($this->variables as $variable) + { + $content .= $variable->to_string(); + } + $content .= '}' . $this->end_comment . "\n"; + + return $content; + } +} diff --git a/phpBB/includes/search/sphinx/config_variable.php b/phpBB/includes/search/sphinx/config_variable.php new file mode 100644 index 0000000000..35abe281cb --- /dev/null +++ b/phpBB/includes/search/sphinx/config_variable.php @@ -0,0 +1,80 @@ +<?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; +} + +/** +* phpbb_search_sphinx_config_variable +* Represents a single variable inside the sphinx configuration +*/ +class phpbb_search_sphinx_config_variable +{ + private $name; + private $value; + private $comment; + + /** + * Constructs a new variable object + * + * @param string $name Name of the variable + * @param string $value Value of the variable + * @param string $comment Optional comment after the variable in the + * config file + * + * @access public + */ + function __construct($name, $value, $comment) + { + $this->name = $name; + $this->value = $value; + $this->comment = $comment; + } + + /** + * Getter for the variable's name + * + * @return string The variable object's name + * + * @access public + */ + function get_name() + { + return $this->name; + } + + /** + * Allows changing the variable's value + * + * @param string $value New value for this variable + * + * @access public + */ + function set_value($value) + { + $this->value = $value; + } + + /** + * Turns this object into a string readable by sphinx + * + * @return string Config data in textual form + * + * @access public + */ + function to_string() + { + return "\t" . $this->name . ' = ' . str_replace("\n", "\\\n", $this->value) . ' ' . $this->comment . "\n"; + } +} diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 257ffb07f6..ee8a4094c7 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -474,7 +474,7 @@ class phpbb_session else { // Added logging temporarly to help debug bugs... - if (defined('DEBUG_EXTRA') && $this->data['user_id'] != ANONYMOUS) + if (defined('DEBUG') && $this->data['user_id'] != ANONYMOUS) { if ($referer_valid) { diff --git a/phpBB/includes/sphinxapi.php b/phpBB/includes/sphinxapi.php new file mode 100644 index 0000000000..bd83b1d2e0 --- /dev/null +++ b/phpBB/includes/sphinxapi.php @@ -0,0 +1,1712 @@ +<?php
+
+//
+// $Id: sphinxapi.php 3087 2012-01-30 23:07:35Z shodan $
+//
+
+//
+// Copyright (c) 2001-2012, Andrew Aksyonoff
+// Copyright (c) 2008-2012, Sphinx Technologies Inc
+// All rights reserved
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License. You should have
+// received a copy of the GPL license along with this program; if you
+// did not, you can find it at http://www.gnu.org/
+//
+
+/////////////////////////////////////////////////////////////////////////////
+// PHP version of Sphinx searchd client (PHP API)
+/////////////////////////////////////////////////////////////////////////////
+
+/// known searchd commands
+define ( "SEARCHD_COMMAND_SEARCH", 0 );
+define ( "SEARCHD_COMMAND_EXCERPT", 1 );
+define ( "SEARCHD_COMMAND_UPDATE", 2 );
+define ( "SEARCHD_COMMAND_KEYWORDS", 3 );
+define ( "SEARCHD_COMMAND_PERSIST", 4 );
+define ( "SEARCHD_COMMAND_STATUS", 5 );
+define ( "SEARCHD_COMMAND_FLUSHATTRS", 7 );
+
+/// current client-side command implementation versions
+define ( "VER_COMMAND_SEARCH", 0x119 );
+define ( "VER_COMMAND_EXCERPT", 0x104 );
+define ( "VER_COMMAND_UPDATE", 0x102 );
+define ( "VER_COMMAND_KEYWORDS", 0x100 );
+define ( "VER_COMMAND_STATUS", 0x100 );
+define ( "VER_COMMAND_QUERY", 0x100 );
+define ( "VER_COMMAND_FLUSHATTRS", 0x100 );
+
+/// known searchd status codes
+define ( "SEARCHD_OK", 0 );
+define ( "SEARCHD_ERROR", 1 );
+define ( "SEARCHD_RETRY", 2 );
+define ( "SEARCHD_WARNING", 3 );
+
+/// known match modes
+define ( "SPH_MATCH_ALL", 0 );
+define ( "SPH_MATCH_ANY", 1 );
+define ( "SPH_MATCH_PHRASE", 2 );
+define ( "SPH_MATCH_BOOLEAN", 3 );
+define ( "SPH_MATCH_EXTENDED", 4 );
+define ( "SPH_MATCH_FULLSCAN", 5 );
+define ( "SPH_MATCH_EXTENDED2", 6 ); // extended engine V2 (TEMPORARY, WILL BE REMOVED)
+
+/// known ranking modes (ext2 only)
+define ( "SPH_RANK_PROXIMITY_BM25", 0 ); ///< default mode, phrase proximity major factor and BM25 minor one
+define ( "SPH_RANK_BM25", 1 ); ///< statistical mode, BM25 ranking only (faster but worse quality)
+define ( "SPH_RANK_NONE", 2 ); ///< no ranking, all matches get a weight of 1
+define ( "SPH_RANK_WORDCOUNT", 3 ); ///< simple word-count weighting, rank is a weighted sum of per-field keyword occurence counts
+define ( "SPH_RANK_PROXIMITY", 4 );
+define ( "SPH_RANK_MATCHANY", 5 );
+define ( "SPH_RANK_FIELDMASK", 6 );
+define ( "SPH_RANK_SPH04", 7 );
+define ( "SPH_RANK_EXPR", 8 );
+define ( "SPH_RANK_TOTAL", 9 );
+
+/// known sort modes
+define ( "SPH_SORT_RELEVANCE", 0 );
+define ( "SPH_SORT_ATTR_DESC", 1 );
+define ( "SPH_SORT_ATTR_ASC", 2 );
+define ( "SPH_SORT_TIME_SEGMENTS", 3 );
+define ( "SPH_SORT_EXTENDED", 4 );
+define ( "SPH_SORT_EXPR", 5 );
+
+/// known filter types
+define ( "SPH_FILTER_VALUES", 0 );
+define ( "SPH_FILTER_RANGE", 1 );
+define ( "SPH_FILTER_FLOATRANGE", 2 );
+
+/// known attribute types
+define ( "SPH_ATTR_INTEGER", 1 );
+define ( "SPH_ATTR_TIMESTAMP", 2 );
+define ( "SPH_ATTR_ORDINAL", 3 );
+define ( "SPH_ATTR_BOOL", 4 );
+define ( "SPH_ATTR_FLOAT", 5 );
+define ( "SPH_ATTR_BIGINT", 6 );
+define ( "SPH_ATTR_STRING", 7 );
+define ( "SPH_ATTR_MULTI", 0x40000001 );
+define ( "SPH_ATTR_MULTI64", 0x40000002 );
+
+/// known grouping functions
+define ( "SPH_GROUPBY_DAY", 0 );
+define ( "SPH_GROUPBY_WEEK", 1 );
+define ( "SPH_GROUPBY_MONTH", 2 );
+define ( "SPH_GROUPBY_YEAR", 3 );
+define ( "SPH_GROUPBY_ATTR", 4 );
+define ( "SPH_GROUPBY_ATTRPAIR", 5 );
+
+// important properties of PHP's integers:
+// - always signed (one bit short of PHP_INT_SIZE)
+// - conversion from string to int is saturated
+// - float is double
+// - div converts arguments to floats
+// - mod converts arguments to ints
+
+// the packing code below works as follows:
+// - when we got an int, just pack it
+// if performance is a problem, this is the branch users should aim for
+//
+// - otherwise, we got a number in string form
+// this might be due to different reasons, but we assume that this is
+// because it didn't fit into PHP int
+//
+// - factor the string into high and low ints for packing
+// - if we have bcmath, then it is used
+// - if we don't, we have to do it manually (this is the fun part)
+//
+// - x64 branch does factoring using ints
+// - x32 (ab)uses floats, since we can't fit unsigned 32-bit number into an int
+//
+// unpacking routines are pretty much the same.
+// - return ints if we can
+// - otherwise format number into a string
+
+/// pack 64-bit signed
+function sphPackI64 ( $v )
+{
+ assert ( is_numeric($v) );
+
+ // x64
+ if ( PHP_INT_SIZE>=8 )
+ {
+ $v = (int)$v;
+ return pack ( "NN", $v>>32, $v&0xFFFFFFFF );
+ }
+
+ // x32, int
+ if ( is_int($v) )
+ return pack ( "NN", $v < 0 ? -1 : 0, $v );
+
+ // x32, bcmath
+ if ( function_exists("bcmul") )
+ {
+ if ( bccomp ( $v, 0 ) == -1 )
+ $v = bcadd ( "18446744073709551616", $v );
+ $h = bcdiv ( $v, "4294967296", 0 );
+ $l = bcmod ( $v, "4294967296" );
+ return pack ( "NN", (float)$h, (float)$l ); // conversion to float is intentional; int would lose 31st bit
+ }
+
+ // x32, no-bcmath
+ $p = max(0, strlen($v) - 13);
+ $lo = abs((float)substr($v, $p));
+ $hi = abs((float)substr($v, 0, $p));
+
+ $m = $lo + $hi*1316134912.0; // (10 ^ 13) % (1 << 32) = 1316134912
+ $q = floor($m/4294967296.0);
+ $l = $m - ($q*4294967296.0);
+ $h = $hi*2328.0 + $q; // (10 ^ 13) / (1 << 32) = 2328
+
+ if ( $v<0 )
+ {
+ if ( $l==0 )
+ $h = 4294967296.0 - $h;
+ else
+ {
+ $h = 4294967295.0 - $h;
+ $l = 4294967296.0 - $l;
+ }
+ }
+ return pack ( "NN", $h, $l );
+}
+
+/// pack 64-bit unsigned
+function sphPackU64 ( $v )
+{
+ assert ( is_numeric($v) );
+
+ // x64
+ if ( PHP_INT_SIZE>=8 )
+ {
+ assert ( $v>=0 );
+
+ // x64, int
+ if ( is_int($v) )
+ return pack ( "NN", $v>>32, $v&0xFFFFFFFF );
+
+ // x64, bcmath
+ if ( function_exists("bcmul") )
+ {
+ $h = bcdiv ( $v, 4294967296, 0 );
+ $l = bcmod ( $v, 4294967296 );
+ return pack ( "NN", $h, $l );
+ }
+
+ // x64, no-bcmath
+ $p = max ( 0, strlen($v) - 13 );
+ $lo = (int)substr ( $v, $p );
+ $hi = (int)substr ( $v, 0, $p );
+
+ $m = $lo + $hi*1316134912;
+ $l = $m % 4294967296;
+ $h = $hi*2328 + (int)($m/4294967296);
+
+ return pack ( "NN", $h, $l );
+ }
+
+ // x32, int
+ if ( is_int($v) )
+ return pack ( "NN", 0, $v );
+
+ // x32, bcmath
+ if ( function_exists("bcmul") )
+ {
+ $h = bcdiv ( $v, "4294967296", 0 );
+ $l = bcmod ( $v, "4294967296" );
+ return pack ( "NN", (float)$h, (float)$l ); // conversion to float is intentional; int would lose 31st bit
+ }
+
+ // x32, no-bcmath
+ $p = max(0, strlen($v) - 13);
+ $lo = (float)substr($v, $p);
+ $hi = (float)substr($v, 0, $p);
+
+ $m = $lo + $hi*1316134912.0;
+ $q = floor($m / 4294967296.0);
+ $l = $m - ($q * 4294967296.0);
+ $h = $hi*2328.0 + $q;
+
+ return pack ( "NN", $h, $l );
+}
+
+// unpack 64-bit unsigned
+function sphUnpackU64 ( $v )
+{
+ list ( $hi, $lo ) = array_values ( unpack ( "N*N*", $v ) );
+
+ if ( PHP_INT_SIZE>=8 )
+ {
+ if ( $hi<0 ) $hi += (1<<32); // because php 5.2.2 to 5.2.5 is totally fucked up again
+ if ( $lo<0 ) $lo += (1<<32);
+
+ // x64, int
+ if ( $hi<=2147483647 )
+ return ($hi<<32) + $lo;
+
+ // x64, bcmath
+ if ( function_exists("bcmul") )
+ return bcadd ( $lo, bcmul ( $hi, "4294967296" ) );
+
+ // x64, no-bcmath
+ $C = 100000;
+ $h = ((int)($hi / $C) << 32) + (int)($lo / $C);
+ $l = (($hi % $C) << 32) + ($lo % $C);
+ if ( $l>$C )
+ {
+ $h += (int)($l / $C);
+ $l = $l % $C;
+ }
+
+ if ( $h==0 )
+ return $l;
+ return sprintf ( "%d%05d", $h, $l );
+ }
+
+ // x32, int
+ if ( $hi==0 )
+ {
+ if ( $lo>0 )
+ return $lo;
+ return sprintf ( "%u", $lo );
+ }
+
+ $hi = sprintf ( "%u", $hi );
+ $lo = sprintf ( "%u", $lo );
+
+ // x32, bcmath
+ if ( function_exists("bcmul") )
+ return bcadd ( $lo, bcmul ( $hi, "4294967296" ) );
+
+ // x32, no-bcmath
+ $hi = (float)$hi;
+ $lo = (float)$lo;
+
+ $q = floor($hi/10000000.0);
+ $r = $hi - $q*10000000.0;
+ $m = $lo + $r*4967296.0;
+ $mq = floor($m/10000000.0);
+ $l = $m - $mq*10000000.0;
+ $h = $q*4294967296.0 + $r*429.0 + $mq;
+
+ $h = sprintf ( "%.0f", $h );
+ $l = sprintf ( "%07.0f", $l );
+ if ( $h=="0" )
+ return sprintf( "%.0f", (float)$l );
+ return $h . $l;
+}
+
+// unpack 64-bit signed
+function sphUnpackI64 ( $v )
+{
+ list ( $hi, $lo ) = array_values ( unpack ( "N*N*", $v ) );
+
+ // x64
+ if ( PHP_INT_SIZE>=8 )
+ {
+ if ( $hi<0 ) $hi += (1<<32); // because php 5.2.2 to 5.2.5 is totally fucked up again
+ if ( $lo<0 ) $lo += (1<<32);
+
+ return ($hi<<32) + $lo;
+ }
+
+ // x32, int
+ if ( $hi==0 )
+ {
+ if ( $lo>0 )
+ return $lo;
+ return sprintf ( "%u", $lo );
+ }
+ // x32, int
+ elseif ( $hi==-1 )
+ {
+ if ( $lo<0 )
+ return $lo;
+ return sprintf ( "%.0f", $lo - 4294967296.0 );
+ }
+
+ $neg = "";
+ $c = 0;
+ if ( $hi<0 )
+ {
+ $hi = ~$hi;
+ $lo = ~$lo;
+ $c = 1;
+ $neg = "-";
+ }
+
+ $hi = sprintf ( "%u", $hi );
+ $lo = sprintf ( "%u", $lo );
+
+ // x32, bcmath
+ if ( function_exists("bcmul") )
+ return $neg . bcadd ( bcadd ( $lo, bcmul ( $hi, "4294967296" ) ), $c );
+
+ // x32, no-bcmath
+ $hi = (float)$hi;
+ $lo = (float)$lo;
+
+ $q = floor($hi/10000000.0);
+ $r = $hi - $q*10000000.0;
+ $m = $lo + $r*4967296.0;
+ $mq = floor($m/10000000.0);
+ $l = $m - $mq*10000000.0 + $c;
+ $h = $q*4294967296.0 + $r*429.0 + $mq;
+ if ( $l==10000000 )
+ {
+ $l = 0;
+ $h += 1;
+ }
+
+ $h = sprintf ( "%.0f", $h );
+ $l = sprintf ( "%07.0f", $l );
+ if ( $h=="0" )
+ return $neg . sprintf( "%.0f", (float)$l );
+ return $neg . $h . $l;
+}
+
+
+function sphFixUint ( $value )
+{
+ if ( PHP_INT_SIZE>=8 )
+ {
+ // x64 route, workaround broken unpack() in 5.2.2+
+ if ( $value<0 ) $value += (1<<32);
+ return $value;
+ }
+ else
+ {
+ // x32 route, workaround php signed/unsigned braindamage
+ return sprintf ( "%u", $value );
+ }
+}
+
+
+/// sphinx searchd client class
+class SphinxClient
+{
+ var $_host; ///< searchd host (default is "localhost")
+ var $_port; ///< searchd port (default is 9312)
+ var $_offset; ///< how many records to seek from result-set start (default is 0)
+ var $_limit; ///< how many records to return from result-set starting at offset (default is 20)
+ var $_mode; ///< query matching mode (default is SPH_MATCH_ALL)
+ var $_weights; ///< per-field weights (default is 1 for all fields)
+ var $_sort; ///< match sorting mode (default is SPH_SORT_RELEVANCE)
+ var $_sortby; ///< attribute to sort by (defualt is "")
+ var $_min_id; ///< min ID to match (default is 0, which means no limit)
+ var $_max_id; ///< max ID to match (default is 0, which means no limit)
+ var $_filters; ///< search filters
+ var $_groupby; ///< group-by attribute name
+ var $_groupfunc; ///< group-by function (to pre-process group-by attribute value with)
+ var $_groupsort; ///< group-by sorting clause (to sort groups in result set with)
+ var $_groupdistinct;///< group-by count-distinct attribute
+ var $_maxmatches; ///< max matches to retrieve
+ var $_cutoff; ///< cutoff to stop searching at (default is 0)
+ var $_retrycount; ///< distributed retries count
+ var $_retrydelay; ///< distributed retries delay
+ var $_anchor; ///< geographical anchor point
+ var $_indexweights; ///< per-index weights
+ var $_ranker; ///< ranking mode (default is SPH_RANK_PROXIMITY_BM25)
+ var $_rankexpr; ///< ranking mode expression (for SPH_RANK_EXPR)
+ var $_maxquerytime; ///< max query time, milliseconds (default is 0, do not limit)
+ var $_fieldweights; ///< per-field-name weights
+ var $_overrides; ///< per-query attribute values overrides
+ var $_select; ///< select-list (attributes or expressions, with optional aliases)
+
+ var $_error; ///< last error message
+ var $_warning; ///< last warning message
+ var $_connerror; ///< connection error vs remote error flag
+
+ var $_reqs; ///< requests array for multi-query
+ var $_mbenc; ///< stored mbstring encoding
+ var $_arrayresult; ///< whether $result["matches"] should be a hash or an array
+ var $_timeout; ///< connect timeout
+
+ /////////////////////////////////////////////////////////////////////////////
+ // common stuff
+ /////////////////////////////////////////////////////////////////////////////
+
+ /// create a new client object and fill defaults
+ function SphinxClient ()
+ {
+ // per-client-object settings
+ $this->_host = "localhost";
+ $this->_port = 9312;
+ $this->_path = false;
+ $this->_socket = false;
+
+ // per-query settings
+ $this->_offset = 0;
+ $this->_limit = 20;
+ $this->_mode = SPH_MATCH_ALL;
+ $this->_weights = array ();
+ $this->_sort = SPH_SORT_RELEVANCE;
+ $this->_sortby = "";
+ $this->_min_id = 0;
+ $this->_max_id = 0;
+ $this->_filters = array ();
+ $this->_groupby = "";
+ $this->_groupfunc = SPH_GROUPBY_DAY;
+ $this->_groupsort = "@group desc";
+ $this->_groupdistinct= "";
+ $this->_maxmatches = 1000;
+ $this->_cutoff = 0;
+ $this->_retrycount = 0;
+ $this->_retrydelay = 0;
+ $this->_anchor = array ();
+ $this->_indexweights= array ();
+ $this->_ranker = SPH_RANK_PROXIMITY_BM25;
+ $this->_rankexpr = "";
+ $this->_maxquerytime= 0;
+ $this->_fieldweights= array();
+ $this->_overrides = array();
+ $this->_select = "*";
+
+ $this->_error = ""; // per-reply fields (for single-query case)
+ $this->_warning = "";
+ $this->_connerror = false;
+
+ $this->_reqs = array (); // requests storage (for multi-query case)
+ $this->_mbenc = "";
+ $this->_arrayresult = false;
+ $this->_timeout = 0;
+ }
+
+ function __destruct()
+ {
+ if ( $this->_socket !== false )
+ fclose ( $this->_socket );
+ }
+
+ /// get last error message (string)
+ function GetLastError ()
+ {
+ return $this->_error;
+ }
+
+ /// get last warning message (string)
+ function GetLastWarning ()
+ {
+ return $this->_warning;
+ }
+
+ /// get last error flag (to tell network connection errors from searchd errors or broken responses)
+ function IsConnectError()
+ {
+ return $this->_connerror;
+ }
+
+ /// set searchd host name (string) and port (integer)
+ function SetServer ( $host, $port = 0 )
+ {
+ assert ( is_string($host) );
+ if ( $host[0] == '/')
+ {
+ $this->_path = 'unix://' . $host;
+ return;
+ }
+ if ( substr ( $host, 0, 7 )=="unix://" )
+ {
+ $this->_path = $host;
+ return;
+ }
+
+ assert ( is_int($port) );
+ $this->_host = $host;
+ $this->_port = $port;
+ $this->_path = '';
+
+ }
+
+ /// set server connection timeout (0 to remove)
+ function SetConnectTimeout ( $timeout )
+ {
+ assert ( is_numeric($timeout) );
+ $this->_timeout = $timeout;
+ }
+
+
+ function _Send ( $handle, $data, $length )
+ {
+ if ( feof($handle) || fwrite ( $handle, $data, $length ) !== $length )
+ {
+ $this->_error = 'connection unexpectedly closed (timed out?)';
+ $this->_connerror = true;
+ return false;
+ }
+ return true;
+ }
+
+ /////////////////////////////////////////////////////////////////////////////
+
+ /// enter mbstring workaround mode
+ function _MBPush ()
+ {
+ $this->_mbenc = "";
+ if ( ini_get ( "mbstring.func_overload" ) & 2 )
+ {
+ $this->_mbenc = mb_internal_encoding();
+ mb_internal_encoding ( "latin1" );
+ }
+ }
+
+ /// leave mbstring workaround mode
+ function _MBPop ()
+ {
+ if ( $this->_mbenc )
+ mb_internal_encoding ( $this->_mbenc );
+ }
+
+ /// connect to searchd server
+ function _Connect ()
+ {
+ if ( $this->_socket!==false )
+ {
+ // we are in persistent connection mode, so we have a socket
+ // however, need to check whether it's still alive
+ if ( !@feof ( $this->_socket ) )
+ return $this->_socket;
+
+ // force reopen
+ $this->_socket = false;
+ }
+
+ $errno = 0;
+ $errstr = "";
+ $this->_connerror = false;
+
+ if ( $this->_path )
+ {
+ $host = $this->_path;
+ $port = 0;
+ }
+ else
+ {
+ $host = $this->_host;
+ $port = $this->_port;
+ }
+
+ if ( $this->_timeout<=0 )
+ $fp = @fsockopen ( $host, $port, $errno, $errstr );
+ else
+ $fp = @fsockopen ( $host, $port, $errno, $errstr, $this->_timeout );
+
+ if ( !$fp )
+ {
+ if ( $this->_path )
+ $location = $this->_path;
+ else
+ $location = "{$this->_host}:{$this->_port}";
+
+ $errstr = trim ( $errstr );
+ $this->_error = "connection to $location failed (errno=$errno, msg=$errstr)";
+ $this->_connerror = true;
+ return false;
+ }
+
+ // send my version
+ // this is a subtle part. we must do it before (!) reading back from searchd.
+ // because otherwise under some conditions (reported on FreeBSD for instance)
+ // TCP stack could throttle write-write-read pattern because of Nagle.
+ if ( !$this->_Send ( $fp, pack ( "N", 1 ), 4 ) )
+ {
+ fclose ( $fp );
+ $this->_error = "failed to send client protocol version";
+ return false;
+ }
+
+ // check version
+ list(,$v) = unpack ( "N*", fread ( $fp, 4 ) );
+ $v = (int)$v;
+ if ( $v<1 )
+ {
+ fclose ( $fp );
+ $this->_error = "expected searchd protocol version 1+, got version '$v'";
+ return false;
+ }
+
+ return $fp;
+ }
+
+ /// get and check response packet from searchd server
+ function _GetResponse ( $fp, $client_ver )
+ {
+ $response = "";
+ $len = 0;
+
+ $header = fread ( $fp, 8 );
+ if ( strlen($header)==8 )
+ {
+ list ( $status, $ver, $len ) = array_values ( unpack ( "n2a/Nb", $header ) );
+ $left = $len;
+ while ( $left>0 && !feof($fp) )
+ {
+ $chunk = fread ( $fp, min ( 8192, $left ) );
+ if ( $chunk )
+ {
+ $response .= $chunk;
+ $left -= strlen($chunk);
+ }
+ }
+ }
+ if ( $this->_socket === false )
+ fclose ( $fp );
+
+ // check response
+ $read = strlen ( $response );
+ if ( !$response || $read!=$len )
+ {
+ $this->_error = $len
+ ? "failed to read searchd response (status=$status, ver=$ver, len=$len, read=$read)"
+ : "received zero-sized searchd response";
+ return false;
+ }
+
+ // check status
+ if ( $status==SEARCHD_WARNING )
+ {
+ list(,$wlen) = unpack ( "N*", substr ( $response, 0, 4 ) );
+ $this->_warning = substr ( $response, 4, $wlen );
+ return substr ( $response, 4+$wlen );
+ }
+ if ( $status==SEARCHD_ERROR )
+ {
+ $this->_error = "searchd error: " . substr ( $response, 4 );
+ return false;
+ }
+ if ( $status==SEARCHD_RETRY )
+ {
+ $this->_error = "temporary searchd error: " . substr ( $response, 4 );
+ return false;
+ }
+ if ( $status!=SEARCHD_OK )
+ {
+ $this->_error = "unknown status code '$status'";
+ return false;
+ }
+
+ // check version
+ if ( $ver<$client_ver )
+ {
+ $this->_warning = sprintf ( "searchd command v.%d.%d older than client's v.%d.%d, some options might not work",
+ $ver>>8, $ver&0xff, $client_ver>>8, $client_ver&0xff );
+ }
+
+ return $response;
+ }
+
+ /////////////////////////////////////////////////////////////////////////////
+ // searching
+ /////////////////////////////////////////////////////////////////////////////
+
+ /// set offset and count into result set,
+ /// and optionally set max-matches and cutoff limits
+ function SetLimits ( $offset, $limit, $max=0, $cutoff=0 )
+ {
+ assert ( is_int($offset) );
+ assert ( is_int($limit) );
+ assert ( $offset>=0 );
+ assert ( $limit>0 );
+ assert ( $max>=0 );
+ $this->_offset = $offset;
+ $this->_limit = $limit;
+ if ( $max>0 )
+ $this->_maxmatches = $max;
+ if ( $cutoff>0 )
+ $this->_cutoff = $cutoff;
+ }
+
+ /// set maximum query time, in milliseconds, per-index
+ /// integer, 0 means "do not limit"
+ function SetMaxQueryTime ( $max )
+ {
+ assert ( is_int($max) );
+ assert ( $max>=0 );
+ $this->_maxquerytime = $max;
+ }
+
+ /// set matching mode
+ function SetMatchMode ( $mode )
+ {
+ assert ( $mode==SPH_MATCH_ALL
+ || $mode==SPH_MATCH_ANY
+ || $mode==SPH_MATCH_PHRASE
+ || $mode==SPH_MATCH_BOOLEAN
+ || $mode==SPH_MATCH_EXTENDED
+ || $mode==SPH_MATCH_FULLSCAN
+ || $mode==SPH_MATCH_EXTENDED2 );
+ $this->_mode = $mode;
+ }
+
+ /// set ranking mode
+ function SetRankingMode ( $ranker, $rankexpr="" )
+ {
+ assert ( $ranker>=0 && $ranker<SPH_RANK_TOTAL );
+ assert ( is_string($rankexpr) );
+ $this->_ranker = $ranker;
+ $this->_rankexpr = $rankexpr;
+ }
+
+ /// set matches sorting mode
+ function SetSortMode ( $mode, $sortby="" )
+ {
+ assert (
+ $mode==SPH_SORT_RELEVANCE ||
+ $mode==SPH_SORT_ATTR_DESC ||
+ $mode==SPH_SORT_ATTR_ASC ||
+ $mode==SPH_SORT_TIME_SEGMENTS ||
+ $mode==SPH_SORT_EXTENDED ||
+ $mode==SPH_SORT_EXPR );
+ assert ( is_string($sortby) );
+ assert ( $mode==SPH_SORT_RELEVANCE || strlen($sortby)>0 );
+
+ $this->_sort = $mode;
+ $this->_sortby = $sortby;
+ }
+
+ /// bind per-field weights by order
+ /// DEPRECATED; use SetFieldWeights() instead
+ function SetWeights ( $weights )
+ {
+ assert ( is_array($weights) );
+ foreach ( $weights as $weight )
+ assert ( is_int($weight) );
+
+ $this->_weights = $weights;
+ }
+
+ /// bind per-field weights by name
+ function SetFieldWeights ( $weights )
+ {
+ assert ( is_array($weights) );
+ foreach ( $weights as $name=>$weight )
+ {
+ assert ( is_string($name) );
+ assert ( is_int($weight) );
+ }
+ $this->_fieldweights = $weights;
+ }
+
+ /// bind per-index weights by name
+ function SetIndexWeights ( $weights )
+ {
+ assert ( is_array($weights) );
+ foreach ( $weights as $index=>$weight )
+ {
+ assert ( is_string($index) );
+ assert ( is_int($weight) );
+ }
+ $this->_indexweights = $weights;
+ }
+
+ /// set IDs range to match
+ /// only match records if document ID is beetwen $min and $max (inclusive)
+ function SetIDRange ( $min, $max )
+ {
+ assert ( is_numeric($min) );
+ assert ( is_numeric($max) );
+ assert ( $min<=$max );
+ $this->_min_id = $min;
+ $this->_max_id = $max;
+ }
+
+ /// set values set filter
+ /// only match records where $attribute value is in given set
+ function SetFilter ( $attribute, $values, $exclude=false )
+ {
+ assert ( is_string($attribute) );
+ assert ( is_array($values) );
+ assert ( count($values) );
+
+ if ( is_array($values) && count($values) )
+ {
+ foreach ( $values as $value )
+ assert ( is_numeric($value) );
+
+ $this->_filters[] = array ( "type"=>SPH_FILTER_VALUES, "attr"=>$attribute, "exclude"=>$exclude, "values"=>$values );
+ }
+ }
+
+ /// set range filter
+ /// only match records if $attribute value is beetwen $min and $max (inclusive)
+ function SetFilterRange ( $attribute, $min, $max, $exclude=false )
+ {
+ assert ( is_string($attribute) );
+ assert ( is_numeric($min) );
+ assert ( is_numeric($max) );
+ assert ( $min<=$max );
+
+ $this->_filters[] = array ( "type"=>SPH_FILTER_RANGE, "attr"=>$attribute, "exclude"=>$exclude, "min"=>$min, "max"=>$max );
+ }
+
+ /// set float range filter
+ /// only match records if $attribute value is beetwen $min and $max (inclusive)
+ function SetFilterFloatRange ( $attribute, $min, $max, $exclude=false )
+ {
+ assert ( is_string($attribute) );
+ assert ( is_float($min) );
+ assert ( is_float($max) );
+ assert ( $min<=$max );
+
+ $this->_filters[] = array ( "type"=>SPH_FILTER_FLOATRANGE, "attr"=>$attribute, "exclude"=>$exclude, "min"=>$min, "max"=>$max );
+ }
+
+ /// setup anchor point for geosphere distance calculations
+ /// required to use @geodist in filters and sorting
+ /// latitude and longitude must be in radians
+ function SetGeoAnchor ( $attrlat, $attrlong, $lat, $long )
+ {
+ assert ( is_string($attrlat) );
+ assert ( is_string($attrlong) );
+ assert ( is_float($lat) );
+ assert ( is_float($long) );
+
+ $this->_anchor = array ( "attrlat"=>$attrlat, "attrlong"=>$attrlong, "lat"=>$lat, "long"=>$long );
+ }
+
+ /// set grouping attribute and function
+ function SetGroupBy ( $attribute, $func, $groupsort="@group desc" )
+ {
+ assert ( is_string($attribute) );
+ assert ( is_string($groupsort) );
+ assert ( $func==SPH_GROUPBY_DAY
+ || $func==SPH_GROUPBY_WEEK
+ || $func==SPH_GROUPBY_MONTH
+ || $func==SPH_GROUPBY_YEAR
+ || $func==SPH_GROUPBY_ATTR
+ || $func==SPH_GROUPBY_ATTRPAIR );
+
+ $this->_groupby = $attribute;
+ $this->_groupfunc = $func;
+ $this->_groupsort = $groupsort;
+ }
+
+ /// set count-distinct attribute for group-by queries
+ function SetGroupDistinct ( $attribute )
+ {
+ assert ( is_string($attribute) );
+ $this->_groupdistinct = $attribute;
+ }
+
+ /// set distributed retries count and delay
+ function SetRetries ( $count, $delay=0 )
+ {
+ assert ( is_int($count) && $count>=0 );
+ assert ( is_int($delay) && $delay>=0 );
+ $this->_retrycount = $count;
+ $this->_retrydelay = $delay;
+ }
+
+ /// set result set format (hash or array; hash by default)
+ /// PHP specific; needed for group-by-MVA result sets that may contain duplicate IDs
+ function SetArrayResult ( $arrayresult )
+ {
+ assert ( is_bool($arrayresult) );
+ $this->_arrayresult = $arrayresult;
+ }
+
+ /// set attribute values override
+ /// there can be only one override per attribute
+ /// $values must be a hash that maps document IDs to attribute values
+ function SetOverride ( $attrname, $attrtype, $values )
+ {
+ assert ( is_string ( $attrname ) );
+ assert ( in_array ( $attrtype, array ( SPH_ATTR_INTEGER, SPH_ATTR_TIMESTAMP, SPH_ATTR_BOOL, SPH_ATTR_FLOAT, SPH_ATTR_BIGINT ) ) );
+ assert ( is_array ( $values ) );
+
+ $this->_overrides[$attrname] = array ( "attr"=>$attrname, "type"=>$attrtype, "values"=>$values );
+ }
+
+ /// set select-list (attributes or expressions), SQL-like syntax
+ function SetSelect ( $select )
+ {
+ assert ( is_string ( $select ) );
+ $this->_select = $select;
+ }
+
+ //////////////////////////////////////////////////////////////////////////////
+
+ /// clear all filters (for multi-queries)
+ function ResetFilters ()
+ {
+ $this->_filters = array();
+ $this->_anchor = array();
+ }
+
+ /// clear groupby settings (for multi-queries)
+ function ResetGroupBy ()
+ {
+ $this->_groupby = "";
+ $this->_groupfunc = SPH_GROUPBY_DAY;
+ $this->_groupsort = "@group desc";
+ $this->_groupdistinct= "";
+ }
+
+ /// clear all attribute value overrides (for multi-queries)
+ function ResetOverrides ()
+ {
+ $this->_overrides = array ();
+ }
+
+ //////////////////////////////////////////////////////////////////////////////
+
+ /// connect to searchd server, run given search query through given indexes,
+ /// and return the search results
+ function Query ( $query, $index="*", $comment="" )
+ {
+ assert ( empty($this->_reqs) );
+
+ $this->AddQuery ( $query, $index, $comment );
+ $results = $this->RunQueries ();
+ $this->_reqs = array (); // just in case it failed too early
+
+ if ( !is_array($results) )
+ return false; // probably network error; error message should be already filled
+
+ $this->_error = $results[0]["error"];
+ $this->_warning = $results[0]["warning"];
+ if ( $results[0]["status"]==SEARCHD_ERROR )
+ return false;
+ else
+ return $results[0];
+ }
+
+ /// helper to pack floats in network byte order
+ function _PackFloat ( $f )
+ {
+ $t1 = pack ( "f", $f ); // machine order
+ list(,$t2) = unpack ( "L*", $t1 ); // int in machine order
+ return pack ( "N", $t2 );
+ }
+
+ /// add query to multi-query batch
+ /// returns index into results array from RunQueries() call
+ function AddQuery ( $query, $index="*", $comment="" )
+ {
+ // mbstring workaround
+ $this->_MBPush ();
+
+ // build request
+ $req = pack ( "NNNN", $this->_offset, $this->_limit, $this->_mode, $this->_ranker );
+ if ( $this->_ranker==SPH_RANK_EXPR )
+ $req .= pack ( "N", strlen($this->_rankexpr) ) . $this->_rankexpr;
+ $req .= pack ( "N", $this->_sort ); // (deprecated) sort mode
+ $req .= pack ( "N", strlen($this->_sortby) ) . $this->_sortby;
+ $req .= pack ( "N", strlen($query) ) . $query; // query itself
+ $req .= pack ( "N", count($this->_weights) ); // weights
+ foreach ( $this->_weights as $weight )
+ $req .= pack ( "N", (int)$weight );
+ $req .= pack ( "N", strlen($index) ) . $index; // indexes
+ $req .= pack ( "N", 1 ); // id64 range marker
+ $req .= sphPackU64 ( $this->_min_id ) . sphPackU64 ( $this->_max_id ); // id64 range
+
+ // filters
+ $req .= pack ( "N", count($this->_filters) );
+ foreach ( $this->_filters as $filter )
+ {
+ $req .= pack ( "N", strlen($filter["attr"]) ) . $filter["attr"];
+ $req .= pack ( "N", $filter["type"] );
+ switch ( $filter["type"] )
+ {
+ case SPH_FILTER_VALUES:
+ $req .= pack ( "N", count($filter["values"]) );
+ foreach ( $filter["values"] as $value )
+ $req .= sphPackI64 ( $value );
+ break;
+
+ case SPH_FILTER_RANGE:
+ $req .= sphPackI64 ( $filter["min"] ) . sphPackI64 ( $filter["max"] );
+ break;
+
+ case SPH_FILTER_FLOATRANGE:
+ $req .= $this->_PackFloat ( $filter["min"] ) . $this->_PackFloat ( $filter["max"] );
+ break;
+
+ default:
+ assert ( 0 && "internal error: unhandled filter type" );
+ }
+ $req .= pack ( "N", $filter["exclude"] );
+ }
+
+ // group-by clause, max-matches count, group-sort clause, cutoff count
+ $req .= pack ( "NN", $this->_groupfunc, strlen($this->_groupby) ) . $this->_groupby;
+ $req .= pack ( "N", $this->_maxmatches );
+ $req .= pack ( "N", strlen($this->_groupsort) ) . $this->_groupsort;
+ $req .= pack ( "NNN", $this->_cutoff, $this->_retrycount, $this->_retrydelay );
+ $req .= pack ( "N", strlen($this->_groupdistinct) ) . $this->_groupdistinct;
+
+ // anchor point
+ if ( empty($this->_anchor) )
+ {
+ $req .= pack ( "N", 0 );
+ } else
+ {
+ $a =& $this->_anchor;
+ $req .= pack ( "N", 1 );
+ $req .= pack ( "N", strlen($a["attrlat"]) ) . $a["attrlat"];
+ $req .= pack ( "N", strlen($a["attrlong"]) ) . $a["attrlong"];
+ $req .= $this->_PackFloat ( $a["lat"] ) . $this->_PackFloat ( $a["long"] );
+ }
+
+ // per-index weights
+ $req .= pack ( "N", count($this->_indexweights) );
+ foreach ( $this->_indexweights as $idx=>$weight )
+ $req .= pack ( "N", strlen($idx) ) . $idx . pack ( "N", $weight );
+
+ // max query time
+ $req .= pack ( "N", $this->_maxquerytime );
+
+ // per-field weights
+ $req .= pack ( "N", count($this->_fieldweights) );
+ foreach ( $this->_fieldweights as $field=>$weight )
+ $req .= pack ( "N", strlen($field) ) . $field . pack ( "N", $weight );
+
+ // comment
+ $req .= pack ( "N", strlen($comment) ) . $comment;
+
+ // attribute overrides
+ $req .= pack ( "N", count($this->_overrides) );
+ foreach ( $this->_overrides as $key => $entry )
+ {
+ $req .= pack ( "N", strlen($entry["attr"]) ) . $entry["attr"];
+ $req .= pack ( "NN", $entry["type"], count($entry["values"]) );
+ foreach ( $entry["values"] as $id=>$val )
+ {
+ assert ( is_numeric($id) );
+ assert ( is_numeric($val) );
+
+ $req .= sphPackU64 ( $id );
+ switch ( $entry["type"] )
+ {
+ case SPH_ATTR_FLOAT: $req .= $this->_PackFloat ( $val ); break;
+ case SPH_ATTR_BIGINT: $req .= sphPackI64 ( $val ); break;
+ default: $req .= pack ( "N", $val ); break;
+ }
+ }
+ }
+
+ // select-list
+ $req .= pack ( "N", strlen($this->_select) ) . $this->_select;
+
+ // mbstring workaround
+ $this->_MBPop ();
+
+ // store request to requests array
+ $this->_reqs[] = $req;
+ return count($this->_reqs)-1;
+ }
+
+ /// connect to searchd, run queries batch, and return an array of result sets
+ function RunQueries ()
+ {
+ if ( empty($this->_reqs) )
+ {
+ $this->_error = "no queries defined, issue AddQuery() first";
+ return false;
+ }
+
+ // mbstring workaround
+ $this->_MBPush ();
+
+ if (!( $fp = $this->_Connect() ))
+ {
+ $this->_MBPop ();
+ return false;
+ }
+
+ // send query, get response
+ $nreqs = count($this->_reqs);
+ $req = join ( "", $this->_reqs );
+ $len = 8+strlen($req);
+ $req = pack ( "nnNNN", SEARCHD_COMMAND_SEARCH, VER_COMMAND_SEARCH, $len, 0, $nreqs ) . $req; // add header
+
+ if ( !( $this->_Send ( $fp, $req, $len+8 ) ) ||
+ !( $response = $this->_GetResponse ( $fp, VER_COMMAND_SEARCH ) ) )
+ {
+ $this->_MBPop ();
+ return false;
+ }
+
+ // query sent ok; we can reset reqs now
+ $this->_reqs = array ();
+
+ // parse and return response
+ return $this->_ParseSearchResponse ( $response, $nreqs );
+ }
+
+ /// parse and return search query (or queries) response
+ function _ParseSearchResponse ( $response, $nreqs )
+ {
+ $p = 0; // current position
+ $max = strlen($response); // max position for checks, to protect against broken responses
+
+ $results = array ();
+ for ( $ires=0; $ires<$nreqs && $p<$max; $ires++ )
+ {
+ $results[] = array();
+ $result =& $results[$ires];
+
+ $result["error"] = "";
+ $result["warning"] = "";
+
+ // extract status
+ list(,$status) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ $result["status"] = $status;
+ if ( $status!=SEARCHD_OK )
+ {
+ list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ $message = substr ( $response, $p, $len ); $p += $len;
+
+ if ( $status==SEARCHD_WARNING )
+ {
+ $result["warning"] = $message;
+ } else
+ {
+ $result["error"] = $message;
+ continue;
+ }
+ }
+
+ // read schema
+ $fields = array ();
+ $attrs = array ();
+
+ list(,$nfields) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ while ( $nfields-->0 && $p<$max )
+ {
+ list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ $fields[] = substr ( $response, $p, $len ); $p += $len;
+ }
+ $result["fields"] = $fields;
+
+ list(,$nattrs) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ while ( $nattrs-->0 && $p<$max )
+ {
+ list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ $attr = substr ( $response, $p, $len ); $p += $len;
+ list(,$type) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ $attrs[$attr] = $type;
+ }
+ $result["attrs"] = $attrs;
+
+ // read match count
+ list(,$count) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ list(,$id64) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+
+ // read matches
+ $idx = -1;
+ while ( $count-->0 && $p<$max )
+ {
+ // index into result array
+ $idx++;
+
+ // parse document id and weight
+ if ( $id64 )
+ {
+ $doc = sphUnpackU64 ( substr ( $response, $p, 8 ) ); $p += 8;
+ list(,$weight) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ }
+ else
+ {
+ list ( $doc, $weight ) = array_values ( unpack ( "N*N*",
+ substr ( $response, $p, 8 ) ) );
+ $p += 8;
+ $doc = sphFixUint($doc);
+ }
+ $weight = sprintf ( "%u", $weight );
+
+ // create match entry
+ if ( $this->_arrayresult )
+ $result["matches"][$idx] = array ( "id"=>$doc, "weight"=>$weight );
+ else
+ $result["matches"][$doc]["weight"] = $weight;
+
+ // parse and create attributes
+ $attrvals = array ();
+ foreach ( $attrs as $attr=>$type )
+ {
+ // handle 64bit ints
+ if ( $type==SPH_ATTR_BIGINT )
+ {
+ $attrvals[$attr] = sphUnpackI64 ( substr ( $response, $p, 8 ) ); $p += 8;
+ continue;
+ }
+
+ // handle floats
+ if ( $type==SPH_ATTR_FLOAT )
+ {
+ list(,$uval) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ list(,$fval) = unpack ( "f*", pack ( "L", $uval ) );
+ $attrvals[$attr] = $fval;
+ continue;
+ }
+
+ // handle everything else as unsigned ints
+ list(,$val) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ if ( $type==SPH_ATTR_MULTI )
+ {
+ $attrvals[$attr] = array ();
+ $nvalues = $val;
+ while ( $nvalues-->0 && $p<$max )
+ {
+ list(,$val) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ $attrvals[$attr][] = sphFixUint($val);
+ }
+ } else if ( $type==SPH_ATTR_MULTI64 )
+ {
+ $attrvals[$attr] = array ();
+ $nvalues = $val;
+ while ( $nvalues>0 && $p<$max )
+ {
+ $attrvals[$attr][] = sphUnpackU64 ( substr ( $response, $p, 8 ) ); $p += 8;
+ $nvalues -= 2;
+ }
+ } else if ( $type==SPH_ATTR_STRING )
+ {
+ $attrvals[$attr] = substr ( $response, $p, $val );
+ $p += $val;
+ } else
+ {
+ $attrvals[$attr] = sphFixUint($val);
+ }
+ }
+
+ if ( $this->_arrayresult )
+ $result["matches"][$idx]["attrs"] = $attrvals;
+ else
+ $result["matches"][$doc]["attrs"] = $attrvals;
+ }
+
+ list ( $total, $total_found, $msecs, $words ) =
+ array_values ( unpack ( "N*N*N*N*", substr ( $response, $p, 16 ) ) );
+ $result["total"] = sprintf ( "%u", $total );
+ $result["total_found"] = sprintf ( "%u", $total_found );
+ $result["time"] = sprintf ( "%.3f", $msecs/1000 );
+ $p += 16;
+
+ while ( $words-->0 && $p<$max )
+ {
+ list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ $word = substr ( $response, $p, $len ); $p += $len;
+ list ( $docs, $hits ) = array_values ( unpack ( "N*N*", substr ( $response, $p, 8 ) ) ); $p += 8;
+ $result["words"][$word] = array (
+ "docs"=>sprintf ( "%u", $docs ),
+ "hits"=>sprintf ( "%u", $hits ) );
+ }
+ }
+
+ $this->_MBPop ();
+ return $results;
+ }
+
+ /////////////////////////////////////////////////////////////////////////////
+ // excerpts generation
+ /////////////////////////////////////////////////////////////////////////////
+
+ /// connect to searchd server, and generate exceprts (snippets)
+ /// of given documents for given query. returns false on failure,
+ /// an array of snippets on success
+ function BuildExcerpts ( $docs, $index, $words, $opts=array() )
+ {
+ assert ( is_array($docs) );
+ assert ( is_string($index) );
+ assert ( is_string($words) );
+ assert ( is_array($opts) );
+
+ $this->_MBPush ();
+
+ if (!( $fp = $this->_Connect() ))
+ {
+ $this->_MBPop();
+ return false;
+ }
+
+ /////////////////
+ // fixup options
+ /////////////////
+
+ if ( !isset($opts["before_match"]) ) $opts["before_match"] = "<b>";
+ if ( !isset($opts["after_match"]) ) $opts["after_match"] = "</b>";
+ if ( !isset($opts["chunk_separator"]) ) $opts["chunk_separator"] = " ... ";
+ if ( !isset($opts["limit"]) ) $opts["limit"] = 256;
+ if ( !isset($opts["limit_passages"]) ) $opts["limit_passages"] = 0;
+ if ( !isset($opts["limit_words"]) ) $opts["limit_words"] = 0;
+ if ( !isset($opts["around"]) ) $opts["around"] = 5;
+ if ( !isset($opts["exact_phrase"]) ) $opts["exact_phrase"] = false;
+ if ( !isset($opts["single_passage"]) ) $opts["single_passage"] = false;
+ if ( !isset($opts["use_boundaries"]) ) $opts["use_boundaries"] = false;
+ if ( !isset($opts["weight_order"]) ) $opts["weight_order"] = false;
+ if ( !isset($opts["query_mode"]) ) $opts["query_mode"] = false;
+ if ( !isset($opts["force_all_words"]) ) $opts["force_all_words"] = false;
+ if ( !isset($opts["start_passage_id"]) ) $opts["start_passage_id"] = 1;
+ if ( !isset($opts["load_files"]) ) $opts["load_files"] = false;
+ if ( !isset($opts["html_strip_mode"]) ) $opts["html_strip_mode"] = "index";
+ if ( !isset($opts["allow_empty"]) ) $opts["allow_empty"] = false;
+ if ( !isset($opts["passage_boundary"]) ) $opts["passage_boundary"] = "none";
+ if ( !isset($opts["emit_zones"]) ) $opts["emit_zones"] = false;
+ if ( !isset($opts["load_files_scattered"]) ) $opts["load_files_scattered"] = false;
+
+
+ /////////////////
+ // build request
+ /////////////////
+
+ // v.1.2 req
+ $flags = 1; // remove spaces
+ if ( $opts["exact_phrase"] ) $flags |= 2;
+ if ( $opts["single_passage"] ) $flags |= 4;
+ if ( $opts["use_boundaries"] ) $flags |= 8;
+ if ( $opts["weight_order"] ) $flags |= 16;
+ if ( $opts["query_mode"] ) $flags |= 32;
+ if ( $opts["force_all_words"] ) $flags |= 64;
+ if ( $opts["load_files"] ) $flags |= 128;
+ if ( $opts["allow_empty"] ) $flags |= 256;
+ if ( $opts["emit_zones"] ) $flags |= 512;
+ if ( $opts["load_files_scattered"] ) $flags |= 1024;
+ $req = pack ( "NN", 0, $flags ); // mode=0, flags=$flags
+ $req .= pack ( "N", strlen($index) ) . $index; // req index
+ $req .= pack ( "N", strlen($words) ) . $words; // req words
+
+ // options
+ $req .= pack ( "N", strlen($opts["before_match"]) ) . $opts["before_match"];
+ $req .= pack ( "N", strlen($opts["after_match"]) ) . $opts["after_match"];
+ $req .= pack ( "N", strlen($opts["chunk_separator"]) ) . $opts["chunk_separator"];
+ $req .= pack ( "NN", (int)$opts["limit"], (int)$opts["around"] );
+ $req .= pack ( "NNN", (int)$opts["limit_passages"], (int)$opts["limit_words"], (int)$opts["start_passage_id"] ); // v.1.2
+ $req .= pack ( "N", strlen($opts["html_strip_mode"]) ) . $opts["html_strip_mode"];
+ $req .= pack ( "N", strlen($opts["passage_boundary"]) ) . $opts["passage_boundary"];
+
+ // documents
+ $req .= pack ( "N", count($docs) );
+ foreach ( $docs as $doc )
+ {
+ assert ( is_string($doc) );
+ $req .= pack ( "N", strlen($doc) ) . $doc;
+ }
+
+ ////////////////////////////
+ // send query, get response
+ ////////////////////////////
+
+ $len = strlen($req);
+ $req = pack ( "nnN", SEARCHD_COMMAND_EXCERPT, VER_COMMAND_EXCERPT, $len ) . $req; // add header
+ if ( !( $this->_Send ( $fp, $req, $len+8 ) ) ||
+ !( $response = $this->_GetResponse ( $fp, VER_COMMAND_EXCERPT ) ) )
+ {
+ $this->_MBPop ();
+ return false;
+ }
+
+ //////////////////
+ // parse response
+ //////////////////
+
+ $pos = 0;
+ $res = array ();
+ $rlen = strlen($response);
+ for ( $i=0; $i<count($docs); $i++ )
+ {
+ list(,$len) = unpack ( "N*", substr ( $response, $pos, 4 ) );
+ $pos += 4;
+
+ if ( $pos+$len > $rlen )
+ {
+ $this->_error = "incomplete reply";
+ $this->_MBPop ();
+ return false;
+ }
+ $res[] = $len ? substr ( $response, $pos, $len ) : "";
+ $pos += $len;
+ }
+
+ $this->_MBPop ();
+ return $res;
+ }
+
+
+ /////////////////////////////////////////////////////////////////////////////
+ // keyword generation
+ /////////////////////////////////////////////////////////////////////////////
+
+ /// connect to searchd server, and generate keyword list for a given query
+ /// returns false on failure,
+ /// an array of words on success
+ function BuildKeywords ( $query, $index, $hits )
+ {
+ assert ( is_string($query) );
+ assert ( is_string($index) );
+ assert ( is_bool($hits) );
+
+ $this->_MBPush ();
+
+ if (!( $fp = $this->_Connect() ))
+ {
+ $this->_MBPop();
+ return false;
+ }
+
+ /////////////////
+ // build request
+ /////////////////
+
+ // v.1.0 req
+ $req = pack ( "N", strlen($query) ) . $query; // req query
+ $req .= pack ( "N", strlen($index) ) . $index; // req index
+ $req .= pack ( "N", (int)$hits );
+
+ ////////////////////////////
+ // send query, get response
+ ////////////////////////////
+
+ $len = strlen($req);
+ $req = pack ( "nnN", SEARCHD_COMMAND_KEYWORDS, VER_COMMAND_KEYWORDS, $len ) . $req; // add header
+ if ( !( $this->_Send ( $fp, $req, $len+8 ) ) ||
+ !( $response = $this->_GetResponse ( $fp, VER_COMMAND_KEYWORDS ) ) )
+ {
+ $this->_MBPop ();
+ return false;
+ }
+
+ //////////////////
+ // parse response
+ //////////////////
+
+ $pos = 0;
+ $res = array ();
+ $rlen = strlen($response);
+ list(,$nwords) = unpack ( "N*", substr ( $response, $pos, 4 ) );
+ $pos += 4;
+ for ( $i=0; $i<$nwords; $i++ )
+ {
+ list(,$len) = unpack ( "N*", substr ( $response, $pos, 4 ) ); $pos += 4;
+ $tokenized = $len ? substr ( $response, $pos, $len ) : "";
+ $pos += $len;
+
+ list(,$len) = unpack ( "N*", substr ( $response, $pos, 4 ) ); $pos += 4;
+ $normalized = $len ? substr ( $response, $pos, $len ) : "";
+ $pos += $len;
+
+ $res[] = array ( "tokenized"=>$tokenized, "normalized"=>$normalized );
+
+ if ( $hits )
+ {
+ list($ndocs,$nhits) = array_values ( unpack ( "N*N*", substr ( $response, $pos, 8 ) ) );
+ $pos += 8;
+ $res [$i]["docs"] = $ndocs;
+ $res [$i]["hits"] = $nhits;
+ }
+
+ if ( $pos > $rlen )
+ {
+ $this->_error = "incomplete reply";
+ $this->_MBPop ();
+ return false;
+ }
+ }
+
+ $this->_MBPop ();
+ return $res;
+ }
+
+ function EscapeString ( $string )
+ {
+ $from = array ( '\\', '(',')','|','-','!','@','~','"','&', '/', '^', '$', '=' );
+ $to = array ( '\\\\', '\(','\)','\|','\-','\!','\@','\~','\"', '\&', '\/', '\^', '\$', '\=' );
+
+ return str_replace ( $from, $to, $string );
+ }
+
+ /////////////////////////////////////////////////////////////////////////////
+ // attribute updates
+ /////////////////////////////////////////////////////////////////////////////
+
+ /// batch update given attributes in given rows in given indexes
+ /// returns amount of updated documents (0 or more) on success, or -1 on failure
+ function UpdateAttributes ( $index, $attrs, $values, $mva=false )
+ {
+ // verify everything
+ assert ( is_string($index) );
+ assert ( is_bool($mva) );
+
+ assert ( is_array($attrs) );
+ foreach ( $attrs as $attr )
+ assert ( is_string($attr) );
+
+ assert ( is_array($values) );
+ foreach ( $values as $id=>$entry )
+ {
+ assert ( is_numeric($id) );
+ assert ( is_array($entry) );
+ assert ( count($entry)==count($attrs) );
+ foreach ( $entry as $v )
+ {
+ if ( $mva )
+ {
+ assert ( is_array($v) );
+ foreach ( $v as $vv )
+ assert ( is_int($vv) );
+ } else
+ assert ( is_int($v) );
+ }
+ }
+
+ // build request
+ $this->_MBPush ();
+ $req = pack ( "N", strlen($index) ) . $index;
+
+ $req .= pack ( "N", count($attrs) );
+ foreach ( $attrs as $attr )
+ {
+ $req .= pack ( "N", strlen($attr) ) . $attr;
+ $req .= pack ( "N", $mva ? 1 : 0 );
+ }
+
+ $req .= pack ( "N", count($values) );
+ foreach ( $values as $id=>$entry )
+ {
+ $req .= sphPackU64 ( $id );
+ foreach ( $entry as $v )
+ {
+ $req .= pack ( "N", $mva ? count($v) : $v );
+ if ( $mva )
+ foreach ( $v as $vv )
+ $req .= pack ( "N", $vv );
+ }
+ }
+
+ // connect, send query, get response
+ if (!( $fp = $this->_Connect() ))
+ {
+ $this->_MBPop ();
+ return -1;
+ }
+
+ $len = strlen($req);
+ $req = pack ( "nnN", SEARCHD_COMMAND_UPDATE, VER_COMMAND_UPDATE, $len ) . $req; // add header
+ if ( !$this->_Send ( $fp, $req, $len+8 ) )
+ {
+ $this->_MBPop ();
+ return -1;
+ }
+
+ if (!( $response = $this->_GetResponse ( $fp, VER_COMMAND_UPDATE ) ))
+ {
+ $this->_MBPop ();
+ return -1;
+ }
+
+ // parse response
+ list(,$updated) = unpack ( "N*", substr ( $response, 0, 4 ) );
+ $this->_MBPop ();
+ return $updated;
+ }
+
+ /////////////////////////////////////////////////////////////////////////////
+ // persistent connections
+ /////////////////////////////////////////////////////////////////////////////
+
+ function Open()
+ {
+ if ( $this->_socket !== false )
+ {
+ $this->_error = 'already connected';
+ return false;
+ }
+ if ( !$fp = $this->_Connect() )
+ return false;
+
+ // command, command version = 0, body length = 4, body = 1
+ $req = pack ( "nnNN", SEARCHD_COMMAND_PERSIST, 0, 4, 1 );
+ if ( !$this->_Send ( $fp, $req, 12 ) )
+ return false;
+
+ $this->_socket = $fp;
+ return true;
+ }
+
+ function Close()
+ {
+ if ( $this->_socket === false )
+ {
+ $this->_error = 'not connected';
+ return false;
+ }
+
+ fclose ( $this->_socket );
+ $this->_socket = false;
+
+ return true;
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ // status
+ //////////////////////////////////////////////////////////////////////////
+
+ function Status ()
+ {
+ $this->_MBPush ();
+ if (!( $fp = $this->_Connect() ))
+ {
+ $this->_MBPop();
+ return false;
+ }
+
+ $req = pack ( "nnNN", SEARCHD_COMMAND_STATUS, VER_COMMAND_STATUS, 4, 1 ); // len=4, body=1
+ if ( !( $this->_Send ( $fp, $req, 12 ) ) ||
+ !( $response = $this->_GetResponse ( $fp, VER_COMMAND_STATUS ) ) )
+ {
+ $this->_MBPop ();
+ return false;
+ }
+
+ $res = substr ( $response, 4 ); // just ignore length, error handling, etc
+ $p = 0;
+ list ( $rows, $cols ) = array_values ( unpack ( "N*N*", substr ( $response, $p, 8 ) ) ); $p += 8;
+
+ $res = array();
+ for ( $i=0; $i<$rows; $i++ )
+ for ( $j=0; $j<$cols; $j++ )
+ {
+ list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
+ $res[$i][] = substr ( $response, $p, $len ); $p += $len;
+ }
+
+ $this->_MBPop ();
+ return $res;
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ // flush
+ //////////////////////////////////////////////////////////////////////////
+
+ function FlushAttributes ()
+ {
+ $this->_MBPush ();
+ if (!( $fp = $this->_Connect() ))
+ {
+ $this->_MBPop();
+ return -1;
+ }
+
+ $req = pack ( "nnN", SEARCHD_COMMAND_FLUSHATTRS, VER_COMMAND_FLUSHATTRS, 0 ); // len=0
+ if ( !( $this->_Send ( $fp, $req, 8 ) ) ||
+ !( $response = $this->_GetResponse ( $fp, VER_COMMAND_FLUSHATTRS ) ) )
+ {
+ $this->_MBPop ();
+ return -1;
+ }
+
+ $tag = -1;
+ if ( strlen($response)==4 )
+ list(,$tag) = unpack ( "N*", $response );
+ else
+ $this->_error = "unexpected response length";
+
+ $this->_MBPop ();
+ return $tag;
+ }
+}
+
+//
+// $Id: sphinxapi.php 3087 2012-01-30 23:07:35Z shodan $
+//
diff --git a/phpBB/includes/style/resource_locator.php b/phpBB/includes/style/resource_locator.php index fafa11c352..4cf767c062 100644 --- a/phpBB/includes/style/resource_locator.php +++ b/phpBB/includes/style/resource_locator.php @@ -44,7 +44,7 @@ class phpbb_style_resource_locator implements phpbb_template_locator * style directory, such as admin control panel templates. * @var string */ - public $template_path = 'template/'; + private $template_path; /** * Map from root index to handles to source template file paths. @@ -64,6 +64,16 @@ class phpbb_style_resource_locator implements phpbb_template_locator private $filenames = array(); /** + * Constructor. + * + * Sets default template path to template/. + */ + public function __construct() + { + $this->set_default_template_path(); + } + + /** * Sets the list of style paths * * These paths will be searched for style files in the provided order. @@ -94,10 +104,32 @@ class phpbb_style_resource_locator implements phpbb_template_locator } /** - * Sets the template filenames for handles. $filename_array - * should be a hash of handle => filename pairs. + * Sets the location of templates directory within style directories. * - * @param array $filname_array Should be a hash of handle => filename pairs. + * The location must be a relative path, with a trailing slash. + * Typically it is one directory level deep, e.g. "template/". + * + * @param string $template_path Relative path to templates directory within style directories + * @return null + */ + public function set_template_path($template_path) + { + $this->template_path = $template_path; + } + + /** + * Sets the location of templates directory within style directories + * to the default, which is "template/". + * + * @return null + */ + public function set_default_template_path() + { + $this->template_path = 'template/'; + } + + /** + * {@inheritDoc} */ public function set_filenames(array $filename_array) { @@ -121,14 +153,7 @@ class phpbb_style_resource_locator implements phpbb_template_locator } /** - * Determines the filename for a template handle. - * - * The filename comes from array used in a set_filenames call, - * which should have been performed prior to invoking this function. - * Return value is a file basename (without path). - * - * @param $handle string Template handle - * @return string Filename corresponding to the template handle + * {@inheritDoc} */ public function get_filename_for_handle($handle) { @@ -140,24 +165,7 @@ class phpbb_style_resource_locator implements phpbb_template_locator } /** - * Determines the source file path for a template handle without - * regard for styles tree. - * - * This function returns the path in "primary" style directory - * corresponding to the given template handle. That path may or - * may not actually exist on the filesystem. Because this function - * does not perform stat calls to determine whether the path it - * returns actually exists, it is faster than get_source_file_for_handle. - * - * Use get_source_file_for_handle to obtain the actual path that is - * guaranteed to exist (which might come from the parent style - * directory if primary style has parent styles). - * - * This function will trigger an error if the handle was never - * associated with a template file via set_filenames. - * - * @param $handle string Template handle - * @return string Path to source file path in primary style directory + * {@inheritDoc} */ public function get_virtual_source_file_for_handle($handle) { @@ -172,23 +180,7 @@ class phpbb_style_resource_locator implements phpbb_template_locator } /** - * Determines the source file path for a template handle, accounting - * for styles tree and verifying that the path exists. - * - * This function returns the actual path that may be compiled for - * the specified template handle. It will trigger an error if - * the template handle was never associated with a template path - * via set_filenames or if the template file does not exist on the - * filesystem. - * - * Use get_virtual_source_file_for_handle to just resolve a template - * handle to a path without any filesystem or styles tree checks. - * - * @param string $handle Template handle (i.e. "friendly" template name) - * @param bool $find_all If true, each root path will be checked and function - * will return array of files instead of string and will not - * trigger a error if template does not exist - * @return string Source file path + * {@inheritDoc} */ public function get_source_file_for_handle($handle, $find_all = false) { @@ -239,23 +231,7 @@ class phpbb_style_resource_locator implements phpbb_template_locator } /** - * Locates source file path, accounting for styles tree and verifying that - * the path exists. - * - * Unlike previous functions, this function works without template handle - * and it can search for more than one file. If more than one file name is - * specified, it will return location of file that it finds first. - * - * @param array $files List of files to locate. - * @param bool $return_default Determines what to return if file does not - * exist. If true, function will return location where file is - * supposed to be. If false, function will return false. - * @param bool $return_full_path If true, function will return full path - * to file. If false, function will return file name. This - * parameter can be used to check which one of set of files - * is available. - * @return string or boolean Source file path if file exists or $return_default is - * true. False if file does not exist and $return_default is false + * {@inheritDoc} */ public function get_first_file_location($files, $return_default = false, $return_full_path = true) { @@ -288,4 +264,85 @@ class phpbb_style_resource_locator implements phpbb_template_locator // search failed return $default_result; } + + /** + * Obtains filesystem path for a template file. + * + * The simplest use is specifying a single template file as a string + * in the first argument. This template file should be a basename + * of a template file in the selected style, or its parent styles + * if template inheritance is being utilized. + * + * Note: "selected style" is whatever style the style resource locator + * is configured for. + * + * The return value then will be a path, relative to the current + * directory or absolute, to the template file in the selected style + * or its closest parent. + * + * If the selected style does not have the template file being searched, + * (and if inheritance is involved, none of the parents have it either), + * false will be returned. + * + * Specifying true for $return_default will cause the function to + * return the first path which was checked for existence in the event + * that the template file was not found, instead of false. + * This is the path in the selected style itself, not any of its + * parents. + * + * $files can be given an array of templates instead of a single + * template. When given an array, the function will try to resolve + * each template in the array to a path, and will return the first + * path that exists, or false if none exist. + * + * If $files is an array and template inheritance is involved, first + * each of the files will be checked in the selected style, then each + * of the files will be checked in the immediate parent, and so on. + * + * If $return_full_path is false, then instead of returning a usable + * path (when the template is found) only the template's basename + * will be returned. This can be used to check which of the templates + * specified in $files exists. Naturally more than one template must + * be given in $files. + * + * This function works identically to get_first_file_location except + * it operates on a list of templates, not files. Practically speaking, + * the templates given in the first argument first are prepended with + * the template path (property in this class), then given to + * get_first_file_location for the rest of the processing. + * + * Templates given to this function can be relative paths for templates + * located in subdirectories of the template directories. The paths + * should be relative to the templates directory (template/ by default). + * + * @param string or array $files List of templates to locate. If there is only + * one template, $files can be a string to make code easier to read. + * @param bool $return_default Determines what to return if template does not + * exist. If true, function will return location where template is + * supposed to be. If false, function will return false. + * @param bool $return_full_path If true, function will return full path + * to template. If false, function will return template file name. + * This parameter can be used to check which one of set of template + * files is available. + * @return string or boolean Source template path if template exists or $return_default is + * true. False if template does not exist and $return_default is false + */ + public function get_first_template_location($templates, $return_default = false, $return_full_path = true) + { + // add template path prefix + $files = array(); + if (is_string($templates)) + { + $files[] = $this->template_path . $templates; + } + else + { + foreach ($templates as $template) + { + $files[] = $this->template_path . $template; + } + } + + return $this->get_first_file_location($files, $return_default, $return_full_path); + } } diff --git a/phpBB/includes/style/style.php b/phpBB/includes/style/style.php index 22e0f1d67a..effd496fb9 100644 --- a/phpBB/includes/style/style.php +++ b/phpBB/includes/style/style.php @@ -38,7 +38,7 @@ class phpbb_style * PHP file extension * @var string */ - private $phpEx; + private $php_ext; /** * phpBB config instance @@ -73,10 +73,10 @@ class phpbb_style * @param phpbb_style_path_provider $provider style path provider * @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_template $template) + public function __construct($phpbb_root_path, $php_ext, $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; + $this->php_ext = $php_ext; $this->config = $config; $this->user = $user; $this->locator = $locator; @@ -110,7 +110,7 @@ class phpbb_style * * @param string $name Name of style, used for cache prefix. Examples: "admin", "prosilver" * @param array or string $paths Array of style paths, relative to current root directory - * @param string $template_path Path to templates, relative to style directory. False if path should not be changed. + * @param string $template_path Path to templates, relative to style directory. False if path should be set to default (templates/). */ public function set_custom_style($name, $paths, $template_path = false) { @@ -122,14 +122,16 @@ class phpbb_style $this->provider->set_styles($paths); $this->locator->set_paths($this->provider); - $this->template->cachepath = $this->phpbb_root_path . 'cache/tpl_' . str_replace('_', '-', $name) . '_'; - - $this->template->context = new phpbb_template_context(); - if ($template_path !== false) { - $this->template->template_path = $this->locator->template_path = $template_path; + $this->locator->set_template_path($template_path); } + else + { + $this->locator->set_default_template_path(); + } + + $this->template->cachepath = $this->phpbb_root_path . 'cache/tpl_' . str_replace('_', '-', $name) . '_'; return true; } diff --git a/phpBB/includes/template/compile.php b/phpBB/includes/template/compile.php index 82b301c1a2..22da21820e 100644 --- a/phpBB/includes/template/compile.php +++ b/phpBB/includes/template/compile.php @@ -58,6 +58,9 @@ class phpbb_template_compile */ public function compile_file_to_file($source_file, $compiled_file) { + $lock = new phpbb_lock_flock($compiled_file); + $lock->acquire(); + $source_handle = @fopen($source_file, 'rb'); $destination_handle = @fopen($compiled_file, 'wb'); @@ -66,16 +69,15 @@ class phpbb_template_compile return false; } - @flock($destination_handle, LOCK_EX); - $this->compile_stream_to_stream($source_handle, $destination_handle); @fclose($source_handle); - @flock($destination_handle, LOCK_UN); @fclose($destination_handle); phpbb_chmod($compiled_file, CHMOD_READ | CHMOD_WRITE); + $lock->release(); + clearstatcache(); return true; @@ -118,7 +120,7 @@ class phpbb_template_compile * * @param resource $source_stream Source stream * @param resource $dest_stream Destination stream - * @return void + * @return null */ private function compile_stream_to_stream($source_stream, $dest_stream) { diff --git a/phpBB/includes/template/filter.php b/phpBB/includes/template/filter.php index ad2e35de6a..66d28242a3 100644 --- a/phpBB/includes/template/filter.php +++ b/phpBB/includes/template/filter.php @@ -209,7 +209,7 @@ class phpbb_template_filter extends php_user_filter */ - $data = preg_replace('~(?<!^)(<\?php(?:(?<!\?>).)+(?<!/\*\*/)\?>)$~m', "$1\n", $data); + $data = preg_replace('~(?<!^)(<\?php.+(?<!/\*\*/)\?>)$~m', "$1\n", $data); $data = str_replace('/**/?>', "?>\n", $data); $data = str_replace('?><?php', '', $data); return $data; @@ -362,6 +362,43 @@ class phpbb_template_filter extends php_user_filter } /** + * Parse paths of the form {FOO}/a/{BAR}/b + * + * Note: this method assumes at least one variable in the path, this should + * be checked before this method is called. + * + * @param string $path The path to parse + * @param string $include_type The type of template function to call + * @return string An appropriately formatted string to include in the + * template or an empty string if an expression like S_FIRST_ROW was + * incorrectly used + */ + private function parse_dynamic_path($path, $include_type) + { + $matches = array(); + $replace = array(); + $is_expr = true; + + preg_match_all('#\{((?:' . self::REGEX_NS . '\.)*)(\$)?(' . self::REGEX_VAR . ')\}#', $path, $matches); + foreach ($matches[0] as $var_str) + { + $tmp_is_expr = false; + $var = $this->get_varref($var_str, $tmp_is_expr); + $is_expr = $is_expr && $tmp_is_expr; + $replace[] = "' . $var . '"; + } + + if (!$is_expr) + { + return " \$_template->$include_type('" . str_replace($matches[0], $replace, $path) . "', true);"; + } + else + { + return ''; + } + } + + /** * Compile variables * * @param string $text_blocks Variable reference in source template @@ -774,15 +811,9 @@ class phpbb_template_filter extends php_user_filter private function compile_tag_include($tag_args) { // Process dynamic includes - if ($tag_args[0] == '{') + if (strpos($tag_args, '{') !== false) { - $var = $this->get_varref($tag_args, $is_expr); - - // Make sure someone didn't try to include S_FIRST_ROW or similar - if (!$is_expr) - { - return "if (isset($var)) { \$_template->_tpl_include($var); }"; - } + return $this->parse_dynamic_path($tag_args, '_tpl_include'); } return "\$_template->_tpl_include('$tag_args');"; @@ -796,6 +827,11 @@ class phpbb_template_filter extends php_user_filter */ private function compile_tag_include_php($tag_args) { + if (strpos($tag_args, '{') !== false) + { + return $this->parse_dynamic_path($tag_args, '_php_include'); + } + return "\$_template->_php_include('$tag_args');"; } @@ -883,14 +919,9 @@ class phpbb_template_filter extends php_user_filter private function compile_tag_include_js($tag_args) { // Process dynamic includes - if ($tag_args[0] == '{') + if (strpos($tag_args, '{') !== false) { - $var = $this->get_varref($tag_args, $is_expr); - if (!$is_expr) - { - return " \$_template->_js_include($var, true);"; - } - return ''; + return $this->parse_dynamic_path($tag_args, '_js_include'); } // Locate file diff --git a/phpBB/includes/template/locator.php b/phpBB/includes/template/locator.php index 01c79eec4e..42db91efb2 100644 --- a/phpBB/includes/template/locator.php +++ b/phpBB/includes/template/locator.php @@ -99,12 +99,54 @@ interface phpbb_template_locator public function get_source_file_for_handle($handle, $find_all = false); /** - * Locates source file path, accounting for styles tree and verifying that - * the path exists. + * Obtains a complete filesystem path for a file in a style. * - * Unlike previous functions, this function works without template handle - * and it can search for more than one file. If more than one file name is - * specified, it will return location of file that it finds first. + * This function traverses the style tree (selected style and + * its parents in order, if inheritance is being used) and finds + * the first file on the filesystem matching specified relative path, + * or the first of the specified paths if more than one path is given. + * + * This function can be used to determine filesystem path of any + * file under any style, with the consequence being that complete + * relative to the style directory path must be provided as an argument. + * + * In particular, this function can be used to locate templates + * and javascript files. + * + * For locating templates get_first_template_location should be used + * as it prepends the configured template path to the template basename. + * + * Note: "selected style" is whatever style the style resource locator + * is configured for. + * + * The return value then will be a path, relative to the current + * directory or absolute, to the first existing file in the selected + * style or its closest parent. + * + * If the selected style does not have the file being searched, + * (and if inheritance is involved, none of the parents have it either), + * false will be returned. + * + * Multiple files can be specified, in which case the first file in + * the list that can be found on the filesystem is returned. + * + * If multiple files are specified and inheritance is involved, + * first each of the specified files is checked in the selected style, + * then each of the specified files is checked in the immediate parent, + * etc. + * + * Specifying true for $return_default will cause the function to + * return the first path which was checked for existence in the event + * that the template file was not found, instead of false. + * This is always a path in the selected style itself, not any of its + * parents. + * + * If $return_full_path is false, then instead of returning a usable + * path (when the file is found) the file's path relative to the style + * directory will be returned. This is the same path as was given to + * the function as a parameter. This can be used to check which of the + * files specified in $files exists. Naturally this requires passing + * more than one file in $files. * * @param array $files List of files to locate. * @param bool $return_default Determines what to return if file does not diff --git a/phpBB/includes/template/template.php b/phpBB/includes/template/template.php index 8ab3c44be3..5396ddbfad 100644 --- a/phpBB/includes/template/template.php +++ b/phpBB/includes/template/template.php @@ -36,7 +36,7 @@ class phpbb_template * Stores template data used during template rendering. * @var phpbb_template_context */ - public $context; + private $context; /** * Path of the cache directory for the template @@ -54,7 +54,7 @@ class phpbb_template * PHP file extension * @var string */ - private $phpEx; + private $php_ext; /** * phpBB config instance @@ -75,26 +75,21 @@ class phpbb_template private $locator; /** - * Location of templates directory within style directories - * @var string - */ - public $template_path = 'template/'; - - /** * Constructor. * * @param string $phpbb_root_path phpBB root path * @param user $user current user * @param phpbb_template_locator $locator template locator + * @param phpbb_template_context $context template context */ - public function __construct($phpbb_root_path, $phpEx, $config, $user, phpbb_template_locator $locator) + public function __construct($phpbb_root_path, $php_ext, $config, $user, phpbb_template_locator $locator, phpbb_template_context $context) { $this->phpbb_root_path = $phpbb_root_path; - $this->phpEx = $phpEx; + $this->php_ext = $php_ext; $this->config = $config; $this->user = $user; $this->locator = $locator; - $this->template_path = $this->locator->template_path; + $this->context = $context; } /** @@ -139,7 +134,7 @@ class phpbb_template */ public function display($handle) { - $result = $this->call_hook($handle); + $result = $this->call_hook($handle, __FUNCTION__); if ($result !== false) { return $result[0]; @@ -174,16 +169,17 @@ class phpbb_template * Calls hook if any is defined. * * @param string $handle Template handle being displayed. + * @param string $method Method name of the caller. */ - private function call_hook($handle) + private function call_hook($handle, $method) { global $phpbb_hook; - if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, __FUNCTION__), $handle, $this)) + if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, $method), $handle, $this)) { - if ($phpbb_hook->hook_return(array(__CLASS__, __FUNCTION__))) + if ($phpbb_hook->hook_return(array(__CLASS__, $method))) { - $result = $phpbb_hook->hook_return_result(array(__CLASS__, __FUNCTION__)); + $result = $phpbb_hook->hook_return_result(array(__CLASS__, $method)); return array($result); } } @@ -247,7 +243,7 @@ class phpbb_template * If template cache is writable the compiled php code will be stored * on filesystem and template will not be subsequently recompiled. * If template cache is not writable template source will be recompiled - * every time it is needed. DEBUG_EXTRA define and load_tplcompile + * every time it is needed. DEBUG define and load_tplcompile * configuration setting may be used to force templates to be always * recompiled. * @@ -265,7 +261,7 @@ class phpbb_template { $output_file = $this->_compiled_file_for_handle($handle); - $recompile = defined('DEBUG_EXTRA') || + $recompile = defined('DEBUG') || !file_exists($output_file) || @filesize($output_file) === 0; @@ -313,7 +309,7 @@ class phpbb_template private function _compiled_file_for_handle($handle) { $source_file = $this->locator->get_filename_for_handle($handle); - $compiled_file = $this->cachepath . str_replace('/', '.', $source_file) . '.' . $this->phpEx; + $compiled_file = $this->cachepath . str_replace('/', '.', $source_file) . '.' . $this->php_ext; return $compiled_file; } @@ -456,42 +452,6 @@ class phpbb_template } /** - * Locates source template path, accounting for styles tree and verifying that - * the path exists. - * - * @param string or array $files List of templates to locate. If there is only - * one template, $files can be a string to make code easier to read. - * @param bool $return_default Determines what to return if template does not - * exist. If true, function will return location where template is - * supposed to be. If false, function will return false. - * @param bool $return_full_path If true, function will return full path - * to template. If false, function will return template file name. - * This parameter can be used to check which one of set of template - * files is available. - * @return string or boolean Source template path if template exists or $return_default is - * true. False if template does not exist and $return_default is false - */ - public function locate($files, $return_default = false, $return_full_path = true) - { - // add tempalte path prefix - $templates = array(); - if (is_string($files)) - { - $templates[] = $this->template_path . $files; - } - else - { - foreach ($files as $file) - { - $templates[] = $this->template_path . $file; - } - } - - // use resource locator to find files - return $this->locator->get_first_file_location($templates, $return_default, $return_full_path); - } - - /** * Include JS file * * @param string $file file name @@ -503,7 +463,11 @@ class phpbb_template // Locate file if ($locate) { - $file = $this->locator->get_first_file_location(array($file), true, true); + $located = $this->locator->get_first_file_location(array($file), false, true); + if ($located) + { + $file = $located; + } } else if ($relative) { diff --git a/phpBB/includes/ucp/info/ucp_profile.php b/phpBB/includes/ucp/info/ucp_profile.php index 968538a178..3581a7f533 100644 --- a/phpBB/includes/ucp/info/ucp_profile.php +++ b/phpBB/includes/ucp/info/ucp_profile.php @@ -19,8 +19,8 @@ class ucp_profile_info 'title' => 'UCP_PROFILE', 'version' => '1.0.0', 'modes' => array( - 'profile_info' => array('title' => 'UCP_PROFILE_PROFILE_INFO', 'auth' => '', 'cat' => array('UCP_PROFILE')), - 'signature' => array('title' => 'UCP_PROFILE_SIGNATURE', 'auth' => '', 'cat' => array('UCP_PROFILE')), + 'profile_info' => array('title' => 'UCP_PROFILE_PROFILE_INFO', 'auth' => 'acl_u_chgprofileinfo', 'cat' => array('UCP_PROFILE')), + 'signature' => array('title' => 'UCP_PROFILE_SIGNATURE', 'auth' => 'acl_u_sig', 'cat' => array('UCP_PROFILE')), 'avatar' => array('title' => 'UCP_PROFILE_AVATAR', 'auth' => 'cfg_allow_avatar && (cfg_allow_avatar_local || cfg_allow_avatar_remote || cfg_allow_avatar_upload || cfg_allow_avatar_remote_upload)', 'cat' => array('UCP_PROFILE')), 'reg_details' => array('title' => 'UCP_PROFILE_REG_DETAILS', 'auth' => '', 'cat' => array('UCP_PROFILE')), 'autologin_keys'=> array('title' => 'UCP_PROFILE_AUTOLOGIN_KEYS', 'auth' => '', 'cat' => array('UCP_PROFILE')), diff --git a/phpBB/includes/ucp/ucp_attachments.php b/phpBB/includes/ucp/ucp_attachments.php index 836185f105..dc095e7b73 100644 --- a/phpBB/includes/ucp/ucp_attachments.php +++ b/phpBB/includes/ucp/ucp_attachments.php @@ -170,9 +170,11 @@ class ucp_attachments } $db->sql_freeresult($result); + $base_url = $this->u_action . "&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( - 'PAGE_NUMBER' => on_page($num_attachments, $config['topics_per_page'], $start), - 'PAGINATION' => generate_pagination($this->u_action . "&sk=$sort_key&sd=$sort_dir", $num_attachments, $config['topics_per_page'], $start), + 'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $num_attachments, $config['topics_per_page'], $start), 'TOTAL_ATTACHMENTS' => $num_attachments, 'L_TITLE' => $user->lang['UCP_ATTACHMENTS'], diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index a7c6479759..9652986cf2 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -513,7 +513,8 @@ class ucp_groups $data['height'] = request_var('height', ''); $delete = request_var('delete', ''); - if (!empty($_FILES['uploadfile']['tmp_name']) || $data['uploadurl'] || $data['remotelink']) + $uploadfile = $request->file('uploadfile'); + if (!empty($uploadfile['tmp_name']) || $data['uploadurl'] || $data['remotelink']) { // Avatar stuff $var_ary = array( @@ -527,7 +528,7 @@ class ucp_groups { $data['user_id'] = "g$group_id"; - if ((!empty($_FILES['uploadfile']['tmp_name']) || $data['uploadurl']) && $can_upload) + if ((!empty($uploadfile['tmp_name']) || $data['uploadurl']) && $can_upload) { list($submit_ary['avatar_type'], $submit_ary['avatar'], $submit_ary['avatar_width'], $submit_ary['avatar_height']) = avatar_upload($data, $error); } @@ -844,11 +845,13 @@ class ucp_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_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), + 'S_ON_PAGE' => phpbb_on_page($template, $user, $base_url, $total_members, $config['topics_per_page'], $start), 'U_ACTION' => $this->u_action . "&g=$group_id", 'S_UCP_ACTION' => $this->u_action . "&g=$group_id", @@ -1067,7 +1070,8 @@ class ucp_groups 'mode' => $mode, 'action' => $action ); - confirm_box(false, $user->lang('GROUP_CONFIRM_ADD_USERS', sizeof($name_ary), implode(', ', $name_ary)), build_hidden_fields($s_hidden_fields)); + + confirm_box(false, $user->lang('GROUP_CONFIRM_ADD_USERS', sizeof($name_ary), implode($user->lang['COMMA_SEPARATOR'], $name_ary)), build_hidden_fields($s_hidden_fields)); } trigger_error($user->lang['NO_USERS_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '&action=list&g=' . $group_id . '">', '</a>')); diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index 00b7b55f27..94fd59433b 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -69,17 +69,16 @@ class ucp_main // Get cleaned up list... return only those forums having the f_read permission $forum_ary = $auth->acl_getf('f_read', true); $forum_ary = array_unique(array_keys($forum_ary)); - - $sql = "SELECT t.* $sql_select - FROM $sql_from - WHERE t.topic_type = " . POST_GLOBAL . ' - AND ' . $db->sql_in_set('t.forum_id', $forum_ary) . ' - ORDER BY t.topic_last_post_time DESC'; - $topic_list = $rowset = array(); + // If the user can't see any forums, he can't read any posts because fid of 0 is invalid if (!empty($forum_ary)) { + $sql = "SELECT t.* $sql_select + FROM $sql_from + WHERE t.topic_type = " . POST_GLOBAL . ' + AND ' . $db->sql_in_set('t.forum_id', $forum_ary) . ' + ORDER BY t.topic_last_post_time DESC'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) @@ -670,9 +669,10 @@ class ucp_main if ($topics_count) { + phpbb_generate_template_pagination($template, $this->u_action, 'pagination', 'start', $topics_count, $config['topics_per_page'], $start); + $template->assign_vars(array( - 'PAGINATION' => generate_pagination($this->u_action, $topics_count, $config['topics_per_page'], $start), - 'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start), + 'PAGE_NUMBER' => phpbb_on_page($template, $user, $this->u_action, $topics_count, $config['topics_per_page'], $start), 'TOTAL_TOPICS' => $user->lang('VIEW_FORUM_TOPICS', (int) $topics_count), )); } @@ -813,7 +813,6 @@ class ucp_main 'S_DELETED_TOPIC' => (!$row['topic_id']) ? true : false, - 'PAGINATION' => topic_generate_pagination($replies, append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . "&t=$topic_id")), 'REPLIES' => $replies, 'VIEWS' => $row['topic_views'], 'TOPIC_TITLE' => censor_text($row['topic_title']), @@ -837,6 +836,8 @@ class ucp_main 'U_VIEW_TOPIC' => $view_topic_url, 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id), )); + + phpbb_generate_template_pagination($template, append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . "&t=$topic_id"), 'topicrow.pagination', 'start', $replies + 1, $config['posts_per_page'], 1, true, true); } } } diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 0084184c65..f6192a3588 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -749,7 +749,8 @@ function compose_pm($id, $mode, $action, $user_folders = array()) $return_box_lang = ($action === 'post' || $action === 'edit') ? 'PM_OUTBOX' : 'PM_INBOX'; - $message = $user->lang['MESSAGE_STORED'] . '<br /><br />' . sprintf($user->lang['VIEW_PRIVATE_MESSAGE'], '<a href="' . $return_message_url . '">', '</a>'); + $save_message = ($action === 'edit') ? $user->lang['MESSAGE_EDITED'] : $user->lang['MESSAGE_STORED']; + $message = $save_message . '<br /><br />' . $user->lang('VIEW_PRIVATE_MESSAGE', '<a href="' . $return_message_url . '">', '</a>'); $last_click_type = 'CLICK_RETURN_FOLDER'; if ($folder_url) @@ -837,11 +838,11 @@ function compose_pm($id, $mode, $action, $user_folders = array()) $post_id = request_var('p', 0); if ($config['allow_post_links']) { - $message_link = "[url=" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id}]{$user->lang['SUBJECT']}: {$message_subject}[/url]\n\n"; + $message_link = "[url=" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id}]{$user->lang['SUBJECT']}{$user->lang['COLON']} {$message_subject}[/url]\n\n"; } else { - $message_link = $user->lang['SUBJECT'] . ': ' . $message_subject . " (" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id})\n\n"; + $message_link = $user->lang['SUBJECT'] . $user->lang['COLON'] . ' ' . $message_subject . " (" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id})\n\n"; } } else @@ -874,7 +875,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) $forward_text[] = sprintf($user->lang['FWD_SUBJECT'], censor_text($message_subject)); $forward_text[] = sprintf($user->lang['FWD_DATE'], $user->format_date($message_time, false, true)); $forward_text[] = sprintf($user->lang['FWD_FROM'], $quote_username_text); - $forward_text[] = sprintf($user->lang['FWD_TO'], implode(', ', $fwd_to_field['to'])); + $forward_text[] = sprintf($user->lang['FWD_TO'], implode($user->lang['COMMA_SEPARATOR'], $fwd_to_field['to'])); $message_parser->message = implode("\n", $forward_text) . "\n\n[quote="{$quote_username}"]\n" . censor_text(trim($message_parser->message)) . "\n[/quote]"; $message_subject = ((!preg_match('/^Fwd:/', $message_subject)) ? 'Fwd: ' : '') . censor_text($message_subject); diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index 8b1cd419f4..625da23736 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -176,7 +176,7 @@ function view_folder($id, $mode, $folder_id, $folder) 'U_VIEW_PM' => ($row['pm_deleted']) ? '' : $view_message_url, 'U_REMOVE_PM' => ($row['pm_deleted']) ? $remove_message_url : '', 'U_MCP_REPORT' => (isset($row['report_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=pm_reports&mode=pm_report_details&r=' . $row['report_id']) : '', - 'RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? implode(', ', $address_list[$message_id]) : '') + 'RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? implode($user->lang['COMMA_SEPARATOR'], $address_list[$message_id]) : '') ); } unset($folder_info['rowset']); @@ -266,9 +266,9 @@ function view_folder($id, $mode, $folder_id, $folder) } } - // There is the chance that all recipients of the message got deleted. To avoid creating + // There is the chance that all recipients of the message got deleted. To avoid creating // exports without recipients, we add a bogus "undisclosed recipient". - if (!(isset($address[$message_id]['g']) && sizeof($address[$message_id]['g'])) && + if (!(isset($address[$message_id]['g']) && sizeof($address[$message_id]['g'])) && !(isset($address[$message_id]['u']) && sizeof($address[$message_id]['u']))) { $address[$message_id]['u'] = array(); @@ -277,7 +277,7 @@ function view_folder($id, $mode, $folder_id, $folder) } decode_message($message_row['message_text'], $message_row['bbcode_uid']); - + $data[] = array( 'subject' => censor_text($row['message_subject']), 'sender' => $row['username'], @@ -451,9 +451,11 @@ function get_pm_from($folder_id, $folder, $user_id) $sql_limit_time = ''; } + $base_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=view&action=view_folder&f=$folder_id&$u_sort_param"); + phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $pm_count, $config['topics_per_page'], $start); + $template->assign_vars(array( - 'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=view&action=view_folder&f=$folder_id&$u_sort_param"), $pm_count, $config['topics_per_page'], $start), - 'PAGE_NUMBER' => on_page($pm_count, $config['topics_per_page'], $start), + 'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $pm_count, $config['topics_per_page'], $start), 'TOTAL_MESSAGES' => $user->lang('VIEW_PM_MESSAGES', (int) $pm_count), 'POST_IMG' => (!$auth->acl_get('u_sendpm')) ? $user->img('button_topic_locked', 'POST_PM_LOCKED') : $user->img('button_pm_new', 'POST_NEW_PM'), diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index c55e8850a6..c85b05f144 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -21,7 +21,7 @@ if (!defined('IN_PHPBB')) function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) { global $user, $template, $auth, $db, $cache; - global $phpbb_root_path, $request, $phpEx, $config; + global $phpbb_root_path, $request, $phpEx, $config, $phpbb_dispatcher; $user->add_lang(array('viewtopic', 'memberlist')); @@ -204,7 +204,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) } } - $template->assign_vars(array( + $msg_data = array( 'MESSAGE_AUTHOR_FULL' => get_username_string('full', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']), 'MESSAGE_AUTHOR_COLOUR' => get_username_string('colour', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']), 'MESSAGE_AUTHOR' => get_username_string('username', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']), @@ -257,6 +257,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) 'U_PM_ACTION' => $url . '&mode=compose&f=' . $folder_id . '&p=' . $message_row['msg_id'], 'S_HAS_ATTACHMENTS' => (sizeof($attachments)) ? true : false, + 'S_HAS_MULTIPLE_ATTACHMENTS' => (sizeof($attachments) > 1), 'S_DISPLAY_NOTICE' => $display_notice && $message_row['message_attachment'], 'S_AUTHOR_DELETED' => ($author_id == ANONYMOUS) ? true : false, 'S_SPECIAL_FOLDER' => in_array($folder_id, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX)), @@ -265,9 +266,28 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) 'S_CUSTOM_FIELDS' => (!empty($cp_row['row'])) ? true : false, 'U_PRINT_PM' => ($config['print_pm'] && $auth->acl_get('u_pm_printpm')) ? "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=print" : '', - 'U_FORWARD_PM' => ($config['forward_pm'] && $auth->acl_get('u_sendpm') && $auth->acl_get('u_pm_forward')) ? "$url&mode=compose&action=forward&f=$folder_id&p=" . $message_row['msg_id'] : '') + 'U_FORWARD_PM' => ($config['forward_pm'] && $auth->acl_get('u_sendpm') && $auth->acl_get('u_pm_forward')) ? "$url&mode=compose&action=forward&f=$folder_id&p=" . $message_row['msg_id'] : '', ); + /** + * Modify pm and sender data before it is assigned to the template + * + * @event core.ucp_pm_view_messsage + * @var mixed id Active module category (can be int or string) + * @var string mode Active module + * @var int folder_id ID of the folder the message is in + * @var int msg_id ID of the private message + * var array folder Array with data of user's message folders + * @var array message_row Array with message data + * @var array cp_row Array with senders custom profile field data + * @var array msg_data Template array with message data + * @since 3.1-A1 + */ + $vars = array('id', 'mode', 'folder_id', 'msg_id', 'folder', 'message_row', 'cp_row', 'msg_data'); + extract($phpbb_dispatcher->trigger_event('core.ucp_pm_view_messsage', compact($vars))); + + $template->assign_vars($msg_data); + // Display the custom profile fields if (!empty($cp_row['row'])) { @@ -282,6 +302,12 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) // Display not already displayed Attachments for this post, we already parsed them. ;) if (isset($attachments) && sizeof($attachments)) { + $methods = phpbb_gen_download_links('post_msg_id', $msg_id, $phpbb_root_path, $phpEx); + foreach ($methods as $method) + { + $template->assign_block_vars('dl_method', $method); + } + foreach ($attachments as $attachment) { $template->assign_block_vars('attachment', array( diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index 0c9f20f266..23892c2c8c 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -41,9 +41,8 @@ class ucp_prefs 'dateformat' => request_var('dateformat', $user->data['user_dateformat'], true), 'lang' => basename(request_var('lang', $user->data['user_lang'])), 'style' => request_var('style', (int) $user->data['user_style']), - 'tz' => request_var('tz', (float) $user->data['user_timezone']), + 'tz' => request_var('tz', $user->data['user_timezone']), - 'dst' => request_var('dst', (bool) $user->data['user_dst']), 'viewemail' => request_var('viewemail', (bool) $user->data['user_allow_viewemail']), 'massemail' => request_var('massemail', (bool) $user->data['user_allow_massemail']), 'hideonline' => request_var('hideonline', (bool) !$user->data['user_allow_viewonline']), @@ -72,7 +71,7 @@ class ucp_prefs $error = validate_data($data, array( 'dateformat' => array('string', false, 1, 30), 'lang' => array('language_iso_name'), - 'tz' => array('num', false, -14, 14), + 'tz' => array('timezone'), )); if (!check_form_key('ucp_prefs_personal')) @@ -93,7 +92,6 @@ class ucp_prefs 'user_notify_pm' => $data['notifypm'], 'user_options' => $user->data['user_options'], - 'user_dst' => $data['dst'], 'user_dateformat' => $data['dateformat'], 'user_lang' => $data['lang'], 'user_timezone' => $data['tz'], @@ -133,6 +131,37 @@ class ucp_prefs } $dateformat_options .= '>' . $user->lang['CUSTOM_DATEFORMAT'] . '</option>'; + $timezone_selects = phpbb_timezone_select($user, $data['tz'], true); + + // check if there are any user-selectable languages + $sql = 'SELECT COUNT(lang_id) as languages_count + FROM ' . LANG_TABLE; + $result = $db->sql_query($sql); + if ($db->sql_fetchfield('languages_count') > 1) + { + $s_more_languages = true; + } + else + { + $s_more_languages = false; + } + $db->sql_freeresult($result); + + // check if there are any user-selectable styles + $sql = 'SELECT COUNT(style_id) as styles_count + FROM ' . STYLES_TABLE . ' + WHERE style_active = 1'; + $result = $db->sql_query($sql); + if ($db->sql_fetchfield('styles_count') > 1) + { + $s_more_styles = true; + } + else + { + $s_more_styles = false; + } + $db->sql_freeresult($result); + $template->assign_vars(array( 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '', @@ -145,7 +174,6 @@ class ucp_prefs 'S_HIDE_ONLINE' => $data['hideonline'], 'S_NOTIFY_PM' => $data['notifypm'], 'S_POPUP_PM' => $data['popuppm'], - 'S_DST' => $data['dst'], 'DATE_FORMAT' => $data['dateformat'], 'A_DATE_FORMAT' => addslashes($data['dateformat']), @@ -154,9 +182,13 @@ class ucp_prefs 'DEFAULT_DATEFORMAT' => $config['default_dateformat'], 'A_DEFAULT_DATEFORMAT' => addslashes($config['default_dateformat']), + 'S_MORE_LANGUAGES' => $s_more_languages, + 'S_MORE_STYLES' => $s_more_styles, + 'S_LANG_OPTIONS' => language_select($data['lang']), 'S_STYLE_OPTIONS' => ($config['override_user_style']) ? '' : 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'], 'S_CAN_HIDE_ONLINE' => ($auth->acl_get('u_hideonline')) ? true : false, 'S_SELECT_NOTIFY' => ($config['jab_enable'] && $user->data['user_jabber'] && @extension_loaded('xml')) ? true : false) ); diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 2ac82fb52f..e7cea06a45 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -46,9 +46,9 @@ class ucp_profile $data = array( 'username' => utf8_normalize_nfc(request_var('username', $user->data['username'], true)), 'email' => strtolower(request_var('email', $user->data['user_email'])), - 'new_password' => request_var('new_password', '', true), - 'cur_password' => request_var('cur_password', '', true), - 'password_confirm' => request_var('password_confirm', '', true), + 'new_password' => $request->variable('new_password', '', true), + 'cur_password' => $request->variable('cur_password', '', true), + 'password_confirm' => $request->variable('password_confirm', '', true), ); add_form_key('ucp_reg_details'); @@ -251,6 +251,11 @@ class ucp_profile break; case 'profile_info': + // Do not display profile information panel if not authed to do so + if (!$auth->acl_get('u_chgprofileinfo')) + { + trigger_error('NO_AUTH_PROFILEINFO'); + } include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx); diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 5d85029e62..c57aec00a0 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -100,7 +100,7 @@ class ucp_register 'username' => utf8_normalize_nfc(request_var('username', '', true)), 'email' => strtolower(request_var('email', '')), 'lang' => $user->lang_name, - 'tz' => request_var('tz', (float) $config['board_timezone']), + 'tz' => request_var('tz', $config['board_timezone']), )); } @@ -120,7 +120,10 @@ class ucp_register if ($coppa === false && $config['coppa_enable']) { $now = getdate(); - $coppa_birthday = $user->format_date(mktime($now['hours'] + $user->data['user_dst'], $now['minutes'], $now['seconds'], $now['mon'], $now['mday'] - 1, $now['year'] - 13), $user->lang['DATE_FORMAT']); + $coppa_birthday = $user->create_datetime() + ->setDate($now['year'] - 13, $now['mon'], $now['mday'] - 1) + ->setTime(0, 0, 0) + ->format($user->lang['DATE_FORMAT'], true); unset($now); $template->assign_vars(array( @@ -163,16 +166,15 @@ class ucp_register $captcha->init(CONFIRM_REG); } - $is_dst = $config['board_dst']; $timezone = $config['board_timezone']; $data = array( 'username' => utf8_normalize_nfc(request_var('username', '', true)), - 'new_password' => request_var('new_password', '', true), - 'password_confirm' => request_var('password_confirm', '', true), + 'new_password' => $request->variable('new_password', '', true), + 'password_confirm' => $request->variable('password_confirm', '', true), 'email' => strtolower(request_var('email', '')), 'lang' => basename(request_var('lang', $user->lang_name)), - 'tz' => request_var('tz', (float) $timezone), + 'tz' => request_var('tz', $timezone), ); // Check and initialize some variables if needed @@ -189,7 +191,7 @@ class ucp_register 'email' => array( array('string', false, 6, 60), array('email')), - 'tz' => array('num', false, -14, 14), + 'tz' => array('timezone'), 'lang' => array('language_iso_name'), )); @@ -279,8 +281,7 @@ class ucp_register 'user_password' => phpbb_hash($data['new_password']), 'user_email' => $data['email'], 'group_id' => (int) $group_id, - 'user_timezone' => (float) $data['tz'], - 'user_dst' => $is_dst, + 'user_timezone' => $data['tz'], 'user_lang' => $data['lang'], 'user_type' => $user_type, 'user_actkey' => $user_actkey, @@ -441,6 +442,7 @@ class ucp_register break; } + $timezone_selects = phpbb_timezone_select($user, $data['tz'], true); $template->assign_vars(array( 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '', 'USERNAME' => $data['username'], @@ -453,7 +455,8 @@ class ucp_register 'L_PASSWORD_EXPLAIN' => $user->lang($config['pass_complex'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_pass_chars']), $user->lang('CHARACTERS', (int) $config['max_pass_chars'])), 'S_LANG_OPTIONS' => language_select($data['lang']), - 'S_TZ_OPTIONS' => tz_select($data['tz']), + 'S_TZ_OPTIONS' => $timezone_selects['tz_select'], + 'S_TZ_DATE_OPTIONS' => $timezone_selects['tz_dates'], 'S_CONFIRM_REFRESH' => ($config['enable_confirm'] && $config['confirm_refresh']) ? true : false, 'S_REGISTRATION' => true, 'S_COPPA' => $coppa, diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php index efe928b387..a669c450a4 100644 --- a/phpBB/includes/ucp/ucp_zebra.php +++ b/phpBB/includes/ucp/ucp_zebra.php @@ -25,7 +25,7 @@ class ucp_zebra function main($id, $mode) { - global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx, $request; + global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx, $request, $phpbb_dispatcher; $submit = (isset($_POST['submit']) || isset($_GET['add']) || isset($_GET['remove'])) ? true : false; $s_hidden_fields = ''; @@ -54,9 +54,22 @@ class ucp_zebra // Remove users if (!empty($data['usernames'])) { + $user_ids = $data['usernames']; + + /** + * Remove users from friends/foes + * + * @event core.ucp_remove_zebra + * @var string mode Zebra type: friends|foes + * @var array user_ids User ids we remove + * @since 3.1-A1 + */ + $vars = array('user_ids'); + extract($phpbb_dispatcher->trigger_event('core.ucp_remove_zebra', compact($vars))); + $sql = 'DELETE FROM ' . ZEBRA_TABLE . ' WHERE user_id = ' . $user->data['user_id'] . ' - AND ' . $db->sql_in_set('zebra_id', $data['usernames']); + AND ' . $db->sql_in_set('zebra_id', $user_ids); $db->sql_query($sql); $updated = true; @@ -186,6 +199,19 @@ class ucp_zebra ); } + /** + * Add users to friends/foes + * + * @event core.ucp_add_zebra + * @var string mode Zebra type: + * friends|foes + * @var array sql_ary Array of + * entries we add + * @since 3.1-A1 + */ + $vars = array('mode', 'sql_ary'); + extract($phpbb_dispatcher->trigger_event('core.ucp_add_zebra', compact($vars))); + $db->sql_multi_insert(ZEBRA_TABLE, $sql_ary); $updated = true; diff --git a/phpBB/includes/update_helpers.php b/phpBB/includes/update_helpers.php new file mode 100644 index 0000000000..69d678b2f8 --- /dev/null +++ b/phpBB/includes/update_helpers.php @@ -0,0 +1,112 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +*/ + +/** +* phpBB Update Helpers +*/ +class phpbb_update_helpers +{ + /** + * Determine the new timezone for a given phpBB 3.0 timezone and + * "Daylight Saving Time" option + * + * @param $timezone float Users timezone in 3.0 + * @param $dst int Users daylight saving time + * @return string Users new php Timezone which is used since 3.1 + */ + function convert_phpbb30_timezone($timezone, $dst) + { + $offset = $timezone + $dst; + + switch ($timezone) + { + case '-12': + return 'Etc/GMT+' . abs($offset); //'[UTC - 12] Baker Island Time' + case '-11': + return 'Etc/GMT+' . abs($offset); //'[UTC - 11] Niue Time, Samoa Standard Time' + case '-10': + return 'Etc/GMT+' . abs($offset); //'[UTC - 10] Hawaii-Aleutian Standard Time, Cook Island Time' + case '-9.5': + return 'Pacific/Marquesas'; //'[UTC - 9:30] Marquesas Islands Time' + case '-9': + return 'Etc/GMT+' . abs($offset); //'[UTC - 9] Alaska Standard Time, Gambier Island Time' + case '-8': + return 'Etc/GMT+' . abs($offset); //'[UTC - 8] Pacific Standard Time' + case '-7': + return 'Etc/GMT+' . abs($offset); //'[UTC - 7] Mountain Standard Time' + case '-6': + return 'Etc/GMT+' . abs($offset); //'[UTC - 6] Central Standard Time' + case '-5': + return 'Etc/GMT+' . abs($offset); //'[UTC - 5] Eastern Standard Time' + case '-4.5': + return 'America/Caracas'; //'[UTC - 4:30] Venezuelan Standard Time' + case '-4': + return 'Etc/GMT+' . abs($offset); //'[UTC - 4] Atlantic Standard Time' + case '-3.5': + return 'America/St_Johns'; //'[UTC - 3:30] Newfoundland Standard Time' + case '-3': + return 'Etc/GMT+' . abs($offset); //'[UTC - 3] Amazon Standard Time, Central Greenland Time' + case '-2': + return 'Etc/GMT+' . abs($offset); //'[UTC - 2] Fernando de Noronha Time, South Georgia & the South Sandwich Islands Time' + case '-1': + return 'Etc/GMT+' . abs($offset); //'[UTC - 1] Azores Standard Time, Cape Verde Time, Eastern Greenland Time' + case '0': + return (!$dst) ? 'UTC' : 'Etc/GMT-1'; //'[UTC] Western European Time, Greenwich Mean Time' + case '1': + return 'Etc/GMT-' . $offset; //'[UTC + 1] Central European Time, West African Time' + case '2': + return 'Etc/GMT-' . $offset; //'[UTC + 2] Eastern European Time, Central African Time' + case '3': + return 'Etc/GMT-' . $offset; //'[UTC + 3] Moscow Standard Time, Eastern African Time' + case '3.5': + return 'Asia/Tehran'; //'[UTC + 3:30] Iran Standard Time' + case '4': + return 'Etc/GMT-' . $offset; //'[UTC + 4] Gulf Standard Time, Samara Standard Time' + case '4.5': + return 'Asia/Kabul'; //'[UTC + 4:30] Afghanistan Time' + case '5': + return 'Etc/GMT-' . $offset; //'[UTC + 5] Pakistan Standard Time, Yekaterinburg Standard Time' + case '5.5': + return 'Asia/Kolkata'; //'[UTC + 5:30] Indian Standard Time, Sri Lanka Time' + case '5.75': + return 'Asia/Kathmandu'; //'[UTC + 5:45] Nepal Time' + case '6': + return 'Etc/GMT-' . $offset; //'[UTC + 6] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time' + case '6.5': + return 'Indian/Cocos'; //'[UTC + 6:30] Cocos Islands Time, Myanmar Time' + case '7': + return 'Etc/GMT-' . $offset; //'[UTC + 7] Indochina Time, Krasnoyarsk Standard Time' + case '8': + return 'Etc/GMT-' . $offset; //'[UTC + 8] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time' + case '8.75': + return 'Australia/Eucla'; //'[UTC + 8:45] Southeastern Western Australia Standard Time' + case '9': + return 'Etc/GMT-' . $offset; //'[UTC + 9] Japan Standard Time, Korea Standard Time, Chita Standard Time' + case '9.5': + return 'Australia/ACT'; //'[UTC + 9:30] Australian Central Standard Time' + case '10': + return 'Etc/GMT-' . $offset; //'[UTC + 10] Australian Eastern Standard Time, Vladivostok Standard Time' + case '10.5': + return 'Australia/Lord_Howe'; //'[UTC + 10:30] Lord Howe Standard Time' + case '11': + return 'Etc/GMT-' . $offset; //'[UTC + 11] Solomon Island Time, Magadan Standard Time' + case '11.5': + return 'Pacific/Norfolk'; //'[UTC + 11:30] Norfolk Island Time' + case '12': + return 'Etc/GMT-12'; //'[UTC + 12] New Zealand Time, Fiji Time, Kamchatka Standard Time' + case '12.75': + return 'Pacific/Chatham'; //'[UTC + 12:45] Chatham Islands Time' + case '13': + return 'Pacific/Tongatapu'; //'[UTC + 13] Tonga Time, Phoenix Islands Time' + case '14': + return 'Pacific/Kiritimati'; //'[UTC + 14] Line Island Time' + default: + return 'UTC'; + } + } +} diff --git a/phpBB/includes/user.php b/phpBB/includes/user.php index cf9e6b9994..9ddd806b27 100644 --- a/phpBB/includes/user.php +++ b/phpBB/includes/user.php @@ -29,8 +29,11 @@ class phpbb_user extends phpbb_session var $help = array(); var $style = array(); var $date_format; - var $timezone; - var $dst; + + /** + * DateTimeZone object holding the timezone of the user + */ + public $timezone; var $lang_name = false; var $lang_id = false; @@ -73,21 +76,19 @@ class phpbb_user extends phpbb_session function setup($lang_set = false, $style_id = false) { global $db, $phpbb_style, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache; + global $phpbb_dispatcher; if ($this->data['user_id'] != ANONYMOUS) { - $this->lang_name = (file_exists($this->lang_path . $this->data['user_lang'] . "/common.$phpEx")) ? $this->data['user_lang'] : basename($config['default_lang']); - - $this->date_format = $this->data['user_dateformat']; - $this->timezone = $this->data['user_timezone'] * 3600; - $this->dst = $this->data['user_dst'] * 3600; + $user_lang_name = (file_exists($this->lang_path . $this->data['user_lang'] . "/common.$phpEx")) ? $this->data['user_lang'] : basename($config['default_lang']); + $user_date_format = $this->data['user_dateformat']; + $user_timezone = $this->data['user_timezone']; } else { - $this->lang_name = basename($config['default_lang']); - $this->date_format = $config['default_dateformat']; - $this->timezone = $config['board_timezone'] * 3600; - $this->dst = $config['board_dst'] * 3600; + $user_lang_name = basename($config['default_lang']); + $user_date_format = $config['default_dateformat']; + $user_timezone = $config['board_timezone']; /** * If a guest user is surfing, we try to guess his/her language first by obtaining the browser language @@ -106,7 +107,7 @@ class phpbb_user extends phpbb_session if (file_exists($this->lang_path . $accept_lang . "/common.$phpEx")) { - $this->lang_name = $config['default_lang'] = $accept_lang; + $user_lang_name = $config['default_lang'] = $accept_lang; break; } else @@ -117,7 +118,7 @@ class phpbb_user extends phpbb_session if (file_exists($this->lang_path . $accept_lang . "/common.$phpEx")) { - $this->lang_name = $config['default_lang'] = $accept_lang; + $user_lang_name = $config['default_lang'] = $accept_lang; break; } } @@ -126,11 +127,43 @@ class phpbb_user extends phpbb_session */ } + $user_data = $this->data; + + /** + * Event to load language files and modify user data on every page + * + * @event core.user_setup + * @var array user_data Array with user's data row + * @var string user_lang_name Basename of the user's langauge + * @var string user_date_format User's date/time format + * @var string user_timezone User's timezone, should be one of + * http://www.php.net/manual/en/timezones.php + * @var mixed lang_set String or array of language files + * @var mixed style_id Style we are going to display + * @since 3.1-A1 + */ + $vars = array('user_data', 'user_lang_name', 'user_date_format', 'user_timezone', 'lang_set', 'style_id'); + extract($phpbb_dispatcher->trigger_event('core.user_setup', compact($vars))); + + $this->data = $user_data; + $this->lang_name = $user_lang_name; + $this->date_format = $user_date_format; + + try + { + $this->timezone = new DateTimeZone($user_timezone); + } + catch (Exception $e) + { + // If the timezone the user has selected is invalid, we fall back to UTC. + $this->timezone = new DateTimeZone('UTC'); + } + // We include common language file here to not load it every time a custom language file is included $lang = &$this->lang; - // Do not suppress error if in DEBUG_EXTRA mode - $include_result = (defined('DEBUG_EXTRA')) ? (include $this->lang_path . $this->lang_name . "/common.$phpEx") : (@include $this->lang_path . $this->lang_name . "/common.$phpEx"); + // Do not suppress error if in DEBUG mode + $include_result = (defined('DEBUG')) ? (include $this->lang_path . $this->lang_name . "/common.$phpEx") : (@include $this->lang_path . $this->lang_name . "/common.$phpEx"); if ($include_result === false) { @@ -219,7 +252,7 @@ class phpbb_user extends phpbb_session // Disable board if the install/ directory is still present // For the brave development army we do not care about this, else we need to comment out this everytime we develop locally - if (!defined('DEBUG_EXTRA') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install')) + if (!defined('DEBUG') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install')) { // Adjust the message slightly according to the permissions if ($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) @@ -585,8 +618,8 @@ class phpbb_user extends phpbb_session return; } - // Do not suppress error if in DEBUG_EXTRA mode - $include_result = (defined('DEBUG_EXTRA')) ? (include $language_filename) : (@include $language_filename); + // Do not suppress error if in DEBUG mode + $include_result = (defined('DEBUG')) ? (include $language_filename) : (@include $language_filename); if ($include_result === false) { @@ -612,70 +645,46 @@ class phpbb_user extends phpbb_session */ function format_date($gmepoch, $format = false, $forcedate = false) { - static $midnight; - static $date_cache; - - $format = (!$format) ? $this->date_format : $format; - $now = time(); - $delta = $now - $gmepoch; - - if (!isset($date_cache[$format])) - { - // Is the user requesting a friendly date format (i.e. 'Today 12:42')? - $date_cache[$format] = array( - 'is_short' => strpos($format, '|'), - 'format_short' => substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1), - 'format_long' => str_replace('|', '', $format), - 'lang' => $this->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)) - { - $date_cache[$format]['lang']['May'] = $this->lang['datetime']['May_short']; - } - } - - // Zone offset - $zone_offset = $this->timezone + $this->dst; - - // Show date < 1 hour ago as 'xx min ago' but not greater than 60 seconds in the future - // A small tolerence is given for times in the future but in the same minute are displayed as '< than a minute ago' - if ($delta < 3600 && $delta > -60 && ($delta >= -5 || (($now / 60) % 60) == (($gmepoch / 60) % 60)) && $date_cache[$format]['is_short'] !== false && !$forcedate && isset($this->lang['datetime']['AGO'])) - { - return $this->lang(array('datetime', 'AGO'), max(0, (int) floor($delta / 60))); - } + static $utc; - if (!$midnight) + if (!isset($utc)) { - list($d, $m, $y) = explode(' ', gmdate('j n Y', time() + $zone_offset)); - $midnight = gmmktime(0, 0, 0, $m, $d, $y) - $zone_offset; + $utc = new DateTimeZone('UTC'); } - if ($date_cache[$format]['is_short'] !== false && !$forcedate && !($gmepoch < $midnight - 86400 || $gmepoch > $midnight + 172800)) - { - $day = false; + $time = new phpbb_datetime($this, "@$gmepoch", $utc); + $time->setTimezone($this->timezone); - if ($gmepoch > $midnight + 86400) - { - $day = 'TOMORROW'; - } - else if ($gmepoch > $midnight) - { - $day = 'TODAY'; - } - else if ($gmepoch > $midnight - 86400) - { - $day = 'YESTERDAY'; - } + return $time->format($format, $forcedate); + } - if ($day !== false) - { - return str_replace('||', $this->lang['datetime'][$day], strtr(@gmdate($date_cache[$format]['format_short'], $gmepoch + $zone_offset), $date_cache[$format]['lang'])); - } - } + /** + * Create a phpbb_datetime object in the context of the current user + * + * @since 3.1 + * @param string $time String in a format accepted by strtotime(). + * @param DateTimeZone $timezone Time zone of the time. + * @return phpbb_datetime Date time object linked to the current users locale + */ + public function create_datetime($time = 'now', DateTimeZone $timezone = null) + { + $timezone = $timezone ?: $this->timezone; + return new phpbb_datetime($this, $time, $timezone); + } - return strtr(@gmdate($date_cache[$format]['format_long'], $gmepoch + $zone_offset), $date_cache[$format]['lang']); + /** + * Get the UNIX timestamp for a datetime in the users timezone, so we can store it in the database. + * + * @param string $format Format of the entered date/time + * @param string $time Date/time with the timezone applied + * @param DateTimeZone $timezone Timezone of the date/time, falls back to timezone of current user + * @return int Returns the unix timestamp + */ + public function get_timestamp_from_format($format, $time, DateTimeZone $timezone = null) + { + $timezone = $timezone ?: $this->timezone; + $date = DateTime::createFromFormat($format, $time, $timezone); + return ($date !== false) ? $date->format('U') : false; } /** diff --git a/phpBB/index.php b/phpBB/index.php index 9a57105d57..845d0f0c02 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -17,48 +17,12 @@ define('IN_PHPBB', true); $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); +include($phpbb_root_path . 'includes/functions_display.' . $phpEx); // Start session management $user->session_begin(); $auth->acl($user->data); -$user->setup(); - -// Handle the display of extension front pages -if ($ext = $request->variable('ext', '')) -{ - $class = 'phpbb_ext_' . str_replace('/', '_', $ext) . '_controller'; - - if (!$phpbb_extension_manager->available($ext)) - { - send_status_line(404, 'Not Found'); - trigger_error($user->lang('EXTENSION_DOES_NOT_EXIST', $ext)); - } - else if (!$phpbb_extension_manager->enabled($ext)) - { - send_status_line(404, 'Not Found'); - trigger_error($user->lang('EXTENSION_DISABLED', $ext)); - } - else if (!class_exists($class)) - { - send_status_line(404, 'Not Found'); - trigger_error($user->lang('EXTENSION_CONTROLLER_MISSING', $ext)); - } - - $controller = new $class; - - if (!($controller instanceof phpbb_extension_controller_interface)) - { - send_status_line(500, 'Internal Server Error'); - trigger_error($user->lang('EXTENSION_CLASS_WRONG_TYPE', $class)); - } - - $controller->handle(); - exit_handler(); -} - -include($phpbb_root_path . 'includes/functions_display.' . $phpEx); - -$user->add_lang('viewforum'); +$user->setup('viewforum'); display_forums('', $config['load_moderators']); @@ -104,17 +68,18 @@ while ($row = $db->sql_fetchrow($result)) } $db->sql_freeresult($result); -$legend = implode(', ', $legend); +$legend = implode($user->lang['COMMA_SEPARATOR'], $legend); // Generate birthday list if required ... $birthday_list = array(); if ($config['load_birthdays'] && $config['allow_birthdays'] && $auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) { - $now = phpbb_gmgetdate(time() + $user->timezone + $user->dst); + $time = $user->create_datetime(); + $now = phpbb_gmgetdate($time->getTimestamp() + $time->getOffset()); // Display birthdays of 29th february on 28th february in non-leap-years $leap_year_birthdays = ''; - if ($now['mday'] == 28 && $now['mon'] == 2 && !$user->format_date(time(), 'L')) + if ($now['mday'] == 28 && $now['mon'] == 2 && !$time->format('L')) { $leap_year_birthdays = " OR u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', 29, 2)) . "%'"; } @@ -156,7 +121,7 @@ $template->assign_vars(array( 'NEWEST_USER' => $user->lang('NEWEST_USER', get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])), 'LEGEND' => $legend, - 'BIRTHDAY_LIST' => (empty($birthday_list)) ? '' : implode(', ', $birthday_list), + 'BIRTHDAY_LIST' => (empty($birthday_list)) ? '' : implode($user->lang['COMMA_SEPARATOR'], $birthday_list), 'FORUM_IMG' => $user->img('forum_read', 'NO_UNREAD_POSTS'), 'FORUM_UNREAD_IMG' => $user->img('forum_unread', 'UNREAD_POSTS'), @@ -166,12 +131,24 @@ $template->assign_vars(array( 'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'), 'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false, - 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'hash=' . generate_link_hash('global') . '&mark=forums') : '', + 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'hash=' . generate_link_hash('global') . '&mark=forums&mark_time=' . time()) : '', 'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=front', true, $user->session_id) : '') ); +$page_title = $user->lang['INDEX']; + +/** +* You can use this event to modify the page title and load data for the index +* +* @event core.index_modify_page_title +* @var string page_title Title of the index page +* @since 3.1-A1 +*/ +$vars = array('page_title'); +extract($phpbb_dispatcher->trigger_event('core.index_modify_page_title', compact($vars))); + // Output page -page_header($user->lang['INDEX']); +page_header($page_title); $template->set_filenames(array( 'body' => 'index_body.html') diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index 79c20b718d..68acea02b3 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -32,7 +32,7 @@ $convertor_data = array( 'forum_name' => 'phpBB 2.0.x', 'version' => '1.0.3', 'phpbb_version' => '3.1.0-dev', - 'author' => '<a href="http://www.phpbb.com/">phpBB Group</a>', + 'author' => '<a href="https://www.phpbb.com/">phpBB Group</a>', 'dbms' => $dbms, 'dbhost' => $dbhost, 'dbport' => $dbport, diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index b7490aca0b..30592b995d 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -7,6 +7,10 @@ * */ +use Symfony\Component\Config\FileLocator; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; + define('UPDATES_TO_VERSION', '3.1.0-dev'); // Enter any version to update from to test updates. The version within the db will not be updated. @@ -59,8 +63,6 @@ $updates_to_version = UPDATES_TO_VERSION; $debug_from_version = DEBUG_FROM_VERSION; $oldest_from_version = OLDEST_FROM_VERSION; -error_reporting(E_ALL); - @set_time_limit(0); // Include essential scripts @@ -71,21 +73,11 @@ if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type)) die("Please read: <a href='../docs/INSTALL.html'>INSTALL.html</a> before attempting to update."); } -// Load Extensions -if (!empty($load_extensions) && function_exists('dl')) -{ - $load_extensions = explode(',', $load_extensions); - - foreach ($load_extensions as $extension) - { - @dl(trim($extension)); - } -} - // Include files require($phpbb_root_path . 'includes/class_loader.' . $phpEx); require($phpbb_root_path . 'includes/functions.' . $phpEx); +require($phpbb_root_path . 'includes/functions_container.' . $phpEx); phpbb_require_updated('includes/functions_content.' . $phpEx, true); @@ -107,21 +99,38 @@ if (!defined('EXT_TABLE')) define('EXT_TABLE', $table_prefix . 'ext'); } -$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', $phpbb_root_path . 'ext/', ".$phpEx"); -$phpbb_class_loader_ext->register(); -$phpbb_class_loader = new phpbb_class_loader('phpbb_', $phpbb_root_path . 'includes/', ".$phpEx"); +// Setup class loader first +$phpbb_class_loader = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}includes/", ".$phpEx"); $phpbb_class_loader->register(); +$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', "{$phpbb_root_path}ext/", ".$phpEx"); +$phpbb_class_loader_ext->register(); + +// Set up container +$phpbb_container = phpbb_create_dumped_container_unless_debug( + array( + new phpbb_di_extension_config($phpbb_root_path . 'config.' . $phpEx), + new phpbb_di_extension_core($phpbb_root_path), + ), + array( + new phpbb_di_pass_collection_pass(), + new phpbb_di_pass_kernel_pass(), + ), + $phpbb_root_path, + $phpEx +); + +$phpbb_class_loader->set_cache($phpbb_container->get('cache.driver')); +$phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver')); // set up caching -$cache_factory = new phpbb_cache_factory($acm_type); -$cache = $cache_factory->get_service(); -$phpbb_class_loader_ext->set_cache($cache->get_driver()); -$phpbb_class_loader->set_cache($cache->get_driver()); +$cache = $phpbb_container->get('cache'); -$phpbb_dispatcher = new phpbb_event_dispatcher(); -$request = new phpbb_request(); -$user = new phpbb_user(); -$db = new $sql_db(); +// Instantiate some basic classes +$phpbb_dispatcher = $phpbb_container->get('dispatcher'); +$request = $phpbb_container->get('request'); +$user = $phpbb_container->get('user'); +$auth = $phpbb_container->get('auth'); +$db = $phpbb_container->get('dbal.conn'); // make sure request_var uses this request instance request_var('', 0, false, false, $request); // "dependency injection" for a function @@ -597,7 +606,7 @@ function _print_footer() </div> <div id="page-footer"> - Powered by <a href="http://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Group + Powered by <a href="https://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Group </div> </div> @@ -613,7 +622,7 @@ function _sql($sql, &$errored, &$error_ary, $echo_dot = true) { global $db; - if (defined('DEBUG_EXTRA')) + if (defined('DEBUG')) { echo "<br />\n{$sql}\n<br />"; } @@ -683,12 +692,12 @@ function _write_result($no_updates, $errored, $error_ary) function _add_modules($modules_to_install) { - global $phpbb_root_path, $phpEx, $db, $phpbb_extension_manager; + global $phpbb_root_path, $phpEx, $db, $phpbb_extension_manager, $config; // modules require an extension manager if (empty($phpbb_extension_manager)) { - $phpbb_extension_manager = new phpbb_extension_manager($db, EXT_TABLE, $phpbb_root_path, ".$phpEx"); + $phpbb_extension_manager = new phpbb_extension_manager($db, $config, EXT_TABLE, $phpbb_root_path, ".$phpEx"); } include_once($phpbb_root_path . 'includes/acp/acp_modules.' . $phpEx); @@ -1071,6 +1080,18 @@ function database_update_info() '3.0.10-RC3' => array(), // No changes from 3.0.10 to 3.0.11-RC1 '3.0.10' => array(), + // Changes from 3.0.11-RC1 to 3.0.11-RC2 + '3.0.11-RC1' => array( + 'add_columns' => array( + PROFILE_FIELDS_TABLE => array( + 'field_show_novalue' => array('BOOL', 0), + ), + ), + ), + // No changes from 3.0.11-RC2 to 3.0.11 + '3.0.11-RC2' => array(), + // No changes from 3.0.11 to 3.0.12-RC1 + '3.0.11' => array(), /** @todo DROP LOGIN_ATTEMPT_TABLE.attempt_id in 3.0.12-RC1 */ @@ -1102,13 +1123,18 @@ function database_update_info() 'style_parent_tree' => array('TEXT', ''), ), REPORTS_TABLE => array( - 'reported_post_text' => array('MTEXT_UNI', ''), + 'reported_post_text' => array('MTEXT_UNI', ''), + 'reported_post_uid' => array('VCHAR:8', ''), + 'reported_post_bitfield' => array('VCHAR:255', ''), ), ), 'change_columns' => array( GROUPS_TABLE => array( 'group_legend' => array('UINT', 0), ), + USERS_TABLE => array( + 'user_timezone' => array('VCHAR:100', ''), + ), ), ), ); @@ -1123,6 +1149,8 @@ function change_database_data(&$no_updates, $version) { global $db, $errored, $error_ary, $config, $phpbb_root_path, $phpEx, $db_tools; + $update_helpers = new phpbb_update_helpers(); + switch ($version) { case '3.0.0': @@ -1968,7 +1996,7 @@ function change_database_data(&$no_updates, $version) 'user_email' => '', 'user_lang' => $config['default_lang'], 'user_style' => $config['default_style'], - 'user_timezone' => 0, + 'user_timezone' => 'UTC', 'user_dateformat' => $config['default_dateformat'], 'user_allow_massemail' => 0, ); @@ -2205,6 +2233,99 @@ function change_database_data(&$no_updates, $version) $no_updates = false; break; + // No changes from 3.0.11-RC1 to 3.0.11-RC2 + case '3.0.11-RC1': + break; + + // No changes from 3.0.11-RC2 to 3.0.11 + case '3.0.11-RC2': + break; + + // Changes from 3.0.11 to 3.0.12-RC1 + case '3.0.11': + $sql = 'UPDATE ' . MODULES_TABLE . ' + SET module_auth = \'acl_u_sig\' + WHERE module_class = \'ucp\' + AND module_basename = \'profile\' + AND module_mode = \'signature\''; + _sql($sql, $errored, $error_ary); + + // Update bots + if (!function_exists('user_delete')) + { + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + } + + $bots_updates = array( + // Bot Deletions + 'NG-Search [Bot]' => false, + 'Nutch/CVS [Bot]' => false, + 'OmniExplorer [Bot]' => false, + 'Seekport [Bot]' => false, + 'Synoo [Bot]' => false, + 'WiseNut [Bot]' => false, + + // Bot Updates + // Bot name to bot user agent map + 'Baidu [Spider]' => 'Baiduspider', + 'Exabot [Bot]' => 'Exabot', + 'Voyager [Bot]' => 'voyager/', + 'W3C [Validator]' => 'W3C_Validator', + ); + + foreach ($bots_updates as $bot_name => $bot_agent) + { + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . ' + WHERE user_type = ' . USER_IGNORE . " + AND username_clean = '" . $db->sql_escape(utf8_clean_string($bot_name)) . "'"; + $result = $db->sql_query($sql); + $bot_user_id = (int) $db->sql_fetchfield('user_id'); + $db->sql_freeresult($result); + + if ($bot_user_id) + { + if ($bot_agent === false) + { + $sql = 'DELETE FROM ' . BOTS_TABLE . " + WHERE user_id = $bot_user_id"; + _sql($sql, $errored, $error_ary); + + user_delete('remove', $bot_user_id); + } + else + { + $sql = 'UPDATE ' . BOTS_TABLE . " + SET bot_agent = '" . $db->sql_escape($bot_agent) . "' + WHERE user_id = $bot_user_id"; + _sql($sql, $errored, $error_ary); + } + } + } + + // Disable receiving pms for bots + $sql = 'SELECT user_id + FROM ' . BOTS_TABLE; + $result = $db->sql_query($sql); + + $bot_user_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $bot_user_ids[] = (int) $row['user_id']; + } + $db->sql_freeresult($result); + + if (!empty($bot_user_ids)) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_allow_pm = 0 + WHERE ' . $db->sql_in_set('user_id', $bot_user_ids); + _sql($sql, $errored, $error_ary); + } + + $no_updates = false; + break; + // Changes from 3.1.0-dev to 3.1.0-A1 case '3.1.0-dev': @@ -2245,6 +2366,31 @@ function change_database_data(&$no_updates, $version) set_config('search_type', 'phpbb_search_' . $config['search_type']); } + if (!isset($config['fulltext_postgres_ts_name'])) + { + set_config('fulltext_postgres_ts_name', 'simple'); + } + + if (!isset($config['fulltext_postgres_min_word_len'])) + { + set_config('fulltext_postgres_min_word_len', 4); + } + + if (!isset($config['fulltext_postgres_max_word_len'])) + { + set_config('fulltext_postgres_max_word_len', 254); + } + + if (!isset($config['fulltext_sphinx_stopwords'])) + { + set_config('fulltext_sphinx_stopwords', 0); + } + + if (!isset($config['fulltext_sphinx_indexer_mem_limit'])) + { + set_config('fulltext_sphinx_indexer_mem_limit', 512); + } + if (!isset($config['load_jquery_cdn'])) { set_config('load_jquery_cdn', 0); @@ -2581,17 +2727,119 @@ function change_database_data(&$no_updates, $version) // Create config value for displaying last subject on forum list if (!isset($config['display_last_subject'])) - { + { $config->set('display_last_subject', '1'); } - - $no_updates = false; if (!isset($config['assets_version'])) { $config->set('assets_version', '1'); } + // If the column exists, we did not yet update the users timezone + if ($db_tools->sql_column_exists(USERS_TABLE, 'user_dst')) + { + // Update user timezones + $sql = 'SELECT user_dst, user_timezone + FROM ' . USERS_TABLE . ' + GROUP BY user_timezone, user_dst'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_timezone = '" . $db->sql_escape($update_helpers->convert_phpbb30_timezone($row['user_timezone'], $row['user_dst'])) . "' + WHERE user_timezone = '" . $db->sql_escape($row['user_timezone']) . "' + AND user_dst = " . (int) $row['user_dst']; + _sql($sql, $errored, $error_ary); + } + $db->sql_freeresult($result); + + // Update board default timezone + set_config('board_timezone', $update_helpers->convert_phpbb30_timezone($config['board_timezone'], $config['board_dst'])); + + // After we have calculated the timezones we can delete user_dst column from user table. + $db_tools->sql_column_remove(USERS_TABLE, 'user_dst'); + } + + if (!isset($config['site_home_url'])) + { + $config->set('site_home_url', ''); + $config->set('site_home_text', ''); + } + + // PHPBB3-10601: Make inbox default. Add basename to ucp's pm category + + // Get the category wanted while checking, at the same time, if this has already been applied + $sql = 'SELECT module_id, module_basename + FROM ' . MODULES_TABLE . " + WHERE module_basename <> 'ucp_pm' AND + module_langname='UCP_PM' + "; + $result = $db->sql_query_limit($sql, 1); + + if ($row = $db->sql_fetchrow($result)) + { + // This update is still not applied. Applying it + + $sql = 'UPDATE ' . MODULES_TABLE . " + SET module_basename = 'ucp_pm' + WHERE module_id = " . (int) $row['module_id']; + + _sql($sql, $errored, $error_ary); + } + $db->sql_freeresult($result); + + // Add new permission u_chgprofileinfo and duplicate settings from u_sig + include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx); + $auth_admin = new auth_admin(); + + // Only add the new permission if it does not already exist + if (empty($auth_admin->acl_options['id']['u_chgprofileinfo'])) + { + $auth_admin->acl_add_option(array('global' => array('u_chgprofileinfo'))); + + // Now the tricky part, filling the permission + $old_id = $auth_admin->acl_options['id']['u_sig']; + $new_id = $auth_admin->acl_options['id']['u_chgprofileinfo']; + + $tables = array(ACL_GROUPS_TABLE, ACL_ROLES_DATA_TABLE, ACL_USERS_TABLE); + + foreach ($tables as $table) + { + $sql = 'SELECT * + FROM ' . $table . ' + WHERE auth_option_id = ' . $old_id; + $result = _sql($sql, $errored, $error_ary); + + $sql_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $row['auth_option_id'] = $new_id; + $sql_ary[] = $row; + } + $db->sql_freeresult($result); + + if (sizeof($sql_ary)) + { + $db->sql_multi_insert($table, $sql_ary); + } + } + + // Remove any old permission entries + $auth_admin->acl_clear_prefetch(); + } + + // Update the auth setting for the module + $sql = 'UPDATE ' . MODULES_TABLE . " + SET module_auth = 'acl_u_chgprofileinfo' + WHERE module_class = 'ucp' + AND module_basename = 'ucp_profile' + AND module_mode = 'profile_info'"; + _sql($sql, $errored, $error_ary); + + $no_updates = false; + break; } } diff --git a/phpBB/install/index.php b/phpBB/install/index.php index f992b67bb7..09560946a6 100644 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -7,6 +7,10 @@ * */ +use Symfony\Component\Config\FileLocator; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; + /**#@+ * @ignore */ @@ -17,9 +21,9 @@ define('IN_INSTALL', true); $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); -if (version_compare(PHP_VERSION, '5.3.2') < 0) +if (version_compare(PHP_VERSION, '5.3.3') < 0) { - die('You are running an unsupported PHP version. Please upgrade to PHP 5.3.2 or higher before trying to install phpBB 3.1'); + die('You are running an unsupported PHP version. Please upgrade to PHP 5.3.3 or higher before trying to install phpBB 3.1'); } function phpbb_require_updated($path, $optional = false) @@ -71,7 +75,9 @@ else // Include essential scripts require($phpbb_root_path . 'includes/class_loader.' . $phpEx); + require($phpbb_root_path . 'includes/functions.' . $phpEx); +require($phpbb_root_path . 'includes/functions_container.' . $phpEx); phpbb_require_updated('includes/functions_content.' . $phpEx, true); @@ -79,19 +85,23 @@ include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); require($phpbb_root_path . 'includes/functions_install.' . $phpEx); -$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', $phpbb_root_path . 'ext/', ".$phpEx"); -$phpbb_class_loader_ext->register(); -$phpbb_class_loader = new phpbb_class_loader('phpbb_', $phpbb_root_path . 'includes/', ".$phpEx"); +// Setup class loader first +$phpbb_class_loader = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}includes/", ".$phpEx"); $phpbb_class_loader->register(); +$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', "{$phpbb_root_path}ext/", ".$phpEx"); +$phpbb_class_loader_ext->register(); + +// Set up container +$phpbb_container = phpbb_create_install_container($phpbb_root_path, $phpEx); + +$phpbb_class_loader->set_cache($phpbb_container->get('cache.driver')); +$phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver')); // set up caching -$cache_factory = new phpbb_cache_factory('file'); -$cache = $cache_factory->get_service(); -$phpbb_class_loader_ext->set_cache($cache->get_driver()); -$phpbb_class_loader->set_cache($cache->get_driver()); +$cache = $phpbb_container->get('cache'); -$phpbb_dispatcher = new phpbb_event_dispatcher(); -$request = new phpbb_request(); +$phpbb_dispatcher = $phpbb_container->get('dispatcher'); +$request = $phpbb_container->get('request'); // make sure request_var uses this request instance request_var('', 0, false, false, $request); // "dependency injection" for a function @@ -202,7 +212,7 @@ $config = new phpbb_config(array( $phpbb_style_resource_locator = new phpbb_style_resource_locator(); $phpbb_style_path_provider = new phpbb_style_path_provider(); -$template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $phpbb_style_resource_locator); +$template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $phpbb_style_resource_locator, new phpbb_template_context()); $phpbb_style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $phpbb_style_resource_locator, $phpbb_style_path_provider, $template); $phpbb_style->set_ext_dir_prefix('adm/'); $phpbb_style->set_custom_style('admin', '../adm/style', ''); @@ -355,6 +365,7 @@ class module $template->assign_vars(array( 'L_CHANGE' => $lang['CHANGE'], + 'L_COLON' => $lang['COLON'], 'L_INSTALL_PANEL' => $lang['INSTALL_PANEL'], 'L_SELECT_LANG' => $lang['SELECT_LANG'], 'L_SKIP' => $lang['SKIP'], @@ -583,7 +594,7 @@ class module echo ' </div>'; echo ' </div>'; echo ' <div id="page-footer">'; - echo ' Powered by <a href="http://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Group'; + echo ' Powered by <a href="https://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Group'; echo ' </div>'; echo '</div>'; echo '</body>'; diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index db974f9903..41de9de44c 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -569,7 +569,7 @@ class install_convert extends module */ function convert_data($sub) { - global $template, $user, $phpbb_root_path, $phpEx, $db, $lang, $config, $cache; + global $template, $user, $phpbb_root_path, $phpEx, $db, $lang, $config, $cache, $auth; global $convert, $convert_row, $message_parser, $skip_rows, $language; global $request; @@ -750,7 +750,7 @@ class install_convert extends module } $error = false; - $convert->fulltext_search = new $search_type($error); + $convert->fulltext_search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user); if ($error) { @@ -933,7 +933,7 @@ class install_convert extends module } else if (sizeof($missing_tables)) { - $this->p_master->error(sprintf($user->lang['TABLES_MISSING'], implode(', ', $missing_tables)) . '<br /><br />' . $user->lang['CHECK_TABLE_PREFIX'], __LINE__, __FILE__); + $this->p_master->error(sprintf($user->lang['TABLES_MISSING'], implode($user->lang['COMMA_SEPARATOR'], $missing_tables)) . '<br /><br />' . $user->lang['CHECK_TABLE_PREFIX'], __LINE__, __FILE__); } $url = $this->save_convert_progress('&confirm=1'); @@ -1196,7 +1196,7 @@ class install_convert extends module $template->assign_block_vars('checks', array( 'TITLE' => "skip_rows = $skip_rows", - 'RESULT' => $rows . ((defined('DEBUG_EXTRA') && function_exists('memory_get_usage')) ? ceil(memory_get_usage()/1024) . ' ' . $user->lang['KIB'] : ''), + 'RESULT' => $rows . ((defined('DEBUG') && function_exists('memory_get_usage')) ? ceil(memory_get_usage()/1024) . ' ' . $user->lang['KIB'] : ''), )); $mtime = explode(' ', microtime()); @@ -1380,7 +1380,7 @@ class install_convert extends module } // When we reach this point, either the current table has been processed or we're running out of time. - if (still_on_time() && $counting < $convert->batch_size/* && !defined('DEBUG_EXTRA')*/) + if (still_on_time() && $counting < $convert->batch_size/* && !defined('DEBUG')*/) { $skip_rows = 0; $current_table++; @@ -1469,7 +1469,7 @@ class install_convert extends module sync('topic', 'range', 'topic_id BETWEEN ' . $sync_batch . ' AND ' . $end, true, true); $template->assign_block_vars('checks', array( - 'TITLE' => sprintf($user->lang['SYNC_TOPIC_ID'], $sync_batch, ($sync_batch + $batch_size)) . ((defined('DEBUG_EXTRA') && function_exists('memory_get_usage')) ? ' [' . ceil(memory_get_usage()/1024) . ' ' . $user->lang['KIB'] . ']' : ''), + 'TITLE' => sprintf($user->lang['SYNC_TOPIC_ID'], $sync_batch, ($sync_batch + $batch_size)) . ((defined('DEBUG') && function_exists('memory_get_usage')) ? ' [' . ceil(memory_get_usage()/1024) . ' ' . $user->lang['KIB'] . ']' : ''), 'RESULT' => $user->lang['DONE'], )); @@ -1757,7 +1757,7 @@ class install_convert extends module global $convert; // Can we use IGNORE with this DBMS? - $sql_ignore = (strpos($db->sql_layer, 'mysql') === 0 && !defined('DEBUG_EXTRA')) ? 'IGNORE ' : ''; + $sql_ignore = (strpos($db->sql_layer, 'mysql') === 0 && !defined('DEBUG')) ? 'IGNORE ' : ''; $insert_query = 'INSERT ' . $sql_ignore . 'INTO ' . $schema['target'] . ' ('; $aliases = array(); diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index ef384edb78..4b2fa046bc 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -143,7 +143,7 @@ class install_install extends module // Test the minimum PHP version $php_version = PHP_VERSION; - if (version_compare($php_version, '5.3.2') < 0) + if (version_compare($php_version, '5.3.3') < 0) { $result = '<strong style="color:red">' . $lang['NO'] . '</strong>'; } @@ -250,7 +250,7 @@ class install_install extends module 'S_EXPLAIN' => true, 'S_LEGEND' => false, )); - + // Check for php json support if (@extension_loaded('json')) { @@ -271,14 +271,6 @@ class install_install extends module 'S_LEGEND' => false, )); -/** -* Better not enabling and adding to the loaded extensions due to the specific requirements needed - if (!@extension_loaded('mbstring')) - { - can_load_dll('mbstring'); - } -*/ - $passed['mbstring'] = true; if (@extension_loaded('mbstring')) { @@ -382,17 +374,14 @@ class install_install extends module { if (!@extension_loaded($dll)) { - if (!can_load_dll($dll)) - { - $template->assign_block_vars('checks', array( - 'TITLE' => $lang['DLL_' . strtoupper($dll)], - 'RESULT' => '<strong style="color:red">' . $lang['UNAVAILABLE'] . '</strong>', + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['DLL_' . strtoupper($dll)], + 'RESULT' => '<strong style="color:red">' . $lang['UNAVAILABLE'] . '</strong>', - 'S_EXPLAIN' => false, - 'S_LEGEND' => false, - )); - continue; - } + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + continue; } $template->assign_block_vars('checks', array( @@ -873,22 +862,7 @@ class install_install extends module $written = false; // Create a list of any PHP modules we wish to have loaded - $load_extensions = array(); $available_dbms = get_available_dbms($data['dbms']); - $check_exts = array_merge(array($available_dbms[$data['dbms']]['MODULE']), $this->php_dlls_other); - - foreach ($check_exts as $dll) - { - if (!@extension_loaded($dll)) - { - if (!can_load_dll($dll)) - { - continue; - } - - $load_extensions[] = $dll . '.' . PHP_SHLIB_SUFFIX; - } - } // Create a lock file to indicate that there is an install in progress $fp = @fopen($phpbb_root_path . 'cache/install_lock', 'wb'); @@ -902,7 +876,7 @@ class install_install extends module @chmod($phpbb_root_path . 'cache/install_lock', 0777); // Time to convert the data provided into a config file - $config_data = phpbb_create_config_file_data($data, $available_dbms[$data['dbms']]['DRIVER'], $load_extensions); + $config_data = phpbb_create_config_file_data($data, $available_dbms[$data['dbms']]['DRIVER']); // Attempt to write out the config file directly. If it works, this is the easiest way to do it ... if ((file_exists($phpbb_root_path . 'config.' . $phpEx) && phpbb_is_writable($phpbb_root_path . 'config.' . $phpEx)) || phpbb_is_writable($phpbb_root_path)) @@ -1178,7 +1152,7 @@ class install_install extends module $sql_query = preg_replace('#phpbb_#i', $data['table_prefix'], $sql_query); - $sql_query = remove_comments($sql_query); + $sql_query = phpbb_remove_comments($sql_query); $sql_query = split_sql_file($sql_query, $delimiter); @@ -1216,7 +1190,7 @@ class install_install extends module // Change language strings... $sql_query = preg_replace_callback('#\{L_([A-Z0-9\-_]*)\}#s', 'adjust_language_keys_callback', $sql_query); - $sql_query = remove_comments($sql_query); + $sql_query = phpbb_remove_comments($sql_query); $sql_query = split_sql_file($sql_query, ';'); foreach ($sql_query as $sql) @@ -1368,7 +1342,7 @@ class install_install extends module WHERE config_name = 'dbms_version'", ); - if (@extension_loaded('gd') || can_load_dll('gd')) + if (@extension_loaded('gd')) { $sql_ary[] = 'UPDATE ' . $data['table_prefix'] . "config SET config_value = 'phpbb_captcha_gd' @@ -1427,7 +1401,7 @@ class install_install extends module */ function build_search_index($mode, $sub) { - global $db, $lang, $phpbb_root_path, $phpEx, $config; + global $db, $lang, $phpbb_root_path, $phpEx, $config, $auth, $user; // Obtain any submitted data $data = $this->get_submitted_data(); @@ -1463,7 +1437,7 @@ class install_install extends module set_config_count(null, null, null, $config); $error = false; - $search = new phpbb_search_fulltext_native($error); + $search = new phpbb_search_fulltext_native($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user); $sql = 'SELECT post_id, post_subject, post_text, poster_id, forum_id FROM ' . POSTS_TABLE; @@ -1481,12 +1455,12 @@ class install_install extends module */ function add_modules($mode, $sub) { - global $db, $lang, $phpbb_root_path, $phpEx, $phpbb_extension_manager; + global $db, $lang, $phpbb_root_path, $phpEx, $phpbb_extension_manager, $config; // modules require an extension manager if (empty($phpbb_extension_manager)) { - $phpbb_extension_manager = new phpbb_extension_manager($db, EXT_TABLE, $phpbb_root_path, ".$phpEx"); + $phpbb_extension_manager = new phpbb_extension_manager($db, $config, EXT_TABLE, $phpbb_root_path, ".$phpEx"); } include_once($phpbb_root_path . 'includes/acp/acp_modules.' . $phpEx); @@ -1504,8 +1478,14 @@ class install_install extends module foreach ($this->module_categories[$module_class] as $cat_name => $subs) { + $basename = ''; + // Check if this sub-category has a basename. If it has, use it. + if (isset($this->module_categories_basenames[$cat_name])) + { + $basename = $this->module_categories_basenames[$cat_name]; + } $module_data = array( - 'module_basename' => '', + 'module_basename' => $basename, 'module_enabled' => 1, 'module_display' => 1, 'parent_id' => 0, @@ -1533,8 +1513,14 @@ class install_install extends module { foreach ($subs as $level2_name) { + $basename = ''; + // Check if this sub-category has a basename. If it has, use it. + if (isset($this->module_categories_basenames[$level2_name])) + { + $basename = $this->module_categories_basenames[$level2_name]; + } $module_data = array( - 'module_basename' => '', + 'module_basename' => $basename, 'module_enabled' => 1, 'module_display' => 1, 'parent_id' => (int) $categories[$cat_name]['id'], @@ -1795,9 +1781,10 @@ class install_install extends module 'user_email' => '', 'user_lang' => $data['default_lang'], 'user_style' => 1, - 'user_timezone' => 0, + 'user_timezone' => 'UTC', 'user_dateformat' => $lang['default_dateformat'], 'user_allow_massemail' => 0, + 'user_allow_pm' => 0, ); $user_id = user_add($user_row); @@ -2034,9 +2021,9 @@ class install_install extends module 'Alexa [Bot]' => array('ia_archiver', ''), 'Alta Vista [Bot]' => array('Scooter/', ''), 'Ask Jeeves [Bot]' => array('Ask Jeeves', ''), - 'Baidu [Spider]' => array('Baiduspider+(', ''), - 'Bing [Bot]' => array('bingbot/', ''), - 'Exabot [Bot]' => array('Exabot/', ''), + 'Baidu [Spider]' => array('Baiduspider', ''), + 'Bing [Bot]' => array('bingbot/', ''), + 'Exabot [Bot]' => array('Exabot', ''), 'FAST Enterprise [Crawler]' => array('FAST Enterprise Crawler', ''), 'FAST WebCrawler [Crawler]' => array('FAST-WebCrawler/', ''), 'Francis [Bot]' => array('http://www.neomo.de/', ''), @@ -2055,27 +2042,21 @@ class install_install extends module 'MSN NewsBlogs' => array('msnbot-NewsBlogs/', ''), 'MSN [Bot]' => array('msnbot/', ''), 'MSNbot Media' => array('msnbot-media/', ''), - 'NG-Search [Bot]' => array('NG-Search/', ''), 'Nutch [Bot]' => array('http://lucene.apache.org/nutch/', ''), - 'Nutch/CVS [Bot]' => array('NutchCVS/', ''), - 'OmniExplorer [Bot]' => array('OmniExplorer_Bot/', ''), 'Online link [Validator]' => array('online link validator', ''), 'psbot [Picsearch]' => array('psbot/0', ''), - 'Seekport [Bot]' => array('Seekbot/', ''), 'Sensis [Crawler]' => array('Sensis Web Crawler', ''), 'SEO Crawler' => array('SEO search Crawler/', ''), 'Seoma [Crawler]' => array('Seoma [SEO Crawler]', ''), 'SEOSearch [Crawler]' => array('SEOsearch/', ''), 'Snappy [Bot]' => array('Snappy/1.1 ( http://www.urltrends.com/ )', ''), 'Steeler [Crawler]' => array('http://www.tkl.iis.u-tokyo.ac.jp/~crawler/', ''), - 'Synoo [Bot]' => array('SynooBot/', ''), 'Telekom [Bot]' => array('crawleradmin.t-info@telekom.de', ''), 'TurnitinBot [Bot]' => array('TurnitinBot/', ''), - 'Voyager [Bot]' => array('voyager/1.0', ''), + 'Voyager [Bot]' => array('voyager/', ''), 'W3 [Sitesearch]' => array('W3 SiteSearch Crawler', ''), 'W3C [Linkcheck]' => array('W3C-checklink/', ''), - 'W3C [Validator]' => array('W3C_*Validator', ''), - 'WiseNut [Bot]' => array('http://www.WISEnutbot.com', ''), + 'W3C [Validator]' => array('W3C_Validator', ''), 'YaCy [Bot]' => array('yacybot', ''), 'Yahoo MMCrawler [Bot]' => array('Yahoo-MMCrawler/', ''), 'Yahoo Slurp [Bot]' => array('Yahoo! DE Slurp', ''), @@ -2147,6 +2128,9 @@ class install_install extends module 'UCP_ZEBRA' => null, ), ); + var $module_categories_basenames = array( + 'UCP_PM' => 'ucp_pm', + ); var $module_extras = array( 'acp' => array( diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index c2feaa086a..7f40015002 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -71,7 +71,7 @@ class install_update extends module function main($mode, $sub) { - global $style, $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth, $language; + global $phpbb_style, $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth, $language; global $request; $this->tpl_name = 'install_update'; @@ -349,7 +349,7 @@ class install_update extends module // We are directly within an update. To make sure our update list is correct we check its status. $update_list = ($request->variable('check_again', false, false, phpbb_request_interface::POST)) ? false : $cache->get('_update_list'); - $modified = ($update_list !== false) ? @filemtime($cache->cache_dir . 'data_update_list.' . $phpEx) : 0; + $modified = ($update_list !== false) ? @filemtime($cache->get_driver()->cache_dir . 'data_update_list.' . $phpEx) : 0; // Make sure the list is up-to-date if ($update_list !== false) @@ -862,7 +862,14 @@ class install_update extends module $test_connection = false; if ($test_ftp_connection || $submit) { - $transfer = new $method(request_var('host', ''), request_var('username', ''), request_var('password', ''), request_var('root_path', ''), request_var('port', ''), request_var('timeout', '')); + $transfer = new $method( + request_var('host', ''), + request_var('username', ''), + htmlspecialchars_decode($request->untrimmed_variable('password', '')), + request_var('root_path', ''), + request_var('port', ''), + request_var('timeout', '') + ); $test_connection = $transfer->open_session(); // Make sure that the directory is correct by checking for the existence of common.php @@ -948,7 +955,14 @@ class install_update extends module } else { - $transfer = new $method(request_var('host', ''), request_var('username', ''), request_var('password', ''), request_var('root_path', ''), request_var('port', ''), request_var('timeout', '')); + $transfer = new $method( + request_var('host', ''), + request_var('username', ''), + htmlspecialchars_decode($request->untrimmed_variable('password', '')), + request_var('root_path', ''), + request_var('port', ''), + request_var('timeout', '') + ); $transfer->open_session(); } diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 51565ef2d4..767ce68b4a 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -818,6 +818,7 @@ CREATE TABLE phpbb_profile_fields ( field_default_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, field_validation VARCHAR(20) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, field_required INTEGER DEFAULT 0 NOT NULL, + field_show_novalue INTEGER DEFAULT 0 NOT NULL, field_show_on_reg INTEGER DEFAULT 0 NOT NULL, field_show_on_pm INTEGER DEFAULT 0 NOT NULL, field_show_on_vt INTEGER DEFAULT 0 NOT NULL, @@ -910,7 +911,9 @@ CREATE TABLE phpbb_reports ( report_closed INTEGER DEFAULT 0 NOT NULL, report_time INTEGER DEFAULT 0 NOT NULL, report_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - reported_post_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL + reported_post_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, + reported_post_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + reported_post_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL );; ALTER TABLE phpbb_reports ADD PRIMARY KEY (report_id);; @@ -1242,8 +1245,7 @@ CREATE TABLE phpbb_users ( user_inactive_time INTEGER DEFAULT 0 NOT NULL, user_posts INTEGER DEFAULT 0 NOT NULL, user_lang VARCHAR(30) CHARACTER SET NONE DEFAULT '' NOT NULL, - user_timezone DOUBLE PRECISION DEFAULT 0 NOT NULL, - user_dst INTEGER DEFAULT 0 NOT NULL, + user_timezone VARCHAR(100) CHARACTER SET NONE DEFAULT 'UTC' NOT NULL, user_dateformat VARCHAR(30) CHARACTER SET UTF8 DEFAULT 'd M Y H:i' NOT NULL COLLATE UNICODE, user_style INTEGER DEFAULT 0 NOT NULL, user_rank INTEGER DEFAULT 0 NOT NULL, diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 2c78dd009f..84c975942f 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -992,6 +992,7 @@ CREATE TABLE [phpbb_profile_fields] ( [field_default_value] [varchar] (255) DEFAULT ('') NOT NULL , [field_validation] [varchar] (20) DEFAULT ('') NOT NULL , [field_required] [int] DEFAULT (0) NOT NULL , + [field_show_novalue] [int] DEFAULT (0) NOT NULL , [field_show_on_reg] [int] DEFAULT (0) NOT NULL , [field_show_on_pm] [int] DEFAULT (0) NOT NULL , [field_show_on_vt] [int] DEFAULT (0) NOT NULL , @@ -1109,7 +1110,9 @@ CREATE TABLE [phpbb_reports] ( [report_closed] [int] DEFAULT (0) NOT NULL , [report_time] [int] DEFAULT (0) NOT NULL , [report_text] [text] DEFAULT ('') NOT NULL , - [reported_post_text] [text] DEFAULT ('') NOT NULL + [reported_post_text] [text] DEFAULT ('') NOT NULL , + [reported_post_bitfield] [varchar] (255) DEFAULT ('') NOT NULL , + [reported_post_uid] [varchar] (8) DEFAULT ('') NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO @@ -1526,8 +1529,7 @@ CREATE TABLE [phpbb_users] ( [user_inactive_time] [int] DEFAULT (0) NOT NULL , [user_posts] [int] DEFAULT (0) NOT NULL , [user_lang] [varchar] (30) DEFAULT ('') NOT NULL , - [user_timezone] [float] DEFAULT (0) NOT NULL , - [user_dst] [int] DEFAULT (0) NOT NULL , + [user_timezone] [varchar] (100) DEFAULT ('UTC') NOT NULL , [user_dateformat] [varchar] (30) DEFAULT ('d M Y H:i') NOT NULL , [user_style] [int] DEFAULT (0) NOT NULL , [user_rank] [int] DEFAULT (0) NOT NULL , diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index d19f1930d0..8aab949103 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -582,6 +582,7 @@ CREATE TABLE phpbb_profile_fields ( field_default_value blob NOT NULL, field_validation varbinary(60) DEFAULT '' NOT NULL, field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + field_show_novalue tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_show_on_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_show_on_vt tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, @@ -648,6 +649,8 @@ CREATE TABLE phpbb_reports ( report_time int(11) UNSIGNED DEFAULT '0' NOT NULL, report_text mediumblob NOT NULL, reported_post_text mediumblob NOT NULL, + reported_post_bitfield varbinary(255) DEFAULT '' NOT NULL, + reported_post_uid varbinary(8) DEFAULT '' NOT NULL, PRIMARY KEY (report_id), KEY post_id (post_id), KEY pm_id (pm_id) @@ -890,8 +893,7 @@ CREATE TABLE phpbb_users ( user_inactive_time int(11) UNSIGNED DEFAULT '0' NOT NULL, user_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_lang varbinary(30) DEFAULT '' NOT NULL, - user_timezone decimal(5,2) DEFAULT '0' NOT NULL, - user_dst tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + user_timezone varbinary(100) DEFAULT 'UTC' NOT NULL, user_dateformat varbinary(90) DEFAULT 'd M Y H:i' NOT NULL, user_style mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_rank mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 3fd8d4f1d1..04aef2844a 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -582,6 +582,7 @@ CREATE TABLE phpbb_profile_fields ( field_default_value varchar(255) DEFAULT '' NOT NULL, field_validation varchar(20) DEFAULT '' NOT NULL, field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + field_show_novalue tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_show_on_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_show_on_vt tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, @@ -648,6 +649,8 @@ CREATE TABLE phpbb_reports ( report_time int(11) UNSIGNED DEFAULT '0' NOT NULL, report_text mediumtext NOT NULL, reported_post_text mediumtext NOT NULL, + reported_post_bitfield varchar(255) DEFAULT '' NOT NULL, + reported_post_uid varchar(8) DEFAULT '' NOT NULL, PRIMARY KEY (report_id), KEY post_id (post_id), KEY pm_id (pm_id) @@ -890,8 +893,7 @@ CREATE TABLE phpbb_users ( user_inactive_time int(11) UNSIGNED DEFAULT '0' NOT NULL, user_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_lang varchar(30) DEFAULT '' NOT NULL, - user_timezone decimal(5,2) DEFAULT '0' NOT NULL, - user_dst tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + user_timezone varchar(100) DEFAULT 'UTC' NOT NULL, user_dateformat varchar(30) DEFAULT 'd M Y H:i' NOT NULL, user_style mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_rank mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 8a0f3e56b1..91f906bc8b 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -1100,6 +1100,7 @@ CREATE TABLE phpbb_profile_fields ( field_default_value varchar2(765) DEFAULT '' , field_validation varchar2(60) DEFAULT '' , field_required number(1) DEFAULT '0' NOT NULL, + field_show_novalue number(1) DEFAULT '0' NOT NULL, field_show_on_reg number(1) DEFAULT '0' NOT NULL, field_show_on_pm number(1) DEFAULT '0' NOT NULL, field_show_on_vt number(1) DEFAULT '0' NOT NULL, @@ -1215,6 +1216,8 @@ CREATE TABLE phpbb_reports ( report_time number(11) DEFAULT '0' NOT NULL, report_text clob DEFAULT '' , reported_post_text clob DEFAULT '' , + reported_post_bitfield varchar2(255) DEFAULT '' , + reported_post_uid varchar2(8) DEFAULT '' , CONSTRAINT pk_phpbb_reports PRIMARY KEY (report_id) ) / @@ -1638,8 +1641,7 @@ CREATE TABLE phpbb_users ( user_inactive_time number(11) DEFAULT '0' NOT NULL, user_posts number(8) DEFAULT '0' NOT NULL, user_lang varchar2(30) DEFAULT '' , - user_timezone number(5, 2) DEFAULT '0' NOT NULL, - user_dst number(1) DEFAULT '0' NOT NULL, + user_timezone varchar2(100) DEFAULT 'UTC' NOT NULL, user_dateformat varchar2(90) DEFAULT 'd M Y H:i' NOT NULL, user_style number(8) DEFAULT '0' NOT NULL, user_rank number(8) DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index c624024362..619985e0d6 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -774,6 +774,7 @@ CREATE TABLE phpbb_profile_fields ( field_default_value varchar(255) DEFAULT '' NOT NULL, field_validation varchar(20) DEFAULT '' NOT NULL, field_required INT2 DEFAULT '0' NOT NULL CHECK (field_required >= 0), + field_show_novalue INT2 DEFAULT '0' NOT NULL CHECK (field_show_novalue >= 0), field_show_on_reg INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_reg >= 0), field_show_on_pm INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_pm >= 0), field_show_on_vt INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_vt >= 0), @@ -854,6 +855,8 @@ CREATE TABLE phpbb_reports ( report_time INT4 DEFAULT '0' NOT NULL CHECK (report_time >= 0), report_text TEXT DEFAULT '' NOT NULL, reported_post_text TEXT DEFAULT '' NOT NULL, + reported_post_bitfield varchar(255) DEFAULT '' NOT NULL, + reported_post_uid varchar(8) DEFAULT '' NOT NULL, PRIMARY KEY (report_id) ); @@ -1140,8 +1143,7 @@ CREATE TABLE phpbb_users ( user_inactive_time INT4 DEFAULT '0' NOT NULL CHECK (user_inactive_time >= 0), user_posts INT4 DEFAULT '0' NOT NULL CHECK (user_posts >= 0), user_lang varchar(30) DEFAULT '' NOT NULL, - user_timezone decimal(5,2) DEFAULT '0' NOT NULL, - user_dst INT2 DEFAULT '0' NOT NULL CHECK (user_dst >= 0), + user_timezone varchar(100) DEFAULT 'UTC' NOT NULL, user_dateformat varchar(30) DEFAULT 'd M Y H:i' NOT NULL, user_style INT4 DEFAULT '0' NOT NULL CHECK (user_style >= 0), user_rank INT4 DEFAULT '0' NOT NULL CHECK (user_rank >= 0), diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 5489fd4e3d..7c1a7d40f5 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -54,12 +54,11 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_salt', 'php INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_contact', 'contact@yourdomain.tld'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_disable', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_disable_msg', ''); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_dst', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email', 'address@yourdomain.tld'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email_form', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email_sig', '{L_CONFIG_BOARD_EMAIL_SIG}'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_hide_emails', '1'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_timezone', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_timezone', 'UTC'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('browser_check', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('bump_interval', '10'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('bump_type', 'd'); @@ -125,6 +124,11 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_co INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_load_upd', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_max_chars', '14'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_min_chars', '3'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_postgres_max_word_len', '254'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_postgres_min_word_len', '4'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_postgres_ts_name', 'simple'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_sphinx_indexer_mem_limit', '512'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_sphinx_stopwords', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('gzip_compress', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('hot_threshold', '25'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('icons_path', 'images/icons'); @@ -238,6 +242,8 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_protocol', INSERT INTO phpbb_config (config_name, config_value) VALUES ('session_gc', '3600'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('session_length', '3600'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_desc', '{L_CONFIG_SITE_DESC}'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_home_url', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_home_text', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('sitename', '{L_CONFIG_SITENAME}'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('smilies_path', 'images/smilies'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('smilies_per_page', '50'); @@ -341,6 +347,7 @@ INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_board', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_bots', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_clearlogs', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_email', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_extensions', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_fauth', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_forum', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_forumadd', 1); @@ -380,6 +387,7 @@ INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgemail', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chggrp', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgname', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgpasswd', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgprofileinfo', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_download', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_hideonline', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_ignoreflood', 1); @@ -541,7 +549,7 @@ INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 22, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_attach', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_sticky', 'f_user_lock', 'f_votechg'); # New Member (u_) -INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 23, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_sendpm', 'u_masspm', 'u_masspm_group'); +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 23, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_sendpm', 'u_masspm', 'u_masspm_group', 'u_chgprofileinfo'); # New Member (f_) INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 24, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_noapprove'); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index bd002c93ed..1690a7dcab 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -565,6 +565,7 @@ CREATE TABLE phpbb_profile_fields ( field_default_value varchar(255) NOT NULL DEFAULT '', field_validation varchar(20) NOT NULL DEFAULT '', field_required INTEGER UNSIGNED NOT NULL DEFAULT '0', + field_show_novalue INTEGER UNSIGNED NOT NULL DEFAULT '0', field_show_on_reg INTEGER UNSIGNED NOT NULL DEFAULT '0', field_show_on_pm INTEGER UNSIGNED NOT NULL DEFAULT '0', field_show_on_vt INTEGER UNSIGNED NOT NULL DEFAULT '0', @@ -628,7 +629,9 @@ CREATE TABLE phpbb_reports ( report_closed INTEGER UNSIGNED NOT NULL DEFAULT '0', report_time INTEGER UNSIGNED NOT NULL DEFAULT '0', report_text mediumtext(16777215) NOT NULL DEFAULT '', - reported_post_text mediumtext(16777215) NOT NULL DEFAULT '' + reported_post_text mediumtext(16777215) NOT NULL DEFAULT '', + reported_post_bitfield varchar(255) NOT NULL DEFAULT '', + reported_post_uid varchar(8) NOT NULL DEFAULT '' ); CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id); @@ -864,8 +867,7 @@ CREATE TABLE phpbb_users ( user_inactive_time INTEGER UNSIGNED NOT NULL DEFAULT '0', user_posts INTEGER UNSIGNED NOT NULL DEFAULT '0', user_lang varchar(30) NOT NULL DEFAULT '', - user_timezone decimal(5,2) NOT NULL DEFAULT '0', - user_dst INTEGER UNSIGNED NOT NULL DEFAULT '0', + user_timezone varchar(100) NOT NULL DEFAULT 'UTC', user_dateformat varchar(30) NOT NULL DEFAULT 'd M Y H:i', user_style INTEGER UNSIGNED NOT NULL DEFAULT '0', user_rank INTEGER UNSIGNED NOT NULL DEFAULT '0', diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 384bce75bf..1b99c87938 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -45,16 +45,19 @@ $lang = array_merge($lang, array( 'DISABLE_BOARD' => 'Disable board', 'DISABLE_BOARD_EXPLAIN' => 'This will make the board unavailable to users. You can also enter a short (255 character) message to display if you wish.', 'DISPLAY_LAST_SUBJECT' => 'Display subject of last added post on forum list', - 'DISPLAY_LAST_SUBJECT_EXPLAIN' => 'The subject of the last added post will be displayed in the forum list with a hyperlink to the post. Subjects from password protected forums and forums in which user doesn’t have read access are not shown.', + 'DISPLAY_LAST_SUBJECT_EXPLAIN' => 'The subject of the last added post will be displayed in the forum list with a hyperlink to the post. Subjects from password protected forums and forums in which user doesn’t have read access are not shown.', 'OVERRIDE_STYLE' => 'Override user style', 'OVERRIDE_STYLE_EXPLAIN' => 'Replaces user’s style with the default.', 'SITE_DESC' => 'Site description', + 'SITE_HOME_TEXT' => 'Main website text', + 'SITE_HOME_TEXT_EXPLAIN' => 'This text will be displayed as a link to your website homepage in the board’s breadcrumbs. If not specified, it will default to “Home”.', + 'SITE_HOME_URL' => 'Main website URL', + 'SITE_HOME_URL_EXPLAIN' => 'If specified, a link to this URL will be prepended to your board’s breadcrumbs and the board logo will link to this URL instead of the forum index. An absolute URL is required, e.g. <samp>http://www.phpbb.com</samp>.', 'SITE_NAME' => 'Site name', - 'SYSTEM_DST' => 'Enable Summer Time/<abbr title="Daylight Saving Time">DST</abbr>', 'SYSTEM_TIMEZONE' => 'Guest timezone', 'SYSTEM_TIMEZONE_EXPLAIN' => 'Timezone to use for displaying times to users who are not logged in (guests, bots). Logged in users set their timezone during registration and can change it in their user control panel.', 'WARNINGS_EXPIRE' => 'Warning duration', - 'WARNINGS_EXPIRE_EXPLAIN' => 'Number of days that will elapse before the warning will automatically expire from a user’s record. Set this value to 0 to make warnings permanent.', + 'WARNINGS_EXPIRE_EXPLAIN' => 'Number of days that will elapse before a warning will automatically expire from a user’s record. Set this value to 0 to make warnings permanent.', )); // Board Features @@ -446,10 +449,10 @@ $lang = array_merge($lang, array( 'ACP_SECURITY_SETTINGS_EXPLAIN' => 'Here you are able to define session and login related settings.', 'ALL' => 'All', - 'ALLOW_AUTOLOGIN' => 'Allow persistent logins', - 'ALLOW_AUTOLOGIN_EXPLAIN' => 'Determines whether users can autologin when they visit the board.', - 'AUTOLOGIN_LENGTH' => 'Persistent login key expiration length (in days)', - 'AUTOLOGIN_LENGTH_EXPLAIN' => 'Number of days after which persistent login keys are removed or zero to disable.', + 'ALLOW_AUTOLOGIN' => 'Allow "Remember Me" logins', + 'ALLOW_AUTOLOGIN_EXPLAIN' => 'Determines whether users are given "Remember Me" option when they visit the board.', + 'AUTOLOGIN_LENGTH' => '"Remember Me" login key expiration length (in days)', + 'AUTOLOGIN_LENGTH_EXPLAIN' => 'Number of days after which "Remember Me" login keys are removed or zero to disable.', 'BROWSER_VALID' => 'Validate browser', 'BROWSER_VALID_EXPLAIN' => 'Enables browser validation for each session improving security.', 'CHECK_DNSBL' => 'Check IP against DNS Blackhole List', diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index dc35969955..5eb10d50b3 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -81,6 +81,7 @@ $lang = array_merge($lang, array( 'ACP_EMAIL_SETTINGS' => 'Email settings', 'ACP_EXTENSION_GROUPS' => 'Manage extension groups', + 'ACP_EXTENSIONS' => 'Manage board extensions', 'ACP_FORUM_BASED_PERMISSIONS' => 'Forum based permissions', 'ACP_FORUM_LOGS' => 'Forum logs', @@ -401,6 +402,8 @@ $lang = array_merge($lang, array( 'STATISTIC' => 'Statistic', 'STATISTIC_RESYNC_OPTIONS' => 'Resynchronise or reset statistics', + 'TIMEZONE_INVALID' => 'The timezone you selected is invalid.', + 'TIMEZONE_SELECTED' => '(currently selected)', 'TOPICS_PER_DAY' => 'Topics per day', 'UPLOAD_DIR_SIZE' => 'Size of posted attachments', @@ -688,6 +691,7 @@ $lang = array_merge($lang, array( 'LOG_SEARCH_INDEX_CREATED' => '<strong>Created search index for</strong><br />» %s', 'LOG_SEARCH_INDEX_REMOVED' => '<strong>Removed search index for</strong><br />» %s', + 'LOG_SPHINX_ERROR' => '<strong>Sphinx Error</strong><br />» %s', 'LOG_STYLE_ADD' => '<strong>Added new style</strong><br />» %s', 'LOG_STYLE_DELETE' => '<strong>Deleted style</strong><br />» %s', 'LOG_STYLE_EDIT_DETAILS' => '<strong>Edited style</strong><br />» %s', diff --git a/phpBB/language/en/acp/extensions.php b/phpBB/language/en/acp/extensions.php new file mode 100644 index 0000000000..0adaff10c8 --- /dev/null +++ b/phpBB/language/en/acp/extensions.php @@ -0,0 +1,103 @@ +<?php +/** +* +* acp_extensions [English] +* +* @package language +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License +* +*/ +/** +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** +* DO NOT CHANGE +*/ +if (empty($lang) || !is_array($lang)) +{ + $lang = array(); +} + +// DEVELOPERS PLEASE NOTE +// +// Placeholders can now contain order information, e.g. instead of +// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows +// translators to re-order the output of data while ensuring it remains correct +// +// You do not need this where single placeholders are used, e.g. 'Message %d' is fine +// equally where a string contains only two placeholders which are used to wrap text +// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine + + +$lang = array_merge($lang, array( + 'EXTENSION' => 'Extension', + 'EXTENSIONS' => 'Extensions', + 'EXTENSIONS_ADMIN' => 'Extensions Manager', + 'EXTENSIONS_EXPLAIN' => 'The Extensions Manager is a tool in your phpBB Board which allows you to manage all of your extensions statuses and view information about them.', + 'EXTENSION_INVALID_LIST' => 'The "%s" extension is not valid.<br /><p>%s</p>', + 'EXTENSION_NOT_AVAILABLE' => 'The selected extension is not available for this board, please verify your phpBB and PHP versions are allowed (see the details page).', + + 'DETAILS' => 'Details', + + 'AVAILABLE' => 'Available', + 'ENABLED' => 'Enabled', + 'DISABLED' => 'Disabled', + 'PURGED' => 'Purged', + 'UPLOADED' => 'Uploaded', + + 'ENABLE' => 'Enable', + 'DISABLE' => 'Disable', + 'PURGE' => 'Purge', + + 'ENABLE_EXPLAIN' => 'Enabling an extension allows you to use it on your board.', + 'DISABLE_EXPLAIN' => 'Disabling an extension retains its files and settings but removes any functionality added by the extension.', + 'PURGE_EXPLAIN' => 'Purging an extension clears an extensions data while retaining its files.', + 'DELETE_EXPLAIN' => 'Deleting an extension removes all of its files and settings. Log entries will remain, although any language variables added by the extension will not be available.', + + 'DISABLE_IN_PROGRESS' => 'The extension is currently being disabled, please do not leave this page or refresh until it is completed.', + 'ENABLE_IN_PROGRESS' => 'The extension is currently being installed, please do not leave this page or refresh until it is completed.', + 'PURGE_IN_PROGRESS' => 'The extension is currently being purged, please do not leave this page or refresh until it is completed.', + 'ENABLE_SUCCESS' => 'The extension was enabled successfully', + 'DISABLE_SUCCESS' => 'The extension was disabled successfully', + 'PURGE_SUCCESS' => 'The extension was purged successfully', + + 'ENABLE_FAIL' => 'The extension could not be enabled', + 'DISABLE_FAIL' => 'The extension could not be disabled', + 'PURGE_FAIL' => 'The extension could not be purged', + + 'EXTENSION_NAME' => 'Extension Name', + 'EXTENSION_ACTIONS' => 'Actions', + 'EXTENSION_OPTIONS' => 'Options', + + 'ENABLE_CONFIRM' => 'Are you sure that you wish to enable this extension?', + 'DISABLE_CONFIRM' => 'Are you sure that you wish to disable this extension?', + 'PURGE_CONFIRM' => 'Are you sure that you wish to purge this extension's data? This will remove all settings stored for this extension and cannot be undone!', + + 'WARNING' => 'Warning', + 'RETURN' => 'Return', + + 'EXT_DETAILS' => 'Extension Details', + 'DISPLAY_NAME' => 'Display Name', + 'CLEAN_NAME' => 'Clean Name', + 'TYPE' => 'Type', + 'DESCRIPTION' => 'Description', + 'VERSION' => 'Version', + 'HOMEPAGE' => 'Homepage', + 'PATH' => 'File Path', + 'TIME' => 'Release Time', + 'LICENCE' => 'Licence', + + 'REQUIREMENTS' => 'Requirements', + 'PHPBB_VERSION' => 'phpBB Version', + 'PHP_VERSION' => 'PHP Version', + 'AUTHOR_INFORMATION' => 'Author Information', + 'AUTHOR_NAME' => 'Name', + 'AUTHOR_EMAIL' => 'Email', + 'AUTHOR_HOMEPAGE' => 'Homepage', + 'AUTHOR_ROLE' => 'Role', +)); diff --git a/phpBB/language/en/acp/permissions_phpbb.php b/phpBB/language/en/acp/permissions_phpbb.php index 17649693fa..27ef714f8b 100644 --- a/phpBB/language/en/acp/permissions_phpbb.php +++ b/phpBB/language/en/acp/permissions_phpbb.php @@ -102,6 +102,7 @@ $lang = array_merge($lang, array( 'acl_u_chgemail' => array('lang' => 'Can change email address', 'cat' => 'profile'), 'acl_u_chgavatar' => array('lang' => 'Can change avatar', 'cat' => 'profile'), 'acl_u_chggrp' => array('lang' => 'Can change default usergroup', 'cat' => 'profile'), + 'acl_u_chgprofileinfo' => array('lang' => 'Can change profile field information', 'cat' => 'profile'), 'acl_u_attach' => array('lang' => 'Can attach files', 'cat' => 'post'), 'acl_u_download' => array('lang' => 'Can download files', 'cat' => 'post'), @@ -135,39 +136,38 @@ $lang = array_merge($lang, array( // Forum Permissions $lang = array_merge($lang, array( - 'acl_f_list' => array('lang' => 'Can see forum', 'cat' => 'post'), - 'acl_f_read' => array('lang' => 'Can read forum', 'cat' => 'post'), + 'acl_f_list' => array('lang' => 'Can see forum', 'cat' => 'actions'), + 'acl_f_read' => array('lang' => 'Can read forum', 'cat' => 'actions'), + 'acl_f_search' => array('lang' => 'Can search the forum', 'cat' => 'actions'), + 'acl_f_subscribe' => array('lang' => 'Can subscribe forum', 'cat' => 'actions'), + 'acl_f_print' => array('lang' => 'Can print topics', 'cat' => 'actions'), + 'acl_f_email' => array('lang' => 'Can email topics', 'cat' => 'actions'), + 'acl_f_bump' => array('lang' => 'Can bump topics', 'cat' => 'actions'), + 'acl_f_user_lock' => array('lang' => 'Can lock own topics', 'cat' => 'actions'), + 'acl_f_download' => array('lang' => 'Can download files', 'cat' => 'actions'), + 'acl_f_report' => array('lang' => 'Can report posts', 'cat' => 'actions'), + 'acl_f_post' => array('lang' => 'Can start new topics', 'cat' => 'post'), - 'acl_f_reply' => array('lang' => 'Can reply to topics', 'cat' => 'post'), - 'acl_f_icons' => array('lang' => 'Can use topic/post icons', 'cat' => 'post'), - 'acl_f_announce' => array('lang' => 'Can post announcements', 'cat' => 'post'), 'acl_f_sticky' => array('lang' => 'Can post stickies', 'cat' => 'post'), + 'acl_f_announce' => array('lang' => 'Can post announcements', 'cat' => 'post'), + 'acl_f_reply' => array('lang' => 'Can reply to topics', 'cat' => 'post'), + 'acl_f_edit' => array('lang' => 'Can edit own posts', 'cat' => 'post'), + 'acl_f_delete' => array('lang' => 'Can delete own posts', 'cat' => 'post'), + 'acl_f_ignoreflood' => array('lang' => 'Can ignore flood limit', 'cat' => 'post'), + 'acl_f_postcount' => array('lang' => 'Increment post counter<br /><em>Please note that this setting only affects new posts.</em>', 'cat' => 'post'), + 'acl_f_noapprove' => array('lang' => 'Can post without approval', 'cat' => 'post'), + + 'acl_f_attach' => array('lang' => 'Can attach files', 'cat' => 'content'), + 'acl_f_icons' => array('lang' => 'Can use topic/post icons', 'cat' => 'content'), + 'acl_f_bbcode' => array('lang' => 'Can use BBCode', 'cat' => 'content'), + 'acl_f_flash' => array('lang' => 'Can use [flash] BBCode tag', 'cat' => 'content'), + 'acl_f_img' => array('lang' => 'Can use [img] BBCode tag', 'cat' => 'content'), + 'acl_f_sigs' => array('lang' => 'Can use signatures', 'cat' => 'content'), + 'acl_f_smilies' => array('lang' => 'Can use smilies', 'cat' => 'content'), 'acl_f_poll' => array('lang' => 'Can create polls', 'cat' => 'polls'), 'acl_f_vote' => array('lang' => 'Can vote in polls', 'cat' => 'polls'), 'acl_f_votechg' => array('lang' => 'Can change existing vote', 'cat' => 'polls'), - - 'acl_f_attach' => array('lang' => 'Can attach files', 'cat' => 'content'), - 'acl_f_download' => array('lang' => 'Can download files', 'cat' => 'content'), - 'acl_f_sigs' => array('lang' => 'Can use signatures', 'cat' => 'content'), - 'acl_f_bbcode' => array('lang' => 'Can use BBCode', 'cat' => 'content'), - 'acl_f_smilies' => array('lang' => 'Can use smilies', 'cat' => 'content'), - 'acl_f_img' => array('lang' => 'Can use [img] BBCode tag', 'cat' => 'content'), - 'acl_f_flash' => array('lang' => 'Can use [flash] BBCode tag', 'cat' => 'content'), - - 'acl_f_edit' => array('lang' => 'Can edit own posts', 'cat' => 'actions'), - 'acl_f_delete' => array('lang' => 'Can delete own posts', 'cat' => 'actions'), - 'acl_f_user_lock' => array('lang' => 'Can lock own topics', 'cat' => 'actions'), - 'acl_f_bump' => array('lang' => 'Can bump topics', 'cat' => 'actions'), - 'acl_f_report' => array('lang' => 'Can report posts', 'cat' => 'actions'), - 'acl_f_subscribe' => array('lang' => 'Can subscribe forum', 'cat' => 'actions'), - 'acl_f_print' => array('lang' => 'Can print topics', 'cat' => 'actions'), - 'acl_f_email' => array('lang' => 'Can email topics', 'cat' => 'actions'), - - 'acl_f_search' => array('lang' => 'Can search the forum', 'cat' => 'misc'), - 'acl_f_ignoreflood' => array('lang' => 'Can ignore flood limit', 'cat' => 'misc'), - 'acl_f_postcount' => array('lang' => 'Increment post counter<br /><em>Please note that this setting only affects new posts.</em>', 'cat' => 'misc'), - 'acl_f_noapprove' => array('lang' => 'Can post without approval', 'cat' => 'misc'), )); // Moderator Permissions @@ -226,6 +226,7 @@ $lang = array_merge($lang, array( 'acl_a_switchperm' => array('lang' => 'Can use others permissions', 'cat' => 'permissions'), 'acl_a_styles' => array('lang' => 'Can manage styles', 'cat' => 'misc'), + 'acl_a_extensions' => array('lang' => 'Can manage extensions', 'cat' => 'misc'), 'acl_a_viewlogs' => array('lang' => 'Can view logs', 'cat' => 'misc'), 'acl_a_clearlogs' => array('lang' => 'Can clear logs', 'cat' => 'misc'), 'acl_a_modules' => array('lang' => 'Can manage modules', 'cat' => 'misc'), diff --git a/phpBB/language/en/acp/profile.php b/phpBB/language/en/acp/profile.php index 92e642a993..8509845860 100644 --- a/phpBB/language/en/acp/profile.php +++ b/phpBB/language/en/acp/profile.php @@ -132,6 +132,8 @@ $lang = array_merge($lang, array( 'SAVE' => 'Save', 'SECOND_OPTION' => 'Second option', + 'SHOW_NOVALUE_FIELD' => 'Show field if no value was selected', + 'SHOW_NOVALUE_FIELD_EXPLAIN' => 'Determines if the profile field should be displayed if no value was selected for optional fields or if no value has been selected yet for required fields.', 'STEP_1_EXPLAIN_CREATE' => 'Here you can enter the first basic parameters of your new profile field. This information is needed for the second step where you’ll be able to set remaining options and tweak your profile field further.', 'STEP_1_EXPLAIN_EDIT' => 'Here you can change the basic parameters of your profile field. The relevant options are re-calculated within the second step.', 'STEP_1_TITLE_CREATE' => 'Add profile field', diff --git a/phpBB/language/en/acp/prune.php b/phpBB/language/en/acp/prune.php index b8c255e38d..fcc085205b 100644 --- a/phpBB/language/en/acp/prune.php +++ b/phpBB/language/en/acp/prune.php @@ -36,7 +36,9 @@ if (empty($lang) || !is_array($lang)) // User pruning $lang = array_merge($lang, array( - 'ACP_PRUNE_USERS_EXPLAIN' => 'This section allows you to delete or deactivate users on your board. Accounts can be filtered in a variety of ways; by post count, most recent activity, etc. Criteria may be combined to narrow down which accounts are affected. For example, you can prune users with fewer than 10 posts, who were also inactive after 2002-01-01. Alternatively, you may skip the criteria selection completely by entering a list of users (each on a separate line) into the text field. Take care with this facility! Once a user is deleted, there is no way to reverse the action.', + 'ACP_PRUNE_USERS_EXPLAIN' => 'This section allows you to delete or deactivate users on your board. Accounts can be filtered in a variety of ways; by post count, most recent activity, etc. Criteria may be combined to narrow down which accounts are affected. For example, you can prune users with fewer than 10 posts, who were also inactive after 2002-01-01. Use * as a wildcard for text fields. Alternatively, you may skip the criteria selection completely by entering a list of users (each on a separate line) into the text field. Take care with this facility! Once a user is deleted, there is no way to reverse the action.', + + 'CRITERIA' => 'Criteria', 'DEACTIVATE_DELETE' => 'Deactivate or delete', 'DEACTIVATE_DELETE_EXPLAIN' => 'Choose whether to deactivate users or delete them entirely. Please note that deleted users cannot be restored!', @@ -44,15 +46,17 @@ $lang = array_merge($lang, array( 'DELETE_USER_POSTS' => 'Delete pruned user posts', 'DELETE_USER_POSTS_EXPLAIN' => 'Removes posts made by deleted users, has no effect if users are deactivated.', - 'JOINED_EXPLAIN' => 'Enter a date in <kbd>YYYY-MM-DD</kbd> format.', + 'JOINED_EXPLAIN' => 'Enter a date in <kbd>YYYY-MM-DD</kbd> format. You may use both fields to specify an interval, or leave one blank for an open date range.', 'LAST_ACTIVE_EXPLAIN' => 'Enter a date in <kbd>YYYY-MM-DD</kbd> format. Enter <kbd>0000-00-00</kbd> to prune users who never logged in, <em>Before</em> and <em>After</em> conditions will be ignored.', + 'POSTS_ON_QUEUE' => 'Posts Awaiting Approval', + 'PRUNE_USERS_GROUP_EXPLAIN' => 'Selects all members of the group for pruning.', 'PRUNE_USERS_LIST' => 'Users to be pruned', - 'PRUNE_USERS_LIST_DELETE' => 'With the selected critera for pruning users the following accounts will be removed.', - 'PRUNE_USERS_LIST_DEACTIVATE' => 'With the selected critera for pruning users the following accounts will be deactivated.', + 'PRUNE_USERS_LIST_DELETE' => 'With the selected critera for pruning users the following accounts will be removed. You can remove individual users from the deletion list by unchecking the box next to their username.', + 'PRUNE_USERS_LIST_DEACTIVATE' => 'With the selected critera for pruning users the following accounts will be deactivated. You can remove individual users from the deactivation list by unchecking the box next to their username.', - 'SELECT_USERS_EXPLAIN' => 'Enter specific usernames here, they will be used in preference to the criteria above. Founders cannot be pruned.', + 'SELECT_USERS_EXPLAIN' => 'Enter specific usernames here. They will be used in preference to the criteria above. Founders cannot be pruned.', 'USER_DEACTIVATE_SUCCESS' => 'The selected users have been deactivated successfully.', 'USER_DELETE_SUCCESS' => 'The selected users have been deleted successfully.', diff --git a/phpBB/language/en/acp/search.php b/phpBB/language/en/acp/search.php index 2f46856557..9f947dc816 100644 --- a/phpBB/language/en/acp/search.php +++ b/phpBB/language/en/acp/search.php @@ -57,6 +57,34 @@ $lang = array_merge($lang, array( 'FULLTEXT_MYSQL_MIN_SEARCH_CHARS_EXPLAIN' => 'Words with at least this many characters will be indexed for searching. You or your host can only change this setting by changing the mysql configuration.', 'FULLTEXT_MYSQL_MAX_SEARCH_CHARS_EXPLAIN' => 'Words with no more than this many characters will be indexed for searching. You or your host can only change this setting by changing the mysql configuration.', + 'FULLTEXT_POSTGRES_INCOMPATIBLE_DATABASE' => 'The PostgreSQL fulltext backend can only be used with PostgreSQL.', + 'FULLTEXT_POSTGRES_TS_NOT_USABLE' => 'The PostgreSQL fulltext backend can only be used with PostgreSQL 8.3 and above.', + 'FULLTEXT_POSTGRES_TOTAL_POSTS' => 'Total number of indexed posts', + 'FULLTEXT_POSTGRES_VERSION_CHECK' => 'PostgreSQL version', + 'FULLTEXT_POSTGRES_TS_NAME' => 'Text search Configuration Profile:', + 'FULLTEXT_POSTGRES_MIN_WORD_LEN' => 'Minimum word length for keywords', + 'FULLTEXT_POSTGRES_MAX_WORD_LEN' => 'Maximum word length for keywords', + 'FULLTEXT_POSTGRES_VERSION_CHECK_EXPLAIN' => 'This search backend requires PostgreSQL version 8.3 and above.', + 'FULLTEXT_POSTGRES_TS_NAME_EXPLAIN' => 'The Text search configuration profile used to determine the parser and dictionary.', + 'FULLTEXT_POSTGRES_MIN_WORD_LEN_EXPLAIN' => 'Words with at least this many characters will be included in the query to the database.', + 'FULLTEXT_POSTGRES_MAX_WORD_LEN_EXPLAIN' => 'Words with no more than this many characters will be included in the query to the database.', + + 'FULLTEXT_SPHINX_CONFIGURE' => 'Configure the following settings to generate sphinx config file', + 'FULLTEXT_SPHINX_DATA_PATH' => 'Path to data directory', + 'FULLTEXT_SPHINX_DATA_PATH_EXPLAIN' => 'It will be used to store the indexes and log files. You should create this directory outside the web accessible directories. (should have a trailing slash)', + 'FULLTEXT_SPHINX_DELTA_POSTS' => 'Number of posts in frequently updated delta index', + 'FULLTEXT_SPHINX_HOST' => 'Sphinx search daemon host', + 'FULLTEXT_SPHINX_HOST_EXPLAIN' => 'Host on which the sphinx search daemon (searchd) listens. Leave empty to use the default localhost', + 'FULLTEXT_SPHINX_INDEXER_MEM_LIMIT' => 'Indexer memory limit', + 'FULLTEXT_SPHINX_INDEXER_MEM_LIMIT_EXPLAIN' => 'This number should at all times be lower than the RAM available on your machine. If you experience periodic performance problems this might be due to the indexer consuming too many resources. It might help to lower the amount of memory available to the indexer.', + 'FULLTEXT_SPHINX_MAIN_POSTS' => 'Number of posts in main index', + 'FULLTEXT_SPHINX_PORT' => 'Sphinx search daemon port', + 'FULLTEXT_SPHINX_PORT_EXPLAIN' => 'Port on which the sphinx search daemon (searchd) listens. Leave empty to use the default Sphinx API port 9312', + 'FULLTEXT_SPHINX_WRONG_DATABASE' => 'The sphinx search for phpBB supports MySQL and PostgreSQL only.', + 'FULLTEXT_SPHINX_CONFIG_FILE' => 'Sphinx config file', + 'FULLTEXT_SPHINX_CONFIG_FILE_EXPLAIN' => 'The generated content of the sphinx config file. This data needs to be pasted into the sphinx.conf which is used by sphinx search daemon.', + 'FULLTEXT_SPHINX_NO_CONFIG_DATA' => 'The sphinx data and config directory paths are not defined. Please define them to generate the config file.', + 'GENERAL_SEARCH_SETTINGS' => 'General search settings', 'GO_TO_SEARCH_INDEX' => 'Go to search index page', diff --git a/phpBB/language/en/acp/users.php b/phpBB/language/en/acp/users.php index 45cf36469b..865a2a0371 100644 --- a/phpBB/language/en/acp/users.php +++ b/phpBB/language/en/acp/users.php @@ -58,7 +58,7 @@ $lang = array_merge($lang, array( 'DELETE_POSTS' => 'Delete posts', 'DELETE_USER' => 'Delete user', - 'DELETE_USER_EXPLAIN' => 'Please note that deleting a user is final, they cannot be recovered.', + 'DELETE_USER_EXPLAIN' => 'Please note that deleting a user is final, they cannot be recovered. Unread private messages sent by this user will be deleted and will not be available to their recipients.', 'FORCE_REACTIVATION_SUCCESS' => 'Successfully forced reactivation.', 'FOUNDER' => 'Founder', diff --git a/phpBB/language/en/app.php b/phpBB/language/en/app.php new file mode 100644 index 0000000000..cb56015c30 --- /dev/null +++ b/phpBB/language/en/app.php @@ -0,0 +1,49 @@ +<?php +/** +* +* app [English] +* +* @package language +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* DO NOT CHANGE +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +if (empty($lang) || !is_array($lang)) +{ + $lang = array(); +} + +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. +// +// Placeholders can now contain order information, e.g. instead of +// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows +// translators to re-order the output of data while ensuring it remains correct +// +// You do not need this where single placeholders are used, e.g. 'Message %d' is fine +// equally where a string contains only two placeholders which are used to wrap text +// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine +// +// Some characters you may want to copy&paste: +// ’ » “ ” … +// + +$lang = array_merge($lang, array( + 'CONTROLLER_ARGUMENT_VALUE_MISSING' => 'Missing value for argument #%1$s: <strong>%3$s</strong> in class <strong>%2$s</strong>', + 'CONTROLLER_NOT_SPECIFIED' => 'No controller has been specified.', + 'CONTROLLER_NOT_FOUND' => 'The requested page could not be found.', + 'CONTROLLER_METHOD_NOT_SPECIFIED' => 'No method was specified for the controller.', + 'CONTROLLER_SERVICE_NOT_GIVEN' => 'The controller "<strong>%s</strong>" must have a service specified in ./config/routing.yml.', + 'CONTROLLER_SERVICE_UNDEFINED' => 'The service for controller "<strong>%s</strong>" is not defined in ./config/services.yml.', + 'CONTROLLER_RETURN_TYPE_INVALID' => 'The controller object <strong>%s</strong> must return a Symfony\Component\HttpFoundation\Response object.', +)); diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index a6da52d4ef..fbb7b40d41 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -42,6 +42,7 @@ $lang = array_merge($lang, array( 'TRANSLATION_INFO' => '', 'DIRECTION' => 'ltr', 'DATE_FORMAT' => '|d M Y|', // 01 Jan 2007 (with Relative days enabled) + 'DATETIME_FORMAT' => '|d M Y, H:i|', // 01 Jan 2007, 13:37 (with Relative days enabled) 'USER_LANG' => 'en-gb', // You can define different rules for the determination of plural forms here. @@ -74,7 +75,7 @@ $lang = array_merge($lang, array( 'ALL_FORUMS' => 'All forums', 'ALL_MESSAGES' => 'All messages', 'ALL_POSTS' => 'All posts', - 'ALL_TIMES' => 'All times are %1$s %2$s', + 'ALL_TIMES' => 'All times are <abbr title="%2$s">%1$s</abbr>', 'ALL_TOPICS' => 'All Topics', 'AND' => 'And', 'ARE_WATCHING_FORUM' => 'You have subscribed to be notified of new posts in this forum.', @@ -133,7 +134,8 @@ $lang = array_merge($lang, array( 'COLLAPSE_VIEW' => 'Collapse view', 'CLOSE_WINDOW' => 'Close window', 'COLOUR_SWATCH' => 'Colour swatch', - 'COMMA_SEPARATOR' => ', ', // Used in pagination of ACP & prosilver, use localised comma if appropriate, eg: Ideographic or Arabic + 'COLON' => ':', + 'COMMA_SEPARATOR' => ', ', // Comma used to join lists into a single string, use localised comma if appropriate, eg: Ideographic or Arabic 'CONFIRM' => 'Confirm', 'CONFIRM_CODE' => 'Confirmation code', 'CONFIRM_CODE_EXPLAIN' => 'Enter the code exactly as it appears. All letters are case insensitive.', @@ -160,6 +162,8 @@ $lang = array_merge($lang, array( 'DISPLAY_MESSAGES' => 'Display messages from previous', 'DISPLAY_POSTS' => 'Display posts from previous', 'DISPLAY_TOPICS' => 'Display topics from previous', + 'DOWNLOAD_ALL' => 'Download all', + 'DOWNLOAD_ALL_ATTACHMENTS' => 'Download all attachments', 'DOWNLOADED' => 'Downloaded', 'DOWNLOADING_FILE' => 'Downloading file', 'DOWNLOAD_COUNTS' => array( @@ -339,7 +343,7 @@ $lang = array_merge($lang, array( 'LOGIN_EXPLAIN_VIEWONLINE' => 'In order to view the online list you have to be registered and logged in.', 'LOGOUT' => 'Logout', 'LOGOUT_USER' => 'Logout [ %s ]', - 'LOG_ME_IN' => 'Log me on automatically each visit', + 'LOG_ME_IN' => 'Remember me', 'MARK' => 'Mark', 'MARK_ALL' => 'Mark all', @@ -601,9 +605,11 @@ $lang = array_merge($lang, array( 'SUBJECT' => 'Subject', 'SUBMIT' => 'Submit', + 'TB' => 'TB', 'TERMS_USE' => 'Terms of use', 'TEST_CONNECTION' => 'Test connection', 'THE_TEAM' => 'The team', + 'TIB' => 'TiB', 'TIME' => 'Time', 'TIMEOUT_PROCESSING_REQ' => 'Request timed out.', @@ -835,91 +841,33 @@ $lang = array_merge($lang, array( 'Dec' => 'Dec', ), - 'tz' => array( - '-12' => 'UTC - 12 hours', - '-11' => 'UTC - 11 hours', - '-10' => 'UTC - 10 hours', - '-9.5' => 'UTC - 9:30 hours', - '-9' => 'UTC - 9 hours', - '-8' => 'UTC - 8 hours', - '-7' => 'UTC - 7 hours', - '-6' => 'UTC - 6 hours', - '-5' => 'UTC - 5 hours', - '-4.5' => 'UTC - 4:30 hours', - '-4' => 'UTC - 4 hours', - '-3.5' => 'UTC - 3:30 hours', - '-3' => 'UTC - 3 hours', - '-2' => 'UTC - 2 hours', - '-1' => 'UTC - 1 hour', - '0' => 'UTC', - '1' => 'UTC + 1 hour', - '2' => 'UTC + 2 hours', - '3' => 'UTC + 3 hours', - '3.5' => 'UTC + 3:30 hours', - '4' => 'UTC + 4 hours', - '4.5' => 'UTC + 4:30 hours', - '5' => 'UTC + 5 hours', - '5.5' => 'UTC + 5:30 hours', - '5.75' => 'UTC + 5:45 hours', - '6' => 'UTC + 6 hours', - '6.5' => 'UTC + 6:30 hours', - '7' => 'UTC + 7 hours', - '8' => 'UTC + 8 hours', - '8.75' => 'UTC + 8:45 hours', - '9' => 'UTC + 9 hours', - '9.5' => 'UTC + 9:30 hours', - '10' => 'UTC + 10 hours', - '10.5' => 'UTC + 10:30 hours', - '11' => 'UTC + 11 hours', - '11.5' => 'UTC + 11:30 hours', - '12' => 'UTC + 12 hours', - '12.75' => 'UTC + 12:45 hours', - '13' => 'UTC + 13 hours', - '14' => 'UTC + 14 hours', - 'dst' => '[ <abbr title="Daylight Saving Time">DST</abbr> ]', - ), - - 'tz_zones' => array( - '-12' => '[UTC - 12] Baker Island Time', - '-11' => '[UTC - 11] Niue Time, Samoa Standard Time', - '-10' => '[UTC - 10] Hawaii-Aleutian Standard Time, Cook Island Time', - '-9.5' => '[UTC - 9:30] Marquesas Islands Time', - '-9' => '[UTC - 9] Alaska Standard Time, Gambier Island Time', - '-8' => '[UTC - 8] Pacific Standard Time', - '-7' => '[UTC - 7] Mountain Standard Time', - '-6' => '[UTC - 6] Central Standard Time', - '-5' => '[UTC - 5] Eastern Standard Time', - '-4.5' => '[UTC - 4:30] Venezuelan Standard Time', - '-4' => '[UTC - 4] Atlantic Standard Time', - '-3.5' => '[UTC - 3:30] Newfoundland Standard Time', - '-3' => '[UTC - 3] Amazon Standard Time, Central Greenland Time', - '-2' => '[UTC - 2] Fernando de Noronha Time, South Georgia & the South Sandwich Islands Time', - '-1' => '[UTC - 1] Azores Standard Time, Cape Verde Time, Eastern Greenland Time', - '0' => '[UTC] Western European Time, Greenwich Mean Time', - '1' => '[UTC + 1] Central European Time, West African Time', - '2' => '[UTC + 2] Eastern European Time, Central African Time', - '3' => '[UTC + 3] Moscow Standard Time, Eastern African Time', - '3.5' => '[UTC + 3:30] Iran Standard Time', - '4' => '[UTC + 4] Gulf Standard Time, Samara Standard Time', - '4.5' => '[UTC + 4:30] Afghanistan Time', - '5' => '[UTC + 5] Pakistan Standard Time, Yekaterinburg Standard Time', - '5.5' => '[UTC + 5:30] Indian Standard Time, Sri Lanka Time', - '5.75' => '[UTC + 5:45] Nepal Time', - '6' => '[UTC + 6] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time', - '6.5' => '[UTC + 6:30] Cocos Islands Time, Myanmar Time', - '7' => '[UTC + 7] Indochina Time, Krasnoyarsk Standard Time', - '8' => '[UTC + 8] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time', - '8.75' => '[UTC + 8:45] Southeastern Western Australia Standard Time', - '9' => '[UTC + 9] Japan Standard Time, Korea Standard Time, Chita Standard Time', - '9.5' => '[UTC + 9:30] Australian Central Standard Time', - '10' => '[UTC + 10] Australian Eastern Standard Time, Vladivostok Standard Time', - '10.5' => '[UTC + 10:30] Lord Howe Standard Time', - '11' => '[UTC + 11] Solomon Island Time, Magadan Standard Time', - '11.5' => '[UTC + 11:30] Norfolk Island Time', - '12' => '[UTC + 12] New Zealand Time, Fiji Time, Kamchatka Standard Time', - '12.75' => '[UTC + 12:45] Chatham Islands Time', - '13' => '[UTC + 13] Tonga Time, Phoenix Islands Time', - '14' => '[UTC + 14] Line Island Time', + // Timezones can be translated. We use this for the Etc/GMT timezones here, + // because they are named invers to their offset. + 'timezones' => array( + 'Etc/GMT-12' => 'GMT+12', + 'Etc/GMT-11' => 'GMT+11', + 'Etc/GMT-10' => 'GMT+10', + 'Etc/GMT-9' => 'GMT+9', + 'Etc/GMT-8' => 'GMT+8', + 'Etc/GMT-7' => 'GMT+7', + 'Etc/GMT-6' => 'GMT+6', + 'Etc/GMT-5' => 'GMT+5', + 'Etc/GMT-4' => 'GMT+4', + 'Etc/GMT-3' => 'GMT+3', + 'Etc/GMT-2' => 'GMT+2', + 'Etc/GMT-1' => 'GMT+1', + 'Etc/GMT+1' => 'GMT-1', + 'Etc/GMT+2' => 'GMT-2', + 'Etc/GMT+3' => 'GMT-3', + 'Etc/GMT+4' => 'GMT-4', + 'Etc/GMT+5' => 'GMT-5', + 'Etc/GMT+6' => 'GMT-6', + 'Etc/GMT+7' => 'GMT-7', + 'Etc/GMT+8' => 'GMT-8', + 'Etc/GMT+9' => 'GMT-9', + 'Etc/GMT+10' => 'GMT-10', + 'Etc/GMT+11' => 'GMT-11', + 'Etc/GMT+12' => 'GMT-12', ), // The value is only an example and will get replaced by the current time on view diff --git a/phpBB/language/en/email/forum_notify.txt b/phpBB/language/en/email/forum_notify.txt index fae5a83885..490780a0a6 100644 --- a/phpBB/language/en/email/forum_notify.txt +++ b/phpBB/language/en/email/forum_notify.txt @@ -2,7 +2,7 @@ Subject: Forum post notification - "{FORUM_NAME}" Hello {USERNAME}, -You are receiving this notification because you are watching the forum, "{FORUM_NAME}" at "{SITENAME}". This forum has received a new reply to the topic "{TOPIC_TITLE}" since your last visit. You can use the following link to view the last unread reply, no more notifications will be sent until you visit the topic. +You are receiving this notification because you are watching the forum, "{FORUM_NAME}" at "{SITENAME}". This forum has received a new reply to the topic "{TOPIC_TITLE}"<!-- IF AUTHOR_NAME --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit. You can use the following link to view the last unread reply, no more notifications will be sent until you visit the topic. {U_NEWEST_POST} diff --git a/phpBB/language/en/email/newtopic_notify.txt b/phpBB/language/en/email/newtopic_notify.txt index 529bbf0f8f..eda1370938 100644 --- a/phpBB/language/en/email/newtopic_notify.txt +++ b/phpBB/language/en/email/newtopic_notify.txt @@ -2,7 +2,7 @@ Subject: New topic notification - "{FORUM_NAME}" Hello {USERNAME}, -You are receiving this notification because you are watching the forum, "{FORUM_NAME}" at "{SITENAME}". This forum has received a new topic since your last visit, "{TOPIC_TITLE}". You can use the following link to view the forum, no more notifications will be sent until you visit the forum. +You are receiving this notification because you are watching the forum, "{FORUM_NAME}" at "{SITENAME}". This forum has received a new topic<!-- IF AUTHOR_NAME --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit, "{TOPIC_TITLE}". You can use the following link to view the forum, no more notifications will be sent until you visit the forum. {U_FORUM} diff --git a/phpBB/language/en/email/topic_notify.txt b/phpBB/language/en/email/topic_notify.txt index 99587b28e0..fcfbcc2abd 100644 --- a/phpBB/language/en/email/topic_notify.txt +++ b/phpBB/language/en/email/topic_notify.txt @@ -2,7 +2,7 @@ Subject: Topic reply notification - "{TOPIC_TITLE}" Hello {USERNAME}, -You are receiving this notification because you are watching the topic, "{TOPIC_TITLE}" at "{SITENAME}". This topic has received a reply since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic. +You are receiving this notification because you are watching the topic, "{TOPIC_TITLE}" at "{SITENAME}". This topic has received a reply<!-- IF AUTHOR_NAME --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic. If you want to view the newest post made since your last visit, click the following link: {U_NEWEST_POST} diff --git a/phpBB/language/en/help_faq.php b/phpBB/language/en/help_faq.php index f21a8d866e..9500943b88 100644 --- a/phpBB/language/en/help_faq.php +++ b/phpBB/language/en/help_faq.php @@ -43,7 +43,7 @@ $help = array( ), array( 0 => 'Why do I get logged off automatically?', - 1 => 'If you do not check the <em>Log me in automatically</em> box when you login, the board will only keep you logged in for a preset time. This prevents misuse of your account by anyone else. To stay logged in, check the box during login. This is not recommended if you access the board from a shared computer, e.g. library, internet cafe, university computer lab, etc. If you do not see this checkbox, it means the board administrator has disabled this feature.' + 1 => 'If you do not check the <em>Remember me</em> box when you login, the board will only keep you logged in for a preset time. This prevents misuse of your account by anyone else. To stay logged in, check the box during login. This is not recommended if you access the board from a shared computer, e.g. library, internet cafe, university computer lab, etc. If you do not see this checkbox, it means the board administrator has disabled this feature.' ), array( 0 => 'How do I prevent my username appearing in the online user listings?', @@ -87,7 +87,7 @@ $help = array( ), array( 0 => 'I changed the timezone and the time is still wrong!', - 1 => 'If you are sure you have set the timezone and Summer Time/DST correctly and the time is still incorrect, then the time stored on the server clock is incorrect. Please notify an administrator to correct the problem.' + 1 => 'If you are sure you have set the timezone correctly and the time is still incorrect, then the time stored on the server clock is incorrect. Please notify an administrator to correct the problem.' ), array( 0 => 'My language is not in the list!', diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 68623a6c25..1c45deae11 100644 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -210,7 +210,7 @@ $lang = array_merge($lang, array( <p>phpBB3 supports the following databases:</p> <ul> <li>MySQL 3.23 or above (MySQLi supported)</li> - <li>PostgreSQL 7.3+</li> + <li>PostgreSQL 8.3+</li> <li>SQLite 2.8.2+</li> <li>Firebird 2.1+</li> <li>MS SQL Server 2000 or above (directly or via ODBC)</li> @@ -302,10 +302,10 @@ $lang = array_merge($lang, array( 'PHP_REGISTER_GLOBALS_EXPLAIN' => 'phpBB will still run if this setting is enabled, but if possible, it is recommended that register_globals is disabled on your PHP install for security reasons.', 'PHP_SAFE_MODE' => 'Safe mode', 'PHP_SETTINGS' => 'PHP version and settings', - 'PHP_SETTINGS_EXPLAIN' => '<strong>Required</strong> - You must be running at least version 5.3.2 of PHP in order to install phpBB. If <var>safe mode</var> is displayed below your PHP installation is running in that mode. This will impose limitations on remote administration and similar features.', + 'PHP_SETTINGS_EXPLAIN' => '<strong>Required</strong> - You must be running at least version 5.3.3 of PHP in order to install phpBB. If <var>safe mode</var> is displayed below your PHP installation is running in that mode. This will impose limitations on remote administration and similar features.', 'PHP_URL_FOPEN_SUPPORT' => 'PHP setting <var>allow_url_fopen</var> is enabled', 'PHP_URL_FOPEN_SUPPORT_EXPLAIN' => '<strong>Optional</strong> - This setting is optional, however certain phpBB functions like off-site avatars will not work properly without it.', - 'PHP_VERSION_REQD' => 'PHP version >= 5.3.2', + 'PHP_VERSION_REQD' => 'PHP version >= 5.3.3', 'POST_ID' => 'Post ID', 'PREFIX_FOUND' => 'A scan of your tables has shown a valid installation using <strong>%s</strong> as table prefix.', 'PREPROCESS_STEP' => 'Executing pre-processing functions/queries', diff --git a/phpBB/language/en/search.php b/phpBB/language/en/search.php index 5b6fdce0e7..71cbec4b41 100644 --- a/phpBB/language/en/search.php +++ b/phpBB/language/en/search.php @@ -72,6 +72,7 @@ $lang = array_merge($lang, array( 'WORDS_IN_NO_POST' => 'No posts were found because the words <strong>%s</strong> are not contained in any post.', 'POST_CHARACTERS' => 'characters of posts', + 'PHRASE_SEARCH_DISABLED' => 'Searching by exact phrase is not supported on this board.', 'RECENT_SEARCHES' => 'Recent searches', 'RESULT_DAYS' => 'Limit results to previous', @@ -81,6 +82,7 @@ $lang = array_merge($lang, array( 'SEARCHED_FOR' => 'Search term used', 'SEARCHED_TOPIC' => 'Searched topic', + 'SEARCHED_QUERY' => 'Searched query', 'SEARCH_ALL_TERMS' => 'Search for all terms or use query as entered', 'SEARCH_ANY_TERMS' => 'Search for any terms', 'SEARCH_AUTHOR' => 'Search for author', @@ -103,6 +105,8 @@ $lang = array_merge($lang, array( 'SORT_FORUM' => 'Forum', 'SORT_POST_SUBJECT' => 'Post subject', 'SORT_TIME' => 'Post time', + 'SPHINX_SEARCH_FAILED' => 'Search failed: %s', + 'SPHINX_SEARCH_FAILED_LOG' => 'Sorry, search could not be performed. More information about this failure has been logged in the error log.', 'TOO_FEW_AUTHOR_CHARS' => array( 1 => 'You must specify at least %d character of the authors name.', diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index 8af828935b..936bad7a99 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -87,7 +87,7 @@ $lang = array_merge($lang, array( 'ATTACHMENTS_EXPLAIN' => 'This is a list of attachments you have made in posts to this board.', 'ATTACHMENTS_DELETED' => 'Attachments successfully deleted.', 'ATTACHMENT_DELETED' => 'Attachment successfully deleted.', - 'AUTOLOGIN_SESSION_KEYS_DELETED'=> 'The selected persistent login keys were successfully deleted.', + 'AUTOLOGIN_SESSION_KEYS_DELETED'=> 'The selected "Remember Me" login keys were successfully deleted.', 'AVATAR_CATEGORY' => 'Category', 'AVATAR_EXPLAIN' => 'Maximum dimensions; width: %1$s, height: %2$s, file size: %3$.2f KiB.', 'AVATAR_FEATURES_DISABLED' => 'The avatar functionality is currently disabled.', @@ -103,7 +103,6 @@ $lang = array_merge($lang, array( 'BIRTHDAY_EXPLAIN' => 'Setting a year will list your age when it is your birthday.', 'BOARD_DATE_FORMAT' => 'My date format', 'BOARD_DATE_FORMAT_EXPLAIN' => 'The syntax used is identical to the PHP <a href="http://www.php.net/date">date()</a> function.', - 'BOARD_DST' => 'Summer Time/<abbr title="Daylight Saving Time">DST</abbr> is in effect', 'BOARD_LANGUAGE' => 'My language', 'BOARD_STYLE' => 'My board style', 'BOARD_TIMEZONE' => 'My timezone', @@ -269,8 +268,9 @@ $lang = array_merge($lang, array( 'MESSAGE_BY_AUTHOR' => 'by', 'MESSAGE_COLOURS' => 'Message colours', 'MESSAGE_DELETED' => 'Message successfully deleted.', + 'MESSAGE_EDITED' => 'Message successfully edited.', 'MESSAGE_HISTORY' => 'Message history', - 'MESSAGE_REMOVED_FROM_OUTBOX' => 'This message has been removed by its author before it was delivered.', + 'MESSAGE_REMOVED_FROM_OUTBOX' => 'This message was deleted by its author.', 'MESSAGE_SENT_ON' => 'on', 'MESSAGE_STORED' => 'This message has been sent successfully.', 'MESSAGE_TO' => 'To', @@ -318,6 +318,7 @@ $lang = array_merge($lang, array( 'NO_AUTH_FORWARD_MESSAGE' => 'You are not authorised to forward private messages.', 'NO_AUTH_GROUP_MESSAGE' => 'You are not authorised to send private messages to groups.', 'NO_AUTH_PASSWORD_REMINDER' => 'You are not authorised to request a new password.', + 'NO_AUTH_PROFILEINFO' => 'You are not authorised to change your profile information.', 'NO_AUTH_READ_HOLD_MESSAGE' => 'You are not authorised to read private messages that are on hold.', 'NO_AUTH_READ_MESSAGE' => 'You are not authorised to read private messages.', 'NO_AUTH_READ_REMOVED_MESSAGE' => 'You are not able to read this message because it was removed by the author.', @@ -381,8 +382,8 @@ $lang = array_merge($lang, array( 'PREFERENCES_UPDATED' => 'Your preferences have been updated.', 'PROFILE_INFO_NOTICE' => 'Please note that this information may be viewable to other members. Be careful when including any personal details. Any fields marked with a * must be completed.', 'PROFILE_UPDATED' => 'Your profile has been updated.', - 'PROFILE_AUTOLOGIN_KEYS' => 'The persistent login keys automatically log you in when you visit the board. If you logout, the persistent login key is deleted only on the computer you are using to logout. Here you can see persistent login keys created on other computers you used to access this site.', - 'PROFILE_NO_AUTOLOGIN_KEYS' => 'There are no saved persistent login keys.', + 'PROFILE_AUTOLOGIN_KEYS' => 'The "Remember Me" login keys automatically log you in when you visit the board. If you logout, the remember me login key is deleted only on the computer you are using to logout. Here you can see remember login keys created on other computers you used to access this site.', + 'PROFILE_NO_AUTOLOGIN_KEYS' => 'There are no saved "Remember Me" login keys.', 'RECIPIENT' => 'Recipient', 'RECIPIENTS' => 'Recipients', @@ -420,6 +421,8 @@ $lang = array_merge($lang, array( 'SIGNATURE_EXPLAIN' => 'This is a block of text that can be added to posts you make. There is a %d character limit.', 'SIGNATURE_PREVIEW' => 'Your signature will appear like this in posts', 'SIGNATURE_TOO_LONG' => 'Your signature is too long.', + 'SELECT_CURRENT_TIME' => 'Select current time', + 'SELECT_TIMEZONE' => 'Select timezone', 'SORT' => 'Sort', 'SORT_COMMENT' => 'File comment', 'SORT_DOWNLOADS' => 'Downloads', @@ -429,6 +432,8 @@ $lang = array_merge($lang, array( 'SORT_SIZE' => 'File size', 'TIMEZONE' => 'Timezone', + 'TIMEZONE_DATE_SUGGESTION' => 'Suggestion: %s', + 'TIMEZONE_INVALID' => 'The timezone you selected is invalid.', 'TO' => 'To', 'TOO_MANY_RECIPIENTS' => 'You tried to send a private message to too many recipients.', 'TOO_MANY_REGISTERS' => 'You have exceeded the maximum number of registration attempts for this session. Please try again later.', @@ -473,7 +478,7 @@ $lang = array_merge($lang, array( 'UCP_PROFILE_PROFILE_INFO' => 'Edit profile', 'UCP_PROFILE_REG_DETAILS' => 'Edit account settings', 'UCP_PROFILE_SIGNATURE' => 'Edit signature', - 'UCP_PROFILE_AUTOLOGIN_KEYS'=> 'Edit persistent login keys', + 'UCP_PROFILE_AUTOLOGIN_KEYS'=> 'Edit "Remember Me" login keys', 'UCP_USERGROUPS' => 'Usergroups', 'UCP_USERGROUPS_MEMBER' => 'Edit memberships', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index a69afe36f3..1320a2c02e 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -575,6 +575,26 @@ switch ($mode) unset($module); } + /** + * Modify user data before we display the profile + * + * @event core.memberlist_view_profile + * @var array member Title of the index page + * @var bool user_notes_enabled Is the mcp user notes module + * enabled? + * @var bool warn_user_enabled Is the mcp warnings module + * enabled? + * @var bool zebra_enabled Is the ucp zebra module + * enabled? + * @var bool friends_enabled Is the ucp friends module + * enabled? + * @var bool foes_enabled Is the ucp foes module + * enabled? + * @since 3.1-A1 + */ + $vars = array('member', 'user_notes_enabled', 'warn_user_enabled', 'zebra_enabled', 'friends_enabled', 'foes_enabled'); + extract($phpbb_dispatcher->trigger_event('core.memberlist_view_profile', compact($vars))); + $template->assign_vars(show_profile($member, $user_notes_enabled, $warn_user_enabled)); // Custom Profile Fields @@ -1572,10 +1592,11 @@ switch ($mode) } } + phpbb_generate_template_pagination($template, $pagination_url, 'pagination', 'start', $total_users, $config['topics_per_page'], $start); + // Generate page $template->assign_vars(array( - 'PAGINATION' => generate_pagination($pagination_url, $total_users, $config['topics_per_page'], $start), - 'PAGE_NUMBER' => on_page($total_users, $config['topics_per_page'], $start), + 'PAGE_NUMBER' => phpbb_on_page($template, $user, $pagination_url, $total_users, $config['topics_per_page'], $start), 'TOTAL_USERS' => $user->lang('LIST_USERS', (int) $total_users), 'PROFILE_IMG' => $user->img('icon_user_profile', $user->lang['PROFILE']), @@ -1630,7 +1651,7 @@ page_footer(); */ function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = false) { - global $config, $auth, $template, $user, $phpEx, $phpbb_root_path; + global $config, $auth, $template, $user, $phpEx, $phpbb_root_path, $phpbb_dispatcher; $username = $data['username']; $user_id = $data['user_id']; @@ -1674,7 +1695,8 @@ function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = f if ($bday_year) { - $now = phpbb_gmgetdate(time() + $user->timezone + $user->dst); + $now = $user->create_datetime(); + $now = phpbb_gmgetdate($now->getTimestamp() + $now->getOffset()); $diff = $now['mon'] - $bday_month; if ($diff == 0) @@ -1705,7 +1727,7 @@ function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = f ) ? true : false; // Dump it out to the template - return array( + $template_data = array( 'AGE' => $age, 'RANK_TITLE' => $rank_title, 'JOINED' => $user->format_date($data['user_regdate']), @@ -1753,6 +1775,19 @@ function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = f 'L_VIEWING_PROFILE' => sprintf($user->lang['VIEWING_PROFILE'], $username), ); + + /** + * Preparing a user's data before displaying it in profile and memberlist + * + * @event core.memberlist_prepare_profile_data + * @var array data Array with user's data + * @var array template_data Template array with user's data + * @since 3.1-A1 + */ + $vars = array('data', 'template_data'); + extract($phpbb_dispatcher->trigger_event('core.memberlist_prepare_profile_data', compact($vars))); + + return $template_data; } function _sort_last_active($first, $second) diff --git a/phpBB/posting.php b/phpBB/posting.php index 7f57f693af..2d3cb9ab44 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -44,6 +44,41 @@ $mode = ($delete && !$preview && !$refresh && $submit) ? 'delete' : request_var $error = $post_data = array(); $current_time = time(); +/** +* This event allows you to alter the above parameters, such as submit and mode +* +* Note: $refresh must be true to retain previously submitted form data. +* +* Note: The template class will not work properly until $user->setup() is +* called, and it has not been called yet. Extensions requiring template +* assignments should use an event that comes later in this file. +* +* @event core.modify_posting_parameters +* @var int post_id ID of the post +* @var int topic_id ID of the topic +* @var int forum_id ID of the forum +* @var int draft_id ID of the draft +* @var int lastclick Timestamp of when the form was last loaded +* @var bool submit Whether or not the form has been submitted +* @var bool preview Whether or not the post is being previewed +* @var bool save Whether or not a draft is being saved +* @var bool load Whether or not a draft is being loaded +* @var bool delete Whether or not the post is being deleted +* @var bool cancel Whether or not to cancel the form (returns to +* viewtopic or viewforum depending on if the user +* is posting a new topic or editing a post) +* @var bool refresh Whether or not to retain previously submitted data +* @var string mode What action to take if the form has been sumitted +* post|reply|quote|edit|delete|bump|smilies|popup +* @var array error Any error strings; a non-empty array aborts +* form submission. +* NOTE: Should be actual language strings, NOT +* language keys. +* @since 3.1-A1 +*/ +$vars = array('post_id', 'topic_id', 'forum_id', 'draft_id', 'lastclick', 'submit', 'preview', 'save', 'load', 'delete', 'cancel', 'refresh', 'mode', 'error'); +extract($phpbb_dispatcher->trigger_event('core.modify_posting_parameters', compact($vars))); + // Was cancel pressed? If so then redirect to the appropriate page if ($cancel || ($current_time - $lastclick < 2 && $submit)) { @@ -1362,7 +1397,7 @@ $template->assign_vars(array( 'FORUM_NAME' => $post_data['forum_name'], 'FORUM_DESC' => ($post_data['forum_desc']) ? generate_text_for_display($post_data['forum_desc'], $post_data['forum_desc_uid'], $post_data['forum_desc_bitfield'], $post_data['forum_desc_options']) : '', 'TOPIC_TITLE' => censor_text($post_data['topic_title']), - 'MODERATORS' => (sizeof($moderators)) ? implode(', ', $moderators[$forum_id]) : '', + 'MODERATORS' => (sizeof($moderators)) ? implode($user->lang['COMMA_SEPARATOR'], $moderators[$forum_id]) : '', 'USERNAME' => ((!$preview && $mode != 'quote') || $preview) ? $post_data['username'] : '', 'SUBJECT' => $post_data['post_subject'], 'MESSAGE' => $post_data['post_text'], @@ -1376,7 +1411,7 @@ $template->assign_vars(array( 'POST_DATE' => ($post_data['post_time']) ? $user->format_date($post_data['post_time']) : '', 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '', 'TOPIC_TIME_LIMIT' => (int) $post_data['topic_time_limit'], - 'EDIT_REASON' => $post_data['post_edit_reason'], + 'EDIT_REASON' => $request->variable('edit_reason', ''), 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id"), 'U_VIEW_TOPIC' => ($mode != 'post') ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id") : '', 'U_PROGRESS_BAR' => append_sid("{$phpbb_root_path}posting.$phpEx", "f=$forum_id&mode=popup"), @@ -1417,6 +1452,14 @@ $template->assign_vars(array( 'S_HIDDEN_FIELDS' => $s_hidden_fields) ); +/** +* This event allows you to modify template variables for the posting screen +* +* @event core.posting_modify_template_vars +* @since 3.1-A1 +*/ +$phpbb_dispatcher->trigger_event('core.posting_modify_template_vars'); + // Build custom bbcodes array display_custom_bbcodes(); diff --git a/phpBB/report.php b/phpBB/report.php index 29b46a6211..d792b8df6a 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -71,9 +71,11 @@ if ($post_id) trigger_error('POST_NOT_EXIST'); } - $forum_id = (int) $report_data['forum_id']; - $topic_id = (int) $report_data['topic_id']; - $reported_post_text = $report_data['post_text']; + $forum_id = (int) $report_data['forum_id']; + $topic_id = (int) $report_data['topic_id']; + $reported_post_text = $report_data['post_text']; + $reported_post_bitfield = $report_data['bbcode_bitfield']; + $reported_post_uid = $report_data['bbcode_uid']; $sql = 'SELECT * FROM ' . FORUMS_TABLE . ' @@ -132,7 +134,9 @@ else trigger_error($message); } - $reported_post_text = $report_data['message_text']; + $reported_post_text = $report_data['message_text']; + $reported_post_bitfield = $report_data['bbcode_bitfield']; + $reported_post_uid = $report_data['bbcode_uid']; } // Submit report? @@ -151,15 +155,17 @@ if ($submit && $reason_id) } $sql_ary = array( - 'reason_id' => (int) $reason_id, - 'post_id' => $post_id, - 'pm_id' => $pm_id, - 'user_id' => (int) $user->data['user_id'], - 'user_notify' => (int) $user_notify, - 'report_closed' => 0, - 'report_time' => (int) time(), - 'report_text' => (string) $report_text, + 'reason_id' => (int) $reason_id, + 'post_id' => $post_id, + 'pm_id' => $pm_id, + 'user_id' => (int) $user->data['user_id'], + 'user_notify' => (int) $user_notify, + 'report_closed' => 0, + 'report_time' => (int) time(), + 'report_text' => (string) $report_text, 'reported_post_text' => $reported_post_text, + 'reported_post_uid' => $reported_post_uid, + 'reported_post_bitfield'=> $reported_post_bitfield, ); $sql = 'INSERT INTO ' . REPORTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); diff --git a/phpBB/search.php b/phpBB/search.php index 2b463aec9c..7d20d8d4a2 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -280,21 +280,31 @@ if ($keywords || $author || $author_id || $search_id || $submit) } // We do some additional checks in the module to ensure it can actually be utilised $error = false; - $search = new $search_type($error); + $search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user); if ($error) { trigger_error($error); } + $common_words = $search->get_common_words(); + // let the search module split up the keywords if ($keywords) { $correct_query = $search->split_keywords($keywords, $search_terms); - if (!$correct_query || (empty($search->search_query) && !sizeof($author_id_ary) && !$search_id)) + if (!$correct_query || (!$search->get_search_query() && !sizeof($author_id_ary) && !$search_id)) { - $ignored = (sizeof($search->common_words)) ? sprintf($user->lang['IGNORED_TERMS_EXPLAIN'], implode(' ', $search->common_words)) . '<br />' : ''; - trigger_error($ignored . $user->lang('NO_KEYWORDS', $user->lang('CHARACTERS', (int) $search->word_length['min']), $user->lang('CHARACTERS', (int) $search->word_length['max']))); + $ignored = (sizeof($common_words)) ? sprintf($user->lang['IGNORED_TERMS_EXPLAIN'], implode(' ', $common_words)) . '<br />' : ''; + $word_length = $search->get_word_length(); + if ($word_length) + { + trigger_error($ignored . $user->lang('NO_KEYWORDS', $user->lang('CHARACTERS', (int) $word_length['min']), $user->lang('CHARACTERS', (int) $word_length['max']))); + } + else + { + trigger_error($ignored); + } } } @@ -526,7 +536,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) sort($m_approve_fid_ary); sort($author_id_ary); - if (!empty($search->search_query)) + if ($search->get_search_query()) { $total_match_count = $search->keyword_search($show_results, $search_fields, $search_terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $sql_author_match, $id_ary, $start, $per_page); } @@ -596,13 +606,25 @@ if ($keywords || $author || $author_id || $search_id || $submit) $u_search .= ($search_fields != 'all') ? '&sf=' . $search_fields : ''; $u_search .= ($return_chars != 300) ? '&ch=' . $return_chars : ''; + // Check if search backend supports phrase search or not + $phrase_search_disabled = ''; + if (strpos(html_entity_decode($keywords), '"') !== false && method_exists($search, 'supports_phrase_search')) + { + $phrase_search_disabled = $search->supports_phrase_search() ? false : true; + } + + phpbb_generate_template_pagination($template, $u_search, 'pagination', 'start', $total_match_count, $per_page, $start); + $template->assign_vars(array( 'SEARCH_TITLE' => $l_search_title, 'SEARCH_MATCHES' => $l_search_matches, - 'SEARCH_WORDS' => $search->search_query, - 'IGNORED_WORDS' => (sizeof($search->common_words)) ? implode(' ', $search->common_words) : '', - 'PAGINATION' => generate_pagination($u_search, $total_match_count, $per_page, $start), - 'PAGE_NUMBER' => on_page($total_match_count, $per_page, $start), + 'SEARCH_WORDS' => $keywords, + 'SEARCHED_QUERY' => $search->get_search_query(), + 'IGNORED_WORDS' => (sizeof($common_words)) ? implode(' ', $common_words) : '', + 'PAGE_NUMBER' => phpbb_on_page($template, $user, $u_search, $total_match_count, $per_page, $start), + + 'PHRASE_SEARCH_DISABLED' => $phrase_search_disabled, + 'TOTAL_MATCHES' => $total_match_count, 'SEARCH_IN_RESULTS' => ($search_id) ? false : true, @@ -888,7 +910,6 @@ if ($keywords || $author || $author_id || $search_id || $submit) 'LAST_POST_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), 'LAST_POST_AUTHOR_FULL' => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), - 'PAGINATION' => topic_generate_pagination($replies, $view_topic_url), 'TOPIC_TYPE' => $topic_type, 'TOPIC_IMG_STYLE' => $folder_img, @@ -992,6 +1013,11 @@ if ($keywords || $author || $author_id || $search_id || $submit) 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id), 'U_VIEW_POST' => (!empty($row['post_id'])) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=" . $row['topic_id'] . '&p=' . $row['post_id'] . (($u_hilit) ? '&hilit=' . $u_hilit : '')) . '#p' . $row['post_id'] : '') )); + + if ($show_results == 'topics') + { + phpbb_generate_template_pagination($template, $view_topic_url, 'searchresults.pagination', 'start', $replies + 1, $config['posts_per_page'], 1, true, true); + } } if ($topic_id && ($topic_id == $result_topic_id)) diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js index 54f34e4204..fa31d3268f 100644 --- a/phpBB/styles/prosilver/template/ajax.js +++ b/phpBB/styles/prosilver/template/ajax.js @@ -106,6 +106,10 @@ phpbb.ajaxify({ } }); +$('#quick-mod-select').change(function () { + $('#quickmodform').submit(); +}); + })(jQuery); // Avoid conflicts with other libraries diff --git a/phpBB/styles/prosilver/template/bbcode.html b/phpBB/styles/prosilver/template/bbcode.html index dac2929a0f..c0c0a2da46 100644 --- a/phpBB/styles/prosilver/template/bbcode.html +++ b/phpBB/styles/prosilver/template/bbcode.html @@ -8,11 +8,11 @@ <!-- BEGIN listitem --><li><!-- END listitem --> <!-- BEGIN listitem_close --></li><!-- END listitem_close --> -<!-- BEGIN quote_username_open --><blockquote><div><cite>{USERNAME} {L_WROTE}:</cite><!-- END quote_username_open --> +<!-- BEGIN quote_username_open --><blockquote><div><cite>{USERNAME} {L_WROTE}{L_COLON}</cite><!-- END quote_username_open --> <!-- BEGIN quote_open --><blockquote class="uncited"><div><!-- END quote_open --> <!-- BEGIN quote_close --></div></blockquote><!-- END quote_close --> -<!-- BEGIN code_open --><dl class="codebox"><dt>{L_CODE}: <a href="#" onclick="selectCode(this); return false;">{L_SELECT_ALL_CODE}</a></dt><dd><code><!-- END code_open --> +<!-- BEGIN code_open --><dl class="codebox"><dt>{L_CODE}{L_COLON} <a href="#" onclick="selectCode(this); return false;">{L_SELECT_ALL_CODE}</a></dt><dd><code><!-- END code_open --> <!-- BEGIN code_close --></code></dd></dl><!-- END code_close --> <!-- BEGIN inline_attachment_open --><div class="inline-attachment"><!-- END inline_attachment_open --> diff --git a/phpBB/styles/prosilver/template/captcha_default.html b/phpBB/styles/prosilver/template/captcha_default.html index 007cff644f..c9c5295d13 100644 --- a/phpBB/styles/prosilver/template/captcha_default.html +++ b/phpBB/styles/prosilver/template/captcha_default.html @@ -9,7 +9,7 @@ <!-- ENDIF --> <dl> - <dt><label for="confirm_code">{L_CONFIRM_CODE}:</label></dt> + <dt><label for="confirm_code">{L_CONFIRM_CODE}{L_COLON}</label></dt> <dd><img src="{CONFIRM_IMAGE_LINK}" alt="{L_CONFIRM_CODE}" /></dd> <dd><input type="text" name="confirm_code" id="confirm_code" size="8" maxlength="8" tabindex="{$CAPTCHA_TAB_INDEX}" class="inputbox narrow" title="{L_CONFIRM_CODE}" /> <!-- IF S_CONFIRM_REFRESH --><input type="submit" name="refresh_vc" id="refresh_vc" class="button2" value="{L_VC_REFRESH}" /><!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/captcha_qa.html b/phpBB/styles/prosilver/template/captcha_qa.html index 7986b1faa2..c179f6dc20 100644 --- a/phpBB/styles/prosilver/template/captcha_qa.html +++ b/phpBB/styles/prosilver/template/captcha_qa.html @@ -7,7 +7,7 @@ <!-- ENDIF --> <dl> - <dt><label>{QA_CONFIRM_QUESTION}:</label><br /><span>{L_CONFIRM_QUESTION_EXPLAIN}</span></dt> + <dt><label>{QA_CONFIRM_QUESTION}{L_COLON}</label><br /><span>{L_CONFIRM_QUESTION_EXPLAIN}</span></dt> <dd> <input type="text" tabindex="{$CAPTCHA_TAB_INDEX}" name="qa_answer" id="answer" size="45" class="inputbox autowidth" title="{L_ANSWER}" /> <input type="hidden" name="qa_confirm_id" id="qa_confirm_id" value="{QA_CONFIRM_ID}" /> diff --git a/phpBB/styles/prosilver/template/captcha_recaptcha.html b/phpBB/styles/prosilver/template/captcha_recaptcha.html index 087a5b9405..aad1008241 100644 --- a/phpBB/styles/prosilver/template/captcha_recaptcha.html +++ b/phpBB/styles/prosilver/template/captcha_recaptcha.html @@ -10,7 +10,7 @@ <!-- IF S_RECAPTCHA_AVAILABLE --> <dl> - <dt><label>{L_CONFIRM_CODE}</label>:<br /><span>{L_RECAPTCHA_EXPLAIN}</span></dt> + <dt><label>{L_CONFIRM_CODE}{L_COLON}</label><br /><span>{L_RECAPTCHA_EXPLAIN}</span></dt> <dd> <script type="text/javascript"> // <![CDATA[ diff --git a/phpBB/styles/prosilver/template/custom_profile_fields.html b/phpBB/styles/prosilver/template/custom_profile_fields.html index 44c68f532b..9c627a509d 100644 --- a/phpBB/styles/prosilver/template/custom_profile_fields.html +++ b/phpBB/styles/prosilver/template/custom_profile_fields.html @@ -25,7 +25,7 @@ <!-- END int --> <!-- BEGIN date --> -<label for="{date.FIELD_IDENT}_day">{L_DAY}: <select name="{date.FIELD_IDENT}_day" id="{date.FIELD_IDENT}_day">{date.S_DAY_OPTIONS}</select></label> -<label for="{date.FIELD_IDENT}_month">{L_MONTH}: <select name="{date.FIELD_IDENT}_month" id="{date.FIELD_IDENT}_month">{date.S_MONTH_OPTIONS}</select></label> -<label for="{date.FIELD_IDENT}_year">{L_YEAR}: <select name="{date.FIELD_IDENT}_year" id="{date.FIELD_IDENT}_year">{date.S_YEAR_OPTIONS}</select></label> +<label for="{date.FIELD_IDENT}_day">{L_DAY}{L_COLON} <select name="{date.FIELD_IDENT}_day" id="{date.FIELD_IDENT}_day">{date.S_DAY_OPTIONS}</select></label> +<label for="{date.FIELD_IDENT}_month">{L_MONTH}{L_COLON} <select name="{date.FIELD_IDENT}_month" id="{date.FIELD_IDENT}_month">{date.S_MONTH_OPTIONS}</select></label> +<label for="{date.FIELD_IDENT}_year">{L_YEAR}{L_COLON} <select name="{date.FIELD_IDENT}_year" id="{date.FIELD_IDENT}_year">{date.S_YEAR_OPTIONS}</select></label> <!-- END date --> diff --git a/phpBB/styles/prosilver/template/drafts.html b/phpBB/styles/prosilver/template/drafts.html index c3c54876e3..b6e6a7f5b7 100644 --- a/phpBB/styles/prosilver/template/drafts.html +++ b/phpBB/styles/prosilver/template/drafts.html @@ -28,8 +28,8 @@ <dl> <dt> <a href="{draftrow.U_INSERT}" title="{L_LOAD_DRAFT}" class="topictitle">{draftrow.DRAFT_SUBJECT}</a><br /> - <!-- IF not S_PRIVMSGS --><!-- IF draftrow.S_LINK_TOPIC -->{L_TOPIC}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a> - <!-- ELSEIF draftrow.S_LINK_FORUM -->{L_FORUM}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a> + <!-- IF not S_PRIVMSGS --><!-- IF draftrow.S_LINK_TOPIC -->{L_TOPIC}{L_COLON} <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a> + <!-- ELSEIF draftrow.S_LINK_FORUM -->{L_FORUM}{L_COLON} <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a> <!-- ELSE -->{L_NO_TOPIC_FORUM}<!-- ENDIF --><!-- ENDIF --> </dt> <dd class="posted">{draftrow.DATE}</dd> diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index 240fe7e51d..995b4b0ab7 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -42,11 +42,7 @@ function jumpto() */ function marklist(id, name, state) { - var parent = document.getElementById(id); - if (!parent) - { - eval('parent = document.' + id); - } + var parent = document.getElementById(id) || document[id]; if (!parent) { diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html index 723c2ffeda..8762cb0c2e 100644 --- a/phpBB/styles/prosilver/template/forumlist_body.html +++ b/phpBB/styles/prosilver/template/forumlist_body.html @@ -33,7 +33,7 @@ <a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a><br /> {forumrow.FORUM_DESC} <!-- IF forumrow.MODERATORS --> - <br /><strong>{forumrow.L_MODERATOR_STR}:</strong> {forumrow.MODERATORS} + <br /><strong>{forumrow.L_MODERATOR_STR}{L_COLON}</strong> {forumrow.MODERATORS} <!-- ENDIF --> <!-- IF .forumrow.subforum and forumrow.S_LIST_SUBFORUMS --> <br /><strong>{forumrow.L_SUBFORUM_STR}</strong> @@ -43,7 +43,7 @@ <!-- ENDIF --> </dt> <!-- IF forumrow.CLICKS --> - <dd class="redirect"><span>{L_REDIRECTS}: {forumrow.CLICKS}</span></dd> + <dd class="redirect"><span>{L_REDIRECTS}{L_COLON} {forumrow.CLICKS}</span></dd> <!-- ELSEIF not forumrow.S_IS_LINK --> <dd class="topics">{forumrow.TOPICS} <dfn>{L_TOPICS}</dfn></dd> <dd class="posts">{forumrow.POSTS} <dfn>{L_POSTS}</dfn></dd> @@ -51,7 +51,7 @@ <!-- IF forumrow.U_UNAPPROVED_TOPICS --><a href="{forumrow.U_UNAPPROVED_TOPICS}">{UNAPPROVED_IMG}</a><!-- ENDIF --> <!-- IF forumrow.LAST_POST_TIME --><dfn>{L_LAST_POST}</dfn> <!-- IF forumrow.S_DISPLAY_SUBJECT --> - <a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}">{forumrow.LAST_POST_SUBJECT_TRUNCATED}</a> <br /> + <a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}" class="lastsubject">{forumrow.LAST_POST_SUBJECT_TRUNCATED}</a> <br /> <!-- ENDIF --> {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL} <!-- IF not S_IS_BOT --><a href="{forumrow.U_LAST_POST}">{LAST_POST_IMG}</a> <!-- ENDIF --><br />{forumrow.LAST_POST_TIME}<!-- ELSE -->{L_NO_POSTS}<br /> <!-- ENDIF --></span> diff --git a/phpBB/styles/prosilver/template/index_body.html b/phpBB/styles/prosilver/template/index_body.html index 9269f62769..6babbf5997 100644 --- a/phpBB/styles/prosilver/template/index_body.html +++ b/phpBB/styles/prosilver/template/index_body.html @@ -18,8 +18,8 @@ <form method="post" action="{S_LOGIN_ACTION}" class="headerspace"> <h3><a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a><!-- IF S_REGISTER_ENABLED --> • <a href="{U_REGISTER}">{L_REGISTER}</a><!-- ENDIF --></h3> <fieldset class="quick-login"> - <label for="username">{L_USERNAME}:</label> <input type="text" name="username" id="username" size="10" class="inputbox" title="{L_USERNAME}" /> - <label for="password">{L_PASSWORD}:</label> <input type="password" name="password" id="password" size="10" class="inputbox" title="{L_PASSWORD}" /> + <label for="username">{L_USERNAME}{L_COLON}</label> <input type="text" name="username" id="username" size="10" class="inputbox" title="{L_USERNAME}" /> + <label for="password">{L_PASSWORD}{L_COLON}</label> <input type="password" name="password" id="password" size="10" class="inputbox" title="{L_PASSWORD}" /> <!-- IF S_AUTOLOGIN_ENABLED --> | <label for="autologin">{L_LOG_ME_IN} <input type="checkbox" name="autologin" id="autologin" /></label> <!-- ENDIF --> @@ -32,12 +32,12 @@ <!-- IF S_DISPLAY_ONLINE_LIST --> <!-- IF U_VIEWONLINE --><h3><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></h3><!-- ELSE --><h3>{L_WHO_IS_ONLINE}</h3><!-- ENDIF --> <p>{TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})<br />{RECORD_USERS}<br /> <br />{LOGGED_IN_USER_LIST} - <!-- IF LEGEND --><br /><em>{L_LEGEND}: {LEGEND}</em><!-- ENDIF --></p> + <!-- IF LEGEND --><br /><em>{L_LEGEND}{L_COLON} {LEGEND}</em><!-- ENDIF --></p> <!-- ENDIF --> -<!-- IF S_DISPLAY_BIRTHDAY_LIST and .birthdays --> +<!-- IF S_DISPLAY_BIRTHDAY_LIST --> <h3>{L_BIRTHDAYS}</h3> - <p><!-- IF .birthdays -->{L_CONGRATULATIONS}: <strong><!-- BEGIN birthdays -->{birthdays.USERNAME}<!-- IF birthdays.AGE !== '' --> ({birthdays.AGE})<!-- ENDIF --><!-- IF not birthdays.S_LAST_ROW -->, <!-- ENDIF --><!-- END birthdays --></strong><!-- ELSE -->{L_NO_BIRTHDAYS}<!-- ENDIF --></p> + <p><!-- IF .birthdays -->{L_CONGRATULATIONS}{L_COLON} <strong><!-- BEGIN birthdays -->{birthdays.USERNAME}<!-- IF birthdays.AGE !== '' --> ({birthdays.AGE})<!-- ENDIF --><!-- IF not birthdays.S_LAST_ROW -->, <!-- ENDIF --><!-- END birthdays --></strong><!-- ELSE -->{L_NO_BIRTHDAYS}<!-- ENDIF --></p> <!-- ENDIF --> <!-- IF NEWEST_USER --> diff --git a/phpBB/styles/prosilver/template/jumpbox.html b/phpBB/styles/prosilver/template/jumpbox.html index 1029627561..ff234464dc 100644 --- a/phpBB/styles/prosilver/template/jumpbox.html +++ b/phpBB/styles/prosilver/template/jumpbox.html @@ -1,12 +1,12 @@ <!-- IF S_VIEWTOPIC --> - <p></p><p><a href="{U_VIEW_FORUM}" class="left-box {S_CONTENT_FLOW_BEGIN}" accesskey="r">{L_RETURN_TO} {FORUM_NAME}</a></p> + <p></p><p><a href="{U_VIEW_FORUM}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}" accesskey="r">{L_RETURN_TO} {FORUM_NAME}</a></p> <!-- ELSEIF S_VIEWFORUM --> - <p></p><p><a href="{U_INDEX}" class="left-box {S_CONTENT_FLOW_BEGIN}" accesskey="r">{L_RETURN_TO} {L_INDEX}</a></p> + <p></p><p><a href="{U_INDEX}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}" accesskey="r">{L_RETURN_TO} {L_INDEX}</a></p> <!-- ELSEIF SEARCH_TOPIC --> - <p></p><p><a class="left-box {S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH_TOPIC}" accesskey="r">{L_RETURN_TO}: {SEARCH_TOPIC}</a></p> + <p></p><p><a class="left-box arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH_TOPIC}" accesskey="r">{L_RETURN_TO}{L_COLON} {SEARCH_TOPIC}</a></p> <!-- ELSEIF S_SEARCH_ACTION --> - <p></p><p><a class="left-box {S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH}" title="{L_SEARCH_ADV}" accesskey="r">{L_RETURN_TO_SEARCH_ADV}</a></p> + <p></p><p><a class="left-box arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH}" title="{L_SEARCH_ADV}" accesskey="r">{L_RETURN_TO_SEARCH_ADV}</a></p> <!-- ENDIF --> <!-- IF S_DISPLAY_JUMPBOX --> @@ -17,7 +17,7 @@ <!-- ELSE --> <fieldset class="jumpbox"> <!-- ENDIF --> - <label for="f" accesskey="j"><!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->:</label> + <label for="f" accesskey="j"><!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->{L_COLON}</label> <select name="f" id="f" onchange="if(this.options[this.selectedIndex].value != -1){ document.forms['jumpbox'].submit() }"> <!-- BEGIN jumpbox_forums --> <!-- IF jumpbox_forums.S_FORUM_COUNT == 1 --><option value="-1">------------------</option><!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/login_body.html b/phpBB/styles/prosilver/template/login_body.html index d8b9b01779..89ef8acd6f 100644 --- a/phpBB/styles/prosilver/template/login_body.html +++ b/phpBB/styles/prosilver/template/login_body.html @@ -2,7 +2,9 @@ <script type="text/javascript"> // <![CDATA[ - onload_functions.push('document.getElementById("<!-- IF S_ADMIN_AUTH -->{PASSWORD_CREDENTIAL}<!-- ELSE -->{USERNAME_CREDENTIAL}<!-- ENDIF -->").focus();'); + onload_functions.push(function () { + document.getElementById("<!-- IF S_ADMIN_AUTH -->{PASSWORD_CREDENTIAL}<!-- ELSE -->{USERNAME_CREDENTIAL}<!-- ENDIF -->").focus(); + }); // ]]> </script> @@ -16,11 +18,11 @@ <fieldset <!-- IF not S_CONFIRM_CODE -->class="fields1"<!-- ELSE -->class="fields2"<!-- ENDIF -->> <!-- IF LOGIN_ERROR --><div class="error">{LOGIN_ERROR}</div><!-- ENDIF --> <dl> - <dt><label for="{USERNAME_CREDENTIAL}">{L_USERNAME}:</label></dt> + <dt><label for="{USERNAME_CREDENTIAL}">{L_USERNAME}{L_COLON}</label></dt> <dd><input type="text" tabindex="1" name="{USERNAME_CREDENTIAL}" id="{USERNAME_CREDENTIAL}" size="25" value="{USERNAME}" class="inputbox autowidth" /></dd> </dl> <dl> - <dt><label for="{PASSWORD_CREDENTIAL}">{L_PASSWORD}:</label></dt> + <dt><label for="{PASSWORD_CREDENTIAL}">{L_PASSWORD}{L_COLON}</label></dt> <dd><input type="password" tabindex="2" id="{PASSWORD_CREDENTIAL}" name="{PASSWORD_CREDENTIAL}" size="25" class="inputbox autowidth" /></dd> <!-- IF S_DISPLAY_FULL_LOGIN and (U_SEND_PASSWORD or U_RESEND_ACTIVATION) --> <!-- IF U_SEND_PASSWORD --><dd><a href="{U_SEND_PASSWORD}">{L_FORGOT_PASS}</a></dd><!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/login_forum.html b/phpBB/styles/prosilver/template/login_forum.html index 13669a78bb..63f0b2e0f7 100644 --- a/phpBB/styles/prosilver/template/login_forum.html +++ b/phpBB/styles/prosilver/template/login_forum.html @@ -17,7 +17,7 @@ </dl> <!-- ENDIF --> <dl> - <dt><label for="password">{L_PASSWORD}:</label></dt> + <dt><label for="password">{L_PASSWORD}{L_COLON}</label></dt> <dd><input class="inputbox narrow" type="password" name="password" id="password" size="25" tabindex="1" /></dd> </dl> <dl class="fields2"> diff --git a/phpBB/styles/prosilver/template/mcp_approve.html b/phpBB/styles/prosilver/template/mcp_approve.html index 8b7f7c8c6d..faa88aefc7 100644 --- a/phpBB/styles/prosilver/template/mcp_approve.html +++ b/phpBB/styles/prosilver/template/mcp_approve.html @@ -20,14 +20,14 @@ <!-- IF not S_APPROVE --> <dl class="fields2 nobg"> - <dt><label>{L_DISAPPROVE_REASON}:</label></dt> + <dt><label>{L_DISAPPROVE_REASON}{L_COLON}</label></dt> <dd><select name="reason_id"> <!-- BEGIN reason --><option value="{reason.ID}"<!-- IF reason.S_SELECTED --> selected="selected"<!-- ENDIF -->>{reason.DESCRIPTION}</option><!-- END reason --> </select> </dd> </dl> <dl class="fields2 nobg"> - <dt><label for="reason">{L_MORE_INFO}:</label><br /><span>{L_CAN_LEAVE_BLANK}</span></dt> + <dt><label for="reason">{L_MORE_INFO}{L_COLON}</label><br /><span>{L_CAN_LEAVE_BLANK}</span></dt> <dd><textarea class="inputbox" name="reason" id="reason" rows="4" cols="40">{REASON}</textarea></dd> </dl> <!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/mcp_ban.html b/phpBB/styles/prosilver/template/mcp_ban.html index adcd86d057..591dbf8076 100644 --- a/phpBB/styles/prosilver/template/mcp_ban.html +++ b/phpBB/styles/prosilver/template/mcp_ban.html @@ -43,28 +43,28 @@ <fieldset> <dl> - <dt><label for="ban">{L_BAN_CELL}:</label></dt> + <dt><label for="ban">{L_BAN_CELL}{L_COLON}</label></dt> <dd><label for="ban"><textarea name="ban" id="ban" class="inputbox" cols="40" rows="3">{BAN_QUANTIFIER}</textarea></label></dd> <!-- IF S_USERNAME_BAN --><dd><strong><a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a></strong></dd><!-- ENDIF --> </dl> <dl> - <dt><label for="banlength">{L_BAN_LENGTH}:</label></dt> + <dt><label for="banlength">{L_BAN_LENGTH}{L_COLON}</label></dt> <dd><label for="banlength"><select name="banlength" id="banlength" onchange="if(this.value==-1){document.getElementById('banlengthother').style.display = 'block';}else{document.getElementById('banlengthother').style.display='none';}">{S_BAN_END_OPTIONS}</select></label></dd> <dd id="banlengthother" style="display: none;"><label><input type="text" name="banlengthother" class="inputbox" /><br /><span>{L_YEAR_MONTH_DAY}</span></label></dd> </dl> <dl> - <dt><label for="banreason">{L_BAN_REASON}:</label></dt> + <dt><label for="banreason">{L_BAN_REASON}{L_COLON}</label></dt> <dd><input name="banreason" id="banreason" type="text" class="inputbox" maxlength="255" /></dd> </dl> <dl> - <dt><label for="bangivereason">{L_BAN_GIVE_REASON}:</label></dt> + <dt><label for="bangivereason">{L_BAN_GIVE_REASON}{L_COLON}</label></dt> <dd><input name="bangivereason" id="bangivereason" type="text" class="inputbox" maxlength="255" /></dd> </dl> <hr /> <dl> - <dt><label for="banexclude0">{L_BAN_EXCLUDE}:</label><br /><span>{L_BAN_EXCLUDE_EXPLAIN}</span></dt> + <dt><label for="banexclude0">{L_BAN_EXCLUDE}{L_COLON}</label><br /><span>{L_BAN_EXCLUDE_EXPLAIN}</span></dt> <dd> <label for="banexclude1"><input type="radio" name="banexclude" id="banexclude1" value="1" /> {L_YES}</label> <label for="banexclude0"><input type="radio" name="banexclude" id="banexclude0" value="0" checked="checked" /> {L_NO}</label> @@ -90,19 +90,19 @@ <!-- IF S_BANNED_OPTIONS --> <fieldset> <dl> - <dt><label for="unban">{L_BAN_CELL}:</label></dt> + <dt><label for="unban">{L_BAN_CELL}{L_COLON}</label></dt> <dd><select name="unban[]" id="unban" multiple="multiple" size="5" onchange="if (this.selectedIndex != -1) {display_details(this.options[this.selectedIndex].value);}">{BANNED_OPTIONS}</select></dd> </dl> <dl> - <dt>{L_BAN_LENGTH}:</dt> + <dt>{L_BAN_LENGTH}{L_COLON}</dt> <dd><strong id="unbanlength"></strong></dd> </dl> <dl> - <dt>{L_BAN_REASON}:</dt> + <dt>{L_BAN_REASON}{L_COLON}</dt> <dd><strong id="unbanreason"></strong></dd> </dl> <dl> - <dt>{L_BAN_GIVE_REASON}:</dt> + <dt>{L_BAN_GIVE_REASON}{L_COLON}</dt> <dd><strong id="unbangivereason"></strong></dd> </dl> </fieldset> diff --git a/phpBB/styles/prosilver/template/mcp_forum.html b/phpBB/styles/prosilver/template/mcp_forum.html index afd4f2308a..e559f178f2 100644 --- a/phpBB/styles/prosilver/template/mcp_forum.html +++ b/phpBB/styles/prosilver/template/mcp_forum.html @@ -3,18 +3,22 @@ <!-- DEFINE $CUSTOM_FIELDSET_CLASS = 'forum-selection2' --> <!-- INCLUDE jumpbox.html --> -<h2><a href="{U_VIEW_FORUM}">{L_FORUM}: {FORUM_NAME}</a></h2> +<h2><a href="{U_VIEW_FORUM}">{L_FORUM}{L_COLON} {FORUM_NAME}</a></h2> <form method="post" id="mcp" action="{S_MCP_ACTION}"> <div class="panel"> <div class="inner"> - <!-- IF PAGINATION or TOTAL_TOPICS --> + <!-- IF .pagination or TOTAL_TOPICS --> <ul class="linklist"> <li class="rightside pagination"> - <!-- IF TOTAL_TOPICS --> {TOTAL_TOPICS}<!-- ENDIF --> - <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> + <!-- IF TOTAL_TOPICS --> {TOTAL_TOPICS} • <!-- ENDIF --> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </li> </ul> <!-- ENDIF --> @@ -42,7 +46,20 @@ <!-- IF topicrow.S_TOPIC_REPORTED --><a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --> <!-- IF topicrow.S_MOVED_TOPIC and S_CAN_DELETE --> <a href="{topicrow.U_DELETE_TOPIC}" class="topictitle">[ {L_DELETE_SHADOW_TOPIC} ]</a><!-- ENDIF --> <br /> - <!-- IF topicrow.PAGINATION --><strong class="pagination"><span>{topicrow.PAGINATION}</span></strong><!-- ENDIF --> + <!-- IF .topicrow.pagination --> + <div class="pagination"> + <ul> + <!-- BEGIN pagination --> + <!-- IF topicrow.pagination.S_IS_PREV --> + <!-- ELSEIF topicrow.pagination.S_IS_CURRENT --><li class="active"><span>{topicrow.pagination.PAGE_NUMBER}</span></li> + <!-- ELSEIF topicrow.pagination.S_IS_ELLIPSIS --><li class="ellipsis"><span>{L_ELLIPSIS}</span></li> + <!-- ELSEIF topicrow.pagination.S_IS_NEXT --> + <!-- ELSE --><li><a href="{topicrow.pagination.PAGE_URL}">{topicrow.pagination.PAGE_NUMBER}</a></li> + <!-- ENDIF --> + <!-- END pagination --> + </ul> + </div> + <!-- ENDIF --> <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->{L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} » {topicrow.FIRST_POST_TIME} </dt> <dd class="posts">{topicrow.REPLIES} <dfn>{L_REPLIES}</dfn></dd> <dd class="lastpost"><span><dfn>{L_LAST_POST} </dfn>{L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL}<br />{topicrow.LAST_POST_TIME}</span> @@ -63,20 +80,37 @@ <!-- ENDIF --> <fieldset class="display-options"> - <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> - <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> - <label>{L_DISPLAY_TOPICS}: {S_SELECT_SORT_DAYS}</label> + <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> + <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> + <label>{L_DISPLAY_TOPICS}{L_COLON} {S_SELECT_SORT_DAYS}</label> <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label> <label>{S_SELECT_SORT_DIR} <input type="submit" name="sort" value="{L_GO}" class="button2" /></label> </fieldset> <hr /> - <!-- IF PAGINATION or TOTAL_TOPICS --> + <!-- IF .pagination or TOTAL_TOPICS --> <ul class="linklist"> <li class="rightside pagination"> - <!-- IF TOTAL_TOPICS --> {TOTAL_TOPICS}<!-- ENDIF --> - <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> + <!-- IF TOTAL_TOPICS --> {TOTAL_TOPICS} • <!-- ENDIF --> + <!-- IF .pagination --> + <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • + <ul> + <!-- BEGIN pagination --> + <!-- IF pagination.S_IS_PREV --> + <!-- 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 --> + <!-- ELSE --> + <li><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a></li> + <!-- ENDIF --> + <!-- END pagination --> + </ul> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </li> </ul> <!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/mcp_front.html b/phpBB/styles/prosilver/template/mcp_front.html index 69e0b02a4e..57e57d8254 100644 --- a/phpBB/styles/prosilver/template/mcp_front.html +++ b/phpBB/styles/prosilver/template/mcp_front.html @@ -31,8 +31,8 @@ {L_POSTED} {L_POST_BY_AUTHOR} {unapproved.AUTHOR_FULL} » {unapproved.POST_TIME} </dt> <dd class="moderation"><span> - {L_TOPIC}: <a href="{unapproved.U_TOPIC}">{unapproved.TOPIC_TITLE}</a> [<a href="{unapproved.U_MCP_TOPIC}">{L_MODERATE}</a>]<br /> - {L_FORUM}: <!-- IF unapproved.U_FORUM --><a href="{unapproved.U_FORUM}">{unapproved.FORUM_NAME}</a><!-- ELSE -->{unapproved.FORUM_NAME}<!-- ENDIF --><!-- IF unapproved.U_MCP_FORUM --> [<a href="{unapproved.U_MCP_FORUM}">{L_MODERATE}</a>]<!-- ENDIF --></span> + {L_TOPIC}{L_COLON} <a href="{unapproved.U_TOPIC}">{unapproved.TOPIC_TITLE}</a> [<a href="{unapproved.U_MCP_TOPIC}">{L_MODERATE}</a>]<br /> + {L_FORUM}{L_COLON} <!-- IF unapproved.U_FORUM --><a href="{unapproved.U_FORUM}">{unapproved.FORUM_NAME}</a><!-- ELSE -->{unapproved.FORUM_NAME}<!-- ENDIF --><!-- IF unapproved.U_MCP_FORUM --> [<a href="{unapproved.U_MCP_FORUM}">{L_MODERATE}</a>]<!-- ENDIF --></span> </dd> <dd class="mark"><input type="checkbox" name="post_id_list[]" value="{unapproved.POST_ID}" /></dd> @@ -84,7 +84,7 @@ </dt> <dd class="moderation"> <span>{L_REPORTED} {L_POST_BY_AUTHOR} {report.REPORTER_FULL} {L_REPORTED_ON_DATE} {report.REPORT_TIME}<br /> - {L_FORUM}: <a href="{report.U_FORUM}">{report.FORUM_NAME}</a></span> + {L_FORUM}{L_COLON} <a href="{report.U_FORUM}">{report.FORUM_NAME}</a></span> </dd> </dl> </li> diff --git a/phpBB/styles/prosilver/template/mcp_logs.html b/phpBB/styles/prosilver/template/mcp_logs.html index b5561687b2..9e4a6f272e 100644 --- a/phpBB/styles/prosilver/template/mcp_logs.html +++ b/phpBB/styles/prosilver/template/mcp_logs.html @@ -9,11 +9,15 @@ <ul class="linklist"> <li class="leftside"> - {L_SEARCH_KEYWORDS}: <input type="text" class="inputbox autowidth" name="keywords" value="{S_KEYWORDS}" /> <input type="submit" class="button2" name="filter" value="{L_SEARCH}" /> + {L_SEARCH_KEYWORDS}{L_COLON} <input type="text" class="inputbox autowidth" name="keywords" value="{S_KEYWORDS}" /> <input type="submit" class="button2" name="filter" value="{L_SEARCH}" /> </li> <li class="rightside pagination"> - <!-- IF TOTAL -->{TOTAL} <!-- ENDIF --> - <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> + <!-- IF TOTAL -->{TOTAL} • <!-- ENDIF --> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </li> </ul> @@ -50,9 +54,9 @@ <!-- IF .log --> <fieldset class="display-options"> - <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> - <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> - <label>{L_DISPLAY_POSTS}: {S_SELECT_SORT_DAYS}</label> + <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> + <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> + <label>{L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS}</label> <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label> <label>{S_SELECT_SORT_DIR}</label> <input type="submit" name="sort" value="{L_GO}" class="button2" /> @@ -62,8 +66,12 @@ <ul class="linklist"> <li class="rightside pagination"> - <!-- IF TOTAL -->{TOTAL} <!-- ENDIF --> - <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> + <!-- IF TOTAL -->{TOTAL} • <!-- ENDIF --> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </li> </ul> {S_FORM_TOKEN} diff --git a/phpBB/styles/prosilver/template/mcp_move.html b/phpBB/styles/prosilver/template/mcp_move.html index 4611412a9e..d7a4f3d798 100644 --- a/phpBB/styles/prosilver/template/mcp_move.html +++ b/phpBB/styles/prosilver/template/mcp_move.html @@ -11,7 +11,7 @@ <fieldset> <dl class="fields2"> - <dt><label>{L_SELECT_DESTINATION_FORUM}:</label></dt> + <dt><label>{L_SELECT_DESTINATION_FORUM}{L_COLON}</label></dt> <dd><select name="to_forum_id">{S_FORUM_SELECT}</select></dd> <!-- IF S_CAN_LEAVE_SHADOW --><dd><label for="move_leave_shadow"><input type="checkbox" name="move_leave_shadow" id="move_leave_shadow" />{L_LEAVE_SHADOW}</label></dd><!-- ENDIF --> <!-- IF S_CAN_LOCK_TOPIC --><dd><label for="move_lock_topics"><input type="checkbox" name="move_lock_topics" id="move_lock_topics" />{L_LOCK_TOPIC}</label></dd><!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/mcp_notes_front.html b/phpBB/styles/prosilver/template/mcp_notes_front.html index 3da66ccb2e..db10284bce 100644 --- a/phpBB/styles/prosilver/template/mcp_notes_front.html +++ b/phpBB/styles/prosilver/template/mcp_notes_front.html @@ -9,7 +9,7 @@ <fieldset> <dl> - <dt><label for="username">{L_SELECT_USER}:</label></dt> + <dt><label for="username">{L_SELECT_USER}{L_COLON}</label></dt> <dd><input name="username" id="username" type="text" class="inputbox" /></dd> <dd><strong><a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a></strong></dd> </dl> diff --git a/phpBB/styles/prosilver/template/mcp_notes_user.html b/phpBB/styles/prosilver/template/mcp_notes_user.html index afe904dab3..3bbbd10f12 100644 --- a/phpBB/styles/prosilver/template/mcp_notes_user.html +++ b/phpBB/styles/prosilver/template/mcp_notes_user.html @@ -16,11 +16,11 @@ <div class="column2"> <dl class="details"> - <!-- IF RANK_TITLE --><dt>{L_RANK}:</dt><dd>{RANK_TITLE}</dd><!-- ENDIF --> - <!-- IF RANK_IMG --><dt><!-- IF RANK_TITLE --> <!-- ELSE -->{L_RANK}:<!-- ENDIF --></dt><dd>{RANK_IMG}</dd><!-- ENDIF --> - <dt>{L_JOINED}:</dt><dd>{JOINED}</dd> - <dt>{L_TOTAL_POSTS}:</dt><dd>{POSTS}</dd> - <dt>{L_WARNINGS}: </dt><dd>{WARNINGS}</dd> + <!-- IF RANK_TITLE --><dt>{L_RANK}{L_COLON}</dt><dd>{RANK_TITLE}</dd><!-- ENDIF --> + <!-- IF RANK_IMG --><dt><!-- IF RANK_TITLE --> <!-- ELSE -->{L_RANK}{L_COLON}<!-- ENDIF --></dt><dd>{RANK_IMG}</dd><!-- ENDIF --> + <dt>{L_JOINED}{L_COLON}</dt><dd>{JOINED}</dd> + <dt>{L_TOTAL_POSTS}{L_COLON}</dt><dd>{POSTS}</dd> + <dt>{L_WARNINGS}{L_COLON} </dt><dd>{WARNINGS}</dd> </dl> </div> </div> @@ -52,11 +52,15 @@ <ul class="linklist"> <li class="leftside"> - {L_SEARCH_KEYWORDS}: <input type="text" class="inputbox autowidth" name="keywords" value="{S_KEYWORDS}" /> <input type="submit" class="button2" name="filter" value="{L_SEARCH}" /> + {L_SEARCH_KEYWORDS}{L_COLON} <input type="text" class="inputbox autowidth" name="keywords" value="{S_KEYWORDS}" /> <input type="submit" class="button2" name="filter" value="{L_SEARCH}" /> </li> <li class="rightside pagination"> - <!-- IF TOTAL_REPORTS -->{TOTAL_REPORTS} <!-- ENDIF --> - <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> + <!-- IF TOTAL_REPORTS -->{TOTAL_REPORTS} • <!-- ENDIF --> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </li> </ul> @@ -91,9 +95,9 @@ <hr /> <fieldset class="display-options"> - <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> - <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> - <label>{L_DISPLAY_LOG}: {S_SELECT_SORT_DAYS}</label> + <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> + <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> + <label>{L_DISPLAY_LOG}{L_COLON} {S_SELECT_SORT_DAYS}</label> <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label> <input type="submit" name="sort" value="{L_GO}" class="button2" /> </fieldset> @@ -102,8 +106,12 @@ <ul class="linklist"> <li class="rightside pagination"> - <!-- IF TOTAL_REPORTS -->{TOTAL_REPORTS}<!-- ENDIF --> - <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> + <!-- IF TOTAL_REPORTS -->{TOTAL_REPORTS} • <!-- ENDIF --> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </li> </ul> diff --git a/phpBB/styles/prosilver/template/mcp_post.html b/phpBB/styles/prosilver/template/mcp_post.html index 752fbdd078..756a6eb114 100644 --- a/phpBB/styles/prosilver/template/mcp_post.html +++ b/phpBB/styles/prosilver/template/mcp_post.html @@ -11,7 +11,7 @@ <div class="inner"> <div class="postbody"> - <h3>{L_REPORT_REASON}: {REPORT_REASON_TITLE}</h3> + <h3>{L_REPORT_REASON}{L_COLON} {REPORT_REASON_TITLE}</h3> <p class="author">{L_REPORTED} {L_POST_BY_AUTHOR} {REPORTER_FULL} « {REPORT_DATE}</p> <!-- IF not S_POST_REPORTED --> <p class="rules">{L_REPORT_CLOSED}</p> @@ -59,10 +59,10 @@ <h3><a href="{U_VIEW_POST}">{POST_SUBJECT}</a></h3> <!-- IF S_PM --> <p class="author"> - <strong>{L_SENT_AT}:</strong> {POST_DATE} - <br /><strong>{L_PM_FROM}:</strong> {POST_AUTHOR_FULL} - <!-- IF S_TO_RECIPIENT --><br /><strong>{L_TO}:</strong> <!-- BEGIN to_recipient --><!-- IF to_recipient.NAME_FULL -->{to_recipient.NAME_FULL}<!-- ELSE --><a href="{to_recipient.U_VIEW}" style="color:<!-- IF to_recipient.COLOUR -->{to_recipient.COLOUR}<!-- ELSEIF to_recipient.IS_GROUP -->#0000FF<!-- ENDIF -->;">{to_recipient.NAME}</a><!-- ENDIF --> <!-- END to_recipient --><!-- ENDIF --> - <!-- IF S_BCC_RECIPIENT --><br /><strong>{L_BCC}:</strong> <!-- BEGIN bcc_recipient --><!-- IF bcc_recipient.NAME_FULL -->{bcc_recipient.NAME_FULL}<!-- ELSE --><a href="{bcc_recipient.U_VIEW}" style="color:<!-- IF bcc_recipient.COLOUR -->{bcc_recipient.COLOUR}<!-- ELSEIF bcc_recipient.IS_GROUP -->#0000FF<!-- ENDIF -->;">{bcc_recipient.NAME}</a><!-- ENDIF --> <!-- END bcc_recipient --><!-- ENDIF --> + <strong>{L_SENT_AT}{L_COLON}</strong> {POST_DATE} + <br /><strong>{L_PM_FROM}{L_COLON}</strong> {POST_AUTHOR_FULL} + <!-- IF S_TO_RECIPIENT --><br /><strong>{L_TO}{L_COLON}</strong> <!-- BEGIN to_recipient --><!-- IF to_recipient.NAME_FULL -->{to_recipient.NAME_FULL}<!-- ELSE --><a href="{to_recipient.U_VIEW}" style="color:<!-- IF to_recipient.COLOUR -->{to_recipient.COLOUR}<!-- ELSEIF to_recipient.IS_GROUP -->#0000FF<!-- ENDIF -->;">{to_recipient.NAME}</a><!-- ENDIF --> <!-- END to_recipient --><!-- ENDIF --> + <!-- IF S_BCC_RECIPIENT --><br /><strong>{L_BCC}{L_COLON}</strong> <!-- BEGIN bcc_recipient --><!-- IF bcc_recipient.NAME_FULL -->{bcc_recipient.NAME_FULL}<!-- ELSE --><a href="{bcc_recipient.U_VIEW}" style="color:<!-- IF bcc_recipient.COLOUR -->{bcc_recipient.COLOUR}<!-- ELSEIF bcc_recipient.IS_GROUP -->#0000FF<!-- ENDIF -->;">{bcc_recipient.NAME}</a><!-- ENDIF --> <!-- END bcc_recipient --><!-- ENDIF --> </p> <!-- ELSE --> <p class="author">{MINI_POST_IMG} {L_POSTED} {L_POST_BY_AUTHOR} {POST_AUTHOR_FULL} » {POST_DATE}</p> @@ -106,7 +106,7 @@ <!-- IF S_MCP_REPORT and S_CAN_VIEWIP --> <hr /> - <div><!-- IF S_PM -->{L_THIS_PM_IP}<!-- ELSE -->{L_THIS_POST_IP}<!-- ENDIF -->: <!-- IF U_WHOIS --> + <div><!-- IF S_PM -->{L_THIS_PM_IP}<!-- ELSE -->{L_THIS_POST_IP}<!-- ENDIF -->{L_COLON} <!-- IF U_WHOIS --> <a href="{U_WHOIS}"><!-- IF POST_IPADDR -->{POST_IPADDR}<!-- ELSE -->{POST_IP}<!-- ENDIF --></a> (<!-- IF POST_IPADDR -->{POST_IP}<!-- ELSE --><a href="{U_LOOKUP_IP}">{L_LOOKUP_IP}</a><!-- ENDIF -->) <!-- ELSE --> <!-- IF POST_IPADDR -->{POST_IPADDR} ({POST_IP})<!-- ELSE -->{POST_IP}<!-- IF U_LOOKUP_IP --> (<a href="{U_LOOKUP_IP}">{L_LOOKUP_IP}</a>)<!-- ENDIF --><!-- ENDIF --> @@ -128,7 +128,7 @@ <fieldset> <dl> - <dt><label>{L_CHANGE_POSTER}:</label></dt> + <dt><label>{L_CHANGE_POSTER}{L_COLON}</label></dt> <!-- IF S_USER_SELECT --><dd><select name="u">{S_USER_SELECT}</select> <input type="submit" class="button2" name="action[chgposter_ip]" value="{L_CONFIRM}" /></dd><!-- ENDIF --> <dd style="margin-top:3px;"> <input class="inputbox autowidth" type="text" name="username" value="" /> @@ -147,7 +147,7 @@ <fieldset> <dl> - <dt><label>{L_MOD_OPTIONS}:</label></dt> + <dt><label>{L_MOD_OPTIONS}{L_COLON}</label></dt> <dd><select name="action"> <!-- IF S_CAN_LOCK_POST --><!-- IF S_POST_LOCKED --><option value="unlock_post">{L_UNLOCK_POST} [{L_UNLOCK_POST_EXPLAIN}]</option><!-- ELSE --><option value="lock_post">{L_LOCK_POST} [{L_LOCK_POST_EXPLAIN}]</option><!-- ENDIF --><!-- ENDIF --> <!-- IF S_CAN_DELETE_POST --><option value="delete_post">{L_DELETE_POST}</option><!-- ENDIF --> @@ -187,7 +187,7 @@ <h3>{L_FEEDBACK}</h3> <!-- BEGIN usernotes --> - <span class="small"><strong>{L_REPORTED_BY}: {usernotes.REPORT_BY} « {usernotes.REPORT_AT}</strong></span> + <span class="small"><strong>{L_REPORTED_BY}{L_COLON} {usernotes.REPORT_BY} « {usernotes.REPORT_AT}</strong></span> <!-- IF S_CLEAR_ALLOWED --><div class="right-box"><input type="checkbox" name="marknote[]" value="{usernotes.ID}" /></div><!-- ENDIF --> <div class="postbody">{usernotes.ACTION}</div> @@ -227,8 +227,8 @@ <h3>{L_MCP_POST_REPORTS}</h3> <!-- BEGIN reports --> - <span class="small"><strong>{L_REPORTED_BY}: <!-- IF reports.U_REPORTER --><a href="{reports.U_REPORTER}">{reports.REPORTER}</a><!-- ELSE -->{reports.REPORTER}<!-- ENDIF --> « {reports.REPORT_TIME}</strong></span> - <p><em>{reports.REASON_TITLE}: {reports.REASON_DESC}</em><!-- IF reports.REPORT_TEXT --><br />{reports.REPORT_TEXT}<!-- ENDIF --></p> + <span class="small"><strong>{L_REPORTED_BY}{L_COLON} <!-- IF reports.U_REPORTER --><a href="{reports.U_REPORTER}">{reports.REPORTER}</a><!-- ELSE -->{reports.REPORTER}<!-- ENDIF --> « {reports.REPORT_TIME}</strong></span> + <p><em>{reports.REASON_TITLE}{L_COLON} {reports.REASON_DESC}</em><!-- IF reports.REPORT_TEXT --><br />{reports.REPORT_TEXT}<!-- ENDIF --></p> <!-- END reports --> </div> @@ -239,7 +239,7 @@ <div class="panel" id="ip"> <div class="inner"> - <p>{L_THIS_POST_IP}: <!-- IF U_WHOIS --> + <p>{L_THIS_POST_IP}{L_COLON} <!-- IF U_WHOIS --> <a href="{U_WHOIS}"><!-- IF POST_IPADDR -->{POST_IPADDR}<!-- ELSE -->{POST_IP}<!-- ENDIF --></a> (<!-- IF POST_IPADDR -->{POST_IP}<!-- ELSE --><a href="{U_LOOKUP_IP}">{L_LOOKUP_IP}</a><!-- ENDIF -->) <!-- ELSE --> <!-- IF POST_IPADDR -->{POST_IPADDR} ({POST_IP})<!-- ELSE -->{POST_IP}<!-- IF U_LOOKUP_IP --> (<a href="{U_LOOKUP_IP}">{L_LOOKUP_IP}</a>)<!-- ENDIF --><!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/mcp_queue.html b/phpBB/styles/prosilver/template/mcp_queue.html index e9a477a24c..847151a01e 100644 --- a/phpBB/styles/prosilver/template/mcp_queue.html +++ b/phpBB/styles/prosilver/template/mcp_queue.html @@ -3,7 +3,7 @@ <form id="mcp" method="post" action="{S_MCP_ACTION}"> <fieldset class="forum-selection"> - <label for="fo">{L_FORUM}: <select name="f" id="fo">{S_FORUM_OPTIONS}</select></label> + <label for="fo">{L_FORUM}{L_COLON} <select name="f" id="fo">{S_FORUM_OPTIONS}</select></label> <input type="submit" name="sort" value="{L_GO}" class="button2" /> {S_FORM_TOKEN} </fieldset> @@ -18,8 +18,12 @@ <!-- IF .postrow --> <ul class="linklist"> <li class="rightside pagination"> - <!-- IF TOTAL --> {TOTAL}<!-- ENDIF --> - <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> + <!-- IF TOTAL --> {TOTAL} • <!-- ENDIF --> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </li> </ul> <ul class="topiclist"> @@ -47,8 +51,8 @@ </dt> <dd class="moderation"> <span> - <!-- IF S_TOPICS --><br /><!-- ELSE -->{L_TOPIC}: <a href="{postrow.U_TOPIC}">{postrow.TOPIC_TITLE}</a> <br /><!-- ENDIF --> - {L_FORUM}: <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a> + <!-- IF S_TOPICS --><br /><!-- ELSE -->{L_TOPIC}{L_COLON} <a href="{postrow.U_TOPIC}">{postrow.TOPIC_TITLE}</a> <br /><!-- ENDIF --> + {L_FORUM}{L_COLON} <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a> </span> </dd> @@ -61,9 +65,9 @@ </ul> <fieldset class="display-options"> - <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> - <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> - <label>{L_DISPLAY_POSTS}: {S_SELECT_SORT_DAYS}</label> + <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> + <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> + <label>{L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS}</label> <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label> <!-- IF TOPIC_ID --><label><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" /> <strong>{L_ONLY_TOPIC}</strong></label><!-- ENDIF --> <input type="submit" name="sort" value="{L_GO}" class="button2" /> @@ -73,8 +77,12 @@ <ul class="linklist"> <li class="rightside pagination"> - <!-- IF TOTAL -->{TOTAL}<!-- ENDIF --> - <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> + <!-- IF TOTAL -->{TOTAL} • <!-- ENDIF --> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </li> </ul> <!-- ELSE --> diff --git a/phpBB/styles/prosilver/template/mcp_reports.html b/phpBB/styles/prosilver/template/mcp_reports.html index 95e7d9e021..ea9a4edd6f 100644 --- a/phpBB/styles/prosilver/template/mcp_reports.html +++ b/phpBB/styles/prosilver/template/mcp_reports.html @@ -4,7 +4,7 @@ <!-- IF not S_PM --> <fieldset class="forum-selection"> - <label for="fo">{L_FORUM}: <select name="f" id="fo">{S_FORUM_OPTIONS}</select></label> + <label for="fo">{L_FORUM}{L_COLON} <select name="f" id="fo">{S_FORUM_OPTIONS}</select></label> <input type="submit" name="sort" value="{L_GO}" class="button2" /> {S_FORM_TOKEN} </fieldset> @@ -20,8 +20,12 @@ <!-- IF .postrow --> <ul class="linklist"> <li class="rightside pagination"> - <!-- IF TOTAL -->{TOTAL_REPORTS}<!-- ENDIF --> - <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> + <!-- IF TOTAL -->{TOTAL_REPORTS} • <!-- ENDIF --> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </li> </ul> <ul class="topiclist"> @@ -54,7 +58,7 @@ </dt> <dd class="moderation"> <span>{postrow.REPORTER_FULL} « {postrow.REPORT_TIME}<br /> - <!-- IF postrow.U_VIEWFORUM -->{L_FORUM}: <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a><!-- ELSE -->{postrow.FORUM_NAME}<!-- ENDIF --></span> + <!-- IF postrow.U_VIEWFORUM -->{L_FORUM}{L_COLON} <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a><!-- ELSE -->{postrow.FORUM_NAME}<!-- ENDIF --></span> </dd> <!-- ENDIF --> <dd class="mark"><input type="checkbox" name="report_id_list[]" value="{postrow.REPORT_ID}" /></dd> @@ -64,9 +68,9 @@ </ul> <fieldset class="display-options"> - <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> - <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> - <label>{L_DISPLAY_POSTS}: {S_SELECT_SORT_DAYS}</label> + <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> + <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> + <label>{L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS}</label> <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label> <!-- IF TOPIC_ID --><label><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" /> <strong>{L_ONLY_TOPIC}</strong></label><!-- ENDIF --> <input type="submit" name="sort" value="{L_GO}" class="button2" /> @@ -74,8 +78,12 @@ <hr /> <ul class="linklist"> <li class="rightside pagination"> - <!-- IF TOTAL -->{TOTAL_REPORTS}<!-- ENDIF --> - <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> + <!-- IF TOTAL -->{TOTAL_REPORTS} • <!-- ENDIF --> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </li> </ul> diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html index 8d0294d226..a89fd8a171 100644 --- a/phpBB/styles/prosilver/template/mcp_topic.html +++ b/phpBB/styles/prosilver/template/mcp_topic.html @@ -1,7 +1,7 @@ <!-- INCLUDE mcp_header.html --> <div class="tabs-container"> -<h2><a href="{U_VIEW_TOPIC}">{L_TOPIC}: {TOPIC_TITLE}</a></h2> +<h2><a href="{U_VIEW_TOPIC}">{L_TOPIC}{L_COLON} {TOPIC_TITLE}</a></h2> <script type="text/javascript"> // <![CDATA[ @@ -22,15 +22,13 @@ onload_functions.push('subPanels()'); <div id="minitabs"> <ul> - <li id="display-panel-tab"<!-- IF not S_MERGE_VIEW --> class="activetab"<!-- ENDIF --> + <li id="display-panel-tab"<!-- IF not S_MERGE_VIEW --> class="activetab"<!-- ENDIF -->> <a href="#minitabs" onclick="subPanels('display-panel'); return false;"><span>{L_DISPLAY_OPTIONS}</span></a> </li> <li id="split-panel-tab"> - <a href="#minitabs" onclick="subPanels('split-panel'); return false;"><span>{L_SPLIT_TOPIC}</span></a> </li> <li id="merge-panel-tab"<!-- IF S_MERGE_VIEW --> class="activetab"<!-- ENDIF -->> - <a href="#minitabs" onclick="subPanels('merge-panel'); return false;"><span>{L_MERGE_POSTS}</span></a> </li> </ul> @@ -44,11 +42,11 @@ onload_functions.push('subPanels()'); <fieldset id="display-panel" class="fields2"> <dl> - <dt><label for="posts_per_page">{L_POSTS_PER_PAGE}:</label><br /><span>{L_POSTS_PER_PAGE_EXPLAIN}</span></dt> + <dt><label for="posts_per_page">{L_POSTS_PER_PAGE}{L_COLON}</label><br /><span>{L_POSTS_PER_PAGE_EXPLAIN}</span></dt> <dd><input class="inputbox autowidth" type="text" name="posts_per_page" id="posts_per_page" size="6" value="{POSTS_PER_PAGE}" /></dd> </dl> <dl> - <dt><label>{L_DISPLAY_POSTS}:</label></dt> + <dt><label>{L_DISPLAY_POSTS}{L_COLON}</label></dt> <dd>{S_SELECT_SORT_DAYS} <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label> <input type="submit" name="sort" value="{L_GO}" class="button2" /></dd> </dl> </fieldset> @@ -59,18 +57,18 @@ onload_functions.push('subPanels()'); <!-- IF S_SHOW_TOPIC_ICONS --> <dl> - <dt><label for="icon">{L_TOPIC_ICON}:</label></dt> + <dt><label for="icon">{L_TOPIC_ICON}{L_COLON}</label></dt> <dd><label for="icon"><input type="radio" name="icon" id="icon" value="0" checked="checked" /> {L_NO_TOPIC_ICON}</label> <!-- BEGIN topic_icon --><label for="icon-{topic_icon.ICON_ID}"><input type="radio" name="icon" id="icon-{topic_icon.ICON_ID}" value="{topic_icon.ICON_ID}" {topic_icon.S_ICON_CHECKED} /><img src="{topic_icon.ICON_IMG}" width="{topic_icon.ICON_WIDTH}" height="{topic_icon.ICON_HEIGHT}" alt="" title="" /></label> <!-- END topic_icon --></dd> </dl> <!-- ENDIF --> <dl> - <dt><label for="subject">{L_SPLIT_SUBJECT}:</label></dt> + <dt><label for="subject">{L_SPLIT_SUBJECT}{L_COLON}</label></dt> <dd><input type="text" name="subject" id="subject" size="45" maxlength="124" tabindex="2" value="{SPLIT_SUBJECT}" title="{L_SPLIT_SUBJECT}" class="inputbox" /></dd> </dl> <dl> - <dt><label>{L_SPLIT_FORUM}:</label></dt> + <dt><label>{L_SPLIT_FORUM}{L_COLON}</label></dt> <dd><select name="to_forum_id">{S_FORUM_SELECT}</select></dd> </dl> </fieldset> @@ -80,7 +78,7 @@ onload_functions.push('subPanels()'); <fieldset id="merge-panel" class="fields2"> <p>{L_MERGE_TOPIC_EXPLAIN}</p> <dl> - <dt><label for="to_topic_id">{L_MERGE_TOPIC_ID}:</label></dt> + <dt><label for="to_topic_id">{L_MERGE_TOPIC_ID}{L_COLON}</label></dt> <dd> <input class="inputbox autowidth" type="text" size="6" name="to_topic_id" id="to_topic_id" value="{TO_TOPIC_ID}" /> <a href="{U_SELECT_TOPIC}" >{L_SELECT_TOPIC}</a> @@ -98,7 +96,7 @@ onload_functions.push('subPanels()'); <h3 id="review"> <span class="right-box"><a href="#review" onclick="viewableArea(getElementById('topicreview'), true); var rev_text = getElementById('review').getElementsByTagName('a').item(0).firstChild; if (rev_text.data == '{LA_EXPAND_VIEW}'){rev_text.data = '{LA_COLLAPSE_VIEW}'; } else if (rev_text.data == '{LA_COLLAPSE_VIEW}'){rev_text.data = '{LA_EXPAND_VIEW}'};">{L_EXPAND_VIEW}</a></span> - {L_TOPIC_REVIEW}: {TOPIC_TITLE} + {L_TOPIC_REVIEW}{L_COLON} {TOPIC_TITLE} </h3> <div id="topicreview"> @@ -107,7 +105,7 @@ onload_functions.push('subPanels()'); <div class="inner"> <div class="postbody" id="pr{postrow.POST_ID}"> - <ul class="profile-icons"><li class="info-icon"><a href="{postrow.U_POST_DETAILS}" title="{L_POST_DETAILS}"><span>{L_POST_DETAILS}</span></a></li><li><label for="post_id_list_select_{postrow.POST_ID}">{L_SELECT}: <input type="checkbox" id="post_id_list_select_{postrow.POST_ID}" name="post_id_list[]" value="{postrow.POST_ID}"<!-- IF postrow.S_CHECKED --> checked="checked"<!-- ENDIF --> /></label></li></ul> + <ul class="profile-icons"><li class="info-icon"><a href="{postrow.U_POST_DETAILS}" title="{L_POST_DETAILS}"><span>{L_POST_DETAILS}</span></a></li><li><label for="post_id_list_select_{postrow.POST_ID}">{L_SELECT}{L_COLON} <input type="checkbox" id="post_id_list_select_{postrow.POST_ID}" name="post_id_list[]" value="{postrow.POST_ID}"<!-- IF postrow.S_CHECKED --> checked="checked"<!-- ENDIF --> /></label></li></ul> <h3><a href="{postrow.U_POST_DETAILS}">{postrow.POST_SUBJECT}</a></h3> <p class="author"><a href="#pr{postrow.POST_ID}">{postrow.MINI_POST_IMG}</a> {L_POSTED} {postrow.POST_DATE} {L_POST_BY_AUTHOR} <strong>{postrow.POST_AUTHOR_FULL}</strong><!-- IF postrow.U_MCP_DETAILS --> [ <a href="{postrow.U_MCP_DETAILS}">{L_POST_DETAILS}</a> ]<!-- ENDIF --></p> @@ -139,11 +137,15 @@ onload_functions.push('subPanels()'); <hr /> - <!-- IF PAGINATION or TOTAL_POSTS --> + <!-- IF .pagination or TOTAL_POSTS --> <ul class="linklist"> <li class="rightside pagination"> - <!-- IF TOTAL_POSTS --> {TOTAL_POSTS}<!-- ENDIF --> - <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> + <!-- IF TOTAL_POSTS --> {TOTAL_POSTS} • <!-- ENDIF --> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </li> </ul> <!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/mcp_warn_front.html b/phpBB/styles/prosilver/template/mcp_warn_front.html index df3497eb25..5a332cf202 100644 --- a/phpBB/styles/prosilver/template/mcp_warn_front.html +++ b/phpBB/styles/prosilver/template/mcp_warn_front.html @@ -11,7 +11,7 @@ <fieldset> <dl> - <dt><label for="username">{L_SELECT_USER}:</label></dt> + <dt><label for="username">{L_SELECT_USER}{L_COLON}</label></dt> <dd><input name="username" id="username" type="text" class="inputbox" /></dd> <dd><strong><a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a></strong></dd> </dl> diff --git a/phpBB/styles/prosilver/template/mcp_warn_list.html b/phpBB/styles/prosilver/template/mcp_warn_list.html index e4f82bbe67..69aa185391 100644 --- a/phpBB/styles/prosilver/template/mcp_warn_list.html +++ b/phpBB/styles/prosilver/template/mcp_warn_list.html @@ -12,8 +12,25 @@ <!-- IF .user --> <ul class="linklist"> <li class="rightside pagination"> - <!-- IF TOTAL_USERS -->{TOTAL_USERS} <!-- ENDIF --> - <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> + <!-- IF TOTAL_USERS -->{TOTAL_USERS} • <!-- ENDIF --> + <!-- IF .pagination --> + <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • + <ul> + <!-- BEGIN pagination --> + <!-- IF pagination.S_IS_PREV --> + <!-- 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 --> + <!-- ELSE --> + <li><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a></li> + <!-- ENDIF --> + <!-- END pagination --> + </ul> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </li> </ul> @@ -40,7 +57,7 @@ </table> <fieldset class="display-options"> - <label>{L_DISPLAY_POSTS}: {S_SELECT_SORT_DAYS}</label> + <label>{L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS}</label> <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label> <input type="submit" name="sort" value="{L_GO}" class="button2" /> </fieldset> @@ -48,8 +65,12 @@ <ul class="linklist"> <li class="rightside pagination"> - <!-- IF TOTAL_USERS -->{TOTAL_USERS} <!-- ENDIF --> - <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> + <!-- IF TOTAL_USERS -->{TOTAL_USERS} • <!-- ENDIF --> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </li> </ul> <!-- ELSE --> diff --git a/phpBB/styles/prosilver/template/mcp_warn_post.html b/phpBB/styles/prosilver/template/mcp_warn_post.html index 540abb9473..0dd2e14d92 100644 --- a/phpBB/styles/prosilver/template/mcp_warn_post.html +++ b/phpBB/styles/prosilver/template/mcp_warn_post.html @@ -16,11 +16,11 @@ <div class="column2"> <dl class="details"> - <!-- IF RANK_TITLE --><dt>{L_RANK}:</dt><dd>{RANK_TITLE}</dd><!-- ENDIF --> - <!-- IF RANK_IMG --><dt><!-- IF RANK_TITLE --> <!-- ELSE -->{L_RANK}:<!-- ENDIF --></dt><dd>{RANK_IMG}</dd><!-- ENDIF --> - <dt>{L_JOINED}:</dt><dd>{JOINED}</dd> - <dt>{L_TOTAL_POSTS}:</dt><dd>{POSTS}</dd> - <dt>{L_WARNINGS}: </dt><dd>{WARNINGS}</dd> + <!-- IF RANK_TITLE --><dt>{L_RANK}{L_COLON}</dt><dd>{RANK_TITLE}</dd><!-- ENDIF --> + <!-- IF RANK_IMG --><dt><!-- IF RANK_TITLE --> <!-- ELSE -->{L_RANK}{L_COLON}<!-- ENDIF --></dt><dd>{RANK_IMG}</dd><!-- ENDIF --> + <dt>{L_JOINED}{L_COLON}</dt><dd>{JOINED}</dd> + <dt>{L_TOTAL_POSTS}{L_COLON}</dt><dd>{POSTS}</dd> + <dt>{L_WARNINGS}{L_COLON} </dt><dd>{WARNINGS}</dd> </dl> </div> </div> diff --git a/phpBB/styles/prosilver/template/mcp_warn_user.html b/phpBB/styles/prosilver/template/mcp_warn_user.html index 5e99c8d7e1..1541f2e5f6 100644 --- a/phpBB/styles/prosilver/template/mcp_warn_user.html +++ b/phpBB/styles/prosilver/template/mcp_warn_user.html @@ -16,11 +16,11 @@ <div class="column2"> <dl class="details"> - <!-- IF RANK_TITLE --><dt>{L_RANK}:</dt><dd>{RANK_TITLE}</dd><!-- ENDIF --> - <!-- IF RANK_IMG --><dt><!-- IF RANK_TITLE --> <!-- ELSE -->{L_RANK}:<!-- ENDIF --></dt><dd>{RANK_IMG}</dd><!-- ENDIF --> - <dt>{L_JOINED}:</dt><dd>{JOINED}</dd> - <dt>{L_TOTAL_POSTS}:</dt><dd>{POSTS}</dd> - <dt>{L_WARNINGS}: </dt><dd>{WARNINGS}</dd> + <!-- IF RANK_TITLE --><dt>{L_RANK}{L_COLON}</dt><dd>{RANK_TITLE}</dd><!-- ENDIF --> + <!-- IF RANK_IMG --><dt><!-- IF RANK_TITLE --> <!-- ELSE -->{L_RANK}{L_COLON}<!-- ENDIF --></dt><dd>{RANK_IMG}</dd><!-- ENDIF --> + <dt>{L_JOINED}{L_COLON}</dt><dd>{JOINED}</dd> + <dt>{L_TOTAL_POSTS}{L_COLON}</dt><dd>{POSTS}</dd> + <dt>{L_WARNINGS}{L_COLON} </dt><dd>{WARNINGS}</dd> </dl> </div> </div> diff --git a/phpBB/styles/prosilver/template/mcp_whois.html b/phpBB/styles/prosilver/template/mcp_whois.html index 88d3269a71..41a825458d 100644 --- a/phpBB/styles/prosilver/template/mcp_whois.html +++ b/phpBB/styles/prosilver/template/mcp_whois.html @@ -4,11 +4,11 @@ <div class="panel"> <div class="inner"> - <p><a class="{S_CONTENT_FLOW_BEGIN}" href="{U_RETURN_POST}">{L_RETURN_POST}</a></p> + <p><a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_RETURN_POST}">{L_RETURN_POST}</a></p> <div class="postbody"><div class="content"> <pre>{WHOIS}</pre> </div></div> - <p><a class="{S_CONTENT_FLOW_BEGIN}" href="{U_RETURN_POST}">{L_RETURN_POST}</a></p> + <p><a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_RETURN_POST}">{L_RETURN_POST}</a></p> </div> </div> diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html index d5154761e9..4ba0c5cb2a 100644 --- a/phpBB/styles/prosilver/template/memberlist_body.html +++ b/phpBB/styles/prosilver/template/memberlist_body.html @@ -4,7 +4,7 @@ <form method="post" id="results" action="{S_MODE_ACTION}" onsubmit="insert_marked(this.user); return false"> <!-- ELSEIF S_SEARCH_USER --> - <!-- INCLUDE overall_header.html --> + <!-- INCLUDE overall_header.html --> <!-- INCLUDE memberlist_search.html --> <form method="post" action="{S_MODE_ACTION}"> @@ -25,7 +25,7 @@ </p> <!-- ELSE --> - <h2 class="solo">{PAGE_TITLE}<!-- IF SEARCH_WORDS -->: <a href="{U_SEARCH_WORDS}">{SEARCH_WORDS}</a><!-- ENDIF --></h2> + <h2 class="solo">{PAGE_TITLE}<!-- IF SEARCH_WORDS -->{L_COLON} <a href="{U_SEARCH_WORDS}">{SEARCH_WORDS}</a><!-- ENDIF --></h2> <div class="panel"> <div class="inner"> @@ -36,13 +36,18 @@ <!-- IF U_FIND_MEMBER and not S_SEARCH_USER --><a href="{U_FIND_MEMBER}">{L_FIND_USERNAME}</a> • <!-- ELSEIF S_SEARCH_USER and U_HIDE_FIND_MEMBER and not S_IN_SEARCH_POPUP --><a href="{U_HIDE_FIND_MEMBER}">{L_HIDE_MEMBER_SEARCH}</a> • <!-- ENDIF --> <strong style="font-size: 0.95em;"> <!-- BEGIN first_char --> - <a href="{first_char.U_SORT}">{first_char.DESC}</a> + <a href="{first_char.U_SORT}">{first_char.DESC}</a> <!-- END first_char --> </strong> </li> <li class="rightside pagination"> - {TOTAL_USERS} • - <!-- IF PAGINATION --><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE -->{PAGE_NUMBER}<!-- ENDIF --> + {TOTAL_USERS} + <!-- IF .pagination --> + • + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </li> </ul> @@ -109,7 +114,7 @@ <tr class="<!-- IF memberrow.S_ROW_COUNT is even -->bg1<!-- ELSE -->bg2<!-- ENDIF -->"> <td><!-- IF memberrow.RANK_IMG --><span class="rank-img">{memberrow.RANK_IMG}</span><!-- ELSE --><span class="rank-img">{memberrow.RANK_TITLE}</span><!-- ENDIF --><!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><input type="checkbox" name="user" value="{memberrow.USERNAME}" /> <!-- ENDIF -->{memberrow.USERNAME_FULL}<!-- IF S_SELECT_SINGLE --><br />[ <a href="#" onclick="insert_single('{memberrow.A_USERNAME}'); return false;">{L_SELECT}</a> ]<!-- ENDIF --></td> <td class="posts"><!-- IF memberrow.POSTS and S_DISPLAY_SEARCH --><a href="{memberrow.U_SEARCH_USER}" title="{L_SEARCH_USER_POSTS}">{memberrow.POSTS}</a><!-- ELSE -->{memberrow.POSTS}<!-- ENDIF --></td> - <td class="info"><!-- IF memberrow.U_WWW or memberrow.LOCATION --><!-- IF memberrow.U_WWW --><div><a href="{memberrow.U_WWW}" title="{L_VISIT_WEBSITE}: {memberrow.U_WWW}">{memberrow.U_SHORT_WWW}</a></div><!-- ENDIF --><!-- IF memberrow.LOCATION --><div>{memberrow.LOCATION}</div><!-- ENDIF --><!-- ELSE --> <!-- ENDIF --></td> + <td class="info"><!-- IF memberrow.U_WWW or memberrow.LOCATION --><!-- IF memberrow.U_WWW --><div><a href="{memberrow.U_WWW}" title="{L_VISIT_WEBSITE}{L_COLON} {memberrow.U_WWW}">{memberrow.U_SHORT_WWW}</a></div><!-- ENDIF --><!-- IF memberrow.LOCATION --><div>{memberrow.LOCATION}</div><!-- ENDIF --><!-- ELSE --> <!-- ENDIF --></td> <td>{memberrow.JOINED}</td> <!-- IF S_VIEWONLINE --><td>{memberrow.VISITED} </td><!-- ENDIF --> </tr> @@ -138,9 +143,9 @@ <!-- IF S_IN_SEARCH_POPUP and not S_SEARCH_USER --> <fieldset class="display-options"> - <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> - <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> - <label for="sk">{L_SELECT_SORT_METHOD}: <select name="sk" id="sk">{S_MODE_SELECT}</select></label> + <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> + <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> + <label for="sk">{L_SELECT_SORT_METHOD}{L_COLON} <select name="sk" id="sk">{S_MODE_SELECT}</select></label> <label for="sd">{L_ORDER} <select name="sd" id="sd">{S_ORDER_SELECT}</select> <input type="submit" name="sort" value="{L_SUBMIT}" class="button2" /></label> </fieldset> <!-- ENDIF --> @@ -150,7 +155,14 @@ <hr /> <ul class="linklist"> - <li class="rightside pagination">{TOTAL_USERS} • <!-- IF PAGINATION --><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE -->{PAGE_NUMBER}<!-- ENDIF --></li> + <li class="rightside pagination">{TOTAL_USERS} + <!-- IF .pagination --> + • + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> + </li> </ul> <!-- IF S_IN_SEARCH_POPUP --> diff --git a/phpBB/styles/prosilver/template/memberlist_email.html b/phpBB/styles/prosilver/template/memberlist_email.html index 97bea144e8..c40a5f1a8b 100644 --- a/phpBB/styles/prosilver/template/memberlist_email.html +++ b/phpBB/styles/prosilver/template/memberlist_email.html @@ -12,30 +12,30 @@ <fieldset class="fields2"> <!-- IF S_SEND_USER --> <dl> - <dt><label>{L_RECIPIENT}:</label></dt> + <dt><label>{L_RECIPIENT}{L_COLON}</label></dt> <dd><strong>{USERNAME}</strong></dd> </dl> <dl> - <dt><label for="subject">{L_SUBJECT}:</label></dt> + <dt><label for="subject">{L_SUBJECT}{L_COLON}</label></dt> <dd><input class="inputbox autowidth" type="text" name="subject" id="subject" size="50" tabindex="1" value="{SUBJECT}" /></dd> </dl> <!-- ELSE --> <dl> - <dt><label for="email">{L_EMAIL_ADDRESS}:</label></dt> + <dt><label for="email">{L_EMAIL_ADDRESS}{L_COLON}</label></dt> <dd><input class="inputbox autowidth" type="text" name="email" id="email" size="50" maxlength="100" tabindex="2" value="{EMAIL}" /></dd> </dl> <dl> - <dt><label for="name">{L_REAL_NAME}:</label></dt> + <dt><label for="name">{L_REAL_NAME}{L_COLON}</label></dt> <dd><input class="inputbox autowidth" type="text" name="name" id="name" size="50" tabindex="3" value="{NAME}" /></dd> </dl> <dl> - <dt><label for="lang">{L_DEST_LANG}:</label><br /> + <dt><label for="lang">{L_DEST_LANG}{L_COLON}</label><br /> <span>{L_DEST_LANG_EXPLAIN}</span></dt> <dd><select name="lang">{S_LANG_OPTIONS}</select></dd> </dl> <!-- ENDIF --> <dl> - <dt><label for="message">{L_MESSAGE_BODY}:</label><br /> + <dt><label for="message">{L_MESSAGE_BODY}{L_COLON}</label><br /> <span>{L_EMAIL_BODY_EXPLAIN}</span></dt> <dd><textarea class="inputbox" name="message" id="message" rows="15" cols="76" tabindex="4">{MESSAGE}</textarea></dd> </dl> diff --git a/phpBB/styles/prosilver/template/memberlist_im.html b/phpBB/styles/prosilver/template/memberlist_im.html index ccef778ebb..68aed0b3dd 100644 --- a/phpBB/styles/prosilver/template/memberlist_im.html +++ b/phpBB/styles/prosilver/template/memberlist_im.html @@ -12,17 +12,17 @@ <fieldset> <dl class="fields2"> - <dt><label>{L_IM_RECIPIENT}:</label></dt> + <dt><label>{L_IM_RECIPIENT}{L_COLON}</label></dt> <dd><strong>{USERNAME}</strong><!-- IF S_SEND_ICQ or S_SEND_AIM or S_SEND_MSNM or S_NO_SEND_JABBER --> [ {IM_CONTACT} ]<!-- ENDIF --><!-- IF PRESENCE_IMG --> {PRESENCE_IMG}<!-- ENDIF --></dd> </dl> <!-- IF S_SEND_ICQ --> <dl class="fields2"> - <dt><label for="from">{L_IM_NAME}:</label></dt> + <dt><label for="from">{L_IM_NAME}{L_COLON}</label></dt> <dd><input class="inputbox autowidth" type="text" name="from" id="from" size="20" /></dd> </dl> <dl class="fields2"> - <dt><label for="body">{L_IM_MESSAGE}:</label></dt> + <dt><label for="body">{L_IM_MESSAGE}{L_COLON}</label></dt> <dd><textarea class="inputbox autowidth" name="body" id="body" rows="5" cols="45"></textarea></dd> </dl> <dl class="fields2"> @@ -54,7 +54,7 @@ <!-- IF S_SEND_JABBER --> <dl class="fields2"> - <dt><label for="message">{L_IM_MESSAGE}:</label></dt> + <dt><label for="message">{L_IM_MESSAGE}{L_COLON}</label></dt> <dd><textarea class="inputbox autowidth" name="message" id="message" rows="5" cols="45"></textarea></dd> </dl> <dl class="fields2"> diff --git a/phpBB/styles/prosilver/template/memberlist_search.html b/phpBB/styles/prosilver/template/memberlist_search.html index 2ea32fc774..6fed528cea 100644 --- a/phpBB/styles/prosilver/template/memberlist_search.html +++ b/phpBB/styles/prosilver/template/memberlist_search.html @@ -50,60 +50,60 @@ function insert_single(user) <fieldset class="fields1 column1"> <dl> - <dt><label for="username">{L_USERNAME}:</label></dt> + <dt><label for="username">{L_USERNAME}{L_COLON}</label></dt> <dd><input type="text" name="username" id="username" value="{USERNAME}" class="inputbox" /></dd> </dl> <!-- IF S_EMAIL_SEARCH_ALLOWED --> <dl> - <dt><label for="email">{L_EMAIL}:</label></dt> + <dt><label for="email">{L_EMAIL}{L_COLON}</label></dt> <dd><input type="text" name="email" id="email" value="{EMAIL}" class="inputbox" /></dd> </dl> <!-- ENDIF --> <dl> - <dt><label for="icq">{L_ICQ}:</label></dt> + <dt><label for="icq">{L_ICQ}{L_COLON}</label></dt> <dd><input type="text" name="icq" id="icq" value="{ICQ}" class="inputbox" /></dd> </dl> <dl> - <dt><label for="aim">{L_AIM}:</label></dt> + <dt><label for="aim">{L_AIM}{L_COLON}</label></dt> <dd><input type="text" name="aim" id="aim" value="{AIM}" class="inputbox" /></dd> </dl> <dl> - <dt><label for="yahoo">{L_YIM}:</label></dt> + <dt><label for="yahoo">{L_YIM}{L_COLON}</label></dt> <dd><input type="text" name="yahoo" id="yahoo" value="{YAHOO}" class="inputbox" /></dd> </dl> <dl> - <dt><label for="msn">{L_MSNM}:</label></dt> + <dt><label for="msn">{L_MSNM}{L_COLON}</label></dt> <dd><input type="text" name="msn" id="msn" value="{MSNM}" class="inputbox" /></dd> </dl> </fieldset> <fieldset class="fields1 column2"> <dl> - <dt><label for="joined">{L_JOINED}:</label></dt> + <dt><label for="joined">{L_JOINED}{L_COLON}</label></dt> <dd><select name="joined_select">{S_JOINED_TIME_OPTIONS}</select> <input class="inputbox medium" type="text" name="joined" id="joined" value="{JOINED}" /></dd> </dl> <!-- IF S_VIEWONLINE --> <dl> - <dt><label for="active">{L_LAST_ACTIVE}:</label></dt> + <dt><label for="active">{L_LAST_ACTIVE}{L_COLON}</label></dt> <dd><select name="active_select">{S_ACTIVE_TIME_OPTIONS}</select> <input class="inputbox medium" type="text" name="active" id="active" value="{ACTIVE}" /></dd> </dl> <!-- ENDIF --> <dl> - <dt><label for="count">{L_POSTS}:</label></dt> + <dt><label for="count">{L_POSTS}{L_COLON}</label></dt> <dd><select name="count_select">{S_COUNT_OPTIONS}</select> <input class="inputbox medium" type="text" name="count" id="count" value="{COUNT}" /></dd> </dl> <!-- IF S_IP_SEARCH_ALLOWED --> <dl> - <dt><label for="ip">{L_POST_IP}:</label></dt> + <dt><label for="ip">{L_POST_IP}{L_COLON}</label></dt> <dd><input class="inputbox medium" type="text" name="ip" id="ip" value="{IP}" /></dd> </dl> <!-- ENDIF --> <dl> - <dt><label for="search_group_id">{L_GROUP}:</label></dt> + <dt><label for="search_group_id">{L_GROUP}{L_COLON}</label></dt> <dd><select name="search_group_id" id="search_group_id">{S_GROUP_SELECT}</select></dd> </dl> <dl> - <dt><label for="sk" class="label3">{L_SORT_BY}:</label></dt> + <dt><label for="sk" class="label3">{L_SORT_BY}{L_COLON}</label></dt> <dd><select name="sk" id="sk">{S_SORT_OPTIONS}</select> <select name="sd">{S_ORDER_SELECT}</select></dd> </dl> </fieldset> diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html index b50e3a84ad..57cfcb86d9 100644 --- a/phpBB/styles/prosilver/template/memberlist_view.html +++ b/phpBB/styles/prosilver/template/memberlist_view.html @@ -15,7 +15,7 @@ <!-- ENDIF --> <dl class="left-box details" style="width: 80%;"> - <dt>{L_USERNAME}:</dt> + <dt>{L_USERNAME}{L_COLON}</dt> <dd> <!-- IF USER_COLOR --><span style="color: {USER_COLOR}; font-weight: bold;"><!-- ELSE --><span><!-- ENDIF -->{USERNAME}</span> <!-- IF U_USER_ADMIN --> [ <a href="{U_USER_ADMIN}">{L_USER_ADMIN}</a> ]<!-- ENDIF --> @@ -23,16 +23,16 @@ <!-- IF U_SWITCH_PERMISSIONS --> [ <a href="{U_SWITCH_PERMISSIONS}">{L_USE_PERMISSIONS}</a> ]<!-- ENDIF --> </dd> <!-- IF not AVATAR_IMG --> - <!-- IF RANK_TITLE --><dt>{L_RANK}:</dt> <dd>{RANK_TITLE}</dd><!-- ENDIF --> - <!-- IF RANK_IMG --><dt><!-- IF RANK_TITLE --> <!-- ELSE -->{L_RANK}:<!-- ENDIF --></dt> <dd>{RANK_IMG}</dd><!-- ENDIF --> + <!-- IF RANK_TITLE --><dt>{L_RANK}{L_COLON}</dt> <dd>{RANK_TITLE}</dd><!-- ENDIF --> + <!-- IF RANK_IMG --><dt><!-- IF RANK_TITLE --> <!-- ELSE -->{L_RANK}{L_COLON}<!-- ENDIF --></dt> <dd>{RANK_IMG}</dd><!-- ENDIF --> <!-- ENDIF --> - <!-- IF S_USER_INACTIVE --><dt>{L_USER_IS_INACTIVE}:</dt> <dd>{USER_INACTIVE_REASON}</dd><!-- ENDIF --> - <!-- IF LOCATION --><dt>{L_LOCATION}:</dt> <dd>{LOCATION}</dd><!-- ENDIF --> - <!-- IF AGE !== '' --><dt>{L_AGE}:</dt> <dd>{AGE}</dd><!-- ENDIF --> - <!-- IF OCCUPATION --><dt>{L_OCCUPATION}:</dt> <dd>{OCCUPATION}</dd><!-- ENDIF --> - <!-- IF INTERESTS --><dt>{L_INTERESTS}:</dt> <dd>{INTERESTS}</dd><!-- ENDIF --> - <!-- IF S_GROUP_OPTIONS --><dt>{L_USERGROUPS}:</dt> <dd><select name="g">{S_GROUP_OPTIONS}</select> <input type="submit" name="submit" value="{L_GO}" class="button2" /></dd><!-- ENDIF --> - <!-- BEGIN custom_fields --><dt>{custom_fields.PROFILE_FIELD_NAME}:</dt> <dd>{custom_fields.PROFILE_FIELD_VALUE}</dd><!-- END custom_fields --> + <!-- IF S_USER_INACTIVE --><dt>{L_USER_IS_INACTIVE}{L_COLON}</dt> <dd>{USER_INACTIVE_REASON}</dd><!-- ENDIF --> + <!-- IF LOCATION --><dt>{L_LOCATION}{L_COLON}</dt> <dd>{LOCATION}</dd><!-- ENDIF --> + <!-- IF AGE !== '' --><dt>{L_AGE}{L_COLON}</dt> <dd>{AGE}</dd><!-- ENDIF --> + <!-- IF OCCUPATION --><dt>{L_OCCUPATION}{L_COLON}</dt> <dd>{OCCUPATION}</dd><!-- ENDIF --> + <!-- IF INTERESTS --><dt>{L_INTERESTS}{L_COLON}</dt> <dd>{INTERESTS}</dd><!-- ENDIF --> + <!-- IF S_GROUP_OPTIONS --><dt>{L_USERGROUPS}{L_COLON}</dt> <dd><select name="g">{S_GROUP_OPTIONS}</select> <input type="submit" name="submit" value="{L_GO}" class="button2" /></dd><!-- ENDIF --> + <!-- BEGIN custom_fields --><dt>{custom_fields.PROFILE_FIELD_NAME}{L_COLON}</dt> <dd>{custom_fields.PROFILE_FIELD_VALUE}</dd><!-- END custom_fields --> <!-- IF S_USER_LOGGED_IN and S_ZEBRA --> <!-- IF U_REMOVE_FRIEND --> <dt> </dt> <dd class="zebra"><a href="{U_REMOVE_FRIEND}" data-ajax="zebra"><strong>{L_REMOVE_FRIEND}</strong></a></dd> @@ -59,17 +59,17 @@ <h3>{L_CONTACT_USER} {USERNAME}</h3> <dl class="details"> - <!-- IF U_EMAIL --><dt>{L_EMAIL_ADDRESS}:</dt> <dd><a href="{U_EMAIL}">{L_SEND_EMAIL_USER} {USERNAME}</a></dd><!-- ENDIF --> - <!-- IF U_WWW --><dt>{L_WEBSITE}:</dt> <dd><a href="{U_WWW}" title="{L_VISIT_WEBSITE}: {U_WWW}">{U_WWW}</a></dd><!-- ENDIF --> - <!-- IF U_PM --><dt>{L_PM}:</dt> <dd><a href="{U_PM}">{L_SEND_PRIVATE_MESSAGE}</a></dd><!-- ENDIF --> - <!-- IF U_MSN or USER_MSN --><dt>{L_MSNM}:</dt> <dd><!-- IF U_MSN --><a href="{U_MSN}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_MSNM_MESSAGE}</a><!-- ELSE -->{USER_MSN}<!-- ENDIF --></dd><!-- ENDIF --> - <!-- IF U_YIM or USER_YIM --><dt>{L_YIM}:</dt> <dd><!-- IF U_YIM --><a href="{U_YIM}" onclick="popup(this.href, 780, 550); return false;">{L_SEND_YIM_MESSAGE}</a><!-- ELSE -->{USER_YIM}<!-- ENDIF --></dd><!-- ENDIF --> - <!-- IF U_AIM or USER_AIM --><dt>{L_AIM}:</dt> <dd><!-- IF U_AIM --><a href="{U_AIM}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_AIM_MESSAGE}</a><!-- ELSE -->{USER_AIM}<!-- ENDIF --></dd><!-- ENDIF --> - <!-- IF U_ICQ or USER_ICQ --><dt>{L_ICQ}:</dt> <dd><!-- IF U_ICQ --><a href="{U_ICQ}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_ICQ_MESSAGE}</a><!-- ELSE -->{USER_ICQ}<!-- ENDIF --></dd><!-- ENDIF --> - <!-- IF U_JABBER and S_JABBER_ENABLED --><dt>{L_JABBER}:</dt> <dd><a href="{U_JABBER}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_JABBER_MESSAGE}</a></dd><!-- ELSEIF USER_JABBER --><dt>{L_JABBER}:</dt> <dd>{USER_JABBER}</dd><!-- ENDIF --> + <!-- IF U_EMAIL --><dt>{L_EMAIL_ADDRESS}{L_COLON}</dt> <dd><a href="{U_EMAIL}">{L_SEND_EMAIL_USER} {USERNAME}</a></dd><!-- ENDIF --> + <!-- IF U_WWW --><dt>{L_WEBSITE}{L_COLON}</dt> <dd><a href="{U_WWW}" title="{L_VISIT_WEBSITE}{L_COLON} {U_WWW}">{U_WWW}</a></dd><!-- ENDIF --> + <!-- IF U_PM --><dt>{L_PM}{L_COLON}</dt> <dd><a href="{U_PM}">{L_SEND_PRIVATE_MESSAGE}</a></dd><!-- ENDIF --> + <!-- IF U_MSN or USER_MSN --><dt>{L_MSNM}{L_COLON}</dt> <dd><!-- IF U_MSN --><a href="{U_MSN}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_MSNM_MESSAGE}</a><!-- ELSE -->{USER_MSN}<!-- ENDIF --></dd><!-- ENDIF --> + <!-- IF U_YIM or USER_YIM --><dt>{L_YIM}{L_COLON}</dt> <dd><!-- IF U_YIM --><a href="{U_YIM}" onclick="popup(this.href, 780, 550); return false;">{L_SEND_YIM_MESSAGE}</a><!-- ELSE -->{USER_YIM}<!-- ENDIF --></dd><!-- ENDIF --> + <!-- IF U_AIM or USER_AIM --><dt>{L_AIM}{L_COLON}</dt> <dd><!-- IF U_AIM --><a href="{U_AIM}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_AIM_MESSAGE}</a><!-- ELSE -->{USER_AIM}<!-- ENDIF --></dd><!-- ENDIF --> + <!-- IF U_ICQ or USER_ICQ --><dt>{L_ICQ}{L_COLON}</dt> <dd><!-- IF U_ICQ --><a href="{U_ICQ}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_ICQ_MESSAGE}</a><!-- ELSE -->{USER_ICQ}<!-- ENDIF --></dd><!-- ENDIF --> + <!-- IF U_JABBER and S_JABBER_ENABLED --><dt>{L_JABBER}{L_COLON}</dt> <dd><a href="{U_JABBER}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_JABBER_MESSAGE}</a></dd><!-- ELSEIF USER_JABBER --><dt>{L_JABBER}{L_COLON}</dt> <dd>{USER_JABBER}</dd><!-- ENDIF --> <!-- IF S_PROFILE_FIELD1 --> <!-- NOTE: Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. --> - <dt>{PROFILE_FIELD1_NAME}:</dt> <dd>{PROFILE_FIELD1_VALUE}</dd> + <dt>{PROFILE_FIELD1_NAME}{L_COLON}</dt> <dd>{PROFILE_FIELD1_VALUE}</dd> <!-- ENDIF --> </dl> </div> @@ -77,20 +77,20 @@ <div class="column2"> <h3>{L_USER_FORUM}</h3> <dl class="details"> - <dt>{L_JOINED}:</dt> <dd>{JOINED}</dd> - <dt>{L_VISITED}:</dt> <dd>{VISITED}</dd> + <dt>{L_JOINED}{L_COLON}</dt> <dd>{JOINED}</dd> + <dt>{L_VISITED}{L_COLON}</dt> <dd>{VISITED}</dd> <!-- IF S_WARNINGS --> - <dt>{L_WARNINGS}: </dt> + <dt>{L_WARNINGS}{L_COLON} </dt> <dd><strong>{WARNINGS}</strong><!-- IF U_NOTES or U_WARN --> [ <!-- IF U_NOTES --><a href="{U_NOTES}">{L_VIEW_NOTES}</a><!-- ENDIF --> <!-- IF U_WARN --><!-- IF U_NOTES --> | <!-- ENDIF --><a href="{U_WARN}">{L_WARN_USER}</a><!-- ENDIF --> ]<!-- ENDIF --></dd> <!-- ENDIF --> - <dt>{L_TOTAL_POSTS}:</dt> + <dt>{L_TOTAL_POSTS}{L_COLON}</dt> <dd>{POSTS} <!-- IF S_DISPLAY_SEARCH -->| <strong><a href="{U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a></strong><!-- ENDIF --> <!-- IF POSTS_PCT --><br />({POSTS_PCT} / {POSTS_DAY})<!-- ENDIF --> <!-- IF POSTS_IN_QUEUE and U_MCP_QUEUE --><br />(<a href="{U_MCP_QUEUE}">{L_POSTS_IN_QUEUE}</a>)<!-- ELSEIF POSTS_IN_QUEUE --><br />({L_POSTS_IN_QUEUE})<!-- ENDIF --> </dd> <!-- IF S_SHOW_ACTIVITY and POSTS --> - <dt>{L_ACTIVE_IN_FORUM}:</dt> <dd><!-- IF ACTIVE_FORUM != '' --><strong><a href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></strong><br />({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT})<!-- ELSE --> - <!-- ENDIF --></dd> - <dt>{L_ACTIVE_IN_TOPIC}:</dt> <dd><!-- IF ACTIVE_TOPIC != '' --><strong><a href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></strong><br />({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT})<!-- ELSE --> - <!-- ENDIF --></dd> + <dt>{L_ACTIVE_IN_FORUM}{L_COLON}</dt> <dd><!-- IF ACTIVE_FORUM != '' --><strong><a href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></strong><br />({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT})<!-- ELSE --> - <!-- ENDIF --></dd> + <dt>{L_ACTIVE_IN_TOPIC}{L_COLON}</dt> <dd><!-- IF ACTIVE_TOPIC != '' --><strong><a href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></strong><br />({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT})<!-- ELSE --> - <!-- ENDIF --></dd> <!-- ENDIF --> </dl> </div> diff --git a/phpBB/styles/prosilver/template/message_body.html b/phpBB/styles/prosilver/template/message_body.html index fb6dfce35f..a844246055 100644 --- a/phpBB/styles/prosilver/template/message_body.html +++ b/phpBB/styles/prosilver/template/message_body.html @@ -8,7 +8,7 @@ <div class="inner"> <h2>{MESSAGE_TITLE}</h2> <p>{MESSAGE_TEXT}</p> - <!-- IF SCRIPT_NAME == "search" and not S_BOARD_DISABLED and not S_NO_SEARCH and L_RETURN_TO_SEARCH_ADV --><p><a href="{U_SEARCH}" class="{S_CONTENT_FLOW_BEGIN}">{L_RETURN_TO_SEARCH_ADV}</a></p><!-- ENDIF --> + <!-- IF SCRIPT_NAME == "search" and not S_BOARD_DISABLED and not S_NO_SEARCH and L_RETURN_TO_SEARCH_ADV --><p><a href="{U_SEARCH}" class="arrow-{S_CONTENT_FLOW_BEGIN}">{L_RETURN_TO_SEARCH_ADV}</a></p><!-- ENDIF --> </div> </div> diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html index 2cb721073f..7e43ff2d0a 100644 --- a/phpBB/styles/prosilver/template/overall_footer.html +++ b/phpBB/styles/prosilver/template/overall_footer.html @@ -4,13 +4,13 @@ <div class="navbar"> <div class="inner"> - + <ul class="linklist"> - <li class="icon-home"><a href="{U_INDEX}" accesskey="h">{L_INDEX}</a></li> + <li class="icon-home"><!-- IF U_SITE_HOME --><a href="{U_SITE_HOME}">{L_SITE_HOME}</a> <strong>‹</strong> <!-- ENDIF --><a href="{U_INDEX}" accesskey="h">{L_INDEX}</a></li> <!-- IF not S_IS_BOT --> - <!-- IF S_WATCH_FORUM_LINK --><li <!-- IF S_WATCHING_FORUM -->class="icon-unsubscribe"<!-- ELSE -->class="icon-subscribe"<!-- ENDIF -->><a href="{S_WATCH_FORUM_LINK}" title="{S_WATCH_FORUM_TITLE}" data-ajax="alt_text" data-alt-text="<!-- IF S_WATCHING_FORUM -->{L_START_WATCHING_FORUM}<!-- ELSE -->{L_STOP_WATCHING_FORUM}<!-- ENDIF -->">{S_WATCH_FORUM_TITLE}</a></li><!-- ENDIF --> - <!-- IF U_WATCH_TOPIC --><li <!-- IF S_WATCHING_TOPIC -->class="icon-unsubscribe"<!-- ELSE -->class="icon-subscribe"<!-- ENDIF -->><a href="{U_WATCH_TOPIC}" title="{L_WATCH_TOPIC}" data-ajax="alt_text" data-alt-text="<!-- IF S_WATCHING_TOPIC -->{L_START_WATCHING_TOPIC}<!-- ELSE -->{L_STOP_WATCHING_TOPIC}<!-- ENDIF -->">{L_WATCH_TOPIC}</a></li><!-- ENDIF --> - <!-- IF U_BOOKMARK_TOPIC --><li class="icon-bookmark"><a href="{U_BOOKMARK_TOPIC}" title="{L_BOOKMARK_TOPIC}" data-ajax="alt_text" data-alt-text="<!-- IF S_BOOKMARKED_TOPIC -->{L_BOOKMARK_TOPIC_REAL}<!-- ELSE -->{L_BOOKMARK_TOPIC_REMOVE}<!-- ENDIF -->">{L_BOOKMARK_TOPIC}</a></li><!-- ENDIF --> + <!-- IF U_WATCH_FORUM_LINK --><li <!-- IF S_WATCHING_FORUM -->class="icon-unsubscribe"<!-- ELSE -->class="icon-subscribe"<!-- ENDIF -->><a href="{U_WATCH_FORUM_LINK}" title="{S_WATCH_FORUM_TITLE}" data-ajax="toggle_link" data-toggle-class="icon-<!-- IF not S_WATCHING_FORUM -->unsubscribe<!-- ELSE -->subscribe<!-- ENDIF -->" data-toggle-text="{S_WATCH_FORUM_TOGGLE}" data-toggle-url="{U_WATCH_FORUM_TOGGLE}">{S_WATCH_FORUM_TITLE}</a></li><!-- ENDIF --> + <!-- IF U_WATCH_TOPIC --><li <!-- IF S_WATCHING_TOPIC -->class="icon-unsubscribe"<!-- ELSE -->class="icon-subscribe"<!-- ENDIF -->><a href="{U_WATCH_TOPIC}" title="{S_WATCH_TOPIC_TITLE}" data-ajax="toggle_link" data-toggle-class="<!-- IF not S_WATCHING_TOPIC -->icon-unsubscribe<!-- ELSE -->icon-subscribe<!-- ENDIF -->" data-toggle-text="{S_WATCH_TOPIC_TOGGLE}" data-toggle-url="{U_WATCH_TOPIC_TOGGLE}">{S_WATCH_TOPIC_TITLE}</a></li><!-- ENDIF --> + <!-- IF U_BOOKMARK_TOPIC --><li class="icon-bookmark"><a href="{U_BOOKMARK_TOPIC}" title="{L_BOOKMARK_TOPIC}" data-ajax="alt_text" data-alt-text="{S_BOOKMARK_TOGGLE}">{S_BOOKMARK_TOPIC}</a></li><!-- ENDIF --> <!-- IF U_BUMP_TOPIC --><li class="icon-bump"><a href="{U_BUMP_TOPIC}" title="{L_BUMP_TOPIC}" data-ajax="true">{L_BUMP_TOPIC}</a></li><!-- ENDIF --> <!-- ENDIF --> <li class="rightside"><!-- IF U_TEAM --><a href="{U_TEAM}">{L_THE_TEAM}</a> • <!-- ENDIF --><!-- IF not S_IS_BOT --><a href="{U_DELETE_COOKIES}" data-ajax="true" data-refresh="true">{L_DELETE_COOKIES}</a> • <!-- ENDIF -->{S_TIMEZONE}</li> diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html index 349309ab4e..3e00827235 100644 --- a/phpBB/styles/prosilver/template/overall_header.html +++ b/phpBB/styles/prosilver/template/overall_header.html @@ -26,7 +26,7 @@ <script type="text/javascript"> // <![CDATA[ - var jump_page = '{LA_JUMP_PAGE}:'; + var jump_page = '{LA_JUMP_PAGE}{L_COLON}'; var on_page = '{ON_PAGE}'; var per_page = '{PER_PAGE}'; var base_url = '{A_BASE_URL}'; @@ -56,7 +56,7 @@ { for (var i = 0; i < onload_functions.length; i++) { - eval(onload_functions[i]); + onload_functions[i](); } }; @@ -64,7 +64,7 @@ { for (var i = 0; i < onunload_functions.length; i++) { - eval(onunload_functions[i]); + onunload_functions[i](); } }; @@ -95,7 +95,7 @@ <div class="inner"> <div id="site-description"> - <a href="{U_INDEX}" title="{L_INDEX}" id="logo">{SITE_LOGO_IMG}</a> + <a href="<!-- IF U_SITE_HOME -->{U_SITE_HOME}<!-- ELSE -->{U_INDEX}<!-- ENDIF -->" title="<!-- IF U_SITE_HOME -->{L_SITE_HOME}<!-- ELSE -->{L_INDEX}<!-- ENDIF -->" id="logo">{SITE_LOGO_IMG}</a> <h1>{SITENAME}</h1> <p>{SITE_DESCRIPTION}</p> <p class="skiplink"><a href="#start_here">{L_SKIP}</a></p> @@ -120,7 +120,8 @@ <div class="inner"> <ul class="linklist navlinks"> - <li class="icon-home"><a href="{U_INDEX}" accesskey="h">{L_INDEX}</a> <!-- BEGIN navlinks --> <strong>‹</strong> <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></li> + <!-- DEFINE $MICRODATA = ' itemtype="http://data-vocabulary.org/Breadcrumb" itemscope=""' --> + <li class="icon-home"><!-- IF U_SITE_HOME --><a href="{U_SITE_HOME}"{$MICRODATA}>{L_SITE_HOME}</a> <strong>‹</strong> <!-- ENDIF --><a href="{U_INDEX}" accesskey="h"{$MICRODATA}>{L_INDEX}</a> <!-- BEGIN navlinks --> <strong>‹</strong> <a href="{navlinks.U_VIEW_FORUM}"{$MICRODATA}>{navlinks.FORUM_NAME}</a><!-- END navlinks --></li> <!-- IF U_EMAIL_TOPIC --><li class="rightside"><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}" class="sendemail">{L_EMAIL_TOPIC}</a></li><!-- ENDIF --> <!-- IF U_EMAIL_PM --><li class="rightside"><a href="{U_EMAIL_PM}" title="{L_EMAIL_PM}" class="sendemail">{L_EMAIL_PM}</a></li><!-- ENDIF --> @@ -162,7 +163,7 @@ <!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN and (U_MCP or U_ACP) --> <div id="information" class="rules"> <div class="inner"> - <strong>{L_INFORMATION}:</strong> {L_BOARD_DISABLED} + <strong>{L_INFORMATION}{L_COLON}</strong> {L_BOARD_DISABLED} </div> </div> <!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/pagination.html b/phpBB/styles/prosilver/template/pagination.html new file mode 100644 index 0000000000..1c8441a9fd --- /dev/null +++ b/phpBB/styles/prosilver/template/pagination.html @@ -0,0 +1,15 @@ + + <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • + <ul> + <!-- BEGIN pagination --> + <!-- IF pagination.S_IS_PREV --> + <!-- 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 --> + <!-- ELSE --> + <li><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a></li> + <!-- ENDIF --> + <!-- END pagination --> + </ul> diff --git a/phpBB/styles/prosilver/template/posting_attach_body.html b/phpBB/styles/prosilver/template/posting_attach_body.html index 162b0b5d4e..fa9dd19c09 100644 --- a/phpBB/styles/prosilver/template/posting_attach_body.html +++ b/phpBB/styles/prosilver/template/posting_attach_body.html @@ -5,14 +5,14 @@ <fieldset class="fields2"> <dl> - <dt><label for="fileupload">{L_FILENAME}:</label></dt> + <dt><label for="fileupload">{L_FILENAME}{L_COLON}</label></dt> <dd> <input type="file" name="fileupload" id="fileupload" maxlength="{FILESIZE}" value="" class="inputbox autowidth" /> <input type="submit" name="add_file" value="{L_ADD_FILE}" class="button2" onclick="upload = true;" /> </dd> </dl> <dl> - <dt><label for="filecomment">{L_FILE_COMMENT}:</label></dt> + <dt><label for="filecomment">{L_FILE_COMMENT}{L_COLON}</label></dt> <dd><textarea name="filecomment" id="filecomment" rows="1" cols="40" class="inputbox autowidth">{FILE_COMMENT}</textarea></dd> </dl> </fieldset> diff --git a/phpBB/styles/prosilver/template/posting_buttons.html b/phpBB/styles/prosilver/template/posting_buttons.html index 78c2a0d9f2..8e87407757 100644 --- a/phpBB/styles/prosilver/template/posting_buttons.html +++ b/phpBB/styles/prosilver/template/posting_buttons.html @@ -28,7 +28,7 @@ y: '{LA_BBCODE_Y_HELP}', d: '{LA_BBCODE_D_HELP}' <!-- BEGIN custom_tags --> - ,cb_{custom_tags.BBCODE_ID}: '{custom_tags.A_BBCODE_HELPLINE}' + ,cb_{custom_tags.BBCODE_ID}{L_COLON} '{custom_tags.A_BBCODE_HELPLINE}' <!-- END custom_tags --> } @@ -43,7 +43,7 @@ <!-- IF S_BBCODE_ALLOWED --> <div id="colour_palette" style="display: none;"> <dl style="clear: left;"> - <dt><label>{L_FONT_COLOR}:</label></dt> + <dt><label>{L_FONT_COLOR}{L_COLON}</label></dt> <dd> <script type="text/javascript"> // <![CDATA[ diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html index d1c86e7e13..be45993cef 100644 --- a/phpBB/styles/prosilver/template/posting_editor.html +++ b/phpBB/styles/prosilver/template/posting_editor.html @@ -1,6 +1,6 @@ <script type="text/javascript"> // <![CDATA[ - onload_functions.push('apply_onkeypress_event()'); + onload_functions.push(apply_onkeypress_event); // ]]> </script> @@ -13,11 +13,11 @@ <!-- IF S_ALLOW_MASS_PM --> <!-- IF .to_recipient --> <dl> - <dt><label>{L_TO}:</label></dt> + <dt><label>{L_TO}{L_COLON}</label></dt> <dd> <!-- BEGIN to_recipient --> <!-- IF not to_recipient.S_FIRST_ROW and to_recipient.S_ROW_COUNT mod 2 eq 0 --></dd><dd><!-- ENDIF --> - <!-- IF to_recipient.IS_GROUP --><a href="{to_recipient.U_VIEW}"><strong>{to_recipient.NAME}</strong></a> <!-- ELSE -->{to_recipient.NAME_FULL} <!-- ENDIF --> + <!-- IF to_recipient.IS_GROUP --><a href="{to_recipient.U_VIEW}"><strong>{to_recipient.NAME}</strong></a><!-- ELSE -->{to_recipient.NAME_FULL}<!-- ENDIF --> <!-- IF not S_EDIT_POST --><input type="submit" name="remove_{to_recipient.TYPE}[{to_recipient.UG_ID}]" value="x" class="button2" /> <!-- ENDIF --> <!-- END to_recipient --> </dd> @@ -25,11 +25,11 @@ <!-- ENDIF --> <!-- IF .bcc_recipient --> <dl> - <dt><label>{L_BCC}:</label></dt> + <dt><label>{L_BCC}{L_COLON}</label></dt> <dd> <!-- BEGIN bcc_recipient --> <!-- IF not bcc_recipient.S_FIRST_ROW and bcc_recipient.S_ROW_COUNT mod 2 eq 0 --></dd><dd><!-- ENDIF --> - <!-- IF bcc_recipient.IS_GROUP --><a href="{bcc_recipient.U_VIEW}"><strong>{bcc_recipient.NAME}</strong></a><!-- ELSE -->{bcc_recipient.NAME_FULL} <!-- ENDIF --> + <!-- IF bcc_recipient.IS_GROUP --><a href="{bcc_recipient.U_VIEW}"><strong>{bcc_recipient.NAME}</strong></a><!-- ELSE -->{bcc_recipient.NAME_FULL}<!-- ENDIF --> <!-- IF not S_EDIT_POST --><input type="submit" name="remove_{bcc_recipient.TYPE}[{bcc_recipient.UG_ID}]" value="x" class="button2" /> <!-- ENDIF --> <!-- END bcc_recipient --> </dd> @@ -45,12 +45,12 @@ <!-- ENDIF --> <!-- ELSE --> <dl> - <dt><label for="username_list">{L_TO}:</label><!-- IF not S_EDIT_POST --><br /><span><a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false">{L_FIND_USERNAME}</a></span><!-- ENDIF --></dt> + <dt><label for="username_list">{L_TO}{L_COLON}</label><!-- IF not S_EDIT_POST --><br /><span><a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false">{L_FIND_USERNAME}</a></span><!-- ENDIF --></dt> <!-- IF .to_recipient --> <dd> <!-- BEGIN to_recipient --> <!-- IF not to_recipient.S_FIRST_ROW and to_recipient.S_ROW_COUNT mod 2 eq 0 --></dd><dd><!-- ENDIF --> - <!-- IF to_recipient.IS_GROUP --><a href="{to_recipient.U_VIEW}"><strong>{to_recipient.NAME}</strong></a><!-- ELSE -->{to_recipient.NAME_FULL} <!-- ENDIF --> + <!-- IF to_recipient.IS_GROUP --><a href="{to_recipient.U_VIEW}"><strong>{to_recipient.NAME}</strong></a><!-- ELSE -->{to_recipient.NAME_FULL}<!-- ENDIF --> <!-- IF not S_EDIT_POST --><input type="submit" name="remove_{to_recipient.TYPE}[{to_recipient.UG_ID}]" value="x" class="button2" /> <!-- ENDIF --> <!-- END to_recipient --> </dd> @@ -67,7 +67,7 @@ <!-- IF S_GROUP_OPTIONS --> <div class="column2"> <dl> - <dd><label for="group_list">{L_USERGROUPS}:</label> <select name="group_list[]" id="group_list" multiple="multiple" size="4" class="inputbox">{S_GROUP_OPTIONS}</select></dd> + <dd><label for="group_list">{L_USERGROUPS}{L_COLON}</label> <select name="group_list[]" id="group_list" multiple="multiple" size="4" class="inputbox">{S_GROUP_OPTIONS}</select></dd> </dl> </div> <!-- ENDIF --> @@ -78,14 +78,14 @@ <!-- IF S_DELETE_ALLOWED --> <dl> - <dt><label for="delete">{L_DELETE_POST}:</label></dt> + <dt><label for="delete">{L_DELETE_POST}{L_COLON}</label></dt> <dd><label for="delete"><input type="checkbox" name="delete" id="delete" /> {L_DELETE_POST_WARN}</label></dd> </dl> <!-- ENDIF --> <!-- IF S_SHOW_TOPIC_ICONS or S_SHOW_PM_ICONS --> <dl> - <dt><label for="icon">{L_ICON}:</label></dt> + <dt><label for="icon">{L_ICON}{L_COLON}</label></dt> <dd> <label for="icon"><input type="radio" name="icon" id="icon" value="0" checked="checked" tabindex="1" /> <!-- IF S_SHOW_TOPIC_ICONS -->{L_NO_TOPIC_ICON}<!-- ELSE -->{L_NO_PM_ICON}<!-- ENDIF --></label> <!-- BEGIN topic_icon --><label for="icon-{topic_icon.ICON_ID}"><input type="radio" name="icon" id="icon-{topic_icon.ICON_ID}" value="{topic_icon.ICON_ID}" {topic_icon.S_ICON_CHECKED} tabindex="1" /><img src="{topic_icon.ICON_IMG}" width="{topic_icon.ICON_WIDTH}" height="{topic_icon.ICON_HEIGHT}" alt="" title="" /></label> <!-- END topic_icon --> @@ -95,14 +95,14 @@ <!-- IF not S_PRIVMSGS and S_DISPLAY_USERNAME --> <dl style="clear: left;"> - <dt><label for="username">{L_USERNAME}:</label></dt> + <dt><label for="username">{L_USERNAME}{L_COLON}</label></dt> <dd><input type="text" tabindex="1" name="username" id="username" size="25" value="{USERNAME}" class="inputbox autowidth" /></dd> </dl> <!-- ENDIF --> <!-- IF S_POST_ACTION or S_PRIVMSGS or S_EDIT_DRAFT --> <dl style="clear: left;"> - <dt><label for="subject">{L_SUBJECT}:</label></dt> + <dt><label for="subject">{L_SUBJECT}{L_COLON}</label></dt> <dd><input type="text" name="subject" id="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->120<!-- ELSE -->124<!-- ENDIF -->" tabindex="2" value="{SUBJECT}{DRAFT_SUBJECT}" class="inputbox autowidth" /></dd> </dl> <!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE --> @@ -163,9 +163,9 @@ <!-- BEGIN attach_row --> <dl> - <dt><label for="comment_list_{attach_row.ASSOC_INDEX}">{L_FILE_COMMENT}:</label></dt> + <dt><label for="comment_list_{attach_row.ASSOC_INDEX}">{L_FILE_COMMENT}{L_COLON}</label></dt> <dd><textarea name="comment_list[{attach_row.ASSOC_INDEX}]" id="comment_list_{attach_row.ASSOC_INDEX}" rows="1" cols="35" class="inputbox">{attach_row.FILE_COMMENT}</textarea></dd> - <dd><a href="{attach_row.U_VIEW_ATTACHMENT}" class="{S_CONTENT_FLOW_END}">{attach_row.FILENAME}</a></dd> + <dd><a href="{attach_row.U_VIEW_ATTACHMENT}">{attach_row.FILENAME}</a></dd> <dd style="margin-top: 5px;"> <!-- IF S_INLINE_ATTACHMENT_OPTIONS --><input type="button" value="{L_PLACE_INLINE}" onclick="attach_inline({attach_row.ASSOC_INDEX}, '{attach_row.A_FILENAME}');" class="button2" /> <!-- ENDIF --> <input type="submit" name="delete_file[{attach_row.ASSOC_INDEX}]" value="{L_DELETE_FILE}" class="button2" /> @@ -241,14 +241,14 @@ <!-- IF S_TYPE_TOGGLE --> <dl> - <dt><label for="topic_type-0"><!-- IF S_EDIT_POST -->{L_CHANGE_TOPIC_TO}<!-- ELSE -->{L_POST_TOPIC_AS}<!-- ENDIF -->:</label></dt> + <dt><label for="topic_type-0"><!-- IF S_EDIT_POST -->{L_CHANGE_TOPIC_TO}<!-- ELSE -->{L_POST_TOPIC_AS}<!-- ENDIF -->{L_COLON}</label></dt> <dd><!-- BEGIN topic_type --><label for="topic_type-{topic_type.VALUE}"><input type="radio" name="topic_type" id="topic_type-{topic_type.VALUE}" value="{topic_type.VALUE}"{topic_type.S_CHECKED} />{topic_type.L_TOPIC_TYPE}</label> <!-- END topic_type --></dd> </dl> <!-- ENDIF --> <!-- IF S_TOPIC_TYPE_ANNOUNCE or S_TOPIC_TYPE_STICKY --> <dl> - <dt><label for="topic_time_limit">{L_STICK_TOPIC_FOR}:</label></dt> + <dt><label for="topic_time_limit">{L_STICK_TOPIC_FOR}{L_COLON}</label></dt> <dd><label for="topic_time_limit"><input type="text" name="topic_time_limit" id="topic_time_limit" size="3" maxlength="3" value="{TOPIC_TIME_LIMIT}" class="inputbox autowidth" /> {L_DAYS}</label></dd> <dd>{L_STICK_TOPIC_FOR_EXPLAIN}</dd> </dl> @@ -256,7 +256,7 @@ <!-- IF S_EDIT_REASON --> <dl> - <dt><label for="edit_reason">{L_EDIT_REASON}:</label></dt> + <dt><label for="edit_reason">{L_EDIT_REASON}{L_COLON}</label></dt> <dd><input type="text" name="edit_reason" id="edit_reason" value="{EDIT_REASON}" class="inputbox" /></dd> </dl> <!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/posting_layout.html b/phpBB/styles/prosilver/template/posting_layout.html index a5cb3fc154..4e9954ef81 100644 --- a/phpBB/styles/prosilver/template/posting_layout.html +++ b/phpBB/styles/prosilver/template/posting_layout.html @@ -45,7 +45,7 @@ <h2>{L_SELECT_DESTINATION_FORUM}</h2> <p>{L_UNGLOBALISE_EXPLAIN}</p> <dl> - <dt><label for="to_forum_id">{L_MOVE}:</label></dt> + <dt><label for="to_forum_id">{L_MOVE}{L_COLON}</label></dt> <dd><select id="to_forum_id" name="to_forum_id">{S_FORUM_SELECT}</select></dd> </dl> diff --git a/phpBB/styles/prosilver/template/posting_poll_body.html b/phpBB/styles/prosilver/template/posting_poll_body.html index 3f64c5d5b5..5d6e01e997 100644 --- a/phpBB/styles/prosilver/template/posting_poll_body.html +++ b/phpBB/styles/prosilver/template/posting_poll_body.html @@ -9,28 +9,28 @@ <!-- IF S_SHOW_POLL_BOX --> <!-- IF S_POLL_DELETE --> <dl> - <dt><label for="poll_delete">{L_POLL_DELETE}:</label></dt> + <dt><label for="poll_delete">{L_POLL_DELETE}{L_COLON}</label></dt> <dd><label for="poll_delete"><input type="checkbox" name="poll_delete" id="poll_delete"<!-- IF S_POLL_DELETE_CHECKED --> checked="checked"<!-- ENDIF --> /> </label></dd> </dl> <!-- ENDIF --> <dl> - <dt><label for="poll_title">{L_POLL_QUESTION}:</label></dt> + <dt><label for="poll_title">{L_POLL_QUESTION}{L_COLON}</label></dt> <dd><input type="text" name="poll_title" id="poll_title" maxlength="255" value="{POLL_TITLE}" class="inputbox" /></dd> </dl> <dl> - <dt><label for="poll_option_text">{L_POLL_OPTIONS}:</label><br /><span>{L_POLL_OPTIONS_EXPLAIN}</span></dt> + <dt><label for="poll_option_text">{L_POLL_OPTIONS}{L_COLON}</label><br /><span>{L_POLL_OPTIONS_EXPLAIN}</span></dt> <dd><textarea name="poll_option_text" id="poll_option_text" rows="5" cols="35" class="inputbox">{POLL_OPTIONS}</textarea></dd> </dl> <hr class="dashed" /> <dl> - <dt><label for="poll_max_options">{L_POLL_MAX_OPTIONS}:</label></dt> + <dt><label for="poll_max_options">{L_POLL_MAX_OPTIONS}{L_COLON}</label></dt> <dd><input type="text" name="poll_max_options" id="poll_max_options" size="3" maxlength="3" value="{POLL_MAX_OPTIONS}" class="inputbox autowidth" /></dd> <dd>{L_POLL_MAX_OPTIONS_EXPLAIN}</dd> </dl> <dl> - <dt><label for="poll_length">{L_POLL_FOR}:</label></dt> + <dt><label for="poll_length">{L_POLL_FOR}{L_COLON}</label></dt> <dd><label for="poll_length"><input type="text" name="poll_length" id="poll_length" size="3" maxlength="3" value="{POLL_LENGTH}" class="inputbox autowidth" /> {L_DAYS}</label></dd> <dd>{L_POLL_FOR_EXPLAIN}</dd> </dl> @@ -39,14 +39,14 @@ <hr class="dashed" /> <dl> - <dt><label for="poll_vote_change">{L_POLL_VOTE_CHANGE}:</label></dt> + <dt><label for="poll_vote_change">{L_POLL_VOTE_CHANGE}{L_COLON}</label></dt> <dd><label for="poll_vote_change"><input type="checkbox" id="poll_vote_change" name="poll_vote_change"{VOTE_CHANGE_CHECKED} /> {L_POLL_VOTE_CHANGE_EXPLAIN}</label></dd> </dl> <!-- ENDIF --> <!-- ELSEIF S_POLL_DELETE --> <dl class="fields1"> - <dt><label for="poll_delete">{L_POLL_DELETE}:</label></dt> + <dt><label for="poll_delete">{L_POLL_DELETE}{L_COLON}</label></dt> <dd><label for="poll_delete"><input type="checkbox" name="poll_delete" id="poll_delete"<!-- IF S_POLL_DELETE_CHECKED --> checked="checked"<!-- ENDIF --> /> </label></dd> </dl> <!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/posting_preview.html b/phpBB/styles/prosilver/template/posting_preview.html index 16fc4ba233..a5aae8c436 100644 --- a/phpBB/styles/prosilver/template/posting_preview.html +++ b/phpBB/styles/prosilver/template/posting_preview.html @@ -3,7 +3,7 @@ <!-- IF S_HAS_POLL_OPTIONS --> <div class="content"> - <h2>{L_PREVIEW}: {POLL_QUESTION}</h2> + <h2>{L_PREVIEW}{L_COLON} {POLL_QUESTION}</h2> <p class="author"><!-- IF L_POLL_LENGTH -->{L_POLL_LENGTH}<br /><!-- ENDIF -->{L_MAX_VOTES}</p> <fieldset class="polls"> @@ -25,7 +25,7 @@ <!-- ENDIF --> <div class="postbody"> - <h3>{L_PREVIEW}: {PREVIEW_SUBJECT}</h3> + <h3>{L_PREVIEW}{L_COLON} {PREVIEW_SUBJECT}</h3> <div class="content">{PREVIEW_MESSAGE}</div> diff --git a/phpBB/styles/prosilver/template/posting_smilies.html b/phpBB/styles/prosilver/template/posting_smilies.html index d3d6293586..01b74c710c 100644 --- a/phpBB/styles/prosilver/template/posting_smilies.html +++ b/phpBB/styles/prosilver/template/posting_smilies.html @@ -17,7 +17,11 @@ </div> </div> -<div>{PAGINATION}</div> +<div class="pagination"> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ENDIF --> +</div> <a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a> <!-- INCLUDE simple_footer.html --> diff --git a/phpBB/styles/prosilver/template/posting_topic_review.html b/phpBB/styles/prosilver/template/posting_topic_review.html index 5e7b36c526..1fcc9facd0 100644 --- a/phpBB/styles/prosilver/template/posting_topic_review.html +++ b/phpBB/styles/prosilver/template/posting_topic_review.html @@ -1,7 +1,7 @@ <h3 id="review"> <span class="right-box"><a href="#review" onclick="viewableArea(getElementById('topicreview'), true); var rev_text = getElementById('review').getElementsByTagName('a').item(0).firstChild; if (rev_text.data == '{LA_EXPAND_VIEW}'){rev_text.data = '{LA_COLLAPSE_VIEW}'; } else if (rev_text.data == '{LA_COLLAPSE_VIEW}'){rev_text.data = '{LA_EXPAND_VIEW}'};">{L_EXPAND_VIEW}</a></span> - {L_TOPIC_REVIEW}: {TOPIC_TITLE} + {L_TOPIC_REVIEW}{L_COLON} {TOPIC_TITLE} </h3> <div id="topicreview"> diff --git a/phpBB/styles/prosilver/template/quickreply_editor.html b/phpBB/styles/prosilver/template/quickreply_editor.html index 5fcdf0f5d4..9164cb1919 100644 --- a/phpBB/styles/prosilver/template/quickreply_editor.html +++ b/phpBB/styles/prosilver/template/quickreply_editor.html @@ -4,7 +4,7 @@ <h2>{L_QUICKREPLY}</h2> <fieldset class="fields1"> <dl style="clear: left;"> - <dt><label for="subject">{L_SUBJECT}:</label></dt> + <dt><label for="subject">{L_SUBJECT}{L_COLON}</label></dt> <dd><input type="text" name="subject" id="subject" size="45" maxlength="124" tabindex="2" value="{SUBJECT}" class="inputbox autowidth" /></dd> </dl> <div id="message-box"> diff --git a/phpBB/styles/prosilver/template/report_body.html b/phpBB/styles/prosilver/template/report_body.html index 3e876afe85..4cb03dc51c 100644 --- a/phpBB/styles/prosilver/template/report_body.html +++ b/phpBB/styles/prosilver/template/report_body.html @@ -11,12 +11,12 @@ <fieldset> <dl class="fields2"> - <dt><label for="reason_id">{L_REASON}:</label></dt> + <dt><label for="reason_id">{L_REASON}{L_COLON}</label></dt> <dd><select name="reason_id" id="reason_id" class="full"><!-- BEGIN reason --><option value="{reason.ID}"<!-- IF reason.S_SELECTED --> selected="selected"<!-- ENDIF -->>{reason.DESCRIPTION}</option><!-- END reason --></select></dd> </dl> <!-- IF S_CAN_NOTIFY --> <dl class="fields2"> - <dt><label for="notify1">{L_REPORT_NOTIFY}:</label><br /><span>{L_REPORT_NOTIFY_EXPLAIN}</span></dt> + <dt><label for="notify1">{L_REPORT_NOTIFY}{L_COLON}</label><br /><span>{L_REPORT_NOTIFY_EXPLAIN}</span></dt> <dd> <label for="notify1"><input type="radio" name="notify" id="notify1" value="1" <!-- IF not S_NOTIFY -->checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label for="notify0"><input type="radio" name="notify" id="notify0" value="0" <!-- IF S_NOTIFY -->checked="checked"<!-- ENDIF --> /> {L_NO}</label> @@ -24,7 +24,7 @@ </dl> <!-- ENDIF --> <dl class="fields2"> - <dt><label for="report_text">{L_MORE_INFO}:</label><br /><span>{L_CAN_LEAVE_BLANK}</span></dt> + <dt><label for="report_text">{L_MORE_INFO}{L_COLON}</label><br /><span>{L_CAN_LEAVE_BLANK}</span></dt> <dd><textarea name="report_text" id="report_text" rows="10" cols="76" class="inputbox">{REPORT_TEXT}</textarea></dd> </dl> </fieldset> diff --git a/phpBB/styles/prosilver/template/search_body.html b/phpBB/styles/prosilver/template/search_body.html index a8baafa5f1..dee080def5 100644 --- a/phpBB/styles/prosilver/template/search_body.html +++ b/phpBB/styles/prosilver/template/search_body.html @@ -2,7 +2,9 @@ <script type="text/javascript"> // <![CDATA[ - onload_functions.push('document.getElementById("keywords").focus();'); + onload_functions.push(function () { + document.getElementById("keywords").focus(); + }); // ]]> </script> @@ -16,13 +18,13 @@ <fieldset> <dl> - <dt><label for="keywords">{L_SEARCH_KEYWORDS}:</label><br /><span>{L_SEARCH_KEYWORDS_EXPLAIN}</span></dt> + <dt><label for="keywords">{L_SEARCH_KEYWORDS}{L_COLON}</label><br /><span>{L_SEARCH_KEYWORDS_EXPLAIN}</span></dt> <dd><input type="text" class="inputbox" name="keywords" id="keywords" size="40" title="{L_SEARCH_KEYWORDS}" /></dd> <dd><label for="terms1"><input type="radio" name="terms" id="terms1" value="all" checked="checked" /> {L_SEARCH_ALL_TERMS}</label></dd> <dd><label for="terms2"><input type="radio" name="terms" id="terms2" value="any" /> {L_SEARCH_ANY_TERMS}</label></dd> </dl> <dl> - <dt><label for="author">{L_SEARCH_AUTHOR}:</label><br /><span>{L_SEARCH_AUTHOR_EXPLAIN}</span></dt> + <dt><label for="author">{L_SEARCH_AUTHOR}{L_COLON}</label><br /><span>{L_SEARCH_AUTHOR_EXPLAIN}</span></dt> <dd><input type="text" class="inputbox" name="author" id="author" size="40" title="{L_SEARCH_AUTHOR}" /></dd> </dl> </fieldset> @@ -37,18 +39,18 @@ <fieldset> <dl> - <dt><label for="search_forum">{L_SEARCH_FORUMS}:</label><br /><span>{L_SEARCH_FORUMS_EXPLAIN}</span></dt> + <dt><label for="search_forum">{L_SEARCH_FORUMS}{L_COLON}</label><br /><span>{L_SEARCH_FORUMS_EXPLAIN}</span></dt> <dd><select name="fid[]" id="search_forum" multiple="multiple" size="8" title="{L_SEARCH_FORUMS}">{S_FORUM_OPTIONS}</select></dd> </dl> <dl> - <dt><label for="search_child1">{L_SEARCH_SUBFORUMS}:</label></dt> + <dt><label for="search_child1">{L_SEARCH_SUBFORUMS}{L_COLON}</label></dt> <dd> <label for="search_child1"><input type="radio" name="sc" id="search_child1" value="1" checked="checked" /> {L_YES}</label> <label for="search_child2"><input type="radio" name="sc" id="search_child2" value="0" /> {L_NO}</label> </dd> </dl> <dl> - <dt><label for="sf1">{L_SEARCH_WITHIN}:</label></dt> + <dt><label for="sf1">{L_SEARCH_WITHIN}{L_COLON}</label></dt> <dd><label for="sf1"><input type="radio" name="sf" id="sf1" value="all" checked="checked" /> {L_SEARCH_TITLE_MSG}</label></dd> <dd><label for="sf2"><input type="radio" name="sf" id="sf2" value="msgonly" /> {L_SEARCH_MSG_ONLY}</label></dd> <dd><label for="sf3"><input type="radio" name="sf" id="sf3" value="titleonly" /> {L_SEARCH_TITLE_ONLY}</label></dd> @@ -58,25 +60,25 @@ <hr class="dashed" /> <dl> - <dt><label for="show_results1">{L_DISPLAY_RESULTS}:</label></dt> + <dt><label for="show_results1">{L_DISPLAY_RESULTS}{L_COLON}</label></dt> <dd> <label for="show_results1"><input type="radio" name="sr" id="show_results1" value="posts" checked="checked" /> {L_POSTS}</label> <label for="show_results2"><input type="radio" name="sr" id="show_results2" value="topics" /> {L_TOPICS}</label> </dd> </dl> <dl> - <dt><label for="sd">{L_RESULT_SORT}:</label></dt> + <dt><label for="sd">{L_RESULT_SORT}{L_COLON}</label></dt> <dd>{S_SELECT_SORT_KEY} <label for="sa"><input type="radio" name="sd" id="sa" value="a" /> {L_SORT_ASCENDING}</label> <label for="sd"><input type="radio" name="sd" id="sd" value="d" checked="checked" /> {L_SORT_DESCENDING}</label> </dd> </dl> <dl> - <dt><label>{L_RESULT_DAYS}:</label></dt> + <dt><label>{L_RESULT_DAYS}{L_COLON}</label></dt> <dd>{S_SELECT_SORT_DAYS}</dd> </dl> <dl> - <dt><label>{L_RETURN_FIRST}:</label></dt> + <dt><label>{L_RETURN_FIRST}{L_COLON}</label></dt> <dd><select name="ch" title="{L_RETURN_FIRST}">{S_CHARACTER_OPTIONS}</select> {L_POST_CHARACTERS}</dd> </dl> </fieldset> diff --git a/phpBB/styles/prosilver/template/search_results.html b/phpBB/styles/prosilver/template/search_results.html index 5d75bd3d56..62b7c61eb3 100644 --- a/phpBB/styles/prosilver/template/search_results.html +++ b/phpBB/styles/prosilver/template/search_results.html @@ -1,15 +1,17 @@ <!-- INCLUDE overall_header.html --> -<h2><!-- IF SEARCH_TITLE -->{SEARCH_TITLE}<!-- ELSE -->{SEARCH_MATCHES}<!-- ENDIF --><!-- IF SEARCH_WORDS -->: <a href="{U_SEARCH_WORDS}">{SEARCH_WORDS}</a><!-- ENDIF --></h2> -<!-- IF IGNORED_WORDS --> <p>{L_IGNORED_TERMS}: <strong>{IGNORED_WORDS}</strong></p><!-- ENDIF --> +<h2><!-- IF SEARCH_TITLE -->{SEARCH_TITLE}<!-- ELSE -->{SEARCH_MATCHES}<!-- ENDIF --><!-- IF SEARCH_WORDS -->{L_COLON} <a href="{U_SEARCH_WORDS}">{SEARCH_WORDS}</a><!-- ENDIF --></h2> +<!-- IF SEARCHED_QUERY --> <p>{L_SEARCHED_QUERY}{L_COLON} <strong>{SEARCHED_QUERY}</strong></p><!-- ENDIF --> +<!-- IF IGNORED_WORDS --> <p>{L_IGNORED_TERMS}{L_COLON} <strong>{IGNORED_WORDS}</strong></p><!-- ENDIF --> +<!-- IF PHRASE_SEARCH_DISABLED --> <p><strong>{L_PHRASE_SEARCH_DISABLED}</strong></p><!-- ENDIF --> <!-- IF SEARCH_TOPIC --> - <p><a class="{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH_TOPIC}">{L_RETURN_TO}: {SEARCH_TOPIC}</a></p> + <p><a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH_TOPIC}">{L_RETURN_TO}{L_COLON} {SEARCH_TOPIC}</a></p> <!-- ELSE --> - <p><a class="{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH}" title="{L_SEARCH_ADV}">{L_RETURN_TO_SEARCH_ADV}</a></p> + <p><a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH}" title="{L_SEARCH_ADV}">{L_RETURN_TO_SEARCH_ADV}</a></p> <!-- ENDIF --> -<!-- IF PAGINATION or SEARCH_MATCHES or PAGE_NUMBER --> +<!-- IF .pagination or SEARCH_MATCHES or PAGE_NUMBER --> <form method="post" action="{S_SEARCH_ACTION}"> <div class="topic-actions"> @@ -17,14 +19,20 @@ <!-- IF SEARCH_MATCHES --> <div class="search-box"> <!-- IF SEARCH_IN_RESULTS --> - <label for="add_keywords">{L_SEARCH_IN_RESULTS}: <input type="text" name="add_keywords" id="add_keywords" value="" class="inputbox narrow" /></label> + <label for="add_keywords">{L_SEARCH_IN_RESULTS}{L_COLON} <input type="text" name="add_keywords" id="add_keywords" value="" class="inputbox narrow" /></label> <input class="button2" type="submit" name="submit" value="{L_SEARCH}" /> <!-- ENDIF --> </div> <!-- ENDIF --> <div class="rightside pagination"> - {SEARCH_MATCHES}<!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --> + {SEARCH_MATCHES} + <!-- IF .pagination --> + • + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </div> </div> @@ -57,7 +65,20 @@ <a href="{searchresults.U_VIEW_TOPIC}" class="topictitle">{searchresults.TOPIC_TITLE}</a> {searchresults.ATTACH_ICON_IMG} <!-- IF searchresults.S_TOPIC_UNAPPROVED or searchresults.S_POSTS_UNAPPROVED --><a href="{searchresults.U_MCP_QUEUE}">{searchresults.UNAPPROVED_IMG}</a> <!-- ENDIF --> <!-- IF searchresults.S_TOPIC_REPORTED --><a href="{searchresults.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --><br /> - <!-- IF searchresults.PAGINATION --><strong class="pagination"><span>{searchresults.PAGINATION}</span></strong><!-- ENDIF --> + <!-- IF .searchresults.pagination --> + <div class="pagination"> + <ul> + <!-- BEGIN pagination --> + <!-- IF searchresults.pagination.S_IS_PREV --> + <!-- ELSEIF searchresults.pagination.S_IS_CURRENT --><li class="active"><span>{searchresults.pagination.PAGE_NUMBER}</span></li> + <!-- ELSEIF searchresults.pagination.S_IS_ELLIPSIS --><li class="ellipsis"><span>{L_ELLIPSIS}</span></li> + <!-- ELSEIF searchresults.pagination.S_IS_NEXT --> + <!-- ELSE --><li><a href="{searchresults.pagination.PAGE_URL}">{searchresults.pagination.PAGE_NUMBER}</a></li> + <!-- ENDIF --> + <!-- END pagination --> + </ul> + </div> + <!-- ENDIF --> {L_POST_BY_AUTHOR} {searchresults.TOPIC_AUTHOR_FULL} » {searchresults.FIRST_POST_TIME} » {L_IN} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a> </dt> <dd class="posts">{searchresults.TOPIC_REPLIES}</dd> @@ -101,16 +122,16 @@ <dt class="author">{L_POST_BY_AUTHOR} {searchresults.POST_AUTHOR_FULL}</dt> <dd>{searchresults.POST_DATE}</dd> <dd> </dd> - <dd>{L_FORUM}: <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a></dd> - <dd>{L_TOPIC}: <a href="{searchresults.U_VIEW_TOPIC}">{searchresults.TOPIC_TITLE}</a></dd> - <dd>{L_REPLIES}: <strong>{searchresults.TOPIC_REPLIES}</strong></dd> - <dd>{L_VIEWS}: <strong>{searchresults.TOPIC_VIEWS}</strong></dd> + <dd>{L_FORUM}{L_COLON} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a></dd> + <dd>{L_TOPIC}{L_COLON} <a href="{searchresults.U_VIEW_TOPIC}">{searchresults.TOPIC_TITLE}</a></dd> + <dd>{L_REPLIES}{L_COLON} <strong>{searchresults.TOPIC_REPLIES}</strong></dd> + <dd>{L_VIEWS}{L_COLON} <strong>{searchresults.TOPIC_VIEWS}</strong></dd> </dl> <!-- ENDIF --> <!-- IF not searchresults.S_IGNORE_POST --> <ul class="searchresults"> - <li ><a href="{searchresults.U_VIEW_POST}" class="{S_CONTENT_FLOW_END}">{L_JUMP_TO_POST}</a></li> + <li ><a href="{searchresults.U_VIEW_POST}" class="arrow-{S_CONTENT_FLOW_END}">{L_JUMP_TO_POST}</a></li> </ul> <!-- ENDIF --> @@ -125,12 +146,12 @@ <!-- END searchresults --> <!-- ENDIF --> -<!-- IF PAGINATION or .searchresults or S_SELECT_SORT_KEY or S_SELECT_SORT_DAYS --> +<!-- IF .pagination or .searchresults or S_SELECT_SORT_KEY or S_SELECT_SORT_DAYS --> <form method="post" action="{S_SEARCH_ACTION}"> <fieldset class="display-options"> - <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> - <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> + <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> + <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> <!-- IF S_SELECT_SORT_DAYS or S_SELECT_SORT_KEY --> <label><!-- IF S_SHOW_TOPICS -->{L_DISPLAY_POSTS}<!-- ELSE -->{L_SORT_BY}</label><label><!-- ENDIF --> {S_SELECT_SORT_DAYS}<!-- IF S_SELECT_SORT_KEY --></label> <label>{S_SELECT_SORT_KEY}</label> <label>{S_SELECT_SORT_DIR}<!-- ENDIF --> <input type="submit" name="sort" value="{L_GO}" class="button2" /></label> @@ -142,10 +163,29 @@ <hr /> <!-- ENDIF --> -<!-- IF PAGINATION or .searchresults or PAGE_NUMBER --> +<!-- IF .pagination or .searchresults or PAGE_NUMBER --> <ul class="linklist"> <li class="rightside pagination"> - {SEARCH_MATCHES}<!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --> + {SEARCH_MATCHES} + <!-- IF .pagination --> + • + <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • + <ul> + <!-- BEGIN pagination --> + <!-- IF pagination.S_IS_PREV --> + <!-- 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 --> + <!-- ELSE --> + <li><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a></li> + <!-- ENDIF --> + <!-- END pagination --> + </ul> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </li> </ul> <!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/simple_header.html b/phpBB/styles/prosilver/template/simple_header.html index 5440d66520..88b2c0c025 100644 --- a/phpBB/styles/prosilver/template/simple_header.html +++ b/phpBB/styles/prosilver/template/simple_header.html @@ -10,7 +10,7 @@ <script type="text/javascript"> // <![CDATA[ - var jump_page = '{LA_JUMP_PAGE}:'; + var jump_page = '{LA_JUMP_PAGE}{L_COLON}'; var on_page = '{ON_PAGE}'; var per_page = '{PER_PAGE}'; var base_url = '{A_BASE_URL}'; @@ -26,7 +26,7 @@ { for (var i = 0; i < onload_functions.length; i++) { - eval(onload_functions[i]); + onload_functions[i](); } } @@ -34,7 +34,7 @@ { for (var i = 0; i < onunload_functions.length; i++) { - eval(onunload_functions[i]); + onunload_functions[i](); } } diff --git a/phpBB/styles/prosilver/template/timezone.js b/phpBB/styles/prosilver/template/timezone.js new file mode 100644 index 0000000000..da0a2b0bfd --- /dev/null +++ b/phpBB/styles/prosilver/template/timezone.js @@ -0,0 +1,19 @@ +(function($) { // Avoid conflicts with other libraries + +$('#tz_date').change(function() { + phpbb.timezone_switch_date(false); +}); + +$('#tz_select_date_suggest').click(function(){ + phpbb.timezone_preselect_select(true); +}); + +$(document).ready( + phpbb.timezone_enable_date_selection +); + +$(document).ready( + phpbb.timezone_preselect_select($('#tz_select_date_suggest').attr('data-is-registration') == 'true') +); + +})(jQuery); // Avoid conflicts with other libraries diff --git a/phpBB/styles/prosilver/template/timezone_option.html b/phpBB/styles/prosilver/template/timezone_option.html new file mode 100644 index 0000000000..320b9b7121 --- /dev/null +++ b/phpBB/styles/prosilver/template/timezone_option.html @@ -0,0 +1,20 @@ +<dl> + <dt><label for="timezone">{L_BOARD_TIMEZONE}{L_COLON}</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> + <input type="button" id="tz_select_date_suggest" class="button2" style="display: none;" data-is-registration="<!-- IF S_REGISTRATION -->true<!-- ELSE -->false<!-- ENDIF -->" data-l-suggestion="{L_TIMEZONE_DATE_SUGGESTION}" value="{L_TIMEZONE_DATE_SUGGESTION}" /> + </dd> + <!-- ENDIF --> + <dd> + <select name="tz" id="timezone" class="autowidth tz_select"> + <option value="">{L_SELECT_TIMEZONE}</option> + {S_TZ_OPTIONS} + </select> + + <!-- INCLUDEJS template/timezone.js --> + </dd> +</dl> diff --git a/phpBB/styles/prosilver/template/ucp_agreement.html b/phpBB/styles/prosilver/template/ucp_agreement.html index 4109b6ef34..6c96be864a 100644 --- a/phpBB/styles/prosilver/template/ucp_agreement.html +++ b/phpBB/styles/prosilver/template/ucp_agreement.html @@ -19,7 +19,7 @@ <form method="post" action="{S_UCP_ACTION}" id="register"> <p class="rightside"> - <label for="lang">{L_LANGUAGE}:</label><select name="lang" id="lang" onchange="change_language(this.value); return false;" title="{L_LANGUAGE}">{S_LANG_OPTIONS}</select> + <label for="lang">{L_LANGUAGE}{L_COLON}</label><select name="lang" id="lang" onchange="change_language(this.value); return false;" title="{L_LANGUAGE}">{S_LANG_OPTIONS}</select> {S_HIDDEN_FIELDS} </p> </form> diff --git a/phpBB/styles/prosilver/template/ucp_attachments.html b/phpBB/styles/prosilver/template/ucp_attachments.html index 84e4c2e875..478b14ab86 100644 --- a/phpBB/styles/prosilver/template/ucp_attachments.html +++ b/phpBB/styles/prosilver/template/ucp_attachments.html @@ -12,8 +12,12 @@ <!-- IF .attachrow --> <ul class="linklist"> <li class="rightside pagination"> - <!-- IF TOTAL_ATTACHMENTS -->{TOTAL_ATTACHMENTS} {L_TITLE}<!-- ENDIF --> - <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> + <!-- IF TOTAL_ATTACHMENTS -->{TOTAL_ATTACHMENTS} {L_TITLE} • <!-- ENDIF --> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </li> </ul> @@ -33,7 +37,7 @@ <li class="row<!-- IF attachrow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->"> <dl> <dt style="width: 40%"><a href="{attachrow.U_VIEW_ATTACHMENT}" class="topictitle">{attachrow.FILENAME}</a> ({attachrow.SIZE})<br /> - <!-- IF attachrow.S_IN_MESSAGE -->{L_PM}: <!-- ELSE -->{L_TOPIC}: <!-- ENDIF --><a href="{attachrow.U_VIEW_TOPIC}">{attachrow.TOPIC_TITLE}</a></dt> + <!-- IF attachrow.S_IN_MESSAGE -->{L_PM}{L_COLON} <!-- ELSE -->{L_TOPIC}{L_COLON} <!-- ENDIF --><a href="{attachrow.U_VIEW_TOPIC}">{attachrow.TOPIC_TITLE}</a></dt> <dd class="extra">{attachrow.DOWNLOAD_COUNT}</dd> <dd class="time"><span>{attachrow.POST_TIME}</span></dd> <dd class="mark"><input type="checkbox" name="attachment[{attachrow.ATTACH_ID}]" value="1" /></dd> @@ -43,9 +47,9 @@ </ul> <fieldset class="display-options"> - <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> - <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> - <label for="sk">{L_SORT_BY}: <select name="sk" id="sk">{S_SORT_OPTIONS}</select></label> + <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> + <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> + <label for="sk">{L_SORT_BY}{L_COLON} <select name="sk" id="sk">{S_SORT_OPTIONS}</select></label> <label><select name="sd" id="sd">{S_ORDER_SELECT}</select></label> <input class="button2" type="submit" name="sort" value="{L_SORT}" /> {S_FORM_TOKEN} @@ -55,8 +59,12 @@ <ul class="linklist"> <li class="rightside pagination"> - <!-- IF TOTAL_ATTACHMENTS -->{TOTAL_ATTACHMENTS} {L_TITLE}<!-- ENDIF --> - <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> + <!-- IF TOTAL_ATTACHMENTS -->{TOTAL_ATTACHMENTS} {L_TITLE} • <!-- ENDIF --> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </li> </ul> <!-- ELSE --> diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options.html b/phpBB/styles/prosilver/template/ucp_avatar_options.html index 9801e065a5..850a1412a0 100644 --- a/phpBB/styles/prosilver/template/ucp_avatar_options.html +++ b/phpBB/styles/prosilver/template/ucp_avatar_options.html @@ -8,32 +8,32 @@ <fieldset> <!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF --> <dl> - <dt><label>{L_CURRENT_IMAGE}:</label><br /><span>{L_AVATAR_EXPLAIN}</span></dt> + <dt><label>{L_CURRENT_IMAGE}{L_COLON}</label><br /><span>{L_AVATAR_EXPLAIN}</span></dt> <dd><!-- IF AVATAR -->{AVATAR}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" /><!-- ENDIF --></dd> <dd><label for="delete"><input type="checkbox" name="delete" id="delete" /> {L_DELETE_AVATAR}</label></dd> </dl> <!-- IF S_UPLOAD_AVATAR_FILE --> <dl> - <dt><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}:</label></dt> + <dt><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}{L_COLON}</label></dt> <dd><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_SIZE}" /><input type="file" name="uploadfile" id="uploadfile" class="inputbox autowidth" /></dd> </dl> <!-- ENDIF --> <!-- IF S_UPLOAD_AVATAR_URL --> <dl> - <dt><label for="uploadurl">{L_UPLOAD_AVATAR_URL}:</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></dt> + <dt><label for="uploadurl">{L_UPLOAD_AVATAR_URL}{L_COLON}</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></dt> <dd><input type="text" name="uploadurl" id="uploadurl" value="{AVATAR_URL}" class="inputbox" /></dd> </dl> <!-- ENDIF --> <!-- IF S_LINK_AVATAR --> <dl> - <dt><label for="remotelink">{L_LINK_REMOTE_AVATAR}:</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></dt> + <dt><label for="remotelink">{L_LINK_REMOTE_AVATAR}{L_COLON}</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></dt> <dd><input type="text" name="remotelink" id="remotelink" value="{AVATAR_REMOTE}" class="inputbox" /></dd> </dl> <dl> - <dt><label for="width">{L_LINK_REMOTE_SIZE}:</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt> + <dt><label for="width">{L_LINK_REMOTE_SIZE}{L_COLON}</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt> <dd> <label for="width"><input type="text" name="width" id="width" size="3" value="{AVATAR_WIDTH}" class="inputbox autowidth" /> {L_PIXEL}</label> × <label for="height"><input type="text" name="height" id="height" size="3" value="{AVATAR_HEIGHT}" class="inputbox autowidth" /> {L_PIXEL}</label> @@ -52,7 +52,7 @@ <h3>{L_AVATAR_GALLERY}</h3> <fieldset> - <label for="category">{L_AVATAR_CATEGORY}: <select name="category" id="category">{S_CAT_OPTIONS}</select></label> + <label for="category">{L_AVATAR_CATEGORY}{L_COLON} <select name="category" id="category">{S_CAT_OPTIONS}</select></label> <input type="submit" value="{L_GO}" name="display_gallery" class="button2" /> <input type="submit" name="cancel" value="{L_CANCEL}" class="button2" /> </fieldset> diff --git a/phpBB/styles/prosilver/template/ucp_groups_manage.html b/phpBB/styles/prosilver/template/ucp_groups_manage.html index a13c043e48..6b017ea3fa 100644 --- a/phpBB/styles/prosilver/template/ucp_groups_manage.html +++ b/phpBB/styles/prosilver/template/ucp_groups_manage.html @@ -21,18 +21,18 @@ <fieldset> <dl> - <dt><label for="group_name">{L_GROUP_NAME}:</label></dt> + <dt><label for="group_name">{L_GROUP_NAME}{L_COLON}</label></dt> <dd><!-- IF S_SPECIAL_GROUP --><strong<!-- IF GROUP_COLOUR --> style="color: #{GROUP_COLOUR};"<!-- ENDIF -->>{GROUP_NAME}</strong> <input name="group_name" type="hidden" value="{GROUP_INTERNAL_NAME}" /> <!-- ELSE --><input name="group_name" type="text" id="group_name" value="{GROUP_INTERNAL_NAME}" class="inputbox" /><!-- ENDIF --></dd> </dl> <dl> - <dt><label for="group_desc">{L_GROUP_DESC}:</label></dt> + <dt><label for="group_desc">{L_GROUP_DESC}{L_COLON}</label></dt> <dd><textarea id="group_desc" name="group_desc" rows="5" cols="45" class="inputbox">{GROUP_DESC}</textarea></dd> <dd><label for="desc_parse_bbcode"><input type="checkbox" class="radio" name="desc_parse_bbcode" id="desc_parse_bbcode"<!-- IF S_DESC_BBCODE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_BBCODE}</label> <label for="desc_parse_smilies"><input type="checkbox" class="radio" name="desc_parse_smilies" id="desc_parse_smilies"<!-- IF S_DESC_SMILIES_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_SMILIES}</label> <label for="desc_parse_urls"><input type="checkbox" class="radio" name="desc_parse_urls" id="desc_parse_urls"<!-- IF S_DESC_URLS_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_URLS}</label></dd> </dl> <!-- IF not S_SPECIAL_GROUP --> <dl> - <dt><label for="group_type1">{L_GROUP_TYPE}:</label><br /><span>{L_GROUP_TYPE_EXPLAIN}</span></dt> + <dt><label for="group_type1">{L_GROUP_TYPE}{L_COLON}</label><br /><span>{L_GROUP_TYPE_EXPLAIN}</span></dt> <dd> <label for="group_type1"><input type="radio" class="radio" name="group_type" id="group_type1" value="{GROUP_TYPE_FREE}"{GROUP_FREE} /> {L_GROUP_OPEN}</label> <label for="group_type2"><input type="radio" class="radio" name="group_type" id="group_type2" value="{GROUP_TYPE_OPEN}"{GROUP_OPEN} /> {L_GROUP_REQUEST}</label> @@ -54,11 +54,11 @@ <fieldset> <dl> - <dt><label for="group_colour">{L_GROUP_COLOR}:</label><br /><span>{L_GROUP_COLOR_EXPLAIN}</span></dt> + <dt><label for="group_colour">{L_GROUP_COLOR}{L_COLON}</label><br /><span>{L_GROUP_COLOR_EXPLAIN}</span></dt> <dd><input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="7" maxlength="7" class="inputbox narrow" /> <span style="background-color: {GROUP_COLOUR};"> </span> [ <a href="{U_SWATCH}" onclick="popup(this.href, 636, 150, '_swatch'); return false;">{L_COLOUR_SWATCH}</a> ]</dd> </dl> <dl> - <dt><label for="group_rank">{L_GROUP_RANK}:</label></dt> + <dt><label for="group_rank">{L_GROUP_RANK}{L_COLON}</label></dt> <dd><select name="group_rank" id="group_rank">{S_RANK_OPTIONS}</select></dd> </dl> </fieldset> @@ -159,7 +159,11 @@ <ul class="linklist"> <li class="leftside pagination"> - <!-- 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 --> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {S_ON_PAGE} + <!-- ENDIF --> </li> </ul> @@ -181,14 +185,14 @@ <fieldset> <dl> - <dt><label for="default0">{L_USER_GROUP_DEFAULT}:</label><br /><span>{L_USER_GROUP_DEFAULT_EXPLAIN}</span></dt> + <dt><label for="default0">{L_USER_GROUP_DEFAULT}{L_COLON}</label><br /><span>{L_USER_GROUP_DEFAULT_EXPLAIN}</span></dt> <dd> <label for="default1"><input type="radio" name="default" id="default1" value="1" /> {L_YES}</label> <label for="default0"><input type="radio" name="default" id="default0" value="0" checked="checked" /> {L_NO}</label> </dd> </dl> <dl> - <dt><label for="usernames">{L_USERNAME}:</label><br /><span>{L_USERNAMES_EXPLAIN}</span></dt> + <dt><label for="usernames">{L_USERNAME}{L_COLON}</label><br /><span>{L_USERNAMES_EXPLAIN}</span></dt> <dd><textarea name="usernames" id="usernames" rows="3" cols="30" class="inputbox"></textarea></dd> <dd><strong><a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a></strong></dd> </dl> diff --git a/phpBB/styles/prosilver/template/ucp_groups_membership.html b/phpBB/styles/prosilver/template/ucp_groups_membership.html index a312911ae4..bf266208f2 100644 --- a/phpBB/styles/prosilver/template/ucp_groups_membership.html +++ b/phpBB/styles/prosilver/template/ucp_groups_membership.html @@ -93,7 +93,7 @@ <!-- IF pending.GROUP_DESC --><br />{pending.GROUP_DESC}<!-- ENDIF --> <!-- IF not pending.GROUP_SPECIAL --><br /><i>{pending.GROUP_STATUS}</i><!-- ENDIF --> </dt> - <dd class="mark"><input type="radio" name="selected" value="{pending.GROUP_ID}" <!-- IF pending.GROUP_SPECIAL -->disabled="diabled"<!-- ENDIF --> /></dd> + <dd class="mark"><input type="radio" name="selected" value="{pending.GROUP_ID}" <!-- IF pending.GROUP_SPECIAL -->disabled="disabled"<!-- ENDIF --> /></dd> </dl> </li> <!-- END pending --> @@ -146,7 +146,7 @@ <!-- IF $SHOW_BUTTONS eq 1 --> <div class="right-box"> - <label for="action">{L_SELECT}:</label> + <label for="action">{L_SELECT}{L_COLON}</label> <select name="action" id="action"> <option value="join">{L_JOIN_SELECTED}</option> <option value="resign">{L_RESIGN_SELECTED}</option> diff --git a/phpBB/styles/prosilver/template/ucp_main_bookmarks.html b/phpBB/styles/prosilver/template/ucp_main_bookmarks.html index 89502bbc3d..8707a749c1 100644 --- a/phpBB/styles/prosilver/template/ucp_main_bookmarks.html +++ b/phpBB/styles/prosilver/template/ucp_main_bookmarks.html @@ -36,7 +36,20 @@ <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a> <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF --> <!-- IF topicrow.S_TOPIC_REPORTED --><a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --><br /> - <!-- IF topicrow.PAGINATION --><strong class="pagination"><span>{topicrow.PAGINATION}</span></strong><!-- ENDIF --> + <!-- IF .topicrow.pagination --> + <div class="pagination"> + <ul> + <!-- BEGIN pagination --> + <!-- IF topicrow.pagination.S_IS_PREV --> + <!-- ELSEIF topicrow.pagination.S_IS_CURRENT --><li class="active"><span>{topicrow.pagination.PAGE_NUMBER}</span></li> + <!-- ELSEIF topicrow.pagination.S_IS_ELLIPSIS --><li class="ellipsis"><span>{L_ELLIPSIS}</span></li> + <!-- ELSEIF topicrow.pagination.S_IS_NEXT --> + <!-- ELSE --><li><a href="{topicrow.pagination.PAGE_URL}">{topicrow.pagination.PAGE_NUMBER}</a></li> + <!-- ENDIF --> + <!-- END pagination --> + </ul> + </div> + <!-- ENDIF --> <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->{L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} » {topicrow.FIRST_POST_TIME} </dt> <dd class="lastpost"><span><dfn>{L_LAST_POST} </dfn>{L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} @@ -50,8 +63,12 @@ </ul> <ul class="linklist"> <li class="rightside pagination"> - <!-- IF TOTAL_TOPICS --> {TOTAL_TOPICS} <!-- ENDIF --> - <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> + <!-- IF TOTAL_TOPICS --> {TOTAL_TOPICS} • <!-- ENDIF --> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </li> </ul> <!-- ELSE --> diff --git a/phpBB/styles/prosilver/template/ucp_main_drafts.html b/phpBB/styles/prosilver/template/ucp_main_drafts.html index 2155abeda3..a99c52cbfc 100644 --- a/phpBB/styles/prosilver/template/ucp_main_drafts.html +++ b/phpBB/styles/prosilver/template/ucp_main_drafts.html @@ -40,8 +40,8 @@ <dl> <dt> <a class="topictitle" href="{draftrow.U_VIEW_EDIT}">{draftrow.DRAFT_SUBJECT}</a><br /> - <!-- IF draftrow.S_LINK_TOPIC -->{L_TOPIC}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a> - <!-- ELSEIF draftrow.S_LINK_FORUM -->{L_FORUM}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a> + <!-- IF draftrow.S_LINK_TOPIC -->{L_TOPIC}{L_COLON} <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a> + <!-- ELSEIF draftrow.S_LINK_FORUM -->{L_FORUM}{L_COLON} <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a> <!-- ELSEIF S_PRIVMSGS --> <!-- ELSE -->{L_NO_TOPIC_FORUM}<!-- ENDIF --> </dt> diff --git a/phpBB/styles/prosilver/template/ucp_main_front.html b/phpBB/styles/prosilver/template/ucp_main_front.html index b7a0619227..b92ca7c8e2 100644 --- a/phpBB/styles/prosilver/template/ucp_main_front.html +++ b/phpBB/styles/prosilver/template/ucp_main_front.html @@ -16,7 +16,20 @@ <dl class="icon {topicrow.TOPIC_IMG_STYLE}"> <dt <!-- IF topicrow.TOPIC_ICON_IMG -->style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF -->> <!-- IF topicrow.S_UNREAD --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a><br /> - <!-- IF topicrow.PAGINATION --><strong class="pagination"><span>{topicrow.PAGINATION}</span></strong><!-- ENDIF --> + <!-- IF .topicrow.pagination --> + <div class="pagination"> + <ul> + <!-- BEGIN pagination --> + <!-- IF topicrow.pagination.S_IS_PREV --> + <!-- ELSEIF topicrow.pagination.S_IS_CURRENT --><li class="active"><span>{topicrow.pagination.PAGE_NUMBER}</span></li> + <!-- ELSEIF topicrow.pagination.S_IS_ELLIPSIS --><li class="ellipsis"><span>{L_ELLIPSIS}</span></li> + <!-- ELSEIF topicrow.pagination.S_IS_NEXT --> + <!-- ELSE --><li><a href="{topicrow.pagination.PAGE_URL}">{topicrow.pagination.PAGE_NUMBER}</a></li> + <!-- ENDIF --> + <!-- END pagination --> + </ul> + </div> + <!-- ENDIF --> <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->{L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} » {topicrow.FIRST_POST_TIME} </dt> <dd class="lastpost"><span>{L_LAST_POST} {L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} @@ -31,12 +44,12 @@ <h3>{L_YOUR_DETAILS}</h3> <dl class="details"> - <dt>{L_JOINED}:</dt> <dd>{JOINED}</dd> - <dt>{L_VISITED}:</dt> <dd>{LAST_VISIT_YOU}</dd> - <dt>{L_TOTAL_POSTS}:</dt> <dd><!-- IF POSTS_PCT -->{POSTS}<!-- IF S_DISPLAY_SEARCH --> | <strong><a href="{U_SEARCH_USER}">{L_SEARCH_YOUR_POSTS}</a></strong><!-- ENDIF --><br />({POSTS_DAY} / {POSTS_PCT})<!-- ELSE -->{POSTS}<!-- ENDIF --></dd> - <!-- IF ACTIVE_FORUM != '' --><dt>{L_ACTIVE_IN_FORUM}:</dt> <dd><strong><a href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></strong><br />({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT})</dd><!-- ENDIF --> - <!-- IF ACTIVE_TOPIC != '' --><dt>{L_ACTIVE_IN_TOPIC}:</dt> <dd><strong><a href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></strong><br />({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT})</dd><!-- ENDIF --> - <!-- IF WARNINGS --><dt>{L_YOUR_WARNINGS}:</dt> <dd class="error">{WARNING_IMG} [{WARNINGS}]</dd><!-- ENDIF --> + <dt>{L_JOINED}{L_COLON}</dt> <dd>{JOINED}</dd> + <dt>{L_VISITED}{L_COLON}</dt> <dd>{LAST_VISIT_YOU}</dd> + <dt>{L_TOTAL_POSTS}{L_COLON}</dt> <dd><!-- IF POSTS_PCT -->{POSTS}<!-- IF S_DISPLAY_SEARCH --> | <strong><a href="{U_SEARCH_USER}">{L_SEARCH_YOUR_POSTS}</a></strong><!-- ENDIF --><br />({POSTS_DAY} / {POSTS_PCT})<!-- ELSE -->{POSTS}<!-- ENDIF --></dd> + <!-- IF ACTIVE_FORUM != '' --><dt>{L_ACTIVE_IN_FORUM}{L_COLON}</dt> <dd><strong><a href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></strong><br />({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT})</dd><!-- ENDIF --> + <!-- IF ACTIVE_TOPIC != '' --><dt>{L_ACTIVE_IN_TOPIC}{L_COLON}</dt> <dd><strong><a href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></strong><br />({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT})</dd><!-- ENDIF --> + <!-- IF WARNINGS --><dt>{L_YOUR_WARNINGS}{L_COLON}</dt> <dd class="error">{WARNING_IMG} [{WARNINGS}]</dd><!-- ENDIF --> </dl> </div> diff --git a/phpBB/styles/prosilver/template/ucp_main_subscribed.html b/phpBB/styles/prosilver/template/ucp_main_subscribed.html index ab65d9b3ae..11957aa90d 100644 --- a/phpBB/styles/prosilver/template/ucp_main_subscribed.html +++ b/phpBB/styles/prosilver/template/ucp_main_subscribed.html @@ -56,7 +56,20 @@ <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a> <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF --> <!-- IF topicrow.S_TOPIC_REPORTED --><a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --><br /> - <!-- IF topicrow.PAGINATION --><strong class="pagination"><span>{topicrow.PAGINATION}</span></strong><!-- ENDIF --> + <!-- IF .topicrow.pagination --> + <div class="pagination"> + <ul> + <!-- BEGIN pagination --> + <!-- IF topicrow.pagination.S_IS_PREV --> + <!-- ELSEIF topicrow.pagination.S_IS_CURRENT --><li class="active"><span>{topicrow.pagination.PAGE_NUMBER}</span></li> + <!-- ELSEIF topicrow.pagination.S_IS_ELLIPSIS --><li class="ellipsis"><span>{L_ELLIPSIS}</span></li> + <!-- ELSEIF topicrow.pagination.S_IS_NEXT --> + <!-- ELSE --><li><a href="{topicrow.pagination.PAGE_URL}">{topicrow.pagination.PAGE_NUMBER}</a></li> + <!-- ENDIF --> + <!-- END pagination --> + </ul> + </div> + <!-- ENDIF --> <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->{L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} » {topicrow.FIRST_POST_TIME} </dt> <dd class="lastpost"><span><dfn>{L_LAST_POST} </dfn>{L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} @@ -69,8 +82,12 @@ </ul> <ul class="linklist"> <li class="rightside pagination"> - <!-- IF TOTAL_TOPICS --> {TOTAL_TOPICS} <!-- ENDIF --> - <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> + <!-- IF TOTAL_TOPICS --> {TOTAL_TOPICS} • <!-- ENDIF --> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </li> </ul> <!-- ELSEIF S_TOPIC_NOTIFY --> diff --git a/phpBB/styles/prosilver/template/ucp_pm_history.html b/phpBB/styles/prosilver/template/ucp_pm_history.html index d7fcbb9e54..6abc9b1402 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_history.html +++ b/phpBB/styles/prosilver/template/ucp_pm_history.html @@ -1,7 +1,7 @@ <h3 id="review"> <span class="right-box"><a href="#review" onclick="viewableArea(getElementById('topicreview'), true); var rev_text = getElementById('review').getElementsByTagName('a').item(0).firstChild; if (rev_text.data == '{LA_EXPAND_VIEW}'){rev_text.data = '{LA_COLLAPSE_VIEW}'; } else if (rev_text.data == '{LA_COLLAPSE_VIEW}'){rev_text.data = '{LA_EXPAND_VIEW}'};">{L_EXPAND_VIEW}</a></span> - {L_MESSAGE_HISTORY}: + {L_MESSAGE_HISTORY}{L_COLON} </h3> <div id="topicreview"> @@ -22,7 +22,7 @@ <!-- ENDIF --> <h3><a href="{history_row.U_VIEW_MESSAGE}" <!-- IF history_row.S_CURRENT_MSG -->class="current"<!-- ENDIF -->>{history_row.SUBJECT}</a></h3> - <p class="author">{history_row.MINI_POST_IMG} {L_SENT_AT}: <strong>{history_row.SENT_DATE}</strong><br /> + <p class="author">{history_row.MINI_POST_IMG} {L_SENT_AT}{L_COLON} <strong>{history_row.SENT_DATE}</strong><br /> {L_MESSAGE_BY_AUTHOR} {history_row.MESSAGE_AUTHOR_FULL}</p> <div class="content">{history_row.MESSAGE}</div> <div id="message_{history_row.MSG_ID}" style="display: none;">{history_row.DECODED_MESSAGE}</div> diff --git a/phpBB/styles/prosilver/template/ucp_pm_message_header.html b/phpBB/styles/prosilver/template/ucp_pm_message_header.html index d6659fad0f..c47f93f739 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_message_header.html +++ b/phpBB/styles/prosilver/template/ucp_pm_message_header.html @@ -1,4 +1,4 @@ -<h2>{L_TITLE}<!-- IF CUR_FOLDER_NAME -->: {CUR_FOLDER_NAME}<!-- ENDIF --></h2> +<h2>{L_TITLE}<!-- IF CUR_FOLDER_NAME -->{L_COLON} {CUR_FOLDER_NAME}<!-- ENDIF --></h2> <form id="viewfolder" method="post" action="{S_PM_ACTION}"> @@ -11,17 +11,21 @@ <!-- IF U_POST_REPLY_PM --><div class="pmreply-icon"><a title="{L_POST_REPLY_PM}" href="{U_POST_REPLY_PM}"><span></span>{L_POST_REPLY_PM}</a></div> <!-- ELSEIF U_POST_NEW_TOPIC --><div class="newpm-icon"><a href="{U_POST_NEW_TOPIC}" accesskey="n" title="{L_UCP_PM_COMPOSE}"><span></span>{L_UCP_PM_COMPOSE}</a></div><!-- ENDIF --> <!-- IF U_FORWARD_PM --><div class="forwardpm-icon"><a title="{L_POST_FORWARD_PM}" href="{U_FORWARD_PM}"><span></span>{L_FORWARD_PM}</a></div><!-- ENDIF --> - <!-- IF U_POST_REPLY_PM and S_PM_RECIPIENTS gt 1 --><div class="reply-all"><a class="left" title="{L_REPLY_TO_ALL}" href="{U_POST_REPLY_ALL}">{L_REPLY_TO_ALL}</a></div><!-- ENDIF --> + <!-- IF U_POST_REPLY_PM and S_PM_RECIPIENTS gt 1 --><div class="reply-all"><a class="left" title="{L_REPLY_TO_ALL}" href="{U_POST_REPLY_ALL}">{L_REPLY_TO_ALL}</a></div><!-- ENDIF --> </div> <!-- ENDIF --> <!-- IF TOTAL_MESSAGES or S_VIEW_MESSAGE --> <ul class="linklist"> <li class="rightside pagination"> - <!-- IF S_VIEW_MESSAGE --><a class="{S_CONTENT_FLOW_BEGIN}" href="{U_CURRENT_FOLDER}">{L_RETURN_TO} {CUR_FOLDER_NAME}</a><!-- ENDIF --> + <!-- IF S_VIEW_MESSAGE --><a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_CURRENT_FOLDER}">{L_RETURN_TO} {CUR_FOLDER_NAME}</a><!-- ENDIF --> <!-- IF FOLDER_CUR_MESSAGES neq 0 --> - <!-- IF TOTAL_MESSAGES -->{TOTAL_MESSAGES}<!-- ENDIF --> - <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> + <!-- IF TOTAL_MESSAGES -->{TOTAL_MESSAGES} • <!-- ENDIF --> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> <!-- ENDIF --> </li> </ul> diff --git a/phpBB/styles/prosilver/template/ucp_pm_options.html b/phpBB/styles/prosilver/template/ucp_pm_options.html index dde8ee639b..247be8b6fd 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_options.html +++ b/phpBB/styles/prosilver/template/ucp_pm_options.html @@ -9,12 +9,12 @@ <!-- IF ERROR_MESSAGE --><p class="error">{ERROR_MESSAGE}</p><!-- ENDIF --> <!-- IF NOTIFICATION_MESSAGE --><p class="error">{NOTIFICATION_MESSAGE}</p><!-- ENDIF --> - + <h3>{L_DEFINED_RULES}</h3> <ol class="def-rules"> <!-- BEGIN rule --> - <li><div class="right-box"><input type="submit" name="delete_rule[{rule.RULE_ID}]" value="{L_DELETE_RULE}" class="button2" /></div><strong>{L_IF}</strong> {rule.CHECK} <em>{rule.RULE}</em> <!-- IF rule.STRING --><strong>{rule.STRING}</strong> | <!-- ENDIF -->{rule.ACTION}<!-- IF rule.FOLDER -->: {rule.FOLDER}<!-- ENDIF --><div style="clear: both;"></div></li> + <li><div class="right-box"><input type="submit" name="delete_rule[{rule.RULE_ID}]" value="{L_DELETE_RULE}" class="button2" /></div><strong>{L_IF}</strong> {rule.CHECK} <em>{rule.RULE}</em> <!-- IF rule.STRING --><strong>{rule.STRING}</strong> | <!-- ENDIF -->{rule.ACTION}<!-- IF rule.FOLDER -->{L_COLON} {rule.FOLDER}<!-- ENDIF --><div style="clear: both;"></div></li> <!-- BEGINELSE --> <li><strong>{L_NO_RULES_DEFINED}</strong></li> <!-- END rule --> @@ -26,7 +26,7 @@ <!-- IF S_CHECK_DEFINED --> <dl> - <dt><label<!-- IF S_CHECK_SELECT --> for="check_option"<!-- ENDIF -->>{L_IF}:</label></dt> + <dt><label<!-- IF S_CHECK_SELECT --> for="check_option"<!-- ENDIF -->>{L_IF}{L_COLON}</label></dt> <dd> <!-- IF S_CHECK_SELECT --><select name="check_option" id="check_option">{S_CHECK_OPTIONS}</select> <input type="submit" name="next" value="{L_NEXT_STEP}" class="button2" /><!-- ELSE -->{CHECK_CURRENT}<input type="hidden" name="check_option" value="{CHECK_OPTION}" /><!-- ENDIF --> </dd> @@ -81,26 +81,26 @@ <!-- IF not S_MAX_FOLDER_ZERO --> <dl> - <dt><label for="foldername">{L_ADD_FOLDER}:</label></dt> + <dt><label for="foldername">{L_ADD_FOLDER}{L_COLON}</label></dt> <dd><!-- IF S_MAX_FOLDER_REACHED -->{L_MAX_FOLDER_REACHED}<!-- ELSE --><input type="text" class="inputbox medium" name="foldername" id="foldername" size="30" maxlength="30" /> <input class="button2" type="submit" name="addfolder" value="{L_ADD}" /><!-- ENDIF --></dd> </dl> <!-- IF S_FOLDER_OPTIONS --><hr class="dashed" /><!-- ENDIF --> <!-- ENDIF --> - + <!-- IF S_FOLDER_OPTIONS --> <dl> - <dt><label for="rename_folder_id">{L_RENAME_FOLDER}:</label></dt> + <dt><label for="rename_folder_id">{L_RENAME_FOLDER}{L_COLON}</label></dt> <dd><select name="rename_folder_id" id="rename_folder_id">{S_FOLDER_OPTIONS}</select></dd> - <dt><label for="new_folder_name">{L_NEW_FOLDER_NAME}:</label></dt> + <dt><label for="new_folder_name">{L_NEW_FOLDER_NAME}{L_COLON}</label></dt> <dd><input type="text" class="inputbox tiny" name="new_folder_name" id="new_folder_name" maxlength="30" /> <input class="button2" type="submit" name="rename_folder" value="{L_RENAME}" /></dd> </dl> <hr class="dashed" /> <dl> - <dt><label for="remove_folder_id">{L_REMOVE_FOLDER}:</label></dt> + <dt><label for="remove_folder_id">{L_REMOVE_FOLDER}{L_COLON}</label></dt> <dd><select name="remove_folder_id" id="remove_folder_id">{S_FOLDER_OPTIONS}</select></dd> - <dd style="margin-top: 3px;"><label for="remove_action1"><input type="radio" name="remove_action" id="remove_action1" value="1" checked="checked" /> {L_MOVE_DELETED_MESSAGES_TO}:</label> <select name="move_to">{S_TO_FOLDER_OPTIONS}</select></dd> + <dd style="margin-top: 3px;"><label for="remove_action1"><input type="radio" name="remove_action" id="remove_action1" value="1" checked="checked" /> {L_MOVE_DELETED_MESSAGES_TO}{L_COLON}</label> <select name="move_to">{S_TO_FOLDER_OPTIONS}</select></dd> <dd style="margin-top: 3px;"><label for="remove_action2"><input type="radio" name="remove_action" id="remove_action2" value="2" /> {L_DELETE_MESSAGES_IN_FOLDER}</label></dd> <dd style="margin-top: 3px;"><input class="button2" type="submit" name="remove_folder" value="{L_REMOVE}" /></dd> </dl> @@ -109,15 +109,15 @@ <hr class="dashed" /> <dl> - <dt><label for="full_action1">{L_IF_FOLDER_FULL}:</label></dt> + <dt><label for="full_action1">{L_IF_FOLDER_FULL}{L_COLON}</label></dt> <dd style="margin-top: 3px;"><label for="full_action1"><input type="radio" name="full_action" id="full_action1" value="1"{S_DELETE_CHECKED} /> {L_DELETE_OLDEST_MESSAGES}</label></dd> - <dd style="margin-top: 3px;"><label for="full_action2"><input type="radio" name="full_action" id="full_action2" value="2"{S_MOVE_CHECKED} /> {L_MOVE_TO_FOLDER}:</label> <select name="full_move_to">{S_FULL_FOLDER_OPTIONS}</select></dd> + <dd style="margin-top: 3px;"><label for="full_action2"><input type="radio" name="full_action" id="full_action2" value="2"{S_MOVE_CHECKED} /> {L_MOVE_TO_FOLDER}{L_COLON}</label> <select name="full_move_to">{S_FULL_FOLDER_OPTIONS}</select></dd> <dd style="margin-top: 3px;"><label for="full_action3" style="white-space:normal;"><input type="radio" name="full_action" id="full_action3" value="3"{S_HOLD_CHECKED} /> {L_HOLD_NEW_MESSAGES}</label></dd> </dl> <dl> - <dt><label>{L_DEFAULT_ACTION}:</label><br /><span>{L_DEFAULT_ACTION_EXPLAIN}</span></dt> + <dt><label>{L_DEFAULT_ACTION}{L_COLON}</label><br /><span>{L_DEFAULT_ACTION_EXPLAIN}</span></dt> <dd>{DEFAULT_ACTION}</dd> <dd><input class="button2" type="submit" name="fullfolder" value="{L_CHANGE}" /></dd> </dl> diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html b/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html index 20394b254e..96668284eb 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html +++ b/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html @@ -12,11 +12,11 @@ <h3>{L_OPTIONS}</h3> <fieldset> <dl> - <dt><label for="delimiter">{L_DELIMITER}:</label></dt> + <dt><label for="delimiter">{L_DELIMITER}{L_COLON}</label></dt> <dd><input class="inputbox" type="text" id="delimiter" name="delimiter" value="," /></dd> </dl> <dl> - <dt><label for="enclosure">{L_ENCLOSURE}:</label></dt> + <dt><label for="enclosure">{L_ENCLOSURE}{L_COLON}</label></dt> <dd><input class="inputbox" type="text" id="enclosure" name="enclosure" value=""" /></dd> </dl> </fieldset> @@ -73,7 +73,7 @@ <!-- IF messagerow.S_PM_REPORTED --><a href="{messagerow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --> {messagerow.ATTACH_ICON_IMG}<br /> <!-- IF S_SHOW_RECIPIENTS -->{L_MESSAGE_TO} {messagerow.RECIPIENTS}<!-- ELSE -->{L_MESSAGE_BY_AUTHOR} {messagerow.MESSAGE_AUTHOR_FULL} » {messagerow.SENT_TIME}<!-- ENDIF --> </dt> - <!-- IF S_SHOW_RECIPIENTS --><dd class="info"><span>{L_SENT_AT}: {messagerow.SENT_TIME}</span></dd><!-- ENDIF --> + <!-- IF S_SHOW_RECIPIENTS --><dd class="info"><span>{L_SENT_AT}{L_COLON} {messagerow.SENT_TIME}</span></dd><!-- ENDIF --> <!-- IF S_UNREAD --><dd class="info"><!-- IF messagerow.FOLDER --><a href="{messagerow.U_FOLDER}">{messagerow.FOLDER}</a><!-- ELSE -->{L_UNKNOWN_FOLDER}<!-- ENDIF --></dd><!-- ENDIF --> <dd class="mark"><input type="checkbox" name="marked_msg_id[]" value="{messagerow.MESSAGE_ID}" /></dd> </dl> @@ -93,7 +93,7 @@ <!-- IF FOLDER_CUR_MESSAGES neq 0 --> <fieldset class="display-actions"> - <div class="left-box"><label for="export_option">{L_EXPORT_FOLDER}: <select name="export_option" id="export_option"><option value="CSV">{L_EXPORT_AS_CSV}</option><option value="CSV_EXCEL">{L_EXPORT_AS_CSV_EXCEL}</option><option value="XML">{L_EXPORT_AS_XML}</option></select></label> <input class="button2" type="submit" name="submit_export" value="{L_GO}" /><br /></div> + <div class="left-box"><label for="export_option">{L_EXPORT_FOLDER}{L_COLON} <select name="export_option" id="export_option"><option value="CSV">{L_EXPORT_AS_CSV}</option><option value="CSV_EXCEL">{L_EXPORT_AS_CSV_EXCEL}</option><option value="XML">{L_EXPORT_AS_XML}</option></select></label> <input class="button2" type="submit" name="submit_export" value="{L_GO}" /><br /></div> <select name="mark_option">{S_MARK_OPTIONS}{S_MOVE_MARKED_OPTIONS}</select> <input class="button2" type="submit" name="submit_mark" value="{L_GO}" /> <div><a href="#" onclick="marklist('viewfolder', 'marked_msg', true); return false;">{L_MARK_ALL}</a> • <a href="#" onclick="marklist('viewfolder', 'marked_msg', false); return false;">{L_UNMARK_ALL}</a></div> </fieldset> @@ -103,8 +103,12 @@ <ul class="linklist"> <!-- IF TOTAL_MESSAGES or S_VIEW_MESSAGE --> <li class="rightside pagination"> - <!-- IF TOTAL_MESSAGES -->{TOTAL_MESSAGES}<!-- ENDIF --> - <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> + <!-- IF TOTAL_MESSAGES -->{TOTAL_MESSAGES} • <!-- ENDIF --> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </li> <!-- ENDIF --> </ul> @@ -115,9 +119,9 @@ <!-- IF FOLDER_CUR_MESSAGES neq 0 --> <fieldset class="display-options"> - <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> - <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> - <label>{L_DISPLAY}: {S_SELECT_SORT_DAYS}</label> + <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> + <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> + <label>{L_DISPLAY}{L_COLON} {S_SELECT_SORT_DAYS}</label> <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label> <label>{S_SELECT_SORT_DIR} <input type="submit" name="sort" value="{L_GO}" class="button2" /></label> <input type="hidden" name="cur_folder_id" value="{CUR_FOLDER_ID}" /> diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html index 2e7a7c4ac9..22149c8b80 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html +++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html @@ -8,8 +8,8 @@ <!-- IF S_DISPLAY_HISTORY and (U_VIEW_PREVIOUS_HISTORY or U_VIEW_NEXT_HISTORY) --> <fieldset class="display-options clearfix"> - <!-- IF U_VIEW_PREVIOUS_HISTORY --><a href="{U_VIEW_PREVIOUS_HISTORY}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_VIEW_PREVIOUS_HISTORY}</a><!-- ENDIF --> - <!-- IF U_VIEW_NEXT_HISTORY --><a href="{U_VIEW_NEXT_HISTORY}" class="right-box {S_CONTENT_FLOW_END}">{L_VIEW_NEXT_HISTORY}</a><!-- ENDIF --> + <!-- IF U_VIEW_PREVIOUS_HISTORY --><a href="{U_VIEW_PREVIOUS_HISTORY}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_VIEW_PREVIOUS_HISTORY}</a><!-- ENDIF --> + <!-- IF U_VIEW_NEXT_HISTORY --><a href="{U_VIEW_NEXT_HISTORY}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_VIEW_NEXT_HISTORY}</a><!-- ENDIF --> </fieldset> <!-- ENDIF --> @@ -31,22 +31,34 @@ <h3 class="first">{SUBJECT}</h3> <p class="author"> - <strong>{L_SENT_AT}:</strong> {SENT_DATE} - <br /><strong>{L_PM_FROM}:</strong> {MESSAGE_AUTHOR_FULL} - <!-- IF S_TO_RECIPIENT --><br /><strong>{L_TO}:</strong> <!-- BEGIN to_recipient --><!-- IF to_recipient.NAME_FULL -->{to_recipient.NAME_FULL}<!-- ELSE --><a href="{to_recipient.U_VIEW}" style="color:<!-- IF to_recipient.COLOUR -->{to_recipient.COLOUR}<!-- ELSEIF to_recipient.IS_GROUP -->#0000FF<!-- ENDIF -->;">{to_recipient.NAME}</a><!-- ENDIF --> <!-- END to_recipient --><!-- ENDIF --> - <!-- IF S_BCC_RECIPIENT --><br /><strong>{L_BCC}:</strong> <!-- BEGIN bcc_recipient --><!-- IF bcc_recipient.NAME_FULL -->{bcc_recipient.NAME_FULL}<!-- ELSE --><a href="{bcc_recipient.U_VIEW}" style="color:<!-- IF bcc_recipient.COLOUR -->{bcc_recipient.COLOUR}<!-- ELSEIF bcc_recipient.IS_GROUP -->#0000FF<!-- ENDIF -->;">{bcc_recipient.NAME}</a><!-- ENDIF --> <!-- END bcc_recipient --><!-- ENDIF --> + <strong>{L_SENT_AT}{L_COLON}</strong> {SENT_DATE} + <br /><strong>{L_PM_FROM}{L_COLON}</strong> {MESSAGE_AUTHOR_FULL} + <!-- IF S_TO_RECIPIENT --><br /><strong>{L_TO}{L_COLON}</strong> <!-- BEGIN to_recipient --><!-- IF to_recipient.NAME_FULL -->{to_recipient.NAME_FULL}<!-- ELSE --><a href="{to_recipient.U_VIEW}" style="color:<!-- IF to_recipient.COLOUR -->{to_recipient.COLOUR}<!-- ELSEIF to_recipient.IS_GROUP -->#0000FF<!-- ENDIF -->;">{to_recipient.NAME}</a><!-- ENDIF --> <!-- END to_recipient --><!-- ENDIF --> + <!-- IF S_BCC_RECIPIENT --><br /><strong>{L_BCC}{L_COLON}</strong> <!-- BEGIN bcc_recipient --><!-- IF bcc_recipient.NAME_FULL -->{bcc_recipient.NAME_FULL}<!-- ELSE --><a href="{bcc_recipient.U_VIEW}" style="color:<!-- IF bcc_recipient.COLOUR -->{bcc_recipient.COLOUR}<!-- ELSEIF bcc_recipient.IS_GROUP -->#0000FF<!-- ENDIF -->;">{bcc_recipient.NAME}</a><!-- ENDIF --> <!-- END bcc_recipient --><!-- ENDIF --> </p> <div class="content">{MESSAGE}</div> <!-- IF S_HAS_ATTACHMENTS --> - <dl class="attachbox"> - <dt>{L_ATTACHMENTS}</dt> - <!-- BEGIN attachment --> - <dd>{attachment.DISPLAY_ATTACHMENT}</dd> - <!-- END attachment --> - </dl> + <dl class="attachbox"> + <dt> + {L_ATTACHMENTS} + <!-- IF S_HAS_MULTIPLE_ATTACHMENTS --> + <div class="dl_links"> + <strong>{L_DOWNLOAD_ALL}{L_COLON}</strong> + <ul> + <!-- BEGIN dl_method --> + <li>[ <a href="{dl_method.LINK}">{dl_method.TYPE}</a> ]</li> + <!-- END dl_method --> + </ul> + </div> + <!-- ENDIF --> + </dt> + <!-- BEGIN attachment --> + <dd>{attachment.DISPLAY_ATTACHMENT}</dd> + <!-- END attachment --> + </dl> <!-- ENDIF --> <!-- IF S_DISPLAY_NOTICE --> @@ -55,7 +67,7 @@ <!-- IF EDITED_MESSAGE or EDIT_REASON --> <div class="notice">{EDITED_MESSAGE} - <!-- IF EDIT_REASON --><br /><strong>{L_REASON}:</strong> <em>{EDIT_REASON}</em><!-- ENDIF --> + <!-- IF EDIT_REASON --><br /><strong>{L_REASON}{L_COLON}</strong> <em>{EDIT_REASON}</em><!-- ENDIF --> </div> <!-- ENDIF --> @@ -69,12 +81,12 @@ <!-- IF RANK_TITLE --><dd>{RANK_TITLE}</dd><!-- ENDIF --> <!-- IF RANK_IMG --><dd>{RANK_IMG}</dd><!-- ENDIF --> <dd> </dd> - <dd><strong>{L_POSTS}:</strong> {AUTHOR_POSTS}</dd> - <!-- IF AUTHOR_JOINED --><dd><strong>{L_JOINED}:</strong> {AUTHOR_JOINED}</dd><!-- ENDIF --> - <!-- IF AUTHOR_FROM --><dd><strong>{L_LOCATION}:</strong> {AUTHOR_FROM}</dd><!-- ENDIF --> + <dd><strong>{L_POSTS}{L_COLON}</strong> {AUTHOR_POSTS}</dd> + <!-- IF AUTHOR_JOINED --><dd><strong>{L_JOINED}{L_COLON}</strong> {AUTHOR_JOINED}</dd><!-- ENDIF --> + <!-- IF AUTHOR_FROM --><dd><strong>{L_LOCATION}{L_COLON}</strong> {AUTHOR_FROM}</dd><!-- ENDIF --> <!-- BEGIN custom_fields --> - <dd><strong>{custom_fields.PROFILE_FIELD_NAME}:</strong> {custom_fields.PROFILE_FIELD_VALUE}</dd> + <dd><strong>{custom_fields.PROFILE_FIELD_NAME}{L_COLON}</strong> {custom_fields.PROFILE_FIELD_VALUE}</dd> <!-- END custom_fields --> @@ -83,7 +95,7 @@ <ul class="profile-icons"> <!-- IF U_PM --><li class="pm-icon"><a href="{U_PM}" title="{L_PRIVATE_MESSAGE}"><span>{L_PRIVATE_MESSAGE}</span></a></li><!-- ENDIF --> <!-- IF U_EMAIL --><li class="email-icon"><a href="{U_EMAIL}" title="{L_SEND_EMAIL_USER} {MESSAGE_AUTHOR}"><span>{L_SEND_EMAIL_USER} {MESSAGE_AUTHOR}</span></a></li><!-- ENDIF --> - <!-- IF U_WWW --><li class="web-icon"><a href="{U_WWW}" title="{L_VISIT_WEBSITE}: {U_WWW}"><span>{L_WEBSITE}</span></a></li><!-- ENDIF --> + <!-- IF U_WWW --><li class="web-icon"><a href="{U_WWW}" title="{L_VISIT_WEBSITE}{L_COLON} {U_WWW}"><span>{L_WEBSITE}</span></a></li><!-- ENDIF --> <!-- IF U_MSN --><li class="msnm-icon"><a href="{U_MSN}" onclick="popup(this.href, 550, 320); return false;" title="{L_MSNM}"><span>{L_MSNM}</span></a></li><!-- ENDIF --> <!-- IF U_ICQ --><li class="icq-icon"><a href="{U_ICQ}" onclick="popup(this.href, 550, 320); return false;" title="{L_ICQ}"><span>{L_ICQ}</span></a></li><!-- ENDIF --> <!-- IF U_YIM --><li class="yahoo-icon"><a href="{U_YIM}" onclick="popup(this.href, 780, 550); return false;" title="{L_YIM}"><span>{L_YIM}</span></a></li><!-- ENDIF --> @@ -101,11 +113,11 @@ <!-- IF S_VIEW_MESSAGE --> <fieldset class="display-options"> - <!-- IF U_PREVIOUS_PM --><a href="{U_PREVIOUS_PM}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_VIEW_PREVIOUS_PM}</a><!-- ENDIF --> - <!-- IF U_NEXT_PM --><a href="{U_NEXT_PM}" class="right-box {S_CONTENT_FLOW_END}">{L_VIEW_NEXT_PM}</a><!-- ENDIF --> + <!-- IF U_PREVIOUS_PM --><a href="{U_PREVIOUS_PM}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_VIEW_PREVIOUS_PM}</a><!-- ENDIF --> + <!-- IF U_NEXT_PM --><a href="{U_NEXT_PM}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_VIEW_NEXT_PM}</a><!-- ENDIF --> <!-- IF S_MARK_OPTIONS --><label for="mark_option"><select name="mark_option" id="mark_option">{S_MARK_OPTIONS}</select></label> <input class="button2" type="submit" name="submit_mark" value="{L_GO}" /><!-- ENDIF --> - <!-- IF not S_UNREAD and not S_SPECIAL_FOLDER --><label for="dest_folder"><!-- IF S_VIEW_MESSAGE -->{L_MOVE_TO_FOLDER}: <!-- ELSE -->{L_MOVE_MARKED_TO_FOLDER}<!-- ENDIF --> <select name="dest_folder" id="dest_folder">{S_TO_FOLDER_OPTIONS}</select></label> <input class="button2" type="submit" name="move_pm" value="{L_GO}" /><!-- ENDIF --> + <!-- IF not S_UNREAD and not S_SPECIAL_FOLDER --><label for="dest_folder"><!-- IF S_VIEW_MESSAGE -->{L_MOVE_TO_FOLDER}{L_COLON} <!-- ELSE -->{L_MOVE_MARKED_TO_FOLDER}<!-- ENDIF --> <select name="dest_folder" id="dest_folder">{S_TO_FOLDER_OPTIONS}</select></label> <input class="button2" type="submit" name="move_pm" value="{L_GO}" /><!-- ENDIF --> <input type="hidden" name="marked_msg_id[]" value="{MSG_ID}" /> <input type="hidden" name="cur_folder_id" value="{CUR_FOLDER_ID}" /> <input type="hidden" name="p" value="{MSG_ID}" /> diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html index bafb64dbc8..a024a170a7 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html +++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html @@ -17,10 +17,9 @@ <div id="page-header"> <h1>{SITENAME}</h1> - <p>{SITE_DESCRIPTION}<br /><a href="{U_FORUM}">{U_FORUM}</a></p> + <p>{SITE_DESCRIPTION}</p> - <h2>{TOPIC_TITLE}</h2> - <p><a href="{U_TOPIC}">{U_TOPIC}</a></p> + <h2>{L_PRIVATE_MESSAGING}</h2> </div> <div id="page-body"> @@ -43,7 +42,7 @@ <div id="page-footer"> <div class="page-number">{S_TIMEZONE}<br />{PAGE_NUMBER}</div> - <div class="copyright">Powered by phpBB® Forum Software © phpBB Group<br />http://www.phpbb.com/</div> + <div class="copyright">Powered by phpBB® Forum Software © phpBB Group<br />https://www.phpbb.com/</div> </div> </div> diff --git a/phpBB/styles/prosilver/template/ucp_prefs_personal.html b/phpBB/styles/prosilver/template/ucp_prefs_personal.html index 1c829899fd..50ade02acd 100644 --- a/phpBB/styles/prosilver/template/ucp_prefs_personal.html +++ b/phpBB/styles/prosilver/template/ucp_prefs_personal.html @@ -10,21 +10,21 @@ <fieldset> <!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF --> <dl> - <dt><label for="viewemail0">{L_SHOW_EMAIL}:</label></dt> + <dt><label for="viewemail0">{L_SHOW_EMAIL}{L_COLON}</label></dt> <dd> <label for="viewemail1"><input type="radio" name="viewemail" id="viewemail1" value="1"<!-- IF S_VIEW_EMAIL --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label for="viewemail0"><input type="radio" name="viewemail" id="viewemail0" value="0"<!-- IF not S_VIEW_EMAIL --> checked="checked"<!-- ENDIF --> /> {L_NO}</label> </dd> </dl> <dl> - <dt><label for="massemail1">{L_ADMIN_EMAIL}:</label></dt> + <dt><label for="massemail1">{L_ADMIN_EMAIL}{L_COLON}</label></dt> <dd> <label for="massemail1"><input type="radio" name="massemail" id="massemail1" value="1"<!-- IF S_MASS_EMAIL --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label for="massemail0"><input type="radio" name="massemail" id="massemail0" value="0"<!-- IF not S_MASS_EMAIL --> checked="checked"<!-- ENDIF --> /> {L_NO}</label> </dd> </dl> <dl> - <dt><label for="allowpm1">{L_ALLOW_PM}:</label><br /><span>{L_ALLOW_PM_EXPLAIN}</span></dt> + <dt><label for="allowpm1">{L_ALLOW_PM}{L_COLON}</label><br /><span>{L_ALLOW_PM_EXPLAIN}</span></dt> <dd> <label for="allowpm1"><input type="radio" name="allowpm" id="allowpm1" value="1"<!-- IF S_ALLOW_PM --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label for="allowpm0"><input type="radio" name="allowpm" id="allowpm0" value="0"<!-- IF not S_ALLOW_PM --> checked="checked"<!-- ENDIF --> /> {L_NO}</label> @@ -32,7 +32,7 @@ </dl> <!-- IF S_CAN_HIDE_ONLINE --> <dl> - <dt><label for="hideonline0">{L_HIDE_ONLINE}:</label><br /><span>{L_HIDE_ONLINE_EXPLAIN}</span></dt> + <dt><label for="hideonline0">{L_HIDE_ONLINE}{L_COLON}</label><br /><span>{L_HIDE_ONLINE_EXPLAIN}</span></dt> <dd> <label for="hideonline1"><input type="radio" name="hideonline" id="hideonline1" value="1"<!-- IF S_HIDE_ONLINE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label for="hideonline0"><input type="radio" name="hideonline" id="hideonline0" value="0"<!-- IF not S_HIDE_ONLINE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label> @@ -41,7 +41,7 @@ <!-- ENDIF --> <!-- IF S_SELECT_NOTIFY --> <dl> - <dt><label for="notifymethod0">{L_NOTIFY_METHOD}:</label></dt> + <dt><label for="notifymethod0">{L_NOTIFY_METHOD}{L_COLON}</label></dt> <dd> <label for="notifymethod0"><input type="radio" name="notifymethod" id="notifymethod0" value="0"<!-- IF S_NOTIFY_EMAIL --> checked="checked"<!-- ENDIF --> /> {L_NOTIFY_METHOD_EMAIL}</label> <label for="notifymethod1"><input type="radio" name="notifymethod" id="notifymethod1" value="1"<!-- IF S_NOTIFY_IM --> checked="checked"<!-- ENDIF --> /> {L_NOTIFY_METHOD_IM}</label> @@ -50,42 +50,34 @@ </dl> <!-- ENDIF --> <dl> - <dt><label for="notifypm1">{L_NOTIFY_ON_PM}:</label></dt> + <dt><label for="notifypm1">{L_NOTIFY_ON_PM}{L_COLON}</label></dt> <dd> <label for="notifypm1"><input type="radio" name="notifypm" id="notifypm1" value="1"<!-- IF S_NOTIFY_PM --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label for="notifypm0"><input type="radio" name="notifypm" id="notifypm0" value="0"<!-- IF not S_NOTIFY_PM --> checked="checked"<!-- ENDIF --> /> {L_NO}</label> </dd> </dl> <dl> - <dt><label for="popuppm0">{L_POPUP_ON_PM}:</label></dt> + <dt><label for="popuppm0">{L_POPUP_ON_PM}{L_COLON}</label></dt> <dd> <label for="popuppm1"><input type="radio" name="popuppm" id="popuppm1" value="1"<!-- IF S_POPUP_PM --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label for="popuppm0"><input type="radio" name="popuppm" id="popuppm0" value="0"<!-- IF not S_POPUP_PM --> checked="checked"<!-- ENDIF --> /> {L_NO}</label> </dd> </dl> - <dl> - <dt><label for="lang">{L_BOARD_LANGUAGE}:</label></dt> - <dd><select name="lang" id="lang">{S_LANG_OPTIONS}</select></dd> - </dl> - <!-- IF S_STYLE_OPTIONS --> + <!-- IF S_MORE_LANGUAGES --> + <dl> + <dt><label for="lang">{L_BOARD_LANGUAGE}{L_COLON}</label></dt> + <dd><select name="lang" id="lang">{S_LANG_OPTIONS}</select></dd> + </dl> + <!-- ENDIF --> + <!-- IF S_STYLE_OPTIONS and S_MORE_STYLES --> <dl> - <dt><label for="style">{L_BOARD_STYLE}:</label></dt> + <dt><label for="style">{L_BOARD_STYLE}{L_COLON}</label></dt> <dd><select name="style" id="style">{S_STYLE_OPTIONS}</select></dd> </dl> <!-- ENDIF --> + <!-- INCLUDE timezone_option.html --> <dl> - <dt><label for="timezone">{L_BOARD_TIMEZONE}:</label></dt> - <dd><select name="tz" id="timezone" class="autowidth">{S_TZ_OPTIONS}</select></dd> - </dl> - <dl> - <dt><label for="dst1">{L_BOARD_DST}:</label></dt> - <dd> - <label for="dst1"><input type="radio" name="dst" id="dst1" value="1"<!-- IF S_DST --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> - <label for="dst0"><input type="radio" name="dst" id="dst0" value="0"<!-- IF not S_DST --> checked="checked"<!-- ENDIF --> /> {L_NO}</label> - </dd> - </dl> - <dl> - <dt><label for="dateformat">{L_BOARD_DATE_FORMAT}:</label><br /><span>{L_BOARD_DATE_FORMAT_EXPLAIN}</span></dt> + <dt><label for="dateformat">{L_BOARD_DATE_FORMAT}{L_COLON}</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} diff --git a/phpBB/styles/prosilver/template/ucp_prefs_post.html b/phpBB/styles/prosilver/template/ucp_prefs_post.html index 0ca51ed7d6..6c68b2bccc 100644 --- a/phpBB/styles/prosilver/template/ucp_prefs_post.html +++ b/phpBB/styles/prosilver/template/ucp_prefs_post.html @@ -9,28 +9,28 @@ <fieldset> <!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF --> <dl> - <dt><label for="bbcode1">{L_DEFAULT_BBCODE}:</label></dt> + <dt><label for="bbcode1">{L_DEFAULT_BBCODE}{L_COLON}</label></dt> <dd> <label for="bbcode1"><input type="radio" name="bbcode" id="bbcode1" value="1"<!-- IF S_BBCODE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label for="bbcode0"><input type="radio" name="bbcode" id="bbcode0" value="0"<!-- IF not S_BBCODE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label> </dd> </dl> <dl> - <dt><label for="smilies1">{L_DEFAULT_SMILIES}:</label></dt> + <dt><label for="smilies1">{L_DEFAULT_SMILIES}{L_COLON}</label></dt> <dd> <label for="smilies1"><input type="radio" name="smilies" id="smilies1" value="1"<!-- IF S_SMILIES --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label for="smilies0"><input type="radio" name="smilies" id="smilies0" value="0"<!-- IF not S_SMILIES --> checked="checked"<!-- ENDIF --> /> {L_NO}</label> </dd> </dl> <dl> - <dt><label for="sig1">{L_DEFAULT_ADD_SIG}:</label></dt> + <dt><label for="sig1">{L_DEFAULT_ADD_SIG}{L_COLON}</label></dt> <dd> <label for="sig1"><input type="radio" name="sig" id="sig1" value="1"<!-- IF S_SIG --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label for="sig0"><input type="radio" name="sig" id="sig0" value="0"<!-- IF not S_SIG --> checked="checked"<!-- ENDIF --> /> {L_NO}</label> </dd> </dl> <dl> - <dt><label for="notify1">{L_DEFAULT_NOTIFY}:</label></dt> + <dt><label for="notify1">{L_DEFAULT_NOTIFY}{L_COLON}</label></dt> <dd> <label for="notify1"><input type="radio" name="notify" id="notify1" value="1"<!-- IF S_NOTIFY --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label for="notify0"><input type="radio" name="notify" id="notify0" value="0"<!-- IF not S_NOTIFY --> checked="checked"<!-- ENDIF --> /> {L_NO}</label> diff --git a/phpBB/styles/prosilver/template/ucp_prefs_view.html b/phpBB/styles/prosilver/template/ucp_prefs_view.html index 2e47c2e054..51561349c3 100644 --- a/phpBB/styles/prosilver/template/ucp_prefs_view.html +++ b/phpBB/styles/prosilver/template/ucp_prefs_view.html @@ -10,35 +10,35 @@ <fieldset> <!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF --> <dl> - <dt><label for="images1">{L_VIEW_IMAGES}:</label></dt> + <dt><label for="images1">{L_VIEW_IMAGES}{L_COLON}</label></dt> <dd> <label for="images1"><input type="radio" name="images" id="images1" value="1"<!-- IF S_IMAGES --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label for="images0"><input type="radio" name="images" id="images0" value="0"<!-- IF not S_IMAGES --> checked="checked"<!-- ENDIF --> /> {L_NO}</label> </dd> </dl> <dl> - <dt><label for="flash0">{L_VIEW_FLASH}:</label></dt> + <dt><label for="flash0">{L_VIEW_FLASH}{L_COLON}</label></dt> <dd> <label for="flash1"><input type="radio" name="flash" id="flash1" value="1"<!-- IF S_FLASH --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label for="flash0"><input type="radio" name="flash" id="flash0" value="0"<!-- IF not S_FLASH --> checked="checked"<!-- ENDIF --> /> {L_NO}</label> </dd> </dl> <dl> - <dt><label for="smilies1">{L_VIEW_SMILIES}:</label></dt> + <dt><label for="smilies1">{L_VIEW_SMILIES}{L_COLON}</label></dt> <dd> <label for="smilies1"><input type="radio" name="smilies" id="smilies1" value="1"<!-- IF S_SMILIES --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label for="smilies0"><input type="radio" name="smilies" id="smilies0" value="0"<!-- IF not S_SMILIES --> checked="checked"<!-- ENDIF --> /> {L_NO}</label> </dd> </dl> <dl> - <dt><label for="sigs1">{L_VIEW_SIGS}:</label></dt> + <dt><label for="sigs1">{L_VIEW_SIGS}{L_COLON}</label></dt> <dd> <label for="sigs1"><input type="radio" name="sigs" id="sigs1" value="1"<!-- IF S_SIGS --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label for="sigs0"><input type="radio" name="sigs" id="sigs0" value="0"<!-- IF not S_SIGS --> checked="checked"<!-- ENDIF --> /> {L_NO}</label> </dd> </dl> <dl> - <dt><label for="avatars1">{L_VIEW_AVATARS}:</label></dt> + <dt><label for="avatars1">{L_VIEW_AVATARS}{L_COLON}</label></dt> <dd> <label for="avatars1"><input type="radio" name="avatars" id="avatars1" value="1"<!-- IF S_AVATARS --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label for="avatars0"><input type="radio" name="avatars" id="avatars0" value="0"<!-- IF not S_AVATARS --> checked="checked"<!-- ENDIF --> /> {L_NO}</label> @@ -46,7 +46,7 @@ </dl> <!-- IF S_CHANGE_CENSORS --> <dl> - <dt><label for="wordcensor1">{L_DISABLE_CENSORS}:</label></dt> + <dt><label for="wordcensor1">{L_DISABLE_CENSORS}{L_COLON}</label></dt> <dd> <label for="wordcensor1"><input type="radio" name="wordcensor" id="wordcensor1" value="1"<!-- IF S_DISABLE_CENSORS --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label for="wordcensor0"><input type="radio" name="wordcensor" id="wordcensor0" value="0"<!-- IF not S_DISABLE_CENSORS --> checked="checked"<!-- ENDIF --> /> {L_NO}</label> @@ -55,28 +55,28 @@ <!-- ENDIF --> <hr /> <dl> - <dt><label>{L_VIEW_TOPICS_DAYS}:</label></dt> + <dt><label>{L_VIEW_TOPICS_DAYS}{L_COLON}</label></dt> <dd>{S_TOPIC_SORT_DAYS}</dd> </dl> <dl> - <dt><label>{L_VIEW_TOPICS_KEY}:</label></dt> + <dt><label>{L_VIEW_TOPICS_KEY}{L_COLON}</label></dt> <dd>{S_TOPIC_SORT_KEY}</dd> </dl> <dl> - <dt><label>{L_VIEW_TOPICS_DIR}:</label></dt> + <dt><label>{L_VIEW_TOPICS_DIR}{L_COLON}</label></dt> <dd>{S_TOPIC_SORT_DIR}</dd> </dl> <hr /> <dl> - <dt><label>{L_VIEW_POSTS_DAYS}:</label></dt> + <dt><label>{L_VIEW_POSTS_DAYS}{L_COLON}</label></dt> <dd>{S_POST_SORT_DAYS}</dd> </dl> <dl> - <dt><label>{L_VIEW_POSTS_KEY}:</label></dt> + <dt><label>{L_VIEW_POSTS_KEY}{L_COLON}</label></dt> <dd>{S_POST_SORT_KEY}</dd> </dl> <dl> - <dt><label>{L_VIEW_POSTS_DIR}:</label></dt> + <dt><label>{L_VIEW_POSTS_DIR}{L_COLON}</label></dt> <dd>{S_POST_SORT_DIR}</dd> </dl> </fieldset> diff --git a/phpBB/styles/prosilver/template/ucp_profile_profile_info.html b/phpBB/styles/prosilver/template/ucp_profile_profile_info.html index b6f6a8988d..03d89e8590 100644 --- a/phpBB/styles/prosilver/template/ucp_profile_profile_info.html +++ b/phpBB/styles/prosilver/template/ucp_profile_profile_info.html @@ -11,54 +11,54 @@ <fieldset> <!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF --> <dl> - <dt><label for="icq">{L_UCP_ICQ}:</label></dt> + <dt><label for="icq">{L_UCP_ICQ}{L_COLON}</label></dt> <dd><input type="text" name="icq" id="icq" maxlength="15" value="{ICQ}" class="inputbox" /></dd> </dl> <dl> - <dt><label for="aim">{L_UCP_AIM}:</label></dt> + <dt><label for="aim">{L_UCP_AIM}{L_COLON}</label></dt> <dd><input type="text" name="aim" id="aim" maxlength="255" value="{AIM}" class="inputbox" /></dd> </dl> <dl> - <dt><label for="msn">{L_UCP_MSNM}:</label></dt> + <dt><label for="msn">{L_UCP_MSNM}{L_COLON}</label></dt> <dd><input type="text" name="msn" id="msn" maxlength="255" value="{MSN}" class="inputbox" /></dd> </dl> <dl> - <dt><label for="yim">{L_UCP_YIM}:</label></dt> + <dt><label for="yim">{L_UCP_YIM}{L_COLON}</label></dt> <dd><input type="text" name="yim" id="yim" maxlength="255" value="{YIM}" class="inputbox" /></dd> </dl> <dl> - <dt><label for="jabber">{L_UCP_JABBER}:</label></dt> + <dt><label for="jabber">{L_UCP_JABBER}{L_COLON}</label></dt> <dd><input type="text" name="jabber" id="jabber" maxlength="255" value="{JABBER}" class="inputbox" /></dd> </dl> <dl> - <dt><label for="website">{L_WEBSITE}:</label></dt> + <dt><label for="website">{L_WEBSITE}{L_COLON}</label></dt> <dd><input type="text" name="website" id="website" maxlength="255" value="{WEBSITE}" class="inputbox" /></dd> </dl> <dl> - <dt><label for="location">{L_LOCATION}:</label></dt> + <dt><label for="location">{L_LOCATION}{L_COLON}</label></dt> <dd><input type="text" name="location" id="location" maxlength="255" value="{LOCATION}" class="inputbox" /></dd> </dl> <dl> - <dt><label for="occupation">{L_OCCUPATION}:</label></dt> + <dt><label for="occupation">{L_OCCUPATION}{L_COLON}</label></dt> <dd><textarea name="occupation" id="occupation" class="inputbox" rows="3" cols="30">{OCCUPATION}</textarea></dd> </dl> <dl> - <dt><label for="interests">{L_INTERESTS}:</label></dt> + <dt><label for="interests">{L_INTERESTS}{L_COLON}</label></dt> <dd><textarea name="interests" id="interests" class="inputbox" rows="3" cols="30">{INTERESTS}</textarea></dd> </dl> <!-- IF S_BIRTHDAYS_ENABLED --> <dl> - <dt><label for="bday_day">{L_BIRTHDAY}:</label><br /><span>{L_BIRTHDAY_EXPLAIN}</span></dt> + <dt><label for="bday_day">{L_BIRTHDAY}{L_COLON}</label><br /><span>{L_BIRTHDAY_EXPLAIN}</span></dt> <dd> - <label for="bday_day">{L_DAY}: <select name="bday_day" id="bday_day" style="width: 4em;">{S_BIRTHDAY_DAY_OPTIONS}</select></label> - <label for="bday_month">{L_MONTH}: <select name="bday_month" id="bday_month" style="width: 4em;">{S_BIRTHDAY_MONTH_OPTIONS}</select></label> - <label for="bday_year">{L_YEAR}: <select name="bday_year" id="bday_year" style="width: 6em;">{S_BIRTHDAY_YEAR_OPTIONS}</select></label> + <label for="bday_day">{L_DAY}{L_COLON} <select name="bday_day" id="bday_day" style="width: 4em;">{S_BIRTHDAY_DAY_OPTIONS}</select></label> + <label for="bday_month">{L_MONTH}{L_COLON} <select name="bday_month" id="bday_month" style="width: 4em;">{S_BIRTHDAY_MONTH_OPTIONS}</select></label> + <label for="bday_year">{L_YEAR}{L_COLON} <select name="bday_year" id="bday_year" style="width: 6em;">{S_BIRTHDAY_YEAR_OPTIONS}</select></label> </dd> </dl> <!-- ENDIF --> <!-- BEGIN profile_fields --> <dl> - <dt><label<!-- IF profile_fields.FIELD_ID --> for="{profile_fields.FIELD_ID}"<!-- ENDIF -->>{profile_fields.LANG_NAME}:<!-- IF profile_fields.S_REQUIRED --> *<!-- ENDIF --></label> + <dt><label<!-- IF profile_fields.FIELD_ID --> for="{profile_fields.FIELD_ID}"<!-- ENDIF -->>{profile_fields.LANG_NAME}{L_COLON}<!-- IF profile_fields.S_REQUIRED --> *<!-- ENDIF --></label> <!-- IF profile_fields.LANG_EXPLAIN --><br /><span>{profile_fields.LANG_EXPLAIN}</span><!-- ENDIF --></dt> <!-- IF profile_fields.ERROR --><dd class="error">{profile_fields.ERROR}</dd><!-- ENDIF --> <dd>{profile_fields.FIELD}</dd> diff --git a/phpBB/styles/prosilver/template/ucp_profile_reg_details.html b/phpBB/styles/prosilver/template/ucp_profile_reg_details.html index 5c0639fce7..c014e54250 100644 --- a/phpBB/styles/prosilver/template/ucp_profile_reg_details.html +++ b/phpBB/styles/prosilver/template/ucp_profile_reg_details.html @@ -13,20 +13,20 @@ <fieldset> <!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF --> <dl> - <dt><label <!-- IF S_CHANGE_USERNAME -->for="username"<!-- ENDIF -->>{L_USERNAME}:</label><br /><span>{L_USERNAME_EXPLAIN}</span></dt> + <dt><label <!-- IF S_CHANGE_USERNAME -->for="username"<!-- ENDIF -->>{L_USERNAME}{L_COLON}</label><br /><span>{L_USERNAME_EXPLAIN}</span></dt> <dd><!-- IF S_CHANGE_USERNAME --><input type="text" name="username" id="username" value="{USERNAME}" class="inputbox" title="{L_USERNAME}" /><!-- ELSE --><strong>{USERNAME}</strong><!-- ENDIF --></dd> </dl> <dl> - <dt><label for="email">{L_EMAIL_ADDRESS}:</label></dt> + <dt><label for="email">{L_EMAIL_ADDRESS}{L_COLON}</label></dt> <dd><!-- IF S_CHANGE_EMAIL --><input type="text" name="email" id="email" maxlength="100" value="{EMAIL}" class="inputbox" title="{L_EMAIL_ADDRESS}" /><!-- ELSE --><strong>{EMAIL}</strong><!-- ENDIF --></dd> </dl> <!-- IF S_CHANGE_PASSWORD --> <dl> - <dt><label for="new_password">{L_NEW_PASSWORD}:</label><br /><span>{L_CHANGE_PASSWORD_EXPLAIN}</span></dt> + <dt><label for="new_password">{L_NEW_PASSWORD}{L_COLON}</label><br /><span>{L_CHANGE_PASSWORD_EXPLAIN}</span></dt> <dd><input type="password" name="new_password" id="new_password" maxlength="255" value="{NEW_PASSWORD}" class="inputbox" title="{L_CHANGE_PASSWORD}" /></dd> </dl> <dl> - <dt><label for="password_confirm">{L_CONFIRM_PASSWORD}:</label><br /><span>{L_CONFIRM_PASSWORD_EXPLAIN}</span></dt> + <dt><label for="password_confirm">{L_CONFIRM_PASSWORD}{L_COLON}</label><br /><span>{L_CONFIRM_PASSWORD_EXPLAIN}</span></dt> <dd><input type="password" name="password_confirm" id="password_confirm" maxlength="255" value="{PASSWORD_CONFIRM}" class="inputbox" title="{L_CONFIRM_PASSWORD}" /></dd> </dl> <!-- ENDIF --> @@ -39,7 +39,7 @@ <fieldset> <dl> - <dt><label for="cur_password">{L_CURRENT_PASSWORD}:</label><br /><span><!-- IF S_CHANGE_PASSWORD -->{L_CURRENT_CHANGE_PASSWORD_EXPLAIN}<!-- ELSE -->{L_CURRENT_PASSWORD_EXPLAIN}<!-- ENDIF --></span></dt> + <dt><label for="cur_password">{L_CURRENT_PASSWORD}{L_COLON}</label><br /><span><!-- IF S_CHANGE_PASSWORD -->{L_CURRENT_CHANGE_PASSWORD_EXPLAIN}<!-- ELSE -->{L_CURRENT_PASSWORD_EXPLAIN}<!-- ENDIF --></span></dt> <dd><input type="password" name="cur_password" id="cur_password" maxlength="255" value="{CUR_PASSWORD}" class="inputbox" title="{L_CURRENT_PASSWORD}" /></dd> </dl> </fieldset> diff --git a/phpBB/styles/prosilver/template/ucp_register.html b/phpBB/styles/prosilver/template/ucp_register.html index 47253af37c..47537e9d8b 100644 --- a/phpBB/styles/prosilver/template/ucp_register.html +++ b/phpBB/styles/prosilver/template/ucp_register.html @@ -12,7 +12,7 @@ } <!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_REFRESH --> - onload_functions.push('apply_onkeypress_event()'); + onload_functions.push(apply_onkeypress_event); <!-- ENDIF --> // ]]> @@ -31,39 +31,37 @@ <dl><dd><strong>{L_REG_COND}</strong></dd></dl> <!-- ENDIF --> <dl> - <dt><label for="username">{L_USERNAME}:</label><br /><span>{L_USERNAME_EXPLAIN}</span></dt> + <dt><label for="username">{L_USERNAME}{L_COLON}</label><br /><span>{L_USERNAME_EXPLAIN}</span></dt> <dd><input type="text" tabindex="1" name="username" id="username" size="25" value="{USERNAME}" class="inputbox autowidth" title="{L_USERNAME}" /></dd> </dl> <dl> - <dt><label for="email">{L_EMAIL_ADDRESS}:</label></dt> + <dt><label for="email">{L_EMAIL_ADDRESS}{L_COLON}</label></dt> <dd><input type="text" tabindex="2" name="email" id="email" size="25" maxlength="100" value="{EMAIL}" class="inputbox autowidth" title="{L_EMAIL_ADDRESS}" /></dd> </dl> <dl> - <dt><label for="new_password">{L_PASSWORD}:</label><br /><span>{L_PASSWORD_EXPLAIN}</span></dt> + <dt><label for="new_password">{L_PASSWORD}{L_COLON}</label><br /><span>{L_PASSWORD_EXPLAIN}</span></dt> <dd><input type="password" tabindex="4" name="new_password" id="new_password" size="25" value="{PASSWORD}" class="inputbox autowidth" title="{L_NEW_PASSWORD}" /></dd> </dl> <dl> - <dt><label for="password_confirm">{L_CONFIRM_PASSWORD}:</label></dt> + <dt><label for="password_confirm">{L_CONFIRM_PASSWORD}{L_COLON}</label></dt> <dd><input type="password" tabindex="5" name="password_confirm" id="password_confirm" size="25" value="{PASSWORD_CONFIRM}" class="inputbox autowidth" title="{L_CONFIRM_PASSWORD}" /></dd> </dl> <hr /> <dl> - <dt><label for="lang">{L_LANGUAGE}:</label></dt> + <dt><label for="lang">{L_LANGUAGE}{L_COLON}</label></dt> <dd><select name="lang" id="lang" onchange="change_language(this.value); return false;" tabindex="6" title="{L_LANGUAGE}">{S_LANG_OPTIONS}</select></dd> </dl> - <dl> - <dt><label for="tz">{L_TIMEZONE}:</label></dt> - <dd><select name="tz" id="tz" tabindex="7" class="autowidth">{S_TZ_OPTIONS}</select></dd> - </dl> + + <!-- INCLUDE timezone_option.html --> <!-- IF .profile_fields --> <dl><dd><strong>{L_ITEMS_REQUIRED}</strong></dd></dl> <!-- BEGIN profile_fields --> <dl> - <dt><label<!-- IF profile_fields.FIELD_ID --> for="{profile_fields.FIELD_ID}"<!-- ENDIF -->>{profile_fields.LANG_NAME}:<!-- IF profile_fields.S_REQUIRED --> *<!-- ENDIF --></label> + <dt><label<!-- IF profile_fields.FIELD_ID --> for="{profile_fields.FIELD_ID}"<!-- ENDIF -->>{profile_fields.LANG_NAME}{L_COLON}<!-- IF profile_fields.S_REQUIRED --> *<!-- ENDIF --></label> <!-- IF profile_fields.LANG_EXPLAIN --><br /><span>{profile_fields.LANG_EXPLAIN}</span><!-- ENDIF --> <!-- IF profile_fields.ERROR --><br /><span class="error">{profile_fields.ERROR}</span><!-- ENDIF --></dt> <dd>{profile_fields.FIELD}</dd> @@ -106,4 +104,7 @@ </div> </form> +<script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/timezone.js"></script> +<script type="text/javascript">phpbb_preselect_tz_select();</script> + <!-- INCLUDE overall_footer.html --> diff --git a/phpBB/styles/prosilver/template/ucp_remind.html b/phpBB/styles/prosilver/template/ucp_remind.html index d480258209..b957bd4fe4 100644 --- a/phpBB/styles/prosilver/template/ucp_remind.html +++ b/phpBB/styles/prosilver/template/ucp_remind.html @@ -10,11 +10,11 @@ <fieldset> <dl> - <dt><label for="username">{L_USERNAME}:</label></dt> + <dt><label for="username">{L_USERNAME}{L_COLON}</label></dt> <dd><input class="inputbox narrow" type="text" name="username" id="username" size="25" /></dd> </dl> <dl> - <dt><label for="email">{L_EMAIL_ADDRESS}:</label><br /><span>{L_EMAIL_REMIND}</span></dt> + <dt><label for="email">{L_EMAIL_ADDRESS}{L_COLON}</label><br /><span>{L_EMAIL_REMIND}</span></dt> <dd><input class="inputbox narrow" type="text" name="email" id="email" size="25" maxlength="100" /></dd> </dl> <dl> diff --git a/phpBB/styles/prosilver/template/ucp_resend.html b/phpBB/styles/prosilver/template/ucp_resend.html index 36e112863c..6b1b2d84e2 100644 --- a/phpBB/styles/prosilver/template/ucp_resend.html +++ b/phpBB/styles/prosilver/template/ucp_resend.html @@ -11,11 +11,11 @@ <fieldset> <dl> - <dt><label for="username">{L_USERNAME}:</label></dt> + <dt><label for="username">{L_USERNAME}{L_COLON}</label></dt> <dd><input class="inputbox narrow" type="text" name="username" id="username" size="25" /></dd> </dl> <dl> - <dt><label for="email">{L_EMAIL_ADDRESS}:</label><br /><span>{L_EMAIL_REMIND}</span></dt> + <dt><label for="email">{L_EMAIL_ADDRESS}{L_COLON}</label><br /><span>{L_EMAIL_REMIND}</span></dt> <dd><input class="inputbox narrow" type="text" name="email" id="email" size="25" maxlength="100" /></dd> </dl> <dl> diff --git a/phpBB/styles/prosilver/template/ucp_zebra_foes.html b/phpBB/styles/prosilver/template/ucp_zebra_foes.html index 7aceac74c3..712479dc18 100644 --- a/phpBB/styles/prosilver/template/ucp_zebra_foes.html +++ b/phpBB/styles/prosilver/template/ucp_zebra_foes.html @@ -12,7 +12,7 @@ <fieldset class="fields2"> <!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF --> <dl> - <dt><label <!-- IF S_USERNAME_OPTIONS -->for="usernames"<!-- ENDIF -->>{L_YOUR_FOES}:</label><br /><span>{L_YOUR_FOES_EXPLAIN}</span></dt> + <dt><label <!-- IF S_USERNAME_OPTIONS -->for="usernames"<!-- ENDIF -->>{L_YOUR_FOES}{L_COLON}</label><br /><span>{L_YOUR_FOES_EXPLAIN}</span></dt> <dd> <!-- IF S_USERNAME_OPTIONS --> <select name="usernames[]" id="usernames" multiple="multiple" size="5">{S_USERNAME_OPTIONS}</select> @@ -22,7 +22,7 @@ </dd> </dl> <dl> - <dt><label for="add">{L_ADD_FOES}:</label><br /><span>{L_ADD_FOES_EXPLAIN}</span></dt> + <dt><label for="add">{L_ADD_FOES}{L_COLON}</label><br /><span>{L_ADD_FOES_EXPLAIN}</span></dt> <dd><textarea name="add" id="add" rows="3" cols="30" class="inputbox">{USERNAMES}</textarea></dd> <dd><strong><a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a></strong></dd> </dl> diff --git a/phpBB/styles/prosilver/template/ucp_zebra_friends.html b/phpBB/styles/prosilver/template/ucp_zebra_friends.html index 8908e4ba69..583b911284 100644 --- a/phpBB/styles/prosilver/template/ucp_zebra_friends.html +++ b/phpBB/styles/prosilver/template/ucp_zebra_friends.html @@ -12,7 +12,7 @@ <fieldset class="fields2"> <!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF --> <dl> - <dt><label <!-- IF S_USERNAME_OPTIONS -->for="usernames"<!-- ENDIF -->>{L_YOUR_FRIENDS}:</label><br /><span>{L_YOUR_FRIENDS_EXPLAIN}</span></dt> + <dt><label <!-- IF S_USERNAME_OPTIONS -->for="usernames"<!-- ENDIF -->>{L_YOUR_FRIENDS}{L_COLON}</label><br /><span>{L_YOUR_FRIENDS_EXPLAIN}</span></dt> <dd> <!-- IF S_USERNAME_OPTIONS --> <select name="usernames[]" id="usernames" multiple="multiple" size="5">{S_USERNAME_OPTIONS}</select> @@ -22,7 +22,7 @@ </dd> </dl> <dl> - <dt><label for="add">{L_ADD_FRIENDS}:</label><br /><span>{L_ADD_FRIENDS_EXPLAIN}</span></dt> + <dt><label for="add">{L_ADD_FRIENDS}{L_COLON}</label><br /><span>{L_ADD_FRIENDS_EXPLAIN}</span></dt> <dd><textarea name="add" id="add" rows="3" cols="30" class="inputbox">{USERNAMES}</textarea></dd> <dd><strong><a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a></strong></dd> </dl> diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html index f5ff1d3f98..a3239602ae 100644 --- a/phpBB/styles/prosilver/template/viewforum_body.html +++ b/phpBB/styles/prosilver/template/viewforum_body.html @@ -6,7 +6,7 @@ <div> <!-- NOTE: remove the style="display: none" when you want to have the forum description on the forum body --> <!-- IF FORUM_DESC --><div style="display: none !important;">{FORUM_DESC}<br /></div><!-- ENDIF --> - <!-- IF MODERATORS --><p><strong><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->:</strong> {MODERATORS}</p><!-- ENDIF --> + <!-- IF MODERATORS --><p><strong><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->{L_COLON}</strong> {MODERATORS}</p><!-- ENDIF --> </div> <!-- ENDIF --> @@ -34,7 +34,7 @@ <!-- INCLUDE forumlist_body.html --> <!-- ENDIF --> -<!-- IF S_DISPLAY_POST_INFO or PAGINATION or TOTAL_POSTS or TOTAL_TOPICS --> +<!-- IF S_DISPLAY_POST_INFO or .pagination or TOTAL_POSTS or TOTAL_TOPICS --> <div class="topic-actions" <!-- IF S_HAS_SUBFORUM -->style="margin-top: 2em;"<!-- ENDIF -->> <!-- IF not S_IS_BOT and S_DISPLAY_POST_INFO --> @@ -55,11 +55,14 @@ </div> <!-- ENDIF --> - <!-- IF PAGINATION or TOTAL_POSTS or TOTAL_TOPICS --> + <!-- IF .pagination or TOTAL_POSTS or TOTAL_TOPICS --> <div class="pagination"> - <!-- IF not S_IS_BOT and U_MARK_TOPICS --><a href="{U_MARK_TOPICS}" accesskey="m" data-ajax="true">{L_MARK_TOPICS_READ}</a> • <!-- ENDIF --><!-- IF TOTAL_TOPICS -->{TOTAL_TOPICS}<!-- ENDIF --> - <!-- IF PAGE_NUMBER --> - <!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --> + <!-- IF not S_IS_BOT and U_MARK_TOPICS --><a href="{U_MARK_TOPICS}" accesskey="m" data-ajax="true">{L_MARK_TOPICS_READ}</a> • <!-- ENDIF --> + <!-- IF TOTAL_TOPICS -->{TOTAL_TOPICS} • <!-- ENDIF --> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} <!-- ENDIF --> </div> <!-- ENDIF --> @@ -87,11 +90,11 @@ <fieldset class="fields1"> <dl> - <dt><label for="username">{L_USERNAME}:</label></dt> + <dt><label for="username">{L_USERNAME}{L_COLON}</label></dt> <dd><input type="text" tabindex="1" name="username" id="username" size="25" value="{USERNAME}" class="inputbox autowidth" /></dd> </dl> <dl> - <dt><label for="password">{L_PASSWORD}:</label></dt> + <dt><label for="password">{L_PASSWORD}{L_COLON}</label></dt> <dd><input type="password" tabindex="2" id="password" name="password" size="25" class="inputbox autowidth" /></dd> <!-- IF S_AUTOLOGIN_ENABLED --><dd><label for="autologin"><input type="checkbox" name="autologin" id="autologin" tabindex="3" /> {L_LOG_ME_IN}</label></dd><!-- ENDIF --> <dd><label for="viewonline"><input type="checkbox" name="viewonline" id="viewonline" tabindex="4" /> {L_HIDE_ME}</label></dd> @@ -142,7 +145,20 @@ <dt<!-- IF topicrow.TOPIC_ICON_IMG and S_TOPIC_ICONS --> style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF --> title="{topicrow.TOPIC_FOLDER_IMG_ALT}"><!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a> <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF --> <!-- IF topicrow.S_TOPIC_REPORTED --><a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --><br /> - <!-- IF topicrow.PAGINATION --><strong class="pagination"><span>{topicrow.PAGINATION}</span></strong><!-- ENDIF --> + <!-- IF .topicrow.pagination --> + <div class="pagination"> + <ul> + <!-- BEGIN pagination --> + <!-- IF topicrow.pagination.S_IS_PREV --> + <!-- ELSEIF topicrow.pagination.S_IS_CURRENT --><li class="active"><span>{topicrow.pagination.PAGE_NUMBER}</span></li> + <!-- ELSEIF topicrow.pagination.S_IS_ELLIPSIS --><li class="ellipsis"><span>{L_ELLIPSIS}</span></li> + <!-- ELSEIF topicrow.pagination.S_IS_NEXT --> + <!-- ELSE --><li><a href="{topicrow.pagination.PAGE_URL}">{topicrow.pagination.PAGE_NUMBER}</a></li> + <!-- ENDIF --> + <!-- END pagination --> + </ul> + </div> + <!-- ENDIF --> <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->{L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} » {topicrow.FIRST_POST_TIME} <!-- IF topicrow.S_POST_GLOBAL and FORUM_ID != topicrow.FORUM_ID --> » {L_IN} <a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a><!-- ENDIF --> </dt> @@ -173,10 +189,10 @@ <!-- IF S_SELECT_SORT_DAYS and not S_DISPLAY_ACTIVE --> <form method="post" action="{S_FORUM_ACTION}"> <fieldset class="display-options"> - <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> - <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> + <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> + <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> <!-- IF not S_IS_BOT --> - <label>{L_DISPLAY_TOPICS}: {S_SELECT_SORT_DAYS}</label> + <label>{L_DISPLAY_TOPICS}{L_COLON} {S_SELECT_SORT_DAYS}</label> <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label> <label>{S_SELECT_SORT_DIR} <input type="submit" name="sort" value="{L_GO}" class="button2" /></label> <!-- ENDIF --> @@ -193,13 +209,16 @@ </div> <!-- ENDIF --> - <!-- IF PAGINATION or TOTAL_POSTS or TOTAL_TOPICS --> + <!-- IF PAGE_NUMBER or TOTAL_POSTS or TOTAL_TOPICS --> <div class="pagination"> <!-- IF TOTAL_TOPICS and not S_IS_BOT and U_MARK_TOPICS --><a href="{U_MARK_TOPICS}">{L_MARK_TOPICS_READ}</a> • <!-- ENDIF --> - <!-- IF TOTAL_POSTS and not NEWEST_USER --> {TOTAL_POSTS}<!-- ELSEIF TOTAL_TOPICS and not NEWEST_USER --> {TOTAL_TOPICS}<!-- ENDIF --> - <!-- IF TOTAL_USERS -->{TOTAL_USERS}<!-- ENDIF --> - <!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> - • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --> + <!-- IF TOTAL_POSTS and not NEWEST_USER --> {TOTAL_POSTS}<!-- ELSEIF TOTAL_TOPICS and not NEWEST_USER --> {TOTAL_TOPICS} • <!-- ENDIF --> + <!-- IF TOTAL_USERS -->{TOTAL_USERS} • <!-- ENDIF --> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </div> <!-- ENDIF --> </div> diff --git a/phpBB/styles/prosilver/template/viewonline_body.html b/phpBB/styles/prosilver/template/viewonline_body.html index 9da8202783..cb19a40d8f 100644 --- a/phpBB/styles/prosilver/template/viewonline_body.html +++ b/phpBB/styles/prosilver/template/viewonline_body.html @@ -4,7 +4,13 @@ <p>{TOTAL_GUEST_USERS_ONLINE}<!-- IF S_SWITCH_GUEST_DISPLAY --> • <a href="{U_SWITCH_GUEST_DISPLAY}">{L_SWITCH_GUEST_DISPLAY}</a><!-- ENDIF --></p> <ul class="linklist"> - <li class="rightside pagination"><!-- IF PAGINATION --><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE -->{PAGE_NUMBER}<!-- ENDIF --></li> + <li class="rightside pagination"> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> + </li> </ul> <div class="forumbg forumbg-table"> @@ -23,7 +29,7 @@ <tbody> <!-- BEGIN user_row --> <tr class="<!-- IF user_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF -->"> - <td>{user_row.USERNAME_FULL}<!-- IF user_row.USER_IP --> <span style="margin-left: 30px;">{L_IP}: <a href="{user_row.U_USER_IP}">{user_row.USER_IP}</a> » <a href="{user_row.U_WHOIS}" onclick="popup(this.href, 750, 500); return false;">{L_WHOIS}</a></span><!-- ENDIF --> + <td>{user_row.USERNAME_FULL}<!-- IF user_row.USER_IP --> <span style="margin-left: 30px;">{L_IP}{L_COLON} <a href="{user_row.U_USER_IP}">{user_row.USER_IP}</a> » <a href="{user_row.U_WHOIS}" onclick="popup(this.href, 750, 500); return false;">{L_WHOIS}</a></span><!-- ENDIF --> <!-- IF user_row.USER_BROWSER --><br />{user_row.USER_BROWSER}<!-- ENDIF --></td> <td class="info"><a href="{user_row.U_FORUM_LOCATION}">{user_row.FORUM_LOCATION}</a></td> <td class="active">{user_row.LASTUPDATE}</td> @@ -43,14 +49,20 @@ <!-- IF PREVIOUS_PAGE or NEXT_PAGE --> <fieldset class="display-options right-box"> - <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ELSE -->{L_PREVIOUS}<!-- ENDIF --> • <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ELSE -->{L_NEXT}<!-- ENDIF --> + <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ELSE -->{L_PREVIOUS}<!-- ENDIF --> • <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ELSE -->{L_NEXT}<!-- ENDIF --> </fieldset> <!-- ENDIF --> -<!-- IF LEGEND --><p><em>{L_LEGEND}: {LEGEND}</em></p><!-- ENDIF --> +<!-- IF LEGEND --><p><em>{L_LEGEND}{L_COLON} {LEGEND}</em></p><!-- ENDIF --> <ul class="linklist"> - <li class="rightside pagination"><!-- IF PAGINATION --><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE -->{PAGE_NUMBER}<!-- ENDIF --></li> + <li class="rightside pagination"> + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> + </li> </ul> <!-- INCLUDE jumpbox.html --> diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index 1af512732d..1b7d78e063 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -6,7 +6,7 @@ <!-- IF MODERATORS --> <p> - <strong><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->:</strong> {MODERATORS} + <strong><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->{L_COLON}</strong> {MODERATORS} </p> <!-- ENDIF --> @@ -45,10 +45,14 @@ </div> <!-- ENDIF --> - <!-- IF PAGINATION or TOTAL_POSTS --> + <!-- IF .pagination or TOTAL_POSTS --> <div class="pagination"> - <!-- IF U_VIEW_UNREAD_POST and not S_IS_BOT --><a href="{U_VIEW_UNREAD_POST}">{L_VIEW_UNREAD_POST}</a> • <!-- ENDIF -->{TOTAL_POSTS} - <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> + <!-- IF U_VIEW_UNREAD_POST and not S_IS_BOT --><a href="{U_VIEW_UNREAD_POST}">{L_VIEW_UNREAD_POST}</a> • <!-- ENDIF -->{TOTAL_POSTS} • + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </div> <!-- ENDIF --> @@ -78,7 +82,7 @@ <!-- IF S_DISPLAY_RESULTS --> <dl> <dt> </dt> - <dd class="resultbar">{L_TOTAL_VOTES} : {TOTAL_VOTES}</dd> + <dd class="resultbar">{L_TOTAL_VOTES}{L_COLON} {TOTAL_VOTES}</dd> </dl> <!-- ENDIF --> @@ -153,7 +157,19 @@ <!-- IF postrow.S_HAS_ATTACHMENTS --> <dl class="attachbox"> - <dt>{L_ATTACHMENTS}</dt> + <dt> + {L_ATTACHMENTS} + <!-- IF postrow.S_MULTIPLE_ATTACHMENTS --> + <div class="dl_links"> + <strong>{L_DOWNLOAD_ALL}{L_COLON}</strong> + <ul> + <!-- BEGIN dl_method --> + <li>[ <a href="{postrow.dl_method.LINK}">{postrow.dl_method.TYPE}</a> ]</li> + <!-- END dl_method --> + </ul> + </div> + <!-- ENDIF --> + </dt> <!-- BEGIN attachment --> <dd>{postrow.attachment.DISPLAY_ATTACHMENT}</dd> <!-- END attachment --> @@ -163,7 +179,7 @@ <!-- IF postrow.S_DISPLAY_NOTICE --><div class="rules">{L_DOWNLOAD_NOTICE}</div><!-- ENDIF --> <!-- IF postrow.EDITED_MESSAGE or postrow.EDIT_REASON --> <div class="notice">{postrow.EDITED_MESSAGE} - <!-- IF postrow.EDIT_REASON --><br /><strong>{L_REASON}:</strong> <em>{postrow.EDIT_REASON}</em><!-- ENDIF --> + <!-- IF postrow.EDIT_REASON --><br /><strong>{L_REASON}{L_COLON}</strong> <em>{postrow.EDIT_REASON}</em><!-- ENDIF --> </div> <!-- ENDIF --> @@ -186,17 +202,17 @@ <dd> </dd> - <!-- IF postrow.POSTER_POSTS != '' --><dd><strong>{L_POSTS}:</strong> {postrow.POSTER_POSTS}</dd><!-- ENDIF --> - <!-- IF postrow.POSTER_JOINED --><dd><strong>{L_JOINED}:</strong> {postrow.POSTER_JOINED}</dd><!-- ENDIF --> - <!-- IF postrow.POSTER_FROM --><dd><strong>{L_LOCATION}:</strong> {postrow.POSTER_FROM}</dd><!-- ENDIF --> + <!-- IF postrow.POSTER_POSTS != '' --><dd><strong>{L_POSTS}{L_COLON}</strong> {postrow.POSTER_POSTS}</dd><!-- ENDIF --> + <!-- IF postrow.POSTER_JOINED --><dd><strong>{L_JOINED}{L_COLON}</strong> {postrow.POSTER_JOINED}</dd><!-- ENDIF --> + <!-- IF postrow.POSTER_FROM --><dd><strong>{L_LOCATION}{L_COLON}</strong> {postrow.POSTER_FROM}</dd><!-- ENDIF --> <!-- IF postrow.S_PROFILE_FIELD1 --> <!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. --> - <dd><strong>{postrow.PROFILE_FIELD1_NAME}:</strong> {postrow.PROFILE_FIELD1_VALUE}</dd> + <dd><strong>{postrow.PROFILE_FIELD1_NAME}{L_COLON}</strong> {postrow.PROFILE_FIELD1_VALUE}</dd> <!-- ENDIF --> <!-- BEGIN custom_fields --> - <dd><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}:</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd> + <dd><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}{L_COLON}</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd> <!-- END custom_fields --> <!-- IF not S_IS_BOT --> @@ -205,7 +221,7 @@ <ul class="profile-icons"> <!-- IF postrow.U_PM --><li class="pm-icon"><a href="{postrow.U_PM}" title="{L_PRIVATE_MESSAGE}"><span>{L_PRIVATE_MESSAGE}</span></a></li><!-- ENDIF --> <!-- IF postrow.U_EMAIL --><li class="email-icon"><a href="{postrow.U_EMAIL}" title="{L_SEND_EMAIL_USER} {postrow.POST_AUTHOR}"><span>{L_SEND_EMAIL_USER} {postrow.POST_AUTHOR}</span></a></li><!-- ENDIF --> - <!-- IF postrow.U_WWW --><li class="web-icon"><a href="{postrow.U_WWW}" title="{L_VISIT_WEBSITE}: {postrow.U_WWW}"><span>{L_WEBSITE}</span></a></li><!-- ENDIF --> + <!-- IF postrow.U_WWW --><li class="web-icon"><a href="{postrow.U_WWW}" title="{L_VISIT_WEBSITE}{L_COLON} {postrow.U_WWW}"><span>{L_WEBSITE}</span></a></li><!-- ENDIF --> <!-- IF postrow.U_MSN --><li class="msnm-icon"><a href="{postrow.U_MSN}" onclick="popup(this.href, 550, 320); return false;" title="{L_MSNM}"><span>{L_MSNM}</span></a></li><!-- ENDIF --> <!-- IF postrow.U_ICQ --><li class="icq-icon"><a href="{postrow.U_ICQ}" onclick="popup(this.href, 550, 320); return false;" title="{L_ICQ}"><span>{L_ICQ}</span></a></li><!-- ENDIF --> <!-- IF postrow.U_YIM --><li class="yahoo-icon"><a href="{postrow.U_YIM}" onclick="popup(this.href, 780, 550); return false;" title="{L_YIM}"><span>{L_YIM}</span></a></li><!-- ENDIF --> @@ -229,14 +245,14 @@ <!-- IF S_QUICK_REPLY --> <!-- INCLUDE quickreply_editor.html --> <!-- ENDIF --> -<!-- IF S_NUM_POSTS > 1 or PREVIOUS_PAGE --> +<!-- IF S_NUM_POSTS > 1 or PREVIOUS_PAGE or NEXT_PAGE --> <form id="viewtopic" method="post" action="{S_TOPIC_ACTION}"> <fieldset class="display-options" style="margin-top: 0; "> - <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> - <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> + <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> + <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> <!-- IF not S_IS_BOT --> - <label>{L_DISPLAY_POSTS}: {S_SELECT_SORT_DAYS}</label> + <label>{L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS}</label> <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label> <label>{S_SELECT_SORT_DIR} <input type="submit" name="sort" value="{L_GO}" class="button2" /></label> <!-- ENDIF --> </fieldset> @@ -252,10 +268,35 @@ <!-- ENDIF --> </div> - <!-- IF PAGINATION or TOTAL_POSTS --> + <!-- IF S_HAS_ATTACHMENTS --> + <div class="dl_links"> + <strong>{L_DOWNLOAD_ALL_ATTACHMENTS}{L_COLON}</strong> + <ul> + <!-- BEGIN dl_method --> + <li>[ <a href="{dl_method.LINK}">{dl_method.TYPE}</a> ]</li> + <!-- END dl_method --> + </ul> + </div> + <!-- ENDIF --> + + <!-- IF .pagination or TOTAL_POSTS --> <div class="pagination"> - {TOTAL_POSTS} - <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> + {TOTAL_POSTS} • + <!-- IF .pagination --> + <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • + <ul> + <!-- BEGIN pagination --> + <!-- IF pagination.S_IS_PREV --> + <!-- 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 --> + <!-- ELSE --><li><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a></li> + <!-- ENDIF --> + <!-- END pagination --> + </ul> + <!-- ELSE --> + {PAGE_NUMBER} + <!-- ENDIF --> </div> <!-- ENDIF --> </div> @@ -265,7 +306,7 @@ <!-- IF .quickmod --> <form method="post" action="{S_MOD_ACTION}" id="quickmodform"> <fieldset class="quickmod"> - <label for="quick-mod-select">{L_QUICK_MOD}:</label> + <label for="quick-mod-select">{L_QUICK_MOD}{L_COLON}</label> <select name="action" id="quick-mod-select"> <!-- BEGIN quickmod --> <option value="{quickmod.VALUE}">{quickmod.TITLE}</option> diff --git a/phpBB/styles/prosilver/template/viewtopic_print.html b/phpBB/styles/prosilver/template/viewtopic_print.html index b28608d6f1..54676279d2 100644 --- a/phpBB/styles/prosilver/template/viewtopic_print.html +++ b/phpBB/styles/prosilver/template/viewtopic_print.html @@ -28,7 +28,7 @@ <!-- BEGIN postrow --> <div class="post"> <h3>{postrow.POST_SUBJECT}</h3> - <div class="date">{postrow.MINI_POST_IMG}{L_POSTED}: <strong>{postrow.POST_DATE}</strong></div> + <div class="date">{postrow.MINI_POST_IMG}{L_POSTED}{L_COLON} <strong>{postrow.POST_DATE}</strong></div> <div class="author">{L_POST_BY_AUTHOR} <strong>{postrow.POST_AUTHOR}</strong></div> <div class="content">{postrow.MESSAGE}</div> </div> @@ -38,7 +38,7 @@ <div id="page-footer"> <div class="page-number">{S_TIMEZONE}<br />{PAGE_NUMBER}</div> - <div class="copyright">Powered by phpBB® Forum Software © phpBB Group<br />http://www.phpbb.com/</div> + <div class="copyright">Powered by phpBB® Forum Software © phpBB Group<br />https://www.phpbb.com/</div> </div> </div> diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css index fe6a7a7fda..a5a18dc6a1 100644 --- a/phpBB/styles/prosilver/theme/colours.css +++ b/phpBB/styles/prosilver/theme/colours.css @@ -145,25 +145,30 @@ dl.details dd { /* Pagination ---------------------------------------- */ -.pagination span strong { - color: #FFFFFF; - background-color: #4692BF; - border-color: #4692BF; -} - -.pagination span a, .pagination span a:link, .pagination span a:visited { +.pagination li a, .pagination li a:link, .pagination li a:visited { color: #5C758C; background-color: #ECEDEE; border-color: #B4BAC0; } -.pagination span a:hover { +.pagination li.ellipsis span { + background-color: transparent; + color: #000000; +} + +.pagination li.active span { + color: #FFFFFF; + background-color: #4692BF; + border-color: #4692BF; +} + +.pagination li a:hover, .pagination .active a:hover { border-color: #368AD2; background-color: #368AD2; - color: #FFF; + color: #FFFFFF; } -.pagination span a:active { +.pagination li a:active, .pagination li.active a:active { color: #5C758C; background-color: #ECEDEE; border-color: #B4BAC0; @@ -326,20 +331,20 @@ a.top2 { } /* Arrow links */ -a.up { background-image: url("./images/arrow_up.gif") } -a.down { background-image: url("./images/arrow_down.gif") } -a.left { background-image: url("./images/arrow_left.gif") } -a.right { background-image: url("./images/arrow_right.gif") } +a.arrow-up { background-image: url("./images/arrow_up.gif") } +a.arrow-down { background-image: url("./images/arrow_down.gif") } +a.arrow-left { background-image: url("./images/arrow_left.gif") } +a.arrow-right { background-image: url("./images/arrow_right.gif") } -a.up:hover { +a.arrow-up:hover { background-color: transparent; } -a.left:hover { +a.arrow-left:hover { color: #368AD2; } -a.right:hover { +a.arrow-right:hover { color: #368AD2; } diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index 3dda343829..50b22f44df 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -483,6 +483,7 @@ dl.details dd { overflow: hidden; } + /* Pagination ---------------------------------------- */ .pagination { @@ -493,51 +494,50 @@ dl.details dd { float: right; } -.pagination span.page-sep { - display: none; -} - li.pagination { margin-top: 0; } -.pagination strong, .pagination b { - font-weight: normal; +.pagination img { + vertical-align: middle; } -.pagination span strong { - padding: 0 2px; - margin: 0 2px; - font-weight: normal; - border: 1px solid transparent; - font-size: 0.9em; +.pagination ul { + display: inline-block; + *display: inline; /* IE7 inline-block hack */ + *zoom: 1; + margin-left: 0; + margin-bottom: 0; +} + +li.pagination ul { + margin-top: -2px; + vertical-align: middle; } -.pagination span a, .pagination span a:link, .pagination span a:visited, .pagination span a:active { +.pagination ul li, dl .pagination ul li, dl.icon .pagination ul li { + display: inline; + padding: 0; + font-size: 100%; + line-height: normal; +} + +.pagination li a, .pagnation li span, li .pagination li a, li .pagnation li span, .pagination li.active span, .pagination li.ellipsis span { font-weight: normal; text-decoration: none; - margin: 0 2px; padding: 0 2px; border: 1px solid transparent; font-size: 0.9em; line-height: 1.5em; } -.pagination span a:hover { - text-decoration: none; -} - -.pagination img { - vertical-align: middle; -} - /* Pagination in viewforum for multipage topics */ .row .pagination { display: block; float: right; width: auto; margin-top: 0; - padding: 1px 0 1px 15px; + padding: 1px 0 1px 8px; font-size: 0.9em; background: none 0 50% no-repeat; } @@ -623,9 +623,10 @@ li.pagination { } div.rules { - padding: 0 10px; margin: 10px 0; font-size: 1.1em; + padding: 5px 10px; + border-radius: 7px; } div.rules ul, div.rules ol { diff --git a/phpBB/styles/prosilver/theme/content.css b/phpBB/styles/prosilver/theme/content.css index 60903911dd..b6012f8a63 100644 --- a/phpBB/styles/prosilver/theme/content.css +++ b/phpBB/styles/prosilver/theme/content.css @@ -702,3 +702,26 @@ dl.pmlist dd { margin-left: 61% !important; margin-bottom: 2px; } + +.topic-actions div.dl_links { + padding: 10px 0 0 10px; +} + +div.dl_links { + display: inline-block; + text-transform: none; +} + +.dl_links strong { + font-weight: bold; +} + +.dl_links ul { + list-style-type: none; + margin: 0; + display: inline-block; +} + +.dl_links li { + display: inline-block; +} diff --git a/phpBB/styles/prosilver/theme/cp.css b/phpBB/styles/prosilver/theme/cp.css index bf7d304ca4..da3ec1736e 100644 --- a/phpBB/styles/prosilver/theme/cp.css +++ b/phpBB/styles/prosilver/theme/cp.css @@ -260,8 +260,9 @@ ul.cplist { /* Friends list */ .cp-mini { - padding: 0 5px; margin: 10px 15px 10px 5px; + padding: 5px 10px; + border-radius: 7px; } dl.mini dt { diff --git a/phpBB/styles/prosilver/theme/forms.css b/phpBB/styles/prosilver/theme/forms.css index 77b3be5cfa..8829211934 100644 --- a/phpBB/styles/prosilver/theme/forms.css +++ b/phpBB/styles/prosilver/theme/forms.css @@ -32,6 +32,11 @@ option { padding-right: 1em; } +select optgroup option { + padding-right: 1em; + font-family: Verdana, Helvetica, Arial, sans-serif; +} + textarea { font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; width: 60%; diff --git a/phpBB/styles/prosilver/theme/links.css b/phpBB/styles/prosilver/theme/links.css index 3cb6e928b5..5dc8a13313 100644 --- a/phpBB/styles/prosilver/theme/links.css +++ b/phpBB/styles/prosilver/theme/links.css @@ -66,6 +66,15 @@ a.topictitle:hover { text-decoration: underline; } +a.lastsubject { + font-weight: bold; + text-decoration: none; +} + +a.lastsubject:hover { + text-decoration: underline; +} + /* Post body links */ .postlink { text-decoration: none; @@ -136,44 +145,44 @@ a.top2 { } /* Arrow links */ -a.up { background: none no-repeat left center; } -a.down { background: none no-repeat right center; } -a.left { background: none no-repeat 3px 60%; } -a.right { background: none no-repeat 95% 60%; } +a.arrow-up { background: none no-repeat left center; } +a.arrow-down { background: none no-repeat right center; } +a.arrow-left { background: none no-repeat 3px 60%; } +a.arrow-right { background: none no-repeat 95% 60%; } -a.up, a.up:link, a.up:active, a.up:visited { +a.arrow-up, a.arrow-up:link, a.arrow-up:active, a.arrow-up:visited { padding-left: 10px; text-decoration: none; border-bottom-width: 0; } -a.up:hover { +a.arrow-up:hover { background-position: left top; } -a.down, a.down:link, a.down:active, a.down:visited { +a.arrow-down, a.arrow-down:link, a.arrow-down:active, a.arrow-down:visited { padding-right: 10px; } -a.down:hover { +a.arrow-down:hover { background-position: right bottom; text-decoration: none; } -a.left, a.left:active, a.left:visited { +a.arrow-left, a.arrow-left:active, a.arrow-left:visited { padding-left: 12px; } -a.left:hover { +a.arrow-left:hover { text-decoration: none; background-position: 0 60%; } -a.right, a.right:active, a.right:visited { +a.arrow-right, a.arrow-right:active, a.arrow-right:visited { padding-right: 12px; } -a.right:hover { +a.arrow-right:hover { text-decoration: none; background-position: 100% 60%; } diff --git a/phpBB/styles/prosilver/theme/stylesheet.css b/phpBB/styles/prosilver/theme/stylesheet.css index 419de4e6ec..48a00c6803 100644 --- a/phpBB/styles/prosilver/theme/stylesheet.css +++ b/phpBB/styles/prosilver/theme/stylesheet.css @@ -3,7 +3,7 @@ Style name: prosilver (the default phpBB 3.1.x style) Based on style: Original author: Tom Beddard ( http://www.subblue.com/ ) - Modified by: phpBB Group ( http://www.phpbb.com/ ) + Modified by: phpBB Group ( https://www.phpbb.com/ ) -------------------------------------------------------------- */ diff --git a/phpBB/styles/subsilver2/template/attachment.html b/phpBB/styles/subsilver2/template/attachment.html index fca620b481..eb5dd91634 100644 --- a/phpBB/styles/subsilver2/template/attachment.html +++ b/phpBB/styles/subsilver2/template/attachment.html @@ -6,7 +6,7 @@ <!-- ELSE --> <!-- IF _file.COMMENT --> - <span class="gensmall"><b>{L_FILE_COMMENT}:</b> {_file.COMMENT}</span><br /> + <span class="gensmall"><b>{L_FILE_COMMENT}{L_COLON}</b> {_file.COMMENT}</span><br /> <!-- ENDIF --> <!-- IF _file.S_THUMBNAIL --> diff --git a/phpBB/styles/subsilver2/template/bbcode.html b/phpBB/styles/subsilver2/template/bbcode.html index 50162740d0..efcf5e1acb 100644 --- a/phpBB/styles/subsilver2/template/bbcode.html +++ b/phpBB/styles/subsilver2/template/bbcode.html @@ -9,11 +9,11 @@ <!-- BEGIN listitem_close --></li><!-- END listitem_close --> <!-- BEGIN quote_username_open --> -<div class="quotetitle">{USERNAME} {L_WROTE}:</div><div class="quotecontent"> +<div class="quotetitle">{USERNAME} {L_WROTE}{L_COLON}</div><div class="quotecontent"> <!-- END quote_username_open --> <!-- BEGIN quote_open --> -<div class="quotetitle"><b>{L_QUOTE}:</b></div><div class="quotecontent"> +<div class="quotetitle"><b>{L_QUOTE}{L_COLON}</b></div><div class="quotecontent"> <!-- END quote_open --> <!-- BEGIN quote_close --> @@ -21,7 +21,7 @@ <!-- END quote_close --> <!-- BEGIN code_open --> -<div class="codetitle"><b>{L_CODE}:</b></div><div class="codecontent"> +<div class="codetitle"><b>{L_CODE}{L_COLON}</b></div><div class="codecontent"> <!-- END code_open --> <!-- BEGIN code_close --> @@ -29,7 +29,7 @@ <!-- END code_close --> <!-- BEGIN inline_attachment_open --> -<div class="attachtitle">{L_ATTACHMENT}:</div><div class="attachcontent"> +<div class="attachtitle">{L_ATTACHMENT}{L_COLON}</div><div class="attachcontent"> <!-- END inline_attachment_open --> <!-- BEGIN inline_attachment_close --> diff --git a/phpBB/styles/subsilver2/template/breadcrumbs.html b/phpBB/styles/subsilver2/template/breadcrumbs.html index f8476ec37a..49e31c0749 100644 --- a/phpBB/styles/subsilver2/template/breadcrumbs.html +++ b/phpBB/styles/subsilver2/template/breadcrumbs.html @@ -1,7 +1,8 @@ + <!-- IF $S_MICRODATA --><!-- DEFINE $MICRODATA = ' itemtype="http://data-vocabulary.org/Breadcrumb" itemscope=""' --><!-- ELSE --><!-- DEFINE $MICRODATA = '' --><!-- ENDIF --> <table class="tablebg" width="100%" cellspacing="1" cellpadding="0" style="margin-top: 5px;"> <tr> <td class="row1"> - <p class="breadcrumbs"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></p> + <p class="breadcrumbs"><!-- IF U_SITE_HOME --><a href="{U_SITE_HOME}"{$MICRODATA}>{L_SITE_HOME}</a> <strong>»</strong> <!-- ENDIF --><a href="{U_INDEX}"{$MICRODATA}>{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}"{$MICRODATA}>{navlinks.FORUM_NAME}</a><!-- END navlinks --></p> <p class="datetime">{S_TIMEZONE}</p> </td> </tr> diff --git a/phpBB/styles/subsilver2/template/captcha_default.html b/phpBB/styles/subsilver2/template/captcha_default.html index e2edf0b810..1be25403ce 100644 --- a/phpBB/styles/subsilver2/template/captcha_default.html +++ b/phpBB/styles/subsilver2/template/captcha_default.html @@ -11,7 +11,7 @@ <input type="hidden" name="confirm_id" id="confirm_id" value="{CONFIRM_ID}" /></td> </tr> <tr> - <td class="row1"><b class="genmed">{L_CONFIRM_CODE}:</b><br /><span class="gensmall">{L_CONFIRM_CODE_EXPLAIN}</span></td> + <td class="row1"><b class="genmed">{L_CONFIRM_CODE}{L_COLON}</b><br /><span class="gensmall">{L_CONFIRM_CODE_EXPLAIN}</span></td> <td class="row2"><input class="post" type="text" name="confirm_code" size="8" maxlength="8"<!-- IF $CAPTCHA_TAB_INDEX --> tabindex="{$CAPTCHA_TAB_INDEX}"<!-- ENDIF --> /> <!-- IF S_CONFIRM_REFRESH --><input type="submit" name="refresh_vc" id="refresh_vc" class="btnlite" value="{L_VC_REFRESH}" /><!-- ENDIF --></td> </tr> diff --git a/phpBB/styles/subsilver2/template/captcha_qa.html b/phpBB/styles/subsilver2/template/captcha_qa.html index acc9cdcdfb..90a6492400 100644 --- a/phpBB/styles/subsilver2/template/captcha_qa.html +++ b/phpBB/styles/subsilver2/template/captcha_qa.html @@ -2,7 +2,7 @@ <th colspan="2" valign="middle">{L_CONFIRM_QUESTION}</th> </tr> <tr> - <td class="row1"><b class="genmed">{QA_CONFIRM_QUESTION}:</b><br /><span class="gensmall">{L_CONFIRM_QUESTION_EXPLAIN}</span></td> - <td class="row2"><input class="post" type="text" name="qa_answer" size="80"<!-- IF $CAPTCHA_TAB_INDEX --> tabindex="{$CAPTCHA_TAB_INDEX}"<!-- ENDIF --> /></td> + <td class="row1"><b class="genmed">{QA_CONFIRM_QUESTION}{L_COLON}</b><br /><span class="gensmall">{L_CONFIRM_QUESTION_EXPLAIN}</span></td> + <td class="row2"><input class="post" type="text" name="qa_answer" size="80"<!-- IF $CAPTCHA_TAB_INDEX --> tabindex="{$CAPTCHA_TAB_INDEX}"<!-- ENDIF --> /> <input type="hidden" name="qa_confirm_id" id="confirm_id" value="{QA_CONFIRM_ID}" /></td> </tr> diff --git a/phpBB/styles/subsilver2/template/captcha_recaptcha.html b/phpBB/styles/subsilver2/template/captcha_recaptcha.html index ec09b28ef5..0d116b361f 100644 --- a/phpBB/styles/subsilver2/template/captcha_recaptcha.html +++ b/phpBB/styles/subsilver2/template/captcha_recaptcha.html @@ -3,7 +3,7 @@ <th colspan="2" valign="middle">{L_CONFIRM_CODE}</th> </tr> <tr> - <td class="row1"><b class="genmed">{L_CONFIRM_CODE}:</b><br /><span class="gensmall">{L_RECAPTCHA_EXPLAIN}</span></td> + <td class="row1"><b class="genmed">{L_CONFIRM_CODE}{L_COLON}</b><br /><span class="gensmall">{L_RECAPTCHA_EXPLAIN}</span></td> <td class="row2"> <script type="text/javascript"> // <![CDATA[ diff --git a/phpBB/styles/subsilver2/template/custom_profile_fields.html b/phpBB/styles/subsilver2/template/custom_profile_fields.html index c8f287ddb4..2853722064 100644 --- a/phpBB/styles/subsilver2/template/custom_profile_fields.html +++ b/phpBB/styles/subsilver2/template/custom_profile_fields.html @@ -25,7 +25,7 @@ <!-- END int --> <!-- BEGIN date --> - <span class="genmed">{L_DAY}:</span> <select name="{date.FIELD_IDENT}_day">{date.S_DAY_OPTIONS}</select> - <span class="genmed">{L_MONTH}:</span> <select name="{date.FIELD_IDENT}_month">{date.S_MONTH_OPTIONS}</select> - <span class="genmed">{L_YEAR}:</span> <select name="{date.FIELD_IDENT}_year">{date.S_YEAR_OPTIONS}</select> + <span class="genmed">{L_DAY}{L_COLON}</span> <select name="{date.FIELD_IDENT}_day">{date.S_DAY_OPTIONS}</select> + <span class="genmed">{L_MONTH}{L_COLON}</span> <select name="{date.FIELD_IDENT}_month">{date.S_MONTH_OPTIONS}</select> + <span class="genmed">{L_YEAR}{L_COLON}</span> <select name="{date.FIELD_IDENT}_year">{date.S_YEAR_OPTIONS}</select> <!-- END date --> diff --git a/phpBB/styles/subsilver2/template/forumlist_body.html b/phpBB/styles/subsilver2/template/forumlist_body.html index b9a1102df0..ad505885f6 100644 --- a/phpBB/styles/subsilver2/template/forumlist_body.html +++ b/phpBB/styles/subsilver2/template/forumlist_body.html @@ -19,13 +19,13 @@ <td class="row1" width="50" align="center">{forumrow.FORUM_FOLDER_IMG}</td> <td class="row1"> <!-- IF forumrow.FORUM_IMAGE --> - <div style="float: {S_CONTENT_FLOW_BEGIN}; margin-{S_CONTENT_FLOW_END}: 5px;">{forumrow.FORUM_IMAGE}</div> + <div style="float: {S_CONTENT_FLOW_BEGIN}; margin-{S_CONTENT_FLOW_END}{L_COLON} 5px;">{forumrow.FORUM_IMAGE}</div> <!-- ENDIF --> <a class="forumlink" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a> <p class="forumdesc">{forumrow.FORUM_DESC}</p> </td> <!-- IF forumrow.CLICKS --> - <td class="row2" colspan="3" align="center"><span class="genmed">{L_REDIRECTS}: {forumrow.CLICKS}</span></td> + <td class="row2" colspan="3" align="center"><span class="genmed">{L_REDIRECTS}{L_COLON} {forumrow.CLICKS}</span></td> <!-- ELSE --> <td class="row2" colspan="3" align="center"> </td> <!-- ENDIF --> @@ -41,12 +41,12 @@ <td class="row1" width="50" align="center">{forumrow.FORUM_FOLDER_IMG}</td> <td class="row1" width="100%"> <!-- IF forumrow.FORUM_IMAGE --> - <div style="float: {S_CONTENT_FLOW_BEGIN}; margin-{S_CONTENT_FLOW_END}: 5px;">{forumrow.FORUM_IMAGE}</div> + <div style="float: {S_CONTENT_FLOW_BEGIN}; margin-{S_CONTENT_FLOW_END}{L_COLON} 5px;">{forumrow.FORUM_IMAGE}</div> <!-- ENDIF --> <a class="forumlink" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a> <p class="forumdesc">{forumrow.FORUM_DESC}</p> <!-- IF forumrow.MODERATORS --> - <p class="forumdesc"><strong>{forumrow.L_MODERATOR_STR}:</strong> {forumrow.MODERATORS}</p> + <p class="forumdesc"><strong>{forumrow.L_MODERATOR_STR}{L_COLON}</strong> {forumrow.MODERATORS}</p> <!-- ENDIF --> <!-- IF .forumrow.subforum and forumrow.S_LIST_SUBFORUMS --> <p class="forumdesc"><strong>{forumrow.L_SUBFORUM_STR}</strong> @@ -61,7 +61,7 @@ <td class="row2" align="center" nowrap="nowrap"> <!-- IF forumrow.LAST_POST_TIME --> <!-- IF forumrow.S_DISPLAY_SUBJECT --> - <p class="topicdetails"><a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}">{forumrow.LAST_POST_SUBJECT_TRUNCATED}</a></p> + <p class="topicdetails"><a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}" class="lastsubject">{forumrow.LAST_POST_SUBJECT_TRUNCATED}</a></p> <!-- ENDIF --> <p class="topicdetails"><!-- IF forumrow.U_UNAPPROVED_TOPICS --><a href="{forumrow.U_UNAPPROVED_TOPICS}" class="imageset">{UNAPPROVED_IMG}</a> <!-- ENDIF -->{forumrow.LAST_POST_TIME}</p> <p class="topicdetails">{forumrow.LAST_POSTER_FULL} diff --git a/phpBB/styles/subsilver2/template/index_body.html b/phpBB/styles/subsilver2/template/index_body.html index 100199c209..af2cefef7a 100644 --- a/phpBB/styles/subsilver2/template/index_body.html +++ b/phpBB/styles/subsilver2/template/index_body.html @@ -50,7 +50,7 @@ </tr> <tr> <td class="row1" align="center" valign="middle"><img src="{T_THEME_PATH}/images/whosonline.gif" alt="{L_BIRTHDAYS}" /></td> - <td class="row1" width="100%"><p class="genmed"><!-- IF .birthdays -->{L_CONGRATULATIONS}: <b><!-- BEGIN birthdays -->{birthdays.USERNAME}<!-- IF birthdays.AGE !== '' --> ({birthdays.AGE})<!-- ENDIF --><!-- IF not birthdays.S_LAST_ROW -->, <!-- ENDIF --><!-- END birthdays --></b><!-- ELSE -->{L_NO_BIRTHDAYS}<!-- ENDIF --></p></td> + <td class="row1" width="100%"><p class="genmed"><!-- IF .birthdays -->{L_CONGRATULATIONS}{L_COLON} <b><!-- BEGIN birthdays -->{birthdays.USERNAME}<!-- IF birthdays.AGE !== '' --> ({birthdays.AGE})<!-- ENDIF --><!-- IF not birthdays.S_LAST_ROW -->, <!-- ENDIF --><!-- END birthdays --></b><!-- ELSE -->{L_NO_BIRTHDAYS}<!-- ENDIF --></p></td> </tr> </table> <!-- ENDIF --> @@ -77,7 +77,7 @@ <td class="cat"><h4><a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a></h4></td> </tr> <tr> - <td class="row1" align="center"><span class="genmed">{L_USERNAME}:</span> <input class="post" type="text" name="username" size="10" /> <span class="genmed">{L_PASSWORD}:</span> <input class="post" type="password" name="password" size="10" /> <!-- IF S_AUTOLOGIN_ENABLED --> <span class="gensmall">{L_LOG_ME_IN}</span> <input type="checkbox" class="radio" name="autologin" /><!-- ENDIF --> <input type="submit" class="btnmain" name="login" value="{L_LOGIN}" /></td> + <td class="row1" align="center"><span class="genmed">{L_USERNAME}{L_COLON}</span> <input class="post" type="text" name="username" size="10" /> <span class="genmed">{L_PASSWORD}{L_COLON}</span> <input class="post" type="password" name="password" size="10" /> <!-- IF S_AUTOLOGIN_ENABLED --> <span class="gensmall">{L_LOG_ME_IN}</span> <input type="checkbox" class="radio" name="autologin" /><!-- ENDIF --> <input type="submit" class="btnmain" name="login" value="{L_LOGIN}" /></td> </tr> </table> {S_LOGIN_REDIRECT} diff --git a/phpBB/styles/subsilver2/template/jumpbox.html b/phpBB/styles/subsilver2/template/jumpbox.html index a7c157f02b..f4153d7692 100644 --- a/phpBB/styles/subsilver2/template/jumpbox.html +++ b/phpBB/styles/subsilver2/template/jumpbox.html @@ -4,7 +4,7 @@ <table cellspacing="0" cellpadding="0" border="0"> <tr> - <td nowrap="nowrap"><span class="gensmall"><!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->:</span> <select name="f" onchange="if(this.options[this.selectedIndex].value != -1){ document.forms['jumpbox'].submit() }"> + <td nowrap="nowrap"><span class="gensmall"><!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->{L_COLON}</span> <select name="f" onchange="if(this.options[this.selectedIndex].value != -1){ document.forms['jumpbox'].submit() }"> <!-- BEGIN jumpbox_forums --> <!-- IF jumpbox_forums.S_FORUM_COUNT eq 1 --><option value="-1">------------------</option><!-- ENDIF --> diff --git a/phpBB/styles/subsilver2/template/login_body.html b/phpBB/styles/subsilver2/template/login_body.html index ba316517a9..2b895dda89 100644 --- a/phpBB/styles/subsilver2/template/login_body.html +++ b/phpBB/styles/subsilver2/template/login_body.html @@ -34,7 +34,7 @@ <!-- ENDIF --> <tr> - <td valign="top" <!-- IF S_ADMIN_AUTH -->style="width: 50%; text-align: {S_CONTENT_FLOW_END};"<!-- ENDIF -->><b class="gensmall">{L_USERNAME}:</b></td> + <td valign="top" <!-- IF S_ADMIN_AUTH -->style="width: 50%; text-align: {S_CONTENT_FLOW_END};"<!-- ENDIF -->><b class="gensmall">{L_USERNAME}{L_COLON}</b></td> <td><input class="post" type="text" name="{USERNAME_CREDENTIAL}" size="25" value="{USERNAME}" tabindex="1" /> <!-- IF not S_ADMIN_AUTH and S_REGISTER_ENABLED --> <br /><a class="gensmall" href="{U_REGISTER}">{L_REGISTER}</a> @@ -42,7 +42,7 @@ </td> </tr> <tr> - <td valign="top" <!-- IF S_ADMIN_AUTH -->style="width: 50%; text-align: {S_CONTENT_FLOW_END};"<!-- ENDIF -->><b class="gensmall">{L_PASSWORD}:</b></td> + <td valign="top" <!-- IF S_ADMIN_AUTH -->style="width: 50%; text-align: {S_CONTENT_FLOW_END};"<!-- ENDIF -->><b class="gensmall">{L_PASSWORD}{L_COLON}</b></td> <td> <input class="post" type="password" name="{PASSWORD_CREDENTIAL}" size="25" tabindex="2" /> <!-- IF U_SEND_PASSWORD --><br /><a class="gensmall" href="{U_SEND_PASSWORD}">{L_FORGOT_PASS}</a><!-- ENDIF --> diff --git a/phpBB/styles/subsilver2/template/login_forum.html b/phpBB/styles/subsilver2/template/login_forum.html index d31a7d2109..c9b2c7277e 100644 --- a/phpBB/styles/subsilver2/template/login_forum.html +++ b/phpBB/styles/subsilver2/template/login_forum.html @@ -21,7 +21,7 @@ </tr> <!-- ENDIF --> <tr> - <td class="gensmall"><b>{L_PASSWORD}:</b></td> + <td class="gensmall"><b>{L_PASSWORD}{L_COLON}</b></td> <td><input class="post" type="password" name="password" size="25" tabindex="2" /></td> </tr> </table> diff --git a/phpBB/styles/subsilver2/template/mcp_approve.html b/phpBB/styles/subsilver2/template/mcp_approve.html index 2d2013f05c..5ad7d2f9b5 100644 --- a/phpBB/styles/subsilver2/template/mcp_approve.html +++ b/phpBB/styles/subsilver2/template/mcp_approve.html @@ -20,11 +20,11 @@ <br /> <table border="0" width="90%" cellspacing="2" cellpadding="1"> <tr> - <td class="row1" width="22%"><b class="gen">{L_DISAPPROVE_REASON}:</b></td> + <td class="row1" width="22%"><b class="gen">{L_DISAPPROVE_REASON}{L_COLON}</b></td> <td class="row1" width="78%"><select name="reason_id"><!-- BEGIN reason --><option value="{reason.ID}"<!-- IF reason.S_SELECTED --> selected="selected"<!-- ENDIF -->>{reason.DESCRIPTION}</option><!-- END reason --></select></td> </tr> <tr> - <td class="row1" valign="top"><span class="gen"><b>{L_MORE_INFO}:</b></span><br /><span class="gensmall">{L_CAN_LEAVE_BLANK}</span></td> + <td class="row1" valign="top"><span class="gen"><b>{L_MORE_INFO}{L_COLON}</b></span><br /><span class="gensmall">{L_CAN_LEAVE_BLANK}</span></td> <td class="row1"><textarea class="post" style="width:500px" name="reason" rows="10" cols="40">{REASON}</textarea></td> </tr> </table> diff --git a/phpBB/styles/subsilver2/template/mcp_ban.html b/phpBB/styles/subsilver2/template/mcp_ban.html index 67de81c60c..edf81c6d76 100644 --- a/phpBB/styles/subsilver2/template/mcp_ban.html +++ b/phpBB/styles/subsilver2/template/mcp_ban.html @@ -41,26 +41,26 @@ <td class="row3" colspan="2">{L_EXPLAIN}</td> </tr> <tr> - <td class="row1" width="45%" valign="top"><b>{L_BAN_CELL}:</b></td> + <td class="row1" width="45%" valign="top"><b>{L_BAN_CELL}{L_COLON}</b></td> <td class="row2"> <textarea name="ban" id="ban" cols="40" rows="3" class="post">{USERNAMES}</textarea> <!-- IF S_USERNAME_BAN --><br />[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]<!-- ENDIF --> </td> </tr> <tr> - <td class="row1" valign="top"><b>{L_BAN_LENGTH}:</b></td> + <td class="row1" valign="top"><b>{L_BAN_LENGTH}{L_COLON}</b></td> <td class="row2"><select name="banlength">{S_BAN_END_OPTIONS}</select><br /><input type="text" name="banlengthother" class="post" /> {L_YEAR_MONTH_DAY}</td> </tr> <tr> - <td class="row1" valign="top"><b>{L_BAN_EXCLUDE}:</b><br /><span class="gensmall">{L_BAN_EXCLUDE_EXPLAIN}</span></td> + <td class="row1" valign="top"><b>{L_BAN_EXCLUDE}{L_COLON}</b><br /><span class="gensmall">{L_BAN_EXCLUDE_EXPLAIN}</span></td> <td class="row2"><input type="radio" class="radio" name="banexclude" value="1" /> {L_YES} <input type="radio" class="radio" name="banexclude" value="0" checked="checked" /> {L_NO}</td> </tr> <tr> - <td class="row1" valign="top"><b>{L_BAN_REASON}:</b></td> + <td class="row1" valign="top"><b>{L_BAN_REASON}{L_COLON}</b></td> <td class="row2"><input name="banreason" type="text" class="post" maxlength="255" /></td> </tr> <tr> - <td class="row1" valign="top"><b>{L_BAN_GIVE_REASON}:</b></td> + <td class="row1" valign="top"><b>{L_BAN_GIVE_REASON}{L_COLON}</b></td> <td class="row2"><input name="bangivereason" type="text" class="post" maxlength="255" /></td> </tr> <tr> @@ -79,19 +79,19 @@ </tr> <!-- IF S_BANNED_OPTIONS --> <tr> - <td class="row1" valign="top" width="45%"><b>{L_BAN_CELL}:</b></td> + <td class="row1" valign="top" width="45%"><b>{L_BAN_CELL}{L_COLON}</b></td> <td class="row2"><select name="unban[]" multiple="multiple" size="10" style="width: 50%" onchange="if (this.selectedIndex > -1) display_details(this.options[this.selectedIndex].value); else display_details(-1);">{BANNED_OPTIONS}</select></td> </tr> <tr> - <td class="row1" valign="top"><b>{L_BAN_LENGTH}:</b></td> + <td class="row1" valign="top"><b>{L_BAN_LENGTH}{L_COLON}</b></td> <td class="row2"><input style="border: 0; width: 100%" type="text" name="unbanlength" readonly="readonly" /></td> </tr> <tr> - <td class="row1" valign="top"><b>{L_BAN_REASON}:</b></td> + <td class="row1" valign="top"><b>{L_BAN_REASON}{L_COLON}</b></td> <td class="row2"><textarea style="border: 0; width: 100%" name="unbanreason" readonly="readonly" rows="5" cols="80"> </textarea></td> </tr> <tr> - <td class="row1" valign="top"><b>{L_BAN_GIVE_REASON}:</b></td> + <td class="row1" valign="top"><b>{L_BAN_GIVE_REASON}{L_COLON}</b></td> <td class="row2"><textarea style="border: 0; width: 100%" name="unbangivereason" readonly="readonly" rows="5" cols="80"> </textarea></td> </tr> <tr> diff --git a/phpBB/styles/subsilver2/template/mcp_footer.html b/phpBB/styles/subsilver2/template/mcp_footer.html index b48c244653..280920b148 100644 --- a/phpBB/styles/subsilver2/template/mcp_footer.html +++ b/phpBB/styles/subsilver2/template/mcp_footer.html @@ -3,7 +3,7 @@ </tr> </table> - <!-- IF PAGINATION --> + <!-- IF .pagination --> <table width="80%" align="{S_CONTENT_FLOW_END}" cellspacing="1"> <tr> <td class="nav" valign="middle" nowrap="nowrap"> {PAGE_NUMBER}<br /></td> diff --git a/phpBB/styles/subsilver2/template/mcp_forum.html b/phpBB/styles/subsilver2/template/mcp_forum.html index 5d69e85391..6972f14b79 100644 --- a/phpBB/styles/subsilver2/template/mcp_forum.html +++ b/phpBB/styles/subsilver2/template/mcp_forum.html @@ -10,7 +10,7 @@ <table class="tablebg" width="100%" cellspacing="1"> <tr> - <td class="cat" colspan="6" align="center"><span class="gensmall">{L_DISPLAY_TOPICS}:</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td> + <td class="cat" colspan="6" align="center"><span class="gensmall">{L_DISPLAY_TOPICS}{L_COLON}</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td> </tr> <tr> <th width="4%" nowrap="nowrap"> </th> diff --git a/phpBB/styles/subsilver2/template/mcp_jumpbox.html b/phpBB/styles/subsilver2/template/mcp_jumpbox.html index 14856596f0..734222bc77 100644 --- a/phpBB/styles/subsilver2/template/mcp_jumpbox.html +++ b/phpBB/styles/subsilver2/template/mcp_jumpbox.html @@ -2,7 +2,7 @@ <form name="jumpbox" method="post" action="{S_JUMPBOX_ACTION}"> - <span class="gensmall">{L_JUMP_TO}:</span> <select name="f" onChange="if(this.options[this.selectedIndex].value != -1 && this.options[this.selectedIndex].value != document.jumpbox.current_f.value){ document.forms['jumpbox'].submit() }"> + <span class="gensmall">{L_JUMP_TO}{L_COLON}</span> <select name="f" onChange="if(this.options[this.selectedIndex].value != -1 && this.options[this.selectedIndex].value != document.jumpbox.current_f.value){ document.forms['jumpbox'].submit() }"> <!-- IF S_ENABLE_SELECT_ALL --> <option value="0">{L_ALL_FORUMS}</option> diff --git a/phpBB/styles/subsilver2/template/mcp_logs.html b/phpBB/styles/subsilver2/template/mcp_logs.html index 03c6a2f139..64f2a6a64d 100644 --- a/phpBB/styles/subsilver2/template/mcp_logs.html +++ b/phpBB/styles/subsilver2/template/mcp_logs.html @@ -22,10 +22,10 @@ </tr> <!-- END log --> <tr align="center"> - <td class="row3" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->"><span class="gensmall">{L_SEARCH_KEYWORDS}:</span> <input type="text" name="keywords" value="{S_KEYWORDS}" /> <input type="submit" class="btnlite" name="filter" value="{L_SEARCH}" /></td> + <td class="row3" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->"><span class="gensmall">{L_SEARCH_KEYWORDS}{L_COLON}</span> <input type="text" name="keywords" value="{S_KEYWORDS}" /> <input type="submit" class="btnlite" name="filter" value="{L_SEARCH}" /></td> </tr> <tr align="center"> - <td class="row3" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->"><span class="gensmall">{L_DISPLAY_LOG}:</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td> + <td class="row3" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->"><span class="gensmall">{L_DISPLAY_LOG}{L_COLON}</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td> </tr> <!-- IF S_CLEAR_ALLOWED --> <tr> diff --git a/phpBB/styles/subsilver2/template/mcp_notes_front.html b/phpBB/styles/subsilver2/template/mcp_notes_front.html index 6f5972889f..e2e14e0150 100644 --- a/phpBB/styles/subsilver2/template/mcp_notes_front.html +++ b/phpBB/styles/subsilver2/template/mcp_notes_front.html @@ -7,7 +7,7 @@ <th colspan="2"align="center">{L_SELECT_USER}</th> </tr> <tr> - <td class="row1" width="40%"><b class="gen">{L_FIND_USERNAME}: </b><br /><span class="gensmall">[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span></td> + <td class="row1" width="40%"><b class="gen">{L_FIND_USERNAME}{L_COLON} </b><br /><span class="gensmall">[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span></td> <td class="row2"><input type="text" class="post" name="username" size="20" /></td> </tr> <tr> diff --git a/phpBB/styles/subsilver2/template/mcp_notes_user.html b/phpBB/styles/subsilver2/template/mcp_notes_user.html index b7ce1d3fce..4bd8de6862 100644 --- a/phpBB/styles/subsilver2/template/mcp_notes_user.html +++ b/phpBB/styles/subsilver2/template/mcp_notes_user.html @@ -30,15 +30,15 @@ <td class="row1"> <table width="100%" cellspacing="1" cellpadding="2" border="0"> <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_JOINED}: </td> + <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_JOINED}{L_COLON} </td> <td width="100%"><b class="gen">{JOINED}</b></td> </tr> <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_TOTAL_POSTS}: </td> + <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_TOTAL_POSTS}{L_COLON} </td> <td><b class="gen">{POSTS}</b></td> </tr> <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_WARNINGS}: </td> + <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_WARNINGS}{L_COLON} </td> <td><b class="gen">{WARNINGS}</b></td> </tr> </table> @@ -55,10 +55,10 @@ <!-- IF S_USER_NOTES --> <tr align="center"> - <td colspan="5" class="row3"><span class="gensmall">{L_SEARCH_KEYWORDS}:</span> <input type="text" name="keywords" value="{S_KEYWORDS}" /> <input type="submit" class="btnlite" name="filter" value="{L_SEARCH}" /></td> + <td colspan="5" class="row3"><span class="gensmall">{L_SEARCH_KEYWORDS}{L_COLON}</span> <input type="text" name="keywords" value="{S_KEYWORDS}" /> <input type="submit" class="btnlite" name="filter" value="{L_SEARCH}" /></td> </tr> <tr align="center"> - <td colspan="5" class="row3"><span class="gensmall">{L_DISPLAY_LOG}:</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}:</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td> + <td colspan="5" class="row3"><span class="gensmall">{L_DISPLAY_LOG}{L_COLON}</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}{L_COLON}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td> </tr> <tr> <th>{L_REPORT_BY}</th> diff --git a/phpBB/styles/subsilver2/template/mcp_post.html b/phpBB/styles/subsilver2/template/mcp_post.html index 24d8682876..910accd09f 100644 --- a/phpBB/styles/subsilver2/template/mcp_post.html +++ b/phpBB/styles/subsilver2/template/mcp_post.html @@ -8,15 +8,15 @@ <th colspan="2" align="center"><!-- IF S_PM -->{L_PM_REPORT_DETAILS}<!-- ELSE -->{L_REPORT_DETAILS}<!-- ENDIF --></th> </tr> <tr> - <td class="row1"><b class="gen">{L_REPORT_REASON}: </b></td> + <td class="row1"><b class="gen">{L_REPORT_REASON}{L_COLON} </b></td> <td class="row2"><span class="gen">{REPORT_REASON_TITLE} » {REPORT_REASON_DESCRIPTION}</span></td> </tr> <tr> - <td class="row1" width="20%"><b class="gen">{L_REPORTER}: </b></td> + <td class="row1" width="20%"><b class="gen">{L_REPORTER}{L_COLON} </b></td> <td class="row2" width="80%"><span class="gen"<!-- IF REPORTER_COLOUR --> style="font-weight: bold; color: {REPORTER_COLOUR};"<!-- ENDIF -->>{REPORTER_NAME}</span> <span class="gen">[ <!-- IF U_VIEW_REPORTER_PROFILE --><a href="{U_VIEW_REPORTER_PROFILE}">{L_READ_PROFILE}</a><!-- ENDIF --><!-- IF S_USER_NOTES --><!-- IF U_VIEW_REPORTER_PROFILE --> | <!-- ENDIF --><a href="{U_MCP_REPORTER_NOTES}">{L_VIEW_NOTES}</a> | <a href="{U_MCP_WARN_REPORTER}">{L_WARN_USER}</a><!-- ENDIF --> ]</span></td> </tr> <tr> - <td class="row1"><b class="gen">{L_REPORTED}: </b></td> + <td class="row1"><b class="gen">{L_REPORTED}{L_COLON} </b></td> <td class="row2"><span class="postdetails">{REPORT_DATE}</span></td> </tr> <!-- IF REPORT_TEXT --> @@ -49,16 +49,16 @@ <td class="row3" colspan="2" align="center"><span class="gensmall"><!-- IF S_MCP_QUEUE -->{RETURN_QUEUE} | {RETURN_TOPIC_SIMPLE} | {RETURN_POST}<!-- ELSEIF S_MCP_REPORT -->{RETURN_REPORTS}<!-- IF not S_PM --> | <a href="{U_VIEW_POST}">{L_VIEW_POST}</a> | <a href="{U_VIEW_TOPIC}">{L_VIEW_TOPIC}</a> | <a href="{U_VIEW_FORUM}">{L_VIEW_FORUM}</a><!-- ENDIF --><!-- ELSE -->{RETURN_TOPIC}<!-- ENDIF --></span></td> </tr> <tr> - <td class="row1"><b class="gen"><!-- IF S_PM -->{L_PM_SUBJECT}<!-- ELSE -->{L_POST_SUBJECT}<!-- ENDIF -->: </b></td> + <td class="row1"><b class="gen"><!-- IF S_PM -->{L_PM_SUBJECT}<!-- ELSE -->{L_POST_SUBJECT}<!-- ENDIF -->{L_COLON} </b></td> <td class="row2"><span class="gen">{POST_SUBJECT}</span> <!-- IF S_POST_UNAPPROVED --><span class="postapprove">{UNAPPROVED_IMG} <a href="{U_MCP_APPROVE}">{L_POST_UNAPPROVED}</a></span> <!-- ENDIF --> <!-- IF S_POST_REPORTED and not S_MCP_REPORT --><span class="postreported">{REPORTED_IMG} <a href="{U_MCP_REPORT}">{L_POST_REPORTED}</a></span><!-- ENDIF --></td> </tr> <tr> - <td class="row1" width="20%"><b class="gen"><!-- IF S_PM -->{L_PM_FROM}<!-- ELSE -->{L_POSTER}<!-- ENDIF -->: </b></td> + <td class="row1" width="20%"><b class="gen"><!-- IF S_PM -->{L_PM_FROM}<!-- ELSE -->{L_POSTER}<!-- ENDIF -->{L_COLON} </b></td> <td class="row2" width="80%"><span class="gen"<!-- IF POST_AUTHOR_COLOUR --> style="font-weight: bold; color: {POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{POST_AUTHOR}</span><span class="gen"> [ <!-- IF U_POST_AUTHOR --><a href="{U_POST_AUTHOR}">{L_READ_PROFILE}</a><!-- ENDIF --><!-- IF S_USER_NOTES --><!-- IF U_POST_AUTHOR --> | <!-- ENDIF --><a href="{U_MCP_USER_NOTES}">{L_VIEW_NOTES}</a> <!-- IF U_MCP_WARN_USER -->| <a href="{U_MCP_WARN_USER}">{L_WARN_USER}</a><!-- ENDIF --><!-- ENDIF --> ]</span></td> </tr> <!-- IF S_CAN_VIEWIP --> <tr> - <td class="row1"><b class="gen"><!-- IF S_PM -->{L_THIS_PM_IP}<!-- ELSE -->{L_THIS_POST_IP}<!-- ENDIF -->: </b></td> + <td class="row1"><b class="gen"><!-- IF S_PM -->{L_THIS_PM_IP}<!-- ELSE -->{L_THIS_POST_IP}<!-- ENDIF -->{L_COLON} </b></td> <td class="row2"><span class="gen"> <!-- IF U_WHOIS --> <a href="{U_WHOIS}"><!-- IF POST_IPADDR -->{POST_IPADDR}<!-- ELSE -->{POST_IP}<!-- ENDIF --></a> (<!-- IF POST_IPADDR -->{POST_IP}<!-- ELSE --><a href="{U_LOOKUP_IP}">{L_LOOKUP_IP}</a><!-- ENDIF -->) @@ -69,12 +69,12 @@ </tr> <!-- ENDIF --> <tr> - <td class="row1"><b class="gen"><!-- IF S_PM -->{L_SENT_AT}<!-- ELSE -->{L_POSTED}<!-- ENDIF -->: </b></td> + <td class="row1"><b class="gen"><!-- IF S_PM -->{L_SENT_AT}<!-- ELSE -->{L_POSTED}<!-- ENDIF -->{L_COLON} </b></td> <td class="row2"><span class="postdetails">{POST_DATE}</span></td> </tr> <!-- IF S_TO_RECIPIENT --> <tr> - <td class="row1" nowrap="nowrap" width="150"><b class="gen">{L_TO}:</b></td> + <td class="row1" nowrap="nowrap" width="150"><b class="gen">{L_TO}{L_COLON}</b></td> <td class="row2 gen"> <!-- BEGIN to_recipient --> <!-- IF to_recipient.IS_GROUP --><span class="sep"><a href="{to_recipient.U_VIEW}">{to_recipient.NAME}</a></span><!-- ELSE -->{to_recipient.NAME_FULL} <!-- ENDIF --> @@ -85,7 +85,7 @@ <!-- IF S_BCC_RECIPIENT --> <tr> - <td class="row1" nowrap="nowrap" width="150"><b class="gen">{L_BCC}:</b></td> + <td class="row1" nowrap="nowrap" width="150"><b class="gen">{L_BCC}{L_COLON}</b></td> <td class="row2 gen"> <!-- BEGIN bcc_recipient --> <!-- IF bcc_recipient.IS_GROUP --><span class="sep"><a href="{bcc_recipient.U_VIEW}">{bcc_recipient.NAME}</a></span><!-- ELSE -->{bcc_recipient.NAME_FULL} <!-- ENDIF --> @@ -107,7 +107,7 @@ <table class="tablebg" width="100%" cellspacing="1"> <tr> - <td class="row3"><b class="genmed">{L_ATTACHMENTS}: </b></td> + <td class="row3"><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td> </tr> <!-- BEGIN attachment --> <tr> diff --git a/phpBB/styles/subsilver2/template/mcp_queue.html b/phpBB/styles/subsilver2/template/mcp_queue.html index d13af91888..febde7e59c 100644 --- a/phpBB/styles/subsilver2/template/mcp_queue.html +++ b/phpBB/styles/subsilver2/template/mcp_queue.html @@ -7,7 +7,7 @@ <th colspan="4" nowrap="nowrap">{L_DISPLAY_OPTIONS}</th> </tr> <tr> - <td colspan="4" class="cat" align="center"><span class="gensmall">{L_DISPLAY_ITEMS}:</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <span class="gensmall">{L_FORUM}</span> <select name="f">{S_FORUM_OPTIONS}</select> <!-- IF TOPIC_ID --><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" /> <b>{L_ONLY_TOPIC}</b> <!-- ENDIF --><input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td> + <td colspan="4" class="cat" align="center"><span class="gensmall">{L_DISPLAY_ITEMS}{L_COLON}</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <span class="gensmall">{L_FORUM}</span> <select name="f">{S_FORUM_OPTIONS}</select> <!-- IF TOPIC_ID --><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" /> <b>{L_ONLY_TOPIC}</b> <!-- ENDIF --><input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td> </tr> <tr> <th> <!-- IF S_TOPICS -->{L_TOPIC}<!-- ELSE -->{L_POST}<!-- ENDIF --> </th> @@ -19,7 +19,7 @@ <!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> <td style="padding: 4px;"><p class="topictitle">{postrow.ATTACH_ICON_IMG} <a href="{postrow.U_VIEWPOST}">{postrow.POST_SUBJECT}</a></p> - <span class="gensmall"><!-- IF postrow.U_VIEWFORUM -->{L_FORUM}: <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a><!-- ELSE -->{postrow.FORUM_NAME}<!-- ENDIF --></span></td> + <span class="gensmall"><!-- IF postrow.U_VIEWFORUM -->{L_FORUM}{L_COLON} <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a><!-- ELSE -->{postrow.FORUM_NAME}<!-- ENDIF --></span></td> <td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap"><span class="gen">{postrow.POST_AUTHOR_FULL}</span><br /> <span class="gensmall">[ <a href="{postrow.U_VIEW_DETAILS}">{L_VIEW_DETAILS}</a> ]</span></td> <td class="postdetails" style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap">{postrow.POST_TIME}</td> diff --git a/phpBB/styles/subsilver2/template/mcp_reports.html b/phpBB/styles/subsilver2/template/mcp_reports.html index cfbd713321..158f9c2603 100644 --- a/phpBB/styles/subsilver2/template/mcp_reports.html +++ b/phpBB/styles/subsilver2/template/mcp_reports.html @@ -7,7 +7,7 @@ <th colspan="5" nowrap="nowrap">{L_DISPLAY_OPTIONS}</th> </tr> <tr> - <td colspan="5" class="cat" align="center"><span class="gensmall">{L_DISPLAY_POSTS}:</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}<!-- IF not S_PM --> <span class="gensmall">{L_FORUM}</span> <select name="f">{S_FORUM_OPTIONS}</select> <!-- IF TOPIC_ID --><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" /> <b>{L_ONLY_TOPIC}</b> <!-- ENDIF --><!-- ENDIF --><input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td> + <td colspan="5" class="cat" align="center"><span class="gensmall">{L_DISPLAY_POSTS}{L_COLON}</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}<!-- IF not S_PM --> <span class="gensmall">{L_FORUM}</span> <select name="f">{S_FORUM_OPTIONS}</select> <!-- IF TOPIC_ID --><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" /> <b>{L_ONLY_TOPIC}</b> <!-- ENDIF --><!-- ENDIF --><input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td> </tr> <tr> <!-- IF S_PM --> @@ -26,12 +26,12 @@ <!-- IF postrow.S_ROW_ is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> <!-- IF S_PM --> <td style="padding: 4px;"><p class="topictitle">{postrow.ATTACH_ICON_IMG} <a href="{postrow.U_VIEW_DETAILS}">{postrow.PM_SUBJECT}</a></p> - <span class="gensmall">{L_PM_FROM}: {postrow.PM_AUTHOR_FULL}</span></td> + <span class="gensmall">{L_PM_FROM}{L_COLON} {postrow.PM_AUTHOR_FULL}</span></td> <td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><span class="gen">{postrow.RECIPIENTS}</span><br /> - <span class="gensmall">{L_SENT_AT}: {postrow.PM_TIME}</span></td> + <span class="gensmall">{L_SENT_AT}{L_COLON} {postrow.PM_TIME}</span></td> <!-- ELSE --> <td style="padding: 4px;"><p class="topictitle">{postrow.ATTACH_ICON_IMG} <a href="{postrow.U_VIEWPOST}">{postrow.POST_SUBJECT}</a></p> - <span class="gensmall"><!-- IF postrow.U_VIEWFORUM -->{L_FORUM}: <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a><!-- ELSE -->{postrow.FORUM_NAME}<!-- ENDIF --></span></td> + <span class="gensmall"><!-- IF postrow.U_VIEWFORUM -->{L_FORUM}{L_COLON} <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a><!-- ELSE -->{postrow.FORUM_NAME}<!-- ENDIF --></span></td> <td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap"><span class="gen">{postrow.POST_AUTHOR_FULL}</span><br /> <span class="gensmall">{postrow.POST_TIME}</span></td> <!-- ENDIF --> diff --git a/phpBB/styles/subsilver2/template/mcp_topic.html b/phpBB/styles/subsilver2/template/mcp_topic.html index 6bbf13e12c..431d8d0e6c 100644 --- a/phpBB/styles/subsilver2/template/mcp_topic.html +++ b/phpBB/styles/subsilver2/template/mcp_topic.html @@ -58,10 +58,10 @@ <td class="row2" colspan="2"><input class="post" type="text" name="posts_per_page" size="6" value="{POSTS_PER_PAGE}" /></td> </tr> <tr> - <td class="cat" colspan="3" align="center"><span class="gensmall">{L_DISPLAY_POSTS}:</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td> + <td class="cat" colspan="3" align="center"><span class="gensmall">{L_DISPLAY_POSTS}{L_COLON}</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td> </tr> <tr> - <th nowrap="nowrap" colspan="3">{L_TOPIC_REVIEW}: {TOPIC_TITLE}</th> + <th nowrap="nowrap" colspan="3">{L_TOPIC_REVIEW}{L_COLON} {TOPIC_TITLE}</th> </tr> <tr> <td class="row3" colspan="3" align="center"><span class="gensmall">{RETURN_TOPIC}</span></td> @@ -74,7 +74,7 @@ <td width="100%"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr valign="top"> - <td class="gensmall" nowrap="nowrap"> <b>{L_POST_SUBJECT}:</b> </td> + <td class="gensmall" nowrap="nowrap"> <b>{L_POST_SUBJECT}{L_COLON}</b> </td> <td class="gensmall" width="100%">{postrow.POST_SUBJECT}</td> </tr> </table> @@ -94,7 +94,7 @@ <table class="tablebg" width="100%" cellspacing="1"> <tr> - <td class="row3"><b class="genmed">{L_ATTACHMENTS}: </b></td> + <td class="row3"><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td> </tr> <!-- BEGIN attachment --> <tr> @@ -115,7 +115,7 @@ <!-- IF postrow.S_POST_REPORTED and postrow.U_MCP_REPORT --><span class="postreported">{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}">{L_POST_REPORTED}</a></span><!-- ENDIF --> </td> <td width="10" nowrap="nowrap">{postrow.MINI_POST_IMG}</td> - <td class="gensmall" nowrap="nowrap"><b>{L_POSTED}:</b> {postrow.POST_DATE}</td> + <td class="gensmall" nowrap="nowrap"><b>{L_POSTED}{L_COLON}</b> {postrow.POST_DATE}</td> </tr> </table> </td> diff --git a/phpBB/styles/subsilver2/template/mcp_warn_front.html b/phpBB/styles/subsilver2/template/mcp_warn_front.html index 020a79f419..f6daec9cc5 100644 --- a/phpBB/styles/subsilver2/template/mcp_warn_front.html +++ b/phpBB/styles/subsilver2/template/mcp_warn_front.html @@ -7,7 +7,7 @@ <th colspan="2"align="center">{L_SELECT_USER}</th> </tr> <tr> - <td class="row1" width="40%"><b class="gen">{L_FIND_USERNAME}: </b><br /><span class="gensmall">[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span></td> + <td class="row1" width="40%"><b class="gen">{L_FIND_USERNAME}{L_COLON} </b><br /><span class="gensmall">[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span></td> <td class="row2"><input type="text" class="post" name="username" size="20" /></td> </tr> <tr> diff --git a/phpBB/styles/subsilver2/template/mcp_warn_list.html b/phpBB/styles/subsilver2/template/mcp_warn_list.html index 0b0cfa8a45..6e263b6403 100644 --- a/phpBB/styles/subsilver2/template/mcp_warn_list.html +++ b/phpBB/styles/subsilver2/template/mcp_warn_list.html @@ -25,7 +25,7 @@ </tr> <!-- END user --> <tr align="center"> - <td class="row3" colspan="4"><span class="gensmall">{L_DISPLAY_POSTS}:</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td> + <td class="row3" colspan="4"><span class="gensmall">{L_DISPLAY_POSTS}{L_COLON}</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td> </tr> </table> diff --git a/phpBB/styles/subsilver2/template/mcp_warn_user.html b/phpBB/styles/subsilver2/template/mcp_warn_user.html index c8856045b5..6b78c71557 100644 --- a/phpBB/styles/subsilver2/template/mcp_warn_user.html +++ b/phpBB/styles/subsilver2/template/mcp_warn_user.html @@ -28,15 +28,15 @@ <td class="row1"> <table width="100%" cellspacing="1" cellpadding="2" border="0"> <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_JOINED}: </td> + <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_JOINED}{L_COLON} </td> <td width="100%"><b class="gen">{JOINED}</b></td> </tr> <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_TOTAL_POSTS}: </td> + <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_TOTAL_POSTS}{L_COLON} </td> <td><b class="gen">{POSTS}</b></td> </tr> <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_WARNINGS}: </td> + <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_WARNINGS}{L_COLON} </td> <td><b class="gen">{WARNINGS}</b></td> </tr> </table> diff --git a/phpBB/styles/subsilver2/template/memberlist_body.html b/phpBB/styles/subsilver2/template/memberlist_body.html index 4c7af75ae5..09336fb8a3 100644 --- a/phpBB/styles/subsilver2/template/memberlist_body.html +++ b/phpBB/styles/subsilver2/template/memberlist_body.html @@ -14,7 +14,7 @@ <form method="post" name="charsearch" action="{S_MODE_ACTION}"> <table width="100%" cellspacing="1"> <tr> - <td align="{S_CONTENT_FLOW_BEGIN}"><span class="genmed">{L_USERNAME_BEGINS_WITH}: </span> + <td align="{S_CONTENT_FLOW_BEGIN}"><span class="genmed">{L_USERNAME_BEGINS_WITH}{L_COLON} </span> <select name="first_char" onchange="this.form.submit();"> <!-- BEGIN first_char --> <option value="{first_char.VALUE}"<!-- IF first_char.S_SELECTED --> selected="selected"<!-- ENDIF -->>{first_char.DESC}</option> @@ -91,7 +91,7 @@ <!-- END memberrow --> <tr> - <td class="cat" colspan="<!-- IF S_IN_SEARCH_POPUP -->9<!-- ELSE -->8<!-- ENDIF -->" align="center"><!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><input class="btnlite" type="submit" value="{L_SELECT_MARKED}" /><!-- ELSE --><span class="gensmall">{L_SELECT_SORT_METHOD}:</span> <select name="sk">{S_MODE_SELECT}</select> <span class="gensmall">{L_ORDER}</span> <select name="sd">{S_ORDER_SELECT}</select> <input type="submit" name="submit" value="{L_SUBMIT}" class="btnlite" /><!-- ENDIF --></td> + <td class="cat" colspan="<!-- IF S_IN_SEARCH_POPUP -->9<!-- ELSE -->8<!-- ENDIF -->" align="center"><!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><input class="btnlite" type="submit" value="{L_SELECT_MARKED}" /><!-- ELSE --><span class="gensmall">{L_SELECT_SORT_METHOD}{L_COLON}</span> <select name="sk">{S_MODE_SELECT}</select> <span class="gensmall">{L_ORDER}</span> <select name="sd">{S_ORDER_SELECT}</select> <input type="submit" name="submit" value="{L_SUBMIT}" class="btnlite" /><!-- ENDIF --></td> </tr> </table> {S_FORM_TOKEN} diff --git a/phpBB/styles/subsilver2/template/memberlist_group.html b/phpBB/styles/subsilver2/template/memberlist_group.html index f48b9811f0..4140c8cdbf 100644 --- a/phpBB/styles/subsilver2/template/memberlist_group.html +++ b/phpBB/styles/subsilver2/template/memberlist_group.html @@ -4,14 +4,14 @@ <th colspan="3">{L_GROUP_INFORMATION}</th> </tr> <tr> - <td class="row1" width="20%"><b class="genmed">{L_GROUP_NAME}:</b></td> + <td class="row1" width="20%"><b class="genmed">{L_GROUP_NAME}{L_COLON}</b></td> <td class="row2"><b class="gen"<!-- IF GROUP_COLOR --> style="color:#{GROUP_COLOR}"<!-- ENDIF -->>{GROUP_NAME}</b></td> <!-- IF AVATAR_IMG or RANK_IMG or GROUP_RANK or U_PM --> <td class="row1" width="33%" rowspan="2" align="center"><!-- IF AVATAR_IMG -->{AVATAR_IMG}<br /><!-- ENDIF --><!-- IF RANK_IMG -->{RANK_IMG}<!-- ENDIF --><!-- IF GROUP_RANK --><span class="gensmall">{GROUP_RANK}</span><br /><br /><!-- ENDIF --><!-- IF U_PM --><a href="{U_PM}" class="imageset">{PM_IMG}</a><!-- ENDIF --></td> <!-- ENDIF --> </tr> <tr> - <td class="row1" width="20%"><b class="genmed">{L_GROUP_DESC}:</b></td> + <td class="row1" width="20%"><b class="genmed">{L_GROUP_DESC}{L_COLON}</b></td> <td class="row2"><span class="gen">{GROUP_DESC}</span><p class="forumdesc">{GROUP_TYPE}</p></td> </tr> </table> diff --git a/phpBB/styles/subsilver2/template/memberlist_im.html b/phpBB/styles/subsilver2/template/memberlist_im.html index 329c323ffa..da1ad661c3 100644 --- a/phpBB/styles/subsilver2/template/memberlist_im.html +++ b/phpBB/styles/subsilver2/template/memberlist_im.html @@ -13,7 +13,7 @@ <td class="row3" colspan="2"><span class="gensmall">{L_SEND_IM_EXPLAIN}</span></td> </tr> <tr> - <td class="row1"><b class="genmed">{L_IM_RECIPIENT}: </b></td> + <td class="row1"><b class="genmed">{L_IM_RECIPIENT}{L_COLON} </b></td> <td class="row2"><span class="gen"><b>{USERNAME}</b><!-- IF S_SEND_ICQ or S_SEND_AIM or S_SEND_MSNM or S_NO_SEND_JABBER --> [ {IM_CONTACT} ]<!-- ENDIF --></span> <!-- IF PRESENCE_IMG -->{PRESENCE_IMG}<!-- ENDIF --></td> </tr> @@ -107,7 +107,7 @@ <!-- IF S_SEND_JABBER --> <tr> - <td class="row1"><b class="genmed">{L_IM_MESSAGE}: </b></td> + <td class="row1"><b class="genmed">{L_IM_MESSAGE}{L_COLON} </b></td> <td class="row2"><textarea class="post" name="message" rows="5" cols="45"></textarea></td> </tr> <tr> diff --git a/phpBB/styles/subsilver2/template/memberlist_search.html b/phpBB/styles/subsilver2/template/memberlist_search.html index 96ffad00d6..c0434d8110 100644 --- a/phpBB/styles/subsilver2/template/memberlist_search.html +++ b/phpBB/styles/subsilver2/template/memberlist_search.html @@ -43,11 +43,7 @@ */ function marklist(id, name, state) { - var parent = document.getElementById(id); - if (!parent) - { - eval('parent = document.' + id); - } + var parent = document.getElementById(id) || document[id]; if (!parent) { @@ -78,58 +74,58 @@ <td class="row3" colspan="4"><span class="gensmall">{L_FIND_USERNAME_EXPLAIN}</span></td> </tr> <tr> - <td class="row1"><b class="genmed">{L_USERNAME}:</b></td> + <td class="row1"><b class="genmed">{L_USERNAME}{L_COLON}</b></td> <td class="row2"><input class="post" type="text" name="username" value="{USERNAME}" /></td> - <td class="row1"><b class="genmed">{L_ICQ}:</b></td> + <td class="row1"><b class="genmed">{L_ICQ}{L_COLON}</b></td> <td class="row2"><input class="post" type="text" name="icq" value="{ICQ}" /></td> </tr> <tr> <!-- IF S_EMAIL_SEARCH_ALLOWED --> - <td class="row1"><b class="genmed">{L_EMAIL}:</b></td> + <td class="row1"><b class="genmed">{L_EMAIL}{L_COLON}</b></td> <td class="row2"><input class="post" type="text" name="email" value="{EMAIL}" /></td> <!-- ELSE --> <td colspan="2" class="row1"> </td> <!-- ENDIF --> - <td class="row1"><b class="genmed">{L_AIM}:</b></td> + <td class="row1"><b class="genmed">{L_AIM}{L_COLON}</b></td> <td class="row2"><input class="post" type="text" name="aim" value="{AIM}" /></td> </tr> <tr> - <td class="row1"><b class="genmed">{L_JOINED}:</b></td> + <td class="row1"><b class="genmed">{L_JOINED}{L_COLON}</b></td> <td class="row2"><select name="joined_select">{S_JOINED_TIME_OPTIONS}</select> <input class="post" type="text" name="joined" value="{JOINED}" /></td> - <td class="row1"><b class="genmed">{L_YIM}:</b></td> + <td class="row1"><b class="genmed">{L_YIM}{L_COLON}</b></td> <td class="row2"><input class="post" type="text" name="yahoo" value="{YAHOO}" /></td> </tr> <tr> <!-- IF S_VIEWONLINE --> - <td class="row1"><b class="genmed">{L_LAST_ACTIVE}:</b></td> + <td class="row1"><b class="genmed">{L_LAST_ACTIVE}{L_COLON}</b></td> <td class="row2"><select name="active_select">{S_ACTIVE_TIME_OPTIONS}</select> <input class="post" type="text" name="active" value="{ACTIVE}" /></td> <!-- ELSE --> <td colspan="2" class="row1"> </td> <!-- ENDIF --> - <td class="row1"><b class="genmed">{L_MSNM}:</b></td> + <td class="row1"><b class="genmed">{L_MSNM}{L_COLON}</b></td> <td class="row2"><input class="post" type="text" name="msn" value="{MSNM}" /></td> </tr> <tr> - <td class="row1"><b class="genmed">{L_POSTS}:</b></td> + <td class="row1"><b class="genmed">{L_POSTS}{L_COLON}</b></td> <td class="row2"><select name="count_select">{S_COUNT_OPTIONS}</select> <input class="post" type="text" name="count" value="{COUNT}" /></td> - <td class="row1"><b class="genmed">{L_JABBER}:</b></td> + <td class="row1"><b class="genmed">{L_JABBER}{L_COLON}</b></td> <td class="row2"><input class="post" type="text" name="jabber" value="{JABBER}" /></td> </tr> <tr> - <td class="row1"><b class="genmed">{L_SORT_BY}:</b></td> + <td class="row1"><b class="genmed">{L_SORT_BY}{L_COLON}</b></td> <td class="row2" nowrap="nowrap"><select name="sk">{S_SORT_OPTIONS}</select> <select name="sd">{S_ORDER_SELECT}</select> </td> <!-- IF S_IP_SEARCH_ALLOWED --> - <td class="row1"><b class="genmed">{L_POST_IP}:</b></td> + <td class="row1"><b class="genmed">{L_POST_IP}{L_COLON}</b></td> <td class="row2"><input class="post" type="text" name="ip" value="{IP}" /></td> </tr> <tr> - <td class="row1"><b class="genmed">{L_GROUP}:</b></td> + <td class="row1"><b class="genmed">{L_GROUP}{L_COLON}</b></td> <td class="row2" nowrap="nowrap"><select name="search_group_id">{S_GROUP_SELECT}</select></td> <td class="row1"> </td> <td class="row2"> </td> </tr> <!-- ELSE --> - <td class="row1"><b class="genmed">{L_GROUP}:</b></td> + <td class="row1"><b class="genmed">{L_GROUP}{L_COLON}</b></td> <td class="row2" nowrap="nowrap"><select name="search_group_id">{S_GROUP_SELECT}</select></td> </tr> <!-- ENDIF --> diff --git a/phpBB/styles/subsilver2/template/memberlist_view.html b/phpBB/styles/subsilver2/template/memberlist_view.html index 5d866214ce..464369a7a8 100644 --- a/phpBB/styles/subsilver2/template/memberlist_view.html +++ b/phpBB/styles/subsilver2/template/memberlist_view.html @@ -18,7 +18,7 @@ <table cellspacing="1" cellpadding="2" border="0"> <!-- IF S_USER_INACTIVE --> <tr> - <td align="center" style="color: red;"><b class="gen">{L_USER_IS_INACTIVE}</b><br />{L_INACTIVE_REASON}: {USER_INACTIVE_REASON}<br /><br /></td> + <td align="center" style="color: red;"><b class="gen">{L_USER_IS_INACTIVE}</b><br />{L_INACTIVE_REASON}{L_COLON} {USER_INACTIVE_REASON}<br /><br /></td> </tr> <!-- ENDIF --> <tr> @@ -67,32 +67,32 @@ <td class="row1"> <table width="100%" cellspacing="1" cellpadding="2" border="0"> <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_JOINED}: </td> + <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_JOINED}{L_COLON} </td> <td width="100%"><b class="gen">{JOINED}</b></td> </tr> <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_VISITED}: </td> + <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_VISITED}{L_COLON} </td> <td width="100%"><b class="gen">{VISITED}</b></td> </tr> <!-- IF S_WARNINGS --> <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_WARNINGS}: </td> + <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_WARNINGS}{L_COLON} </td> <td width="100%"><b class="gen">{WARNINGS}</b><!-- IF U_NOTES or U_WARN --><br /><span class="genmed"> [ <!-- IF U_NOTES --><a href="{U_NOTES}">{L_VIEW_NOTES}</a><!-- ENDIF --> <!-- IF U_WARN --><!-- IF U_NOTES --> | <!-- ENDIF --><a href="{U_WARN}">{L_WARN_USER}</a><!-- ENDIF --> ]</span><!-- ENDIF --></td> </tr> <!-- ENDIF --> <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_TOTAL_POSTS}: </td> + <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_TOTAL_POSTS}{L_COLON} </td> <td><b class="gen">{POSTS}</b><span class="genmed"><!-- IF POSTS_PCT --><br />[{POSTS_PCT} / {POSTS_DAY}]<!-- ENDIF --> <!-- IF POSTS_IN_QUEUE and U_MCP_QUEUE --><br />[<a href="{U_MCP_QUEUE}">{L_POSTS_IN_QUEUE}</a>]<!-- ELSEIF POSTS_IN_QUEUE --><br />[{L_POSTS_IN_QUEUE}]<!-- ENDIF --> <!-- IF S_DISPLAY_SEARCH --><br /><a href="{U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a><!-- ENDIF --></span></td> </tr> <!-- IF S_SHOW_ACTIVITY --> <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_ACTIVE_IN_FORUM}: </td> + <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_ACTIVE_IN_FORUM}{L_COLON} </td> <td><!-- IF ACTIVE_FORUM != '' --><b><a class="gen" href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></b><br /><span class="genmed">[ {ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT} ]</span><!-- ELSE --><span class="gen">-</span><!-- ENDIF --></td> </tr> <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_ACTIVE_IN_TOPIC}: </td> + <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_ACTIVE_IN_TOPIC}{L_COLON} </td> <td><!-- IF ACTIVE_TOPIC != '' --><b><a class="gen" href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></b><br /><span class="genmed">[ {ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT} ]</span><!-- ELSE --><span class="gen">-</span><!-- ENDIF --></td> </tr> <!-- ENDIF --> @@ -107,33 +107,33 @@ <td class="row1"> <table width="100%" cellspacing="1" cellpadding="2" border="0"> <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_EMAIL_ADDRESS}: </td> + <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_EMAIL_ADDRESS}{L_COLON} </td> <td width="100%"><!-- IF U_EMAIL --><a href="{U_EMAIL}" class="imageset">{EMAIL_IMG}</a><!-- ENDIF --></td> </tr> <!-- IF U_PM --> <tr> - <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_PM}: </td> + <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_PM}{L_COLON} </td> <td><a href="{U_PM}" class="imageset">{PM_IMG}</a></td> </tr> <!-- ENDIF --> <tr> - <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_MSNM}: </td> + <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_MSNM}{L_COLON} </td> <td><!-- IF U_MSN --><a href="{U_MSN}" onclick="popup(this.href, 550, 320); return false" class="imageset">{MSN_IMG}</a><!-- ELSEIF USER_MSN -->{USER_MSN}<!-- ENDIF --></td> </tr> <tr> - <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_YIM}: </td> + <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_YIM}{L_COLON} </td> <td><!-- IF U_YIM --><a href="{U_YIM}" onclick="popup(this.href, 780, 550); return false" class="imageset">{YIM_IMG}</a><!-- ELSEIF USER_YIM -->{USER_YIM}<!-- ENDIF --></td> </tr> <tr> - <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_AIM}: </td> + <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_AIM}{L_COLON} </td> <td><!-- IF U_AIM --><a href="{U_AIM}" onclick="popup(this.href, 550, 320); return false" class="imageset">{AIM_IMG}</a><!-- ELSEIF USER_AIM -->{USER_AIM}<!-- ENDIF --></td> </tr> <tr> - <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_ICQ}: </td> + <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_ICQ}{L_COLON} </td> <td><!-- IF U_ICQ --><a href="{U_ICQ}" onclick="popup(this.href, 550, 320); return false" class="imageset">{ICQ_IMG}</a><!-- ELSEIF USER_ICQ -->{USER_ICQ}<!-- ENDIF --></td> </tr> <tr> - <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_JABBER}: </td> + <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_JABBER}{L_COLON} </td> <td><!-- IF U_JABBER --><a href="{U_JABBER}" onclick="popup(this.href, 550, 320); return false" class="imageset">{JABBER_IMG}</a><!-- ELSEIF USER_JABBER -->{USER_JABBER_IMG}<!-- ENDIF --></td> </tr> </table> @@ -141,41 +141,41 @@ <td class="row1"> <table cellspacing="1" cellpadding="2" border="0"> <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_USERGROUPS}: </td> + <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_USERGROUPS}{L_COLON} </td> <td><select name="g">{S_GROUP_OPTIONS}</select> <input class="btnlite" type="submit" name="submit" value="{L_GO}" /></td> </tr> <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_LOCATION}: </td> + <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_LOCATION}{L_COLON} </td> <td><!-- IF LOCATION --><b class="genmed">{LOCATION}</b><!-- ENDIF --></td> </tr> <!-- IF AGE !== '' --> <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_AGE}: </td> + <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_AGE}{L_COLON} </td> <td><b class="genmed">{AGE}</b></td> </tr> <!-- ENDIF --> <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_OCCUPATION}: </td> + <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_OCCUPATION}{L_COLON} </td> <td><!-- IF OCCUPATION --><b class="genmed">{OCCUPATION}</b><!-- ENDIF --></td> </tr> <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_INTERESTS}: </td> + <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_INTERESTS}{L_COLON} </td> <td><!-- IF INTERESTS --><b class="genmed">{INTERESTS}</b><!-- ENDIF --></td> </tr> <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_WEBSITE}: </td> + <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_WEBSITE}{L_COLON} </td> <td><!-- IF U_WWW --><b><a class="genmed" href="{U_WWW}">{U_WWW}</a></b><!-- ENDIF --></td> </tr> <!-- IF S_PROFILE_FIELD1 --> <!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. --> <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{PROFILE_FIELD1_NAME}: </td> + <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{PROFILE_FIELD1_NAME}{L_COLON} </td> <td><b class="genmed">{PROFILE_FIELD1_VALUE}</b></td> </tr> <!-- ENDIF --> <!-- BEGIN custom_fields --> <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{custom_fields.PROFILE_FIELD_NAME}: </td> + <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{custom_fields.PROFILE_FIELD_NAME}{L_COLON} </td> <td><b class="genmed">{custom_fields.PROFILE_FIELD_VALUE}</b></td> </tr> <!-- END custom_fields --> diff --git a/phpBB/styles/subsilver2/template/overall_header.html b/phpBB/styles/subsilver2/template/overall_header.html index 5d5489338a..4ed69c56aa 100644 --- a/phpBB/styles/subsilver2/template/overall_header.html +++ b/phpBB/styles/subsilver2/template/overall_header.html @@ -39,7 +39,7 @@ function popup(url, width, height, name) function jumpto() { - var page = prompt('{LA_JUMP_PAGE}:', '{ON_PAGE}'); + var page = prompt('{LA_JUMP_PAGE}{L_COLON}', '{ON_PAGE}'); var per_page = '{PER_PAGE}'; var base_url = '{A_BASE_URL}'; @@ -71,11 +71,7 @@ function find_username(url) */ function marklist(id, name, state) { - var parent = document.getElementById(id); - if (!parent) - { - eval('parent = document.' + id); - } + var parent = document.getElementById(id) || document[id]; if (!parent) { @@ -83,7 +79,7 @@ function marklist(id, name, state) } var rb = parent.getElementsByTagName('input'); - + for (var r = 0; r < rb.length; r++) { if (rb[r].name.substr(0, name.length) == name) @@ -143,7 +139,7 @@ function marklist(id, name, state) <div id="logodesc"> <table width="100%" cellspacing="0"> <tr> - <td><a href="{U_INDEX}" class="imageset">{SITE_LOGO_IMG}</a></td> + <td><a href="<!-- IF U_SITE_HOME -->{U_SITE_HOME}<!-- ELSE -->{U_INDEX}<!-- ENDIF -->" class="imageset">{SITE_LOGO_IMG}</a></td> <td width="100%" align="center"><h1>{SITENAME}</h1><span class="gen">{SITE_DESCRIPTION}</span></td> </tr> </table> @@ -199,6 +195,8 @@ function marklist(id, name, state) <br style="clear: both;" /> + <!-- DEFINE $S_MICRODATA = 1 --> <!-- INCLUDE breadcrumbs.html --> + <!-- DEFINE $S_MICRODATA = 0 --> <br /> diff --git a/phpBB/styles/subsilver2/template/pagination.html b/phpBB/styles/subsilver2/template/pagination.html index a36eb88d8f..a2e023ac22 100644 --- a/phpBB/styles/subsilver2/template/pagination.html +++ b/phpBB/styles/subsilver2/template/pagination.html @@ -1 +1,11 @@ -<!-- IF PAGINATION --><b><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b><!-- ENDIF --> +<!-- IF .pagination --> + <b><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{L_GOTO_PAGE}</a> + <!-- BEGIN pagination --> + <!-- IF pagination.S_IS_PREV --><a href="{pagination.PAGE_URL}">{L_PREVIOUS}</a> + <!-- ELSEIF pagination.S_IS_CURRENT --><strong>{pagination.PAGE_NUMBER}</strong> + <!-- ELSEIF pagination.S_IS_ELLIPSIS --> {L_ELLIPSIS} + <!-- ELSEIF pagination.S_IS_NEXT --><a href="{pagination.PAGE_URL}">{L_NEXT}</a> + <!-- ELSE --><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a> + <!-- ENDIF --> + <!-- END pagination --> +<!-- ENDIF --> diff --git a/phpBB/styles/subsilver2/template/posting_body.html b/phpBB/styles/subsilver2/template/posting_body.html index ae7d2f88d6..4c9df6f060 100644 --- a/phpBB/styles/subsilver2/template/posting_body.html +++ b/phpBB/styles/subsilver2/template/posting_body.html @@ -23,7 +23,7 @@ <h2><!-- IF TOPIC_TITLE --><a class="titles" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><!-- ELSE --><a class="titles" href="{U_VIEW_FORUM}">{FORUM_NAME}</a><!-- ENDIF --></h2> <!-- IF MODERATORS --> - <p class="moderators">{L_MODERATORS}: {MODERATORS}</p> + <p class="moderators">{L_MODERATORS}{L_COLON} {MODERATORS}</p> <!-- ENDIF --> <!-- IF U_MCP --> <p class="linkmcp">[ <a href="{U_MCP}">{L_MCP}</a> ]</p> @@ -69,8 +69,8 @@ <td class="postdetails" style="padding: 4px;">{draftrow.DATE}</td> <td style="padding: 4px;"><b class="gen">{draftrow.DRAFT_SUBJECT}</b> - <!-- IF draftrow.S_LINK_TOPIC --><br /><span class="gensmall">{L_TOPIC}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span> - <!-- ELSEIF draftrow.S_LINK_FORUM --><br /><span class="gensmall">{L_FORUM}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span> + <!-- IF draftrow.S_LINK_TOPIC --><br /><span class="gensmall">{L_TOPIC}{L_COLON} <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span> + <!-- ELSEIF draftrow.S_LINK_FORUM --><br /><span class="gensmall">{L_FORUM}{L_COLON} <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span> <!-- ELSEIF draftrow.S_LINK_PM --><br /><span class="gensmall">{L_PRIVATE_MESSAGE}</span> <!-- ELSE --><br /><span class="gensmall">{L_NO_TOPIC_FORUM}</span><!-- ENDIF --> </td> @@ -116,14 +116,14 @@ <!-- IF S_DELETE_ALLOWED --> <tr> - <td class="row1"><b class="genmed">{L_DELETE_POST}:</b></td> + <td class="row1"><b class="genmed">{L_DELETE_POST}{L_COLON}</b></td> <td class="row2"><input type="checkbox" class="radio" name="delete" /> <span class="gensmall">[ {L_DELETE_POST_WARN} ]</span></td> </tr> <!-- ENDIF --> <!-- IF S_SHOW_TOPIC_ICONS or S_SHOW_PM_ICONS --> <tr> - <td class="row1"><b class="genmed">{L_ICON}:</b></td> + <td class="row1"><b class="genmed">{L_ICON}{L_COLON}</b></td> <td class="row2"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> @@ -136,14 +136,14 @@ <!-- IF not S_PRIVMSGS and S_DISPLAY_USERNAME --> <tr> - <td class="row1"><b class="genmed">{L_USERNAME}:</b></td> + <td class="row1"><b class="genmed">{L_USERNAME}{L_COLON}</b></td> <td class="row2"><input class="post" type="text" tabindex="1" name="username" size="25" value="{USERNAME}" /></td> </tr> <!-- ENDIF --> <!-- IF S_PRIVMSGS --> <tr> - <td class="row1"><b class="genmed">{L_TO}:</b></td> + <td class="row1"><b class="genmed">{L_TO}{L_COLON}</b></td> <td class="row2"> {S_HIDDEN_ADDRESS_FIELD} <!-- BEGIN to_recipient --> @@ -157,7 +157,7 @@ </tr> <!-- IF S_ALLOW_MASS_PM --> <tr> - <td class="row1"><b class="genmed">{L_BCC}:</b></td> + <td class="row1"><b class="genmed">{L_BCC}{L_COLON}</b></td> <td class="row2"> <!-- BEGIN bcc_recipient --> <span class="genmed nowrap"><strong> @@ -172,11 +172,11 @@ <!-- ENDIF --> <tr> - <td class="row1" width="22%"><b class="genmed">{L_SUBJECT}:</b></td> + <td class="row1" width="22%"><b class="genmed">{L_SUBJECT}{L_COLON}</b></td> <td class="row2" width="78%"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->120<!-- ELSE -->124<!-- ENDIF -->" tabindex="2" value="{SUBJECT}" /></td> </tr> <tr> - <td class="row1" valign="top"><b class="genmed">{L_MESSAGE_BODY}:</b><br /><span class="gensmall">{L_MESSAGE_BODY_EXPLAIN} </span><br /><br /> + <td class="row1" valign="top"><b class="genmed">{L_MESSAGE_BODY}{L_COLON}</b><br /><span class="gensmall">{L_MESSAGE_BODY_EXPLAIN} </span><br /><br /> <!-- IF S_SMILIES_ALLOWED --> <table width="100%" cellspacing="5" cellpadding="0" border="0" align="center"> <tr> @@ -227,14 +227,14 @@ <!-- IF S_INLINE_ATTACHMENT_OPTIONS --> <tr> - <td class="row1"><b class="genmed">{L_ATTACHMENTS}:</b></td> + <td class="row1"><b class="genmed">{L_ATTACHMENTS}{L_COLON}</b></td> <td class="row2"><select name="attachments">{S_INLINE_ATTACHMENT_OPTIONS}</select> <input type="button" class="btnbbcode" accesskey="a" value="{L_PLACE_INLINE}" name="attachinline" onclick="attach_form = document.forms[form_name].elements['attachments']; attach_inline(attach_form.value, attach_form.options[attach_form.selectedIndex].text);" onmouseover="helpline('a')" onmouseout="helpline('tip')" /> </td> </tr> <!-- ENDIF --> <tr> - <td class="row1" valign="top"><b class="genmed">{L_OPTIONS}:</b><br /> + <td class="row1" valign="top"><b class="genmed">{L_OPTIONS}{L_COLON}</b><br /> <table cellspacing="2" cellpadding="0" border="0"> <tr> <td class="gensmall">{BBCODE_STATUS}</td> @@ -310,7 +310,7 @@ <!-- IF S_TYPE_TOGGLE --> <tr> <td> </td> - <td class="gen"><!-- IF S_EDIT_POST -->{L_CHANGE_TOPIC_TO}<!-- ELSE -->{L_POST_TOPIC_AS}<!-- ENDIF -->: <!-- BEGIN topic_type --><input type="radio" class="radio" name="topic_type" value="{topic_type.VALUE}"{topic_type.S_CHECKED} />{topic_type.L_TOPIC_TYPE} <!-- END topic_type --></td> + <td class="gen"><!-- IF S_EDIT_POST -->{L_CHANGE_TOPIC_TO}<!-- ELSE -->{L_POST_TOPIC_AS}<!-- ENDIF -->{L_COLON} <!-- BEGIN topic_type --><input type="radio" class="radio" name="topic_type" value="{topic_type.VALUE}"{topic_type.S_CHECKED} />{topic_type.L_TOPIC_TYPE} <!-- END topic_type --></td> </tr> <!-- ENDIF --> <!-- ENDIF --> @@ -320,14 +320,14 @@ <!-- IF S_TOPIC_TYPE_ANNOUNCE or S_TOPIC_TYPE_STICKY --> <tr> - <td class="row1"><b class="genmed">{L_STICK_TOPIC_FOR}:</b><br /><span class="gensmall">{L_STICKY_ANNOUNCE_TIME_LIMIT}</span></td> + <td class="row1"><b class="genmed">{L_STICK_TOPIC_FOR}{L_COLON}</b><br /><span class="gensmall">{L_STICKY_ANNOUNCE_TIME_LIMIT}</span></td> <td class="row2"><input class="post" type="text" name="topic_time_limit" size="3" maxlength="3" value="{TOPIC_TIME_LIMIT}" /> <b class="gen">{L_DAYS}</b> <span class="gensmall">{L_STICK_TOPIC_FOR_EXPLAIN}</span></td> </tr> <!-- ENDIF --> <!-- IF S_EDIT_REASON --> <tr> - <td class="row1" valign="top"><b class="genmed">{L_EDIT_REASON}:</b></td> + <td class="row1" valign="top"><b class="genmed">{L_EDIT_REASON}{L_COLON}</b></td> <td class="row2"><input class="post" type="text" name="edit_reason" size="50" value="{EDIT_REASON}" /></td> </tr> <!-- ENDIF --> @@ -355,7 +355,7 @@ <!-- INCLUDE posting_poll_body.html --> <!-- ELSEIF S_POLL_DELETE --> <tr> - <td class="row1"><span class="genmed"><b>{L_POLL_DELETE}:</b></span></td> + <td class="row1"><span class="genmed"><b>{L_POLL_DELETE}{L_COLON}</b></span></td> <td class="row2"><input type="checkbox" class="radio" name="poll_delete" /></td> </tr> <!-- ENDIF --> diff --git a/phpBB/styles/subsilver2/template/posting_buttons.html b/phpBB/styles/subsilver2/template/posting_buttons.html index cfe69dee56..1a7093e1be 100644 --- a/phpBB/styles/subsilver2/template/posting_buttons.html +++ b/phpBB/styles/subsilver2/template/posting_buttons.html @@ -27,7 +27,7 @@ d: '{LA_BBCODE_D_HELP}', tip: '{L_STYLES_TIP}' <!-- BEGIN custom_tags --> - ,cb_{custom_tags.BBCODE_ID}: '{custom_tags.A_BBCODE_HELPLINE}' + ,cb_{custom_tags.BBCODE_ID}{L_COLON} '{custom_tags.A_BBCODE_HELPLINE}' <!-- END custom_tags --> } @@ -55,7 +55,7 @@ <!-- IF S_BBCODE_FLASH --> <input type="button" class="btnbbcode" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" onmouseover="helpline('d')" onmouseout="helpline('tip')" /> <!-- ENDIF --> - <span class="genmed nowrap">{L_FONT_SIZE}: <select class="gensmall" name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" onmouseover="helpline('f')" onmouseout="helpline('tip')"> + <span class="genmed nowrap">{L_FONT_SIZE}{L_COLON} <select class="gensmall" name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" onmouseover="helpline('f')" onmouseout="helpline('tip')"> <option value="50">{L_FONT_TINY}</option> <option value="85">{L_FONT_SMALL}</option> <option value="100" selected="selected">{L_FONT_NORMAL}</option> diff --git a/phpBB/styles/subsilver2/template/posting_poll_body.html b/phpBB/styles/subsilver2/template/posting_poll_body.html index 3a523182f7..c41741ac51 100644 --- a/phpBB/styles/subsilver2/template/posting_poll_body.html +++ b/phpBB/styles/subsilver2/template/posting_poll_body.html @@ -6,31 +6,31 @@ <td class="row3" colspan="2"><span class="gensmall">{L_ADD_POLL_EXPLAIN}</span></td> </tr> <tr> - <td class="row1"><b class="genmed">{L_POLL_QUESTION}:</b></td> + <td class="row1"><b class="genmed">{L_POLL_QUESTION}{L_COLON}</b></td> <td class="row2"><input class="post" type="text" name="poll_title" size="50" maxlength="255" value="{POLL_TITLE}" /></td> </tr> <tr> - <td class="row1"><b class="genmed">{L_POLL_OPTIONS}:</b><br /><span class="gensmall">{L_POLL_OPTIONS_EXPLAIN}</span></td> + <td class="row1"><b class="genmed">{L_POLL_OPTIONS}{L_COLON}</b><br /><span class="gensmall">{L_POLL_OPTIONS_EXPLAIN}</span></td> <td class="row2"><textarea style="width:450px" name="poll_option_text" rows="5" cols="35">{POLL_OPTIONS}</textarea></td> </tr> <tr> - <td class="row1"><b class="genmed">{L_POLL_MAX_OPTIONS}:</b><br /><span class="gensmall">{L_POLL_MAX_OPTIONS_EXPLAIN}</span></td> + <td class="row1"><b class="genmed">{L_POLL_MAX_OPTIONS}{L_COLON}</b><br /><span class="gensmall">{L_POLL_MAX_OPTIONS_EXPLAIN}</span></td> <td class="row2"><input class="post" type="text" name="poll_max_options" size="3" maxlength="3" value="{POLL_MAX_OPTIONS}" /></td> </tr> <tr> - <td class="row1"><b class="genmed">{L_POLL_FOR}:</b></td> + <td class="row1"><b class="genmed">{L_POLL_FOR}{L_COLON}</b></td> <td class="row2"><input class="post" type="text" name="poll_length" size="3" maxlength="3" value="{POLL_LENGTH}" /> <b class="gen">{L_DAYS}</b> <span class="gensmall">{L_POLL_FOR_EXPLAIN}</span></td> </tr> <!-- IF S_POLL_VOTE_CHANGE --> <tr> - <td class="row1"><b class="genmed">{L_POLL_VOTE_CHANGE}:</b><br /><span class="gensmall">{L_POLL_VOTE_CHANGE_EXPLAIN}</span></td> + <td class="row1"><b class="genmed">{L_POLL_VOTE_CHANGE}{L_COLON}</b><br /><span class="gensmall">{L_POLL_VOTE_CHANGE_EXPLAIN}</span></td> <td class="row2"><input type="checkbox" class="radio" name="poll_vote_change"{VOTE_CHANGE_CHECKED} /></td> </tr> <!-- ENDIF --> <!-- IF S_POLL_DELETE --> <tr> - <td class="row1"><b class="genmed">{L_POLL_DELETE}:</b></td> + <td class="row1"><b class="genmed">{L_POLL_DELETE}{L_COLON}</b></td> <td class="row2"><input type="checkbox" class="radio" name="poll_delete"<!-- IF S_POLL_DELETE_CHECKED --> checked="checked"<!-- ENDIF --> /></td> </tr> <!-- ENDIF --> diff --git a/phpBB/styles/subsilver2/template/posting_preview.html b/phpBB/styles/subsilver2/template/posting_preview.html index b990428f36..b0dbef6a5a 100644 --- a/phpBB/styles/subsilver2/template/posting_preview.html +++ b/phpBB/styles/subsilver2/template/posting_preview.html @@ -4,7 +4,7 @@ <th>{L_PREVIEW}</th> </tr> <tr> - <td class="row1">{MINI_POST_IMG}<span class="postdetails">{L_POSTED}: {POST_DATE} {L_POST_SUBJECT}: {PREVIEW_SUBJECT}</span></td> + <td class="row1">{MINI_POST_IMG}<span class="postdetails">{L_POSTED}{L_COLON} {POST_DATE} {L_POST_SUBJECT}{L_COLON} {PREVIEW_SUBJECT}</span></td> </tr> <!-- IF S_HAS_POLL_OPTIONS --> <tr> @@ -48,7 +48,7 @@ <table class="tablebg" width="100%" cellspacing="1"> <tr> - <td class="row3"><b class="genmed">{L_ATTACHMENTS}: </b></td> + <td class="row3"><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td> </tr> <!-- BEGIN attachment --> <tr> diff --git a/phpBB/styles/subsilver2/template/posting_review.html b/phpBB/styles/subsilver2/template/posting_review.html index 87266da44c..baf159aecd 100644 --- a/phpBB/styles/subsilver2/template/posting_review.html +++ b/phpBB/styles/subsilver2/template/posting_review.html @@ -34,7 +34,7 @@ <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> <td> </td> - <td class="gensmall" valign="middle" nowrap="nowrap"><b>{L_POST_SUBJECT}:</b> </td> + <td class="gensmall" valign="middle" nowrap="nowrap"><b>{L_POST_SUBJECT}{L_COLON}</b> </td> <td class="gensmall" width="100%" valign="middle">{post_review_row.POST_SUBJECT}</td> <td> </td> </tr> @@ -57,7 +57,7 @@ <table class="tablebg" width="100%" cellspacing="1"> <tr> - <td class="row3"><b class="genmed">{L_ATTACHMENTS}: </b></td> + <td class="row3"><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td> </tr> <!-- BEGIN attachment --> <tr> @@ -78,7 +78,7 @@ <tr valign="middle"> <td width="100%"> </td> <td width="10" nowrap="nowrap"><!-- IF S_IS_BOT -->{post_review_row.MINI_POST_IMG}<!-- ELSE --><a href="{post_review_row.U_MINI_POST}" class="imageset">{post_review_row.MINI_POST_IMG}</a><!-- ENDIF --></td> - <td class="gensmall" nowrap="nowrap"><b>{L_POSTED}:</b> {post_review_row.POST_DATE}</td> + <td class="gensmall" nowrap="nowrap"><b>{L_POSTED}{L_COLON}</b> {post_review_row.POST_DATE}</td> </tr> </table> </td> diff --git a/phpBB/styles/subsilver2/template/posting_smilies.html b/phpBB/styles/subsilver2/template/posting_smilies.html index 691ba239b2..30a80e26ab 100644 --- a/phpBB/styles/subsilver2/template/posting_smilies.html +++ b/phpBB/styles/subsilver2/template/posting_smilies.html @@ -16,7 +16,20 @@ <th>{L_SMILIES}</th> </tr> <tr> - <td class="row1" align="center" valign="middle"><!-- BEGIN smiley --> <a href="#" onclick="initInsertions(); insert_text('{smiley.A_SMILEY_CODE}', true, true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" hspace="2" vspace="2" /></a> <!-- END smiley --><br />{PAGINATION}<br /><a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></td> + <td class="row1" align="center" valign="middle"><!-- BEGIN smiley --> <a href="#" onclick="initInsertions(); insert_text('{smiley.A_SMILEY_CODE}', true, true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" hspace="2" vspace="2" /></a> <!-- END smiley --><br /> + <!-- IF .pagination --> + <b><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{L_GOTO_PAGE}</a> + <!-- BEGIN pagination --> + <!-- IF pagination.S_IS_PREV --><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a> + <!-- ELSEIF pagination.S_IS_CURRENT --><strong>{pagination.PAGE_NUMBER}</strong> + <!-- ELSEIF pagination.S_IS_ELLIPSIS --> {L_ELLIPSIS} + <!-- ELSEIF pagination.S_IS_NEXT --><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a> + <!-- ELSE --><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a> + <!-- ENDIF --> + <!-- END pagination --> + <br /> + <!-- ENDIF --> + <a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></td> </tr> </table> </td> diff --git a/phpBB/styles/subsilver2/template/posting_topic_review.html b/phpBB/styles/subsilver2/template/posting_topic_review.html index cbd6746a8a..23ea56a216 100644 --- a/phpBB/styles/subsilver2/template/posting_topic_review.html +++ b/phpBB/styles/subsilver2/template/posting_topic_review.html @@ -34,7 +34,7 @@ <table width="100%" cellspacing="0"> <tr> <td> </td> - <td class="gensmall" valign="middle" nowrap="nowrap"><b>{L_POST_SUBJECT}:</b> </td> + <td class="gensmall" valign="middle" nowrap="nowrap"><b>{L_POST_SUBJECT}{L_COLON}</b> </td> <td class="gensmall" width="100%" valign="middle">{topic_review_row.POST_SUBJECT}</td> <td valign="top" nowrap="nowrap"> <!-- IF topic_review_row.POSTER_QUOTE and topic_review_row.DECODED_MESSAGE --><a href="#" onclick="addquote({topic_review_row.POST_ID},'{topic_review_row.POSTER_QUOTE}', '{LA_WROTE}'); return false;" class="imageset">{QUOTE_IMG}</a><!-- ENDIF --></td> </tr> @@ -65,7 +65,7 @@ <table class="tablebg" width="100%" cellspacing="1"> <tr> - <td class="row3"><b class="genmed">{L_ATTACHMENTS}: </b></td> + <td class="row3"><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td> </tr> <!-- BEGIN attachment --> <tr> @@ -89,7 +89,7 @@ <tr valign="middle"> <td width="100%" align="{S_CONTENT_FLOW_BEGIN}"><span class="gensmall"><!-- IF topic_review_row.U_MCP_DETAILS -->[ <a href="{topic_review_row.U_MCP_DETAILS}">{L_POST_DETAILS}</a> ]<!-- ENDIF --></span></td> <td width="10" nowrap="nowrap"><!-- IF S_IS_BOT -->{topic_review_row.MINI_POST_IMG}<!-- ELSE --><a href="{topic_review_row.U_MINI_POST}" class="imageset">{topic_review_row.MINI_POST_IMG}</a><!-- ENDIF --></td> - <td class="gensmall" nowrap="nowrap"><b>{L_POSTED}:</b> {topic_review_row.POST_DATE}</td> + <td class="gensmall" nowrap="nowrap"><b>{L_POSTED}{L_COLON}</b> {topic_review_row.POST_DATE}</td> </tr> </table> </td> diff --git a/phpBB/styles/subsilver2/template/quickreply_editor.html b/phpBB/styles/subsilver2/template/quickreply_editor.html index 7a68a8f605..72dc5506bf 100644 --- a/phpBB/styles/subsilver2/template/quickreply_editor.html +++ b/phpBB/styles/subsilver2/template/quickreply_editor.html @@ -5,11 +5,11 @@ <th align="center" colspan="2">{L_QUICKREPLY}</th> </tr> <tr> - <td class="row1" width="22%"><b class="genmed">{L_SUBJECT}:</b></td> + <td class="row1" width="22%"><b class="genmed">{L_SUBJECT}{L_COLON}</b></td> <td class="row2" width="78%"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="124" tabindex="2" value="{SUBJECT}" /></td> </tr> <tr> - <td class="row1" width="22%"><b class="genmed">{L_MESSAGE}:</b></td> + <td class="row1" width="22%"><b class="genmed">{L_MESSAGE}{L_COLON}</b></td> <td class="row2" valign="top" align="left" width="78%"><textarea name="message" rows="7" cols="76" tabindex="3" style="width: 700px; height: 130px; min-width: 98%; max-width: 98%;"></textarea> </td> </tr> <tr> diff --git a/phpBB/styles/subsilver2/template/report_body.html b/phpBB/styles/subsilver2/template/report_body.html index bb963865e5..9ed510bb9f 100644 --- a/phpBB/styles/subsilver2/template/report_body.html +++ b/phpBB/styles/subsilver2/template/report_body.html @@ -10,19 +10,19 @@ <td class="row3" colspan="2"><span class="gensmall"><!-- IF S_REPORT_POST -->{L_REPORT_POST_EXPLAIN}<!-- ELSE -->{L_REPORT_MESSAGE_EXPLAIN}<!-- ENDIF --></span></td> </tr> <tr> - <td class="row1" width="22%"><b class="gen">{L_REASON}:</b></td> + <td class="row1" width="22%"><b class="gen">{L_REASON}{L_COLON}</b></td> <td class="row2" width="78%"><select name="reason_id"> <!-- BEGIN reason --><option value="{reason.ID}"<!-- IF reason.S_SELECTED --> selected="selected"<!-- ENDIF -->>{reason.TITLE} » {reason.DESCRIPTION}</option><!-- END reason --> </select></td> </tr> <!-- IF S_CAN_NOTIFY --> <tr> - <td class="row1"><span class="gen"><b>{L_REPORT_NOTIFY}:</b></span><br /><span class="gensmall">{L_REPORT_NOTIFY_EXPLAIN}</span></td> + <td class="row1"><span class="gen"><b>{L_REPORT_NOTIFY}{L_COLON}</b></span><br /><span class="gensmall">{L_REPORT_NOTIFY_EXPLAIN}</span></td> <td class="row2"><span class="gen"><input type="radio" class="radio" name="notify" value="1"<!-- IF S_NOTIFY --> checked="checked"<!-- ENDIF --> /> {L_YES} <input type="radio" class="radio" name="notify" value="0"<!-- IF not S_NOTIFY --> checked="checked"<!-- ENDIF --> /> {L_NO}</span></td> </tr> <!-- ENDIF --> <tr> - <td class="row1" valign="top"><span class="gen"><b>{L_MORE_INFO}:</b></span><br /><span class="gensmall">{L_CAN_LEAVE_BLANK}</span></td> + <td class="row1" valign="top"><span class="gen"><b>{L_MORE_INFO}{L_COLON}</b></span><br /><span class="gensmall">{L_CAN_LEAVE_BLANK}</span></td> <td class="row2"><textarea class="post" name="report_text" rows="10" cols="50">{REPORT_TEXT}</textarea></td> </tr> <tr> diff --git a/phpBB/styles/subsilver2/template/search_body.html b/phpBB/styles/subsilver2/template/search_body.html index 763a229c83..c0199fbae8 100644 --- a/phpBB/styles/subsilver2/template/search_body.html +++ b/phpBB/styles/subsilver2/template/search_body.html @@ -9,36 +9,36 @@ <th colspan="4">{L_SEARCH_QUERY}</th> </tr> <tr> - <td class="row1" colspan="2" width="50%"><b class="genmed">{L_SEARCH_KEYWORDS}: </b><br /><span class="gensmall">{L_SEARCH_KEYWORDS_EXPLAIN}</span></td> + <td class="row1" colspan="2" width="50%"><b class="genmed">{L_SEARCH_KEYWORDS}{L_COLON} </b><br /><span class="gensmall">{L_SEARCH_KEYWORDS_EXPLAIN}</span></td> <td class="row2" colspan="2" valign="top"><input type="text" style="width: 300px" class="post" name="keywords" size="30" /><br /><input type="radio" class="radio" name="terms" value="all" checked="checked" /> <span class="genmed">{L_SEARCH_ALL_TERMS}</span><br /><input type="radio" class="radio" name="terms" value="any" /> <span class="genmed">{L_SEARCH_ANY_TERMS}</span></td> </tr> <tr> - <td class="row1" colspan="2"><b class="genmed">{L_SEARCH_AUTHOR}:</b><br /><span class="gensmall">{L_SEARCH_AUTHOR_EXPLAIN}</span></td> + <td class="row1" colspan="2"><b class="genmed">{L_SEARCH_AUTHOR}{L_COLON}</b><br /><span class="gensmall">{L_SEARCH_AUTHOR_EXPLAIN}</span></td> <td class="row2" colspan="2" valign="middle"><input type="text" style="width: 300px" class="post" name="author" size="30" /></td> </tr> <tr> - <td class="row1" colspan="2"><b class="genmed">{L_SEARCH_FORUMS}: </b><br /><span class="gensmall">{L_SEARCH_FORUMS_EXPLAIN}</span></td> + <td class="row1" colspan="2"><b class="genmed">{L_SEARCH_FORUMS}{L_COLON} </b><br /><span class="gensmall">{L_SEARCH_FORUMS_EXPLAIN}</span></td> <td class="row2" colspan="2"><select name="fid[]" multiple="multiple" size="5">{S_FORUM_OPTIONS}</select></td> </tr> <tr> <th colspan="4">{L_SEARCH_OPTIONS}</th> </tr> <tr> - <td class="row1" width="25%" nowrap="nowrap"><b class="genmed">{L_SEARCH_SUBFORUMS}: </b></td> + <td class="row1" width="25%" nowrap="nowrap"><b class="genmed">{L_SEARCH_SUBFORUMS}{L_COLON} </b></td> <td class="row2" width="25%" nowrap="nowrap"><input type="radio" class="radio" name="sc" value="1" checked="checked" /> <span class="genmed">{L_YES}</span> <input type="radio" class="radio" name="sc" value="0" /> <span class="genmed">{L_NO}</span></td> - <td class="row1" width="25%" nowrap="nowrap"><b class="genmed">{L_SEARCH_WITHIN}: </b></td> + <td class="row1" width="25%" nowrap="nowrap"><b class="genmed">{L_SEARCH_WITHIN}{L_COLON} </b></td> <td class="row2" width="25%" nowrap="nowrap"><input type="radio" class="radio" name="sf" value="all" checked="checked" /> <span class="genmed">{L_SEARCH_TITLE_MSG}</span><br /><input type="radio" class="radio" name="sf" value="msgonly" /> <span class="genmed">{L_SEARCH_MSG_ONLY}</span> <br /><input type="radio" class="radio" name="sf" value="titleonly" /> <span class="genmed">{L_SEARCH_TITLE_ONLY}</span> <br /><input type="radio" class="radio" name="sf" value="firstpost" /> <span class="genmed">{L_SEARCH_FIRST_POST}</span></td> </tr> <tr> - <td class="row1"><b class="genmed">{L_RESULT_SORT}: </b></td> + <td class="row1"><b class="genmed">{L_RESULT_SORT}{L_COLON} </b></td> <td class="row2" nowrap="nowrap">{S_SELECT_SORT_KEY}<br /><input type="radio" class="radio" name="sd" value="a" /> <span class="genmed">{L_SORT_ASCENDING}</span><br /><input type="radio" class="radio" name="sd" value="d" checked="checked" /> <span class="genmed">{L_SORT_DESCENDING}</span></td> - <td class="row1" nowrap="nowrap"><b class="genmed">{L_DISPLAY_RESULTS}: </b></td> + <td class="row1" nowrap="nowrap"><b class="genmed">{L_DISPLAY_RESULTS}{L_COLON} </b></td> <td class="row2" nowrap="nowrap"><input type="radio" class="radio" name="sr" value="posts" checked="checked" /> <span class="genmed">{L_POSTS}</span> <input type="radio" class="radio" name="sr" value="topics" /> <span class="genmed">{L_TOPICS}</span></td> </tr> <tr> - <td class="row1" width="25%"><b class="genmed">{L_RESULT_DAYS}: </b></td> + <td class="row1" width="25%"><b class="genmed">{L_RESULT_DAYS}{L_COLON} </b></td> <td class="row2" width="25%" nowrap="nowrap">{S_SELECT_SORT_DAYS}</td> - <td class="row1" nowrap="nowrap"><b class="genmed">{L_RETURN_FIRST}: </b></td> + <td class="row1" nowrap="nowrap"><b class="genmed">{L_RETURN_FIRST}{L_COLON} </b></td> <td class="row2" nowrap="nowrap"><select name="ch">{S_CHARACTER_OPTIONS}</select> <span class="genmed">{L_POST_CHARACTERS}</span></td> </tr> <tr> diff --git a/phpBB/styles/subsilver2/template/search_results.html b/phpBB/styles/subsilver2/template/search_results.html index d8a1879ca7..8ced5a5301 100644 --- a/phpBB/styles/subsilver2/template/search_results.html +++ b/phpBB/styles/subsilver2/template/search_results.html @@ -7,8 +7,8 @@ <td colspan="2"><span class="titles"><!-- IF SEARCH_TITLE -->{SEARCH_TITLE}<!-- ELSE -->{SEARCH_MATCHES}<!-- ENDIF --></span><br /></td> </tr> <tr> - <td class="genmed"><!-- IF SEARCH_TOPIC -->{L_SEARCHED_TOPIC}: <a href="{U_SEARCH_TOPIC}"><b>{SEARCH_TOPIC}</b></a><br /><!-- ENDIF --><!-- IF SEARCH_WORDS -->{L_SEARCHED_FOR}: <a href="{U_SEARCH_WORDS}"><b>{SEARCH_WORDS}</b></a><!-- ENDIF --><!-- IF IGNORED_WORDS --> {L_IGNORED_TERMS}: <b>{IGNORED_WORDS}</b><!-- ENDIF --></td> - <td align="{S_CONTENT_FLOW_END}"><!-- IF SEARCH_IN_RESULTS --><span class="genmed">{L_SEARCH_IN_RESULTS}: </span><input class="post" type="text" name="add_keywords" value="" /> <input class="btnlite" type="submit" name="submit" value="{L_GO}" /><!-- ENDIF --></td> + <td class="genmed"><!-- IF SEARCH_TOPIC -->{L_SEARCHED_TOPIC}{L_COLON} <a href="{U_SEARCH_TOPIC}"><b>{SEARCH_TOPIC}</b></a><br /><!-- ENDIF --><!-- IF SEARCH_WORDS -->{L_SEARCHED_FOR}{L_COLON} <a href="{U_SEARCH_WORDS}"><b>{SEARCH_WORDS}</b></a><!-- ENDIF --><!-- IF IGNORED_WORDS --> {L_IGNORED_TERMS}{L_COLON} <b>{IGNORED_WORDS}</b><!-- ENDIF --></td> + <td align="{S_CONTENT_FLOW_END}"><!-- IF SEARCH_IN_RESULTS --><span class="genmed">{L_SEARCH_IN_RESULTS}{L_COLON} </span><input class="post" type="text" name="add_keywords" value="" /> <input class="btnlite" type="submit" name="submit" value="{L_GO}" /><!-- ENDIF --></td> </tr> </table> @@ -42,8 +42,17 @@ <!-- IF searchresults.S_TOPIC_REPORTED --> <a href="{searchresults.U_MCP_REPORT}" class="imageset">{REPORTED_IMG}</a> <!-- ENDIF --> - <!-- IF searchresults.PAGINATION --> - <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {searchresults.PAGINATION} ] </p> + <!-- IF .searchresults.pagination --> + <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}{L_COLON} + <!-- BEGIN pagination --> + <!-- IF searchresults.pagination.S_IS_PREV --> + <!-- ELSEIF searchresults.pagination.S_IS_CURRENT --><strong>{searchresults.pagination.PAGE_NUMBER}</strong> + <!-- ELSEIF searchresults.pagination.S_IS_ELLIPSIS --> {L_ELLIPSIS} + <!-- ELSEIF searchresults.pagination.S_IS_NEXT --> + <!-- ELSE --><a href="{searchresults.pagination.PAGE_URL}">{searchresults.pagination.PAGE_NUMBER}</a> + <!-- ENDIF --> + <!-- END pagination --> + ] </p> <!-- ENDIF --> <p class="gensmall">{L_IN} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a></p> </td> @@ -63,7 +72,7 @@ </tr> <!-- END searchresults --> <tr> - <td class="cat" colspan="7" valign="middle" align="center"><!-- IF S_SELECT_SORT_DAYS or S_SELECT_SORT_KEY --><span class="gensmall">{L_DISPLAY_POSTS}:</span> {S_SELECT_SORT_DAYS}<!-- IF S_SELECT_SORT_KEY --> <span class="gensmall">{L_SORT_BY}:</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}<!-- ENDIF --> <input class="btnlite" type="submit" value="{L_GO}" name="sort" /><!-- ENDIF --></td> + <td class="cat" colspan="7" valign="middle" align="center"><!-- IF S_SELECT_SORT_DAYS or S_SELECT_SORT_KEY --><span class="gensmall">{L_DISPLAY_POSTS}{L_COLON}</span> {S_SELECT_SORT_DAYS}<!-- IF S_SELECT_SORT_KEY --> <span class="gensmall">{L_SORT_BY}{L_COLON}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}<!-- ENDIF --> <input class="btnlite" type="submit" value="{L_GO}" name="sort" /><!-- ENDIF --></td> </tr> </table> @@ -80,7 +89,7 @@ <!-- IF searchresults.S_IGNORE_POST --> <td class="gensmall" colspan="2" height="25" align="center">{searchresults.L_IGNORE_POST}</td> <!-- ELSE --> - <td colspan="2" height="25"><p class="topictitle"><a name="p{searchresults.POST_ID}" id="p{searchresults.POST_ID}"></a> {L_FORUM}: <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a> {L_TOPIC}: <a href="{searchresults.U_VIEW_TOPIC}">{searchresults.TOPIC_TITLE}</a> </p></td> + <td colspan="2" height="25"><p class="topictitle"><a name="p{searchresults.POST_ID}" id="p{searchresults.POST_ID}"></a> {L_FORUM}{L_COLON} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a> {L_TOPIC}{L_COLON} <a href="{searchresults.U_VIEW_TOPIC}">{searchresults.TOPIC_TITLE}</a> </p></td> </tr> <tr class="row1"> <td width="150" align="center" valign="middle"><b class="postauthor">{searchresults.POST_AUTHOR_FULL}</b></td> @@ -90,19 +99,19 @@ <td class="gensmall"> <div style="float: {S_CONTENT_FLOW_BEGIN};"> <!-- IF searchresults.POST_SUBJECT neq "" --> - <b>{L_POST_SUBJECT}:</b> <a href="{searchresults.U_VIEW_POST}">{searchresults.POST_SUBJECT}</a> + <b>{L_POST_SUBJECT}{L_COLON}</b> <a href="{searchresults.U_VIEW_POST}">{searchresults.POST_SUBJECT}</a> <!-- ELSE --> [ <a href="{searchresults.U_VIEW_POST}">{L_JUMP_TO_POST}</a> ] <!-- ENDIF --> </div> - <div style="float: {S_CONTENT_FLOW_END};"><b>{L_POSTED}:</b> {searchresults.POST_DATE} </div> + <div style="float: {S_CONTENT_FLOW_END};"><b>{L_POSTED}{L_COLON}</b> {searchresults.POST_DATE} </div> </td> </tr> </table> </td> </tr> <tr class="row1"> - <td width="150" align="center" valign="top"><br /><span class="postdetails">{L_REPLIES}: <b>{searchresults.TOPIC_REPLIES}</b><br />{L_VIEWS}: <b>{searchresults.TOPIC_VIEWS}</b></span><br /><br /></td> + <td width="150" align="center" valign="top"><br /><span class="postdetails">{L_REPLIES}{L_COLON} <b>{searchresults.TOPIC_REPLIES}</b><br />{L_VIEWS}{L_COLON} <b>{searchresults.TOPIC_VIEWS}</b></span><br /><br /></td> <td valign="top"> <table width="100%" cellspacing="5"> <tr> @@ -121,7 +130,7 @@ </tr> <!-- END searchresults --> <tr> - <td class="cat" colspan="2" align="center"><!-- IF S_SELECT_SORT_KEY --><span class="gensmall">{L_SORT_BY}:</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" name="sort" value="{L_GO}" /><!-- ENDIF --></td> + <td class="cat" colspan="2" align="center"><!-- IF S_SELECT_SORT_KEY --><span class="gensmall">{L_SORT_BY}{L_COLON}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" name="sort" value="{L_GO}" /><!-- ENDIF --></td> </tr> </table> <!-- ENDIF --> diff --git a/phpBB/styles/subsilver2/template/searchbox.html b/phpBB/styles/subsilver2/template/searchbox.html index 622961c881..49de299ea2 100644 --- a/phpBB/styles/subsilver2/template/searchbox.html +++ b/phpBB/styles/subsilver2/template/searchbox.html @@ -1 +1 @@ -<form method="get" name="search" action="{S_SEARCHBOX_ACTION}"><span class="gensmall">{L_SEARCH_FOR}:</span> <input class="post" type="text" name="keywords" size="20" /> <input class="btnlite" type="submit" value="{L_GO}" />{S_SEARCH_LOCAL_HIDDEN_FIELDS}</form> +<form method="get" name="search" action="{S_SEARCHBOX_ACTION}"><span class="gensmall">{L_SEARCH_FOR}{L_COLON}</span> <input class="post" type="text" name="keywords" size="20" /> <input class="btnlite" type="submit" value="{L_GO}" />{S_SEARCH_LOCAL_HIDDEN_FIELDS}</form> diff --git a/phpBB/styles/subsilver2/template/simple_footer.html b/phpBB/styles/subsilver2/template/simple_footer.html index 6082b71891..38a86c5001 100644 --- a/phpBB/styles/subsilver2/template/simple_footer.html +++ b/phpBB/styles/subsilver2/template/simple_footer.html @@ -2,7 +2,7 @@ </div> <div id="wrapfooter"> - <span class="copyright">{CREDIT_LINE} + <span class="copyright">{CREDIT_LINE}</span> </div> <script type="text/javascript" src="{T_JQUERY_LINK}"></script> diff --git a/phpBB/styles/subsilver2/template/timezone.js b/phpBB/styles/subsilver2/template/timezone.js new file mode 100644 index 0000000000..da0a2b0bfd --- /dev/null +++ b/phpBB/styles/subsilver2/template/timezone.js @@ -0,0 +1,19 @@ +(function($) { // Avoid conflicts with other libraries + +$('#tz_date').change(function() { + phpbb.timezone_switch_date(false); +}); + +$('#tz_select_date_suggest').click(function(){ + phpbb.timezone_preselect_select(true); +}); + +$(document).ready( + phpbb.timezone_enable_date_selection +); + +$(document).ready( + phpbb.timezone_preselect_select($('#tz_select_date_suggest').attr('data-is-registration') == 'true') +); + +})(jQuery); // Avoid conflicts with other libraries diff --git a/phpBB/styles/subsilver2/template/timezone_option.html b/phpBB/styles/subsilver2/template/timezone_option.html new file mode 100644 index 0000000000..7fa310b1bc --- /dev/null +++ b/phpBB/styles/subsilver2/template/timezone_option.html @@ -0,0 +1,20 @@ +<tr> + <td class="row1" width="50%"><b class="genmed">{L_BOARD_TIMEZONE}{L_COLON}</b></td> + <td class="row2"> + <!-- IF S_TZ_DATE_OPTIONS --> + <div 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><br /> + <input type="button" id="tz_select_date_suggest" class="btnlite" style="display: none;" data-is-registration="<!-- IF S_REGISTRATION -->true<!-- ELSE -->false<!-- ENDIF -->" data-l-suggestion="{L_TIMEZONE_DATE_SUGGESTION}" value="{L_TIMEZONE_DATE_SUGGESTION}" /> + </div> + <!-- ENDIF --> + <select name="tz" id="timezone" class="autowidth tz_select"> + <option value="">{L_SELECT_TIMEZONE}</option> + {S_TZ_OPTIONS} + </select> + + <!-- INCLUDEJS template/timezone.js --> + </td> +</tr> diff --git a/phpBB/styles/subsilver2/template/ucp_agreement.html b/phpBB/styles/subsilver2/template/ucp_agreement.html index d5420f66a6..054d25282f 100644 --- a/phpBB/styles/subsilver2/template/ucp_agreement.html +++ b/phpBB/styles/subsilver2/template/ucp_agreement.html @@ -20,7 +20,7 @@ <form method="post" action="{S_UCP_ACTION}" id="register"> <table width="100%" cellspacing="0"> <tr> - <td class="gensmall" align="{S_CONTENT_FLOW_END}">{L_LANGUAGE}: <select name="lang" id="lang" onchange="change_language(this.value); return false;" title="{L_LANGUAGE}">{S_LANG_OPTIONS}</select></td> + <td class="gensmall" align="{S_CONTENT_FLOW_END}">{L_LANGUAGE}{L_COLON} <select name="lang" id="lang" onchange="change_language(this.value); return false;" title="{L_LANGUAGE}">{S_LANG_OPTIONS}</select></td> </tr> </table> {S_HIDDEN_FIELDS} diff --git a/phpBB/styles/subsilver2/template/ucp_attachments.html b/phpBB/styles/subsilver2/template/ucp_attachments.html index 63885f5da9..0f6101aac7 100644 --- a/phpBB/styles/subsilver2/template/ucp_attachments.html +++ b/phpBB/styles/subsilver2/template/ucp_attachments.html @@ -28,7 +28,7 @@ <!-- IF attachrow.S_ROW_COUNT is even --><tr class="row2"><!-- ELSE --><tr class="row1"><!-- ENDIF --> <td class="genmed" style="padding: 4px;" align="center" width="2%"> {attachrow.ROW_NUMBER} </td> - <td style="padding: 4px;"><a class="gen" href="{attachrow.U_VIEW_ATTACHMENT}">{attachrow.FILENAME}</a><br /><span class="gensmall"><!-- IF attachrow.S_IN_MESSAGE --><b>{L_PM}: </b><!-- ELSE --><b>{L_TOPIC}: </b><!-- ENDIF --><a href="{attachrow.U_VIEW_TOPIC}">{attachrow.TOPIC_TITLE}</a></span></td> + <td style="padding: 4px;"><a class="gen" href="{attachrow.U_VIEW_ATTACHMENT}">{attachrow.FILENAME}</a><br /><span class="gensmall"><!-- IF attachrow.S_IN_MESSAGE --><b>{L_PM}{L_COLON} </b><!-- ELSE --><b>{L_TOPIC}{L_COLON} </b><!-- ENDIF --><a href="{attachrow.U_VIEW_TOPIC}">{attachrow.TOPIC_TITLE}</a></span></td> <td class="gensmall" style="padding: 4px;" align="center" valign="middle" nowrap="nowrap"> {attachrow.POST_TIME} </td> <td class="genmed" style="padding: 4px;" align="center" valign="middle" nowrap="nowrap">{attachrow.SIZE}</td> <td class="genmed" style="padding: 4px;" align="center">{attachrow.DOWNLOAD_COUNT}</td> @@ -36,7 +36,7 @@ </tr> <!-- END attachrow --> <tr> - <td class="cat" colspan="6"><div style="float: {S_CONTENT_FLOW_BEGIN};"><span class="gensmall">{L_SORT_BY}: </span><select name="sk">{S_SORT_OPTIONS}</select> <select name="sd">{S_ORDER_SELECT}</select> <input class="btnlite" type="submit" name="sort" value="{L_SORT}" /></div><div style="float: {S_CONTENT_FLOW_END};"><input class="btnlite" type="submit" name="delete" value="{L_DELETE_MARKED}" /> </div></td> + <td class="cat" colspan="6"><div style="float: {S_CONTENT_FLOW_BEGIN};"><span class="gensmall">{L_SORT_BY}{L_COLON} </span><select name="sk">{S_SORT_OPTIONS}</select> <select name="sd">{S_ORDER_SELECT}</select> <input class="btnlite" type="submit" name="sort" value="{L_SORT}" /></div><div style="float: {S_CONTENT_FLOW_END};"><input class="btnlite" type="submit" name="delete" value="{L_DELETE_MARKED}" /> </div></td> </tr> </table> diff --git a/phpBB/styles/subsilver2/template/ucp_groups_manage.html b/phpBB/styles/subsilver2/template/ucp_groups_manage.html index ac678895a6..12319c9e4e 100644 --- a/phpBB/styles/subsilver2/template/ucp_groups_manage.html +++ b/phpBB/styles/subsilver2/template/ucp_groups_manage.html @@ -21,18 +21,18 @@ <th colspan="2">{L_GROUP_DETAILS}</th> </tr> <tr> - <td class="row1" width="35%"><label<!-- IF not S_SPECIAL_GROUP --> for="group_name"<!-- ENDIF -->>{L_GROUP_NAME}:</label></td> + <td class="row1" width="35%"><label<!-- IF not S_SPECIAL_GROUP --> for="group_name"<!-- ENDIF -->>{L_GROUP_NAME}{L_COLON}</label></td> <td class="row2"><!-- IF S_SPECIAL_GROUP --><b<!-- IF GROUP_COLOUR --> style="color: #{GROUP_COLOUR};"<!-- ENDIF -->>{GROUP_NAME}</b><!-- ENDIF --><input name="group_name" type="<!-- IF S_SPECIAL_GROUP -->hidden<!-- ELSE -->text<!-- ENDIF -->" id="group_name" value="{GROUP_INTERNAL_NAME}" /></td> </tr> <tr> - <td class="row1" width="35%"><label for="group_desc">{L_GROUP_DESC}:</label></td> + <td class="row1" width="35%"><label for="group_desc">{L_GROUP_DESC}{L_COLON}</label></td> <td class="row2"><textarea id="group_desc" name="group_desc" rows="5" cols="45">{GROUP_DESC}</textarea> <br /><input type="checkbox" class="radio" name="desc_parse_bbcode"<!-- IF S_DESC_BBCODE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_BBCODE} <input type="checkbox" class="radio" name="desc_parse_smilies"<!-- IF S_DESC_SMILIES_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_SMILIES} <input type="checkbox" class="radio" name="desc_parse_urls"<!-- IF S_DESC_URLS_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_URLS} </td> </tr> <!-- IF not S_SPECIAL_GROUP --> <tr> - <td class="row1" width="35%"><label for="group_type">{L_GROUP_TYPE}:</label><br /><span>{L_GROUP_TYPE_EXPLAIN}</span></td> + <td class="row1" width="35%"><label for="group_type">{L_GROUP_TYPE}{L_COLON}</label><br /><span>{L_GROUP_TYPE_EXPLAIN}</span></td> <td class="row2"> <input name="group_type" type="radio" class="radio" id="group_type" value="{GROUP_TYPE_FREE}"{GROUP_FREE} /> {L_GROUP_OPEN} <input name="group_type" type="radio" class="radio" value="{GROUP_TYPE_OPEN}"{GROUP_OPEN} /> {L_GROUP_REQUEST} @@ -48,46 +48,46 @@ <th colspan="2">{L_GROUP_SETTINGS_SAVE}</th> </tr> <tr> - <td class="row1" width="35%"><label for="group_colour">{L_GROUP_COLOR}:</label><br /><span>{L_GROUP_COLOR_EXPLAIN}</span></td> + <td class="row1" width="35%"><label for="group_colour">{L_GROUP_COLOR}{L_COLON}</label><br /><span>{L_GROUP_COLOR_EXPLAIN}</span></td> <td class="row2"><input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="6" maxlength="6" /> <span>[ <a href="{U_SWATCH}" onclick="popup(this.href, 636, 150, '_swatch'); return false;">{L_COLOUR_SWATCH}</a> ]</span></td> </tr> <tr> - <td class="row1" width="35%"><label for="group_rank">{L_GROUP_RANK}:</label></td> + <td class="row1" width="35%"><label for="group_rank">{L_GROUP_RANK}{L_COLON}</label></td> <td class="row2"><select name="group_rank" id="group_rank">{S_RANK_OPTIONS}</select></td> </tr> <tr> <th colspan="2">{L_GROUP_AVATAR}</th> </tr> <tr> - <td class="row1" width="35%"><label>{L_CURRENT_IMAGE}:</label><br /><span>{L_AVATAR_EXPLAIN}</span></td> + <td class="row1" width="35%"><label>{L_CURRENT_IMAGE}{L_COLON}</label><br /><span>{L_AVATAR_EXPLAIN}</span></td> <td class="row2">{AVATAR_IMAGE}<br /><br /><input type="checkbox" class="radio" name="delete" /> <span>{L_DELETE_AVATAR}</span></td> </tr> <!-- IF not S_IN_AVATAR_GALLERY --> <!-- IF S_UPLOAD_AVATAR_FILE --> <tr> - <td class="row1" width="35%"><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}:</label></td> + <td class="row1" width="35%"><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}{L_COLON}</label></td> <td class="row2"><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_MAX_FILESIZE}" /><input type="file" id="uploadfile" name="uploadfile" /></td> </tr> <!-- ENDIF --> <!-- IF S_UPLOAD_AVATAR_URL --> <tr> - <td class="row1" width="35%"><label for="uploadurl">{L_UPLOAD_AVATAR_URL}:</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></td> + <td class="row1" width="35%"><label for="uploadurl">{L_UPLOAD_AVATAR_URL}{L_COLON}</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></td> <td class="row2"><input name="uploadurl" type="text" id="uploadurl" value="" /></td> </tr> <!-- ENDIF --> <!-- IF S_LINK_AVATAR --> <tr> - <td class="row1" width="35%"><label for="remotelink">{L_LINK_REMOTE_AVATAR}:</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></td> + <td class="row1" width="35%"><label for="remotelink">{L_LINK_REMOTE_AVATAR}{L_COLON}</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></td> <td class="row2"><input name="remotelink" type="text" id="remotelink" value="" /></td> </tr> <tr> - <td class="row1" width="35%"><label for="width">{L_LINK_REMOTE_SIZE}:</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></td> + <td class="row1" width="35%"><label for="width">{L_LINK_REMOTE_SIZE}{L_COLON}</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></td> <td class="row2"><input name="width" type="text" id="width" size="3" value="{AVATAR_WIDTH}" /> <span>px X </span> <input type="text" name="height" size="3" value="{AVATAR_HEIGHT}" /> <span>px</span></td> </tr> <!-- ENDIF --> <!-- IF S_DISPLAY_GALLERY --> <tr> - <td class="row1" width="35%"><label>{L_AVATAR_GALLERY}:</label></td> + <td class="row1" width="35%"><label>{L_AVATAR_GALLERY}{L_COLON}</label></td> <td class="row2"><input class="btnmain" type="submit" name="display_gallery" value="{L_DISPLAY_GALLERY}" /></td> </tr> <!-- ENDIF --> @@ -97,7 +97,7 @@ <th colspan="2">{L_AVATAR_GALLERY}</th> </tr> <tr> - <td class="row1" width="35%"><label for="category">{L_AVATAR_CATEGORY}:</label></td> + <td class="row1" width="35%"><label for="category">{L_AVATAR_CATEGORY}{L_COLON}</label></td> <td class="row2"><select name="category" id="category">{S_CAT_OPTIONS}</select> <input class="btnmain" type="submit" value="{L_GO}" name="display_gallery" /></td> </tr> <tr> @@ -185,7 +185,7 @@ </table> <div class="pagination" style="float: {S_CONTENT_FLOW_BEGIN};"> - <!-- IF PAGINATION --> + <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> {S_ON_PAGE} @@ -204,11 +204,11 @@ <th colspan="2">{L_ADD_USERS}</th> </tr> <tr> - <td class="row1"><label for="default">{L_USER_GROUP_DEFAULT}:</label><br /><span>{L_USER_GROUP_DEFAULT_EXPLAIN}</span></td> + <td class="row1"><label for="default">{L_USER_GROUP_DEFAULT}{L_COLON}</label><br /><span>{L_USER_GROUP_DEFAULT_EXPLAIN}</span></td> <td class="row2"><input name="default" type="radio" class="radio" value="1" /> {L_YES} <input name="default" type="radio" class="radio" id="default" value="0" checked="checked" /> {L_NO}</td> </tr> <tr> - <td class="row1"><label for="usernames">{L_USERNAME}:</label><br /><span>{L_USERNAMES_EXPLAIN}</span></td> + <td class="row1"><label for="usernames">{L_USERNAME}{L_COLON}</label><br /><span>{L_USERNAMES_EXPLAIN}</span></td> <td class="row2"><textarea id="usernames" name="usernames" cols="40" rows="5"></textarea><br />[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</td> </tr> <tr> diff --git a/phpBB/styles/subsilver2/template/ucp_groups_membership.html b/phpBB/styles/subsilver2/template/ucp_groups_membership.html index 38179e254a..846d48007e 100644 --- a/phpBB/styles/subsilver2/template/ucp_groups_membership.html +++ b/phpBB/styles/subsilver2/template/ucp_groups_membership.html @@ -86,7 +86,7 @@ <!-- END nonmember --> <tr> - <td class="cat" colspan="3"><!-- IF S_CHANGE_DEFAULT --><div style="float: {S_CONTENT_FLOW_BEGIN};"><input class="btnlite" type="submit" name="change_default" value="{L_CHANGE_DEFAULT_GROUP}" /></div><!-- ENDIF --><div style="float: {S_CONTENT_FLOW_END};"><span class="genmed">{L_SELECT}: </span><select name="action"><option value="join">{L_JOIN_SELECTED}</option><option value="resign">{L_RESIGN_SELECTED}</option><option value="demote">{L_DEMOTE_SELECTED}</option></select> <input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" /> </div></td> + <td class="cat" colspan="3"><!-- IF S_CHANGE_DEFAULT --><div style="float: {S_CONTENT_FLOW_BEGIN};"><input class="btnlite" type="submit" name="change_default" value="{L_CHANGE_DEFAULT_GROUP}" /></div><!-- ENDIF --><div style="float: {S_CONTENT_FLOW_END};"><span class="genmed">{L_SELECT}{L_COLON} </span><select name="action"><option value="join">{L_JOIN_SELECTED}</option><option value="resign">{L_RESIGN_SELECTED}</option><option value="demote">{L_DEMOTE_SELECTED}</option></select> <input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" /> </div></td> </tr> </table> diff --git a/phpBB/styles/subsilver2/template/ucp_header.html b/phpBB/styles/subsilver2/template/ucp_header.html index 1566a15929..1ac426d5c3 100644 --- a/phpBB/styles/subsilver2/template/ucp_header.html +++ b/phpBB/styles/subsilver2/template/ucp_header.html @@ -15,7 +15,7 @@ </tr> <!-- IF not S_ALLOW_MASS_PM --> <tr> - <td class="row1"><b class="genmed">{L_USERNAME}:</b><br />[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</td> + <td class="row1"><b class="genmed">{L_USERNAME}{L_COLON}</b><br />[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</td> </tr> <tr> @@ -23,7 +23,7 @@ </tr> <!-- ELSE --> <tr> - <td class="row1"><b class="genmed">{L_USERNAMES}:</b></td> + <td class="row1"><b class="genmed">{L_USERNAMES}{L_COLON}</b></td> </tr> <tr> <td class="row2"><textarea name="username_list" rows="5" cols="22" tabindex="1"></textarea><br /> @@ -33,7 +33,7 @@ <!-- ENDIF --> <!-- IF S_GROUP_OPTIONS --> <tr> - <td class="row1"><b class="genmed">{L_USERGROUPS}:</b></td> + <td class="row1"><b class="genmed">{L_USERGROUPS}{L_COLON}</b></td> </tr> <tr> <td class="row2"><select name="group_list[]" multiple="multiple" size="5" style="width:150px">{S_GROUP_OPTIONS}</select></td> diff --git a/phpBB/styles/subsilver2/template/ucp_main_bookmarks.html b/phpBB/styles/subsilver2/template/ucp_main_bookmarks.html index 2fa8f6ac2e..e91417503f 100644 --- a/phpBB/styles/subsilver2/template/ucp_main_bookmarks.html +++ b/phpBB/styles/subsilver2/template/ucp_main_bookmarks.html @@ -42,9 +42,18 @@ <!-- ELSE --> <td style="padding: 4px;" width="100%" valign="top"> <p class="topictitle"><!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF -->{topicrow.ATTACH_ICON_IMG} <a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a></p> - <!-- IF topicrow.S_GLOBAL_TOPIC --><span class="gensmall">{L_GLOBAL_ANNOUNCEMENT}</span><!-- ELSE --><span class="gensmall"><b>{L_FORUM}: </b><a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a></span><!-- ENDIF --> - <!-- IF topicrow.PAGINATION --> - <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {topicrow.PAGINATION} ] </p> + <!-- IF topicrow.S_GLOBAL_TOPIC --><span class="gensmall">{L_GLOBAL_ANNOUNCEMENT}</span><!-- ELSE --><span class="gensmall"><b>{L_FORUM}{L_COLON} </b><a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a></span><!-- ENDIF --> + <!-- IF .topicrow.pagination --> + <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}{L_COLON} + <!-- BEGIN pagination --> + <!-- IF topicrow.pagination.S_IS_PREV --> + <!-- ELSEIF topicrow.pagination.S_IS_CURRENT --><strong>{topicrow.pagination.PAGE_NUMBER}</strong> + <!-- ELSEIF topicrow.pagination.S_IS_ELLIPSIS --> {L_ELLIPSIS} + <!-- ELSEIF topicrow.pagination.S_IS_NEXT --> + <!-- ELSE --><a href="{topicrow.pagination.PAGE_URL}">{topicrow.pagination.PAGE_NUMBER}</a> + <!-- ENDIF --> + <!-- END pagination --> + ] </p> <!-- ENDIF --> </td> <td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap"> diff --git a/phpBB/styles/subsilver2/template/ucp_main_drafts.html b/phpBB/styles/subsilver2/template/ucp_main_drafts.html index 0259ae466f..8e18e9cabf 100644 --- a/phpBB/styles/subsilver2/template/ucp_main_drafts.html +++ b/phpBB/styles/subsilver2/template/ucp_main_drafts.html @@ -32,8 +32,8 @@ <td class="postdetails" style="padding: 4px;" nowrap="nowrap">{draftrow.DATE}</td> <td style="padding: 4px;" valign="top" width="100%"> <p class="topictitle">{draftrow.DRAFT_SUBJECT}</p> - <!-- IF draftrow.S_LINK_TOPIC --><span class="gensmall">{L_TOPIC}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span> - <!-- ELSEIF draftrow.S_LINK_FORUM --><span class="gensmall">{L_FORUM}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span> + <!-- IF draftrow.S_LINK_TOPIC --><span class="gensmall">{L_TOPIC}{L_COLON} <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span> + <!-- ELSEIF draftrow.S_LINK_FORUM --><span class="gensmall">{L_FORUM}{L_COLON} <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span> <!-- ELSEIF draftrow.S_LINK_PM --><span class="gensmall">{L_PRIVATE_MESSAGE}</span> <!-- ELSE --><span class="gensmall">{L_NO_TOPIC_FORUM}</span><!-- ENDIF --> </td> @@ -54,11 +54,11 @@ <!-- ELSEIF S_EDIT_DRAFT --> <tr> - <td class="row1" width="22%"><b class="genmed">{L_SUBJECT}:</b></td> + <td class="row1" width="22%"><b class="genmed">{L_SUBJECT}{L_COLON}</b></td> <td class="row2"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="64" tabindex="2" value="{DRAFT_SUBJECT}" /></td> </tr> <tr> - <td class="row1" width="22%"><b class="genmed">{L_MESSAGE}: </b><br /><span class="gensmall">{L_EDIT_DRAFT_EXPLAIN}</span></td> + <td class="row1" width="22%"><b class="genmed">{L_MESSAGE}{L_COLON} </b><br /><span class="gensmall">{L_EDIT_DRAFT_EXPLAIN}</span></td> <td class="row2"> <script type="text/javascript"> // <![CDATA[ diff --git a/phpBB/styles/subsilver2/template/ucp_main_front.html b/phpBB/styles/subsilver2/template/ucp_main_front.html index 1445a71a1b..5dea2b4f03 100644 --- a/phpBB/styles/subsilver2/template/ucp_main_front.html +++ b/phpBB/styles/subsilver2/template/ucp_main_front.html @@ -38,26 +38,26 @@ <td class="row1" colspan="3"> <table width="100%" cellspacing="1" cellpadding="4"> <tr> - <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_JOINED}: </b></td> + <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_JOINED}{L_COLON} </b></td> <td width="100%"><b class="gen">{JOINED}</b></td> </tr> <tr> - <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_TOTAL_POSTS}: </b></td> + <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_TOTAL_POSTS}{L_COLON} </b></td> <td><!-- IF POSTS_PCT --><b class="gen">{POSTS}</b><br /><span class="genmed">[{POSTS_PCT} / {POSTS_DAY}]<!-- IF S_DISPLAY_SEARCH --><br /><a href="{U_SEARCH_SELF}">{L_SEARCH_YOUR_POSTS}</a><!-- ENDIF --></span><!-- ELSE --><b class="gen">{POSTS}<b><!-- ENDIF --></td> </tr> <!-- IF S_SHOW_ACTIVITY --> <tr> - <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_ACTIVE_IN_FORUM}: </b></td> + <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_ACTIVE_IN_FORUM}{L_COLON} </b></td> <td><!-- IF ACTIVE_FORUM != '' --><b><a class="gen" href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></b><br /><span class="genmed">[ {ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT} ]</span><!-- ELSE --><span class="gen">-</span><!-- ENDIF --></td> </tr> <tr> - <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_ACTIVE_IN_TOPIC}: </b></td> + <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_ACTIVE_IN_TOPIC}{L_COLON} </b></td> <td><!-- IF ACTIVE_TOPIC != '' --><b><a class="gen" href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></b><br /><span class="genmed">[ {ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT} ]</span><!-- ELSE --><span class="gen">-</span><!-- ENDIF --></td> </tr> <!-- ENDIF --> <!-- IF WARNINGS --> <tr> - <td align="{S_CONTENT_FLOW_END}" valign="middle" nowrap="nowrap"><b class="genmed">{L_YOUR_WARNINGS}: </b></td> + <td align="{S_CONTENT_FLOW_END}" valign="middle" nowrap="nowrap"><b class="genmed">{L_YOUR_WARNINGS}{L_COLON} </b></td> <td class="genmed">{WARNING_IMG} [ <b>{WARNINGS}</b> ]</td> </tr> <!-- ENDIF --> diff --git a/phpBB/styles/subsilver2/template/ucp_main_subscribed.html b/phpBB/styles/subsilver2/template/ucp_main_subscribed.html index 42a452549b..45094abe5f 100644 --- a/phpBB/styles/subsilver2/template/ucp_main_subscribed.html +++ b/phpBB/styles/subsilver2/template/ucp_main_subscribed.html @@ -51,9 +51,18 @@ <td style="padding: 4px;" width="20" align="center" valign="middle">{topicrow.TOPIC_FOLDER_IMG}</td> <td style="padding: 4px;" width="100%" valign="top"> <p class="topictitle"><!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}" class="imageset">{NEWEST_POST_IMG}</a> <!-- ENDIF -->{topicrow.ATTACH_ICON_IMG} <a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a></p> - <!-- IF topicrow.S_GLOBAL_TOPIC --><span class="gensmall">{L_GLOBAL_ANNOUNCEMENT}</span><!-- ELSE --><span class="gensmall"><b>{L_FORUM}: </b><a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a></span><!-- ENDIF --> - <!-- IF topicrow.PAGINATION --> - <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {topicrow.PAGINATION} ] </p> + <!-- IF topicrow.S_GLOBAL_TOPIC --><span class="gensmall">{L_GLOBAL_ANNOUNCEMENT}</span><!-- ELSE --><span class="gensmall"><b>{L_FORUM}{L_COLON} </b><a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a></span><!-- ENDIF --> + <!-- IF .topicrow.pagination --> + <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}{L_COLON} + <!-- BEGIN pagination --> + <!-- IF topicrow.pagination.S_IS_PREV --> + <!-- ELSEIF topicrow.pagination.S_IS_CURRENT --><strong>{topicrow.pagination.PAGE_NUMBER}</strong> + <!-- ELSEIF topicrow.pagination.S_IS_ELLIPSIS --> {L_ELLIPSIS} + <!-- ELSEIF topicrow.pagination.S_IS_NEXT --> + <!-- ELSE --><a href="{topicrow.pagination.PAGE_URL}">{topicrow.pagination.PAGE_NUMBER}</a> + <!-- ENDIF --> + <!-- END pagination --> + ] </p> <!-- ENDIF --> </td> <td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap"> diff --git a/phpBB/styles/subsilver2/template/ucp_pm_history.html b/phpBB/styles/subsilver2/template/ucp_pm_history.html index f24474e85c..0cbbf33fbe 100644 --- a/phpBB/styles/subsilver2/template/ucp_pm_history.html +++ b/phpBB/styles/subsilver2/template/ucp_pm_history.html @@ -26,7 +26,7 @@ </table> </td> <td width="100%"<!-- IF history_row.S_CURRENT_MSG --> style="background-color:lightblue"<!-- ENDIF -->> - <div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};"><b>{L_PM_SUBJECT}:</b> {history_row.SUBJECT}</div><div class="gensmall" style="float: {S_CONTENT_FLOW_END};"><b>{L_FOLDER}:</b> {history_row.FOLDER}</div> + <div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};"><b>{L_PM_SUBJECT}{L_COLON}</b> {history_row.SUBJECT}</div><div class="gensmall" style="float: {S_CONTENT_FLOW_END};"><b>{L_FOLDER}{L_COLON}</b> {history_row.FOLDER}</div> </td> </tr> @@ -48,7 +48,7 @@ <tr valign="middle"> <td width="100%"> </td> <td width="10" nowrap="nowrap">{history_row.MINI_POST_IMG}</td> - <td class="gensmall" nowrap="nowrap"><b>{L_SENT_AT}:</b> {history_row.SENT_DATE}</td> + <td class="gensmall" nowrap="nowrap"><b>{L_SENT_AT}{L_COLON}</b> {history_row.SENT_DATE}</td> </tr> </table> </td> diff --git a/phpBB/styles/subsilver2/template/ucp_pm_message_footer.html b/phpBB/styles/subsilver2/template/ucp_pm_message_footer.html index d1ef5ebd10..20c5c7fe9f 100644 --- a/phpBB/styles/subsilver2/template/ucp_pm_message_footer.html +++ b/phpBB/styles/subsilver2/template/ucp_pm_message_footer.html @@ -31,7 +31,7 @@ <!-- ENDIF --> <!-- ELSE --> <form name="sortmsg" method="post" action="{S_PM_ACTION}" style="margin:0px"> - <span class="gensmall">{L_DISPLAY_MESSAGES}:</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" name="sort" value="{L_GO}" /> + <span class="gensmall">{L_DISPLAY_MESSAGES}{L_COLON}</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" name="sort" value="{L_GO}" /> {S_FORM_TOKEN} </form> <!-- ENDIF --> diff --git a/phpBB/styles/subsilver2/template/ucp_pm_options.html b/phpBB/styles/subsilver2/template/ucp_pm_options.html index 3ff18d8c15..beb867c75a 100644 --- a/phpBB/styles/subsilver2/template/ucp_pm_options.html +++ b/phpBB/styles/subsilver2/template/ucp_pm_options.html @@ -20,7 +20,7 @@ </tr> <!-- IF S_CHECK_DEFINED --> <tr> - <td class="row1" width="50" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><b class="gen">{L_IF}:</b></td> + <td class="row1" width="50" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><b class="gen">{L_IF}{L_COLON}</b></td> <td class="row2" align="center" valign="top"><!-- IF S_CHECK_SELECT --><select name="check_option">{S_CHECK_OPTIONS}</select><!-- ELSE --><b class="gen">{CHECK_CURRENT}</b><input type="hidden" name="check_option" value="{CHECK_OPTION}" /><!-- ENDIF --></td> <td class="row1" width="50" align="{S_CONTENT_FLOW_END}" valign="top"><!-- IF S_CHECK_SELECT --><input type="submit" name="next" value="{L_NEXT_STEP}" class="btnlite" /><!-- ELSE --> <!-- ENDIF --></td> </tr> @@ -98,11 +98,11 @@ <th colspan="2">{L_RENAME_FOLDER}</th> </tr> <tr> - <td class="row1" width="200"><b class="gen">{L_RENAME_FOLDER}: </b></td> + <td class="row1" width="200"><b class="gen">{L_RENAME_FOLDER}{L_COLON} </b></td> <td class="row1"><select name="rename_folder_id">{S_FOLDER_OPTIONS}</select></td> </tr> <tr> - <td class="row1" width="200"><b class="gen">{L_NEW_FOLDER_NAME}: </b></td> + <td class="row1" width="200"><b class="gen">{L_NEW_FOLDER_NAME}{L_COLON} </b></td> <td class="row1"><input type="text" class="post" name="new_folder_name" size="30" maxlength="30" /></td> </tr> <tr> @@ -124,7 +124,7 @@ </tr> <!-- ELSE --> <tr> - <td class="row1" width="200"><b class="gen">{L_ADD_FOLDER}: </b></td> + <td class="row1" width="200"><b class="gen">{L_ADD_FOLDER}{L_COLON} </b></td> <td class="row1"><input type="text" class="post" name="foldername" size="30" maxlength="30" /></td> </tr> <tr> @@ -142,7 +142,7 @@ <th colspan="3">{L_REMOVE_FOLDER}</th> </tr> <tr> - <td class="row1" width="200"><b class="gen">{L_REMOVE_FOLDER}: </b></td> + <td class="row1" width="200"><b class="gen">{L_REMOVE_FOLDER}{L_COLON} </b></td> <td class="row1"><select name="remove_folder_id">{S_FOLDER_OPTIONS}</select></td> <td class="row1"><b class="genmed">{L_AND}</b></td> </tr> @@ -168,19 +168,19 @@ <th colspan="2">{L_FOLDER_OPTIONS}</th> </tr> <tr> - <td class="row1" width="200"><span><b class="genmed">{L_IF_FOLDER_FULL}: </b></span></td> + <td class="row1" width="200"><span><b class="genmed">{L_IF_FOLDER_FULL}{L_COLON} </b></span></td> <td class="row1"><input type="radio" class="radio" name="full_action" value="1"{S_DELETE_CHECKED} /> <span class="genmed">{L_DELETE_OLDEST_MESSAGES}</span></td> </tr> <tr> <td class="row1" width="200"> </td> - <td class="row1"><input type="radio" class="radio" name="full_action" value="2"{S_MOVE_CHECKED} /> <span class="genmed">{L_MOVE_TO_FOLDER}: </span><select name="full_move_to">{S_FULL_FOLDER_OPTIONS}</select></td> + <td class="row1"><input type="radio" class="radio" name="full_action" value="2"{S_MOVE_CHECKED} /> <span class="genmed">{L_MOVE_TO_FOLDER}{L_COLON} </span><select name="full_move_to">{S_FULL_FOLDER_OPTIONS}</select></td> </tr> <tr> <td class="row1" width="200"> </td> <td class="row1"><input type="radio" class="radio" name="full_action" value="3"{S_HOLD_CHECKED} /> <span class="genmed">{L_HOLD_NEW_MESSAGES}</span></td> </tr> <tr> - <td class="row2" width="200"><b class="genmed">{L_DEFAULT_ACTION}: </b><br /><span class="gensmall">{L_DEFAULT_ACTION_EXPLAIN}</span></td> + <td class="row2" width="200"><b class="genmed">{L_DEFAULT_ACTION}{L_COLON} </b><br /><span class="gensmall">{L_DEFAULT_ACTION_EXPLAIN}</span></td> <td class="row2"><span class="genmed">{DEFAULT_ACTION}</span></td> </tr> <tr> diff --git a/phpBB/styles/subsilver2/template/ucp_pm_viewfolder.html b/phpBB/styles/subsilver2/template/ucp_pm_viewfolder.html index 64c923e72c..edcf553b84 100644 --- a/phpBB/styles/subsilver2/template/ucp_pm_viewfolder.html +++ b/phpBB/styles/subsilver2/template/ucp_pm_viewfolder.html @@ -22,11 +22,11 @@ <th colspan="2" valign="middle">{L_OPTIONS}</th> </tr> <tr> - <td class="row1" width="35%">{L_DELIMITER}: </td> + <td class="row1" width="35%">{L_DELIMITER}{L_COLON} </td> <td class="row2"><input class="post" type="text" name="delimiter" value="," /></td> </tr> <tr> - <td class="row1" width="35%">{L_ENCLOSURE}: </td> + <td class="row1" width="35%">{L_ENCLOSURE}{L_COLON} </td> <td class="row2"><input class="post" type="text" name="enclosure" value=""" /></td> </tr> <tr> diff --git a/phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html b/phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html index faaa3f9593..be1e27c5f3 100644 --- a/phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html +++ b/phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html @@ -8,23 +8,23 @@ <table class="tablebg" width="100%" cellspacing="1" cellpadding="4"> <tr class="row1"> - <td class="genmed" nowrap="nowrap" width="150"><b>{L_PM_SUBJECT}:</b></td> + <td class="genmed" nowrap="nowrap" width="150"><b>{L_PM_SUBJECT}{L_COLON}</b></td> <td class="gen">{SUBJECT}</td> </tr> <tr class="row1"> - <td class="genmed" nowrap="nowrap" width="150"><b>{L_PM_FROM}:</b></td> + <td class="genmed" nowrap="nowrap" width="150"><b>{L_PM_FROM}{L_COLON}</b></td> <td class="gen">{MESSAGE_AUTHOR_FULL}</td> </tr> <tr class="row1"> - <td class="genmed" nowrap="nowrap" width="150"><b>{L_SENT_AT}:</b></td> + <td class="genmed" nowrap="nowrap" width="150"><b>{L_SENT_AT}{L_COLON}</b></td> <td class="gen">{SENT_DATE}</td> </tr> <!-- IF S_TO_RECIPIENT --> <tr class="row1"> - <td class="genmed" nowrap="nowrap" width="150"><b>{L_TO}:</b></td> + <td class="genmed" nowrap="nowrap" width="150"><b>{L_TO}{L_COLON}</b></td> <td class="gen"> <!-- BEGIN to_recipient --> <!-- IF to_recipient.IS_GROUP --><span class="sep"><a href="{to_recipient.U_VIEW}">{to_recipient.NAME}</a></span><!-- ELSE -->{to_recipient.NAME_FULL} <!-- ENDIF --> @@ -35,7 +35,7 @@ <!-- IF S_BCC_RECIPIENT --> <tr class="row1"> - <td class="genmed" nowrap="nowrap" width="150"><b>{L_BCC}:</b></td> + <td class="genmed" nowrap="nowrap" width="150"><b>{L_BCC}{L_COLON}</b></td> <td class="gen"> <!-- BEGIN bcc_recipient --> <!-- IF bcc_recipient.IS_GROUP --><span class="sep"><a href="{bcc_recipient.U_VIEW}">{bcc_recipient.NAME}</a></span><!-- ELSE -->{bcc_recipient.NAME_FULL} <!-- ENDIF --> @@ -69,7 +69,7 @@ <table class="tablebg" width="100%" cellspacing="1"> <tr> - <td class="row3"><b class="genmed">{L_ATTACHMENTS}: </b></td> + <td class="row3"><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td> </tr> <!-- BEGIN attachment --> <tr> diff --git a/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html b/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html index 7c368c8124..fd0244a79d 100644 --- a/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html +++ b/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html @@ -74,13 +74,13 @@ hr.sep { <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> - <td width="10%" nowrap="nowrap">{L_PM_FROM}: </td> + <td width="10%" nowrap="nowrap">{L_PM_FROM}{L_COLON} </td> <td><b>{MESSAGE_AUTHOR}</b> [ {SENT_DATE} ]</td> </tr> <!-- IF S_TO_RECIPIENT --> <tr> - <td width="10%" nowrap="nowrap">{L_TO}:</td> + <td width="10%" nowrap="nowrap">{L_TO}{L_COLON}</td> <td> <!-- BEGIN to_recipient --> <span<!-- IF to_recipient.IS_GROUP --> class="sep"<!-- ENDIF -->>{to_recipient.NAME}</span> @@ -91,7 +91,7 @@ hr.sep { <!-- IF S_BCC_RECIPIENT --> <tr> - <td width="10%" nowrap="nowrap">{L_BCC}:</td> + <td width="10%" nowrap="nowrap">{L_BCC}{L_COLON}</td> <td> <!-- BEGIN bcc_recipient --> <!-- IF bcc_recipient.COLOUR --><span style="color:{bcc_recipient.COLOUR}"><!-- ELSE --><span<!-- IF bcc_recipient.IS_GROUP --> class="sep"<!-- ENDIF -->><!-- ENDIF -->{bcc_recipient.NAME}</span> @@ -112,7 +112,7 @@ hr.sep { <td align="{S_CONTENT_FLOW_END}"><span class="gensmall">{S_TIMEZONE}</span></td> </tr> <tr> - <td colspan="2" align="center"><span class="gensmall">Powered by phpBB® Forum Software © phpBB Group<br />http://www.phpbb.com/</span></td> + <td colspan="2" align="center"><span class="gensmall">Powered by phpBB® Forum Software © phpBB Group<br />https://www.phpbb.com/</span></td> </tr> </table> diff --git a/phpBB/styles/subsilver2/template/ucp_prefs_personal.html b/phpBB/styles/subsilver2/template/ucp_prefs_personal.html index 8e4b04fc10..9ebc045608 100644 --- a/phpBB/styles/subsilver2/template/ucp_prefs_personal.html +++ b/phpBB/styles/subsilver2/template/ucp_prefs_personal.html @@ -30,59 +30,52 @@ </tr> <!-- ENDIF --> <tr> - <td class="row1" width="50%"><b class="genmed">{L_SHOW_EMAIL}:</b></td> + <td class="row1" width="50%"><b class="genmed">{L_SHOW_EMAIL}{L_COLON}</b></td> <td class="row2"><input type="radio" class="radio" name="viewemail" value="1"<!-- IF S_VIEW_EMAIL --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span> <input type="radio" class="radio" name="viewemail" value="0"<!-- IF not S_VIEW_EMAIL --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td> </tr> <tr> - <td class="row1" width="50%"><b class="genmed">{L_ADMIN_EMAIL}:</b></td> + <td class="row1" width="50%"><b class="genmed">{L_ADMIN_EMAIL}{L_COLON}</b></td> <td class="row2"><input type="radio" class="radio" name="massemail" value="1"<!-- IF S_MASS_EMAIL --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span> <input type="radio" class="radio" name="massemail" value="0"<!-- IF not S_MASS_EMAIL --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td> </tr> <tr> - <td class="row1" width="50%"><b class="genmed">{L_ALLOW_PM}:</b><br /><span class="gensmall">{L_ALLOW_PM_EXPLAIN}</span></td> + <td class="row1" width="50%"><b class="genmed">{L_ALLOW_PM}{L_COLON}</b><br /><span class="gensmall">{L_ALLOW_PM_EXPLAIN}</span></td> <td class="row2"><input type="radio" class="radio" name="allowpm" value="1"<!-- IF S_ALLOW_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span> <input type="radio" class="radio" name="allowpm" value="0"<!-- IF not S_ALLOW_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td> </tr> <!-- IF S_CAN_HIDE_ONLINE --> <tr> - <td class="row1" width="50%"><b class="genmed">{L_HIDE_ONLINE}:</b><br /><span class="gensmall">{L_HIDE_ONLINE_EXPLAIN}</span></td> + <td class="row1" width="50%"><b class="genmed">{L_HIDE_ONLINE}{L_COLON}</b><br /><span class="gensmall">{L_HIDE_ONLINE_EXPLAIN}</span></td> <td class="row2"><input type="radio" class="radio" name="hideonline" value="1"<!-- IF S_HIDE_ONLINE --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span> <input type="radio" class="radio" name="hideonline" value="0"<!-- IF not S_HIDE_ONLINE --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td> </tr> <!-- ENDIF --> <!-- IF S_SELECT_NOTIFY --> <tr> - <td class="row1" width="50%"><b class="genmed">{L_NOTIFY_METHOD}:</b><br /><span class="gensmall">{L_NOTIFY_METHOD_EXPLAIN}</span></td> + <td class="row1" width="50%"><b class="genmed">{L_NOTIFY_METHOD}{L_COLON}</b><br /><span class="gensmall">{L_NOTIFY_METHOD_EXPLAIN}</span></td> <td class="row2"><input type="radio" class="radio" name="notifymethod" value="0"<!-- IF S_NOTIFY_EMAIL --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NOTIFY_METHOD_EMAIL}</span> <input type="radio" class="radio" name="notifymethod" value="1"<!-- IF S_NOTIFY_IM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NOTIFY_METHOD_IM}</span> <input type="radio" class="radio" name="notifymethod" value="2"<!-- IF S_NOTIFY_BOTH --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NOTIFY_METHOD_BOTH}</span></td> </tr> <!-- ENDIF --> <tr> - <td class="row1" width="50%"><b class="genmed">{L_NOTIFY_ON_PM}:</b></td> + <td class="row1" width="50%"><b class="genmed">{L_NOTIFY_ON_PM}{L_COLON}</b></td> <td class="row2"><input type="radio" class="radio" name="notifypm" value="1"<!-- IF S_NOTIFY_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span> <input type="radio" class="radio" name="notifypm" value="0"<!-- IF not S_NOTIFY_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td> </tr> <tr> - <td class="row1" width="50%"><b class="genmed">{L_POPUP_ON_PM}:</b></td> + <td class="row1" width="50%"><b class="genmed">{L_POPUP_ON_PM}{L_COLON}</b></td> <td class="row2"><input type="radio" class="radio" name="popuppm" value="1"<!-- IF S_POPUP_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span> <input type="radio" class="radio" name="popuppm" value="0"<!-- IF not S_POPUP_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td> </tr> +<!-- IF S_MORE_LANGUAGES --> <tr> - <td class="row1" width="50%"><b class="genmed">{L_BOARD_LANGUAGE}:</b></td> + <td class="row1" width="50%"><b class="genmed">{L_BOARD_LANGUAGE}{L_COLON}</b></td> <td class="row2"><select name="lang">{S_LANG_OPTIONS}</select></td> </tr> -<!-- IF S_STYLE_OPTIONS --> +<!-- ENDIF --> +<!-- IF S_STYLE_OPTIONS and S_MORE_STYLES --> <tr> - <td class="row1" width="50%"><b class="genmed">{L_BOARD_STYLE}:</b></td> + <td class="row1" width="50%"><b class="genmed">{L_BOARD_STYLE}{L_COLON}</b></td> <td class="row2"><select name="style">{S_STYLE_OPTIONS}</select></td> </tr> <!-- ENDIF --> +<!-- INCLUDE timezone_option.html --> <tr> - <td class="row1" width="50%"><b class="genmed">{L_BOARD_TIMEZONE}:</b></td> - <td class="row2"> - <select id="tz" name="tz">{S_TZ_OPTIONS}</select> - </td> -</tr> -<tr> - <td class="row1" width="50%"><b class="genmed">{L_BOARD_DST}:</b></td> - <td class="row2"><input type="radio" class="radio" name="dst" value="1"<!-- IF S_DST --> checked="checked"<!-- ENDIF --> /> <span class="genmed">{L_YES}</span> <input type="radio" class="radio" name="dst" value="0"<!-- IF not S_DST --> checked="checked"<!-- ENDIF --> /> <span class="genmed">{L_NO}</span></td> -</tr> -<tr> - <td class="row1" width="50%"><b class="genmed">{L_BOARD_DATE_FORMAT}:</b><br /><span class="gensmall">{L_BOARD_DATE_FORMAT_EXPLAIN}</span></td> + <td class="row1" width="50%"><b class="genmed">{L_BOARD_DATE_FORMAT}{L_COLON}</b><br /><span class="gensmall">{L_BOARD_DATE_FORMAT_EXPLAIN}</span></td> <td class="row2"> <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} diff --git a/phpBB/styles/subsilver2/template/ucp_prefs_post.html b/phpBB/styles/subsilver2/template/ucp_prefs_post.html index 9f086fa8b5..03f1472942 100644 --- a/phpBB/styles/subsilver2/template/ucp_prefs_post.html +++ b/phpBB/styles/subsilver2/template/ucp_prefs_post.html @@ -10,19 +10,19 @@ </tr> <!-- ENDIF --> <tr> - <td class="row1" width="50%"><b class="genmed">{L_DEFAULT_BBCODE}:</b></td> + <td class="row1" width="50%"><b class="genmed">{L_DEFAULT_BBCODE}{L_COLON}</b></td> <td class="row2"><input type="radio" class="radio" name="bbcode" value="1"<!-- IF S_BBCODE --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span> <input type="radio" class="radio" name="bbcode" value="0"<!-- IF not S_BBCODE --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td> </tr> <tr> - <td class="row1" width="50%"><b class="genmed">{L_DEFAULT_SMILIES}:</b></td> + <td class="row1" width="50%"><b class="genmed">{L_DEFAULT_SMILIES}{L_COLON}</b></td> <td class="row2"><input type="radio" class="radio" name="smilies" value="1"<!-- IF S_SMILIES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span> <input type="radio" class="radio" name="smilies" value="0"<!-- IF not S_SMILIES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td> </tr> <tr> - <td class="row1" width="50%"><b class="genmed">{L_DEFAULT_ADD_SIG}:</b></td> + <td class="row1" width="50%"><b class="genmed">{L_DEFAULT_ADD_SIG}{L_COLON}</b></td> <td class="row2"><input type="radio" class="radio" name="sig" value="1"<!-- IF S_SIG --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span> <input type="radio" class="radio" name="sig" value="0"<!-- IF not S_SIG --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td> </tr> <tr> - <td class="row1" width="50%"><b class="genmed">{L_DEFAULT_NOTIFY}:</b></td> + <td class="row1" width="50%"><b class="genmed">{L_DEFAULT_NOTIFY}{L_COLON}</b></td> <td class="row2"><input type="radio" class="radio" name="notify" value="1"<!-- IF S_NOTIFY --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span> <input type="radio" class="radio" name="notify" value="0"<!-- IF not S_NOTIFY --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td> </tr> <tr> diff --git a/phpBB/styles/subsilver2/template/ucp_prefs_view.html b/phpBB/styles/subsilver2/template/ucp_prefs_view.html index 7d8c7d4333..cc1b20a987 100644 --- a/phpBB/styles/subsilver2/template/ucp_prefs_view.html +++ b/phpBB/styles/subsilver2/template/ucp_prefs_view.html @@ -10,28 +10,28 @@ </tr> <!-- ENDIF --> <tr> - <td class="row1" width="50%"><b class="genmed">{L_VIEW_IMAGES}:</b></td> + <td class="row1" width="50%"><b class="genmed">{L_VIEW_IMAGES}{L_COLON}</b></td> <td class="row2"><input type="radio" class="radio" name="images" value="1"<!-- IF S_IMAGES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span> <input type="radio" class="radio" name="images" value="0"<!-- IF not S_IMAGES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td> </tr> <tr> - <td class="row1" width="50%"><b class="genmed">{L_VIEW_FLASH}:</b></td> + <td class="row1" width="50%"><b class="genmed">{L_VIEW_FLASH}{L_COLON}</b></td> <td class="row2"><input type="radio" class="radio" name="flash" value="1"<!-- IF S_FLASH --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span> <input type="radio" class="radio" name="flash" value="0"<!-- IF not S_FLASH --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td> </tr> <tr> - <td class="row1" width="50%"><b class="genmed">{L_VIEW_SMILIES}:</b></td> + <td class="row1" width="50%"><b class="genmed">{L_VIEW_SMILIES}{L_COLON}</b></td> <td class="row2"><input type="radio" class="radio" name="smilies" value="1"<!-- IF S_SMILIES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span> <input type="radio" class="radio" name="smilies" value="0"<!-- IF not S_SMILIES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td> </tr> <tr> - <td class="row1" width="50%"><b class="genmed">{L_VIEW_SIGS}:</b></td> + <td class="row1" width="50%"><b class="genmed">{L_VIEW_SIGS}{L_COLON}</b></td> <td class="row2"><input type="radio" class="radio" name="sigs" value="1"<!-- IF S_SIGS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span> <input type="radio" class="radio" name="sigs" value="0"<!-- IF not S_SIGS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td> </tr> <tr> - <td class="row1" width="50%"><b class="genmed">{L_VIEW_AVATARS}:</b></td> + <td class="row1" width="50%"><b class="genmed">{L_VIEW_AVATARS}{L_COLON}</b></td> <td class="row2"><input type="radio" class="radio" name="avatars" value="1"<!-- IF S_AVATARS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span> <input type="radio" class="radio" name="avatars" value="0"<!-- IF not S_AVATARS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td> </tr> <!-- IF S_CHANGE_CENSORS --> <tr> - <td class="row1" width="50%"><b class="genmed">{L_DISABLE_CENSORS}:</b></td> + <td class="row1" width="50%"><b class="genmed">{L_DISABLE_CENSORS}{L_COLON}</b></td> <td class="row2"><input type="radio" class="radio" name="wordcensor" value="1"<!-- IF S_DISABLE_CENSORS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span> <input type="radio" class="radio" name="wordcensor" value="0"<!-- IF not S_DISABLE_CENSORS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td> </tr> <!-- ENDIF --> @@ -39,30 +39,30 @@ <td colspan="2" class="spacer"></td> </tr> <tr> - <td class="row1" width="50%"><b class="genmed">{L_VIEW_TOPICS_DAYS}:</b></td> + <td class="row1" width="50%"><b class="genmed">{L_VIEW_TOPICS_DAYS}{L_COLON}</b></td> <td class="row2">{S_TOPIC_SORT_DAYS}</td> </tr> <tr> - <td class="row1" width="50%"><b class="genmed">{L_VIEW_TOPICS_KEY}:</b></td> + <td class="row1" width="50%"><b class="genmed">{L_VIEW_TOPICS_KEY}{L_COLON}</b></td> <td class="row2">{S_TOPIC_SORT_KEY}</td> </tr> <tr> - <td class="row1" width="50%"><b class="genmed">{L_VIEW_TOPICS_DIR}:</b></td> + <td class="row1" width="50%"><b class="genmed">{L_VIEW_TOPICS_DIR}{L_COLON}</b></td> <td class="row2">{S_TOPIC_SORT_DIR}</td> </tr> <tr> <td colspan="2" class="spacer"></td> </tr> <tr> - <td class="row1" width="50%"><b class="genmed">{L_VIEW_POSTS_DAYS}:</b></td> + <td class="row1" width="50%"><b class="genmed">{L_VIEW_POSTS_DAYS}{L_COLON}</b></td> <td class="row2">{S_POST_SORT_DAYS}</td> </tr> <tr> - <td class="row1" width="50%"><b class="genmed">{L_VIEW_POSTS_KEY}:</b></td> + <td class="row1" width="50%"><b class="genmed">{L_VIEW_POSTS_KEY}{L_COLON}</b></td> <td class="row2">{S_POST_SORT_KEY}</td> </tr> <tr> - <td class="row1" width="50%"><b class="genmed">{L_VIEW_POSTS_DIR}:</b></td> + <td class="row1" width="50%"><b class="genmed">{L_VIEW_POSTS_DIR}{L_COLON}</b></td> <td class="row2">{S_POST_SORT_DIR}</td> </tr> <tr> diff --git a/phpBB/styles/subsilver2/template/ucp_profile_avatar.html b/phpBB/styles/subsilver2/template/ucp_profile_avatar.html index 3101cb9c18..160f8a2399 100644 --- a/phpBB/styles/subsilver2/template/ucp_profile_avatar.html +++ b/phpBB/styles/subsilver2/template/ucp_profile_avatar.html @@ -10,7 +10,7 @@ </tr> <!-- ENDIF --> <tr> - <td class="row1" width="35%"><b class="genmed">{L_CURRENT_IMAGE}: </b><br /><span class="gensmall">{L_AVATAR_EXPLAIN}</span></td> + <td class="row1" width="35%"><b class="genmed">{L_CURRENT_IMAGE}{L_COLON} </b><br /><span class="gensmall">{L_AVATAR_EXPLAIN}</span></td> <td class="row2" align="center"><br /> <!-- IF AVATAR -->{AVATAR}<br /><br /><input type="checkbox" class="radio" name="delete" /> <span class="gensmall">{L_DELETE_AVATAR}</span> <!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" /> @@ -23,29 +23,29 @@ <!-- ENDIF --> <!-- IF S_UPLOAD_AVATAR_FILE --> <tr> - <td class="row1" width="35%"><b class="genmed">{L_UPLOAD_AVATAR_FILE}: </b></td> + <td class="row1" width="35%"><b class="genmed">{L_UPLOAD_AVATAR_FILE}{L_COLON} </b></td> <td class="row2"><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_SIZE}" /><input class="post" type="file" name="uploadfile" /></td> </tr> <!-- ENDIF --> <!-- IF S_UPLOAD_AVATAR_URL --> <tr> - <td class="row1" width="35%"><b class="genmed">{L_UPLOAD_AVATAR_URL}: </b><br /><span class="gensmall">{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></td> + <td class="row1" width="35%"><b class="genmed">{L_UPLOAD_AVATAR_URL}{L_COLON} </b><br /><span class="gensmall">{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></td> <td class="row2"><input class="post" type="text" name="uploadurl" size="40" value="{AVATAR_URL}" /></td> </tr> <!-- ENDIF --> <!-- IF S_LINK_AVATAR --> <tr> - <td class="row1" width="35%"><b class="genmed">{L_LINK_REMOTE_AVATAR}: </b><br /><span class="gensmall">{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></td> + <td class="row1" width="35%"><b class="genmed">{L_LINK_REMOTE_AVATAR}{L_COLON} </b><br /><span class="gensmall">{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></td> <td class="row2"><input class="post" type="text" name="remotelink" size="40" value="{AVATAR_REMOTE}" /></td> </tr> <tr> - <td class="row1" width="35%"><b class="genmed">{L_LINK_REMOTE_SIZE}: </b><br /><span class="gensmall">{L_LINK_REMOTE_SIZE_EXPLAIN}</span></td> + <td class="row1" width="35%"><b class="genmed">{L_LINK_REMOTE_SIZE}{L_COLON} </b><br /><span class="gensmall">{L_LINK_REMOTE_SIZE_EXPLAIN}</span></td> <td class="row2"><input class="post" type="text" name="width" size="3" value="{AVATAR_WIDTH}" /> <span class="gen">{L_PIXEL} × </span> <input class="post" type="text" name="height" size="3" value="{AVATAR_HEIGHT}" /> <span class="gen">{L_PIXEL}</span></td> </tr> <!-- ENDIF --> <!-- IF S_DISPLAY_GALLERY --> <tr> - <td class="row1" width="35%"><b class="genmed">{L_AVATAR_GALLERY}: </b></td> + <td class="row1" width="35%"><b class="genmed">{L_AVATAR_GALLERY}{L_COLON} </b></td> <td class="row2"><strong><a href="{U_GALLERY}">{L_DISPLAY_GALLERY}</a></strong></td> </tr> <!-- ENDIF --> @@ -55,7 +55,7 @@ <th colspan="2">{L_AVATAR_GALLERY}</th> </tr> <tr> - <td class="cat" colspan="2" align="center" valign="middle"><span class="genmed">{L_AVATAR_CATEGORY}: </span><select name="category">{S_CAT_OPTIONS}</select> <input class="btnlite" tabindex="0" type="submit" value="{L_GO}" name="display_gallery" /></td> + <td class="cat" colspan="2" align="center" valign="middle"><span class="genmed">{L_AVATAR_CATEGORY}{L_COLON} </span><select name="category">{S_CAT_OPTIONS}</select> <input class="btnlite" tabindex="0" type="submit" value="{L_GO}" name="display_gallery" /></td> </tr> <tr> <td class="row1" colspan="2" align="center"> diff --git a/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html b/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html index 6d5e65a050..19259aebc8 100644 --- a/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html +++ b/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html @@ -13,51 +13,51 @@ <td class="row1" colspan="2"><span class="gensmall">{L_PROFILE_INFO_NOTICE}</span></td> </tr> <tr> - <td class="row1" width="35%"><b class="genmed">{L_UCP_ICQ}: </b></td> + <td class="row1" width="35%"><b class="genmed">{L_UCP_ICQ}{L_COLON} </b></td> <td class="row2"><input class="post" type="text" name="icq" size="30" maxlength="15" value="{ICQ}" /></td> </tr> <tr> - <td class="row1" width="35%"><b class="genmed">{L_UCP_AIM}: </b></td> + <td class="row1" width="35%"><b class="genmed">{L_UCP_AIM}{L_COLON} </b></td> <td class="row2"><input class="post" type="text" name="aim" size="30" maxlength="255" value="{AIM}" /></td> </tr> <tr> - <td class="row1" width="35%"><b class="genmed">{L_UCP_MSNM}: </b></td> + <td class="row1" width="35%"><b class="genmed">{L_UCP_MSNM}{L_COLON} </b></td> <td class="row2"><input class="post" type="text" name="msn" size="30" maxlength="255" value="{MSN}" /></td> </tr> <tr> - <td class="row1" width="35%"><b class="genmed">{L_UCP_YIM}: </b></td> + <td class="row1" width="35%"><b class="genmed">{L_UCP_YIM}{L_COLON} </b></td> <td class="row2"><input class="post" type="text" name="yim" size="30" maxlength="255" value="{YIM}" /></td> </tr> <tr> - <td class="row1" width="35%"><b class="genmed">{L_UCP_JABBER}: </b></td> + <td class="row1" width="35%"><b class="genmed">{L_UCP_JABBER}{L_COLON} </b></td> <td class="row2"><input class="post" type="text" name="jabber" size="30" maxlength="255" value="{JABBER}" /></td> </tr> <tr> - <td class="row1" width="35%"><b class="genmed">{L_WEBSITE}: </b></td> + <td class="row1" width="35%"><b class="genmed">{L_WEBSITE}{L_COLON} </b></td> <td class="row2"><input class="post" type="text" name="website" size="30" maxlength="255" value="{WEBSITE}" /></td> </tr> <tr> - <td class="row1" width="35%"><b class="genmed">{L_LOCATION}: </b></td> + <td class="row1" width="35%"><b class="genmed">{L_LOCATION}{L_COLON} </b></td> <td class="row2"><input class="post" type="text" name="location" size="30" maxlength="100" value="{LOCATION}" /></td> </tr> <tr> - <td class="row1" width="35%"><b class="genmed">{L_OCCUPATION}: </b></td> + <td class="row1" width="35%"><b class="genmed">{L_OCCUPATION}{L_COLON} </b></td> <td class="row2"><textarea class="post" name="occupation" rows="3" cols="30">{OCCUPATION}</textarea></td> </tr> <tr> - <td class="row1" width="35%"><b class="genmed">{L_INTERESTS}: </b></td> + <td class="row1" width="35%"><b class="genmed">{L_INTERESTS}{L_COLON} </b></td> <td class="row2"><textarea class="post" name="interests" rows="3" cols="30">{INTERESTS}</textarea></td> </tr> <!-- IF S_BIRTHDAYS_ENABLED --> <tr> - <td class="row1" width="35%"><b class="genmed">{L_BIRTHDAY}: </b><br /><span class="gensmall">{L_BIRTHDAY_EXPLAIN}</span></td> - <td class="row2"><span class="genmed">{L_DAY}:</span> <select name="bday_day">{S_BIRTHDAY_DAY_OPTIONS}</select> <span class="genmed">{L_MONTH}:</span> <select name="bday_month">{S_BIRTHDAY_MONTH_OPTIONS}</select> <span class="genmed">{L_YEAR}:</span> <select name="bday_year">{S_BIRTHDAY_YEAR_OPTIONS}</select></td> + <td class="row1" width="35%"><b class="genmed">{L_BIRTHDAY}{L_COLON} </b><br /><span class="gensmall">{L_BIRTHDAY_EXPLAIN}</span></td> + <td class="row2"><span class="genmed">{L_DAY}{L_COLON}</span> <select name="bday_day">{S_BIRTHDAY_DAY_OPTIONS}</select> <span class="genmed">{L_MONTH}{L_COLON}</span> <select name="bday_month">{S_BIRTHDAY_MONTH_OPTIONS}</select> <span class="genmed">{L_YEAR}{L_COLON}</span> <select name="bday_year">{S_BIRTHDAY_YEAR_OPTIONS}</select></td> </tr> <!-- ENDIF --> <!-- BEGIN profile_fields --> <tr> <td class="row1" width="35%"> - <b class="genmed">{profile_fields.LANG_NAME}: </b> + <b class="genmed">{profile_fields.LANG_NAME}{L_COLON} </b> <!-- IF profile_fields.S_REQUIRED --><b>*</b><!-- ENDIF --> <!-- IF profile_fields.LANG_EXPLAIN --><br /><span class="gensmall">{profile_fields.LANG_EXPLAIN}</span><!-- ENDIF --> </td> diff --git a/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html b/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html index 71b34499d1..5b65fdb8af 100644 --- a/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html +++ b/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html @@ -15,20 +15,20 @@ </tr> <!-- ENDIF --> <tr> - <td class="row1" width="35%"><b class="genmed">{L_USERNAME}: </b><br /><span class="gensmall">{L_USERNAME_EXPLAIN}</span></td> + <td class="row1" width="35%"><b class="genmed">{L_USERNAME}{L_COLON} </b><br /><span class="gensmall">{L_USERNAME_EXPLAIN}</span></td> <td class="row2"><!-- IF S_CHANGE_USERNAME --><input type="text" class="post" name="username" size="30" value="{USERNAME}" /><!-- ELSE --><b class="gen">{USERNAME}</b><!-- ENDIF --></td> </tr> <tr> - <td class="row1" width="35%"><b class="genmed">{L_EMAIL_ADDRESS}: </b></td> + <td class="row1" width="35%"><b class="genmed">{L_EMAIL_ADDRESS}{L_COLON} </b></td> <td class="row2"><!-- IF S_CHANGE_EMAIL --><input type="text" class="post" name="email" size="30" maxlength="100" value="{EMAIL}" /><!-- ELSE --><b class="gen">{EMAIL}</b><!-- ENDIF --></td> </tr> <!-- IF S_CHANGE_PASSWORD --> <tr> - <td class="row1" width="35%"><b class="genmed">{L_NEW_PASSWORD}: </b><br /><span class="gensmall">{L_CHANGE_PASSWORD_EXPLAIN}</span></td> + <td class="row1" width="35%"><b class="genmed">{L_NEW_PASSWORD}{L_COLON} </b><br /><span class="gensmall">{L_CHANGE_PASSWORD_EXPLAIN}</span></td> <td class="row2"><input type="password" class="post" name="new_password" size="30" maxlength="255" value="{NEW_PASSWORD}" /></td> </tr> <tr> - <td class="row1" width="35%"><b class="genmed">{L_CONFIRM_PASSWORD}: </b><br /><span class="gensmall">{L_CONFIRM_PASSWORD_EXPLAIN}</span></td> + <td class="row1" width="35%"><b class="genmed">{L_CONFIRM_PASSWORD}{L_COLON} </b><br /><span class="gensmall">{L_CONFIRM_PASSWORD_EXPLAIN}</span></td> <td class="row2"><input type="password" class="post" name="password_confirm" size="30" maxlength="255" value="{PASSWORD_CONFIRM}" /></td> </tr> <!-- ENDIF --> @@ -36,7 +36,7 @@ <th colspan="2">{L_CONFIRM_CHANGES}</th> </tr> <tr> - <td class="row1" width="35%"><b class="genmed">{L_CURRENT_PASSWORD}: </b><br /><span class="gensmall"><!-- IF S_CHANGE_PASSWORD -->{L_CURRENT_CHANGE_PASSWORD_EXPLAIN}<!-- ELSE -->{L_CURRENT_PASSWORD_EXPLAIN}<!-- ENDIF --></span></td> + <td class="row1" width="35%"><b class="genmed">{L_CURRENT_PASSWORD}{L_COLON} </b><br /><span class="gensmall"><!-- IF S_CHANGE_PASSWORD -->{L_CURRENT_CHANGE_PASSWORD_EXPLAIN}<!-- ELSE -->{L_CURRENT_PASSWORD_EXPLAIN}<!-- ENDIF --></span></td> <td class="row2"><input type="password" class="post" name="cur_password" size="30" maxlength="255" value="{CUR_PASSWORD}" /></td> </tr> <tr> diff --git a/phpBB/styles/subsilver2/template/ucp_register.html b/phpBB/styles/subsilver2/template/ucp_register.html index 0c3533292d..01808dfc69 100644 --- a/phpBB/styles/subsilver2/template/ucp_register.html +++ b/phpBB/styles/subsilver2/template/ucp_register.html @@ -34,29 +34,28 @@ <!-- ENDIF --> <tr> - <td class="row1" width="38%"><b class="genmed">{L_USERNAME}: </b><br /><span class="gensmall">{L_USERNAME_EXPLAIN}</span></td> + <td class="row1" width="38%"><b class="genmed">{L_USERNAME}{L_COLON} </b><br /><span class="gensmall">{L_USERNAME_EXPLAIN}</span></td> <td class="row2"><input class="post" type="text" name="username" size="25" value="{USERNAME}" /></td> </tr> <tr> - <td class="row1"><b class="genmed">{L_EMAIL_ADDRESS}: </b></td> + <td class="row1"><b class="genmed">{L_EMAIL_ADDRESS}{L_COLON} </b></td> <td class="row2"><input class="post" type="text" name="email" size="25" maxlength="100" value="{EMAIL}" /></td> </tr> <tr> - <td class="row1"><b class="genmed">{L_PASSWORD}: </b><br /><span class="gensmall">{L_PASSWORD_EXPLAIN}</span></td> + <td class="row1"><b class="genmed">{L_PASSWORD}{L_COLON} </b><br /><span class="gensmall">{L_PASSWORD_EXPLAIN}</span></td> <td class="row2"><input class="post" type="password" name="new_password" size="25" value="{PASSWORD}" /></td> </tr> <tr> - <td class="row1"><b class="genmed">{L_CONFIRM_PASSWORD}: </b></td> + <td class="row1"><b class="genmed">{L_CONFIRM_PASSWORD}{L_COLON} </b></td> <td class="row2"><input class="post" type="password" name="password_confirm" size="25" value="{PASSWORD_CONFIRM}" /></td> </tr> <tr> - <td class="row1"><b class="genmed">{L_LANGUAGE}: </b></td> + <td class="row1"><b class="genmed">{L_LANGUAGE}{L_COLON} </b></td> <td class="row2"><select name="lang" onchange="change_language(this.value); return false;">{S_LANG_OPTIONS}</select></td> </tr> -<tr> - <td class="row1"><b class="genmed">{L_TIMEZONE}: </b></td> - <td class="row2"><select name="tz">{S_TZ_OPTIONS}</select></td> -</tr> + +<!-- INCLUDE timezone_option.html --> + <!-- IF .profile_fields --> <tr> <td class="row2" colspan="2"><span class="gensmall">{L_ITEMS_REQUIRED}</span></td> @@ -64,7 +63,7 @@ <!-- BEGIN profile_fields --> <tr> <td class="row1" width="35%"> - <b class="genmed">{profile_fields.LANG_NAME}: </b> + <b class="genmed">{profile_fields.LANG_NAME}{L_COLON} </b> <!-- IF profile_fields.S_REQUIRED --><b>*</b><!-- ENDIF --> <!-- IF profile_fields.LANG_EXPLAIN --><br /><span class="gensmall">{profile_fields.LANG_EXPLAIN}</span><!-- ENDIF --> </td> diff --git a/phpBB/styles/subsilver2/template/ucp_remind.html b/phpBB/styles/subsilver2/template/ucp_remind.html index bf3ded394c..5151ccfad3 100644 --- a/phpBB/styles/subsilver2/template/ucp_remind.html +++ b/phpBB/styles/subsilver2/template/ucp_remind.html @@ -9,11 +9,11 @@ <th colspan="2">{L_SEND_PASSWORD}</th> </tr> <tr> - <td class="row1" width="38%"><b class="genmed">{L_USERNAME}: </b></td> + <td class="row1" width="38%"><b class="genmed">{L_USERNAME}{L_COLON} </b></td> <td class="row2"><input type="text" class="post" name="username" size="25" value="{USERNAME}" /></td> </tr> <tr> - <td class="row1"><b class="genmed">{L_EMAIL_ADDRESS}: </b><br /><span class="gensmall">{L_EMAIL_REMIND}</span></td> + <td class="row1"><b class="genmed">{L_EMAIL_ADDRESS}{L_COLON} </b><br /><span class="gensmall">{L_EMAIL_REMIND}</span></td> <td class="row2"><input type="text" class="post" name="email" size="25" maxlength="100" value="{EMAIL}" /></td> </tr> <tr> diff --git a/phpBB/styles/subsilver2/template/ucp_resend.html b/phpBB/styles/subsilver2/template/ucp_resend.html index 3180334180..7e88f6ede2 100644 --- a/phpBB/styles/subsilver2/template/ucp_resend.html +++ b/phpBB/styles/subsilver2/template/ucp_resend.html @@ -9,11 +9,11 @@ <th colspan="2">{L_UCP_RESEND}</th> </tr> <tr> - <td class="row1" width="38%"><b class="genmed">{L_USERNAME}: </b></td> + <td class="row1" width="38%"><b class="genmed">{L_USERNAME}{L_COLON} </b></td> <td class="row2"><input type="text" class="post" name="username" size="25" value="{USERNAME}" /></td> </tr> <tr> - <td class="row1"><b class="genmed">{L_EMAIL_ADDRESS}: </b><br /><span class="gensmall">{L_EMAIL_REMIND}</span></td> + <td class="row1"><b class="genmed">{L_EMAIL_ADDRESS}{L_COLON} </b><br /><span class="gensmall">{L_EMAIL_REMIND}</span></td> <td class="row2"><input type="text" class="post" name="email" size="25" maxlength="100" value="{EMAIL}" /></td> </tr> <tr> diff --git a/phpBB/styles/subsilver2/template/ucp_zebra_foes.html b/phpBB/styles/subsilver2/template/ucp_zebra_foes.html index fb1167654e..6149a80e69 100644 --- a/phpBB/styles/subsilver2/template/ucp_zebra_foes.html +++ b/phpBB/styles/subsilver2/template/ucp_zebra_foes.html @@ -13,11 +13,11 @@ </tr> <!-- ENDIF --> <tr> - <td class="row1" width="40%"><b class="genmed">{L_YOUR_FOES}:</b><br /><span class="gensmall">{L_YOUR_FOES_EXPLAIN}</span></td> + <td class="row1" width="40%"><b class="genmed">{L_YOUR_FOES}{L_COLON}</b><br /><span class="gensmall">{L_YOUR_FOES_EXPLAIN}</span></td> <td class="row2" align="center"><!-- IF S_USERNAME_OPTIONS --><select name="usernames[]" multiple="multiple" size="5">{S_USERNAME_OPTIONS}</select><!-- ELSE --><b class="genmed">{L_NO_FOES}</b><!-- ENDIF --></td> </tr> <tr> - <td class="row1"><b class="genmed">{L_ADD_FOES}:</b><br /><span class="gensmall">{L_ADD_FOES_EXPLAIN} [ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span></td> + <td class="row1"><b class="genmed">{L_ADD_FOES}{L_COLON}</b><br /><span class="gensmall">{L_ADD_FOES_EXPLAIN} [ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span></td> <td class="row2" align="center"><textarea name="add" rows="5" cols="30">{USERNAMES}</textarea><br /></td> </tr> <tr> diff --git a/phpBB/styles/subsilver2/template/ucp_zebra_friends.html b/phpBB/styles/subsilver2/template/ucp_zebra_friends.html index 6ba4f0f671..45280a35c5 100644 --- a/phpBB/styles/subsilver2/template/ucp_zebra_friends.html +++ b/phpBB/styles/subsilver2/template/ucp_zebra_friends.html @@ -13,11 +13,11 @@ </tr> <!-- ENDIF --> <tr> - <td class="row1" width="40%"><b class="genmed">{L_YOUR_FRIENDS}:</b><br /><span class="gensmall">{L_YOUR_FRIENDS_EXPLAIN}</span></td> + <td class="row1" width="40%"><b class="genmed">{L_YOUR_FRIENDS}{L_COLON}</b><br /><span class="gensmall">{L_YOUR_FRIENDS_EXPLAIN}</span></td> <td class="row2" align="center"><!-- IF S_USERNAME_OPTIONS --><select name="usernames[]" multiple="multiple" size="5">{S_USERNAME_OPTIONS}</select><!-- ELSE --><b class="genmed">{L_NO_FRIENDS}</b><!-- ENDIF --></td> </tr> <tr> - <td class="row1"><b class="genmed">{L_ADD_FRIENDS}:</b><br /><span class="gensmall">{L_ADD_FRIENDS_EXPLAIN} [ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span></td> + <td class="row1"><b class="genmed">{L_ADD_FRIENDS}{L_COLON}</b><br /><span class="gensmall">{L_ADD_FRIENDS_EXPLAIN} [ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span></td> <td class="row2" align="center"><textarea name="add" rows="5" cols="30">{USERNAMES}</textarea><br /></td> </tr> <tr> diff --git a/phpBB/styles/subsilver2/template/viewforum_body.html b/phpBB/styles/subsilver2/template/viewforum_body.html index f132185716..c5e66a07ca 100644 --- a/phpBB/styles/subsilver2/template/viewforum_body.html +++ b/phpBB/styles/subsilver2/template/viewforum_body.html @@ -41,15 +41,24 @@ <!-- ENDIF --> <td class="row1"> <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}" class="imageset">{NEWEST_POST_IMG}</a><!-- ENDIF --> - {topicrow.ATTACH_ICON_IMG} <!-- IF topicrow.S_HAS_POLL or topicrow.S_TOPIC_MOVED --><b>{topicrow.TOPIC_TYPE}</b> <!-- ENDIF --><a title="{L_POSTED}: {topicrow.FIRST_POST_TIME}" href="{topicrow.U_VIEW_TOPIC}"class="topictitle">{topicrow.TOPIC_TITLE}</a> + {topicrow.ATTACH_ICON_IMG} <!-- IF topicrow.S_HAS_POLL or topicrow.S_TOPIC_MOVED --><b>{topicrow.TOPIC_TYPE}</b> <!-- ENDIF --><a title="{L_POSTED}{L_COLON} {topicrow.FIRST_POST_TIME}" href="{topicrow.U_VIEW_TOPIC}"class="topictitle">{topicrow.TOPIC_TITLE}</a> <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --> <a href="{topicrow.U_MCP_QUEUE}" class="imageset">{UNAPPROVED_IMG}</a> <!-- ENDIF --> <!-- IF topicrow.S_TOPIC_REPORTED --> <a href="{topicrow.U_MCP_REPORT}" class="imageset">{REPORTED_IMG}</a> <!-- ENDIF --> - <!-- IF topicrow.PAGINATION --> - <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {topicrow.PAGINATION} ] </p> + <!-- IF .topicrow.pagination --> + <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}{L_COLON} + <!-- BEGIN pagination --> + <!-- IF topicrow.pagination.S_IS_PREV --> + <!-- ELSEIF topicrow.pagination.S_IS_CURRENT --><strong>{topicrow.pagination.PAGE_NUMBER}</strong> + <!-- ELSEIF topicrow.pagination.S_IS_ELLIPSIS --> {L_ELLIPSIS} + <!-- ELSEIF topicrow.pagination.S_IS_NEXT --> + <!-- ELSE --><a href="{topicrow.pagination.PAGE_URL}">{topicrow.pagination.PAGE_NUMBER}</a> + <!-- ENDIF --> + <!-- END pagination --> + ] </p> <!-- ENDIF --> </td> <td class="row2" width="130" align="center"><p class="topicauthor">{topicrow.TOPIC_AUTHOR_FULL}</p></td> @@ -92,7 +101,7 @@ <h2><a class="titles" href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2> <!-- IF MODERATORS --> - <p class="moderators"><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->: {MODERATORS}</p> + <p class="moderators"><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->{L_COLON} {MODERATORS}</p> <!-- ENDIF --> <!-- IF U_MCP --> <p class="linkmcp">[ <a href="{U_MCP}">{L_MCP}</a> ]</p> @@ -122,7 +131,7 @@ <td class="cat"><h4><a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a></h4></td> </tr> <tr> - <td class="row1" align="center"><span class="genmed">{L_USERNAME}:</span> <input class="post" type="text" name="username" size="10" /> <span class="genmed">{L_PASSWORD}:</span> <input class="post" type="password" name="password" size="10" /><!-- IF S_AUTOLOGIN_ENABLED --> <span class="gensmall">{L_LOG_ME_IN}</span> <input type="checkbox" class="radio" name="autologin" /><!-- ENDIF --> <input type="submit" class="btnmain" name="login" value="{L_LOGIN}" /></td> + <td class="row1" align="center"><span class="genmed">{L_USERNAME}{L_COLON}</span> <input class="post" type="text" name="username" size="10" /> <span class="genmed">{L_PASSWORD}{L_COLON}</span> <input class="post" type="password" name="password" size="10" /><!-- IF S_AUTOLOGIN_ENABLED --> <span class="gensmall">{L_LOG_ME_IN}</span> <input type="checkbox" class="radio" name="autologin" /><!-- ENDIF --> <input type="submit" class="btnmain" name="login" value="{L_LOGIN}" /></td> </tr> </table> {S_LOGIN_REDIRECT} @@ -154,7 +163,7 @@ <td class="cat" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->"> <table width="100%" cellspacing="0"> <tr class="nav"> - <td valign="middle"> <!-- IF S_WATCH_FORUM_LINK and not S_IS_BOT --><a href="{S_WATCH_FORUM_LINK}">{S_WATCH_FORUM_TITLE}</a><!-- ENDIF --></td> + <td valign="middle"> <!-- IF U_WATCH_FORUM_LINK and not S_IS_BOT --><a href="{U_WATCH_FORUM_LINK}">{S_WATCH_FORUM_TITLE}</a><!-- ENDIF --></td> <td align="{S_CONTENT_FLOW_END}" valign="middle"><!-- IF not S_IS_BOT and U_MARK_TOPICS --><a href="{U_MARK_TOPICS}">{L_MARK_TOPICS_READ}</a><!-- ENDIF --> </td> </tr> </table> @@ -192,15 +201,24 @@ <!-- ENDIF --> <td class="row1"> <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}" class="imageset">{NEWEST_POST_IMG}</a><!-- ENDIF --> - {topicrow.ATTACH_ICON_IMG} <!-- IF topicrow.S_HAS_POLL or topicrow.S_TOPIC_MOVED --><b>{topicrow.TOPIC_TYPE}</b> <!-- ENDIF --><a title="{L_POSTED}: {topicrow.FIRST_POST_TIME}" href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a> + {topicrow.ATTACH_ICON_IMG} <!-- IF topicrow.S_HAS_POLL or topicrow.S_TOPIC_MOVED --><b>{topicrow.TOPIC_TYPE}</b> <!-- ENDIF --><a title="{L_POSTED}{L_COLON} {topicrow.FIRST_POST_TIME}" href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a> <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --> <a href="{topicrow.U_MCP_QUEUE}" class="imageset">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF --> <!-- IF topicrow.S_TOPIC_REPORTED --> <a href="{topicrow.U_MCP_REPORT}" class="imageset">{REPORTED_IMG}</a> <!-- ENDIF --> - <!-- IF topicrow.PAGINATION --> - <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {topicrow.PAGINATION} ] </p> + <!-- IF .topicrow.pagination --> + <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}{L_COLON} + <!-- BEGIN pagination --> + <!-- IF topicrow.pagination.S_IS_PREV --> + <!-- ELSEIF topicrow.pagination.S_IS_CURRENT --><strong>{topicrow.pagination.PAGE_NUMBER}</strong> + <!-- ELSEIF topicrow.pagination.S_IS_ELLIPSIS --> {L_ELLIPSIS} + <!-- ELSEIF topicrow.pagination.S_IS_NEXT --> + <!-- ELSE --><a href="{topicrow.pagination.PAGE_URL}">{topicrow.pagination.PAGE_NUMBER}</a> + <!-- ENDIF --> + <!-- END pagination --> + ] </p> <!-- ENDIF --> <!-- IF topicrow.S_POST_GLOBAL and FORUM_ID != topicrow.FORUM_ID --><p class="gensmall">{L_IN} <a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a></p><!-- ENDIF --> </td> @@ -234,7 +252,7 @@ <!-- ELSE --> <td class="cat" colspan="6"> <!-- ENDIF --> - <form method="post" action="{S_FORUM_ACTION}"><span class="gensmall">{L_DISPLAY_TOPICS}:</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" name="sort" value="{L_GO}" /></form> + <form method="post" action="{S_FORUM_ACTION}"><span class="gensmall">{L_DISPLAY_TOPICS}{L_COLON}</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" name="sort" value="{L_GO}" /></form> </td> </tr> <!-- ENDIF --> diff --git a/phpBB/styles/subsilver2/template/viewonline_body.html b/phpBB/styles/subsilver2/template/viewonline_body.html index 1c8734d06a..70b8b52efa 100644 --- a/phpBB/styles/subsilver2/template/viewonline_body.html +++ b/phpBB/styles/subsilver2/template/viewonline_body.html @@ -4,11 +4,11 @@ <h4>{TOTAL_GUEST_USERS_ONLINE}<!-- IF S_SWITCH_GUEST_DISPLAY --> [ <a href="{U_SWITCH_GUEST_DISPLAY}">{L_SWITCH_GUEST_DISPLAY}</a> ]<!-- ENDIF --></h4> <br /> -<!-- IF PAGINATION --> +<!-- IF .pagination --> <table width="100%" cellspacing="1"> <tr> <td class="nav" valign="middle" nowrap="nowrap"> {PAGE_NUMBER}<br /></td> - <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><b><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b></td> + <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --></td> </tr> </table> <!-- ENDIF --> @@ -21,7 +21,7 @@ </tr> <!-- BEGIN user_row --> <tr> - <td class="row1"><p class="gen">{user_row.USERNAME_FULL}</p><!-- IF user_row.USER_IP --><p class="gensmall">{L_IP}: <a href="{user_row.U_USER_IP}">{user_row.USER_IP}</a> » <a href="{user_row.U_WHOIS}" onclick="popup(this.href, 750, 500); return false;">{L_WHOIS}</a></p><!-- ENDIF --> + <td class="row1"><p class="gen">{user_row.USERNAME_FULL}</p><!-- IF user_row.USER_IP --><p class="gensmall">{L_IP}{L_COLON} <a href="{user_row.U_USER_IP}">{user_row.USER_IP}</a> » <a href="{user_row.U_WHOIS}" onclick="popup(this.href, 750, 500); return false;">{L_WHOIS}</a></p><!-- ENDIF --> <!-- IF user_row.USER_BROWSER -->{user_row.USER_BROWSER}<!-- ENDIF --></td> <td class="row2" align="center" nowrap="nowrap"><p class="genmed"> {user_row.LASTUPDATE}</p></td> <td class="row1"><p class="genmed"><a href="{user_row.U_FORUM_LOCATION}">{user_row.FORUM_LOCATION}</a></p></td> @@ -35,11 +35,11 @@ <!-- ENDIF --> </table> -<!-- IF PAGINATION --> +<!-- IF .pagination --> <table width="100%" cellspacing="1"> <tr> <td class="nav" valign="middle" nowrap="nowrap"> {PAGE_NUMBER}<br /></td> - <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><b><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b></td> + <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --></td> </tr> </table> <!-- ENDIF --> diff --git a/phpBB/styles/subsilver2/template/viewtopic_body.html b/phpBB/styles/subsilver2/template/viewtopic_body.html index 2c5351b926..e2834ffa0b 100644 --- a/phpBB/styles/subsilver2/template/viewtopic_body.html +++ b/phpBB/styles/subsilver2/template/viewtopic_body.html @@ -18,7 +18,7 @@ <h2><a class="titles" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h2> <!-- IF MODERATORS --> - <p class="moderators"><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->: {MODERATORS}</p> + <p class="moderators"><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->{L_COLON} {MODERATORS}</p> <!-- ENDIF --> <!-- IF U_MCP --> <p class="linkmcp">[ <a href="{U_MCP}">{L_MCP}</a> ]</p> @@ -52,8 +52,8 @@ <tr> <td class="nav" nowrap="nowrap"> <!-- IF not S_IS_BOT --> - <!-- IF U_WATCH_TOPIC --><a href="{U_WATCH_TOPIC}" title="{L_WATCH_TOPIC}">{L_WATCH_TOPIC}</a><!-- IF U_PRINT_TOPIC or U_EMAIL_TOPIC or U_BUMP_TOPIC or U_BOOKMARK_TOPIC --> | <!-- ENDIF --><!-- ENDIF --> - <!-- IF U_BOOKMARK_TOPIC --><a href="{U_BOOKMARK_TOPIC}" title="{L_BOOKMARK_TOPIC}">{L_BOOKMARK_TOPIC}</a><!-- IF U_PRINT_TOPIC or U_EMAIL_TOPIC or U_BUMP_TOPIC --> | <!-- ENDIF --><!-- ENDIF --> + <!-- IF U_WATCH_TOPIC --><a href="{U_WATCH_TOPIC}" title="{S_WATCH_TOPIC_TITLE}">{S_WATCH_TOPIC_TITLE}</a><!-- IF U_PRINT_TOPIC or U_EMAIL_TOPIC or U_BUMP_TOPIC or U_BOOKMARK_TOPIC --> | <!-- ENDIF --><!-- ENDIF --> + <!-- IF U_BOOKMARK_TOPIC --><a href="{U_BOOKMARK_TOPIC}" title="{S_BOOKMARK_TOPIC}">{S_BOOKMARK_TOPIC}</a><!-- IF U_PRINT_TOPIC or U_EMAIL_TOPIC or U_BUMP_TOPIC --> | <!-- ENDIF --><!-- ENDIF --> <!-- IF U_PRINT_TOPIC --><a href="{U_PRINT_TOPIC}" title="{L_PRINT_TOPIC}">{L_PRINT_TOPIC}</a><!-- IF U_EMAIL_TOPIC or U_BUMP_TOPIC --> | <!-- ENDIF --><!-- ENDIF --> <!-- IF U_EMAIL_TOPIC --><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}">{L_EMAIL_TOPIC}</a><!-- IF U_BUMP_TOPIC --> | <!-- ENDIF --><!-- ENDIF --> <!-- IF U_BUMP_TOPIC --><a href="{U_BUMP_TOPIC}" title="{L_BUMP_TOPIC}">{L_BUMP_TOPIC}</a><!-- ENDIF --> @@ -109,7 +109,7 @@ <!-- ENDIF --> <!-- IF S_DISPLAY_RESULTS --> <tr> - <td class="gensmall" colspan="4" align="center"><b>{L_TOTAL_VOTES} : {TOTAL_VOTES}</b></td> + <td class="gensmall" colspan="4" align="center"><b>{L_TOTAL_VOTES}{L_COLON} {TOTAL_VOTES}</b></td> </tr> <!-- ELSE --> <tr> @@ -150,7 +150,7 @@ <!-- IF postrow.POST_ICON_IMG --> <td><img src="{T_ICONS_PATH}{postrow.POST_ICON_IMG}" width="{postrow.POST_ICON_IMG_WIDTH}" height="{postrow.POST_ICON_IMG_HEIGHT}" alt="" title="" /></td> <!-- ENDIF --> - <td class="gensmall" width="100%"><div style="float: {S_CONTENT_FLOW_BEGIN};"> <b>{L_POST_SUBJECT}:</b> <a href="#p{postrow.POST_ID}">{postrow.POST_SUBJECT}</a></div><div style="float: {S_CONTENT_FLOW_END};"><!-- IF S_IS_BOT -->{postrow.MINI_POST_IMG}<!-- ELSE --><a href="{postrow.U_MINI_POST}" class="imageset">{postrow.MINI_POST_IMG}</a><!-- ENDIF --><b>{L_POSTED}:</b> {postrow.POST_DATE} </div></td> + <td class="gensmall" width="100%"><div style="float: {S_CONTENT_FLOW_BEGIN};"> <b>{L_POST_SUBJECT}{L_COLON}</b> <a href="#p{postrow.POST_ID}">{postrow.POST_SUBJECT}</a></div><div style="float: {S_CONTENT_FLOW_END};"><!-- IF S_IS_BOT -->{postrow.MINI_POST_IMG}<!-- ELSE --><a href="{postrow.U_MINI_POST}" class="imageset">{postrow.MINI_POST_IMG}</a><!-- ENDIF --><b>{L_POSTED}{L_COLON}</b> {postrow.POST_DATE} </div></td> </tr> </table> </td> @@ -188,17 +188,17 @@ </table> <span class="postdetails"> - <!-- IF postrow.POSTER_JOINED --><br /><b>{L_JOINED}:</b> {postrow.POSTER_JOINED}<!-- ENDIF --> - <!-- IF postrow.POSTER_POSTS != '' --><br /><b>{L_POSTS}:</b> {postrow.POSTER_POSTS}<!-- ENDIF --> - <!-- IF postrow.POSTER_FROM --><br /><b>{L_LOCATION}:</b> {postrow.POSTER_FROM}<!-- ENDIF --> + <!-- IF postrow.POSTER_JOINED --><br /><b>{L_JOINED}{L_COLON}</b> {postrow.POSTER_JOINED}<!-- ENDIF --> + <!-- IF postrow.POSTER_POSTS != '' --><br /><b>{L_POSTS}{L_COLON}</b> {postrow.POSTER_POSTS}<!-- ENDIF --> + <!-- IF postrow.POSTER_FROM --><br /><b>{L_LOCATION}{L_COLON}</b> {postrow.POSTER_FROM}<!-- ENDIF --> <!-- IF postrow.S_PROFILE_FIELD1 --> <!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. --> - <br /><b>{postrow.PROFILE_FIELD1_NAME}:</b> {postrow.PROFILE_FIELD1_VALUE} + <br /><b>{postrow.PROFILE_FIELD1_NAME}{L_COLON}</b> {postrow.PROFILE_FIELD1_VALUE} <!-- ENDIF --> <!-- BEGIN custom_fields --> - <br /><b>{postrow.custom_fields.PROFILE_FIELD_NAME}:</b> {postrow.custom_fields.PROFILE_FIELD_VALUE} + <br /><b>{postrow.custom_fields.PROFILE_FIELD_NAME}{L_COLON}</b> {postrow.custom_fields.PROFILE_FIELD_VALUE} <!-- END custom_fields --> </span> @@ -224,7 +224,7 @@ <table class="tablebg" width="100%" cellspacing="1"> <tr> - <td class="row3"><b class="genmed">{L_ATTACHMENTS}: </b></td> + <td class="row3"><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td> </tr> <!-- BEGIN attachment --> <tr> @@ -268,9 +268,9 @@ <tr valign="middle"> <td class="gensmall" align="{S_CONTENT_FLOW_END}"> <!-- IF not S_IS_BOT --> - <!-- IF postrow.U_REPORT --><a href="{postrow.U_REPORT}" class="imageset">{REPORT_IMG}</a> <!-- ENDIF --> - <!-- IF postrow.U_INFO --><a href="{postrow.U_INFO}" class="imageset">{INFO_IMG}</a> <!-- ENDIF --> - <!-- IF postrow.U_WARN --><a href="{postrow.U_WARN}" class="imageset">{WARN_IMG}</a> <!-- ENDIF --> + <!-- IF postrow.U_REPORT --><a href="{postrow.U_REPORT}" class="imageset">{REPORT_IMG}</a> <!-- ENDIF --> + <!-- IF postrow.U_INFO --><a href="{postrow.U_INFO}" class="imageset">{INFO_IMG}</a> <!-- ENDIF --> + <!-- IF postrow.U_WARN --><a href="{postrow.U_WARN}" class="imageset">{WARN_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_DELETE --><a href="{postrow.U_DELETE}" class="imageset">{DELETE_IMG}</a> <!-- ENDIF --> <!-- ENDIF --> </td> @@ -298,7 +298,7 @@ <!-- IF not S_IS_BOT --> <table width="100%" cellspacing="1" class="tablebg"> <tr align="center"> - <td class="cat"><form name="viewtopic" method="post" action="{S_TOPIC_ACTION}"><span class="gensmall">{L_DISPLAY_POSTS}:</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" value="{L_GO}" name="sort" /></form></td> + <td class="cat"><form name="viewtopic" method="post" action="{S_TOPIC_ACTION}"><span class="gensmall">{L_DISPLAY_POSTS}{L_COLON}</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" value="{L_GO}" name="sort" /></form></td> </tr> </table> <!-- ENDIF --> @@ -350,7 +350,7 @@ <td width="40%" valign="top" nowrap="nowrap" align="{S_CONTENT_FLOW_BEGIN}"> <!-- IF .quickmod --> <form method="post" action="{S_MOD_ACTION}"> - <span class="gensmall">{L_QUICK_MOD}:</span> + <span class="gensmall">{L_QUICK_MOD}{L_COLON}</span> <select name="action" id="quick-mod-select"> <!-- BEGIN quickmod --> <option value="{quickmod.VALUE}">{quickmod.TITLE}</option> diff --git a/phpBB/styles/subsilver2/template/viewtopic_print.html b/phpBB/styles/subsilver2/template/viewtopic_print.html index 07da8ef752..78fab17d02 100644 --- a/phpBB/styles/subsilver2/template/viewtopic_print.html +++ b/phpBB/styles/subsilver2/template/viewtopic_print.html @@ -88,11 +88,11 @@ hr.sep { <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center"> <tr> - <td width="10%" nowrap="nowrap">{L_AUTHOR}: </td> + <td width="10%" nowrap="nowrap">{L_AUTHOR}{L_COLON} </td> <td><b>{postrow.POST_AUTHOR}</b> [ {postrow.POST_DATE} ]</td> </tr> <tr> - <td width="10%" nowrap="nowrap">{L_POST_SUBJECT}: </td> + <td width="10%" nowrap="nowrap">{L_POST_SUBJECT}{L_COLON} </td> <td><b>{postrow.POST_SUBJECT}</b></td> </tr> <tr> @@ -103,7 +103,7 @@ hr.sep { <table class="tablebg" width="100%" cellspacing="1"> <tr> - <td><b class="genmed">{L_ATTACHMENTS}: </b></td> + <td><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td> </tr> <!-- BEGIN attachment --> <tr> @@ -126,7 +126,7 @@ hr.sep { <td align="{S_CONTENT_FLOW_END}"><span class="gensmall">{S_TIMEZONE}</span></td> </tr> <tr> - <td colspan="2" align="center"><span class="gensmall">Powered by phpBB® Forum Software © phpBB Group<br />http://www.phpbb.com/</span></td> + <td colspan="2" align="center"><span class="gensmall">Powered by phpBB® Forum Software © phpBB Group<br />https://www.phpbb.com/</span></td> </tr> </table> diff --git a/phpBB/styles/subsilver2/theme/stylesheet.css b/phpBB/styles/subsilver2/theme/stylesheet.css index 18d15a8d41..977e5c20c6 100644 --- a/phpBB/styles/subsilver2/theme/stylesheet.css +++ b/phpBB/styles/subsilver2/theme/stylesheet.css @@ -3,7 +3,7 @@ Style name: subsilver2 Based on style: subSilver (the default phpBB 2.0.x style) Original author: Tom Beddard ( http://www.subblue.com/ ) - Modified by: phpBB Group ( http://www.phpbb.com/ ) + Modified by: phpBB Group ( https://www.phpbb.com/ ) -------------------------------------------------------------- */ @@ -422,6 +422,15 @@ a.topictitle:visited { text-decoration: none; } +a.lastsubject { + font-weight: bold; + text-decoration: none; +} + +a.lastsubject:hover { + text-decoration: underline; +} + th a, th a:visited { color: #FFA34F !important; diff --git a/phpBB/ucp.php b/phpBB/ucp.php index 64afa0be67..a7e75f76c4 100644 --- a/phpBB/ucp.php +++ b/phpBB/ucp.php @@ -322,11 +322,17 @@ if (!$config['allow_topic_notify'] && !$config['allow_forum_notify']) $module->set_display('main', 'subscribed', false); } -// Do not display signature panel if not authed to do so -if (!$auth->acl_get('u_sig')) -{ - $module->set_display('profile', 'signature', false); -} +/** +* Use this event to enable and disable additional UCP modules +* +* @event core.ucp_display_module_before +* @var p_master module Object holding all modules and their status +* @var mixed id Active module category (can be the int or string) +* @var string mode Active module +* @since 3.1-A1 +*/ +$vars = array('module', 'id', 'mode'); +extract($phpbb_dispatcher->trigger_event('core.ucp_display_module_before', compact($vars))); // Select the active module $module->set_active($id, $mode); diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 2d91581cf4..83e5d4caa5 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -176,7 +176,7 @@ if ($mark_read == 'topics') $token = request_var('hash', ''); if (check_link_hash($token, 'global')) { - markread('topics', array($forum_id)); + markread('topics', array($forum_id), false, request_var('mark_time', 0)); } $redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id); meta_refresh(3, $redirect_url); @@ -193,8 +193,12 @@ if ($forum_data['forum_topics_per_page']) // Do the forum Prune thang - cron type job ... if (!$config['use_system_cron']) { - $task = $cron->instantiate_task('cron_task_core_prune_forum', $forum_data); - if ($task && $task->is_ready()) + $cron = $phpbb_container->get('cron.manager'); + + $task = $cron->find_task('cron.task.core.prune_forum'); + $task->set_forum_data($forum_data); + + if ($task->is_ready()) { $url = $task->get_url(); $template->assign_var('RUN_CRON_TASK', '<img src="' . $url . '" width="1" height="1" alt="cron" />'); @@ -204,7 +208,9 @@ if (!$config['use_system_cron']) // Forum rules and subscription info $s_watching_forum = array( 'link' => '', + 'link_toggle' => '', 'title' => '', + 'title_toggle' => '', 'is_watching' => false, ); @@ -287,7 +293,7 @@ if (!empty($_EXTRA_URL)) } $template->assign_vars(array( - 'MODERATORS' => (!empty($moderators[$forum_id])) ? implode(', ', $moderators[$forum_id]) : '', + 'MODERATORS' => (!empty($moderators[$forum_id])) ? implode($user->lang['COMMA_SEPARATOR'], $moderators[$forum_id]) : '', 'POST_IMG' => ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->img('button_topic_locked', $post_alt) : $user->img('button_topic_new', $post_alt), 'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'), @@ -318,8 +324,10 @@ $template->assign_vars(array( 'S_SELECT_SORT_KEY' => $s_sort_key, 'S_SELECT_SORT_DAYS' => $s_limit_days, 'S_TOPIC_ICONS' => ($s_display_active && sizeof($active_forum_ary)) ? max($active_forum_ary['enable_icons']) : (($forum_data['enable_icons']) ? true : false), - 'S_WATCH_FORUM_LINK' => $s_watching_forum['link'], + 'U_WATCH_FORUM_LINK' => $s_watching_forum['link'], + 'U_WATCH_FORUM_TOGGLE' => $s_watching_forum['link_toggle'], 'S_WATCH_FORUM_TITLE' => $s_watching_forum['title'], + 'S_WATCH_FORUM_TOGGLE' => $s_watching_forum['title_toggle'], 'S_WATCHING_FORUM' => $s_watching_forum['is_watching'], 'S_FORUM_ACTION' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . (($start == 0) ? '' : "&start=$start")), 'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('u_search') && $auth->acl_get('f_search', $forum_id) && $config['load_search']) ? true : false, @@ -332,7 +340,7 @@ $template->assign_vars(array( 'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&i=main&mode=forum_view", true, $user->session_id) : '', 'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=post&f=' . $forum_id) : '', 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . ((strlen($u_sort_param)) ? "&$u_sort_param" : '') . (($start == 0) ? '' : "&start=$start")), - 'U_MARK_TOPICS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . "&f=$forum_id&mark=topics") : '', + 'U_MARK_TOPICS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . "&f=$forum_id&mark=topics&mark_time=" . time()) : '', )); // Grab icons @@ -586,9 +594,11 @@ if ($s_display_active) // otherwise the number is different from the one on the forum list $total_topic_count = $topics_count - sizeof($global_announce_forums); +$base_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . ((strlen($u_sort_param)) ? "&$u_sort_param" : '')); +phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $topics_count, $config['topics_per_page'], $start); + $template->assign_vars(array( - 'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . ((strlen($u_sort_param)) ? "&$u_sort_param" : '')), $topics_count, $config['topics_per_page'], $start), - 'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start), + 'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $topics_count, $config['topics_per_page'], $start), 'TOTAL_TOPICS' => ($s_display_active) ? false : $user->lang('VIEW_FORUM_TOPICS', (int) $total_topic_count), )); @@ -684,7 +694,7 @@ if (sizeof($topic_list)) $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&t=$topic_id", true, $user->session_id) : ''; // Send vars to template - $template->assign_block_vars('topicrow', array( + $topic_row = array( 'FORUM_ID' => $row['forum_id'], 'TOPIC_ID' => $topic_id, 'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), @@ -698,7 +708,6 @@ if (sizeof($topic_list)) 'LAST_POST_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), 'LAST_POST_AUTHOR_FULL' => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), - 'PAGINATION' => topic_generate_pagination($replies, $view_topic_url), 'REPLIES' => $replies, 'VIEWS' => $row['topic_views'], 'TOPIC_TITLE' => censor_text($row['topic_title']), @@ -737,9 +746,24 @@ if (sizeof($topic_list)) 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=reports&f=' . $row['forum_id'] . '&t=' . $topic_id, true, $user->session_id), 'U_MCP_QUEUE' => $u_mcp_queue, - 'S_TOPIC_TYPE_SWITCH' => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test) + 'S_TOPIC_TYPE_SWITCH' => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test, ); + /** + * Modify the topic data before it is assigned to the template + * + * @event core.viewforum_modify_topicrow + * @var array row Array with topic data + * @var array topic_row Template array with topic data + * @since 3.1-A1 + */ + $vars = array('row', 'topic_row'); + extract($phpbb_dispatcher->trigger_event('core.viewforum_modify_topicrow', compact($vars))); + + $template->assign_block_vars('topicrow', $topic_row); + + phpbb_generate_template_pagination($template, $view_topic_url, 'topicrow.pagination', 'start', $replies + 1, $config['posts_per_page'], 1, true, true); + $s_type_switch = ($row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL) ? 1 : 0; if ($unread_topic) diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index 08ca7f7a04..687fef4c6c 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -121,13 +121,30 @@ if (!$show_guests) } // Get user list -$sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_type, u.user_colour, s.session_id, s.session_time, s.session_page, s.session_ip, s.session_browser, s.session_viewonline, s.session_forum_id - FROM ' . USERS_TABLE . ' u, ' . SESSIONS_TABLE . ' s - WHERE u.user_id = s.session_user_id +$sql_ary = array( + 'SELECT' => 'u.user_id, u.username, u.username_clean, u.user_type, u.user_colour, s.session_id, s.session_time, s.session_page, s.session_ip, s.session_browser, s.session_viewonline, s.session_forum_id', + 'FROM' => array( + USERS_TABLE => 'u', + SESSIONS_TABLE => 's', + ), + 'WHERE' => 'u.user_id = s.session_user_id AND s.session_time >= ' . (time() - ($config['load_online_time'] * 60)) . - ((!$show_guests) ? ' AND s.session_user_id <> ' . ANONYMOUS : '') . ' - ORDER BY ' . $order_by; -$result = $db->sql_query($sql); + ((!$show_guests) ? ' AND s.session_user_id <> ' . ANONYMOUS : ''), + 'ORDER_BY' => $order_by, +); + +/** +* Modify the SQL query for getting the user data to display viewonline list +* +* @event core.viewonline_modify_sql +* @var array sql_ary The SQL array +* @var bool show_guests Do we display guests in the list +* @since 3.1-A1 +*/ +$vars = array('sql_ary', 'show_guests'); +extract($phpbb_dispatcher->trigger_event('core.viewonline_modify_sql', compact($vars))); + +$result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary)); $prev_id = $prev_ip = $user_list = array(); $logged_visible_online = $logged_hidden_online = $counter = 0; @@ -320,6 +337,19 @@ while ($row = $db->sql_fetchrow($result)) break; } + /** + * Overwrite the location's name and URL, which are displayed in the list + * + * @event core.viewonline_overwrite_location + * @var array on_page File name and query string + * @var array row Array with the users sql row + * @var string location Page name to displayed in the list + * @var string location_url Page url to displayed in the list + * @since 3.1-A1 + */ + $vars = array('on_page', 'row', 'location', 'location_url'); + extract($phpbb_dispatcher->trigger_event('core.viewonline_overwrite_location', compact($vars))); + $template->assign_block_vars('user_row', array( 'USERNAME' => $row['username'], 'USERNAME_COLOUR' => $row['user_colour'], @@ -342,8 +372,6 @@ while ($row = $db->sql_fetchrow($result)) $db->sql_freeresult($result); unset($prev_id, $prev_ip); -$pagination = generate_pagination(append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&sk=$sort_key&sd=$sort_dir"), $counter, $config['topics_per_page'], $start); - $order_legend = ($config['legend_sort_groupname']) ? 'group_name' : 'group_legend'; // Grab group details for legend display if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) @@ -386,13 +414,15 @@ $db->sql_freeresult($result); // Refreshing the page every 60 seconds... meta_refresh(60, append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&sk=$sort_key&sd=$sort_dir&start=$start")); +$base_url = append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&sk=$sort_key&sd=$sort_dir"); +phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $counter, $config['topics_per_page'], $start); + // Send data to template $template->assign_vars(array( 'TOTAL_REGISTERED_USERS_ONLINE' => $user->lang('REG_USERS_ONLINE', (int) $logged_visible_online, $user->lang('HIDDEN_USERS_ONLINE', (int) $logged_hidden_online)), 'TOTAL_GUEST_USERS_ONLINE' => $user->lang('GUEST_USERS_ONLINE', (int) $guest_counter), 'LEGEND' => $legend, - 'PAGINATION' => $pagination, - 'PAGE_NUMBER' => on_page($counter, $config['topics_per_page'], $start), + 'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $counter, $config['topics_per_page'], $start), 'U_SORT_USERNAME' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=a&sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a') . '&sg=' . ((int) $show_guests)), 'U_SORT_UPDATED' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=b&sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a') . '&sg=' . ((int) $show_guests)), diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 4306ca2f3f..90cb7e9567 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -450,7 +450,9 @@ $viewtopic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&a // Are we watching this topic? $s_watching_topic = array( 'link' => '', + 'link_toggle' => '', 'title' => '', + 'title_toggle' => '', 'is_watching' => false, ); @@ -544,9 +546,6 @@ foreach($quickmod_array as $option => $qm_ary) } } -// If we've got a hightlight set pass it on to pagination. -$pagination = generate_pagination(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id" . ((strlen($u_sort_param)) ? "&$u_sort_param" : '') . (($highlight_match) ? "&hilit=$highlight" : '')), $total_posts, $config['posts_per_page'], $start); - // Navigation links generate_forum_nav($topic_data); @@ -584,6 +583,10 @@ if (!empty($_EXTRA_URL)) } } +// If we've got a hightlight set pass it on to pagination. +$base_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id" . ((strlen($u_sort_param)) ? "&$u_sort_param" : '') . (($highlight_match) ? "&hilit=$highlight" : '')); +phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $total_posts, $config['posts_per_page'], $start); + // Send vars to template $template->assign_vars(array( 'FORUM_ID' => $forum_id, @@ -597,11 +600,10 @@ $template->assign_vars(array( 'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $topic_data['topic_poster'], $topic_data['topic_first_poster_name'], $topic_data['topic_first_poster_colour']), 'TOPIC_AUTHOR' => get_username_string('username', $topic_data['topic_poster'], $topic_data['topic_first_poster_name'], $topic_data['topic_first_poster_colour']), - 'PAGINATION' => $pagination, - 'PAGE_NUMBER' => on_page($total_posts, $config['posts_per_page'], $start), + 'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $total_posts, $config['posts_per_page'], $start), 'TOTAL_POSTS' => $user->lang('VIEW_TOPIC_POSTS', (int) $total_posts), 'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=topic_view&f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start") . ((strlen($u_sort_param)) ? "&$u_sort_param" : ''), true, $user->session_id) : '', - 'MODERATORS' => (isset($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id])) ? implode(', ', $forum_moderators[$forum_id]) : '', + 'MODERATORS' => (isset($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id])) ? implode($user->lang['COMMA_SEPARATOR'], $forum_moderators[$forum_id]) : '', 'POST_IMG' => ($topic_data['forum_status'] == ITEM_LOCKED) ? $user->img('button_topic_locked', 'FORUM_LOCKED') : $user->img('button_topic_new', 'POST_NEW_TOPIC'), 'QUOTE_IMG' => $user->img('icon_post_quote', 'REPLY_WITH_QUOTE'), @@ -650,13 +652,15 @@ $template->assign_vars(array( 'U_PRINT_TOPIC' => ($auth->acl_get('f_print', $forum_id)) ? $viewtopic_url . '&view=print' : '', 'U_EMAIL_TOPIC' => ($auth->acl_get('f_email', $forum_id) && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&t=$topic_id") : '', - 'U_WATCH_TOPIC' => $s_watching_topic['link'], - 'L_WATCH_TOPIC' => $s_watching_topic['title'], + 'U_WATCH_TOPIC' => $s_watching_topic['link'], + 'U_WATCH_TOPIC_TOGGLE' => $s_watching_topic['link_toggle'], + 'S_WATCH_TOPIC_TITLE' => $s_watching_topic['title'], + 'S_WATCH_TOPIC_TOGGLE' => $s_watching_topic['title_toggle'], 'S_WATCHING_TOPIC' => $s_watching_topic['is_watching'], 'U_BOOKMARK_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks']) ? $viewtopic_url . '&bookmark=1&hash=' . generate_link_hash("topic_$topic_id") : '', - 'L_BOOKMARK_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks'] && $topic_data['bookmarked']) ? $user->lang['BOOKMARK_TOPIC_REMOVE'] : $user->lang['BOOKMARK_TOPIC'], - 'L_BOOKMARK_TOPIC_REAL' => $user->lang['BOOKMARK_TOPIC'], + 'S_BOOKMARK_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks'] && $topic_data['bookmarked']) ? $user->lang['BOOKMARK_TOPIC_REMOVE'] : $user->lang['BOOKMARK_TOPIC'], + 'S_BOOKMARK_TOGGLE' => (!$user->data['is_registered'] || !$config['allow_bookmarks'] || !$topic_data['bookmarked']) ? $user->lang['BOOKMARK_TOPIC_REMOVE'] : $user->lang['BOOKMARK_TOPIC'], 'S_BOOKMARKED_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks'] && $topic_data['bookmarked']) ? true : false, 'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=post&f=$forum_id") : '', @@ -984,10 +988,21 @@ $sql_ary = array( AND u.user_id = p.poster_id', ); +/** +* Event to modify the SQL query before the post and poster data is retrieved +* +* @event core.viewtopic_get_post_data +* @var array sql_ary The SQL array to get the data of posts and posters +* @since 3.1-A1 +*/ +$vars = array('sql_ary'); +extract($phpbb_dispatcher->trigger_event('core.viewtopic_get_post_data', compact($vars))); + $sql = $db->sql_build_query('SELECT', $sql_ary); $result = $db->sql_query($sql); -$now = phpbb_gmgetdate(time() + $user->timezone + $user->dst); +$now = $user->create_datetime(); +$now = phpbb_gmgetdate($now->getTimestamp() + $now->getOffset()); // Posts are stored in the $rowset array while $attach_list, $user_cache // and the global bbcode_bitfield are built @@ -1059,7 +1074,7 @@ while ($row = $db->sql_fetchrow($result)) { if ($poster_id == ANONYMOUS) { - $user_cache[$poster_id] = array( + $user_cache_data = array( 'joined' => '', 'posts' => '', 'from' => '', @@ -1094,6 +1109,20 @@ while ($row = $db->sql_fetchrow($result)) 'allow_pm' => 0, ); + /** + * Modify the guest user's data displayed with the posts + * + * @event core.viewtopic_cache_guest_data + * @var array user_cache_data Array with the user's data + * @var int poster_id Poster's user id + * @var array row Array with original user and post data + * @since 3.1-A1 + */ + $vars = array('user_cache_data', 'poster_id', 'row'); + extract($phpbb_dispatcher->trigger_event('core.viewtopic_cache_guest_data', compact($vars))); + + $user_cache[$poster_id] = $user_cache_data; + get_user_rank($row['user_rank'], false, $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']); } else @@ -1108,7 +1137,7 @@ while ($row = $db->sql_fetchrow($result)) $id_cache[] = $poster_id; - $user_cache[$poster_id] = array( + $user_cache_data = array( 'user_type' => $row['user_type'], 'user_inactive_reason' => $row['user_inactive_reason'], @@ -1149,6 +1178,20 @@ while ($row = $db->sql_fetchrow($result)) 'author_profile' => get_username_string('profile', $poster_id, $row['username'], $row['user_colour']), ); + /** + * Modify the users' data displayed with their posts + * + * @event core.viewtopic_cache_user_data + * @var array user_cache_data Array with the user's data + * @var int poster_id Poster's user id + * @var array row Array with original user and post data + * @since 3.1-A1 + */ + $vars = array('user_cache_data', 'poster_id', 'row'); + extract($phpbb_dispatcher->trigger_event('core.viewtopic_cache_user_data', compact($vars))); + + $user_cache[$poster_id] = $user_cache_data; + get_user_rank($row['user_rank'], $row['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']); if ((!empty($row['user_allow_viewemail']) && $auth->acl_get('u_sendemail')) || $auth->acl_get('a_email')) @@ -1313,6 +1356,16 @@ if (sizeof($attach_list)) } } +$template->assign_vars(array( + 'S_HAS_ATTACHMENTS' => !empty($attachments), +)); + +$methods = phpbb_gen_download_links('topic_id', $topic_id, $phpbb_root_path, $phpEx); +foreach ($methods as $method) +{ + $template->assign_block_vars('dl_method', $method); +} + // Instantiate BBCode if need be if ($bbcode_bitfield !== '') { @@ -1508,7 +1561,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) ) ? true : false; // - $postrow = array( + $post_row = array( 'POST_AUTHOR_FULL' => ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_full'] : get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), 'POST_AUTHOR_COLOUR' => ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_colour'] : get_username_string('colour', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), 'POST_AUTHOR' => ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_username'] : get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), @@ -1571,6 +1624,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'POSTER_ID' => $poster_id, 'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false, + 'S_MULTIPLE_ATTACHMENTS' => !empty($attachments[$row['post_id']]) && sizeof($attachments[$row['post_id']]) > 1, 'S_POST_UNAPPROVED' => ($row['post_approved']) ? false : true, 'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_report', $forum_id)) ? true : false, 'S_DISPLAY_NOTICE' => $display_notice && $row['post_attachment'], @@ -1584,13 +1638,28 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'L_IGNORE_POST' => ($row['hide_post']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), '<a href="' . $viewtopic_url . "&p={$row['post_id']}&view=show#p{$row['post_id']}" . '">', '</a>') : '', ); + $user_poster_data = $user_cache[$poster_id]; + + /** + * Modify the posts template block + * + * @event core.viewtopic_modify_post_row + * @var array row Array with original post and user data + * @var array cp_row Custom profile field data of the poster + * @var array user_poster_data Poster's data from user cache + * @var array post_row Template block array of the post + * @since 3.1-A1 + */ + $vars = array('row', 'cp_row', 'user_poster_data', 'post_row'); + extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_post_row', compact($vars))); + if (isset($cp_row['row']) && sizeof($cp_row['row'])) { - $postrow = array_merge($postrow, $cp_row['row']); + $post_row = array_merge($post_row, $cp_row['row']); } // Dump vars into template - $template->assign_block_vars('postrow', $postrow); + $template->assign_block_vars('postrow', $post_row); if (!empty($cp_row['blockrow'])) { @@ -1609,6 +1678,12 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'DISPLAY_ATTACHMENT' => $attachment) ); } + + $methods = phpbb_gen_download_links('post_msg_id', $row['post_id'], $phpbb_root_path, $phpEx); + foreach ($methods as $method) + { + $template->assign_block_vars('postrow.dl_method', $method); + } } $prev_post_id = $row['post_id']; @@ -1744,8 +1819,23 @@ if (!request_var('t', 0) && !empty($topic_id)) $request->overwrite('t', $topic_id); } +$page_title = $topic_data['topic_title'] . ($start ? ' - ' . sprintf($user->lang['PAGE_TITLE_NUMBER'], floor($start / $config['posts_per_page']) + 1) : ''); + +/** +* You can use this event to modify the page title of the viewtopic page +* +* @event core.viewtopic_modify_page_title +* @var string page_title Title of the index page +* @var array topic_data Array with topic data +* @var int forum_id Forum ID of the topic +* @var int start Start offset used to calculate the page +* @since 3.1-A1 +*/ +$vars = array('page_title', 'topic_data', 'forum_id', 'start'); +extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_page_title', compact($vars))); + // Output the page -page_header($topic_data['topic_title'] . ($start ? ' - ' . sprintf($user->lang['PAGE_TITLE_NUMBER'], floor($start / $config['posts_per_page']) + 1) : ''), true, $forum_id); +page_header($page_title, true, $forum_id); $template->set_filenames(array( 'body' => ($view == 'print') ? 'viewtopic_print.html' : 'viewtopic_body.html') diff --git a/tests/RUNNING_TESTS.txt b/tests/RUNNING_TESTS.txt index b976545c22..75a6fc94f6 100644 --- a/tests/RUNNING_TESTS.txt +++ b/tests/RUNNING_TESTS.txt @@ -51,6 +51,42 @@ test_config.php file: PHPBB_TEST_DBNAME='database' PHPBB_TEST_DBUSER='user' \ PHPBB_TEST_DBPASSWD='password' phpunit +Special Database Cases +---------------------- +In order to run tests on some of the databases that we support, it will be +necessary to provide a custom DSN string in test_config.php. This is only +needed for MSSQL 2000+ (PHP module), MSSQL via ODBC, and Firebird when +PDO_Firebird does not work on your system +(https://bugs.php.net/bug.php?id=61183). The variable must be named $custom_dsn. + +Examples: +Firebird using http://www.firebirdsql.org/en/odbc-driver/ +$custom_dsn = "Driver={Firebird/InterBase(r) driver};dbname=$dbhost:$dbname"; + +MSSQL +$custom_dsn = "Driver={SQL Server Native Client 10.0};Server=$dbhost;Database=$dbname"; + +The other fields in test_config.php should be filled out as you would normally +to connect to that database in phpBB. + +Additionally, you will need to be running the DbUnit fork from +https://github.com/phpbb/dbunit/tree/phpbb. + +Redis +----- + +In order to run tests for the Redis cache driver, at least one of Redis host +or port must be specified in test configuration. This can be done via +test_config.php as follows: + + <?php + $phpbb_redis_host = 'localhost'; + $phpbb_redis_port = 6379; + +Or via environment variables as follows: + + $ PHPBB_TEST_REDIS_HOST=localhost PHPBB_TEST_REDIS_PORT=6379 phpunit + Running ======= diff --git a/tests/bbcode/url_bbcode_test.php b/tests/bbcode/url_bbcode_test.php index b944b6135d..d5df386714 100644 --- a/tests/bbcode/url_bbcode_test.php +++ b/tests/bbcode/url_bbcode_test.php @@ -11,8 +11,6 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php'; require_once dirname(__FILE__) . '/../../phpBB/includes/bbcode.php'; require_once dirname(__FILE__) . '/../../phpBB/includes/message_parser.php'; -require_once dirname(__FILE__) . '/../mock_user.php'; -require_once dirname(__FILE__) . '/../mock/request.php'; class phpbb_url_bbcode_test extends phpbb_test_case { diff --git a/tests/bootstrap.php b/tests/bootstrap.php index f103d8f15a..1017e0c72f 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -16,6 +16,8 @@ $table_prefix = 'phpbb_'; require_once $phpbb_root_path . 'includes/constants.php'; require_once $phpbb_root_path . 'includes/class_loader.' . $phpEx; +$phpbb_class_loader_mock = new phpbb_class_loader('phpbb_mock_', $phpbb_root_path . '../tests/mock/', ".php"); +$phpbb_class_loader_mock->register(); $phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', $phpbb_root_path . 'ext/', ".php"); $phpbb_class_loader_ext->register(); $phpbb_class_loader = new phpbb_class_loader('phpbb_', $phpbb_root_path . 'includes/', ".php"); diff --git a/tests/cache/apc_driver_test.php b/tests/cache/apc_driver_test.php new file mode 100644 index 0000000000..3380762878 --- /dev/null +++ b/tests/cache/apc_driver_test.php @@ -0,0 +1,53 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +// Important: apc.enable_cli=1 must be in php.ini. +// http://forums.devshed.com/php-development-5/apc-problem-561290.html +// http://php.net/manual/en/apc.configuration.php + +require_once dirname(__FILE__) . '/common_test_case.php'; + +class phpbb_cache_apc_driver_test extends phpbb_cache_common_test_case +{ + protected static $config; + protected $driver; + + public function getDataSet() + { + return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml'); + } + + static public function setUpBeforeClass() + { + if (!extension_loaded('apc')) + { + self::markTestSkipped('APC extension is not loaded'); + } + + $php_ini = new phpbb_php_ini; + + if (!$php_ini->get_bool('apc.enabled')) + { + self::markTestSkipped('APC is not enabled. Make sure apc.enabled=1 in php.ini'); + } + + if (PHP_SAPI == 'cli' && !$php_ini->get_bool('apc.enable_cli')) + { + self::markTestSkipped('APC is not enabled for CLI. Set apc.enable_cli=1 in php.ini'); + } + } + + protected function setUp() + { + parent::setUp(); + + $this->driver = new phpbb_cache_driver_apc; + $this->driver->purge(); + } +} diff --git a/tests/cache/common_test_case.php b/tests/cache/common_test_case.php new file mode 100644 index 0000000000..fa298ec9ae --- /dev/null +++ b/tests/cache/common_test_case.php @@ -0,0 +1,97 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +abstract class phpbb_cache_common_test_case extends phpbb_database_test_case +{ + public function test_get_put_exists() + { + $this->assertFalse($this->driver->_exists('test_key')); + $this->assertSame(false, $this->driver->get('test_key')); + + $this->driver->put('test_key', 'test_value'); + + $this->assertTrue($this->driver->_exists('test_key')); + $this->assertEquals( + 'test_value', + $this->driver->get('test_key'), + 'File ACM put and get' + ); + } + + public function test_purge() + { + $this->driver->put('test_key', 'test_value'); + + $this->assertEquals( + 'test_value', + $this->driver->get('test_key'), + 'File ACM put and get' + ); + + $this->driver->purge(); + + $this->assertSame(false, $this->driver->get('test_key')); + } + + public function test_destroy() + { + $this->driver->put('first_key', 'first_value'); + $this->driver->put('second_key', 'second_value'); + + $this->assertEquals( + 'first_value', + $this->driver->get('first_key') + ); + $this->assertEquals( + 'second_value', + $this->driver->get('second_key') + ); + + $this->driver->destroy('first_key'); + + $this->assertFalse($this->driver->_exists('first_key')); + $this->assertEquals( + 'second_value', + $this->driver->get('second_key') + ); + } + + public function test_cache_sql() + { + global $db, $cache; + $db = $this->new_dbal(); + $cache = new phpbb_cache_service($this->driver); + + $sql = "SELECT * FROM phpbb_config + WHERE config_name = 'foo'"; + + $result = $db->sql_query($sql, 300); + $first_result = $db->sql_fetchrow($result); + $expected = array('config_name' => 'foo', 'config_value' => '23', 'is_dynamic' => 0); + $this->assertEquals($expected, $first_result); + + $sql = 'DELETE FROM phpbb_config'; + $result = $db->sql_query($sql); + + $sql = "SELECT * FROM phpbb_config + WHERE config_name = 'foo'"; + $result = $db->sql_query($sql, 300); + + $this->assertEquals($expected, $db->sql_fetchrow($result)); + + $sql = "SELECT * FROM phpbb_config + WHERE config_name = 'foo'"; + $result = $db->sql_query($sql); + + $no_cache_result = $db->sql_fetchrow($result); + $this->assertSame(false, $no_cache_result); + + $db->sql_close(); + } +} diff --git a/tests/cache/cache_test.php b/tests/cache/file_driver_test.php index 564bd35863..745c6bb081 100644 --- a/tests/cache/cache_test.php +++ b/tests/cache/file_driver_test.php @@ -7,19 +7,27 @@ * */ -require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; +require_once dirname(__FILE__) . '/common_test_case.php'; -class phpbb_cache_test extends phpbb_test_case +class phpbb_cache_file_driver_test extends phpbb_cache_common_test_case { private $cache_dir; + protected $driver; public function __construct() { $this->cache_dir = dirname(__FILE__) . '/../tmp/cache/'; } + public function getDataSet() + { + return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml'); + } + protected function setUp() { + parent::setUp(); + if (file_exists($this->cache_dir)) { // cache directory possibly left after aborted @@ -27,6 +35,8 @@ class phpbb_cache_test extends phpbb_test_case $this->remove_cache_dir(); } $this->create_cache_dir(); + + $this->driver = new phpbb_cache_driver_file($this->cache_dir); } protected function tearDown() @@ -35,6 +45,8 @@ class phpbb_cache_test extends phpbb_test_case { $this->remove_cache_dir(); } + + parent::tearDown(); } private function create_cache_dir() @@ -54,17 +66,4 @@ class phpbb_cache_test extends phpbb_test_case } rmdir($this->cache_dir); } - - public function test_cache_driver_file() - { - $driver = new phpbb_cache_driver_file($this->cache_dir); - $driver->put('test_key', 'test_value'); - $driver->save(); - - $this->assertEquals( - 'test_value', - $driver->get('test_key'), - 'File ACM put and get' - ); - } } diff --git a/tests/cache/fixtures/config.xml b/tests/cache/fixtures/config.xml new file mode 100644 index 0000000000..9d395b685c --- /dev/null +++ b/tests/cache/fixtures/config.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<dataset> + <table name="phpbb_config"> + <column>config_name</column> + <column>config_value</column> + <column>is_dynamic</column> + <row> + <value>foo</value> + <value>23</value> + <value>0</value> + </row> + <row> + <value>bar</value> + <value>42</value> + <value>1</value> + </row> + </table> +</dataset> diff --git a/tests/cache/null_driver_test.php b/tests/cache/null_driver_test.php new file mode 100644 index 0000000000..86553d4dc5 --- /dev/null +++ b/tests/cache/null_driver_test.php @@ -0,0 +1,74 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +class phpbb_cache_null_driver_test extends phpbb_database_test_case +{ + protected $driver; + + public function getDataSet() + { + return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml'); + } + + protected function setUp() + { + parent::setUp(); + + $this->driver = new phpbb_cache_driver_null; + } + + public function test_get_put() + { + $this->assertSame(false, $this->driver->get('key')); + + $this->driver->put('key', 'value'); + + // null driver does not cache + $this->assertSame(false, $this->driver->get('key')); + } + + public function test_purge() + { + // does nothing + $this->driver->purge(); + } + + public function test_destroy() + { + // does nothing + $this->driver->destroy('foo'); + } + + public function test_cache_sql() + { + global $db, $cache; + $db = $this->new_dbal(); + $cache = new phpbb_cache_service($this->driver); + + $sql = "SELECT * FROM phpbb_config + WHERE config_name = 'foo'"; + $result = $db->sql_query($sql, 300); + $first_result = $db->sql_fetchrow($result); + $expected = array('config_name' => 'foo', 'config_value' => '23', 'is_dynamic' => 0); + $this->assertEquals($expected, $first_result); + + $sql = 'DELETE FROM phpbb_config'; + $result = $db->sql_query($sql); + + // As null cache driver does not actually cache, + // this should return no results + $sql = "SELECT * FROM phpbb_config + WHERE config_name = 'foo'"; + $result = $db->sql_query($sql, 300); + + $this->assertSame(false, $db->sql_fetchrow($result)); + + $db->sql_close(); + } +} diff --git a/tests/cache/redis_driver_test.php b/tests/cache/redis_driver_test.php new file mode 100644 index 0000000000..1308519a18 --- /dev/null +++ b/tests/cache/redis_driver_test.php @@ -0,0 +1,49 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +require_once dirname(__FILE__) . '/common_test_case.php'; + +class phpbb_cache_redis_driver_test extends phpbb_cache_common_test_case +{ + protected static $config; + protected $driver; + + public function getDataSet() + { + return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml'); + } + + static public function setUpBeforeClass() + { + if (!extension_loaded('redis')) + { + self::markTestSkipped('redis extension is not loaded'); + } + + $config = phpbb_test_case_helpers::get_test_config(); + if (isset($config['redis_host']) || isset($config['redis_port'])) + { + $host = isset($config['redis_host']) ? $config['redis_host'] : 'localhost'; + $port = isset($config['redis_port']) ? $config['redis_port'] : 6379; + self::$config = array('host' => $host, 'port' => $port); + } + else + { + self::markTestSkipped('Test redis host/port is not specified'); + } + } + + protected function setUp() + { + parent::setUp(); + + $this->driver = new phpbb_cache_driver_redis(self::$config['host'], self::$config['port']); + $this->driver->purge(); + } +} diff --git a/tests/class_loader/class_loader_test.php b/tests/class_loader/class_loader_test.php index 80f0b38095..76af4dde37 100644 --- a/tests/class_loader/class_loader_test.php +++ b/tests/class_loader/class_loader_test.php @@ -7,8 +7,6 @@ * */ -require_once dirname(__FILE__) . '/../mock/cache.php'; - class phpbb_class_loader_test extends PHPUnit_Framework_TestCase { public function setUp() diff --git a/tests/compress/archive/.gitkeep b/tests/compress/archive/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/compress/archive/.gitkeep diff --git a/tests/compress/compress_test.php b/tests/compress/compress_test.php new file mode 100644 index 0000000000..ac8dd358d3 --- /dev/null +++ b/tests/compress/compress_test.php @@ -0,0 +1,173 @@ +<?php +/** + * + * @package testing + * @copyright (c) 2012 phpBB Group + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 + * + */ + +require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; +require_once dirname(__FILE__) . '/../../phpBB/includes/functions_admin.php'; +require_once dirname(__FILE__) . '/../../phpBB/includes/functions_compress.php'; + +class phpbb_compress_test extends phpbb_test_case +{ + const EXTRACT_DIR = '/extract/'; + const ARCHIVE_DIR = '/archive/'; + + private $path; + + protected $filelist = array( + '1.txt', + 'dir/2.txt', + 'dir/3.txt', + 'dir/subdir/4.txt', + ); + + protected $conflicts = array( + '1_1.txt', + '1_2.txt', + 'dir/2_1.txt', + ); + + protected function setUp() + { + // Required for compress::add_file + global $phpbb_root_path; + $phpbb_root_path = ''; + + $this->path = dirname(__FILE__) . '/fixtures/'; + + if (!@extension_loaded('zlib') || !@extension_loaded('bz2')) + { + $this->markTestSkipped('PHP needs to be compiled with --with-zlib and --with-bz2 in order to run these tests'); + } + } + + protected function tearDown() + { + foreach (array(dirname(__FILE__) . self::EXTRACT_DIR, dirname(__FILE__) . self::ARCHIVE_DIR) as $dir) + { + $this->clear_dir($dir); + } + } + + protected function clear_dir($dir) + { + $iterator = new DirectoryIterator($dir); + foreach ($iterator as $fileinfo) + { + $name = $fileinfo->getFilename(); + $path = $fileinfo->getPathname(); + + if ($name[0] !== '.') + { + if ($fileinfo->isDir()) + { + $this->clear_dir($path); + rmdir($path); + } + else + { + unlink($path); + } + } + } + } + + protected function archive_files($compress) + { + $compress->add_file($this->path . '1.txt', $this->path); + $compress->add_file( + 'tests/compress/fixtures/dir/', + 'tests/compress/fixtures/', + '', + // The comma here is not an error, this is a comma-separated list + 'subdir/4.txt,3.txt' + ); + $compress->add_custom_file($this->path . 'dir/3.txt', 'dir/3.txt'); + $compress->add_data(file_get_contents($this->path . 'dir/subdir/4.txt'), 'dir/subdir/4.txt'); + + // Add multiples of the same file to check conflicts are handled + $compress->add_file($this->path . '1.txt', $this->path); + $compress->add_file($this->path . '1.txt', $this->path); + $compress->add_file($this->path . 'dir/2.txt', $this->path); + } + + protected function valid_extraction($extra = array()) + { + $filelist = array_merge($this->filelist, $extra); + + foreach ($filelist as $filename) + { + $path = dirname(__FILE__) . self::EXTRACT_DIR . $filename; + $this->assertTrue(file_exists($path)); + + // Check the file's contents is correct + $contents = explode('_', basename($filename, '.txt')); + $contents = $contents[0]; + $this->assertEquals($contents . "\n", file_get_contents($path)); + } + } + + public function tar_archive_list() + { + return array( + array('archive.tar', '.tar'), + array('archive.tar.gz', '.tar.gz'), + array('archive.tar.bz2', '.tar.bz2'), + ); + } + + /** + * @dataProvider tar_archive_list + */ + public function test_extract_tar($filename, $type) + { + $compress = new compress_tar('r', $this->path . $filename); + $compress->extract('tests/compress/' . self::EXTRACT_DIR); + $this->valid_extraction(); + } + + public function test_extract_zip() + { + $compress = new compress_zip('r', $this->path . 'archive.zip'); + $compress->extract('tests/compress/' . self::EXTRACT_DIR); + $this->valid_extraction(); + } + + /** + * @depends test_extract_tar + * @dataProvider tar_archive_list + */ + public function test_compress_tar($filename, $type) + { + $tar = dirname(__FILE__) . self::ARCHIVE_DIR . $filename; + $compress = new compress_tar('w', $tar); + $this->archive_files($compress); + $compress->close(); + $this->assertTrue(file_exists($tar)); + + $compress->mode = 'r'; + $compress->open(); + $compress->extract('tests/compress/' . self::EXTRACT_DIR); + $this->valid_extraction($this->conflicts); + } + + /** + * @depends test_extract_zip + */ + public function test_compress_zip() + { + $zip = dirname(__FILE__) . self::ARCHIVE_DIR . 'archive.zip'; + $compress = new compress_zip('w', $zip); + $this->archive_files($compress); + $compress->close(); + $this->assertTrue(file_exists($zip)); + + $compress = new compress_zip('r', $zip); + $compress->extract('tests/compress/' . self::EXTRACT_DIR); + $this->valid_extraction($this->conflicts); + } +} diff --git a/tests/compress/extract/.gitkeep b/tests/compress/extract/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/compress/extract/.gitkeep diff --git a/tests/compress/fixtures/1.txt b/tests/compress/fixtures/1.txt new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/tests/compress/fixtures/1.txt @@ -0,0 +1 @@ +1 diff --git a/tests/compress/fixtures/archive.tar b/tests/compress/fixtures/archive.tar Binary files differnew file mode 100644 index 0000000000..54ed56084e --- /dev/null +++ b/tests/compress/fixtures/archive.tar diff --git a/tests/compress/fixtures/archive.tar.bz2 b/tests/compress/fixtures/archive.tar.bz2 Binary files differnew file mode 100644 index 0000000000..04c0eccd74 --- /dev/null +++ b/tests/compress/fixtures/archive.tar.bz2 diff --git a/tests/compress/fixtures/archive.tar.gz b/tests/compress/fixtures/archive.tar.gz Binary files differnew file mode 100644 index 0000000000..195e7a060a --- /dev/null +++ b/tests/compress/fixtures/archive.tar.gz diff --git a/tests/compress/fixtures/archive.zip b/tests/compress/fixtures/archive.zip Binary files differnew file mode 100644 index 0000000000..bdb618fc26 --- /dev/null +++ b/tests/compress/fixtures/archive.zip diff --git a/tests/compress/fixtures/dir/2.txt b/tests/compress/fixtures/dir/2.txt new file mode 100644 index 0000000000..0cfbf08886 --- /dev/null +++ b/tests/compress/fixtures/dir/2.txt @@ -0,0 +1 @@ +2 diff --git a/tests/compress/fixtures/dir/3.txt b/tests/compress/fixtures/dir/3.txt new file mode 100644 index 0000000000..00750edc07 --- /dev/null +++ b/tests/compress/fixtures/dir/3.txt @@ -0,0 +1 @@ +3 diff --git a/tests/compress/fixtures/dir/subdir/4.txt b/tests/compress/fixtures/dir/subdir/4.txt new file mode 100644 index 0000000000..b8626c4cff --- /dev/null +++ b/tests/compress/fixtures/dir/subdir/4.txt @@ -0,0 +1 @@ +4 diff --git a/tests/config/db_test.php b/tests/config/db_test.php index a9a53541a5..0b8f73d53a 100644 --- a/tests/config/db_test.php +++ b/tests/config/db_test.php @@ -7,8 +7,6 @@ * */ -require_once dirname(__FILE__) . '/../mock/cache.php'; - class phpbb_config_db_test extends phpbb_database_test_case { private $cache; diff --git a/tests/controller/config/routing.yml b/tests/controller/config/routing.yml new file mode 100644 index 0000000000..175b11f130 --- /dev/null +++ b/tests/controller/config/routing.yml @@ -0,0 +1,3 @@ +core_controller: + pattern: /core_foo + defaults: { _controller: core_foo.controller:bar } diff --git a/tests/controller/config/services.yml b/tests/controller/config/services.yml new file mode 100644 index 0000000000..f1bd047489 --- /dev/null +++ b/tests/controller/config/services.yml @@ -0,0 +1,3 @@ +services: + core_foo.controller: + class: phpbb_controller_foo diff --git a/tests/controller/controller_test.php b/tests/controller/controller_test.php new file mode 100644 index 0000000000..198fb3c6dd --- /dev/null +++ b/tests/controller/controller_test.php @@ -0,0 +1,76 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Route; +use Symfony\Component\Routing\RouteCollection; +use Symfony\Component\Config\FileLocator; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; + +class phpbb_controller_test extends phpbb_test_case +{ + public function setUp() + { + $this->extension_manager = new phpbb_mock_extension_manager( + dirname(__FILE__) . '/', + array( + 'foo' => array( + 'ext_name' => 'foo', + 'ext_active' => '1', + 'ext_path' => 'ext/foo/', + ), + )); + } + + public function test_provider() + { + $provider = new phpbb_controller_provider; + $routes = $provider + ->import_paths_from_finder($this->extension_manager->get_finder()) + ->find('./tests/controller/'); + + // This will need to be updated if any new routes are defined + $this->assertEquals(2, sizeof($routes)); + } + + public function test_controller_resolver() + { + $container = new ContainerBuilder(); + // YamlFileLoader only uses one path at a time, so we need to loop + // through all of the ones we are using. + foreach (array(__DIR__.'/config', __DIR__.'/ext/foo/config') as $path) + { + $loader = new YamlFileLoader($container, new FileLocator($path)); + $loader->load('services.yml'); + } + + // Autoloading classes within the tests folder does not work + // so I'll include them manually. + if (!class_exists('phpbb_ext_foo_controller')) + { + include(__DIR__.'/ext/foo/controller.php'); + } + if (!class_exists('phpbb_controller_foo')) + { + include(__DIR__.'/includes/controller/foo.php'); + } + + $resolver = new phpbb_controller_resolver(new phpbb_user, $container); + $symfony_request = new Request(); + $symfony_request->attributes->set('_controller', 'foo.controller:handle'); + + $this->assertEquals($resolver->getController($symfony_request), array(new phpbb_ext_foo_controller, 'handle')); + + $symfony_request = new Request(); + $symfony_request->attributes->set('_controller', 'core_foo.controller:bar'); + + $this->assertEquals($resolver->getController($symfony_request), array(new phpbb_controller_foo, 'bar')); + } +} diff --git a/tests/controller/ext/foo/config/routing.yml b/tests/controller/ext/foo/config/routing.yml new file mode 100644 index 0000000000..4799fec37d --- /dev/null +++ b/tests/controller/ext/foo/config/routing.yml @@ -0,0 +1,3 @@ +controller1: + pattern: /foo + defaults: { _controller: foo.controller:handle } diff --git a/tests/controller/ext/foo/config/services.yml b/tests/controller/ext/foo/config/services.yml new file mode 100644 index 0000000000..ce0e18c610 --- /dev/null +++ b/tests/controller/ext/foo/config/services.yml @@ -0,0 +1,3 @@ +services: + foo.controller: + class: phpbb_ext_foo_controller diff --git a/tests/controller/ext/foo/controller.php b/tests/controller/ext/foo/controller.php new file mode 100644 index 0000000000..cfc5c20622 --- /dev/null +++ b/tests/controller/ext/foo/controller.php @@ -0,0 +1,16 @@ +<?php + +use Symfony\Component\HttpFoundation\Response; + +class phpbb_ext_foo_controller +{ + /** + * Handle method + * + * @return null + */ + public function handle() + { + return new Response('Test', 200); + } +} diff --git a/tests/controller/includes/controller/foo.php b/tests/controller/includes/controller/foo.php new file mode 100644 index 0000000000..04576e16c4 --- /dev/null +++ b/tests/controller/includes/controller/foo.php @@ -0,0 +1,16 @@ +<?php + +use Symfony\Component\HttpFoundation\Response; + +class phpbb_controller_foo +{ + /** + * Bar method + * + * @return null + */ + public function bar() + { + return new Response('bar()', 200); + } +} diff --git a/tests/cron/ext/testext/cron/dummy_task.php b/tests/cron/ext/testext/cron/dummy_task.php index 996f5b39cf..3e81db1895 100644 --- a/tests/cron/ext/testext/cron/dummy_task.php +++ b/tests/cron/ext/testext/cron/dummy_task.php @@ -9,7 +9,12 @@ class phpbb_ext_testext_cron_dummy_task extends phpbb_cron_task_base { - public static $was_run = 0; + static public $was_run = 0; + + public function get_name() + { + return get_class($this); + } public function run() { diff --git a/tests/cron/includes/cron/task/core/dummy_task.php b/tests/cron/includes/cron/task/core/dummy_task.php index 6e2e2db636..c94455603f 100644 --- a/tests/cron/includes/cron/task/core/dummy_task.php +++ b/tests/cron/includes/cron/task/core/dummy_task.php @@ -9,7 +9,12 @@ class phpbb_cron_task_core_dummy_task extends phpbb_cron_task_base { - public static $was_run = 0; + static public $was_run = 0; + + public function get_name() + { + return get_class($this); + } public function run() { diff --git a/tests/cron/includes/cron/task/core/second_dummy_task.php b/tests/cron/includes/cron/task/core/second_dummy_task.php index 8cd0bddfc0..77ef6f70ed 100644 --- a/tests/cron/includes/cron/task/core/second_dummy_task.php +++ b/tests/cron/includes/cron/task/core/second_dummy_task.php @@ -9,7 +9,12 @@ class phpbb_cron_task_core_second_dummy_task extends phpbb_cron_task_base { - public static $was_run = 0; + static public $was_run = 0; + + public function get_name() + { + return get_class($this); + } public function run() { diff --git a/tests/cron/manager_test.php b/tests/cron/manager_test.php index f433fc9a9b..3c541be2a6 100644 --- a/tests/cron/manager_test.php +++ b/tests/cron/manager_test.php @@ -7,7 +7,6 @@ * */ -require_once dirname(__FILE__) . '/../mock/extension_manager.php'; require_once dirname(__FILE__) . '/includes/cron/task/core/dummy_task.php'; require_once dirname(__FILE__) . '/includes/cron/task/core/second_dummy_task.php'; require_once dirname(__FILE__) . '/ext/testext/cron/dummy_task.php'; @@ -19,10 +18,10 @@ class phpbb_cron_manager_test extends PHPUnit_Framework_TestCase { public function setUp() { - $this->manager = new phpbb_cron_manager(array( - 'phpbb_cron_task_core_dummy_task', - 'phpbb_cron_task_core_second_dummy_task', - 'phpbb_ext_testext_cron_dummy_task', + $this->manager = $this->create_cron_manager(array( + new phpbb_cron_task_core_dummy_task(), + new phpbb_cron_task_core_second_dummy_task(), + new phpbb_ext_testext_cron_dummy_task(), )); $this->task_name = 'phpbb_cron_task_core_dummy_task'; } @@ -34,13 +33,6 @@ class phpbb_cron_manager_test extends PHPUnit_Framework_TestCase $this->assertEquals($this->task_name, $task->get_name()); } - public function test_manager_instantiates_task_by_name() - { - $task = $this->manager->instantiate_task($this->task_name, array()); - $this->assertInstanceOf('phpbb_cron_task_wrapper', $task); - $this->assertEquals($this->task_name, $task->get_name()); - } - public function test_manager_finds_all_ready_tasks() { $tasks = $this->manager->find_all_ready_tasks(); @@ -55,10 +47,10 @@ class phpbb_cron_manager_test extends PHPUnit_Framework_TestCase public function test_manager_finds_only_ready_tasks() { - $manager = new phpbb_cron_manager(array( - 'phpbb_cron_task_core_simple_ready', - 'phpbb_cron_task_core_simple_not_runnable', - 'phpbb_cron_task_core_simple_should_not_run', + $manager = $this->create_cron_manager(array( + new phpbb_cron_task_core_simple_ready(), + new phpbb_cron_task_core_simple_not_runnable(), + new phpbb_cron_task_core_simple_should_not_run(), )); $tasks = $manager->find_all_ready_tasks(); $task_names = $this->tasks_to_names($tasks); @@ -70,8 +62,15 @@ class phpbb_cron_manager_test extends PHPUnit_Framework_TestCase $names = array(); foreach ($tasks as $task) { - $names[] = get_class($task->task); + $names[] = $task->get_name(); } return $names; } + + private function create_cron_manager($tasks) + { + global $phpbb_root_path, $phpEx; + + return new phpbb_cron_manager($tasks, $phpbb_root_path, $phpEx); + } } diff --git a/tests/cron/task_provider_test.php b/tests/cron/task_provider_test.php deleted file mode 100644 index 4547c61a55..0000000000 --- a/tests/cron/task_provider_test.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** -* -* @package testing -* @copyright (c) 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 -* -*/ - -require_once dirname(__FILE__) . '/../mock/extension_manager.php'; - -class phpbb_cron_task_provider_test extends PHPUnit_Framework_TestCase -{ - public function setUp() - { - $this->extension_manager = new phpbb_mock_extension_manager( - dirname(__FILE__) . '/', - array( - 'testext' => array( - 'ext_name' => 'testext', - 'ext_active' => true, - 'ext_path' => 'ext/testext/' - ), - )); - $this->provider = new phpbb_cron_task_provider($this->extension_manager); - } - - public function test_manager_finds_shipped_tasks() - { - $tasks = array(); - foreach ($this->provider as $task) - { - $tasks[] = $task; - } - sort($tasks); - - $this->assertEquals(array( - 'phpbb_cron_task_core_dummy_task', - 'phpbb_cron_task_core_second_dummy_task', - 'phpbb_ext_testext_cron_dummy_task', - ), $tasks); - } -} diff --git a/tests/cron/tasks/simple_not_runnable.php b/tests/cron/tasks/simple_not_runnable.php index 837f28f1c0..56d484eacd 100644 --- a/tests/cron/tasks/simple_not_runnable.php +++ b/tests/cron/tasks/simple_not_runnable.php @@ -2,6 +2,11 @@ class phpbb_cron_task_core_simple_not_runnable extends phpbb_cron_task_base { + public function get_name() + { + return get_class($this); + } + public function run() { } diff --git a/tests/cron/tasks/simple_ready.php b/tests/cron/tasks/simple_ready.php index de5f10e491..8aa0507406 100644 --- a/tests/cron/tasks/simple_ready.php +++ b/tests/cron/tasks/simple_ready.php @@ -2,6 +2,11 @@ class phpbb_cron_task_core_simple_ready extends phpbb_cron_task_base { + public function get_name() + { + return get_class($this); + } + public function run() { } diff --git a/tests/cron/tasks/simple_should_not_run.php b/tests/cron/tasks/simple_should_not_run.php index c2a41616f6..58f6df2616 100644 --- a/tests/cron/tasks/simple_should_not_run.php +++ b/tests/cron/tasks/simple_should_not_run.php @@ -2,6 +2,11 @@ class phpbb_cron_task_core_simple_should_not_run extends phpbb_cron_task_base { + public function get_name() + { + return get_class($this); + } + public function run() { } diff --git a/tests/datetime/from_format_test.php b/tests/datetime/from_format_test.php new file mode 100644 index 0000000000..c28925272e --- /dev/null +++ b/tests/datetime/from_format_test.php @@ -0,0 +1,57 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +require_once dirname(__FILE__) . '/../../phpBB/includes/session.php'; +require_once dirname(__FILE__) . '/../../phpBB/includes/user.php'; +require_once dirname(__FILE__) . '/../../phpBB/includes/datetime.php'; +require_once dirname(__FILE__) . '/../mock/lang.php'; + +class phpbb_datetime_from_format_test extends phpbb_test_case +{ + public function from_format_data() + { + return array( + array( + 'UTC', + 'Y-m-d', + '2012-06-08', + ), + + array( + 'Europe/Berlin', + 'Y-m-d H:i:s', + '2012-06-08 14:01:02', + ), + ); + } + + /** + * @dataProvider from_format_data() + */ + public function test_from_format($timezone, $format, $expected) + { + global $user; + + $user = new phpbb_user(); + $user->timezone = new DateTimeZone($timezone); + $user->lang['datetime'] = array( + 'TODAY' => 'Today', + 'TOMORROW' => 'Tomorrow', + 'YESTERDAY' => 'Yesterday', + 'AGO' => array( + 0 => 'less than a minute ago', + 1 => '%d minute ago', + 2 => '%d minutes ago', + ), + ); + + $timestamp = $user->get_timestamp_from_format($format, $expected, new DateTimeZone($timezone)); + $this->assertEquals($expected, $user->format_date($timestamp, $format, true)); + } +} diff --git a/tests/dbal/case_test.php b/tests/dbal/case_test.php new file mode 100644 index 0000000000..57a1729a39 --- /dev/null +++ b/tests/dbal/case_test.php @@ -0,0 +1,69 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +class phpbb_dbal_case_test extends phpbb_database_test_case +{ + public function getDataSet() + { + return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/config.xml'); + } + + public function test_case_int() + { + $db = $this->new_dbal(); + + $sql = 'SELECT ' . $db->sql_case('1 = 1', '1', '2') . ' AS test_num + FROM phpbb_config'; + $result = $db->sql_query_limit($sql, 1); + + $this->assertEquals(1, (int) $db->sql_fetchfield('test_num')); + + $sql = 'SELECT ' . $db->sql_case('1 = 0', '1', '2') . ' AS test_num + FROM phpbb_config'; + $result = $db->sql_query_limit($sql, 1); + + $this->assertEquals(2, (int) $db->sql_fetchfield('test_num')); + } + + public function test_case_string() + { + $db = $this->new_dbal(); + + $sql = 'SELECT ' . $db->sql_case('1 = 1', "'foo'", "'bar'") . ' AS test_string + FROM phpbb_config'; + $result = $db->sql_query_limit($sql, 1); + + $this->assertEquals('foo', $db->sql_fetchfield('test_string')); + + $sql = 'SELECT ' . $db->sql_case('1 = 0', "'foo'", "'bar'") . ' AS test_string + FROM phpbb_config'; + $result = $db->sql_query_limit($sql, 1); + + $this->assertEquals('bar', $db->sql_fetchfield('test_string')); + } + + public function test_case_column() + { + $db = $this->new_dbal(); + + $sql = 'SELECT ' . $db->sql_case("config_name = 'config1'", 'config_name', 'config_value') . " AS test_string + FROM phpbb_config + WHERE config_name = 'config1'"; + $result = $db->sql_query_limit($sql, 1); + + $this->assertEquals('config1', $db->sql_fetchfield('test_string')); + + $sql = 'SELECT ' . $db->sql_case("config_name = 'config1'", 'config_name', 'config_value') . " AS test_string + FROM phpbb_config + WHERE config_value = 'bar'"; + $result = $db->sql_query_limit($sql, 1); + + $this->assertEquals('bar', $db->sql_fetchfield('test_string')); + } +} diff --git a/tests/dbal/concatenate_test.php b/tests/dbal/concatenate_test.php new file mode 100644 index 0000000000..0891fa58a0 --- /dev/null +++ b/tests/dbal/concatenate_test.php @@ -0,0 +1,64 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +class phpbb_dbal_concatenate_test extends phpbb_database_test_case +{ + public function getDataSet() + { + return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/config.xml'); + } + + public function test_concatenate_string() + { + $db = $this->new_dbal(); + + $sql = 'SELECT config_name, ' . $db->sql_concatenate('config_name', "'" . $db->sql_escape('append') . "'") . ' AS string + FROM phpbb_config'; + $result = $db->sql_query($sql); + + $db->sql_return_on_error(false); + + $this->assertEquals(array( + array( + 'config_name' => 'config1', + 'string' => 'config1append', + ), + array( + 'config_name' => 'config2', + 'string' => 'config2append', + ), + ), + $db->sql_fetchrowset($result) + ); + } + + public function test_concatenate_statement() + { + $db = $this->new_dbal(); + + $sql = 'SELECT config_name, ' . $db->sql_concatenate('config_name', 'config_value') . ' AS string + FROM phpbb_config'; + $result = $db->sql_query($sql); + + $db->sql_return_on_error(false); + + $this->assertEquals(array( + array( + 'config_name' => 'config1', + 'string' => 'config1foo', + ), + array( + 'config_name' => 'config2', + 'string' => 'config2bar', + ), + ), + $db->sql_fetchrowset($result) + ); + } +} diff --git a/tests/dbal/order_lower_test.php b/tests/dbal/order_lower_test.php index e16c0c20ee..84d454742f 100644 --- a/tests/dbal/order_lower_test.php +++ b/tests/dbal/order_lower_test.php @@ -14,7 +14,7 @@ class phpbb_dbal_order_lower_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/styles.xml'); } - public function test_cross_join() + public function test_order_lower() { $db = $this->new_dbal(); diff --git a/tests/dbal/select_test.php b/tests/dbal/select_test.php index bd524100a2..c8cfad04e0 100644 --- a/tests/dbal/select_test.php +++ b/tests/dbal/select_test.php @@ -125,7 +125,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case $this->assertEquals($expected, $ary); } - public static function fetchfield_seek_data() + static public function fetchfield_seek_data() { return array( array(1, 'foobar'), @@ -151,7 +151,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case $this->assertEquals($expected, $field); } - public static function query_limit_data() + static public function query_limit_data() { return array( array(0, 0, array(array('username_clean' => 'barfoo'), diff --git a/tests/dbal/write_sequence_test.php b/tests/dbal/write_sequence_test.php new file mode 100644 index 0000000000..8975cfbfb1 --- /dev/null +++ b/tests/dbal/write_sequence_test.php @@ -0,0 +1,55 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; + +class phpbb_dbal_write_sequence_test extends phpbb_database_test_case +{ + public function getDataSet() + { + return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/three_users.xml'); + } + + static public function write_sequence_data() + { + return array( + array( + 'ticket/11219', + 4, + ), + ); + } + + /** + * @dataProvider write_sequence_data + */ + public function test_write_sequence($username, $expected) + { + $db = $this->new_dbal(); + + $sql = 'INSERT INTO phpbb_users ' . $db->sql_build_array('INSERT', array( + 'username' => $username, + 'username_clean' => $username, + 'user_permissions' => '', + 'user_sig' => '', + 'user_occ' => '', + 'user_interests' => '', + )); + $db->sql_query($sql); + + $this->assertEquals($expected, $db->sql_nextid()); + + $sql = "SELECT user_id + FROM phpbb_users + WHERE username_clean = '" . $db->sql_escape($username) . "'"; + $result = $db->sql_query_limit($sql, 1); + + $this->assertEquals($expected, $db->sql_fetchfield('user_id')); + } +} diff --git a/tests/di/create_container_test.php b/tests/di/create_container_test.php new file mode 100644 index 0000000000..c2b8a0fc0b --- /dev/null +++ b/tests/di/create_container_test.php @@ -0,0 +1,72 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; +require_once dirname(__FILE__) . '/../../phpBB/includes/functions_container.php'; +require_once dirname(__FILE__) . '/../../phpBB/includes/db/dbal.php'; + +class phpbb_di_container_test extends phpbb_test_case +{ + public function test_phpbb_create_container() + { + $phpbb_root_path = __DIR__ . '/../../phpBB/'; + $extensions = array( + new phpbb_di_extension_config(__DIR__ . '/fixtures/config.php'), + new phpbb_di_extension_core($phpbb_root_path), + ); + $container = phpbb_create_container($extensions, $phpbb_root_path, 'php'); + + $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container); + } + + public function test_phpbb_create_install_container() + { + $phpbb_root_path = __DIR__ . '/../../phpBB/'; + $extensions = array( + new phpbb_di_extension_config(__DIR__ . '/fixtures/config.php'), + new phpbb_di_extension_core($phpbb_root_path), + ); + $container = phpbb_create_install_container($phpbb_root_path, 'php'); + + $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container); + $this->assertTrue($container->isFrozen()); + } + + public function test_phpbb_create_compiled_container() + { + $phpbb_root_path = __DIR__ . '/../../phpBB/'; + $extensions = array( + new phpbb_di_extension_config(__DIR__ . '/fixtures/config.php'), + new phpbb_di_extension_core($phpbb_root_path), + ); + $container = phpbb_create_compiled_container($extensions, array(), $phpbb_root_path, 'php'); + + $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container); + $this->assertTrue($container->isFrozen()); + } +} + +class dbal_container_mock extends dbal +{ + public function sql_connect() + { + } + + public function sql_query() + { + } + + public function sql_fetchrow() + { + } + + public function sql_freeresult() + { + } +} diff --git a/tests/di/fixtures/config.php b/tests/di/fixtures/config.php new file mode 100644 index 0000000000..5033d2dc9f --- /dev/null +++ b/tests/di/fixtures/config.php @@ -0,0 +1,11 @@ +<?php +// phpBB 3.1.x auto-generated configuration file +// Do not change anything in this file! +$dbms = 'container_mock'; +$dbhost = '127.0.0.1'; +$dbport = ''; +$dbname = 'phpbb'; +$dbuser = 'root'; +$dbpasswd = ''; +$table_prefix = 'phpbb_'; +$acm_type = 'phpbb_cache_driver_null'; diff --git a/tests/download/http_byte_range_test.php b/tests/download/http_byte_range_test.php index b93c1b630c..23b9169fe3 100644 --- a/tests/download/http_byte_range_test.php +++ b/tests/download/http_byte_range_test.php @@ -8,7 +8,6 @@ */ require_once dirname(__FILE__) . '/../../phpBB/includes/functions_download.php'; -require_once dirname(__FILE__) . '/../mock/request.php'; class phpbb_download_http_byte_range_test extends phpbb_test_case { diff --git a/tests/event/dispatcher_test.php b/tests/event/dispatcher_test.php index f8fe060d99..9b9203e06a 100644 --- a/tests/event/dispatcher_test.php +++ b/tests/event/dispatcher_test.php @@ -11,7 +11,7 @@ class phpbb_event_dispatcher_test extends phpbb_test_case { public function test_trigger_event() { - $dispatcher = new phpbb_event_dispatcher(); + $dispatcher = new phpbb_event_dispatcher(new phpbb_mock_container_builder()); $dispatcher->addListener('core.test_event', function (phpbb_event_data $event) { $event['foo'] = $event['foo'] . '2'; diff --git a/tests/extension/acp.php b/tests/extension/acp.php new file mode 100644 index 0000000000..790df77c0d --- /dev/null +++ b/tests/extension/acp.php @@ -0,0 +1,205 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +class acp_test extends phpbb_functional_test_case +{ + static private $copied_files = array(); + static private $helper; + + /** + * This should only be called once before the tests are run. + * This is used to copy the extensions to the phpBB install + */ + static public function setUpBeforeClass() + { + global $phpbb_root_path; + + parent::setUpBeforeClass(); + + self::$helper = new phpbb_test_case_helpers(self); + + // First, move any extensions setup on the board to a temp directory + self::$copied_files = self::$helper->copy_dir($phpbb_root_path . 'ext/', $phpbb_root_path . 'store/temp_ext/'); + + // Then empty the ext/ directory on the board (for accurate test cases) + self::$helper->empty_dir($phpbb_root_path . 'ext/'); + + // Copy our ext/ files from the test case to the board + self::$copied_files = array_merge(self::$copied_files, self::$helper->copy_dir(dirname(__FILE__) . '/ext/', $phpbb_root_path . 'ext/')); + } + + public function setUp() + { + parent::setUp(); + + $this->get_db(); + + // Clear the phpbb_ext table + $this->db->sql_query('DELETE FROM phpbb_ext'); + + // Insert our base data + $insert_rows = array( + array( + 'ext_name' => 'foo', + 'ext_active' => true, + 'ext_state' => 'b:0;', + ), + array( + 'ext_name' => 'vendor/moo', + 'ext_active' => false, + 'ext_state' => 'b:0;', + ), + + // do not exist + array( + 'ext_name' => 'test2', + 'ext_active' => true, + 'ext_state' => 'b:0;', + ), + array( + 'ext_name' => 'test3', + 'ext_active' => false, + 'ext_state' => 'b:0;', + ), + ); + $this->db->sql_multi_insert('phpbb_ext', $insert_rows); + + $this->login(); + $this->admin_login(); + + $this->add_lang('acp/extensions'); + } + + /** + * This should only be called once after the tests are run. + * This is used to remove the files copied to the phpBB install + */ + static public function tearDownAfterClass() + { + global $phpbb_root_path; + + // Copy back the board installed extensions from the temp directory + self::$helper->copy_dir($phpbb_root_path . 'store/temp_ext/', $phpbb_root_path . 'ext/'); + + self::$copied_files[] = $phpbb_root_path . 'store/temp_ext/'; + + // Remove all of the files we copied around (from board ext -> temp_ext, from test ext -> board ext) + self::$helper->remove_files(self::$copied_files); + } + + public function test_list() + { + $crawler = $this->request('GET', 'adm/index.php?i=acp_extensions&mode=main&sid=' . $this->sid); + + $this->assertCount(1, $crawler->filter('.ext_enabled')); + $this->assertCount(4, $crawler->filter('.ext_disabled')); + + $this->assertContains('phpBB Foo Extension', $crawler->filter('.ext_enabled')->eq(0)->text()); + $this->assertContainsLang('PURGE', $crawler->filter('.ext_enabled')->eq(0)->text()); + + $this->assertContains('The "test2" extension is not valid.', $crawler->filter('.ext_disabled')->eq(0)->text()); + + $this->assertContains('The "test3" extension is not valid.', $crawler->filter('.ext_disabled')->eq(1)->text()); + + $this->assertContains('phpBB Moo Extension', $crawler->filter('.ext_disabled')->eq(2)->text()); + $this->assertContainsLang('DETAILS', $crawler->filter('.ext_disabled')->eq(2)->text()); + $this->assertContainsLang('ENABLE', $crawler->filter('.ext_disabled')->eq(2)->text()); + $this->assertContainsLang('PURGE', $crawler->filter('.ext_disabled')->eq(2)->text()); + + $this->assertContains('The "bar" extension is not valid.', $crawler->filter('.ext_disabled')->eq(3)->text()); + } + + public function test_details() + { + $crawler = $this->request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=details&ext_name=foo&sid=' . $this->sid); + + $validation = array( + 'DISPLAY_NAME' => 'phpBB Foo Extension', + 'CLEAN_NAME' => 'foo/example', + 'DESCRIPTION' => 'An example/sample extension to be used for testing purposes in phpBB Development.', + 'VERSION' => '1.0.0', + 'TIME' => '2012-02-15 01:01:01', + 'LICENCE' => 'GPL-2.0', + 'PHPBB_VERSION' => '3.1.0-dev', + 'PHP_VERSION' => '>=5.3', + 'AUTHOR_NAME' => 'Nathan Guse', + 'AUTHOR_EMAIL' => 'email@phpbb.com', + 'AUTHOR_HOMEPAGE' => 'http://lithiumstudios.org', + 'AUTHOR_ROLE' => 'N/A', + ); + + for ($i = 0; $i < $crawler->filter('dl')->count(); $i++) + { + $text = $crawler->filter('dl')->eq($i)->text(); + + $match = false; + + foreach ($validation as $language_key => $expected) + { + if (strpos($text, $this->lang($language_key)) === 0) + { + $match = true; + + $this->assertContains($expected, $text); + } + } + + if (!$match) + { + $this->fail('Unexpected field: "' . $text . '"'); + } + } + } + + public function test_enable_pre() + { + // Foo is already enabled (redirect to list) + $crawler = $this->request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=foo&sid=' . $this->sid); + $this->assertContainsLang('EXTENSION_NAME', $crawler->filter('html')->text()); + $this->assertContainsLang('EXTENSION_OPTIONS', $crawler->filter('html')->text()); + $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('html')->text()); + + $crawler = $this->request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid); + $this->assertContainsLang('ENABLE_CONFIRM', $crawler->filter('html')->text()); + } + + public function test_disable_pre() + { + // Moo is not enabled (redirect to list) + $crawler = $this->request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid); + $this->assertContainsLang('EXTENSION_NAME', $crawler->filter('html')->text()); + $this->assertContainsLang('EXTENSION_OPTIONS', $crawler->filter('html')->text()); + $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('html')->text()); + + $crawler = $this->request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=foo&sid=' . $this->sid); + $this->assertContainsLang('DISABLE_CONFIRM', $crawler->filter('html')->text()); + } + + public function test_purge_pre() + { + // test2 is not available (error) + $crawler = $this->request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=purge_pre&ext_name=test2&sid=' . $this->sid); + $this->assertContains('The required file does not exist', $crawler->filter('html')->text()); + + $crawler = $this->request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=purge_pre&ext_name=foo&sid=' . $this->sid); + $this->assertContainsLang('PURGE_CONFIRM', $crawler->filter('html')->text()); + } + + public function test_actions() + { + $crawler = $this->request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable&ext_name=vendor%2Fmoo&sid=' . $this->sid); + $this->assertContainsLang('ENABLE_SUCCESS', $crawler->filter('html')->text()); + + $crawler = $this->request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable&ext_name=vendor%2Fmoo&sid=' . $this->sid); + $this->assertContainsLang('DISABLE_SUCCESS', $crawler->filter('html')->text()); + + $crawler = $this->request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=purge&ext_name=vendor%2Fmoo&sid=' . $this->sid); + $this->assertContainsLang('PURGE_SUCCESS', $crawler->filter('html')->text()); + } +}
\ No newline at end of file diff --git a/tests/extension/ext/foo/composer.json b/tests/extension/ext/foo/composer.json new file mode 100644 index 0000000000..744f7be625 --- /dev/null +++ b/tests/extension/ext/foo/composer.json @@ -0,0 +1,22 @@ +{ + "name": "foo/example", + "type": "phpbb3-extension", + "description": "An example/sample extension to be used for testing purposes in phpBB Development.", + "version": "1.0.0", + "time": "2012-02-15 01:01:01", + "licence": "GPL-2.0", + "authors": [{ + "name": "Nathan Guse", + "username": "EXreaction", + "email": "email@phpbb.com", + "homepage": "http://lithiumstudios.org", + "role": "N/A" + }], + "require": { + "php": ">=5.3", + "phpbb": "3.1.0-dev" + }, + "extra": { + "display-name": "phpBB Foo Extension" + } +} diff --git a/tests/extension/ext/vendor/moo/composer.json b/tests/extension/ext/vendor/moo/composer.json new file mode 100644 index 0000000000..c91a5e027b --- /dev/null +++ b/tests/extension/ext/vendor/moo/composer.json @@ -0,0 +1,22 @@ +{ + "name": "moo/example", + "type": "phpbb3-extension", + "description": "An example/sample extension to be used for testing purposes in phpBB Development.", + "version": "1.0.0", + "time": "2012-02-15 01:01:01", + "licence": "GNU GPL v2", + "authors": [{ + "name": "Nathan Guse", + "username": "EXreaction", + "email": "email@phpbb.com", + "homepage": "http://lithiumstudios.org", + "role": "N/A" + }], + "require": { + "php": ">=5.3", + "phpbb": "3.1.0-dev" + }, + "extra": { + "display-name": "phpBB Moo Extension" + } +} diff --git a/tests/extension/finder_test.php b/tests/extension/finder_test.php index f7e9bd57bb..622f404786 100644 --- a/tests/extension/finder_test.php +++ b/tests/extension/finder_test.php @@ -7,9 +7,6 @@ * */ -require_once dirname(__FILE__) . '/../mock/cache.php'; -require_once dirname(__FILE__) . '/../mock/extension_manager.php'; - class phpbb_extension_finder_test extends phpbb_test_case { protected $extension_manager; diff --git a/tests/extension/manager_test.php b/tests/extension/manager_test.php index 0a689916c7..5cde5bccdb 100644 --- a/tests/extension/manager_test.php +++ b/tests/extension/manager_test.php @@ -7,7 +7,6 @@ * */ -require_once dirname(__FILE__) . '/../mock/cache.php'; require_once dirname(__FILE__) . '/ext/bar/ext.php'; require_once dirname(__FILE__) . '/ext/foo/ext.php'; require_once dirname(__FILE__) . '/ext/vendor/moo/ext.php'; @@ -28,6 +27,7 @@ class phpbb_extension_manager_test extends phpbb_database_test_case $this->extension_manager = new phpbb_extension_manager( $this->new_dbal(), + new phpbb_config(array()), 'phpbb_ext', dirname(__FILE__) . '/', '.php', @@ -91,6 +91,7 @@ class phpbb_extension_manager_test extends phpbb_database_test_case { $extension_manager = new phpbb_extension_manager( $this->new_dbal(), + new phpbb_config(array()), 'phpbb_ext', dirname(__FILE__) . '/', '.php' diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php new file mode 100644 index 0000000000..ce7be0dea5 --- /dev/null +++ b/tests/extension/metadata_manager_test.php @@ -0,0 +1,431 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +class metadata_manager_test extends phpbb_database_test_case +{ + protected $class_loader; + protected $extension_manager; + + protected $cache; + protected $config; + protected $db; + protected $phpbb_root_path; + protected $phpEx; + protected $template; + protected $user; + + public function getDataSet() + { + return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/extensions.xml'); + } + + protected function setUp() + { + parent::setUp(); + + $this->cache = new phpbb_mock_cache(); + $this->config = new phpbb_config(array( + 'version' => '3.1.0', + )); + $this->db = $this->new_dbal(); + $this->phpbb_root_path = dirname(__FILE__) . '/'; + $this->phpEx = '.php'; + $this->user = new phpbb_user(); + + $this->template = new phpbb_template( + $this->phpbb_root_path, + $this->phpEx, + $this->config, + $this->user, + new phpbb_style_resource_locator(), + new phpbb_template_context() + ); + + $this->extension_manager = new phpbb_extension_manager( + $this->db, + $this->config, + 'phpbb_ext', + $this->phpbb_root_path, + $this->phpEx, + $this->cache + ); + } + + // Should fail from missing composer.json + public function test_bar() + { + $ext_name = 'bar'; + + $manager = $this->get_metadata_manager($ext_name); + + try + { + $manager->get_metadata(); + } + catch(phpbb_extension_exception $e){} + + $this->assertEquals((string) $e, 'The required file does not exist: ' . $this->phpbb_root_path . $this->extension_manager->get_extension_path($ext_name) . 'composer.json'); + } + + // Should be the same as a direct json_decode of the composer.json file + public function test_foo() + { + $ext_name = 'foo'; + + $manager = $this->get_metadata_manager($ext_name); + + try + { + $metadata = $manager->get_metadata(); + } + catch(phpbb_extension_exception $e) + { + $this->fail($e); + } + + $json = json_decode(file_get_contents($this->phpbb_root_path . 'ext/foo/composer.json'), true); + + $this->assertEquals($metadata, $json); + } + + public function test_validator_non_existant() + { + $ext_name = 'validator'; + + $manager = $this->get_metadata_manager($ext_name); + + // Non-existant data + try + { + $manager->validate('name'); + + $this->fail('Exception not triggered'); + } + catch(phpbb_extension_exception $e) + { + $this->assertEquals((string) $e, 'Required meta field \'name\' has not been set.'); + } + + try + { + $manager->validate('type'); + + $this->fail('Exception not triggered'); + } + catch(phpbb_extension_exception $e) + { + $this->assertEquals((string) $e, 'Required meta field \'type\' has not been set.'); + } + + try + { + $manager->validate('licence'); + + $this->fail('Exception not triggered'); + } + catch(phpbb_extension_exception $e) + { + $this->assertEquals((string) $e, 'Required meta field \'licence\' has not been set.'); + } + + try + { + $manager->validate('version'); + + $this->fail('Exception not triggered'); + } + catch(phpbb_extension_exception $e) + { + $this->assertEquals((string) $e, 'Required meta field \'version\' has not been set.'); + } + + try + { + $manager->validate_authors(); + + $this->fail('Exception not triggered'); + } + catch(phpbb_extension_exception $e) + { + $this->assertEquals((string) $e, 'Required meta field \'authors\' has not been set.'); + } + + $manager->merge_metadata(array( + 'authors' => array( + array(), + ), + )); + + try + { + $manager->validate_authors(); + + $this->fail('Exception not triggered'); + } + catch(phpbb_extension_exception $e) + { + $this->assertEquals((string) $e, 'Required meta field \'author name\' has not been set.'); + } + } + + + public function test_validator_invalid() + { + $ext_name = 'validator'; + + $manager = $this->get_metadata_manager($ext_name); + + // Invalid data + $manager->set_metadata(array( + 'name' => 'asdf', + 'type' => 'asdf', + 'licence' => '', + 'version' => '', + )); + + try + { + $manager->validate('name'); + + $this->fail('Exception not triggered'); + } + catch(phpbb_extension_exception $e) + { + $this->assertEquals((string) $e, 'Meta field \'name\' is invalid.'); + } + + try + { + $manager->validate('type'); + + $this->fail('Exception not triggered'); + } + catch(phpbb_extension_exception $e) + { + $this->assertEquals((string) $e, 'Meta field \'type\' is invalid.'); + } + + try + { + $manager->validate('licence'); + + $this->fail('Exception not triggered'); + } + catch(phpbb_extension_exception $e) + { + $this->assertEquals((string) $e, 'Meta field \'licence\' is invalid.'); + } + + try + { + $manager->validate('version'); + + $this->fail('Exception not triggered'); + } + catch(phpbb_extension_exception $e) + { + $this->assertEquals((string) $e, 'Meta field \'version\' is invalid.'); + } + } + + public function test_validator_valid() + { + $ext_name = 'validator'; + + $manager = $this->get_metadata_manager($ext_name); + + // Valid data + $manager->set_metadata(array( + 'name' => 'test/foo', + 'type' => 'phpbb3-extension', + 'licence' => 'GPL v2', + 'version' => '1.0.0', + )); + + try + { + $this->assertEquals(true, $manager->validate('enable')); + } + catch(phpbb_extension_exception $e) + { + $this->fail($e); + } + } + + + public function test_validator_requirements() + { + $ext_name = 'validator'; + + $manager = $this->get_metadata_manager($ext_name); + // Too high of requirements + $manager->merge_metadata(array( + 'require' => array( + 'php' => '10.0.0', + 'phpbb' => '3.2.0', // config is set to 3.1.0 + ), + )); + + try + { + $this->assertEquals(false, $manager->validate_require_php()); + $this->assertEquals(false, $manager->validate_require_phpbb()); + } + catch(phpbb_extension_exception $e) + { + $this->fail($e); + } + + + // Too high of requirements + $manager->merge_metadata(array( + 'require' => array( + 'php' => '5.3.0', + 'phpbb' => '3.1.0-beta', // config is set to 3.1.0 + ), + )); + + try + { + $this->assertEquals(true, $manager->validate_require_php()); + $this->assertEquals(true, $manager->validate_require_phpbb()); + } + catch(phpbb_extension_exception $e) + { + $this->fail($e); + } + + + // Too high of requirements + $manager->merge_metadata(array( + 'require' => array( + 'php' => '>' . phpversion(), + 'phpbb' => '>3.1.0', // config is set to 3.1.0 + ), + )); + + try + { + $this->assertEquals(false, $manager->validate_require_php()); + $this->assertEquals(false, $manager->validate_require_phpbb()); + } + catch(phpbb_extension_exception $e) + { + $this->fail($e); + } + + + // Too high of current install + $manager->merge_metadata(array( + 'require' => array( + 'php' => '<' . phpversion(), + 'phpbb' => '<3.1.0', // config is set to 3.1.0 + ), + )); + + try + { + $this->assertEquals(false, $manager->validate_require_php()); + $this->assertEquals(false, $manager->validate_require_phpbb()); + } + catch(phpbb_extension_exception $e) + { + $this->fail($e); + } + + + // Matching requirements + $manager->merge_metadata(array( + 'require' => array( + 'php' => phpversion(), + 'phpbb' => '3.1.0', // config is set to 3.1.0 + ), + )); + + try + { + $this->assertEquals(true, $manager->validate_require_php()); + $this->assertEquals(true, $manager->validate_require_phpbb()); + } + catch(phpbb_extension_exception $e) + { + $this->fail($e); + } + + + // Matching requirements + $manager->merge_metadata(array( + 'require' => array( + 'php' => '>=' . phpversion(), + 'phpbb' => '>=3.1.0', // config is set to 3.1.0 + ), + )); + + try + { + $this->assertEquals(true, $manager->validate_require_php()); + $this->assertEquals(true, $manager->validate_require_phpbb()); + } + catch(phpbb_extension_exception $e) + { + $this->fail($e); + } + + + // Matching requirements + $manager->merge_metadata(array( + 'require' => array( + 'php' => '<=' . phpversion(), + 'phpbb' => '<=3.1.0', // config is set to 3.1.0 + ), + )); + + try + { + $this->assertEquals(true, $manager->validate_require_php()); + $this->assertEquals(true, $manager->validate_require_phpbb()); + } + catch(phpbb_extension_exception $e) + { + $this->fail($e); + } + } + + /** + * Get an instance of the metadata manager + * + * @param string $ext_name + * @return phpbb_extension_metadata_manager_test + */ + private function get_metadata_manager($ext_name) + { + return new phpbb_extension_metadata_manager_test( + $ext_name, + $this->db, + $this->extension_manager, + $this->phpbb_root_path, + $this->phpEx, + $this->template, + $this->config + ); + } +} + +class phpbb_extension_metadata_manager_test extends phpbb_extension_metadata_manager +{ + public function set_metadata($metadata) + { + $this->metadata = $metadata; + } + + public function merge_metadata($metadata) + { + $this->metadata = array_merge($this->metadata, $metadata); + } +}
\ No newline at end of file diff --git a/tests/fixtures/empty.xml b/tests/fixtures/empty.xml new file mode 100644 index 0000000000..96eb1ab483 --- /dev/null +++ b/tests/fixtures/empty.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<dataset> + <table name="phpbb_posts"> + </table> +</dataset> diff --git a/tests/functional/browse_test.php b/tests/functional/browse_test.php index 26c18c4c1f..b5748059c6 100644 --- a/tests/functional/browse_test.php +++ b/tests/functional/browse_test.php @@ -15,18 +15,21 @@ class phpbb_functional_browse_test extends phpbb_functional_test_case public function test_index() { $crawler = $this->request('GET', 'index.php'); + $this->assert_response_success(); $this->assertGreaterThan(0, $crawler->filter('.topiclist')->count()); } public function test_viewforum() { $crawler = $this->request('GET', 'viewforum.php?f=2'); + $this->assert_response_success(); $this->assertGreaterThan(0, $crawler->filter('.topiclist')->count()); } public function test_viewtopic() { $crawler = $this->request('GET', 'viewtopic.php?t=1'); + $this->assert_response_success(); $this->assertGreaterThan(0, $crawler->filter('.postbody')->count()); } } diff --git a/tests/functional/extension_controller_test.php b/tests/functional/extension_controller_test.php index e9409d9d3f..f28b321942 100644 --- a/tests/functional/extension_controller_test.php +++ b/tests/functional/extension_controller_test.php @@ -13,6 +13,14 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_case { protected $phpbb_extension_manager; + + static protected $fixtures = array( + 'foo/bar/config/routing.yml', + 'foo/bar/config/services.yml', + 'foo/bar/controller/controller.php', + 'foo/bar/styles/prosilver/template/foo_bar_body.html', + ); + /** * This should only be called once before the tests are run. * This is used to copy the fixtures to the phpBB install @@ -22,15 +30,11 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c global $phpbb_root_path; parent::setUpBeforeClass(); - // these directories need to be created before the files can be copied $directories = array( - $phpbb_root_path . 'ext/error/class/', - $phpbb_root_path . 'ext/error/classtype/', - $phpbb_root_path . 'ext/error/disabled/', $phpbb_root_path . 'ext/foo/bar/', - $phpbb_root_path . 'ext/foo/bar/styles/prosilver/template/', - $phpbb_root_path . 'ext/foobar/', - $phpbb_root_path . 'ext/foobar/styles/prosilver/template/', + $phpbb_root_path . 'ext/foo/bar/config/', + $phpbb_root_path . 'ext/foo/bar/controller/', + $phpbb_root_path . 'ext/foo/bar/styles/prosilver/template', ); foreach ($directories as $dir) @@ -41,28 +45,34 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c } } - $fixtures = array( - 'error/class/controller.php', - 'error/class/ext.php', - 'error/classtype/controller.php', - 'error/classtype/ext.php', - 'error/disabled/controller.php', - 'error/disabled/ext.php', - 'foo/bar/controller.php', - 'foo/bar/ext.php', - 'foo/bar/styles/prosilver/template/foobar_body.html', - 'foobar/controller.php', - 'foobar/ext.php', - 'foobar/styles/prosilver/template/foobar_body.html', - ); + foreach (self::$fixtures as $fixture) + { + copy( + "tests/functional/fixtures/ext/$fixture", + "{$phpbb_root_path}ext/$fixture"); + } + } - foreach ($fixtures as $fixture) + /** + * This should only be called once after the tests are run. + * This is used to remove the fixtures from the phpBB install + */ + static public function tearDownAfterClass() + { + global $phpbb_root_path; + + foreach (self::$fixtures as $fixture) { - if (!copy("tests/functional/fixtures/ext/$fixture", "{$phpbb_root_path}ext/$fixture")) - { - echo 'Could not copy file ' . $fixture; - } + unlink("{$phpbb_root_path}ext/$fixture"); } + + rmdir("{$phpbb_root_path}ext/foo/bar/config"); + rmdir("{$phpbb_root_path}ext/foo/bar/controller"); + rmdir("{$phpbb_root_path}ext/foo/bar/styles/prosilver/template"); + rmdir("{$phpbb_root_path}ext/foo/bar/styles/prosilver"); + rmdir("{$phpbb_root_path}ext/foo/bar/styles"); + rmdir("{$phpbb_root_path}ext/foo/bar"); + rmdir("{$phpbb_root_path}ext/foo"); } public function setUp() @@ -75,70 +85,67 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c } /** - * Check an extension at ./ext/foobar/ which should have the class - * phpbb_ext_foobar_controller - */ - public function test_foobar() - { - $this->phpbb_extension_manager->enable('foobar'); - $crawler = $this->request('GET', 'index.php?ext=foobar'); - $this->assertContains("This is for testing purposes.", $crawler->filter('#page-body')->text()); - $this->phpbb_extension_manager->purge('foobar'); - } - - /** - * Check an extension at ./ext/foo/bar/ which should have the class - * phpbb_ext_foo_bar_controller + * Check a controller for extension foo/bar. */ public function test_foo_bar() { $this->phpbb_extension_manager->enable('foo/bar'); - $crawler = $this->request('GET', 'index.php?ext=foo/bar'); - $this->assertContains("This is for testing purposes.", $crawler->filter('#page-body')->text()); + $crawler = $this->request('GET', 'app.php?controller=foo/bar'); + $this->assert_response_success(); + $this->assertContains("foo/bar controller handle() method", $crawler->filter('body')->text()); $this->phpbb_extension_manager->purge('foo/bar'); } /** - * Check the error produced by extension at ./ext/error/class which has class - * phpbb_ext_foobar_controller + * Check the output of a controller using the template system */ - public function test_error_class_name() + public function test_controller_with_template() { - $this->phpbb_extension_manager->enable('error/class'); - $crawler = $this->request('GET', 'index.php?ext=error/class'); - $this->assertContains("The extension error/class is missing a controller class and cannot be accessed through the front-end.", $crawler->filter('#message')->text()); - $this->phpbb_extension_manager->purge('error/class'); + $this->phpbb_extension_manager->enable('foo/bar'); + $crawler = $this->request('GET', 'app.php?controller=foo/template'); + $this->assert_response_success(); + $this->assertContains("I am a variable", $crawler->filter('#content')->text()); + $this->phpbb_extension_manager->purge('foo/bar'); } /** - * Check the error produced by extension at ./ext/error/classtype which has class - * phpbb_ext_error_classtype_controller but does not implement phpbb_extension_controller_interface + * Check the error produced by calling a controller without a required + * argument. */ - public function test_error_class_type() + public function test_missing_argument() { - $this->phpbb_extension_manager->enable('error/classtype'); - $crawler = $this->request('GET', 'index.php?ext=error/classtype'); - $this->assertContains("The extension controller class phpbb_ext_error_classtype_controller is not an instance of the phpbb_extension_controller_interface.", $crawler->filter('#message')->text()); - $this->phpbb_extension_manager->purge('error/classtype'); + $this->phpbb_extension_manager->enable('foo/bar'); + $crawler = $this->request('GET', 'app.php?controller=foo/baz'); + $this->assertEquals(500, $this->client->getResponse()->getStatus()); + $this->assertContains('Missing value for argument #1: test in class phpbb_ext_foo_bar_controller:baz', $crawler->filter('body')->text()); + $this->phpbb_extension_manager->purge('foo/bar'); } /** - * Check the error produced by extension at ./ext/error/disabled that is (obviously) - * a disabled extension + * Check the status code resulting from an exception thrown by a controller */ - public function test_error_ext_disabled() + public function test_exception_should_result_in_500_status_code() { - $crawler = $this->request('GET', 'index.php?ext=error/disabled'); - $this->assertContains("The extension error/disabled is not enabled", $crawler->filter('#message')->text()); + $this->phpbb_extension_manager->enable('foo/bar'); + $crawler = $this->request('GET', 'app.php?controller=foo/exception'); + $this->assertEquals(500, $this->client->getResponse()->getStatus()); + $this->assertContains('Exception thrown from foo/exception route', $crawler->filter('body')->text()); + $this->phpbb_extension_manager->purge('foo/bar'); } /** - * Check the error produced by extension at ./ext/error/404 that is (obviously) - * not existant + * Check the error produced by extension at ./ext/does/not/exist. + * + * If an extension is disabled, its routes are not loaded. Because we + * are not looking for a controller based on a specified extension, + * we don't know the difference between a route in a disabled + * extension and a route that is not defined anyway; it is the same + * error message. */ - public function test_error_ext_missing() + public function test_error_ext_disabled_or_404() { - $crawler = $this->request('GET', 'index.php?ext=error/404'); - $this->assertContains("The extension error/404 does not exist.", $crawler->filter('#message')->text()); + $crawler = $this->request('GET', 'app.php?controller=does/not/exist'); + $this->assertEquals(404, $this->client->getResponse()->getStatus()); + $this->assertContains('No route found for "GET /does/not/exist"', $crawler->filter('body')->text()); } } diff --git a/tests/functional/fileupload_form_test.php b/tests/functional/fileupload_form_test.php new file mode 100644 index 0000000000..99afcfdc3d --- /dev/null +++ b/tests/functional/fileupload_form_test.php @@ -0,0 +1,72 @@ +<?php +/** + * + * @package testing + * @copyright (c) 2012 phpBB Group + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 + * + */ + +/** + * @group functional + */ +class phpbb_functional_fileupload_form_test extends phpbb_functional_test_case +{ + private $path; + + public function setUp() + { + parent::setUp(); + $this->path = __DIR__ . '/fixtures/files/'; + $this->add_lang('posting'); + $this->login(); + } + + private function upload_file($filename, $mimetype) + { + $file = array( + 'tmp_name' => $this->path . $filename, + 'name' => $filename, + 'type' => $mimetype, + 'size' => filesize($this->path . $filename), + 'error' => UPLOAD_ERR_OK, + ); + + $crawler = $this->client->request( + 'POST', + 'posting.php?mode=reply&f=2&t=1&sid=' . $this->sid, + array('add_file' => $this->lang('ADD_FILE')), + array('fileupload' => $file) + ); + + return $crawler; + } + + public function test_empty_file() + { + $crawler = $this->upload_file('empty.png', 'image/png'); + $this->assertEquals($this->lang('ATTACHED_IMAGE_NOT_IMAGE'), $crawler->filter('div#message p')->text()); + } + + public function test_invalid_extension() + { + $crawler = $this->upload_file('illegal-extension.bif', 'application/octet-stream'); + $this->assertEquals($this->lang('DISALLOWED_EXTENSION', 'bif'), $crawler->filter('p.error')->text()); + } + + public function test_too_large() + { + $this->markTestIncomplete('Functional tests use an admin account which ignores maximum upload size.'); + $crawler = $this->upload_file('too-large.png', 'image/png'); + $this->assertEquals($this->lang('WRONG_FILESIZE', '256', 'KiB'), $crawler->filter('p.error')->text()); + } + + public function test_valid_file() + { + $crawler = $this->upload_file('valid.jpg', 'image/jpeg'); + $this->assert_response_success(); + // ensure there was no error message rendered + $this->assertNotContains('<h2>' . $this->lang('INFORMATION') . '</h2>', $this->client->getResponse()->getContent()); + $this->assertContains($this->lang('POSTED_ATTACHMENTS'), $crawler->filter('#postform h3')->eq(1)->text()); + } +} diff --git a/tests/functional/fileupload_remote_test.php b/tests/functional/fileupload_remote_test.php new file mode 100644 index 0000000000..0deb79acf6 --- /dev/null +++ b/tests/functional/fileupload_remote_test.php @@ -0,0 +1,72 @@ +<?php +/** + * + * @package testing + * @copyright (c) 2012 phpBB Group + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 + * + */ + +/** + * @group functional + */ +class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case +{ + public function setUp() + { + parent::setUp(); + // Only doing this within the functional framework because we need a + // URL + + // Global $config required by unique_id + // Global $user required by fileupload::remote_upload + global $config, $user; + + if (!is_array($config)) + { + $config = array(); + } + + $config['rand_seed'] = ''; + $config['rand_seed_last_update'] = time() + 600; + + $user = new phpbb_mock_user(); + $user->lang = new phpbb_mock_lang(); + } + + public function tearDown() + { + global $config, $user; + $user = null; + $config = array(); + } + + public function test_invalid_extension() + { + $upload = new fileupload('', array('jpg'), 100); + $file = $upload->remote_upload('http://example.com/image.gif'); + $this->assertEquals('URL_INVALID', $file->error[0]); + } + + public function test_non_existant() + { + $upload = new fileupload('', array('jpg'), 100); + $file = $upload->remote_upload('http://example.com/image.jpg'); + $this->assertEquals('EMPTY_REMOTE_DATA', $file->error[0]); + } + + public function test_successful_upload() + { + $upload = new fileupload('', array('gif'), 1000); + $file = $upload->remote_upload($this->root_url . 'styles/prosilver/theme/images/forum_read.gif'); + $this->assertEquals(0, sizeof($file->error)); + $this->assertTrue(file_exists($file->filename)); + } + + public function test_too_large() + { + $upload = new fileupload('', array('gif'), 100); + $file = $upload->remote_upload($this->root_url . 'styles/prosilver/theme/images/forum_read.gif'); + $this->assertEquals('WRONG_FILESIZE', $file->error[0]); + } +} diff --git a/tests/functional/fixtures/ext/error/class/controller.php b/tests/functional/fixtures/ext/error/class/controller.php deleted file mode 100644 index 74bbbee540..0000000000 --- a/tests/functional/fixtures/ext/error/class/controller.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -class phpbb_ext_foobar_controller extends phpbb_extension_controller -{ - public function handle() - { - $this->template->set_filenames(array( - 'body' => 'index_body.html' - )); - - page_header('Test extension'); - page_footer(); - } -} diff --git a/tests/functional/fixtures/ext/error/class/ext.php b/tests/functional/fixtures/ext/error/class/ext.php deleted file mode 100644 index f97ad2b838..0000000000 --- a/tests/functional/fixtures/ext/error/class/ext.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php - -class phpbb_ext_error_class_ext extends phpbb_extension_base -{ - -} diff --git a/tests/functional/fixtures/ext/error/classtype/controller.php b/tests/functional/fixtures/ext/error/classtype/controller.php deleted file mode 100644 index 55ac651bdf..0000000000 --- a/tests/functional/fixtures/ext/error/classtype/controller.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -class phpbb_ext_error_classtype_controller -{ - public function handle() - { - global $template; - $template->set_filenames(array( - 'body' => 'index_body.html' - )); - - page_header('Test extension'); - page_footer(); - } -} diff --git a/tests/functional/fixtures/ext/error/classtype/ext.php b/tests/functional/fixtures/ext/error/classtype/ext.php deleted file mode 100644 index 35b1cd15a2..0000000000 --- a/tests/functional/fixtures/ext/error/classtype/ext.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php - -class phpbb_ext_error_classtype_ext extends phpbb_extension_base -{ - -} diff --git a/tests/functional/fixtures/ext/error/disabled/controller.php b/tests/functional/fixtures/ext/error/disabled/controller.php deleted file mode 100644 index 57b913f377..0000000000 --- a/tests/functional/fixtures/ext/error/disabled/controller.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -class phpbb_ext_error_disabled_controller extends phpbb_extension_controller -{ - public function handle() - { - $this->template->set_filenames(array( - 'body' => 'index_body.html' - )); - - page_header('Test extension'); - page_footer(); - } -} diff --git a/tests/functional/fixtures/ext/error/disabled/ext.php b/tests/functional/fixtures/ext/error/disabled/ext.php deleted file mode 100644 index aec8051848..0000000000 --- a/tests/functional/fixtures/ext/error/disabled/ext.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php - -class phpbb_ext_error_disabled_ext extends phpbb_extension_base -{ - -} diff --git a/tests/functional/fixtures/ext/foo/bar/config/routing.yml b/tests/functional/fixtures/ext/foo/bar/config/routing.yml new file mode 100644 index 0000000000..09a30a8c67 --- /dev/null +++ b/tests/functional/fixtures/ext/foo/bar/config/routing.yml @@ -0,0 +1,15 @@ +foo_bar_controller: + pattern: /foo/bar + defaults: { _controller: foo_bar.controller:handle } + +foo_baz_controller: + pattern: /foo/baz + defaults: { _controller: foo_bar.controller:baz } + +foo_template_controller: + pattern: /foo/template + defaults: { _controller: foo_bar.controller:template } + +foo_exception_controller: + pattern: /foo/exception + defaults: { _controller: foo_bar.controller:exception } diff --git a/tests/functional/fixtures/ext/foo/bar/config/services.yml b/tests/functional/fixtures/ext/foo/bar/config/services.yml new file mode 100644 index 0000000000..33ced55af9 --- /dev/null +++ b/tests/functional/fixtures/ext/foo/bar/config/services.yml @@ -0,0 +1,6 @@ +services: + foo_bar.controller: + class: phpbb_ext_foo_bar_controller + arguments: + - @controller.helper + - @template diff --git a/tests/functional/fixtures/ext/foo/bar/controller.php b/tests/functional/fixtures/ext/foo/bar/controller.php deleted file mode 100644 index 3375e317b3..0000000000 --- a/tests/functional/fixtures/ext/foo/bar/controller.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -class phpbb_ext_foo_bar_controller extends phpbb_extension_controller -{ - public function handle() - { - $this->template->set_filenames(array( - 'body' => 'foobar_body.html' - )); - - page_header('Test extension'); - page_footer(); - } -} diff --git a/tests/functional/fixtures/ext/foo/bar/controller/controller.php b/tests/functional/fixtures/ext/foo/bar/controller/controller.php new file mode 100644 index 0000000000..5a91b5f681 --- /dev/null +++ b/tests/functional/fixtures/ext/foo/bar/controller/controller.php @@ -0,0 +1,35 @@ +<?php +use Symfony\Component\HttpFoundation\Response; + +class phpbb_ext_foo_bar_controller +{ + protected $template; + + public function __construct(phpbb_controller_helper $helper, phpbb_template $template) + { + $this->template = $template; + $this->helper = $helper; + } + + public function handle() + { + return new Response('foo/bar controller handle() method', 200); + } + + public function baz($test) + { + return new Response('Value of "test" URL argument is: ' . $test); + } + + public function template() + { + $this->template->assign_var('A_VARIABLE', 'I am a variable'); + + return $this->helper->render('foo_bar_body.html'); + } + + public function exception() + { + throw new phpbb_controller_exception('Exception thrown from foo/exception route'); + } +} diff --git a/tests/functional/fixtures/ext/foo/bar/ext.php b/tests/functional/fixtures/ext/foo/bar/ext.php index 3a2068631e..74359d51ab 100644 --- a/tests/functional/fixtures/ext/foo/bar/ext.php +++ b/tests/functional/fixtures/ext/foo/bar/ext.php @@ -2,5 +2,5 @@ class phpbb_ext_foo_bar_ext extends phpbb_extension_base { - + } diff --git a/tests/functional/fixtures/ext/foo/bar/styles/prosilver/template/foobar_body.html b/tests/functional/fixtures/ext/foo/bar/styles/prosilver/template/foo_bar_body.html index 4addf2666f..8fb6994d3d 100644 --- a/tests/functional/fixtures/ext/foo/bar/styles/prosilver/template/foobar_body.html +++ b/tests/functional/fixtures/ext/foo/bar/styles/prosilver/template/foo_bar_body.html @@ -1,5 +1,3 @@ <!-- INCLUDE overall_header.html --> - -<div id="welcome">This is for testing purposes.</div> - +<div id="content">{A_VARIABLE}</div> <!-- INCLUDE overall_footer.html --> diff --git a/tests/functional/fixtures/ext/foobar/controller.php b/tests/functional/fixtures/ext/foobar/controller.php deleted file mode 100644 index ff35f12ee0..0000000000 --- a/tests/functional/fixtures/ext/foobar/controller.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -class phpbb_ext_foobar_controller extends phpbb_extension_controller -{ - public function handle() - { - $this->template->set_filenames(array( - 'body' => 'foobar_body.html' - )); - - page_header('Test extension'); - page_footer(); - } -} diff --git a/tests/functional/fixtures/ext/foobar/ext.php b/tests/functional/fixtures/ext/foobar/ext.php deleted file mode 100644 index 7cf443d369..0000000000 --- a/tests/functional/fixtures/ext/foobar/ext.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php - -class phpbb_ext_foobar_ext extends phpbb_extension_base -{ - -} diff --git a/tests/functional/fixtures/ext/foobar/styles/prosilver/template/foobar_body.html b/tests/functional/fixtures/ext/foobar/styles/prosilver/template/foobar_body.html deleted file mode 100644 index 4addf2666f..0000000000 --- a/tests/functional/fixtures/ext/foobar/styles/prosilver/template/foobar_body.html +++ /dev/null @@ -1,5 +0,0 @@ -<!-- INCLUDE overall_header.html --> - -<div id="welcome">This is for testing purposes.</div> - -<!-- INCLUDE overall_footer.html --> diff --git a/tests/functional/fixtures/files/empty.png b/tests/functional/fixtures/files/empty.png new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/functional/fixtures/files/empty.png diff --git a/tests/functional/fixtures/files/illegal-extension.bif b/tests/functional/fixtures/files/illegal-extension.bif Binary files differnew file mode 100644 index 0000000000..3cd5038e38 --- /dev/null +++ b/tests/functional/fixtures/files/illegal-extension.bif diff --git a/tests/functional/fixtures/files/too-large.png b/tests/functional/fixtures/files/too-large.png Binary files differnew file mode 100644 index 0000000000..ed4b0abd80 --- /dev/null +++ b/tests/functional/fixtures/files/too-large.png diff --git a/tests/functional/fixtures/files/valid.jpg b/tests/functional/fixtures/files/valid.jpg Binary files differnew file mode 100644 index 0000000000..95a87ddbdf --- /dev/null +++ b/tests/functional/fixtures/files/valid.jpg diff --git a/tests/functional/posting_test.php b/tests/functional/posting_test.php new file mode 100644 index 0000000000..f54a3591b2 --- /dev/null +++ b/tests/functional/posting_test.php @@ -0,0 +1,102 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @group functional +*/ +class phpbb_functional_posting_test extends phpbb_functional_test_case +{ + public function test_post_new_topic() + { + $this->login(); + $this->add_lang('posting'); + + $crawler = $this->request('GET', 'posting.php?mode=post&f=2&sid=' . $this->sid); + $this->assertContains($this->lang('POST_TOPIC'), $crawler->filter('html')->text()); + + $hidden_fields = array(); + $hidden_fields[] = $crawler->filter('[type="hidden"]')->each(function ($node, $i) { + return array('name' => $node->getAttribute('name'), 'value' => $node->getAttribute('value')); + }); + + $test_message = 'This is a test topic posted by the testing framework.'; + $form_data = array( + 'subject' => 'Test Topic 1', + 'message' => $test_message, + 'post' => true, + 'f' => 2, + 'mode' => 'post', + 'sid' => $this->sid, + ); + + foreach ($hidden_fields as $fields) + { + foreach($fields as $field) + { + $form_data[$field['name']] = $field['value']; + } + } + + // Bypass time restriction that said that if the lastclick time (i.e. time when the form was opened) + // is not at least 2 seconds before submission, cancel the form + $form_data['lastclick'] = 0; + + // I use a request because the form submission method does not allow you to send data that is not + // contained in one of the actual form fields that the browser sees (i.e. it ignores "hidden" inputs) + // Instead, I send it as a request with the submit button "post" set to true. + $crawler = $this->client->request('POST', 'posting.php', $form_data); + $this->assertContains($this->lang('POST_STORED'), $crawler->filter('html')->text()); + + $crawler = $this->request('GET', 'viewtopic.php?t=2&sid=' . $this->sid); + $this->assertContains($test_message, $crawler->filter('html')->text()); + } + + public function test_post_reply() + { + $this->login(); + $this->add_lang('posting'); + + $crawler = $this->request('GET', 'posting.php?mode=reply&t=2&f=2&sid=' . $this->sid); + $this->assertContains($this->lang('POST_REPLY'), $crawler->filter('html')->text()); + + $hidden_fields = array(); + $hidden_fields[] = $crawler->filter('[type="hidden"]')->each(function ($node, $i) { + return array('name' => $node->getAttribute('name'), 'value' => $node->getAttribute('value')); + }); + + $test_message = 'This is a test post posted by the testing framework.'; + $form_data = array( + 'subject' => 'Re: Test Topic 1', + 'message' => $test_message, + 'post' => true, + 't' => 2, + 'f' => 2, + 'mode' => 'reply', + 'sid' => $this->sid, + ); + + foreach ($hidden_fields as $fields) + { + foreach($fields as $field) + { + $form_data[$field['name']] = $field['value']; + } + } + + // For reasoning behind the following command, see the test_post_new_topic() test + $form_data['lastclick'] = 0; + + // Submit the post + $crawler = $this->client->request('POST', 'posting.php', $form_data); + $this->assertContains($this->lang('POST_STORED'), $crawler->filter('html')->text()); + + $crawler = $this->request('GET', 'viewtopic.php?t=2&sid=' . $this->sid); + $this->assertContains($test_message, $crawler->filter('html')->text()); + } +} diff --git a/tests/functions/clean_path_test.php b/tests/functions/clean_path_test.php new file mode 100644 index 0000000000..bcbe9838d9 --- /dev/null +++ b/tests/functions/clean_path_test.php @@ -0,0 +1,44 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; + +class phpbb_clean_path_test extends phpbb_test_case +{ + public function clean_path_test_data() + { + return array( + array('foo', 'foo'), + array('foo/bar', 'foo/bar'), + array('foo/bar/', 'foo/bar/'), + array('foo/./bar', 'foo/bar'), + array('foo/./././bar', 'foo/bar'), + array('foo/bar/.', 'foo/bar'), + array('./foo/bar', './foo/bar'), + array('../foo/bar', '../foo/bar'), + array('one/two/three', 'one/two/three'), + array('one/two/../three', 'one/three'), + array('one/../two/three', 'two/three'), + array('one/two/..', 'one'), + array('one/two/../', 'one/'), + array('one/two/../three/../four', 'one/four'), + array('one/two/three/../../four', 'one/four'), + ); + } + + /** + * @dataProvider clean_path_test_data + */ + public function test_clean_path($input, $expected) + { + $output = phpbb_clean_path($input); + + $this->assertEquals($expected, $output); + } +} diff --git a/tests/functions/get_formatted_filesize_test.php b/tests/functions/get_formatted_filesize_test.php new file mode 100644 index 0000000000..96ea2be132 --- /dev/null +++ b/tests/functions/get_formatted_filesize_test.php @@ -0,0 +1,71 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; + +class phpbb_get_formatted_filesize_test extends phpbb_test_case +{ + public function get_formatted_filesize_test_data() + { + return array( + // exact powers of 2 + array(1, '1 BYTES'), + array(1024, '1 KIB'), + array(1048576, '1 MIB'), + array(1073741824, '1 GIB'), + array(1099511627776, '1 TIB'), + + // exact powers of 10 + array(1000, '1000 BYTES'), + array(1000000, '976.56 KIB'), + array(1000000000, '953.67 MIB'), + array(1000000000000, '931.32 GIB'), + array(100000000000000, '90.95 TIB'), + + array(0, '0 BYTES'), + array(2, '2 BYTES'), + + array(1023, '1023 BYTES'), + array(1025, '1 KIB'), + array(1048575, '1024 KIB'), + + // String values + // exact powers of 2 + array('1', '1 BYTES'), + array('1024', '1 KIB'), + array('1048576', '1 MIB'), + array('1073741824', '1 GIB'), + array('1099511627776', '1 TIB'), + + // exact powers of 10 + array('1000', '1000 BYTES'), + array('1000000', '976.56 KIB'), + array('1000000000', '953.67 MIB'), + array('1000000000000', '931.32 GIB'), + array('100000000000000', '90.95 TIB'), + + array('0', '0 BYTES'), + array('2', '2 BYTES'), + + array('1023', '1023 BYTES'), + array('1025', '1 KIB'), + array('1048575', '1024 KIB'), + ); + } + + /** + * @dataProvider get_formatted_filesize_test_data + */ + public function test_get_formatted_filesize($input, $expected) + { + $output = get_formatted_filesize($input); + + $this->assertEquals($expected, $output); + } +} diff --git a/tests/functions_acp/build_cfg_template_test.php b/tests/functions_acp/build_cfg_template_test.php index bb479ffac9..bf5330fd88 100644 --- a/tests/functions_acp/build_cfg_template_test.php +++ b/tests/functions_acp/build_cfg_template_test.php @@ -7,7 +7,6 @@ * */ -require_once dirname(__FILE__) . '/../mock/lang.php'; require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php'; class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case @@ -47,8 +46,9 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case */ public function test_build_cfg_template_text($tpl_type, $key, $new, $config_key, $vars, $expected) { - global $user; + global $user, $phpbb_dispatcher; + $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); $user->lang = new phpbb_mock_lang(); $this->assertEquals($expected, build_cfg_template($tpl_type, $key, $new, $config_key, $vars)); @@ -81,8 +81,9 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case */ public function test_build_cfg_template_dimension($tpl_type, $key, $new, $config_key, $vars, $expected) { - global $user; + global $user, $phpbb_dispatcher; + $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); $user->lang = new phpbb_mock_lang(); $this->assertEquals($expected, build_cfg_template($tpl_type, $key, $new, $config_key, $vars)); @@ -107,8 +108,9 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case */ public function test_build_cfg_template_textarea($tpl_type, $key, $new, $config_key, $vars, $expected) { - global $user; + global $user, $phpbb_dispatcher; + $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); $user->lang = new phpbb_mock_lang(); $this->assertEquals($expected, build_cfg_template($tpl_type, $key, $new, $config_key, $vars)); @@ -157,8 +159,9 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case */ public function test_build_cfg_template_radio($tpl_type, $key, $new, $config_key, $vars, $expected) { - global $user; + global $user, $phpbb_dispatcher; + $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); $user->lang = new phpbb_mock_lang(); $this->assertEquals($expected, build_cfg_template($tpl_type, $key, $new, $config_key, $vars)); @@ -183,8 +186,9 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case */ public function test_build_cfg_template_append($tpl_type, $key, $new, $config_key, $vars, $expected) { - global $user; + global $user, $phpbb_dispatcher; + $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); $user->lang = new phpbb_mock_lang(); $this->assertEquals($expected, build_cfg_template($tpl_type, $key, $new, $config_key, $vars)); diff --git a/tests/functions_acp/build_select_test.php b/tests/functions_acp/build_select_test.php index 782acae1fa..aca49b7655 100644 --- a/tests/functions_acp/build_select_test.php +++ b/tests/functions_acp/build_select_test.php @@ -7,7 +7,6 @@ * */ -require_once dirname(__FILE__) . '/../mock/lang.php'; require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php'; class phpbb_functions_acp_built_select_test extends phpbb_test_case diff --git a/tests/functions_acp/h_radio_test.php b/tests/functions_acp/h_radio_test.php index 02b2444a9e..a61f2e8975 100644 --- a/tests/functions_acp/h_radio_test.php +++ b/tests/functions_acp/h_radio_test.php @@ -7,7 +7,6 @@ * */ -require_once dirname(__FILE__) . '/../mock/lang.php'; require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php'; class phpbb_functions_acp_h_radio_test extends phpbb_test_case diff --git a/tests/functions_acp/validate_config_vars_test.php b/tests/functions_acp/validate_config_vars_test.php index 55441561a6..7cd7fa3892 100644 --- a/tests/functions_acp/validate_config_vars_test.php +++ b/tests/functions_acp/validate_config_vars_test.php @@ -7,7 +7,6 @@ * */ -require_once dirname(__FILE__) . '/../mock/lang.php'; require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php'; class phpbb_functions_acp_validate_config_vars_test extends phpbb_test_case diff --git a/tests/functions_acp/validate_range_test.php b/tests/functions_acp/validate_range_test.php index 34ce848e76..8606158251 100644 --- a/tests/functions_acp/validate_range_test.php +++ b/tests/functions_acp/validate_range_test.php @@ -7,7 +7,6 @@ * */ -require_once dirname(__FILE__) . '/../mock/lang.php'; require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php'; require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php'; diff --git a/tests/lint_test.php b/tests/lint_test.php new file mode 100644 index 0000000000..905067072d --- /dev/null +++ b/tests/lint_test.php @@ -0,0 +1,74 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +class phpbb_lint_test extends phpbb_test_case +{ + static protected $exclude; + + static public function setUpBeforeClass() + { + $output = array(); + $status = 1; + exec('(php -v) 2>&1', $output, $status); + if ($status) + { + $output = implode("\n", $output); + self::markTestSkipped("php is not in PATH or broken: $output"); + } + + self::$exclude = array( + // PHP Fatal error: Cannot declare class Container because the name is already in use in /var/www/projects/phpbb3/tests/../phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php on line 20 + // https://gist.github.com/e003913ffd493da63cbc + dirname(__FILE__) . '/../phpBB/vendor', + ); + } + + public function test_lint() + { + if (version_compare(PHP_VERSION, '5.3.0', '<')) + { + $this->markTestSkipped('phpBB uses PHP 5.3 syntax in some files, linting on PHP < 5.3 will fail'); + } + + $root = dirname(__FILE__) . '/..'; + $this->check($root); + } + + protected function check($root) + { + $dh = opendir($root); + while (($filename = readdir($dh)) !== false) + { + if ($filename == '.' || $filename == '..' || $filename == 'git') + { + continue; + } + $path = $root . '/' . $filename; + // skip symlinks to avoid infinite loops + if (is_link($path)) + { + continue; + } + if (is_dir($path) && !in_array($path, self::$exclude)) + { + $this->check($path); + } + else if (substr($filename, strlen($filename)-4) == '.php') + { + // assume php binary is called php and it is in PATH + $cmd = '(php -l ' . escapeshellarg($path) . ') 2>&1'; + $output = array(); + $status = 1; + exec($cmd, $output, $status); + $output = implode("\n", $output); + $this->assertEquals(0, $status, "php -l failed for $path:\n$output"); + } + } + } +} diff --git a/tests/lock/flock_test.php b/tests/lock/flock_test.php new file mode 100644 index 0000000000..1edc96b3a4 --- /dev/null +++ b/tests/lock/flock_test.php @@ -0,0 +1,109 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +class phpbb_lock_flock_test extends phpbb_test_case +{ + public function test_lock() + { + $path = __DIR__ . '/../tmp/precious'; + + $lock = new phpbb_lock_flock($path); + $ok = $lock->acquire(); + $this->assertTrue($ok); + $lock->release(); + } + + public function test_consecutive_locking() + { + $path = __DIR__ . '/../tmp/precious'; + + $lock = new phpbb_lock_flock($path); + $ok = $lock->acquire(); + $this->assertTrue($ok); + $lock->release(); + + $ok = $lock->acquire(); + $this->assertTrue($ok); + $lock->release(); + + $ok = $lock->acquire(); + $this->assertTrue($ok); + $lock->release(); + } + + /* This hangs the process. + public function test_concurrent_locking_fail() + { + $path = __DIR__ . '/../tmp/precious'; + + $lock1 = new phpbb_lock_flock($path); + $ok = $lock1->acquire(); + $this->assertTrue($ok); + + $lock2 = new phpbb_lock_flock($path); + $ok = $lock2->acquire(); + $this->assertFalse($ok); + + $lock->release(); + $ok = $lock2->acquire(); + $this->assertTrue($ok); + } + */ + + public function test_concurrent_locking() + { + if (!function_exists('pcntl_fork')) + { + $this->markTestSkipped('pcntl extension and pcntl_fork are required for this test'); + } + + $path = __DIR__ . '/../tmp/precious'; + + $pid = pcntl_fork(); + if ($pid) + { + // parent + // wait 0.5 s, acquire the lock, note how long it took + sleep(1); + + $lock = new phpbb_lock_flock($path); + $start = time(); + $ok = $lock->acquire(); + $delta = time() - $start; + $this->assertTrue($ok); + $this->assertGreaterThan(0.5, $delta, 'First lock acquired too soon'); + + $lock->release(); + + // acquire again, this should be instantaneous + $start = time(); + $ok = $lock->acquire(); + $delta = time() - $start; + $this->assertTrue($ok); + $this->assertLessThan(0.1, $delta, 'Second lock not acquired instantaneously'); + + // reap the child + $status = null; + pcntl_waitpid($pid, $status); + } + else + { + // child + // immediately acquire the lock and sleep for 2 s + $lock = new phpbb_lock_flock($path); + $ok = $lock->acquire(); + $this->assertTrue($ok); + sleep(2); + $lock->release(); + + // and go away silently + pcntl_exec('/usr/bin/env', array('true')); + } + } +} diff --git a/tests/mock/cache.php b/tests/mock/cache.php index c6d08afef0..bc18ca066b 100644 --- a/tests/mock/cache.php +++ b/tests/mock/cache.php @@ -121,8 +121,9 @@ class phpbb_mock_cache implements phpbb_cache_driver_interface public function sql_load($query) { } - public function sql_save($query, &$query_result, $ttl) + public function sql_save($query, $query_result, $ttl) { + return $query_result; } public function sql_exists($query_id) { diff --git a/tests/mock/container_builder.php b/tests/mock/container_builder.php new file mode 100644 index 0000000000..8a81dd72d1 --- /dev/null +++ b/tests/mock/container_builder.php @@ -0,0 +1,160 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\ScopeInterface; + +class phpbb_mock_container_builder implements ContainerInterface +{ + /** + * Sets a service. + * + * @param string $id The service identifier + * @param object $service The service instance + * @param string $scope The scope of the service + * + * @api + */ + public function set($id, $service, $scope = self::SCOPE_CONTAINER) + { + } + + /** + * Gets a service. + * + * @param string $id The service identifier + * @param int $invalidBehavior The behavior when the service does not exist + * + * @return object The associated service + * + * @throws InvalidArgumentException if the service is not defined + * @throws ServiceCircularReferenceException When a circular reference is detected + * @throws ServiceNotFoundException When the service is not defined + * + * @see Reference + * + * @api + */ + public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) + { + } + + /** + * Returns true if the given service is defined. + * + * @param string $id The service identifier + * + * @return Boolean true if the service is defined, false otherwise + * + * @api + */ + public function has($id) + { + } + + /** + * Gets a parameter. + * + * @param string $name The parameter name + * + * @return mixed The parameter value + * + * @throws InvalidArgumentException if the parameter is not defined + * + * @api + */ + public function getParameter($name) + { + } + + /** + * Checks if a parameter exists. + * + * @param string $name The parameter name + * + * @return Boolean The presence of parameter in container + * + * @api + */ + public function hasParameter($name) + { + } + + /** + * Sets a parameter. + * + * @param string $name The parameter name + * @param mixed $value The parameter value + * + * @api + */ + public function setParameter($name, $value) + { + } + + /** + * Enters the given scope + * + * @param string $name + * + * @api + */ + public function enterScope($name) + { + } + + /** + * Leaves the current scope, and re-enters the parent scope + * + * @param string $name + * + * @api + */ + public function leaveScope($name) + { + } + + /** + * Adds a scope to the container + * + * @param ScopeInterface $scope + * + * @api + */ + public function addScope(ScopeInterface $scope) + { + } + + /** + * Whether this container has the given scope + * + * @param string $name + * + * @return Boolean + * + * @api + */ + public function hasScope($name) + { + } + + /** + * Determines whether the given scope is currently active. + * + * It does however not check if the scope actually exists. + * + * @param string $name + * + * @return Boolean + * + * @api + */ + public function isScopeActive($name) + { + } +} diff --git a/tests/mock/event_dispatcher.php b/tests/mock/event_dispatcher.php new file mode 100644 index 0000000000..8887b16163 --- /dev/null +++ b/tests/mock/event_dispatcher.php @@ -0,0 +1,16 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +class phpbb_mock_event_dispatcher +{ + public function trigger_event($eventName, $data) + { + return array(); + } +} diff --git a/tests/mock/extension_manager.php b/tests/mock/extension_manager.php index 77f799dd3b..fdda4cbadc 100644 --- a/tests/mock/extension_manager.php +++ b/tests/mock/extension_manager.php @@ -12,7 +12,7 @@ class phpbb_mock_extension_manager extends phpbb_extension_manager public function __construct($phpbb_root_path, $extensions = array()) { $this->phpbb_root_path = $phpbb_root_path; - $this->phpEx = '.php'; + $this->php_ext = '.php'; $this->extensions = $extensions; } } diff --git a/tests/mock/filespec.php b/tests/mock/filespec.php new file mode 100644 index 0000000000..9d2a5c84de --- /dev/null +++ b/tests/mock/filespec.php @@ -0,0 +1,32 @@ +<?php +/** + * + * @package testing + * @copyright (c) 2012 phpBB Group + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 + * + */ + +/** + * Mock filespec class with some basic values to help with testing the + * fileupload class + */ +class phpbb_mock_filespec +{ + public $filesize; + public $realname; + public $extension; + public $width; + public $height; + public $error = array(); + + public function check_content($disallowed_content) + { + return true; + } + + public function get($property) + { + return $this->$property; + } +} diff --git a/tests/mock/fileupload.php b/tests/mock/fileupload.php new file mode 100644 index 0000000000..409036ba63 --- /dev/null +++ b/tests/mock/fileupload.php @@ -0,0 +1,52 @@ +<?php +/** + * + * @package testing + * @copyright (c) 2012 phpBB Group + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 + * + */ + +/** + * Mock fileupload class with some basic values to help with testing the + * filespec class + */ +class phpbb_mock_fileupload +{ + public $max_filesize = 100; + public $error_prefix = ''; + + public function valid_dimensions($filespec) + { + return true; + } + + /** + * Copied verbatim from phpBB/includes/functions_upload.php's fileupload + * class to ensure the correct behaviour of filespec::move_file. + * + * Maps file extensions to the constant in second index of the array + * returned by getimagesize() + */ + public function image_types() + { + return array( + IMAGETYPE_GIF => array('gif'), + IMAGETYPE_JPEG => array('jpg', 'jpeg'), + IMAGETYPE_PNG => array('png'), + IMAGETYPE_SWF => array('swf'), + IMAGETYPE_PSD => array('psd'), + IMAGETYPE_BMP => array('bmp'), + IMAGETYPE_TIFF_II => array('tif', 'tiff'), + IMAGETYPE_TIFF_MM => array('tif', 'tiff'), + IMAGETYPE_JPC => array('jpg', 'jpeg'), + IMAGETYPE_JP2 => array('jpg', 'jpeg'), + IMAGETYPE_JPX => array('jpg', 'jpeg'), + IMAGETYPE_JB2 => array('jpg', 'jpeg'), + IMAGETYPE_SWC => array('swc'), + IMAGETYPE_IFF => array('iff'), + IMAGETYPE_WBMP => array('wbmp'), + IMAGETYPE_XBM => array('xbm'), + ); + } +} diff --git a/tests/mock/request.php b/tests/mock/request.php index 946dfdada9..2a272fc03b 100644 --- a/tests/mock/request.php +++ b/tests/mock/request.php @@ -11,13 +11,14 @@ class phpbb_mock_request implements phpbb_request_interface { protected $data; - public function __construct($get = array(), $post = array(), $cookie = array(), $server = array(), $request = false) + public function __construct($get = array(), $post = array(), $cookie = array(), $server = array(), $request = false, $files = array()) { $this->data[phpbb_request_interface::GET] = $get; $this->data[phpbb_request_interface::POST] = $post; $this->data[phpbb_request_interface::COOKIE] = $cookie; $this->data[phpbb_request_interface::REQUEST] = ($request === false) ? $post + $get : $request; $this->data[phpbb_request_interface::SERVER] = $server; + $this->data[phpbb_request_interface::FILES] = $files; } public function overwrite($var_name, $value, $super_global = phpbb_request_interface::REQUEST) @@ -42,6 +43,12 @@ class phpbb_mock_request implements phpbb_request_interface return $this->server($var_name, $default); } + public function file($form_name) + { + $super_global = phpbb_request_interface::FILES; + return isset($this->data[$super_global][$form_name]) ? $this->data[$super_global][$form_name] : array(); + } + public function is_set_post($name) { return $this->is_set($name, phpbb_request_interface::POST); diff --git a/tests/mock_user.php b/tests/mock/user.php index ec14ce430e..ec14ce430e 100644 --- a/tests/mock_user.php +++ b/tests/mock/user.php diff --git a/tests/privmsgs/delete_user_pms_test.php b/tests/privmsgs/delete_user_pms_test.php new file mode 100644 index 0000000000..f705825262 --- /dev/null +++ b/tests/privmsgs/delete_user_pms_test.php @@ -0,0 +1,102 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +require_once dirname(__FILE__) . '/../../phpBB/includes/functions_privmsgs.php'; + +class phpbb_privmsgs_delete_user_pms_test extends phpbb_database_test_case +{ + public function getDataSet() + { + return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/delete_user_pms.xml'); + } + + static public function delete_user_pms_data() + { + return array( + // array( + // (user we delete), + // array(remaining privmsgs ids), + // array(remaining privmsgs_to), + // ), + array( + 2, + array( + array('msg_id' => 1), + ), + array( + array('msg_id' => 1, 'user_id' => 3), + ), + ), + array( + 3, + array( + array('msg_id' => 1), + array('msg_id' => 2), + array('msg_id' => 3), + array('msg_id' => 5), + ), + array( + array('msg_id' => 1, 'user_id' => 2), + array('msg_id' => 1, 'user_id' => 4), + array('msg_id' => 2, 'user_id' => 2), + array('msg_id' => 2, 'user_id' => 4), + array('msg_id' => 3, 'user_id' => 2), + array('msg_id' => 5, 'user_id' => 2), + array('msg_id' => 5, 'user_id' => 4), + ), + ), + array( + 5, + array( + array('msg_id' => 1), + array('msg_id' => 2), + array('msg_id' => 3), + array('msg_id' => 4), + array('msg_id' => 5), + ), + array( + array('msg_id' => 1, 'user_id' => 2), + array('msg_id' => 1, 'user_id' => 3), + array('msg_id' => 1, 'user_id' => 4), + array('msg_id' => 2, 'user_id' => 2), + array('msg_id' => 2, 'user_id' => 4), + array('msg_id' => 3, 'user_id' => 2), + array('msg_id' => 4, 'user_id' => 3), + array('msg_id' => 5, 'user_id' => 2), + array('msg_id' => 5, 'user_id' => 3), + array('msg_id' => 5, 'user_id' => 4), + ), + ), + ); + } + + /** + * @dataProvider delete_user_pms_data + */ + public function test_delete_user_pms($delete_user, $remaining_privmsgs, $remaining_privmsgs_to) + { + global $db; + + $db = $this->new_dbal(); + + phpbb_delete_user_pms($delete_user); + + $sql = 'SELECT msg_id + FROM ' . PRIVMSGS_TABLE; + $result = $db->sql_query($sql); + + $this->assertEquals($remaining_privmsgs, $db->sql_fetchrowset($result)); + + $sql = 'SELECT msg_id, user_id + FROM ' . PRIVMSGS_TO_TABLE; + $result = $db->sql_query($sql); + + $this->assertEquals($remaining_privmsgs_to, $db->sql_fetchrowset($result)); + } +} diff --git a/tests/privmsgs/fixtures/delete_user_pms.xml b/tests/privmsgs/fixtures/delete_user_pms.xml new file mode 100644 index 0000000000..9a86501b7a --- /dev/null +++ b/tests/privmsgs/fixtures/delete_user_pms.xml @@ -0,0 +1,215 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<dataset> + <table name="phpbb_users"> + <column>user_id</column> + <column>username</column> + <column>username_clean</column> + <column>user_new_privmsg</column> + <column>user_unread_privmsg</column> + <column>user_permissions</column> + <column>user_sig</column> + <column>user_occ</column> + <column>user_interests</column> + <row> + <value>2</value> + <value>sender</value> + <value>sender</value> + <value>0</value> + <value>0</value> + <value></value> + <value></value> + <value></value> + <value></value> + </row> + <row> + <value>3</value> + <value>pm in inbox</value> + <value>pm in inbox</value> + <value>0</value> + <value>0</value> + <value></value> + <value></value> + <value></value> + <value></value> + </row> + <row> + <value>4</value> + <value>pm in no box</value> + <value>pm in no box</value> + <value>2</value> + <value>2</value> + <value></value> + <value></value> + <value></value> + <value></value> + </row> + <row> + <value>5</value> + <value>no pms</value> + <value>no pms</value> + <value>0</value> + <value>0</value> + <value></value> + <value></value> + <value></value> + <value></value> + </row> + </table> + <table name="phpbb_privmsgs"> + <column>msg_id</column> + <column>root_level</column> + <column>author_id</column> + <column>message_subject</column> + <column>message_text</column> + <column>to_address</column> + <column>bcc_address</column> + <row> + <value>1</value> + <value>0</value> + <value>2</value> + <value>#1</value> + <value> + 2 - outbox + 3 - inbox + 4 - nobox + </value> + <value></value> + <value></value> + </row> + <row> + <value>2</value> + <value>0</value> + <value>2</value> + <value>#2</value> + <value> + 2 - outbox + 4 - nobox + </value> + <value></value> + <value></value> + </row> + <row> + <value>3</value> + <value>0</value> + <value>2</value> + <value>#3</value> + <value> + 2 - outbox + </value> + <value></value> + <value></value> + </row> + <row> + <value>4</value> + <value>0</value> + <value>2</value> + <value>#4</value> + <value> + 3 - nobox + </value> + <value></value> + <value></value> + </row> + <row> + <value>5</value> + <value>0</value> + <value>2</value> + <value>#5</value> + <value> + 2 - outbox + 3 - nobox + 4 - nobox + </value> + <value></value> + <value></value> + </row> + </table> + <table name="phpbb_privmsgs_to"> + <column>msg_id</column> + <column>user_id</column> + <column>author_id</column> + <column>pm_new</column> + <column>pm_unread</column> + <column>folder_id</column> + <row> + <value>1</value> + <value>2</value> + <value>2</value> + <value>0</value> + <value>0</value> + <value>-2</value> + </row> + <row> + <value>1</value> + <value>3</value> + <value>2</value> + <value>0</value> + <value>0</value> + <value>0</value> + </row> + <row> + <value>1</value> + <value>4</value> + <value>2</value> + <value>0</value> + <value>0</value> + <value>-3</value> + </row> + <row> + <value>2</value> + <value>2</value> + <value>2</value> + <value>0</value> + <value>0</value> + <value>-2</value> + </row> + <row> + <value>2</value> + <value>4</value> + <value>2</value> + <value>0</value> + <value>0</value> + <value>-3</value> + </row> + <row> + <value>3</value> + <value>2</value> + <value>2</value> + <value>0</value> + <value>0</value> + <value>-2</value> + </row> + <row> + <value>4</value> + <value>3</value> + <value>2</value> + <value>0</value> + <value>0</value> + <value>-3</value> + </row> + <row> + <value>5</value> + <value>2</value> + <value>2</value> + <value>0</value> + <value>0</value> + <value>-2</value> + </row> + <row> + <value>5</value> + <value>3</value> + <value>2</value> + <value>0</value> + <value>0</value> + <value>-3</value> + </row> + <row> + <value>5</value> + <value>4</value> + <value>2</value> + <value>0</value> + <value>0</value> + <value>-3</value> + </row> + </table> +</dataset> diff --git a/tests/request/request_test.php b/tests/request/request_test.php index bca5125b7a..52c21abd2a 100644 --- a/tests/request/request_test.php +++ b/tests/request/request_test.php @@ -21,6 +21,13 @@ class phpbb_request_test extends phpbb_test_case $_COOKIE['test'] = 3; $_REQUEST['test'] = 3; $_GET['unset'] = ''; + $_FILES['test'] = array( + 'name' => 'file', + 'tmp_name' => 'tmp', + 'size' => 256, + 'type' => 'application/octet-stream', + 'error' => UPLOAD_ERR_OK, + ); $_SERVER['HTTP_HOST'] = 'example.com'; $_SERVER['HTTP_ACCEPT'] = 'application/json'; @@ -42,6 +49,7 @@ class phpbb_request_test extends phpbb_test_case $this->assertEquals(2, $_GET['test'], 'Checking $_GET after enable_super_globals'); $this->assertEquals(3, $_COOKIE['test'], 'Checking $_COOKIE after enable_super_globals'); $this->assertEquals(3, $_REQUEST['test'], 'Checking $_REQUEST after enable_super_globals'); + $this->assertEquals(256, $_FILES['test']['size']); $_POST['x'] = 2; $this->assertEquals($_POST, $GLOBALS['_POST'], 'Checking whether $_POST can still be accessed via $GLOBALS[\'_POST\']'); @@ -85,6 +93,23 @@ class phpbb_request_test extends phpbb_test_case $this->request->header('SOMEVAR'); } + public function test_file() + { + $file = $this->request->file('test'); + $this->assertEquals('file', $file['name']); + $this->assertEquals('tmp', $file['tmp_name']); + $this->assertEquals(256, $file['size']); + $this->assertEquals('application/octet-stream', $file['type']); + $this->assertEquals(UPLOAD_ERR_OK, $file['error']); + } + + public function test_file_not_exists() + { + $file = $this->request->file('404'); + $this->assertTrue(is_array($file)); + $this->assertTrue(empty($file)); + } + /** * Checks that directly accessing $_POST will trigger * an error. diff --git a/tests/request/type_cast_helper_test.php b/tests/request/type_cast_helper_test.php index d553d5b8cd..f41db005af 100644 --- a/tests/request/type_cast_helper_test.php +++ b/tests/request/type_cast_helper_test.php @@ -48,4 +48,24 @@ class phpbb_type_cast_helper_test extends phpbb_test_case $this->assertEquals($expected, $data); } + + public function test_simple_untrimmed_recursive_set_var() + { + $data = " eviL<3\t\t"; + $expected = " eviL<3\t\t"; + + $this->type_cast_helper->recursive_set_var($data, '', true, false); + + $this->assertEquals($expected, $data); + } + + public function test_nested_untrimmed_recursive_set_var() + { + $data = array(" eviL<3\t\t"); + $expected = array(" eviL<3\t\t"); + + $this->type_cast_helper->recursive_set_var($data, array(0 => ''), true, false); + + $this->assertEquals($expected, $data); + } } diff --git a/tests/search/common_test_case.php b/tests/search/common_test_case.php new file mode 100644 index 0000000000..dd04f7048c --- /dev/null +++ b/tests/search/common_test_case.php @@ -0,0 +1,106 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +require_once dirname(__FILE__) . '/../test_framework/phpbb_search_test_case.php'; + +abstract class phpbb_search_common_test_case extends phpbb_search_test_case +{ + public function keywords() + { + return array( + // keywords + // terms + // ok + // split words + // common words + array( + 'fooo', + 'all', + true, + array('fooo'), + array(), + ), + array( + 'fooo baar', + 'all', + true, + array('fooo', 'baar'), + array(), + ), + // leading, trailing and multiple spaces + array( + ' fooo baar ', + 'all', + true, + array('fooo', 'baar'), + array(), + ), + // words too short + array( + 'f', + 'all', + false, + null, + // short words count as "common" words + array('f'), + ), + array( + 'f o o', + 'all', + false, + null, + array('f', 'o', 'o'), + ), + array( + 'f -o -o', + 'all', + false, + null, + array('f', '-o', '-o'), + ), + array( + 'fooo -baar', + 'all', + true, + array('-baar', 'fooo'), + array(), + ), + // all negative + array( + '-fooo', + 'all', + true, + array('-fooo'), + array(), + ), + array( + '-fooo -baar', + 'all', + true, + array('-fooo', '-baar'), + array(), + ), + ); + } + + /** + * @dataProvider keywords + */ + public function test_split_keywords($keywords, $terms, $ok, $split_words, $common) + { + $rv = $this->search->split_keywords($keywords, $terms); + $this->assertEquals($ok, $rv); + if ($ok) + { + // only check criteria if the search is going to be performed + $this->assert_array_content_equals($split_words, $this->search->get_split_words()); + } + $this->assert_array_content_equals($common, $this->search->get_common_words()); + } +} diff --git a/tests/search/fixtures/posts.xml b/tests/search/fixtures/posts.xml new file mode 100644 index 0000000000..7b249ee303 --- /dev/null +++ b/tests/search/fixtures/posts.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<dataset> + <table name="phpbb_posts"> + <column>post_username</column> + <column>post_subject</column> + <column>post_text</column> + <row> + <value>foo</value> + <value>foo</value> + <value>foo</value> + </row> + <row> + <value>bar</value> + <value>bar</value> + <value>bar</value> + </row> + <row> + <value>commonword</value> + <value>commonword</value> + <value>commonword</value> + </row> + </table> + <table name="phpbb_search_wordlist"> + <column>word_id</column> + <column>word_text</column> + <column>word_common</column> + <row> + <value>1</value> + <value>foo</value> + <value>0</value> + </row> + <row> + <value>2</value> + <value>bar</value> + <value>0</value> + </row> + <row> + <value>3</value> + <value>commonword</value> + <value>1</value> + </row> + </table> +</dataset> diff --git a/tests/search/mysql_test.php b/tests/search/mysql_test.php new file mode 100644 index 0000000000..3ba3915714 --- /dev/null +++ b/tests/search/mysql_test.php @@ -0,0 +1,40 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +require_once dirname(__FILE__) . '/common_test_case.php'; + +class phpbb_search_mysql_test extends phpbb_search_common_test_case +{ + protected $db; + protected $search; + + public function getDataSet() + { + return $this->createXMLDataSet(dirname(__FILE__) . '/../fixtures/empty.xml'); + } + + protected function setUp() + { + global $phpbb_root_path, $phpEx, $config, $user, $cache; + + parent::setUp(); + + // dbal uses cache + $cache = new phpbb_cache_service(new phpbb_cache_driver_null); + + // set config values + $config['fulltext_mysql_min_word_len'] = 4; + $config['fulltext_mysql_max_word_len'] = 254; + + $this->db = $this->new_dbal(); + $error = null; + $class = self::get_search_wrapper('phpbb_search_fulltext_mysql'); + $this->search = new $class($error, $phpbb_root_path, $phpEx, null, $config, $this->db, $user); + } +} diff --git a/tests/search/native_test.php b/tests/search/native_test.php new file mode 100644 index 0000000000..eeee3a44f3 --- /dev/null +++ b/tests/search/native_test.php @@ -0,0 +1,158 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +require_once dirname(__FILE__) . '/../test_framework/phpbb_search_test_case.php'; + +class phpbb_search_native_test extends phpbb_search_test_case +{ + protected $db; + protected $search; + + public function getDataSet() + { + return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/posts.xml'); + } + + protected function setUp() + { + global $phpbb_root_path, $phpEx, $config, $user, $cache; + + parent::setUp(); + + // dbal uses cache + $cache = new phpbb_cache_service(new phpbb_cache_driver_null); + + $this->db = $this->new_dbal(); + $error = null; + $class = self::get_search_wrapper('phpbb_search_fulltext_native'); + $this->search = new $class($error, $phpbb_root_path, $phpEx, null, $config, $this->db, $user); + } + + public function keywords() + { + return array( + // keywords + // terms + // ok + // must contain ids + // must not contain ids + // common words + array( + 'foo', + 'all', + true, + array(1), + array(), + array(), + ), + array( + 'foo bar', + 'all', + true, + array(1, 2), + array(), + array(), + ), + // leading, trailing and multiple spaces + array( + ' foo bar ', + 'all', + true, + array(1, 2), + array(), + array(), + ), + // words too short + array( + 'f', + 'all', + false, + null, + null, + // short words count as "common" words + array('f'), + ), + array( + 'f o o', + 'all', + false, + null, + null, + array('f', 'o', 'o'), + ), + array( + 'f -o -o', + 'all', + false, + null, + null, + array('f', 'o', 'o'), + ), + array( + 'foo -bar', + 'all', + true, + array(1), + array(2), + array(), + ), + // all negative + array( + '-foo', + 'all', + false, + null, + null, + array(), + ), + array( + '-foo -bar', + 'all', + false, + null, + null, + array(), + ), + // all common + array( + 'commonword', + 'all', + false, + null, + null, + array('commonword'), + ), + // some common + array( + 'commonword foo', + 'all', + true, + array(1), + array(), + array('commonword'), + ), + ); + } + + /** + * @dataProvider keywords + */ + public function test_split_keywords($keywords, $terms, $ok, $must_contain, $must_not_contain, $common) + { + $rv = $this->search->split_keywords($keywords, $terms); + $this->assertEquals($ok, $rv); + if ($ok) + { + // only check criteria if the search is going to be performed + $this->assert_array_content_equals($must_contain, $this->search->get_must_contain_ids()); + $this->assert_array_content_equals($must_not_contain, $this->search->get_must_not_contain_ids()); + } + $this->assert_array_content_equals($common, $this->search->get_common_words()); + } +} diff --git a/tests/search/postgres_test.php b/tests/search/postgres_test.php new file mode 100644 index 0000000000..9c77e0c09e --- /dev/null +++ b/tests/search/postgres_test.php @@ -0,0 +1,40 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +require_once dirname(__FILE__) . '/common_test_case.php'; + +class phpbb_search_postgres_test extends phpbb_search_common_test_case +{ + protected $db; + protected $search; + + public function getDataSet() + { + return $this->createXMLDataSet(dirname(__FILE__) . '/../fixtures/empty.xml'); + } + + protected function setUp() + { + global $phpbb_root_path, $phpEx, $config, $user, $cache; + + parent::setUp(); + + // dbal uses cache + $cache = new phpbb_cache_service(new phpbb_cache_driver_null); + + // set config values + $config['fulltext_postgres_min_word_len'] = 4; + $config['fulltext_postgres_max_word_len'] = 254; + + $this->db = $this->new_dbal(); + $error = null; + $class = self::get_search_wrapper('phpbb_search_fulltext_postgres'); + $this->search = new $class($error, $phpbb_root_path, $phpEx, null, $config, $this->db, $user); + } +} diff --git a/tests/security/base.php b/tests/security/base.php index 82e4dda9d0..08878ad60d 100644 --- a/tests/security/base.php +++ b/tests/security/base.php @@ -7,8 +7,6 @@ * */ -require_once dirname(__FILE__) . '/../mock/request.php'; - abstract class phpbb_security_test_base extends phpbb_test_case { /** diff --git a/tests/session/append_sid_test.php b/tests/session/append_sid_test.php index 88f6f0718e..34f6dea8ca 100644 --- a/tests/session/append_sid_test.php +++ b/tests/session/append_sid_test.php @@ -45,6 +45,9 @@ class phpbb_session_append_sid_test extends phpbb_test_case */
public function test_append_sid($url, $params, $is_amp, $session_id, $expected, $description)
{
+ global $phpbb_dispatcher;
+
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher;
$this->assertEquals($expected, append_sid($url, $params, $is_amp, $session_id));
}
}
diff --git a/tests/session/continue_test.php b/tests/session/continue_test.php index c4f7f8d75b..ad78d92299 100644 --- a/tests/session/continue_test.php +++ b/tests/session/continue_test.php @@ -7,7 +7,6 @@ * */ -require_once dirname(__FILE__) . '/../mock/cache.php'; require_once dirname(__FILE__) . '/testable_factory.php'; class phpbb_session_continue_test extends phpbb_database_test_case diff --git a/tests/session/init_test.php b/tests/session/init_test.php index 2ce6c4a4ac..830de34ed0 100644 --- a/tests/session/init_test.php +++ b/tests/session/init_test.php @@ -7,7 +7,6 @@ * */ -require_once dirname(__FILE__) . '/../mock/cache.php'; require_once dirname(__FILE__) . '/testable_factory.php'; class phpbb_session_init_test extends phpbb_database_test_case diff --git a/tests/session/testable_factory.php b/tests/session/testable_factory.php index a042085908..cb85a01c5c 100644 --- a/tests/session/testable_factory.php +++ b/tests/session/testable_factory.php @@ -7,9 +7,6 @@ * */ -require_once dirname(__FILE__) . '/../mock/request.php'; -require_once dirname(__FILE__) . '/../mock/session_testable.php'; - /** * This class exists to setup an instance of phpbb's session class for testing. * diff --git a/tests/template/includephp_test.php b/tests/template/includephp_test.php index 626735f15f..c93a53e2ad 100644 --- a/tests/template/includephp_test.php +++ b/tests/template/includephp_test.php @@ -23,6 +23,18 @@ class phpbb_template_includephp_test extends phpbb_template_template_test_case $this->assertEquals("Path is relative to board root.\ntesting included php", $this->display('test'), "Testing INCLUDEPHP"); } + public function test_includephp_variables() + { + $this->setup_engine(array('tpl_allow_php' => true)); + + $cache_file = $this->template->cachepath . 'includephp_variables.html.php'; + + $this->run_template('includephp_variables.html', array('TEMPLATES' => 'templates'), array(), array(), "Path includes variables.\ntesting included php", $cache_file); + + $this->template->set_filenames(array('test' => 'includephp_variables.html')); + $this->assertEquals("Path includes variables.\ntesting included php", $this->display('test'), "Testing INCLUDEPHP"); + } + public function test_includephp_absolute() { $path_to_php = dirname(__FILE__) . '/templates/_dummy_include.php.inc'; @@ -36,7 +48,7 @@ class phpbb_template_includephp_test extends phpbb_template_template_test_case $this->setup_engine(array('tpl_allow_php' => true)); - $this->style->set_custom_style('tests', $cache_dir); + $this->style->set_custom_style('tests', $cache_dir, ''); $cache_file = $this->template->cachepath . 'includephp_absolute.html.php'; $this->run_template('includephp_absolute.html', array(), array(), array(), "Path is absolute.\ntesting included php", $cache_file); diff --git a/tests/template/template_includejs_test.php b/tests/template/template_includejs_test.php index a8f9a9037f..22b020208b 100644 --- a/tests/template/template_includejs_test.php +++ b/tests/template/template_includejs_test.php @@ -20,11 +20,14 @@ class phpbb_template_template_includejs_test extends phpbb_template_template_tes $scripts = array( '<script src="' . $this->test_path . '/templates/parent_and_child.js?assets_version=1"></script>', '<script src="' . $this->test_path . '/parent_templates/parent_only.js?assets_version=1"></script>', - '<script src="' . $this->test_path . '/templates/child_only.js?assets_version=1"></script>' + '<script src="' . $this->test_path . '/templates/child_only.js?assets_version=1"></script>', + '<script src="' . $this->test_path . '/templates/subdir/parent_only.js?assets_version=1"></script>', + '<script src="' . $this->test_path . '/templates/subdir/subsubdir/parent_only.js?assets_version=1"></script>', + '<script src="' . $this->test_path . '/templates/subdir/parent_only.js?assets_version=1"></script>', ); // Run test $cache_file = $this->template->cachepath . 'includejs.html.php'; - $this->run_template('includejs.html', array('PARENT' => 'parent_only.js'), array(), array(), implode('', $scripts), $cache_file); + $this->run_template('includejs.html', array('PARENT' => 'parent_only.js', 'SUBDIR' => 'subdir', 'EXT' => 'js'), array(), array(), implode('', $scripts), $cache_file); } } diff --git a/tests/template/template_locate_test.php b/tests/template/template_locate_test.php index be9ae06809..851dcae8ea 100644 --- a/tests/template/template_locate_test.php +++ b/tests/template/template_locate_test.php @@ -62,7 +62,7 @@ class phpbb_template_template_locate_test extends phpbb_template_template_test_c $this->setup_engine(); // Locate template - $result = $this->template->locate($files, $return_default, $return_full_path); + $result = $this->style_resource_locator->get_first_template_location($files, $return_default, $return_full_path); $this->assertSame($expected, $result); } } diff --git a/tests/template/template_test.php b/tests/template/template_test.php index f8677ed913..83995cb4ac 100644 --- a/tests/template/template_test.php +++ b/tests/template/template_test.php @@ -184,6 +184,13 @@ class phpbb_template_template_test extends phpbb_template_template_test_case 'value', ), array( + 'include_variables.html', + array('SUBDIR' => 'subdir', 'VARIABLE' => 'value'), + array(), + array(), + 'value', + ), + array( 'loop_vars.html', array(), array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'loop.inner' => array(array(), array())), diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php index dd0acba6cd..2e6f703eb1 100644 --- a/tests/template/template_test_case.php +++ b/tests/template/template_test_case.php @@ -8,7 +8,6 @@ */ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; -require_once dirname(__FILE__) . '/../mock/extension_manager.php'; class phpbb_template_template_test_case extends phpbb_test_case { @@ -68,7 +67,7 @@ class phpbb_template_template_test_case extends phpbb_test_case $this->template_path = $this->test_path . '/templates'; $this->style_resource_locator = new phpbb_style_resource_locator(); $this->style_provider = new phpbb_style_path_provider(); - $this->template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator); + $this->template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, new phpbb_template_context()); $this->style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider, $this->template); $this->style->set_custom_style('tests', $this->template_path, ''); } diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php index 05ccb7ee55..6a226f317a 100644 --- a/tests/template/template_test_case_with_tree.php +++ b/tests/template/template_test_case_with_tree.php @@ -22,7 +22,7 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat $this->parent_template_path = $this->test_path . '/parent_templates'; $this->style_resource_locator = new phpbb_style_resource_locator(); $this->style_provider = new phpbb_style_path_provider(); - $this->template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator); + $this->template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, new phpbb_template_context()); $this->style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider, $this->template); $this->style->set_custom_style('tests', array($this->template_path, $this->parent_template_path), ''); } diff --git a/tests/template/templates/include_variables.html b/tests/template/templates/include_variables.html new file mode 100644 index 0000000000..8371a061b5 --- /dev/null +++ b/tests/template/templates/include_variables.html @@ -0,0 +1 @@ +<!-- INCLUDE {SUBDIR}/variable.html --> diff --git a/tests/template/templates/includejs.html b/tests/template/templates/includejs.html index 8a2587d76b..ef73700eeb 100644 --- a/tests/template/templates/includejs.html +++ b/tests/template/templates/includejs.html @@ -2,4 +2,7 @@ <!-- INCLUDEJS {PARENT} --> <!-- DEFINE $TEST = 'child_only.js' --> <!-- INCLUDEJS {$TEST} --> -{SCRIPTS}
\ No newline at end of file +<!-- INCLUDEJS subdir/{PARENT} --> +<!-- INCLUDEJS {SUBDIR}/subsubdir/{PARENT} --> +<!-- INCLUDEJS {SUBDIR}/parent_only.{EXT} --> +{SCRIPTS} diff --git a/tests/template/templates/includephp_variables.html b/tests/template/templates/includephp_variables.html new file mode 100644 index 0000000000..6106efc86a --- /dev/null +++ b/tests/template/templates/includephp_variables.html @@ -0,0 +1,2 @@ +Path includes variables. +<!-- INCLUDEPHP ../tests/template/{TEMPLATES}/_dummy_include.php.inc --> diff --git a/tests/template/templates/subdir/parent_only.js b/tests/template/templates/subdir/parent_only.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/template/templates/subdir/parent_only.js diff --git a/tests/template/templates/subdir/subsubdir/parent_only.js b/tests/template/templates/subdir/subsubdir/parent_only.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/template/templates/subdir/subsubdir/parent_only.js diff --git a/tests/template/templates/subdir/variable.html b/tests/template/templates/subdir/variable.html new file mode 100644 index 0000000000..f68f91597c --- /dev/null +++ b/tests/template/templates/subdir/variable.html @@ -0,0 +1 @@ +{VARIABLE} diff --git a/tests/test_framework/phpbb_database_connection_odbc_pdo_wrapper.php b/tests/test_framework/phpbb_database_connection_odbc_pdo_wrapper.php new file mode 100644 index 0000000000..ec59fa3886 --- /dev/null +++ b/tests/test_framework/phpbb_database_connection_odbc_pdo_wrapper.php @@ -0,0 +1,37 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +if (!class_exists('PDO')) +{ + return; +} + +/** +* Used for passing in information about the PDO driver +* since the PDO class reveals nothing about the DSN that +* the user provided. +* +* This is used in the custom PHPUnit ODBC driver +*/ +class phpbb_database_connection_odbc_pdo_wrapper extends PDO +{ + // Name of the driver being used (i.e. mssql, firebird) + public $driver = ''; + + // Version number of driver since PDO::getAttribute(PDO::ATTR_CLIENT_VERSION) is pretty useless for this + public $version = 0; + + function __construct($dbms, $version, $dsn, $user, $pass) + { + $this->driver = $dbms; + $this->version = (double) $version; + + parent::__construct($dsn, $user, $pass); + } +} diff --git a/tests/test_framework/phpbb_database_test_case.php b/tests/test_framework/phpbb_database_test_case.php index e742b543b0..b5076b92e9 100644 --- a/tests/test_framework/phpbb_database_test_case.php +++ b/tests/test_framework/phpbb_database_test_case.php @@ -13,6 +13,8 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test protected $test_case_helpers; + protected $fixture_xml_data; + public function __construct($name = NULL, array $data = array(), $dataName = '') { parent::__construct($name, $data, $dataName); @@ -28,6 +30,44 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test ); } + protected function setUp() + { + parent::setUp(); + + // Resynchronise tables if a fixture was loaded + if (isset($this->fixture_xml_data)) + { + $config = $this->get_database_config(); + $manager = $this->create_connection_manager($config); + $manager->connect(); + $manager->post_setup_synchronisation($this->fixture_xml_data); + } + } + + public function createXMLDataSet($path) + { + $db_config = $this->get_database_config(); + + // Firebird requires table and column names to be uppercase + if ($db_config['dbms'] == 'firebird') + { + $xml_data = file_get_contents($path); + $xml_data = preg_replace_callback('/(?:(<table name="))([a-z_]+)(?:(">))/', 'phpbb_database_test_case::to_upper', $xml_data); + $xml_data = preg_replace_callback('/(?:(<column>))([a-z_]+)(?:(<\/column>))/', 'phpbb_database_test_case::to_upper', $xml_data); + + $new_fixture = tmpfile(); + fwrite($new_fixture, $xml_data); + fseek($new_fixture, 0); + + $meta_data = stream_get_meta_data($new_fixture); + $path = $meta_data['uri']; + } + + $this->fixture_xml_data = parent::createXMLDataSet($path); + + return $this->fixture_xml_data; + } + public function get_test_case_helpers() { if (!$this->test_case_helpers) @@ -106,4 +146,33 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test { return new phpbb_database_test_connection_manager($config); } + + /** + * Converts a match in the middle of a string to uppercase. + * This is necessary for transforming the fixture information for Firebird tests + * + * @param $matches The array of matches from a regular expression + * + * @return string The string with the specified match converted to uppercase + */ + static public function to_upper($matches) + { + return $matches[1] . strtoupper($matches[2]) . $matches[3]; + } + + public function assert_array_content_equals($one, $two) + { + // http://stackoverflow.com/questions/3838288/phpunit-assert-two-arrays-are-equal-but-order-of-elements-not-important + // but one array_diff is not enough! + if (sizeof(array_diff($one, $two)) || sizeof(array_diff($two, $one))) + { + // get a nice error message + $this->assertEquals($one, $two); + } + else + { + // increase assertion count + $this->assertTrue(true); + } + } } diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php index ae21be6c34..d7c2804aa7 100644 --- a/tests/test_framework/phpbb_database_test_connection_manager.php +++ b/tests/test_framework/phpbb_database_test_connection_manager.php @@ -8,6 +8,7 @@ */ require_once dirname(__FILE__) . '/../../phpBB/includes/functions_install.php'; +require_once dirname(__FILE__) . '/phpbb_database_connection_odbc_pdo_wrapper.php'; class phpbb_database_test_connection_manager { @@ -62,6 +63,13 @@ class phpbb_database_test_connection_manager // e.g. Driver={SQL Server Native Client 10.0};Server=(local)\SQLExpress; $dsn .= $this->config['dbhost']; + // Primarily for MSSQL Native/Azure as ODBC needs it in $dbhost, attached to the Server param + if ($this->config['dbport']) + { + $port_delimiter = (defined('PHP_OS') && substr(PHP_OS, 0, 3) === 'WIN') ? ',' : ':'; + $dsn .= $port_delimiter . $this->config['dbport']; + } + if ($use_db) { $dsn .= ';Database=' . $this->config['dbname']; @@ -98,9 +106,34 @@ class phpbb_database_test_connection_manager break; } + // These require different connection strings on the phpBB side than they do in PDO + // so you must provide a DSN string for ODBC separately + if (!empty($this->config['custom_dsn']) && ($this->config['dbms'] == 'mssql' || $this->config['dbms'] == 'firebird')) + { + $dsn = 'odbc:' . $this->config['custom_dsn']; + } + try { - $this->pdo = new PDO($dsn, $this->config['dbuser'], $this->config['dbpasswd']); + switch ($this->config['dbms']) + { + case 'mssql': + case 'mssql_odbc': + $this->pdo = new phpbb_database_connection_odbc_pdo_wrapper('mssql', 0, $dsn, $this->config['dbuser'], $this->config['dbpasswd']); + break; + + case 'firebird': + if (!empty($this->config['custom_dsn'])) + { + $this->pdo = new phpbb_database_connection_odbc_pdo_wrapper('firebird', 0, $dsn, $this->config['dbuser'], $this->config['dbpasswd']); + break; + } + // Fall through if they're using the firebird PDO driver and not the generic ODBC driver + + default: + $this->pdo = new PDO($dsn, $this->config['dbuser'], $this->config['dbpasswd']); + break; + } } catch (PDOException $e) { @@ -108,8 +141,7 @@ class phpbb_database_test_connection_manager throw new Exception("Unable do connect to $cleaned_dsn using PDO with error: {$e->getMessage()}"); } - // good for debug - // $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } /** @@ -134,10 +166,24 @@ class phpbb_database_test_connection_manager switch ($this->config['dbms']) { case 'sqlite': - if (file_exists($this->config['dbhost'])) + case 'firebird': + $this->connect(); + // Drop all of the tables + foreach ($this->get_tables() as $table) { - unlink($this->config['dbhost']); + $this->pdo->exec('DROP TABLE ' . $table); } + $this->purge_extras(); + break; + + case 'oracle': + $this->connect(); + // Drop all of the tables + foreach ($this->get_tables() as $table) + { + $this->pdo->exec('DROP TABLE ' . $table . ' CASCADE CONSTRAINTS'); + } + $this->purge_extras(); break; default: @@ -146,6 +192,15 @@ class phpbb_database_test_connection_manager try { $this->pdo->exec('DROP DATABASE ' . $this->config['dbname']); + + try + { + $this->pdo->exec('CREATE DATABASE ' . $this->config['dbname']); + } + catch (PDOException $e) + { + throw new Exception("Unable to re-create database: {$e->getMessage()}"); + } } catch (PDOException $e) { @@ -154,9 +209,8 @@ class phpbb_database_test_connection_manager { $this->pdo->exec('DROP TABLE ' . $table); } + $this->purge_extras(); } - - $this->pdo->exec('CREATE DATABASE ' . $this->config['dbname']); break; } } @@ -258,7 +312,7 @@ class phpbb_database_test_connection_manager $filename = $directory . $schema . '_schema.sql'; $queries = file_get_contents($filename); - $sql = remove_comments($queries); + $sql = phpbb_remove_comments($queries); $sql = split_sql_file($sql, $this->dbms['DELIM']); @@ -332,4 +386,151 @@ class phpbb_database_test_connection_manager throw new Exception($message); } } + + /** + * Removes extra objects from a database. This is for cases where dropping the database fails. + */ + public function purge_extras() + { + $this->ensure_connected(__METHOD__); + $queries = array(); + + switch ($this->config['dbms']) + { + case 'firebird': + $sql = 'SELECT RDB$GENERATOR_NAME + FROM RDB$GENERATORS + WHERE RDB$SYSTEM_FLAG = 0'; + $result = $this->pdo->query($sql); + + while ($row = $result->fetch(PDO::FETCH_NUM)) + { + $queries[] = 'DROP GENERATOR ' . current($row); + } + break; + + case 'oracle': + $sql = 'SELECT sequence_name + FROM USER_SEQUENCES'; + $result = $this->pdo->query($sql); + + while ($row = $result->fetch(PDO::FETCH_NUM)) + { + $queries[] = 'DROP SEQUENCE ' . current($row); + } + break; + } + + foreach ($queries as $query) + { + $this->pdo->exec($query); + } + } + + /** + * Performs synchronisations on the database after a fixture has been loaded + * + * @param PHPUnit_Extensions_Database_DataSet_XmlDataSet $xml_data_set Information about the tables contained within the loaded fixture + * + * @return null + */ + public function post_setup_synchronisation($xml_data_set) + { + $this->ensure_connected(__METHOD__); + $queries = array(); + + // Get escaped versions of the table names used in the fixture + $table_names = array_map(array($this->pdo, 'PDO::quote'), $xml_data_set->getTableNames()); + + switch ($this->config['dbms']) + { + case 'oracle': + // Get all of the information about the sequences + $sql = "SELECT t.table_name, tc.column_name, d.referenced_name as sequence_name, s.increment_by, s.min_value + FROM USER_TRIGGERS t + JOIN USER_DEPENDENCIES d ON (d.name = t.trigger_name) + JOIN USER_TRIGGER_COLS tc ON (tc.trigger_name = t.trigger_name) + JOIN USER_SEQUENCES s ON (s.sequence_name = d.referenced_name) + WHERE d.referenced_type = 'SEQUENCE' + AND d.type = 'TRIGGER' + AND t.table_name IN (" . implode(', ', array_map('strtoupper', $table_names)) . ')'; + + $result = $this->pdo->query($sql); + + while ($row = $result->fetch(PDO::FETCH_ASSOC)) + { + // Get the current max value of the table + $sql = "SELECT MAX({$row['COLUMN_NAME']}) AS max FROM {$row['TABLE_NAME']}"; + $max_result = $this->pdo->query($sql); + $max_row = $max_result->fetch(PDO::FETCH_ASSOC); + + if (!$max_row) + { + continue; + } + + $max_val = (int) $max_row['MAX']; + $max_val++; + + /** + * This is not the "proper" way, but the proper way does not allow you to completely reset + * tables with no rows since you have to select the next value to make the change go into effect. + * You would have to go past the minimum value to set it correctly, but that's illegal. + * Since we have no objects attached to our sequencers (triggers aren't attached), this works fine. + */ + $queries[] = 'DROP SEQUENCE ' . $row['SEQUENCE_NAME']; + $queries[] = "CREATE SEQUENCE {$row['SEQUENCE_NAME']} + MINVALUE {$row['MIN_VALUE']} + INCREMENT BY {$row['INCREMENT_BY']} + START WITH $max_val"; + } + break; + + case 'postgres': + // Get the sequences attached to the tables + $sql = 'SELECT column_name, table_name FROM information_schema.columns + WHERE table_name IN (' . implode(', ', $table_names) . ") + AND strpos(column_default, '_seq''::regclass') > 0"; + $result = $this->pdo->query($sql); + + $setval_queries = array(); + while ($row = $result->fetch(PDO::FETCH_ASSOC)) + { + // Get the columns used in the fixture for this table + $column_names = $xml_data_set->getTableMetaData($row['table_name'])->getColumns(); + + // Skip sequences that weren't specified in the fixture + if (!in_array($row['column_name'], $column_names)) + { + continue; + } + + // Get the old value if it exists, or use 1 if it doesn't + $sql = "SELECT COALESCE((SELECT MAX({$row['column_name']}) + 1 FROM {$row['table_name']}), 1) AS val"; + $result_max = $this->pdo->query($sql); + $row_max = $result_max->fetch(PDO::FETCH_ASSOC); + + if ($row_max) + { + $seq_name = $this->pdo->quote($row['table_name'] . '_seq'); + $max_val = (int) $row_max['val']; + + // The last parameter is false so that the system doesn't increment it again + $setval_queries[] = "SETVAL($seq_name, $max_val, false)"; + } + } + + // Combine all of the SETVALs into one query + if (sizeof($setval_queries)) + { + $queries[] = 'SELECT ' . implode(', ', $setval_queries); + } + break; + } + + foreach ($queries as $query) + { + $this->pdo->exec($query); + } + } } diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 76650feb02..16e1ccaff9 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -34,16 +34,6 @@ class phpbb_functional_test_case extends phpbb_test_case static protected $config = array(); static protected $already_installed = false; - static public function setUpBeforeClass() - { - if (!extension_loaded('phar')) - { - self::markTestSkipped('phar extension is not loaded'); - } - - require_once 'phar://' . __DIR__ . '/../../vendor/goutte.phar'; - } - public function setUp() { if (!isset(self::$config['phpbb_functional_url'])) @@ -52,12 +42,16 @@ class phpbb_functional_test_case extends phpbb_test_case } $this->cookieJar = new CookieJar; - $this->client = new Goutte\Client(array(), array(), null, $this->cookieJar); + $this->client = new Goutte\Client(array(), null, $this->cookieJar); + // Reset the curl handle because it is 0 at this point and not a valid + // resource + $this->client->getClient()->getCurlMulti()->reset(true); $this->root_url = self::$config['phpbb_functional_url']; // Clear the language array so that things // that were added in other tests are gone $this->lang = array(); $this->add_lang('common'); + $this->purge_cache(); } public function request($method, $path) @@ -132,6 +126,7 @@ class phpbb_functional_test_case extends phpbb_test_case { $this->extension_manager = new phpbb_extension_manager( $this->get_db(), + new phpbb_config(array()), self::$config['table_prefix'] . 'ext', $phpbb_root_path, ".$phpEx", @@ -204,13 +199,11 @@ class phpbb_functional_test_case extends phpbb_test_case $this->do_request('create_table', $data); - file_put_contents($phpbb_root_path . "config.$phpEx", phpbb_create_config_file_data($data, self::$config['dbms'], array(), true)); - $this->do_request('config_file', $data); - - copy($phpbb_root_path . "config.$phpEx", $phpbb_root_path . "config_test.$phpEx"); + file_put_contents($phpbb_root_path . "config.$phpEx", phpbb_create_config_file_data($data, self::$config['dbms'], true, true)); $this->do_request('final', $data); + copy($phpbb_root_path . "config.$phpEx", $phpbb_root_path . "config_test.$phpEx"); } private function do_request($sub, $post_data = null) @@ -251,15 +244,57 @@ class phpbb_functional_test_case extends phpbb_test_case $cookies = $this->cookieJar->all(); // The session id is stored in a cookie that ends with _sid - we assume there is only one such cookie - foreach ($cookies as $key => $cookie); + foreach ($cookies as $cookie); { - if (substr($key, -4) == '_sid') + if (substr($cookie->getName(), -4) == '_sid') { $this->sid = $cookie->getValue(); } } } + /** + * Login to the ACP + * You must run login() before calling this. + */ + protected function admin_login() + { + $this->add_lang('acp/common'); + + // Requires login first! + if (empty($this->sid)) + { + $this->fail('$this->sid is empty. Make sure you call login() before admin_login()'); + return; + } + + $crawler = $this->request('GET', 'adm/index.php?sid=' . $this->sid); + $this->assertContains($this->lang('LOGIN_ADMIN_CONFIRM'), $crawler->filter('html')->text()); + + $form = $crawler->selectButton($this->lang('LOGIN'))->form(); + + foreach ($form->getValues() as $field => $value) + { + if (strpos($field, 'password_') === 0) + { + $login = $this->client->submit($form, array('username' => 'admin', $field => 'admin')); + + $cookies = $this->cookieJar->all(); + + // The session id is stored in a cookie that ends with _sid - we assume there is only one such cookie + foreach ($cookies as $cookie); + { + if (substr($cookie->getName(), -4) == '_sid') + { + $this->sid = $cookie->getValue(); + } + } + + break; + } + } + } + protected function add_lang($lang_file) { if (is_array($lang_file)) @@ -296,4 +331,31 @@ class phpbb_functional_test_case extends phpbb_test_case return call_user_func_array('sprintf', $args); } + + /** + * assertContains for language strings + * + * @param string $needle Search string + * @param string $haystack Search this + * @param string $message Optional failure message + */ + public function assertContainsLang($needle, $haystack, $message = null) + { + $this->assertContains(html_entity_decode($this->lang($needle), ENT_QUOTES), $haystack, $message); + } + + /** + * Heuristic function to check that the response is success. + * + * When php decides to die with a fatal error, it still sends 200 OK + * status code. This assertion tries to catch that. + * + * @return null + */ + public function assert_response_success() + { + $this->assertEquals(200, $this->client->getResponse()->getStatus()); + $content = $this->client->getResponse()->getContent(); + $this->assertNotContains('Fatal error:', $content); + } } diff --git a/tests/test_framework/phpbb_search_test_case.php b/tests/test_framework/phpbb_search_test_case.php new file mode 100644 index 0000000000..418d352c17 --- /dev/null +++ b/tests/test_framework/phpbb_search_test_case.php @@ -0,0 +1,29 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +abstract class phpbb_search_test_case extends phpbb_database_test_case +{ + static protected function get_search_wrapper($class) + { + $wrapped = $class . '_wrapper'; + if (!class_exists($wrapped)) + { + $code = " +class $wrapped extends $class +{ + public function get_must_contain_ids() { return \$this->must_contain_ids; } + public function get_must_not_contain_ids() { return \$this->must_not_contain_ids; } + public function get_split_words() { return \$this->split_words; } +} + "; + eval($code); + } + return $wrapped; + } +} diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php index 329af2c537..fe15eded90 100644 --- a/tests/test_framework/phpbb_test_case_helpers.php +++ b/tests/test_framework/phpbb_test_case_helpers.php @@ -84,12 +84,22 @@ class phpbb_test_case_helpers 'dbname' => $dbname, 'dbuser' => $dbuser, 'dbpasswd' => $dbpasswd, + 'custom_dsn' => isset($custom_dsn) ? $custom_dsn : '', )); if (isset($phpbb_functional_url)) { $config['phpbb_functional_url'] = $phpbb_functional_url; } + + if (isset($phpbb_redis_host)) + { + $config['redis_host'] = $phpbb_redis_host; + } + if (isset($phpbb_redis_port)) + { + $config['redis_port'] = $phpbb_redis_port; + } } if (isset($_SERVER['PHPBB_TEST_DBMS'])) @@ -100,7 +110,8 @@ class phpbb_test_case_helpers 'dbport' => isset($_SERVER['PHPBB_TEST_DBPORT']) ? $_SERVER['PHPBB_TEST_DBPORT'] : '', 'dbname' => isset($_SERVER['PHPBB_TEST_DBNAME']) ? $_SERVER['PHPBB_TEST_DBNAME'] : '', 'dbuser' => isset($_SERVER['PHPBB_TEST_DBUSER']) ? $_SERVER['PHPBB_TEST_DBUSER'] : '', - 'dbpasswd' => isset($_SERVER['PHPBB_TEST_DBPASSWD']) ? $_SERVER['PHPBB_TEST_DBPASSWD'] : '' + 'dbpasswd' => isset($_SERVER['PHPBB_TEST_DBPASSWD']) ? $_SERVER['PHPBB_TEST_DBPASSWD'] : '', + 'custom_dsn' => isset($_SERVER['PHPBB_TEST_CUSTOM_DSN']) ? $_SERVER['PHPBB_TEST_CUSTOM_DSN'] : '', )); } @@ -111,6 +122,124 @@ class phpbb_test_case_helpers )); } + if (isset($_SERVER['PHPBB_TEST_REDIS_HOST'])) + { + $config['redis_host'] = $_SERVER['PHPBB_TEST_REDIS_HOST']; + } + + if (isset($_SERVER['PHPBB_TEST_REDIS_PORT'])) + { + $config['redis_port'] = $_SERVER['PHPBB_TEST_REDIS_PORT']; + } + return $config; } + + /** + * Recursive directory copying function + * + * @param string $source + * @param string $dest + * @return array list of files copied + */ + public function copy_dir($source, $dest) + { + $source = (substr($source, -1) == '/') ? $source : $source . '/'; + $dest = (substr($dest, -1) == '/') ? $dest : $dest . '/'; + + $copied_files = array(); + + if (!is_dir($dest)) + { + $this->makedirs($dest); + } + + $files = scandir($source); + foreach ($files as $file) + { + if ($file == '.' || $file == '..') + { + continue; + } + + if (is_dir($source . $file)) + { + $created_dir = false; + if (!is_dir($dest . $file)) + { + $created_dir = true; + $this->makedirs($dest . $file); + } + + $copied_files = array_merge($copied_files, self::copy_dir($source . $file, $dest . $file)); + + if ($created_dir) + { + $copied_files[] = $dest . $file; + } + } + else + { + if (!file_exists($dest . $file)) + { + copy($source . $file, $dest . $file); + + $copied_files[] = $dest . $file; + } + } + } + + return $copied_files; + } + + /** + * Remove files/directories that are listed in an array + * Designed for use with $this->copy_dir() + * + * @param array $file_list + */ + public function remove_files($file_list) + { + foreach ($file_list as $file) + { + if (is_dir($file)) + { + rmdir($file); + } + else + { + unlink($file); + } + } + } + + /** + * Empty directory (remove any subdirectories/files below) + * + * @param array $file_list + */ + public function empty_dir($path) + { + $path = (substr($path, -1) == '/') ? $path : $path . '/'; + + $files = scandir($path); + foreach ($files as $file) + { + if ($file == '.' || $file == '..') + { + continue; + } + + if (is_dir($path . $file)) + { + $this->empty_dir($path . $file); + + rmdir($path . $file); + } + else + { + unlink($path . $file); + } + } + } } diff --git a/tests/text_processing/censor_text_test.php b/tests/text_processing/censor_text_test.php index 8fcdb7ef85..043d8eb27d 100644 --- a/tests/text_processing/censor_text_test.php +++ b/tests/text_processing/censor_text_test.php @@ -9,8 +9,6 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php'; -require_once dirname(__FILE__) . '/../mock_user.php'; -require_once dirname(__FILE__) . '/../mock/cache.php'; class phpbb_text_processing_censor_text_test extends phpbb_test_case { @@ -19,7 +17,7 @@ class phpbb_text_processing_censor_text_test extends phpbb_test_case global $cache, $user; $cache = new phpbb_mock_cache; $user = new phpbb_mock_user; - + $user->optionset('viewcensors', false); return array( @@ -61,7 +59,7 @@ class phpbb_text_processing_censor_text_test extends phpbb_test_case array('badword1 badword2 badword3 badword4', 'replacement1 replacement2 replacement3 replacement4'), array('badword1 badword2 badword3 badword4d', 'replacement1 replacement2 replacement3 badword4d'), array('abadword1 badword2 badword3 badword4', 'replacement1 replacement2 replacement3 replacement4'), - + array("new\nline\ntest", "new\nline\ntest"), array("tab\ttest\t", "tab\ttest\t"), array('öäü', 'öäü'), diff --git a/tests/upload/filespec_test.php b/tests/upload/filespec_test.php new file mode 100644 index 0000000000..c7ff2e78e0 --- /dev/null +++ b/tests/upload/filespec_test.php @@ -0,0 +1,275 @@ +<?php +/** + * + * @package testing + * @copyright (c) 2012 phpBB Group + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 + * + */ + +require_once __DIR__ . '/../../phpBB/includes/functions.php'; +require_once __DIR__ . '/../../phpBB/includes/utf/utf_tools.php'; +require_once __DIR__ . '/../../phpBB/includes/functions_upload.php'; + +class phpbb_filespec_test extends phpbb_test_case +{ + const TEST_COUNT = 100; + const PREFIX = 'phpbb_'; + const MAX_STR_LEN = 50; + const UPLOAD_MAX_FILESIZE = 1000; + + private $config; + public $path; + + protected function setUp() + { + // Global $config required by unique_id + // Global $user required by filespec::additional_checks and + // filespec::move_file + global $config, $user; + + if (!is_array($config)) + { + $config = array(); + } + + $config['rand_seed'] = ''; + $config['rand_seed_last_update'] = time() + 600; + // This config value is normally pulled from the database which is set + // to this value at install time. + // See: phpBB/install/schemas/schema_data.sql + $config['mime_triggers'] = 'body|head|html|img|plaintext|a href|pre|script|table|title'; + + $user = new phpbb_mock_user(); + $user->lang = new phpbb_mock_lang(); + + $this->config = &$config; + $this->path = __DIR__ . '/fixture/'; + + // Create copies of the files for use in testing move_file + $iterator = new DirectoryIterator($this->path); + foreach ($iterator as $fileinfo) + { + if ($fileinfo->isDot() || $fileinfo->isDir()) + { + continue; + } + + copy($fileinfo->getPathname(), $this->path . 'copies/' . $fileinfo->getFilename() . '_copy'); + if ($fileinfo->getFilename() === 'txt') + { + copy($fileinfo->getPathname(), $this->path . 'copies/' . $fileinfo->getFilename() . '_copy_2'); + } + } + } + + private function get_filespec($override = array()) + { + // Initialise a blank filespec object for use with trivial methods + $upload_ary = array( + 'name' => '', + 'type' => '', + 'size' => '', + 'tmp_name' => '', + 'error' => '', + ); + + return new filespec(array_merge($upload_ary, $override), null); + } + + protected function tearDown() + { + global $user; + $this->config = array(); + $user = null; + + $iterator = new DirectoryIterator($this->path . 'copies'); + foreach ($iterator as $fileinfo) + { + $name = $fileinfo->getFilename(); + if ($name[0] !== '.') + { + unlink($fileinfo->getPathname()); + } + } + } + + public function additional_checks_variables() + { + // False here just indicates the file is too large and fails the + // filespec::additional_checks method because of it. All other code + // paths in that method are covered elsewhere. + return array( + array('gif', true), + array('jpg', false), + array('png', true), + array('tif', false), + array('txt', false), + ); + } + + /** + * @dataProvider additional_checks_variables + */ + public function test_additional_checks($filename, $expected) + { + $upload = new phpbb_mock_fileupload(); + $filespec = $this->get_filespec(); + $filespec->upload = $upload; + $filespec->file_moved = true; + $filespec->filesize = $filespec->get_filesize($this->path . $filename); + + $this->assertEquals($expected, $filespec->additional_checks()); + } + + public function check_content_variables() + { + // False here indicates that a file is non-binary and contains + // disallowed content that makes IE report the mimetype incorrectly. + return array( + array('gif', true), + array('jpg', true), + array('png', true), + array('tif', true), + array('txt', false), + ); + } + + /** + * @dataProvider check_content_variables + */ + public function test_check_content($filename, $expected) + { + $disallowed_content = explode('|', $this->config['mime_triggers']); + $filespec = $this->get_filespec(array('tmp_name' => $this->path . $filename)); + $this->assertEquals($expected, $filespec->check_content($disallowed_content)); + } + + public function clean_filename_variables() + { + $chunks = str_split('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\'\\" /:*?<>|[];(){},#+=-_`', 8); + return array( + array($chunks[0] . $chunks[7]), + array($chunks[1] . $chunks[8]), + array($chunks[2] . $chunks[9]), + array($chunks[3] . $chunks[4]), + array($chunks[5] . $chunks[6]), + ); + } + + /** + * @dataProvider clean_filename_variables + */ + public function test_clean_filename_real($filename) + { + $bad_chars = array("'", "\\", ' ', '/', ':', '*', '?', '"', '<', '>', '|'); + $filespec = $this->get_filespec(array('name' => $filename)); + $filespec->clean_filename('real', self::PREFIX); + $name = $filespec->realname; + + $this->assertEquals(0, preg_match('/%(\w{2})/', $name)); + foreach ($bad_chars as $char) + { + $this->assertFalse(strpos($name, $char)); + } + } + + public function test_clean_filename_unique() + { + $filenames = array(); + for ($tests = 0; $tests < self::TEST_COUNT; $tests++) + { + $filespec = $this->get_filespec(); + $filespec->clean_filename('unique', self::PREFIX); + $name = $filespec->realname; + + $this->assertEquals(strlen($name), 32 + strlen(self::PREFIX)); + $this->assertRegExp('#^[A-Za-z0-9]+$#', substr($name, strlen(self::PREFIX))); + $this->assertFalse(isset($filenames[$name])); + $filenames[$name] = true; + } + } + + public function get_extension_variables() + { + return array( + array('file.png', 'png'), + array('file.phpbb.gif', 'gif'), + array('file..', ''), + array('.file..jpg.webp', 'webp'), + ); + } + + /** + * @dataProvider get_extension_variables + */ + public function test_get_extension($filename, $expected) + { + $filespec = $this->get_filespec(); + $this->assertEquals($expected, $filespec->get_extension($filename)); + } + + public function is_image_variables() + { + return array( + array('gif', 'image/gif', true), + array('jpg', 'image/jpg', true), + array('png', 'image/png', true), + array('tif', 'image/tif', true), + array('txt', 'text/plain', false), + ); + } + + /** + * @dataProvider is_image_variables + */ + public function test_is_image($filename, $mimetype, $expected) + { + $filespec = $this->get_filespec(array('tmp_name' => $this->path . $filename, 'type' => $mimetype)); + $this->assertEquals($expected, $filespec->is_image()); + } + + public function move_file_variables() + { + return array( + array('gif_copy', 'gif_moved', 'image/gif', 'gif', false, true), + array('non_existant', 'still_non_existant', 'text/plain', 'txt', 'GENERAL_UPLOAD_ERROR', false), + array('txt_copy', 'txt_as_img', 'image/jpg', 'txt', false, true), + array('txt_copy_2', 'txt_moved', 'text/plain', 'txt', false, true), + array('jpg_copy', 'jpg_moved', 'image/png', 'jpg', false, true), + array('png_copy', 'png_moved', 'image/png', 'jpg', 'IMAGE_FILETYPE_MISMATCH', true), + ); + } + + /** + * @dataProvider move_file_variables + */ + public function test_move_file($tmp_name, $realname, $mime_type, $extension, $error, $expected) + { + // Global $phpbb_root_path and $phpEx are required by phpbb_chmod + global $phpbb_root_path, $phpEx; + $phpbb_root_path = ''; + $phpEx = 'php'; + + $upload = new phpbb_mock_fileupload(); + $upload->max_filesize = self::UPLOAD_MAX_FILESIZE; + + $filespec = $this->get_filespec(array( + 'tmp_name' => $this->path . 'copies/' . $tmp_name, + 'name' => $realname, + 'type' => $mime_type, + )); + $filespec->extension = $extension; + $filespec->upload = $upload; + $filespec->local = true; + + $this->assertEquals($expected, $filespec->move_file($this->path . 'copies')); + $this->assertEquals($filespec->file_moved, file_exists($this->path . 'copies/' . $realname)); + if ($error) + { + $this->assertEquals($error, $filespec->error[0]); + } + + $phpEx = ''; + } +} diff --git a/tests/upload/fileupload_test.php b/tests/upload/fileupload_test.php new file mode 100644 index 0000000000..1665c493be --- /dev/null +++ b/tests/upload/fileupload_test.php @@ -0,0 +1,119 @@ +<?php +/** + * + * @package testing + * @copyright (c) 2012 phpBB Group + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 + * + */ + +require_once __DIR__ . '/../../phpBB/includes/functions.php'; +require_once __DIR__ . '/../../phpBB/includes/utf/utf_tools.php'; +require_once __DIR__ . '/../../phpBB/includes/functions_upload.php'; + +class phpbb_fileupload_test extends phpbb_test_case +{ + private $path; + + protected function setUp() + { + // Global $config required by unique_id + // Global $user required by several functions dealing with translations + // Global $request required by form_upload, local_upload and is_valid + global $config, $user, $request; + + if (!is_array($config)) + { + $config = array(); + } + + $config['rand_seed'] = ''; + $config['rand_seed_last_update'] = time() + 600; + + $user = new phpbb_mock_user(); + $user->lang = new phpbb_mock_lang(); + + $request = new phpbb_mock_request(); + + $this->path = __DIR__ . '/fixture/'; + } + + private function gen_valid_filespec() + { + $filespec = new phpbb_mock_filespec(); + $filespec->filesize = 1; + $filespec->extension = 'jpg'; + $filespec->realname = 'valid'; + $filespec->width = 2; + $filespec->height = 2; + + return $filespec; + } + + protected function tearDown() + { + // Clear globals + global $config, $user; + $config = array(); + $user = null; + } + + public function test_common_checks_invalid_extension() + { + $upload = new fileupload('', array('png'), 100); + $file = $this->gen_valid_filespec(); + $upload->common_checks($file); + $this->assertEquals('DISALLOWED_EXTENSION', $file->error[0]); + } + + public function test_common_checks_invalid_filename() + { + $upload = new fileupload('', array('jpg'), 100); + $file = $this->gen_valid_filespec(); + $file->realname = 'invalid?'; + $upload->common_checks($file); + $this->assertEquals('INVALID_FILENAME', $file->error[0]); + } + + public function test_common_checks_too_large() + { + $upload = new fileupload('', array('jpg'), 100); + $file = $this->gen_valid_filespec(); + $file->filesize = 1000; + $upload->common_checks($file); + $this->assertEquals('WRONG_FILESIZE', $file->error[0]); + } + + public function test_common_checks_valid_file() + { + $upload = new fileupload('', array('jpg'), 1000); + $file = $this->gen_valid_filespec(); + $upload->common_checks($file); + $this->assertEquals(0, sizeof($file->error)); + } + + public function test_local_upload() + { + $upload = new fileupload('', array('jpg'), 1000); + + copy($this->path . 'jpg', $this->path . 'jpg.jpg'); + $file = $upload->local_upload($this->path . 'jpg.jpg'); + $this->assertEquals(0, sizeof($file->error)); + unlink($this->path . 'jpg.jpg'); + } + + public function test_valid_dimensions() + { + $upload = new fileupload('', false, false, 1, 1, 100, 100); + + $file1 = $this->gen_valid_filespec(); + $file2 = $this->gen_valid_filespec(); + $file2->height = 101; + $file3 = $this->gen_valid_filespec(); + $file3->width = 0; + + $this->assertTrue($upload->valid_dimensions($file1)); + $this->assertFalse($upload->valid_dimensions($file2)); + $this->assertFalse($upload->valid_dimensions($file3)); + } +} diff --git a/tests/upload/fixture/copies/.gitkeep b/tests/upload/fixture/copies/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/upload/fixture/copies/.gitkeep diff --git a/tests/upload/fixture/gif b/tests/upload/fixture/gif Binary files differnew file mode 100644 index 0000000000..b636f4b8df --- /dev/null +++ b/tests/upload/fixture/gif diff --git a/tests/upload/fixture/jpg b/tests/upload/fixture/jpg Binary files differnew file mode 100644 index 0000000000..3cd5038e38 --- /dev/null +++ b/tests/upload/fixture/jpg diff --git a/tests/upload/fixture/png b/tests/upload/fixture/png Binary files differnew file mode 100644 index 0000000000..5514ad40e9 --- /dev/null +++ b/tests/upload/fixture/png diff --git a/tests/upload/fixture/tif b/tests/upload/fixture/tif Binary files differnew file mode 100644 index 0000000000..248b50f9cb --- /dev/null +++ b/tests/upload/fixture/tif diff --git a/tests/upload/fixture/txt b/tests/upload/fixture/txt new file mode 100644 index 0000000000..a78c858f5c --- /dev/null +++ b/tests/upload/fixture/txt @@ -0,0 +1,2 @@ +<HTML>mime trigger</HTML> +The HTML tags should remain uppercase so that case-insensitivity can be checked. diff --git a/travis/phpunit-mysql-travis.xml b/travis/phpunit-mysql-travis.xml index e54b2bb77b..5366494c8b 100644 --- a/travis/phpunit-mysql-travis.xml +++ b/travis/phpunit-mysql-travis.xml @@ -9,6 +9,7 @@ stopOnFailure="false" syntaxCheck="true" strict="true" + verbose="true" bootstrap="../tests/bootstrap.php"> <testsuites> <testsuite name="phpBB Test Suite"> diff --git a/travis/phpunit-postgres-travis.xml b/travis/phpunit-postgres-travis.xml index 55ba996548..0383edd9d6 100644 --- a/travis/phpunit-postgres-travis.xml +++ b/travis/phpunit-postgres-travis.xml @@ -9,6 +9,7 @@ stopOnFailure="false" syntaxCheck="true" strict="true" + verbose="true" bootstrap="../tests/bootstrap.php"> <testsuites> <testsuite name="phpBB Test Suite"> diff --git a/vendor/goutte.phar b/vendor/goutte.phar Binary files differdeleted file mode 100644 index 20b7166a67..0000000000 --- a/vendor/goutte.phar +++ /dev/null |