mirror of
https://github.com/phpbb/phpbb.git
synced 2025-09-18 20:11:47 +02:00
Compare commits
356 Commits
release-3.
...
olympus_me
Author | SHA1 | Date | |
---|---|---|---|
|
1ef96b504d | ||
|
8c9af252cb | ||
|
7e95a3ee6c | ||
|
79f2dedb51 | ||
|
c48f64ce94 | ||
|
a39e879300 | ||
|
a0c9705bb7 | ||
|
bb5c5adab1 | ||
|
c076becc5a | ||
|
4e3d564be6 | ||
|
16e8b8271b | ||
|
9ef743ba7d | ||
|
79dc2e79b2 | ||
|
a236d24ae5 | ||
|
eddddaa3a4 | ||
|
d054940739 | ||
|
45ac6aba10 | ||
|
b68a102491 | ||
|
be17000b92 | ||
|
f49fe16766 | ||
|
132a1d2efa | ||
|
81b57da147 | ||
|
4379b3d7bc | ||
|
b4bf675273 | ||
|
764c1c4f2b | ||
|
0d92e30b38 | ||
|
d57b4d0b48 | ||
|
de51ec8a15 | ||
|
7b5dc8f3c5 | ||
|
c95f0c7935 | ||
|
332521a369 | ||
|
9954d9c29f | ||
|
81c44f8351 | ||
|
f816e67c36 | ||
|
528bd80651 | ||
|
0955e2e539 | ||
|
ae9c4068e7 | ||
|
21573a8473 | ||
|
0b11951412 | ||
|
c8cba06910 | ||
|
bcfcf9b048 | ||
|
07e9b83a3d | ||
|
8427ae3fd4 | ||
|
6e2d2f85b5 | ||
|
500eb05c48 | ||
|
3f11fc12ac | ||
|
aa3a2f565b | ||
|
3bd6984785 | ||
|
dcf0b15c9f | ||
|
ff22d7a368 | ||
|
f4c079a62b | ||
|
d26f38c4e0 | ||
|
99fa62267e | ||
|
74121b41fa | ||
|
416270ee77 | ||
|
efe06af913 | ||
|
04f7c1da69 | ||
|
a9274f1d63 | ||
|
08bd36f0b2 | ||
|
d46e8e6f98 | ||
|
47b4b83468 | ||
|
c8e3035a4b | ||
|
ef0c0d4c82 | ||
|
1739da9335 | ||
|
36635929a8 | ||
|
f353fd2d57 | ||
|
6a15c2a936 | ||
|
c903b453fa | ||
|
1b10cb9c37 | ||
|
d0e630157c | ||
|
69cfb5b821 | ||
|
baf8d571e3 | ||
|
5ce6035aad | ||
|
746b617807 | ||
|
9c7d8dcd7d | ||
|
73db74dfa1 | ||
|
d4c8a078a2 | ||
|
9d9d61b1a2 | ||
|
89f1b88fe1 | ||
|
9a7804cb71 | ||
|
8f2b4562b1 | ||
|
18bfc5e69b | ||
|
ad4d7c036e | ||
|
e4c3a743ca | ||
|
f3844a17f7 | ||
|
c439b286e9 | ||
|
0b6dd99a76 | ||
|
0a4c62f12e | ||
|
1cc419fb4c | ||
|
f6a47c6f82 | ||
|
10d3191198 | ||
|
9f9a89c78e | ||
|
884cde18fe | ||
|
ec1be2563c | ||
|
ec88ec534b | ||
|
bb97d3531a | ||
|
ce6b87ccec | ||
|
b486710ea1 | ||
|
aa9dbcec3c | ||
|
08428f8fa1 | ||
|
0f14f278d0 | ||
|
c67fa83652 | ||
|
1f6eea1b5b | ||
|
6f0ea3c9d2 | ||
|
8fd7f16642 | ||
|
80ced5c0b7 | ||
|
01c1c27f2c | ||
|
eee2f89ace | ||
|
461be11e8d | ||
|
5349280538 | ||
|
24da8c474d | ||
|
158a15ba9c | ||
|
958d077faa | ||
|
4649b93e0d | ||
|
2fc6d5147a | ||
|
e2736dea20 | ||
|
76c0e5aa5e | ||
|
d135060c12 | ||
|
3b79fd122e | ||
|
b6949c47ec | ||
|
235f552974 | ||
|
1651c5df57 | ||
|
17ec98b834 | ||
|
cc5d77e06d | ||
|
2eeeaadcfd | ||
|
de0bc7476a | ||
|
ca07af715f | ||
|
46b4d09e3a | ||
|
af26b56470 | ||
|
310375db66 | ||
|
e5425dfd46 | ||
|
0e0100c525 | ||
|
a32f3a6709 | ||
|
10c8d29205 | ||
|
6f754d49e4 | ||
|
c83e6f7e94 | ||
|
3a330753f4 | ||
|
a736c97c04 | ||
|
199ab53f30 | ||
|
63e2f5cf14 | ||
|
4658e3f828 | ||
|
44416f4744 | ||
|
0dbe7e3b6c | ||
|
f2abefeaed | ||
|
57ec5805df | ||
|
73da6084d0 | ||
|
323fb23b49 | ||
|
cbacffd9fc | ||
|
589db44b56 | ||
|
8174462e89 | ||
|
a45ac24bd7 | ||
|
3a3b9eb8ef | ||
|
76a542a03e | ||
|
d67b943ef6 | ||
|
b46bd90f6e | ||
|
c119d0b424 | ||
|
15e04808fc | ||
|
4235be4bcb | ||
|
f741c4ff05 | ||
|
8236a7438d | ||
|
ae27aaf1a4 | ||
|
cec12340b9 | ||
|
f405535730 | ||
|
6eed0e5bd2 | ||
|
6a401ab68b | ||
|
b3e2250391 | ||
|
c002c468c4 | ||
|
1071d9cb31 | ||
|
48701289ff | ||
|
360e245a1a | ||
|
97b5920055 | ||
|
492354344b | ||
|
c1cf3404a2 | ||
|
96948b010c | ||
|
9047c986da | ||
|
4580ca9683 | ||
|
be1849a901 | ||
|
e9b2e6174e | ||
|
fe93fa0e9d | ||
|
dceaf59d3b | ||
|
db4011c9d9 | ||
|
7c79d0f860 | ||
|
8c186d97c6 | ||
|
1b67e80422 | ||
|
d8f2c4a1c4 | ||
|
41d3effa19 | ||
|
e6e9618be6 | ||
|
0c4ae1cd97 | ||
|
036dc071e7 | ||
|
d5d7de4ffa | ||
|
79dd5b164b | ||
|
e0799b79e2 | ||
|
95462dca58 | ||
|
ad739a358c | ||
|
3892e7330a | ||
|
aeb36226c0 | ||
|
eeba8f4560 | ||
|
677e6451c4 | ||
|
c44d2edc4a | ||
|
50dd4c183a | ||
|
97d2fb55b7 | ||
|
0ebc5cc9ee | ||
|
0ca7e81ca4 | ||
|
fc8db76da9 | ||
|
d168abdcc9 | ||
|
50f5502cc9 | ||
|
e199f55ba2 | ||
|
d7a217c28c | ||
|
8f3c085f7f | ||
|
4ba2921cec | ||
|
fe2343965b | ||
|
d0140a096c | ||
|
fc126eec66 | ||
|
1aa40171e0 | ||
|
6a59f3efd6 | ||
|
b54a9ec1e2 | ||
|
24b9d6432f | ||
|
7524ca5249 | ||
|
4dddc3a130 | ||
|
8822747b91 | ||
|
ea3eb9e9c3 | ||
|
a156e31f0c | ||
|
443ec9dcb0 | ||
|
e08a400b9f | ||
|
a11f41986f | ||
|
150c6c4c24 | ||
|
e8b7c45d85 | ||
|
e8e807f797 | ||
|
65fb840b76 | ||
|
59e6bc27f1 | ||
|
7591a84c0d | ||
|
990e3cd4b2 | ||
|
de5ddf3907 | ||
|
7c159b8c6e | ||
|
98dadd5eb8 | ||
|
8ce9e1b852 | ||
|
2f4a618900 | ||
|
91b4fe1868 | ||
|
28e8c3ea85 | ||
|
0c1fa73423 | ||
|
e7a043a22a | ||
|
53dc95d429 | ||
|
41d8c20836 | ||
|
8dde998e87 | ||
|
9aac603888 | ||
|
2cfc6b7e0b | ||
|
6871e7caa4 | ||
|
0d631c2ae0 | ||
|
1219ff4717 | ||
|
22f6e1ed1e | ||
|
eb664ddafb | ||
|
771fd3696d | ||
|
b1915b6f25 | ||
|
378838499e | ||
|
60aad364c8 | ||
|
52400baafa | ||
|
ebb801ebff | ||
|
4b9077a58b | ||
|
5e7c936618 | ||
|
c5dcff536a | ||
|
91d0c8b3bf | ||
|
f2ba40f294 | ||
|
0cf75b2546 | ||
|
5c2b9b17d1 | ||
|
dbae1db24c | ||
|
82454165c3 | ||
|
4879a7a075 | ||
|
c5081a685e | ||
|
2deee69e2f | ||
|
3e42df098c | ||
|
45c97a40d2 | ||
|
b935389427 | ||
|
195cd7e148 | ||
|
22c304092e | ||
|
7596a3bfdc | ||
|
a3da99f358 | ||
|
6a30daeb59 | ||
|
5417ec5c4d | ||
|
65b0f6b165 | ||
|
6c8a8163e8 | ||
|
312bd1a670 | ||
|
02a5032a52 | ||
|
c34599126f | ||
|
9b96e12678 | ||
|
d1f48526d7 | ||
|
8c64d7c32a | ||
|
f115ab68a5 | ||
|
cf17b13c98 | ||
|
da966fed65 | ||
|
a765c1aba1 | ||
|
f465cdd782 | ||
|
05ba2058c6 | ||
|
2a3eb724a8 | ||
|
30b24d476c | ||
|
f83b47bc11 | ||
|
42073ab0af | ||
|
a800565393 | ||
|
0c5839a0b9 | ||
|
2cedbbac09 | ||
|
6dc85449c1 | ||
|
95f11a38c0 | ||
|
65ba4fe94e | ||
|
b33ec670a2 | ||
|
3b669aedfd | ||
|
7b262babcd | ||
|
e9e9e8e69c | ||
|
2e5e0a7868 | ||
|
9a4a3a089a | ||
|
48ed77f046 | ||
|
4b5fab372f | ||
|
1407460895 | ||
|
e970da6514 | ||
|
1819be3ed1 | ||
|
9f5841219a | ||
|
e683deeeb8 | ||
|
fedee2c07e | ||
|
7fed5dd166 | ||
|
e6991260df | ||
|
dbcf8a6f31 | ||
|
835558ea38 | ||
|
8608cea5c8 | ||
|
18a081bc6c | ||
|
5195509f3b | ||
|
13ee383aad | ||
|
9dcb557a5e | ||
|
b9da54ba91 | ||
|
24a359e9f5 | ||
|
cbb4db46b2 | ||
|
35f59ceb9a | ||
|
b9b46a8b45 | ||
|
7193d91e40 | ||
|
370e189f15 | ||
|
b4e64655af | ||
|
2928574ed4 | ||
|
159ce6f8d1 | ||
|
5dddcb42ae | ||
|
6dfa770986 | ||
|
2f08a36062 | ||
|
57645ad5bc | ||
|
f0dea06097 | ||
|
a4633d8ac0 | ||
|
3b29db4545 | ||
|
f14f82775f | ||
|
af738dbc2a | ||
|
edd6c34eda | ||
|
6b8f2fb4cc | ||
|
a7c29a06bf | ||
|
12d7c9b007 | ||
|
4b1b950068 | ||
|
85055ac97f | ||
|
0f26ffbade | ||
|
fe56349e34 | ||
|
5eb46fb67e | ||
|
c3ef1109c0 | ||
|
bf2741ca80 | ||
|
253c07733e |
210
code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php
Normal file
210
code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php
Normal file
@@ -0,0 +1,210 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package code_sniffer
|
||||
* @version $Id: $
|
||||
* @copyright (c) 2007 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Checks that each source file contains the standard header.
|
||||
*
|
||||
* Based on Coding Guidelines 1.ii File Header.
|
||||
*
|
||||
* @package code_sniffer
|
||||
* @author Manuel Pichler <mapi@phpundercontrol.org>
|
||||
*/
|
||||
class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
|
||||
{
|
||||
/**
|
||||
* Returns an array of tokens this test wants to listen for.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
return array(T_OPEN_TAG);
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes this test, when one of its tokens is encountered.
|
||||
*
|
||||
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
|
||||
* @param int $stackPtr The position of the current token
|
||||
* in the stack passed in $tokens.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
|
||||
{
|
||||
// We are only interested in the first file comment.
|
||||
if ($stackPtr !== 0)
|
||||
{
|
||||
if ($phpcsFile->findPrevious(T_OPEN_TAG, $stackPtr - 1) !== false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Fetch next non whitespace token
|
||||
$tokens = $phpcsFile->getTokens();
|
||||
$start = $phpcsFile->findNext(T_WHITESPACE, $stackPtr + 1, null, true);
|
||||
|
||||
// Skip empty files
|
||||
if ($tokens[$start]['code'] === T_CLOSE_TAG)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Mark as error if this is not a doc comment
|
||||
else if ($start === false || $tokens[$start]['code'] !== T_DOC_COMMENT)
|
||||
{
|
||||
$phpcsFile->addError('Missing required file doc comment.', $stackPtr);
|
||||
return;
|
||||
}
|
||||
|
||||
// Find comment end token
|
||||
$end = $phpcsFile->findNext(T_DOC_COMMENT, $start + 1, null, true) - 1;
|
||||
|
||||
// If there is no end, skip processing here
|
||||
if ($end === false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// List of found comment tags
|
||||
$tags = array();
|
||||
|
||||
// check comment lines without the first(/**) an last(*/) line
|
||||
for ($i = $start + 1, $c = ($end - $start); $i <= $c; ++$i)
|
||||
{
|
||||
$line = $tokens[$i]['content'];
|
||||
|
||||
// Check that each line starts with a '*'
|
||||
if (substr($line, 0, 1) !== '*')
|
||||
{
|
||||
$message = 'The file doc comment should not be idented.';
|
||||
$phpcsFile->addWarning($message, $i);
|
||||
}
|
||||
else if (preg_match('/^\*\s+@([\w]+)\s+(.*)$/', $line, $match) !== 0)
|
||||
{
|
||||
$tags[$match[1]] = array($match[2], $i);
|
||||
}
|
||||
}
|
||||
|
||||
// Check that the first and last line is empty
|
||||
if (trim($tokens[$start + 1]['content']) !== '*')
|
||||
{
|
||||
$message = 'The first file comment line should be empty.';
|
||||
$phpcsFile->addWarning($message, ($start + 1));
|
||||
}
|
||||
if (trim($tokens[$end - $start]['content']) !== '*')
|
||||
{
|
||||
$message = 'The last file comment line should be empty.';
|
||||
$phpcsFile->addWarning($message, ($end - $start));
|
||||
}
|
||||
|
||||
$this->processPackage($phpcsFile, $start, $tags);
|
||||
$this->processVersion($phpcsFile, $start, $tags);
|
||||
$this->processCopyright($phpcsFile, $start, $tags);
|
||||
$this->processLicense($phpcsFile, $start, $tags);
|
||||
|
||||
//print_r($tags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the tags array contains a valid package tag
|
||||
*
|
||||
* @param PHP_CodeSniffer_File $phpcsFile The context source file instance.
|
||||
* @param integer The stack pointer for the first comment token.
|
||||
* @param array(string=>array) $tags The found file doc comment tags.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function processPackage(PHP_CodeSniffer_File $phpcsFile, $ptr, $tags)
|
||||
{
|
||||
if (!isset($tags['package']))
|
||||
{
|
||||
$message = 'Missing require @package tag in file doc comment.';
|
||||
$phpcsFile->addError($message, $ptr);
|
||||
}
|
||||
else if (preg_match('/^([\w]+)$/', $tags['package'][0]) === 0)
|
||||
{
|
||||
$message = 'Invalid content found for @package tag.';
|
||||
$phpcsFile->addWarning($message, $tags['package'][1]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the tags array contains a valid version tag
|
||||
*
|
||||
* @param PHP_CodeSniffer_File $phpcsFile The context source file instance.
|
||||
* @param integer The stack pointer for the first comment token.
|
||||
* @param array(string=>array) $tags The found file doc comment tags.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function processVersion(PHP_CodeSniffer_File $phpcsFile, $ptr, $tags)
|
||||
{
|
||||
if (!isset($tags['version']))
|
||||
{
|
||||
$message = 'Missing require @version tag in file doc comment.';
|
||||
$phpcsFile->addError($message, $ptr);
|
||||
}
|
||||
else if (preg_match('/^\$Id:[^\$]+\$$/', $tags['version'][0]) === 0)
|
||||
{
|
||||
$message = 'Invalid content found for @version tag, use "$Id: $".';
|
||||
$phpcsFile->addError($message, $tags['version'][1]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the tags array contains a valid copyright tag
|
||||
*
|
||||
* @param PHP_CodeSniffer_File $phpcsFile The context source file instance.
|
||||
* @param integer The stack pointer for the first comment token.
|
||||
* @param array(string=>array) $tags The found file doc comment tags.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function processCopyright(PHP_CodeSniffer_File $phpcsFile, $ptr, $tags)
|
||||
{
|
||||
if (!isset($tags['copyright']))
|
||||
{
|
||||
$message = 'Missing require @copyright tag in file doc comment.';
|
||||
$phpcsFile->addError($message, $ptr);
|
||||
}
|
||||
else if (preg_match('/^\(c\) 2[0-9]{3} phpBB Group\s*$/', $tags['copyright'][0]) === 0)
|
||||
{
|
||||
$message = 'Invalid content found for @copyright tag, use "(c) <year> phpBB Group".';
|
||||
$phpcsFile->addError($message, $tags['copyright'][1]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the tags array contains a valid license tag
|
||||
*
|
||||
* @param PHP_CodeSniffer_File $phpcsFile The context source file instance.
|
||||
* @param integer The stack pointer for the first comment token.
|
||||
* @param array(string=>array) $tags The found file doc comment tags.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function processLicense(PHP_CodeSniffer_File $phpcsFile, $ptr, $tags)
|
||||
{
|
||||
$license = 'http://opensource.org/licenses/gpl-license.php GNU Public License';
|
||||
|
||||
if (!isset($tags['license']))
|
||||
{
|
||||
$message = 'Missing require @license tag in file doc comment.';
|
||||
$phpcsFile->addError($message, $ptr);
|
||||
}
|
||||
else if (trim($tags['license'][0]) !== $license)
|
||||
{
|
||||
$message = 'Invalid content found for @license tag, use '
|
||||
. '"' . $license . '".';
|
||||
$phpcsFile->addError($message, $tags['license'][1]);
|
||||
}
|
||||
}
|
||||
}
|
19
code_sniffer/phpbb/Tests/Commenting/FileCommentUnitTest.inc
Normal file
19
code_sniffer/phpbb/Tests/Commenting/FileCommentUnitTest.inc
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package code_sniffer³
|
||||
* @version $Id: $
|
||||
* @copyright (c) 2008 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-license.php BSD License
|
||||
*
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* Broken but not first file doc comment.
|
||||
*
|
||||
* @version @package_version@
|
||||
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
|
||||
* @copyright (c) 2007 phpBB Group
|
||||
*
|
||||
*/
|
51
code_sniffer/phpbb/Tests/Commenting/FileCommentUnitTest.php
Normal file
51
code_sniffer/phpbb/Tests/Commenting/FileCommentUnitTest.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package code_sniffer
|
||||
* @version $Id: $
|
||||
* @copyright (c) 2007 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Unit test class for the EmptyStatement sniff.
|
||||
*
|
||||
* @package code_sniffer
|
||||
* @author Manuel Pichler <mapi@phpundercontrol.org>
|
||||
*/
|
||||
class phpbb_Tests_Commenting_FileCommentUnitTest extends AbstractSniffUnitTest
|
||||
{
|
||||
|
||||
/**
|
||||
* Returns the lines where errors should occur.
|
||||
*
|
||||
* The key of the array should represent the line number and the value
|
||||
* should represent the number of errors that should occur on that line.
|
||||
*
|
||||
* @return array(int => int)
|
||||
*/
|
||||
public function getErrorList()
|
||||
{
|
||||
return array(
|
||||
7 => 1 // BSD License error :)
|
||||
);
|
||||
}//end getErrorList()
|
||||
|
||||
|
||||
/**
|
||||
* Returns the lines where warnings should occur.
|
||||
*
|
||||
* The key of the array should represent the line number and the value
|
||||
* should represent the number of warnings that should occur on that line.
|
||||
*
|
||||
* @return array(int => int)
|
||||
*/
|
||||
public function getWarningList()
|
||||
{
|
||||
return array(
|
||||
4 => 1,
|
||||
8 => 1
|
||||
);
|
||||
}//end getWarningList()
|
||||
}
|
65
code_sniffer/phpbb/build.xml
Normal file
65
code_sniffer/phpbb/build.xml
Normal file
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="code_sniffer" basedir="." default="phpunit">
|
||||
|
||||
<property name="cvs.module" value="pear/PHP_CodeSniffer" />
|
||||
<property name="working.dir" value="${basedir}/_work/code" />
|
||||
<property name="test.coverage" value="${basedir}/_work/coverage" />
|
||||
|
||||
<target name="phpunit" depends="update,prepare">
|
||||
<exec executable="phpunit">
|
||||
<arg line="--coverage-html ${test.coverage}
|
||||
PHP_CodeSniffer_AllTests
|
||||
${working.dir}/${cvs.module}/tests/AllTests.php" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="prepare">
|
||||
<delete dir="${working.dir}/${cvs.module}/CodeSniffer/Standards/phpbb" />
|
||||
<mkdir dir="${working.dir}/${cvs.module}/CodeSniffer/Standards/phpbb"/>
|
||||
|
||||
<copy todir="${working.dir}/${cvs.module}/CodeSniffer/Standards/phpbb/Sniffs">
|
||||
<fileset dir="${basedir}/Sniffs" />
|
||||
</copy>
|
||||
|
||||
<copy todir="${working.dir}/${cvs.module}/CodeSniffer/Standards/phpbb/Tests">
|
||||
<fileset dir="${basedir}/Tests" />
|
||||
</copy>
|
||||
|
||||
<copy todir="${working.dir}/${cvs.module}/CodeSniffer/Standards/phpbb">
|
||||
<fileset file="${basedir}/phpbbCodingStandard.php" />
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="cleanup">
|
||||
<delete dir="${working.dir}" />
|
||||
</target>
|
||||
|
||||
<target name="update">
|
||||
<exec executable="cvs" dir="${working.dir}/${cvs.module}">
|
||||
<arg line="up" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="checkout" depends="cleanup">
|
||||
<cvspass cvsroot=":pserver:cvsread@cvs.php.net:/repository" password="phpfi" />
|
||||
<cvs cvsRoot=":pserver:cvsread@cvs.php.net:/repository"
|
||||
package="${cvs.module}"
|
||||
dest="${working.dir}" />
|
||||
</target>
|
||||
|
||||
<!--
|
||||
Installs the sniffs on my local development machine
|
||||
-->
|
||||
<target name="install">
|
||||
<delete dir="/usr/local/pear/PEAR/PHP/CodeSniffer/Standards/phpbb" />
|
||||
<mkdir dir="/usr/local/pear/PEAR/PHP/CodeSniffer/Standards/phpbb" />
|
||||
|
||||
<copy todir="/usr/local/pear/PEAR/PHP/CodeSniffer/Standards/phpbb">
|
||||
<fileset file="${basedir}/phpbbCodingStandard.php" />
|
||||
</copy>
|
||||
<copy todir="/usr/local/pear/PEAR/PHP/CodeSniffer/Standards/phpbb/Sniffs">
|
||||
<fileset dir="${basedir}/Sniffs" />
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
</project>
|
43
code_sniffer/phpbb/phpbbCodingStandard.php
Normal file
43
code_sniffer/phpbb/phpbbCodingStandard.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package code_sniffer
|
||||
* @version $Id: $
|
||||
* @copyright (c) 2007 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
if (class_exists('PHP_CodeSniffer_Standards_CodingStandard', true) === false) {
|
||||
throw new PHP_CodeSniffer_Exception(
|
||||
'Class PHP_CodeSniffer_Standards_CodingStandard not found'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Primary class for the phpbb coding standard.
|
||||
*
|
||||
* @package code_sniffer
|
||||
*/
|
||||
class PHP_CodeSniffer_Standards_phpbb_phpbbCodingStandard extends PHP_CodeSniffer_Standards_CodingStandard
|
||||
{
|
||||
/**
|
||||
* Return a list of external sniffs to include with this standard.
|
||||
*
|
||||
* External locations can be single sniffs, a whole directory of sniffs, or
|
||||
* an entire coding standard. Locations start with the standard name. For
|
||||
* example:
|
||||
* PEAR => include all sniffs in this standard
|
||||
* PEAR/Sniffs/Files => include all sniffs in this dir
|
||||
* PEAR/Sniffs/Files/LineLengthSniff => include this single sniff
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getIncludedSniffs()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
}
|
0
phpBB/adm/images/progress_bar.gif
Executable file → Normal file
0
phpBB/adm/images/progress_bar.gif
Executable file → Normal file
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -15,11 +15,13 @@ define('ADMIN_START', true);
|
||||
define('NEED_SID', true);
|
||||
|
||||
// Include files
|
||||
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
require($phpbb_root_path . 'common.' . $phpEx);
|
||||
require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
||||
require($phpbb_root_path . 'includes/functions_module.' . $phpEx);
|
||||
if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './../');
|
||||
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
if (!defined('PHPBB_ADMIN_PATH')) define('PHPBB_ADMIN_PATH', './');
|
||||
|
||||
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||
require(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
|
||||
require(PHPBB_ROOT_PATH . 'includes/functions_module.' . PHP_EXT);
|
||||
|
||||
// Start session management
|
||||
$user->session_begin();
|
||||
@@ -28,10 +30,14 @@ $user->setup('acp/common');
|
||||
// End session management
|
||||
|
||||
// Have they authenticated (again) as an admin for this session?
|
||||
if (!isset($user->data['session_admin']) || !$user->data['session_admin'])
|
||||
if ($user->data['user_id'] != ANONYMOUS && (!isset($user->data['session_admin']) || !$user->data['session_admin']))
|
||||
{
|
||||
login_box('', $user->lang['LOGIN_ADMIN_CONFIRM'], $user->lang['LOGIN_ADMIN_SUCCESS'], true, false);
|
||||
}
|
||||
else if ($user->data['user_id'] == ANONYMOUS)
|
||||
{
|
||||
login_box('');
|
||||
}
|
||||
|
||||
// Is user any type of admin? No, then stop here, each script needs to
|
||||
// check specific permissions but this is a catchall
|
||||
@@ -42,20 +48,16 @@ if (!$auth->acl_get('a_'))
|
||||
|
||||
// We define the admin variables now, because the user is now able to use the admin related features...
|
||||
define('IN_ADMIN', true);
|
||||
$phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : './';
|
||||
|
||||
// Some oft used variables
|
||||
$safe_mode = (@ini_get('safe_mode') == '1' || @strtolower(ini_get('safe_mode')) === 'on') ? true : false;
|
||||
$safe_mode = (@ini_get('safe_mode') == '1' || strtolower(@ini_get('safe_mode')) === 'on') ? true : false;
|
||||
$file_uploads = (@ini_get('file_uploads') == '1' || strtolower(@ini_get('file_uploads')) === 'on') ? true : false;
|
||||
$module_id = request_var('i', '');
|
||||
$mode = request_var('mode', '');
|
||||
|
||||
// Set custom template for admin area
|
||||
$template->set_custom_template($phpbb_admin_path . 'style', 'admin');
|
||||
$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');
|
||||
|
||||
// the acp template is never stored in the database
|
||||
$user->theme['template_storedb'] = false;
|
||||
$template->set_custom_template(PHPBB_ADMIN_PATH . 'style', 'admin');
|
||||
$template->assign_var('T_TEMPLATE_PATH', PHPBB_ADMIN_PATH . 'style');
|
||||
|
||||
// Instantiate new module
|
||||
$module = new p_master();
|
||||
@@ -68,7 +70,7 @@ $module->set_active($module_id, $mode);
|
||||
|
||||
// Assign data to the template engine for the list of modules
|
||||
// We do this before loading the active module for correct menu display in trigger_error
|
||||
$module->assign_tpl_vars(append_sid("{$phpbb_admin_path}index.$phpEx"));
|
||||
$module->assign_tpl_vars(append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT));
|
||||
|
||||
// Load and execute the relevant module
|
||||
$module->load_active();
|
||||
@@ -88,7 +90,7 @@ adm_page_footer();
|
||||
function adm_page_header($page_title)
|
||||
{
|
||||
global $config, $db, $user, $template;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID;
|
||||
global $SID, $_SID;
|
||||
|
||||
if (defined('HEADER_INC'))
|
||||
{
|
||||
@@ -108,35 +110,39 @@ function adm_page_header($page_title)
|
||||
|
||||
$template->assign_vars(array(
|
||||
'PAGE_TITLE' => $page_title,
|
||||
'USERNAME' => $user->data['username'],
|
||||
'USERNAME' => ($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : '',
|
||||
|
||||
'SID' => $SID,
|
||||
'_SID' => $_SID,
|
||||
'SESSION_ID' => $user->session_id,
|
||||
'ROOT_PATH' => $phpbb_admin_path,
|
||||
'ROOT_PATH' => PHPBB_ADMIN_PATH,
|
||||
|
||||
'U_LOGOUT' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout'),
|
||||
'U_ADM_INDEX' => append_sid("{$phpbb_admin_path}index.$phpEx"),
|
||||
'U_INDEX' => append_sid("{$phpbb_root_path}index.$phpEx"),
|
||||
'U_LOGOUT' => append_sid('ucp', 'mode=logout'),
|
||||
'U_ADM_LOGOUT' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'action=admlogout'),
|
||||
'U_ADM_INDEX' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT),
|
||||
'U_INDEX' => append_sid('index'),
|
||||
|
||||
'T_IMAGES_PATH' => "{$phpbb_root_path}images/",
|
||||
'T_SMILIES_PATH' => "{$phpbb_root_path}{$config['smilies_path']}/",
|
||||
'T_AVATAR_PATH' => "{$phpbb_root_path}{$config['avatar_path']}/",
|
||||
'T_AVATAR_GALLERY_PATH' => "{$phpbb_root_path}{$config['avatar_gallery_path']}/",
|
||||
'T_ICONS_PATH' => "{$phpbb_root_path}{$config['icons_path']}/",
|
||||
'T_RANKS_PATH' => "{$phpbb_root_path}{$config['ranks_path']}/",
|
||||
'T_UPLOAD_PATH' => "{$phpbb_root_path}{$config['upload_path']}/",
|
||||
'S_USER_ADMIN' => $user->data['session_admin'],
|
||||
'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS && !$user->data['is_bot']),
|
||||
|
||||
'ICON_MOVE_UP' => '<img src="' . $phpbb_admin_path . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
|
||||
'ICON_MOVE_UP_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_up_disabled.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
|
||||
'ICON_MOVE_DOWN' => '<img src="' . $phpbb_admin_path . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
|
||||
'ICON_MOVE_DOWN_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
|
||||
'ICON_EDIT' => '<img src="' . $phpbb_admin_path . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
|
||||
'ICON_EDIT_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_edit_disabled.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
|
||||
'ICON_DELETE' => '<img src="' . $phpbb_admin_path . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
|
||||
'ICON_DELETE_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_delete_disabled.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
|
||||
'ICON_SYNC' => '<img src="' . $phpbb_admin_path . 'images/icon_sync.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
|
||||
'ICON_SYNC_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_sync_disabled.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
|
||||
'T_IMAGES_PATH' => PHPBB_ROOT_PATH . 'images/',
|
||||
'T_SMILIES_PATH' => PHPBB_ROOT_PATH . $config['smilies_path'] . '/',
|
||||
'T_AVATAR_PATH' => PHPBB_ROOT_PATH . $config['avatar_path'] . '/',
|
||||
'T_AVATAR_GALLERY_PATH' => PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/',
|
||||
'T_ICONS_PATH' => PHPBB_ROOT_PATH . $config['icons_path'] . '/',
|
||||
'T_RANKS_PATH' => PHPBB_ROOT_PATH . $config['ranks_path'] . '/',
|
||||
'T_UPLOAD_PATH' => PHPBB_ROOT_PATH . $config['upload_path'] . '/',
|
||||
|
||||
'ICON_MOVE_UP' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
|
||||
'ICON_MOVE_UP_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_up_disabled.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
|
||||
'ICON_MOVE_DOWN' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
|
||||
'ICON_MOVE_DOWN_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
|
||||
'ICON_EDIT' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
|
||||
'ICON_EDIT_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_edit_disabled.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
|
||||
'ICON_DELETE' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
|
||||
'ICON_DELETE_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_delete_disabled.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
|
||||
'ICON_SYNC' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_sync.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
|
||||
'ICON_SYNC_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_sync_disabled.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
|
||||
|
||||
'S_USER_LANG' => $user->lang['USER_LANG'],
|
||||
'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
|
||||
@@ -161,7 +167,7 @@ function adm_page_header($page_title)
|
||||
function adm_page_footer($copyright_html = true)
|
||||
{
|
||||
global $db, $config, $template, $user, $auth, $cache;
|
||||
global $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $starttime;
|
||||
|
||||
// Output page creation time
|
||||
if (defined('DEBUG'))
|
||||
@@ -169,7 +175,7 @@ function adm_page_footer($copyright_html = true)
|
||||
$mtime = explode(' ', microtime());
|
||||
$totaltime = $mtime[0] + $mtime[1] - $starttime;
|
||||
|
||||
if (!empty($_REQUEST['explain']) && $auth->acl_get('a_') && defined('DEBUG_EXTRA') && method_exists($db, 'sql_report'))
|
||||
if (request::variable('explain', false) && $auth->acl_get('a_') && defined('DEBUG_EXTRA') && method_exists($db, 'sql_report'))
|
||||
{
|
||||
$db->sql_report('display');
|
||||
}
|
||||
@@ -372,7 +378,8 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
|
||||
*/
|
||||
function validate_config_vars($config_vars, &$cfg_array, &$error)
|
||||
{
|
||||
global $phpbb_root_path, $user;
|
||||
global $user;
|
||||
|
||||
$type = 0;
|
||||
$min = 1;
|
||||
$max = 2;
|
||||
@@ -465,13 +472,13 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
||||
|
||||
$cfg_array[$config_name] = basename($cfg_array[$config_name]);
|
||||
|
||||
if (!file_exists($phpbb_root_path . 'language/' . $cfg_array[$config_name] . '/'))
|
||||
if (!file_exists(PHPBB_ROOT_PATH . 'language/' . $cfg_array[$config_name] . '/'))
|
||||
{
|
||||
$error[] = $user->lang['WRONG_DATA_LANG'];
|
||||
}
|
||||
break;
|
||||
|
||||
// Relative path (appended $phpbb_root_path)
|
||||
// Relative path (appended PHPBB_ROOT_PATH)
|
||||
case 'rpath':
|
||||
case 'rwpath':
|
||||
if (!$cfg_array[$config_name])
|
||||
@@ -513,12 +520,12 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!file_exists($phpbb_root_path . $cfg_array[$config_name]))
|
||||
if (!file_exists(PHPBB_ROOT_PATH . $cfg_array[$config_name]))
|
||||
{
|
||||
$error[] = sprintf($user->lang['DIRECTORY_DOES_NOT_EXIST'], $cfg_array[$config_name]);
|
||||
}
|
||||
|
||||
if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !is_dir($phpbb_root_path . $cfg_array[$config_name]))
|
||||
if (file_exists(PHPBB_ROOT_PATH . $cfg_array[$config_name]) && !is_dir(PHPBB_ROOT_PATH . $cfg_array[$config_name]))
|
||||
{
|
||||
$error[] = sprintf($user->lang['DIRECTORY_NOT_DIR'], $cfg_array[$config_name]);
|
||||
}
|
||||
@@ -526,7 +533,7 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
||||
// Check if the path is writable
|
||||
if ($config_definition['validate'] == 'wpath' || $config_definition['validate'] == 'rwpath')
|
||||
{
|
||||
if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !@is_writable($phpbb_root_path . $cfg_array[$config_name]))
|
||||
if (file_exists(PHPBB_ROOT_PATH . $cfg_array[$config_name]) && !@is_writable(PHPBB_ROOT_PATH . $cfg_array[$config_name]))
|
||||
{
|
||||
$error[] = sprintf($user->lang['DIRECTORY_NOT_WRITABLE'], $cfg_array[$config_name]);
|
||||
}
|
||||
|
@@ -97,11 +97,11 @@
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="unbanreason">{L_BAN_REASON}:</label></dt>
|
||||
<dd><input style="border: 0;" type="text" class="text full" disabled="disabled" name="unbanreason" id="unbanreason" /></dd>
|
||||
<dd><textarea style="border: 0;" class="text full" disabled="disabled" name="unbanreason" id="unbanreason" rows="5" cols="80"> </textarea></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="unbangivereason">{L_BAN_GIVE_REASON}:</label></dt>
|
||||
<dd><input style="border: 0;" type="text" class="text full" disabled="disabled" name="unbangivereason" id="unbangivereason" /></dd>
|
||||
<dd><textarea style="border: 0;" class="text full" disabled="disabled" name="unbangivereason" id="unbangivereason" rows="5" cols="80"> </textarea></dd>
|
||||
</dl>
|
||||
|
||||
<p class="submit-buttons">
|
||||
|
@@ -22,47 +22,34 @@
|
||||
<dd><label><input type="radio" class="radio" id="enable_post_confirm" name="enable_post_confirm" value="1"<!-- IF POST_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_ENABLED}</label>
|
||||
<label><input type="radio" class="radio" name="enable_post_confirm" value="0"<!-- IF not POST_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label></dd>
|
||||
</dl>
|
||||
<!-- IF GD -->
|
||||
<dl>
|
||||
<dt><label for="captcha_gd">{L_CAPTCHA_GD}:</label><br /><span>{L_CAPTCHA_GD_EXPLAIN}</span></dt>
|
||||
<dd><label><input id="captcha_gd" name="captcha_gd" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input name="captcha_gd" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="captcha_gd_foreground_noise">{L_CAPTCHA_GD_FOREGROUND_NOISE}:</label><br /><span>{L_CAPTCHA_GD_FOREGROUND_NOISE_EXPLAIN}</span></dt>
|
||||
<dd><label><input id="captcha_gd_foreground_noise" name="captcha_gd_foreground_noise" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_FOREGROUND_NOISE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input name="captcha_gd_foreground_noise" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD_FOREGROUND_NOISE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="captcha_gd_x_grid">{L_CAPTCHA_GD_X_GRID}:</label><br /><span>{L_CAPTCHA_GD_X_GRID_EXPLAIN}</span></dt>
|
||||
<dd><input id="captcha_gd_x_grid" name="captcha_gd_x_grid" value="{CAPTCHA_GD_X_GRID}" type="text" /></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="captcha_gd_y_grid">{L_CAPTCHA_GD_Y_GRID}:</label><br /><span>{L_CAPTCHA_GD_Y_GRID_EXPLAIN}</span></dt>
|
||||
<dd><input id="captcha_gd_y_grid" name="captcha_gd_y_grid" value="{CAPTCHA_GD_Y_GRID}" type="text" /></dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>{L_AVAILABLE_CAPTCHAS}</legend>
|
||||
|
||||
<dl>
|
||||
<dt><label for="captcha_select">{L_CAPTCHA_SELECT}:</label><br /><span>{L_CAPTCHA_SELECT_EXPLAIN}</span></dt>
|
||||
<dd><select id="captcha_select" name="select_captcha" onchange="(document.getElementById('acp_captcha')).submit()" >{CAPTCHA_SELECT}</select></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="configure">{L_CAPTCHA_CONFIGURE}:</label><br /><span>{L_CAPTCHA_CONFIGURE_EXPLAIN}</span></dt>
|
||||
<dd><input class="button2" type="submit" id="configure" name="configure" value="{L_CONFIGURE}" /></dd>
|
||||
</dl>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<!-- IF CAPTCHA_PREVIEW -->
|
||||
<fieldset>
|
||||
<legend>{L_PREVIEW}</legend>
|
||||
<!-- IF PREVIEW -->
|
||||
<div class="successbox">
|
||||
<h3>{L_WARNING}</h3>
|
||||
<p>{L_CAPTCHA_PREVIEW_MSG}</p>
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
<dl>
|
||||
<dt><label for="captcha_preview">{L_PREVIEW}:</label><br /><span>{L_CAPTCHA_PREVIEW_EXPLAIN}</span></dt>
|
||||
<dd><img src="{CAPTCHA_PREVIEW}" alt="{L_PREVIEW}" <!-- IF CAPTCHA_GD_PREVIEWED -->width="360" height="96"<!-- ELSE --> width="320" height="50"<!-- ENDIF --> id="captcha_preview" /></dd>
|
||||
</dl>
|
||||
{CAPTCHA_PREVIEW}
|
||||
</fieldset>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<fieldset class="submit-buttons">
|
||||
<legend>{L_SUBMIT}</legend>
|
||||
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />
|
||||
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
|
||||
<input class="button2" type="submit" id="preview" name="preview" value="{L_PREVIEW}" />
|
||||
<input class="button1" type="submit" id="main_submit" name="main_submit" value="{L_SUBMIT}" />
|
||||
<input class="button2" type="reset" id="form_reset" name="reset" value="{L_RESET}" />
|
||||
{S_FORM_TOKEN}
|
||||
</fieldset>
|
||||
</form>
|
||||
|
@@ -96,7 +96,7 @@
|
||||
|
||||
<a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">« {L_BACK}</a>
|
||||
|
||||
<h1>{L_TITLE} :: {FORUM_NAME}</h1>
|
||||
<h1>{L_TITLE} <!-- IF FORUM_NAME -->:: {FORUM_NAME}<!-- ENDIF --></h1>
|
||||
|
||||
<p>{L_FORUM_EDIT_EXPLAIN}</p>
|
||||
|
||||
|
@@ -74,6 +74,10 @@
|
||||
<dt><label for="group_message_limit">{L_GROUP_MESSAGE_LIMIT}:</label><br /><span>{L_GROUP_MESSAGE_LIMIT_EXPLAIN}</span></dt>
|
||||
<dd><input name="group_message_limit" type="text" id="group_message_limit" maxlength="4" size="4" value="{GROUP_MESSAGE_LIMIT}" /></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="group_max_recipients">{L_GROUP_MAX_RECIPIENTS}:</label><br /><span>{L_GROUP_MAX_RECIPIENTS_EXPLAIN}</span></dt>
|
||||
<dd><input name="group_max_recipients" type="text" id="group_max_recipients" maxlength="10" size="4" value="{GROUP_MAX_RECIPIENTS}" /></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="group_colour">{L_GROUP_COLOR}:</label><br /><span>{L_GROUP_COLOR_EXPLAIN}</span></dt>
|
||||
<dd><input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="6" maxlength="6" /> <span>[ <a href="{U_SWATCH}" onclick="popup(this.href, 636, 150, '_swatch'); return false">{L_COLOUR_SWATCH}</a> ]</span></dd>
|
||||
|
0
phpBB/adm/style/acp_inactive.html
Executable file → Normal file
0
phpBB/adm/style/acp_inactive.html
Executable file → Normal file
46
phpBB/adm/style/acp_login.html
Normal file
46
phpBB/adm/style/acp_login.html
Normal file
@@ -0,0 +1,46 @@
|
||||
<!-- INCLUDE overall_header.html -->
|
||||
<h1>{PAGE_TITLE}</h1>
|
||||
<p><!-- IF LOGIN_EXPLAIN -->{LOGIN_EXPLAIN}<!-- ELSE -->{L_LOGIN}<!-- ENDIF --></p>
|
||||
|
||||
<!-- IF LOGIN_ERROR -->
|
||||
<div class="errorbox">
|
||||
<h3>{L_WARNING}</h3>
|
||||
<p>{LOGIN_ERROR}</p>
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
<form action="{S_LOGIN_ACTION}" method="post" id="login">
|
||||
|
||||
<fieldset>
|
||||
<dl>
|
||||
<dt><label for="{USERNAME_CREDENTIAL}">{L_USERNAME}:</label></dt>
|
||||
<dd><input type="text" tabindex="1" name="{USERNAME_CREDENTIAL}" id="{USERNAME_CREDENTIAL}" size="25" value="{USERNAME}" class="inputbox autowidth" /></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="{PASSWORD_CREDENTIAL}">{L_PASSWORD}:</label></dt>
|
||||
<dd><input type="password" tabindex="2" id="{PASSWORD_CREDENTIAL}" name="{PASSWORD_CREDENTIAL}" size="25" class="inputbox autowidth" /></dd>
|
||||
<!-- IF S_DISPLAY_FULL_LOGIN and (U_SEND_PASSWORD or U_RESEND_ACTIVATION) -->
|
||||
<!-- IF U_SEND_PASSWORD --><dd><a href="{U_SEND_PASSWORD}">{L_FORGOT_PASS}</a></dd><!-- ENDIF -->
|
||||
<!-- IF U_RESEND_ACTIVATION --><dd><a href="{U_RESEND_ACTIVATION}">{L_RESEND_ACTIVATION}</a></dd><!-- ENDIF -->
|
||||
<!-- ENDIF -->
|
||||
</dl>
|
||||
|
||||
<!-- IF S_CONFIRM_CODE -->
|
||||
<dl>
|
||||
<dt><label for="confirm_code">{L_CONFIRM_CODE}:</label><br /><span>{L_CONFIRM_CODE_EXPLAIN}</span></dt>
|
||||
<dd><input type="hidden" name="confirm_id" value="{CONFIRM_ID}" />{CONFIRM_IMAGE}</dd>
|
||||
<dd><input type="text" name="confirm_code" id="confirm_code" size="8" maxlength="8" tabindex="3" class="inputbox narrow" title="{L_CONFIRM_CODE}" /></dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<p class="submit-buttons">
|
||||
<!-- IF S_DISPLAY_FULL_LOGIN -->
|
||||
<!-- IF S_AUTOLOGIN_ENABLED --><label for="autologin"><input type="checkbox" name="autologin" id="autologin" tabindex="4" /> {L_LOG_ME_IN}</label><!-- ENDIF -->
|
||||
<label for="viewonline"><input type="checkbox" name="viewonline" id="viewonline" tabindex="5" /> {L_HIDE_ME}</label>
|
||||
<!-- ENDIF -->
|
||||
|
||||
{S_HIDDEN_FIELDS}<input type="submit" name="login" tabindex="6" value="{L_LOGIN}" class="button1" />
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<!-- INCLUDE overall_footer.html -->
|
@@ -21,6 +21,12 @@
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_WRITABLE_CONFIG -->
|
||||
<div class="errorbox notice">
|
||||
<p>{L_WRITABLE_CONFIG}</p>
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<table cellspacing="1">
|
||||
<caption>{L_FORUM_STATS}</caption>
|
||||
<col class="col1" /><col class="col2" /><col class="col1" /><col class="col2" />
|
||||
|
@@ -475,13 +475,6 @@
|
||||
<dd><!-- IF S_INSTALL --><b id="imageset_id">{IMAGESET_NAME}</b><!-- ELSE --><select id="imageset_id" name="imageset_id">{S_IMAGESET_OPTIONS}</select><!-- ENDIF --></dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF S_TEMPLATE or S_THEME -->
|
||||
<dl>
|
||||
<dt><label for="store_db">{L_LOCATION}:</label><br /><span>{L_LOCATION_EXPLAIN}</span></dt>
|
||||
<dd><label><input type="radio" class="radio" name="store_db" value="0"<!-- IF not S_STORE_DB --> id="store_db" checked="checked"<!-- ENDIF --> /> {L_STORE_FILESYSTEM}</label>
|
||||
<label><input type="radio" class="radio" name="store_db" value="1"<!-- IF S_STORE_DB --> id="store_db" checked="checked"<!-- ENDIF --> /> {L_STORE_DATABASE}</label></dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF S_STYLE -->
|
||||
</fieldset>
|
||||
|
||||
|
@@ -197,7 +197,7 @@
|
||||
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span>
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
|
||||
|
||||
<fieldset class="quick">
|
||||
<input class="button2" type="submit" name="delmarked" value="{L_DELETE_MARKED}" />
|
||||
<p class="small"><a href="#" onclick="marklist('user_attachments', 'mark', true);">{L_MARK_ALL}</a> • <a href="#" onclick="marklist('user_attachments', 'mark', false);">{L_UNMARK_ALL}</a></p>
|
||||
@@ -215,7 +215,7 @@
|
||||
<form id="select_forum" method="post" action="{U_ACTION}">
|
||||
|
||||
<fieldset class="quick" style="text-align: left;">
|
||||
{L_SELECT_FORUM}: <select name="f">{S_FORUM_OPTIONS}</select>
|
||||
{L_SELECT_FORUM}: <select name="f">{S_FORUM_OPTIONS}</select>
|
||||
<input class="button2" type="submit" value="{L_GO}" name="select" />
|
||||
{S_FORM_TOKEN}
|
||||
</fieldset>
|
||||
|
@@ -30,7 +30,7 @@
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label>{L_POSTS}:</label></dt>
|
||||
<dd><strong>{USER_POSTS}</strong></dd>
|
||||
<dd><strong>{USER_POSTS}</strong><!-- IF POSTS_IN_QUEUE and U_MCP_QUEUE --> (<a href="{U_MCP_QUEUE}">{L_POSTS_IN_QUEUE}</a>)<!-- ELSEIF POSTS_IN_QUEUE --> ({L_POSTS_IN_QUEUE})<!-- ENDIF --></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label>{L_WARNINGS}:</label></dt>
|
||||
@@ -138,7 +138,7 @@
|
||||
</p>
|
||||
|
||||
</fieldset>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
<!-- ENDIF -->
|
||||
|
@@ -1175,6 +1175,10 @@ input.disabled {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.notice {
|
||||
background-color: #62A5CC;
|
||||
}
|
||||
|
||||
/* Special cases for the error page */
|
||||
#errorpage #page-header a {
|
||||
font-weight: bold;
|
||||
@@ -1333,18 +1337,21 @@ fieldset.permissions .permissions-switch {
|
||||
fieldset.permissions .padding {
|
||||
}
|
||||
|
||||
.permissions-switch {
|
||||
margin-top: -6px;
|
||||
font-size: .9em;
|
||||
}
|
||||
|
||||
.permissions-switch a {
|
||||
text-decoration: underline;
|
||||
font-size: 0.90em;
|
||||
}
|
||||
|
||||
.permissions-reset {
|
||||
margin-top: -6px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.permissions-reset a {
|
||||
font-size: .8em;
|
||||
font-size: .85em;
|
||||
}
|
||||
|
||||
/* Tabbed menu */
|
||||
|
5
phpBB/adm/style/captcha_default_acp_demo.html
Normal file
5
phpBB/adm/style/captcha_default_acp_demo.html
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
<dl>
|
||||
<dt><label for="captcha_preview">{L_PREVIEW}:</label><br /><span>{L_CAPTCHA_PREVIEW_EXPLAIN}</span></dt>
|
||||
<dd><img src="{CONFIRM_IMAGE}" alt="{L_PREVIEW}" width="360" height="96" id="captcha_preview" /></dd>
|
||||
</dl>
|
53
phpBB/adm/style/captcha_gd_acp.html
Normal file
53
phpBB/adm/style/captcha_gd_acp.html
Normal file
@@ -0,0 +1,53 @@
|
||||
<!-- INCLUDE overall_header.html -->
|
||||
|
||||
<a name="maincontent"></a>
|
||||
|
||||
<h1>{L_ACP_VC_SETTINGS}</h1>
|
||||
|
||||
<p>{L_ACP_VC_SETTINGS_EXPLAIN}</p>
|
||||
|
||||
|
||||
<form id="acp_captcha" method="post" action="{U_ACTION}">
|
||||
|
||||
<fieldset>
|
||||
<legend>{L_GENERAL_OPTIONS}</legend>
|
||||
|
||||
<dl>
|
||||
<dt><label for="captcha_gd_foreground_noise">{L_CAPTCHA_GD_FOREGROUND_NOISE}:</label><br /><span>{L_CAPTCHA_GD_FOREGROUND_NOISE_EXPLAIN}</span></dt>
|
||||
<dd><label><input id="captcha_gd_foreground_noise" name="captcha_gd_foreground_noise" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_FOREGROUND_NOISE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input name="captcha_gd_foreground_noise" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD_FOREGROUND_NOISE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="captcha_gd_x_grid">{L_CAPTCHA_GD_X_GRID}:</label><br /><span>{L_CAPTCHA_GD_X_GRID_EXPLAIN}</span></dt>
|
||||
<dd><input id="captcha_gd_x_grid" name="captcha_gd_x_grid" value="{CAPTCHA_GD_X_GRID}" type="text" /></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="captcha_gd_y_grid">{L_CAPTCHA_GD_Y_GRID}:</label><br /><span>{L_CAPTCHA_GD_Y_GRID_EXPLAIN}</span></dt>
|
||||
<dd><input id="captcha_gd_y_grid" name="captcha_gd_y_grid" value="{CAPTCHA_GD_Y_GRID}" type="text" /></dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{L_PREVIEW}</legend>
|
||||
<!-- IF PREVIEW -->
|
||||
<div class="successbox">
|
||||
<h3>{L_WARNING}</h3>
|
||||
<p>{L_CAPTCHA_PREVIEW_MSG}</p>
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
{CAPTCHA_PREVIEW}
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="submit-buttons">
|
||||
<legend>{L_SUBMIT}</legend>
|
||||
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />
|
||||
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
|
||||
<input type="hidden" name="select_captcha" value="{CAPTCHA_NAME}" />
|
||||
<input type="hidden" name="configure" value="1" />
|
||||
|
||||
{S_FORM_TOKEN}
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<!-- INCLUDE overall_footer.html -->
|
19
phpBB/adm/style/captcha_recaptcha.html
Normal file
19
phpBB/adm/style/captcha_recaptcha.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<!-- IF S_RECAPTCHA_AVAILABLE -->
|
||||
<dl>
|
||||
<script type="text/javascript" src="{RECAPTCHA_SERVER}/challenge?k={RECAPTCHA_PUBKEY}{RECAPTCHA_ERRORGET}">
|
||||
// <![CDATA[
|
||||
var RecaptchaOptions = {
|
||||
lang : {L_RECAPTCHA_LANG}
|
||||
};
|
||||
// ]]>
|
||||
</script>
|
||||
|
||||
<noscript>
|
||||
<iframe src="{RECAPTCHA_SERVER}/noscript?k={RECAPTCHA_PUBKEY}{RECAPTCHA_ERRORGET}" height="300" width="500" frameborder="0"></iframe><br/>
|
||||
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
|
||||
<input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
|
||||
</noscript>
|
||||
</dl>
|
||||
<!-- ELSE -->
|
||||
{L_RECAPTCHA_NOT_AVAILABLE}
|
||||
<!-- ENDIF -->
|
48
phpBB/adm/style/captcha_recaptcha_acp.html
Normal file
48
phpBB/adm/style/captcha_recaptcha_acp.html
Normal file
@@ -0,0 +1,48 @@
|
||||
<!-- INCLUDE overall_header.html -->
|
||||
|
||||
<a name="maincontent"></a>
|
||||
|
||||
<h1>{L_ACP_VC_SETTINGS}</h1>
|
||||
|
||||
<p>{L_ACP_VC_SETTINGS_EXPLAIN}</p>
|
||||
|
||||
|
||||
<form id="acp_captcha" method="post" action="{U_ACTION}">
|
||||
|
||||
<fieldset>
|
||||
<legend>{L_GENERAL_OPTIONS}</legend>
|
||||
|
||||
<dl>
|
||||
<dt><label for="recaptcha_pubkey">{L_RECAPTCHA_PUBLIC}:</label><br /><span>{L_RECAPTCHA_PUBLIC_EXPLAIN}</span></dt>
|
||||
<dd><input id="recaptcha_pubkey" name="recaptcha_pubkey" value="{RECAPTCHA_PUBKEY}" size="50" type="text" /></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="recaptcha_privkey">{L_RECAPTCHA_PRIVATE}:</label><br /><span>{L_RECAPTCHA_PRIVATE_EXPLAIN}</span></dt>
|
||||
<dd><input id="recaptcha_privkey" name="recaptcha_privkey" value="{RECAPTCHA_PRIVKEY}" size="50" type="text" /></dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{L_PREVIEW}</legend>
|
||||
<!-- IF PREVIEW -->
|
||||
<div class="successbox">
|
||||
<h3>{L_WARNING}</h3>
|
||||
<p>{L_CAPTCHA_PREVIEW_MSG}</p>
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
{CAPTCHA_PREVIEW}
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="submit-buttons">
|
||||
<legend>{L_SUBMIT}</legend>
|
||||
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />
|
||||
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
|
||||
<input type="hidden" name="select_captcha" value="{CAPTCHA_NAME}" />
|
||||
<input type="hidden" name="configure" value="1" />
|
||||
|
||||
{S_FORM_TOKEN}
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<!-- INCLUDE overall_footer.html -->
|
0
phpBB/adm/style/install_convert.html
Executable file → Normal file
0
phpBB/adm/style/install_convert.html
Executable file → Normal file
0
phpBB/adm/style/install_error.html
Executable file → Normal file
0
phpBB/adm/style/install_error.html
Executable file → Normal file
0
phpBB/adm/style/install_footer.html
Executable file → Normal file
0
phpBB/adm/style/install_footer.html
Executable file → Normal file
0
phpBB/adm/style/install_header.html
Executable file → Normal file
0
phpBB/adm/style/install_header.html
Executable file → Normal file
0
phpBB/adm/style/install_install.html
Executable file → Normal file
0
phpBB/adm/style/install_install.html
Executable file → Normal file
0
phpBB/adm/style/install_main.html
Executable file → Normal file
0
phpBB/adm/style/install_main.html
Executable file → Normal file
@@ -186,7 +186,7 @@
|
||||
<p>{L_NO_UPDATE_FILES_EXPLAIN}</p><br />
|
||||
|
||||
<strong>{NO_UPDATE_FILES}</strong>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
|
||||
@@ -226,7 +226,7 @@
|
||||
<!-- IF files.S_CUSTOM -->
|
||||
<dd style="margin-left: 60%;"><label><input type="checkbox" name="no_update[]" value="{files.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
|
||||
<!-- ENDIF -->
|
||||
|
||||
|
||||
<!-- IF files.STATUS eq 'modified' -->
|
||||
</dl>
|
||||
<dl>
|
||||
@@ -295,7 +295,7 @@
|
||||
<p>{L_UPDATE_METHOD_EXPLAIN}</p>
|
||||
|
||||
<fieldset class="submit-buttons">
|
||||
<input class="button1" type="submit" name="ftp_upload" value="{L_FTP_UPDATE_METHOD}" /> <input class="button1" type="submit" name="download" value="{L_DOWNLOAD_UPDATE_METHOD}" />
|
||||
<input class="button1" type="submit" name="ftp_upload" value="{L_FTP_UPDATE_METHOD}" /> <input class="button1" type="submit" name="download" value="{L_DOWNLOAD_UPDATE_METHOD_BUTTON}" />
|
||||
</fieldset>
|
||||
|
||||
</form>
|
||||
@@ -360,9 +360,18 @@
|
||||
<p>{L_CONNECTION_SUCCESS}</p>
|
||||
</div>
|
||||
<!-- ELSEIF S_CONNECTION_FAILED -->
|
||||
<div class="successbox">
|
||||
<p>{L_TRY_DOWNLOAD_METHOD}</p>
|
||||
|
||||
<fieldset class="quick">
|
||||
<input class="button1" type="submit" name="download" value="{L_TRY_DOWNLOAD_METHOD_BUTTON}" />
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="errorbox">
|
||||
<p>{L_CONNECTION_FAILED}<br />{ERROR_MSG}</p>
|
||||
</div>
|
||||
|
||||
<!-- ENDIF -->
|
||||
|
||||
<fieldset>
|
||||
@@ -378,7 +387,7 @@
|
||||
</dl>
|
||||
<!-- END data -->
|
||||
</fieldset>
|
||||
|
||||
|
||||
<fieldset class="submit-buttons">
|
||||
{S_HIDDEN_FIELDS}
|
||||
<input class="button2" type="submit" name="check_again" value="{L_BACK}" />
|
||||
|
@@ -181,11 +181,12 @@ function switch_menu()
|
||||
<span class="corners-top"><span></span></span>
|
||||
<div id="content">
|
||||
<!-- IF not S_USER_NOTICE -->
|
||||
<div id="toggle">
|
||||
<div id="toggle">
|
||||
<a id="toggle-handle" accesskey="m" title="{L_MENU_TOGGLE}" onclick="switch_menu(); return false;" href="#"></a></div>
|
||||
<!-- ENDIF -->
|
||||
<div id="menu">
|
||||
<p>{L_LOGGED_IN_AS}<br /><strong>{USERNAME}</strong> [ <a href="{U_LOGOUT}">{L_LOGOUT}</a> ]</p>
|
||||
<p><!-- IF S_USER_LOGGED_IN --> {L_LOGGED_IN_AS}<br /><strong>{USERNAME}</strong> [ <a href="{U_LOGOUT}">{L_LOGOUT}</a> ]<!-- ENDIF --><!-- IF S_USER_ADMIN -->[ <a href="{U_ADM_LOGOUT}">{L_ADM_LOGOUT}</a> ]<!-- ENDIF --></p>
|
||||
<!-- IF S_USER_ADMIN -->
|
||||
<ul>
|
||||
<!-- BEGIN l_block1 -->
|
||||
<!-- IF l_block1.S_SELECTED -->
|
||||
@@ -203,6 +204,7 @@ function switch_menu()
|
||||
<!-- ENDIF -->
|
||||
<!-- END l_block1 -->
|
||||
</ul>
|
||||
<!-- ENDIF -->
|
||||
</div>
|
||||
|
||||
<div id="main">
|
||||
|
@@ -68,7 +68,7 @@
|
||||
<!-- ELSE -->
|
||||
<li class="permissions-preset-custom<!-- IF p_mask.S_FIRST_ROW and p_mask.f_mask.S_FIRST_ROW and p_mask.f_mask.category.S_FIRST_ROW --> activetab<!-- ENDIF -->" id="tab{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}">
|
||||
<!-- ENDIF -->
|
||||
<a href="#" onclick="swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '{p_mask.f_mask.category.S_ROW_COUNT}', false<!-- IF p_mask.S_VIEW -->, true<!-- ENDIF -->); return false;"><span class="tabbg"><span class="colour"></span>{category.CAT_NAME}</span></a></li>
|
||||
<a href="#" onclick="swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '{p_mask.f_mask.category.S_ROW_COUNT}', false<!-- IF p_mask.S_VIEW -->, true<!-- ENDIF -->); return false;"><span class="tabbg"><span class="colour"></span>{p_mask.f_mask.category.CAT_NAME}</span></a></li>
|
||||
<!-- END category -->
|
||||
</ul>
|
||||
</div>
|
||||
|
@@ -13,9 +13,9 @@
|
||||
*/
|
||||
define('IN_PHPBB', true);
|
||||
define('ADMIN_START', true);
|
||||
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
include($phpbb_root_path . 'common.' . $phpEx);
|
||||
if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './../');
|
||||
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||
|
||||
// Start session management
|
||||
$user->session_begin(false);
|
||||
@@ -23,7 +23,7 @@ $auth->acl($user->data);
|
||||
$user->setup();
|
||||
|
||||
// Set custom template for admin area
|
||||
$template->set_custom_template($phpbb_root_path . 'adm/style', 'admin');
|
||||
$template->set_custom_template(PHPBB_ROOT_PATH . CONFIG_ADM_FOLDER . '/style', 'admin');
|
||||
|
||||
$template->set_filenames(array(
|
||||
'body' => 'colour_swatch.html')
|
||||
@@ -39,7 +39,7 @@ $name = (!preg_match('/^[a-z0-9_-]+$/i', $name)) ? '' : $name;
|
||||
$template->assign_vars(array(
|
||||
'OPENER' => $form,
|
||||
'NAME' => $name,
|
||||
'T_IMAGES_PATH' => "{$phpbb_root_path}images/",
|
||||
'T_IMAGES_PATH' => PHPBB_ROOT_PATH . 'images/',
|
||||
|
||||
'S_USER_LANG' => $user->lang['USER_LANG'],
|
||||
'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @copyright (c) 2005 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
* Minimum Requirement: PHP 4.3.3
|
||||
* Minimum Requirement: PHP 5.2.0+
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -21,6 +21,7 @@ $starttime = $starttime[1] + $starttime[0];
|
||||
|
||||
// Report all errors, except notices
|
||||
error_reporting(E_ALL ^ E_NOTICE);
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
/*
|
||||
* Remove variables created by register_globals from the global scope
|
||||
@@ -103,7 +104,7 @@ if (version_compare(PHP_VERSION, '6.0.0-dev', '>='))
|
||||
}
|
||||
else
|
||||
{
|
||||
set_magic_quotes_runtime(0);
|
||||
@set_magic_quotes_runtime(0);
|
||||
|
||||
// Be paranoid with passed vars
|
||||
if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on' || !function_exists('ini_get'))
|
||||
@@ -116,15 +117,15 @@ else
|
||||
|
||||
if (defined('IN_CRON'))
|
||||
{
|
||||
$phpbb_root_path = dirname(__FILE__) . DIRECTORY_SEPARATOR;
|
||||
@define('PHPBB_ROOT_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
|
||||
}
|
||||
|
||||
if (!file_exists($phpbb_root_path . 'config.' . $phpEx))
|
||||
if (!file_exists(PHPBB_ROOT_PATH . 'config.' . PHP_EXT))
|
||||
{
|
||||
die("<p>The config.$phpEx file could not be found.</p><p><a href=\"{$phpbb_root_path}install/index.$phpEx\">Click here to install phpBB</a></p>");
|
||||
die('<p>The config.' . PHP_EXT . ' file could not be found.</p><p><a href="' . PHPBB_ROOT_PATH . 'install/index.' . PHP_EXT . '">Click here to install phpBB</a></p>');
|
||||
}
|
||||
|
||||
require($phpbb_root_path . 'config.' . $phpEx);
|
||||
require(PHPBB_ROOT_PATH . 'config.' . PHP_EXT);
|
||||
|
||||
if (!defined('PHPBB_INSTALLED'))
|
||||
{
|
||||
@@ -143,7 +144,7 @@ if (!defined('PHPBB_INSTALLED'))
|
||||
|
||||
// Replace any number of consecutive backslashes and/or slashes with a single slash
|
||||
// (could happen on some proxy setups and/or Windows servers)
|
||||
$script_path = trim(dirname($script_name)) . '/install/index.' . $phpEx;
|
||||
$script_path = trim(dirname($script_name)) . '/install/index.' . PHP_EXT;
|
||||
$script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path);
|
||||
|
||||
$url = (($secure) ? 'https://' : 'http://') . $server_name;
|
||||
@@ -183,27 +184,30 @@ if (!empty($load_extensions))
|
||||
}
|
||||
|
||||
// Include files
|
||||
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
|
||||
require($phpbb_root_path . 'includes/cache.' . $phpEx);
|
||||
require($phpbb_root_path . 'includes/template.' . $phpEx);
|
||||
require($phpbb_root_path . 'includes/session.' . $phpEx);
|
||||
require($phpbb_root_path . 'includes/auth.' . $phpEx);
|
||||
require(PHPBB_ROOT_PATH . 'includes/acm/acm_' . $acm_type . '.' . PHP_EXT);
|
||||
require(PHPBB_ROOT_PATH . 'includes/cache.' . PHP_EXT);
|
||||
require(PHPBB_ROOT_PATH . 'includes/template.' . PHP_EXT);
|
||||
require(PHPBB_ROOT_PATH . 'includes/session.' . PHP_EXT);
|
||||
require(PHPBB_ROOT_PATH . 'includes/auth.' . PHP_EXT);
|
||||
|
||||
require($phpbb_root_path . 'includes/functions.' . $phpEx);
|
||||
require($phpbb_root_path . 'includes/functions_content.' . $phpEx);
|
||||
require(PHPBB_ROOT_PATH . 'includes/functions.' . PHP_EXT);
|
||||
require(PHPBB_ROOT_PATH . 'includes/functions_content.' . PHP_EXT);
|
||||
|
||||
require($phpbb_root_path . 'includes/constants.' . $phpEx);
|
||||
require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
|
||||
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
|
||||
require(PHPBB_ROOT_PATH . 'includes/constants.' . PHP_EXT);
|
||||
require(PHPBB_ROOT_PATH . 'includes/db/' . $dbms . '.' . PHP_EXT);
|
||||
require(PHPBB_ROOT_PATH . 'includes/utf/utf_tools.' . PHP_EXT);
|
||||
|
||||
// Set PHP error handler to ours
|
||||
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
|
||||
|
||||
// enforce the use of the request class
|
||||
request::disable_super_globals();
|
||||
|
||||
// Instantiate some basic classes
|
||||
$user = new user();
|
||||
$auth = new auth();
|
||||
$template = new template();
|
||||
$cache = new cache();
|
||||
$cache = new acm();
|
||||
$db = new $sql_db();
|
||||
|
||||
// Connect to DB
|
||||
@@ -213,15 +217,15 @@ $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, defined('
|
||||
unset($dbpasswd);
|
||||
|
||||
// Grab global variables, re-cache if necessary
|
||||
$config = $cache->obtain_config();
|
||||
$config = cache::obtain_config();
|
||||
|
||||
// Add own hook handler
|
||||
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
|
||||
require(PHPBB_ROOT_PATH . 'includes/hooks/index.' . PHP_EXT);
|
||||
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
|
||||
|
||||
foreach ($cache->obtain_hooks() as $hook)
|
||||
foreach (cache::obtain_hooks() as $hook)
|
||||
{
|
||||
@include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
|
||||
@include(PHPBB_ROOT_PATH . 'includes/hooks/' . $hook . '.' . PHP_EXT);
|
||||
}
|
||||
|
||||
?>
|
@@ -12,9 +12,9 @@
|
||||
*/
|
||||
define('IN_PHPBB', true);
|
||||
define('IN_CRON', true);
|
||||
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
include($phpbb_root_path . 'common.' . $phpEx);
|
||||
if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './');
|
||||
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||
|
||||
// Do not update users last page entry
|
||||
$user->session_begin(false);
|
||||
@@ -74,7 +74,7 @@ switch ($cron_type)
|
||||
{
|
||||
case 'queue':
|
||||
|
||||
if (time() - $config['queue_interval'] <= $config['last_queue_run'] || !file_exists($phpbb_root_path . 'cache/queue.' . $phpEx))
|
||||
if (time() - $config['queue_interval'] <= $config['last_queue_run'] || !file_exists(PHPBB_ROOT_PATH . 'cache/queue.' . PHP_EXT))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -85,7 +85,7 @@ switch ($cron_type)
|
||||
$use_shutdown_function = false;
|
||||
}
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
|
||||
$queue = new queue();
|
||||
|
||||
if ($use_shutdown_function)
|
||||
@@ -118,16 +118,16 @@ switch ($cron_type)
|
||||
break;
|
||||
|
||||
case 'tidy_search':
|
||||
|
||||
|
||||
// Select the search method
|
||||
$search_type = basename($config['search_type']);
|
||||
|
||||
if (time() - $config['search_gc'] <= $config['search_last_gc'] || !file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
|
||||
if (time() - $config['search_gc'] <= $config['search_last_gc'] || !file_exists(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
include_once("{$phpbb_root_path}includes/search/$search_type.$phpEx");
|
||||
include_once(PHPBB_ROOT_PATH . "includes/search/$search_type." . PHP_EXT);
|
||||
|
||||
// We do some additional checks in the module to ensure it can actually be utilised
|
||||
$error = false;
|
||||
@@ -156,7 +156,7 @@ switch ($cron_type)
|
||||
break;
|
||||
}
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
|
||||
|
||||
if ($use_shutdown_function)
|
||||
{
|
||||
@@ -176,7 +176,7 @@ switch ($cron_type)
|
||||
break;
|
||||
}
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
|
||||
|
||||
if ($use_shutdown_function)
|
||||
{
|
||||
@@ -226,7 +226,7 @@ switch ($cron_type)
|
||||
// Do the forum Prune thang
|
||||
if ($row['prune_next'] < time() && $row['enable_prune'])
|
||||
{
|
||||
include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
|
||||
|
||||
if ($row['prune_days'])
|
||||
{
|
||||
|
@@ -20,34 +20,10 @@
|
||||
//
|
||||
die("Please read the first lines of this script for instructions on how to enable it");
|
||||
|
||||
|
||||
// This script adds missing permissions
|
||||
$db = $dbhost = $dbuser = $dbpasswd = $dbport = $dbname = '';
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
define('ANONYMOUS', 1);
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
$phpbb_root_path='./../';
|
||||
include($phpbb_root_path . 'config.'.$phpEx);
|
||||
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.'.$phpEx);
|
||||
require($phpbb_root_path . 'includes/db/' . $dbms . '.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/functions.'.$phpEx);
|
||||
|
||||
define('ACL_NEVER', 0);
|
||||
define('ACL_YES', 1);
|
||||
define('ACL_NO', -1);
|
||||
|
||||
define('ACL_GROUPS_TABLE', $table_prefix.'acl_groups');
|
||||
define('ACL_OPTIONS_TABLE', $table_prefix.'acl_options');
|
||||
define('ACL_USERS_TABLE', $table_prefix.'acl_users');
|
||||
define('GROUPS_TABLE', $table_prefix.'groups');
|
||||
define('USERS_TABLE', $table_prefix.'users');
|
||||
|
||||
$cache = new acm();
|
||||
$db = new sql_db();
|
||||
|
||||
// Connect to DB
|
||||
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
|
||||
define('PHPBB_ROOT_PATH', './../');
|
||||
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
require(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||
|
||||
// auth => is_local, is_global
|
||||
$f_permissions = array(
|
||||
@@ -250,7 +226,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting)
|
||||
$sql = 'SELECT group_id FROM ' . GROUPS_TABLE . "
|
||||
WHERE group_name = '" . strtoupper($ug_id) . "'";
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
$id = (int) $db->sql_fetchfield('group_id', 0, $result);
|
||||
$id = (int) $db->sql_fetchfield('group_id', $result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!$id)
|
||||
@@ -414,4 +390,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting)
|
||||
|
||||
}
|
||||
|
||||
garbage_collection();
|
||||
exit_handler();
|
||||
|
||||
?>
|
10
phpBB/develop/adjust_avatars.php
Executable file → Normal file
10
phpBB/develop/adjust_avatars.php
Executable file → Normal file
@@ -9,9 +9,9 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||
set_time_limit(0);
|
||||
|
||||
define('IN_PHPBB', true);
|
||||
$phpbb_root_path = './../';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
define('PHPBB_ROOT_PATH', './../');
|
||||
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||
|
||||
// Start session management
|
||||
$user->session_begin();
|
||||
@@ -130,9 +130,9 @@ $db->sql_close();
|
||||
|
||||
function adjust_avatar($old_name, $midfix)
|
||||
{
|
||||
global $config, $phpbb_root_path;
|
||||
global $config;
|
||||
|
||||
$avatar_path = $phpbb_root_path . $config['avatar_path'];
|
||||
$avatar_path = PHPBB_ROOT_PATH . $config['avatar_path'];
|
||||
$extension = strtolower(substr(strrchr($old_name, '.'), 1));
|
||||
$new_name = $config['avatar_salt'] . '_' . $midfix . '.' . $extension;
|
||||
|
||||
|
@@ -11,10 +11,10 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||
set_time_limit(0);
|
||||
|
||||
define('IN_PHPBB', true);
|
||||
$phpbb_root_path = './../';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
|
||||
define('PHPBB_ROOT_PATH', './../');
|
||||
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||
include(PHPBB_ROOT_PATH . 'includes/message_parser.' . PHP_EXT);
|
||||
|
||||
// Start session management
|
||||
$user->session_begin();
|
||||
|
@@ -10,9 +10,9 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||
set_time_limit(0);
|
||||
|
||||
define('IN_PHPBB', true);
|
||||
$phpbb_root_path = './../';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
define('PHPBB_ROOT_PATH', './../');
|
||||
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||
|
||||
// Start session management
|
||||
$user->session_begin();
|
||||
|
@@ -13,9 +13,9 @@ set_time_limit(0);
|
||||
@ini_set('memory_limit', '128M');
|
||||
|
||||
define('IN_PHPBB', true);
|
||||
$phpbb_root_path = './../';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
define('PHPBB_ROOT_PATH', './../');
|
||||
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||
|
||||
// Start session management
|
||||
$user->session_begin();
|
||||
|
@@ -7,9 +7,9 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||
set_time_limit(0);
|
||||
|
||||
define('IN_PHPBB', true);
|
||||
$phpbb_root_path = './../';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
define('PHPBB_ROOT_PATH', './../');
|
||||
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||
|
||||
// Start session management
|
||||
$user->session_begin();
|
||||
|
6
phpBB/develop/adjust_uids.php
Executable file → Normal file
6
phpBB/develop/adjust_uids.php
Executable file → Normal file
@@ -12,9 +12,9 @@ set_time_limit(0);
|
||||
@ini_set('memory_limit', '512M');
|
||||
|
||||
define('IN_PHPBB', true);
|
||||
$phpbb_root_path = './../';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
define('PHPBB_ROOT_PATH', './../');
|
||||
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||
|
||||
// Start session management
|
||||
$user->session_begin();
|
||||
|
@@ -9,9 +9,9 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||
set_time_limit(0);
|
||||
|
||||
define('IN_PHPBB', true);
|
||||
$phpbb_root_path = './../';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
define('PHPBB_ROOT_PATH', './../');
|
||||
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||
|
||||
// Start session management
|
||||
$user->session_begin();
|
||||
|
@@ -1,462 +0,0 @@
|
||||
<?php
|
||||
|
||||
//
|
||||
// Security message:
|
||||
//
|
||||
// This script is potentially dangerous.
|
||||
// Remove or comment the next line (die(".... ) to enable this script.
|
||||
// Do NOT FORGET to either remove this script or disable it after you have used it.
|
||||
//
|
||||
die("Please read the first lines of this script for instructions on how to enable it");
|
||||
|
||||
//
|
||||
// Do not change anything below this line.
|
||||
//
|
||||
|
||||
|
||||
$phpbb_root_path = "../";
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/post.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
|
||||
|
||||
srand ((double) microtime() * 1000000);
|
||||
set_time_limit(240*60);
|
||||
|
||||
// Here's the text we stick in posts..
|
||||
$bigass_text = '
|
||||
phpBB BBCode test suite v0.0.2
|
||||
auto-linkification:
|
||||
http://something.com
|
||||
www.something.com
|
||||
nate@phpbb.com
|
||||
http://something.com/foo.php?this=that&theother=some%20encoded%20string is a link.
|
||||
[code]
|
||||
Simple code block with some <html> <tags>.
|
||||
[/code]
|
||||
[b]bolded[/b], [i]italic[/i]
|
||||
[email]james@totalgeek.org[/email]
|
||||
[url=http://www.totalgeek.org]totalgeek.org[/url]
|
||||
[url]www.totalgeek.org[/url]
|
||||
[list]
|
||||
[*] This is the first bulleted item.
|
||||
[*] This is the second bulleted item.
|
||||
[/list]
|
||||
[list=A]
|
||||
[*] This is the first bulleted item.
|
||||
[*] This is the second bulleted item.
|
||||
[/list]
|
||||
[quote]
|
||||
And a quote!
|
||||
[/quote]
|
||||
';
|
||||
|
||||
|
||||
// The script expects the ID's in the tables to sequential (1,2,3,4,5),
|
||||
// so no holes please (1,4,5,8)...
|
||||
$nr_of_users = nrof(USERS_TABLE);
|
||||
$nr_of_cats = nrof(CATEGORIES_TABLE);
|
||||
$nr_of_forums = nrof(FORUMS_TABLE);
|
||||
$nr_of_posts = nrof(POSTS_TABLE);
|
||||
|
||||
$u = $users;
|
||||
|
||||
$starttime = microtime();
|
||||
|
||||
$usercreationcount = 0;
|
||||
while($users > 0)
|
||||
{
|
||||
|
||||
$name = "testuser_" . substr(md5(uniqid(rand())), 0, 10);
|
||||
if (make_user($name))
|
||||
{
|
||||
$usercreationcount++;
|
||||
$users--;
|
||||
}
|
||||
if (($usercreationcount % 500) == 0)
|
||||
{
|
||||
echo "status: $usercreationcount <br>\n";
|
||||
flush();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($posts > 0)
|
||||
{
|
||||
filldb($posts);
|
||||
}
|
||||
|
||||
$endtime = microtime();
|
||||
|
||||
if ($submit="" || !isset($submit))
|
||||
{
|
||||
?>
|
||||
Hello, welcome to this little phpBB Benchmarking script :)<p>
|
||||
|
||||
At the moment there are:<br>
|
||||
|
||||
<table>
|
||||
<tr><td align="right"><?php echo $nr_of_users?></td><td>Users</td></tr>
|
||||
<tr><td align="right"><?php echo $nr_of_forums?></td><td>Forums</td></tr>
|
||||
<tr><td align="right"><?php echo $nr_of_posts?></td><td>Posts</td></tr>
|
||||
</table>
|
||||
<p>
|
||||
What do you want to create?<p>
|
||||
|
||||
<form method="get" action="<?php echo $PHP_SELF?>">
|
||||
<input type="text" name="users" size="3"> Users<br>
|
||||
<input type="text" name="posts" size="3"> Posts/topics (optional: post size in <input type="text" name="size" size="3"> bytes)<br>
|
||||
<input type="submit" name="submit">
|
||||
</form>
|
||||
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
list ($starttime_msec,$starttime_sec) = explode(" ",$starttime);
|
||||
list ($endtime_msec,$endtime_sec) = explode(" ",$endtime);
|
||||
$timetaken_sec = ($endtime_sec+$endtime_msec) - ($starttime_sec+$starttime_msec);
|
||||
print "<B>TIME TAKEN : ".$timetaken_sec."s</B><BR>\n";
|
||||
|
||||
print "<p>\n<a href=\"$PHP_SELF\">Back to the overview page</a>\n";
|
||||
}
|
||||
|
||||
|
||||
function filldb($newposts)
|
||||
{
|
||||
global $nr_of_forums;
|
||||
global $nr_of_users;
|
||||
|
||||
$forum_topic_counts = array();
|
||||
|
||||
for ($i = 1; $i <= $nr_of_forums; $i++)
|
||||
{
|
||||
$forum_topic_counts[$i] = get_topic_count($i);
|
||||
}
|
||||
|
||||
for($i = 0; $i < $newposts; $i++)
|
||||
{
|
||||
$userid = rand(2, $nr_of_users - 1);
|
||||
$forum = rand(1,$nr_of_forums);
|
||||
|
||||
if ((rand(0,30) < 1) || ($forum_topic_count[$forum] == 0))
|
||||
{
|
||||
// create a new topic 1 in 30 times (or when there are none);
|
||||
$topic = make_topic($userid, "Testing topic $i", $forum);
|
||||
$forum_topic_count[$forum]++;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise create a reply(posting) somewhere.
|
||||
$topic = get_smallest_topic($forum);
|
||||
create_posting($userid, $topic, $forum, "reply");
|
||||
}
|
||||
|
||||
if (($i % 1000) == 0)
|
||||
{
|
||||
echo "status: $i <br>";
|
||||
flush();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function get_smallest_topic($forum_id)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$sql = "SELECT topic_id
|
||||
FROM " . TOPICS_TABLE . "
|
||||
WHERE (forum_id = $forum_id)
|
||||
ORDER BY topic_replies ASC LIMIT 1";
|
||||
if($result = $db->sql_query($sql))
|
||||
{
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$topic_id = $row['topic_id'];
|
||||
|
||||
unset($result);
|
||||
unset($row);
|
||||
return $topic_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Couldn't get smallest topic.", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function get_topic_count($forum_id)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$sql = "SELECT forum_topics
|
||||
FROM " . FORUMS_TABLE . "
|
||||
WHERE (forum_id = $forum_id)";
|
||||
if($result = $db->sql_query($sql))
|
||||
{
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$topic_count = $row['forum_topics'];
|
||||
|
||||
unset($result);
|
||||
unset($row);
|
||||
return $topic_count;
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Couldn't get topic count.", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function make_topic($user_id, $subject, $forum_id)
|
||||
{
|
||||
global $db;
|
||||
$topic_type = POST_NORMAL;
|
||||
$topic_vote = 0;
|
||||
$current_time = time();
|
||||
|
||||
$sql = "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote)
|
||||
VALUES ('$subject', $user_id, $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)";
|
||||
|
||||
if( $result = $db->sql_query($sql, BEGIN_TRANSACTION) )
|
||||
{
|
||||
$new_topic_id = $db->sql_nextid();
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Error inserting data into topics table", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
|
||||
create_posting($user_id, $new_topic_id, $forum_id);
|
||||
|
||||
return $new_topic_id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function create_posting($userid, $topic_id, $forum, $mode='newtopic')
|
||||
{
|
||||
$message = generatepost();
|
||||
|
||||
return make_post($topic_id, $forum, $userid, "", $message, $mode);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function make_post($new_topic_id, $forum_id, $user_id, $post_username, $text, $mode='newtopic')
|
||||
{
|
||||
global $db;
|
||||
$current_time = time();
|
||||
$user_ip = "ac100202";
|
||||
$bbcode_on = 1;
|
||||
$html_on = 1;
|
||||
$smilies_on = 1;
|
||||
$attach_sig = 1;
|
||||
$bbcode_uid = make_bbcode_uid();
|
||||
|
||||
$post_subject = 'random subject';
|
||||
|
||||
$post_message = prepare_message($text, $html_on, $bbcode_on, $smilies_on, $bbcode_uid);
|
||||
|
||||
$sql = "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, attach_id, icon_id, post_username, post_time, poster_ip, post_approved, bbcode_uid, enable_bbcode, enable_html, enable_smilies, enable_sig, post_subject, post_text)
|
||||
VALUES ($new_topic_id, $forum_id, $user_id, 0, 0, '$post_username', $current_time, '$user_ip', 1, '$bbcode_uid', $bbcode_on, $html_on, $smilies_on, $attach_sig, '$post_subject', '$post_message')";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
$new_post_id = $db->sql_nextid();
|
||||
|
||||
$sql = "UPDATE " . TOPICS_TABLE . "
|
||||
SET topic_last_post_id = $new_post_id";
|
||||
if($mode == "reply")
|
||||
{
|
||||
$sql .= ", topic_replies = topic_replies + 1 ";
|
||||
}
|
||||
$sql .= " WHERE topic_id = $new_topic_id";
|
||||
|
||||
if($db->sql_query($sql))
|
||||
{
|
||||
$sql = "UPDATE " . FORUMS_TABLE . "
|
||||
SET forum_last_post_id = $new_post_id, forum_posts = forum_posts + 1";
|
||||
if($mode == "newtopic")
|
||||
{
|
||||
$sql .= ", forum_topics = forum_topics + 1";
|
||||
}
|
||||
$sql .= " WHERE forum_id = $forum_id";
|
||||
|
||||
if($db->sql_query($sql))
|
||||
{
|
||||
$sql = "UPDATE " . USERS_TABLE . "
|
||||
SET user_posts = user_posts + 1
|
||||
WHERE user_id = " . $user_id;
|
||||
|
||||
if($db->sql_query($sql, END_TRANSACTION))
|
||||
{
|
||||
// SUCCESS.
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Error updating users table", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Error updating forums table", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Rollback
|
||||
if($db->sql_layer == "mysql")
|
||||
{
|
||||
$sql = "DELETE FROM " . POSTS_TABLE . "
|
||||
WHERE post_id = $new_post_id";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
message_die(GENERAL_ERROR, "Error updating topics table", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Error inserting data into posts table", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function generatepost($size=850)
|
||||
{
|
||||
global $bigass_text;
|
||||
// Returns a string with a length between $size and $size*0.2
|
||||
$size = rand(0.2*$size, $size);
|
||||
|
||||
$textsize = strlen($bigass_text);
|
||||
$currentsize = 0;
|
||||
// Add whole $text multiple times
|
||||
while($currentsize < $size && $size-$currentsize <= $textsize)
|
||||
{
|
||||
$message .= $bigass_text;
|
||||
$currentsize += $textsize;
|
||||
}
|
||||
// Add the remainder number of chars and return it.
|
||||
$message .= substr($bigass_text, 0, $size-$currentsize);
|
||||
|
||||
return (addslashes($message));
|
||||
}
|
||||
|
||||
|
||||
function nrof($table)
|
||||
{
|
||||
global $db;
|
||||
$sql = "SELECT count(*) AS counted FROM $table";
|
||||
$result = $db->sql_query($sql);
|
||||
$topics = $db->sql_fetchrow($result);
|
||||
return $topics[counted];
|
||||
}
|
||||
|
||||
|
||||
function make_user($username)
|
||||
{
|
||||
global $db, $board_config;
|
||||
|
||||
$password = md5("benchpass");
|
||||
$email = "nobody@localhost";
|
||||
$icq = "12345678";
|
||||
$website = "http://www.phpbb.com";
|
||||
$occupation = "phpBB tester";
|
||||
$location = "phpBB world hq";
|
||||
$interests = "Eating, sleeping, living, and breathing phpBB";
|
||||
$signature = "$username: phpBB tester.";
|
||||
$signature_bbcode_uid = "";
|
||||
$avatar_filename = "";
|
||||
$viewemail = 0;
|
||||
$aim = 0;
|
||||
$yim = 0;
|
||||
$msn = 0;
|
||||
$attachsig = 1;
|
||||
$allowsmilies = 1;
|
||||
$allowhtml = 1;
|
||||
$allowbbcode = 1;
|
||||
$allowviewonline = 1;
|
||||
$notifyreply = 0;
|
||||
$notifypm = 0;
|
||||
$user_timezone = $board_config['board_timezone'];
|
||||
$user_dateformat = $board_config['default_dateformat'];
|
||||
$user_lang = $board_config['default_lang'];
|
||||
$user_style = $board_config['default_style'];
|
||||
|
||||
|
||||
$sql = "SELECT MAX(user_id) AS total
|
||||
FROM " . USERS_TABLE;
|
||||
if($result = $db->sql_query($sql))
|
||||
{
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$new_user_id = $row['total'] + 1;
|
||||
|
||||
unset($result);
|
||||
unset($row);
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Couldn't obtained next user_id information.", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
|
||||
$sql = "SELECT MAX(group_id) AS total
|
||||
FROM " . GROUPS_TABLE;
|
||||
if($result = $db->sql_query($sql))
|
||||
{
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$new_group_id = $row['total'] + 1;
|
||||
|
||||
unset($result);
|
||||
unset($row);
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Couldn't obtained next user_id information.", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
|
||||
|
||||
$sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmilies, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey)
|
||||
VALUES ($new_user_id, '$username', " . time() . ", '$password', '$email', '$icq', '$website', '$occupation', '$location', '$interests', '$signature', '$signature_bbcode_uid', '$avatar_filename', $viewemail, '$aim', '$yim', '$msn', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $user_timezone, '$user_dateformat', '$user_lang', $user_style, 0, 1, ";
|
||||
|
||||
|
||||
$sql .= "1, '')";
|
||||
|
||||
if($result = $db->sql_query($sql, BEGIN_TRANSACTION))
|
||||
{
|
||||
$sql = "INSERT INTO " . GROUPS_TABLE . " (group_id, group_name, group_description, group_single_user, group_moderator)
|
||||
VALUES ($new_group_id, '', 'Personal User', 1, 0)";
|
||||
if($result = $db->sql_query($sql))
|
||||
{
|
||||
$sql = "INSERT INTO " . USER_GROUP_TABLE . " (user_id, group_id, user_pending)
|
||||
VALUES ($new_user_id, $new_group_id, 0)";
|
||||
if($result = $db->sql_query($sql, END_TRANSACTION))
|
||||
{
|
||||
|
||||
// SUCCESS.
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Couldn't insert data into user_group table", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Couldn't insert data into groups table", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Couldn't insert data into users table", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@@ -21,22 +21,10 @@
|
||||
die("Please read the first lines of this script for instructions on how to enable it");
|
||||
@set_time_limit(300);
|
||||
|
||||
$db = $dbhost = $dbuser = $dbpasswd = $dbport = $dbname = '';
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
define('ANONYMOUS', 1);
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
$phpbb_root_path='./../';
|
||||
include($phpbb_root_path . 'config.'.$phpEx);
|
||||
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.'.$phpEx);
|
||||
require($phpbb_root_path . 'includes/db/' . $dbms . '.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/functions.'.$phpEx);
|
||||
|
||||
$cache = new acm();
|
||||
$db = new sql_db();
|
||||
|
||||
// Connect to DB
|
||||
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
|
||||
define('PHPBB_ROOT_PATH', './../');
|
||||
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||
|
||||
$start = 0;
|
||||
do
|
||||
|
@@ -30,23 +30,9 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||
|
||||
@set_time_limit(2400);
|
||||
|
||||
// This script adds missing permissions
|
||||
$db = $dbhost = $dbuser = $dbpasswd = $dbport = $dbname = '';
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
define('ANONYMOUS', 1);
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
$phpbb_root_path='./../';
|
||||
include($phpbb_root_path . 'config.'.$phpEx);
|
||||
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.'.$phpEx);
|
||||
require($phpbb_root_path . 'includes/db/' . $dbms . '.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/functions.'.$phpEx);
|
||||
|
||||
$cache = new acm();
|
||||
$db = new $sql_db();
|
||||
|
||||
// Connect to DB
|
||||
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
|
||||
define('PHPBB_ROOT_PATH', './../');
|
||||
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||
|
||||
$sql = "SELECT post_id, post_text FROM {$table_prefix}posts WHERE post_text LIKE '%{SMILE_PATH}%'";
|
||||
$result = $db->sql_query($sql);
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -21,10 +21,10 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||
|
||||
|
||||
define('IN_PHPBB', true);
|
||||
$phpbb_root_path = './../';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
||||
define('PHPBB_ROOT_PATH', './../');
|
||||
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||
include(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
|
||||
|
||||
set_time_limit(0);
|
||||
header('Expires: 0');
|
||||
@@ -117,14 +117,14 @@ switch ($mode)
|
||||
|
||||
if ($topic_id >= $num_topics)
|
||||
{
|
||||
echo '<meta http-equiv="refresh" content="10; url=fill.' . $phpEx . '?mode=sync&' . time() . '">And now for something completely different...';
|
||||
echo '<meta http-equiv="refresh" content="10; url=fill.' . PHP_EXT . '?mode=sync&' . time() . '">And now for something completely different...';
|
||||
|
||||
$db->sql_query('ANALYZE TABLES ' . TOPICS_TABLE . ', ' . POSTS_TABLE);
|
||||
flush();
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<meta http-equiv="refresh" content="10; url=fill.' . $phpEx . '?start=' . $topic_id . '&' . time() . '">To the next page... (' . $topic_id . '/' . $num_topics . ')';
|
||||
echo '<meta http-equiv="refresh" content="10; url=fill.' . PHP_EXT . '?start=' . $topic_id . '&' . time() . '">To the next page... (' . $topic_id . '/' . $num_topics . ')';
|
||||
flush();
|
||||
}
|
||||
break;
|
||||
@@ -141,7 +141,7 @@ switch ($mode)
|
||||
$e = explode(' ', microtime());
|
||||
|
||||
echo '<pre><b>' . ($e[0] + $e[1] - $s[0] - $s[1]) . '</b></pre>';
|
||||
echo '<a href="fill.' . $phpEx . '">Here we go again</a>';
|
||||
echo '<a href="fill.' . PHP_EXT . '">Here we go again</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -157,11 +157,11 @@ switch ($mode)
|
||||
if ($end < $num_topics)
|
||||
{
|
||||
$start += $batch_size;
|
||||
echo '<meta http-equiv="refresh" content="0; url=fill.' . $phpEx . "?mode=sync&start=$start&" . time() . "\">And now for something completely different... ($start/$num_topics)";
|
||||
echo '<meta http-equiv="refresh" content="0; url=fill.' . PHP_EXT . "?mode=sync&start=$start&" . time() . "\">And now for something completely different... ($start/$num_topics)";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<a href="fill.' . $phpEx . '">Here we go again</a>';
|
||||
echo '<a href="fill.' . PHP_EXT . '">Here we go again</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -25,8 +25,8 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||
set_time_limit(0);
|
||||
|
||||
define('IN_PHPBB', true);
|
||||
$phpbb_root_path = '../';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
define('PHPBB_ROOT_PATH', './../');
|
||||
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
|
||||
echo "Checking for required files\n";
|
||||
download('http://unicode.org/Public/UNIDATA/CaseFolding.txt');
|
||||
@@ -71,8 +71,8 @@ foreach ($array as $value)
|
||||
|
||||
foreach ($uniarray as $idx => $contents)
|
||||
{
|
||||
echo "Writing to case_fold_$idx.$phpEx\n";
|
||||
$fp = fopen($phpbb_root_path . 'includes/utf/data/case_fold_' . strtolower($idx) . '.' . $phpEx, 'wb');
|
||||
echo "Writing to case_fold_$idx." . PHP_EXT . "\n";
|
||||
$fp = fopen(PHPBB_ROOT_PATH . 'includes/utf/data/case_fold_' . strtolower($idx) . '.' . PHP_EXT, 'wb');
|
||||
fwrite($fp, '<?php return ' . my_var_export($contents) . ';');
|
||||
fclose($fp);
|
||||
}
|
||||
@@ -116,9 +116,7 @@ function my_var_export($var)
|
||||
*/
|
||||
function download($url)
|
||||
{
|
||||
global $phpbb_root_path;
|
||||
|
||||
if (file_exists($phpbb_root_path . 'develop/' . basename($url)))
|
||||
if (file_exists(PHPBB_ROOT_PATH . 'develop/' . basename($url)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -130,7 +128,7 @@ function download($url)
|
||||
die("Can't download from $url\nPlease download it yourself and put it in the develop/ dir, kthxbai");
|
||||
}
|
||||
|
||||
if (!$fpw = fopen($phpbb_root_path . 'develop/' . basename($url), 'wb'))
|
||||
if (!$fpw = fopen(PHPBB_ROOT_PATH . 'develop/' . basename($url), 'wb'))
|
||||
{
|
||||
die("Can't open develop/" . basename($url) . " for output... please check your permissions or something");
|
||||
}
|
||||
|
@@ -25,8 +25,8 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||
set_time_limit(0);
|
||||
|
||||
define('IN_PHPBB', true);
|
||||
$phpbb_root_path = '../';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
define('PHPBB_ROOT_PATH', './../');
|
||||
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
|
||||
echo "Checking for required files\n";
|
||||
download('http://unicode.org/reports/tr39/data/confusables.txt');
|
||||
@@ -155,9 +155,9 @@ foreach ($array as $value)
|
||||
$uniarray[utf8_chr(hexdec((string)$value[1]))] = $temp_hold;
|
||||
}
|
||||
|
||||
echo "Writing to confusables.$phpEx\n";
|
||||
echo "Writing to confusables." . PHP_EXT . "\n";
|
||||
|
||||
$fp = fopen($phpbb_root_path . 'includes/utf/data/confusables.' . $phpEx, 'wb');
|
||||
$fp = fopen(PHPBB_ROOT_PATH . 'includes/utf/data/confusables.' . PHP_EXT, 'wb');
|
||||
fwrite($fp, '<?php return ' . my_var_export($uniarray) . ';');
|
||||
fclose($fp);
|
||||
|
||||
@@ -200,9 +200,7 @@ function my_var_export($var)
|
||||
*/
|
||||
function download($url)
|
||||
{
|
||||
global $phpbb_root_path;
|
||||
|
||||
if (file_exists($phpbb_root_path . 'develop/' . basename($url)))
|
||||
if (file_exists(PHPBB_ROOT_PATH . 'develop/' . basename($url)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -214,7 +212,7 @@ function download($url)
|
||||
die("Can't download from $url\nPlease download it yourself and put it in the develop/ dir, kthxbai");
|
||||
}
|
||||
|
||||
if (!$fpw = fopen($phpbb_root_path . 'develop/' . basename($url), 'wb'))
|
||||
if (!$fpw = fopen(PHPBB_ROOT_PATH . 'develop/' . basename($url), 'wb'))
|
||||
{
|
||||
die("Can't open develop/" . basename($url) . " for output... please check your permissions or something");
|
||||
}
|
||||
|
@@ -25,8 +25,8 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||
set_time_limit(0);
|
||||
|
||||
define('IN_PHPBB', true);
|
||||
$phpbb_root_path = '../';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
define('PHPBB_ROOT_PATH', './../');
|
||||
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
|
||||
echo "Checking for required files\n";
|
||||
download('http://www.unicode.org/Public/UNIDATA/CompositionExclusions.txt');
|
||||
@@ -34,7 +34,7 @@ download('http://www.unicode.org/Public/UNIDATA/DerivedNormalizationProps.txt');
|
||||
download('http://www.unicode.org/Public/UNIDATA/UnicodeData.txt');
|
||||
echo "\n";
|
||||
|
||||
require_once($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
|
||||
require_once(PHPBB_ROOT_PATH . 'includes/utf/utf_normalizer.' . PHP_EXT);
|
||||
$file_contents = array();
|
||||
|
||||
/**
|
||||
@@ -172,7 +172,7 @@ fclose($fp);
|
||||
* Do mappings
|
||||
*/
|
||||
echo "Loading Unicode decomposition mappings\n";
|
||||
$fp = fopen($phpbb_root_path . 'develop/UnicodeData.txt', 'rt');
|
||||
$fp = fopen(PHPBB_ROOT_PATH . 'develop/UnicodeData.txt', 'rt');
|
||||
|
||||
$map = array();
|
||||
while (!feof($fp))
|
||||
@@ -266,9 +266,9 @@ foreach ($file_contents as $file => $contents)
|
||||
/**
|
||||
* Generate a new file
|
||||
*/
|
||||
echo "Writing to $file.$phpEx\n";
|
||||
echo "Writing to $file." . PHP_EXT . "\n";
|
||||
|
||||
if (!$fp = fopen($phpbb_root_path . 'includes/utf/data/' . $file . '.' . $phpEx, 'wb'))
|
||||
if (!$fp = fopen(PHPBB_ROOT_PATH . 'includes/utf/data/' . $file . '.' . PHP_EXT, 'wb'))
|
||||
{
|
||||
trigger_error('Cannot open ' . $file . ' for write');
|
||||
}
|
||||
@@ -288,7 +288,7 @@ echo "\n*** UTF-8 normalization tables done\n\n";
|
||||
*/
|
||||
echo "Generating search indexer tables\n";
|
||||
|
||||
$fp = fopen($phpbb_root_path . 'develop/UnicodeData.txt', 'rt');
|
||||
$fp = fopen(PHPBB_ROOT_PATH . 'develop/UnicodeData.txt', 'rt');
|
||||
|
||||
$map = array();
|
||||
while ($line = fgets($fp, 1024))
|
||||
@@ -406,8 +406,8 @@ unset($map);
|
||||
|
||||
foreach ($file_contents as $idx => $contents)
|
||||
{
|
||||
echo "Writing to search_indexer_$idx.$phpEx\n";
|
||||
$fp = fopen($phpbb_root_path . 'includes/utf/data/search_indexer_' . $idx . '.' . $phpEx, 'wb');
|
||||
echo "Writing to search_indexer_$idx." . PHP_EXT . "\n";
|
||||
$fp = fopen(PHPBB_ROOT_PATH . 'includes/utf/data/search_indexer_' . $idx . '.' . PHP_EXT, 'wb');
|
||||
fwrite($fp, '<?php return ' . my_var_export($contents) . ';');
|
||||
fclose($fp);
|
||||
}
|
||||
@@ -486,9 +486,7 @@ function my_var_export($var)
|
||||
*/
|
||||
function download($url)
|
||||
{
|
||||
global $phpbb_root_path;
|
||||
|
||||
if (file_exists($phpbb_root_path . 'develop/' . basename($url)))
|
||||
if (file_exists(PHPBB_ROOT_PATH . 'develop/' . basename($url)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -500,7 +498,7 @@ function download($url)
|
||||
die("Can't download from $url\nPlease download it yourself and put it in the develop/ dir, kthxbai");
|
||||
}
|
||||
|
||||
if (!$fpw = fopen($phpbb_root_path . 'develop/' . basename($url), 'wb'))
|
||||
if (!$fpw = fopen(PHPBB_ROOT_PATH . 'develop/' . basename($url), 'wb'))
|
||||
{
|
||||
die("Can't open develop/" . basename($url) . " for output... please check your permissions or something");
|
||||
}
|
||||
|
@@ -24,13 +24,13 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||
// Thanks to arod-1
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
$phpbb_root_path='./../';
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
define('PHPBB_ROOT_PATH', './../');
|
||||
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||
|
||||
$mode = request_var('mode', '');
|
||||
|
||||
$modules = find_modules($phpbb_root_path . 'language/en');
|
||||
$modules = find_modules(PHPBB_ROOT_PATH . 'language/en');
|
||||
|
||||
$kkeys = $keys = array();
|
||||
$langdir = dirname(__FILE__);
|
||||
@@ -81,7 +81,7 @@ while ($module = array_shift($keys))
|
||||
}
|
||||
|
||||
$color = '';
|
||||
if ((basename($module) == "common.$phpEx") || (basename($other_module) == "common.$phpEx"))
|
||||
if ((basename($module) == "common." . PHP_EXT) || (basename($other_module) == "common." . PHP_EXT))
|
||||
{
|
||||
$color = ' style="color:#B00000;"';
|
||||
}
|
||||
|
@@ -1,80 +0,0 @@
|
||||
<?php
|
||||
// -------------------------------------------------------------
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// FILENAME : merge_attachment_tables.php
|
||||
// STARTED : Tue Nov 04, 2003
|
||||
// COPYRIGHT : <20> 2001, 2003 phpBB Group
|
||||
// WWW : http://www.phpbb.com/
|
||||
// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
|
||||
//
|
||||
// Security message:
|
||||
//
|
||||
// This script is potentially dangerous.
|
||||
// Remove or comment the next line (die(".... ) to enable this script.
|
||||
// Do NOT FORGET to either remove this script or disable it after you have used it.
|
||||
//
|
||||
die("Please read the first lines of this script for instructions on how to enable it");
|
||||
|
||||
$db = $dbhost = $dbuser = $dbpasswd = $dbport = $dbname = '';
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
define('ANONYMOUS', 1);
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
$phpbb_root_path='./../';
|
||||
include($phpbb_root_path . 'config.'.$phpEx);
|
||||
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.'.$phpEx);
|
||||
require($phpbb_root_path . 'includes/db/' . $dbms . '.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/functions.'.$phpEx);
|
||||
|
||||
$cache = new acm();
|
||||
$db = new sql_db();
|
||||
|
||||
// Connect to DB
|
||||
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
|
||||
|
||||
// Rename the attachments table...
|
||||
$sql = "RENAME TABLE {$table_prefix}attachments TO {$table_prefix}attach_temp";
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql = "CREATE TABLE {$table_prefix}attachments
|
||||
SELECT d.*, a.post_id, a.user_id_from as poster_id, p.topic_id
|
||||
FROM {$table_prefix}attach_desc d, {$table_prefix}attach_temp a, {$table_prefix}posts p
|
||||
WHERE a.attach_id = d.attach_id
|
||||
AND a.post_id = p.post_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
switch ($db->sql_layer)
|
||||
{
|
||||
case 'mysql':
|
||||
case 'mysql4':
|
||||
$sql = 'ALTER TABLE ' . $table_prefix . 'attachments
|
||||
ADD PRIMARY KEY (attach_id),
|
||||
ADD INDEX filetime (filetime),
|
||||
ADD INDEX post_id (post_id),
|
||||
ADD INDEX poster_id (poster_id),
|
||||
ADD INDEX physical_filename (physical_filename(10)),
|
||||
ADD INDEX filesize (filesize),
|
||||
ADD INDEX topic_id (topic_id),
|
||||
MODIFY COLUMN attach_id mediumint(8) UNSIGNED NOT NULL auto_increment';
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
case 'mssql-odbc':
|
||||
case 'msaccess':
|
||||
break;
|
||||
|
||||
case 'postgresql':
|
||||
break;
|
||||
}
|
||||
$db->sql_query($sql);
|
||||
|
||||
//$db->sql_query("DROP TABLE {$table_prefix}attach_temp");
|
||||
|
||||
echo "<p><b>Done</b></p>\n";
|
||||
|
||||
?>
|
@@ -1,209 +0,0 @@
|
||||
<?php
|
||||
/***************************************************************************
|
||||
* merge_clean_posts.php
|
||||
* -------------------
|
||||
* begin : Tuesday, February 25, 2003
|
||||
* copyright : (C) 2003 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
//
|
||||
// Security message:
|
||||
//
|
||||
// This script is potentially dangerous.
|
||||
// Remove or comment the next line (die(".... ) to enable this script.
|
||||
// Do NOT FORGET to either remove this script or disable it after you have used it.
|
||||
//
|
||||
die("Please read the first lines of this script for instructions on how to enable it");
|
||||
|
||||
@set_time_limit(2400);
|
||||
|
||||
$db = $dbhost = $dbuser = $dbpasswd = $dbport = $dbname = '';
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
define('ANONYMOUS', 1);
|
||||
$phpbb_root_path='./../';
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'config.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/functions.'.$phpEx);
|
||||
require($phpbb_root_path . 'includes/acm/cache_' . $acm_type . '.'.$phpEx);
|
||||
include($phpbb_root_path . 'db/' . $dbms . '.'.$phpEx);
|
||||
|
||||
$cache = new acm();
|
||||
$db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
|
||||
|
||||
// Just Do it (tm)
|
||||
$sql = "RENAME TABLE {$table_prefix}posts TO {$table_prefix}posts_temp";
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql = "CREATE TABLE {$table_prefix}posts
|
||||
SELECT p.*, pt.post_subject, pt.post_text, pt.post_checksum, pt.bbcode_bitfield, pt.bbcode_uid
|
||||
FROM {$table_prefix}posts_temp p, {$table_prefix}posts_text pt
|
||||
WHERE pt.post_id = p.post_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
switch ($db->sql_layer)
|
||||
{
|
||||
case 'mysql':
|
||||
case 'mysql4':
|
||||
$sql = 'ALTER TABLE ' . $table_prefix . 'posts
|
||||
ADD PRIMARY KEY (post_id),
|
||||
ADD INDEX topic_id (topic_id),
|
||||
ADD INDEX poster_ip (poster_ip),
|
||||
ADD INDEX post_approved (post_approved),
|
||||
MODIFY COLUMN post_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
ADD COLUMN post_encoding varchar(11) DEFAULT \'iso-8859-15\' NOT NULL';
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
case 'mssql-odbc':
|
||||
case 'msaccess':
|
||||
break;
|
||||
|
||||
case 'postgresql':
|
||||
break;
|
||||
}
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql = "UPDATE {$table_prefix}topics SET topic_poster = 1 WHERE topic_poster = 0 OR topic_poster IS NULL";
|
||||
$db->sql_query($sql);
|
||||
$sql = "UPDATE {$table_prefix}topics SET topic_last_poster_id = 1 WHERE topic_last_poster_id = 0 OR topic_last_poster_id IS NULL";
|
||||
$db->sql_query($sql);
|
||||
$sql = "UPDATE {$table_prefix}posts SET poster_id = 1 WHERE poster_id = 0 OR poster_id IS NULL";
|
||||
$db->sql_query($sql);
|
||||
$sql = "UPDATE {$table_prefix}users SET user_id = 1 WHERE user_id = 0";
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql = "SELECT t.topic_id
|
||||
FROM {$table_prefix}topics t
|
||||
LEFT JOIN {$table_prefix}posts p ON p.topic_id = t.topic_id
|
||||
WHERE p.topic_id IS NULL";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$del_sql = '';
|
||||
do
|
||||
{
|
||||
$del_sql .= (($del_sql != '') ? ', ' : '') . $row['topic_id'];
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
|
||||
$sql = "DELETE FROM {$table_prefix}topics
|
||||
WHERE topic_id IN ($del_sql)";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$del_sql = '';
|
||||
$sql = "SELECT topic_id, MIN(post_id) AS first_post_id, MAX(post_id) AS last_post_id, COUNT(post_id) AS total_posts
|
||||
FROM {$table_prefix}posts
|
||||
GROUP BY topic_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$del_sql .= (($del_sql != '') ? ', ' : '') . $row['topic_id'];
|
||||
|
||||
$sql = "UPDATE {$table_prefix}topics
|
||||
SET topic_first_post_id = " . $row['first_post_id'] . ", topic_last_post_id = " . $row['last_post_id'] . ", topic_replies = " . ($row['total_posts'] - 1) . "
|
||||
WHERE topic_id = " . $row['topic_id'];
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = "DELETE FROM {$table_prefix}topics WHERE topic_id NOT IN ($del_sql)";
|
||||
$db->sql_query($sql);
|
||||
|
||||
$topic_count = $post_count = array();
|
||||
$sql = "SELECT forum_id, COUNT(topic_id) AS topics
|
||||
FROM {$table_prefix}topics
|
||||
GROUP BY forum_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$topic_count[$row['forum_id']] = $row['topics'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = "SELECT forum_id, COUNT(post_id) AS posts
|
||||
FROM {$table_prefix}posts
|
||||
GROUP BY forum_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$post_count[$row['forum_id']] = $row['posts'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
switch ($db->sql_layer)
|
||||
{
|
||||
case 'oracle':
|
||||
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
|
||||
FROM " . $table_prefix . "forums f, " . $table_prefix . "posts p, " . $table_prefix . "users u
|
||||
WHERE p.post_id = f.forum_last_post_id(+)
|
||||
AND u.user_id = p.poster_id(+)";
|
||||
break;
|
||||
|
||||
default:
|
||||
$sql = "SELECT f.forum_id, p.post_time, p.post_username, u.username, u.user_id
|
||||
FROM ((" . $table_prefix . "forums f
|
||||
LEFT JOIN " . $table_prefix . "posts p ON p.post_id = f.forum_last_post_id)
|
||||
LEFT JOIN " . $table_prefix . "users u ON u.user_id = p.poster_id)";
|
||||
break;
|
||||
}
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$sql_ary = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$forum_id = $row['forum_id'];
|
||||
|
||||
$sql_ary[] = "UPDATE " . $table_prefix . "forums
|
||||
SET forum_last_poster_id = " . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? $row['user_id'] : ANONYMOUS) . ", forum_last_poster_name = '" . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? addslashes($row['username']) : addslashes($row['post_username'])) . "', forum_last_post_time = " . $row['post_time'] . ", forum_posts = " . (($post_count[$forum_id]) ? $post_count[$forum_id] : 0) . ", forum_topics = " . (($topic_count[$forum_id]) ? $topic_count[$forum_id] : 0) . "
|
||||
WHERE forum_id = $forum_id";
|
||||
|
||||
$sql = "SELECT t.topic_id, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
|
||||
FROM " . $table_prefix . "topics t, " . $table_prefix . "users u, " . $table_prefix . "posts p, " . $table_prefix . "posts p2, " . $table_prefix . "users u2
|
||||
WHERE t.forum_id = $forum_id
|
||||
AND u.user_id = t.topic_poster
|
||||
AND p.post_id = t.topic_first_post_id
|
||||
AND p2.post_id = t.topic_last_post_id
|
||||
AND u2.user_id = p2.poster_id";
|
||||
$result2 = $db->sql_query($sql);
|
||||
|
||||
while ($row2 = $db->sql_fetchrow($result2))
|
||||
{
|
||||
$sql_ary[] = "UPDATE " . $table_prefix . "topics
|
||||
SET topic_poster = " . $row2['user_id'] . ", topic_first_poster_name = '" . ((!empty($row2['user_id']) && $row2['user_id'] != ANONYMOUS) ? addslashes($row2['username']) : addslashes($row2['post_username'])) . "', topic_last_poster_id = " . ((!empty($row2['id2']) && $row2['id2'] != ANONYMOUS) ? $row2['id2'] : ANONYMOUS) . ", topic_last_post_time = " . $row2['post_time'] . ", topic_last_poster_name = '" . ((!empty($row2['id2']) && $row2['id2'] != ANONYMOUS) ? addslashes($row2['user2']) : addslashes($row2['post_username2'])) . "'
|
||||
WHERE topic_id = " . $row2['topic_id'];
|
||||
}
|
||||
$db->sql_freeresult($result2);
|
||||
|
||||
unset($row2);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
foreach ($sql_ary as $sql)
|
||||
{
|
||||
$sql . "<br />";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
echo "<p><b>Done</b></p>\n";
|
||||
|
||||
?>
|
File diff suppressed because it is too large
Load Diff
866
phpBB/develop/posting-api.php
Normal file
866
phpBB/develop/posting-api.php
Normal file
@@ -0,0 +1,866 @@
|
||||
<?php
|
||||
define('IN_PHPBB', true);
|
||||
define('PHPBB_ROOT_PATH', './../');
|
||||
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||
|
||||
//$db = new dbal_mysqli();
|
||||
|
||||
class posting_api
|
||||
{
|
||||
/*
|
||||
topic table:
|
||||
topic_id
|
||||
forum_id
|
||||
topic_title
|
||||
topic_status
|
||||
topic_type
|
||||
topic_shadow_id // to implement
|
||||
|
||||
sec:
|
||||
topic_posts
|
||||
topic_shadow_posts
|
||||
topic_deleted_posts
|
||||
topic_unapproved_posts
|
||||
|
||||
all must be approved:
|
||||
topic_poster
|
||||
topic_first_poster_name
|
||||
topic_first_poster_id
|
||||
topic_last_post_id
|
||||
topic_last_poster_name
|
||||
topic_last_poster_id
|
||||
topic_last_post_title
|
||||
topic_last_post_time
|
||||
*/
|
||||
|
||||
/*
|
||||
post table:
|
||||
post_id
|
||||
topic_id
|
||||
post_subject
|
||||
post_body
|
||||
post_status
|
||||
post_type
|
||||
post_username
|
||||
poster_id
|
||||
forum_id
|
||||
post_time
|
||||
|
||||
/*
|
||||
forum table:
|
||||
forum_id
|
||||
forum_posts
|
||||
forum_shadow_posts
|
||||
forum_deleted_posts
|
||||
forum_unapproved_posts
|
||||
|
||||
sec:
|
||||
forum_topics
|
||||
forum_shadow_topics
|
||||
forum_deleted_topics
|
||||
forum_unapproved_topics
|
||||
|
||||
forum_last_poster_name
|
||||
forum_last_user_id
|
||||
forum_last_post_title
|
||||
forum_last_post_time
|
||||
*/
|
||||
|
||||
const NORMAL = 0;
|
||||
|
||||
// status
|
||||
const UNAPPROVED = 1;
|
||||
const DELETED = 2;
|
||||
|
||||
// type
|
||||
const ANNOUNCEMENT = 1;
|
||||
const STICKY = 2;
|
||||
|
||||
// we, for now, only support the insertion of posts that are not already
|
||||
// shadow'd and not deleted (it must first exist for it to be shadow'd or deleted!)
|
||||
static function insert_topic($data)
|
||||
{
|
||||
global $db;
|
||||
|
||||
// one transaction, we can now garuntee that atomicity of insertions
|
||||
$db->sql_transaction('begin');
|
||||
|
||||
$user_id = (int) $data['user_id'];
|
||||
$forum_id = (int) $data['forum_id'];
|
||||
$topic_title = $data['title'];
|
||||
$post_contents = $data['post_contents'];
|
||||
$topic_status = (int) $data['status'];
|
||||
$topic_type = (int) $data['type'];
|
||||
$approved = (bool) $data['approved'];
|
||||
|
||||
$shadow_forums = $data['shadow_forums'];
|
||||
|
||||
$time = ($data['time']) ? (int) $data['time'] : time();
|
||||
|
||||
if (isset($data['username']))
|
||||
{
|
||||
$username = $data['username'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = 'SELECT username
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE user_id = ' . $user_id;
|
||||
$result = $db->sql_query($sql);
|
||||
$username = (string) $db->sql_fetchfield('username');
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
$sql = 'SELECT forum_topics, forum_unapproved_topics, forum_posts, forum_unapproved_posts
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forum_id = ' . (int) $forum_id;
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// throw our topic to the dogs
|
||||
$topic_data = array(
|
||||
'topic_title' => $topic_title,
|
||||
'topic_status' => $topic_status,
|
||||
'topic_type' => $topic_type,
|
||||
'topic_posts' => 1,
|
||||
'topic_shadow_posts' => 0,
|
||||
'topic_deleted_posts' => 0,
|
||||
'topic_unapproved_posts' => ($approved) ? 0 : 1,
|
||||
'topic_first_poster_name' => $username,
|
||||
'topic_poster' => $user_id,
|
||||
'topic_last_username' => $username,
|
||||
'topic_last_post_title' => $topic_title,
|
||||
'topic_last_post_time' => $time,
|
||||
'topic_last_poster_id' => $user_id,
|
||||
'forum_id' => $forum_id
|
||||
);
|
||||
|
||||
$db->sql_handle_data('INSERT', TOPICS_TABLE, $topic_data);
|
||||
$topic_id = $db->sql_nextid();
|
||||
|
||||
// I suppose it is time to make us a post, no?
|
||||
$post_data = array(
|
||||
'topic_id' => $topic_id,
|
||||
'post_subject' => $topic_title,
|
||||
'post_body' => $post_contents,
|
||||
'post_username' => $username,
|
||||
'poster_id' => $user_id,
|
||||
'post_status' => $topic_status, // first post inherits its type from the topic
|
||||
'post_type' => self::NORMAL, // for now, there are no shadow, global or sticky posts
|
||||
'forum_id' => $forum_id
|
||||
);
|
||||
|
||||
$db->sql_handle_data('INSERT', POSTS_TABLE, $post_data);
|
||||
$post_id = $db->sql_nextid();
|
||||
|
||||
// time to fill in the blanks
|
||||
$db->sql_handle_data('UPDATE', TOPICS_TABLE, array('topic_first_post_id' => $post_id, 'topic_last_post_id' => $post_id), "topic_id = $topic_id");
|
||||
|
||||
// let's go update the forum table
|
||||
$forum_data = array(
|
||||
'forum_posts' => ++$row['forum_posts'],
|
||||
'forum_topics' => ++$row['forum_topics'],
|
||||
);
|
||||
|
||||
// the last post inserted is always the latest,
|
||||
// we must update the forum records to make sure everybody knows the good news
|
||||
if ($approved)
|
||||
{
|
||||
$forum_data['forum_last_poster_name'] = $username;
|
||||
$forum_data['forum_last_user_id'] = $user_id;
|
||||
$forum_data['forum_last_post_title'] = $topic_title;
|
||||
$forum_data['forum_last_post_time'] = $time;
|
||||
}
|
||||
else
|
||||
{
|
||||
$forum_data['forum_unapproved_posts'] = ++$row['forum_unapproved_posts'];
|
||||
$forum_data['forum_unapproved_topics'] = ++$row['forum_unapproved_topics'];
|
||||
}
|
||||
|
||||
$db->sql_handle_data('UPDATE', FORUMS_TABLE, $forum_data, "forum_id = $forum_id");
|
||||
|
||||
foreach ($shadow_forums as $shadow_forum_id)
|
||||
{
|
||||
$data['shadow_topic_id'] = $topic_id;
|
||||
$data['forum_id'] = $shadow_forum_id;
|
||||
self::insert_shadow_topic($data);
|
||||
}
|
||||
|
||||
// we are consistant, victory is ours
|
||||
$db->sql_transaction('commit');
|
||||
}
|
||||
|
||||
// inserts a shadow topic into the database
|
||||
static function insert_shadow_topic($data)
|
||||
{
|
||||
global $db;
|
||||
|
||||
// one transaction, we can now garuntee that atomicity of insertions
|
||||
$db->sql_transaction('begin');
|
||||
|
||||
$user_id = (int) $data['user_id'];
|
||||
$forum_id = (int) $data['forum_id'];
|
||||
$topic_title = $data['title'];
|
||||
$topic_status = (int) $data['status'];
|
||||
$topic_type = (int) $data['type'];
|
||||
$time = ($data['time']) ? (int) $data['time'] : time();
|
||||
$shadow_topic_id = (int) $data['shadow_topic_id'];
|
||||
$approved = (bool) $data['approved'];
|
||||
|
||||
if (isset($data['username']))
|
||||
{
|
||||
$username = $data['username'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = 'SELECT username
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE user_id = ' . $user_id;
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$username = $row['username'];
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
$sql = 'SELECT forum_topics, forum_shadow_topics
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forum_id = ' . (int) $forum_id;
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// throw our topic to the dogs
|
||||
$topic_data = array(
|
||||
'topic_title' => $topic_title,
|
||||
'topic_status' => $topic_status,
|
||||
'topic_type' => $topic_type,
|
||||
'topic_posts' => 0,
|
||||
'topic_shadow_posts' => 0,
|
||||
'topic_deleted_posts' => 0,
|
||||
'topic_unapproved_posts' => ($approved ? 0 : 1),
|
||||
'topic_first_poster_name' => $username,
|
||||
'topic_poster' => $user_id,
|
||||
'topic_last_username' => $username,
|
||||
'topic_last_post_title' => $topic_title,
|
||||
'topic_last_post_time' => $time,
|
||||
'topic_last_poster_id' => $user_id,
|
||||
'forum_id' => $forum_id,
|
||||
'topic_shadow_id' => $shadow_topic_id
|
||||
);
|
||||
|
||||
$db->sql_handle_data('INSERT', TOPICS_TABLE, $topic_data);
|
||||
|
||||
// let's go update the forum table
|
||||
$forum_data = array(
|
||||
'forum_topics' => ++$row['forum_topics'],
|
||||
'forum_shadow_topics' => ++$row['forum_shadow_topics']
|
||||
);
|
||||
|
||||
// an unapproved shadow topic? I suppose...
|
||||
if (!$approved)
|
||||
{
|
||||
$forum_data['forum_unapproved_topics'] = ++$row['forum_unapproved_topics'];
|
||||
}
|
||||
|
||||
$db->sql_handle_data('UPDATE', FORUMS_TABLE, $forum_data, "forum_id = $forum_id");
|
||||
|
||||
// we are consistant, victory is ours
|
||||
$db->transaction('END');
|
||||
}
|
||||
|
||||
static function insert_post($data)
|
||||
{
|
||||
global $db;
|
||||
// one transaction, we can now garuntee that atomicity of insertions
|
||||
$db->transaction('BEGIN');
|
||||
|
||||
$user_id = (int) $data['user_id'];
|
||||
$topic_id = (int) $data['topic_id'];
|
||||
|
||||
// begin massive amounts of hand holding
|
||||
|
||||
if (isset($data['forum_id']))
|
||||
{
|
||||
$forum_id = (int) $data['forum_id'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = 'SELECT forum_id
|
||||
FROM ' . TOPICS_TABLE . '
|
||||
WHERE topic_id = ' . $topic_id;
|
||||
$result = $db->sql_query($sql);
|
||||
$forum_id = (int) $db->sql_fetchfield('forum_id');
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
$post_title = $data['title'];
|
||||
$post_contents = $data['post_contents'];
|
||||
$time = ($data['time']) ? (int) $data['time'] : time();
|
||||
|
||||
if (isset($data['username']))
|
||||
{
|
||||
$username = $data['username'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = 'SELECT username
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE user_id = ' . $user_id;
|
||||
$result = $db->sql_query($sql);
|
||||
$username = (string) $db->sql_fetchfield('username');
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
// hand holding complete, lets write some posts
|
||||
|
||||
$sql = 'SELECT forum_topics, forum_unapproved_topics, forum_posts, forum_unapproved_posts
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forum_id = ' . (int) $forum_id;
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$post_status = (int) $data['post_status'];
|
||||
$approved = ($post_status === self::NORMAL);
|
||||
|
||||
// I suppose it is time to make us a post, no?
|
||||
$post_data = array(
|
||||
'topic_id' => $topic_id,
|
||||
'post_subject' => $post_title,
|
||||
'post_body' => $post_contents,
|
||||
'post_username' => $username,
|
||||
'poster_id' => $user_id,
|
||||
'post_status' => $post_status,
|
||||
'forum_id' => $forum_id,
|
||||
);
|
||||
$db->sql_handle_data('INSERT', POSTS_TABLE, $post_data);
|
||||
|
||||
// what is the new post_id?
|
||||
$post_id = $db->sql_nextid();
|
||||
|
||||
// iceberg ahead! we must only update the topic information if the post is approved ;)
|
||||
if ($approved)
|
||||
{
|
||||
// time to fill in the blanks
|
||||
$topics_data = array(
|
||||
'topic_last_poster_id' => $user_id,
|
||||
'topic_last_post_id' => $post_id,
|
||||
'topic_last_poster_name'=> $username,
|
||||
'topic_last_post_title' => $post_title,
|
||||
'topic_last_post_time' => $time,
|
||||
);
|
||||
$db->sql_handle_data('UPDATE', TOPICS_TABLE, $topics_data, "topic_id = $topic_id");
|
||||
}
|
||||
|
||||
// let's go update the forum table
|
||||
$forum_data = array(
|
||||
'forum_posts' => ++$row['forum_posts'],
|
||||
);
|
||||
|
||||
// the last post inserted is always the latest,
|
||||
// we must update the forum records to make sure everybody knows the good news
|
||||
if ($approved)
|
||||
{
|
||||
$forum_data['forum_last_poster_name'] = $username;
|
||||
$forum_data['forum_last_user_id'] = $user_id;
|
||||
$forum_data['forum_last_post_title'] = $post_title;
|
||||
$forum_data['forum_last_post_time'] = $time;
|
||||
}
|
||||
else
|
||||
{
|
||||
$forum_data['forum_unapproved_posts'] = ++$row['forum_unapproved_posts'];
|
||||
}
|
||||
|
||||
$db->sql_handle_data('UPDATE', FORUMS_TABLE, $forum_data, "forum_id = $forum_id");
|
||||
|
||||
// we are consistant, victory is ours
|
||||
$db->sql_transaction('commit');
|
||||
}
|
||||
|
||||
static function delete_topic($data)
|
||||
{
|
||||
// just call the more powerful variant with just one topic :)
|
||||
self::delete_topics(array('topic_ids' => array($data['topic_id'])));
|
||||
}
|
||||
|
||||
static function delete_topics($data)
|
||||
{
|
||||
global $db;
|
||||
|
||||
// lets get this party started
|
||||
$db->sql_transaction('begin');
|
||||
|
||||
$topic_ids = array_map('intval', $data['topic_ids']);
|
||||
|
||||
// what kind of topic is this? lets find out how much we must tamper with the forum table...
|
||||
// TODO: investigate how aggregate functions can speed this up/reduce the number of results returned/misc. other benefits
|
||||
$sql = 'SELECT topic_posts, topic_shadow_posts, topic_deleted_posts, topic_unapproved_posts, topic_shadow_id, forum_id, topic_status
|
||||
FROM ' . TOPICS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('topic_id', $topic_ids);
|
||||
$result = $db->sql_query($sql);
|
||||
// the following in an array, key'd by forum id that refers to topic rows
|
||||
$forum_lookup = array();
|
||||
while ($topic_row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$forum_id = (int) $topic_row['forum_id'];
|
||||
|
||||
// deal with posts
|
||||
$forum_lookup[$forum_id]['forum_posts'] += $topic_row['topic_posts'];
|
||||
$forum_lookup[$forum_id]['forum_shadow_posts'] += $topic_row['topic_shadow_posts'];
|
||||
$forum_lookup[$forum_id]['forum_deleted_posts'] += $topic_row['topic_deleted_posts'];
|
||||
$forum_lookup[$forum_id]['forum_unapproved_posts'] += $topic_row['topic_unapproved_posts'];
|
||||
|
||||
// deal with topics
|
||||
$topic_status = (int) $topic_row['topic_status'];
|
||||
$forum_lookup[$forum_id]['forum_topics']++; // a topic is a topic
|
||||
$forum_lookup[$forum_id]['forum_shadow_topics'] += ($topic_row['topic_shadow_id'] != 0);
|
||||
$forum_lookup[$forum_id]['forum_deleted_topics'] += ($topic_status & self::DELETED);
|
||||
$forum_lookup[$forum_id]['forum_unapproved_topics'] += ($topic_status & self::UNAPPROVED);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// goodnight, topics
|
||||
$db->sql_query('DELETE FROM ' . TOPICS_TABLE . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids));
|
||||
|
||||
// goodnight, posts
|
||||
$db->sql_query('DELETE FROM ' . POSTS_TABLE . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids));
|
||||
|
||||
$forum_ids = array_keys($forum_lookup);
|
||||
|
||||
// what kind of topic is this? lets find out how much we must tamper with the forum table...
|
||||
$sql = 'SELECT forum_posts, forum_shadow_posts, forum_deleted_posts, forum_unapproved_posts, forum_id
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('forum_id', $forum_ids);
|
||||
$result = $db->sql_query($sql);
|
||||
$forum_rows = array();
|
||||
while ($forum_row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$forum_id = (int) $forum_row['forum_id'];
|
||||
$forum_rows[$forum_id] = $forum_row;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$shadow_topic_ids = array();
|
||||
foreach ($forum_rows as $forum_id => $forum_row)
|
||||
{
|
||||
$topic_row = $forum_lookup[$forum_id];
|
||||
$forum_array = array(
|
||||
'forum_posts' => max($forum_row['forum_posts'] - $topic_row['forum_posts'], 0),
|
||||
'forum_shadow_posts' => max($forum_row['forum_shadow_posts'] - $topic_row['forum_shadow_posts'], 0),
|
||||
'forum_deleted_posts' => max($forum_row['forum_deleted_posts'] - $topic_row['forum_deleted_posts'], 0),
|
||||
'forum_unapproved_posts' => max($forum_row['forum_unapproved_posts'] - $topic_row['forum_unapproved_posts'], 0),
|
||||
|
||||
'forum_topics' => max($forum_row['forum_topics'] - $topic_row['forum_topics'], 0),
|
||||
'forum_shadow_topics' => max($forum_row['forum_shadow_topics'] - $topic_row['forum_shadow_topics'], 0),
|
||||
'forum_deleted_topics' => max($forum_row['forum_deleted_topics'] - $topic_row['forum_deleted_topics'], 0),
|
||||
'forum_unapproved_topics' => max($forum_row['forum_unapproved_topics'] - $topic_row['forum_unapproved_topics'], 0),
|
||||
);
|
||||
|
||||
// get the last "normal" post in the forum, we _must_ update it
|
||||
$sql = 'SELECT MAX(post_id) as max_post_id
|
||||
FROM ' . POSTS_TABLE . '
|
||||
WHERE post_status = ' . self::NORMAL . '
|
||||
AND forum_id = ' . $forum_id;
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// anything left?
|
||||
if ($row)
|
||||
{
|
||||
// OK, lets go do some magick
|
||||
$sql = 'SELECT post_username, poster_id, post_subject, post_time
|
||||
FROM '. POSTS_TABLE . '
|
||||
WHERE post_id = ' . (int) $row['max_post_id'];
|
||||
$result = $db->sql_query($sql);
|
||||
$last_post = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$forum_array['forum_last_user_id'] = (int) $last_post['poster_id'];
|
||||
$forum_array['forum_last_poster_name'] = $last_post['post_username'];
|
||||
$forum_array['forum_last_post_title'] = $last_post['post_subject'];
|
||||
$forum_array['forum_last_post_time'] = (int) $last_post['post_time'];
|
||||
}
|
||||
else
|
||||
{
|
||||
// reset forum state
|
||||
$forum_array['forum_last_user_id'] = 0;
|
||||
$forum_array['forum_last_poster_name'] = '';
|
||||
$forum_array['forum_last_post_title'] = '';
|
||||
$forum_array['forum_last_post_time'] = 0;
|
||||
}
|
||||
|
||||
$db->sql_handle_data('UPDATE', FORUMS_TABLE, $forum_array, "forum_id = $forum_id");
|
||||
}
|
||||
|
||||
// let's not get too hasty, we can kill off the shadows later,
|
||||
// instead we compose a list of all shadows and then efficiently kill them off :)
|
||||
$sql = 'SELECT topic_id
|
||||
FROM ' . TOPICS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('topic_shadow_id', $topic_ids);
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$shadow_topic_ids[] = $row['topic_id'];
|
||||
}
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// recursion, the other white meat.
|
||||
if (sizeof($shadow_topic_ids))
|
||||
{
|
||||
self::delete_topics(array('topic_ids' => $shadow_topic_ids));
|
||||
}
|
||||
|
||||
// goodnight, moon
|
||||
$db->transaction('commit');
|
||||
}
|
||||
|
||||
static function delete_post($data)
|
||||
{
|
||||
// just call the more powerful variant with just one post :)
|
||||
self::delete_posts(array('post_ids' => array($data['post_id'])));
|
||||
}
|
||||
|
||||
static function delete_posts($data)
|
||||
{
|
||||
global $db;
|
||||
|
||||
// lets get this party started
|
||||
$db->sql_transaction('begin');
|
||||
|
||||
$post_ids = array_map('intval', $data['post_ids']);
|
||||
|
||||
$sql = 'SELECT topic_id, post_status, post_id, post_shadow_id, forum_id
|
||||
FROM ' . POSTS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('post_id', $post_ids);
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
// the following arrays are designed to allow for much faster updates
|
||||
$topic_lookup = array();
|
||||
$forum_lookup = array();
|
||||
|
||||
while ($post_row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$topic_id = (int) $post_row['topic_id'];
|
||||
$forum_id = (int) $post_row['forum_id'];
|
||||
$post_status = (int) $post_row['post_status'];
|
||||
|
||||
$topic_lookup[$topic_id]['topic_posts']++; // we remove a post, go figure
|
||||
$topic_lookup[$topic_id]['topic_shadow_posts'] += ($post_row['post_shadow_id'] != 0); // did we just try to kill a shadow post?!
|
||||
$topic_lookup[$topic_id]['topic_deleted_posts'] += ($post_status & self::DELETED);
|
||||
$topic_lookup[$topic_id]['topic_unapproved_posts'] += ($post_status & self::UNAPPROVED);
|
||||
|
||||
$forum_lookup[$forum_id]['forum_posts']++;
|
||||
$forum_lookup[$topic_id]['forum_shadow_posts'] += ($post_row['post_shadow_id'] != 0); // did we just try to kill a shadow post?!
|
||||
$forum_lookup[$topic_id]['forum_deleted_posts'] += ($post_status & self::DELETED);
|
||||
$forum_lookup[$topic_id]['forum_unapproved_posts'] += ($post_status & self::UNAPPROVED);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$topic_ids = array_keys($forum_lookup);
|
||||
|
||||
// goodnight, posts
|
||||
$db->sql_query('DELETE FROM ' . POSTS_TABLE . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids));
|
||||
|
||||
// mangle the forums table
|
||||
$sql = 'SELECT forum_posts, forum_shadow_posts, forum_deleted_posts, forum_unapproved_posts, forum_id
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forum_id = ' . $forum_id;
|
||||
$result = $db->sql_query($sql);
|
||||
$forum_rows = array();
|
||||
while ($forum_row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$forum_id = (int) $forum_row['forum_id'];
|
||||
$forum_rows[$forum_id] = $forum_row;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$shadow_topic_ids = array();
|
||||
foreach ($forum_rows as $forum_id => $forum_row)
|
||||
{
|
||||
$topic_row = $forum_lookup[$forum_id];
|
||||
$forum_array = array(
|
||||
'forum_posts' => max($forum_row['forum_posts'] - $topic_row['forum_posts'], 0),
|
||||
'forum_shadow_posts' => max($forum_row['forum_shadow_posts'] - $topic_row['forum_shadow_posts'], 0),
|
||||
'forum_deleted_posts' => max($forum_row['forum_deleted_posts'] - $topic_row['forum_deleted_posts'], 0),
|
||||
'forum_unapproved_posts' => max($forum_row['forum_unapproved_posts'] - $topic_row['forum_unapproved_posts'], 0),
|
||||
);
|
||||
|
||||
// get the last "normal" post in the forum, we _must_ update it
|
||||
$sql = 'SELECT MAX(post_id) as max_post_id
|
||||
FROM ' . POSTS_TABLE . '
|
||||
WHERE post_status = ' . self::NORMAL . '
|
||||
AND forum_id = ' . $forum_id;
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// anything left?
|
||||
if ($row)
|
||||
{
|
||||
// OK, lets go do some magick
|
||||
$sql = 'SELECT post_username, poster_id, post_subject, post_time
|
||||
FROM '. POSTS_TABLE . '
|
||||
WHERE post_id = ' . (int) $row['max_post_id'];
|
||||
$result = $db->sql_query($sql);
|
||||
$last_post = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$forum_array['forum_last_user_id'] = (int) $last_post['poster_id'];
|
||||
$forum_array['forum_last_poster_name'] = $last_post['post_username'];
|
||||
$forum_array['forum_last_post_title'] = $last_post['post_subject'];
|
||||
$forum_array['forum_last_post_time'] = (int) $last_post['post_time'];
|
||||
}
|
||||
else
|
||||
{
|
||||
// reset forum state
|
||||
$forum_array['forum_last_user_id'] = 0;
|
||||
$forum_array['forum_last_poster_name'] = '';
|
||||
$forum_array['forum_last_post_title'] = '';
|
||||
$forum_array['forum_last_post_time'] = 0;
|
||||
}
|
||||
|
||||
$db->sql_handle_data('UPDATE', FORUMS_TABLE, $forum_array, "forum_id = $forum_id");
|
||||
}
|
||||
|
||||
// mangle the topics table now :)
|
||||
$sql = 'SELECT topic_posts, topic_shadow_posts, topic_deleted_posts, topic_unapproved_posts, topic_id
|
||||
FROM ' . TOPICS_TABLE . '
|
||||
WHERE forum_id = ' . $forum_id;
|
||||
$result = $db->sql_query($sql);
|
||||
$topic_rows = array();
|
||||
while ($topic_row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$topic_id = (int) $topic_row['topic_id'];
|
||||
$topic_rows[$topic_id] = $topic_row;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$empty_topic_ids = array();
|
||||
|
||||
foreach ($topic_rows as $topic_id => $topic_row)
|
||||
{
|
||||
$post_row = $topic_lookup[$topic_id];
|
||||
$topic_array = array(
|
||||
'topic_posts' => max($topic_row['topic_posts'] - $post_row['topic_posts'], 0),
|
||||
'topic_shadow_posts' => max($topic_row['topic_shadow_posts'] - $post_row['topic_shadow_posts'], 0),
|
||||
'topic_deleted_posts' => max($topic_row['topic_deleted_posts'] - $post_row['topic_deleted_posts'], 0),
|
||||
'topic_unapproved_posts' => max($topic_row['topic_unapproved_posts'] - $post_row['topic_unapproved_posts'], 0),
|
||||
);
|
||||
|
||||
// get the last "normal" post in the topic, we _must_ update it
|
||||
$sql = 'SELECT MAX(post_id) as max_post_id
|
||||
FROM ' . POSTS_TABLE . '
|
||||
WHERE post_status = ' . self::NORMAL . '
|
||||
AND topic_id = ' . $topic_id;
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// anything left?
|
||||
if ($row)
|
||||
{
|
||||
// OK, lets go do some magick
|
||||
$sql = 'SELECT post_username, poster_id, post_subject, post_time
|
||||
FROM '. POSTS_TABLE . '
|
||||
WHERE post_id = ' . (int) $row['max_post_id'];
|
||||
$result = $db->sql_query($sql);
|
||||
$last_post = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$topic_array['topic_last_user_id'] = (int) $last_post['poster_id'];
|
||||
$topic_array['topic_last_poster_name'] = $last_post['post_username'];
|
||||
$topic_array['topic_last_post_title'] = $last_post['post_subject'];
|
||||
$topic_array['topic_last_post_time'] = (int) $last_post['post_time'];
|
||||
}
|
||||
else
|
||||
{
|
||||
// mark this post for execution!
|
||||
$empty_topic_ids[] = $topic_id;
|
||||
}
|
||||
|
||||
$db->sql_handle_data('UPDATE', TOPICS_TABLE, $topic_array, "topic_id = $topic_id");
|
||||
}
|
||||
|
||||
$shadow_post_ids = array();
|
||||
|
||||
// let's not get too hasty, we can kill off the shadows later,
|
||||
// instead we compose a list of all shadows and then efficiently kill them off :)
|
||||
$sql = 'SELECT post_id
|
||||
FROM ' . POSTS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('post_shadow_id', $topic_ids);
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$shadow_post_ids[] = $row['post_id'];
|
||||
}
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// recursion, the other white meat.
|
||||
if (sizeof($shadow_topic_ids))
|
||||
{
|
||||
self::delete_posts(array('post_ids' => $shadow_post_ids));
|
||||
}
|
||||
|
||||
// we killed all the posts in a topic, time to kill the topics!
|
||||
if (sizeof($empty_topic_ids))
|
||||
{
|
||||
self::delete_topics(array('topic_ids' => $empty_topic_ids));
|
||||
}
|
||||
|
||||
// goodnight, moon
|
||||
$db->transaction('commit');
|
||||
}
|
||||
|
||||
static function move_topic($data)
|
||||
{
|
||||
self::move_topics(array('topic_forum_mapping' => array(array('topic_id' => $data['topic_id'], 'forum_id' => $data['forum_id'], 'make_shadow' => $data['make_shadow']))));
|
||||
}
|
||||
|
||||
static function move_topics($data)
|
||||
{
|
||||
global $db;
|
||||
|
||||
// lets get this party started
|
||||
$db->transaction('begin');
|
||||
|
||||
// all of each are indexed by topic id
|
||||
$to_forum_ids = $shadow_topic_ids = array();
|
||||
|
||||
foreach ($data['topic_forum_mapping'] as $mapping)
|
||||
{
|
||||
$topic_id = (int) $mapping['topic_id'];
|
||||
$to_forum_ids[$topic_id] = (int) $mapping['forum_id'];
|
||||
if ($mapping['make_shadow'])
|
||||
{
|
||||
$shadow_topic_ids[] = $topic_id;
|
||||
}
|
||||
}
|
||||
|
||||
$forum_columns = array('forum_posts', 'forum_shadow_posts', 'forum_deleted_posts', 'forum_unapproved_posts', 'forum_topics', 'forum_shadow_topics', 'forum_deleted_topics', 'forum_unapproved_topics');
|
||||
|
||||
$topic_ids = array_keys($to_forum_ids);
|
||||
|
||||
// let us first determine how many items we are removing from the pool
|
||||
$sql = 'SELECT topic_posts, topic_shadow_posts, topic_deleted_posts, topic_unapproved_posts, forum_id, topic_status, topic_type, topic_shadow_id, topic_id
|
||||
FROM ' . TOPICS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('topic_id', $topic_ids);
|
||||
$result = $db->sql_query($sql);
|
||||
$forum_lookup = array();
|
||||
while ($topic_row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$topic_id = $topic_row['topic_id'];
|
||||
$from_forum_id = (int) $topic_row['forum_id'];
|
||||
$to_forum_id = $to_forum_ids[$topic_id];
|
||||
|
||||
// we are iterating one topic at a time...
|
||||
$forum_lookup[$from_forum_id]['forum_topics'] = $forum_lookup[$to_forum_id]['forum_topics'] = 1;
|
||||
|
||||
foreach ($forum_columns as $column)
|
||||
{
|
||||
$forum_lookup[$from_forum_id][$column] -= $topic_row['topic_posts'];
|
||||
$forum_lookup[$to_forum_id][$column] += $topic_row['topic_posts'];
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// determine the totals
|
||||
$sql = 'SELECT forum_posts, forum_shadow_posts, forum_deleted_posts, forum_unapproved_posts, forum_id, forum_topics, forum_deleted_topics, forum_unapproved_topics
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('forum_id', array_keys($forum_lookup));
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$forum_id = (int) $row['forum_id'];
|
||||
|
||||
foreach ($forum_columns as $column)
|
||||
{
|
||||
$forum_lookup[$forum_id][$column] += (int) $row[$column];
|
||||
}
|
||||
}
|
||||
|
||||
// create a listing of which topics are going in which forums
|
||||
$update_list = array();
|
||||
|
||||
foreach ($to_forum_ids as $topic_id => $forum_id)
|
||||
{
|
||||
$update_list[$forum_id][] = $topic_id;
|
||||
}
|
||||
|
||||
// we save as many queries as we can by updating all similar topics at once
|
||||
foreach ($update_list as $forum_id => $topic_ids)
|
||||
{
|
||||
// update the topic itself
|
||||
$db->sql_handle_data('UPDATE', TOPICS_TABLE, array('forum_id' => $to_forum_id), $db->sql_in_set('topic_id', $topic_ids));
|
||||
|
||||
// update the posts now
|
||||
$db->sql_handle_data('UPDATE', POSTS_TABLE, array('forum_id' => $to_forum_id), $db->sql_in_set('topic_id', $topic_ids));
|
||||
}
|
||||
|
||||
// start building the needed arrays for updating the forum data
|
||||
foreach ($forum_lookup as $forum_id => $forum_data)
|
||||
{
|
||||
foreach ($forum_columns as $column)
|
||||
{
|
||||
$forum_data[$column] = max($forum_data[$column], 0); // ensure the result is unsigned
|
||||
}
|
||||
|
||||
// get the last "normal" post in the old forum, we _must_ update it
|
||||
$sql = 'SELECT MAX(post_id) as max_post_id
|
||||
FROM ' . POSTS_TABLE . '
|
||||
WHERE post_status = ' . self::NORMAL . '
|
||||
AND forum_id = ' . $forum_id;
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// anything left?
|
||||
if ($row)
|
||||
{
|
||||
// OK, lets go do some magick
|
||||
$sql = 'SELECT post_username, poster_id, post_subject, post_time
|
||||
FROM '. POSTS_TABLE . '
|
||||
WHERE post_id = ' . (int) $row['max_post_id'];
|
||||
$result = $db->sql_query($sql);
|
||||
$last_post = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$forum_data['forum_last_user_id'] = (int) $last_post['poster_id'];
|
||||
$forum_data['forum_last_poster_name'] = $last_post['post_username'];
|
||||
$forum_data['forum_last_post_title'] = $last_post['post_subject'];
|
||||
$forum_data['forum_last_post_time'] = (int) $last_post['post_time'];
|
||||
}
|
||||
else
|
||||
{
|
||||
// reset forum state
|
||||
$forum_data['forum_last_user_id'] = 0;
|
||||
$forum_data['forum_last_poster_name'] = '';
|
||||
$forum_data['forum_last_post_title'] = '';
|
||||
$forum_data['forum_last_post_time'] = 0;
|
||||
}
|
||||
|
||||
// update the old forum
|
||||
$db->sql_handle_data('UPDATE', FORUMS_TABLE, $forum_data, "forum_id = $forum_id");
|
||||
}
|
||||
|
||||
// hooray for code reuse!
|
||||
foreach ($shadow_topic_ids as $topic_id)
|
||||
{
|
||||
$data['shadow_topic_id'] = $topic_id;
|
||||
$data['forum_id'] = $from_forum_id;
|
||||
self::insert_shadow_topic($data);
|
||||
}
|
||||
|
||||
$db->sql_transaction('commit');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@@ -80,4 +80,4 @@ echo 'www.URL: ' . $www_url . "<br />\n";
|
||||
$relative_url = "$segment$path_abempty(?:\?$query)?(?:\#$fragment)?";
|
||||
echo 'relative URL: ' . $relative_url . "<br />\n";
|
||||
|
||||
?>
|
||||
?>
|
||||
|
12
phpBB/develop/repair_bots.php
Executable file → Normal file
12
phpBB/develop/repair_bots.php
Executable file → Normal file
@@ -11,10 +11,10 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||
set_time_limit(0);
|
||||
|
||||
define('IN_PHPBB', true);
|
||||
$phpbb_root_path = './../';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
include($phpbb_root_path . '/includes/functions_user.'.$phpEx);
|
||||
define('PHPBB_ROOT_PATH', './../');
|
||||
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||
include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||
|
||||
|
||||
// Start session management
|
||||
@@ -98,7 +98,7 @@ function add_bots($bots)
|
||||
|
||||
$sql = 'SELECT group_id FROM ' . GROUPS_TABLE . " WHERE group_name = 'BOTS'";
|
||||
$result = $db->sql_query($sql);
|
||||
$group_id = (int) $db->sql_fetchfield('group_id', false, $result);
|
||||
$group_id = (int) $db->sql_fetchfield('group_id', $result);
|
||||
$db->sql_freeresult($result);
|
||||
$db->sql_query('TRUNCATE TABLE ' . BOTS_TABLE);
|
||||
|
||||
@@ -108,7 +108,7 @@ function add_bots($bots)
|
||||
|
||||
$sql = 'SELECT group_id FROM ' . GROUPS_TABLE . " WHERE group_name = 'BOTS'";
|
||||
$result = $db->sql_query($sql);
|
||||
$group_id = (int) $db->sql_fetchfield('group_id', false, $result);
|
||||
$group_id = (int) $db->sql_fetchfield('group_id', $result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
}
|
||||
|
@@ -23,9 +23,9 @@ die("Please read the first lines of this script for instructions on how to enabl
|
||||
set_time_limit(0);
|
||||
|
||||
define('IN_PHPBB', true);
|
||||
$phpbb_root_path = '../';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
define('PHPBB_ROOT_PATH', './../');
|
||||
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||
|
||||
// Start session management
|
||||
$user->session_begin();
|
||||
@@ -34,12 +34,12 @@ $user->setup();
|
||||
|
||||
$search_type = $config['search_type'];
|
||||
|
||||
if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
|
||||
if (!file_exists(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT))
|
||||
{
|
||||
trigger_error('NO_SUCH_SEARCH_MODULE');
|
||||
}
|
||||
|
||||
require($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx);
|
||||
require(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT);
|
||||
|
||||
$error = false;
|
||||
$search = new $search_type($error);
|
||||
|
@@ -98,8 +98,7 @@ function utf8_normalize_nfkc($strings)
|
||||
|
||||
if (!class_exists('utf_normalizer'))
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
|
||||
include(PHPBB_ROOT_PATH . 'includes/utf/utf_normalizer.' . PHP_EXT);
|
||||
}
|
||||
|
||||
if (!is_array($strings))
|
||||
|
@@ -26,8 +26,8 @@ set_time_limit(0);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
define('IN_PHPBB', true);
|
||||
$phpbb_root_path = '../';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
define('PHPBB_ROOT_PATH', './../');
|
||||
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
|
||||
|
||||
/**
|
||||
@@ -77,13 +77,13 @@ $test_suite = array(
|
||||
)
|
||||
);
|
||||
|
||||
require_once($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
|
||||
require_once(PHPBB_ROOT_PATH . 'includes/utf/utf_normalizer.' . PHP_EXT);
|
||||
|
||||
$i = $n = 0;
|
||||
$failed = false;
|
||||
$tested_chars = array();
|
||||
|
||||
$fp = fopen($phpbb_root_path . 'develop/NormalizationTest.txt', 'rb');
|
||||
$fp = fopen(PHPBB_ROOT_PATH . 'develop/NormalizationTest.txt', 'rb');
|
||||
while (!feof($fp))
|
||||
{
|
||||
$line = fgets($fp);
|
||||
@@ -158,7 +158,7 @@ fclose($fp);
|
||||
*/
|
||||
echo "\n\nTesting for invariants...\n\n";
|
||||
|
||||
$fp = fopen($phpbb_root_path . 'develop/UnicodeData.txt', 'rt');
|
||||
$fp = fopen(PHPBB_ROOT_PATH . 'develop/UnicodeData.txt', 'rt');
|
||||
|
||||
$n = 0;
|
||||
while (!feof($fp))
|
||||
@@ -184,21 +184,21 @@ while (!feof($fp))
|
||||
|
||||
$utf_expected = hex_to_utf($hex_expected);
|
||||
|
||||
if ($utf_expected >= UTF8_SURROGATE_FIRST
|
||||
&& $utf_expected <= UTF8_SURROGATE_LAST)
|
||||
if ($utf_expected >= utf_normalizer::UTF8_SURROGATE_FIRST
|
||||
&& $utf_expected <= utf_normalizer::UTF8_SURROGATE_LAST)
|
||||
{
|
||||
/**
|
||||
* Surrogates are illegal on their own, we expect the normalizer
|
||||
* to return a replacement char
|
||||
*/
|
||||
$utf_expected = UTF8_REPLACEMENT;
|
||||
$utf_expected = utf_normalizer::UTF8_REPLACEMENT;
|
||||
$hex_expected = utf_to_hexseq($utf_expected);
|
||||
}
|
||||
|
||||
foreach (array('nfc', 'nfkc', 'nfd', 'nfkd') as $form)
|
||||
{
|
||||
$utf_result = $utf_expected;
|
||||
utf_normalizer::$form($utf_result);
|
||||
call_user_func(array('utf_normalizer', $form), $utf_result);
|
||||
$hex_result = utf_to_hexseq($utf_result);
|
||||
// echo "$form($utf_expected) == $utf_result\n";
|
||||
|
||||
@@ -227,9 +227,7 @@ die("\n\nALL TESTS PASSED SUCCESSFULLY\n");
|
||||
*/
|
||||
function download($url)
|
||||
{
|
||||
global $phpbb_root_path;
|
||||
|
||||
if (file_exists($phpbb_root_path . 'develop/' . basename($url)))
|
||||
if (file_exists(PHPBB_ROOT_PATH . 'develop/' . basename($url)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -241,7 +239,7 @@ function download($url)
|
||||
die("Can't download from $url\nPlease download it yourself and put it in the develop/ dir, kthxbai");
|
||||
}
|
||||
|
||||
if (!$fpw = fopen($phpbb_root_path . 'develop/' . basename($url), 'wb'))
|
||||
if (!$fpw = fopen(PHPBB_ROOT_PATH . 'develop/' . basename($url), 'wb'))
|
||||
{
|
||||
die("Can't open develop/" . basename($url) . " for output... please check your permissions or something");
|
||||
}
|
||||
|
@@ -22,13 +22,15 @@ involved in phpBB.
|
||||
|
||||
phpBB Lead Developer : Acyd Burn (Meik Sievertsen)
|
||||
|
||||
phpBB Developers : DavidMJ (David M.)
|
||||
phpBB Developers : APTX (Marek A. R.)
|
||||
DavidMJ (David M.)
|
||||
dhn (Dominik Dr<44>scher)
|
||||
kellanved (Henry Sudhof)
|
||||
naderman (Nils Adermann)
|
||||
subBlue (Tom Beddard)
|
||||
ToonArmy (Chris Smith)
|
||||
Vic D'Elfant (Vic D'Elfant)
|
||||
|
||||
|
||||
-- Previous Contributors --
|
||||
|
||||
phpBB Project Manager : theFinn (James Atkinson) [Founder - 04/2007]
|
||||
|
@@ -1,634 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en">
|
||||
<head>
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="content-style-type" content="text/css" />
|
||||
<meta http-equiv="content-language" content="en" />
|
||||
<meta http-equiv="imagetoolbar" content="no" />
|
||||
<meta name="resource-type" content="document" />
|
||||
<meta name="distribution" content="global" />
|
||||
<meta name="copyright" content="2007 phpBB Group" />
|
||||
<meta name="keywords" content="" />
|
||||
<meta name="description" content="phpBB 3.0.x Changelog" />
|
||||
<title>phpBB3 • Changelog</title>
|
||||
|
||||
<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
|
||||
|
||||
</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"><span class="corners-top"><span></span></span>
|
||||
|
||||
<div id="doc-description">
|
||||
<a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a>
|
||||
<h1>phpBB 3.0.x Changelog</h1>
|
||||
<p style="display: none;"><a href="#start_here">Skip</a></p>
|
||||
</div>
|
||||
|
||||
<span class="corners-bottom"><span></span></span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a name="start_here"></a>
|
||||
|
||||
<div id="page-body">
|
||||
|
||||
<!-- BEGIN DOCUMENT -->
|
||||
|
||||
<p>This is a non-exhaustive (but still near complete) changelog for phpBB 3.0.x including release candidate versions. Our thanks to all those people who've contributed bug reports and code fixes.</p>
|
||||
|
||||
<h1>Changelog</h1>
|
||||
|
||||
<div class="paragraph menu">
|
||||
<div class="inner"><span class="corners-top"><span></span></span>
|
||||
|
||||
<div class="content">
|
||||
|
||||
<ol>
|
||||
<li><a href="#changelog">Changelog</a>
|
||||
<ol style="list-style-type: lower-roman;">
|
||||
<li><a href="#v300">Changes since 3.0.0</a></li>
|
||||
<li><a href="#v30rc8">Changes since RC-8</a></li>
|
||||
<li><a href="#v30rc7">Changes since RC-7</a></li>
|
||||
<li><a href="#v30rc6">Changes since RC-6</a></li>
|
||||
<li><a href="#v30rc5">Changes since RC-5</a></li>
|
||||
<li><a href="#v30rc4">Changes since RC-4</a></li>
|
||||
<li><a href="#v30rc3">Changes since RC-3</a></li>
|
||||
<li><a href="#v30rc2">Changes since RC-2</a></li>
|
||||
<li><a href="#v30rc1">Changes since RC-1</a></li>
|
||||
</ol>
|
||||
</li>
|
||||
<li><a href="#disclaimer">Copyright and disclaimer</a></li>
|
||||
</ol>
|
||||
|
||||
</div>
|
||||
|
||||
<span class="corners-bottom"><span></span></span></div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="changelog"></a><h2>1. Changelog</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="inner"><span class="corners-top"><span></span></span>
|
||||
|
||||
<div class="content">
|
||||
|
||||
<a name="v300"></a><h3>1.i. Changes since 3.0.0</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Change] Validate birthdays (Bug #15004)</li>
|
||||
<li>[Fix] Allow correct avatar caching for CGI installations. (thanks wildbill)</li>
|
||||
<li>[Fix] Fix disabling of word censor, now possible again</li>
|
||||
<li>[Fix] Allow single quotes in db password to be stored within config.php in installer</li>
|
||||
<li>[Fix] Correctly quote db password for re-display in installer (Bug #16695 / thanks to m313 for reporting too - #s17235)</li>
|
||||
<li>[Fix] Correctly handle empty imageset entries (Bug #16865)</li>
|
||||
<li>[Fix] Correctly check empty subjects/messages (Bug #17915)</li>
|
||||
<li>[Change] Do not check usernames against word censor list. Disallowed usernames is already checked and word censor belong to posts. (Bug #17745)</li>
|
||||
<li>[Fix] Additionally include non-postable forums for moderators forums shown within the teams list. (Bug #17265)</li>
|
||||
<li>[Change] Sped up viewforum considerably (also goes towards mcp_forum)</li>
|
||||
<li>[Fix] Do not split topic list for topics being promoted to announcements after been moved to another forum (Bug #18635)</li>
|
||||
<li>[Fix] Allow editing usernames within database_update on username cleanup (Bug #18415)</li>
|
||||
<li>[Fix] Fixing wrong sync() calls if moving all posts by a member in ACP (Bug #18385)</li>
|
||||
<li>[Fix] Check entered imagemagick path for trailing slash (Bug #18205)</li>
|
||||
<li>[Fix] Use proper title on index for new/unread posts (Bug #13101) - patch provided by Pyramide</li>
|
||||
<li>[Fix] Allow calls to $user->set_cookie() define no cookie time for setting session cookies (Bug #18025)</li>
|
||||
<li>[Fix] Stricter checks on smilie packs (Bug #19675)</li>
|
||||
<li>[Fix] Gracefully return from cancelling pm drafts (Bug #19675)</li>
|
||||
<li>[Fix] Possible login problems with IE7 if browser check is activated (Bug #20135)</li>
|
||||
<li>[Fix] Fix possible database transaction errors if code returns on error and rollback happened (Bug #17025)</li>
|
||||
<li>[Change] Allow numbers in permission names for modifications, as well as uppercase letters for the request_ part (Bug #20125)</li>
|
||||
<li>[Fix] Use HTTP_HOST in favor of SERVER_NAME for determining server url for redirection and installation (Bug #19955)</li>
|
||||
<li>[Fix] Removing s_watching_img from watch_topic_forum() function (Bug #20445)</li>
|
||||
<li>[Fix] Changing order for post review if more than one post affected (Bug #15249)</li>
|
||||
<li>[Fix] Language typos/fixes (Bug #20425, #15719, #15429, #14669, #13479, #20795, #21095, #21405, #21715, #21725, #21755, #21865, #15689)</li>
|
||||
<li>[Fix] Style/Template fixes (Bug #20065, #19405, #19205, #15028, #14934, #14821, #14752, #14497, #13707, #14738, #19725)</li>
|
||||
<li>[Fix] Tiny code fixes (Bug #20165, #20025, #19795, #14804)</li>
|
||||
<li>[Fix] Prepend phpbb_root_path to ranks path for displaying ranks (Bug #19075)</li>
|
||||
<li>[Fix] Allow forum notifications if topic notifications are disabled but forum notifications enabled (Bug #14765)</li>
|
||||
<li>[Fix] Fixing realpath issues for provider returning the passed value instead of disabling it. This fixes issues with confirm boxes for those hosted on Network Solutions for example. (Bug #20435)</li>
|
||||
<li>[Fix] Try to sort last active date on memberlist correctly at least on current page (Bug #18665)</li>
|
||||
<li>[Fix] Handle generation of form tokens when maximum time is set to -1</li>
|
||||
<li>[Fix] Correctly delete unapproved posts without deleting the topic (Bug #15120)</li>
|
||||
<li>[Fix] Respect signature permissions in posting (Bug #16029)</li>
|
||||
<li>[Fix] Users allowed to resign only from open and freely open groups (Bug #19355)</li>
|
||||
<li>[Fix] Assign a last viewed date to converted topics (Bug #16565)</li>
|
||||
<li>[Fix] Many minor and/or cosmetic fixes (Including, but not limited to: #21315, #18575, #18435, #21215)</li>
|
||||
<li>[Feature] New option to hide the entire list of subforums on listforums</li>
|
||||
<li>[Fix] Custom BBCode {EMAIL}-Token usage (Bug #21155)</li>
|
||||
<li>[Fix] Do not rely on parameter returned by unlink() for verifying cache directory write permission (Bug #19565)</li>
|
||||
<li>[Change] Use correct string for filesize (MiB instead of MB for example)</li>
|
||||
<li>[Change] Remove left join for query used to retrieve already assigned users and groups within permission panel (Bug #20235)</li>
|
||||
<li>[Fix] Correctly return sole whitespaces if used with BBCodes (Bug #19535)</li>
|
||||
<li>[Fix] Quote bbcode parsing adding too much closing tags on special conditions (Bug #20735)</li>
|
||||
<li>[Change] Added sanity checks to various ACP settings</li>
|
||||
<li>[Change] Removed minimum form times</li>
|
||||
<li>[Fix] Check topics_per_page value in acp_forums (Bug #15539)</li>
|
||||
<li>[Fix] Custom profile fields with date type should be timezone independend (Bug #15003)</li>
|
||||
<li>[Fix] Fixing some XHTML errors/warnings within the ACP (Bug #22875)</li>
|
||||
<li>[Fix] Warnings if poll title/options exceed maximum characters per post (Bug #22865)</li>
|
||||
<li>[Fix] Do not allow selecting non-authorized groups within memberlist by adjusting URL (Bug #22805 - patch provided by ToonArmy)</li>
|
||||
<li>[Fix] Correctly specify "close report action" (Bug #22685)</li>
|
||||
<li>[Fix] Display "empty password error" within the login box instead of issuing a general error (Bug #22525)</li>
|
||||
<li>[Fix] Clean up who is online code in page_header (Bug #22715, thanks HighwayofLife)</li>
|
||||
<li>[Fix] Pertain select single link on memberlist (Bug #23235 - patch provided by Schumi)</li>
|
||||
<li>[Fix] Allow & and | in local part of email addresses (Bug #22995)</li>
|
||||
<li>[Fix] Do not error out if php_uname function disabled / Authenticating on SMTP Server (Bug #22235 - patch by HoL)</li>
|
||||
<li>[Fix] Correctly obtain to be ignored users within topic/forum notification (Bug #21795 - patch provided by dr.death)</li>
|
||||
<li>[Fix] Correctly update board statistics for attaching orphaned files to existing posts (Bug #20185)</li>
|
||||
<li>[Fix] Do not detect the board URL as a link twice in posts (Bug #19215)</li>
|
||||
<li>[Fix] Set correct error reporting in style.php to avoid blank pages after CSS changes (Bug #23885)</li>
|
||||
<li>[Fix] If pruning users based on last activity, do not include users never logged in before (Bug #18105)</li>
|
||||
<li>[Sec] Only allow searching by email address in memberlist for users having the a_user permission (reported by evil<3)</li>
|
||||
<li>[Sec] Limit private message attachments to be viewable only by the recipient(s)/sender (Report #s23535) - reported by AlleyKat</li>
|
||||
<li>[Sec] Check for non-empty config.php within style.php (Report #s24575) - reported by bantu</li>
|
||||
<li>[Fix] Find and display colliding usernames correctly when converting from one database to another (Bug #23925)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v30rc8"></a><h3>1.i. Changes since 3.0.RC8</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Cleaned usernames contain only single spaces, so "a_name" and "a__name" are treated as the same name (Bug #15634)</li>
|
||||
<li>[Fix] Check "able to disable word censor" option while applying word censor on text (Bug #15974)</li>
|
||||
<li>[Fix] Rollback changes on failed transaction if returning on sql error is set</li>
|
||||
<li>[Fix] Call garbage_collection() within database updater to correctly close connections (affects Oracle for example)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v30rc7"></a><h3>1.ii. Changes since 3.0.RC7</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Fixed MSSQL related bug in the update system</li>
|
||||
<li>[Fix] Display "Return to" links on unwritable forums (Bug #14824)</li>
|
||||
<li>[Fix] Mitigating different realpath() handling between PHP versions (fixing confirm box redirects)</li>
|
||||
<li>[Fix] Fix signature editing - ability to remove signature (Bug #14820)</li>
|
||||
<li>[Fix] Send correct activation key by forcing reactivation for inactive user (Bug #14819)</li>
|
||||
<li>[Fix] Adding correct IP for private messages sent by issuing warnings (Bug #14781)</li>
|
||||
<li>[Fix] Open private message notification (Bug #14773)</li>
|
||||
<li>[Fix] Fixing false new private message indicator (Bug #14627)</li>
|
||||
<li>[Fix] Let newly activated passwords work if users were converted (Bug #14787)</li>
|
||||
<li>[Fix] Quote bbcode fixes. Letting parse quote="[" and re-allowing whitelisted bbcodes within username portion (Bug #14770)</li>
|
||||
<li>[Fix] Allow alternative text for styled buttons if images turned off, but CSS staying on</li>
|
||||
<li>[Sec] Fix bbcode helpline display for custom bbcodes - this requires style changes for any custom style (Bug #14850)</li>
|
||||
<li>[Fix] Correctly count announcements when filtering forums by date (Bug #14877)</li>
|
||||
<li>[Fix] Allow charset names containing underscores or spaces</li>
|
||||
<li>[Fix] Don't allow previous/next links for non-existing topics (Bug #15039)</li>
|
||||
<li>[Change] Do not assign converted votes to the first option in a vote.</li>
|
||||
<li>[Fix] Use correct RFC 2822 date format in emails (Bug #15042)</li>
|
||||
<li>[Fix] Require founder status for some actions on founder-only groups (Bug #15119)</li>
|
||||
<li>[Fix] Allow changing the "now" option of date CPFs (Bug #15111)</li>
|
||||
<li>[Change] Some improvements to the caching of avatars</li>
|
||||
<li>[Change] Set template recompilation to be disabled by default. All mod and style authors and all those who want to modify their styles should enabled it after installation.</li>
|
||||
<li>[Change] Disable debug mode. All mod and style authors should enable DEBUG and DEBUG_EXTRA.</li>
|
||||
<li>[Fix] Check error reporting level for all error level. This fixes a problem for hosts having manipulated the error handler. (Bug #14831)</li>
|
||||
<li>[Feature] Constant PHPBB_DB_NEW_LINK introduced which can be used to force phpBB to create a new database connection instead of reusing an existing one if the dbms supports it (Bug #14927)</li>
|
||||
<li>[Fix] Automatic URL parsing no longer allows dots in the schema but can parse URLs starting after a dot (Bug #15110)</li>
|
||||
<li>[Fix] Dynamic width for birthday select boxes (Bug #15149)</li>
|
||||
<li>[Fix] Recache Moderators when copying permissions. (Bug #15384)</li>
|
||||
<li>[Fix] Propagate sort options in mcp_forums (Bug #15464)</li>
|
||||
<li>[Change] Do not allow [size=0] bbcodes (font-size of 0)</li>
|
||||
<li>[Fix] No duplication of active topics (Bug #15474)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v30rc6"></a><h3>1.iii. Changes since 3.0.RC6</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Submitting language changes using acp_language (Bug #14736)</li>
|
||||
<li>[Fix] Fixed wrong bbcode handling for forum rules, forum descriptions and group descriptions</li>
|
||||
<li>[Fix] Fixed faulty form tokens (Bug #14725, #14762 and #14755)</li>
|
||||
<li>[Fix] Fixed bbcode uid generation in the phpBB2 converter (Bug #14722)</li>
|
||||
<li>[Fix] Able to request new password (Bug #14743)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v30rc5"></a><h3>1.iv. Changes since 3.0.RC5</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Feature] Removing constant PHPBB_EMBEDDED in favor of using an exit_handler(); the constant was meant to achive this more or less.</li>
|
||||
<li>[Feature] Constant PHPBB_ADMIN_PATH introduced, having the same purpose as PHPBB_ROOT_PATH, but for the ACP.</li>
|
||||
<li>[Fix] Further fixing user profile view (please do not forget to update/refresh your template and style) (Bug #14230)</li>
|
||||
<li>[Fix] Adjust google adsense bot information (Bug #14296)</li>
|
||||
<li>[Fix] Fix horizontal scrollbar problem in IE6 (Bug #14228) - fix provided by Danny-dev</li>
|
||||
<li>[Fix] Use correct size values in ACP user signature screen (Bug #13367)</li>
|
||||
<li>[Fix] Attachment Place inline won't work with single quotes (Bug #14291)</li>
|
||||
<li>[Fix] Unable to save email templates through ACP language page (Bug #14266)</li>
|
||||
<li>[Fix] Correctly set user style for guest user (able to be changed within user management)</li>
|
||||
<li>[Change] Moved note about dns_get_record function for using GTalk (Jabber) from Jabber log to Jabber ACP panel</li>
|
||||
<li>[Fix] Do not use register_shutdown_function within cron.php if handling the queue and the mail function being used (Bug #14321)</li>
|
||||
<li>[Fix] Fixing private message on-hold code if moving messages into folder based on rules (Bug #14309)</li>
|
||||
<li>[Fix] Allow the merge selection screen to work (Bug #14363)</li>
|
||||
<li>[Change] Require additional permissions for copying permission when editing forums </li>
|
||||
<li>[Fix] Local magic URLs no longer get an additional trailing slash (Bug #14362)</li>
|
||||
<li>[Fix] Do not let the cron script stale for one hour if register_shutdown_function is not able to be called (Bug #14436)</li>
|
||||
<li>[Feature] Added /includes/db/db_tools.php file, which includes tools for handling cross-db actions such as altering columns, etc.</li>
|
||||
<li>[Change] Reset the start parameter when the timeframe is changed in the mcp topic page (Ticket #14438)</li>
|
||||
<li>[Change] Added Code for cleaning the confirm table to the session garbage collection</li>
|
||||
<li>[Fix] Fixed token handling in jabber class for extremely spec-compliant XMPP server (Bug #14445)</li>
|
||||
<li>[Fix] Disallowed galleries from using special characters (Bug #14466)</li>
|
||||
<li>[Change] Listing the board url within the email text instead of appending it to the subject (Bug #14378)</li>
|
||||
<li>[Fix] Always display the quote button as the most accessible one (this means edit is before quote in prosilver due to the way we lay out profiles)</li>
|
||||
<li>[Fix] Use correct dimension (width x height) in ACP (Bug #14452)</li>
|
||||
<li>[Fix] Only display PM history links if there are PM's to be displayed (Bug #14484)</li>
|
||||
<li>[Feature] Added completely new hook system to allow better application/mod integration - see docs/hook_system.html</li>
|
||||
<li>[Fix] Correctly delete excess poll options (Bug #14566)</li>
|
||||
<li>[Fix] Allow names evaluating to false for poll options</li>
|
||||
<li>[Change] use in-build functions for user online list (Bug #14596) - provided by rxu</li>
|
||||
<li>[Fix] Fixing google cache display problems with Firefox (Bug #14472) - patch provided by Raimon</li>
|
||||
<li>[Fix] Prevent topic unlocking if locked by someone else while posting (Bug #10307)</li>
|
||||
<li>[Change] Allow years in future be selected for date custom profile field (Bug #14519)</li>
|
||||
<li>[Fix] Don't display "Avatars Disabled" message on edit groups in UCP (Bug #14636)</li>
|
||||
<li>[Change] Require confirm for deleting inactive users. (Bug #14641)</li>
|
||||
<li>[Fix] Match custom BBCodes in the same way during first and second pass - patch provided by IBBoard (Bug #14268)</li>
|
||||
<li>[Fix] Correct quote parsing if opening bracket before opening quote (Bug #14667)</li>
|
||||
<li>[Fix] Clean post message for checking length to prevent posting empty messages</li>
|
||||
<li>[Fix] Display jumpbox if needed for functionality (Bug #14702)</li>
|
||||
<li>[Feature] Added an option to enforce that users spend a configurable amount of time on the terms page during registration</li>
|
||||
<li>[Fix] Fixed copy permissions box in the ACP</li>
|
||||
<li>[Fix] Enforce types for the user table during conversions</li>
|
||||
<li>[Sec] Fixing possible XSS through compromised WHOIS server (#i63, #i64)</li>
|
||||
<li>[Sec] Missing access control on whois in viewonline.php (#i51)</li>
|
||||
<li>[Sec] Encoding some variables within user::page array correctly (to cope with browser not doing it correctly) to prevent XSS through functions re-using them (#i61)</li>
|
||||
<li>[Sec] Fixed XSS through memberlist search feature (#i62)</li>
|
||||
<li>[Sec] Fixed XSS through colour swatch (#i65)</li>
|
||||
<li>[Sec] Fixed insecure attachment deletion (#i53)</li>
|
||||
<li>[Sec] Only allow whitelisted protocols in meta_redirect/redirect (#i66)</li>
|
||||
<li>[Sec] Check file names to be written in language management panel (#i52)</li>
|
||||
<li>[Sec] Deregister globals if ini_get has been disabled (#i112)</li>
|
||||
<li>[Sec] Added form tokens to most forms to enforce a lighter variant of CSRF protection (#i91 - #i96)</li>
|
||||
<li>[Sec] Use new password hash method for forum passwords (#i43)</li>
|
||||
<li>[Sec] Changed download file location to prevent flash crossdomain policies taking effect (#i8)</li>
|
||||
<li>[Sec] Do not allow autocompletion for password on admin re-authentication (#i41)</li>
|
||||
<li>[Sec] Made sure users are not completely locked out if they have a GLOBALS cookie (#i101)</li>
|
||||
<li>[Sec] Use the secure hash to generate BBCODE_UIDs (#i71)</li>
|
||||
<li>[Sec] Increase the length of BBCODE_UIDs (#i72)</li>
|
||||
<li>[Sec] New password hashing mechanism for storing passwords (#i42)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v30rc4"></a><h3>1.v. Changes since 3.0.RC4</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] MySQL, PostgreSQL and SQLite related database fixes (Bug #13862)</li>
|
||||
<li>[Fix] Allow MS SQL to properly connect when using the mssql driver and PHP is less than either 4.4.1 or 5.1 (Bug #13874)</li>
|
||||
<li>[Fix] Ignore files containing HTML special chars in the filenames as gallery avatars (Bug #13906)</li>
|
||||
<li>[Fix] Multiple PM recipients not separated (Bug #13876)</li>
|
||||
<li>[Change] Split the select list for the smilie order to clarify which are feasible and which are not (Bug #13911)</li>
|
||||
<li>[Fix] Convert empty homepage fields (Bug #13917)</li>
|
||||
<li>[Fix] Use board default DST setting on creating new profiles (Bug #11563)</li>
|
||||
<li>[Feature] New constant PHPBB_EMBEDDED can be used to let phpBB not call exit; if wrapped/embedded (We may re-check this constant on other code locations later too)</li>
|
||||
<li>[Feature] append_sid() having a check for the function append_sid_phpbb_hook(). This function is called in favour of append_sid() with the exact same parameters if present.</li>
|
||||
<li>[Fix] Only list enabled modes within the dropdown at user administration (Bug #13883) - patch provided by damnian</li>
|
||||
<li>[Fix] Properly display ban reason if selecting banned entries within the ACP (Bug #13896)</li>
|
||||
<li>[Fix] Properly parse SQL expressions for Oracle (Bug #13916)</li>
|
||||
<li>[Fix] Added label bindings to the custom profile fields in the ACP (Bug #13936) - patch provided by damnian</li>
|
||||
<li>[Change] Made group avatar/rank changes more intuitive</li>
|
||||
<li>[Fix] Give more feedback in icon/smilie management (Bug #13295)</li>
|
||||
<li>[Fix] Correctly set user::lang_id (Bug #14010)</li>
|
||||
<li>[Fix] Properly display the smiley export screen (Bug #13968)</li>
|
||||
<li>[Feature] Add "DECIMAL:", "PDECIMAL", and "PDECIMAL:" to the schema creation code (Bug #13999) - patch provided by poyntesm</li>
|
||||
<li>[Fix] Don't show the notify checkbox in the approval queue if the only posts are written by ANONYMOUS (Bug #13973)</li>
|
||||
<li>[Fix] Redirect to bots management page on edit/add (Bug #14073)</li>
|
||||
<li>[Fix] Display locked icon in viewforum/prosilver if forum locked (Bug #14009)</li>
|
||||
<li>[Feature] Display message history in compose PM screen</li>
|
||||
<li>[Change] Do not force login on visiting topic/forum from notification emails (Bug #13818)</li>
|
||||
<li>[Fix] Fixed cron_lock value for cron execution. This bug led to users having problems with the email queue and other cron related issues.</li>
|
||||
<li>[Fix] Prevent white pages on php notices with gzip compression enabled (Bug #14096)</li>
|
||||
<li>[Fix] Propagate the cleaned identifier for CFPs (Bug #14072)</li>
|
||||
<li>[Fix] Do not display NO_TOPICS message if viewing non-postable category (Bug #13489)</li>
|
||||
<li>[Fix] Let the theme immediately expire if changed from ACP for at least 30 minutes after change</li>
|
||||
<li>[Fix] Do not append hilit= in search if highlighting term is empty (Bug #13910)</li>
|
||||
<li>[Fix] Return to last page after voting in viewtopic instead of first page in topic (Bug #13976)</li>
|
||||
<li>[Fix] If sending PM's to groups only include activated member (Bug #14040)</li>
|
||||
<li>[Fix] Correctly wrap words in emails containing utf8 characters (Bug #14109)</li>
|
||||
<li>[Change] For new posts or editing the first post topic titles have a maxlength of 60 characters. For any subsequent posts the length is extended to 64 to make room for the Re: part, but cutting at 60 characters. The maxlength need to be 64, else users using opera are unable to post (opera does not allow pre-filling a field with more characters than specified within the maxlength attribute)</li>
|
||||
<li>[Fix] Disable gzip compression for cached stylesheet for Internet Explorer 6 or empty browser (IE6 is not able to properly display the compressed stylesheet) (Bug #14054)</li>
|
||||
<li>[Fix] Header icons fixed in FF for RTL languages (Bug #14084)</li>
|
||||
<li>[Change] Words in topic titles and post subjects are highlighted on the search results page and viewtopic too now (Bug #13383)</li>
|
||||
<li>[Fix] Made sure strip_bbcode cannot get the idea that a smiley is a BBCode (Bug #14030)</li>
|
||||
<li>[Change] Added a filter for user objects to LDAP configuration and improved explanations (Bug #12627)</li>
|
||||
<li>[Fix] Display searchable subforums of invisible parents in advanced search forum selection (Bug #11395)</li>
|
||||
<li>[Fix] Allow line breaks in custom BBCodes (Bug #10758)</li>
|
||||
<li>[Fix] Ordered BBcode parsing functions in the same way everywhere where they are used</li>
|
||||
<li>[Fix] Prevent {URL} token in custom BBCodes from make_clickable messing (Bug #14151)</li>
|
||||
<li>[Sec] Added alternative tokens to custom BBCodes which are safe for CSS/Javascript and changed TEXT token to entitise opening and closing parantheses.</li>
|
||||
<li>[Fix] Convert 2.0 moderator posting permissions (Bug #14105)</li>
|
||||
<li>[Fix] Correctly apply PM box limit of 0 to custom folder (Bug #14154)</li>
|
||||
<li>[Fix] odbc_autocommit causing existing result sets to be dropped (Bug #14182)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v30rc3"></a><h3>1.vi. Changes since 3.0.RC3</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Fixing some subsilver2 and prosilver style issues</li>
|
||||
<li>[Fix] Parse error in MCP ban (Bug #13109)</li>
|
||||
<li>[Fix] Correctly hide online status in the profile (Bug #13059)</li>
|
||||
<li>[Feature] Let the user choose how to update modified files (merging, using new file or using old file) within automatic updater</li>
|
||||
<li>[Fix] An extra \ in an Oracle SQL regex was corrected (Bug #13151)</li>
|
||||
<li>[Fix] Added a missing global to get_file() (Bug #13149)</li>
|
||||
<li>[Fix] Hide autologin box when autologin is disabled (Bug #13093)</li>
|
||||
<li>[Fix] Account for the forum id not being part of the request uri in prosilver (Bug #13121)</li>
|
||||
<li>[Fix] Properly alter PostgreSQL tables</li>
|
||||
<li>[Fix] Properly cache template files that were stored in the database (Bug #12675)</li>
|
||||
<li>[Fix] Do not count the deletion of an unapproved topic as a decrease in normally viewable posts (Bug #13167)</li>
|
||||
<li>[Fix] Allow column_exists() to return true if the column exists but no data is in the table</li>
|
||||
<li>[Fix] Allow setting the smiley order via the select. Also allow to add smileys at the top. (Bug #13199)</li>
|
||||
<li>[Fix] Fix php notice on sending jabber messages (Bug #13201)</li>
|
||||
<li>[Fix] Make the window showing file differences a little wider (Bug #13157)</li>
|
||||
<li>[Fix] Preserve preview style on search form (Bug #13205)</li>
|
||||
<li>[Fix] Place attachment filename in new line in posting editor (Bug #9726)</li>
|
||||
<li>[Fix] Don't allow caching to occur in the update sequence (Bug #13207)</li>
|
||||
<li>[Fix] Enforce the max password length for automatically generated password created by the password sender (Bug #13181)</li>
|
||||
<li>[Fix] Handle phpinfo() when expose_php is false (Bug #12777)</li>
|
||||
<li>[Fix] Allow managing of forum roles without global users (Bug #13249)</li>
|
||||
<li>[Change] Do not run cron script if board is disabled</li>
|
||||
<li>[Fix] Correctly destroy sql cache for some query combinations (Bug #13237)</li>
|
||||
<li>[Fix] Allow link forums being password protected (Bug #12967)</li>
|
||||
<li>[Fix] Allow wrapping topic/post icons in posting editor (Bug #12843)</li>
|
||||
<li>[Fix] Display L_RANK only once in template if rank title and image defined (Bug #13231)</li>
|
||||
<li>[Fix] Make sure selected transfer method exists before calling (Bug #13265)</li>
|
||||
<li>[Fix] Correctly escape language keys in language editor (Bug #13279)</li>
|
||||
<li>[Fix] Correctly hide post/reply buttons if permissions are not given (related to Bug #12809)</li>
|
||||
<li>[Fix] Remove orphan/wrong permission entries for non-existent forums - self-repairing permissions if conversions went "crazy"</li>
|
||||
<li>[Feature] Allow "older" updates applied with the automatic updater. This allows people using it for updating, say, from 3.0.0 to 3.0.1 (with the correct package of course) and then from 3.0.1 to 3.0.2 if the latest version at this time is 3.0.2. These changes take effect beginning with RC4 or people replacing install/install_update.php manually prior doing the updates.</li>
|
||||
<li>[Fix] Present correct error message if user tries to edit already read private message (Bug #13271)</li>
|
||||
<li>[Fix] Also display board disabled notice for admins/mods if board got disabled due to exceeding the load limit (Bug #13267)</li>
|
||||
<li>[Fix] Correctly deliver avatar if readfile function has been disabled (Bug #13309)</li>
|
||||
<li>[Fix] Display php information page with the correct direction (Bug #12557)</li>
|
||||
<li>[Fix] Increased the number of style objects (styles, templates, themes and imagesets) possible from 127 to 65535 for MySQL (Bug #13179)</li>
|
||||
<li>[Fix] Although theoretically impossible in our code, removed the chance of trying to open a file that does not exist (Bug #13327)</li>
|
||||
<li>[Fix] Although theoretically impossible in our code, changed the handling of non-existent language files (Bug #13329, #13331)</li>
|
||||
<li>[Fix] Removed extra ampersand from ACP link (Bug #13315)</li>
|
||||
<li>[Fix] used cleaned up version of given field identification for pre-filling a new custom profile field (Bug #13319)</li>
|
||||
<li>[Fix] Correctly convert 2.0 website profile fields. (Bug #13379)</li>
|
||||
<li>[Fix] Fixed the "Alphanumeric" and "Alphanumeric and spacers" username selection limitations (Bug #13391)</li>
|
||||
<li>[Fix] Make sure filelist() is only returning array types (Bug #13385)</li>
|
||||
<li>[Fix] Correctly mark forums read if using cookie based topic tracking (Bug #13245)</li>
|
||||
<li>[Change] Put custom profile fields into top box and signature into separate box in members profile view (Bug #13357)</li>
|
||||
<li>[Fix] Only show moderator log entries for forums the user is having moderation rights in (Bug #12481)</li>
|
||||
<li>[Feature] Show resulting permission alone in trace window (Bug #10952) - thanks to dark/rain for the proposal</li>
|
||||
<li>[Fix] Fixed bug in realpath replacement letting it actually work again</li>
|
||||
<li>[Change] Try to be a bit more specific regarding global/local permission trace (Bug #11032)</li>
|
||||
<li>[Fix] Fixed some strangeness in password validation due to mb_ereg()</li>
|
||||
<li>[Fix] Subforums of a forum would overwrite the latest post information even if they did not contain the latest post (Bug #11931)</li>
|
||||
<li>[Fix] Use global username display function on several places (Bug #11080, #11098) - patch by HoL</li>
|
||||
<li>[Fix] Several viewonline fixes and feature changes. Also displaying the users browser in viewonline list to let the admin easier spot additional search bots, connected to a_user permission (Bug #11088) - patch and suggestions provided by HoL</li>
|
||||
<li>[Change] u_viewprofile permission also affecting viewonline list now</li>
|
||||
<li>[Fix] Do not display return to search link in prosilver if search is not allowed (Bug #11393)</li>
|
||||
<li>[Fix] Use global url validation for img bbcode tag (Bug #11935)</li>
|
||||
<li>[Fix] Added proper unicode support to style names (Bug #12165)</li>
|
||||
<li>[Fix] Search result extract should not end in the middle of a multibyte character (Bug #11863)</li>
|
||||
<li>[Fix] Missing localisation for an imageset no longer triggers a lot of "imageset refreshed" log messages (Bug #12027)</li>
|
||||
<li>[Fix] Explain that themes which need parsing cannot be stored on the filesystem (Bug #11134)</li>
|
||||
<li>[Fix] Normalize usernames</li>
|
||||
<li>[Change] Improved utf8_clean_string with a more complete list of homographs and NFKC normalization</li>
|
||||
<li>[Fix] Fixed error messages that ACP Database can give (Bug #13463)</li>
|
||||
<li>[Fix] Fixed potential issues with databases that use tables names is uppercase</li>
|
||||
<li>[Fix] Handle forum links/redirects within viewforum if no read permission given (to display login box or error message) (Bug #13467)</li>
|
||||
<li>[Fix] Prevent changing postable forum having subforums to link forum without moving subforums out first</li>
|
||||
<li>[Fix] Do not display version in admin template (Bug #13495)</li>
|
||||
<li>[Fix] Allow manual specification of remote avatar dimensions if getimagesize is disabled (Bug #13531)</li>
|
||||
<li>[Fix] Make viewonline use the session page's added forum parameter (Bug #13597)</li>
|
||||
<li>[Fix] Correcting BBCode FAQ (Bug #11180)</li>
|
||||
<li>[Fix] Make to/bcc line in view private message display consistent with other username displays in prosilver (Bug #11989)</li>
|
||||
<li>[Fix] Send out activation email if admin activation is enabled and user activated through inactive users panel upon registration (Bug #12065)</li>
|
||||
<li>[Change] Re-implemented All Yes/No/Never links in permission panels for easier changing all categories at once</li>
|
||||
<li>[Change] Advanced permission link now "marked" if no role is assigned and custom permissions set. With this an admin can instantly see if the object is not set at all or having custom permissions, something you only saw if advanced permissions were viewed before.</li>
|
||||
<li>[Fix] Change misleading custom BBCodes explanation, regarding tokens and useable template variables (Bug #12403, #5660)</li>
|
||||
<li>[Feature] Ability to disable birthdays completely with new board features setting</li>
|
||||
<li>[Fix] Fix disallowed username check (Bug #13511)</li>
|
||||
<li>[Fix] Allow for unicode usernames to be pruned (Bug #13643)</li>
|
||||
<li>[Fix] Do not copy forum permissions from self (Bug #13663)</li>
|
||||
<li>[Fix] Allow for polls to work during preview (Bug #13657) - thanks to Thatbitextra</li>
|
||||
<li>[Fix] Finer error conditions for sending IM messages (Bugs #13681, #13683)</li>
|
||||
<li>[Fix] Add a confirmation for log deletion in the MCP (Bug #13693)</li>
|
||||
<li>[Fix] Do not erase ranks and avatars when changing default groups (Bugs #13701, #13697)</li>
|
||||
<li>[Fix] Limit author searches to firstpost, if selected (Bug #13579)</li>
|
||||
<li>[Fix] Properly resync user post counts for users that have no posts (Bug #13581)</li>
|
||||
<li>[Fix] Do not require space after , in smiley pak files (Bug #13647)</li>
|
||||
<li>[Fix] Properly display the subscribe link in topic and forum display for Oracle (Bug #13583)</li>
|
||||
<li>[Change] Add version number to ACP index (Bug #13703)</li>
|
||||
<li>[Fix] Several fixes for custom profile fields on multi-lingual boards (Bugs #13763, #13527, #13525, #11515)</li>
|
||||
<li>[Fix] Return to the mode previously selected after disaproving a post (Bug #13796)</li>
|
||||
<li>[Fix] Cron now uses a locking variable to make sure it does not spawn too many webserver processes (Bug #12741)</li>
|
||||
<li>[Fix] Cached stylesheet now supporting gzip compression</li>
|
||||
<li>[Fix] Added link to inbox for deleted PMs (Bug #13813)</li>
|
||||
<li>[Fix] Re-syncing the board stats also refreshes the newest user (Bug #13831)</li>
|
||||
<li>[Feature] Ability to externally set $phpbb_root_path if wrapping phpBB3 by defining constant PHPBB_ROOT_PATH</li>
|
||||
<li>[Fix] Implemented correct left/right floating within ACP in regard to RTL languages (Bug #13777)</li>
|
||||
<li>[Fix] Fixing session problems when using MySQL strict mode in conjunction with very long browser agent string (Bug #13827)</li>
|
||||
<li>[Fix] Disallow post/pm subjects entirely made up from non-printable chars and whitespaces (Bug #13800)</li>
|
||||
<li>[Fix] Allow moving private messages from the sentbox (Bug #13791)</li>
|
||||
<li>[Fix] Properly export localized imagesets</li>
|
||||
<li>[Feature] Show the size of Firebird databases</li>
|
||||
<li>[Fix] Show error when moving topic into a category via quickmod (Bug #11611)</li>
|
||||
<li>[Fix] Allow Oracle to install on a database without specify the database name</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<a name="v30rc2"></a><h3>1.vii. Changes since 3.0.RC2</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Re-allow searching within the memberlist</li>
|
||||
<li>[Fix] Force prune related values to integers during conversions</li>
|
||||
<li>[Fix] Updater now detects successfully merged files having conflicts and user chose to merge with modifications (Bug #12685)</li>
|
||||
<li>[Fix] Updater is no longer listing missing language entries and styles if these had been removed (Bug #12655)</li>
|
||||
<li>[Fix] Correct approval of posts in global announcements (Bug #12699)</li>
|
||||
<li>[Sec] Do not allow setup spiders/robots to post, even if permissions are given. We see no reason why this should be possible. (Thanks to Frank Rizzo for convincing us regarding this)</li>
|
||||
<li>[Sec] Do not display the last active column within the memberlist if u_viewonline permission is not given (Bug #12797)</li>
|
||||
<li>[Fix] Display custom profile field "date" based on users language (Bug #12787)</li>
|
||||
<li>[Fix] Allow adding of help language files within subdirectories (Bug #12783)</li>
|
||||
<li>[Fix] Correctly apply smileys on posting having # within their emotion code</li>
|
||||
<li>[Fix] Correctly convert smileys having double quotes within their emotion code (Bug #12731)</li>
|
||||
<li>[Fix] The converter now adds the protocol to user website profile fields missing it (Bug #12819)</li>
|
||||
<li>[Fix] Correctly escape banned ip/email using wildcard for ban check (Bug #12815)</li>
|
||||
<li>[Fix] Fixed some very nasty opera bugs (dropdown list bug, cpu spike bug) (Bug #12763, #11609)</li>
|
||||
<li>[Fix] Font colour list having the correct height in IE (Bug #9571)</li>
|
||||
<li>[Feature] Added mark/unmark all links to the bots page (Bug #12461)</li>
|
||||
<li>[Fix] Introduced check on duplicate usernames during bot creation/edit (Bug #12461)</li>
|
||||
<li>[Fix] Allow multibyte letters for smilie codes(Bug #12321)</li>
|
||||
<li>[Fix] Correctly chmod created cache files (Bug #12859)</li>
|
||||
<li>[Fix] Use our global expression for checking email syntax in memberlist (Bug #12827)</li>
|
||||
<li>[Fix] Correctly retrieve/refresh templates stored in database if using subdirectories within template directory (Bug #12839)</li>
|
||||
<li>[Fix] Correctly translate special group names in ucp_groups.php (Bug #12597)</li>
|
||||
<li>[Fix] Search boxes not loosing session id (changing method from get to post) (Bug #12643)</li>
|
||||
<li>[Fix] Make sure the automatic update is also working for those having fsockopen disabled</li>
|
||||
<li>[Fix] Simulate recache of theme data on automatic update finished page - recaching it if css data changed</li>
|
||||
<li>[Feature] Allow dropping in custom "info_[module class]_*.php" files to language/*/mods directory for inclusion into the menu structure without the need to modify phpBB language files for menu placements</li>
|
||||
<li>[Fix] Added login box to egosearch (Bug #12941)</li>
|
||||
<li>[Fix] Deal with slashed quotes during quote bbcode conversion (Bug #12607)</li>
|
||||
<li>[Fix] Minor language and style fixes (Bugs #12235, #12493, #11949)</li>
|
||||
<li>[Feature] Added backlinks to mcp_report (Bug #12905)</li>
|
||||
<li>[Fix] Only check usernames in guest posts upon edit (Bug #11349)</li>
|
||||
<li>[Fix] Consider viewonline permission when viewing friends/foes (Bug #12955)</li>
|
||||
<li>[Fix] Added proper unicode support to ban reasons (Bug #12947)</li>
|
||||
<li>[Fix] The forum/topic sync code now recognizes other ways that the latest post in a topic can be expressed (Bug #12947) - patch provided by APTX</li>
|
||||
<li>[Fix] Topic deletion via the user post deletion mechanism did not take into account statistics for forums that hold shadow topics (Bug #12981)</li>
|
||||
<li>[Fix] Allow for negative and decimal numbers to be in transposed queries in the Oracle and Firebird DBAL (Bug #13033)</li>
|
||||
<li>[Fix] Some jabber related bugs (Bug #12989, #11805, #11809)</li>
|
||||
<li>[Fix] Added UTF-8 support for banning via the MCP (Bug #13013)</li>
|
||||
<li>[Fix] Properly detect the script name in session::extract_current_page() if PHP_SELF is not defined (Bug #12705) - patch provided by ToonArmy</li>
|
||||
<li>[Fix] Show role mask for global permission class under Permissions->Permission Roles (Bug #13057)</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<a name="v30rc1"></a><h3>1.viii. Changes since 3.0.RC1</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] (X)HTML issues within the templates (Bug #11255, #11255)</li>
|
||||
<li>[Fix] Tiny language and grammar changes</li>
|
||||
<li>[Fix] Several style related fixes, mainly fixing cross-browser issues</li>
|
||||
<li>[Fix] Several RTL fixes within prosilver</li>
|
||||
<li>[Fix] MCP looses forum_id in some panels (Bug #11255)</li>
|
||||
<li>[Fix] Moderation queue used unfriendly notification of no posts/topics (Bug #11291)</li>
|
||||
<li>[Fix] Array in Oracle DBAL not always set (Bug #11475)</li>
|
||||
<li>[Fix] Improper continue; in acp_styles.php (Bug #11523)</li>
|
||||
<li>[Fix] Imageset editor more friendly (Bug #11511)</li>
|
||||
<li>[Fix] Made Custom BBCode validation more strict (Bug #11335)</li>
|
||||
<li>[Fix] Proper sync of data on topic copy (Bug #11335)</li>
|
||||
<li>[Fix] Introduced ORDER BY clauses to converter queries (Bug #10697)</li>
|
||||
<li>[Fix] Stopped bots from getting added to the registered users group during conversion (Bug #11283)</li>
|
||||
<li>[Fix] Filled "SMILIEYS_DISABLED" template variable (Bug #11257)</li>
|
||||
<li>[Fix] Properly escaped the delimiter in disallowed username comparisons (Bug #11339)</li>
|
||||
<li>[Fix] Check global purge setting (Bug #11555)</li>
|
||||
<li>[Fix] Improper magic url parsing applied to already parsed [url=] bbcode tag (Bug #11429)</li>
|
||||
<li>[Fix] Renamed two indicies for Oracle support (Bug #11457)</li>
|
||||
<li>[Fix] Added support for ISO-8859-8(-i) in the character set convertor (Bug #11265, #12039)</li>
|
||||
<li>[Fix] Added support for Oracle's "easy connect naming"</li>
|
||||
<li>[Fix] Let Mark/Unmark All work in Manage Drafts (Bug #11679)</li>
|
||||
<li>[Fix] Display correct message if no attachments found in user administration (Bug #11629)</li>
|
||||
<li>[Fix] Let the "Delete all board cookies" being displayed for guests too (only prosilver) (Bug #11603)</li>
|
||||
<li>[Fix] Do not display view topic link in MCP while there is no link present (Bug #11573)</li>
|
||||
<li>[Fix] MySQL now properly sorts by post_subject (Bug #11637)</li>
|
||||
<li>[Fix] Introduced checks to stop negative postcounts (Bug #11561, #11421)</li>
|
||||
<li>[Fix] Allow IP v4/v6 urls for remote avatars (Bug #11633)</li>
|
||||
<li>[Fix] Delete avatar files automatically (Bug #11631)</li>
|
||||
<li>[Fix] Automatically add selected columns to group by statements in the converter (Bug #11465)</li>
|
||||
<li>[Fix] Allow posts without subjects to be clicked in the MCP (Bug #11483)</li>
|
||||
<li>[Fix] Sync the forums that shadow topics reside in when the topic that they point to is deleted</li>
|
||||
<li>[Fix] Do not use the gen_random_string function to create cookie names during install (Bug #11431)</li>
|
||||
<li>[Fix] Send stylesheet in style.php even without a valid session id (Bug #11531)</li>
|
||||
<li>[Fix] request_var should strictly return the requested number of dimensions</li>
|
||||
<li>[Fix] Correct assignment of custom width to $user->img(); / Correctly display poll bars in subsilver2 (Bug #11301)</li>
|
||||
<li>[Fix] Allow removing polls in prosilver</li>
|
||||
<li>[Fix] Correct link to post in managing users attachments (Bug #11765)</li>
|
||||
<li>[Fix] Reload confirm screen for selecting new forum for global topic type change if not postable forum is chosen (Bug #11711)</li>
|
||||
<li>[Fix] Correctly show system default color for disabled options in Internet Explorer which does not support disabled option fields</li>
|
||||
<li>[Fix] Update query for custom profiles in user management used wrong order for left/right delimiter (affecting mssql) (Bug #11781)</li>
|
||||
<li>[Fix] Inconsistent display of more smileys link fixed (Bug #11801)</li>
|
||||
<li>[Fix] Outbox messages are no always neither new nor unread post-conversion (Bug #11461)</li>
|
||||
<li>[Feature] Replaced outdated jabber class with the one from the flyspray project</li>
|
||||
<li>[Feature] The converter no longer relies on the smiley ID to decide if it should be displayed on the posting page</li>
|
||||
<li>[Change] Limit maximum number of allowed characters in messages to 60.000 by default. Admins should increase their PHP time limits if they want to raise this tremedously.</li>
|
||||
<li>[Change] Some changes to the conversion documentation</li>
|
||||
<li>[Fix] Only use permissions from existing forums during the conversion (Bug #11417)</li>
|
||||
<li>[Fix] Do not permit the decimal as a valid prefix character (Bug #11967)</li>
|
||||
<li>[Fix] Account for the fact that the IM fields might hold non-IM information</li>
|
||||
<li>[Fix] Make the queue function on post details</li>
|
||||
<li>[Fix] Check if there are active styles left before deleting a style</li>
|
||||
<li>[Fix] Correctly update styles after the deletion of an imageset.</li>
|
||||
<li>[Fix] Replaced jabber validation to use the method used by the new jabber class (Bug #9822)</li>
|
||||
<li>[Sec] Adding confirm boxes to UCP group actions (ToonArmy)</li>
|
||||
<li>[Feature] Added the option to disable the flash bbcode globally (DelvarWorld)</li>
|
||||
<li>[Sec] Changed the embedding of Flash (NeoThermic, DelvarWorld)</li>
|
||||
<li>[Fix] Use the signature setting for PMs (Bug #12001)</li>
|
||||
<li>[Fix] Made the DBMS selection use language variables (Bug #11969)</li>
|
||||
<li>[Fix] Make sure that a folder is used when viewing messages to oneself (Bug #12105)</li>
|
||||
<li>[Fix] Account for the fact that a board might have no visible Admins (Bug #12185)</li>
|
||||
<li>[Fix] Change group ranks even if empty (Bug #12231)</li>
|
||||
<li>[Fix] Correctly propagate variables across the custom profile field wizard (Bug #12237)</li>
|
||||
<li>[Fix] Correctly move pm's into folders if more than one is received (Bug #12135)</li>
|
||||
<li>[Fix] Corrected various bugs with CPF on multi-language boards (Bug #11803)</li>
|
||||
<li>[Fix] Disable notify checkbox in posting editor when board email is disabled (Bug #12263)</li>
|
||||
<li>[Fix] Removed maxlength from password/username fields (Bugs #12215, #11797)</li>
|
||||
<li>[Fix] Use icon-unsubscribe in prosilver (Bug #12211)</li>
|
||||
<li>[Fix] Seperated PREVIOUS/NEXT language vars for pagination and next/previous step (Bug #12197)</li>
|
||||
<li>[Feature] append_sid() supporting anchor (Bug #11535) - patch provided by Schumi and ToonArmy</li>
|
||||
<li>[Fix] Remember selected language while registering after submit (Bug #11435)</li>
|
||||
<li>[Fix] UTF-8 support in theme and template editors (Bug #12251)</li>
|
||||
<li>[Fix] Allow for posts per page in the MCP to change during topic selection (Bug #12067)</li>
|
||||
<li>[Fix] Remove group avatars upon deletion from all profiles, not just the people having the group as default (Bug #12275, #12267)</li>
|
||||
<li>[Fix] Allow for conversions to SQLite (Bug #12279) - patch provided by ToonArmy</li>
|
||||
<li>[Fix] Apply colours to guests (Bug #12219)</li>
|
||||
<li>[Fix] Set the Admin group as founder_manage during conversion (Bug #12287)</li>
|
||||
<li>[Fix] Fixed a special quote BBCode case (Bug #12189)</li>
|
||||
<li>[Fix] Correctly parse BBCodes in a post when a poll is being used (Bug #11833)</li>
|
||||
<li>[Fix] Remember attached files on PM edit (Bug #12019)</li>
|
||||
<li>[Fix] Correctly display poll ending on preview (Bug #12303)</li>
|
||||
<li>[Feature] Display the success message on posting longer for posts awaiting approval (Bug #12053)</li>
|
||||
<li>[Fix] Display maximum and entered number of characters for the "maximum number of characters exceeded" error messages (Bug #11981)</li>
|
||||
<li>[Fix] Wrongly applied setting for allowing links in private messages (used the signature setting instead of the post setting) (Bug #11945)</li>
|
||||
<li>[Fix] Unread flag for multipage topic wrongly set under some conditions (Bug #12127) - fix provided by asinshesq</li>
|
||||
<li>[Fix] Able to delete posts within user prune panel (Bug #11849)</li>
|
||||
<li>[Feature] Allow to specify dimensions of images manually on imageset config (Bug #11675)</li>
|
||||
<li>[Fix] Correctly re-assign query result id after seeking rows (MSSQL/Firebird) (Bug #12369)</li>
|
||||
<li>[Feature] Make effect of a changed hideonline permission instantaneous</li>
|
||||
<li>[Fix] Do not overwrite larger memory values in the installer (Bug #12195)</li>
|
||||
<li>[Fix] Order forums on role permission mask (Bug #12337)</li>
|
||||
<li>[Fix] Show "no image" image when a non-selectable item was selected in the acp imageset editor - IE (Bug #12423)</li>
|
||||
<li>[Fix] Update session information without new pageload (Bug #12393, Bug #12441)</li>
|
||||
<li>[Fix] Let polls be edited correctly (Bug #12433)</li>
|
||||
<li>[Fix] Overcome Oracle's inability to handle IN() clauses with over one thousand elements (Bug #12449)</li>
|
||||
<li>[Fix] Simulate Firebird's affected rows mechanism for older versions of PHP</li>
|
||||
<li>[Fix] Custom BBCodes properly handle lowercasing of parameterized tags (Bug #12377)</li>
|
||||
<li>[Fix] Update the forum_id sequence for PostgreSQL during conversion (Bug #11927)</li>
|
||||
<li>[Fix] Allow for multiple tags containing URL and LOCAL_URL tokens (Bug #12473)</li>
|
||||
<li>[Fix] Properly display forum list in the MCP Queue (Bug #11313)</li>
|
||||
<li>[Fix] Use the localised guest name for quotes (Bug #12483)</li>
|
||||
<li>[Fix] Added post anchor to links in default warning message (Bug #12489)</li>
|
||||
<li>[Fix] Allow 5 digits in editing time fields (Bug #12489)</li>
|
||||
<li>[Fix] MS SQL DBAL drivers now write over extension limitations, they are too low for most installations (Bug #12415)</li>
|
||||
<li>[Fix] Fix sorting by author on "unanswered posts" (Bug #12545)</li>
|
||||
<li>[Fix] Allow searching for multibyte authors (Bug #11793)</li>
|
||||
<li>[Fix] Writing directories/files with correct permissions using FTP for transfers on PHP4</li>
|
||||
<li>[Fix] Oracle sequences during conversions are now corrected (Bug #12555)</li>
|
||||
<li>[Fix] Allow users to continue after selecting "No" in the merge quickmod confirmation (Bug #12577)</li>
|
||||
<li>[Fix] Correctly check permissions on the UCP subscription/bookmark pages (Bug #12595)</li>
|
||||
<li>[Fix] Only convert non-orphaned PMs</li>
|
||||
<li>[Fix] Fixed a few Postgres related errors (Bug #12587)</li>
|
||||
<li>[Feature] New DBAL wrapper for LIKE expressions / sql_like_expression()</li>
|
||||
<li>[Sec] Stricter validation of language entries. </li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
|
||||
|
||||
<span class="corners-bottom"><span></span></span></div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="disclaimer"></a><h2>2. Copyright and disclaimer</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="inner"><span class="corners-top"><span></span></span>
|
||||
|
||||
<div class="content">
|
||||
|
||||
<p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-license.php">GPL</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) 2000, 2002, 2005, 2007 <a href="http://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
|
||||
|
||||
<span class="corners-bottom"><span></span></span></div>
|
||||
</div>
|
||||
|
||||
<!-- END DOCUMENT -->
|
||||
|
||||
<div id="page-footer">
|
||||
<div class="version">Note that a full list of fixed bugs can be found at the bug tracker (<a href="README.html#bugs">see section on bug reporting</a>)</div>
|
||||
</div>
|
||||
</div></div>
|
||||
|
||||
<div>
|
||||
<a id="bottom" name="bottom" accesskey="z"></a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -273,7 +273,7 @@
|
||||
|
||||
<p>This package is meant for those wanting to only replace changed files from a previous version to the latest version. This package normally contains the changed files from up to five previous versions.</p>
|
||||
|
||||
<p>This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have <samp>3.0.0</samp> you should select the phpBB-3.0.0_to_3.0.1.zip/tar.gz file.</p>
|
||||
<p>This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have <samp>3.0.2</samp> you should select the phpBB-3.0.2_to_3.0.3.zip/tar.gz file.</p>
|
||||
|
||||
<p>The directory structure has been preserved enabling you (if you wish) to simply upload the contents of the archive to the appropriate location on your server, i.e. simply overwrite the existing files with the new versions. Do not forget that if you have installed any MODs these files will overwrite the originals possibly destroying them in the process. You will need to re-add MODs to any affected file before uploading.</p>
|
||||
|
||||
@@ -285,7 +285,7 @@
|
||||
|
||||
<p>The patch file is one solution for those with many Modifications (MODs) or other changes who do not want to re-add them back to all the changed files if they use the method explained above. To use this you will need command line access to a standard UNIX type <strong>patch</strong> application. If you do not have access to such an application but still want to use this update approach, we strongly recommend the <a href="#update_auto">Automatic update package</a> explained below. It is also the preferred update method.</p>
|
||||
|
||||
<p>A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is 3.0.0 you need the phpBB-3.0.0_to_3.0.1.patch file. Place the correct patch in the parent directory containing the phpBB3 core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: <strong>patch -cl -d [PHPBB DIRECTORY] -p1 < [PATCH NAME]</strong> (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB3, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.</p>
|
||||
<p>A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is 3.0.2 you need the phpBB-3.0.2_to_3.0.3.patch file. Place the correct patch in the parent directory containing the phpBB3 core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: <strong>patch -cl -d [PHPBB DIRECTORY] -p1 < [PATCH NAME]</strong> (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB3, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.</p>
|
||||
|
||||
<p>If you do get failures you should look at using the <a href="#update_files">Changed files only</a> package to replace the files which failed to patch, please note that you will need to manually re-add any Modifications (MODs) to these particular files. Alternatively if you know how you can examine the .rej files to determine what failed where and make manual adjustments to the relevant source.</p>
|
||||
|
||||
@@ -295,7 +295,7 @@
|
||||
|
||||
<p>This update method is the preferred method for updating. This package allows detecting changed files automatically and merges changes if needed.</p>
|
||||
|
||||
<p>The automatic update package is holding - contrary to the others - only the update informations for updating the last released version to the latest available version. These package is meant for use with the automatic update tool.</p>
|
||||
<p>The automatic update package contains - contrary to the others - only the information required to update the previous release version to the latest available version. These packages are meant for use with the automatic update tool.</p>
|
||||
|
||||
<p>To perform the update, either follow the instructions from the <code>Administration Control Panel->System</code> Tab - this should point out that you are running an outdated version and will guide you through the update - or follow the instructions listed below.</p>
|
||||
|
||||
@@ -371,9 +371,9 @@
|
||||
|
||||
<p><strong>Path to your former board</strong> The converter expects the relative path to your old board's files. So, - for instance - if the old board is located at <code>http://www.yourdomain.com/forum</code> and the phpBB3 installation is located at <code>http://www.yourdomain.com/phpBB3</code>, then the correct value would be <code>../forum</code>. Note that the webserver user must be able to access the source installation's files.</p>
|
||||
|
||||
<p><strong>Missing images</strong> If your default board language's language pack does not include all images, then some images might be missing in your installation. Always use a complete language pack as default language.</p>
|
||||
<p><strong>Missing images</strong> If your default board language's language pack does not include all images, then some images might be missing in your installation. Always use a complete language pack as default language.</p>
|
||||
|
||||
<p><strong>Smilies</strong> During the conversion you might see warnings about image files where the copying failed. That can happen if the old board's smilies have the same file names as those on the new board. Copy those files manually after the conversion, if you want to continue using the old smilies.</p>
|
||||
<p><strong>Smilies</strong> During the conversion you might see warnings about image files where the copying failed. That can happen if the old board's smilies have the same file names as those on the new board. Copy those files manually after the conversion, if you want to continue using the old smilies.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
4
phpBB/docs/changes.txt
Normal file
4
phpBB/docs/changes.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
List of major changes since 3.0.x:
|
||||
|
||||
- new stack-based bbcode system
|
||||
- Migrate phpBB to PHP versions >= 5.2
|
@@ -188,8 +188,7 @@ class ...
|
||||
<li><code>/includes/db/firebird.php</code><br />Firebird/Interbase Database Abstraction Layer</li>
|
||||
<li><code>/includes/db/msssql.php</code><br />MSSQL Database Abstraction Layer</li>
|
||||
<li><code>/includes/db/mssql_odbc.php</code><br />MSSQL ODBC Database Abstraction Layer for MSSQL</li>
|
||||
<li><code>/includes/db/mysql.php</code><br />MySQL Database Abstraction Layer for MySQL 3.x/4.0.x</li>
|
||||
<li><code>/includes/db/mysql4.php</code><br />MySQL4 Database Abstraction Layer for MySQL 4.1.x/5.x</li>
|
||||
<li><code>/includes/db/mysql.php</code><br />MySQL Database Abstraction Layer for MySQL 3.x/4.0.x/4.1.x/5.x
|
||||
<li><code>/includes/db/mysqli.php</code><br />MySQLi Database Abstraction Layer</li>
|
||||
<li><code>/includes/db/oracle.php</code><br />Oracle Database Abstraction Layer</li>
|
||||
<li><code>/includes/db/postgres.php</code><br />PostgreSQL Database Abstraction Layer</li>
|
||||
@@ -399,12 +398,12 @@ do_stuff($str);
|
||||
|
||||
<p class="bad">// Sometimes single quotes are just not right</p>
|
||||
<div class="codebox"><pre>
|
||||
$post_url = $phpbb_root_path . 'posting.' . $phpEx . '?mode=' . $mode . '&amp;start=' . $start;
|
||||
$some_string = $board_url . 'someurl.php?mode=' . $mode . '&amp;start=' . $start;
|
||||
</pre></div>
|
||||
|
||||
<p class="good">// Double quotes are sometimes needed to not overcroud the line with concentinations</p>
|
||||
<div class="codebox"><pre>
|
||||
$post_url = "{$phpbb_root_path}posting.$phpEx?mode=$mode&amp;start=$start";
|
||||
$some_string = "{$board_url}someurl.php?mode=$mode&amp;start=$start";
|
||||
</pre></div>
|
||||
|
||||
<p>In SQL Statements mixing single and double quotes is partly allowed (following the guidelines listed here about SQL Formatting), else it should be tryed to only use one method - mostly single quotes.</p>
|
||||
@@ -518,7 +517,7 @@ switch ($mode)
|
||||
break;
|
||||
|
||||
default:
|
||||
// Always assume that the case got not catched
|
||||
// Always assume that a case was not caught
|
||||
break;
|
||||
}
|
||||
</pre></div>
|
||||
@@ -541,7 +540,7 @@ switch ($mode)
|
||||
|
||||
default:
|
||||
|
||||
// Always assume that the case got not catched
|
||||
// Always assume that a case was not caught
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -569,7 +568,7 @@ switch ($mode)
|
||||
|
||||
default:
|
||||
|
||||
// Always assume that the case got not catched
|
||||
// Always assume that a case was not caught
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -690,7 +689,29 @@ $sql = 'UPDATE ' . SOME_TABLE . '
|
||||
$db->sql_query($sql);
|
||||
</pre></div>
|
||||
|
||||
<p>The <code>$db->sql_build_array()</code> function supports the following modes: <code>INSERT</code> (example above), <code>INSERT_SELECT</code> (building query for <code>INSERT INTO table (...) SELECT value, column ...</code> statements), <code>MULTI_INSERT</code> (for returning extended inserts), <code>UPDATE</code> (example above) and <code>SELECT</code> (for building WHERE statement [AND logic]).</p>
|
||||
<p>The <code>$db->sql_build_array()</code> function supports the following modes: <code>INSERT</code> (example above), <code>INSERT_SELECT</code> (building query for <code>INSERT INTO table (...) SELECT value, column ...</code> statements), <code>UPDATE</code> (example above) and <code>SELECT</code> (for building WHERE statement [AND logic]).</p>
|
||||
|
||||
<h4>sql_multi_insert():</h4>
|
||||
|
||||
<p>If you want to insert multiple statements at once, please use the separate <code>sql_multi_insert()</code> method. An example:</p>
|
||||
|
||||
<div class="codebox"><pre>
|
||||
$sql_ary = array();
|
||||
|
||||
$sql_ary[] = array(
|
||||
'somedata' => $my_string_1,
|
||||
'otherdata' => $an_int_1,
|
||||
'moredata' => $another_int_1,
|
||||
);
|
||||
|
||||
$sql_ary[] = array(
|
||||
'somedata' => $my_string_2,
|
||||
'otherdata' => $an_int_2,
|
||||
'moredata' => $another_int_2,
|
||||
);
|
||||
|
||||
$db->sql_multi_insert(SOME_TABLE, $sql_ary);
|
||||
</pre></div>
|
||||
|
||||
<h4>sql_in_set():</h4>
|
||||
|
||||
@@ -854,7 +875,7 @@ $submit = (isset($HTTP_POST_VARS['submit'])) ? true : false;
|
||||
<p class="good">// Use request var and define a default variable (use the correct type)</p>
|
||||
<div class="codebox"><pre>
|
||||
$start = request_var('start', 0);
|
||||
$submit = (isset($_POST['submit'])) ? true : false;
|
||||
$submit = request::is_set_post('submit');
|
||||
</pre></div>
|
||||
|
||||
<p class="bad">// $start is an int, the following use of request_var therefore is not allowed</p>
|
||||
@@ -925,12 +946,18 @@ trigger_error('NO_MODE', E_USER_ERROR);
|
||||
|
||||
<h4>Url formatting</h4>
|
||||
|
||||
<p>All urls pointing to internal files need to be prepended by the <code>$phpbb_root_path</code> variable. Within the administration control panel all urls pointing to internal files need to be prepended by the <code>$phpbb_admin_path</code> variable. This makes sure the path is always correct and users being able to just rename the admin folder and the acp still working as intended (though some links will fail and the code need to be slightly adjusted).</p>
|
||||
<p>All urls pointing to internal files need to be prepended by the <code>PHPBB_ROOT_PATH</code> constant. Within the administration control panel all urls pointing to internal files need to be prepended by the <code>PHPBB_ADMIN_PATH</code> constant. This makes sure the path is always correct and users being able to just rename the admin folder and the acp still working as intended (though some links will fail and the code need to be slightly adjusted).</p>
|
||||
|
||||
<p>The <code>append_sid()</code> function from 2.0.x is available too, though does not handle url alterations automatically. Please have a look at the code documentation if you want to get more details on how to use append_sid(). A sample call to append_sid() can look like this:</p>
|
||||
|
||||
<div class="codebox"><pre>
|
||||
append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id'])
|
||||
append_sid(PHPBB_ROOT_PATH . 'memberlist.' . PHP_EXT, 'mode=group&amp;g=' . $row['group_id'])
|
||||
</pre></div>
|
||||
|
||||
<p>For shorter writing internal urls are allowed to be written in short notation, not providing the root path and the extension. The append_sid() function will prepend the root path and append the extension automatically (and before calling the hook).</p>
|
||||
|
||||
<div class="codebox"><pre>
|
||||
append_sid('memberlist', 'mode=group&amp;g=' . $row['group_id'])
|
||||
</pre></div>
|
||||
|
||||
<h4>General function usage: </h4>
|
||||
@@ -973,8 +1000,18 @@ append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;
|
||||
<div class="inner"><span class="corners-top"><span></span></span>
|
||||
|
||||
<div class="content">
|
||||
|
||||
<h4>General things</h4>
|
||||
<a name="cfgfiles"></a><h3>3.i. Style Config Files</h3>
|
||||
<p>Style cfg files are simple name-value lists with the information necessary for installing a style. Similar cfg files exist for templates, themes and imagesets. These follow the same principle and will not be introduced individually. Styles can use installed components by using the required_theme/required_template/required_imageset entries. The important part of the style configuration file is assigning an unique name.</p>
|
||||
<div class="codebox"><pre>
|
||||
# General Information about this style
|
||||
name = prosilver_duplicate
|
||||
copyright = © phpBB Group, 2007
|
||||
version = 3.0.3
|
||||
required_template = prosilver
|
||||
required_theme = prosilver
|
||||
required_imageset = prosilver
|
||||
</pre></div>
|
||||
<a name="genstyling"></a><h3>3.2. General Styling Rules</h3>
|
||||
<p>Templates should be produced in a consistent manner. Where appropriate they should be based off an existing copy, e.g. index, viewforum or viewtopic (the combination of which implement a range of conditional and variable forms). Please also note that the intendation and coding guidelines also apply to templates where possible.</p>
|
||||
|
||||
<p>The outer table class <code>forumline</code> has gone and is replaced with <code>tablebg</code>.</p>
|
||||
@@ -1042,6 +1079,8 @@ append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;
|
||||
|
||||
<div class="content">
|
||||
|
||||
<a name="templates"></a><h3>4.i. General Templating</h3>
|
||||
|
||||
<h4>File naming</h4>
|
||||
<p>Firstly templates now take the suffix ".html" rather than ".tpl". This was done simply to make the lifes of some people easier wrt syntax highlighting, etc.</p>
|
||||
|
||||
@@ -1429,6 +1468,29 @@ div
|
||||
</fieldset>
|
||||
</form>
|
||||
</pre></div><br />
|
||||
|
||||
<a name="inheritance"></a><h3>4.ii. Template Inheritance</h3>
|
||||
<p>When basing a new template on an existing one, it is not necessary to provide all template files. By declaring the template to be "<strong>inheriting</strong>" in the template configuration file.</p>
|
||||
|
||||
<p>The limitation on this is that the base style has to be installed and complete, meaning that it is not itself inheriting.</p>
|
||||
|
||||
<p>The effect of doing so is that the template engine will use the files in the new template where they exist, but fall back to files in the base template otherwise. Declaring a style to be inheriting also causes it to use some of the configuration settings of the base style, notably database storage.</p>
|
||||
|
||||
<p>We strongly encourage the use of inheritance for styles based on the bundled styles, as it will ease the update procedure.</p>
|
||||
|
||||
<div class="codebox"><pre>
|
||||
# General Information about this template
|
||||
name = inherits
|
||||
copyright = © phpBB Group, 2007
|
||||
version = 3.0.3
|
||||
|
||||
# Defining a different template bitfield
|
||||
template_bitfield = lNg=
|
||||
|
||||
# Are we inheriting?
|
||||
inherit_from = prosilver
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
|
||||
@@ -1450,7 +1512,7 @@ div
|
||||
|
||||
|
||||
<h4>What are Unicode, UCS and UTF-8?</h4>
|
||||
<p>The <a href="http://en.wikipedia.org/wiki/Universal_Character_Set">Universal Character Set (UCS)</a> described in ISO/IEC 10646 consists of a large amount of characters. Each of them has a unique name and a code point which is an integer number. <a href="http://en.wikipedia.org/wiki/Unicode">Unicode</a> - which is an industry standard - complements the Universal Character Set with further information about the characters' properties and alternative character encodings. More information on Unicode can be found on the <a href="http://www.unicode.org/">Unicode Consortium's website</a>. One of the Unicode encodings is the <a href="http://en.wikipedia.org/wiki/UTF-8">8-bit Unicode Transformation Format (UTF-8)</a>. It encodes characters with up to four bytes aiming for maximum compatability with the <a href="http://en.wikipedia.org/wiki/ASCII">American Standard Code for Information Interchange</a> which is a 7-bit encoding of a relatively small subset of the UCS.</p>
|
||||
<p>The <a href="http://en.wikipedia.org/wiki/Universal_Character_Set">Universal Character Set (UCS)</a> described in ISO/IEC 10646 consists of a large amount of characters. Each of them has a unique name and a code point which is an integer number. <a href="http://en.wikipedia.org/wiki/Unicode">Unicode</a> - which is an industry standard - complements the Universal Character Set with further information about the characters' properties and alternative character encodings. More information on Unicode can be found on the <a href="http://www.unicode.org/">Unicode Consortium's website</a>. One of the Unicode encodings is the <a href="http://en.wikipedia.org/wiki/UTF-8">8-bit Unicode Transformation Format (UTF-8)</a>. It encodes characters with up to four bytes aiming for maximum compatibility with the <a href="http://en.wikipedia.org/wiki/ASCII">American Standard Code for Information Interchange</a> which is a 7-bit encoding of a relatively small subset of the UCS.</p>
|
||||
|
||||
<h4>phpBB's use of Unicode</h4>
|
||||
<p>Unfortunately PHP does not faciliate the use of Unicode prior to version 6. Most functions simply treat strings as sequences of bytes assuming that each character takes up exactly one byte. This behaviour still allows for storing UTF-8 encoded text in PHP strings but many operations on strings have unexpected results. To circumvent this problem we have created some alternative functions to PHP's native string operations which use code points instead of bytes. These functions can be found in <code>/includes/utf/utf_tools.php</code>. They are also covered in the <a href="http://area51.phpbb.com/docs/code/">phpBB3 Sourcecode Documentation</a>. A lot of native PHP functions still work with UTF-8 as long as you stick to certain restrictions. For example <code>explode</code> still works as long as the first and the last character of the delimiter string are ASCII characters.</p>
|
||||
@@ -2195,6 +2257,13 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
|
||||
|
||||
<div class="content">
|
||||
|
||||
<h3>Revision 8596+</h3>
|
||||
|
||||
<ul>
|
||||
<li>Removed sql_build_array('MULTI_INSERT'... statements.</li>
|
||||
<li>Added sql_multi_insert() explanation.</li>
|
||||
</ul>
|
||||
|
||||
<h3>Revision 1.31</h3>
|
||||
|
||||
<ul>
|
||||
|
@@ -383,10 +383,10 @@ a:active { color: #368AD2; }
|
||||
<p>There are also valid external constants you may want to use if you embed phpBB3 into your application:</p>
|
||||
|
||||
<div class="codebox"><pre>
|
||||
PHPBB_MSG_HANDLER (overwrite message handler)
|
||||
PHPBB_MSG_HANDLER (define own message handler)
|
||||
PHPBB_DB_NEW_LINK (overwrite new_link parameter for sql_connect)
|
||||
PHPBB_ROOT_PATH (overwrite $phpbb_root_path)
|
||||
PHPBB_ADMIN_PATH (overwrite $phpbb_admin_path)
|
||||
PHPBB_ROOT_PATH (define own PHPBB_ROOT_PATH)
|
||||
PHPBB_ADMIN_PATH (define own PHPBB_ADMIN_PATH)
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
|
@@ -12,33 +12,34 @@
|
||||
* @ignore
|
||||
*/
|
||||
define('IN_PHPBB', true);
|
||||
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './../');
|
||||
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||
|
||||
if (isset($_GET['avatar']))
|
||||
|
||||
// Thank you sun.
|
||||
if (isset($_SERVER['CONTENT_TYPE']))
|
||||
{
|
||||
require($phpbb_root_path . 'config.' . $phpEx);
|
||||
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
|
||||
require($phpbb_root_path . 'includes/cache.' . $phpEx);
|
||||
require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
|
||||
require($phpbb_root_path . 'includes/constants.' . $phpEx);
|
||||
|
||||
$db = new $sql_db();
|
||||
$cache = new cache();
|
||||
|
||||
// Connect to DB
|
||||
if (!@$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false))
|
||||
if ($_SERVER['CONTENT_TYPE'] === 'application/x-java-archive')
|
||||
{
|
||||
exit;
|
||||
}
|
||||
unset($dbpasswd);
|
||||
}
|
||||
else if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'Java') !== false)
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (request::is_set('avatar', request::GET))
|
||||
{
|
||||
// worst-case default
|
||||
$browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : 'msie 6.0';
|
||||
|
||||
$config = $cache->obtain_config();
|
||||
$filename = $_GET['avatar'];
|
||||
$config = cache::obtain_config();
|
||||
$filename = request::variable('avatar', '', false, request::GET);
|
||||
$avatar_group = false;
|
||||
$exit = false;
|
||||
|
||||
if ($filename[0] === 'g')
|
||||
{
|
||||
$avatar_group = true;
|
||||
@@ -48,81 +49,41 @@ if (isset($_GET['avatar']))
|
||||
// '==' is not a bug - . as the first char is as bad as no dot at all
|
||||
if (strpos($filename, '.') == false)
|
||||
{
|
||||
header('HTTP/1.0 403 Forbidden');
|
||||
if (!empty($cache))
|
||||
{
|
||||
$cache->unload();
|
||||
}
|
||||
$db->sql_close();
|
||||
exit;
|
||||
header('HTTP/1.0 403 forbidden');
|
||||
$exit = true;
|
||||
}
|
||||
|
||||
$ext = substr(strrchr($filename, '.'), 1);
|
||||
$stamp = (int) substr(stristr($filename, '_'), 1);
|
||||
$filename = (int) $filename;
|
||||
|
||||
// let's see if we have to send the file at all
|
||||
$last_load = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? strtotime(trim($_SERVER['HTTP_IF_MODIFIED_SINCE'])) : false;
|
||||
if (strpos(strtolower($browser), 'msie 6.0') === false)
|
||||
if (!$exit)
|
||||
{
|
||||
if ($last_load !== false && $last_load <= $stamp)
|
||||
$ext = substr(strrchr($filename, '.'), 1);
|
||||
$stamp = (int) substr(stristr($filename, '_'), 1);
|
||||
$filename = (int) $filename;
|
||||
$exit = set_modified_headers($stamp, $browser);
|
||||
}
|
||||
if (!$exit && !in_array($ext, array('png', 'gif', 'jpg', 'jpeg')))
|
||||
{
|
||||
// no way such an avatar could exist. They are not following the rules, stop the show.
|
||||
header("HTTP/1.0 403 Forbidden");
|
||||
$exit = true;
|
||||
}
|
||||
|
||||
|
||||
if (!$exit)
|
||||
{
|
||||
if (!$filename)
|
||||
{
|
||||
if (@php_sapi_name() === 'CGI')
|
||||
{
|
||||
header('Status: 304 Not Modified', true, 304);
|
||||
}
|
||||
else
|
||||
{
|
||||
header('HTTP/1.0 304 Not Modified', true, 304);
|
||||
}
|
||||
// seems that we need those too ... browsers
|
||||
header('Pragma: public');
|
||||
header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 31536000));
|
||||
exit();
|
||||
// no way such an avatar could exist. They are not following the rules, stop the show.
|
||||
header("HTTP/1.0 403 Forbidden");
|
||||
}
|
||||
else
|
||||
{
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $stamp) . ' GMT');
|
||||
send_avatar_to_browser(($avatar_group ? 'g' : '') . $filename . '.' . $ext, $browser);
|
||||
}
|
||||
}
|
||||
|
||||
if (!in_array($ext, array('png', 'gif', 'jpg', 'jpeg')))
|
||||
{
|
||||
// no way such an avatar could exist. They are not following the rules, stop the show.
|
||||
header("HTTP/1.0 403 Forbidden");
|
||||
if (!empty($cache))
|
||||
{
|
||||
$cache->unload();
|
||||
}
|
||||
$db->sql_close();
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!$filename)
|
||||
{
|
||||
// no way such an avatar could exist. They are not following the rules, stop the show.
|
||||
header("HTTP/1.0 403 Forbidden");
|
||||
if (!empty($cache))
|
||||
{
|
||||
$cache->unload();
|
||||
}
|
||||
$db->sql_close();
|
||||
exit;
|
||||
}
|
||||
|
||||
send_avatar_to_browser(($avatar_group ? 'g' : '') . $filename . '.' . $ext, $browser);
|
||||
|
||||
if (!empty($cache))
|
||||
{
|
||||
$cache->unload();
|
||||
}
|
||||
$db->sql_close();
|
||||
exit;
|
||||
file_gc();
|
||||
}
|
||||
|
||||
// implicit else: we are not in avatar mode
|
||||
include($phpbb_root_path . 'common.' . $phpEx);
|
||||
|
||||
$download_id = request_var('id', 0);
|
||||
$mode = request_var('mode', '');
|
||||
$thumbnail = request_var('t', false);
|
||||
@@ -142,7 +103,7 @@ if (!$config['allow_attachments'] && !$config['allow_pm_attach'])
|
||||
trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED');
|
||||
}
|
||||
|
||||
$sql = 'SELECT attach_id, in_message, post_msg_id, extension, is_orphan, poster_id
|
||||
$sql = 'SELECT attach_id, in_message, post_msg_id, extension, is_orphan, poster_id, filetime
|
||||
FROM ' . ATTACHMENTS_TABLE . "
|
||||
WHERE attach_id = $download_id";
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
@@ -172,7 +133,7 @@ if ($attachment['is_orphan'])
|
||||
}
|
||||
|
||||
// Obtain all extensions...
|
||||
$extensions = $cache->obtain_attach_extensions(true);
|
||||
$extensions = cache::obtain_attach_extensions(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -208,7 +169,7 @@ else
|
||||
$row['forum_id'] = false;
|
||||
if (!$auth->acl_get('u_pm_download'))
|
||||
{
|
||||
header('HTTP/1.0 403 Forbidden');
|
||||
header('HTTP/1.0 403 forbidden');
|
||||
trigger_error('SORRY_AUTH_VIEW_ATTACH');
|
||||
}
|
||||
|
||||
@@ -231,7 +192,7 @@ else
|
||||
|
||||
if (!$allowed)
|
||||
{
|
||||
header('HTTP/1.0 403 Forbidden');
|
||||
header('HTTP/1.0 403 forbidden');
|
||||
trigger_error('ERROR_NO_ATTACHMENT');
|
||||
}
|
||||
}
|
||||
@@ -246,14 +207,14 @@ else
|
||||
|
||||
if (!download_allowed())
|
||||
{
|
||||
header('HTTP/1.0 403 Forbidden');
|
||||
header('HTTP/1.0 403 forbidden');
|
||||
trigger_error($user->lang['LINKAGE_FORBIDDEN']);
|
||||
}
|
||||
|
||||
$download_mode = (int) $extensions[$attachment['extension']]['download_mode'];
|
||||
|
||||
// Fetching filename here to prevent sniffing of filename
|
||||
$sql = 'SELECT attach_id, is_orphan, in_message, post_msg_id, extension, physical_filename, real_filename, mimetype
|
||||
$sql = 'SELECT attach_id, is_orphan, in_message, post_msg_id, extension, physical_filename, real_filename, mimetype, filetime
|
||||
FROM ' . ATTACHMENTS_TABLE . "
|
||||
WHERE attach_id = $download_id";
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
@@ -291,9 +252,9 @@ else if (($display_cat == ATTACHMENT_CATEGORY_NONE || $display_cat == ATTACHMENT
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
if ($display_cat == ATTACHMENT_CATEGORY_IMAGE && $mode === 'view' && (strpos($attachment['mimetype'], 'image') === 0) && strpos(strtolower($user->browser), 'msie') !== false)
|
||||
if ($display_cat == ATTACHMENT_CATEGORY_IMAGE && $mode === 'view' && (strpos($attachment['mimetype'], 'image') === 0) && ((strpos(strtolower($user->browser), 'msie') !== false) && (strpos(strtolower($user->browser), 'msie 8.0') === false)))
|
||||
{
|
||||
wrap_img_in_html(append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'id=' . $attachment['attach_id']), $attachment['real_filename']);
|
||||
wrap_img_in_html(append_sid('download/file', 'id=' . $attachment['attach_id']), $attachment['real_filename']);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -301,18 +262,18 @@ else
|
||||
if ($download_mode == PHYSICAL_LINK)
|
||||
{
|
||||
// This presenting method should no longer be used
|
||||
if (!@is_dir($phpbb_root_path . $config['upload_path']))
|
||||
if (!@is_dir(PHPBB_ROOT_PATH . $config['upload_path']))
|
||||
{
|
||||
trigger_error($user->lang['PHYSICAL_DOWNLOAD_NOT_POSSIBLE']);
|
||||
}
|
||||
|
||||
redirect($phpbb_root_path . $config['upload_path'] . '/' . $attachment['physical_filename']);
|
||||
exit;
|
||||
redirect(PHPBB_ROOT_PATH . $config['upload_path'] . '/' . $attachment['physical_filename']);
|
||||
file_gc();
|
||||
}
|
||||
else
|
||||
{
|
||||
send_file_to_browser($attachment, $config['upload_path'], $display_cat);
|
||||
exit;
|
||||
file_gc();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,7 +284,7 @@ else
|
||||
*/
|
||||
function send_avatar_to_browser($file, $browser)
|
||||
{
|
||||
global $config, $phpbb_root_path;
|
||||
global $config;
|
||||
|
||||
$prefix = $config['avatar_salt'] . '_';
|
||||
$image_dir = $config['avatar_path'];
|
||||
@@ -339,7 +300,7 @@ function send_avatar_to_browser($file, $browser)
|
||||
{
|
||||
$image_dir = '';
|
||||
}
|
||||
$file_path = $phpbb_root_path . $image_dir . '/' . $prefix . $file;
|
||||
$file_path = PHPBB_ROOT_PATH . $image_dir . '/' . $prefix . $file;
|
||||
|
||||
if ((@file_exists($file_path) && @is_readable($file_path)) && !headers_sent())
|
||||
{
|
||||
@@ -348,7 +309,7 @@ function send_avatar_to_browser($file, $browser)
|
||||
$image_data = @getimagesize($file_path);
|
||||
header('Content-Type: ' . image_type_to_mime_type($image_data[2]));
|
||||
|
||||
if (strpos(strtolower($browser), 'msie') !== false)
|
||||
if (strpos(strtolower($browser), 'msie') !== false && strpos(strtolower($browser), 'msie 8.0') === false)
|
||||
{
|
||||
header('Content-Disposition: attachment; ' . header_filename($file));
|
||||
|
||||
@@ -373,7 +334,7 @@ function send_avatar_to_browser($file, $browser)
|
||||
header("Content-Length: $size");
|
||||
}
|
||||
|
||||
if (@readfile($file_path) === false)
|
||||
if (@readfile($file_path) == false)
|
||||
{
|
||||
$fp = @fopen($file_path, 'rb');
|
||||
|
||||
@@ -421,9 +382,9 @@ function wrap_img_in_html($src, $title)
|
||||
*/
|
||||
function send_file_to_browser($attachment, $upload_dir, $category)
|
||||
{
|
||||
global $user, $db, $config, $phpbb_root_path;
|
||||
global $user, $db, $config;
|
||||
|
||||
$filename = $phpbb_root_path . $upload_dir . '/' . $attachment['physical_filename'];
|
||||
$filename = PHPBB_ROOT_PATH . $upload_dir . '/' . $attachment['physical_filename'];
|
||||
|
||||
if (!@file_exists($filename))
|
||||
{
|
||||
@@ -478,9 +439,10 @@ function send_file_to_browser($attachment, $upload_dir, $category)
|
||||
*/
|
||||
|
||||
// Send out the Headers. Do not set Content-Disposition to inline please, it is a security measure for users using the Internet Explorer.
|
||||
header('Content-Type: ' . $attachment['mimetype']);
|
||||
$is_ie8 = (strpos(strtolower($user->browser), 'msie 8.0') !== false);
|
||||
header('Content-Type: ' . $attachment['mimetype'] . (($is_ie8) ? '; authoritative=true;' : ''));
|
||||
|
||||
if (empty($user->browser) || (strpos(strtolower($user->browser), 'msie') !== false))
|
||||
if (empty($user->browser) || (!$is_ie8 && (strpos(strtolower($user->browser), 'msie') !== false)))
|
||||
{
|
||||
header('Content-Disposition: attachment; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
|
||||
if (empty($user->browser) || (strpos(strtolower($user->browser), 'msie 6.0') !== false))
|
||||
@@ -491,6 +453,10 @@ function send_file_to_browser($attachment, $upload_dir, $category)
|
||||
else
|
||||
{
|
||||
header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
|
||||
if ($is_ie8 && (strpos($attachment['mimetype'], 'image') !== 0))
|
||||
{
|
||||
header('X-Download-Options: noopen');
|
||||
}
|
||||
}
|
||||
|
||||
if ($size)
|
||||
@@ -498,26 +464,32 @@ function send_file_to_browser($attachment, $upload_dir, $category)
|
||||
header("Content-Length: $size");
|
||||
}
|
||||
|
||||
// Try to deliver in chunks
|
||||
@set_time_limit(0);
|
||||
// Close the db connection before sending the file
|
||||
$db->sql_close();
|
||||
|
||||
$fp = @fopen($filename, 'rb');
|
||||
|
||||
if ($fp !== false)
|
||||
if (!set_modified_headers($attachment['filetime'], $user->browser))
|
||||
{
|
||||
while (!feof($fp))
|
||||
// Try to deliver in chunks
|
||||
@set_time_limit(0);
|
||||
|
||||
$fp = @fopen($filename, 'rb');
|
||||
|
||||
if ($fp !== false)
|
||||
{
|
||||
echo fread($fp, 8192);
|
||||
while (!feof($fp))
|
||||
{
|
||||
echo fread($fp, 8192);
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
@readfile($filename);
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
@readfile($filename);
|
||||
}
|
||||
|
||||
flush();
|
||||
exit;
|
||||
flush();
|
||||
}
|
||||
file_gc();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -649,4 +621,48 @@ function download_allowed()
|
||||
return $allowed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the browser has the file already and set the appropriate headers-
|
||||
* @returns false if a resend is in order.
|
||||
*/
|
||||
function set_modified_headers($stamp, $browser)
|
||||
{
|
||||
// let's see if we have to send the file at all
|
||||
$last_load = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? strtotime(trim($_SERVER['HTTP_IF_MODIFIED_SINCE'])) : false;
|
||||
if ((strpos(strtolower($browser), 'msie 6.0') === false) && (strpos(strtolower($browser), 'msie 8.0') === false))
|
||||
{
|
||||
if ($last_load !== false && $last_load <= $stamp)
|
||||
{
|
||||
if (@php_sapi_name() === 'CGI')
|
||||
{
|
||||
header('Status: 304 Not Modified', true, 304);
|
||||
}
|
||||
else
|
||||
{
|
||||
header('HTTP/1.0 304 Not Modified', true, 304);
|
||||
}
|
||||
// seems that we need those too ... browsers
|
||||
header('Pragma: public');
|
||||
header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 31536000));
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $stamp) . ' GMT');
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function file_gc()
|
||||
{
|
||||
global $cache, $db;
|
||||
if (!empty($cache))
|
||||
{
|
||||
$cache->unload();
|
||||
}
|
||||
$db->sql_close();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
0
phpBB/download/index.htm
Executable file → Normal file
0
phpBB/download/index.htm
Executable file → Normal file
@@ -12,9 +12,9 @@
|
||||
* @ignore
|
||||
*/
|
||||
define('IN_PHPBB', true);
|
||||
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
include($phpbb_root_path . 'common.' . $phpEx);
|
||||
if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './');
|
||||
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||
|
||||
// Start session management
|
||||
$user->session_begin();
|
||||
@@ -67,7 +67,7 @@ page_header($l_title);
|
||||
$template->set_filenames(array(
|
||||
'body' => 'faq_body.html')
|
||||
);
|
||||
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
|
||||
make_jumpbox(append_sid('viewforum'));
|
||||
|
||||
page_footer();
|
||||
|
||||
|
0
phpBB/images/avatars/upload/.htaccess
Executable file → Normal file
0
phpBB/images/avatars/upload/.htaccess
Executable file → Normal file
320
phpBB/includes/acm/acm_apc.php
Normal file
320
phpBB/includes/acm/acm_apc.php
Normal file
@@ -0,0 +1,320 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package acm
|
||||
* @version $Id$
|
||||
* @copyright (c) 2005 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* ACM APC Based Caching
|
||||
* @package acm
|
||||
*/
|
||||
class acm
|
||||
{
|
||||
private $vars = array();
|
||||
private $is_modified = false;
|
||||
|
||||
public $sql_rowset = array();
|
||||
public $cache_dir = '';
|
||||
|
||||
/**
|
||||
* Set cache path
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
$this->cache_dir = PHPBB_ROOT_PATH . 'cache/';
|
||||
}
|
||||
|
||||
/**
|
||||
* Load global cache
|
||||
*/
|
||||
private function load()
|
||||
{
|
||||
// grab the global cache
|
||||
if ($this->vars = apc_fetch('global'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unload cache object
|
||||
*/
|
||||
public function unload()
|
||||
{
|
||||
$this->save();
|
||||
unset($this->vars);
|
||||
unset($this->sql_rowset);
|
||||
|
||||
$this->vars = array();
|
||||
$this->sql_rowset = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Save modified objects
|
||||
*/
|
||||
private function save()
|
||||
{
|
||||
if (!$this->is_modified)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
apc_store('global', $this->vars, 31536000);
|
||||
|
||||
$this->is_modified = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tidy cache
|
||||
*/
|
||||
public function tidy()
|
||||
{
|
||||
// cache has auto GC, no need to have any code here :)
|
||||
|
||||
set_config('cache_last_gc', time(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get saved cache object
|
||||
*/
|
||||
public function get($var_name)
|
||||
{
|
||||
if ($var_name[0] === '_')
|
||||
{
|
||||
return apc_fetch($var_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!sizeof($this->vars))
|
||||
{
|
||||
$this->load();
|
||||
}
|
||||
return (isset($this->vars[$var_name])) ? $this->vars[$var_name] : false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Put data into cache
|
||||
*/
|
||||
public function put($var_name, $var, $ttl = 31536000)
|
||||
{
|
||||
if ($var_name[0] === '_')
|
||||
{
|
||||
apc_store($var_name, $var, $ttl);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->vars[$var_name] = $var;
|
||||
$this->is_modified = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Purge cache data
|
||||
*/
|
||||
public function purge()
|
||||
{
|
||||
// Purge all phpbb cache files
|
||||
$dir = @opendir($this->cache_dir);
|
||||
|
||||
if (!$dir)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
while (($entry = readdir($dir)) !== false)
|
||||
{
|
||||
if (strpos($entry, 'sql_') !== 0 && strpos($entry, 'data_') !== 0 && strpos($entry, 'ctpl_') !== 0 && strpos($entry, 'tpl_') !== 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@unlink($this->cache_dir . $entry);
|
||||
}
|
||||
closedir($dir);
|
||||
|
||||
apc_clear_cache('user');
|
||||
|
||||
unset($this->vars);
|
||||
unset($this->sql_rowset);
|
||||
|
||||
$this->vars = array();
|
||||
$this->var_expires = array();
|
||||
$this->sql_rowset = array();
|
||||
|
||||
$this->is_modified = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy cache data
|
||||
*/
|
||||
public function destroy($var_name, $table = '')
|
||||
{
|
||||
if ($var_name === 'sql' && !empty($table))
|
||||
{
|
||||
if (!is_array($table))
|
||||
{
|
||||
$table = array($table);
|
||||
}
|
||||
|
||||
foreach ($table as $table_name)
|
||||
{
|
||||
// gives us the md5s that we want
|
||||
$temp = apc_fetch('sql_' . $table_name);
|
||||
if ($temp === false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// delete each query ref
|
||||
foreach ($temp as $md5_id => $void)
|
||||
{
|
||||
apc_delete('sql_' . $md5_id);
|
||||
}
|
||||
|
||||
// delete the table ref
|
||||
apc_delete('sql_' . $table_name);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($var_name[0] === '_')
|
||||
{
|
||||
apc_delete($var_name);
|
||||
}
|
||||
else if (isset($this->vars[$var_name]))
|
||||
{
|
||||
$this->is_modified = true;
|
||||
unset($this->vars[$var_name]);
|
||||
|
||||
// We save here to let the following cache hits succeed
|
||||
$this->save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load cached sql query
|
||||
*/
|
||||
public function sql_load($query)
|
||||
{
|
||||
// Remove extra spaces and tabs
|
||||
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
||||
$query_id = sizeof($this->sql_rowset);
|
||||
|
||||
$temp = apc_fetch('sql_' . md5($query));
|
||||
|
||||
if ($temp === false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->sql_rowset[$query_id] = $temp;
|
||||
|
||||
return $query_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save sql query
|
||||
*/
|
||||
public function sql_save($query, &$query_result, $ttl)
|
||||
{
|
||||
global $db;
|
||||
|
||||
// Remove extra spaces and tabs
|
||||
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
||||
|
||||
// determine which tables this query belongs to:
|
||||
|
||||
// grab all the FROM tables, avoid getting a LEFT JOIN
|
||||
preg_match('/FROM \(?(\w+(?: (?!LEFT JOIN)\w+)?(?:, ?\w+(?: (?!LEFT JOIN)\w+)?)*)\)?/', $query, $regs);
|
||||
$tables = array_map('trim', explode(',', $regs[1]));
|
||||
|
||||
// now get the LEFT JOIN
|
||||
preg_match_all('/LEFT JOIN\s+(\w+)(?: \w+)?/', $query, $result, PREG_PATTERN_ORDER);
|
||||
$tables = array_merge($tables, $result[1]);
|
||||
|
||||
$query_hash = md5($query);
|
||||
|
||||
foreach ($tables as $table_name)
|
||||
{
|
||||
if (($pos = strpos($table_name, ' ')) !== false)
|
||||
{
|
||||
$table_name = substr($table_name, 0, $pos);
|
||||
}
|
||||
|
||||
$temp = apc_fetch('sql_' . $table_name);
|
||||
if ($temp === false)
|
||||
{
|
||||
$temp = array();
|
||||
}
|
||||
$temp[$query_hash] = true;
|
||||
apc_store('sql_' . $table_name, $temp, $ttl);
|
||||
}
|
||||
|
||||
// store them in the right place
|
||||
$query_id = sizeof($this->sql_rowset);
|
||||
$this->sql_rowset[$query_id] = array();
|
||||
|
||||
while ($row = $db->sql_fetchrow($query_result))
|
||||
{
|
||||
$this->sql_rowset[$query_id][] = $row;
|
||||
}
|
||||
$db->sql_freeresult($query_result);
|
||||
|
||||
apc_store('sql_' . $query_hash, $this->sql_rowset[$query_id], $ttl);
|
||||
|
||||
$query_result = $query_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch row from cache (database)
|
||||
*/
|
||||
public function sql_fetchrow($query_id)
|
||||
{
|
||||
list(, $row) = each($this->sql_rowset[$query_id]);
|
||||
|
||||
return ($row !== NULL) ? $row : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a field from the current row of a cached database result (database)
|
||||
*/
|
||||
public function sql_fetchfield($query_id, $field)
|
||||
{
|
||||
$row = current($this->sql_rowset[$query_id]);
|
||||
|
||||
return ($row !== false && isset($row[$field])) ? $row[$field] : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Free memory used for a cached database result (database)
|
||||
*/
|
||||
public function sql_freeresult($query_id)
|
||||
{
|
||||
if (!isset($this->sql_rowset[$query_id]))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
unset($this->sql_rowset[$query_id]);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
336
phpBB/includes/acm/acm_eaccelerator.php
Normal file
336
phpBB/includes/acm/acm_eaccelerator.php
Normal file
@@ -0,0 +1,336 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package acm
|
||||
* @version $Id$
|
||||
* @copyright (c) 2005 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* ACM eAccelerator Based Caching
|
||||
* @package acm
|
||||
*/
|
||||
class acm
|
||||
{
|
||||
private $vars = array();
|
||||
private $is_modified = false;
|
||||
|
||||
public $sql_rowset = array();
|
||||
public $cache_dir = '';
|
||||
|
||||
/**
|
||||
* Set cache path
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
$this->cache_dir = PHPBB_ROOT_PATH . 'cache/';
|
||||
}
|
||||
|
||||
/**
|
||||
* Load global cache
|
||||
*/
|
||||
private function load()
|
||||
{
|
||||
// grab the global cache
|
||||
if ($this->vars = eaccelerator_get('global'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unload cache object
|
||||
*/
|
||||
public function unload()
|
||||
{
|
||||
$this->save();
|
||||
unset($this->vars);
|
||||
unset($this->sql_rowset);
|
||||
|
||||
$this->vars = array();
|
||||
$this->sql_rowset = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Save modified objects
|
||||
*/
|
||||
private function save()
|
||||
{
|
||||
if (!$this->is_modified)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
eaccelerator_put('global', $this->vars, 31536000);
|
||||
|
||||
$this->is_modified = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tidy cache
|
||||
*/
|
||||
public function tidy()
|
||||
{
|
||||
eaccelerator_gc();
|
||||
|
||||
set_config('cache_last_gc', time(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get saved cache object
|
||||
*/
|
||||
public function get($var_name)
|
||||
{
|
||||
if ($var_name[0] === '_')
|
||||
{
|
||||
$temp = eaccelerator_get($var_name);
|
||||
|
||||
if ($temp !== null)
|
||||
{
|
||||
return $temp;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!sizeof($this->vars))
|
||||
{
|
||||
$this->load();
|
||||
}
|
||||
return (isset($this->vars[$var_name])) ? $this->vars[$var_name] : false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Put data into cache
|
||||
*/
|
||||
public function put($var_name, $var, $ttl = 31536000)
|
||||
{
|
||||
if ($var_name[0] === '_')
|
||||
{
|
||||
eaccelerator_put($var_name, $var, $ttl);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->vars[$var_name] = $var;
|
||||
$this->is_modified = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Purge cache data
|
||||
*/
|
||||
public function purge()
|
||||
{
|
||||
// Purge all phpbb cache files
|
||||
$dir = @opendir($this->cache_dir);
|
||||
|
||||
if (!$dir)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
while (($entry = readdir($dir)) !== false)
|
||||
{
|
||||
if (strpos($entry, 'sql_') !== 0 && strpos($entry, 'data_') !== 0 && strpos($entry, 'ctpl_') !== 0 && strpos($entry, 'tpl_') !== 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@unlink($this->cache_dir . $entry);
|
||||
}
|
||||
closedir($dir);
|
||||
|
||||
foreach (eaccelerator_list_keys() as $var)
|
||||
{
|
||||
eaccelerator_rm(substr($var['name'], 1));
|
||||
}
|
||||
|
||||
unset($this->vars);
|
||||
unset($this->sql_rowset);
|
||||
|
||||
$this->vars = array();
|
||||
$this->var_expires = array();
|
||||
$this->sql_rowset = array();
|
||||
|
||||
$this->is_modified = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy cache data
|
||||
*/
|
||||
public function destroy($var_name, $table = '')
|
||||
{
|
||||
if ($var_name === 'sql' && !empty($table))
|
||||
{
|
||||
if (!is_array($table))
|
||||
{
|
||||
$table = array($table);
|
||||
}
|
||||
|
||||
foreach ($table as $table_name)
|
||||
{
|
||||
// gives us the md5s that we want
|
||||
eaccelerator_lock('sql_' . $table_name);
|
||||
$temp = eaccelerator_get('sql_' . $table_name);
|
||||
if ($temp === null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// delete each query ref
|
||||
foreach ($temp as $md5_id => $void)
|
||||
{
|
||||
eaccelerator_lock('sql_' . $md5_id);
|
||||
eaccelerator_rm('sql_' . $md5_id);
|
||||
eaccelerator_unlock('sql_' . $md5_id);
|
||||
}
|
||||
|
||||
// delete the table ref
|
||||
eaccelerator_rm('sql_' . $table_name);
|
||||
eaccelerator_unlock('sql_' . $table_name);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($var_name[0] === '_')
|
||||
{
|
||||
eaccelerator_rm($var_name);
|
||||
}
|
||||
else if (isset($this->vars[$var_name]))
|
||||
{
|
||||
$this->is_modified = true;
|
||||
unset($this->vars[$var_name]);
|
||||
|
||||
// We save here to let the following cache hits succeed
|
||||
$this->save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load cached sql query
|
||||
*/
|
||||
public function sql_load($query)
|
||||
{
|
||||
// Remove extra spaces and tabs
|
||||
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
||||
$query_id = sizeof($this->sql_rowset);
|
||||
|
||||
$temp = eaccelerator_get('sql_' . md5($query));
|
||||
|
||||
if ($temp === null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->sql_rowset[$query_id] = $temp;
|
||||
|
||||
return $query_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save sql query
|
||||
*/
|
||||
public function sql_save($query, &$query_result, $ttl)
|
||||
{
|
||||
global $db;
|
||||
|
||||
// Remove extra spaces and tabs
|
||||
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
||||
|
||||
// determine which tables this query belongs to:
|
||||
|
||||
// grab all the FROM tables, avoid getting a LEFT JOIN
|
||||
preg_match('/FROM \(?(\w+(?: (?!LEFT JOIN)\w+)?(?:, ?\w+(?: (?!LEFT JOIN)\w+)?)*)\)?/', $query, $regs);
|
||||
$tables = array_map('trim', explode(',', $regs[1]));
|
||||
|
||||
// now get the LEFT JOIN
|
||||
preg_match_all('/LEFT JOIN\s+(\w+)(?: \w+)?/', $query, $result, PREG_PATTERN_ORDER);
|
||||
$tables = array_merge($tables, $result[1]);
|
||||
|
||||
$query_hash = md5($query);
|
||||
|
||||
foreach ($tables as $table_name)
|
||||
{
|
||||
if (($pos = strpos($table_name, ' ')) !== false)
|
||||
{
|
||||
$table_name = substr($table_name, 0, $pos);
|
||||
}
|
||||
|
||||
$temp = eaccelerator_get('sql_' . $table_name);
|
||||
if ($temp === null)
|
||||
{
|
||||
$temp = array();
|
||||
}
|
||||
$temp[$query_hash] = true;
|
||||
eaccelerator_put('sql_' . $table_name, $temp, $ttl);
|
||||
}
|
||||
|
||||
// store them in the right place
|
||||
$query_id = sizeof($this->sql_rowset);
|
||||
$this->sql_rowset[$query_id] = array();
|
||||
|
||||
while ($row = $db->sql_fetchrow($query_result))
|
||||
{
|
||||
$this->sql_rowset[$query_id][] = $row;
|
||||
}
|
||||
$db->sql_freeresult($query_result);
|
||||
|
||||
eaccelerator_put('sql_' . $query_hash, $this->sql_rowset[$query_id], $ttl);
|
||||
|
||||
$query_result = $query_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch row from cache (database)
|
||||
*/
|
||||
public function sql_fetchrow($query_id)
|
||||
{
|
||||
list(, $row) = each($this->sql_rowset[$query_id]);
|
||||
|
||||
return ($row !== NULL) ? $row : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a field from the current row of a cached database result (database)
|
||||
*/
|
||||
public function sql_fetchfield($query_id, $field)
|
||||
{
|
||||
$row = current($this->sql_rowset[$query_id]);
|
||||
|
||||
return ($row !== false && isset($row[$field])) ? $row[$field] : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Free memory used for a cached database result (database)
|
||||
*/
|
||||
public function sql_freeresult($query_id)
|
||||
{
|
||||
if (!isset($this->sql_rowset[$query_id]))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
unset($this->sql_rowset[$query_id]);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@@ -22,78 +22,74 @@ if (!defined('IN_PHPBB'))
|
||||
*/
|
||||
class acm
|
||||
{
|
||||
var $vars = array();
|
||||
var $var_expires = array();
|
||||
var $is_modified = false;
|
||||
private $vars = array();
|
||||
private $var_expires = array();
|
||||
private $is_modified = false;
|
||||
|
||||
var $sql_rowset = array();
|
||||
var $sql_row_pointer = array();
|
||||
var $cache_dir = '';
|
||||
public $sql_rowset = array();
|
||||
public $cache_dir = '';
|
||||
|
||||
/**
|
||||
* Set cache path
|
||||
*/
|
||||
function acm()
|
||||
function __construct()
|
||||
{
|
||||
global $phpbb_root_path;
|
||||
$this->cache_dir = $phpbb_root_path . 'cache/';
|
||||
$this->cache_dir = PHPBB_ROOT_PATH . 'cache/';
|
||||
}
|
||||
|
||||
/**
|
||||
* Load global cache
|
||||
*/
|
||||
function load()
|
||||
private function load()
|
||||
{
|
||||
global $phpEx;
|
||||
if (file_exists($this->cache_dir . 'data_global.' . $phpEx))
|
||||
// grab the global cache
|
||||
if (file_exists($this->cache_dir . 'data_global.' . PHP_EXT))
|
||||
{
|
||||
@include($this->cache_dir . 'data_global.' . $phpEx);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
@include($this->cache_dir . 'data_global.' . PHP_EXT);
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unload cache object
|
||||
*/
|
||||
function unload()
|
||||
public function unload()
|
||||
{
|
||||
$this->save();
|
||||
unset($this->vars);
|
||||
unset($this->var_expires);
|
||||
unset($this->sql_rowset);
|
||||
unset($this->sql_row_pointer);
|
||||
|
||||
$this->vars = array();
|
||||
$this->var_expires = array();
|
||||
$this->sql_rowset = array();
|
||||
$this->sql_row_pointer = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Save modified objects
|
||||
*/
|
||||
function save()
|
||||
private function save()
|
||||
{
|
||||
if (!$this->is_modified)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
global $phpEx;
|
||||
|
||||
if ($fp = @fopen($this->cache_dir . 'data_global.' . $phpEx, 'wb'))
|
||||
if ($fp = @fopen($this->cache_dir . 'data_global.' . PHP_EXT, 'wb'))
|
||||
{
|
||||
@flock($fp, LOCK_EX);
|
||||
fwrite($fp, "<?php\n\$this->vars = " . var_export($this->vars, true) . ";\n\n\$this->var_expires = " . var_export($this->var_expires, true) . "\n?>");
|
||||
fwrite($fp, "<?php\n\$this->vars = unserialize(" . var_export(serialize($this->vars), true) . ");\n\$this->var_expires = unserialize(" . var_export(serialize($this->var_expires), true) . ");");
|
||||
@flock($fp, LOCK_UN);
|
||||
fclose($fp);
|
||||
|
||||
@chmod($this->cache_dir . 'data_global.' . $phpEx, 0666);
|
||||
if (!function_exists('phpbb_chmod'))
|
||||
{
|
||||
include(PHPBB_ROOT_PATH . 'includes/functions.' . PHP_EXT);
|
||||
}
|
||||
|
||||
phpbb_chmod($this->cache_dir . 'data_global.' . PHP_EXT, CHMOD_WRITE);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -103,7 +99,7 @@ class acm
|
||||
trigger_error($this->cache_dir . ' is NOT writable.', E_USER_ERROR);
|
||||
}
|
||||
|
||||
trigger_error('Not able to open ' . $this->cache_dir . 'data_global.' . $phpEx, E_USER_ERROR);
|
||||
trigger_error('Not able to open ' . $this->cache_dir . 'data_global.' . PHP_EXT, E_USER_ERROR);
|
||||
}
|
||||
|
||||
$this->is_modified = false;
|
||||
@@ -112,10 +108,8 @@ class acm
|
||||
/**
|
||||
* Tidy cache
|
||||
*/
|
||||
function tidy()
|
||||
public function tidy()
|
||||
{
|
||||
global $phpEx;
|
||||
|
||||
$dir = @opendir($this->cache_dir);
|
||||
|
||||
if (!$dir)
|
||||
@@ -139,7 +133,7 @@ class acm
|
||||
}
|
||||
closedir($dir);
|
||||
|
||||
if (file_exists($this->cache_dir . 'data_global.' . $phpEx))
|
||||
if (file_exists($this->cache_dir . 'data_global.' . PHP_EXT))
|
||||
{
|
||||
if (!sizeof($this->vars))
|
||||
{
|
||||
@@ -154,25 +148,23 @@ class acm
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
set_config('cache_last_gc', time(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get saved cache object
|
||||
*/
|
||||
function get($var_name)
|
||||
public function get($var_name)
|
||||
{
|
||||
if ($var_name[0] == '_')
|
||||
if ($var_name[0] === '_')
|
||||
{
|
||||
global $phpEx;
|
||||
|
||||
if (!$this->_exists($var_name))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@include($this->cache_dir . "data{$var_name}.$phpEx");
|
||||
@include($this->cache_dir . "data{$var_name}." . PHP_EXT);
|
||||
return (isset($data)) ? $data : false;
|
||||
}
|
||||
else
|
||||
@@ -186,18 +178,21 @@ class acm
|
||||
*/
|
||||
function put($var_name, $var, $ttl = 31536000)
|
||||
{
|
||||
if ($var_name[0] == '_')
|
||||
if ($var_name[0] === '_')
|
||||
{
|
||||
global $phpEx;
|
||||
|
||||
if ($fp = @fopen($this->cache_dir . "data{$var_name}.$phpEx", 'wb'))
|
||||
if ($fp = @fopen($this->cache_dir . "data{$var_name}." . PHP_EXT, 'wb'))
|
||||
{
|
||||
@flock($fp, LOCK_EX);
|
||||
fwrite($fp, "<?php\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$data = " . var_export($var, true) . ";\n?>");
|
||||
fwrite($fp, "<?php\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\$data = " . (sizeof($var) ? "unserialize(" . var_export(serialize($var), true) . ");" : 'array();'));
|
||||
@flock($fp, LOCK_UN);
|
||||
fclose($fp);
|
||||
|
||||
@chmod($this->cache_dir . "data{$var_name}.$phpEx", 0666);
|
||||
if (!function_exists('phpbb_chmod'))
|
||||
{
|
||||
include(PHPBB_ROOT_PATH . 'includes/functions.' . PHP_EXT);
|
||||
}
|
||||
|
||||
phpbb_chmod($this->cache_dir . "data{$var_name}." . PHP_EXT, CHMOD_WRITE);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -211,7 +206,7 @@ class acm
|
||||
/**
|
||||
* Purge cache data
|
||||
*/
|
||||
function purge()
|
||||
public function purge()
|
||||
{
|
||||
// Purge all phpbb cache files
|
||||
$dir = @opendir($this->cache_dir);
|
||||
@@ -235,12 +230,10 @@ class acm
|
||||
unset($this->vars);
|
||||
unset($this->var_expires);
|
||||
unset($this->sql_rowset);
|
||||
unset($this->sql_row_pointer);
|
||||
|
||||
$this->vars = array();
|
||||
$this->var_expires = array();
|
||||
$this->sql_rowset = array();
|
||||
$this->sql_row_pointer = array();
|
||||
|
||||
$this->is_modified = false;
|
||||
}
|
||||
@@ -248,11 +241,9 @@ class acm
|
||||
/**
|
||||
* Destroy cache data
|
||||
*/
|
||||
function destroy($var_name, $table = '')
|
||||
public function destroy($var_name, $table = '')
|
||||
{
|
||||
global $phpEx;
|
||||
|
||||
if ($var_name == 'sql' && !empty($table))
|
||||
if ($var_name === 'sql' && !empty($table))
|
||||
{
|
||||
if (!is_array($table))
|
||||
{
|
||||
@@ -310,9 +301,9 @@ class acm
|
||||
return;
|
||||
}
|
||||
|
||||
if ($var_name[0] == '_')
|
||||
if ($var_name[0] === '_')
|
||||
{
|
||||
$this->remove_file($this->cache_dir . 'data' . $var_name . ".$phpEx", true);
|
||||
$this->remove_file($this->cache_dir . 'data' . $var_name . '.' . PHP_EXT, true);
|
||||
}
|
||||
else if (isset($this->vars[$var_name]))
|
||||
{
|
||||
@@ -328,12 +319,11 @@ class acm
|
||||
/**
|
||||
* Check if a given cache entry exist
|
||||
*/
|
||||
function _exists($var_name)
|
||||
private function _exists($var_name)
|
||||
{
|
||||
if ($var_name[0] == '_')
|
||||
if ($var_name[0] === '_')
|
||||
{
|
||||
global $phpEx;
|
||||
return file_exists($this->cache_dir . 'data' . $var_name . ".$phpEx");
|
||||
return file_exists($this->cache_dir . 'data' . $var_name . '.' . PHP_EXT);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -354,20 +344,18 @@ class acm
|
||||
/**
|
||||
* Load cached sql query
|
||||
*/
|
||||
function sql_load($query)
|
||||
public function sql_load($query)
|
||||
{
|
||||
global $phpEx;
|
||||
|
||||
// Remove extra spaces and tabs
|
||||
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
||||
$query_id = sizeof($this->sql_rowset);
|
||||
|
||||
if (!file_exists($this->cache_dir . 'sql_' . md5($query) . ".$phpEx"))
|
||||
if (!file_exists($this->cache_dir . 'sql_' . md5($query) . '.' . PHP_EXT))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@include($this->cache_dir . 'sql_' . md5($query) . ".$phpEx");
|
||||
@include($this->cache_dir . 'sql_' . md5($query) . '.' . PHP_EXT);
|
||||
|
||||
if (!isset($expired))
|
||||
{
|
||||
@@ -375,11 +363,10 @@ class acm
|
||||
}
|
||||
else if ($expired)
|
||||
{
|
||||
$this->remove_file($this->cache_dir . 'sql_' . md5($query) . ".$phpEx", true);
|
||||
$this->remove_file($this->cache_dir . 'sql_' . md5($query) . '.' . PHP_EXT, true);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->sql_row_pointer[$query_id] = 0;
|
||||
|
||||
return $query_id;
|
||||
}
|
||||
@@ -387,13 +374,13 @@ class acm
|
||||
/**
|
||||
* Save sql query
|
||||
*/
|
||||
function sql_save($query, &$query_result, $ttl)
|
||||
public function sql_save($query, &$query_result, $ttl)
|
||||
{
|
||||
global $db, $phpEx;
|
||||
global $db;
|
||||
|
||||
// Remove extra spaces and tabs
|
||||
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
||||
$filename = $this->cache_dir . 'sql_' . md5($query) . '.' . $phpEx;
|
||||
$filename = $this->cache_dir . 'sql_' . md5($query) . '.' . PHP_EXT;
|
||||
|
||||
if ($fp = @fopen($filename, 'wb'))
|
||||
{
|
||||
@@ -401,7 +388,6 @@ class acm
|
||||
|
||||
$query_id = sizeof($this->sql_rowset);
|
||||
$this->sql_rowset[$query_id] = array();
|
||||
$this->sql_row_pointer[$query_id] = 0;
|
||||
|
||||
while ($row = $db->sql_fetchrow($query_result))
|
||||
{
|
||||
@@ -409,71 +395,48 @@ class acm
|
||||
}
|
||||
$db->sql_freeresult($query_result);
|
||||
|
||||
$file = "<?php\n\n/* " . str_replace('*/', '*\/', $query) . " */\n";
|
||||
$file = "<?php\n/* " . str_replace('*/', '*\/', $query) . " */";
|
||||
$file .= "\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n";
|
||||
|
||||
fwrite($fp, $file . "\n\$this->sql_rowset[\$query_id] = " . var_export($this->sql_rowset[$query_id], true) . ";\n?>");
|
||||
fwrite($fp, $file . "\$this->sql_rowset[\$query_id] = " . (sizeof($this->sql_rowset[$query_id]) ? "unserialize(" . var_export(serialize($this->sql_rowset[$query_id]), true) . ");" : 'array();'));
|
||||
@flock($fp, LOCK_UN);
|
||||
fclose($fp);
|
||||
|
||||
@chmod($filename, 0666);
|
||||
if (!function_exists('phpbb_chmod'))
|
||||
{
|
||||
include(PHPBB_ROOT_PATH . 'includes/functions.' . PHP_EXT);
|
||||
}
|
||||
|
||||
phpbb_chmod($filename, CHMOD_WRITE);
|
||||
|
||||
$query_result = $query_id;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ceck if a given sql query exist in cache
|
||||
*/
|
||||
function sql_exists($query_id)
|
||||
{
|
||||
return isset($this->sql_rowset[$query_id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch row from cache (database)
|
||||
*/
|
||||
function sql_fetchrow($query_id)
|
||||
public function sql_fetchrow($query_id)
|
||||
{
|
||||
if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id]))
|
||||
{
|
||||
return $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++];
|
||||
}
|
||||
list(, $row) = each($this->sql_rowset[$query_id]);
|
||||
|
||||
return false;
|
||||
return ($row !== NULL) ? $row : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a field from the current row of a cached database result (database)
|
||||
*/
|
||||
function sql_fetchfield($query_id, $field)
|
||||
public function sql_fetchfield($query_id, $field)
|
||||
{
|
||||
if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id]))
|
||||
{
|
||||
return (isset($this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field])) ? $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field] : false;
|
||||
}
|
||||
$row = current($this->sql_rowset[$query_id]);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Seek a specific row in an a cached database result (database)
|
||||
*/
|
||||
function sql_rowseek($rownum, $query_id)
|
||||
{
|
||||
if ($rownum >= sizeof($this->sql_rowset[$query_id]))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->sql_row_pointer[$query_id] = $rownum;
|
||||
return true;
|
||||
return ($row !== false && isset($row[$field])) ? $row[$field] : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Free memory used for a cached database result (database)
|
||||
*/
|
||||
function sql_freeresult($query_id)
|
||||
public function sql_freeresult($query_id)
|
||||
{
|
||||
if (!isset($this->sql_rowset[$query_id]))
|
||||
{
|
||||
@@ -481,7 +444,6 @@ class acm
|
||||
}
|
||||
|
||||
unset($this->sql_rowset[$query_id]);
|
||||
unset($this->sql_row_pointer[$query_id]);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -489,9 +451,9 @@ class acm
|
||||
/**
|
||||
* Removes/unlinks file
|
||||
*/
|
||||
function remove_file($filename, $check = false)
|
||||
private function remove_file($filename, $check = false)
|
||||
{
|
||||
if ($check && !@is_writeable($this->cache_dir))
|
||||
if ($check && !@is_writable($this->cache_dir))
|
||||
{
|
||||
// E_USER_ERROR - not using language entry - intended.
|
||||
trigger_error('Unable to remove files within ' . $this->cache_dir . '. Please check directory permissions.', E_USER_ERROR);
|
||||
|
322
phpBB/includes/acm/acm_memcache.php
Normal file
322
phpBB/includes/acm/acm_memcache.php
Normal file
@@ -0,0 +1,322 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package acm
|
||||
* @version $Id$
|
||||
* @copyright (c) 2005 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* ACM Memcache Based Caching
|
||||
* @package acm
|
||||
*/
|
||||
class acm
|
||||
{
|
||||
private $vars = array();
|
||||
private $is_modified = false;
|
||||
|
||||
public $sql_rowset = array();
|
||||
public $cache_dir = '';
|
||||
private $memcache;
|
||||
|
||||
/**
|
||||
* Set cache path
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
$this->memcache = memcache_connect('localhost', 11211);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load global cache
|
||||
*/
|
||||
private function load()
|
||||
{
|
||||
// grab the global cache
|
||||
if ($this->vars = memcache_get($this->memcache, 'global'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unload cache object
|
||||
*/
|
||||
public function unload()
|
||||
{
|
||||
$this->save();
|
||||
unset($this->vars);
|
||||
unset($this->sql_rowset);
|
||||
|
||||
$this->vars = array();
|
||||
$this->sql_rowset = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Save modified objects
|
||||
*/
|
||||
private function save()
|
||||
{
|
||||
if (!$this->is_modified)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
memcache_set($this->memcache, 'global', $this->vars, 0, 2592000);
|
||||
|
||||
$this->is_modified = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tidy cache
|
||||
*/
|
||||
public function tidy()
|
||||
{
|
||||
// cache has auto GC, no need to have any code here :)
|
||||
|
||||
set_config('cache_last_gc', time(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get saved cache object
|
||||
*/
|
||||
public function get($var_name)
|
||||
{
|
||||
if ($var_name[0] === '_')
|
||||
{
|
||||
return memcache_get($this->memcache, $var_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!sizeof($this->vars))
|
||||
{
|
||||
$this->load();
|
||||
}
|
||||
return (isset($this->vars[$var_name])) ? $this->vars[$var_name] : false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Put data into cache
|
||||
*/
|
||||
public function put($var_name, $var, $ttl = 31536000)
|
||||
{
|
||||
if ($var_name[0] === '_')
|
||||
{
|
||||
memcache_set($this->memcache, $var_name, $var, 0, $ttl);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->vars[$var_name] = $var;
|
||||
$this->is_modified = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Purge cache data
|
||||
*/
|
||||
public function purge()
|
||||
{
|
||||
// Purge all phpbb cache files
|
||||
$dir = @opendir($this->cache_dir);
|
||||
|
||||
if (!$dir)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
while (($entry = readdir($dir)) !== false)
|
||||
{
|
||||
if (strpos($entry, 'sql_') !== 0 && strpos($entry, 'data_') !== 0 && strpos($entry, 'ctpl_') !== 0 && strpos($entry, 'tpl_') !== 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@unlink($this->cache_dir . $entry);
|
||||
}
|
||||
closedir($dir);
|
||||
|
||||
memcache_flush($this->memcache);
|
||||
|
||||
unset($this->vars);
|
||||
unset($this->sql_rowset);
|
||||
|
||||
$this->vars = array();
|
||||
$this->var_expires = array();
|
||||
$this->sql_rowset = array();
|
||||
|
||||
$this->is_modified = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy cache data
|
||||
*/
|
||||
public function destroy($var_name, $table = '')
|
||||
{
|
||||
if ($var_name === 'sql' && !empty($table))
|
||||
{
|
||||
if (!is_array($table))
|
||||
{
|
||||
$table = array($table);
|
||||
}
|
||||
|
||||
foreach ($table as $table_name)
|
||||
{
|
||||
// gives us the md5s that we want
|
||||
$temp = memcache_get($this->memcache, 'sql_' . $table_name);
|
||||
if ($temp === false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// delete each query ref
|
||||
foreach ($temp as $md5_id => $void)
|
||||
{
|
||||
memcache_delete($this->memcache, 'sql_' . $md5_id);
|
||||
}
|
||||
|
||||
// delete the table ref
|
||||
memcache_delete($this->memcache, 'sql_' . $table_name);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($var_name[0] === '_')
|
||||
{
|
||||
memcache_delete($this->memcache, $var_name);
|
||||
}
|
||||
else if (isset($this->vars[$var_name]))
|
||||
{
|
||||
$this->is_modified = true;
|
||||
unset($this->vars[$var_name]);
|
||||
|
||||
// We save here to let the following cache hits succeed
|
||||
$this->save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load cached sql query
|
||||
*/
|
||||
public function sql_load($query)
|
||||
{
|
||||
// Remove extra spaces and tabs
|
||||
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
||||
$query_id = sizeof($this->sql_rowset);
|
||||
|
||||
$temp = memcache_get($this->memcache, 'sql_' . md5($query));
|
||||
|
||||
if ($temp === false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->sql_rowset[$query_id] = $temp;
|
||||
|
||||
|
||||
return $query_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save sql query
|
||||
*/
|
||||
public function sql_save($query, &$query_result, $ttl)
|
||||
{
|
||||
global $db;
|
||||
|
||||
// Remove extra spaces and tabs
|
||||
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
||||
|
||||
// determine which tables this query belongs to:
|
||||
|
||||
// grab all the FROM tables, avoid getting a LEFT JOIN
|
||||
preg_match('/FROM \(?(\w+(?: (?!LEFT JOIN)\w+)?(?:, ?\w+(?: (?!LEFT JOIN)\w+)?)*)\)?/', $query, $regs);
|
||||
$tables = array_map('trim', explode(',', $regs[1]));
|
||||
|
||||
// now get the LEFT JOIN
|
||||
preg_match_all('/LEFT JOIN\s+(\w+)(?: \w+)?/', $query, $result, PREG_PATTERN_ORDER);
|
||||
$tables = array_merge($tables, $result[1]);
|
||||
|
||||
$query_hash = md5($query);
|
||||
|
||||
foreach ($tables as $table_name)
|
||||
{
|
||||
if (($pos = strpos($table_name, ' ')) !== false)
|
||||
{
|
||||
$table_name = substr($table_name, 0, $pos);
|
||||
}
|
||||
|
||||
$temp = memcache_get($this->memcache, 'sql_' . $table_name);
|
||||
if ($temp === false)
|
||||
{
|
||||
$temp = array();
|
||||
}
|
||||
$temp[$query_hash] = true;
|
||||
memcache_set($this->memcache, 'sql_' . $table_name, $temp, 0, $ttl);
|
||||
}
|
||||
|
||||
// store them in the right place
|
||||
$query_id = sizeof($this->sql_rowset);
|
||||
$this->sql_rowset[$query_id] = array();
|
||||
|
||||
while ($row = $db->sql_fetchrow($query_result))
|
||||
{
|
||||
$this->sql_rowset[$query_id][] = $row;
|
||||
}
|
||||
$db->sql_freeresult($query_result);
|
||||
|
||||
memcache_set($this->memcache, 'sql_' . $query_hash, $this->sql_rowset[$query_id], 0, $ttl);
|
||||
|
||||
$query_result = $query_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch row from cache (database)
|
||||
*/
|
||||
public function sql_fetchrow($query_id)
|
||||
{
|
||||
list(, $row) = each($this->sql_rowset[$query_id]);
|
||||
|
||||
return ($row !== NULL) ? $row : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a field from the current row of a cached database result (database)
|
||||
*/
|
||||
public function sql_fetchfield($query_id, $field)
|
||||
{
|
||||
$row = current($this->sql_rowset[$query_id]);
|
||||
|
||||
return ($row !== false && isset($row[$field])) ? $row[$field] : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Free memory used for a cached database result (database)
|
||||
*/
|
||||
public function sql_freeresult($query_id)
|
||||
{
|
||||
if (!isset($this->sql_rowset[$query_id]))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
unset($this->sql_rowset[$query_id]);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
329
phpBB/includes/acm/acm_xcache.php
Normal file
329
phpBB/includes/acm/acm_xcache.php
Normal file
@@ -0,0 +1,329 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package acm
|
||||
* @version $Id$
|
||||
* @copyright (c) 2005 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* ACM XCache Based Caching
|
||||
* @package acm
|
||||
*/
|
||||
class acm
|
||||
{
|
||||
private $vars = array();
|
||||
private $is_modified = false;
|
||||
|
||||
public $sql_rowset = array();
|
||||
public $cache_dir = '';
|
||||
|
||||
/**
|
||||
* Set cache path
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
$this->cache_dir = PHPBB_ROOT_PATH . 'cache/';
|
||||
}
|
||||
|
||||
/**
|
||||
* Load global cache
|
||||
*/
|
||||
private function load()
|
||||
{
|
||||
// grab the global cache
|
||||
if (xcache_isset('global'))
|
||||
{
|
||||
$this->vars = xcache_get('global');
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unload cache object
|
||||
*/
|
||||
public function unload()
|
||||
{
|
||||
$this->save();
|
||||
unset($this->vars);
|
||||
unset($this->sql_rowset);
|
||||
|
||||
$this->vars = array();
|
||||
$this->sql_rowset = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Save modified objects
|
||||
*/
|
||||
private function save()
|
||||
{
|
||||
if (!$this->is_modified)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
xcache_set('global', $this->vars, 31536000);
|
||||
|
||||
$this->is_modified = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tidy cache
|
||||
*/
|
||||
public function tidy()
|
||||
{
|
||||
// cache has auto GC, no need to have any code here :)
|
||||
|
||||
set_config('cache_last_gc', time(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get saved cache object
|
||||
*/
|
||||
public function get($var_name)
|
||||
{
|
||||
if ($var_name[0] === '_')
|
||||
{
|
||||
return (xcache_isset($var_name)) ? xcache_get($var_name) : false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!sizeof($this->vars))
|
||||
{
|
||||
$this->load();
|
||||
}
|
||||
return (isset($this->vars[$var_name])) ? $this->vars[$var_name] : false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Put data into cache
|
||||
*/
|
||||
public function put($var_name, $var, $ttl = 31536000)
|
||||
{
|
||||
if ($var_name[0] === '_')
|
||||
{
|
||||
xcache_set($var_name, $var, $ttl);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->vars[$var_name] = $var;
|
||||
$this->is_modified = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Purge cache data
|
||||
*/
|
||||
public function purge()
|
||||
{
|
||||
// Purge all phpbb cache files
|
||||
$dir = @opendir($this->cache_dir);
|
||||
|
||||
if (!$dir)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
while (($entry = readdir($dir)) !== false)
|
||||
{
|
||||
if (strpos($entry, 'sql_') !== 0 && strpos($entry, 'data_') !== 0 && strpos($entry, 'ctpl_') !== 0 && strpos($entry, 'tpl_') !== 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@unlink($this->cache_dir . $entry);
|
||||
}
|
||||
closedir($dir);
|
||||
|
||||
$n = xcache_count(XC_TYPE_VAR);
|
||||
for ($i = 0; $i < $n; $i++)
|
||||
{
|
||||
xcache_clear_cache(XC_TYPE_VAR, $i);
|
||||
}
|
||||
|
||||
unset($this->vars);
|
||||
unset($this->sql_rowset);
|
||||
|
||||
$this->vars = array();
|
||||
$this->var_expires = array();
|
||||
$this->sql_rowset = array();
|
||||
|
||||
$this->is_modified = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy cache data
|
||||
*/
|
||||
public function destroy($var_name, $table = '')
|
||||
{
|
||||
if ($var_name === 'sql' && !empty($table))
|
||||
{
|
||||
if (!is_array($table))
|
||||
{
|
||||
$table = array($table);
|
||||
}
|
||||
|
||||
foreach ($table as $table_name)
|
||||
{
|
||||
// gives us the md5s that we want
|
||||
if (!xcache_isset('sql_' . $table_name))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$temp = xcache_get('sql_' . $table_name);
|
||||
|
||||
// delete each query ref
|
||||
foreach ($temp as $md5_id => $void)
|
||||
{
|
||||
xcache_unset('sql_' . $md5_id);
|
||||
}
|
||||
|
||||
// delete the table ref
|
||||
xcache_unset('sql_' . $table_name);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($var_name[0] === '_')
|
||||
{
|
||||
xcache_unset($var_name);
|
||||
}
|
||||
else if (isset($this->vars[$var_name]))
|
||||
{
|
||||
$this->is_modified = true;
|
||||
unset($this->vars[$var_name]);
|
||||
|
||||
// We save here to let the following cache hits succeed
|
||||
$this->save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load cached sql query
|
||||
*/
|
||||
public function sql_load($query)
|
||||
{
|
||||
// Remove extra spaces and tabs
|
||||
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
||||
$query_id = sizeof($this->sql_rowset);
|
||||
|
||||
$query_hash = md5($query);
|
||||
|
||||
if (!xcache_isset('sql_' . $query_hash))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->sql_rowset[$query_id] = xcache_get('sql_' . $query_hash);
|
||||
|
||||
|
||||
return $query_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save sql query
|
||||
*/
|
||||
public function sql_save($query, &$query_result, $ttl)
|
||||
{
|
||||
global $db;
|
||||
|
||||
// Remove extra spaces and tabs
|
||||
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
||||
|
||||
// determine which tables this query belongs to:
|
||||
|
||||
// grab all the FROM tables, avoid getting a LEFT JOIN
|
||||
preg_match('/FROM \(?(\w+(?: (?!LEFT JOIN)\w+)?(?:, ?\w+(?: (?!LEFT JOIN)\w+)?)*)\)?/', $query, $regs);
|
||||
$tables = array_map('trim', explode(',', $regs[1]));
|
||||
|
||||
// now get the LEFT JOIN
|
||||
preg_match_all('/LEFT JOIN\s+(\w+)(?: \w+)?/', $query, $result, PREG_PATTERN_ORDER);
|
||||
$tables = array_merge($tables, $result[1]);
|
||||
|
||||
$query_hash = md5($query);
|
||||
|
||||
foreach ($tables as $table_name)
|
||||
{
|
||||
if (($pos = strpos($table_name, ' ')) !== false)
|
||||
{
|
||||
$table_name = substr($table_name, 0, $pos);
|
||||
}
|
||||
|
||||
if (xcache_isset('sql_' . $table_name))
|
||||
{
|
||||
$temp = xcache_get('sql_' . $table_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
$temp = array();
|
||||
}
|
||||
$temp[$query_hash] = true;
|
||||
xcache_set('sql_' . $table_name, $temp, $ttl);
|
||||
}
|
||||
|
||||
// store them in the right place
|
||||
$query_id = sizeof($this->sql_rowset);
|
||||
$this->sql_rowset[$query_id] = array();
|
||||
|
||||
while ($row = $db->sql_fetchrow($query_result))
|
||||
{
|
||||
$this->sql_rowset[$query_id][] = $row;
|
||||
}
|
||||
$db->sql_freeresult($query_result);
|
||||
|
||||
xcache_set('sql_' . $query_hash, $this->sql_rowset[$query_id], $ttl);
|
||||
|
||||
$query_result = $query_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch row from cache (database)
|
||||
*/
|
||||
public function sql_fetchrow($query_id)
|
||||
{
|
||||
list(, $row) = each($this->sql_rowset[$query_id]);
|
||||
|
||||
return ($row !== NULL) ? $row : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a field from the current row of a cached database result (database)
|
||||
*/
|
||||
public function sql_fetchfield($query_id, $field)
|
||||
{
|
||||
$row = current($this->sql_rowset[$query_id]);
|
||||
|
||||
return ($row !== false && isset($row[$field])) ? $row[$field] : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Free memory used for a cached database result (database)
|
||||
*/
|
||||
public function sql_freeresult($query_id)
|
||||
{
|
||||
if (!isset($this->sql_rowset[$query_id]))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
unset($this->sql_rowset[$query_id]);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@@ -26,13 +26,12 @@ class acp_attachments
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache;
|
||||
global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
|
||||
global $db, $user, $auth, $template, $cache, $config;
|
||||
|
||||
$user->add_lang(array('posting', 'viewtopic', 'acp/attachments'));
|
||||
|
||||
$error = $notify = array();
|
||||
$submit = (isset($_POST['submit'])) ? true : false;
|
||||
$submit = request::is_set_post('submit');
|
||||
$action = request_var('action', '');
|
||||
|
||||
$form_key = 'acp_attach';
|
||||
@@ -79,7 +78,7 @@ class acp_attachments
|
||||
{
|
||||
case 'attach':
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
|
||||
|
||||
$sql = 'SELECT group_name, cat_id
|
||||
FROM ' . EXTENSION_GROUPS_TABLE . '
|
||||
@@ -99,13 +98,9 @@ class acp_attachments
|
||||
$display_vars = array(
|
||||
'title' => 'ACP_ATTACHMENT_SETTINGS',
|
||||
'vars' => array(
|
||||
'img_max_width' => false, 'img_max_height' => false, 'img_link_width' => false, 'img_link_height' => false,
|
||||
|
||||
'legend1' => 'ACP_ATTACHMENT_SETTINGS',
|
||||
|
||||
'img_max_width' => array('lang' => 'MAX_IMAGE_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
|
||||
'img_max_height' => array('lang' => 'MAX_IMAGE_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
|
||||
'img_link_width' => array('lang' => 'IMAGE_LINK_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
|
||||
'img_link_height' => array('lang' => 'IMAGE_LINK_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
|
||||
|
||||
'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
'upload_path' => array('lang' => 'UPLOAD_DIR', 'validate' => 'wpath', 'type' => 'text:25:100', 'explain' => true),
|
||||
@@ -117,7 +112,9 @@ class acp_attachments
|
||||
'max_attachments_pm' => array('lang' => 'MAX_ATTACHMENTS_PM', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => false),
|
||||
'secure_downloads' => array('lang' => 'SECURE_DOWNLOADS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'secure_allow_deny' => array('lang' => 'SECURE_ALLOW_DENY', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_allow_deny', 'explain' => true),
|
||||
'secure_allow_empty_referer' => array('lang' => 'SECURE_EMPTY_REFERRER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'secure_allow_empty_referer' => array('lang' => 'SECURE_EMPTY_REFERRER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'check_attachment_content' => array('lang' => 'CHECK_CONTENT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
|
||||
|
||||
'legend2' => $l_legend_cat_images,
|
||||
'img_display_inlined' => array('lang' => 'DISPLAY_INLINED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
@@ -131,7 +128,7 @@ class acp_attachments
|
||||
);
|
||||
|
||||
$this->new_config = $config;
|
||||
$cfg_array = (isset($_REQUEST['config'])) ? request_var('config', array('' => '')) : $this->new_config;
|
||||
$cfg_array = (request::is_set('config')) ? request_var('config', array('' => '')) : $this->new_config;
|
||||
$error = array();
|
||||
|
||||
// We validate the complete config if whished
|
||||
@@ -156,7 +153,7 @@ class acp_attachments
|
||||
if (in_array($config_name, array('attachment_quota', 'max_filesize', 'max_filesize_pm')))
|
||||
{
|
||||
$size_var = request_var($config_name, '');
|
||||
$this->new_config[$config_name] = $config_value = ($size_var == 'kb') ? ($config_value << 10) : (($size_var == 'mb') ? ($config_value << 20) : $config_value);
|
||||
$this->new_config[$config_name] = $config_value = ($size_var == 'kb') ? round($config_value * 1024) : (($size_var == 'mb') ? round($config_value * 1048576) : $config_value);
|
||||
}
|
||||
|
||||
if ($submit)
|
||||
@@ -277,13 +274,19 @@ class acp_attachments
|
||||
{
|
||||
$l_explain = (isset($user->lang[$vars['lang'] . '_EXPLAIN'])) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : '';
|
||||
}
|
||||
|
||||
$content = build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars);
|
||||
if (empty($content))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$template->assign_block_vars('options', array(
|
||||
'KEY' => $config_key,
|
||||
'TITLE' => $user->lang[$vars['lang']],
|
||||
'S_EXPLAIN' => $vars['explain'],
|
||||
'TITLE_EXPLAIN' => $l_explain,
|
||||
'CONTENT' => build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars),
|
||||
'CONTENT' => $content,
|
||||
)
|
||||
);
|
||||
|
||||
@@ -294,7 +297,7 @@ class acp_attachments
|
||||
|
||||
case 'extensions':
|
||||
|
||||
if ($submit || isset($_POST['add_extension_check']))
|
||||
if ($submit || request::is_set_post('add_extension_check'))
|
||||
{
|
||||
if ($submit)
|
||||
{
|
||||
@@ -358,7 +361,7 @@ class acp_attachments
|
||||
// Add Extension?
|
||||
$add_extension = strtolower(request_var('add_extension', ''));
|
||||
$add_extension_group = request_var('add_group_select', 0);
|
||||
$add = (isset($_POST['add_extension_check'])) ? true : false;
|
||||
$add = request::is_set_post('add_extension_check');
|
||||
|
||||
if ($add_extension && $add)
|
||||
{
|
||||
@@ -399,7 +402,7 @@ class acp_attachments
|
||||
$template->assign_vars(array(
|
||||
'S_EXTENSIONS' => true,
|
||||
'ADD_EXTENSION' => (isset($add_extension)) ? $add_extension : '',
|
||||
'GROUP_SELECT_OPTIONS' => (isset($_POST['add_extension_check'])) ? $this->group_select('add_group_select', $add_extension_group, 'extension_group') : $this->group_select('add_group_select', false, 'extension_group'))
|
||||
'GROUP_SELECT_OPTIONS' => (request::is_set_post('add_extension_check')) ? $this->group_select('add_group_select', $add_extension_group, 'extension_group') : $this->group_select('add_group_select', false, 'extension_group'))
|
||||
);
|
||||
|
||||
$sql = 'SELECT *
|
||||
@@ -483,14 +486,21 @@ class acp_attachments
|
||||
// Check New Group Name
|
||||
if ($new_group_name)
|
||||
{
|
||||
$sql = 'SELECT group_id
|
||||
FROM ' . EXTENSION_GROUPS_TABLE . "
|
||||
WHERE LOWER(group_name) = '" . $db->sql_escape(utf8_strtolower($new_group_name)) . "'";
|
||||
$sql = 'SELECT group_name
|
||||
FROM ' . EXTENSION_GROUPS_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
$ext_row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if ($db->sql_fetchrow($result))
|
||||
$clean_group_name = utf8_clean_string($new_group_name);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$error[] = sprintf($user->lang['EXTENSION_GROUP_EXIST'], $new_group_name);
|
||||
if (utf8_clean_string($row['group_name']) === $clean_group_name)
|
||||
{
|
||||
$error[] = sprintf($user->lang['EXTENSION_GROUP_EXIST'], $new_group_name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
@@ -502,10 +512,10 @@ class acp_attachments
|
||||
$size_select = request_var('size_select', 'b');
|
||||
$forum_select = request_var('forum_select', false);
|
||||
$allowed_forums = request_var('allowed_forums', array(0));
|
||||
$allow_in_pm = (isset($_POST['allow_in_pm'])) ? true : false;
|
||||
$allow_in_pm = request::is_set_post('allow_in_pm');
|
||||
$max_filesize = request_var('max_filesize', 0);
|
||||
$max_filesize = ($size_select == 'kb') ? ($max_filesize << 10) : (($size_select == 'mb') ? ($max_filesize << 20) : $max_filesize);
|
||||
$allow_group = (isset($_POST['allow_group'])) ? true : false;
|
||||
$max_filesize = ($size_select == 'kb') ? round($max_filesize * 1024) : (($size_select == 'mb') ? round($max_filesize * 1048576) : $max_filesize);
|
||||
$allow_group = request::is_set_post('allow_group');
|
||||
|
||||
if ($max_filesize == $config['max_filesize'])
|
||||
{
|
||||
@@ -532,6 +542,7 @@ class acp_attachments
|
||||
$group_ary['download_mode'] = INLINE_LINK;
|
||||
}
|
||||
|
||||
// @TODO: rewrite with the new param db functions
|
||||
$sql = ($action == 'add') ? 'INSERT INTO ' . EXTENSION_GROUPS_TABLE . ' ' : 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' SET ';
|
||||
$sql .= $db->sql_build_array((($action == 'add') ? 'INSERT' : 'UPDATE'), $group_ary);
|
||||
$sql .= ($action == 'edit') ? " WHERE group_id = $group_id" : '';
|
||||
@@ -582,7 +593,7 @@ class acp_attachments
|
||||
);
|
||||
|
||||
$group_id = request_var('g', 0);
|
||||
$action = (isset($_POST['add'])) ? 'add' : $action;
|
||||
$action = request::is_set_post('add');
|
||||
|
||||
switch ($action)
|
||||
{
|
||||
@@ -684,7 +695,7 @@ class acp_attachments
|
||||
$filename_list = '';
|
||||
$no_image_select = false;
|
||||
|
||||
$imglist = filelist($phpbb_root_path . $img_path);
|
||||
$imglist = filelist(PHPBB_ROOT_PATH . $img_path);
|
||||
|
||||
if (sizeof($imglist))
|
||||
{
|
||||
@@ -730,14 +741,14 @@ class acp_attachments
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'PHPBB_ROOT_PATH' => $phpbb_root_path,
|
||||
'PHPBB_ROOT_PATH' => PHPBB_ROOT_PATH,
|
||||
'IMG_PATH' => $img_path,
|
||||
'ACTION' => $action,
|
||||
'GROUP_ID' => $group_id,
|
||||
'GROUP_NAME' => $ext_group_row['group_name'],
|
||||
'ALLOW_GROUP' => $ext_group_row['allow_group'],
|
||||
'ALLOW_IN_PM' => $ext_group_row['allow_in_pm'],
|
||||
'UPLOAD_ICON_SRC' => $phpbb_root_path . $img_path . '/' . $ext_group_row['upload_icon'],
|
||||
'UPLOAD_ICON_SRC' => PHPBB_ROOT_PATH . $img_path . '/' . $ext_group_row['upload_icon'],
|
||||
'EXTGROUP_FILESIZE' => $ext_group_row['max_filesize'],
|
||||
'ASSIGNED_EXTENSIONS' => $assigned_extensions,
|
||||
|
||||
@@ -749,7 +760,7 @@ class acp_attachments
|
||||
'S_NO_IMAGE' => $no_image_select,
|
||||
'S_FORUM_IDS' => (sizeof($forum_ids)) ? true : false,
|
||||
|
||||
'U_EXTENSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=extensions"),
|
||||
'U_EXTENSIONS' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=$id&mode=extensions"),
|
||||
'U_BACK' => $this->u_action,
|
||||
|
||||
'L_LEGEND' => $user->lang[strtoupper($action) . '_EXTENSION_GROUP'])
|
||||
@@ -757,6 +768,8 @@ class acp_attachments
|
||||
|
||||
$s_forum_id_options = '';
|
||||
|
||||
/** @todo use in-built function **/
|
||||
|
||||
$sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
ORDER BY left_id ASC';
|
||||
@@ -787,7 +800,7 @@ class acp_attachments
|
||||
}
|
||||
else if ($row['left_id'] > $right + 1)
|
||||
{
|
||||
$padding = $padding_store[$row['parent_id']];
|
||||
$padding = empty($padding_store[$row['parent_id']]) ? '' : $padding_store[$row['parent_id']];
|
||||
}
|
||||
|
||||
$right = $row['right_id'];
|
||||
@@ -863,8 +876,8 @@ class acp_attachments
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
$delete_files = (isset($_POST['delete'])) ? array_keys(request_var('delete', array('' => 0))) : array();
|
||||
$add_files = (isset($_POST['add'])) ? array_keys(request_var('add', array('' => 0))) : array();
|
||||
$delete_files = array_keys(request::variable('delete', array('' => 0), false, request::POST));
|
||||
$add_files = array_keys(request::variable('add', array('' => 0), false, request::POST));
|
||||
$post_ids = request_var('post_id', array('' => 0));
|
||||
|
||||
if (sizeof($delete_files))
|
||||
@@ -1020,7 +1033,7 @@ class acp_attachments
|
||||
'PHYSICAL_FILENAME' => basename($row['physical_filename']),
|
||||
'ATTACH_ID' => $row['attach_id'],
|
||||
'POST_IDS' => (!empty($post_ids[$row['attach_id']])) ? $post_ids[$row['attach_id']] : '',
|
||||
'U_FILE' => append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'mode=view&id=' . $row['attach_id']))
|
||||
'U_FILE' => append_sid('download/file', 'mode=view&id=' . $row['attach_id']))
|
||||
);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
@@ -1160,7 +1173,7 @@ class acp_attachments
|
||||
$location .= '/';
|
||||
}
|
||||
|
||||
if (@is_readable($location . 'mogrify' . $exe) && @filesize($location . 'mogrify' . $exe) > 3000)
|
||||
if (@file_exists($location) && @is_readable($location . 'mogrify' . $exe) && @filesize($location . 'mogrify' . $exe) > 3000)
|
||||
{
|
||||
$imagick = str_replace('\\', '/', $location);
|
||||
continue;
|
||||
@@ -1180,31 +1193,31 @@ class acp_attachments
|
||||
*/
|
||||
function test_upload(&$error, $upload_dir, $create_directory = false)
|
||||
{
|
||||
global $user, $phpbb_root_path;
|
||||
global $user;
|
||||
|
||||
// Does the target directory exist, is it a directory and writable.
|
||||
if ($create_directory)
|
||||
{
|
||||
if (!file_exists($phpbb_root_path . $upload_dir))
|
||||
if (!file_exists(PHPBB_ROOT_PATH . $upload_dir))
|
||||
{
|
||||
@mkdir($phpbb_root_path . $upload_dir, 0777);
|
||||
@chmod($phpbb_root_path . $upload_dir, 0777);
|
||||
@mkdir(PHPBB_ROOT_PATH . $upload_dir, 0777);
|
||||
phpbb_chmod(PHPBB_ROOT_PATH . $upload_dir, CHMOD_READ | CHMOD_WRITE);
|
||||
}
|
||||
}
|
||||
|
||||
if (!file_exists($phpbb_root_path . $upload_dir))
|
||||
if (!file_exists(PHPBB_ROOT_PATH . $upload_dir))
|
||||
{
|
||||
$error[] = sprintf($user->lang['NO_UPLOAD_DIR'], $upload_dir);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_dir($phpbb_root_path . $upload_dir))
|
||||
if (!is_dir(PHPBB_ROOT_PATH . $upload_dir))
|
||||
{
|
||||
$error[] = sprintf($user->lang['UPLOAD_NOT_DIR'], $upload_dir);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_writable($phpbb_root_path . $upload_dir))
|
||||
if (!is_writable(PHPBB_ROOT_PATH . $upload_dir))
|
||||
{
|
||||
$error[] = sprintf($user->lang['NO_WRITE_UPLOAD'], $upload_dir);
|
||||
return;
|
||||
@@ -1218,14 +1231,14 @@ class acp_attachments
|
||||
{
|
||||
global $db, $user;
|
||||
|
||||
if (isset($_REQUEST['securesubmit']))
|
||||
if (request::is_set('securesubmit'))
|
||||
{
|
||||
// Grab the list of entries
|
||||
$ips = request_var('ips', '');
|
||||
$ip_list = array_unique(explode("\n", $ips));
|
||||
$ip_list_log = implode(', ', $ip_list);
|
||||
|
||||
$ip_exclude = (!empty($_POST['ipexclude'])) ? 1 : 0;
|
||||
$ip_exclude = (int) request::variable('ipexclude', false, false, request::POST);
|
||||
|
||||
$iplist = array();
|
||||
$hostlist = array();
|
||||
@@ -1372,7 +1385,7 @@ class acp_attachments
|
||||
|
||||
trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS'] . adm_back_link($this->u_action));
|
||||
}
|
||||
else if (isset($_POST['unsecuresubmit']))
|
||||
else if (request::is_set_post('unsecuresubmit'))
|
||||
{
|
||||
$unip_sql = request_var('unip', array(0));
|
||||
|
||||
|
@@ -26,12 +26,11 @@ class acp_ban
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template, $cache;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
|
||||
|
||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||
include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||
|
||||
$bansubmit = (isset($_POST['bansubmit'])) ? true : false;
|
||||
$unbansubmit = (isset($_POST['unbansubmit'])) ? true : false;
|
||||
$bansubmit = request::is_set_post('bansubmit');
|
||||
$unbansubmit = request::is_set_post('unbansubmit');
|
||||
$current_time = time();
|
||||
|
||||
$user->add_lang(array('acp/ban', 'acp/users'));
|
||||
@@ -98,7 +97,7 @@ class acp_ban
|
||||
break;
|
||||
}
|
||||
|
||||
$this->display_ban_options($mode);
|
||||
self::display_ban_options($mode);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'L_TITLE' => $this->page_title,
|
||||
@@ -112,14 +111,14 @@ class acp_ban
|
||||
'S_USERNAME_BAN' => ($mode == 'user') ? true : false,
|
||||
|
||||
'U_ACTION' => $this->u_action,
|
||||
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=acp_ban&field=ban'),
|
||||
'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=acp_ban&field=ban'),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display ban options
|
||||
*/
|
||||
function display_ban_options($mode)
|
||||
static function display_ban_options($mode)
|
||||
{
|
||||
global $user, $db, $template;
|
||||
|
||||
|
@@ -25,8 +25,7 @@ class acp_bbcodes
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $user, $auth, $template, $cache, $config;
|
||||
|
||||
$user->add_lang('acp/posting');
|
||||
|
||||
@@ -168,6 +167,12 @@ class acp_bbcodes
|
||||
{
|
||||
trigger_error($user->lang['BBCODE_TAG_DEF_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
|
||||
if (strlen($bbcode_helpline) > 255)
|
||||
{
|
||||
trigger_error($user->lang['BBCODE_HELPLINE_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$sql_ary = array(
|
||||
'bbcode_tag' => $data['bbcode_tag'],
|
||||
|
@@ -27,13 +27,12 @@ class acp_board
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $user, $auth, $template, $config;
|
||||
|
||||
$user->add_lang('acp/board');
|
||||
|
||||
$action = request_var('action', '');
|
||||
$submit = (isset($_POST['submit'])) ? true : false;
|
||||
$submit = request::is_set_post('submit');
|
||||
|
||||
$form_key = 'acp_board';
|
||||
add_form_key($form_key);
|
||||
@@ -102,11 +101,7 @@ class acp_board
|
||||
'title' => 'ACP_AVATAR_SETTINGS',
|
||||
'vars' => array(
|
||||
'legend1' => 'ACP_AVATAR_SETTINGS',
|
||||
|
||||
'avatar_min_width' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
|
||||
'avatar_min_height' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
|
||||
'avatar_max_width' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
|
||||
'avatar_max_height' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
|
||||
'avatar_min_height' => false, 'avatar_min_width' => false, 'avatar_max_height' => false, 'avatar_max_width' => false,
|
||||
|
||||
'allow_avatar_local' => array('lang' => 'ALLOW_LOCAL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
'allow_avatar_remote' => array('lang' => 'ALLOW_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
@@ -131,6 +126,7 @@ class acp_board
|
||||
'pm_max_msgs' => array('lang' => 'BOXES_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true),
|
||||
'full_folder_action' => array('lang' => 'FULL_FOLDER_ACTION', 'validate' => 'int', 'type' => 'select', 'method' => 'full_folder_select', 'explain' => true),
|
||||
'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
|
||||
'pm_max_recipients' => array('lang' => 'PM_MAX_RECIPIENTS', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true),
|
||||
|
||||
'legend2' => 'GENERAL_OPTIONS',
|
||||
'allow_mass_pm' => array('lang' => 'ALLOW_MASS_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
@@ -163,22 +159,24 @@ class acp_board
|
||||
'enable_post_confirm' => array('lang' => 'VISUAL_CONFIRM_POST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
|
||||
'legend2' => 'POSTING',
|
||||
'enable_queue_trigger' => array('lang' => 'ENABLE_QUEUE_TRIGGER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'queue_trigger_posts' => array('lang' => 'QUEUE_TRIGGER_POSTS', 'validate' => 'int:0:250', 'type' => 'text:4:4', 'explain' => true),
|
||||
'bump_type' => false,
|
||||
'edit_time' => array('lang' => 'EDIT_TIME', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
|
||||
'display_last_edited' => array('lang' => 'DISPLAY_LAST_EDITED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'flood_interval' => array('lang' => 'FLOOD_INTERVAL', 'validate' => 'int:0', 'type' => 'text:3:10', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
|
||||
'bump_interval' => array('lang' => 'BUMP_INTERVAL', 'validate' => 'int:0', 'type' => 'custom', 'method' => 'bump_interval', 'explain' => true),
|
||||
'topics_per_page' => array('lang' => 'TOPICS_PER_PAGE', 'validate' => 'int:1', 'type' => 'text:3:4', 'explain' => false),
|
||||
'posts_per_page' => array('lang' => 'POSTS_PER_PAGE', 'validate' => 'int:1', 'type' => 'text:3:4', 'explain' => false),
|
||||
'hot_threshold' => array('lang' => 'HOT_THRESHOLD', 'validate' => 'int:0', 'type' => 'text:3:4', 'explain' => true),
|
||||
'max_poll_options' => array('lang' => 'MAX_POLL_OPTIONS', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => false),
|
||||
'max_post_chars' => array('lang' => 'CHAR_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:6', 'explain' => true),
|
||||
'max_post_smilies' => array('lang' => 'SMILIES_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true),
|
||||
'max_post_urls' => array('lang' => 'MAX_POST_URLS', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true),
|
||||
'max_post_font_size' => array('lang' => 'MAX_POST_FONT_SIZE', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' %'),
|
||||
'max_quote_depth' => array('lang' => 'QUOTE_DEPTH_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true),
|
||||
'max_post_img_width' => array('lang' => 'MAX_POST_IMG_WIDTH', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
|
||||
'max_post_img_height' => array('lang' => 'MAX_POST_IMG_HEIGHT', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
|
||||
'edit_time' => array('lang' => 'EDIT_TIME', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
|
||||
'display_last_edited' => array('lang' => 'DISPLAY_LAST_EDITED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'flood_interval' => array('lang' => 'FLOOD_INTERVAL', 'validate' => 'int:0', 'type' => 'text:3:10', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
|
||||
'bump_interval' => array('lang' => 'BUMP_INTERVAL', 'validate' => 'int:0', 'type' => 'custom', 'method' => 'bump_interval', 'explain' => true),
|
||||
'topics_per_page' => array('lang' => 'TOPICS_PER_PAGE', 'validate' => 'int:1', 'type' => 'text:3:4', 'explain' => false),
|
||||
'posts_per_page' => array('lang' => 'POSTS_PER_PAGE', 'validate' => 'int:1', 'type' => 'text:3:4', 'explain' => false),
|
||||
'hot_threshold' => array('lang' => 'HOT_THRESHOLD', 'validate' => 'int:0', 'type' => 'text:3:4', 'explain' => true),
|
||||
'max_poll_options' => array('lang' => 'MAX_POLL_OPTIONS', 'validate' => 'int:2:127', 'type' => 'text:4:4', 'explain' => false),
|
||||
'max_post_chars' => array('lang' => 'CHAR_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:6', 'explain' => true),
|
||||
'max_post_smilies' => array('lang' => 'SMILIES_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true),
|
||||
'max_post_urls' => array('lang' => 'MAX_POST_URLS', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true),
|
||||
'max_post_font_size' => array('lang' => 'MAX_POST_FONT_SIZE', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' %'),
|
||||
'max_quote_depth' => array('lang' => 'QUOTE_DEPTH_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true),
|
||||
'max_post_img_width' => array('lang' => 'MAX_POST_IMG_WIDTH', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
|
||||
'max_post_img_height' => array('lang' => 'MAX_POST_IMG_HEIGHT', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
|
||||
)
|
||||
);
|
||||
break;
|
||||
@@ -323,6 +321,7 @@ class acp_board
|
||||
'ip_check' => array('lang' => 'IP_VALID', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_ip_check', 'explain' => true),
|
||||
'browser_check' => array('lang' => 'BROWSER_VALID', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'forwarded_for_check' => array('lang' => 'FORWARDED_FOR_VALID', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'referer_validation' => array('lang' => 'REFERER_VALID', 'validate' => 'int:0:3','type' => 'custom', 'method' => 'select_ref_check', 'explain' => true),
|
||||
'check_dnsbl' => array('lang' => 'CHECK_DNSBL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'email_check_mx' => array('lang' => 'EMAIL_CHECK_MX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true),
|
||||
@@ -372,7 +371,7 @@ class acp_board
|
||||
}
|
||||
|
||||
$this->new_config = $config;
|
||||
$cfg_array = (isset($_REQUEST['config'])) ? utf8_normalize_nfc(request_var('config', array('' => ''), true)) : $this->new_config;
|
||||
$cfg_array = (request::is_set('config')) ? utf8_normalize_nfc(request_var('config', array('' => ''), true)) : $this->new_config;
|
||||
$error = array();
|
||||
|
||||
// We validate the complete config if whished
|
||||
@@ -421,15 +420,15 @@ class acp_board
|
||||
// Retrieve a list of auth plugins and check their config values
|
||||
$auth_plugins = array();
|
||||
|
||||
$dp = @opendir($phpbb_root_path . 'includes/auth');
|
||||
$dp = @opendir(PHPBB_ROOT_PATH . 'includes/auth');
|
||||
|
||||
if ($dp)
|
||||
{
|
||||
while (($file = readdir($dp)) !== false)
|
||||
{
|
||||
if (preg_match('#^auth_(.*?)\.' . $phpEx . '$#', $file))
|
||||
if (preg_match('#^auth_(.*?)\.' . PHP_EXT . '$#', $file))
|
||||
{
|
||||
$auth_plugins[] = basename(preg_replace('#^auth_(.*?)\.' . $phpEx . '$#', '\1', $file));
|
||||
$auth_plugins[] = basename(preg_replace('#^auth_(.*?)\.' . PHP_EXT . '$#', '\1', $file));
|
||||
}
|
||||
}
|
||||
closedir($dp);
|
||||
@@ -441,9 +440,9 @@ class acp_board
|
||||
$old_auth_config = array();
|
||||
foreach ($auth_plugins as $method)
|
||||
{
|
||||
if ($method && file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx))
|
||||
if ($method && file_exists(PHPBB_ROOT_PATH . 'includes/auth/auth_' . $method . '.' . PHP_EXT))
|
||||
{
|
||||
include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/auth/auth_' . $method . '.' . PHP_EXT);
|
||||
|
||||
$method = 'acp_' . $method;
|
||||
if (function_exists($method))
|
||||
@@ -484,7 +483,7 @@ class acp_board
|
||||
$method = basename($cfg_array['auth_method']);
|
||||
if ($method && in_array($method, $auth_plugins))
|
||||
{
|
||||
include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/auth/auth_' . $method . '.' . PHP_EXT);
|
||||
|
||||
$method = 'init_' . $method;
|
||||
if (function_exists($method))
|
||||
@@ -556,20 +555,20 @@ class acp_board
|
||||
{
|
||||
$l_explain = (isset($user->lang[$vars['lang'] . '_EXPLAIN'])) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : '';
|
||||
}
|
||||
|
||||
|
||||
$content = build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars);
|
||||
|
||||
|
||||
if (empty($content))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$template->assign_block_vars('options', array(
|
||||
'KEY' => $config_key,
|
||||
'TITLE' => (isset($user->lang[$vars['lang']])) ? $user->lang[$vars['lang']] : $vars['lang'],
|
||||
'S_EXPLAIN' => $vars['explain'],
|
||||
'TITLE_EXPLAIN' => $l_explain,
|
||||
'CONTENT' => build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars),
|
||||
'CONTENT' => $content,
|
||||
)
|
||||
);
|
||||
|
||||
@@ -582,7 +581,7 @@ class acp_board
|
||||
|
||||
foreach ($auth_plugins as $method)
|
||||
{
|
||||
if ($method && file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx))
|
||||
if ($method && file_exists(PHPBB_ROOT_PATH . 'includes/auth/auth_' . $method . '.' . PHP_EXT))
|
||||
{
|
||||
$method = 'acp_' . $method;
|
||||
if (function_exists($method))
|
||||
@@ -607,11 +606,9 @@ class acp_board
|
||||
*/
|
||||
function select_auth_method($selected_method, $key = '')
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
|
||||
$auth_plugins = array();
|
||||
|
||||
$dp = @opendir($phpbb_root_path . 'includes/auth');
|
||||
$dp = @opendir(PHPBB_ROOT_PATH . 'includes/auth');
|
||||
|
||||
if (!$dp)
|
||||
{
|
||||
@@ -620,9 +617,9 @@ class acp_board
|
||||
|
||||
while (($file = readdir($dp)) !== false)
|
||||
{
|
||||
if (preg_match('#^auth_(.*?)\.' . $phpEx . '$#', $file))
|
||||
if (preg_match('#^auth_(.*?)\.' . PHP_EXT . '$#', $file))
|
||||
{
|
||||
$auth_plugins[] = preg_replace('#^auth_(.*?)\.' . $phpEx . '$#', '\1', $file);
|
||||
$auth_plugins[] = preg_replace('#^auth_(.*?)\.' . PHP_EXT . '$#', '\1', $file);
|
||||
}
|
||||
}
|
||||
closedir($dp);
|
||||
@@ -677,6 +674,16 @@ class acp_board
|
||||
return h_radio('config[ip_check]', $radio_ary, $value, $key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Select referer validation
|
||||
*/
|
||||
function select_ref_check($value, $key = '')
|
||||
{
|
||||
$radio_ary = array(REFERER_VALIDATE_PATH => 'REF_PATH', REFERER_VALIDATE_HOST => 'REF_HOST', REFERER_VALIDATE_NONE => 'NO_REF_VALIDATION');
|
||||
|
||||
return h_radio('config[referer_validation]', $radio_ary, $value, $key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Select account activation method
|
||||
*/
|
||||
|
@@ -26,14 +26,13 @@ class acp_bots
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template, $cache;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
|
||||
|
||||
$action = request_var('action', '');
|
||||
$submit = (isset($_POST['submit'])) ? true : false;
|
||||
$submit = request::is_set_post('submit');
|
||||
$mark = request_var('mark', array(0));
|
||||
$bot_id = request_var('id', 0);
|
||||
|
||||
if (isset($_POST['add']))
|
||||
if (request::is_set_post('add'))
|
||||
{
|
||||
$action = 'add';
|
||||
}
|
||||
@@ -141,7 +140,7 @@ class acp_bots
|
||||
|
||||
case 'edit':
|
||||
case 'add':
|
||||
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||
|
||||
$bot_row = array(
|
||||
'bot_name' => utf8_normalize_nfc(request_var('bot_name', '', true)),
|
||||
@@ -210,7 +209,7 @@ class acp_bots
|
||||
{
|
||||
$sql = 'SELECT group_id, group_colour
|
||||
FROM ' . GROUPS_TABLE . "
|
||||
WHERE group_name = 'BOTS'
|
||||
WHERE group_name_clean = 'bots'
|
||||
AND group_type = " . GROUP_SPECIAL;
|
||||
$result = $db->sql_query($sql);
|
||||
$group_row = $db->sql_fetchrow($result);
|
||||
|
@@ -10,6 +10,8 @@
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
@@ -24,95 +26,119 @@ class acp_captcha
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $user, $auth, $template, $config;
|
||||
|
||||
$user->add_lang('acp/board');
|
||||
|
||||
include(PHPBB_ROOT_PATH . 'includes/captcha/captcha_factory.' . PHP_EXT);
|
||||
|
||||
$selected = request_var('select_captcha', $config['captcha_plugin']);
|
||||
$configure = request_var('configure', false);
|
||||
|
||||
$captcha_vars = array(
|
||||
'captcha_gd_x_grid' => 'CAPTCHA_GD_X_GRID',
|
||||
'captcha_gd_y_grid' => 'CAPTCHA_GD_Y_GRID',
|
||||
'captcha_gd_foreground_noise' => 'CAPTCHA_GD_FOREGROUND_NOISE',
|
||||
'captcha_gd' => 'CAPTCHA_GD_PREVIEWED'
|
||||
);
|
||||
|
||||
if (isset($_GET['demo']))
|
||||
// Oh, they are just here for the view
|
||||
if (request::is_set('captcha_demo', request::GET))
|
||||
{
|
||||
$captcha_vars = array_keys($captcha_vars);
|
||||
foreach ($captcha_vars as $captcha_var)
|
||||
{
|
||||
$config[$captcha_var] = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, 0) : $config[$captcha_var];
|
||||
}
|
||||
if ($config['captcha_gd'])
|
||||
{
|
||||
include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx);
|
||||
}
|
||||
else
|
||||
{
|
||||
include($phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx);
|
||||
}
|
||||
$captcha = new captcha();
|
||||
$captcha->execute(gen_rand_string(mt_rand(5, 8)), time());
|
||||
exit_handler();
|
||||
$this->deliver_demo($selected);
|
||||
}
|
||||
|
||||
$config_vars = array(
|
||||
'enable_confirm' => 'REG_ENABLE',
|
||||
'enable_post_confirm' => 'POST_ENABLE',
|
||||
'captcha_gd' => 'CAPTCHA_GD',
|
||||
);
|
||||
|
||||
$this->tpl_name = 'acp_captcha';
|
||||
$this->page_title = 'ACP_VC_SETTINGS';
|
||||
$form_key = 'acp_captcha';
|
||||
add_form_key($form_key);
|
||||
|
||||
$submit = request_var('submit', '');
|
||||
|
||||
if ($submit && check_form_key($form_key))
|
||||
|
||||
// Delegate
|
||||
if ($configure)
|
||||
{
|
||||
$config_vars = array_keys($config_vars);
|
||||
foreach ($config_vars as $config_var)
|
||||
{
|
||||
set_config($config_var, request_var($config_var, ''));
|
||||
}
|
||||
$captcha_vars = array_keys($captcha_vars);
|
||||
foreach ($captcha_vars as $captcha_var)
|
||||
{
|
||||
set_config($captcha_var, request_var($captcha_var, 0));
|
||||
}
|
||||
trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
|
||||
}
|
||||
else if ($submit)
|
||||
{
|
||||
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action));
|
||||
$config_captcha = phpbb_captcha_factory::get_instance($selected);
|
||||
$config_captcha->acp_page($id, $this);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$preview_image_src = append_sid(append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&demo=demo"));
|
||||
if (@extension_loaded('gd'))
|
||||
$captchas = phpbb_captcha_factory::get_captcha_types();
|
||||
|
||||
$config_vars = array(
|
||||
'enable_confirm' => 'REG_ENABLE',
|
||||
'enable_post_confirm' => 'POST_ENABLE',
|
||||
);
|
||||
|
||||
$this->tpl_name = 'acp_captcha';
|
||||
$this->page_title = 'ACP_VC_SETTINGS';
|
||||
$form_key = 'acp_captcha';
|
||||
add_form_key($form_key);
|
||||
|
||||
$submit = request_var('main_submit', false);
|
||||
|
||||
if ($submit && check_form_key($form_key))
|
||||
{
|
||||
$template->assign_var('GD', true);
|
||||
$config_vars = array_keys($config_vars);
|
||||
foreach ($config_vars as $config_var)
|
||||
{
|
||||
set_config($config_var, request_var($config_var, false));
|
||||
}
|
||||
if ($selected !== $config['captcha_plugin'])
|
||||
{
|
||||
// sanity check
|
||||
if (isset($captchas['available'][$selected]))
|
||||
{
|
||||
$old_captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']);
|
||||
$old_captcha->uninstall();
|
||||
set_config('captcha_plugin', $selected);
|
||||
$new_captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']);
|
||||
$new_captcha->install();
|
||||
}
|
||||
else
|
||||
{
|
||||
trigger_error($user->lang['CAPTCHA_UNAVAILABLE'] . adm_back_link($this->u_action));
|
||||
}
|
||||
}
|
||||
trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
|
||||
}
|
||||
foreach ($config_vars as $config_var => $template_var)
|
||||
else if ($submit)
|
||||
{
|
||||
$template->assign_var($template_var, (isset($_REQUEST[$config_var])) ? request_var($config_var, '') : $config[$config_var]) ;
|
||||
trigger_error($user->lang['FORM_INVALID'] . adm_back_link());
|
||||
}
|
||||
foreach ($captcha_vars as $captcha_var => $template_var)
|
||||
else
|
||||
{
|
||||
$var = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, 0) : $config[$captcha_var];
|
||||
$template->assign_var($template_var, $var);
|
||||
$preview_image_src .= "&$captcha_var=" . $var;
|
||||
$captcha_select = '';
|
||||
foreach ($captchas['available'] as $value => $title)
|
||||
{
|
||||
$current = ($selected !== false && $value == $selected) ? ' selected="selected"' : '';
|
||||
$captcha_select .= '<option value="' . $value . '"' . $current . '>' . $user->lang[$title] . '</option>';
|
||||
}
|
||||
foreach ($captchas['unavailable'] as $value => $title)
|
||||
{
|
||||
$captcha_select .= '<option value="' . $value . '"' . $current . ' class="disabled-option" >' . $user->lang[$title] . '</option>';
|
||||
}
|
||||
|
||||
$demo_captcha = phpbb_captcha_factory::get_instance($selected);
|
||||
|
||||
foreach ($config_vars as $config_var => $template_var)
|
||||
{
|
||||
$template->assign_var($template_var, request_var($config_var, $config[$config_var])) ;
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'CAPTCHA_PREVIEW' => $demo_captcha->get_demo_template($id),
|
||||
'CAPTCHA_SELECT' => $captcha_select,
|
||||
));
|
||||
}
|
||||
$template->assign_vars(array(
|
||||
'CAPTCHA_PREVIEW' => $preview_image_src,
|
||||
'PREVIEW' => isset($_POST['preview']),
|
||||
));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Entry point for delivering image CAPTCHAs in the ACP.
|
||||
*/
|
||||
function deliver_demo($selected)
|
||||
{
|
||||
global $db, $user, $config;
|
||||
|
||||
$captcha = phpbb_captcha_factory::get_instance($selected);
|
||||
$captcha->init(CONFIRM_REG);
|
||||
$captcha->execute_demo();
|
||||
garbage_collection();
|
||||
exit_handler();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
@@ -25,8 +25,7 @@ class acp_database
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $table_prefix;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $cache, $db, $user, $auth, $template, $table_prefix, $config;
|
||||
|
||||
$user->add_lang('acp/database');
|
||||
|
||||
@@ -34,7 +33,7 @@ class acp_database
|
||||
$this->page_title = 'ACP_DATABASE';
|
||||
|
||||
$action = request_var('action', '');
|
||||
$submit = (isset($_POST['submit'])) ? true : false;
|
||||
$submit = request::is_set_post('submit');
|
||||
|
||||
$template->assign_vars(array(
|
||||
'MODE' => $mode
|
||||
@@ -86,10 +85,8 @@ class acp_database
|
||||
$time = time();
|
||||
|
||||
$filename = 'backup_' . $time . '_' . unique_id();
|
||||
switch ($db->sql_layer)
|
||||
switch ($db->dbms_type)
|
||||
{
|
||||
case 'mysqli':
|
||||
case 'mysql4':
|
||||
case 'mysql':
|
||||
$extractor = new mysql_extractor($download, $store, $format, $filename, $time);
|
||||
break;
|
||||
@@ -107,13 +104,16 @@ class acp_database
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
case 'mssql_odbc':
|
||||
$extractor = new mssql_extractor($download, $store, $format, $filename, $time);
|
||||
break;
|
||||
|
||||
case 'firebird':
|
||||
$extractor = new firebird_extractor($download, $store, $format, $filename, $time);
|
||||
break;
|
||||
|
||||
case 'db2':
|
||||
$extractor = new db2_extractor($download, $store, $format, $filename, $time);
|
||||
break;
|
||||
}
|
||||
|
||||
$extractor->write_start($table_prefix);
|
||||
@@ -128,15 +128,15 @@ class acp_database
|
||||
else
|
||||
{
|
||||
// We might wanna empty out all that junk :D
|
||||
switch ($db->sql_layer)
|
||||
switch ($db->dbms_type)
|
||||
{
|
||||
case 'sqlite':
|
||||
case 'firebird':
|
||||
case 'db2':
|
||||
$extractor->flush('DELETE FROM ' . $table_name . ";\n");
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
case 'mssql_odbc':
|
||||
$extractor->flush('TRUNCATE TABLE ' . $table_name . "GO\n");
|
||||
break;
|
||||
|
||||
@@ -159,18 +159,20 @@ class acp_database
|
||||
|
||||
$extractor->write_end();
|
||||
|
||||
add_log('admin', 'LOG_DB_BACKUP');
|
||||
|
||||
if ($download == true)
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
add_log('admin', 'LOG_DB_BACKUP');
|
||||
trigger_error($user->lang['BACKUP_SUCCESS'] . adm_back_link($this->u_action));
|
||||
break;
|
||||
|
||||
default:
|
||||
include($phpbb_root_path . 'includes/functions_install.' . $phpEx);
|
||||
include(PHPBB_ROOT_PATH . 'includes/functions_install.' . PHP_EXT);
|
||||
$tables = get_tables($db);
|
||||
asort($tables);
|
||||
foreach ($tables as $table_name)
|
||||
{
|
||||
if (strlen($table_prefix) === 0 || stripos($table_name, $table_prefix) === 0)
|
||||
@@ -222,7 +224,7 @@ class acp_database
|
||||
trigger_error($user->lang['BACKUP_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$file_name = $phpbb_root_path . 'store/' . $matches[0];
|
||||
$file_name = PHPBB_ROOT_PATH . 'store/' . $matches[0];
|
||||
|
||||
if (!file_exists($file_name) || !is_readable($file_name))
|
||||
{
|
||||
@@ -314,12 +316,11 @@ class acp_database
|
||||
break;
|
||||
}
|
||||
|
||||
switch ($db->sql_layer)
|
||||
switch ($db->dbms_type)
|
||||
{
|
||||
case 'mysql':
|
||||
case 'mysql4':
|
||||
case 'mysqli':
|
||||
case 'sqlite':
|
||||
case 'db2':
|
||||
while (($sql = $fgetd($fp, ";\n", $read, $seek, $eof)) !== false)
|
||||
{
|
||||
$db->sql_query($sql);
|
||||
@@ -345,7 +346,25 @@ class acp_database
|
||||
while (($sql = $fgetd($fp, $delim, $read, $seek, $eof)) !== false)
|
||||
{
|
||||
$query = trim($sql);
|
||||
$db->sql_query($query);
|
||||
|
||||
if (substr($query, 0, 13) == 'CREATE DOMAIN')
|
||||
{
|
||||
list(, , $domain) = explode(' ', $query);
|
||||
$sql = "SELECT domain_name
|
||||
FROM information_schema.domains
|
||||
WHERE domain_name = '$domain';";
|
||||
$result = $db->sql_query($sql);
|
||||
if (!$db->sql_fetchrow($result))
|
||||
{
|
||||
$db->sql_query($query);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->sql_query($query);
|
||||
}
|
||||
|
||||
if (substr($query, 0, 4) == 'COPY')
|
||||
{
|
||||
while (($sub = $fgetd($fp, "\n", $read, $seek, $eof)) !== '\.')
|
||||
@@ -370,7 +389,6 @@ class acp_database
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
case 'mssql_odbc':
|
||||
while (($sql = $fgetd($fp, "GO\n", $read, $seek, $eof)) !== false)
|
||||
{
|
||||
$db->sql_query($sql);
|
||||
@@ -380,6 +398,9 @@ class acp_database
|
||||
|
||||
$close($fp);
|
||||
|
||||
// Purge the cache due to updated data
|
||||
$cache->purge();
|
||||
|
||||
add_log('admin', 'LOG_DB_RESTORE');
|
||||
trigger_error($user->lang['RESTORE_SUCCESS'] . adm_back_link($this->u_action));
|
||||
break;
|
||||
@@ -398,7 +419,7 @@ class acp_database
|
||||
$methods[] = $type;
|
||||
}
|
||||
|
||||
$dir = $phpbb_root_path . 'store/';
|
||||
$dir = PHPBB_ROOT_PATH . 'store/';
|
||||
$dh = @opendir($dir);
|
||||
|
||||
if ($dh)
|
||||
@@ -447,7 +468,7 @@ class base_extractor
|
||||
var $format;
|
||||
var $run_comp = false;
|
||||
|
||||
function base_extractor($download = false, $store = false, $format, $filename, $time)
|
||||
function __construct($download = false, $store = false, $format, $filename, $time)
|
||||
{
|
||||
$this->download = $download;
|
||||
$this->store = $store;
|
||||
@@ -507,8 +528,7 @@ class base_extractor
|
||||
|
||||
if ($store == true)
|
||||
{
|
||||
global $phpbb_root_path;
|
||||
$file = $phpbb_root_path . 'store/' . $filename . $ext;
|
||||
$file = PHPBB_ROOT_PATH . 'store/' . $filename . $ext;
|
||||
|
||||
$this->fp = $open($file, 'w');
|
||||
|
||||
@@ -593,28 +613,16 @@ class mysql_extractor extends base_extractor
|
||||
function write_table($table_name)
|
||||
{
|
||||
global $db;
|
||||
static $new_extract;
|
||||
|
||||
if ($new_extract === null)
|
||||
{
|
||||
if ($db->sql_layer === 'mysqli' || version_compare($db->mysql_version, '3.23.20', '>='))
|
||||
{
|
||||
$new_extract = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$new_extract = false;
|
||||
}
|
||||
}
|
||||
$sql = 'SHOW CREATE TABLE ' . $table_name;
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
|
||||
if ($new_extract)
|
||||
{
|
||||
$this->new_write_table($table_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->old_write_table($table_name);
|
||||
}
|
||||
$sql_data = '# Table: ' . $table_name . "\n";
|
||||
$sql_data .= "DROP TABLE IF EXISTS $table_name;\n";
|
||||
$this->flush($sql_data . $row['Create Table'] . ";\n\n");
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
function write_data($table_name)
|
||||
@@ -792,113 +800,6 @@ class mysql_extractor extends base_extractor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function new_write_table($table_name)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$sql = 'SHOW CREATE TABLE ' . $table_name;
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
|
||||
$sql_data = '# Table: ' . $table_name . "\n";
|
||||
$sql_data .= "DROP TABLE IF EXISTS $table_name;\n";
|
||||
$this->flush($sql_data . $row['Create Table'] . ";\n\n");
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
function old_write_table($table_name)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$sql_data = '# Table: ' . $table_name . "\n";
|
||||
$sql_data .= "DROP TABLE IF EXISTS $table_name;\n";
|
||||
$sql_data .= "CREATE TABLE $table_name(\n";
|
||||
$rows = array();
|
||||
|
||||
$sql = "SHOW FIELDS
|
||||
FROM $table_name";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$line = ' ' . $row['Field'] . ' ' . $row['Type'];
|
||||
|
||||
if (!is_null($row['Default']))
|
||||
{
|
||||
$line .= " DEFAULT '{$row['Default']}'";
|
||||
}
|
||||
|
||||
if ($row['Null'] != 'YES')
|
||||
{
|
||||
$line .= ' NOT NULL';
|
||||
}
|
||||
|
||||
if ($row['Extra'] != '')
|
||||
{
|
||||
$line .= ' ' . $row['Extra'];
|
||||
}
|
||||
|
||||
$rows[] = $line;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = "SHOW KEYS
|
||||
FROM $table_name";
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$index = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$kname = $row['Key_name'];
|
||||
|
||||
if ($kname != 'PRIMARY')
|
||||
{
|
||||
if ($row['Non_unique'] == 0)
|
||||
{
|
||||
$kname = "UNIQUE|$kname";
|
||||
}
|
||||
}
|
||||
|
||||
if ($row['Sub_part'])
|
||||
{
|
||||
$row['Column_name'] .= '(' . $row['Sub_part'] . ')';
|
||||
}
|
||||
$index[$kname][] = $row['Column_name'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
foreach ($index as $key => $columns)
|
||||
{
|
||||
$line = ' ';
|
||||
|
||||
if ($key == 'PRIMARY')
|
||||
{
|
||||
$line .= 'PRIMARY KEY (' . implode(', ', $columns) . ')';
|
||||
}
|
||||
else if (strpos($key, 'UNIQUE') === 0)
|
||||
{
|
||||
$line .= 'UNIQUE ' . substr($key, 7) . ' (' . implode(', ', $columns) . ')';
|
||||
}
|
||||
else if (strpos($key, 'FULLTEXT') === 0)
|
||||
{
|
||||
$line .= 'FULLTEXT ' . substr($key, 9) . ' (' . implode(', ', $columns) . ')';
|
||||
}
|
||||
else
|
||||
{
|
||||
$line .= "KEY $key (" . implode(', ', $columns) . ')';
|
||||
}
|
||||
|
||||
$rows[] = $line;
|
||||
}
|
||||
|
||||
$sql_data .= implode(",\n", $rows);
|
||||
$sql_data .= "\n);\n\n";
|
||||
|
||||
$this->flush($sql_data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1087,7 +988,7 @@ class postgres_extractor extends base_extractor
|
||||
}
|
||||
|
||||
$sql_data = '-- Table: ' . $table_name . "\n";
|
||||
//$sql_data .= "DROP TABLE $table_name;\n";
|
||||
$sql_data .= "DROP TABLE $table_name;\n";
|
||||
// PGSQL does not "tightly" bind sequences and tables, we must guess...
|
||||
$sql = "SELECT relname
|
||||
FROM pg_class
|
||||
@@ -1129,7 +1030,7 @@ class postgres_extractor extends base_extractor
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['rowdefault'] = $db->sql_fetchfield('rowdefault', false, $def_res);
|
||||
$row['rowdefault'] = $db->sql_fetchfield('rowdefault', $def_res);
|
||||
}
|
||||
$db->sql_freeresult($def_res);
|
||||
|
||||
@@ -1156,7 +1057,7 @@ class postgres_extractor extends base_extractor
|
||||
$line .= ')';
|
||||
}
|
||||
|
||||
if (!empty($row['rowdefault']))
|
||||
if (isset($row['rowdefault']))
|
||||
{
|
||||
$line .= ' DEFAULT ' . $row['rowdefault'];
|
||||
}
|
||||
@@ -1473,10 +1374,15 @@ class mssql_extractor extends base_extractor
|
||||
{
|
||||
$this->write_data_mssql($table_name);
|
||||
}
|
||||
else
|
||||
else if ($db->sql_layer === 'mssql_odbc')
|
||||
{
|
||||
$this->write_data_odbc($table_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
// @todo: write code for MS SQL 2005 DBAL
|
||||
trigger_error('KungFuDeathGrip');
|
||||
}
|
||||
}
|
||||
|
||||
function write_data_mssql($table_name)
|
||||
@@ -1671,6 +1577,175 @@ class mssql_extractor extends base_extractor
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @package acp
|
||||
*/
|
||||
class db2_extractor extends base_extractor
|
||||
{
|
||||
function write_start($prefix)
|
||||
{
|
||||
$sql_data = "--\n";
|
||||
$sql_data .= "-- phpBB Backup Script\n";
|
||||
$sql_data .= "-- Dump of tables for $prefix\n";
|
||||
$sql_data .= "-- DATE : " . gmdate("d-m-Y H:i:s", $this->time) . " GMT\n";
|
||||
$sql_data .= "--\n";
|
||||
$this->flush($sql_data);
|
||||
}
|
||||
|
||||
function write_table($table_name)
|
||||
{
|
||||
global $db;
|
||||
$sql_data = '-- Table: ' . $table_name . "\n";
|
||||
$sql_data .= "\nCREATE TABLE $table_name (\n";
|
||||
$rows = array();
|
||||
|
||||
// switch to db2_columns()?
|
||||
$sql = "SELECT colname, typename, length, default, identity, nulls
|
||||
FROM syscat.columns
|
||||
WHERE tabname = '$table_name'";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$line = "\t{$row['colname']} {$row['typename']}";
|
||||
|
||||
if ($row['identity'] == 'Y')
|
||||
{
|
||||
$line .= ' GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1)';
|
||||
}
|
||||
|
||||
if ($row['typename'] == 'VARCHAR' || $row['typename'] == 'CHARACTER' || $row['typename'] == 'CLOB')
|
||||
{
|
||||
$line .= ' (' . $row['length'] . ')';
|
||||
}
|
||||
|
||||
if ($row['nulls'] == 'N')
|
||||
{
|
||||
$line .= ' NOT NULL';
|
||||
}
|
||||
else
|
||||
{
|
||||
$line .= ' NULL';
|
||||
}
|
||||
|
||||
if ($row['default'] !== null)
|
||||
{
|
||||
$line .= ' DEFAULT ' . $row['default'];
|
||||
}
|
||||
|
||||
$rows[] = $line;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// switch to db2_columns()?
|
||||
$sql = "SELECT colname
|
||||
FROM SYSCAT.KEYCOLUSE
|
||||
WHERE tabname = '$table_name'";
|
||||
$result = $db->sql_query($sql);
|
||||
$prim_cols = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$prim_cols[] = $row['colname'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
if (sizeof($prim_cols))
|
||||
{
|
||||
$rows[] = "\tPRIMARY KEY (" . implode($prim_cols) . ')';
|
||||
}
|
||||
|
||||
$sql_data .= implode(",\n", $rows);
|
||||
$sql_data .= "\n);\n\n";
|
||||
$rows = array();
|
||||
|
||||
$sql = "SELECT colnames, indname
|
||||
FROM SYSCAT.INDEXES
|
||||
WHERE TABNAME = '$table_name'
|
||||
AND UNIQUERULE <> 'P'";
|
||||
$result = $db->sql_query($sql);
|
||||
$index = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$inds = explode('+', $row['colnames']);
|
||||
unset($inds[0]);
|
||||
$sql_data .= 'CREATE INDEX ' . $row['indname'] . ' ON ' . $table_name . ' (' . implode(', ', $inds) . ") PCTFREE 10 MINPCTUSED 10 ALLOW REVERSE SCANS PAGE SPLIT SYMMETRIC COLLECT SAMPLED DETAILED STATISTICS;\n";
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$this->flush($sql_data);
|
||||
}
|
||||
|
||||
function write_data($table_name)
|
||||
{
|
||||
global $db;
|
||||
$ary_type = $ary_name = array();
|
||||
$result = db2_columns($db->db_connect_id, '', '%', $table_name);
|
||||
$i = 0;
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$ary_type[$i] = $row['type_name'];
|
||||
$ary_name[$i++] = strtolower($row['column_name']);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Grab all of the data from current table.
|
||||
$sql = "SELECT *
|
||||
FROM $table_name";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$sql_data = '';
|
||||
$i_num_fields = $i;
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$schema_vals = $schema_fields = array();
|
||||
|
||||
// Build the SQL statement to recreate the data.
|
||||
for ($i = 0; $i < $i_num_fields; $i++)
|
||||
{
|
||||
$str_val = $row[$ary_name[$i]];
|
||||
|
||||
if (preg_match('#char|clob#i', $ary_type[$i]))
|
||||
{
|
||||
$str_quote = "'";
|
||||
$str_empty = '';
|
||||
$str_val = sanitize_data_generic(str_replace("'", "''", $str_val));
|
||||
}
|
||||
else if (preg_match('#date|timestamp#i', $ary_type[$i]))
|
||||
{
|
||||
if (empty($str_val))
|
||||
{
|
||||
$str_quote = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$str_quote = "'";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$str_quote = '';
|
||||
$str_empty = 'NULL';
|
||||
}
|
||||
|
||||
if (empty($str_val) && $str_val !== '0')
|
||||
{
|
||||
$str_val = $str_empty;
|
||||
}
|
||||
|
||||
$schema_vals[$i] = $str_quote . $str_val . $str_quote;
|
||||
$schema_fields[$i] = '"' . $ary_name[$i] . "'";
|
||||
}
|
||||
|
||||
// Take the ordered fields and their associated data and build it
|
||||
// into a valid sql statement to recreate that field in the data.
|
||||
$sql_data = "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES (' . implode(', ', $schema_vals) . ");\n";
|
||||
|
||||
$this->flush($sql_data);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @package acp
|
||||
*/
|
||||
@@ -1752,7 +1827,7 @@ class oracle_extractor extends base_extractor
|
||||
FROM USER_DEPENDENCIES A, USER_TRIGGERS B
|
||||
WHERE A.REFERENCED_TYPE = 'SEQUENCE'
|
||||
AND A.NAME = B.TRIGGER_NAME
|
||||
AND B. TABLE_NAME = '{$table_name}'";
|
||||
AND B.TABLE_NAME = '{$table_name}'";
|
||||
$result = $db->sql_query($sql);
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
|
@@ -25,10 +25,9 @@ class acp_disallow
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $user, $auth, $template, $cache, $config;
|
||||
|
||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||
include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||
|
||||
$user->add_lang('acp/posting');
|
||||
|
||||
@@ -39,8 +38,8 @@ class acp_disallow
|
||||
$form_key = 'acp_disallow';
|
||||
add_form_key($form_key);
|
||||
|
||||
$disallow = (isset($_POST['disallow'])) ? true : false;
|
||||
$allow = (isset($_POST['allow'])) ? true : false;
|
||||
$disallow = request::is_set_post('disallow');
|
||||
$allow = request::is_set_post('allow');
|
||||
|
||||
if (($allow || $disallow) && !check_form_key($form_key))
|
||||
{
|
||||
|
@@ -26,7 +26,6 @@ class acp_email
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template, $cache;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
|
||||
|
||||
$user->add_lang('acp/email');
|
||||
$this->tpl_name = 'acp_email';
|
||||
@@ -36,7 +35,7 @@ class acp_email
|
||||
add_form_key($form_key);
|
||||
|
||||
// Set some vars
|
||||
$submit = (isset($_POST['submit'])) ? true : false;
|
||||
$submit = request::is_set_post('submit');
|
||||
$error = array();
|
||||
|
||||
$usernames = request_var('usernames', '', true);
|
||||
@@ -49,7 +48,7 @@ class acp_email
|
||||
{
|
||||
// Error checking needs to go here ... if no subject and/or no message then skip
|
||||
// over the send and return to the form
|
||||
$use_queue = (isset($_POST['send_immediately'])) ? false : true;
|
||||
$use_queue = request::is_set_post('send_immediately');
|
||||
$priority = request_var('mail_priority_flag', MAIL_NORMAL_PRIORITY);
|
||||
|
||||
if (!check_form_key($form_key))
|
||||
@@ -148,8 +147,8 @@ class acp_email
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Send the messages
|
||||
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
||||
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||
$messenger = new messenger($use_queue);
|
||||
|
||||
$errored = false;
|
||||
@@ -218,7 +217,7 @@ class acp_email
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = sprintf($user->lang['EMAIL_SEND_ERROR'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&mode=critical') . '">', '</a>');
|
||||
$message = sprintf($user->lang['EMAIL_SEND_ERROR'], '<a href="' . append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=logs&mode=critical') . '">', '</a>');
|
||||
trigger_error($message . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
@@ -227,7 +226,7 @@ class acp_email
|
||||
// Exclude bots and guests...
|
||||
$sql = 'SELECT group_id
|
||||
FROM ' . GROUPS_TABLE . "
|
||||
WHERE group_name IN ('BOTS', 'GUESTS')";
|
||||
WHERE group_name_clean IN ('bots', 'guests')";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$exclude = array();
|
||||
@@ -250,12 +249,11 @@ class acp_email
|
||||
'U_ACTION' => $this->u_action,
|
||||
'S_GROUP_OPTIONS' => $select_list,
|
||||
'USERNAMES' => $usernames,
|
||||
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=acp_email&field=usernames'),
|
||||
'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=acp_email&field=usernames'),
|
||||
'SUBJECT' => $subject,
|
||||
'MESSAGE' => $message,
|
||||
'S_PRIORITY_OPTIONS' => $s_priority_options)
|
||||
);
|
||||
|
||||
'S_PRIORITY_OPTIONS' => $s_priority_options,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -26,8 +26,7 @@ class acp_forums
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache;
|
||||
global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
|
||||
global $db, $user, $auth, $template, $cache, $config;
|
||||
|
||||
$user->add_lang('acp/forums');
|
||||
$this->tpl_name = 'acp_forums';
|
||||
@@ -37,7 +36,7 @@ class acp_forums
|
||||
add_form_key($form_key);
|
||||
|
||||
$action = request_var('action', '');
|
||||
$update = (isset($_POST['update'])) ? true : false;
|
||||
$update = request::is_set_post('update');
|
||||
$forum_id = request_var('f', 0);
|
||||
|
||||
$this->parent_id = request_var('parent_id', 0);
|
||||
@@ -56,7 +55,7 @@ class acp_forums
|
||||
$total = request_var('total', 0);
|
||||
|
||||
$this->display_progress_bar($start, $total);
|
||||
exit_handler();
|
||||
exit;
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
@@ -74,7 +73,7 @@ class acp_forums
|
||||
{
|
||||
trigger_error($user->lang['NO_PERMISSION_FORUM_ADD'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -100,7 +99,7 @@ class acp_forums
|
||||
$cache->destroy('sql', FORUMS_TABLE);
|
||||
|
||||
trigger_error($user->lang['FORUM_DELETED'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id));
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 'edit':
|
||||
@@ -154,8 +153,11 @@ class acp_forums
|
||||
if ($forum_data['forum_type'] == FORUM_LINK)
|
||||
{
|
||||
$forum_data['display_on_index'] = request_var('link_display_on_index', false);
|
||||
}
|
||||
|
||||
// Linked forums are not able to be locked...
|
||||
// Linked forums and categories are not able to be locked...
|
||||
if ($forum_data['forum_type'] == FORUM_LINK || $forum_data['forum_type'] == FORUM_CAT)
|
||||
{
|
||||
$forum_data['forum_status'] = ITEM_UNLOCKED;
|
||||
}
|
||||
|
||||
@@ -189,7 +191,7 @@ class acp_forums
|
||||
$sql = 'DELETE FROM ' . ACL_USERS_TABLE . '
|
||||
WHERE forum_id = ' . (int) $forum_data['forum_id'];
|
||||
$db->sql_query($sql);
|
||||
|
||||
|
||||
$sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . '
|
||||
WHERE forum_id = ' . (int) $forum_data['forum_id'];
|
||||
$db->sql_query($sql);
|
||||
@@ -245,7 +247,7 @@ class acp_forums
|
||||
|
||||
$auth->acl_clear_prefetch();
|
||||
$cache->destroy('sql', FORUMS_TABLE);
|
||||
|
||||
|
||||
$acl_url = '&mode=setting_forum_local&forum_id[]=' . $forum_data['forum_id'];
|
||||
|
||||
$message = ($action == 'add') ? $user->lang['FORUM_CREATED'] : $user->lang['FORUM_UPDATED'];
|
||||
@@ -253,13 +255,13 @@ class acp_forums
|
||||
// Redirect to permissions
|
||||
if ($auth->acl_get('a_fauth'))
|
||||
{
|
||||
$message .= '<br /><br />' . sprintf($user->lang['REDIRECT_ACL'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url) . '">', '</a>');
|
||||
$message .= '<br /><br />' . sprintf($user->lang['REDIRECT_ACL'], '<a href="' . append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=permissions' . $acl_url) . '">', '</a>');
|
||||
}
|
||||
|
||||
// redirect directly to permission settings screen if authed
|
||||
if ($action == 'add' && !$forum_perm_from && $auth->acl_get('a_fauth'))
|
||||
{
|
||||
meta_refresh(4, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url));
|
||||
meta_refresh(4, append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=permissions' . $acl_url));
|
||||
}
|
||||
|
||||
trigger_error($message . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id));
|
||||
@@ -543,7 +545,7 @@ class acp_forums
|
||||
|
||||
$forum_type_options = '';
|
||||
$forum_type_ary = array(FORUM_CAT => 'CAT', FORUM_POST => 'FORUM', FORUM_LINK => 'LINK');
|
||||
|
||||
|
||||
foreach ($forum_type_ary as $value => $lang)
|
||||
{
|
||||
$forum_type_options .= '<option value="' . $value . '"' . (($value == $forum_data['forum_type']) ? ' selected="selected"' : '') . '>' . $user->lang['TYPE_' . $lang] . '</option>';
|
||||
@@ -613,7 +615,7 @@ class acp_forums
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (strlen($forum_data['forum_password']) == 32)
|
||||
{
|
||||
$errors[] = $user->lang['FORUM_PASSWORD_OLD'];
|
||||
@@ -636,7 +638,7 @@ class acp_forums
|
||||
'FORUM_NAME' => $forum_data['forum_name'],
|
||||
'FORUM_DATA_LINK' => $forum_data['forum_link'],
|
||||
'FORUM_IMAGE' => $forum_data['forum_image'],
|
||||
'FORUM_IMAGE_SRC' => ($forum_data['forum_image']) ? $phpbb_root_path . $forum_data['forum_image'] : '',
|
||||
'FORUM_IMAGE_SRC' => ($forum_data['forum_image']) ? PHPBB_ROOT_PATH . $forum_data['forum_image'] : '',
|
||||
'FORUM_POST' => FORUM_POST,
|
||||
'FORUM_LINK' => FORUM_LINK,
|
||||
'FORUM_CAT' => FORUM_CAT,
|
||||
@@ -810,8 +812,8 @@ class acp_forums
|
||||
|
||||
$template->assign_block_vars('forums', array(
|
||||
'FOLDER_IMAGE' => $folder_image,
|
||||
'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="" />' : '',
|
||||
'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
|
||||
'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . PHPBB_ROOT_PATH . $row['forum_image'] . '" alt="" />' : '',
|
||||
'FORUM_IMAGE_SRC' => ($row['forum_image']) ? PHPBB_ROOT_PATH . $row['forum_image'] : '',
|
||||
'FORUM_NAME' => $row['forum_name'],
|
||||
'FORUM_DESCRIPTION' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']),
|
||||
'FORUM_TOPICS' => $row['forum_topics'],
|
||||
@@ -918,14 +920,13 @@ class acp_forums
|
||||
$forum_data['prune_days'] = $forum_data['prune_viewed'] = $forum_data['prune_freq'] = 0;
|
||||
$errors[] = $user->lang['FORUM_DATA_NEGATIVE'];
|
||||
}
|
||||
|
||||
|
||||
$range_test_ary = array(
|
||||
array('lang' => 'FORUM_TOPICS_PAGE', 'value' => $forum_data['forum_topics_per_page'], 'column_type' => 'TINT:0'),
|
||||
);
|
||||
|
||||
validate_range($range_test_ary, $errors);
|
||||
|
||||
|
||||
|
||||
// Set forum flags
|
||||
// 1 = link tracking
|
||||
// 2 = prune old polls
|
||||
@@ -974,7 +975,7 @@ class acp_forums
|
||||
$forum_data_sql['forum_password'] = phpbb_hash($forum_data_sql['forum_password']);
|
||||
}
|
||||
unset($forum_data_sql['forum_password_unset']);
|
||||
|
||||
|
||||
if (!isset($forum_data_sql['forum_id']))
|
||||
{
|
||||
// no forum_id means we're creating a new forum
|
||||
@@ -1206,7 +1207,14 @@ class acp_forums
|
||||
|
||||
if ($row['parent_id'] != $forum_data_sql['parent_id'])
|
||||
{
|
||||
$errors = $this->move_forum($forum_data_sql['forum_id'], $forum_data_sql['parent_id']);
|
||||
if ($row['forum_id'] != $forum_data_sql['parent_id'])
|
||||
{
|
||||
$errors = $this->move_forum($forum_data_sql['forum_id'], $forum_data_sql['parent_id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$forum_data_sql['parent_id'] = $row['parent_id'];
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($errors))
|
||||
@@ -1620,9 +1628,9 @@ class acp_forums
|
||||
*/
|
||||
function delete_forum_content($forum_id)
|
||||
{
|
||||
global $db, $config, $phpbb_root_path, $phpEx;
|
||||
global $db, $config;
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
|
||||
|
||||
$db->sql_transaction('begin');
|
||||
|
||||
@@ -1632,7 +1640,7 @@ class acp_forums
|
||||
WHERE p.forum_id = $forum_id
|
||||
AND a.in_message = 0
|
||||
AND a.topic_id = p.topic_id";
|
||||
$result = $db->sql_query($sql);
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$topic_ids = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
@@ -1647,7 +1655,8 @@ class acp_forums
|
||||
$sql = 'SELECT poster_id
|
||||
FROM ' . POSTS_TABLE . '
|
||||
WHERE forum_id = ' . $forum_id . '
|
||||
AND post_postcount = 1';
|
||||
AND post_postcount = 1
|
||||
AND post_approved = 1';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$post_counts = array();
|
||||
@@ -1657,10 +1666,9 @@ class acp_forums
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
switch ($db->sql_layer)
|
||||
switch ($db->dbms_type)
|
||||
{
|
||||
case 'mysql4':
|
||||
case 'mysqli':
|
||||
case 'mysql':
|
||||
|
||||
// Delete everything else and thank MySQL for offering multi-table deletion
|
||||
$tables_ary = array(
|
||||
@@ -1690,7 +1698,7 @@ class acp_forums
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
|
||||
// Delete everything else and curse your DB for not offering multi-table deletion
|
||||
$tables_ary = array(
|
||||
'post_id' => array(
|
||||
@@ -1768,6 +1776,7 @@ class acp_forums
|
||||
WHERE user_id = ' . $poster_id . '
|
||||
AND user_posts < ' . $substract;
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET user_posts = user_posts - ' . $substract . '
|
||||
WHERE user_id = ' . $poster_id . '
|
||||
@@ -1811,7 +1820,7 @@ class acp_forums
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
set_config('upload_dir_size', (int) $row['stat'], true);
|
||||
set_config('upload_dir_size', (float) $row['stat'], true);
|
||||
|
||||
return array();
|
||||
}
|
||||
|
@@ -25,8 +25,7 @@ class acp_groups
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template, $cache;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads;
|
||||
global $config, $db, $user, $auth, $template, $cache, $file_uploads;
|
||||
|
||||
$user->add_lang('acp/groups');
|
||||
$this->tpl_name = 'acp_groups';
|
||||
@@ -35,21 +34,21 @@ class acp_groups
|
||||
$form_key = 'acp_groups';
|
||||
add_form_key($form_key);
|
||||
|
||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||
include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||
|
||||
// Check and set some common vars
|
||||
$action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['addusers'])) ? 'addusers' : request_var('action', ''));
|
||||
$action = (request::is_set_post('add')) ? 'add' : ((request::is_set_post('addusers')) ? 'addusers' : request_var('action', ''));
|
||||
$group_id = request_var('g', 0);
|
||||
$mark_ary = request_var('mark', array(0));
|
||||
$name_ary = request_var('usernames', '', true);
|
||||
$leader = request_var('leader', 0);
|
||||
$default = request_var('default', 0);
|
||||
$start = request_var('start', 0);
|
||||
$update = (isset($_POST['update'])) ? true : false;
|
||||
$update = request::is_set_post('update');
|
||||
|
||||
|
||||
// Clear some vars
|
||||
$can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $file_uploads) ? true : false;
|
||||
$can_upload = (file_exists(PHPBB_ROOT_PATH . $config['avatar_path']) && @is_writable(PHPBB_ROOT_PATH . $config['avatar_path']) && $file_uploads) ? true : false;
|
||||
$group_row = array();
|
||||
|
||||
// Grab basic data for group, if group_id is set and exists
|
||||
@@ -87,24 +86,32 @@ class acp_groups
|
||||
|
||||
// Approve, demote or promote
|
||||
$group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'];
|
||||
group_user_attributes($action, $group_id, $mark_ary, false, $group_name);
|
||||
$error = group_user_attributes($action, $group_id, $mark_ary, false, $group_name);
|
||||
|
||||
switch ($action)
|
||||
if (!$error)
|
||||
{
|
||||
case 'demote':
|
||||
$message = 'GROUP_MODS_DEMOTED';
|
||||
break;
|
||||
switch ($action)
|
||||
{
|
||||
case 'demote':
|
||||
$message = 'GROUP_MODS_DEMOTED';
|
||||
break;
|
||||
|
||||
case 'promote':
|
||||
$message = 'GROUP_MODS_PROMOTED';
|
||||
break;
|
||||
case 'promote':
|
||||
$message = 'GROUP_MODS_PROMOTED';
|
||||
break;
|
||||
|
||||
case 'approve':
|
||||
$message = 'USERS_APPROVED';
|
||||
break;
|
||||
case 'approve':
|
||||
$message = 'USERS_APPROVED';
|
||||
break;
|
||||
}
|
||||
|
||||
trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&action=list&g=' . $group_id));
|
||||
}
|
||||
else
|
||||
{
|
||||
trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&action=list&g=' . $group_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&action=list&g=' . $group_id));
|
||||
break;
|
||||
|
||||
case 'default':
|
||||
@@ -172,13 +179,17 @@ class acp_groups
|
||||
|
||||
case 'deleteusers':
|
||||
case 'delete':
|
||||
if (!$group_id)
|
||||
{
|
||||
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
else if ($action === 'delete' && $group_row['group_type'] == GROUP_SPECIAL)
|
||||
{
|
||||
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
if (confirm_box(true))
|
||||
{
|
||||
if (!$group_id)
|
||||
{
|
||||
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$error = '';
|
||||
|
||||
switch ($action)
|
||||
@@ -247,7 +258,7 @@ class acp_groups
|
||||
case 'edit':
|
||||
case 'add':
|
||||
|
||||
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
||||
include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
|
||||
|
||||
$data = $submit_ary = array();
|
||||
|
||||
@@ -292,15 +303,16 @@ class acp_groups
|
||||
$submit_ary = array(
|
||||
'colour' => request_var('group_colour', ''),
|
||||
'rank' => request_var('group_rank', 0),
|
||||
'receive_pm' => isset($_REQUEST['group_receive_pm']) ? 1 : 0,
|
||||
'legend' => isset($_REQUEST['group_legend']) ? 1 : 0,
|
||||
'receive_pm' => request::is_set('group_receive_pm') ? 1 : 0,
|
||||
'legend' => request::is_set('group_legend') ? 1 : 0,
|
||||
'message_limit' => request_var('group_message_limit', 0),
|
||||
'max_recipients' => request_var('group_max_recipients', 0),
|
||||
'founder_manage' => 0,
|
||||
);
|
||||
|
||||
if ($user->data['user_type'] == USER_FOUNDER)
|
||||
{
|
||||
$submit_ary['founder_manage'] = isset($_REQUEST['group_founder_manage']) ? 1 : 0;
|
||||
$submit_ary['founder_manage'] = request::is_set('group_founder_manage') ? 1 : 0;
|
||||
}
|
||||
|
||||
if (!empty($_FILES['uploadfile']['tmp_name']) || $data['uploadurl'] || $data['remotelink'])
|
||||
@@ -330,11 +342,11 @@ class acp_groups
|
||||
else if ($avatar_select && $config['allow_avatar_local'])
|
||||
{
|
||||
// check avatar gallery
|
||||
if (is_dir($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category))
|
||||
if (is_dir(PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/' . $category))
|
||||
{
|
||||
$submit_ary['avatar_type'] = AVATAR_GALLERY;
|
||||
|
||||
list($submit_ary['avatar_width'], $submit_ary['avatar_height']) = getimagesize($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category . '/' . $avatar_select);
|
||||
list($submit_ary['avatar_width'], $submit_ary['avatar_height']) = getimagesize(PHPBB_ROOT_PATH . $config['avatar_gallery_path'] . '/' . $category . '/' . $avatar_select);
|
||||
$submit_ary['avatar'] = $category . '/' . $avatar_select;
|
||||
}
|
||||
}
|
||||
@@ -387,7 +399,7 @@ class acp_groups
|
||||
// were made.
|
||||
|
||||
$group_attributes = array();
|
||||
$test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit', 'founder_manage');
|
||||
$test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit', 'max_recipients', 'founder_manage');
|
||||
foreach ($test_variables as $test)
|
||||
{
|
||||
if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test]))
|
||||
@@ -505,9 +517,9 @@ class acp_groups
|
||||
$type_closed = ($group_type == GROUP_CLOSED) ? ' checked="checked"' : '';
|
||||
$type_hidden = ($group_type == GROUP_HIDDEN) ? ' checked="checked"' : '';
|
||||
|
||||
$avatar_img = (!empty($group_row['group_avatar'])) ? get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR') : '<img src="' . $phpbb_admin_path . 'images/no_avatar.gif" alt="" />';
|
||||
$avatar_img = (!empty($group_row['group_avatar'])) ? get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR') : '<img src="' . PHPBB_ADMIN_PATH . 'images/no_avatar.gif" alt="" />';
|
||||
|
||||
$display_gallery = (isset($_POST['display_gallery'])) ? true : false;
|
||||
$display_gallery = request::is_set_post('display_gallery');
|
||||
|
||||
if ($config['allow_avatar_local'] && $display_gallery)
|
||||
{
|
||||
@@ -519,7 +531,7 @@ class acp_groups
|
||||
switch ($back_link)
|
||||
{
|
||||
case 'acp_users_groups':
|
||||
$u_back = append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&mode=groups&u=' . request_var('u', 0));
|
||||
$u_back = append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=users&mode=groups&u=' . request_var('u', 0));
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -547,6 +559,7 @@ class acp_groups
|
||||
'GROUP_FOUNDER_MANAGE' => (isset($group_row['group_founder_manage']) && $group_row['group_founder_manage']) ? ' checked="checked"' : '',
|
||||
'GROUP_LEGEND' => (isset($group_row['group_legend']) && $group_row['group_legend']) ? ' checked="checked"' : '',
|
||||
'GROUP_MESSAGE_LIMIT' => (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0,
|
||||
'GROUP_MAX_RECIPIENTS' => (isset($group_row['group_max_recipients'])) ? $group_row['group_max_recipients'] : 0,
|
||||
'GROUP_COLOUR' => (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '',
|
||||
|
||||
|
||||
@@ -574,7 +587,7 @@ class acp_groups
|
||||
'GROUP_HIDDEN' => $type_hidden,
|
||||
|
||||
'U_BACK' => $u_back,
|
||||
'U_SWATCH' => append_sid("{$phpbb_admin_path}swatch.$phpEx", 'form=settings&name=group_colour'),
|
||||
'U_SWATCH' => append_sid(PHPBB_ADMIN_PATH . 'swatch.' . PHP_EXT, 'form=settings&name=group_colour'),
|
||||
'U_ACTION' => "{$this->u_action}&action=$action&g=$group_id",
|
||||
'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)),
|
||||
)
|
||||
@@ -604,7 +617,7 @@ class acp_groups
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$template->assign_block_vars('leader', array(
|
||||
'U_USER_EDIT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&action=edit&u={$row['user_id']}"),
|
||||
'U_USER_EDIT' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=users&action=edit&u={$row['user_id']}"),
|
||||
|
||||
'USERNAME' => $row['username'],
|
||||
'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false,
|
||||
@@ -643,7 +656,7 @@ class acp_groups
|
||||
|
||||
'U_ACTION' => $this->u_action . "&g=$group_id",
|
||||
'U_BACK' => $this->u_action,
|
||||
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=list&field=usernames'),
|
||||
'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=list&field=usernames'),
|
||||
'U_DEFAULT_ALL' => "{$this->u_action}&action=default&g=$group_id",
|
||||
));
|
||||
|
||||
@@ -670,7 +683,7 @@ class acp_groups
|
||||
}
|
||||
|
||||
$template->assign_block_vars('member', array(
|
||||
'U_USER_EDIT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&action=edit&u={$row['user_id']}"),
|
||||
'U_USER_EDIT' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=users&action=edit&u={$row['user_id']}"),
|
||||
|
||||
'USERNAME' => $row['username'],
|
||||
'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false,
|
||||
@@ -739,14 +752,14 @@ class acp_groups
|
||||
foreach ($row_ary as $group_id => $row)
|
||||
{
|
||||
$group_name = (!empty($user->lang['G_' . $row['group_name']]))? $user->lang['G_' . $row['group_name']] : $row['group_name'];
|
||||
|
||||
|
||||
$template->assign_block_vars('groups', array(
|
||||
'U_LIST' => "{$this->u_action}&action=list&g=$group_id",
|
||||
'U_EDIT' => "{$this->u_action}&action=edit&g=$group_id",
|
||||
'U_DELETE' => ($auth->acl_get('a_groupdel')) ? "{$this->u_action}&action=delete&g=$group_id" : '',
|
||||
|
||||
'S_GROUP_SPECIAL' => ($row['group_type'] == GROUP_SPECIAL) ? true : false,
|
||||
|
||||
|
||||
'GROUP_NAME' => $group_name,
|
||||
'TOTAL_MEMBERS' => $row['total_members'],
|
||||
)
|
||||
|
@@ -26,16 +26,15 @@ class acp_icons
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $user, $auth, $template, $cache, $config;
|
||||
|
||||
$user->add_lang('acp/posting');
|
||||
|
||||
// Set up general vars
|
||||
$action = request_var('action', '');
|
||||
$action = (isset($_POST['add'])) ? 'add' : $action;
|
||||
$action = (isset($_POST['edit'])) ? 'edit' : $action;
|
||||
$action = (isset($_POST['import'])) ? 'import' : $action;
|
||||
$action = (request::is_set_post('add')) ? 'add' : $action;
|
||||
$action = (request::is_set_post('edit')) ? 'edit' : $action;
|
||||
$action = (request::is_set_post('import')) ? 'import' : $action;
|
||||
$icon_id = request_var('id', 0);
|
||||
|
||||
$mode = ($mode == 'smilies') ? 'smilies' : 'icons';
|
||||
@@ -69,13 +68,20 @@ class acp_icons
|
||||
// Grab file list of paks and images
|
||||
if ($action == 'edit' || $action == 'add' || $action == 'import')
|
||||
{
|
||||
$imglist = filelist($phpbb_root_path . $img_path, '');
|
||||
$imglist = filelist(PHPBB_ROOT_PATH . $img_path, '');
|
||||
|
||||
foreach ($imglist as $path => $img_ary)
|
||||
{
|
||||
if (empty($img_ary))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
asort($img_ary, SORT_STRING);
|
||||
|
||||
foreach ($img_ary as $img)
|
||||
{
|
||||
$img_size = getimagesize($phpbb_root_path . $img_path . '/' . $path . $img);
|
||||
$img_size = getimagesize(PHPBB_ROOT_PATH . $img_path . '/' . $path . $img);
|
||||
|
||||
if (!$img_size[0] || !$img_size[1] || strlen($img) > 255)
|
||||
{
|
||||
@@ -89,16 +95,21 @@ class acp_icons
|
||||
}
|
||||
unset($imglist);
|
||||
|
||||
if ($dir = @opendir($phpbb_root_path . $img_path))
|
||||
if ($dir = @opendir(PHPBB_ROOT_PATH . $img_path))
|
||||
{
|
||||
while (($file = readdir($dir)) !== false)
|
||||
{
|
||||
if (is_file($phpbb_root_path . $img_path . '/' . $file) && preg_match('#\.pak$#i', $file))
|
||||
if (is_file(PHPBB_ROOT_PATH . $img_path . '/' . $file) && preg_match('#\.pak$#i', $file))
|
||||
{
|
||||
$_paks[] = $file;
|
||||
}
|
||||
}
|
||||
closedir($dir);
|
||||
|
||||
if (!empty($_paks))
|
||||
{
|
||||
asort($_paks, SORT_STRING);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,7 +265,7 @@ class acp_icons
|
||||
$template->assign_block_vars('items', array(
|
||||
'IMG' => $img,
|
||||
'A_IMG' => addslashes($img),
|
||||
'IMG_SRC' => $phpbb_root_path . $img_path . '/' . $img,
|
||||
'IMG_SRC' => PHPBB_ROOT_PATH . $img_path . '/' . $img,
|
||||
|
||||
'CODE' => ($mode == 'smilies' && isset($img_row['code'])) ? $img_row['code'] : '',
|
||||
'EMOTION' => ($mode == 'smilies' && isset($img_row['emotion'])) ? $img_row['emotion'] : '',
|
||||
@@ -278,9 +289,9 @@ class acp_icons
|
||||
'S_ADD_ORDER_LIST_DISPLAY' => $add_order_list . $add_order_lists[1],
|
||||
'S_ADD_ORDER_LIST_UNDISPLAY' => $add_order_list . $add_order_lists[0],
|
||||
|
||||
'IMG_SRC' => $phpbb_root_path . $img_path . '/' . $default_row['smiley_url'],
|
||||
'IMG_SRC' => PHPBB_ROOT_PATH . $img_path . '/' . $default_row['smiley_url'],
|
||||
'IMG_PATH' => $img_path,
|
||||
'PHPBB_ROOT_PATH' => $phpbb_root_path,
|
||||
'PHPBB_ROOT_PATH' => PHPBB_ROOT_PATH,
|
||||
|
||||
'CODE' => $default_row['code'],
|
||||
'EMOTION' => $default_row['emotion'],
|
||||
@@ -298,20 +309,20 @@ class acp_icons
|
||||
case 'modify':
|
||||
|
||||
// Get items to create/modify
|
||||
$images = (isset($_POST['image'])) ? array_keys(request_var('image', array('' => 0))) : array();
|
||||
$images = array_keys(request::variable('image', array('' => 0), false, request::POST));
|
||||
|
||||
// Now really get the items
|
||||
$image_id = (isset($_POST['id'])) ? request_var('id', array('' => 0)) : array();
|
||||
$image_order = (isset($_POST['order'])) ? request_var('order', array('' => 0)) : array();
|
||||
$image_width = (isset($_POST['width'])) ? request_var('width', array('' => 0)) : array();
|
||||
$image_height = (isset($_POST['height'])) ? request_var('height', array('' => 0)) : array();
|
||||
$image_add = (isset($_POST['add_img'])) ? request_var('add_img', array('' => 0)) : array();
|
||||
$image_emotion = utf8_normalize_nfc(request_var('emotion', array('' => ''), true));
|
||||
$image_code = utf8_normalize_nfc(request_var('code', array('' => ''), true));
|
||||
$image_display_on_posting = (isset($_POST['display_on_posting'])) ? request_var('display_on_posting', array('' => 0)) : array();
|
||||
$image_id = request::variable('id', array('' => 0), false, request::POST);
|
||||
$image_order = request::variable('order', array('' => 0), false, request::POST);
|
||||
$image_width = request::variable('width', array('' => 0), false, request::POST);
|
||||
$image_height = request::variable('height', array('' => 0), false, request::POST);
|
||||
$image_add = request::variable('add_img', array('' => 0), false, request::POST);
|
||||
$image_display_on_posting = request::variable('display_on_posting', array('' => 0), false, request::POST);
|
||||
$image_emotion = utf8_normalize_nfc(request_var('emotion', array('' => ''), true));
|
||||
$image_code = utf8_normalize_nfc(request_var('code', array('' => ''), true));
|
||||
|
||||
// Ok, add the relevant bits if we are adding new codes to existing emoticons...
|
||||
if (!empty($_POST['add_additional_code']))
|
||||
if (request::variable('add_additional_code', false, false, request::POST))
|
||||
{
|
||||
$add_image = request_var('add_image', '');
|
||||
$add_code = utf8_normalize_nfc(request_var('add_code', '', true));
|
||||
@@ -327,7 +338,7 @@ class acp_icons
|
||||
$image_width[$add_image] = request_var('add_width', 0);
|
||||
$image_height[$add_image] = request_var('add_height', 0);
|
||||
|
||||
if (!empty($_POST['add_display_on_posting']))
|
||||
if (request::variable('add_display_on_posting', false, false, request::POST))
|
||||
{
|
||||
$image_display_on_posting[$add_image] = 1;
|
||||
}
|
||||
@@ -352,7 +363,7 @@ class acp_icons
|
||||
{
|
||||
if ($image_width[$image] == 0 || $image_height[$image] == 0)
|
||||
{
|
||||
$img_size = getimagesize($phpbb_root_path . $img_path . '/' . $image);
|
||||
$img_size = getimagesize(PHPBB_ROOT_PATH . $img_path . '/' . $image);
|
||||
$image_width[$image] = $img_size[0];
|
||||
$image_height[$image] = $img_size[1];
|
||||
}
|
||||
@@ -436,7 +447,7 @@ class acp_icons
|
||||
default:
|
||||
$suc_lang = $lang;
|
||||
}
|
||||
$errormsgs = '<br />';
|
||||
$errormsgs = '';
|
||||
foreach ($errors as $img => $error)
|
||||
{
|
||||
$errormsgs .= '<br />' . sprintf($user->lang[$error], $img);
|
||||
@@ -447,7 +458,7 @@ class acp_icons
|
||||
}
|
||||
else
|
||||
{
|
||||
trigger_error($user->lang[$suc_lang . '_ADDED'] . $errormsgs .adm_back_link($this->u_action), $level);
|
||||
trigger_error($user->lang[$suc_lang . '_ADDED'] . $errormsgs . adm_back_link($this->u_action), $level);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -461,7 +472,7 @@ class acp_icons
|
||||
{
|
||||
$order = 0;
|
||||
|
||||
if (!($pak_ary = @file($phpbb_root_path . $img_path . '/' . $pak)))
|
||||
if (!($pak_ary = @file(PHPBB_ROOT_PATH . $img_path . '/' . $pak)))
|
||||
{
|
||||
trigger_error($user->lang['PAK_FILE_NOT_READABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
@@ -487,16 +498,13 @@ class acp_icons
|
||||
// The user has already selected a smilies_pak file
|
||||
if ($current == 'delete')
|
||||
{
|
||||
switch ($db->sql_layer)
|
||||
if ($db->truncate)
|
||||
{
|
||||
case 'sqlite':
|
||||
case 'firebird':
|
||||
$db->sql_query('DELETE FROM ' . $table);
|
||||
break;
|
||||
|
||||
default:
|
||||
$db->sql_query('TRUNCATE TABLE ' . $table);
|
||||
break;
|
||||
$db->sql_query('TRUNCATE TABLE ' . $table);
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->sql_query('DELETE FROM ' . $table);
|
||||
}
|
||||
|
||||
switch ($mode)
|
||||
@@ -836,7 +844,7 @@ class acp_icons
|
||||
$template->assign_block_vars('items', array(
|
||||
'S_SPACER' => (!$spacer && !$row['display_on_posting']) ? true : false,
|
||||
'ALT_TEXT' => $alt_text,
|
||||
'IMG_SRC' => $phpbb_root_path . $img_path . '/' . $row[$fields . '_url'],
|
||||
'IMG_SRC' => PHPBB_ROOT_PATH . $img_path . '/' . $row[$fields . '_url'],
|
||||
'WIDTH' => $row[$fields . '_width'],
|
||||
'HEIGHT' => $row[$fields . '_height'],
|
||||
'CODE' => (isset($row['code'])) ? $row['code'] : '',
|
||||
|
17
phpBB/includes/acp/acp_inactive.php
Executable file → Normal file
17
phpBB/includes/acp/acp_inactive.php
Executable file → Normal file
@@ -24,7 +24,7 @@ class acp_inactive
|
||||
var $u_action;
|
||||
var $p_master;
|
||||
|
||||
function acp_inactive(&$p_master)
|
||||
function __construct(&$p_master)
|
||||
{
|
||||
$this->p_master = &$p_master;
|
||||
}
|
||||
@@ -32,16 +32,15 @@ class acp_inactive
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
|
||||
|
||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||
include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||
|
||||
$user->add_lang('memberlist');
|
||||
|
||||
$action = request_var('action', '');
|
||||
$mark = (isset($_REQUEST['mark'])) ? request_var('mark', array(0)) : array();
|
||||
$mark = request_var('mark', array(0));
|
||||
$start = request_var('start', 0);
|
||||
$submit = isset($_POST['submit']);
|
||||
$submit = request::is_set_post('submit');
|
||||
|
||||
// Sort keys
|
||||
$sort_days = request_var('st', 0);
|
||||
@@ -98,7 +97,7 @@ class acp_inactive
|
||||
|
||||
if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !empty($inactive_users))
|
||||
{
|
||||
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
|
||||
|
||||
$messenger = new messenger();
|
||||
|
||||
@@ -167,7 +166,7 @@ class acp_inactive
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
// Send the messages
|
||||
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
|
||||
|
||||
$messenger = new messenger();
|
||||
$usernames = array();
|
||||
@@ -182,7 +181,7 @@ class acp_inactive
|
||||
$messenger->assign_vars(array(
|
||||
'USERNAME' => htmlspecialchars_decode($row['username']),
|
||||
'REGISTER_DATE' => $user->format_date($row['user_regdate']),
|
||||
'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey'])
|
||||
'U_ACTIVATE' => generate_board_url() . '/ucp.' . PHP_EXT . '?mode=activate&u=' . $row['user_id'] . '&k=' . $row['user_actkey'])
|
||||
);
|
||||
|
||||
$messenger->send($row['user_notify_type']);
|
||||
@@ -228,7 +227,7 @@ class acp_inactive
|
||||
'REASON' => $row['inactive_reason'],
|
||||
'USER_ID' => $row['user_id'],
|
||||
'USERNAME' => $row['username'],
|
||||
'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&mode=overview&u={$row['user_id']}"))
|
||||
'U_USER_ADMIN' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=users&mode=overview&u={$row['user_id']}"))
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -26,15 +26,14 @@ class acp_jabber
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $user, $auth, $template, $config;
|
||||
|
||||
$user->add_lang('acp/board');
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/functions_jabber.' . PHP_EXT);
|
||||
|
||||
$action = request_var('action', '');
|
||||
$submit = (isset($_POST['submit'])) ? true : false;
|
||||
$submit = request::is_set_post('submit');
|
||||
|
||||
if ($mode != 'settings')
|
||||
{
|
||||
@@ -85,6 +84,19 @@ class acp_jabber
|
||||
|
||||
$jabber->disconnect();
|
||||
}
|
||||
else
|
||||
{
|
||||
// This feature is disabled.
|
||||
// We update the user table to be sure all users that have IM as notify type are set to both as notify type
|
||||
$sql_ary = array(
|
||||
'user_notify_type' => NOTIFY_BOTH,
|
||||
);
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
||||
WHERE user_notify_type = ' . NOTIFY_IM;
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
set_config('jab_enable', $jab_enable);
|
||||
set_config('jab_host', $jab_host);
|
||||
|
@@ -32,36 +32,45 @@ class acp_language
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template, $cache;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
|
||||
global $safe_mode, $file_uploads;
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||
/**
|
||||
* @todo make this work with the request class, might require some additional functionality
|
||||
* inside the request class. Reducing some of the redundance of this code would certainly
|
||||
* not hurt either.
|
||||
*/
|
||||
request::enable_super_globals();
|
||||
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||
|
||||
$this->default_variables();
|
||||
|
||||
// Check and set some common vars
|
||||
|
||||
$action = (isset($_POST['update_details'])) ? 'update_details' : '';
|
||||
$action = (isset($_POST['download_file'])) ? 'download_file' : $action;
|
||||
$action = (isset($_POST['upload_file'])) ? 'upload_file' : $action;
|
||||
$action = (isset($_POST['upload_data'])) ? 'upload_data' : $action;
|
||||
$action = (isset($_POST['submit_file'])) ? 'submit_file' : $action;
|
||||
$action = (isset($_POST['remove_store'])) ? 'details' : $action;
|
||||
$action = (request::is_set_post('update_details')) ? 'update_details' : '';
|
||||
$action = (request::is_set_post('download_file')) ? 'download_file' : $action;
|
||||
$action = (request::is_set_post('upload_file')) ? 'upload_file' : $action;
|
||||
$action = (request::is_set_post('upload_data')) ? 'upload_data' : $action;
|
||||
$action = (request::is_set_post('submit_file')) ? 'submit_file' : $action;
|
||||
$action = (request::is_set_post('remove_store')) ? 'details' : $action;
|
||||
|
||||
$submit = (empty($action) && !isset($_POST['update']) && !isset($_POST['test_connection'])) ? false : true;
|
||||
$submit = (empty($action) && !request::is_set_post('update') && !request::is_set_post('test_connection')) ? false : true;
|
||||
$action = (empty($action)) ? request_var('action', '') : $action;
|
||||
|
||||
$form_name = 'acp_lang';
|
||||
add_form_key('acp_lang');
|
||||
|
||||
$lang_id = request_var('id', 0);
|
||||
if (isset($_POST['missing_file']))
|
||||
if (request::is_set_post('missing_file'))
|
||||
{
|
||||
$missing_file = request_var('missing_file', array('' => 0));
|
||||
list($_REQUEST['language_file'], ) = array_keys($missing_file);
|
||||
/**
|
||||
* @todo Do NOT overwrite a request variable.
|
||||
*/
|
||||
request::overwrite('language_file', key($missing_file));
|
||||
}
|
||||
|
||||
$selected_lang_file = request_var('language_file', '|common.' . $phpEx);
|
||||
$selected_lang_file = request_var('language_file', '|common.' . PHP_EXT);
|
||||
|
||||
list($this->language_directory, $this->language_file) = explode('|', $selected_lang_file);
|
||||
|
||||
@@ -78,7 +87,7 @@ class acp_language
|
||||
$action = 'upload_file';
|
||||
$method = request_var('method', '');
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/functions_transfer.' . PHP_EXT);
|
||||
|
||||
switch ($method)
|
||||
{
|
||||
@@ -103,7 +112,7 @@ class acp_language
|
||||
{
|
||||
case 'upload_file':
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/functions_transfer.' . PHP_EXT);
|
||||
|
||||
$method = request_var('method', '');
|
||||
|
||||
@@ -115,11 +124,12 @@ class acp_language
|
||||
$requested_data = call_user_func(array($method, 'data'));
|
||||
foreach ($requested_data as $data => $default)
|
||||
{
|
||||
$default_value = request_var($data, '');
|
||||
$template->assign_block_vars('data', array(
|
||||
'DATA' => $data,
|
||||
'NAME' => $user->lang[strtoupper($method . '_' . $data)],
|
||||
'EXPLAIN' => $user->lang[strtoupper($method . '_' . $data) . '_EXPLAIN'],
|
||||
'DEFAULT' => (!empty($_REQUEST[$data])) ? request_var($data, '') : $default
|
||||
'DEFAULT' => (empty($default_value)) ? $default : $default_value
|
||||
));
|
||||
}
|
||||
|
||||
@@ -130,6 +140,9 @@ class acp_language
|
||||
'method' => $method)
|
||||
);
|
||||
|
||||
/**
|
||||
* @todo Do not use $_POST here, but request::variable which needs to support more dimensions
|
||||
*/
|
||||
$hidden_data .= build_hidden_fields(array('entry' => $_POST['entry']), true, STRIP);
|
||||
|
||||
$template->assign_vars(array(
|
||||
@@ -219,7 +232,7 @@ class acp_language
|
||||
{
|
||||
case 'email':
|
||||
// Get email templates
|
||||
$email_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'email', 'txt');
|
||||
$email_files = filelist(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'], 'email', 'txt');
|
||||
$email_files = $email_files['email/'];
|
||||
|
||||
if (!in_array($this->language_file, $email_files))
|
||||
@@ -230,7 +243,7 @@ class acp_language
|
||||
|
||||
case 'acp':
|
||||
// Get acp files
|
||||
$acp_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'acp', $phpEx);
|
||||
$acp_files = filelist(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'], 'acp', PHP_EXT);
|
||||
$acp_files = $acp_files['acp/'];
|
||||
|
||||
if (!in_array($this->language_file, $acp_files))
|
||||
@@ -241,7 +254,7 @@ class acp_language
|
||||
|
||||
case 'mods':
|
||||
// Get mod files
|
||||
$mods_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'mods', $phpEx);
|
||||
$mods_files = filelist(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'], 'mods', PHP_EXT);
|
||||
$mods_files = (isset($mods_files['mods/'])) ? $mods_files['mods/'] : array();
|
||||
|
||||
if (!in_array($this->language_file, $mods_files))
|
||||
@@ -269,7 +282,7 @@ class acp_language
|
||||
|
||||
foreach ($mkdir_ary as $dir)
|
||||
{
|
||||
$dir = $phpbb_root_path . 'store/' . $dir;
|
||||
$dir = PHPBB_ROOT_PATH . 'store/' . $dir;
|
||||
|
||||
if (!is_dir($dir))
|
||||
{
|
||||
@@ -284,7 +297,7 @@ class acp_language
|
||||
|
||||
// Get target filename for storage folder
|
||||
$filename = $this->get_filename($row['lang_iso'], $this->language_directory, $this->language_file, true, true);
|
||||
$fp = @fopen($phpbb_root_path . $filename, 'wb');
|
||||
$fp = @fopen(PHPBB_ROOT_PATH . $filename, 'wb');
|
||||
|
||||
if (!$fp)
|
||||
{
|
||||
@@ -354,7 +367,7 @@ class acp_language
|
||||
header('Content-Type: application/octetstream; name="' . $this->language_file . '"');
|
||||
header('Content-disposition: attachment; filename=' . $this->language_file);
|
||||
|
||||
$fp = @fopen($phpbb_root_path . $filename, 'rb');
|
||||
$fp = @fopen(PHPBB_ROOT_PATH . $filename, 'rb');
|
||||
while ($buffer = fread($fp, 1024))
|
||||
{
|
||||
echo $buffer;
|
||||
@@ -382,7 +395,7 @@ class acp_language
|
||||
$old_file = '/' . $this->get_filename($row['lang_iso'], $dir, $file, false, true);
|
||||
$lang_path = 'language/' . $row['lang_iso'] . '/' . (($dir) ? $dir . '/' : '');
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/functions_transfer.' . PHP_EXT);
|
||||
$method = request_var('method', '');
|
||||
|
||||
if ($method != 'ftp' && $method != 'ftp_fsock')
|
||||
@@ -412,9 +425,9 @@ class acp_language
|
||||
$transfer->close_session();
|
||||
|
||||
// Remove from storage folder
|
||||
if (file_exists($phpbb_root_path . 'store/' . $lang_path . $file))
|
||||
if (file_exists(PHPBB_ROOT_PATH . 'store/' . $lang_path . $file))
|
||||
{
|
||||
@unlink($phpbb_root_path . 'store/' . $lang_path . $file);
|
||||
@unlink(PHPBB_ROOT_PATH . 'store/' . $lang_path . $file);
|
||||
}
|
||||
|
||||
add_log('admin', 'LOG_LANGUAGE_FILE_REPLACED', $file);
|
||||
@@ -447,15 +460,15 @@ class acp_language
|
||||
$missing_vars = $missing_files = array();
|
||||
|
||||
// Get email templates
|
||||
$email_files = filelist($phpbb_root_path . 'language/' . $config['default_lang'], 'email', 'txt');
|
||||
$email_files = filelist(PHPBB_ROOT_PATH . 'language/' . $config['default_lang'], 'email', 'txt');
|
||||
$email_files = $email_files['email/'];
|
||||
|
||||
// Get acp files
|
||||
$acp_files = filelist($phpbb_root_path . 'language/' . $config['default_lang'], 'acp', $phpEx);
|
||||
$acp_files = filelist(PHPBB_ROOT_PATH . 'language/' . $config['default_lang'], 'acp', PHP_EXT);
|
||||
$acp_files = $acp_files['acp/'];
|
||||
|
||||
// Get mod files
|
||||
$mods_files = filelist($phpbb_root_path . 'language/' . $config['default_lang'], 'mods', $phpEx);
|
||||
$mods_files = filelist(PHPBB_ROOT_PATH . 'language/' . $config['default_lang'], 'mods', PHP_EXT);
|
||||
$mods_files = (isset($mods_files['mods/'])) ? $mods_files['mods/'] : array();
|
||||
|
||||
// Check if our current filename matches the files
|
||||
@@ -489,17 +502,17 @@ class acp_language
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['remove_store']))
|
||||
if (request::is_set_post('remove_store'))
|
||||
{
|
||||
$store_filename = $this->get_filename($lang_iso, $this->language_directory, $this->language_file, true, true);
|
||||
|
||||
if (file_exists($phpbb_root_path . $store_filename))
|
||||
if (file_exists(PHPBB_ROOT_PATH . $store_filename))
|
||||
{
|
||||
@unlink($phpbb_root_path . $store_filename);
|
||||
@unlink(PHPBB_ROOT_PATH . $store_filename);
|
||||
}
|
||||
}
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/functions_transfer.' . PHP_EXT);
|
||||
|
||||
$methods = transfer::methods();
|
||||
|
||||
@@ -529,7 +542,7 @@ class acp_language
|
||||
|
||||
foreach ($this->main_files as $file)
|
||||
{
|
||||
if (file_exists($phpbb_root_path . $this->get_filename($lang_iso, '', $file)))
|
||||
if (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, '', $file)))
|
||||
{
|
||||
$missing_vars[$file] = $this->compare_language_files($config['default_lang'], $lang_iso, '', $file);
|
||||
|
||||
@@ -547,7 +560,7 @@ class acp_language
|
||||
// Now go through acp/mods directories
|
||||
foreach ($acp_files as $file)
|
||||
{
|
||||
if (file_exists($phpbb_root_path . $this->get_filename($lang_iso, 'acp', $file)))
|
||||
if (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, 'acp', $file)))
|
||||
{
|
||||
$missing_vars['acp/' . $file] = $this->compare_language_files($config['default_lang'], $lang_iso, 'acp', $file);
|
||||
|
||||
@@ -566,7 +579,7 @@ class acp_language
|
||||
{
|
||||
foreach ($mods_files as $file)
|
||||
{
|
||||
if (file_exists($phpbb_root_path . $this->get_filename($lang_iso, 'mods', $file)))
|
||||
if (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, 'mods', $file)))
|
||||
{
|
||||
$missing_vars['mods/' . $file] = $this->compare_language_files($config['default_lang'], $lang_iso, 'mods', $file);
|
||||
|
||||
@@ -585,7 +598,7 @@ class acp_language
|
||||
// More missing files... for example email templates?
|
||||
foreach ($email_files as $file)
|
||||
{
|
||||
if (!file_exists($phpbb_root_path . $this->get_filename($lang_iso, 'email', $file)))
|
||||
if (!file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, 'email', $file)))
|
||||
{
|
||||
$missing_files[] = $this->get_filename($lang_iso, 'email', $file);
|
||||
}
|
||||
@@ -625,7 +638,7 @@ class acp_language
|
||||
}
|
||||
|
||||
// Main language files
|
||||
$s_lang_options = '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang['LANGUAGE_FILES'] . '</option>';
|
||||
$s_lang_options = '<option value="|common.' . PHP_EXT . '" class="sep">' . $user->lang['LANGUAGE_FILES'] . '</option>';
|
||||
foreach ($this->main_files as $file)
|
||||
{
|
||||
if (strpos($file, 'help_') === 0)
|
||||
@@ -633,14 +646,14 @@ class acp_language
|
||||
continue;
|
||||
}
|
||||
|
||||
$prefix = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, '', $file, true, true))) ? '* ' : '';
|
||||
$prefix = (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, '', $file, true, true))) ? '* ' : '';
|
||||
|
||||
$selected = (!$this->language_directory && $this->language_file == $file) ? ' selected="selected"' : '';
|
||||
$s_lang_options .= '<option value="|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
|
||||
}
|
||||
|
||||
// Help Files
|
||||
$s_lang_options .= '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang['HELP_FILES'] . '</option>';
|
||||
$s_lang_options .= '<option value="|common.' . PHP_EXT . '" class="sep">' . $user->lang['HELP_FILES'] . '</option>';
|
||||
foreach ($this->main_files as $file)
|
||||
{
|
||||
if (strpos($file, 'help_') !== 0)
|
||||
@@ -648,7 +661,7 @@ class acp_language
|
||||
continue;
|
||||
}
|
||||
|
||||
$prefix = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, '', $file, true, true))) ? '* ' : '';
|
||||
$prefix = (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, '', $file, true, true))) ? '* ' : '';
|
||||
|
||||
$selected = (!$this->language_directory && $this->language_file == $file) ? ' selected="selected"' : '';
|
||||
$s_lang_options .= '<option value="|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
|
||||
@@ -664,11 +677,11 @@ class acp_language
|
||||
continue;
|
||||
}
|
||||
|
||||
$s_lang_options .= '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang[strtoupper($check) . '_FILES'] . '</option>';
|
||||
$s_lang_options .= '<option value="|common.' . PHP_EXT . '" class="sep">' . $user->lang[strtoupper($check) . '_FILES'] . '</option>';
|
||||
|
||||
foreach (${$check . '_files'} as $file)
|
||||
{
|
||||
$prefix = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, $check, $file, true, true))) ? '* ' : '';
|
||||
$prefix = (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, $check, $file, true, true))) ? '* ' : '';
|
||||
|
||||
$selected = ($this->language_directory == $check && $this->language_file == $file) ? ' selected="selected"' : '';
|
||||
$s_lang_options .= '<option value="' . $check . '|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
|
||||
@@ -681,10 +694,10 @@ class acp_language
|
||||
$is_email_file = ($this->language_directory == 'email') ? true : false;
|
||||
$is_help_file = (strpos($this->language_file, 'help_') === 0) ? true : false;
|
||||
|
||||
$file_from_store = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, true, true))) ? true : false;
|
||||
$file_from_store = (file_exists(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, true, true))) ? true : false;
|
||||
$no_store_filename = $this->get_filename($lang_iso, $this->language_directory, $this->language_file);
|
||||
|
||||
if (!$file_from_store && !file_exists($phpbb_root_path . $no_store_filename))
|
||||
if (!$file_from_store && !file_exists(PHPBB_ROOT_PATH . $no_store_filename))
|
||||
{
|
||||
$print_message = sprintf($user->lang['MISSING_LANGUAGE_FILE'], $no_store_filename);
|
||||
}
|
||||
@@ -692,12 +705,12 @@ class acp_language
|
||||
{
|
||||
if ($is_email_file)
|
||||
{
|
||||
$lang = file_get_contents($phpbb_root_path . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, $file_from_store));
|
||||
$lang = file_get_contents(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, $file_from_store));
|
||||
}
|
||||
else
|
||||
{
|
||||
$help = array();
|
||||
include($phpbb_root_path . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, $file_from_store));
|
||||
include(PHPBB_ROOT_PATH . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, $file_from_store));
|
||||
|
||||
if ($is_help_file)
|
||||
{
|
||||
@@ -794,12 +807,12 @@ class acp_language
|
||||
$lang_iso = request_var('iso', '');
|
||||
$lang_iso = basename($lang_iso);
|
||||
|
||||
if (!$lang_iso || !file_exists("{$phpbb_root_path}language/$lang_iso/iso.txt"))
|
||||
if (!$lang_iso || !file_exists(PHPBB_ROOT_PATH . "language/$lang_iso/iso.txt"))
|
||||
{
|
||||
trigger_error($user->lang['LANGUAGE_PACK_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$file = file("{$phpbb_root_path}language/$lang_iso/iso.txt");
|
||||
$file = file(PHPBB_ROOT_PATH . "language/$lang_iso/iso.txt");
|
||||
|
||||
$lang_pack = array(
|
||||
'iso' => $lang_iso,
|
||||
@@ -849,9 +862,9 @@ class acp_language
|
||||
$result = $db->sql_query($sql);
|
||||
while ($imageset_row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if (@file_exists("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/{$lang_pack['iso']}/imageset.cfg"))
|
||||
if (@file_exists(PHPBB_ROOT_PATH . "styles/{$imageset_row['imageset_path']}/imageset/{$lang_pack['iso']}/imageset.cfg"))
|
||||
{
|
||||
$cfg_data_imageset_data = parse_cfg_file("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/{$lang_pack['iso']}/imageset.cfg");
|
||||
$cfg_data_imageset_data = parse_cfg_file(PHPBB_ROOT_PATH . "styles/{$imageset_row['imageset_path']}/imageset/{$lang_pack['iso']}/imageset.cfg");
|
||||
foreach ($cfg_data_imageset_data as $image_name => $value)
|
||||
{
|
||||
if (strpos($value, '*') !== false)
|
||||
@@ -994,41 +1007,41 @@ class acp_language
|
||||
$use_method = '.tar';
|
||||
}
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_compress.' . $phpEx);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/functions_compress.' . PHP_EXT);
|
||||
|
||||
if ($use_method == '.zip')
|
||||
{
|
||||
$compress = new compress_zip('w', $phpbb_root_path . 'store/lang_' . $row['lang_iso'] . $use_method);
|
||||
$compress = new compress_zip('w', PHPBB_ROOT_PATH . 'store/lang_' . $row['lang_iso'] . $use_method);
|
||||
}
|
||||
else
|
||||
{
|
||||
$compress = new compress_tar('w', $phpbb_root_path . 'store/lang_' . $row['lang_iso'] . $use_method, $use_method);
|
||||
$compress = new compress_tar('w', PHPBB_ROOT_PATH . 'store/lang_' . $row['lang_iso'] . $use_method, $use_method);
|
||||
}
|
||||
|
||||
// Get email templates
|
||||
$email_templates = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'email', 'txt');
|
||||
$email_templates = filelist(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'], 'email', 'txt');
|
||||
$email_templates = $email_templates['email/'];
|
||||
|
||||
// Get acp files
|
||||
$acp_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'acp', $phpEx);
|
||||
$acp_files = filelist(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'], 'acp', PHP_EXT);
|
||||
$acp_files = $acp_files['acp/'];
|
||||
|
||||
// Get mod files
|
||||
$mod_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'mods', $phpEx);
|
||||
$mod_files = filelist(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'], 'mods', PHP_EXT);
|
||||
$mod_files = (isset($mod_files['mods/'])) ? $mod_files['mods/'] : array();
|
||||
|
||||
// Add main files
|
||||
$this->add_to_archive($compress, $this->main_files, $row['lang_iso']);
|
||||
|
||||
// Add search files if they exist...
|
||||
if (file_exists($phpbb_root_path . 'language/' . $row['lang_iso'] . '/search_ignore_words.' . $phpEx))
|
||||
if (file_exists(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'] . '/search_ignore_words.' . PHP_EXT))
|
||||
{
|
||||
$this->add_to_archive($compress, array("search_ignore_words.$phpEx"), $row['lang_iso']);
|
||||
$this->add_to_archive($compress, array('search_ignore_words.' . PHP_EXT), $row['lang_iso']);
|
||||
}
|
||||
|
||||
if (file_exists($phpbb_root_path . 'language/' . $row['lang_iso'] . '/search_synonyms.' . $phpEx))
|
||||
if (file_exists(PHPBB_ROOT_PATH . 'language/' . $row['lang_iso'] . '/search_synonyms.' . PHP_EXT))
|
||||
{
|
||||
$this->add_to_archive($compress, array("search_synonyms.$phpEx"), $row['lang_iso']);
|
||||
$this->add_to_archive($compress, array('search_synonyms.' . PHP_EXT), $row['lang_iso']);
|
||||
}
|
||||
|
||||
// Write files in folders
|
||||
@@ -1055,7 +1068,7 @@ class acp_language
|
||||
$compress->close();
|
||||
|
||||
$compress->download('lang_' . $row['lang_iso']);
|
||||
@unlink($phpbb_root_path . 'store/lang_' . $row['lang_iso'] . $use_method);
|
||||
@unlink(PHPBB_ROOT_PATH . 'store/lang_' . $row['lang_iso'] . $use_method);
|
||||
|
||||
exit;
|
||||
|
||||
@@ -1101,17 +1114,17 @@ class acp_language
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$new_ary = $iso = array();
|
||||
$dp = @opendir("{$phpbb_root_path}language");
|
||||
$dp = @opendir(PHPBB_ROOT_PATH . 'language');
|
||||
|
||||
if ($dp)
|
||||
{
|
||||
while (($file = readdir($dp)) !== false)
|
||||
{
|
||||
if ($file[0] != '.' && file_exists("{$phpbb_root_path}language/$file/iso.txt"))
|
||||
if ($file[0] != '.' && file_exists(PHPBB_ROOT_PATH . "language/$file/iso.txt"))
|
||||
{
|
||||
if (!in_array($file, $installed))
|
||||
{
|
||||
if ($iso = file("{$phpbb_root_path}language/$file/iso.txt"))
|
||||
if ($iso = file(PHPBB_ROOT_PATH . "language/$file/iso.txt"))
|
||||
{
|
||||
if (sizeof($iso) == 3)
|
||||
{
|
||||
@@ -1153,8 +1166,6 @@ class acp_language
|
||||
*/
|
||||
function default_variables()
|
||||
{
|
||||
global $phpEx;
|
||||
|
||||
$this->language_file_header = '<?php
|
||||
/**
|
||||
*
|
||||
@@ -1199,7 +1210,7 @@ $lang = array_merge($lang, array(
|
||||
';
|
||||
|
||||
// Language files in language root directory
|
||||
$this->main_files = array("common.$phpEx", "groups.$phpEx", "install.$phpEx", "mcp.$phpEx", "memberlist.$phpEx", "posting.$phpEx", "search.$phpEx", "ucp.$phpEx", "viewforum.$phpEx", "viewtopic.$phpEx", "help_bbcode.$phpEx", "help_faq.$phpEx");
|
||||
$this->main_files = array('common.' . PHP_EXT, 'groups.' . PHP_EXT, 'install.' . PHP_EXT, 'mcp.' . PHP_EXT, 'memberlist.' . PHP_EXT, 'posting.' . PHP_EXT, 'search.' . PHP_EXT, 'ucp.' . PHP_EXT, 'viewforum.' . PHP_EXT, 'viewtopic.' . PHP_EXT, 'help_bbcode.' . PHP_EXT, 'help_faq.' . PHP_EXT);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1207,7 +1218,7 @@ $lang = array_merge($lang, array(
|
||||
*/
|
||||
function get_filename($lang_iso, $directory, $filename, $check_store = false, $only_return_filename = false)
|
||||
{
|
||||
global $phpbb_root_path, $safe_mode;
|
||||
global $safe_mode;
|
||||
|
||||
$check_filename = "language/$lang_iso/" . (($directory) ? $directory . '/' : '') . $filename;
|
||||
|
||||
@@ -1215,7 +1226,7 @@ $lang = array_merge($lang, array(
|
||||
{
|
||||
$check_store_filename = ($safe_mode) ? "store/langfile_{$lang_iso}" . (($directory) ? '_' . $directory : '') . "_{$filename}" : "store/language/$lang_iso/" . (($directory) ? $directory . '/' : '') . $filename;
|
||||
|
||||
if (!$only_return_filename && file_exists($phpbb_root_path . $check_store_filename))
|
||||
if (!$only_return_filename && file_exists(PHPBB_ROOT_PATH . $check_store_filename))
|
||||
{
|
||||
return $check_store_filename;
|
||||
}
|
||||
@@ -1233,8 +1244,6 @@ $lang = array_merge($lang, array(
|
||||
*/
|
||||
function add_to_archive(&$compress, $filelist, $lang_iso, $directory = '')
|
||||
{
|
||||
global $phpbb_root_path;
|
||||
|
||||
foreach ($filelist as $file)
|
||||
{
|
||||
// Get source filename
|
||||
@@ -1242,7 +1251,7 @@ $lang = array_merge($lang, array(
|
||||
$destination = 'language/' . $lang_iso . '/' . (($directory) ? $directory . '/' : '') . $file;
|
||||
|
||||
// Add file to archive
|
||||
$compress->add_custom_file($phpbb_root_path . $source, $destination);
|
||||
$compress->add_custom_file(PHPBB_ROOT_PATH . $source, $destination);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1359,22 +1368,20 @@ $lang = array_merge($lang, array(
|
||||
*/
|
||||
function compare_language_files($source_lang, $dest_lang, $directory, $file)
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
|
||||
$return_ary = array();
|
||||
|
||||
$lang = array();
|
||||
include("{$phpbb_root_path}language/{$source_lang}/" . (($directory) ? $directory . '/' : '') . $file);
|
||||
include(PHPBB_ROOT_PATH . "language/{$source_lang}/" . (($directory) ? $directory . '/' : '') . $file);
|
||||
$lang_entry_src = $lang;
|
||||
|
||||
$lang = array();
|
||||
|
||||
if (!file_exists($phpbb_root_path . $this->get_filename($dest_lang, $directory, $file, true)))
|
||||
if (!file_exists(PHPBB_ROOT_PATH . $this->get_filename($dest_lang, $directory, $file, true)))
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
include($phpbb_root_path . $this->get_filename($dest_lang, $directory, $file, true));
|
||||
include(PHPBB_ROOT_PATH . $this->get_filename($dest_lang, $directory, $file, true));
|
||||
|
||||
$lang_entry_dst = $lang;
|
||||
|
||||
|
@@ -25,8 +25,7 @@ class acp_logs
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $user, $auth, $template, $cache, $config;
|
||||
|
||||
$user->add_lang('mcp');
|
||||
|
||||
@@ -34,8 +33,8 @@ class acp_logs
|
||||
$action = request_var('action', '');
|
||||
$forum_id = request_var('f', 0);
|
||||
$start = request_var('start', 0);
|
||||
$deletemark = (!empty($_POST['delmarked'])) ? true : false;
|
||||
$deleteall = (!empty($_POST['delall'])) ? true : false;
|
||||
$deletemark = request::variable('delmarked', false, false, request::POST);
|
||||
$deleteall = request::variable('delall', false, false, request::POST);
|
||||
$marked = request_var('mark', array(0));
|
||||
|
||||
// Sort keys
|
||||
|
@@ -26,7 +26,6 @@ class acp_main
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
|
||||
// Show restore permissions notice
|
||||
if ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm'))
|
||||
@@ -42,16 +41,16 @@ class acp_main
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$perm_from = '<strong' . (($user_row['user_colour']) ? ' style="color: #' . $user_row['user_colour'] . '">' : '>');
|
||||
$perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $user_row['user_id']) . '">' : '';
|
||||
$perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '<a href="' . append_sid('memberlist', 'mode=viewprofile&u=' . $user_row['user_id']) . '">' : '';
|
||||
$perm_from .= $user_row['username'];
|
||||
$perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '</a>' : '';
|
||||
$perm_from .= '</strong>';
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_RESTORE_PERMISSIONS' => true,
|
||||
'U_RESTORE_PERMISSIONS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm'),
|
||||
'U_RESTORE_PERMISSIONS' => append_sid('ucp', 'mode=restore_perm'),
|
||||
'PERM_FROM' => $perm_from,
|
||||
'L_PERMISSIONS_TRANSFERRED_EXPLAIN' => sprintf($user->lang['PERMISSIONS_TRANSFERRED_EXPLAIN'], $perm_from, append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm')),
|
||||
'L_PERMISSIONS_TRANSFERRED_EXPLAIN' => sprintf($user->lang['PERMISSIONS_TRANSFERRED_EXPLAIN'], $perm_from, append_sid('ucp', 'mode=restore_perm')),
|
||||
));
|
||||
|
||||
return;
|
||||
@@ -61,6 +60,14 @@ class acp_main
|
||||
|
||||
if ($action)
|
||||
{
|
||||
if ($action === 'admlogout')
|
||||
{
|
||||
$user->unset_admin();
|
||||
$redirect_url = append_sid(PHPBB_ROOT_PATH . 'index.' . PHP_EXT);
|
||||
meta_refresh(3, $redirect_url);
|
||||
trigger_error($user->lang['ADM_LOGGED_OUT'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect_url . '">', '</a>'));
|
||||
}
|
||||
|
||||
if (!confirm_box(true))
|
||||
{
|
||||
switch ($action)
|
||||
@@ -108,6 +115,7 @@ class acp_main
|
||||
{
|
||||
switch ($action)
|
||||
{
|
||||
|
||||
case 'online':
|
||||
if (!$auth->acl_get('a_board'))
|
||||
{
|
||||
@@ -157,12 +165,12 @@ class acp_main
|
||||
FROM ' . ATTACHMENTS_TABLE . '
|
||||
WHERE is_orphan = 0';
|
||||
$result = $db->sql_query($sql);
|
||||
set_config('upload_dir_size', (int) $db->sql_fetchfield('stat'), true);
|
||||
set_config('upload_dir_size', (float) $db->sql_fetchfield('stat'), true);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
if (!function_exists('update_last_username'))
|
||||
{
|
||||
include($phpbb_root_path . "includes/functions_user.$phpEx");
|
||||
include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||
}
|
||||
update_last_username();
|
||||
|
||||
@@ -175,22 +183,63 @@ class acp_main
|
||||
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$sql = 'SELECT COUNT(p.post_id) AS num_posts, u.user_id
|
||||
FROM ' . USERS_TABLE . ' u
|
||||
LEFT JOIN ' . POSTS_TABLE . ' p ON (u.user_id = p.poster_id AND p.post_postcount = 1)
|
||||
GROUP BY u.user_id';
|
||||
$result = $db->sql_query($sql);
|
||||
// Resync post counts
|
||||
$start = $max_post_id = 0;
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$db->sql_query('UPDATE ' . USERS_TABLE . " SET user_posts = {$row['num_posts']} WHERE user_id = {$row['user_id']}");
|
||||
}
|
||||
// Find the maximum post ID, we can only stop the cycle when we've reached it
|
||||
$sql = 'SELECT MAX(forum_last_post_id) as max_post_id
|
||||
FROM ' . FORUMS_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
$max_post_id = (int) $db->sql_fetchfield('max_post_id');
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// No maximum post id? :o
|
||||
if (!$max_post_id)
|
||||
{
|
||||
$sql = 'SELECT MAX(post_id)
|
||||
FROM ' . POSTS_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
$max_post_id = (int) $db->sql_fetchfield('max_post_id');
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
// Still no maximum post id? Then we are finished
|
||||
if (!$max_post_id)
|
||||
{
|
||||
add_log('admin', 'LOG_RESYNC_POSTCOUNTS');
|
||||
break;
|
||||
}
|
||||
|
||||
$step = ($config['num_posts']) ? (max((int) ($config['num_posts'] / 5), 20000)) : 20000;
|
||||
$db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_posts = 0');
|
||||
|
||||
while ($start < $max_post_id)
|
||||
{
|
||||
$sql = 'SELECT COUNT(post_id) AS num_posts, poster_id
|
||||
FROM ' . POSTS_TABLE . '
|
||||
WHERE post_id BETWEEN ' . ($start + 1) . ' AND ' . ($start + $step) . '
|
||||
AND post_postcount = 1 AND post_approved = 1
|
||||
GROUP BY poster_id';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$sql = 'UPDATE ' . USERS_TABLE . " SET user_posts = user_posts + {$row['num_posts']} WHERE user_id = {$row['poster_id']}";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$start += $step;
|
||||
}
|
||||
|
||||
add_log('admin', 'LOG_RESYNC_POSTCOUNTS');
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case 'date':
|
||||
if (!$auth->acl_get('a_board'))
|
||||
{
|
||||
@@ -200,18 +249,15 @@ class acp_main
|
||||
set_config('board_startdate', time() - 1);
|
||||
add_log('admin', 'LOG_RESET_DATE');
|
||||
break;
|
||||
|
||||
case 'db_track':
|
||||
switch ($db->sql_layer)
|
||||
{
|
||||
case 'sqlite':
|
||||
case 'firebird':
|
||||
$db->sql_query('DELETE FROM ' . TOPICS_POSTED_TABLE);
|
||||
break;
|
||||
|
||||
default:
|
||||
$db->sql_query('TRUNCATE TABLE ' . TOPICS_POSTED_TABLE);
|
||||
break;
|
||||
case 'db_track':
|
||||
if ($db->truncate)
|
||||
{
|
||||
$db->sql_query('TRUNCATE TABLE ' . TOPICS_POSTED_TABLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->sql_query('DELETE FROM ' . TOPICS_POSTED_TABLE);
|
||||
}
|
||||
|
||||
// This can get really nasty... therefore we only do the last six months
|
||||
@@ -222,7 +268,7 @@ class acp_main
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forum_type <> ' . FORUM_CAT;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
|
||||
$forum_ids = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
@@ -272,7 +318,7 @@ class acp_main
|
||||
$db->sql_multi_insert(TOPICS_POSTED_TABLE, $sql_ary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
add_log('admin', 'LOG_RESYNC_POST_MARKING');
|
||||
break;
|
||||
|
||||
@@ -311,16 +357,16 @@ class acp_main
|
||||
$files_per_day = sprintf('%.2f', $total_files / $boarddays);
|
||||
|
||||
$upload_dir_size = get_formatted_filesize($config['upload_dir_size']);
|
||||
|
||||
|
||||
$avatar_dir_size = 0;
|
||||
|
||||
if ($avatar_dir = @opendir($phpbb_root_path . $config['avatar_path']))
|
||||
if ($avatar_dir = @opendir(PHPBB_ROOT_PATH . $config['avatar_path']))
|
||||
{
|
||||
while (($file = readdir($avatar_dir)) !== false)
|
||||
{
|
||||
if ($file[0] != '.' && $file != 'CVS' && strpos($file, 'index.') === false)
|
||||
{
|
||||
$avatar_dir_size += filesize($phpbb_root_path . $config['avatar_path'] . '/' . $file);
|
||||
$avatar_dir_size += filesize(PHPBB_ROOT_PATH . $config['avatar_path'] . '/' . $file);
|
||||
}
|
||||
}
|
||||
closedir($avatar_dir);
|
||||
@@ -390,8 +436,8 @@ class acp_main
|
||||
'BOARD_VERSION' => $config['version'],
|
||||
|
||||
'U_ACTION' => $this->u_action,
|
||||
'U_ADMIN_LOG' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&mode=admin'),
|
||||
'U_INACTIVE_USERS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&mode=list'),
|
||||
'U_ADMIN_LOG' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=logs&mode=admin'),
|
||||
'U_INACTIVE_USERS' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=inactive&mode=list'),
|
||||
|
||||
'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? true : false,
|
||||
'S_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false,
|
||||
@@ -432,7 +478,7 @@ class acp_main
|
||||
'REASON' => $row['inactive_reason'],
|
||||
'USER_ID' => $row['user_id'],
|
||||
'USERNAME' => $row['username'],
|
||||
'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&mode=overview&u={$row['user_id']}"))
|
||||
'U_USER_ADMIN' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=users&mode=overview&u={$row['user_id']}"))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -449,14 +495,20 @@ class acp_main
|
||||
}
|
||||
|
||||
// Warn if install is still present
|
||||
if (file_exists($phpbb_root_path . 'install'))
|
||||
if (file_exists(PHPBB_ROOT_PATH . 'install'))
|
||||
{
|
||||
$template->assign_var('S_REMOVE_INSTALL', true);
|
||||
}
|
||||
|
||||
if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists(PHPBB_ROOT_PATH . 'config.' . PHP_EXT) && is_writable(PHPBB_ROOT_PATH . 'config.' . PHP_EXT))
|
||||
{
|
||||
// World-Writable? (000x)
|
||||
$template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms(PHPBB_ROOT_PATH . 'config.' . PHP_EXT) & 0x0002));
|
||||
}
|
||||
|
||||
$this->tpl_name = 'acp_main';
|
||||
$this->page_title = 'ACP_MAIN';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
@@ -34,11 +34,16 @@ class acp_modules
|
||||
var $module_class = '';
|
||||
var $parent_id;
|
||||
var $u_action;
|
||||
var $p_master;
|
||||
|
||||
function __construct(p_master $p_master = null)
|
||||
{
|
||||
$this->p_master = $p_master;
|
||||
}
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $module;
|
||||
global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
|
||||
global $db, $user, $auth, $template, $module, $config;
|
||||
|
||||
// Set a global define for modules we might include (the author is able to prevent execution of code by checking this constant)
|
||||
define('MODULE_INCLUDE', true);
|
||||
@@ -261,7 +266,7 @@ class acp_modules
|
||||
$module_data['module_langname'] = utf8_normalize_nfc(request_var('module_langname', (string) $module_row['module_langname'], true));
|
||||
$module_data['module_mode'] = request_var('module_mode', (string) $module_row['module_mode']);
|
||||
|
||||
$submit = (isset($_POST['submit'])) ? true : false;
|
||||
$submit = request::is_set_post('submit');
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
@@ -530,11 +535,9 @@ class acp_modules
|
||||
*/
|
||||
function get_module_infos($module = '', $module_class = false)
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
|
||||
$module_class = ($module_class === false) ? $this->module_class : $module_class;
|
||||
|
||||
$directory = $phpbb_root_path . 'includes/' . $module_class . '/info/';
|
||||
$directory = PHPBB_ROOT_PATH . 'includes/' . $module_class . '/info/';
|
||||
$fileinfo = array();
|
||||
|
||||
if (!$module)
|
||||
@@ -549,9 +552,9 @@ class acp_modules
|
||||
while (($file = readdir($dh)) !== false)
|
||||
{
|
||||
// Is module?
|
||||
if (preg_match('/^' . $module_class . '_.+\.' . $phpEx . '$/', $file))
|
||||
if (preg_match('/^' . $module_class . '_.+\.' . PHP_EXT . '$/', $file))
|
||||
{
|
||||
$class = str_replace(".$phpEx", '', $file) . '_info';
|
||||
$class = str_replace('.' . PHP_EXT, '', $file) . '_info';
|
||||
|
||||
if (!class_exists($class))
|
||||
{
|
||||
@@ -578,7 +581,7 @@ class acp_modules
|
||||
|
||||
if (!class_exists($class))
|
||||
{
|
||||
include($directory . $filename . '.' . $phpEx);
|
||||
include($directory . $filename . '.' . PHP_EXT);
|
||||
}
|
||||
|
||||
// Get module title tag
|
||||
@@ -627,7 +630,7 @@ class acp_modules
|
||||
if (!$ignore_acl && $row['module_auth'])
|
||||
{
|
||||
// We use zero as the forum id to check - global setting.
|
||||
if (!p_master::module_auth($row['module_auth'], 0))
|
||||
if (!$this->p_master->module_auth($row['module_auth'], 0))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -658,6 +661,8 @@ class acp_modules
|
||||
|
||||
$iteration++;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
unset($padding_store);
|
||||
|
||||
return $module_list;
|
||||
|
@@ -25,11 +25,10 @@ class acp_permission_roles
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $user, $auth, $template, $cache, $config;
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||
include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/acp/auth.' . PHP_EXT);
|
||||
|
||||
$auth_admin = new auth_admin();
|
||||
|
||||
@@ -38,10 +37,10 @@ class acp_permission_roles
|
||||
|
||||
$this->tpl_name = 'acp_permission_roles';
|
||||
|
||||
$submit = (isset($_POST['submit'])) ? true : false;
|
||||
$submit = request::is_set_post('submit');
|
||||
$role_id = request_var('role_id', 0);
|
||||
$action = request_var('action', '');
|
||||
$action = (isset($_POST['add'])) ? 'add' : $action;
|
||||
$action = (request::is_set_post('add')) ? 'add' : $action;
|
||||
|
||||
$form_name = 'acp_permissions';
|
||||
add_form_key($form_name);
|
||||
|
@@ -26,11 +26,10 @@ class acp_permissions
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $user, $auth, $template, $cache, $config;
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||
include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/acp/auth.' . PHP_EXT);
|
||||
|
||||
$auth_admin = new auth_admin();
|
||||
|
||||
@@ -60,7 +59,7 @@ class acp_permissions
|
||||
// Set some vars
|
||||
$action = request_var('action', array('' => 0));
|
||||
$action = key($action);
|
||||
$action = (isset($_POST['psubmit'])) ? 'apply_permissions' : $action;
|
||||
$action = (request::is_set_post('psubmit')) ? 'apply_permissions' : $action;
|
||||
|
||||
$all_forums = request_var('all_forums', 0);
|
||||
$subforum_id = request_var('subforum_id', 0);
|
||||
@@ -230,8 +229,8 @@ class acp_permissions
|
||||
trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
// All users/groups selected?
|
||||
$all_users = (isset($_POST['all_users'])) ? true : false;
|
||||
$all_groups = (isset($_POST['all_groups'])) ? true : false;
|
||||
$all_users = request::is_set_post('all_users');
|
||||
$all_groups = request::is_set_post('all_groups');
|
||||
|
||||
if ($all_users || $all_groups)
|
||||
{
|
||||
@@ -258,7 +257,7 @@ class acp_permissions
|
||||
break;
|
||||
|
||||
case 'apply_permissions':
|
||||
if (!isset($_POST['setting']))
|
||||
if (!request::is_set_post('setting'))
|
||||
{
|
||||
trigger_error($user->lang['NO_AUTH_SETTING_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
@@ -271,7 +270,7 @@ class acp_permissions
|
||||
break;
|
||||
|
||||
case 'apply_all_permissions':
|
||||
if (!isset($_POST['setting']))
|
||||
if (!request::is_set_post('setting'))
|
||||
{
|
||||
trigger_error($user->lang['NO_AUTH_SETTING_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
@@ -354,7 +353,7 @@ class acp_permissions
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_SELECT_USER' => true,
|
||||
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_victim&field=username&select_single=true'),
|
||||
'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=select_victim&field=username&select_single=true'),
|
||||
));
|
||||
|
||||
break;
|
||||
@@ -377,8 +376,8 @@ class acp_permissions
|
||||
case 'usergroup':
|
||||
case 'usergroup_view':
|
||||
|
||||
$all_users = (isset($_POST['all_users'])) ? true : false;
|
||||
$all_groups = (isset($_POST['all_groups'])) ? true : false;
|
||||
$all_users = request::is_set_post('all_users');
|
||||
$all_groups = request::is_set_post('all_groups');
|
||||
|
||||
if ((sizeof($user_id) && !$all_users) || (sizeof($group_id) && !$all_groups))
|
||||
{
|
||||
@@ -416,7 +415,7 @@ class acp_permissions
|
||||
'S_DEFINED_USER_OPTIONS' => $items['user_ids_options'],
|
||||
'S_DEFINED_GROUP_OPTIONS' => $items['group_ids_options'],
|
||||
'S_ADD_GROUP_OPTIONS' => group_select_options(false, $items['group_ids'], (($user->data['user_type'] == USER_FOUNDER) ? false : 0)),
|
||||
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=add_user&field=username&select_single=true'),
|
||||
'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=add_user&field=username&select_single=true'),
|
||||
));
|
||||
|
||||
break;
|
||||
@@ -633,18 +632,14 @@ class acp_permissions
|
||||
list($ug_id, ) = each($psubmit);
|
||||
list($forum_id, ) = each($psubmit[$ug_id]);
|
||||
|
||||
if (empty($_POST['setting']) || empty($_POST['setting'][$ug_id]) || empty($_POST['setting'][$ug_id][$forum_id]) || !is_array($_POST['setting'][$ug_id][$forum_id]))
|
||||
$auth_settings = request::variable('setting', array(0 => array(0 => array('' => 0))), false, request::POST);
|
||||
if (!isset($auth_settings[$ug_id][$forum_id]) || !sizeof($auth_settings[$ug_id][$forum_id])))
|
||||
{
|
||||
trigger_error('WRONG_PERMISSION_SETTING_FORMAT', E_USER_WARNING);
|
||||
}
|
||||
|
||||
// We obtain and check $_POST['setting'][$ug_id][$forum_id] directly and not using request_var() because request_var()
|
||||
// currently does not support the amount of dimensions required. ;)
|
||||
// $auth_settings = request_var('setting', array(0 => array(0 => array('' => 0))));
|
||||
$auth_settings = array_map('intval', $_POST['setting'][$ug_id][$forum_id]);
|
||||
|
||||
// Do we have a role we want to set?
|
||||
$assigned_role = (isset($_POST['role'][$ug_id][$forum_id])) ? (int) $_POST['role'][$ug_id][$forum_id] : 0;
|
||||
$assigned_role = request::variable(array('role', $ug_id, $forum_id), 0, false, request::POST));
|
||||
|
||||
// Do the admin want to set these permissions to other items too?
|
||||
$inherit = request_var('inherit', array(0 => array(0)));
|
||||
@@ -714,23 +709,21 @@ class acp_permissions
|
||||
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$auth_settings = (isset($_POST['setting'])) ? $_POST['setting'] : array();
|
||||
$auth_roles = (isset($_POST['role'])) ? $_POST['role'] : array();
|
||||
$auth_settings = request::variable('setting', array(0 => array(0 => array('' => 0))), false, request::POST);
|
||||
$auth_roles = request::variable('role', array(0 => array(0 => 0)), false, request::POST);
|
||||
$ug_ids = $forum_ids = array();
|
||||
|
||||
// We need to go through the auth settings
|
||||
foreach ($auth_settings as $ug_id => $forum_auth_row)
|
||||
{
|
||||
$ug_id = (int) $ug_id;
|
||||
$ug_ids[] = $ug_id;
|
||||
|
||||
foreach ($forum_auth_row as $forum_id => $auth_options)
|
||||
{
|
||||
$forum_id = (int) $forum_id;
|
||||
$forum_ids[] = $forum_id;
|
||||
|
||||
// Check role...
|
||||
$assigned_role = (isset($auth_roles[$ug_id][$forum_id])) ? (int) $auth_roles[$ug_id][$forum_id] : 0;
|
||||
$assigned_role = (isset($auth_roles[$ug_id][$forum_id])) ? $auth_roles[$ug_id][$forum_id] : 0;
|
||||
|
||||
// If the auth settings differ from the assigned role, then do not set a role...
|
||||
if ($assigned_role)
|
||||
@@ -1156,7 +1149,7 @@ class acp_permissions
|
||||
}
|
||||
|
||||
// Not ideal, due to the filesort, non-use of indexes, etc.
|
||||
$sql = 'SELECT DISTINCT u.user_id, u.username
|
||||
$sql = 'SELECT DISTINCT u.user_id, u.username, u.username_clean, u.user_regdate
|
||||
FROM ' . USERS_TABLE . ' u, ' . ACL_USERS_TABLE . " a
|
||||
WHERE u.user_id = a.user_id
|
||||
$sql_forum_id
|
||||
|
@@ -25,8 +25,7 @@ class acp_php_info
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $user, $auth, $template, $config;
|
||||
|
||||
if ($mode != 'info')
|
||||
{
|
||||
|
@@ -29,17 +29,16 @@ class acp_profile
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template, $cache;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
|
||||
|
||||
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
|
||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||
include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
|
||||
include(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
|
||||
include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||
include(PHPBB_ROOT_PATH . 'includes/functions_profile_fields.' . PHP_EXT);
|
||||
|
||||
$user->add_lang(array('ucp', 'acp/profile'));
|
||||
$this->tpl_name = 'acp_profile';
|
||||
$this->page_title = 'ACP_CUSTOM_PROFILE_FIELDS';
|
||||
|
||||
$action = (isset($_POST['create'])) ? 'create' : request_var('action', '');
|
||||
$action = (request::is_set_post('create')) ? 'create' : request_var('action', '');
|
||||
|
||||
$error = array();
|
||||
$s_hidden_fields = '';
|
||||
@@ -120,9 +119,8 @@ class acp_profile
|
||||
$db->sql_query('DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . " WHERE field_id = $field_id");
|
||||
$db->sql_query('DELETE FROM ' . PROFILE_LANG_TABLE . " WHERE field_id = $field_id");
|
||||
|
||||
switch ($db->sql_layer)
|
||||
if ($db->dbms_type == 'sqlite')
|
||||
{
|
||||
case 'sqlite':
|
||||
$sql = "SELECT sql
|
||||
FROM sqlite_master
|
||||
WHERE type = 'table'
|
||||
@@ -166,9 +164,9 @@ class acp_profile
|
||||
$db->sql_query('CREATE TABLE ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $new_table_cols . ');');
|
||||
$db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . PROFILE_FIELDS_DATA_TABLE . '_temp;');
|
||||
$db->sql_query('DROP TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp');
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->sql_query('ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " DROP COLUMN pf_$field_ident");
|
||||
}
|
||||
|
||||
@@ -289,8 +287,8 @@ class acp_profile
|
||||
$field_id = request_var('field_id', 0);
|
||||
$step = request_var('step', 1);
|
||||
|
||||
$submit = (isset($_REQUEST['next']) || isset($_REQUEST['prev'])) ? true : false;
|
||||
$save = (isset($_REQUEST['save'])) ? true : false;
|
||||
$submit = (request::is_set('next') || request::is_set('prev')) ? true : false;
|
||||
$save = request::is_set('save');
|
||||
|
||||
// The language id of default language
|
||||
$this->edit_lang_id = $this->lang_defs['iso'][$config['default_lang']];
|
||||
@@ -401,7 +399,7 @@ class acp_profile
|
||||
$cp->vars['lang_default_value'] = utf8_normalize_nfc(request_var('lang_default_value', $field_row['lang_default_value'], true));
|
||||
|
||||
// Field option...
|
||||
if (isset($_REQUEST['field_option']))
|
||||
if (request::is_set('field_option'))
|
||||
{
|
||||
$field_option = request_var('field_option', '');
|
||||
|
||||
@@ -465,7 +463,7 @@ class acp_profile
|
||||
}
|
||||
else if ($field_type == FIELD_TEXT && $key == 'field_length')
|
||||
{
|
||||
if (isset($_REQUEST['rows']))
|
||||
if (request::is_set('rows'))
|
||||
{
|
||||
$cp->vars['rows'] = request_var('rows', 0);
|
||||
$cp->vars['columns'] = request_var('columns', 0);
|
||||
@@ -489,16 +487,27 @@ class acp_profile
|
||||
$cp->vars['field_default_value_day'] = $now['mday'];
|
||||
$cp->vars['field_default_value_month'] = $now['mon'];
|
||||
$cp->vars['field_default_value_year'] = $now['year'];
|
||||
$var = $_POST['field_default_value'] = 'now';
|
||||
|
||||
$var = 'now';
|
||||
/**
|
||||
* @todo Do NOT overwrite a request variable.
|
||||
*/
|
||||
request::overwrite('field_default_value', $var, request::REQUEST);
|
||||
request::overwrite('field_default_value', $var, request::POST);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isset($_REQUEST['field_default_value_day']))
|
||||
if (request::is_set('field_default_value_day'))
|
||||
{
|
||||
$cp->vars['field_default_value_day'] = request_var('field_default_value_day', 0);
|
||||
$cp->vars['field_default_value_month'] = request_var('field_default_value_month', 0);
|
||||
$cp->vars['field_default_value_year'] = request_var('field_default_value_year', 0);
|
||||
$var = $_POST['field_default_value'] = sprintf('%2d-%2d-%4d', $cp->vars['field_default_value_day'], $cp->vars['field_default_value_month'], $cp->vars['field_default_value_year']);
|
||||
$var = sprintf('%2d-%2d-%4d', $cp->vars['field_default_value_day'], $cp->vars['field_default_value_month'], $cp->vars['field_default_value_year']);
|
||||
/**
|
||||
* @todo Do NOT overwrite a request variable.
|
||||
*/
|
||||
request::overwrite('field_default_value', $var, request::REQUEST);
|
||||
request::overwrite('field_default_value', $var, request::POST);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -624,7 +633,7 @@ class acp_profile
|
||||
}
|
||||
}
|
||||
|
||||
$step = (isset($_REQUEST['next'])) ? $step + 1 : ((isset($_REQUEST['prev'])) ? $step - 1 : $step);
|
||||
$step = (request::is_set('next')) ? $step + 1 : ((request::is_set('prev')) ? $step - 1 : $step);
|
||||
|
||||
if (sizeof($error))
|
||||
{
|
||||
@@ -644,7 +653,7 @@ class acp_profile
|
||||
|
||||
foreach ($key_ary as $key)
|
||||
{
|
||||
if ($field_type == FIELD_TEXT && $key == 'field_length' && isset($_REQUEST['rows']))
|
||||
if ($field_type == FIELD_TEXT && $key == 'field_length' && request::is_set('rows'))
|
||||
{
|
||||
$cp->vars['rows'] = request_var('rows', 0);
|
||||
$cp->vars['columns'] = request_var('columns', 0);
|
||||
@@ -658,21 +667,21 @@ class acp_profile
|
||||
{
|
||||
$_new_key_ary[$key] = 'now';
|
||||
}
|
||||
else if (isset($_REQUEST['field_default_value_day']))
|
||||
else if (request::is_set('field_default_value_day'))
|
||||
{
|
||||
$cp->vars['field_default_value_day'] = request_var('field_default_value_day', 0);
|
||||
$cp->vars['field_default_value_month'] = request_var('field_default_value_month', 0);
|
||||
$cp->vars['field_default_value_year'] = request_var('field_default_value_year', 0);
|
||||
$_new_key_ary[$key] = sprintf('%2d-%2d-%4d', $cp->vars['field_default_value_day'], $cp->vars['field_default_value_month'], $cp->vars['field_default_value_year']);
|
||||
$_new_key_ary[$key] = sprintf('%2d-%2d-%4d', $cp->vars['field_default_value_day'], $cp->vars['field_default_value_month'], $cp->vars['field_default_value_year']);
|
||||
}
|
||||
}
|
||||
else if ($field_type == FIELD_BOOL && $key == 'l_lang_options' && isset($_REQUEST['l_lang_options']))
|
||||
else if ($field_type == FIELD_BOOL && $key == 'l_lang_options' && request::is_set('l_lang_options'))
|
||||
{
|
||||
$_new_key_ary[$key] = utf8_normalize_nfc(request_var($key, array(array('')), true));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isset($_REQUEST[$key]))
|
||||
if (!request::is_set($key))
|
||||
{
|
||||
$var = false;
|
||||
}
|
||||
@@ -682,7 +691,11 @@ class acp_profile
|
||||
}
|
||||
else
|
||||
{
|
||||
$_new_key_ary[$key] = (is_array($_REQUEST[$key])) ? utf8_normalize_nfc(request_var($key, array(''), true)) : utf8_normalize_nfc(request_var($key, '', true));
|
||||
$_new_key_ary[$key] = utf8_normalize_nfc(request_var($key, array(''), true));
|
||||
if (!sizeof($_new_key_ary[$key]))
|
||||
{
|
||||
$_new_key_ary[$key] = utf8_normalize_nfc(request_var($key, '', true));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -729,7 +742,7 @@ class acp_profile
|
||||
'S_FIELD_NO_VIEW' => ($cp->vars['field_no_view']) ? true : false,
|
||||
|
||||
'L_LANG_SPECIFIC' => sprintf($user->lang['LANG_SPECIFIC_OPTIONS'], $config['default_lang']),
|
||||
'FIELD_TYPE' => $user->lang['FIELD_' . strtoupper($cp->profile_types[$field_type])],
|
||||
'FIELD_TYPE' => $user->lang['FIELD_' . strtoupper(custom_profile::$profile_types[$field_type])],
|
||||
'FIELD_IDENT' => $cp->vars['field_ident'],
|
||||
'LANG_NAME' => $cp->vars['lang_name'],
|
||||
'LANG_EXPLAIN' => $cp->vars['lang_explain'])
|
||||
@@ -742,7 +755,7 @@ class acp_profile
|
||||
'S_TEXT' => ($field_type == FIELD_TEXT) ? true : false,
|
||||
'S_STRING' => ($field_type == FIELD_STRING) ? true : false,
|
||||
|
||||
'L_DEFAULT_VALUE_EXPLAIN' => $user->lang[strtoupper($cp->profile_types[$field_type]) . '_DEFAULT_VALUE_EXPLAIN'],
|
||||
'L_DEFAULT_VALUE_EXPLAIN' => $user->lang[strtoupper(custom_profile::$profile_types[$field_type]) . '_DEFAULT_VALUE_EXPLAIN'],
|
||||
'LANG_DEFAULT_VALUE' => $cp->vars['lang_default_value'])
|
||||
);
|
||||
}
|
||||
@@ -769,7 +782,7 @@ class acp_profile
|
||||
'S_BOOL' => ($field_type == FIELD_BOOL) ? true : false,
|
||||
'S_DROPDOWN' => ($field_type == FIELD_DROPDOWN) ? true : false,
|
||||
|
||||
'L_LANG_OPTIONS_EXPLAIN' => $user->lang[strtoupper($cp->profile_types[$field_type]) . '_ENTRIES_EXPLAIN'],
|
||||
'L_LANG_OPTIONS_EXPLAIN' => $user->lang[strtoupper(custom_profile::$profile_types[$field_type]) . '_ENTRIES_EXPLAIN'],
|
||||
'LANG_OPTIONS' => ($field_type == FIELD_DROPDOWN) ? implode("\n", $cp->vars['lang_options']) : '',
|
||||
'FIRST_LANG_OPTION' => ($field_type == FIELD_BOOL) ? $cp->vars['lang_options'][0] : '',
|
||||
'SECOND_LANG_OPTION' => ($field_type == FIELD_BOOL) ? $cp->vars['lang_options'][1] : '')
|
||||
@@ -786,7 +799,7 @@ class acp_profile
|
||||
);
|
||||
|
||||
// Build options based on profile type
|
||||
$function = 'get_' . $cp->profile_types[$field_type] . '_options';
|
||||
$function = 'get_' . custom_profile::$profile_types[$field_type] . '_options';
|
||||
$options = $cp->$function();
|
||||
|
||||
foreach ($options as $num => $option_ary)
|
||||
@@ -851,7 +864,7 @@ class acp_profile
|
||||
|
||||
$template->assign_block_vars('fields', array(
|
||||
'FIELD_IDENT' => $row['field_ident'],
|
||||
'FIELD_TYPE' => $user->lang['FIELD_' . strtoupper($cp->profile_types[$row['field_type']])],
|
||||
'FIELD_TYPE' => $user->lang['FIELD_' . strtoupper(custom_profile::$profile_types[$row['field_type']])],
|
||||
|
||||
'L_ACTIVATE_DEACTIVATE' => $user->lang[$active_lang],
|
||||
'U_ACTIVATE_DEACTIVATE' => $this->u_action . "&action=$active_value&field_id=$id",
|
||||
@@ -873,7 +886,7 @@ class acp_profile
|
||||
}
|
||||
|
||||
$s_select_type = '';
|
||||
foreach ($cp->profile_types as $key => $value)
|
||||
foreach (custom_profile::$profile_types as $key => $value)
|
||||
{
|
||||
$s_select_type .= '<option value="' . $key . '">' . $user->lang['FIELD_' . strtoupper($value)] . '</option>';
|
||||
}
|
||||
@@ -1348,11 +1361,9 @@ class acp_profile
|
||||
{
|
||||
global $db;
|
||||
|
||||
switch ($db->sql_layer)
|
||||
switch ($db->dbms_type)
|
||||
{
|
||||
case 'mysql':
|
||||
case 'mysql4':
|
||||
case 'mysqli':
|
||||
|
||||
// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
|
||||
$sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD `$field_ident` ";
|
||||
@@ -1469,7 +1480,6 @@ class acp_profile
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
case 'mssql_odbc':
|
||||
|
||||
// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
|
||||
$sql = 'ALTER TABLE [' . PROFILE_FIELDS_DATA_TABLE . "] ADD [$field_ident] ";
|
||||
@@ -1606,6 +1616,42 @@ class acp_profile
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'db2':
|
||||
|
||||
// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
|
||||
$sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD \"$field_ident\" ";
|
||||
|
||||
switch ($field_type)
|
||||
{
|
||||
case FIELD_STRING:
|
||||
$sql .= ' VARCHAR(255) ';
|
||||
break;
|
||||
|
||||
case FIELD_DATE:
|
||||
$sql .= 'VARCHAR(10) ';
|
||||
break;
|
||||
|
||||
case FIELD_TEXT:
|
||||
$sql .= "varchar(32672)";
|
||||
// ADD {$field_ident}_bbcode_uid VARCHAR2(5) NOT NULL,
|
||||
// ADD {$field_ident}_bbcode_bitfield NUMBER(11) UNSIGNED";
|
||||
break;
|
||||
|
||||
case FIELD_BOOL:
|
||||
$sql .= 'smallint ';
|
||||
break;
|
||||
|
||||
case FIELD_DROPDOWN:
|
||||
$sql .= 'integer ';
|
||||
break;
|
||||
|
||||
case FIELD_INT:
|
||||
$sql .= 'float ';
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return $sql;
|
||||
|
@@ -25,10 +25,10 @@ class acp_prune
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $user, $phpEx, $phpbb_admin_path, $phpbb_root_path;
|
||||
global $user;
|
||||
|
||||
$user->add_lang('acp/prune');
|
||||
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||
include_once(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||
|
||||
switch ($mode)
|
||||
{
|
||||
@@ -51,12 +51,11 @@ class acp_prune
|
||||
*/
|
||||
function prune_forums($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $user, $auth, $template, $cache, $config;
|
||||
|
||||
$all_forums = request_var('all_forums', 0);
|
||||
$forum_id = request_var('f', array(0));
|
||||
$submit = (isset($_POST['submit'])) ? true : false;
|
||||
$submit = request::is_set_post('submit');
|
||||
|
||||
if ($all_forums)
|
||||
{
|
||||
@@ -228,12 +227,11 @@ class acp_prune
|
||||
*/
|
||||
function prune_users($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $user, $auth, $template, $cache, $config;
|
||||
|
||||
$user->add_lang('memberlist');
|
||||
|
||||
$prune = (isset($_POST['prune'])) ? true : false;
|
||||
$prune = request::is_set_post('prune');
|
||||
|
||||
if ($prune)
|
||||
{
|
||||
@@ -300,8 +298,8 @@ class acp_prune
|
||||
{
|
||||
$template->assign_block_vars('users', array(
|
||||
'USERNAME' => $usernames[$user_id],
|
||||
'U_PROFILE' => append_sid($phpbb_root_path . 'memberlist.' . $phpEx, 'mode=viewprofile&u=' . $user_id),
|
||||
'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&mode=overview&u=' . $user_id, true, $user->session_id) : '',
|
||||
'U_PROFILE' => append_sid('memberlist', 'mode=viewprofile&u=' . $user_id),
|
||||
'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=users&mode=overview&u=' . $user_id, true, $user->session_id) : '',
|
||||
));
|
||||
}
|
||||
|
||||
@@ -358,7 +356,7 @@ class acp_prune
|
||||
'S_JOINED_OPTIONS' => $s_find_join_time,
|
||||
'S_ACTIVE_OPTIONS' => $s_find_active_time,
|
||||
'S_COUNT_OPTIONS' => $s_find_count,
|
||||
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=acp_prune&field=users'),
|
||||
'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=acp_prune&field=users'),
|
||||
));
|
||||
}
|
||||
|
||||
|
@@ -25,15 +25,14 @@ class acp_ranks
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $user, $auth, $template, $cache, $config;
|
||||
|
||||
$user->add_lang('acp/posting');
|
||||
|
||||
// Set up general vars
|
||||
$action = request_var('action', '');
|
||||
$action = (isset($_POST['add'])) ? 'add' : $action;
|
||||
$action = (isset($_POST['save'])) ? 'save' : $action;
|
||||
$action = (request::is_set_post('add')) ? 'add' : $action;
|
||||
$action = (request::is_set_post('save')) ? 'save' : $action;
|
||||
$rank_id = request_var('id', 0);
|
||||
|
||||
$this->tpl_name = 'acp_ranks';
|
||||
@@ -157,7 +156,7 @@ class acp_ranks
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$imglist = filelist($phpbb_root_path . $config['ranks_path'], '');
|
||||
$imglist = filelist(PHPBB_ROOT_PATH . $config['ranks_path'], '');
|
||||
$edit_img = $filename_list = '';
|
||||
|
||||
foreach ($imglist as $path => $img_ary)
|
||||
@@ -196,12 +195,12 @@ class acp_ranks
|
||||
$template->assign_vars(array(
|
||||
'S_EDIT' => true,
|
||||
'U_BACK' => $this->u_action,
|
||||
'RANKS_PATH' => $phpbb_root_path . $config['ranks_path'],
|
||||
'RANKS_PATH' => PHPBB_ROOT_PATH . $config['ranks_path'],
|
||||
'U_ACTION' => $this->u_action . '&id=' . $rank_id,
|
||||
|
||||
'RANK_TITLE' => (isset($ranks['rank_title'])) ? $ranks['rank_title'] : '',
|
||||
'S_FILENAME_LIST' => $filename_list,
|
||||
'RANK_IMAGE' => ($edit_img) ? $phpbb_root_path . $config['ranks_path'] . '/' . $edit_img : $phpbb_admin_path . 'images/spacer.gif',
|
||||
'RANK_IMAGE' => ($edit_img) ? PHPBB_ROOT_PATH . $config['ranks_path'] . '/' . $edit_img : PHPBB_ADMIN_PATH . 'images/spacer.gif',
|
||||
'S_SPECIAL_RANK' => (!isset($ranks['rank_special']) || $ranks['rank_special']) ? true : false,
|
||||
'MIN_POSTS' => (isset($ranks['rank_min']) && !$ranks['rank_special']) ? $ranks['rank_min'] : 0)
|
||||
);
|
||||
@@ -227,7 +226,7 @@ class acp_ranks
|
||||
'S_RANK_IMAGE' => ($row['rank_image']) ? true : false,
|
||||
'S_SPECIAL_RANK' => ($row['rank_special']) ? true : false,
|
||||
|
||||
'RANK_IMAGE' => $phpbb_root_path . $config['ranks_path'] . '/' . $row['rank_image'],
|
||||
'RANK_IMAGE' => PHPBB_ROOT_PATH . $config['ranks_path'] . '/' . $row['rank_image'],
|
||||
'RANK_TITLE' => $row['rank_title'],
|
||||
'MIN_POSTS' => $row['rank_min'],
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user