mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 11:58:51 +00:00
Compare commits
19 commits
cbd5d5fba0
...
33c3dd509d
Author | SHA1 | Date | |
---|---|---|---|
|
33c3dd509d | ||
|
b82d7d3f47 | ||
|
5553e7ae19 | ||
|
7d50f40dde | ||
|
2fce8aeb3e | ||
|
14f055c25b | ||
|
d547c989b7 | ||
|
788108daa9 | ||
|
105823b376 | ||
|
df30f07e6d | ||
|
5d3f0cd482 | ||
|
7fe8188b78 | ||
|
24d4b26a82 | ||
|
ac233ce7ab | ||
|
dbc4f16cfa | ||
|
705df48dff | ||
|
4ef2a543af | ||
|
8427b43b32 | ||
|
e9e7aeb756 |
51 changed files with 734 additions and 3897 deletions
4
.github/check-js.sh
vendored
4
.github/check-js.sh
vendored
|
@ -14,6 +14,6 @@ set +x
|
|||
sudo npm install -g > /dev/null
|
||||
npm ci > /dev/null
|
||||
set -x
|
||||
node_modules/eslint/bin/eslint.js "phpBB/**/*.js"
|
||||
node_modules/eslint/bin/eslint.js "phpBB/**/*.js.twig"
|
||||
node_modules/eslint/bin/eslint.js "phpBB/**/*.js" --ignore-pattern "phpBB/ext/"
|
||||
node_modules/eslint/bin/eslint.js "phpBB/**/*.js.twig" --ignore-pattern "phpBB/ext/"
|
||||
node_modules/eslint/bin/eslint.js "gulpfile.js"
|
||||
|
|
|
@ -5,7 +5,6 @@ const IGNORED_FILES = [
|
|||
'phpBB/assets/javascript/cropper.js',
|
||||
'phpBB/assets/javascript/hermite.js',
|
||||
'phpBB/assets/javascript/jquery-cropper.js',
|
||||
'phpBB/ext/**/*.js',
|
||||
'phpBB/**/*.min.js',
|
||||
'phpBB/vendor/**/*.js',
|
||||
'phpBB/vendor-ext/**/*.js',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# A hook to check syntax of a phpBB3 commit message, per:
|
||||
# A hook to check syntax of a phpBB commit message, per:
|
||||
# * <https://area51.phpbb.com/docs/dev/master/development/git.html>
|
||||
# * <http://area51.phpbb.com/phpBB/viewtopic.php?p=209919#p209919>
|
||||
#
|
||||
|
|
|
@ -56,7 +56,7 @@ catch (RuntimeException $e)
|
|||
function work($pull_id, $remote)
|
||||
{
|
||||
// Get some basic data
|
||||
$pull = get_pull('phpbb', 'phpbb3', $pull_id);
|
||||
$pull = get_pull('phpbb', 'phpbb', $pull_id);
|
||||
|
||||
if (!$pull_id)
|
||||
{
|
||||
|
@ -79,7 +79,7 @@ function work($pull_id, $remote)
|
|||
run("git checkout develop-olympus");
|
||||
run("git pull $remote develop-olympus");
|
||||
|
||||
add_remote($pull_user, 'phpbb3');
|
||||
add_remote($pull_user, 'phpbb');
|
||||
run("git fetch $pull_user");
|
||||
run("git merge --no-ff $pull_user/$pull_branch");
|
||||
run("phpBB/vendor/bin/phpunit");
|
||||
|
@ -94,7 +94,7 @@ function work($pull_id, $remote)
|
|||
run("git checkout develop");
|
||||
run("git pull $remote develop");
|
||||
|
||||
add_remote($pull_user, 'phpbb3');
|
||||
add_remote($pull_user, 'phpbb');
|
||||
run("git fetch $pull_user");
|
||||
run("git merge --no-ff $pull_user/$pull_branch");
|
||||
run("phpBB/vendor/bin/phpunit");
|
||||
|
|
|
@ -1,22 +1,23 @@
|
|||
/* global phpbb */
|
||||
/* eslint no-var: 0 */
|
||||
|
||||
/**
|
||||
* phpBB3 ACP functions
|
||||
* phpBB ACP functions
|
||||
*/
|
||||
|
||||
/**
|
||||
* Parse document block
|
||||
*/
|
||||
function parseDocument(container) {
|
||||
const test = document.createElement('div');
|
||||
var test = document.createElement('div');
|
||||
test.remove();
|
||||
|
||||
/**
|
||||
* Navigation
|
||||
*/
|
||||
container.find('#menu').each(function() {
|
||||
const menu = $(this);
|
||||
const blocks = menu.children('.menu-block');
|
||||
var menu = $(this);
|
||||
var blocks = menu.children('.menu-block');
|
||||
|
||||
if (!blocks.length) {
|
||||
return;
|
||||
|
@ -24,7 +25,7 @@ function parseDocument(container) {
|
|||
|
||||
// Set onclick event
|
||||
blocks.children('a.header').click(function() {
|
||||
const parent = $(this).parent();
|
||||
var parent = $(this).parent();
|
||||
if (!parent.hasClass('active')) {
|
||||
parent.siblings().removeClass('active');
|
||||
}
|
||||
|
@ -45,22 +46,22 @@ function parseDocument(container) {
|
|||
* Responsive tables
|
||||
*/
|
||||
container.find('table').not('.not-responsive').each(function() {
|
||||
const $this = $(this);
|
||||
const th = $this.find('thead > tr > th');
|
||||
const headers = [];
|
||||
let totalHeaders = 0;
|
||||
let i;
|
||||
var $this = $(this);
|
||||
var th = $this.find('thead > tr > th');
|
||||
var headers = [];
|
||||
var totalHeaders = 0;
|
||||
var i;
|
||||
|
||||
// Find columns
|
||||
$this.find('colgroup:first').children().each(function(i) {
|
||||
const column = $(this);
|
||||
var column = $(this);
|
||||
$this.find('td:nth-child(' + (i + 1) + ')').addClass(column.prop('className'));
|
||||
});
|
||||
|
||||
// Styles table
|
||||
if ($this.hasClass('styles')) {
|
||||
$this.find('td:first-child[style]').each(function() {
|
||||
const style = $(this).attr('style');
|
||||
var style = $(this).attr('style');
|
||||
if (style.length) {
|
||||
$(this).parent('tr').attr('style', style.toLowerCase().replace('padding', 'margin')).addClass('responsive-style-row');
|
||||
}
|
||||
|
@ -70,10 +71,10 @@ function parseDocument(container) {
|
|||
// Find each header
|
||||
if (!$this.data('no-responsive-header')) {
|
||||
th.each(function(column) {
|
||||
const cell = $(this);
|
||||
let colspan = parseInt(cell.attr('colspan'), 10);
|
||||
const dfn = cell.attr('data-dfn');
|
||||
let text = dfn ? dfn : $.trim(cell.text());
|
||||
var cell = $(this);
|
||||
var colspan = parseInt(cell.attr('colspan'), 10);
|
||||
var dfn = cell.attr('data-dfn');
|
||||
var text = dfn ? dfn : $.trim(cell.text());
|
||||
|
||||
if (text === ' ') {
|
||||
text = '';
|
||||
|
@ -93,7 +94,7 @@ function parseDocument(container) {
|
|||
});
|
||||
}
|
||||
|
||||
const headersLength = headers.length;
|
||||
headersLength = headers.length;
|
||||
|
||||
// Add header text to each cell as <dfn>
|
||||
$this.addClass('responsive');
|
||||
|
@ -104,9 +105,9 @@ function parseDocument(container) {
|
|||
}
|
||||
|
||||
$this.find('tbody > tr').each(function() {
|
||||
const row = $(this);
|
||||
const cells = row.children('td');
|
||||
let column = 0;
|
||||
var row = $(this);
|
||||
var cells = row.children('td');
|
||||
var column = 0;
|
||||
|
||||
if (cells.length === 1) {
|
||||
row.addClass('big-column');
|
||||
|
@ -114,9 +115,9 @@ function parseDocument(container) {
|
|||
}
|
||||
|
||||
cells.each(function() {
|
||||
const cell = $(this);
|
||||
let colspan = parseInt(cell.attr('colspan'), 10);
|
||||
const text = $.trim(cell.text());
|
||||
var cell = $(this);
|
||||
var colspan = parseInt(cell.attr('colspan'), 10);
|
||||
var text = $.trim(cell.text());
|
||||
|
||||
if (headersLength <= column) {
|
||||
return;
|
||||
|
@ -143,7 +144,7 @@ function parseDocument(container) {
|
|||
* Hide empty responsive tables
|
||||
*/
|
||||
container.find('table.responsive > tbody').each(function() {
|
||||
const items = $(this).children('tr');
|
||||
var items = $(this).children('tr');
|
||||
if (!items.length) {
|
||||
$(this).parent('table:first').addClass('responsive-hide');
|
||||
}
|
||||
|
@ -153,7 +154,7 @@ function parseDocument(container) {
|
|||
* Fieldsets with empty <span>
|
||||
*/
|
||||
container.find('fieldset dt > span:last-child').each(function() {
|
||||
const $this = $(this);
|
||||
var $this = $(this);
|
||||
if ($this.html() === ' ') {
|
||||
$this.addClass('responsive-hide');
|
||||
}
|
||||
|
@ -164,7 +165,7 @@ function parseDocument(container) {
|
|||
*/
|
||||
container.find('#sitename_short').each(function() {
|
||||
const $this = this;
|
||||
const { maxLength } = $this;
|
||||
const maxLength = $this.maxLength;
|
||||
$this.maxLength = maxLength * 2;
|
||||
$this.addEventListener('input', () => {
|
||||
const inputChars = Array.from($this.value);
|
||||
|
@ -178,25 +179,25 @@ function parseDocument(container) {
|
|||
* Responsive tabs
|
||||
*/
|
||||
container.find('#tabs').not('[data-skip-responsive]').each(function() {
|
||||
const $this = $(this);
|
||||
const $body = $('body');
|
||||
const ul = $this.children();
|
||||
const tabs = ul.children().not('[data-skip-responsive]');
|
||||
const links = tabs.children('a');
|
||||
const item = ul.append('<li class="tab responsive-tab" style="display:none;"><a href="javascript:void(0);" class="responsive-tab-link"> </a><div class="dropdown tab-dropdown" style="display: none;"><div class="pointer"><div class="pointer-inner"></div></div><ul class="dropdown-contents" /></div></li>').find('li.responsive-tab');
|
||||
const menu = item.find('.dropdown-contents');
|
||||
let maxHeight = 0;
|
||||
let lastWidth = false;
|
||||
let responsive = false;
|
||||
var $this = $(this);
|
||||
var $body = $('body');
|
||||
var ul = $this.children();
|
||||
var tabs = ul.children().not('[data-skip-responsive]');
|
||||
var links = tabs.children('a');
|
||||
var item = ul.append('<li class="tab responsive-tab" style="display:none;"><a href="javascript:void(0);" class="responsive-tab-link"> </a><div class="dropdown tab-dropdown" style="display: none;"><div class="pointer"><div class="pointer-inner"></div></div><ul class="dropdown-contents" /></div></li>').find('li.responsive-tab');
|
||||
var menu = item.find('.dropdown-contents');
|
||||
var maxHeight = 0;
|
||||
var lastWidth = false;
|
||||
var responsive = false;
|
||||
|
||||
links.each(function() {
|
||||
const link = $(this);
|
||||
var link = $(this);
|
||||
maxHeight = Math.max(maxHeight, Math.max(link.outerHeight(true), link.parent().outerHeight(true)));
|
||||
});
|
||||
|
||||
function check() {
|
||||
const width = $body.width();
|
||||
let height = $this.height();
|
||||
var width = $body.width();
|
||||
var height = $this.height();
|
||||
|
||||
if (!arguments.length && (!responsive || width <= lastWidth) && height <= maxHeight) {
|
||||
return;
|
||||
|
@ -220,10 +221,10 @@ function parseDocument(container) {
|
|||
item.show();
|
||||
menu.html('');
|
||||
|
||||
const availableTabs = tabs.filter(':not(.activetab, .responsive-tab)');
|
||||
const total = availableTabs.length;
|
||||
let i;
|
||||
let tab;
|
||||
var availableTabs = tabs.filter(':not(.activetab, .responsive-tab)');
|
||||
var total = availableTabs.length;
|
||||
var i;
|
||||
var tab;
|
||||
|
||||
for (i = total - 1; i >= 0; i--) {
|
||||
tab = availableTabs.eq(i);
|
||||
|
@ -265,10 +266,10 @@ function parseDocument(container) {
|
|||
parseDocument($('body'));
|
||||
|
||||
$('#questionnaire-form').css('display', 'none');
|
||||
const $triggerConfiglist = $('#trigger-configlist');
|
||||
var $triggerConfiglist = $('#trigger-configlist');
|
||||
|
||||
$triggerConfiglist.on('click', function() {
|
||||
const $configlist = $('#configlist');
|
||||
var $configlist = $('#configlist');
|
||||
$configlist.closest('.send-stats-data-row').toggleClass('send-stats-data-hidden');
|
||||
$configlist.closest('.send-stats-row').find('.send-stats-data-row:first-child').toggleClass('send-stats-data-only-row');
|
||||
$(this).find('i').toggleClass('fa-angle-down fa-angle-up');
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
/* global phpbb, statsData */
|
||||
/* eslint no-var: 0 */
|
||||
|
||||
(function($) { // Avoid conflicts with other libraries
|
||||
'use strict';
|
||||
|
||||
phpbb.prepareSendStats = function() {
|
||||
const $form = $('#acp_help_phpbb');
|
||||
const $dark = $('#darkenwrapper');
|
||||
let $loadingIndicator;
|
||||
var $form = $('#acp_help_phpbb');
|
||||
var $dark = $('#darkenwrapper');
|
||||
var $loadingIndicator;
|
||||
|
||||
$form.on('submit', function(event) {
|
||||
const $this = $(this);
|
||||
const currentTime = Math.floor(new Date().getTime() / 1000);
|
||||
const statsTime = parseInt($this.find('input[name=help_send_statistics_time]').val(), 10);
|
||||
var $this = $(this);
|
||||
var currentTime = Math.floor(new Date().getTime() / 1000);
|
||||
var statsTime = parseInt($this.find('input[name=help_send_statistics_time]').val(), 10);
|
||||
|
||||
event.preventDefault();
|
||||
$this.unbind('submit');
|
||||
|
||||
// Skip ajax request if form is submitted too early or send stats
|
||||
// checkbox is not checked
|
||||
if (!$this.find('input[name=help_send_statistics]').is(':checked')
|
||||
|| statsTime > currentTime) {
|
||||
if (!$this.find('input[name=help_send_statistics]').is(':checked') || statsTime > currentTime) {
|
||||
$form.find('input[type=submit]').click();
|
||||
setTimeout(() => {
|
||||
$form.find('input[type=submit]').click();
|
||||
|
@ -36,7 +36,7 @@
|
|||
}
|
||||
|
||||
phpbb.clearLoadingTimeout();
|
||||
let errorText = '';
|
||||
var errorText = '';
|
||||
|
||||
if (typeof errorThrown === 'string' && errorThrown.length > 0) {
|
||||
errorText = errorThrown;
|
||||
|
@ -71,7 +71,7 @@
|
|||
$loadingIndicator.fadeOut(phpbb.alertTime);
|
||||
}
|
||||
|
||||
const $sendStatisticsSuccess = $('<input />', {
|
||||
var $sendStatisticsSuccess = $('<input />', {
|
||||
type: 'hidden',
|
||||
name: 'send_statistics_response',
|
||||
value: JSON.stringify(res),
|
||||
|
@ -110,8 +110,8 @@
|
|||
return;
|
||||
}
|
||||
|
||||
const $firstTr = $(this).parents('tr');
|
||||
const $secondTr = $firstTr.next();
|
||||
var $firstTr = $(this).parents('tr');
|
||||
var $secondTr = $firstTr.next();
|
||||
|
||||
$firstTr.insertAfter($secondTr);
|
||||
});
|
||||
|
@ -121,8 +121,8 @@
|
|||
return;
|
||||
}
|
||||
|
||||
const $secondTr = $(this).parents('tr');
|
||||
const $firstTr = $secondTr.prev();
|
||||
var $secondTr = $(this).parents('tr');
|
||||
var $firstTr = $secondTr.prev();
|
||||
|
||||
$secondTr.insertBefore($firstTr);
|
||||
});
|
||||
|
@ -133,8 +133,8 @@
|
|||
* in the href with "deactivate", and vice versa.
|
||||
*/
|
||||
phpbb.addAjaxCallback('activate_deactivate', function(res) {
|
||||
const $this = $(this);
|
||||
let newHref = $this.attr('href');
|
||||
var $this = $(this);
|
||||
var newHref = $this.attr('href');
|
||||
|
||||
$this.text(res.text);
|
||||
|
||||
|
@ -211,19 +211,19 @@
|
|||
* This call will submit permissions forms in chunks of 5 fieldsets.
|
||||
*/
|
||||
function submitPermissions() {
|
||||
const $form = $('form#set-permissions');
|
||||
let fieldsetList = $form.find('fieldset[id^=perm]');
|
||||
const formDataSets = [];
|
||||
let dataSetIndex = 0;
|
||||
const $submitAllButton = $form.find('input[type=submit][name^=action]')[0];
|
||||
const $submitButton = $form.find('input[type=submit][data-clicked=true]')[0];
|
||||
var $form = $('form#set-permissions');
|
||||
var fieldsetList = $form.find('fieldset[id^=perm]');
|
||||
var formDataSets = [];
|
||||
var dataSetIndex = 0;
|
||||
var $submitAllButton = $form.find('input[type=submit][name^=action]')[0];
|
||||
var $submitButton = $form.find('input[type=submit][data-clicked=true]')[0];
|
||||
|
||||
// Set proper start values for handling refresh of page
|
||||
let permissionSubmitSize = 0;
|
||||
let permissionRequestCount = 0;
|
||||
const forumIds = [];
|
||||
let permissionSubmitFailed = false;
|
||||
let clearIndicator = true;
|
||||
var permissionSubmitSize = 0;
|
||||
var permissionRequestCount = 0;
|
||||
var forumIds = [];
|
||||
var permissionSubmitFailed = false;
|
||||
var clearIndicator = true;
|
||||
|
||||
if ($submitAllButton !== $submitButton) {
|
||||
fieldsetList = $form.find('fieldset#' + $submitButton.closest('fieldset.permissions').id);
|
||||
|
@ -231,7 +231,7 @@
|
|||
|
||||
$.each(fieldsetList, (key, value) => {
|
||||
dataSetIndex = Math.floor(key / 5);
|
||||
const $fieldset = $('fieldset#' + value.id);
|
||||
var $fieldset = $('fieldset#' + value.id);
|
||||
if (key % 5 === 0) {
|
||||
formDataSets[dataSetIndex] = $fieldset.find('select:visible, input:not([data-name])').serialize();
|
||||
} else {
|
||||
|
@ -239,7 +239,7 @@
|
|||
}
|
||||
|
||||
// Find proper role value
|
||||
const roleInput = $fieldset.find('input[name^=role][data-name]');
|
||||
var roleInput = $fieldset.find('input[name^=role][data-name]');
|
||||
if (roleInput.val()) {
|
||||
formDataSets[dataSetIndex] += '&' + roleInput.attr('name') + '=' + roleInput.val();
|
||||
} else {
|
||||
|
@ -257,7 +257,7 @@
|
|||
}
|
||||
});
|
||||
|
||||
const $loadingIndicator = phpbb.loadingIndicator();
|
||||
var $loadingIndicator = phpbb.loadingIndicator();
|
||||
|
||||
/**
|
||||
* Handler for submitted permissions form chunk
|
||||
|
@ -266,7 +266,7 @@
|
|||
*/
|
||||
function handlePermissionReturn(res) {
|
||||
permissionRequestCount++;
|
||||
const $dark = $('#darkenwrapper');
|
||||
var $dark = $('#darkenwrapper');
|
||||
|
||||
if (res.S_USER_WARNING) {
|
||||
phpbb.alert(res.MESSAGE_TITLE, res.MESSAGE_TEXT);
|
||||
|
@ -276,8 +276,8 @@
|
|||
if (permissionRequestCount >= permissionSubmitSize) {
|
||||
clearIndicator = true;
|
||||
|
||||
const $alert = phpbb.alert(res.MESSAGE_TITLE, res.MESSAGE_TEXT);
|
||||
const $alertBoxLink = $alert.find('p.alert_text > a');
|
||||
var $alert = phpbb.alert(res.MESSAGE_TITLE, res.MESSAGE_TEXT);
|
||||
var $alertBoxLink = $alert.find('p.alert_text > a');
|
||||
|
||||
// Create form to submit instead of normal "Back to previous page" link
|
||||
if ($alertBoxLink) {
|
||||
|
@ -370,11 +370,11 @@
|
|||
}
|
||||
|
||||
$('[data-ajax]').each(function() {
|
||||
const $this = $(this);
|
||||
const ajax = $this.attr('data-ajax');
|
||||
var $this = $(this);
|
||||
var ajax = $this.attr('data-ajax');
|
||||
|
||||
if (ajax !== 'false') {
|
||||
const fn = (ajax === 'true') ? null : ajax;
|
||||
var fn = (ajax === 'true') ? null : ajax;
|
||||
phpbb.ajaxify({
|
||||
selector: this,
|
||||
refresh: $this.attr('data-refresh') !== undefined,
|
||||
|
@ -389,7 +389,7 @@
|
|||
$(() => {
|
||||
phpbb.resizeTextArea($('textarea:not(.no-auto-resize)'), { minHeight: 75 });
|
||||
|
||||
const $setPermissionsForm = $('form#set-permissions');
|
||||
var $setPermissionsForm = $('form#set-permissions');
|
||||
if ($setPermissionsForm.length) {
|
||||
$setPermissionsForm.on('submit', e => {
|
||||
submitPermissions();
|
||||
|
|
|
@ -2,15 +2,16 @@
|
|||
/* eslint camelcase: 0 */
|
||||
/* eslint no-undef: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
/* eslint no-var: 0 */
|
||||
|
||||
/**
|
||||
* Hide and show all checkboxes
|
||||
* status = true (show boxes), false (hide boxes)
|
||||
*/
|
||||
function display_checkboxes(status) {
|
||||
const form = document.getElementById('set-permissions');
|
||||
const cb = document.getElementsByTagName('input');
|
||||
let display;
|
||||
var form = document.getElementById('set-permissions');
|
||||
var cb = document.getElementsByTagName('input');
|
||||
var display;
|
||||
|
||||
if (status) {
|
||||
// show
|
||||
|
@ -20,7 +21,7 @@ function display_checkboxes(status) {
|
|||
display = 'none';
|
||||
}
|
||||
|
||||
for (let i = 0; i < cb.length; i++ ) {
|
||||
for (var i = 0; i < cb.length; i++ ) {
|
||||
if (cb[i].className === 'permissions-checkbox') {
|
||||
cb[i].style.display = display;
|
||||
}
|
||||
|
@ -44,8 +45,8 @@ function set_opacity(e, value) {
|
|||
* block_id = id of the element that needs to be toggled
|
||||
*/
|
||||
function toggle_opacity(block_id) {
|
||||
const cb = document.getElementById('checkbox' + block_id);
|
||||
const fs = document.getElementById('perm' + block_id);
|
||||
var cb = document.getElementById('checkbox' + block_id);
|
||||
var fs = document.getElementById('perm' + block_id);
|
||||
|
||||
if (cb.checked) {
|
||||
set_opacity(fs, 5);
|
||||
|
@ -60,15 +61,15 @@ function toggle_opacity(block_id) {
|
|||
* except_id = id of the element not to hide
|
||||
*/
|
||||
function reset_opacity(status, except_id) {
|
||||
const perm = document.getElementById('set-permissions');
|
||||
const fs = perm.getElementsByTagName('fieldset');
|
||||
let opacity = 5;
|
||||
var perm = document.getElementById('set-permissions');
|
||||
var fs = perm.getElementsByTagName('fieldset');
|
||||
var opacity = 5;
|
||||
|
||||
if (status) {
|
||||
opacity = 10;
|
||||
}
|
||||
|
||||
for (let i = 0; i < fs.length; i++ ) {
|
||||
for (var i = 0; i < fs.length; i++ ) {
|
||||
if (fs[i].className !== 'quick') {
|
||||
set_opacity(fs[i], opacity);
|
||||
}
|
||||
|
@ -88,7 +89,7 @@ function reset_opacity(status, except_id) {
|
|||
* rb = array of radiobuttons
|
||||
*/
|
||||
function get_radio_status(index, rb) {
|
||||
for (let i = index; i < rb.length; i += 3 ) {
|
||||
for (var i = index; i < rb.length; i += 3 ) {
|
||||
if (rb[i].checked !== true) {
|
||||
if (i > index) {
|
||||
// at least one is true, but not all (custom)
|
||||
|
@ -111,18 +112,18 @@ function get_radio_status(index, rb) {
|
|||
* quick = If no calculation needed, this contains the colour
|
||||
*/
|
||||
function set_colours(id, init, quick) {
|
||||
const table = document.getElementById('table' + id);
|
||||
const tab = document.getElementById('tab' + id);
|
||||
var table = document.getElementById('table' + id);
|
||||
var tab = document.getElementById('tab' + id);
|
||||
|
||||
if (typeof (quick) !== 'undefined') {
|
||||
tab.className = 'permissions-preset-' + quick + ' activetab';
|
||||
return;
|
||||
}
|
||||
|
||||
const rb = table.getElementsByTagName('input');
|
||||
let colour = 'custom';
|
||||
var rb = table.getElementsByTagName('input');
|
||||
var colour = 'custom';
|
||||
|
||||
let status = get_radio_status(0, rb);
|
||||
var status = get_radio_status(0, rb);
|
||||
|
||||
if (status === 1) {
|
||||
colour = 'yes';
|
||||
|
@ -154,11 +155,11 @@ function set_colours(id, init, quick) {
|
|||
* block_id = block that is opened
|
||||
*/
|
||||
function init_colours(block_id) {
|
||||
const block = document.getElementById('advanced' + block_id);
|
||||
const panels = block.getElementsByTagName('div');
|
||||
const tab = document.getElementById('tab' + id);
|
||||
var block = document.getElementById('advanced' + block_id);
|
||||
var panels = block.getElementsByTagName('div');
|
||||
var tab = document.getElementById('tab' + id);
|
||||
|
||||
for (let i = 0; i < panels.length; i++) {
|
||||
for (var i = 0; i < panels.length; i++) {
|
||||
if (panels[i].className === 'permissions-panel') {
|
||||
set_colours(panels[i].id.replace(/options/, ''), true);
|
||||
}
|
||||
|
@ -178,9 +179,9 @@ function swap_options(pmask, fmask, cat, adv, view) {
|
|||
id = pmask + fmask + cat;
|
||||
active_option = active_pmask + active_fmask + active_cat;
|
||||
|
||||
const old_tab = document.getElementById('tab' + active_option);
|
||||
const new_tab = document.getElementById('tab' + id);
|
||||
const adv_block = document.getElementById('advanced' + pmask + fmask);
|
||||
var old_tab = document.getElementById('tab' + active_option);
|
||||
var new_tab = document.getElementById('tab' + id);
|
||||
var adv_block = document.getElementById('advanced' + pmask + fmask);
|
||||
|
||||
if (adv_block.style.display === 'block' && adv === true) {
|
||||
phpbb.toggleDisplay('advanced' + pmask + fmask, -1);
|
||||
|
@ -244,15 +245,15 @@ function swap_options(pmask, fmask, cat, adv, view) {
|
|||
* id = table ID container, s = status ['y'/'u'/'n']
|
||||
*/
|
||||
function mark_options(id, s) {
|
||||
const t = document.getElementById(id);
|
||||
var t = document.getElementById(id);
|
||||
|
||||
if (!t) {
|
||||
return;
|
||||
}
|
||||
|
||||
const rb = t.getElementsByTagName('input');
|
||||
var rb = t.getElementsByTagName('input');
|
||||
|
||||
for (let r = 0; r < rb.length; r++) {
|
||||
for (var r = 0; r < rb.length; r++) {
|
||||
if (rb[r].id.substr(rb[r].id.length - 1) === s) {
|
||||
rb[r].checked = true;
|
||||
}
|
||||
|
@ -260,15 +261,15 @@ function mark_options(id, s) {
|
|||
}
|
||||
|
||||
function mark_one_option(id, field_name, s) {
|
||||
const t = document.getElementById(id);
|
||||
var t = document.getElementById(id);
|
||||
|
||||
if (!t) {
|
||||
return;
|
||||
}
|
||||
|
||||
const rb = t.getElementsByTagName('input');
|
||||
var rb = t.getElementsByTagName('input');
|
||||
|
||||
for (let r = 0; r < rb.length; r++) {
|
||||
for (var r = 0; r < rb.length; r++) {
|
||||
if (rb[r].id.substr(rb[r].id.length - field_name.length - 3, field_name.length) === field_name && rb[r].id.substr(rb[r].id.length - 1) === s) {
|
||||
rb[r].checked = true;
|
||||
}
|
||||
|
@ -285,21 +286,21 @@ function mark_one_option(id, field_name, s) {
|
|||
* @returns {void}
|
||||
*/
|
||||
function reset_role(id) {
|
||||
const t = document.getElementById(id);
|
||||
var t = document.getElementById(id);
|
||||
|
||||
if (!t) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Before resetting the role dropdown, try and match any permission role
|
||||
const parent = t.parentNode;
|
||||
const roleId = match_role_settings(id.replace('role', 'perm'));
|
||||
let text = no_role_assigned;
|
||||
let index = 0;
|
||||
var parent = t.parentNode;
|
||||
var roleId = match_role_settings(id.replace('role', 'perm'));
|
||||
var text = no_role_assigned;
|
||||
var index = 0;
|
||||
|
||||
// If a role permissions was matched, grab that option's value and index
|
||||
if (roleId) {
|
||||
for (let i = 0; i < t.options.length; i++) {
|
||||
for (var i = 0; i < t.options.length; i++) {
|
||||
if (parseInt(t.options[i].value, 10) === roleId) {
|
||||
text = t.options[i].text;
|
||||
index = i;
|
||||
|
@ -321,7 +322,7 @@ function reset_role(id) {
|
|||
* Load role and set options accordingly
|
||||
*/
|
||||
function set_role_settings(role_id, target_id) {
|
||||
const settings = role_options[role_id];
|
||||
var settings = role_options[role_id];
|
||||
|
||||
if (!settings) {
|
||||
return;
|
||||
|
@ -330,7 +331,7 @@ function set_role_settings(role_id, target_id) {
|
|||
// Mark all options to no (unset) first...
|
||||
mark_options(target_id, 'u');
|
||||
|
||||
for (const r in settings) {
|
||||
for (var r in settings) {
|
||||
if (Object.prototype.hasOwnProperty.call(settings, r)) {
|
||||
mark_one_option(target_id, r, (settings[r] === 1) ? 'y' : 'n');
|
||||
}
|
||||
|
@ -344,13 +345,13 @@ function set_role_settings(role_id, target_id) {
|
|||
* @return {number} The permission role identifier
|
||||
*/
|
||||
function match_role_settings(id) {
|
||||
const fieldset = document.getElementById(id);
|
||||
const radios = fieldset.getElementsByTagName('input');
|
||||
let set = {};
|
||||
var fieldset = document.getElementById(id);
|
||||
var radios = fieldset.getElementsByTagName('input');
|
||||
var set = {};
|
||||
|
||||
// Iterate over all the radio buttons
|
||||
for (let i = 0; i < radios.length; i++) {
|
||||
const matches = radios[i].id.match(/setting\[\d+]\[\d+]\[([a-z_]+)]/);
|
||||
for (var i = 0; i < radios.length; i++) {
|
||||
var matches = radios[i].id.match(/setting\[\d+]\[\d+]\[([a-z_]+)]/);
|
||||
|
||||
// Make sure the name attribute matches, the radio is checked and it is not the "No" (-1) value.
|
||||
if (matches !== null && radios[i].checked && radios[i].value !== '-1') {
|
||||
|
@ -362,7 +363,7 @@ function match_role_settings(id) {
|
|||
set = sort_and_stringify(set);
|
||||
|
||||
// Iterate over the available role options and return the first match
|
||||
for (const r in role_options) {
|
||||
for (var r in role_options) {
|
||||
if (sort_and_stringify(role_options[r]) === set) {
|
||||
return parseInt(r, 10);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* global phpbb */
|
||||
/* eslint no-var: 0 */
|
||||
|
||||
/*
|
||||
javascript for Bubble Tooltips by Alessandro Fulciniti
|
||||
|
@ -15,7 +16,7 @@ phpBB Development Team:
|
|||
(function($) { // Avoid conflicts with other libraries
|
||||
'use strict';
|
||||
|
||||
const tooltips = [];
|
||||
var tooltips = [];
|
||||
|
||||
/**
|
||||
* Enable tooltip replacements for selects
|
||||
|
@ -24,9 +25,9 @@ phpBB Development Team:
|
|||
* @param {string} [subId] Sub ID that should only be using tooltips (optional)
|
||||
*/
|
||||
phpbb.enableTooltipsSelect = function(id, headline, subId) {
|
||||
let $links;
|
||||
var $links;
|
||||
|
||||
const hold = $('<span />', {
|
||||
var hold = $('<span />', {
|
||||
id: '_tooltip_container',
|
||||
css: {
|
||||
position: 'absolute',
|
||||
|
@ -42,7 +43,7 @@ phpBB Development Team:
|
|||
}
|
||||
|
||||
$links.each(function() {
|
||||
const $this = $(this);
|
||||
var $this = $(this);
|
||||
|
||||
if (subId) {
|
||||
if ($this.parent().attr('id').substr(0, subId.length) === subId) {
|
||||
|
@ -61,13 +62,13 @@ phpBB Development Team:
|
|||
* @param {string} headText Text heading to display
|
||||
*/
|
||||
phpbb.prepareTooltips = function($element, headText) {
|
||||
const text = $element.attr('data-title');
|
||||
var text = $element.attr('data-title');
|
||||
|
||||
if (text === null || text.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const $title = $('<span />', {
|
||||
var $title = $('<span />', {
|
||||
class: 'top',
|
||||
css: {
|
||||
display: 'block',
|
||||
|
@ -75,7 +76,7 @@ phpBB Development Team:
|
|||
})
|
||||
.append(document.createTextNode(headText));
|
||||
|
||||
const $desc = $('<span />', {
|
||||
var $desc = $('<span />', {
|
||||
class: 'bottom',
|
||||
html: text,
|
||||
css: {
|
||||
|
@ -83,7 +84,7 @@ phpBB Development Team:
|
|||
},
|
||||
});
|
||||
|
||||
const $tooltip = $('<span />', {
|
||||
var $tooltip = $('<span />', {
|
||||
class: 'tooltip',
|
||||
css: {
|
||||
display: 'block',
|
||||
|
@ -103,7 +104,7 @@ phpBB Development Team:
|
|||
* @param {object} $element Element passed by .on()
|
||||
*/
|
||||
phpbb.showTooltip = function($element) {
|
||||
const $this = $($element.target);
|
||||
var $this = $($element.target);
|
||||
$('#_tooltip_container').append(tooltips[$this.attr('data-id')]);
|
||||
phpbb.positionTooltip($this);
|
||||
};
|
||||
|
@ -112,7 +113,7 @@ phpBB Development Team:
|
|||
* Hide tooltip
|
||||
*/
|
||||
phpbb.hideTooltip = function() {
|
||||
const d = document.getElementById('_tooltip_container');
|
||||
var d = document.getElementById('_tooltip_container');
|
||||
if (d.childNodes.length > 0) {
|
||||
d.removeChild(d.firstChild);
|
||||
}
|
||||
|
@ -125,7 +126,7 @@ phpBB Development Team:
|
|||
*/
|
||||
phpbb.positionTooltip = function($element) {
|
||||
$element = $element.parent();
|
||||
const offset = $element.offset();
|
||||
var offset = $element.offset();
|
||||
|
||||
if ($('body').hasClass('rtl')) {
|
||||
$('#_tooltip_container').css({
|
||||
|
@ -144,13 +145,13 @@ phpBB Development Team:
|
|||
* Prepare roles drop down select
|
||||
*/
|
||||
phpbb.prepareRolesDropdown = function() {
|
||||
const $options = $('.roles-options li');
|
||||
var $options = $('.roles-options li');
|
||||
|
||||
// Display span and hide select
|
||||
$('.roles-options > span').css('display', 'block');
|
||||
$('.roles-options > select').hide();
|
||||
$('.roles-options > input[type=hidden]').each(function() {
|
||||
const $this = $(this);
|
||||
var $this = $(this);
|
||||
|
||||
if ($this.attr('data-name') && !$this.attr('name')) {
|
||||
$this.attr('name', $this.attr('data-name'));
|
||||
|
@ -159,9 +160,9 @@ phpBB Development Team:
|
|||
|
||||
// Prepare highlighting of select options and settings update
|
||||
$options.each(function() {
|
||||
const $this = $(this);
|
||||
const $rolesOptions = $this.closest('.roles-options');
|
||||
const $span = $rolesOptions.children('span');
|
||||
var $this = $(this);
|
||||
var $rolesOptions = $this.closest('.roles-options');
|
||||
var $span = $rolesOptions.children('span');
|
||||
|
||||
// Correctly show selected option
|
||||
if (typeof $this.attr('data-selected') !== 'undefined') {
|
||||
|
@ -185,12 +186,12 @@ phpBB Development Team:
|
|||
}
|
||||
|
||||
$this.on('mouseover', function() {
|
||||
const $this = $(this);
|
||||
var $this = $(this);
|
||||
$options.removeClass('roles-highlight');
|
||||
$this.addClass('roles-highlight');
|
||||
}).on('click', function() {
|
||||
const $this = $(this);
|
||||
const $rolesOptions = $this.closest('.roles-options');
|
||||
var $this = $(this);
|
||||
var $rolesOptions = $this.closest('.roles-options');
|
||||
|
||||
// Update settings
|
||||
// eslint-disable-next-line no-undef
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
/* global bbfontstyle */
|
||||
/* eslint no-var: 0 */
|
||||
|
||||
const phpbb = {};
|
||||
var phpbb = {};
|
||||
phpbb.alertTime = 100;
|
||||
|
||||
(function($) { // Avoid conflicts with other libraries
|
||||
'use strict';
|
||||
|
||||
// define a couple constants for keydown functions.
|
||||
const keymap = {
|
||||
var keymap = {
|
||||
TAB: 9,
|
||||
ENTER: 13,
|
||||
ESC: 27,
|
||||
|
@ -15,9 +16,9 @@ phpbb.alertTime = 100;
|
|||
ARROW_DOWN: 40,
|
||||
};
|
||||
|
||||
const $dark = $('#darkenwrapper');
|
||||
let $loadingIndicator;
|
||||
let phpbbAlertTimer = null;
|
||||
var $dark = $('#darkenwrapper');
|
||||
var $loadingIndicator;
|
||||
var phpbbAlertTimer = null;
|
||||
|
||||
phpbb.isTouch = (window && typeof window.ontouchstart !== 'undefined');
|
||||
|
||||
|
@ -54,7 +55,7 @@ phpbb.alertTime = 100;
|
|||
* Show timeout message
|
||||
*/
|
||||
phpbb.showTimeoutMessage = function() {
|
||||
const $alert = $('#phpbb_alert');
|
||||
var $alert = $('#phpbb_alert');
|
||||
|
||||
if ($loadingIndicator.is(':visible')) {
|
||||
phpbb.alert($alert.attr('data-l-err'), $alert.attr('data-l-timeout-processing-req'));
|
||||
|
@ -93,7 +94,7 @@ phpbb.alertTime = 100;
|
|||
* @returns {object} Returns the div created.
|
||||
*/
|
||||
phpbb.alert = function(title, msg) {
|
||||
const $alert = $('#phpbb_alert');
|
||||
var $alert = $('#phpbb_alert');
|
||||
$alert.find('.alert_title').html(title);
|
||||
$alert.find('.alert_text').html(msg);
|
||||
|
||||
|
@ -156,7 +157,7 @@ phpbb.alertTime = 100;
|
|||
* @param {bool} fadedark Whether to remove dark background.
|
||||
*/
|
||||
phpbb.alert.close = function($alert, fadedark) {
|
||||
const $fade = (fadedark) ? $dark : $alert;
|
||||
var $fade = (fadedark) ? $dark : $alert;
|
||||
|
||||
$fade.fadeOut(phpbb.alertTime, () => {
|
||||
$alert.hide();
|
||||
|
@ -180,13 +181,13 @@ phpbb.alertTime = 100;
|
|||
* @returns {object} Returns the div created.
|
||||
*/
|
||||
phpbb.confirm = function(msg, callback, fadedark) {
|
||||
const $confirmDiv = $('#phpbb_confirm');
|
||||
var $confirmDiv = $('#phpbb_confirm');
|
||||
$confirmDiv.find('.alert_text').html(msg);
|
||||
fadedark = typeof fadedark === 'undefined' ? true : fadedark;
|
||||
|
||||
$(document).on('keydown.phpbb.alert', e => {
|
||||
if (e.keyCode === keymap.ENTER || e.keyCode === keymap.ESC) {
|
||||
const name = (e.keyCode === keymap.ENTER) ? 'confirm' : 'cancel';
|
||||
var name = (e.keyCode === keymap.ENTER) ? 'confirm' : 'cancel';
|
||||
|
||||
$('input[name="' + name + '"]').trigger('click');
|
||||
e.preventDefault();
|
||||
|
@ -195,7 +196,7 @@ phpbb.alertTime = 100;
|
|||
});
|
||||
|
||||
$confirmDiv.find('input[type="button"]').one('click.phpbb.confirmbox', function(e) {
|
||||
const confirmed = this.name === 'confirm';
|
||||
var confirmed = this.name === 'confirm';
|
||||
|
||||
callback(confirmed);
|
||||
$confirmDiv.find('input[type="button"]').off('click.phpbb.confirmbox');
|
||||
|
@ -217,9 +218,9 @@ phpbb.alertTime = 100;
|
|||
* @returns {object} The object created.
|
||||
*/
|
||||
phpbb.parseQuerystring = function(string) {
|
||||
const params = {};
|
||||
let i;
|
||||
let split;
|
||||
var params = {};
|
||||
var i;
|
||||
var split;
|
||||
|
||||
string = string.split('&');
|
||||
for (i = 0; i < string.length; i++) {
|
||||
|
@ -244,13 +245,13 @@ phpbb.alertTime = 100;
|
|||
* @param {object} options Options.
|
||||
*/
|
||||
phpbb.ajaxify = function(options) {
|
||||
const $elements = $(options.selector);
|
||||
let { refresh } = options;
|
||||
const { callback } = options;
|
||||
const overlay = typeof options.overlay === 'undefined' ? true : options.overlay;
|
||||
const isForm = $elements.is('form');
|
||||
const isText = $elements.is('input[type="text"], textarea');
|
||||
let eventName;
|
||||
var $elements = $(options.selector);
|
||||
var refresh = options.refresh;
|
||||
var callback = options.callback;
|
||||
var overlay = typeof options.overlay === 'undefined' ? true : options.overlay;
|
||||
var isForm = $elements.is('form');
|
||||
var isText = $elements.is('input[type="text"], textarea');
|
||||
var eventName;
|
||||
|
||||
if (isForm) {
|
||||
eventName = 'submit';
|
||||
|
@ -261,12 +262,12 @@ phpbb.alertTime = 100;
|
|||
}
|
||||
|
||||
$elements.on(eventName, function(event) {
|
||||
let action;
|
||||
let method;
|
||||
let data;
|
||||
let submit;
|
||||
const that = this;
|
||||
const $this = $(this);
|
||||
var action;
|
||||
var method;
|
||||
var data;
|
||||
var submit;
|
||||
var that = this;
|
||||
var $this = $(this);
|
||||
|
||||
if ($this.find('input[type="submit"][data-clicked]').attr('data-ajax') === 'false') {
|
||||
return;
|
||||
|
@ -281,8 +282,8 @@ phpbb.alertTime = 100;
|
|||
}
|
||||
|
||||
phpbb.clearLoadingTimeout();
|
||||
let responseText;
|
||||
let errorText = false;
|
||||
var responseText;
|
||||
var errorText = false;
|
||||
try {
|
||||
responseText = JSON.parse(jqXHR.responseText);
|
||||
responseText = responseText.message;
|
||||
|
@ -313,7 +314,7 @@ phpbb.alertTime = 100;
|
|||
* @param {object} res The object sent back by the server.
|
||||
*/
|
||||
function returnHandler(res) {
|
||||
let alert;
|
||||
var alert;
|
||||
|
||||
phpbb.clearLoadingTimeout();
|
||||
|
||||
|
@ -380,7 +381,7 @@ phpbb.alertTime = 100;
|
|||
|
||||
// If the element is a form, POST must be used and some extra data must
|
||||
// be taken from the form.
|
||||
const runFilter = (typeof options.filter === 'function');
|
||||
var runFilter = (typeof options.filter === 'function');
|
||||
data = {};
|
||||
|
||||
if (isForm) {
|
||||
|
@ -396,7 +397,7 @@ phpbb.alertTime = 100;
|
|||
});
|
||||
}
|
||||
} else if (isText) {
|
||||
const name = $this.attr('data-name') || this.name;
|
||||
var name = $this.attr('data-name') || this.name;
|
||||
action = $this.attr('data-url').replace('&', '&');
|
||||
data[name] = this.value;
|
||||
method = 'POST';
|
||||
|
@ -406,13 +407,13 @@ phpbb.alertTime = 100;
|
|||
method = 'GET';
|
||||
}
|
||||
|
||||
const sendRequest = function() {
|
||||
const dataOverlay = $this.attr('data-overlay');
|
||||
var sendRequest = function() {
|
||||
var dataOverlay = $this.attr('data-overlay');
|
||||
if (overlay && (typeof dataOverlay === 'undefined' || dataOverlay === 'true')) {
|
||||
phpbb.loadingIndicator();
|
||||
}
|
||||
|
||||
const request = $.ajax({
|
||||
var request = $.ajax({
|
||||
url: action,
|
||||
type: method,
|
||||
data,
|
||||
|
@ -440,7 +441,7 @@ phpbb.alertTime = 100;
|
|||
|
||||
if (isForm) {
|
||||
$elements.find('input:submit').click(function() {
|
||||
const $this = $(this);
|
||||
var $this = $(this);
|
||||
|
||||
// Remove data-clicked attribute from any submit button of form
|
||||
$this.parents('form:first').find('input:submit[data-clicked]').removeAttr('data-clicked');
|
||||
|
@ -522,7 +523,7 @@ phpbb.alertTime = 100;
|
|||
*/
|
||||
phpbb.search.getKeyword = function($input, keyword, multiline) {
|
||||
if (multiline) {
|
||||
const line = phpbb.search.getKeywordLine($input);
|
||||
var line = phpbb.search.getKeywordLine($input);
|
||||
keyword = keyword.split('\n').splice(line, 1);
|
||||
}
|
||||
|
||||
|
@ -537,7 +538,7 @@ phpbb.alertTime = 100;
|
|||
* @returns {int} The line number.
|
||||
*/
|
||||
phpbb.search.getKeywordLine = function($textarea) {
|
||||
const { selectionStart } = $textarea.get(0);
|
||||
var { selectionStart } = $textarea.get(0);
|
||||
return $textarea.val().substr(0, selectionStart).split('\n').length - 1;
|
||||
};
|
||||
|
||||
|
@ -551,8 +552,8 @@ phpbb.alertTime = 100;
|
|||
*/
|
||||
phpbb.search.setValue = function($input, value, multiline) {
|
||||
if (multiline) {
|
||||
const line = phpbb.search.getKeywordLine($input);
|
||||
const lines = $input.val().split('\n');
|
||||
var line = phpbb.search.getKeywordLine($input);
|
||||
var lines = $input.val().split('\n');
|
||||
lines[line] = value;
|
||||
value = lines.join('\n');
|
||||
}
|
||||
|
@ -589,14 +590,14 @@ phpbb.alertTime = 100;
|
|||
* @returns {boolean} Returns false.
|
||||
*/
|
||||
phpbb.search.filter = function(data, event, sendRequest) {
|
||||
const $this = $(this);
|
||||
const dataName = $this.attr('data-name') === undefined ? $this.attr('name') : $this.attr('data-name');
|
||||
const minLength = parseInt($this.attr('data-min-length'), 10);
|
||||
const searchID = $this.attr('data-results');
|
||||
const keyword = phpbb.search.getKeyword($this, data[dataName], $this.attr('data-multiline'));
|
||||
const cache = phpbb.search.cache.get(searchID);
|
||||
const key = event.keyCode || event.which;
|
||||
let proceed = true;
|
||||
var $this = $(this);
|
||||
var dataName = $this.attr('data-name') === undefined ? $this.attr('name') : $this.attr('data-name');
|
||||
var minLength = parseInt($this.attr('data-min-length'), 10);
|
||||
var searchID = $this.attr('data-results');
|
||||
var keyword = phpbb.search.getKeyword($this, data[dataName], $this.attr('data-multiline'));
|
||||
var cache = phpbb.search.cache.get(searchID);
|
||||
var key = event.keyCode || event.which;
|
||||
var proceed = true;
|
||||
data[dataName] = keyword;
|
||||
|
||||
// No need to search if enter was pressed
|
||||
|
@ -609,7 +610,7 @@ phpbb.alertTime = 100;
|
|||
clearTimeout(cache.timeout);
|
||||
}
|
||||
|
||||
const timeout = setTimeout(function() {
|
||||
var timeout = setTimeout(function() {
|
||||
// Check min length and existence of cache.
|
||||
if (minLength > keyword.length) {
|
||||
proceed = false;
|
||||
|
@ -620,7 +621,7 @@ phpbb.alertTime = 100;
|
|||
} else {
|
||||
// Do we already have results for this?
|
||||
if (cache.results[keyword]) {
|
||||
const response = {
|
||||
var response = {
|
||||
keyword,
|
||||
results: cache.results[keyword],
|
||||
};
|
||||
|
@ -660,8 +661,8 @@ phpbb.alertTime = 100;
|
|||
return;
|
||||
}
|
||||
|
||||
const searchID = $input.attr('data-results');
|
||||
const $container = $(searchID);
|
||||
var searchID = $input.attr('data-results');
|
||||
var $container = $(searchID);
|
||||
|
||||
if (this.cache.get(searchID).callback) {
|
||||
callback = this.cache.get(searchID).callback;
|
||||
|
@ -686,7 +687,7 @@ phpbb.alertTime = 100;
|
|||
* @param {function} callback Optional callback to run when assigning each search result.
|
||||
*/
|
||||
phpbb.search.showResults = function(results, $input, $container, callback) {
|
||||
const $resultContainer = $('.search-results', $container);
|
||||
var $resultContainer = $('.search-results', $container);
|
||||
this.clearResults($resultContainer);
|
||||
|
||||
if (!results.length) {
|
||||
|
@ -694,9 +695,9 @@ phpbb.alertTime = 100;
|
|||
return;
|
||||
}
|
||||
|
||||
const searchID = $container.attr('id');
|
||||
let tpl;
|
||||
let row;
|
||||
var searchID = $container.attr('id');
|
||||
var tpl;
|
||||
var row;
|
||||
|
||||
if (!this.tpl[searchID]) {
|
||||
tpl = $('.search-result-tpl', $container);
|
||||
|
@ -754,14 +755,14 @@ phpbb.alertTime = 100;
|
|||
// Rebind it, to ensure the event is 'dynamic'.
|
||||
$input.off('.phpbb.search');
|
||||
$input.on('keydown.phpbb.search', event => {
|
||||
const key = event.keyCode || event.which;
|
||||
const $active = $resultContainer.children('.active');
|
||||
var key = event.keyCode || event.which;
|
||||
var $active = $resultContainer.children('.active');
|
||||
|
||||
if (key === keymap.ESC) {
|
||||
phpbb.search.closeResults($input, $container);
|
||||
} else if (key === keymap.ENTER) {
|
||||
if ($active.length) {
|
||||
const value = $active.find('.search-result > span').text();
|
||||
var value = $active.find('.search-result > span').text();
|
||||
|
||||
phpbb.search.setValue($input, value, $input.attr('data-multiline'));
|
||||
}
|
||||
|
@ -771,8 +772,8 @@ phpbb.alertTime = 100;
|
|||
// Do not submit the form
|
||||
event.preventDefault();
|
||||
} else if (key === keymap.ARROW_DOWN || key === keymap.ARROW_UP) {
|
||||
const up = key === keymap.ARROW_UP;
|
||||
const $children = $resultContainer.children();
|
||||
var up = key === keymap.ARROW_UP;
|
||||
var $children = $resultContainer.children();
|
||||
|
||||
if (!$active.length) {
|
||||
if (up) {
|
||||
|
@ -805,7 +806,7 @@ phpbb.alertTime = 100;
|
|||
};
|
||||
|
||||
$('#phpbb').click(function() {
|
||||
const $this = $(this);
|
||||
var $this = $(this);
|
||||
|
||||
if (!$this.is('.live-search') && !$this.parents().is('.live-search')) {
|
||||
phpbb.search.closeResults($('input, textarea'), $('.live-search'));
|
||||
|
@ -834,7 +835,7 @@ phpbb.alertTime = 100;
|
|||
* @param {object} [obj] Optional state object.
|
||||
*/
|
||||
phpbb.history.alterUrl = function(mode, url, title, obj) {
|
||||
const fn = mode + 'State';
|
||||
var fn = mode + 'State';
|
||||
|
||||
if (!url || !phpbb.history.isSupported(fn)) {
|
||||
return;
|
||||
|
@ -880,10 +881,10 @@ phpbb.alertTime = 100;
|
|||
* user be forced to repick one.
|
||||
*/
|
||||
phpbb.timezoneSwitchDate = function(keepSelection) {
|
||||
const $timezoneCopy = $('#timezone_copy');
|
||||
const $timezone = $('#timezone');
|
||||
const $tzDate = $('#tz_date');
|
||||
const $tzSelectDateSuggest = $('#tz_select_date_suggest');
|
||||
var $timezoneCopy = $('#timezone_copy');
|
||||
var $timezone = $('#timezone');
|
||||
var $tzDate = $('#tz_date');
|
||||
var $tzSelectDateSuggest = $('#tz_select_date_suggest');
|
||||
|
||||
if ($timezoneCopy.length === 0) {
|
||||
// We make a backup of the original dropdown, so we can remove optgroups
|
||||
|
@ -909,7 +910,7 @@ phpbb.alertTime = 100;
|
|||
$tzSelectDateSuggest.css('display', 'inline');
|
||||
}
|
||||
|
||||
const $tzOptions = $timezone.children('optgroup[data-tz-value="' + $tzDate.val() + '"]').children('option');
|
||||
var $tzOptions = $timezone.children('optgroup[data-tz-value="' + $tzDate.val() + '"]').children('option');
|
||||
|
||||
if ($tzOptions.length === 1) {
|
||||
// If there is only one timezone for the selected date, we just select that automatically.
|
||||
|
@ -918,7 +919,7 @@ phpbb.alertTime = 100;
|
|||
}
|
||||
|
||||
if (typeof keepSelection !== 'undefined' && !keepSelection) {
|
||||
const $timezoneOptions = $timezone.find('optgroup option');
|
||||
var $timezoneOptions = $timezone.find('optgroup option');
|
||||
if ($timezoneOptions.filter(':selected').length <= 0) {
|
||||
$timezoneOptions.filter(':first').prop('selected', true);
|
||||
}
|
||||
|
@ -939,16 +940,16 @@ phpbb.alertTime = 100;
|
|||
*/
|
||||
phpbb.timezonePreselectSelect = function(forceSelector) {
|
||||
// The offset returned here is in minutes and negated.
|
||||
let offset = (new Date()).getTimezoneOffset();
|
||||
let sign = '-';
|
||||
var offset = (new Date()).getTimezoneOffset();
|
||||
var sign = '-';
|
||||
|
||||
if (offset < 0) {
|
||||
sign = '+';
|
||||
offset = -offset;
|
||||
}
|
||||
|
||||
let minutes = offset % 60;
|
||||
let hours = (offset - minutes) / 60;
|
||||
var minutes = offset % 60;
|
||||
var hours = (offset - minutes) / 60;
|
||||
|
||||
if (hours === 0) {
|
||||
hours = '00';
|
||||
|
@ -965,15 +966,15 @@ phpbb.alertTime = 100;
|
|||
minutes = minutes.toString();
|
||||
}
|
||||
|
||||
const prefix = 'UTC' + sign + hours + ':' + minutes;
|
||||
const prefixLength = prefix.length;
|
||||
const selectorOptions = $('option', '#tz_date');
|
||||
let i;
|
||||
var prefix = 'UTC' + sign + hours + ':' + minutes;
|
||||
var prefixLength = prefix.length;
|
||||
var selectorOptions = $('option', '#tz_date');
|
||||
var i;
|
||||
|
||||
const $tzSelectDateSuggest = $('#tz_select_date_suggest');
|
||||
var $tzSelectDateSuggest = $('#tz_select_date_suggest');
|
||||
|
||||
for (i = 0; i < selectorOptions.length; ++i) {
|
||||
const option = selectorOptions[i];
|
||||
var option = selectorOptions[i];
|
||||
|
||||
if (option.value.substring(0, prefixLength) === prefix) {
|
||||
if ($('#tz_date').val() !== option.value && !forceSelector) {
|
||||
|
@ -987,7 +988,7 @@ phpbb.alertTime = 100;
|
|||
$tzSelectDateSuggest.css('display', 'none');
|
||||
}
|
||||
|
||||
const suggestion = $tzSelectDateSuggest.attr('data-l-suggestion');
|
||||
var suggestion = $tzSelectDateSuggest.attr('data-l-suggestion');
|
||||
|
||||
$tzSelectDateSuggest.attr('title', suggestion.replace('%s', option.innerHTML));
|
||||
$tzSelectDateSuggest.attr('value', suggestion.replace('%s', option.innerHTML.substring(0, 9)));
|
||||
|
@ -1030,9 +1031,9 @@ phpbb.alertTime = 100;
|
|||
* current text so that the process can be repeated.
|
||||
*/
|
||||
phpbb.addAjaxCallback('alt_text', function() {
|
||||
let $anchor;
|
||||
const updateAll = $(this).data('update-all');
|
||||
let altText;
|
||||
var $anchor;
|
||||
var updateAll = $(this).data('update-all');
|
||||
var altText;
|
||||
|
||||
if (updateAll !== undefined && updateAll.length) {
|
||||
$anchor = $(updateAll);
|
||||
|
@ -1041,7 +1042,7 @@ phpbb.alertTime = 100;
|
|||
}
|
||||
|
||||
$anchor.each(function() {
|
||||
const $this = $(this);
|
||||
var $this = $(this);
|
||||
altText = $this.attr('data-alt-text');
|
||||
$this.attr('data-alt-text', $.trim($this.text()));
|
||||
$this.attr('title', altText);
|
||||
|
@ -1059,10 +1060,10 @@ phpbb.alertTime = 100;
|
|||
* and changes the link itself.
|
||||
*/
|
||||
phpbb.addAjaxCallback('toggle_link', function() {
|
||||
let $anchor;
|
||||
const updateAll = $(this).data('update-all');
|
||||
let toggleText;
|
||||
let toggleUrl;
|
||||
var $anchor;
|
||||
var updateAll = $(this).data('update-all');
|
||||
var toggleText;
|
||||
var toggleUrl;
|
||||
|
||||
if (updateAll !== undefined && updateAll.length) {
|
||||
$anchor = $(updateAll);
|
||||
|
@ -1071,7 +1072,7 @@ phpbb.alertTime = 100;
|
|||
}
|
||||
|
||||
$anchor.each(function() {
|
||||
const $this = $(this);
|
||||
var $this = $(this);
|
||||
|
||||
// Toggle link text
|
||||
toggleText = $.trim($this.attr('data-toggle-text'));
|
||||
|
@ -1113,7 +1114,7 @@ phpbb.alertTime = 100;
|
|||
*/
|
||||
phpbb.resizeTextArea = function($items, options) {
|
||||
// Configuration
|
||||
let configuration = {
|
||||
var configuration = {
|
||||
minWindowHeight: 500,
|
||||
minHeight: 200,
|
||||
maxHeight: 500,
|
||||
|
@ -1131,7 +1132,7 @@ phpbb.alertTime = 100;
|
|||
}
|
||||
|
||||
function resetAutoResize(item) {
|
||||
const $item = $(item);
|
||||
var $item = $(item);
|
||||
if ($item.hasClass('auto-resized')) {
|
||||
$(item)
|
||||
.css({ height: '', resize: '' })
|
||||
|
@ -1149,20 +1150,20 @@ phpbb.alertTime = 100;
|
|||
configuration.resizeCallback.call(item, $item);
|
||||
}
|
||||
|
||||
const windowHeight = $(window).height();
|
||||
var windowHeight = $(window).height();
|
||||
|
||||
if (windowHeight < configuration.minWindowHeight) {
|
||||
resetAutoResize(item);
|
||||
return;
|
||||
}
|
||||
|
||||
const maxHeight = Math.min(
|
||||
var maxHeight = Math.min(
|
||||
Math.max(windowHeight - configuration.heightDiff, configuration.minHeight),
|
||||
configuration.maxHeight,
|
||||
);
|
||||
const $item = $(item);
|
||||
const height = parseInt($item.innerHeight(), 10);
|
||||
const scrollHeight = (item.scrollHeight) ? item.scrollHeight : 0;
|
||||
var $item = $(item);
|
||||
var height = parseInt($item.innerHeight(), 10);
|
||||
var scrollHeight = (item.scrollHeight) ? item.scrollHeight : 0;
|
||||
|
||||
if (height < 0) {
|
||||
return;
|
||||
|
@ -1202,20 +1203,20 @@ phpbb.alertTime = 100;
|
|||
* @returns {boolean} True if cursor is in bbcode tag
|
||||
*/
|
||||
phpbb.inBBCodeTag = function(textarea, startTags, endTags) {
|
||||
const start = textarea.selectionStart;
|
||||
let lastEnd = -1;
|
||||
let lastStart = -1;
|
||||
let i;
|
||||
let index;
|
||||
var start = textarea.selectionStart;
|
||||
var lastEnd = -1;
|
||||
var lastStart = -1;
|
||||
var i;
|
||||
var index;
|
||||
|
||||
if (typeof start !== 'number') {
|
||||
return false;
|
||||
}
|
||||
|
||||
const value = textarea.value.toLowerCase();
|
||||
var value = textarea.value.toLowerCase();
|
||||
|
||||
for (i = 0; i < startTags.length; i++) {
|
||||
const tagLength = startTags[i].length;
|
||||
var tagLength = startTags[i].length;
|
||||
if (start >= tagLength) {
|
||||
index = value.lastIndexOf(startTags[i], start - tagLength);
|
||||
lastStart = Math.max(lastStart, index);
|
||||
|
@ -1250,9 +1251,9 @@ phpbb.alertTime = 100;
|
|||
*/
|
||||
phpbb.applyCodeEditor = function(textarea) {
|
||||
// list of allowed start and end bbcode code tags, in lower case
|
||||
const startTags = [ '[code]', '[code=' ];
|
||||
const startTagsEnd = ']';
|
||||
const endTags = [ '[/code]' ];
|
||||
var startTags = [ '[code]', '[code=' ];
|
||||
var startTagsEnd = ']';
|
||||
var endTags = [ '[/code]' ];
|
||||
|
||||
if (!textarea || typeof textarea.selectionStart !== 'number') {
|
||||
return;
|
||||
|
@ -1275,17 +1276,17 @@ phpbb.alertTime = 100;
|
|||
* @returns {string} Line of text
|
||||
*/
|
||||
function getLastLine(stripCodeStart) {
|
||||
const start = textarea.selectionStart;
|
||||
let { value } = textarea;
|
||||
let index = value.lastIndexOf('\n', start - 1);
|
||||
var start = textarea.selectionStart;
|
||||
var value = textarea.value;
|
||||
var index = value.lastIndexOf('\n', start - 1);
|
||||
|
||||
value = value.substring(index + 1, start);
|
||||
|
||||
if (stripCodeStart) {
|
||||
for (let i = 0; i < startTags.length; i++) {
|
||||
for (var i = 0; i < startTags.length; i++) {
|
||||
index = value.lastIndexOf(startTags[i]);
|
||||
if (index >= 0) {
|
||||
const tagLength = startTags[i].length;
|
||||
var tagLength = startTags[i].length;
|
||||
|
||||
value = value.substring(index + tagLength);
|
||||
if (startTags[i].lastIndexOf(startTagsEnd) !== tagLength) {
|
||||
|
@ -1309,9 +1310,9 @@ phpbb.alertTime = 100;
|
|||
* @param {string} text Text to append
|
||||
*/
|
||||
function appendText(text) {
|
||||
const start = textarea.selectionStart;
|
||||
const end = textarea.selectionEnd;
|
||||
const { value } = textarea;
|
||||
var start = textarea.selectionStart;
|
||||
var end = textarea.selectionEnd;
|
||||
var value = textarea.value;
|
||||
|
||||
textarea.value = value.substr(0, start) + text + value.substr(end);
|
||||
textarea.selectionStart = start + text.length;
|
||||
|
@ -1319,7 +1320,7 @@ phpbb.alertTime = 100;
|
|||
}
|
||||
|
||||
$(textarea).data('code-editor', true).on('keydown', event => {
|
||||
const key = event.keyCode || event.which;
|
||||
var key = event.keyCode || event.which;
|
||||
|
||||
// intercept tabs
|
||||
if (key === keymap.TAB
|
||||
|
@ -1337,8 +1338,8 @@ phpbb.alertTime = 100;
|
|||
// intercept new line characters
|
||||
if (key === keymap.ENTER) {
|
||||
if (inTag()) {
|
||||
const lastLine = getLastLine(true);
|
||||
const code = String(/^\s*/g.exec(lastLine));
|
||||
var lastLine = getLastLine(true);
|
||||
var code = String(/^\s*/g.exec(lastLine));
|
||||
|
||||
if (code.length > 0) {
|
||||
appendText('\n' + code);
|
||||
|
@ -1389,11 +1390,11 @@ phpbb.alertTime = 100;
|
|||
* This handler is used by phpBB.registerDropdown() and other functions
|
||||
*/
|
||||
phpbb.toggleDropdown = function(event_) {
|
||||
const $this = $(this);
|
||||
const options = $this.data('dropdown-options');
|
||||
const { parent } = options;
|
||||
const visible = parent.hasClass('dropdown-visible');
|
||||
let direction;
|
||||
var $this = $(this);
|
||||
var options = $this.data('dropdown-options');
|
||||
var parent = options.parent;
|
||||
var visible = parent.hasClass('dropdown-visible');
|
||||
var direction;
|
||||
|
||||
if (!visible) {
|
||||
// Prevent link default action
|
||||
|
@ -1404,8 +1405,8 @@ phpbb.alertTime = 100;
|
|||
|
||||
// Figure out direction of dropdown
|
||||
direction = options.direction;
|
||||
let { verticalDirection } = options;
|
||||
const offset = $this.offset();
|
||||
var verticalDirection = options.verticalDirection;
|
||||
var offset = $this.offset();
|
||||
|
||||
if (direction === 'auto') {
|
||||
if (($(window).width() - $this.outerWidth(true)) / 2 > offset.left) {
|
||||
|
@ -1419,8 +1420,8 @@ phpbb.alertTime = 100;
|
|||
.toggleClass(options.rightClass, direction === 'right');
|
||||
|
||||
if (verticalDirection === 'auto') {
|
||||
const height = $(window).height();
|
||||
const top = offset.top - $(window).scrollTop();
|
||||
var height = $(window).height();
|
||||
var top = offset.top - $(window).scrollTop();
|
||||
|
||||
verticalDirection = (top < height * 0.7) ? 'down' : 'up';
|
||||
}
|
||||
|
@ -1436,10 +1437,10 @@ phpbb.alertTime = 100;
|
|||
// Check dimensions when showing dropdown
|
||||
// !visible because variable shows state of dropdown before it was toggled
|
||||
if (!visible) {
|
||||
const windowWidth = $(window).width();
|
||||
var windowWidth = $(window).width();
|
||||
|
||||
options.dropdown.find('.dropdown-contents').each(function() {
|
||||
const $this = $(this);
|
||||
var $this = $(this);
|
||||
|
||||
$this.css({
|
||||
marginLeft: 0,
|
||||
|
@ -1448,8 +1449,8 @@ phpbb.alertTime = 100;
|
|||
maxWidth: (windowWidth - 4) + 'px',
|
||||
});
|
||||
|
||||
const offset = $this.offset().left;
|
||||
const width = $this.outerWidth(true);
|
||||
var offset = $this.offset().left;
|
||||
var width = $this.outerWidth(true);
|
||||
|
||||
if (offset < 2) {
|
||||
$this.css('left', (2 - offset) + 'px');
|
||||
|
@ -1460,22 +1461,22 @@ phpbb.alertTime = 100;
|
|||
// Check whether the vertical scrollbar is present.
|
||||
$this.toggleClass('dropdown-nonscroll', this.scrollHeight === $this.innerHeight());
|
||||
});
|
||||
const freeSpace = parent.offset().left - 4;
|
||||
var freeSpace = parent.offset().left - 4;
|
||||
|
||||
if (direction === 'left') {
|
||||
options.dropdown.css('margin-left', '-' + freeSpace + 'px');
|
||||
|
||||
// Try to position the notification dropdown correctly in RTL-responsive mode
|
||||
if (options.dropdown.hasClass('dropdown-extended')) {
|
||||
let contentWidth;
|
||||
const fullFreeSpace = freeSpace + parent.outerWidth();
|
||||
var contentWidth;
|
||||
var fullFreeSpace = freeSpace + parent.outerWidth();
|
||||
|
||||
options.dropdown.find('.dropdown-contents').each(function() {
|
||||
contentWidth = parseInt($(this).outerWidth(), 10);
|
||||
$(this).css({ marginLeft: 0, left: 0 });
|
||||
});
|
||||
|
||||
const maxOffset = Math.min(contentWidth, fullFreeSpace) + 'px';
|
||||
var maxOffset = Math.min(contentWidth, fullFreeSpace) + 'px';
|
||||
options.dropdown.css({
|
||||
width: maxOffset,
|
||||
marginLeft: -maxOffset,
|
||||
|
@ -1490,7 +1491,7 @@ phpbb.alertTime = 100;
|
|||
if (arguments.length > 0) {
|
||||
try {
|
||||
// eslint-disable-next-line prefer-rest-params
|
||||
const e = arguments[0];
|
||||
var e = arguments[0];
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
} catch { }
|
||||
|
@ -1516,7 +1517,7 @@ phpbb.alertTime = 100;
|
|||
* @param {Object} options List of options. Optional.
|
||||
*/
|
||||
phpbb.registerDropdown = function(toggle, dropdown, options) {
|
||||
let ops = {
|
||||
var ops = {
|
||||
parent: toggle.parent(), // Parent item to add classes to
|
||||
direction: 'auto', // Direction of dropdown menu. Possible values: auto, left, right
|
||||
verticalDirection: 'auto', // Vertical direction. Possible values: auto, up, down
|
||||
|
@ -1549,12 +1550,12 @@ phpbb.alertTime = 100;
|
|||
* @param {int} height Palette cell height.
|
||||
*/
|
||||
phpbb.colorPalette = function(dir, width, height) {
|
||||
let r;
|
||||
let g;
|
||||
let b;
|
||||
const numberList = new Array(6);
|
||||
let color = '';
|
||||
let html = '';
|
||||
var r;
|
||||
var g;
|
||||
var b;
|
||||
var numberList = new Array(6);
|
||||
var color = '';
|
||||
var html = '';
|
||||
|
||||
numberList[0] = '00';
|
||||
numberList[1] = '40';
|
||||
|
@ -1562,7 +1563,7 @@ phpbb.alertTime = 100;
|
|||
numberList[3] = 'BF';
|
||||
numberList[4] = 'FF';
|
||||
|
||||
const tableClass = (dir === 'h') ? 'horizontal-palette' : 'vertical-palette';
|
||||
var tableClass = (dir === 'h') ? 'horizontal-palette' : 'vertical-palette';
|
||||
html += '<table class="not-responsive colour-palette ' + tableClass + '" style="width: auto;">';
|
||||
|
||||
for (r = 0; r < 5; r++) {
|
||||
|
@ -1604,10 +1605,10 @@ phpbb.alertTime = 100;
|
|||
*/
|
||||
phpbb.registerPalette = function(el) {
|
||||
const orientation = el.attr('data-color-palette') || el.attr('data-orientation'); // data-orientation kept for backwards compat.
|
||||
const height = el.attr('data-height');
|
||||
const width = el.attr('data-width');
|
||||
const target = el.attr('data-target');
|
||||
const bbcode = el.attr('data-bbcode');
|
||||
var height = el.attr('data-height');
|
||||
var width = el.attr('data-width');
|
||||
var target = el.attr('data-target');
|
||||
var bbcode = el.attr('data-bbcode');
|
||||
|
||||
// Insert the palette HTML into the container.
|
||||
el.html(phpbb.colorPalette(orientation, width, height));
|
||||
|
@ -1620,7 +1621,7 @@ phpbb.alertTime = 100;
|
|||
|
||||
// Attach event handler when a palette cell is clicked.
|
||||
$(el).on('click', 'a', function(e) {
|
||||
const color = $(this).attr('data-color');
|
||||
var color = $(this).attr('data-color');
|
||||
|
||||
if (bbcode) {
|
||||
bbfontstyle('[color=#' + color + ']', '[/color]');
|
||||
|
@ -1646,9 +1647,9 @@ phpbb.alertTime = 100;
|
|||
type = 'block';
|
||||
}
|
||||
|
||||
const $element = $('#' + id);
|
||||
var $element = $('#' + id);
|
||||
|
||||
const display = $element.css('display');
|
||||
var display = $element.css('display');
|
||||
if (!action) {
|
||||
action = (display === '' || display === type) ? -1 : 1;
|
||||
}
|
||||
|
@ -1664,8 +1665,8 @@ phpbb.alertTime = 100;
|
|||
*/
|
||||
phpbb.toggleSelectSettings = function(el) {
|
||||
el.children().each(function() {
|
||||
const $this = $(this);
|
||||
const $setting = $($this.data('toggle-setting'));
|
||||
var $this = $(this);
|
||||
var $setting = $($this.data('toggle-setting'));
|
||||
$setting.toggle($this.is(':selected'));
|
||||
|
||||
// Disable any input elements that are not visible right now
|
||||
|
@ -1685,11 +1686,11 @@ phpbb.alertTime = 100;
|
|||
* @returns function
|
||||
*/
|
||||
phpbb.getFunctionByName = function(functionName) {
|
||||
const namespaces = functionName.split('.');
|
||||
const func = namespaces.pop();
|
||||
let context = window;
|
||||
var namespaces = functionName.split('.');
|
||||
var func = namespaces.pop();
|
||||
var context = window;
|
||||
|
||||
for (let i = 0; i < namespaces.length; i++) {
|
||||
for (var i = 0; i < namespaces.length; i++) {
|
||||
context = context[namespaces[i]];
|
||||
}
|
||||
|
||||
|
@ -1725,17 +1726,17 @@ phpbb.alertTime = 100;
|
|||
* Register page dropdowns.
|
||||
*/
|
||||
phpbb.registerPageDropdowns = function() {
|
||||
const $body = $('body');
|
||||
var $body = $('body');
|
||||
|
||||
$body.find('.dropdown-container').each(function() {
|
||||
const $this = $(this);
|
||||
let $trigger = $this.find('.dropdown-trigger:first');
|
||||
let $contents = $this.find('.dropdown');
|
||||
const options = {
|
||||
var $this = $(this);
|
||||
var $trigger = $this.find('.dropdown-trigger:first');
|
||||
var $contents = $this.find('.dropdown');
|
||||
var options = {
|
||||
direction: 'auto',
|
||||
verticalDirection: 'auto',
|
||||
};
|
||||
let data;
|
||||
var data;
|
||||
|
||||
if (!$trigger.length) {
|
||||
data = $this.attr('data-dropdown-trigger');
|
||||
|
@ -1772,7 +1773,7 @@ phpbb.alertTime = 100;
|
|||
|
||||
// Hide active dropdowns when click event happens outside
|
||||
$body.click(e => {
|
||||
const $parents = $(e.target).parents();
|
||||
var $parents = $(e.target).parents();
|
||||
if (!$parents.is(phpbb.dropdownVisibleContainers)) {
|
||||
$(phpbb.dropdownHandles).each(phpbb.toggleDropdown);
|
||||
}
|
||||
|
@ -1784,7 +1785,7 @@ phpbb.alertTime = 100;
|
|||
*/
|
||||
phpbb.lazyLoadAvatars = () => {
|
||||
$('.avatar[data-src]').each(function() {
|
||||
const $avatar = $(this);
|
||||
var $avatar = $(this);
|
||||
|
||||
$avatar
|
||||
.attr('src', $avatar.data('src'))
|
||||
|
@ -1922,7 +1923,7 @@ phpbb.alertTime = 100;
|
|||
|
||||
// Hide settings that are not selected via select element.
|
||||
$('select[data-togglable-settings]').each(function() {
|
||||
const $this = $(this);
|
||||
var $this = $(this);
|
||||
|
||||
$this.change(() => {
|
||||
phpbb.toggleSelectSettings($this);
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
/* eslint camelcase: 0 */
|
||||
/* eslint no-undef: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
/* eslint no-var: 0 */
|
||||
|
||||
var form_name = 'postform';
|
||||
var text_name = 'message';
|
||||
|
||||
/**
|
||||
* bbCode control by subBlue design [ www.subBlue.com ]
|
||||
|
@ -9,25 +13,25 @@
|
|||
*/
|
||||
|
||||
// Startup variables
|
||||
const imageTag = false;
|
||||
let theSelection = false;
|
||||
const bbcodeEnabled = true;
|
||||
var imageTag = false;
|
||||
var theSelection = false;
|
||||
var bbcodeEnabled = true;
|
||||
|
||||
// Check for Browser & Platform for PC & IE specific bits
|
||||
// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
|
||||
const clientPC = navigator.userAgent.toLowerCase(); // Get client info
|
||||
const clientVer = parseInt(navigator.appVersion, 10); // Get browser version
|
||||
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
|
||||
var clientVer = parseInt(navigator.appVersion, 10); // Get browser version
|
||||
|
||||
const is_ie = ((clientPC.indexOf('msie') !== -1) && (clientPC.indexOf('opera') === -1));
|
||||
const is_win = ((clientPC.indexOf('win') !== -1) || (clientPC.indexOf('16bit') !== -1));
|
||||
let baseHeight;
|
||||
var is_ie = ((clientPC.indexOf('msie') !== -1) && (clientPC.indexOf('opera') === -1));
|
||||
var is_win = ((clientPC.indexOf('win') !== -1) || (clientPC.indexOf('16bit') !== -1));
|
||||
var baseHeight;
|
||||
|
||||
/**
|
||||
* Fix a bug involving the TextRange object. From
|
||||
* http://www.frostjedi.com/terra/scripts/demo/caretBug.html
|
||||
*/
|
||||
function initInsertions() {
|
||||
let doc;
|
||||
var doc;
|
||||
|
||||
if (document.forms[form_name]) {
|
||||
doc = document;
|
||||
|
@ -35,7 +39,7 @@ function initInsertions() {
|
|||
doc = opener.document;
|
||||
}
|
||||
|
||||
const textarea = doc.forms[form_name].elements[text_name];
|
||||
var textarea = doc.forms[form_name].elements[text_name];
|
||||
|
||||
if (is_ie && typeof (baseHeight) !== 'number') {
|
||||
textarea.focus();
|
||||
|
@ -65,7 +69,7 @@ function bbstyle(bbnumber) {
|
|||
function bbfontstyle(bbopen, bbclose) {
|
||||
theSelection = false;
|
||||
|
||||
const textarea = document.forms[form_name].elements[text_name];
|
||||
var textarea = document.forms[form_name].elements[text_name];
|
||||
|
||||
textarea.focus();
|
||||
|
||||
|
@ -88,8 +92,8 @@ function bbfontstyle(bbopen, bbclose) {
|
|||
}
|
||||
|
||||
// The new position for the cursor after adding the bbcode
|
||||
const caret_pos = getCaretPosition(textarea).start;
|
||||
const new_pos = caret_pos + bbopen.length;
|
||||
var caret_pos = getCaretPosition(textarea).start;
|
||||
var new_pos = caret_pos + bbopen.length;
|
||||
|
||||
// Open tag
|
||||
insert_text(bbopen + bbclose);
|
||||
|
@ -101,7 +105,7 @@ function bbfontstyle(bbopen, bbclose) {
|
|||
textarea.selectionEnd = new_pos;
|
||||
} else if (document.selection) {
|
||||
// IE
|
||||
const range = textarea.createTextRange();
|
||||
var range = textarea.createTextRange();
|
||||
range.move('character', new_pos);
|
||||
range.select();
|
||||
storeCaret(textarea);
|
||||
|
@ -114,7 +118,7 @@ function bbfontstyle(bbopen, bbclose) {
|
|||
* Insert text at position
|
||||
*/
|
||||
function insert_text(text, spaces, popup) {
|
||||
let textarea;
|
||||
var textarea;
|
||||
|
||||
if (popup) {
|
||||
textarea = opener.document.forms[form_name].elements[text_name];
|
||||
|
@ -129,8 +133,8 @@ function insert_text(text, spaces, popup) {
|
|||
// Since IE9, IE also has textarea.selectionStart, but it still needs to be treated the old way.
|
||||
// Therefore we simply add a !is_ie here until IE fixes the text-selection completely.
|
||||
if (!isNaN(textarea.selectionStart) && !is_ie) {
|
||||
const sel_start = textarea.selectionStart;
|
||||
const sel_end = textarea.selectionEnd;
|
||||
var sel_start = textarea.selectionStart;
|
||||
var sel_end = textarea.selectionEnd;
|
||||
|
||||
mozWrap(textarea, text, '');
|
||||
textarea.selectionStart = sel_start + text.length;
|
||||
|
@ -141,7 +145,7 @@ function insert_text(text, spaces, popup) {
|
|||
storeCaret(textarea);
|
||||
}
|
||||
|
||||
const caret_pos = textarea.caretPos;
|
||||
var caret_pos = textarea.caretPos;
|
||||
caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) === ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text;
|
||||
} else {
|
||||
textarea.value += text;
|
||||
|
@ -164,10 +168,10 @@ function attachInline(index, filename) {
|
|||
* Add quote text to message
|
||||
*/
|
||||
function addquote(post_id, username, l_wrote, attributes) {
|
||||
const message_name = 'message_' + post_id;
|
||||
let theSelection = '';
|
||||
let divarea = false;
|
||||
let i;
|
||||
var message_name = 'message_' + post_id;
|
||||
var theSelection = '';
|
||||
var divarea = false;
|
||||
var i;
|
||||
|
||||
if (l_wrote === undefined) {
|
||||
// Backwards compatibility
|
||||
|
@ -217,7 +221,7 @@ function addquote(post_id, username, l_wrote, attributes) {
|
|||
insert_text(generateQuote(theSelection, attributes));
|
||||
} else {
|
||||
insert_text(username + ' ' + l_wrote + ':\n');
|
||||
const lines = split_lines(theSelection);
|
||||
var lines = split_lines(theSelection);
|
||||
for (i = 0; i < lines.length; i++) {
|
||||
insert_text('> ' + lines[i] + '\n');
|
||||
}
|
||||
|
@ -240,22 +244,22 @@ function addquote(post_id, username, l_wrote, attributes) {
|
|||
*/
|
||||
function generateQuote(text, attributes) {
|
||||
text = text.replace(/^\s+/, '').replace(/\s+$/, '');
|
||||
let quote = '[quote';
|
||||
var quote = '[quote';
|
||||
if (attributes.author) {
|
||||
// Add the author as the BBCode's default attribute
|
||||
quote += '=' + formatAttributeValue(attributes.author);
|
||||
delete attributes.author;
|
||||
}
|
||||
|
||||
for (const name in attributes) {
|
||||
for (var name in attributes) {
|
||||
if (Object.hasOwn(attributes, name)) {
|
||||
const value = attributes[name];
|
||||
var value = attributes[name];
|
||||
quote += ' ' + name + '=' + formatAttributeValue(value.toString());
|
||||
}
|
||||
}
|
||||
|
||||
quote += ']';
|
||||
const newline = ((quote + text + '[/quote]').length > 80 || text.indexOf('\n') > -1) ? '\n' : '';
|
||||
var newline = ((quote + text + '[/quote]').length > 80 || text.indexOf('\n') > -1) ? '\n' : '';
|
||||
quote += newline + text + newline + '[/quote]';
|
||||
|
||||
return quote;
|
||||
|
@ -277,25 +281,25 @@ function formatAttributeValue(str) {
|
|||
return str;
|
||||
}
|
||||
|
||||
const singleQuoted = '\'' + str.replace(/[\\']/g, '\\$&') + '\'';
|
||||
const doubleQuoted = '"' + str.replace(/[\\"]/g, '\\$&') + '"';
|
||||
var singleQuoted = '\'' + str.replace(/[\\']/g, '\\$&') + '\'';
|
||||
var doubleQuoted = '"' + str.replace(/[\\"]/g, '\\$&') + '"';
|
||||
|
||||
return (singleQuoted.length < doubleQuoted.length) ? singleQuoted : doubleQuoted;
|
||||
}
|
||||
|
||||
function split_lines(text) {
|
||||
const lines = text.split('\n');
|
||||
const splitLines = [];
|
||||
let j = 0;
|
||||
let i;
|
||||
var lines = text.split('\n');
|
||||
var splitLines = [];
|
||||
var j = 0;
|
||||
var i;
|
||||
|
||||
for (i = 0; i < lines.length; i++) {
|
||||
if (lines[i].length <= 80) {
|
||||
splitLines[j] = lines[i];
|
||||
j++;
|
||||
} else {
|
||||
let line = lines[i];
|
||||
let splitAt;
|
||||
var line = lines[i];
|
||||
var splitAt;
|
||||
do {
|
||||
splitAt = line.indexOf(' ', 80);
|
||||
|
||||
|
@ -319,14 +323,14 @@ function split_lines(text) {
|
|||
* From http://www.massless.org/mozedit/
|
||||
*/
|
||||
function mozWrap(txtarea, open, close) {
|
||||
const selLength = (typeof (txtarea.textLength) === 'undefined') ? txtarea.value.length : txtarea.textLength;
|
||||
const selStart = txtarea.selectionStart;
|
||||
const selEnd = txtarea.selectionEnd;
|
||||
const { scrollTop } = txtarea;
|
||||
var selLength = (typeof (txtarea.textLength) === 'undefined') ? txtarea.value.length : txtarea.textLength;
|
||||
var selStart = txtarea.selectionStart;
|
||||
var selEnd = txtarea.selectionEnd;
|
||||
var scrollTop = txtarea.scrollTop;
|
||||
|
||||
const s1 = (txtarea.value).substring(0, selStart);
|
||||
const s2 = (txtarea.value).substring(selStart, selEnd);
|
||||
const s3 = (txtarea.value).substring(selEnd, selLength);
|
||||
var s1 = (txtarea.value).substring(0, selStart);
|
||||
var s2 = (txtarea.value).substring(selStart, selEnd);
|
||||
var s3 = (txtarea.value).substring(selEnd, selLength);
|
||||
|
||||
txtarea.value = s1 + open + s2 + close + s3;
|
||||
txtarea.selectionStart = selStart + open.length;
|
||||
|
@ -348,16 +352,16 @@ function storeCaret(textEl) {
|
|||
/**
|
||||
* Caret Position object
|
||||
*/
|
||||
function CaretPosition() {
|
||||
const start = null;
|
||||
const end = null;
|
||||
function caretPosition() {
|
||||
var start = null;
|
||||
var end = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the caret position in an textarea
|
||||
*/
|
||||
function getCaretPosition(txtarea) {
|
||||
const caretPos = new CaretPosition();
|
||||
var caretPos = new caretPosition();
|
||||
|
||||
// simple Gecko/Opera way
|
||||
if (txtarea.selectionStart || txtarea.selectionStart === 0) {
|
||||
|
@ -366,14 +370,14 @@ function getCaretPosition(txtarea) {
|
|||
} else if (document.selection) {
|
||||
// dirty and slow IE way
|
||||
// get current selection
|
||||
const range = document.selection.createRange();
|
||||
var range = document.selection.createRange();
|
||||
|
||||
// a new selection of the whole textarea
|
||||
const range_all = document.body.createTextRange();
|
||||
var range_all = document.body.createTextRange();
|
||||
range_all.moveToElementText(txtarea);
|
||||
|
||||
// calculate selection start point by moving beginning of range_all to beginning of range
|
||||
let sel_start;
|
||||
var sel_start;
|
||||
for (sel_start = 0; range_all.compareEndPoints('StartToStart', range) < 0; sel_start++) {
|
||||
range_all.moveStart('character', 1);
|
||||
}
|
||||
|
|
|
@ -3,21 +3,23 @@
|
|||
*/
|
||||
|
||||
/* eslint no-prototype-builtins: 0 */
|
||||
/* eslint no-var: 0 */
|
||||
|
||||
(function($) { // Avoid conflicts with other libraries
|
||||
'use strict';
|
||||
|
||||
// Installer variables
|
||||
let pollTimer = null;
|
||||
let nextReadPosition = 0;
|
||||
let progressBarTriggered = false;
|
||||
let progressTimer = null;
|
||||
let currentProgress = 0;
|
||||
let refreshRequested = false;
|
||||
let transmissionOver = false;
|
||||
let statusCount = 0;
|
||||
var pollTimer = null;
|
||||
var nextReadPosition = 0;
|
||||
var progressBarTriggered = false;
|
||||
var progressTimer = null;
|
||||
var currentProgress = 0;
|
||||
var refreshRequested = false;
|
||||
var transmissionOver = false;
|
||||
var statusCount = 0;
|
||||
|
||||
// Template related variables
|
||||
const $contentWrapper = $('.install-body').find('.main');
|
||||
var $contentWrapper = $('.install-body').find('.main');
|
||||
|
||||
// Intercept form submits
|
||||
interceptFormSubmit($('#install_install'));
|
||||
|
@ -43,15 +45,15 @@
|
|||
*/
|
||||
function addMessage(type, messages) {
|
||||
// Get message containers
|
||||
const $errorContainer = $('#error-container');
|
||||
const $warningContainer = $('#warning-container');
|
||||
const $logContainer = $('#log-container');
|
||||
var $errorContainer = $('#error-container');
|
||||
var $warningContainer = $('#warning-container');
|
||||
var $logContainer = $('#log-container');
|
||||
|
||||
let $title;
|
||||
let $description;
|
||||
let $msgElement;
|
||||
const arraySize = messages.length;
|
||||
for (let i = 0; i < arraySize; i++) {
|
||||
var $title;
|
||||
var $description;
|
||||
var $msgElement;
|
||||
var arraySize = messages.length;
|
||||
for (var i = 0; i < arraySize; i++) {
|
||||
$msgElement = $('<div />');
|
||||
$title = $('<strong />');
|
||||
$title.text(messages[i].title);
|
||||
|
@ -84,13 +86,13 @@
|
|||
* Render a download box
|
||||
*/
|
||||
function addDownloadBox(downloadArray) {
|
||||
const $downloadContainer = $('#download-wrapper');
|
||||
let $downloadBox;
|
||||
let $title;
|
||||
let $content;
|
||||
let $link;
|
||||
var $downloadContainer = $('#download-wrapper');
|
||||
var $downloadBox;
|
||||
var $title;
|
||||
var $content;
|
||||
var $link;
|
||||
|
||||
for (let i = 0; i < downloadArray.length; i++) {
|
||||
for (var i = 0; i < downloadArray.length; i++) {
|
||||
$downloadBox = $('<div />');
|
||||
$downloadBox.addClass('download-box');
|
||||
|
||||
|
@ -118,7 +120,7 @@
|
|||
* Render update files' status
|
||||
*/
|
||||
function addUpdateFileStatus(fileStatus) {
|
||||
const $statusContainer = $('#file-status-wrapper');
|
||||
var $statusContainer = $('#file-status-wrapper');
|
||||
$statusContainer.html(fileStatus);
|
||||
}
|
||||
|
||||
|
@ -128,9 +130,9 @@
|
|||
* @param formHtml
|
||||
*/
|
||||
function addForm(formHtml) {
|
||||
const $formContainer = $('#form-wrapper');
|
||||
var $formContainer = $('#form-wrapper');
|
||||
$formContainer.html(formHtml);
|
||||
const $form = $('#install_install');
|
||||
var $form = $('#install_install');
|
||||
interceptFormSubmit($form);
|
||||
}
|
||||
|
||||
|
@ -140,16 +142,16 @@
|
|||
* @param navObj
|
||||
*/
|
||||
function updateNavbarStatus(navObj) {
|
||||
let navID;
|
||||
let $stage;
|
||||
let $stageListItem;
|
||||
const $active = $('#activemenu');
|
||||
var navID;
|
||||
var $stage;
|
||||
var $stageListItem;
|
||||
var $active = $('#activemenu');
|
||||
|
||||
if (navObj.hasOwnProperty('finished')) {
|
||||
// This should be an Array
|
||||
const navItems = navObj.finished;
|
||||
var navItems = navObj.finished;
|
||||
|
||||
for (let i = 0; i < navItems.length; i++) {
|
||||
for (var i = 0; i < navItems.length; i++) {
|
||||
navID = 'installer-stage-' + navItems[i];
|
||||
$stage = $('#' + navID);
|
||||
$stageListItem = $stage.parent();
|
||||
|
@ -181,16 +183,16 @@
|
|||
* @param progressObject
|
||||
*/
|
||||
function setProgress(progressObject) {
|
||||
let $statusText;
|
||||
let $progressBar;
|
||||
let $progressText;
|
||||
let $progressFiller;
|
||||
let $progressFillerText;
|
||||
var $statusText;
|
||||
var $progressBar;
|
||||
var $progressText;
|
||||
var $progressFiller;
|
||||
var $progressFillerText;
|
||||
|
||||
if (progressObject.task_name.length) {
|
||||
if (!progressBarTriggered) {
|
||||
// Create progress bar
|
||||
const $progressBarWrapper = $('#progress-bar-container');
|
||||
var $progressBarWrapper = $('#progress-bar-container');
|
||||
|
||||
// Create progress bar elements
|
||||
$progressBar = $('<div />');
|
||||
|
@ -240,9 +242,9 @@
|
|||
|
||||
// Set cookies
|
||||
function setCookies(cookies) {
|
||||
let cookie;
|
||||
var cookie;
|
||||
|
||||
for (let i = 0; i < cookies.length; i++) {
|
||||
for (var i = 0; i < cookies.length; i++) {
|
||||
// Set cookie name and value
|
||||
cookie = encodeURIComponent(cookies[i].name) + '=' + encodeURIComponent(cookies[i].value);
|
||||
// Set path
|
||||
|
@ -256,7 +258,7 @@
|
|||
if (useAjax) {
|
||||
resetPolling();
|
||||
|
||||
const xhReq = createXhrObject();
|
||||
var xhReq = createXhrObject();
|
||||
xhReq.open('GET', url, true);
|
||||
xhReq.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
|
||||
xhReq.send();
|
||||
|
@ -274,7 +276,7 @@
|
|||
*/
|
||||
function parseMessage(messageJSON) {
|
||||
$('#loading_indicator').css('display', 'none');
|
||||
let responseObject;
|
||||
var responseObject;
|
||||
|
||||
try {
|
||||
responseObject = JSON.parse(messageJSON);
|
||||
|
@ -365,14 +367,14 @@
|
|||
setTimeout(queryInstallerStatus, 5000);
|
||||
} else {
|
||||
$('#loading_indicator').css('display', 'none');
|
||||
addMessage('error',
|
||||
[ {
|
||||
addMessage('error', [
|
||||
{
|
||||
// eslint-disable-next-line no-undef
|
||||
title: installLang.title,
|
||||
// eslint-disable-next-line no-undef
|
||||
description: installLang.msg,
|
||||
} ],
|
||||
);
|
||||
},
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -380,9 +382,9 @@
|
|||
* Queries the installer's status
|
||||
*/
|
||||
function queryInstallerStatus() {
|
||||
let url = $(location).attr('pathname');
|
||||
let lookUp = 'install/app.php';
|
||||
let position = url.indexOf(lookUp);
|
||||
var url = $(location).attr('pathname');
|
||||
var lookUp = 'install/app.php';
|
||||
var position = url.indexOf(lookUp);
|
||||
|
||||
if (position === -1) {
|
||||
lookUp = 'install';
|
||||
|
@ -405,12 +407,12 @@
|
|||
* @param xhReq XHR object
|
||||
*/
|
||||
function pollContent(xhReq) {
|
||||
const messages = xhReq.responseText;
|
||||
const msgSeparator = '}\n\n';
|
||||
let unprocessed;
|
||||
let messageEndIndex;
|
||||
let endOfMessageIndex;
|
||||
let message;
|
||||
var messages = xhReq.responseText;
|
||||
var msgSeparator = '}\n\n';
|
||||
var unprocessed;
|
||||
var messageEndIndex;
|
||||
var endOfMessageIndex;
|
||||
var message;
|
||||
|
||||
do {
|
||||
unprocessed = messages.substring(nextReadPosition);
|
||||
|
@ -428,7 +430,7 @@
|
|||
$('#loading_indicator').css('display', 'none');
|
||||
resetPolling();
|
||||
|
||||
const timeoutDetected = !transmissionOver;
|
||||
var timeoutDetected = !transmissionOver;
|
||||
|
||||
if (refreshRequested) {
|
||||
refreshRequested = false;
|
||||
|
@ -456,7 +458,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
const $progressBar = $('#progress-bar');
|
||||
var $progressBar = $('#progress-bar');
|
||||
|
||||
currentProgress++;
|
||||
$progressFillerText.css('width', $progressBar.width());
|
||||
|
@ -471,10 +473,10 @@
|
|||
* @param progressLimit
|
||||
*/
|
||||
function incrementProgressBar(progressLimit) {
|
||||
const $progressFiller = $('#progress-bar-filler');
|
||||
const $progressFillerText = $('#progress-bar-filler-text');
|
||||
const $progressText = $('#progress-bar-text');
|
||||
const progressStart = $progressFiller.width() / $progressFiller.offsetParent().width() * 100;
|
||||
var $progressFiller = $('#progress-bar-filler');
|
||||
var $progressFillerText = $('#progress-bar-filler-text');
|
||||
var $progressText = $('#progress-bar-text');
|
||||
var progressStart = $progressFiller.width() / $progressFiller.offsetParent().width() * 100;
|
||||
currentProgress = Math.floor(progressStart);
|
||||
|
||||
clearInterval(progressTimer);
|
||||
|
@ -510,7 +512,7 @@
|
|||
function doRefresh() {
|
||||
resetPolling();
|
||||
|
||||
const xhReq = createXhrObject();
|
||||
var xhReq = createXhrObject();
|
||||
xhReq.open('GET', $(location).attr('pathname'), true);
|
||||
xhReq.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
|
||||
xhReq.send();
|
||||
|
@ -527,47 +529,47 @@
|
|||
// Clear content
|
||||
$contentWrapper.html('');
|
||||
|
||||
const $header = $('<div />');
|
||||
var $header = $('<div />');
|
||||
$header.attr('id', 'header-container');
|
||||
$contentWrapper.append($header);
|
||||
|
||||
const $description = $('<div />');
|
||||
var $description = $('<div />');
|
||||
$description.attr('id', 'description-container');
|
||||
$contentWrapper.append($description);
|
||||
|
||||
const $errorContainer = $('<div />');
|
||||
var $errorContainer = $('<div />');
|
||||
$errorContainer.attr('id', 'error-container');
|
||||
$contentWrapper.append($errorContainer);
|
||||
|
||||
const $warningContainer = $('<div />');
|
||||
var $warningContainer = $('<div />');
|
||||
$warningContainer.attr('id', 'warning-container');
|
||||
$contentWrapper.append($warningContainer);
|
||||
|
||||
const $progressContainer = $('<div />');
|
||||
var $progressContainer = $('<div />');
|
||||
$progressContainer.attr('id', 'progress-bar-container');
|
||||
$contentWrapper.append($progressContainer);
|
||||
|
||||
const $logContainer = $('<div />');
|
||||
var $logContainer = $('<div />');
|
||||
$logContainer.attr('id', 'log-container');
|
||||
$contentWrapper.append($logContainer);
|
||||
|
||||
const $installerContentWrapper = $('<div />');
|
||||
var $installerContentWrapper = $('<div />');
|
||||
$installerContentWrapper.attr('id', 'content-container');
|
||||
$contentWrapper.append($installerContentWrapper);
|
||||
|
||||
const $installerDownloadWrapper = $('<div />');
|
||||
var $installerDownloadWrapper = $('<div />');
|
||||
$installerDownloadWrapper.attr('id', 'download-wrapper');
|
||||
$installerContentWrapper.append($installerDownloadWrapper);
|
||||
|
||||
const $updaterFileStatusWrapper = $('<div />');
|
||||
var $updaterFileStatusWrapper = $('<div />');
|
||||
$updaterFileStatusWrapper.attr('id', 'file-status-wrapper');
|
||||
$installerContentWrapper.append($updaterFileStatusWrapper);
|
||||
|
||||
const $formWrapper = $('<div />');
|
||||
var $formWrapper = $('<div />');
|
||||
$formWrapper.attr('id', 'form-wrapper');
|
||||
$installerContentWrapper.append($formWrapper);
|
||||
|
||||
const $spinner = $('<div />');
|
||||
var $spinner = $('<div />');
|
||||
$spinner.attr('id', 'loading_indicator');
|
||||
$spinner.html(' ');
|
||||
$contentWrapper.append($spinner);
|
||||
|
@ -577,7 +579,7 @@
|
|||
function submitForm($form, $submitBtn) {
|
||||
$form.css('display', 'none');
|
||||
|
||||
const xhReq = createXhrObject();
|
||||
var xhReq = createXhrObject();
|
||||
xhReq.open('POST', $form.attr('action'), true);
|
||||
xhReq.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
|
||||
xhReq.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
|
||||
|
@ -602,7 +604,7 @@
|
|||
* @returns {*}
|
||||
*/
|
||||
function getFormFields($form, $submitBtn) {
|
||||
let formData = $form.serialize();
|
||||
var formData = $form.serialize();
|
||||
formData += ((formData.length) ? '&' : '') + encodeURIComponent($submitBtn.attr('name')) + '=';
|
||||
formData += encodeURIComponent($submitBtn.attr('value'));
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* global phpbb, plupload, attachInline, activateSubPanel */
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-var: 0 */
|
||||
|
||||
plupload.addI18n(phpbb.plupload.i18n);
|
||||
phpbb.plupload.ids = [];
|
||||
|
@ -53,8 +54,8 @@ phpbb.plupload.ids = [];
|
|||
* begin with 'attachment_data['
|
||||
*/
|
||||
phpbb.plupload.clearParams = function() {
|
||||
const obj = phpbb.plupload.uploader.settings.multipart_params;
|
||||
for (const key in obj) {
|
||||
var obj = phpbb.plupload.uploader.settings.multipart_params;
|
||||
for (var key in obj) {
|
||||
if (!Object.prototype.hasOwnProperty.call(obj, key) || key.indexOf('attachment_data[') !== 0) {
|
||||
continue;
|
||||
}
|
||||
|
@ -69,7 +70,7 @@ phpbb.plupload.ids = [];
|
|||
* @param {object} obj
|
||||
*/
|
||||
phpbb.plupload.updateMultipartParams = function(obj) {
|
||||
const { settings } = phpbb.plupload.uploader;
|
||||
var { settings } = phpbb.plupload.uploader;
|
||||
settings.multipart_params = $.extend(settings.multipart_params, obj);
|
||||
};
|
||||
|
||||
|
@ -80,10 +81,10 @@ phpbb.plupload.ids = [];
|
|||
* expected by the server
|
||||
*/
|
||||
phpbb.plupload.getSerializedData = function() {
|
||||
const obj = {};
|
||||
for (let i = 0; i < phpbb.plupload.data.length; i++) {
|
||||
const datum = phpbb.plupload.data[i];
|
||||
for (const key in datum) {
|
||||
var obj = {};
|
||||
for (var i = 0; i < phpbb.plupload.data.length; i++) {
|
||||
var datum = phpbb.plupload.data[i];
|
||||
for (var key in datum) {
|
||||
if (!Object.prototype.hasOwnProperty.call(datum, key)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -93,7 +94,7 @@ phpbb.plupload.ids = [];
|
|||
}
|
||||
|
||||
// Insert form data
|
||||
const $pluploadForm = $(phpbb.plupload.config.form_hook).first();
|
||||
var $pluploadForm = $(phpbb.plupload.config.form_hook).first();
|
||||
obj.creation_time = $pluploadForm.find('input[type=hidden][name="creation_time"]').val();
|
||||
obj.form_token = $pluploadForm.find('input[type=hidden][name="form_token"]').val();
|
||||
|
||||
|
@ -108,7 +109,7 @@ phpbb.plupload.ids = [];
|
|||
* @returns {bool|int} Index of the file if exists, otherwise false.
|
||||
*/
|
||||
phpbb.plupload.getIndex = function(attachId) {
|
||||
const index = $.inArray(Number(attachId), phpbb.plupload.ids);
|
||||
var index = $.inArray(Number(attachId), phpbb.plupload.ids);
|
||||
return index === -1 ? false : index;
|
||||
};
|
||||
|
||||
|
@ -124,7 +125,7 @@ phpbb.plupload.ids = [];
|
|||
phpbb.plupload.data = [];
|
||||
phpbb.plupload.data = data;
|
||||
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
phpbb.plupload.ids.push(Number(data[i].attach_id));
|
||||
}
|
||||
};
|
||||
|
@ -151,7 +152,7 @@ phpbb.plupload.ids = [];
|
|||
* @param {Array} downloadUrl Optional array of download urls to update.
|
||||
*/
|
||||
phpbb.plupload.updateRows = function(downloadUrl) {
|
||||
for (let i = 0; i < phpbb.plupload.ids.length; i++) {
|
||||
for (var i = 0; i < phpbb.plupload.ids.length; i++) {
|
||||
phpbb.plupload.updateRow(i, downloadUrl);
|
||||
}
|
||||
};
|
||||
|
@ -165,7 +166,7 @@ phpbb.plupload.ids = [];
|
|||
* @param {object} file Plupload file object for the new attachment.
|
||||
*/
|
||||
phpbb.plupload.insertRow = function(file) {
|
||||
const row = $(phpbb.plupload.rowTpl);
|
||||
var row = $(phpbb.plupload.rowTpl);
|
||||
|
||||
row.attr('id', file.id);
|
||||
row.find('.file-name').html(plupload.xmlEncode(file.name));
|
||||
|
@ -185,13 +186,13 @@ phpbb.plupload.ids = [];
|
|||
* @param {Array} downloadUrl Optional array of download urls to update.
|
||||
*/
|
||||
phpbb.plupload.updateRow = function(index, downloadUrl) {
|
||||
const attach = phpbb.plupload.data[index];
|
||||
const row = $('[data-attach-id="' + attach.attach_id + '"]');
|
||||
var attach = phpbb.plupload.data[index];
|
||||
var row = $('[data-attach-id="' + attach.attach_id + '"]');
|
||||
|
||||
// Add the link to the file
|
||||
if (typeof downloadUrl !== 'undefined' && typeof downloadUrl[index] !== 'undefined') {
|
||||
const url = downloadUrl[index].replace('&', '&');
|
||||
const link = $('<a></a>');
|
||||
var url = downloadUrl[index].replace('&', '&');
|
||||
var link = $('<a></a>');
|
||||
|
||||
link.attr('href', url).html(attach.real_filename);
|
||||
row.find('.file-name').html(link);
|
||||
|
@ -211,12 +212,12 @@ phpbb.plupload.ids = [];
|
|||
phpbb.plupload.updateHiddenData = function(row, attach, index) {
|
||||
row.find('input[type="hidden"]').remove();
|
||||
|
||||
for (const key in attach) {
|
||||
for (var key in attach) {
|
||||
if (!Object.prototype.hasOwnProperty.call(attach, key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const input = $('<input />')
|
||||
var input = $('<input />')
|
||||
.attr('type', 'hidden')
|
||||
.attr('name', 'attachment_data[' + index + '][' + key + ']')
|
||||
.attr('value', attach[key]);
|
||||
|
@ -236,7 +237,7 @@ phpbb.plupload.ids = [];
|
|||
phpbb.plupload.deleteFile = function(row, attachId) {
|
||||
// If there's no attach id, then the file hasn't been uploaded. Simply delete the row.
|
||||
if (typeof attachId === 'undefined') {
|
||||
const file = phpbb.plupload.uploader.getFile(row.attr('id'));
|
||||
var file = phpbb.plupload.uploader.getFile(row.attr('id'));
|
||||
phpbb.plupload.uploader.removeFile(file);
|
||||
|
||||
row.slideUp(100, () => {
|
||||
|
@ -245,21 +246,21 @@ phpbb.plupload.ids = [];
|
|||
});
|
||||
}
|
||||
|
||||
const index = phpbb.plupload.getIndex(attachId);
|
||||
var index = phpbb.plupload.getIndex(attachId);
|
||||
row.find('.file-status').toggleClass('file-uploaded file-working');
|
||||
|
||||
if (index === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
const fields = {};
|
||||
var fields = {};
|
||||
fields['delete_file[' + index + ']'] = 1;
|
||||
|
||||
const always = function() {
|
||||
var always = function() {
|
||||
row.find('.file-status').removeClass('file-working');
|
||||
};
|
||||
|
||||
const done = function(response) {
|
||||
var done = function(response) {
|
||||
if (typeof response !== 'object') {
|
||||
return;
|
||||
}
|
||||
|
@ -288,7 +289,7 @@ phpbb.plupload.ids = [];
|
|||
phpbb.plupload.handleMaxFilesReached();
|
||||
|
||||
if (row.attr('id')) {
|
||||
const file = phpbb.plupload.uploader.getFile(row.attr('id'));
|
||||
var file = phpbb.plupload.uploader.getFile(row.attr('id'));
|
||||
phpbb.plupload.uploader.removeFile(file);
|
||||
}
|
||||
|
||||
|
@ -329,8 +330,8 @@ phpbb.plupload.ids = [];
|
|||
*/
|
||||
phpbb.plupload.updateBbcode = function(action, index) {
|
||||
const textarea = $('#message', phpbb.plupload.form);
|
||||
let text = textarea.val();
|
||||
const removal = (action === 'removal');
|
||||
var text = textarea.val();
|
||||
var removal = (action === 'removal');
|
||||
|
||||
// Return if the bbcode isn't used at all.
|
||||
if (text.indexOf('[attachment=') === -1) {
|
||||
|
@ -338,21 +339,21 @@ phpbb.plupload.ids = [];
|
|||
}
|
||||
|
||||
function runUpdate(i) {
|
||||
const regex = new RegExp('\\[attachment=' + i + '\\](.*?)\\[\\/attachment\\]', 'g');
|
||||
var regex = new RegExp('\\[attachment=' + i + '\\](.*?)\\[\\/attachment\\]', 'g');
|
||||
text = text.replace(regex, (_, fileName) => {
|
||||
// Remove the bbcode if the file was removed.
|
||||
if (removal && index === i) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const newIndex = i + ((removal) ? -1 : 1);
|
||||
var newIndex = i + ((removal) ? -1 : 1);
|
||||
return '[attachment=' + newIndex + ']' + fileName + '[/attachment]';
|
||||
});
|
||||
}
|
||||
|
||||
// Loop forwards when removing and backwards when adding ensures we don't
|
||||
// corrupt the bbcode index.
|
||||
let i;
|
||||
var i;
|
||||
if (removal) {
|
||||
for (i = index; i < phpbb.plupload.ids.length; i++) {
|
||||
runUpdate(i);
|
||||
|
@ -375,7 +376,7 @@ phpbb.plupload.ids = [];
|
|||
* @returns {Array} The Plupload file objects matching the status.
|
||||
*/
|
||||
phpbb.plupload.getFilesByStatus = function(status) {
|
||||
const files = [];
|
||||
var files = [];
|
||||
|
||||
$.each(phpbb.plupload.uploader.files, (i, file) => {
|
||||
if (file.status === status) {
|
||||
|
@ -438,7 +439,7 @@ phpbb.plupload.ids = [];
|
|||
* @param {string} error Error message to present to the user.
|
||||
*/
|
||||
phpbb.plupload.markQueuedFailed = function(error) {
|
||||
const files = phpbb.plupload.getFilesByStatus(plupload.QUEUED);
|
||||
var files = phpbb.plupload.getFilesByStatus(plupload.QUEUED);
|
||||
|
||||
$.each(files, (i, file) => {
|
||||
$('#' + file.id).find('.file-progress').hide();
|
||||
|
@ -511,14 +512,14 @@ phpbb.plupload.ids = [];
|
|||
}
|
||||
});
|
||||
|
||||
const $fileList = $('#file-list');
|
||||
var $fileList = $('#file-list');
|
||||
|
||||
/**
|
||||
* Insert inline attachment bbcode.
|
||||
*/
|
||||
$fileList.on('click', '.file-inline-bbcode', function(e) {
|
||||
const attachId = $(this).parents('.attach-row').attr('data-attach-id');
|
||||
const index = phpbb.plupload.getIndex(attachId);
|
||||
var attachId = $(this).parents('.attach-row').attr('data-attach-id');
|
||||
var index = phpbb.plupload.getIndex(attachId);
|
||||
|
||||
attachInline(index, phpbb.plupload.data[index].real_filename);
|
||||
e.preventDefault();
|
||||
|
@ -528,8 +529,8 @@ phpbb.plupload.ids = [];
|
|||
* Delete a file.
|
||||
*/
|
||||
$fileList.on('click', '.file-delete', function(e) {
|
||||
const row = $(this).parents('.attach-row');
|
||||
const attachId = row.attr('data-attach-id');
|
||||
var row = $(this).parents('.attach-row');
|
||||
var attachId = row.attr('data-attach-id');
|
||||
|
||||
phpbb.plupload.deleteFile(row, attachId);
|
||||
e.preventDefault();
|
||||
|
@ -590,7 +591,7 @@ phpbb.plupload.ids = [];
|
|||
return;
|
||||
}
|
||||
|
||||
let json = {};
|
||||
var json = {};
|
||||
try {
|
||||
json = $.parseJSON(response.response);
|
||||
} catch {
|
||||
|
@ -637,7 +638,7 @@ phpbb.plupload.ids = [];
|
|||
}
|
||||
|
||||
// Show the file list if there aren't any files currently.
|
||||
const $fileListContainer = $('#file-list-container');
|
||||
var $fileListContainer = $('#file-list-container');
|
||||
if (!$fileListContainer.is(':visible')) {
|
||||
$fileListContainer.show(100);
|
||||
}
|
||||
|
@ -670,9 +671,9 @@ phpbb.plupload.ids = [];
|
|||
* @param {string} response The response string from the server
|
||||
*/
|
||||
phpbb.plupload.uploader.bind('FileUploaded', (up, file, response) => {
|
||||
let json = {};
|
||||
const row = $('#' + file.id);
|
||||
let error;
|
||||
var json = {};
|
||||
var row = $('#' + file.id);
|
||||
var error;
|
||||
|
||||
// Hide the progress indicator.
|
||||
row.find('.file-progress').hide();
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="keywords" content="" />
|
||||
<meta name="description" content="phpBB 3.3.x Changelog" />
|
||||
<meta name="description" content="phpBB Changelog" />
|
||||
<title>phpBB • Changelog</title>
|
||||
|
||||
<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
|
@ -21,7 +21,7 @@
|
|||
|
||||
<div id="doc-description">
|
||||
<a href="../index.php" id="logo"><span class="site_logo"></span></a>
|
||||
<h1>phpBB 3.3.x Changelog</h1>
|
||||
<h1>phpBB Changelog</h1>
|
||||
<p style="display: none;"><a href="#start_here">Skip</a></p>
|
||||
</div>
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
|||
<!-- BEGIN DOCUMENT -->
|
||||
|
||||
<p class="paragraph main-description">
|
||||
This is a non-exhaustive (but still near complete) changelog for phpBB 3.3.x including release candidate versions.
|
||||
This is a non-exhaustive (but still near complete) changelog for phpBB including release candidate versions.
|
||||
Our thanks to all those people who've contributed bug reports and code fixes.
|
||||
</p>
|
||||
|
||||
|
|
|
@ -1,328 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html dir="ltr" lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="keywords" content="" />
|
||||
<meta name="description" content="phpBB 3.3.x frequently asked questions" />
|
||||
<title>phpBB • FAQ</title>
|
||||
|
||||
<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
|
||||
</head>
|
||||
|
||||
<body id="phpbb" class="section-docs">
|
||||
|
||||
<div id="wrap">
|
||||
<a id="top" name="top" accesskey="t"></a>
|
||||
<div id="page-header">
|
||||
<div class="headerbar">
|
||||
<div class="inner">
|
||||
|
||||
<div id="doc-description">
|
||||
<a href="../index.php" id="logo"><span class="site_logo"></span></a>
|
||||
<h1>phpBB 3.3.x FAQ</h1>
|
||||
<p>phpBB 3.3.x frequently asked questions</p>
|
||||
<p style="display: none;"><a href="#start_here">Skip</a></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a name="start_here"></a>
|
||||
|
||||
<div id="page-body">
|
||||
|
||||
<!-- BEGIN DOCUMENT -->
|
||||
|
||||
<p class="paragraph main-description">
|
||||
This is a very basic Frequently Asked Questions (FAQ) page which attempts to answer some of the
|
||||
more commonly asked questions. It is by no means exhaustive and should be used in combination with
|
||||
the 'built-in' User FAQ within phpBB3, the community forums and our IRC channel
|
||||
(see <a href="README.html">README</a> for details).
|
||||
</p>
|
||||
|
||||
<h1>FAQ</h1>
|
||||
|
||||
<div class="paragraph menu">
|
||||
<div class="inner">
|
||||
|
||||
<div class="content">
|
||||
|
||||
<!-- add entry about common UTF8 problems (for example wrong uploading, editing) -->
|
||||
<ul>
|
||||
<li><a href="#install">I am finding phpBB too difficult to install. Will you do it for me?</a></li>
|
||||
<li><a href="#legal">I am having problems with the admin at a certain board, help!</a></li>
|
||||
<li><a href="#legal">A board has ripped off my graphics/software/etc., stop them!</a></li>
|
||||
<li><a href="#legal">A board is dealing in warez/porn/etc., you need to prevent them doing this!</a></li>
|
||||
<li><a href="#legal">I want to sue you because i think you host an illegal board!</a></li>
|
||||
<li><a href="#viewonline">According to viewonline a user is doing/reading something they should not be able to!</a></li>
|
||||
<li><a href="#mail">I keep getting Mail sending errors when I (or my users) post/send PM's/etc.!</a></li>
|
||||
<li><a href="#mail_language">My users are complaining that emails are not in their selected language!</a></li>
|
||||
<li><a href="#avatars">I am unable to upload avatars from my computer, regardless of the settings.</a></li>
|
||||
<li><a href="#gallery_avatars">I just cannot get gallery avatars to appear!</a></li>
|
||||
<li><a href="#permissions">How do I use/set permissions?</a></li>
|
||||
<li><a href="#login_issues">I (or my users) cannot stay logged in to the forum!</a></li>
|
||||
<li><a href="#logout_issues">My users are complaining about being logged out too quickly!</a></li>
|
||||
<li><a href="#not_answered">My question isn't answered here!</a></li>
|
||||
<li><a href="#disclaimer">Copyright and disclaimer</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="install"></a><h2>I am finding phpBB too difficult to install. Will you do it for me?</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="inner">
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>Simple answer, no we will not. We are not being difficult when we say this we are actually trying to help you. phpBB has a reputation for being easy to install, that reputation is we believe well deserved. It is a simple process of unarchiving a single file, uploading the resulting directory/files to their intended location and entering some data in a web based form. The sequence of events, what to type where, etc. is covered in detail in the accompanying <a href="INSTALL.html">INSTALL.html</a> documentation. If you cannot install phpBB the chances are you will be unable to administer or update it.</p>
|
||||
|
||||
<p>There are people, companies (unrelated to your hosting provider), etc. that will install your forum, either for free or for a payment. We do not recommend you make use of these offers. Unless the service is provided by your hosting company you will have to divulge passwords and other sensitive details. If you did not know how to use an ATM would you give a passer-by your bank card and PIN and ask them to show you what to do? No, probably not! The same applies to your hosting account details!</p>
|
||||
|
||||
<p>We think a better solution is for you to carefully read the enclosed documentation, read through our knowledge base at <a href="https://www.phpbb.com/">www.phpbb.com</a> and if necessary ask for help on any thing you get stuck on. However, the decision is yours but please note we may not offer support if we believe you have had the board installed by a third party. In such cases you should direct your questions to that company or person/s.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="legal"></a><h2>I am having problems with the admin at a certain board, help!<br />
|
||||
A board has ripped off my graphics/software/etc., stop them!<br />
|
||||
A board is dealing in warez/porn/etc., you need to prevent them doing this!<br />
|
||||
I want to sue you because i think you host an illegal board!</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="inner">
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>We provide the software, we have absolutely nothing to do with any board that runs it (beyond phpbb.com of course!) and we also do not host any site. The GPL grants the user an unlimited right of use subject to their adherence of that license. Therefore we cannot prevent, dictate, control or otherwise limit the use of phpBB software. So please do not contact us for such matters.</p>
|
||||
|
||||
<p>If you have a problem with a given board please take it up with them, not us. We are not and cannot be held legally responsible for any third party use of this software (much like Microsoft et al cannot be held responsible for the use of Windows in illegal activities, etc.). Additionally we do <strong>not</strong> track the use of phpBB software in any way. So please do not ask us for details on a "given" board we will not be able to help you. If any law firms or lawyers out there send us writs, cease and desist orders, etc. for third party website use of this software we reserve the right to charge for time wasted dealing with such issues...</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="viewonline"></a><h2>According to viewonline a user is doing/reading something they should not be able to!</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="inner">
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>No, they probably are not. phpBB uses sessions to keep track of users as they move between pages. The session information tells us who this user is. Therefore in order to determine what a user can do on a page we first need the session details. Once this data is available we can check whether the user is permitted to do whatever it is they are trying to do. This can result in it appearing as if a user is reading a topic in a forum they should not be able to access. Or perhaps viewing private messages when they are only guests, etc. In practice the user is not doing these things, they are viewing a "You are not permitted to do this" type message. The session data has simply been updated before we were able to determine what the user could or could not do.</p>
|
||||
|
||||
<p>Of course this only applies where permissions have been set correctly!</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="mail"></a><h2>I keep getting Mail sending errors when I (or my users) post/send PM's/etc.!</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="inner">
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>This error will occur if phpBB cannot send mail. phpBB can send email two ways; using the PHP <code>mail()</code> function or directly via SMTP. Some hosting providers limit the <code>mail()</code> function to prevent its use in spamming, others may rename it or limit its functionality. If the <code>mail()</code> function got renamed, you are able to enter the correct name within the administration control panel. In either case you may need to make use of SMTP. This requires that you have access to such a facility, e.g. your hosting provider may provide one (perhaps requiring specific written authorisation), etc. Please see <a href="https://www.phpbb.com/">www.phpbb.com</a> for additional help on this matter.</p>
|
||||
|
||||
<p>If you do require SMTP services please do not ask (on our forums or elsewhere) for someone to provide you with one. Open relays are now things of the past thanks to the unthinking spammers out there. Therefore you are unlikely to find someone willing to offer you (free) services.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="mail_language"></a><h2>My users are complaining that emails are not in their selected language!</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="inner">
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>You must have deleted a language pack or the language pack is incomplete. phpBB will try to send emails in the users selected language. If it cannot find a suitable email template it will switch to the boards default language.</p>
|
||||
|
||||
<!-- additional entry about encoded emails -->
|
||||
|
||||
</div>
|
||||
|
||||
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="avatars"></a><h2>I am unable to upload avatars from my computer, regardless of the settings.</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="inner">
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>There are two possibilities here, the first is you have not created the directory you specified as the storage location for avatars, ie. as specified in the <code>Admin -> General -> Board Configuration -> Avatar settings</code> section. If the directory does not exist uploadeable avatars are automatically disabled. You should create the required directory (ensuring it has global write access or other appropriate permissions to allow the webserver to write files to it).</p>
|
||||
|
||||
<p>The second possibility is that your provider has disabled file_upload support. You should contact your provider and ask them if this is the case. There is not a lot you can do, there are still three other avatar settings left to choose from including uploading via an URL which will work fine.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="gallery_avatars"></a><h2>I just cannot get gallery avatars to appear!</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="inner">
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>phpBB categorises gallery avatars and it does this by reading through folders contained in the location you specified as being the gallery path. For example, if you set the gallery path to <samp>images/avatars/gallery</samp> phpBB will expect to find a series of folders within that path, e.g. <samp>images/avatars/gallery/moviestars</samp>, <samp>images/avatars/gallery/cartoons</samp>, <samp>images/avatars/gallery/misc</samp>, etc. Placing images directly in <samp>images/avatars/gallery/</samp> will result in nothing being listed in your gallery.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="permissions"></a><h2>How do I use/set permissions?</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="inner">
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>Please read the paragraph about permissions in our extensive <a href="https://www.phpbb.com/support/docs/en/3.3/ug/">online documentation</a>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="login_issues"></a><h2>I (or my users) cannot stay logged in to the forum!</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="inner">
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>If you (or your users) are, after attempting a login, being returned to the index (or other page) without appearing to be logged in the most likely problem is incorrect cookie settings. phpBB uses cookies to store a session id and a small amount of user data. For this data to be stored correctly the cookie domain, name, path and secure settings must be correct. You can check this in <code>Admin->General->Server Configuration->Cookie Settings</code>. Typically the cookie domain can be left blank and the cookie path set to <samp>/</samp> (a single forward slash). Do <strong>not</strong> set the cookie as being secure unless your board is running over a secure sockets layer connection, ie. https://</p>
|
||||
|
||||
<p>If you still have problems try setting the cookie domain to your full domain name, e.g. <samp>www.mysystem.tld</samp>, <samp>www.something.mydomain.tld</samp>. You <strong>must</strong> ensure the domain name contains at least two dots or browsers will be unlikely to recognise the cookie, e.g. <samp>.mydomain.com</samp>, <samp>mydomain.com</samp>. Do <strong>not</strong> add http:// or anything else to the domain name!</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="logout_issues"></a><h2>My users are complaining about being logged out too quickly!</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="inner">
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>You can increase the default length of sessions (ie. how long before a users session is considered 'dead') in <code>Admin->General->Server Configuration->Load Settings</code>. Set it to whatever value your users feel comfortable with, remember that security issues may affect your decision (ie. having too long a session may allow non-users to abuse your board should a user forget to logout or otherwise leave a current session on a public workstation).</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="not_answered"></a><h2>My question isn't answered here!</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="inner">
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>Please read our <a href="https://www.phpbb.com/support/docs/en/3.3/ug/">extensive user documentation</a> first, it may just explain what you want to know.</p>
|
||||
|
||||
<p>Feel free to search our community forum for the information you require. <strong>PLEASE DO NOT</strong> post your question without having first used search, chances are someone has already asked and answered your question. You can find our board here:</p>
|
||||
|
||||
<p><a href="https://www.phpbb.com">www.phpbb.com</a></p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="disclaimer"></a><h2>Copyright and disclaimer</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="inner">
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>phpBB is free software, released under the terms of the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License, version 2 (GPL-2.0)</a>. Copyright © <a href="https://www.phpbb.com">phpBB Limited</a>. For full copyright and license information, please see the docs/CREDITS.txt file.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- END DOCUMENT -->
|
||||
|
||||
<div id="page-footer">
|
||||
<div class="version"> </div>
|
||||
</div>
|
||||
</div></div>
|
||||
|
||||
<div>
|
||||
<a id="bottom" accesskey="z"></a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="keywords" content="" />
|
||||
<meta name="description" content="phpBB 3.3.x Installation, updating and conversion information" />
|
||||
<meta name="description" content="phpBB Installation, updating and conversion information" />
|
||||
<title>phpBB • Install</title>
|
||||
|
||||
<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
|
@ -21,8 +21,8 @@
|
|||
|
||||
<div id="doc-description">
|
||||
<a href="../index.php" id="logo"><span class="site_logo"></span></a>
|
||||
<h1>phpBB 3.3.x Install</h1>
|
||||
<p>phpBB 3.3.x Installation, updating and conversion information</p>
|
||||
<h1>phpBB Install</h1>
|
||||
<p>phpBB Installation, updating and conversion information</p>
|
||||
<p style="display: none;"><a href="#start_here">Skip</a></p>
|
||||
</div>
|
||||
|
||||
|
@ -109,7 +109,7 @@
|
|||
<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>Point your web browser to the location where you uploaded the phpBB files with the addition of <code>install/app.php</code> or simply <code>install/</code>, e.g. <code>http://www.example.com/phpBB3/install/app.php</code>, <code>http://www.example.com/forum/install/</code>.</li>
|
||||
<li>Point your web browser to the location where you uploaded the phpBB files with the addition of <code>install/app.php</code> or simply <code>install/</code>, e.g. <code>http://www.example.com/phpBB/install/app.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>phpBB 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>
|
||||
|
@ -191,7 +191,7 @@
|
|||
|
||||
<p>phpBB 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 <code>www.example.com</code> and you placed the phpBB 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/app.php</code> into your browser. When you have done this, you should see the <strong><em>phpBB Introduction</em></strong> 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 phpBB files in the directory <code>/phpBB</code> off your web root you would enter <code>http://www.example.com/phpBB/install/</code> or (alternatively) <code>http://www.example.com/phpBB/install/app.php</code> into your browser. When you have done this, you should see the <strong><em>phpBB Introduction</em></strong> screen appear.</p>
|
||||
|
||||
<h4>Introduction:</h4>
|
||||
|
||||
|
@ -313,7 +313,7 @@
|
|||
<li>Go to the <a href="https://www.phpbb.com/downloads/">downloads page</a> and download the latest update package listed there, matching your current version.</li>
|
||||
<li>Upload the uncompressed archive contents to your phpBB installation - only the <code>install/</code> and <code>vendor/</code> folders are required. Upload these folders in their entirety, retaining the file structure.</li>
|
||||
<li>After the install folder is present, phpBB will go offline automatically.</li>
|
||||
<li>Point your browser to the install directory, for example <code>http://www.example.com/phpBB3/install/</code></li>
|
||||
<li>Point your browser to the install directory, for example <code>http://www.example.com/phpBB/install/</code></li>
|
||||
<li>Choose the "Update" Tab and follow the instructions</li>
|
||||
</ul>
|
||||
|
||||
|
@ -407,7 +407,7 @@
|
|||
|
||||
<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; in case your cookie path needs 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 phpBB 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>
|
||||
|
||||
|
@ -417,7 +417,7 @@
|
|||
|
||||
<p><strong>Password conversion</strong> Due to the utf-8 based handling of passwords in phpBB 3.x, 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 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 phpBB 3.x 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 phpBB installation is located at <code>http://www.yourdomain.com/phpBB</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>
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="keywords" content="" />
|
||||
<meta name="description" content="phpBB 3.3.x Readme" />
|
||||
<meta name="description" content="phpBB Readme" />
|
||||
<title>phpBB • Readme</title>
|
||||
|
||||
<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
|
@ -21,7 +21,7 @@
|
|||
|
||||
<div id="doc-description">
|
||||
<a href="../index.php" id="logo"><span class="site_logo"></span></a>
|
||||
<h1>phpBB 3.3.x Readme</h1>
|
||||
<h1>phpBB Readme</h1>
|
||||
<p style="display: none;"><a href="#start_here">Skip</a></p>
|
||||
</div>
|
||||
|
||||
|
@ -146,7 +146,7 @@
|
|||
|
||||
<p>For more information about styles, please see: <a href="https://www.phpbb.com/styles/">https://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. 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><strong>Please note</strong> that 3rd party styles downloaded for older versions of phpBB might <strong>not</strong> work in the latest phpBB. 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 <code>styles/</code> directory. You then need to visit <code>Administration Control Panel -> Customise tab -> Style management -> Install Styles</code> where you should see the new style available. Click "Install style" to install the style.</p>
|
||||
|
||||
|
@ -250,7 +250,7 @@
|
|||
|
||||
<p>The phpBB developers use a bug tracking system to store, list and manage all reported bugs, it can be found at the location listed below. Please <strong>DO NOT</strong> post bug reports to our forums. In addition please <strong>DO NOT</strong> use the bug tracker for support requests. Posting such a request will only see you directed to the support forums (while taking time away from working on real bugs).</p>
|
||||
|
||||
<p><a href="http://tracker.phpbb.com/browse/PHPBB3">http://tracker.phpbb.com/browse/PHPBB3</a></p>
|
||||
<p><a href="http://tracker.phpbb.com/browse/PHPBB">http://tracker.phpbb.com/browse/PHPBB</a></p>
|
||||
|
||||
<p>While we very much appreciate receiving bug reports (the more reports the more stable phpBB will be) we ask you carry out a few steps before adding new entries:</p>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
The original "prosilver" theme for phpBB3
|
||||
The original "prosilver" theme for phpBB
|
||||
Created by subBlue design :: http://www.subBlue.com
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,293 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html dir="ltr" lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="keywords" content="" />
|
||||
<meta name="description" content="This is an explanation of how to use the phpBB auth/acl API" />
|
||||
<title>phpBB3 • Auth API</title>
|
||||
|
||||
<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
|
||||
</head>
|
||||
|
||||
<body id="phpbb" class="section-docs">
|
||||
|
||||
<div id="wrap">
|
||||
<a id="top" name="top" accesskey="t"></a>
|
||||
<div id="page-header">
|
||||
<div class="headerbar">
|
||||
<div class="inner">
|
||||
|
||||
<div id="doc-description">
|
||||
<a href="../index.php" id="logo"><span class="site_logo"></span></a>
|
||||
<h1>Auth API</h1>
|
||||
<p>This is an explanation of how to use the phpBB auth/acl API</p>
|
||||
<p style="display: none;"><a href="#start_here">Skip</a></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a name="start_here"></a>
|
||||
|
||||
<div id="page-body">
|
||||
|
||||
<!-- BEGIN DOCUMENT -->
|
||||
|
||||
<p class="paragraph main-description">This is an explanation of how to use the phpBB auth/acl API.</p>
|
||||
|
||||
<h1>Auth API</h1>
|
||||
|
||||
<div class="paragraph menu">
|
||||
<div class="inner">
|
||||
|
||||
<div class="content">
|
||||
|
||||
<ol>
|
||||
<li><a href="#intro">Introduction</a></li>
|
||||
<li><a href="#methods">Methods</a>
|
||||
<ol style="list-style-type: lower-roman;">
|
||||
<li><a href="#acl">acl</a></li>
|
||||
<li><a href="#acl_get">acl_get</a></li>
|
||||
<li><a href="#acl_gets">acl_gets</a></li>
|
||||
<li><a href="#acl_getf">acl_getf</a></li>
|
||||
<li><a href="#acl_getf_global">acl_getf_global</a></li>
|
||||
<li><a href="#acl_cache">acl_cache</a></li>
|
||||
<li><a href="#acl_clear_prefetch">acl_clear_prefetch</a></li>
|
||||
<li><a href="#acl_get_list">acl_get_list</a></li>
|
||||
<li><a href="#misc">Miscellaneous</a></li>
|
||||
</ol>
|
||||
</li>
|
||||
<li><a href="#admin_related">Admin related functions</a></li>
|
||||
<li><a href="#disclaimer">Copyright and disclaimer</a></li>
|
||||
</ol>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="intro"></a><h2>1. Introduction</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="inner">
|
||||
|
||||
<div class="content">
|
||||
|
||||
<h4>What is it?</h4>
|
||||
|
||||
<p>The <code>auth</code> class contains methods related to authorisation users to access various board functions, e.g. posting, viewing, replying, logging in (and out), etc. If you need to check whether a user can carry out a task or handle user login/logouts this class is required.</p>
|
||||
|
||||
<h4>Initialisation</h4>
|
||||
|
||||
<p>To use any methods contained with the <code>auth</code> class it first needs to be instantiated. This is best achieved early in the execution of the script in the following manner:</p>
|
||||
|
||||
<div class="codebox"><pre>
|
||||
$auth = new phpbb\auth\auth();</pre>
|
||||
</div>
|
||||
|
||||
<p>Once an instance of the class has been created you are free to call the various methods it contains. Please note that should you wish to use the <code>auth_admin</code> methods you will need to instantiate this separately but in the same way.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="methods"></a><h2>2. Methods</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="inner">
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>Following are the methods you are able to use.</p>
|
||||
|
||||
<a name="acl"></a><h3>2.i. acl</h3>
|
||||
|
||||
<p>The <code>acl</code> method is the initialisation routine for all the acl functions. If you intend calling any acl method you must first call this. The method takes as its one and only required parameter an associative array containing user information as stored in the database. This array must contain at least the following information; user_id, user_permissions and user_type. It is called in the following way:</p>
|
||||
|
||||
<div class="codebox"><pre>
|
||||
$auth->acl(<code>userdata</code>);</pre>
|
||||
</div>
|
||||
|
||||
<p>Where userdata is the array containing the aforementioned data.</p>
|
||||
|
||||
<a name="acl_get"></a><h3>2.ii. acl_get</h3>
|
||||
|
||||
<p>This method is the primary way of determining what a user can and cannot do for a given option globally or in a given forum. The method should be called in the following way:</p>
|
||||
|
||||
<div class="codebox"><pre>
|
||||
$result = $auth->acl_get(<code>option</code>[, <code>forum</code>]);</pre>
|
||||
</div>
|
||||
|
||||
<p>Where option is a string representing the required option, e.g. 'f_list', 'm_edit', 'a_adduser', etc. By adding a ! in front of the option, e.g. '!f_list' the result of this method will be negated. The optional forum term is the integer forum_id.</p>
|
||||
|
||||
<p>The method returns a positive integer when the user is allowed to carry out the option and a zero if denied or the other way around if the option is prefixed with an exclamation mark.</p>
|
||||
|
||||
<p>If you specify a forum and there is also a global setting for the specified option then this method will return a positive integer if one of them evaluates to a positive integer. An example would be the m_approve option which can be set per forum but also globally. If a user has the global option he will automatically have m_approve in every forum.</p>
|
||||
|
||||
<p>There are some special options or <em>flags</em> which are used as prefixes for other options, e.g. 'f_' or 'm_'. These flags will automatically be set to a positive integer if the user has one or more permissions with the given prefix. A local setting will result in the flag being set only locally (so it will require a forum id to retrieve). If a user has one or more global permissions with the prefix acl_get will return a positive integer regardless of the forum id.</p>
|
||||
|
||||
<a name="acl_gets"></a><h3>2.iii. acl_gets</h3>
|
||||
|
||||
<p>This method is funtionally similar to <code>acl_get</code> in that it returns information on whether a user can or cannot carry out a given task. The difference here is the ability to test several different options in one go. This may be useful for testing whether a user is a moderator or an admin in one call. Rather than having to call and check <code>acl_get</code> twice.</p>
|
||||
|
||||
<p>The method should be called thus:</p>
|
||||
|
||||
<div class="codebox"><pre>
|
||||
$result = $auth->acl_gets(<code>option1</code>[, <code>option2</code>, ..., <code>optionN</code>, <code>forum</code>]);</pre>
|
||||
</div>
|
||||
|
||||
<p>As with the <code>acl_get</code> method the options are strings representing the required permissions to check. The forum again is an integer representing a given forum_id.</p>
|
||||
|
||||
<p>The method will return a positive integer if <code>acl_get</code> for one of the options evaluates to a positive integer (combines permissions with OR).</p>
|
||||
|
||||
<a name="acl_getf"></a><h3>2.iv. acl_getf</h3>
|
||||
|
||||
<p>This method is used to find out in which forums a user is allowed to carry out an operation or to find out in which forums he is not allowed to carry out an operation. The method should be called in the following way:</p>
|
||||
|
||||
<div class="codebox"><pre>
|
||||
$result = $auth->acl_getf(<code>option</code>[, <code>clean</code>]);</pre>
|
||||
</div>
|
||||
|
||||
<p>Just like in the <code>acl_get</code> method the option is a string specifying the permission which has to be checked (negation using ! is allowed). The second parameter is a boolean. If it is set to false this method returns all forums with either zero or a positive integer. If it is set to true only those forums with a positive integer as the result will be returned.</p>
|
||||
|
||||
<p>The method returns an associative array of the form:</p>
|
||||
|
||||
<div class="codebox"><pre>
|
||||
array(<em>forum_id1</em> => array(<em>option</em> => <em>integer</em>), <em>forum_id2</em> => ...)</pre>
|
||||
</div>
|
||||
|
||||
<p>Where option is the option passed to the method and integer is either zero or a positive integer and the same <code>acl_get(option, forum_id)</code> would return.</p>
|
||||
|
||||
<a name="acl_getf_global"></a><h3>2.v. acl_getf_global</h3>
|
||||
|
||||
<p>This method is used to find out whether a user has a permission in at least one forum or globally. This method is similar to checking whether <code>acl_getf(option, true)</code> returned one or more forums but it's faster. It should be called in the following way:</p>
|
||||
|
||||
<div class="codebox"><pre>
|
||||
$result = $auth->acl_getf_global(<code>option</code>)</pre>
|
||||
</div>
|
||||
|
||||
<p>As with the previous methods option is a string specifying the permission which has to be checked.</p>
|
||||
|
||||
<p>This method returns either zero or a positive integer.</p>
|
||||
|
||||
<a name="acl_cache"></a><h3>2.vi. acl_cache</h3>
|
||||
|
||||
<p>This should be considered a private method and not be called externally. It handles the generation of the user_permissions data from the basic user and group authorisation data. When necessary this method is called automatically by <code>acl</code>.</p>
|
||||
|
||||
<a name="acl_clear_prefetch"></a><h3>2.vii. acl_clear_prefetch</h3>
|
||||
|
||||
<p>This method clears the user_permissions column in the users table for the given user. If the user ID passed is zero, the permissions cache is cleared for all users. This method should be called whenever permissions are set.</p>
|
||||
|
||||
<div class="codebox"><pre>
|
||||
// clear stored permissions for user 2
|
||||
$user_id = 2;
|
||||
$auth->acl_clear_prefetch($user_id);
|
||||
</pre></div>
|
||||
|
||||
<p>This method returns null.</p>
|
||||
|
||||
<a name="acl_get_list"></a><h3>2.viii. acl_get_list</h3>
|
||||
|
||||
<p>This method returns an an array describing which users have permissions in given fora. The resultant array contains an entry for permission that every user has in every forum when no arguments are passed.</p>
|
||||
|
||||
<div class="codebox"><pre>
|
||||
$user_id = array(2, 53);
|
||||
$permissions = array('f_list', 'f_read');
|
||||
$forum_id = array(1, 2, 3);
|
||||
$result = $auth->acl_get_list($user_id, $permissions, $forum_id);
|
||||
</pre></div>
|
||||
|
||||
<p>The parameters may be of the following legal types:</p>
|
||||
<ul>
|
||||
<li><strong>$user_id</strong>: <code>false</code>, int, array(int, int, int, ...)</li>
|
||||
<li><strong>$permissions</strong>: <code>false</code>, string, array(string, string, ...)</li>
|
||||
<li><strong>$forum_id</strong>: <code>false</code>, int, array(int, int, int, ...)</li>
|
||||
</ul>
|
||||
|
||||
<a name="misc"></a><h3>2.ix. Miscellaneous</h3>
|
||||
|
||||
<p>There are other methods defined in the auth class which serve mostly as private methods, but are available for use if needed. Each of them is used to pull data directly from the database tables. They are:</p>
|
||||
<ul>
|
||||
<li><pre>function acl_group_raw_data($group_id = false, $opts = false, $forum_id = false)</pre></li>
|
||||
<li><pre>function acl_user_raw_data($user_id = false, $opts = false, $forum_id = false)</pre></li>
|
||||
<li><pre>function acl_raw_data_single_user($user_id)</pre></li>
|
||||
<li><pre>function acl_raw_data($user_id = false, $opts = false, $forum_id = false)</pre></li>
|
||||
<li><pre>function acl_role_data($user_type, $role_type, $ug_id = false, $forum_id = false)</pre></li>
|
||||
</ul>
|
||||
|
||||
<p>Of these, <code>acl_raw_data</code> is the most general, but the others will be faster if you need a smaller amount of data.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="admin_related"></a><h2>3. Admin related functions</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="inner">
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>A number of additional methods are available related to <code>auth</code>. These handle more basic functions such as adding user and group permissions, new options and clearing the user cache. These methods are contained within a separate class, <code>auth_admin</code>. This can be found in <code>includes/acp/auth.php</code>.</p>
|
||||
|
||||
<p>To use any methods this class contains it first needs to be instantiated separately from <code>auth</code>. This is achieved in the same way as <code>auth</code>:</p>
|
||||
|
||||
<div class="codebox"><pre>
|
||||
$auth_admin = new auth_admin();</pre>
|
||||
</div>
|
||||
|
||||
<p>This instance gives you access to both the methods of this specific class and that of <code>auth</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="disclaimer"></a><h2>4. Copyright and disclaimer</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="inner">
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>phpBB is free software, released under the terms of the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License, version 2 (GPL-2.0)</a>. Copyright © <a href="https://www.phpbb.com">phpBB Limited</a>. For full copyright and license information, please see the docs/CREDITS.txt file.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- END DOCUMENT -->
|
||||
|
||||
<div id="page-footer">
|
||||
<div class="version"> </div>
|
||||
</div>
|
||||
</div></div>
|
||||
|
||||
<div>
|
||||
<a id="bottom" accesskey="z"></a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
File diff suppressed because it is too large
Load diff
|
@ -458,7 +458,7 @@ class acp_groups
|
|||
* Validate the length of "Maximum number of allowed recipients per
|
||||
* private message" setting. We use 16777215 as a maximum because it matches
|
||||
* MySQL unsigned mediumint maximum value which is the lowest amongst DBMSes
|
||||
* supported by phpBB3. Also validate the submitted colour value.
|
||||
* supported by phpBB. Also validate the submitted colour value.
|
||||
*/
|
||||
$validation_checks = array(
|
||||
'max_recipients' => array('num', false, 0, 16777215),
|
||||
|
|
|
@ -3194,7 +3194,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline): bool
|
|||
* and converts backslashes to forward slashes.
|
||||
*
|
||||
* @param string $errfile Absolute file path
|
||||
* (e.g. /var/www/phpbb3/phpBB/includes/functions.php)
|
||||
* (e.g. /var/www/phpbb/phpBB/includes/functions.php)
|
||||
* Please note that if $errfile is outside of the phpBB root,
|
||||
* the root path will not be found and can not be filtered.
|
||||
* @return string Relative file path
|
||||
|
|
|
@ -103,7 +103,7 @@ $tables = array(
|
|||
* In either of the latter cases 'table_name' indicates the name of the table in the database
|
||||
*
|
||||
* 'settings' is an array which maps the name of the config directive in the source forum
|
||||
* to the config directive in phpBB3. It can either be a direct mapping or use a function.
|
||||
* to the config directive in phpBB. It can either be a direct mapping or use a function.
|
||||
* Please note that the contents of the old config value are passed to the function, therefore
|
||||
* an in-built function requiring the variable passed by reference is not able to be used. Since
|
||||
* empty() is such a function we created the function is_empty() to be used instead.
|
||||
|
@ -332,7 +332,7 @@ if (!$get_info)
|
|||
// if (defined("MOD_ATTACHMENT")) { import_attachment_files(); phpbb_copy_thumbnails(); }
|
||||
|
||||
// phpBB2 allowed some similar usernames to coexist which would have the same
|
||||
// username_clean in phpBB3 which is not possible, so we'll give the admin a list
|
||||
// username_clean in phpBB which is not possible, so we'll give the admin a list
|
||||
// of user ids and usernames and let him deicde what he wants to do with them
|
||||
'execute_first' => '
|
||||
phpbb_create_userconv_table();
|
||||
|
|
|
@ -1176,7 +1176,7 @@ function phpbb_convert_group_type($group_type)
|
|||
break;
|
||||
}
|
||||
|
||||
// Never return GROUP_SPECIAL here, because only phpBB3's default groups are allowed to have this type set.
|
||||
// Never return GROUP_SPECIAL here, because only phpBB's default groups are allowed to have this type set.
|
||||
return GROUP_HIDDEN;
|
||||
}
|
||||
|
||||
|
@ -1735,7 +1735,7 @@ function phpbb_disallowed_username($username)
|
|||
|
||||
/**
|
||||
* Checks whether there are any usernames on the old board that would map to the same
|
||||
* username_clean on phpBB3. Prints out a list if any exist and exits.
|
||||
* username_clean on phpBB. Prints out a list if any exist and exits.
|
||||
*/
|
||||
function phpbb_create_userconv_table()
|
||||
{
|
||||
|
|
|
@ -86,7 +86,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('chg_passforce', '0
|
|||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('confirm_refresh', '1');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('contact_admin_form_enable', '1');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_domain', '');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_name', 'phpbb3');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_name', 'phpbb');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_notice', '0');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_path', '/');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_secure', '0');
|
||||
|
|
|
@ -458,7 +458,7 @@ $lang = array_merge($lang, array(
|
|||
'RANKS_PATH' => 'Rank image storage path',
|
||||
'RANKS_PATH_EXPLAIN' => 'Path under your phpBB root directory, e.g. <samp>images/ranks</samp>.',
|
||||
'SCRIPT_PATH' => 'Script path',
|
||||
'SCRIPT_PATH_EXPLAIN' => 'The path where phpBB is located relative to the domain name, e.g. <samp>/phpBB3</samp>.',
|
||||
'SCRIPT_PATH_EXPLAIN' => 'The path where phpBB is located relative to the domain name, e.g. <samp>/phpBB</samp>.',
|
||||
'SERVER_NAME' => 'Domain name',
|
||||
'SERVER_NAME_EXPLAIN' => 'The domain name this board runs from (for example: <samp>example.com</samp>).',
|
||||
'SERVER_PORT' => 'Server port',
|
||||
|
|
|
@ -77,7 +77,7 @@ $lang = array_merge($lang, array(
|
|||
'ENABLE_TOPIC_ICONS' => 'Enable topic icons',
|
||||
|
||||
'FORUM_ADMIN' => 'Forum administration',
|
||||
'FORUM_ADMIN_EXPLAIN' => 'In phpBB3 everything is forum based. A category is just a special type of forum. Each forum can have an unlimited number of sub-forums and you can determine whether each may be posted to or not (i.e. whether it acts like an old category). Here you can add, edit, delete, lock, unlock individual forums as well as set certain additional controls. If your posts and topics have got out of sync you can also resynchronise a forum. <strong>You need to copy or set appropriate permissions for newly created forums to have them displayed.</strong>',
|
||||
'FORUM_ADMIN_EXPLAIN' => 'In phpBB everything is forum based. A category is just a special type of forum. Each forum can have an unlimited number of sub-forums and you can determine whether each may be posted to or not (i.e. whether it acts like an old category). Here you can add, edit, delete, lock, unlock individual forums as well as set certain additional controls. If your posts and topics have got out of sync you can also resynchronise a forum. <strong>You need to copy or set appropriate permissions for newly created forums to have them displayed.</strong>',
|
||||
'FORUM_AUTO_PRUNE' => 'Enable auto-pruning',
|
||||
'FORUM_AUTO_PRUNE_EXPLAIN' => 'Prunes the forum of topics, set the frequency/age parameters below.',
|
||||
'FORUM_CREATED' => 'Forum created successfully.',
|
||||
|
|
|
@ -54,7 +54,7 @@ $lang = array_merge($lang, array(
|
|||
|
||||
<br />
|
||||
|
||||
<p>For further information on setting up and managing permissions on your phpBB3 board, please see the section on <a href="https://www.phpbb.com/support/docs/en/3.3/ug/quickstart/permissions/">Setting permissions of our Quick Start Guide</a>.</p>
|
||||
<p>For further information on setting up and managing permissions on your phpBB board, please see the section on <a href="https://www.phpbb.com/support/docs/en/3.3/ug/quickstart/permissions/">Setting permissions of our Quick Start Guide</a>.</p>
|
||||
',
|
||||
|
||||
'ACL_NEVER' => 'Never',
|
||||
|
|
|
@ -45,18 +45,18 @@ $lang = array_merge($lang, array(
|
|||
|
||||
// Introduction page
|
||||
'INTRODUCTION_TITLE' => 'Introduction',
|
||||
'INTRODUCTION_BODY' => 'Welcome to phpBB3!<br /><br />phpBB® is the most widely used open source bulletin board solution in the world. phpBB3 is the latest installment in a package line started in 2000. Like its predecessors, phpBB3 is feature-rich, user-friendly, and fully supported by the phpBB Team. phpBB3 greatly improves on what made phpBB2 popular, and adds commonly requested features that were not present in previous versions. We hope it exceeds your expectations.<br /><br />This installation system will guide you through installing phpBB3, updating to the latest version of phpBB3 from past releases, as well as converting to phpBB3 from a different discussion board system (including phpBB2). For more information, we encourage you to read <a href="%1$s">the installation guide</a>.<br /><br />To read the phpBB3 license or learn about obtaining support and our stance on it, please select the respective options from the side menu. To continue, please select the appropriate tab above.',
|
||||
'INTRODUCTION_BODY' => 'Welcome to phpBB!<br /><br />phpBB® is the most widely used open source bulletin board solution in the world. phpBB is the latest installment in a package line started in 2000. Like its predecessors, phpBB is feature-rich, user-friendly, and fully supported by the phpBB Team. phpBB greatly improves on what made phpBB2 and phpBB3 popular, and adds commonly requested features that were not present in previous versions. We hope it exceeds your expectations.<br /><br />This installation system will guide you through installing phpBB, updating to the latest version of phpBB from past releases, as well as converting to phpBB from a different discussion board system (including phpBB2). For more information, we encourage you to read <a href="%1$s">the installation guide</a>.<br /><br />To read the phpBB license or learn about obtaining support and our stance on it, please select the respective options from the side menu. To continue, please select the appropriate tab above.',
|
||||
|
||||
// Support page
|
||||
'SUPPORT_TITLE' => 'Support',
|
||||
'SUPPORT_BODY' => 'Full support will be provided for the current stable release of phpBB3, free of charge. This includes:</p><ul><li>installation</li><li>configuration</li><li>technical questions</li><li>problems relating to potential bugs in the software</li><li>updating from Release Candidate (RC) versions to the latest stable version</li><li>converting from phpBB 2.0.x to phpBB3</li><li>converting from other discussion board software to phpBB3 (please see the <a href="https://www.phpbb.com/community/viewforum.php?f=486">Convertors Forum</a>)</li></ul><p>We encourage users still running beta versions of phpBB3 to replace their installation with a fresh copy of the latest version.</p><h2>Extensions / Styles</h2><p>For issues relating to Extensions, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=451">Extensions Forum</a>.<br />For issues relating to styles, templates and themes, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=471">Styles Forum</a>.<br /><br />If your question relates to a specific package, please post directly in the topic dedicated to the package.</p><h2>Obtaining Support</h2><p><a href="https://www.phpbb.com/support/">Support Section</a><br /><a href="https://www.phpbb.com/support/docs/en/3.3/ug/quickstart/">Quick Start Guide</a><br /><br />To ensure you stay up to date with the latest news and releases, follow us on <a href="https://www.twitter.com/phpbb/">Twitter</a> and <a href="https://www.facebook.com/phpbb/">Facebook</a><br /><br />',
|
||||
'SUPPORT_BODY' => 'Full support will be provided for the current stable release of phpBB, free of charge. This includes:</p><ul><li>installation</li><li>configuration</li><li>technical questions</li><li>problems relating to potential bugs in the software</li><li>updating from Release Candidate (RC) versions to the latest stable version</li><li>converting from phpBB 2.0.x to phpBB</li><li>converting from other discussion board software to phpBB (please see the <a href="https://www.phpbb.com/community/viewforum.php?f=486">Convertors Forum</a>)</li></ul><p>We encourage users still running pre-release versions of phpBB to replace their installation with a fresh copy of the latest version.</p><h2>Extensions / Styles</h2><p>For issues relating to Extensions, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=451">Extensions Forum</a>.<br />For issues relating to styles, templates and themes, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=471">Styles Forum</a>.<br /><br />If your question relates to a specific package, please post directly in the topic dedicated to the package.</p><h2>Obtaining Support</h2><p><a href="https://www.phpbb.com/support/">Support Section</a><br /><a href="https://www.phpbb.com/support/docs/en/3.3/ug/quickstart/">Quick Start Guide</a><br /><br />To ensure you stay up to date with the latest news and releases, follow us on <a href="https://www.twitter.com/phpbb/">Twitter</a> and <a href="https://www.facebook.com/phpbb/">Facebook</a><br /><br />',
|
||||
|
||||
// License
|
||||
'LICENSE_TITLE' => 'General Public License',
|
||||
|
||||
// Install page
|
||||
'INSTALL_INTRO' => 'Welcome to Installation',
|
||||
'INSTALL_INTRO_BODY' => 'With this option, it is possible to install phpBB3 onto your server.</p><p>In order to proceed, you will need your database settings. If you do not know your database settings, please contact your host and ask for them. You will not be able to continue without them. You need:</p>
|
||||
'INSTALL_INTRO_BODY' => 'With this option, it is possible to install phpBB onto your server.</p><p>In order to proceed, you will need your database settings. If you do not know your database settings, please contact your host and ask for them. You will not be able to continue without them. You need:</p>
|
||||
|
||||
<ul>
|
||||
<li>The Database Type - the database you will be using.</li>
|
||||
|
@ -68,7 +68,7 @@ $lang = array_merge($lang, array(
|
|||
|
||||
<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>
|
||||
|
||||
<p>phpBB3 supports the following databases:</p>
|
||||
<p>phpBB supports the following databases:</p>
|
||||
<ul>
|
||||
<li>MySQL 4.1.3 or above (MySQLi required)</li>
|
||||
<li>PostgreSQL 8.3+</li>
|
||||
|
@ -235,7 +235,7 @@ $lang = array_merge($lang, array(
|
|||
'UPGRADE_INSTRUCTIONS' => 'A new feature release <strong>%1$s</strong> is available. Please read <a href="%2$s" title="%2$s"><strong>the release announcement</strong></a> to learn about what it has to offer, and how to upgrade.',
|
||||
'SERVER_CONFIG' => 'Server configuration',
|
||||
'SCRIPT_PATH' => 'Script path',
|
||||
'SCRIPT_PATH_EXPLAIN' => 'The path where phpBB is located relative to the domain name, e.g. <samp>/phpBB3</samp>.',
|
||||
'SCRIPT_PATH_EXPLAIN' => 'The path where phpBB is located relative to the domain name, e.g. <samp>/phpBB</samp>.',
|
||||
));
|
||||
|
||||
// Default database schema entries...
|
||||
|
@ -244,7 +244,7 @@ $lang = array_merge($lang, array(
|
|||
'CONFIG_SITE_DESC' => 'A short text to describe your forum',
|
||||
'CONFIG_SITENAME' => 'yourdomain.com',
|
||||
|
||||
'DEFAULT_INSTALL_POST' => '<t>This is an example post in your phpBB3 installation. Everything seems to be working. You may delete this post if you like and continue to set up your board. During the installation process your first category and your first forum are assigned an appropriate set of permissions for the predefined usergroups administrators, bots, global moderators, guests, registered users and registered COPPA users. If you also choose to delete your first category and your first forum, do not forget to assign permissions for all these usergroups for all new categories and forums you create. It is recommended to rename your first category and your first forum and copy permissions from these while creating new categories and forums. Have fun!</t>',
|
||||
'DEFAULT_INSTALL_POST' => '<t>This is an example post in your phpBB installation. Everything seems to be working. You may delete this post if you like and continue to set up your board. During the installation process your first category and your first forum are assigned an appropriate set of permissions for the predefined usergroups administrators, bots, global moderators, guests, registered users and registered COPPA users. If you also choose to delete your first category and your first forum, do not forget to assign permissions for all these usergroups for all new categories and forums you create. It is recommended to rename your first category and your first forum and copy permissions from these while creating new categories and forums. Have fun!</t>',
|
||||
|
||||
'FORUMS_FIRST_CATEGORY' => 'Your first category',
|
||||
'FORUMS_TEST_FORUM_DESC' => 'Description of your first forum.',
|
||||
|
@ -281,7 +281,7 @@ $lang = array_merge($lang, array(
|
|||
'SMILIES_VERY_HAPPY' => 'Very Happy',
|
||||
'SMILIES_WINK' => 'Wink',
|
||||
|
||||
'TOPICS_TOPIC_TITLE' => 'Welcome to phpBB3',
|
||||
'TOPICS_TOPIC_TITLE' => 'Welcome to phpBB',
|
||||
));
|
||||
|
||||
// Common navigation items' translation
|
||||
|
@ -365,7 +365,7 @@ $lang = array_merge($lang, array(
|
|||
|
||||
<h1>How to update your installation with the Full Package</h1>
|
||||
|
||||
<p>The recommended way of updating your installation is using the full package. If core phpBB files have been modified in your installation you may wish to use the advanced update package in order to not lose these changes. You are also able to update your installation using the other methods listed within the INSTALL.html document. The steps for updating phpBB3 using the full package are:</p>
|
||||
<p>The recommended way of updating your installation is using the full package. If core phpBB files have been modified in your installation you may wish to use the advanced update package in order to not lose these changes. You are also able to update your installation using the other methods listed within the INSTALL.html document. The steps for updating phpBB using the full package are:</p>
|
||||
|
||||
<ol style="margin-left: 20px; font-size: 1.1em;">
|
||||
<li><strong class="error">Backup all board files and the database.</strong></li>
|
||||
|
@ -374,7 +374,7 @@ $lang = array_merge($lang, array(
|
|||
<li>Remove (delete) the <code class="inline">config.php</code> file, and the <code class="inline">/images</code>, <code class="inline">/store</code> and <code class="inline">/files</code> folders <em>from the package</em> (not your site).</li>
|
||||
<li>Go to the ACP, Board settings, and make sure prosilver is set as the default style. If not, set it to prosilver.</li>
|
||||
<li>Delete the <code class="inline">/vendor</code> and <code class="inline">/cache</code> folders from the board’s root folder on the host.</li>
|
||||
<li>Via FTP or SSH upload the remaining files and folders (that is, the remaining CONTENTS of the phpBB3 folder) to the root folder of your board installation on the server, overwriting the existing files. (Note: take care not to delete any extensions in your <code class="inline">/ext</code> folder when uploading the new phpBB3 contents.)</li>
|
||||
<li>Via FTP or SSH upload the remaining files and folders (that is, the remaining CONTENTS of the phpBB folder) to the root folder of your board installation on the server, overwriting the existing files. (Note: take care not to delete any extensions in your <code class="inline">/ext</code> folder when uploading the new phpBB contents.)</li>
|
||||
<li><strong><a href="%1$s" title="%1$s">Now start the update process by pointing your browser to the install folder</a>.</strong></li>
|
||||
<li>Follow the steps to update the database and let that run to completion.</li>
|
||||
<li>Via FTP or SSH delete the <code class="inline">/install</code> folder from the root of your board installation.<br><br></li>
|
||||
|
@ -388,7 +388,7 @@ $lang = array_merge($lang, array(
|
|||
|
||||
<h1>How to update your installation with the Advanced Update Package</h1>
|
||||
|
||||
<p>The advanced update package is only recommended for expert users in case core phpBB files have been modified in your installation. You are also able to update your installation using the methods listed within the INSTALL.html document. The steps for updating phpBB3 using the advanced update package are:</p>
|
||||
<p>The advanced update package is only recommended for expert users in case core phpBB files have been modified in your installation. You are also able to update your installation using the methods listed within the INSTALL.html document. The steps for updating phpBB using the advanced update package are:</p>
|
||||
|
||||
<ol style="margin-left: 20px; font-size: 1.1em;">
|
||||
<li>Go to the <a href="https://www.phpbb.com/downloads/" title="https://www.phpbb.com/downloads/">phpBB.com downloads page</a> and download the "Advanced Update Package" archive.</li>
|
||||
|
@ -503,7 +503,7 @@ $lang = array_merge($lang, array(
|
|||
'CONVERT_NOT_EXIST' => 'The specified convertor does not exist.',
|
||||
'DEV_NO_TEST_FILE' => 'No value has been specified for the test_file variable in the convertor. If you are a user of this convertor, you should not be seeing this error, please report this message to the convertor author. If you are a convertor author, you must specify the name of a file which exists in the source board to allow the path to it to be verified.',
|
||||
'COULD_NOT_FIND_PATH' => 'Could not find path to your former board. Please check your settings and try again.<br />» %s was specified as the source path.',
|
||||
'CONFIG_PHPBB_EMPTY' => 'The phpBB3 config variable for “%s” is empty.',
|
||||
'CONFIG_PHPBB_EMPTY' => 'The phpBB config variable for “%s” is empty.',
|
||||
|
||||
'MAKE_FOLDER_WRITABLE' => 'Please make sure that this folder exists and is writable by the webserver then try again:<br />»<strong>%s</strong>.',
|
||||
'MAKE_FOLDERS_WRITABLE' => 'Please make sure that these folders exist and are writable by the webserver then try again:<br />»<strong>%s</strong>.',
|
||||
|
@ -539,7 +539,7 @@ $lang = array_merge($lang, array(
|
|||
'DEFAULT_PREFIX_IS' => 'The convertor was not able to find tables with the specified prefix. Please make sure you have entered the correct details for the board you are converting from. The default table prefix for %1$s is <strong>%2$s</strong>.',
|
||||
'SPECIFY_OPTIONS' => 'Specify conversion options',
|
||||
'FORUM_PATH' => 'Board path',
|
||||
'FORUM_PATH_EXPLAIN' => 'This is the <strong>relative</strong> path on disk to your former board from the <strong>root of this phpBB3 installation</strong>.',
|
||||
'FORUM_PATH_EXPLAIN' => 'This is the <strong>relative</strong> path on disk to your former board from the <strong>root of this phpBB installation</strong>.',
|
||||
'REFRESH_PAGE' => 'Refresh page to continue conversion',
|
||||
'REFRESH_PAGE_EXPLAIN' => 'If set to yes, the convertor will refresh the page to continue the conversion after having finished a step. If this is your first conversion for testing purposes and to determine any errors in advance, we suggest to set this to No.',
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ use phpbb\request\type_cast_helper;
|
|||
use phpbb\user;
|
||||
|
||||
/**
|
||||
* Apache authentication provider for phpBB3
|
||||
* Apache authentication provider for phpBB
|
||||
*/
|
||||
class apache extends base
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@ use phpbb\passwords\manager;
|
|||
use phpbb\user;
|
||||
|
||||
/**
|
||||
* Database authentication provider for phpBB3
|
||||
* Database authentication provider for phpBB
|
||||
* This is for authentication via the integrated user table
|
||||
*/
|
||||
class db extends base
|
||||
|
|
|
@ -20,7 +20,7 @@ use phpbb\language\language;
|
|||
use phpbb\user;
|
||||
|
||||
/**
|
||||
* Database authentication provider for phpBB3
|
||||
* Database authentication provider for phpBB
|
||||
* This is for authentication via the integrated user table
|
||||
*/
|
||||
class ldap extends base
|
||||
|
|
|
@ -31,7 +31,7 @@ use phpbb\request\request_interface;
|
|||
use phpbb\user;
|
||||
|
||||
/**
|
||||
* OAuth authentication provider for phpBB3
|
||||
* OAuth authentication provider for phpBB
|
||||
*/
|
||||
class oauth extends base
|
||||
{
|
||||
|
|
|
@ -23,11 +23,11 @@
|
|||
"classmap": [""]
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.4"
|
||||
"php": "^8.1"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.3.x-dev"
|
||||
"dev-master": "4.0.x-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ class mssqlnative extends \phpbb\db\driver\mssql_base
|
|||
// Test for driver support, to avoid suppressed fatal error
|
||||
if (!function_exists('sqlsrv_connect'))
|
||||
{
|
||||
$this->connect_error = 'Native MS SQL Server driver for PHP is missing or needs to be updated. Version 1.1 or later is required to install phpBB3. You can download the driver from: http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx';
|
||||
$this->connect_error = 'Native MS SQL Server driver for PHP is missing or needs to be updated. Version 1.1 or later is required to install phpBB. You can download the driver from: http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx';
|
||||
return $this->sql_error('');
|
||||
}
|
||||
|
||||
|
|
|
@ -173,7 +173,7 @@ class add_config_settings extends database_task
|
|||
}
|
||||
|
||||
// We set a (semi-)unique cookie name to bypass login issues related to the cookie name.
|
||||
$cookie_name = 'phpbb3_';
|
||||
$cookie_name = 'phpbb_';
|
||||
$rand_str = md5(mt_rand());
|
||||
$rand_str = str_replace('0', 'z', base_convert($rand_str, 16, 35));
|
||||
$rand_str = substr($rand_str, 0, 5);
|
||||
|
|
|
@ -165,7 +165,7 @@ class create_config_file extends \phpbb\install\task_base
|
|||
protected function get_config_data($debug = false, $debug_container = false, $environment = null)
|
||||
{
|
||||
$config_content = "<?php\n";
|
||||
$config_content .= "// phpBB 3.3.x auto-generated configuration file\n// Do not change anything in this file!\n";
|
||||
$config_content .= "// phpBB auto-generated configuration file\n// Do not change anything in this file!\n";
|
||||
|
||||
$dbms = $this->install_config->get('dbms');
|
||||
$db_driver = $this->db_helper->get_available_dbms($dbms);
|
||||
|
|
|
@ -125,10 +125,10 @@ class session
|
|||
$page .= '?' . $query_string;
|
||||
}
|
||||
|
||||
// The script path from the webroot to the current directory (for example: /phpBB3/adm/) : always prefixed with / and ends in /
|
||||
// The script path from the webroot to the current directory (for example: /phpBB/adm/) : always prefixed with / and ends in /
|
||||
$script_path = $symfony_request->getBasePath();
|
||||
|
||||
// The script path from the webroot to the phpBB root (for example: /phpBB3/)
|
||||
// The script path from the webroot to the phpBB root (for example: /phpBB/)
|
||||
$script_dirs = explode('/', $script_path);
|
||||
array_splice($script_dirs, -count($page_dirs));
|
||||
$root_script_path = implode('/', $script_dirs) . (count($root_dirs) ? '/' . implode('/', $root_dirs) : '');
|
||||
|
|
|
@ -15,8 +15,9 @@
|
|||
"support": {
|
||||
"issues": "https://tracker.phpbb.com",
|
||||
"forum": "https://www.phpbb.com/community/",
|
||||
"wiki": "https://wiki.phpbb.com",
|
||||
"irc": "irc://irc.freenode.org/phpbb"
|
||||
"docs": "https://www.phpbb.com/support/docs/",
|
||||
"irc": "irc://irc.libera.chat/phpbb",
|
||||
"chat": "https://www.phpbb.com/support/chat/"
|
||||
},
|
||||
"extra": {
|
||||
"display-name": "prosilver",
|
||||
|
|
|
@ -1,21 +1,22 @@
|
|||
/* global phpbb */
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-var: 0 */
|
||||
|
||||
(function($) { // Avoid conflicts with other libraries
|
||||
'use strict';
|
||||
|
||||
// This callback will mark all forum icons read
|
||||
phpbb.addAjaxCallback('mark_forums_read', function(res) {
|
||||
const readTitle = res.NO_UNREAD_POSTS;
|
||||
const unreadTitle = res.UNREAD_POSTS;
|
||||
const iconsArray = {
|
||||
var readTitle = res.NO_UNREAD_POSTS;
|
||||
var unreadTitle = res.UNREAD_POSTS;
|
||||
var iconsArray = {
|
||||
forum_unread: 'forum_read',
|
||||
forum_unread_subforum: 'forum_read_subforum',
|
||||
forum_unread_locked: 'forum_read_locked',
|
||||
};
|
||||
|
||||
$('li.row').find('dl[class*="forum_unread"]').each(function() {
|
||||
const $this = $(this);
|
||||
var $this = $(this);
|
||||
|
||||
$.each(iconsArray, (unreadClass, readClass) => {
|
||||
if ($this.hasClass(unreadClass)) {
|
||||
|
@ -46,17 +47,17 @@
|
|||
* should be updated. Defaults to true.
|
||||
*/
|
||||
phpbb.addAjaxCallback('mark_topics_read', (res, updateTopicLinks) => {
|
||||
const readTitle = res.NO_UNREAD_POSTS;
|
||||
const unreadTitle = res.UNREAD_POSTS;
|
||||
const iconsArray = {
|
||||
var readTitle = res.NO_UNREAD_POSTS;
|
||||
var unreadTitle = res.UNREAD_POSTS;
|
||||
var iconsArray = {
|
||||
global_unread: 'global_read',
|
||||
announce_unread: 'announce_read',
|
||||
sticky_unread: 'sticky_read',
|
||||
topic_unread: 'topic_read',
|
||||
};
|
||||
const iconsState = [ '', '_hot', '_hot_mine', '_locked', '_locked_mine', '_mine' ];
|
||||
const classMap = {};
|
||||
const classNames = [];
|
||||
var iconsState = [ '', '_hot', '_hot_mine', '_locked', '_locked_mine', '_mine' ];
|
||||
var classMap = {};
|
||||
var classNames = [];
|
||||
|
||||
if (typeof updateTopicLinks === 'undefined') {
|
||||
updateTopicLinks = true;
|
||||
|
@ -74,10 +75,10 @@
|
|||
});
|
||||
});
|
||||
|
||||
const unreadClassSelectors = '.' + classNames.join(',.');
|
||||
var unreadClassSelectors = '.' + classNames.join(',.');
|
||||
|
||||
$('li.row').find(unreadClassSelectors).each(function() {
|
||||
const $this = $(this);
|
||||
var $this = $(this);
|
||||
$.each(classMap, (unreadClass, readClass) => {
|
||||
if ($this.hasClass(unreadClass)) {
|
||||
$this.removeClass(unreadClass).addClass(readClass);
|
||||
|
@ -109,7 +110,7 @@
|
|||
// This callback will mark a notification read
|
||||
phpbb.addAjaxCallback('notification.mark_read', function(res) {
|
||||
if (typeof res.success !== 'undefined') {
|
||||
const unreadCount = Number($('#notification-button strong').html()) - 1;
|
||||
var unreadCount = Number($('#notification-button strong').html()) - 1;
|
||||
phpbb.markNotifications($(this).parent('[data-notification-unread="true"]'), unreadCount);
|
||||
}
|
||||
});
|
||||
|
@ -127,7 +128,7 @@
|
|||
|
||||
// Update the notification link to the real URL.
|
||||
$popup.each(function() {
|
||||
const link = $(this).find('a');
|
||||
var link = $(this).find('a');
|
||||
link.attr('href', link.attr('data-real-url'));
|
||||
});
|
||||
|
||||
|
@ -140,21 +141,21 @@
|
|||
}
|
||||
|
||||
// Update page title
|
||||
const $title = $('title');
|
||||
const originalTitle = $title.text().replace(/(\((\d+)\))/, '');
|
||||
var $title = $('title');
|
||||
var originalTitle = $title.text().replace(/(\((\d+)\))/, '');
|
||||
$title.text((unreadCount ? '(' + unreadCount + ')' : '') + originalTitle);
|
||||
};
|
||||
|
||||
// This callback finds the post from the delete link, and removes it.
|
||||
phpbb.addAjaxCallback('post_delete', function() {
|
||||
const $this = $(this);
|
||||
let postId;
|
||||
var $this = $(this);
|
||||
var postId;
|
||||
|
||||
if ($this.attr('data-refresh') === undefined) {
|
||||
postId = $this[0].href.split('&p=')[1];
|
||||
const post = $this.parents('#p' + postId).css('pointer-events', 'none');
|
||||
var post = $this.parents('#p' + postId).css('pointer-events', 'none');
|
||||
if (post.hasClass('bg1') || post.hasClass('bg2')) {
|
||||
const posts1 = post.nextAll('.bg1');
|
||||
var posts1 = post.nextAll('.bg1');
|
||||
post.nextAll('.bg2').removeClass('bg2').addClass('bg1');
|
||||
posts1.removeClass('bg1').addClass('bg2');
|
||||
}
|
||||
|
@ -167,7 +168,7 @@
|
|||
|
||||
// This callback removes the approve / disapprove div or link.
|
||||
phpbb.addAjaxCallback('post_visibility', function(res) {
|
||||
const remove = (res.visible) ? $(this) : $(this).parents('.post');
|
||||
var remove = (res.visible) ? $(this) : $(this).parents('.post');
|
||||
$(remove).css('pointer-events', 'none').fadeOut(function() {
|
||||
$(this).remove();
|
||||
});
|
||||
|
@ -187,7 +188,7 @@
|
|||
|
||||
// This handles friend / foe additions removals.
|
||||
phpbb.addAjaxCallback('zebra', res => {
|
||||
let zebra;
|
||||
var zebra;
|
||||
|
||||
if (res.success) {
|
||||
zebra = $('.zebra');
|
||||
|
@ -201,13 +202,13 @@
|
|||
*/
|
||||
phpbb.addAjaxCallback('vote_poll', function(res) {
|
||||
if (typeof res.success !== 'undefined') {
|
||||
const poll = $(this).closest('.topic_poll');
|
||||
const panel = poll.find('.panel');
|
||||
const resultsVisible = poll.find('dl:first-child .resultbar').is(':visible');
|
||||
let mostVotes = 0;
|
||||
var poll = $(this).closest('.topic_poll');
|
||||
var panel = poll.find('.panel');
|
||||
var resultsVisible = poll.find('dl:first-child .resultbar').is(':visible');
|
||||
var mostVotes = 0;
|
||||
|
||||
// Set min-height to prevent the page from jumping when the content changes
|
||||
const updatePanelHeight = function(height) {
|
||||
var updatePanelHeight = function(height) {
|
||||
height = (typeof height === 'undefined') ? panel.find('.inner').outerHeight() : height;
|
||||
panel.css('min-height', height);
|
||||
};
|
||||
|
@ -230,8 +231,8 @@
|
|||
|
||||
// Get the votes count of the highest poll option
|
||||
poll.find('[data-poll-option-id]').each(function() {
|
||||
const option = $(this);
|
||||
const optionId = option.attr('data-poll-option-id');
|
||||
var option = $(this);
|
||||
var optionId = option.attr('data-poll-option-id');
|
||||
mostVotes = (res.vote_counts[optionId] >= mostVotes) ? res.vote_counts[optionId] : mostVotes;
|
||||
});
|
||||
|
||||
|
@ -240,14 +241,14 @@
|
|||
|
||||
// Update each option
|
||||
poll.find('[data-poll-option-id]').each(function() {
|
||||
const $this = $(this);
|
||||
const optionId = $this.attr('data-poll-option-id');
|
||||
const voted = (typeof res.user_votes[optionId] !== 'undefined');
|
||||
const mostVoted = (res.vote_counts[optionId] === mostVotes);
|
||||
const percent = res.total_votes ? Math.round((res.vote_counts[optionId] / res.total_votes) * 100) : 0;
|
||||
const percentRel = (mostVotes === 0) ? 0 : Math.round((res.vote_counts[optionId] / mostVotes) * 100);
|
||||
var $this = $(this);
|
||||
var optionId = $this.attr('data-poll-option-id');
|
||||
var voted = (typeof res.user_votes[optionId] !== 'undefined');
|
||||
var mostVoted = (res.vote_counts[optionId] === mostVotes);
|
||||
var percent = res.total_votes ? Math.round((res.vote_counts[optionId] / res.total_votes) * 100) : 0;
|
||||
var percentRel = (mostVotes === 0) ? 0 : Math.round((res.vote_counts[optionId] / mostVotes) * 100);
|
||||
|
||||
const altText = $this.attr('data-alt-text');
|
||||
var altText = $this.attr('data-alt-text');
|
||||
if (voted) {
|
||||
$this.attr('title', $.trim(altText));
|
||||
} else {
|
||||
|
@ -258,9 +259,9 @@
|
|||
$this.toggleClass('most-votes', mostVoted);
|
||||
|
||||
// Update the bars
|
||||
const bar = $this.find('.resultbar div');
|
||||
const barTimeLapse = (res.can_vote) ? 500 : 1500;
|
||||
const newBarClass = (percent === 100) ? 'pollbar5' : 'pollbar' + (Math.floor(percent / 20) + 1);
|
||||
var bar = $this.find('.resultbar div');
|
||||
var barTimeLapse = (res.can_vote) ? 500 : 1500;
|
||||
var newBarClass = (percent === 100) ? 'pollbar5' : 'pollbar' + (Math.floor(percent / 20) + 1);
|
||||
|
||||
setTimeout(() => {
|
||||
bar.animate({ width: percentRel + '%' }, 500)
|
||||
|
@ -268,7 +269,7 @@
|
|||
.addClass(newBarClass)
|
||||
.html(res.vote_counts[optionId]);
|
||||
|
||||
const percentText = percent ? percent + '%' : res.NO_VOTES;
|
||||
var percentText = percent ? percent + '%' : res.NO_VOTES;
|
||||
$this.find('.poll_option_percent').html(percentText);
|
||||
}, barTimeLapse);
|
||||
});
|
||||
|
@ -278,7 +279,7 @@
|
|||
}
|
||||
|
||||
// Display "Your vote has been cast." message. Disappears after 5 seconds.
|
||||
const confirmationDelay = (res.can_vote) ? 300 : 900;
|
||||
var confirmationDelay = (res.can_vote) ? 300 : 900;
|
||||
poll.find('.vote-submitted').delay(confirmationDelay).slideDown(200, function() {
|
||||
if (resultsVisible) {
|
||||
updatePanelHeight();
|
||||
|
@ -294,9 +295,9 @@
|
|||
resizePanel(500);
|
||||
}, 1500);
|
||||
|
||||
const resizePanel = function(time) {
|
||||
const panelHeight = panel.height();
|
||||
const innerHeight = panel.find('.inner').outerHeight();
|
||||
var resizePanel = function(time) {
|
||||
var panelHeight = panel.height();
|
||||
var innerHeight = panel.find('.inner').outerHeight();
|
||||
|
||||
if (panelHeight !== innerHeight) {
|
||||
panel.css({ minHeight: '', height: panelHeight })
|
||||
|
@ -315,19 +316,19 @@
|
|||
// Do not follow the link
|
||||
e.preventDefault();
|
||||
|
||||
const $poll = $(this).parents('.topic_poll');
|
||||
var $poll = $(this).parents('.topic_poll');
|
||||
|
||||
$poll.find('.resultbar, .poll_option_percent, .poll_total_votes').show(500);
|
||||
$poll.find('.poll_view_results').hide(500);
|
||||
});
|
||||
|
||||
$('[data-ajax]').each(function() {
|
||||
const $this = $(this);
|
||||
const ajax = $this.attr('data-ajax');
|
||||
let filter = $this.attr('data-filter');
|
||||
var $this = $(this);
|
||||
var ajax = $this.attr('data-ajax');
|
||||
var filter = $this.attr('data-filter');
|
||||
|
||||
if (ajax !== 'false') {
|
||||
const fn = ajax === 'true' ? null : ajax;
|
||||
var fn = ajax === 'true' ? null : ajax;
|
||||
filter = filter === undefined ? null : phpbb.getFunctionByName(filter);
|
||||
|
||||
phpbb.ajaxify({
|
||||
|
@ -354,7 +355,7 @@
|
|||
// Do not follow the link
|
||||
e.preventDefault();
|
||||
|
||||
const postId = $(this).attr('data-post-id');
|
||||
var postId = $(this).attr('data-post-id');
|
||||
$('#post_content' + postId).show();
|
||||
$('#profile' + postId).show();
|
||||
$('#post_hidden' + postId).hide();
|
||||
|
@ -379,7 +380,7 @@
|
|||
* appropriately changed based on the status of the search panel.
|
||||
*/
|
||||
$('#member_search').click(function() {
|
||||
const $memberlistSearch = $('#memberlist_search');
|
||||
var $memberlistSearch = $('#memberlist_search');
|
||||
|
||||
$memberlistSearch.slideToggle('fast');
|
||||
phpbb.ajaxCallbacks.alt_text.call(this);
|
||||
|
@ -418,7 +419,7 @@
|
|||
* Automatically resize textarea
|
||||
*/
|
||||
$(() => {
|
||||
const $textarea = $('textarea:not(#message-box textarea, .no-auto-resize)');
|
||||
var $textarea = $('textarea:not(#message-box textarea, .no-auto-resize)');
|
||||
phpbb.resizeTextArea($textarea, { minHeight: 75, maxHeight: 250 });
|
||||
phpbb.resizeTextArea($('textarea', '#message-box'));
|
||||
});
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
/* global phpbb */
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
/* eslint no-var:0 */
|
||||
|
||||
/**
|
||||
* phpBB3 forum functions
|
||||
* phpBB forum functions
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -36,10 +37,10 @@ function popup(url, width, height, name) {
|
|||
function pageJump(item) {
|
||||
'use strict';
|
||||
|
||||
const page = parseInt(item.val(), 10);
|
||||
const perPage = item.attr('data-per-page');
|
||||
const baseUrl = item.attr('data-base-url');
|
||||
const startName = item.attr('data-start-name');
|
||||
var page = parseInt(item.val(), 10);
|
||||
var perPage = item.attr('data-per-page');
|
||||
var baseUrl = item.attr('data-base-url');
|
||||
var startName = item.attr('data-start-name');
|
||||
|
||||
if (page !== null && !isNaN(page) && page === Math.floor(page) && page > 0) {
|
||||
if (baseUrl.indexOf('?') === -1) {
|
||||
|
@ -58,7 +59,7 @@ function marklist(id, name, state) {
|
|||
'use strict';
|
||||
|
||||
jQuery('#' + id + ' input[type=checkbox][name]').each(function() {
|
||||
const $this = jQuery(this);
|
||||
var $this = jQuery(this);
|
||||
if ($this.attr('name').substr(0, name.length) === name && !$this.prop('disabled')) {
|
||||
$this.prop('checked', state);
|
||||
}
|
||||
|
@ -103,11 +104,11 @@ jQuery($ => {
|
|||
'use strict';
|
||||
|
||||
$('.sub-panels').each(function() {
|
||||
const $childNodes = $('a[data-subpanel]', this);
|
||||
const panels = $childNodes.map(function() {
|
||||
var $childNodes = $('a[data-subpanel]', this);
|
||||
var panels = $childNodes.map(function() {
|
||||
return this.getAttribute('data-subpanel');
|
||||
});
|
||||
const showPanel = this.getAttribute('data-show-panel');
|
||||
var showPanel = this.getAttribute('data-show-panel');
|
||||
|
||||
if (panels.length) {
|
||||
activateSubPanel(showPanel, panels);
|
||||
|
@ -125,8 +126,8 @@ jQuery($ => {
|
|||
function activateSubPanel(p, panels) {
|
||||
'use strict';
|
||||
|
||||
let i;
|
||||
let showPanel;
|
||||
var i;
|
||||
var showPanel;
|
||||
|
||||
if (typeof p === 'string') {
|
||||
showPanel = p;
|
||||
|
@ -150,16 +151,16 @@ function selectCode(a) {
|
|||
'use strict';
|
||||
|
||||
// Get ID of code block
|
||||
const e = a.parentNode.parentNode.getElementsByTagName('CODE')[0];
|
||||
let s;
|
||||
let r;
|
||||
var e = a.parentNode.parentNode.getElementsByTagName('CODE')[0];
|
||||
var s;
|
||||
var r;
|
||||
|
||||
// Not IE and IE9+
|
||||
if (window.getSelection) {
|
||||
s = window.getSelection();
|
||||
// Safari and Chrome
|
||||
if (s.setBaseAndExtent) {
|
||||
const l = (e.innerText.length > 1) ? e.innerText.length - 1 : 1;
|
||||
var l = (e.innerText.length > 1) ? e.innerText.length - 1 : 1;
|
||||
try {
|
||||
s.setBaseAndExtent(e, 0, e, l);
|
||||
} catch (error) {
|
||||
|
@ -195,8 +196,8 @@ function selectCode(a) {
|
|||
}
|
||||
}
|
||||
|
||||
let inAutocomplete = false;
|
||||
let lastKeyEntered = '';
|
||||
var inAutocomplete = false;
|
||||
var lastKeyEntered = '';
|
||||
|
||||
/**
|
||||
* Check event key
|
||||
|
@ -234,7 +235,7 @@ jQuery($ => {
|
|||
'use strict';
|
||||
|
||||
$('form input[type=text], form input[type=password]').on('keypress', function(e) {
|
||||
const defaultButton = $(this).parents('form').find('input[type=submit].default-submit-action');
|
||||
var defaultButton = $(this).parents('form').find('input[type=submit].default-submit-action');
|
||||
|
||||
if (!defaultButton || defaultButton.length <= 0) {
|
||||
return true;
|
||||
|
@ -259,10 +260,10 @@ jQuery($ => {
|
|||
function insertUser(formId, value) {
|
||||
'use strict';
|
||||
|
||||
const $form = jQuery(formId);
|
||||
const formName = $form.attr('data-form-name');
|
||||
const fieldName = $form.attr('data-field-name');
|
||||
const item = opener.document.forms[formName][fieldName];
|
||||
var $form = jQuery(formId);
|
||||
var formName = $form.attr('data-form-name');
|
||||
var fieldName = $form.attr('data-field-name');
|
||||
var item = opener.document.forms[formName][fieldName];
|
||||
|
||||
if (item.value.length && item.type === 'textarea') {
|
||||
value = item.value + '\n' + value;
|
||||
|
@ -294,9 +295,9 @@ function insert_single_user(formId, user) {
|
|||
function parseDocument($container) {
|
||||
'use strict';
|
||||
|
||||
const test = document.createElement('div');
|
||||
const oldBrowser = (typeof test.style.borderRadius === 'undefined');
|
||||
const $body = $('body');
|
||||
var test = document.createElement('div');
|
||||
var oldBrowser = (typeof test.style.borderRadius === 'undefined');
|
||||
var $body = $('body');
|
||||
|
||||
/**
|
||||
* Reset avatar dimensions when changing URL or EMAIL
|
||||
|
@ -309,7 +310,7 @@ function parseDocument($container) {
|
|||
* Pagination
|
||||
*/
|
||||
$container.find('.pagination .page-jump-form :button').click(function() {
|
||||
const $input = $(this).siblings('input.inputbox');
|
||||
var $input = $(this).siblings('input.inputbox');
|
||||
pageJump($input);
|
||||
});
|
||||
|
||||
|
@ -321,7 +322,7 @@ function parseDocument($container) {
|
|||
});
|
||||
|
||||
$container.find('.pagination .dropdown-trigger').click(function() {
|
||||
const $dropdownContainer = $(this).parent();
|
||||
var $dropdownContainer = $(this).parent();
|
||||
// Wait a little bit to make sure the dropdown has activated
|
||||
setTimeout(() => {
|
||||
if ($dropdownContainer.hasClass('dropdown-visible')) {
|
||||
|
@ -334,27 +335,27 @@ function parseDocument($container) {
|
|||
* Resize navigation (breadcrumbs) block to keep all links on same line
|
||||
*/
|
||||
$container.find('.navlinks').each(function() {
|
||||
const $this = $(this);
|
||||
const $left = $this.children().not('.rightside');
|
||||
const $right = $this.children('.rightside');
|
||||
var $this = $(this);
|
||||
var $left = $this.children().not('.rightside');
|
||||
var $right = $this.children('.rightside');
|
||||
|
||||
if ($left.length !== 1 || !$right.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
function resize() {
|
||||
let width = 0;
|
||||
const diff = $left.outerWidth(true) - $left.width();
|
||||
const minWidth = Math.max($this.width() / 3, 240);
|
||||
var width = 0;
|
||||
var diff = $left.outerWidth(true) - $left.width();
|
||||
var minWidth = Math.max($this.width() / 3, 240);
|
||||
|
||||
$right.each(function() {
|
||||
const $this = $(this);
|
||||
var $this = $(this);
|
||||
if ($this.is(':visible')) {
|
||||
width += $this.outerWidth(true);
|
||||
}
|
||||
});
|
||||
|
||||
const maxWidth = $this.width() - width - diff;
|
||||
var maxWidth = $this.width() - width - diff;
|
||||
$left.css('max-width', Math.floor(Math.max(maxWidth, minWidth)) + 'px');
|
||||
}
|
||||
|
||||
|
@ -366,25 +367,25 @@ function parseDocument($container) {
|
|||
* Makes breadcrumbs responsive
|
||||
*/
|
||||
$container.find('.breadcrumbs:not([data-skip-responsive])').each(function() {
|
||||
const $this = $(this);
|
||||
const $links = $this.find('.crumb');
|
||||
const { length } = $links;
|
||||
const classes = [ 'wrapped-max', 'wrapped-wide', 'wrapped-medium', 'wrapped-small', 'wrapped-tiny' ];
|
||||
const classesLength = classes.length;
|
||||
let maxHeight = 0;
|
||||
let lastWidth = false;
|
||||
let wrapped = false;
|
||||
var $this = $(this);
|
||||
var $links = $this.find('.crumb');
|
||||
var { length } = $links;
|
||||
var classes = [ 'wrapped-max', 'wrapped-wide', 'wrapped-medium', 'wrapped-small', 'wrapped-tiny' ];
|
||||
var classesLength = classes.length;
|
||||
var maxHeight = 0;
|
||||
var lastWidth = false;
|
||||
var wrapped = false;
|
||||
|
||||
// Set tooltips
|
||||
$this.find('a').each(function() {
|
||||
const $link = $(this);
|
||||
var $link = $(this);
|
||||
$link.attr('title', $link.text());
|
||||
});
|
||||
|
||||
// Function that checks breadcrumbs
|
||||
function check() {
|
||||
const height = $this.height();
|
||||
let width;
|
||||
var height = $this.height();
|
||||
var width;
|
||||
|
||||
// Test max-width set in code for .navlinks above
|
||||
width = parseInt($this.css('max-width'), 10);
|
||||
|
@ -420,8 +421,8 @@ function parseDocument($container) {
|
|||
return;
|
||||
}
|
||||
|
||||
for (let i = 0; i < classesLength; i++) {
|
||||
for (let j = length - 1; j >= 0; j--) {
|
||||
for (var i = 0; i < classesLength; i++) {
|
||||
for (var j = length - 1; j >= 0; j--) {
|
||||
$links.eq(j).addClass('wrapped ' + classes[i]);
|
||||
if ($this.height() <= maxHeight) {
|
||||
return;
|
||||
|
@ -455,9 +456,9 @@ function parseDocument($container) {
|
|||
* responsive-show-all to list of classes
|
||||
*/
|
||||
$container.find('.topiclist.responsive-show-all > li > dl').each(function() {
|
||||
const $this = $(this);
|
||||
let $block = $this.find('dt .responsive-show:last-child');
|
||||
let first = true;
|
||||
var $this = $(this);
|
||||
var $block = $this.find('dt .responsive-show:last-child');
|
||||
var first = true;
|
||||
|
||||
// Create block that is visible only on mobile devices
|
||||
if ($block.length) {
|
||||
|
@ -469,9 +470,9 @@ function parseDocument($container) {
|
|||
|
||||
// Copy contents of each column
|
||||
$this.find('dd').not('.mark').each(function() {
|
||||
const column = $(this);
|
||||
const $children = column.children();
|
||||
let html = column.html();
|
||||
var column = $(this);
|
||||
var $children = column.children();
|
||||
var html = column.html();
|
||||
|
||||
if ($children.length === 1 && $children.text() === column.text()) {
|
||||
html = $children.html();
|
||||
|
@ -491,9 +492,9 @@ function parseDocument($container) {
|
|||
* responsive-show-columns to list of classes
|
||||
*/
|
||||
$container.find('.topiclist.responsive-show-columns').each(function() {
|
||||
const $list = $(this);
|
||||
const headers = [];
|
||||
let headersLength = 0;
|
||||
var $list = $(this);
|
||||
var headers = [];
|
||||
var headersLength = 0;
|
||||
|
||||
// Find all headers, get contents
|
||||
$list.prev('.topiclist').find('li.header dd').not('.mark').each(function() {
|
||||
|
@ -507,9 +508,9 @@ function parseDocument($container) {
|
|||
|
||||
// Parse each row
|
||||
$list.find('dl').each(function() {
|
||||
const $this = $(this);
|
||||
let $block = $this.find('dt .responsive-show:last-child');
|
||||
let first = true;
|
||||
var $this = $(this);
|
||||
var $block = $this.find('dt .responsive-show:last-child');
|
||||
var first = true;
|
||||
|
||||
// Create block that is visible only on mobile devices
|
||||
if ($block.length) {
|
||||
|
@ -521,9 +522,9 @@ function parseDocument($container) {
|
|||
|
||||
// Copy contents of each column
|
||||
$this.find('dd').not('.mark').each(function(i) {
|
||||
const column = $(this);
|
||||
const children = column.children();
|
||||
let html = column.html();
|
||||
var column = $(this);
|
||||
var children = column.children();
|
||||
var html = column.html();
|
||||
|
||||
if (children.length === 1 && children.text() === column.text()) {
|
||||
html = children.html();
|
||||
|
@ -545,18 +546,18 @@ function parseDocument($container) {
|
|||
* Responsive tables
|
||||
*/
|
||||
$container.find('table.table1').not('.not-responsive').each(function() {
|
||||
const $this = $(this);
|
||||
const $th = $this.find('thead > tr > th');
|
||||
const headers = [];
|
||||
let totalHeaders = 0;
|
||||
let i;
|
||||
var $this = $(this);
|
||||
var $th = $this.find('thead > tr > th');
|
||||
var headers = [];
|
||||
var totalHeaders = 0;
|
||||
var i;
|
||||
|
||||
// Find each header
|
||||
$th.each(function(column) {
|
||||
const cell = $(this);
|
||||
let colspan = parseInt(cell.attr('colspan'), 10);
|
||||
const dfn = cell.attr('data-dfn');
|
||||
const text = dfn ? dfn : cell.text();
|
||||
var cell = $(this);
|
||||
var colspan = parseInt(cell.attr('colspan'), 10);
|
||||
var dfn = cell.attr('data-dfn');
|
||||
var text = dfn ? dfn : cell.text();
|
||||
|
||||
colspan = isNaN(colspan) || colspan < 1 ? 1 : colspan;
|
||||
|
||||
|
@ -571,7 +572,7 @@ function parseDocument($container) {
|
|||
}
|
||||
});
|
||||
|
||||
const headersLength = headers.length;
|
||||
var headersLength = headers.length;
|
||||
|
||||
// Add header text to each cell as <dfn>
|
||||
$this.addClass('responsive');
|
||||
|
@ -582,9 +583,9 @@ function parseDocument($container) {
|
|||
}
|
||||
|
||||
$this.find('tbody > tr').each(function() {
|
||||
const row = $(this);
|
||||
const cells = row.children('td');
|
||||
let column = 0;
|
||||
var row = $(this);
|
||||
var cells = row.children('td');
|
||||
var column = 0;
|
||||
|
||||
if (cells.length === 1) {
|
||||
row.addClass('big-column');
|
||||
|
@ -592,9 +593,9 @@ function parseDocument($container) {
|
|||
}
|
||||
|
||||
cells.each(function() {
|
||||
const cell = $(this);
|
||||
let colspan = parseInt(cell.attr('colspan'), 10);
|
||||
const text = $.trim(cell.text());
|
||||
var cell = $(this);
|
||||
var colspan = parseInt(cell.attr('colspan'), 10);
|
||||
var text = $.trim(cell.text());
|
||||
|
||||
if (headersLength <= column) {
|
||||
return;
|
||||
|
@ -618,7 +619,7 @@ function parseDocument($container) {
|
|||
* Hide empty responsive tables
|
||||
*/
|
||||
$container.find('table.responsive > tbody').not('.responsive-skip-empty').each(function() {
|
||||
const $items = $(this).children('tr');
|
||||
var $items = $(this).children('tr');
|
||||
if (!$items.length) {
|
||||
$(this).parent('table:first').addClass('responsive-hide');
|
||||
}
|
||||
|
@ -628,24 +629,24 @@ function parseDocument($container) {
|
|||
* Responsive tabs
|
||||
*/
|
||||
$container.find('#tabs, #minitabs').not('[data-skip-responsive]').each(function() {
|
||||
const $this = $(this);
|
||||
const $ul = $this.children();
|
||||
const $tabs = $ul.children().not('[data-skip-responsive]');
|
||||
const $links = $tabs.children('a');
|
||||
const $item = $ul.append('<li class="tab responsive-tab" style="display:none;"><a href="javascript:void(0);" class="responsive-tab-link"> </a><div class="dropdown tab-dropdown" style="display: none;"><div class="pointer"><div class="pointer-inner"></div></div><ul class="dropdown-contents" /></div></li>').find('li.responsive-tab');
|
||||
const $menu = $item.find('.dropdown-contents');
|
||||
let maxHeight = 0;
|
||||
let lastWidth = false;
|
||||
let responsive = false;
|
||||
var $this = $(this);
|
||||
var $ul = $this.children();
|
||||
var $tabs = $ul.children().not('[data-skip-responsive]');
|
||||
var $links = $tabs.children('a');
|
||||
var $item = $ul.append('<li class="tab responsive-tab" style="display:none;"><a href="javascript:void(0);" class="responsive-tab-link"> </a><div class="dropdown tab-dropdown" style="display: none;"><div class="pointer"><div class="pointer-inner"></div></div><ul class="dropdown-contents" /></div></li>').find('li.responsive-tab');
|
||||
var $menu = $item.find('.dropdown-contents');
|
||||
var maxHeight = 0;
|
||||
var lastWidth = false;
|
||||
var responsive = false;
|
||||
|
||||
$links.each(function() {
|
||||
const $this = $(this);
|
||||
var $this = $(this);
|
||||
maxHeight = Math.max(maxHeight, Math.max($this.outerHeight(true), $this.parent().outerHeight(true)));
|
||||
});
|
||||
|
||||
function check() {
|
||||
const width = $body.width();
|
||||
let height = $this.height();
|
||||
var width = $body.width();
|
||||
var height = $this.height();
|
||||
|
||||
if (!arguments.length && (!responsive || width <= lastWidth) && height <= maxHeight) {
|
||||
return;
|
||||
|
@ -668,10 +669,10 @@ function parseDocument($container) {
|
|||
$item.show();
|
||||
$menu.html('');
|
||||
|
||||
const $availableTabs = $tabs.filter(':not(.activetab, .responsive-tab)');
|
||||
const total = $availableTabs.length;
|
||||
let i;
|
||||
let $tab;
|
||||
var $availableTabs = $tabs.filter(':not(.activetab, .responsive-tab)');
|
||||
var total = $availableTabs.length;
|
||||
var i;
|
||||
var $tab;
|
||||
|
||||
for (i = total - 1; i >= 0; i--) {
|
||||
$tab = $availableTabs.eq(i);
|
||||
|
@ -690,7 +691,7 @@ function parseDocument($container) {
|
|||
});
|
||||
}
|
||||
|
||||
const $tabLink = $item.find('a.responsive-tab-link');
|
||||
var $tabLink = $item.find('a.responsive-tab-link');
|
||||
phpbb.registerDropdown($tabLink, $item.find('.dropdown'), {
|
||||
visibleClass: 'activetab',
|
||||
});
|
||||
|
@ -703,7 +704,7 @@ function parseDocument($container) {
|
|||
* Hide UCP/MCP navigation if there is only 1 item
|
||||
*/
|
||||
$container.find('#navigation').each(function() {
|
||||
const $items = $(this).children('ol, ul').children('li');
|
||||
var $items = $(this).children('ol, ul').children('li');
|
||||
if ($items.length === 1) {
|
||||
$(this).addClass('responsive-hide');
|
||||
}
|
||||
|
@ -713,10 +714,10 @@ function parseDocument($container) {
|
|||
* Replace responsive text
|
||||
*/
|
||||
$container.find('[data-responsive-text]').each(function() {
|
||||
const $this = $(this);
|
||||
const fullText = $this.text();
|
||||
const responsiveText = $this.attr('data-responsive-text');
|
||||
let responsive = false;
|
||||
var $this = $(this);
|
||||
var fullText = $this.text();
|
||||
var responsiveText = $this.attr('data-responsive-text');
|
||||
var responsive = false;
|
||||
|
||||
function check() {
|
||||
if ($(window).width() > 700) {
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
<!--
|
||||
phpBB style name: prosilver
|
||||
Based on style: prosilver (this is the default phpBB3 style)
|
||||
Based on style: prosilver (this is the default phpBB style)
|
||||
Original author: Tom Beddard ( http://www.subBlue.com/ )
|
||||
Modified by:
|
||||
-->
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* phpBB3 Style Sheet
|
||||
/* phpBB Style Sheet
|
||||
--------------------------------------------------------------
|
||||
Style name: prosilver (the default phpBB 3.3.x style)
|
||||
Style name: prosilver (the default phpBB style)
|
||||
Based on style:
|
||||
Original author: Tom Beddard ( http://www.subblue.com/ )
|
||||
Modified by: phpBB Limited ( https://www.phpbb.com/ )
|
||||
|
|
|
@ -165,7 +165,7 @@ phpBB allows you to write such tests.
|
|||
Running
|
||||
-------
|
||||
|
||||
Running the tests requires your phpBB3 repository to be accessible through a
|
||||
Running the tests requires your phpBB repository to be accessible through a
|
||||
local web server. You will need to supply the URL to the webserver in
|
||||
the 'tests/test_config.php' file. This is as simple as defining the
|
||||
'$phpbb_functional_url' variable, which contains the URL for the directory containing
|
||||
|
@ -173,7 +173,7 @@ the board. Make sure you include the trailing slash. Note that without extensive
|
|||
changes to the test framework, you cannot use a board outside of the repository
|
||||
on which to run tests.
|
||||
|
||||
$phpbb_functional_url = 'http://localhost/phpBB3/';
|
||||
$phpbb_functional_url = 'http://localhost/phpBB/';
|
||||
|
||||
Functional tests are automatically run, if '$phpbb_functional_url' is configured.
|
||||
If you only want the functional tests, run:
|
||||
|
|
|
@ -22,12 +22,12 @@ class phpbb_controller_helper_route_slash_test extends phpbb_controller_common_h
|
|||
|
||||
protected function get_uri()
|
||||
{
|
||||
return '/phpBB3/app.php';
|
||||
return '/phpBB/app.php';
|
||||
}
|
||||
|
||||
protected function get_base_uri()
|
||||
{
|
||||
return '/phpBB3/';
|
||||
return '/phpBB/';
|
||||
}
|
||||
|
||||
protected function get_script_name()
|
||||
|
@ -37,6 +37,6 @@ class phpbb_controller_helper_route_slash_test extends phpbb_controller_common_h
|
|||
|
||||
protected function path_to_app()
|
||||
{
|
||||
return 'phpBB3/';
|
||||
return 'phpBB/';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -352,11 +352,11 @@ class phpbb_event_php_exporter_test extends phpbb_test_case
|
|||
array(
|
||||
"\t/**",
|
||||
"\t*/",
|
||||
"\t\$vars = array('_Strange123', 'phpBB3_Test');",
|
||||
"\t\$vars = array('_Strange123', 'phpBB_Test');",
|
||||
"\t\$this->dispatcher->dispatch('test');",
|
||||
),
|
||||
3,
|
||||
array('_Strange123', 'phpBB3_Test'),
|
||||
array('_Strange123', 'phpBB_Test'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ class phpbb_functional_notification_test extends phpbb_functional_test_case
|
|||
$this->login('notificationtestuser');
|
||||
|
||||
// Post a new post that needs approval
|
||||
$this->create_post(2, 1, 'Re: Welcome to phpBB3', 'This is a test [b]post[/b] posted by notificationtestuser.', array(), 'POST_STORED_MOD');
|
||||
$this->create_post(2, 1, 'Re: Welcome to phpBB', 'This is a test [b]post[/b] posted by notificationtestuser.', array(), 'POST_STORED_MOD');
|
||||
$crawler = self::request('GET', "viewtopic.php?t=1&sid={$this->sid}");
|
||||
$this->assertStringNotContainsString('This is a test post posted by notificationtestuser.', $crawler->filter('html')->text());
|
||||
|
||||
|
|
|
@ -193,13 +193,13 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
|
|||
|
||||
foreach (['', 'a', 't', 'f', 'i', 's'] as $sort_key)
|
||||
{
|
||||
$this->assert_search_found('phpbb3+installation', 1, 4, $sort_key);
|
||||
$this->assert_search_found('phpbb+installation', 1, 4, $sort_key);
|
||||
$this->assert_search_found('foosubject+barsearch', 1, 2, $sort_key);
|
||||
$this->assert_search_found('barsearch-testing', 1, 2, $sort_key); // test hyphen ignored
|
||||
$this->assert_search_found('barsearch+-+testing', 1, 2, $sort_key); // test hyphen wrapped with space ignored
|
||||
$this->assert_search_found('multiple+results+count', 3, 15, $sort_key); // test multiple results count - posts
|
||||
$this->assert_search_found_topics('multiple+results+count', 2, $sort_key); // test multiple results count - topics
|
||||
$this->assert_search_found_topics('phpbb3+installation', 1, $sort_key);
|
||||
$this->assert_search_found_topics('phpbb+installation', 1, $sort_key);
|
||||
$this->assert_search_found_topics('foosubject+barsearch', 1, $sort_key);
|
||||
|
||||
$this->assert_search_in_forum(2, 'multiple+search+results', 3, $sort_key); // test multiple results count - forum search - posts
|
||||
|
@ -346,11 +346,11 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
|
|||
// Get cached post ids data
|
||||
$cache = $this->get_cache_driver();
|
||||
$post_ids_cached = $cache->get($cache_varname);
|
||||
|
||||
|
||||
$cached_results_count = count($post_ids_cached) - 2; // Don't count '-1' and '-2' indexes
|
||||
|
||||
$post_ids_cached_backup = $post_ids_cached;
|
||||
|
||||
|
||||
// Cached data still should have initial 'd' sort direction
|
||||
$this->assertTrue($post_ids_cached[-2] === 'd', $this->search_backend);
|
||||
|
||||
|
|
|
@ -141,22 +141,22 @@ class phpbb_path_helper_test extends phpbb_test_case
|
|||
array(
|
||||
$this->phpbb_root_path . 'test.php',
|
||||
'/foo/template',
|
||||
'/phpbb3-fork/phpBB/app.php/foo/template',
|
||||
'/phpbb3-fork/phpBB/app.php',
|
||||
'/phpbb-fork/phpBB/app.php/foo/template',
|
||||
'/phpbb-fork/phpBB/app.php',
|
||||
'./../../',
|
||||
),
|
||||
array(
|
||||
$this->phpbb_root_path . 'test.php',
|
||||
'/foo/template',
|
||||
'/phpbb3-fork/phpBB/foo/template',
|
||||
'/phpbb3-fork/phpBB/app.php',
|
||||
'/phpbb-fork/phpBB/foo/template',
|
||||
'/phpbb-fork/phpBB/app.php',
|
||||
'./../',
|
||||
),
|
||||
array(
|
||||
$this->phpbb_root_path . 'test.php',
|
||||
'/',
|
||||
'/phpbb3-fork/phpBB/app.php/',
|
||||
'/phpbb3-fork/phpBB/app.php',
|
||||
'/phpbb-fork/phpBB/app.php/',
|
||||
'/phpbb-fork/phpBB/app.php',
|
||||
'./../',
|
||||
),
|
||||
|
||||
|
@ -171,29 +171,29 @@ class phpbb_path_helper_test extends phpbb_test_case
|
|||
array(
|
||||
'./../../' . $this->phpbb_root_path . 'test.php',
|
||||
'/foo/template',
|
||||
'/phpbb3-fork/phpBB/app.php/foo/template',
|
||||
'/phpbb3-fork/phpBB/app.php',
|
||||
'/phpbb-fork/phpBB/app.php/foo/template',
|
||||
'/phpbb-fork/phpBB/app.php',
|
||||
'',
|
||||
),
|
||||
array(
|
||||
'./../' . $this->phpbb_root_path . 'test.php',
|
||||
'/foo/template',
|
||||
'/phpbb3-fork/phpBB/foo/template',
|
||||
'/phpbb3-fork/phpBB/app.php',
|
||||
'/phpbb-fork/phpBB/foo/template',
|
||||
'/phpbb-fork/phpBB/app.php',
|
||||
'',
|
||||
),
|
||||
array(
|
||||
'./../'.$this->phpbb_root_path . 'test.php',
|
||||
'/',
|
||||
'/phpbb3-fork/phpBB/app.php/',
|
||||
'/phpbb3-fork/phpBB/app.php',
|
||||
'/phpbb-fork/phpBB/app.php/',
|
||||
'/phpbb-fork/phpBB/app.php',
|
||||
'',
|
||||
),
|
||||
array(
|
||||
'./../'.$this->phpbb_root_path . 'test.php',
|
||||
'',
|
||||
'/phpbb3-fork/phpBB/foo',
|
||||
'/phpbb3-fork/phpBB/app.php',
|
||||
'/phpbb-fork/phpBB/foo',
|
||||
'/phpbb-fork/phpBB/app.php',
|
||||
'',
|
||||
),
|
||||
);
|
||||
|
|
|
@ -17,7 +17,7 @@ class phpbb_regex_table_prefix_test extends phpbb_test_case
|
|||
{
|
||||
return array(
|
||||
array('phpbb_', 1),
|
||||
array('phpBB3', 1),
|
||||
array('phpBB', 1),
|
||||
array('a', 1),
|
||||
|
||||
array('', 0),
|
||||
|
|
|
@ -227,7 +227,7 @@ class test_ucp_controller_webpush_test extends phpbb_database_test_case
|
|||
$this->assertEquals([
|
||||
'heading' => 'yourdomain.com',
|
||||
'title' => 'Quoted by Guest in:',
|
||||
'text' => '"Welcome to phpBB3"',
|
||||
'text' => '"Welcome to phpBB"',
|
||||
'url' => 'phpBB/viewtopic.php?p=1#p1',
|
||||
'avatar' => [],
|
||||
], $response_data);
|
||||
|
@ -285,7 +285,7 @@ class test_ucp_controller_webpush_test extends phpbb_database_test_case
|
|||
$this->assertEquals([
|
||||
'heading' => 'yourdomain.com',
|
||||
'title' => 'Quoted by Guest in:',
|
||||
'text' => '"Welcome to phpBB3"',
|
||||
'text' => '"Welcome to phpBB"',
|
||||
'url' => 'phpBB/viewtopic.php?p=1#p1',
|
||||
'avatar' => [],
|
||||
], $response_data);
|
||||
|
@ -393,7 +393,7 @@ class test_ucp_controller_webpush_test extends phpbb_database_test_case
|
|||
$this->assertEquals([
|
||||
'heading' => 'yourdomain.com',
|
||||
'title' => 'Quoted by Guest in:',
|
||||
'text' => '"Welcome to phpBB3"',
|
||||
'text' => '"Welcome to phpBB"',
|
||||
'url' => 'phpBB/viewtopic.php?p=1#p1',
|
||||
'avatar' => [],
|
||||
], $response_data);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<column>notification_time</column>
|
||||
<row>
|
||||
<value>1</value>
|
||||
<value><![CDATA[{"item_id":1,"notification_type_id":4,"item_parent_id":1,"notification_time":1738437884,"notification_read":false,"notification_data":"a:6:{s:9:\"poster_id\";i:3;s:11:\"topic_title\";s:17:\"Welcome to phpBB3\";s:12:\"post_subject\";s:21:\"Re: Welcome to phpBB3\";s:13:\"post_username\";s:0:\"\";s:8:\"forum_id\";i:2;s:10:\"forum_name\";s:16:\"Your first forum\";}","user_id":2,"notification_type_name":"notification.type.quote"}]]></value>
|
||||
<value><![CDATA[{"item_id":1,"notification_type_id":4,"item_parent_id":1,"notification_time":1738437884,"notification_read":false,"notification_data":"a:6:{s:9:\"poster_id\";i:3;s:11:\"topic_title\";s:16:\"Welcome to phpBB\";s:12:\"post_subject\";s:20:\"Re: Welcome to phpBB\";s:13:\"post_username\";s:0:\"\";s:8:\"forum_id\";i:2;s:10:\"forum_name\";s:16:\"Your first forum\";}","user_id":2,"notification_type_name":"notification.type.quote"}]]></value>
|
||||
<value>488c17afe4f18714c235b395e21b78df1c3d78bf1e13d0633ed9425d2eebf967</value>
|
||||
<value>2</value>
|
||||
<value>4</value>
|
||||
|
@ -17,7 +17,7 @@
|
|||
</row>
|
||||
<row>
|
||||
<value>2</value>
|
||||
<value><![CDATA[{"heading":"yourdomain.com","title":"Quoted by Guest in:","text":"\"Welcome to phpBB3\"","url":"phpBB\/viewtopic.php?p=1#p1","avatar":[]}]]></value>
|
||||
<value><![CDATA[{"heading":"yourdomain.com","title":"Quoted by Guest in:","text":"\"Welcome to phpBB\"","url":"phpBB\/viewtopic.php?p=1#p1","avatar":[]}]]></value>
|
||||
<value>488c17afe4f18714c235b395e21b78df1c3d78bf1e13d0633ed9425d2eebf967</value>
|
||||
<value>2</value>
|
||||
<value>4</value>
|
||||
|
|
Loading…
Add table
Reference in a new issue