mirror of
https://github.com/phpbb/phpbb.git
synced 2025-09-19 12:31:34 +02:00
Compare commits
456 Commits
release-3.
...
release-3.
Author | SHA1 | Date | |
---|---|---|---|
|
5be06ec66a | ||
|
623a8f2d0f | ||
|
819eca99a8 | ||
|
a7272fec97 | ||
|
f585f48aca | ||
|
d8dd6bad6b | ||
|
f2a0fe39a5 | ||
|
b09e1ad26d | ||
|
583068da9d | ||
|
2d24b9b61f | ||
|
04b0ba9f6d | ||
|
ccd1e1eebb | ||
|
a959e5f4cc | ||
|
697ccd41c4 | ||
|
6c98b01ad1 | ||
|
ffe72e500c | ||
|
6f1d848087 | ||
|
897b9f333b | ||
|
cf0170d5e3 | ||
|
00aab15f7c | ||
|
11a0516739 | ||
|
ef3de412b7 | ||
|
50a7167c9a | ||
|
51eaa8917f | ||
|
5f905f67ee | ||
|
19267242e3 | ||
|
452b3b4890 | ||
|
5b534369d1 | ||
|
dcf12cad26 | ||
|
81b4293cc5 | ||
|
d89c952955 | ||
|
e22dbbc7e8 | ||
|
a83bcaa8ac | ||
|
a24f9a7ad7 | ||
|
dbfea6d0fa | ||
|
e466318dc2 | ||
|
57ba51c529 | ||
|
9d4228291c | ||
|
dead984f54 | ||
|
2cd2cf2b39 | ||
|
146c4b1624 | ||
|
4bab984dac | ||
|
972f04ec6a | ||
|
40666dd96f | ||
|
3bd5fe6be8 | ||
|
1b1fc6ed24 | ||
|
edeeff597f | ||
|
9a2c74a68c | ||
|
166e0b5961 | ||
|
668defcf57 | ||
|
5f4943c183 | ||
|
9e38f412ea | ||
|
8d54f06d19 | ||
|
4d2940dd2f | ||
|
7a2f72df75 | ||
|
84a40b6ad1 | ||
|
8e80425c82 | ||
|
b7e4d0b0a5 | ||
|
3dcba7000b | ||
|
9e467a4e4a | ||
|
32f5dc3d8b | ||
|
4aac578908 | ||
|
b34e74254a | ||
|
e7c6c3f02b | ||
|
49bc477a87 | ||
|
6a7978965d | ||
|
478a4c4133 | ||
|
7cb7ca57c2 | ||
|
30449b69af | ||
|
9c67d02bd2 | ||
|
771090f13e | ||
|
ff67a09724 | ||
|
edf81e8de8 | ||
|
c3d77edd83 | ||
|
f34f28f283 | ||
|
4bf0534bf9 | ||
|
e37b3495f0 | ||
|
da53d95b95 | ||
|
3e8af1cf33 | ||
|
b24ce02526 | ||
|
5e7550ee53 | ||
|
84d302a2fd | ||
|
c6a654e859 | ||
|
5da50fcf6e | ||
|
e686f8bbdf | ||
|
d1e6c89b90 | ||
|
23aed66473 | ||
|
49bffc1851 | ||
|
8b21e7c0d9 | ||
|
ce937346f3 | ||
|
e30c6caac8 | ||
|
5e3ebda0da | ||
|
7e21d1dab5 | ||
|
6b658874bb | ||
|
ebf0bc2134 | ||
|
203bd4edd5 | ||
|
8b981f9ccd | ||
|
d548a2aa3e | ||
|
11256cd167 | ||
|
4d3188ba57 | ||
|
56251adc24 | ||
|
4262dfeaef | ||
|
100fd39c5e | ||
|
de75a3577f | ||
|
64b41f314e | ||
|
ae31a604e6 | ||
|
b002948e21 | ||
|
2e10961fff | ||
|
3768f7f2b8 | ||
|
92703127d3 | ||
|
3a62903fd1 | ||
|
e69d23dc88 | ||
|
0d7f8ba8af | ||
|
9ab4b30739 | ||
|
629a826f5b | ||
|
42dc7eb0f5 | ||
|
05f1476fc9 | ||
|
4b54df8d45 | ||
|
d0cdc5553a | ||
|
f576f42b4d | ||
|
23db3d0b83 | ||
|
04d34e6c8b | ||
|
6294c45bd3 | ||
|
498a516017 | ||
|
1bd20eb273 | ||
|
4ac2256683 | ||
|
886ca1dbb9 | ||
|
73ba70e98c | ||
|
b346f216c2 | ||
|
ed3f46a9b1 | ||
|
e0efd5ee57 | ||
|
352e995674 | ||
|
60b4d5132f | ||
|
18a08e1af1 | ||
|
2be39c5a8f | ||
|
cc23ac887c | ||
|
607f2e791f | ||
|
7b903919bf | ||
|
d0cf674f33 | ||
|
6f18963636 | ||
|
7b93df1522 | ||
|
2237030398 | ||
|
dbd653327c | ||
|
ae2237f640 | ||
|
817db2f135 | ||
|
8bb48b575d | ||
|
7d7b536874 | ||
|
ef6af2682b | ||
|
84bbd4490e | ||
|
11e312f41c | ||
|
82bc9baa24 | ||
|
2ec5c5de17 | ||
|
d43da6cee9 | ||
|
abf98f92e6 | ||
|
bcac964cd0 | ||
|
c0449d31d6 | ||
|
de947d31f6 | ||
|
7d24510d68 | ||
|
afa4c07a13 | ||
|
57fa7435ad | ||
|
af7f62505e | ||
|
76f7175fc4 | ||
|
bbbf122d05 | ||
|
798490bf1d | ||
|
4a1f617473 | ||
|
e0476d4f53 | ||
|
a8fe3926dc | ||
|
da7b24449d | ||
|
c083a4adda | ||
|
783a156bd2 | ||
|
a259d61f57 | ||
|
8b28881aa2 | ||
|
4f05364eb9 | ||
|
0bab5db1dd | ||
|
08a6f663de | ||
|
e8769fd561 | ||
|
efc09df8df | ||
|
dc9245dd7a | ||
|
2503723e2f | ||
|
c6308ee7c0 | ||
|
002f08ba35 | ||
|
7ccb19fa00 | ||
|
8f5d761112 | ||
|
38a1442d40 | ||
|
f688bc6160 | ||
|
e6407907e2 | ||
|
8eb4ec29ee | ||
|
338abf77e3 | ||
|
f9c50a8db3 | ||
|
e59b96e968 | ||
|
714533d12e | ||
|
89f7fc63e8 | ||
|
a50e2c0c47 | ||
|
5170cd67fb | ||
|
bf7a4f629d | ||
|
5dbfd14699 | ||
|
7b026eff79 | ||
|
9238d28353 | ||
|
7bb617eeb6 | ||
|
2c65b9b133 | ||
|
dfb7bb1de1 | ||
|
0d349a82ca | ||
|
cdf580ee37 | ||
|
3d18d6dc77 | ||
|
d8343f2108 | ||
|
c952622fa0 | ||
|
b5573bb92d | ||
|
790f7ded5b | ||
|
23a45fcace | ||
|
d2a2c183ed | ||
|
832c9f64e0 | ||
|
405681f138 | ||
|
b7db12a593 | ||
|
4143f65b46 | ||
|
5f7fa4c89c | ||
|
83d8ea013b | ||
|
072f4c9260 | ||
|
3ac95f48f8 | ||
|
6e8da5a424 | ||
|
1214210864 | ||
|
abce057467 | ||
|
88d16b47a4 | ||
|
c2d254ea41 | ||
|
2c6369c5d9 | ||
|
f9389995e7 | ||
|
d4e0c08915 | ||
|
41f78b5c49 | ||
|
d70ad1230b | ||
|
f94bbcb4fe | ||
|
9203bf3141 | ||
|
6687b7e9ab | ||
|
823783773c | ||
|
94aff53e3f | ||
|
3cb86cb6f1 | ||
|
1e45a05000 | ||
|
25c4c481d7 | ||
|
17b94b8f9c | ||
|
29cda5f2ad | ||
|
91212d5453 | ||
|
32a2546c5d | ||
|
bac02a348e | ||
|
a620651ca1 | ||
|
99d3995548 | ||
|
c78ee4e201 | ||
|
774582876c | ||
|
bed8df20d2 | ||
|
593c7ed0e4 | ||
|
c221571963 | ||
|
20b16fda4f | ||
|
2b0acdcea4 | ||
|
9057f72fc7 | ||
|
eebab029fd | ||
|
7a55bcc0f3 | ||
|
51831924c5 | ||
|
bb7f843344 | ||
|
9005711ad7 | ||
|
fb94bd11fb | ||
|
852337cacd | ||
|
e8f9458a21 | ||
|
78b0c938a2 | ||
|
9c84b3b5fb | ||
|
6ca3a30576 | ||
|
b627a097bb | ||
|
0f6d16920b | ||
|
db3782e491 | ||
|
189d94e897 | ||
|
cfbd051d52 | ||
|
d978564600 | ||
|
2e20bae695 | ||
|
1f385b536a | ||
|
27a70f573f | ||
|
a39a421acb | ||
|
bafd649eea | ||
|
e3090e04c3 | ||
|
049f584111 | ||
|
d6cd90d325 | ||
|
d1c4f5bc35 | ||
|
df4b391baa | ||
|
01073ffcbf | ||
|
9366f29fd7 | ||
|
b5fed65fe3 | ||
|
fedd0ae7f3 | ||
|
da6f751cef | ||
|
0fc6816be6 | ||
|
143578ad09 | ||
|
2a83290e7c | ||
|
be1d1c7d05 | ||
|
518902ef51 | ||
|
f5801320b7 | ||
|
44fcdd007f | ||
|
8b6c6e794a | ||
|
182312010b | ||
|
3ec3dfcf3a | ||
|
35e5dc46c7 | ||
|
e80bb565ce | ||
|
9951458ebf | ||
|
45d7e18f6b | ||
|
ef39f3a9ab | ||
|
f1e11414e8 | ||
|
ba205a6bce | ||
|
d589142c0b | ||
|
75dd91412b | ||
|
cf93c6503a | ||
|
b1d829c232 | ||
|
39cd228e06 | ||
|
16deefa7f8 | ||
|
0daa999fd0 | ||
|
30f256102f | ||
|
b00b504343 | ||
|
080690073a | ||
|
8fda16527e | ||
|
abef078ab9 | ||
|
7580798a5a | ||
|
cc134d5fed | ||
|
33239183ae | ||
|
6025c40cab | ||
|
622d5b2643 | ||
|
5ca77df084 | ||
|
67502c0d22 | ||
|
b7a89187b5 | ||
|
a462f14aa3 | ||
|
1d2a127144 | ||
|
cb12a065df | ||
|
309a6b9313 | ||
|
e52bc2d022 | ||
|
1c0c9c1bca | ||
|
dcb36d572d | ||
|
502214bf06 | ||
|
3bc2b54128 | ||
|
d004a1c6b8 | ||
|
62e13e945c | ||
|
e4b30c474b | ||
|
4527789e50 | ||
|
084aa56777 | ||
|
66279e1a57 | ||
|
345c25c367 | ||
|
4119be5a3d | ||
|
d4fb3996d3 | ||
|
b3b7f8e925 | ||
|
7f5f5c216b | ||
|
d741ab57a8 | ||
|
7a478b27dd | ||
|
4fc6e7dbc7 | ||
|
350786c969 | ||
|
1e28748c0c | ||
|
aa1b427e45 | ||
|
a67db63a18 | ||
|
603726371c | ||
|
c701e8a131 | ||
|
5465c594ca | ||
|
f2fb8e339d | ||
|
9833eb4f13 | ||
|
b8a31241a3 | ||
|
9e06beb48d | ||
|
70cbe67105 | ||
|
684a050916 | ||
|
59a1f4e8ac | ||
|
a8c033f655 | ||
|
5e99c09abe | ||
|
65b40f15f5 | ||
|
de90dd25b2 | ||
|
c2b4636008 | ||
|
740be0507e | ||
|
ab3e4b8abc | ||
|
6e0d12094a | ||
|
5a107d9dc1 | ||
|
c7a0b4479d | ||
|
0e7448e2b3 | ||
|
1b75411e81 | ||
|
923fdb0aa0 | ||
|
b73b9f1dec | ||
|
f42a737419 | ||
|
713fe496ce | ||
|
cfeb2bec80 | ||
|
52aafb4dea | ||
|
45baaf6022 | ||
|
34141b576e | ||
|
2226043325 | ||
|
96d97ae2d2 | ||
|
bdad879508 | ||
|
e0180991bf | ||
|
af3cde98f4 | ||
|
9c320ccdce | ||
|
7f820ee962 | ||
|
aef5be3d17 | ||
|
34602037dc | ||
|
9cd0295dd8 | ||
|
818df0ec68 | ||
|
c018b3bbc7 | ||
|
ae8129b699 | ||
|
95add752b7 | ||
|
aa0c55ed8f | ||
|
acaa10de52 | ||
|
2fb7ef2668 | ||
|
98c9734db4 | ||
|
62abead26d | ||
|
6d8df7332c | ||
|
46a789de5c | ||
|
c818873d48 | ||
|
0bc352ea7e | ||
|
78c0221855 | ||
|
f80dc9dc16 | ||
|
18e8f281be | ||
|
e98a5afd07 | ||
|
281661c23e | ||
|
55a3d88793 | ||
|
e25e411e2b | ||
|
59a178f3cb | ||
|
2308472eb0 | ||
|
887f83589f | ||
|
196eb98ba8 | ||
|
0fc70d4b15 | ||
|
c5178a19b2 | ||
|
552f35952a | ||
|
a53b57c8a2 | ||
|
8769f185f5 | ||
|
4a7f905c6a | ||
|
c46024bfa2 | ||
|
60f31d48e2 | ||
|
615e5c1076 | ||
|
ba1e3fd661 | ||
|
366dfce846 | ||
|
70c74df009 | ||
|
47514ca2df | ||
|
a151ad912a | ||
|
fcc7e7d333 | ||
|
ef0838e931 | ||
|
96339b7c86 | ||
|
b0f5ef0b1a | ||
|
77c2b2a51d | ||
|
2e7a60d986 | ||
|
4d7cb7ca73 | ||
|
ca883f1196 | ||
|
cfdaf2d63f | ||
|
29ccbd8098 | ||
|
1a001fc233 | ||
|
d5dd9c929d | ||
|
3bda9a3c11 | ||
|
7112058d7b | ||
|
c3a0e09ddb | ||
|
94da39cd88 | ||
|
4cdcb6d5d3 | ||
|
8a6d55520d | ||
|
fa474c4378 | ||
|
134a5e0391 | ||
|
c7cc8a098e | ||
|
21cc1fda85 | ||
|
d53b584c9a | ||
|
5fa6871ebf | ||
|
772bbdfeae | ||
|
5ad69bbecf | ||
|
d0a1650a04 | ||
|
c887eedaa5 | ||
|
d66a53a531 | ||
|
dbc09bf0d4 | ||
|
8b23272c33 |
78
.jscsrc
Normal file
78
.jscsrc
Normal file
@@ -0,0 +1,78 @@
|
||||
|
||||
{
|
||||
"excludeFiles": ["node_modules/**", "**/build/**"],
|
||||
"requireCurlyBraces": [
|
||||
"if", "else", "for", "while", "do", "try", "catch"
|
||||
],
|
||||
"requireSpaceBeforeKeywords": [
|
||||
"else", "while", "catch"
|
||||
],
|
||||
"requireSpaceAfterKeywords": [
|
||||
"do", "for", "if", "else", "switch", "case", "try", "catch", "while", "return", "typeof"
|
||||
],
|
||||
"requireSpaceBeforeBlockStatements": true,
|
||||
"requireParenthesesAroundIIFE": true,
|
||||
"requireSpacesInConditionalExpression": {
|
||||
"afterTest": true,
|
||||
"beforeConsequent": true,
|
||||
"afterConsequent": true,
|
||||
"beforeAlternate": true
|
||||
},
|
||||
"requireSpacesInAnonymousFunctionExpression": {
|
||||
"beforeOpeningCurlyBrace": true
|
||||
},
|
||||
"disallowSpacesInNamedFunctionExpression": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"requireSpacesInFunction": {
|
||||
"beforeOpeningCurlyBrace": true
|
||||
},
|
||||
"disallowSpacesInCallExpression": true,
|
||||
"requireBlocksOnNewline": true,
|
||||
"requirePaddingNewlinesBeforeKeywords": ["case"],
|
||||
"disallowEmptyBlocks": true,
|
||||
"disallowSpacesInsideArrayBrackets": "nested",
|
||||
"disallowSpacesInsideParentheses": true,
|
||||
"requireSpacesInsideObjectBrackets": "all",
|
||||
"disallowQuotedKeysInObjects": "allButReserved",
|
||||
"disallowSpaceAfterObjectKeys": true,
|
||||
"requireSpaceBeforeObjectValues": true,
|
||||
"requireCommaBeforeLineBreak": true,
|
||||
"requireOperatorBeforeLineBreak": [
|
||||
"?", "=", "+", "-", "/", "*", "===", "!==", ">", ">=", "<", "<="
|
||||
],
|
||||
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
|
||||
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
|
||||
"requireSpaceBeforeBinaryOperators": [
|
||||
"=", "+", "+=", "-", "-=", "/", "/=", "*", "*=", "===", "!==", "<", "<=", ">", ">="
|
||||
],
|
||||
"requireSpaceAfterBinaryOperators": [
|
||||
"=", "+", "+=", "-", "-=", "/", "/=", "*", "*=", "===", "!==", "<", "<=", ">", ">="
|
||||
],
|
||||
"disallowKeywords": ["with"],
|
||||
"disallowMultipleLineStrings": true,
|
||||
"disallowMixedSpacesAndTabs": "smart",
|
||||
"disallowTrailingWhitespace": true,
|
||||
"disallowTrailingComma": true,
|
||||
"disallowKeywordsOnNewLine": ["else"],
|
||||
"requireLineFeedAtFileEnd": true,
|
||||
"maximumLineLength": {
|
||||
"value": 120,
|
||||
"tabSize": 4,
|
||||
"allowUrlComments": true,
|
||||
"allowRegex": true
|
||||
},
|
||||
"requireCapitalizedConstructors": true,
|
||||
"requireDotNotation": true,
|
||||
"disallowYodaConditions": true,
|
||||
"requireSpaceAfterLineComment": {
|
||||
"allExcept": ["#", "="]
|
||||
},
|
||||
"disallowNewlineBeforeBlockStatements": true,
|
||||
"validateQuoteMarks": {
|
||||
"mark": "'",
|
||||
"escape": true
|
||||
},
|
||||
"validateParameterSeparator": ", ",
|
||||
"safeContextKeyword": ["that"]
|
||||
}
|
24
.jshintrc
Normal file
24
.jshintrc
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
{
|
||||
"bitwise": true,
|
||||
"curly": true,
|
||||
"eqeqeq": true,
|
||||
"es3": true,
|
||||
"forin": false,
|
||||
"freeze": true,
|
||||
"newcap": true,
|
||||
"noarg": true,
|
||||
"noempty": true,
|
||||
"nonbsp": true,
|
||||
"undef": true,
|
||||
"unused": true,
|
||||
"strict": true,
|
||||
|
||||
"browser": true,
|
||||
"devel": true,
|
||||
"jquery": true,
|
||||
|
||||
"globals": {
|
||||
"JSON": true
|
||||
}
|
||||
}
|
@@ -46,6 +46,7 @@ script:
|
||||
- travis/check-sami-parse-errors.sh $DB $TRAVIS_PHP_VERSION
|
||||
- travis/check-image-icc-profiles.sh $DB $TRAVIS_PHP_VERSION
|
||||
- travis/check-executable-files.sh $DB $TRAVIS_PHP_VERSION ./
|
||||
- sh -c "if [ '$SLOWTESTS' != '1' -a '$DB' = 'mysqli' ]; then phpBB/vendor/bin/phpunit tests/lint_test.php; fi"
|
||||
- sh -c "if [ '$SLOWTESTS' != '1' ]; then phpBB/vendor/bin/phpunit --configuration travis/phpunit-$DB-travis.xml; fi"
|
||||
- sh -c "if [ '$SLOWTESTS' = '1' ]; then phpBB/vendor/bin/phpunit --configuration travis/phpunit-$DB-travis.xml --group slow; fi"
|
||||
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.3.3' -a '$DB' = 'mysqli' -a '$TRAVIS_PULL_REQUEST' != 'false' ]; then git-tools/commit-msg-hook-range.sh origin/$TRAVIS_BRANCH..FETCH_HEAD; fi"
|
||||
|
@@ -2,9 +2,9 @@
|
||||
|
||||
<project name="phpBB" description="The phpBB forum software" default="all" basedir="../">
|
||||
<!-- a few settings for the build -->
|
||||
<property name="newversion" value="3.1.4" />
|
||||
<property name="prevversion" value="3.1.3" />
|
||||
<property name="olderversions" value="3.0.12, 3.0.13, 3.0.13-PL1, 3.0.14, 3.1.0, 3.1.1, 3.1.2, 3.1.4-RC1, 3.1.4-RC2" />
|
||||
<property name="newversion" value="3.1.6-RC1" />
|
||||
<property name="prevversion" value="3.1.5" />
|
||||
<property name="olderversions" value="3.0.12, 3.0.13, 3.0.13-PL1, 3.0.14, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4" />
|
||||
<!-- no configuration should be needed beyond this point -->
|
||||
|
||||
<property name="oldversions" value="${olderversions}, ${prevversion}" />
|
||||
@@ -75,14 +75,14 @@
|
||||
|
||||
<target name="sniff">
|
||||
<exec command="phpBB/vendor/bin/phpcs
|
||||
-s
|
||||
-s -p
|
||||
--extensions=php
|
||||
--standard=build/code_sniffer/ruleset-php-strict-core.xml
|
||||
--ignore=${project.basedir}/phpBB/phpbb/db/migration/data/v30x/*
|
||||
phpBB/phpbb"
|
||||
dir="." returnProperty="retval-php-strict" passthru="true" />
|
||||
<exec command="phpBB/vendor/bin/phpcs
|
||||
-s
|
||||
-s -p
|
||||
--extensions=php
|
||||
--standard=build/code_sniffer/ruleset-php-legacy-core.xml
|
||||
--ignore=${project.basedir}/phpBB/cache/*
|
||||
@@ -98,7 +98,7 @@
|
||||
phpBB"
|
||||
dir="." returnProperty="retval-php-legacy" passthru="true" />
|
||||
<exec command="phpBB/vendor/bin/phpcs
|
||||
-s
|
||||
-s -p
|
||||
--extensions=php
|
||||
--standard=build/code_sniffer/ruleset-php-extensions.xml
|
||||
--ignore=${project.basedir}/phpBB/ext/*/tests/*
|
||||
@@ -149,7 +149,7 @@
|
||||
<property name="dir" value="build/old_versions/release-${version}" />
|
||||
</phingcall>
|
||||
|
||||
<exec dir="build/old_versions" command="LC_ALL=C diff -crNEBwd release-${version} release-${newversion} >
|
||||
<exec dir="build/old_versions" command="LC_ALL=C diff -crNEBZbd release-${version} release-${newversion} >
|
||||
../new_version/patches/phpBB-${version}_to_${newversion}.patch" escape="false" />
|
||||
<exec dir="build/old_versions" command="LC_ALL=C diff -qr release-${version} release-${newversion} | grep 'Only in release-${version}' > ../new_version/patches/phpBB-${version}_to_${newversion}.deleted" escape="false" />
|
||||
</target>
|
||||
@@ -177,13 +177,13 @@
|
||||
<target name="package" depends="clean,prepare,prepare-new-version,old-version-diffs">
|
||||
<exec dir="build" command="php -f package.php '${versions}' > logs/package.log" escape="false" />
|
||||
<exec dir="build" escape="false"
|
||||
command="diff -crNEBwd old_versions/release-${prevversion}/language new_version/phpBB3/language >
|
||||
command="LC_ALL=C diff -crNEBZbd old_versions/release-${prevversion}/language new_version/phpBB3/language >
|
||||
save/phpbb-${prevversion}_to_${newversion}_language.patch" />
|
||||
<exec dir="build" escape="false"
|
||||
command="diff -crNEBwd old_versions/release-${prevversion}/styles/prosilver new_version/phpBB3/styles/prosilver >
|
||||
command="LC_ALL=C diff -crNEBZbd old_versions/release-${prevversion}/styles/prosilver new_version/phpBB3/styles/prosilver >
|
||||
save/phpbb-${prevversion}_to_${newversion}_prosilver.patch" />
|
||||
<exec dir="build" escape="false"
|
||||
command="diff -crNEBwd old_versions/release-${prevversion}/styles/subsilver2 new_version/phpBB3/styles/subsilver2 >
|
||||
command="LC_ALL=C diff -crNEBZbd old_versions/release-${prevversion}/styles/subsilver2 new_version/phpBB3/styles/subsilver2 >
|
||||
save/phpbb-${prevversion}_to_${newversion}_subsilver2.patch" />
|
||||
|
||||
<exec dir="build" escape="false"
|
||||
|
@@ -22,11 +22,11 @@ class build_package
|
||||
// -r - compare recursive
|
||||
// -N - Treat missing files as empty
|
||||
// -E - Ignore tab expansions
|
||||
// not used: -b - Ignore space changes.
|
||||
// -w - Ignore all whitespace
|
||||
// -Z - Ignore white space at line end.
|
||||
// -b - Ignore changes in the amount of white space.
|
||||
// -B - Ignore blank lines
|
||||
// -d - Try to find smaller set of changes
|
||||
var $diff_options = '-crNEBwd';
|
||||
var $diff_options = '-crNEBZbd';
|
||||
var $diff_options_long = '-x images -crNEB'; // -x fonts -x imageset //imageset not used here, because it includes the imageset.cfg file. ;)
|
||||
|
||||
var $verbose = false;
|
||||
|
@@ -60,14 +60,14 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
|
||||
return;
|
||||
}
|
||||
// Mark as error if this is not a doc comment
|
||||
else if ($start === false || $tokens[$start]['code'] !== T_DOC_COMMENT)
|
||||
else if ($start === false || $tokens[$start]['code'] !== T_DOC_COMMENT_OPEN_TAG)
|
||||
{
|
||||
$phpcsFile->addError('Missing required file doc comment.', $stackPtr);
|
||||
return;
|
||||
}
|
||||
|
||||
// Find comment end token
|
||||
$end = $phpcsFile->findNext(T_DOC_COMMENT, $start + 1, null, true) - 1;
|
||||
$end = $tokens[$start]['comment_closer'];
|
||||
|
||||
// If there is no end, skip processing here
|
||||
if ($end === false)
|
||||
@@ -75,38 +75,30 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
|
||||
return;
|
||||
}
|
||||
|
||||
// List of found comment tags
|
||||
$tags = array();
|
||||
|
||||
// check comment lines without the first(/**) an last(*/) line
|
||||
for ($i = $start + 1, $c = $end - 1; $i <= $c; ++$i)
|
||||
for ($token = $start + 1, $c = $end - 2; $token <= $c; ++$token)
|
||||
{
|
||||
$line = $tokens[$i]['content'];
|
||||
|
||||
// Check that each line starts with a '*'
|
||||
if (substr($line, 0, 1) !== '*' && substr($line, 0, 2) !== ' *')
|
||||
if ($tokens[$token]['column'] === 1 && (($tokens[$token]['content'] !== '*' && $tokens[$token]['content'] !== ' ') || ($tokens[$token]['content'] === ' ' && $tokens[$token + 1]['content'] !== '*')))
|
||||
{
|
||||
$message = 'The file doc comment should not be indented.';
|
||||
$phpcsFile->addWarning($message, $i);
|
||||
}
|
||||
else if (preg_match('/^[ ]?\*\s+@([\w]+)\s+(.*)$/', $line, $match) !== 0)
|
||||
{
|
||||
if (!isset($tags[$match[1]]))
|
||||
{
|
||||
$tags[$match[1]] = array();
|
||||
}
|
||||
|
||||
$tags[$match[1]][] = array($match[2], $i);
|
||||
$phpcsFile->addWarning($message, $token);
|
||||
}
|
||||
}
|
||||
|
||||
// Check that the first and last line is empty
|
||||
if (trim($tokens[$start + 1]['content']) !== '*')
|
||||
// /**T_WHITESPACE
|
||||
// (T_WHITESPACE)*T_WHITESPACE
|
||||
// (T_WHITESPACE)* ...
|
||||
// (T_WHITESPACE)*T_WHITESPACE
|
||||
// T_WHITESPACE*/
|
||||
if (!(($tokens[$start + 2]['content'] !== '*' && $tokens[$start + 4]['content'] !== '*') || ($tokens[$start + 3]['content'] !== '*' && $tokens[$start + 6]['content'] !== '*')))
|
||||
{
|
||||
$message = 'The first file comment line should be empty.';
|
||||
$phpcsFile->addWarning($message, ($start + 1));
|
||||
}
|
||||
if (trim($tokens[$end - 1]['content']) !== '*')
|
||||
|
||||
if ($tokens[$end - 3]['content'] !== '*' && $tokens[$end - 6]['content'] !== '*')
|
||||
{
|
||||
$message = 'The last file comment line should be empty.';
|
||||
$phpcsFile->addWarning($message, $end - 1);
|
||||
@@ -114,8 +106,8 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
|
||||
|
||||
//$this->processPackage($phpcsFile, $start, $tags);
|
||||
//$this->processVersion($phpcsFile, $start, $tags);
|
||||
$this->processCopyright($phpcsFile, $start, $tags);
|
||||
$this->processLicense($phpcsFile, $start, $tags);
|
||||
$this->processCopyright($phpcsFile, $start, $tokens[$start]['comment_tags']);
|
||||
$this->processLicense($phpcsFile, $start, $tokens[$start]['comment_tags']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -176,17 +168,24 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
|
||||
protected function processCopyright(PHP_CodeSniffer_File $phpcsFile, $ptr, $tags)
|
||||
{
|
||||
$copyright = '(c) phpBB Limited <https://www.phpbb.com>';
|
||||
$tokens = $phpcsFile->getTokens();
|
||||
|
||||
if (!isset($tags['copyright']))
|
||||
foreach ($tags as $tag)
|
||||
{
|
||||
$message = 'Missing require @copyright tag in file doc comment.';
|
||||
$phpcsFile->addError($message, $ptr);
|
||||
}
|
||||
else if ($tags['copyright'][0][0] !== $copyright)
|
||||
{
|
||||
$message = 'Invalid content found for the first @copyright tag, use "' . $copyright . '".';
|
||||
$phpcsFile->addError($message, $tags['copyright'][0][1]);
|
||||
if ($tokens[$tag]['content'] === '@copyright')
|
||||
{
|
||||
if ($tokens[$tag + 2]['content'] !== $copyright)
|
||||
{
|
||||
$message = 'Invalid content found for the first @copyright tag, use "' . $copyright . '".';
|
||||
$phpcsFile->addError($message, $tags['copyright'][0][1]);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$message = 'Missing require @copyright tag in file doc comment.';
|
||||
$phpcsFile->addError($message, $ptr);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -201,22 +200,33 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
|
||||
protected function processLicense(PHP_CodeSniffer_File $phpcsFile, $ptr, $tags)
|
||||
{
|
||||
$license = 'GNU General Public License, version 2 (GPL-2.0)';
|
||||
$tokens = $phpcsFile->getTokens();
|
||||
|
||||
if (!isset($tags['license']))
|
||||
$found = false;
|
||||
foreach ($tags as $tag)
|
||||
{
|
||||
if ($tokens[$tag]['content'] === '@license')
|
||||
{
|
||||
if ($found)
|
||||
{
|
||||
$message = 'It must be only one @license tag in file doc comment.';
|
||||
$phpcsFile->addError($message, $ptr);
|
||||
}
|
||||
|
||||
$found = true;
|
||||
|
||||
if ($tokens[$tag + 2]['content'] !== $license)
|
||||
{
|
||||
$message = 'Invalid content found for @license tag, use "' . $license . '".';
|
||||
$phpcsFile->addError($message, $tags['license'][0][1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$found)
|
||||
{
|
||||
$message = 'Missing require @license tag in file doc comment.';
|
||||
$phpcsFile->addError($message, $ptr);
|
||||
}
|
||||
else if (sizeof($tags['license']) !== 1)
|
||||
{
|
||||
$message = 'It must be only one @license tag in file doc comment.';
|
||||
$phpcsFile->addError($message, $ptr);
|
||||
}
|
||||
else if (trim($tags['license'][0][0]) !== $license)
|
||||
{
|
||||
$message = 'Invalid content found for @license tag, use '
|
||||
. '"' . $license . '".';
|
||||
$phpcsFile->addError($message, $tags['license'][0][1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,143 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* This file is part of the phpBB Forum Software package.
|
||||
*
|
||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||
*
|
||||
* For full copyright and license information, please see
|
||||
* the docs/CREDITS.txt file.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Checks that the opening brace of a control structures is on the line after.
|
||||
* From Generic_Sniffs_Functions_OpeningFunctionBraceBsdAllmanSniff
|
||||
*/
|
||||
class phpbb_Sniffs_ControlStructures_OpeningBraceBsdAllmanSniff implements PHP_CodeSniffer_Sniff
|
||||
{
|
||||
/**
|
||||
* Registers the tokens that this sniff wants to listen for.
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
return array(
|
||||
T_IF,
|
||||
T_ELSE,
|
||||
T_FOREACH,
|
||||
T_WHILE,
|
||||
T_DO,
|
||||
T_FOR,
|
||||
T_SWITCH,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
$tokens = $phpcsFile->getTokens();
|
||||
|
||||
if (isset($tokens[$stackPtr]['scope_opener']) === false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* ...
|
||||
* }
|
||||
* else if ()
|
||||
* {
|
||||
* ...
|
||||
*/
|
||||
if ($tokens[$stackPtr]['code'] === T_ELSE && $tokens[$stackPtr + 2]['code'] === T_IF)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$openingBrace = $tokens[$stackPtr]['scope_opener'];
|
||||
|
||||
/*
|
||||
* ...
|
||||
* do
|
||||
* {
|
||||
* <code>
|
||||
* } while();
|
||||
* ...
|
||||
* }
|
||||
* else
|
||||
* {
|
||||
* ...
|
||||
*/
|
||||
if ($tokens[$stackPtr]['code'] === T_DO ||$tokens[$stackPtr]['code'] === T_ELSE)
|
||||
{
|
||||
$cs_line = $tokens[$stackPtr]['line'];
|
||||
}
|
||||
else
|
||||
{
|
||||
// The end of the function occurs at the end of the argument list. Its
|
||||
// like this because some people like to break long function declarations
|
||||
// over multiple lines.
|
||||
$cs_line = $tokens[$tokens[$stackPtr]['parenthesis_closer']]['line'];
|
||||
}
|
||||
|
||||
$braceLine = $tokens[$openingBrace]['line'];
|
||||
|
||||
$lineDifference = ($braceLine - $cs_line);
|
||||
|
||||
if ($lineDifference === 0)
|
||||
{
|
||||
$error = 'Opening brace should be on a new line';
|
||||
$phpcsFile->addError($error, $openingBrace, 'BraceOnSameLine');
|
||||
return;
|
||||
}
|
||||
|
||||
if ($lineDifference > 1)
|
||||
{
|
||||
$error = 'Opening brace should be on the line after the declaration; found %s blank line(s)';
|
||||
$data = array(($lineDifference - 1));
|
||||
$phpcsFile->addError($error, $openingBrace, 'BraceSpacing', $data);
|
||||
return;
|
||||
}
|
||||
|
||||
// We need to actually find the first piece of content on this line,
|
||||
// as if this is a method with tokens before it (public, static etc)
|
||||
// or an if with an else before it, then we need to start the scope
|
||||
// checking from there, rather than the current token.
|
||||
$lineStart = $stackPtr;
|
||||
while (($lineStart = $phpcsFile->findPrevious(array(T_WHITESPACE), ($lineStart - 1), null, false)) !== false)
|
||||
{
|
||||
if (strpos($tokens[$lineStart]['content'], $phpcsFile->eolChar) !== false)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// We found a new line, now go forward and find the first non-whitespace
|
||||
// token.
|
||||
$lineStart = $phpcsFile->findNext(array(T_WHITESPACE), $lineStart, null, true);
|
||||
|
||||
// The opening brace is on the correct line, now it needs to be
|
||||
// checked to be correctly indented.
|
||||
$startColumn = $tokens[$lineStart]['column'];
|
||||
$braceIndent = $tokens[$openingBrace]['column'];
|
||||
|
||||
if ($braceIndent !== $startColumn)
|
||||
{
|
||||
$error = 'Opening brace indented incorrectly; expected %s spaces, found %s';
|
||||
$data = array(
|
||||
($startColumn - 1),
|
||||
($braceIndent - 1),
|
||||
);
|
||||
$phpcsFile->addError($error, $openingBrace, 'BraceIndent', $data);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* This file is part of the phpBB Forum Software package.
|
||||
*
|
||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||
*
|
||||
* For full copyright and license information, please see
|
||||
* the docs/CREDITS.txt file.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Checks that there is exactly one space between the keyword and the opening
|
||||
* parenthesis of a control structures.
|
||||
*/
|
||||
class phpbb_Sniffs_ControlStructures_OpeningParenthesisSniff implements PHP_CodeSniffer_Sniff
|
||||
{
|
||||
/**
|
||||
* Registers the tokens that this sniff wants to listen for.
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
return array(
|
||||
T_IF,
|
||||
T_FOREACH,
|
||||
T_WHILE,
|
||||
T_FOR,
|
||||
T_SWITCH,
|
||||
T_ELSEIF,
|
||||
T_CATCH,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
$tokens = $phpcsFile->getTokens();
|
||||
|
||||
if ($tokens[$stackPtr + 1]['content'] === '(')
|
||||
{
|
||||
$error = 'There should be exactly one space between the keyword and opening parenthesis';
|
||||
$phpcsFile->addError($error, $stackPtr, 'NoSpaceBeforeOpeningParenthesis');
|
||||
}
|
||||
else if ($tokens[$stackPtr + 1]['content'] !== ' ')
|
||||
{
|
||||
$error = 'There should be exactly one space between the keyword and opening parenthesis';
|
||||
$phpcsFile->addError($error, $stackPtr, 'IncorrectSpaceBeforeOpeningParenthesis');
|
||||
}
|
||||
}
|
||||
}
|
@@ -138,6 +138,7 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
|
||||
// Check docblocks
|
||||
$find = array(
|
||||
T_COMMENT,
|
||||
T_DOC_COMMENT_CLOSE_TAG,
|
||||
T_DOC_COMMENT,
|
||||
T_CLASS,
|
||||
T_FUNCTION,
|
||||
@@ -147,43 +148,31 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
|
||||
$comment_end = $phpcsFile->findPrevious($find, ($function_declaration - 1));
|
||||
if ($comment_end !== false)
|
||||
{
|
||||
if (!$tokens[$comment_end]['code'] !== T_DOC_COMMENT)
|
||||
if ($tokens[$comment_end]['code'] === T_DOC_COMMENT_CLOSE_TAG)
|
||||
{
|
||||
$comment_start = ($phpcsFile->findPrevious(T_DOC_COMMENT, ($comment_end - 1), null, true) + 1);
|
||||
$comment = $phpcsFile->getTokensAsString($comment_start, ($comment_end - $comment_start + 1));
|
||||
|
||||
try
|
||||
{
|
||||
$comment_parser = new PHP_CodeSniffer_CommentParser_FunctionCommentParser($comment, $phpcsFile);
|
||||
$comment_parser->parse();
|
||||
|
||||
// Check @param
|
||||
foreach ($comment_parser->getParams() as $param) {
|
||||
$type = $param->getType();
|
||||
$types = explode('|', str_replace('[]', '', $type));
|
||||
foreach ($types as $type)
|
||||
{
|
||||
$ok = $this->check($phpcsFile, $type, $class_name_full, $class_name_short, $param->getLine() + $comment_start) ? true : $ok;
|
||||
}
|
||||
$comment_start = $tokens[$comment_end]['comment_opener'];
|
||||
foreach ($tokens[$comment_start]['comment_tags'] as $tag) {
|
||||
if ($tokens[$tag]['content'] !== '@param' && $tokens[$tag]['content'] !== '@return' && $tokens[$tag]['content'] !== '@throws') {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check @return
|
||||
$return = $comment_parser->getReturn();
|
||||
if ($return !== null)
|
||||
$classes = $tokens[($tag + 2)]['content'];
|
||||
$space = strpos($classes, ' ');
|
||||
if ($space !== false) {
|
||||
$classes = substr($classes, 0, $space);
|
||||
}
|
||||
|
||||
$tab = strpos($classes, "\t");
|
||||
if ($tab !== false) {
|
||||
$classes = substr($classes, 0, $tab);
|
||||
}
|
||||
|
||||
$classes = explode('|', str_replace('[]', '', $classes));
|
||||
foreach ($classes as $class)
|
||||
{
|
||||
$type = $return->getValue();
|
||||
$types = explode('|', str_replace('[]', '', $type));
|
||||
foreach ($types as $type)
|
||||
{
|
||||
$ok = $this->check($phpcsFile, $type, $class_name_full, $class_name_short, $return->getLine() + $comment_start) ? true : $ok;
|
||||
}
|
||||
$ok = $this->check($phpcsFile, $class, $class_name_full, $class_name_short, $tokens[$tag + 2]['line']) ? true : $ok;
|
||||
}
|
||||
}
|
||||
catch (PHP_CodeSniffer_CommentParser_ParserException $e)
|
||||
{
|
||||
$line = ($e->getLineWithinComment() + $comment_start);
|
||||
$phpcsFile->addError($e->getMessage(), $line, 'FailedParse');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,6 +184,20 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
|
||||
}
|
||||
}
|
||||
|
||||
// Checks in catch blocks
|
||||
$old_catch = $stackPtr;
|
||||
while (($catch = $phpcsFile->findNext(T_CATCH, ($old_catch + 1))) !== false)
|
||||
{
|
||||
$old_catch = $catch;
|
||||
|
||||
$caught_class_name_start = $phpcsFile->findNext(array(T_NS_SEPARATOR, T_STRING), $catch + 1);
|
||||
$caught_class_name_end = $phpcsFile->findNext($find, $caught_class_name_start + 1, null, true);
|
||||
|
||||
$caught_class_name = trim($phpcsFile->getTokensAsString($caught_class_name_start, ($caught_class_name_end - $caught_class_name_start)));
|
||||
|
||||
$ok = $this->check($phpcsFile, $caught_class_name, $class_name_full, $class_name_short, $catch) ? true : $ok;
|
||||
}
|
||||
|
||||
if (!$ok)
|
||||
{
|
||||
$error = 'There must not be unused USE statements.';
|
||||
|
@@ -12,4 +12,7 @@
|
||||
<!-- Tabs MUST be used for indentation -->
|
||||
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent" />
|
||||
|
||||
<!-- ALL braces MUST be on their own lines. -->
|
||||
<rule ref="./phpbb/Sniffs/ControlStructures/OpeningBraceBsdAllmanSniff.php" />
|
||||
|
||||
</ruleset>
|
||||
|
@@ -86,4 +86,7 @@
|
||||
<!-- The ?> closing tag MUST be omitted from files containing only PHP. -->
|
||||
<rule ref="Zend.Files.ClosingTag" />
|
||||
|
||||
<!-- There MUST be one space between control structure and opening parenthesis -->
|
||||
<rule ref="./phpbb/Sniffs/ControlStructures/OpeningParenthesisSniff.php" />
|
||||
|
||||
</ruleset>
|
||||
|
@@ -25,6 +25,7 @@ $config['versions'] = Sami\Version\GitVersionCollection::create(__DIR__ . '/../'
|
||||
*/
|
||||
->add('3.0.x')
|
||||
->add('3.1.x')
|
||||
->add('master')
|
||||
;
|
||||
|
||||
return new Sami\Sami($iterator, $config);
|
||||
|
BIN
composer.phar
BIN
composer.phar
Binary file not shown.
@@ -7,7 +7,7 @@
|
||||
<p>{L_EXTENSIONS_EXPLAIN}</p>
|
||||
|
||||
<fieldset class="quick">
|
||||
<span class="small"><a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE_ALL}</a> • <a href="javascript:phpbb.toggleDisplay('version_check_settings');">{L_SETTINGS}</a></span>
|
||||
<span class="small"><a href="https://www.phpbb.com/go/customise/extensions/3.1" target="_blank">{L_BROWSE_EXTENSIONS_DATABASE}</a> • <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE_ALL}</a> • <a href="javascript:phpbb.toggleDisplay('version_check_settings');">{L_SETTINGS}</a></span>
|
||||
</fieldset>
|
||||
|
||||
<form id="version_check_settings" method="post" action="{U_ACTION}" style="display:none">
|
||||
@@ -97,6 +97,12 @@
|
||||
</table>
|
||||
|
||||
<table class="table1">
|
||||
<tr>
|
||||
<th>{L_EXTENSION_INSTALL_HEADLINE}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row3">{L_EXTENSION_INSTALL_EXPLAIN}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{L_EXTENSION_UPDATE_HEADLINE}</th>
|
||||
</tr>
|
||||
|
@@ -343,6 +343,8 @@
|
||||
<!-- EVENT acp_forums_rules_settings_append -->
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<!-- EVENT acp_forums_custom_settings -->
|
||||
|
||||
<fieldset class="submit-buttons">
|
||||
<legend>{L_SUBMIT}</legend>
|
||||
|
@@ -39,7 +39,7 @@
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="jab_password">{L_JAB_PASSWORD}{L_COLON}</label><br /><span>{L_JAB_PASSWORD_EXPLAIN}</span></dt>
|
||||
<dd><input type="password" id="jab_password" name="jab_password" value="{JAB_PASSWORD}" /></dd>
|
||||
<dd><input type="password" id="jab_password" name="jab_password" value="{JAB_PASSWORD}" autocomplete="off" /></dd>
|
||||
</dl>
|
||||
<!-- IF S_CAN_USE_SSL -->
|
||||
<dl>
|
||||
|
@@ -68,6 +68,10 @@
|
||||
|
||||
<p>{L_ACP_LANGUAGE_PACKS_EXPLAIN}</p>
|
||||
|
||||
<fieldset class="quick">
|
||||
<span class="small"><a href="https://www.phpbb.com/go/customise/language-packs/3.1" target="_blank">{L_BROWSE_LANGUAGE_PACKS_DATABASE}</a></span>
|
||||
</fieldset>
|
||||
|
||||
<table class="table1 zebra-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@@ -79,6 +79,7 @@
|
||||
<dt><label for="field_hide">{L_HIDE_PROFILE_FIELD}{L_COLON}</label><br /><span>{L_HIDE_PROFILE_FIELD_EXPLAIN}</span></dt>
|
||||
<dd><input type="checkbox" class="radio" id="field_hide" name="field_hide" value="1"<!-- IF S_FIELD_HIDE --> checked="checked"<!-- ENDIF --> /></dd>
|
||||
</dl>
|
||||
<!-- EVENT acp_profile_contact_before -->
|
||||
<dl>
|
||||
<dt><label for="field_is_contact">{L_FIELD_IS_CONTACT}{L_COLON}</label><br /><span>{L_FIELD_IS_CONTACT_EXPLAIN}</span></dt>
|
||||
<dd><input type="checkbox" class="radio" id="field_is_contact" name="field_is_contact" value="1"<!-- IF S_FIELD_CONTACT --> checked="checked"<!-- ENDIF --> /></dd>
|
||||
|
@@ -19,7 +19,7 @@
|
||||
{S_HIDDEN_FIELDS}
|
||||
|
||||
<div style="text-align: center;">
|
||||
<input type="submit" name="confirm" value="{L_YES}" class="button2" />
|
||||
<input type="submit" name="confirm" value="{L_YES}" class="button2" />
|
||||
<input type="submit" name="cancel" value="{L_NO}" class="button2" />
|
||||
</div>
|
||||
|
||||
@@ -32,6 +32,10 @@
|
||||
|
||||
<!-- IF L_EXPLAIN --><p>{L_EXPLAIN}</p><!-- ENDIF -->
|
||||
|
||||
<fieldset class="quick">
|
||||
<span class="small"><a href="https://www.phpbb.com/go/customise/styles/3.1" target="_blank">{L_BROWSE_STYLES_DATABASE}</a></span>
|
||||
</fieldset>
|
||||
|
||||
<form id="acp_styles" method="post" action="{U_ACTION}">
|
||||
{S_HIDDEN_FIELDS}
|
||||
{S_FORM_TOKEN}
|
||||
|
@@ -17,6 +17,10 @@
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
abbr {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
body, div, p, th, td, li, dd {
|
||||
font-size: x-small;
|
||||
voice-family: "\"}\"";
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* global bbfontstyle */
|
||||
|
||||
var phpbb = {};
|
||||
phpbb.alertTime = 100;
|
||||
|
||||
@@ -13,7 +15,7 @@ var keymap = {
|
||||
};
|
||||
|
||||
var $dark = $('#darkenwrapper');
|
||||
var $loadingIndicator = $('#loading_indicator');
|
||||
var $loadingIndicator;
|
||||
var phpbbAlertTimer = null;
|
||||
|
||||
phpbb.isTouch = (window && typeof window.ontouchstart !== 'undefined');
|
||||
@@ -21,9 +23,14 @@ phpbb.isTouch = (window && typeof window.ontouchstart !== 'undefined');
|
||||
/**
|
||||
* Display a loading screen
|
||||
*
|
||||
* @returns object Returns loadingIndicator.
|
||||
* @returns {object} Returns loadingIndicator.
|
||||
*/
|
||||
phpbb.loadingIndicator = function() {
|
||||
if (!$loadingIndicator) {
|
||||
$loadingIndicator = $('<div />', { id: 'loading_indicator' });
|
||||
$loadingIndicator.appendTo('#page-footer');
|
||||
}
|
||||
|
||||
if (!$loadingIndicator.is(':visible')) {
|
||||
$loadingIndicator.fadeIn(phpbb.alertTime);
|
||||
// Wait fifteen seconds and display an error if nothing has been returned by then.
|
||||
@@ -54,7 +61,7 @@ phpbb.clearLoadingTimeout = function() {
|
||||
/**
|
||||
* Close popup alert after a specified delay
|
||||
*
|
||||
* @param int Delay in ms until darkenwrapper's click event is triggered
|
||||
* @param {int} delay Delay in ms until darkenwrapper's click event is triggered
|
||||
*/
|
||||
phpbb.closeDarkenWrapper = function(delay) {
|
||||
phpbbAlertTimer = setTimeout(function() {
|
||||
@@ -67,14 +74,12 @@ phpbb.closeDarkenWrapper = function(delay) {
|
||||
*
|
||||
* You can only call one alert or confirm box at any one time.
|
||||
*
|
||||
* @param string title Title of the message, eg "Information" (HTML).
|
||||
* @param string msg Message to display (HTML).
|
||||
* @param bool fadedark Remove the dark background when done? Defaults
|
||||
* to yes.
|
||||
* @param {string} title Title of the message, eg "Information" (HTML).
|
||||
* @param {string} msg Message to display (HTML).
|
||||
*
|
||||
* @returns object Returns the div created.
|
||||
* @returns {object} Returns the div created.
|
||||
*/
|
||||
phpbb.alert = function(title, msg, fadedark) {
|
||||
phpbb.alert = function(title, msg) {
|
||||
var $alert = $('#phpbb_alert');
|
||||
$alert.find('.alert_title').html(title);
|
||||
$alert.find('.alert_text').html(msg);
|
||||
@@ -94,14 +99,14 @@ phpbb.alert = function(title, msg, fadedark) {
|
||||
/**
|
||||
* Handler for opening an alert box.
|
||||
*
|
||||
* @param jQuery $alert jQuery object.
|
||||
* @param {jQuery} $alert jQuery object.
|
||||
*/
|
||||
phpbb.alert.open = function($alert) {
|
||||
if (!$dark.is(':visible')) {
|
||||
$dark.fadeIn(phpbb.alertTime);
|
||||
}
|
||||
|
||||
if ($loadingIndicator.is(':visible')) {
|
||||
if ($loadingIndicator && $loadingIndicator.is(':visible')) {
|
||||
$loadingIndicator.fadeOut(phpbb.alertTime, function() {
|
||||
$dark.append($alert);
|
||||
$alert.fadeIn(phpbb.alertTime);
|
||||
@@ -134,8 +139,8 @@ phpbb.alert.open = function($alert) {
|
||||
/**
|
||||
* Handler for closing an alert box.
|
||||
*
|
||||
* @param jQuery $alert jQuery object.
|
||||
* @param bool fadedark Whether to remove dark background.
|
||||
* @param {jQuery} $alert jQuery object.
|
||||
* @param {bool} fadedark Whether to remove dark background.
|
||||
*/
|
||||
phpbb.alert.close = function($alert, fadedark) {
|
||||
var $fade = (fadedark) ? $dark : $alert;
|
||||
@@ -153,13 +158,13 @@ phpbb.alert.close = function($alert, fadedark) {
|
||||
*
|
||||
* You can only call one alert or confirm box at any one time.
|
||||
*
|
||||
* @param string msg Message to display (HTML).
|
||||
* @param function callback Callback. Bool param, whether the user pressed
|
||||
* @param {string} msg Message to display (HTML).
|
||||
* @param {function} callback Callback. Bool param, whether the user pressed
|
||||
* yes or no (or whatever their language is).
|
||||
* @param bool fadedark Remove the dark background when done? Defaults
|
||||
* @param {bool} fadedark Remove the dark background when done? Defaults
|
||||
* to yes.
|
||||
*
|
||||
* @returns object Returns the div created.
|
||||
* @returns {object} Returns the div created.
|
||||
*/
|
||||
phpbb.confirm = function(msg, callback, fadedark) {
|
||||
var $confirmDiv = $('#phpbb_confirm');
|
||||
@@ -197,8 +202,8 @@ phpbb.confirm = function(msg, callback, fadedark) {
|
||||
/**
|
||||
* Turn a querystring into an array.
|
||||
*
|
||||
* @argument string string The querystring to parse.
|
||||
* @returns object The object created.
|
||||
* @argument {string} string The querystring to parse.
|
||||
* @returns {object} The object created.
|
||||
*/
|
||||
phpbb.parseQuerystring = function(string) {
|
||||
var params = {}, i, split;
|
||||
@@ -223,12 +228,7 @@ phpbb.parseQuerystring = function(string) {
|
||||
* For more info, view the following page on the phpBB wiki:
|
||||
* http://wiki.phpbb.com/JavaScript_Function.phpbb.ajaxify
|
||||
*
|
||||
* @param object options Options.
|
||||
* @param bool/function refresh If we are sent back a refresh, should it be
|
||||
* acted upon? This can either be true / false / a function.
|
||||
* @param function callback Callback to call on completion of event. Has
|
||||
* three parameters: the element that the event was evoked from, the JSON
|
||||
* that was returned and (if it is a form) the form action.
|
||||
* @param {object} options Options.
|
||||
*/
|
||||
phpbb.ajaxify = function(options) {
|
||||
var $elements = $(options.selector),
|
||||
@@ -262,11 +262,16 @@ phpbb.ajaxify = function(options) {
|
||||
console.log('AJAX error. status: ' + textStatus + ', message: ' + errorThrown);
|
||||
}
|
||||
phpbb.clearLoadingTimeout();
|
||||
var errorText = false;
|
||||
if (typeof errorThrown === 'string' && errorThrown.length > 0) {
|
||||
var responseText, errorText = false;
|
||||
try {
|
||||
responseText = JSON.parse(jqXHR.responseText);
|
||||
responseText = responseText.message;
|
||||
} catch (e) {}
|
||||
if (typeof responseText === 'string' && responseText.length > 0) {
|
||||
errorText = responseText;
|
||||
} else if (typeof errorThrown === 'string' && errorThrown.length > 0) {
|
||||
errorText = errorThrown;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
errorText = $dark.attr('data-ajax-error-text-' + textStatus);
|
||||
if (typeof errorText !== 'string' || !errorText.length) {
|
||||
errorText = $dark.attr('data-ajax-error-text');
|
||||
@@ -283,7 +288,7 @@ phpbb.ajaxify = function(options) {
|
||||
* It cannot be called from outside this function, and is purely here to
|
||||
* avoid repetition of code.
|
||||
*
|
||||
* @param object res The object sent back by the server.
|
||||
* @param {object} res The object sent back by the server.
|
||||
*/
|
||||
function returnHandler(res) {
|
||||
var alert;
|
||||
@@ -389,8 +394,11 @@ phpbb.ajaxify = function(options) {
|
||||
error: errorHandler,
|
||||
cache: false
|
||||
});
|
||||
|
||||
request.always(function() {
|
||||
$loadingIndicator.fadeOut(phpbb.alertTime);
|
||||
if ($loadingIndicator && $loadingIndicator.is(':visible')) {
|
||||
$loadingIndicator.fadeOut(phpbb.alertTime);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -427,10 +435,10 @@ phpbb.search = {
|
||||
};
|
||||
|
||||
/**
|
||||
* Get cached search data.
|
||||
* Get cached search data.
|
||||
*
|
||||
* @param string id Search ID.
|
||||
* @return bool|object. Cached data object. Returns false if no data exists.
|
||||
* @param {string} id Search ID.
|
||||
* @returns {bool|object} Cached data object. Returns false if no data exists.
|
||||
*/
|
||||
phpbb.search.cache.get = function(id) {
|
||||
if (this.data[id]) {
|
||||
@@ -440,39 +448,35 @@ phpbb.search.cache.get = function(id) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Set search cache data value.
|
||||
* Set search cache data value.
|
||||
*
|
||||
* @param string id Search ID.
|
||||
* @param string key Data key.
|
||||
* @param string value Data value.
|
||||
*
|
||||
* @return undefined
|
||||
* @param {string} id Search ID.
|
||||
* @param {string} key Data key.
|
||||
* @param {string} value Data value.
|
||||
*/
|
||||
phpbb.search.cache.set = function(id, key, value) {
|
||||
if (!this.data[id]) {
|
||||
this.data[id] = {results: []};
|
||||
this.data[id] = { results: [] };
|
||||
}
|
||||
this.data[id][key] = value;
|
||||
};
|
||||
|
||||
/**
|
||||
* Cache search result.
|
||||
* Cache search result.
|
||||
*
|
||||
* @param string id Search ID.
|
||||
* @param string keyword Keyword.
|
||||
* @param array results Search results.
|
||||
*
|
||||
* @return undefined
|
||||
* @param {string} id Search ID.
|
||||
* @param {string} keyword Keyword.
|
||||
* @param {Array} results Search results.
|
||||
*/
|
||||
phpbb.search.cache.setResults = function(id, keyword, value) {
|
||||
this.data[id].results[keyword] = value;
|
||||
phpbb.search.cache.setResults = function(id, keyword, results) {
|
||||
this.data[id].results[keyword] = results;
|
||||
};
|
||||
|
||||
/**
|
||||
* Trim spaces from keyword and lower its case.
|
||||
*
|
||||
* @param string keyword Search keyword to clean.
|
||||
* @return string Cleaned string.
|
||||
* @param {string} keyword Search keyword to clean.
|
||||
* @returns {string} Cleaned string.
|
||||
*/
|
||||
phpbb.search.cleanKeyword = function(keyword) {
|
||||
return $.trim(keyword).toLowerCase();
|
||||
@@ -482,11 +486,11 @@ phpbb.search.cleanKeyword = function(keyword) {
|
||||
* Get clean version of search keyword. If textarea supports several keywords
|
||||
* (one per line), it fetches the current keyword based on the caret position.
|
||||
*
|
||||
* @param jQuery $input Search input|textarea.
|
||||
* @param string keyword Input|textarea value.
|
||||
* @param bool multiline Whether textarea supports multiple search keywords.
|
||||
* @param {jQuery} $input Search input|textarea.
|
||||
* @param {string} keyword Input|textarea value.
|
||||
* @param {bool} multiline Whether textarea supports multiple search keywords.
|
||||
*
|
||||
* @return string Clean string.
|
||||
* @returns string Clean string.
|
||||
*/
|
||||
phpbb.search.getKeyword = function($input, keyword, multiline) {
|
||||
if (multiline) {
|
||||
@@ -498,10 +502,10 @@ phpbb.search.getKeyword = function($input, keyword, multiline) {
|
||||
|
||||
/**
|
||||
* Get the textarea line number on which the keyword resides - for textareas
|
||||
* that support multiple keywords (one per line).
|
||||
* that support multiple keywords (one per line).
|
||||
*
|
||||
* @param jQuery $textarea Search textarea.
|
||||
* @return int
|
||||
* @param {jQuery} $textarea Search textarea.
|
||||
* @returns {int} The line number.
|
||||
*/
|
||||
phpbb.search.getKeywordLine = function ($textarea) {
|
||||
var selectionStart = $textarea.get(0).selectionStart;
|
||||
@@ -512,11 +516,9 @@ phpbb.search.getKeywordLine = function ($textarea) {
|
||||
* Set the value on the input|textarea. If textarea supports multiple
|
||||
* keywords, only the active keyword is replaced.
|
||||
*
|
||||
* @param jQuery $input Search input|textarea.
|
||||
* @param string value Value to set.
|
||||
* @param bool multiline Whether textarea supports multiple search keywords.
|
||||
*
|
||||
* @return undefined
|
||||
* @param {jQuery} $input Search input|textarea.
|
||||
* @param {string} value Value to set.
|
||||
* @param {bool} multiline Whether textarea supports multiple search keywords.
|
||||
*/
|
||||
phpbb.search.setValue = function($input, value, multiline) {
|
||||
if (multiline) {
|
||||
@@ -529,14 +531,13 @@ phpbb.search.setValue = function($input, value, multiline) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the onclick event to set the value on the input|textarea to the selected search result.
|
||||
* Sets the onclick event to set the value on the input|textarea to the
|
||||
* selected search result.
|
||||
*
|
||||
* @param jQuery $input Search input|textarea.
|
||||
* @param object value Result object.
|
||||
* @param jQuery $row Result element.
|
||||
* @param jQuery $container jQuery object for the search container.
|
||||
*
|
||||
* @return undefined
|
||||
* @param {jQuery} $input Search input|textarea.
|
||||
* @param {object} value Result object.
|
||||
* @param {jQuery} $row Result element.
|
||||
* @param {jQuery} $container jQuery object for the search container.
|
||||
*/
|
||||
phpbb.search.setValueOnClick = function($input, value, $row, $container) {
|
||||
$row.click(function() {
|
||||
@@ -551,16 +552,16 @@ phpbb.search.setValueOnClick = function($input, value, $row, $container) {
|
||||
* already, those are displayed instead. Executes the AJAX request function
|
||||
* itself due to the need to use a timeout to limit the number of requests.
|
||||
*
|
||||
* @param array data Data to be sent to the server.
|
||||
* @param object event Onkeyup event object.
|
||||
* @param function sendRequest Function to execute AJAX request.
|
||||
* @param {Array} data Data to be sent to the server.
|
||||
* @param {object} event Onkeyup event object.
|
||||
* @param {function} sendRequest Function to execute AJAX request.
|
||||
*
|
||||
* @return bool Returns false.
|
||||
* @returns {bool} Returns false.
|
||||
*/
|
||||
phpbb.search.filter = function(data, event, sendRequest) {
|
||||
var $this = $(this),
|
||||
dataName = ($this.attr('data-name') !== undefined) ? $this.attr('data-name') : $this.attr('name'),
|
||||
minLength = parseInt($this.attr('data-min-length')),
|
||||
minLength = parseInt($this.attr('data-min-length'), 10),
|
||||
searchID = $this.attr('data-results'),
|
||||
keyword = phpbb.search.getKeyword($this, data[dataName], $this.attr('data-multiline')),
|
||||
cache = phpbb.search.cache.get(searchID),
|
||||
@@ -582,7 +583,10 @@ phpbb.search.filter = function(data, event, sendRequest) {
|
||||
} else {
|
||||
// Do we already have results for this?
|
||||
if (cache.results[keyword]) {
|
||||
var response = {keyword: keyword, results: cache.results[keyword]};
|
||||
var response = {
|
||||
keyword: keyword,
|
||||
results: cache.results[keyword]
|
||||
};
|
||||
phpbb.search.handleResponse(response, $this, true);
|
||||
proceed = false;
|
||||
}
|
||||
@@ -593,8 +597,8 @@ phpbb.search.filter = function(data, event, sendRequest) {
|
||||
phpbb.search.cache.set(searchID, 'lastSearch', keyword);
|
||||
phpbb.search.cache.setResults(searchID, keyword, []);
|
||||
proceed = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (proceed) {
|
||||
@@ -607,14 +611,12 @@ phpbb.search.filter = function(data, event, sendRequest) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle search result response.
|
||||
* Handle search result response.
|
||||
*
|
||||
* @param object res Data received from server.
|
||||
* @param jQuery $input Search input|textarea.
|
||||
* @param bool fromCache Whether the results are from the cache.
|
||||
* @param function callback Optional callback to run when assigning each search result.
|
||||
*
|
||||
* @return undefined
|
||||
* @param {object} res Data received from server.
|
||||
* @param {jQuery} $input Search input|textarea.
|
||||
* @param {bool} fromCache Whether the results are from the cache.
|
||||
* @param {function} callback Optional callback to run when assigning each search result.
|
||||
*/
|
||||
phpbb.search.handleResponse = function(res, $input, fromCache, callback) {
|
||||
if (typeof res !== 'object') {
|
||||
@@ -641,12 +643,10 @@ phpbb.search.handleResponse = function(res, $input, fromCache, callback) {
|
||||
/**
|
||||
* Show search results.
|
||||
*
|
||||
* @param array results Search results.
|
||||
* @param jQuery $input Search input|textarea.
|
||||
* @param jQuery $container Search results container element.
|
||||
* @param function callback Optional callback to run when assigning each search result.
|
||||
*
|
||||
* @return undefined
|
||||
* @param {Array} results Search results.
|
||||
* @param {jQuery} $input Search input|textarea.
|
||||
* @param {jQuery} $container Search results container element.
|
||||
* @param {function} callback Optional callback to run when assigning each search result.
|
||||
*/
|
||||
phpbb.search.showResults = function(results, $input, $container, callback) {
|
||||
var $resultContainer = $('.search-results', $container);
|
||||
@@ -683,8 +683,7 @@ phpbb.search.showResults = function(results, $input, $container, callback) {
|
||||
/**
|
||||
* Clear search results.
|
||||
*
|
||||
* @param jQuery $container Search results container.
|
||||
* @return undefined
|
||||
* @param {jQuery} $container Search results container.
|
||||
*/
|
||||
phpbb.search.clearResults = function($container) {
|
||||
$container.children(':not(.search-result-tpl)').remove();
|
||||
@@ -703,8 +702,8 @@ phpbb.history = {};
|
||||
/**
|
||||
* Check whether a method in the native history object is supported.
|
||||
*
|
||||
* @param string fn Method name.
|
||||
* @return bool Returns true if the method is supported.
|
||||
* @param {string} fn Method name.
|
||||
* @returns {bool} Returns true if the method is supported.
|
||||
*/
|
||||
phpbb.history.isSupported = function(fn) {
|
||||
return !(typeof history === 'undefined' || typeof history[fn] === 'undefined');
|
||||
@@ -714,12 +713,10 @@ phpbb.history.isSupported = function(fn) {
|
||||
* Wrapper for the pushState and replaceState methods of the
|
||||
* native history object.
|
||||
*
|
||||
* @param string mode Mode. Either push or replace.
|
||||
* @param string url New URL.
|
||||
* @param string title Optional page title.
|
||||
* @patam object obj Optional state object.
|
||||
*
|
||||
* @return undefined
|
||||
* @param {string} mode Mode. Either push or replace.
|
||||
* @param {string} url New URL.
|
||||
* @param {string} [title] Optional page title.
|
||||
* @param {object} [obj] Optional state object.
|
||||
*/
|
||||
phpbb.history.alterUrl = function(mode, url, title, obj) {
|
||||
var fn = mode + 'State';
|
||||
@@ -740,11 +737,9 @@ phpbb.history.alterUrl = function(mode, url, title, obj) {
|
||||
/**
|
||||
* Wrapper for the native history.replaceState method.
|
||||
*
|
||||
* @param string url New URL.
|
||||
* @param string title Optional page title.
|
||||
* @patam object obj Optional state object.
|
||||
*
|
||||
* @return undefined
|
||||
* @param {string} url New URL.
|
||||
* @param {string} [title] Optional page title.
|
||||
* @param {object} [obj] Optional state object.
|
||||
*/
|
||||
phpbb.history.replaceUrl = function(url, title, obj) {
|
||||
phpbb.history.alterUrl('replace', url, title, obj);
|
||||
@@ -753,11 +748,9 @@ phpbb.history.replaceUrl = function(url, title, obj) {
|
||||
/**
|
||||
* Wrapper for the native history.pushState method.
|
||||
*
|
||||
* @param string url New URL.
|
||||
* @param string title Optional page title.
|
||||
* @patam object obj Optional state object.
|
||||
*
|
||||
* @return undefined
|
||||
* @param {string} url New URL.
|
||||
* @param {string} [title] Optional page title.
|
||||
* @param {object} [obj] Optional state object.
|
||||
*/
|
||||
phpbb.history.pushUrl = function(url, title, obj) {
|
||||
phpbb.history.alterUrl('push', url, title, obj);
|
||||
@@ -766,7 +759,8 @@ phpbb.history.pushUrl = function(url, title, obj) {
|
||||
/**
|
||||
* Hide the optgroups that are not the selected timezone
|
||||
*
|
||||
* @param bool keepSelection Shall we keep the value selected, or shall the user be forced to repick one.
|
||||
* @param {bool} keepSelection Shall we keep the value selected, or shall the
|
||||
* user be forced to repick one.
|
||||
*/
|
||||
phpbb.timezoneSwitchDate = function(keepSelection) {
|
||||
var $timezoneCopy = $('#timezone_copy');
|
||||
@@ -789,7 +783,7 @@ phpbb.timezoneSwitchDate = function(keepSelection) {
|
||||
}
|
||||
|
||||
if ($tzDate.val() !== '') {
|
||||
$timezone.children('optgroup').remove(':not([data-tz-value="' + $('#tz_date').val() + '"])');
|
||||
$timezone.children('optgroup').remove(':not([data-tz-value="' + $tzDate.val() + '"])');
|
||||
}
|
||||
|
||||
if ($tzDate.val() === $tzSelectDateSuggest.attr('data-suggested-tz')) {
|
||||
@@ -797,7 +791,7 @@ phpbb.timezoneSwitchDate = function(keepSelection) {
|
||||
} else {
|
||||
$tzSelectDateSuggest.css('display', 'inline');
|
||||
}
|
||||
|
||||
|
||||
var $tzOptions = $timezone.children('optgroup[data-tz-value="' + $tzDate.val() + '"]').children('option');
|
||||
|
||||
if ($tzOptions.length === 1) {
|
||||
@@ -824,7 +818,7 @@ phpbb.timezoneEnableDateSelection = function() {
|
||||
/**
|
||||
* Preselect a date/time or suggest one, if it is not picked.
|
||||
*
|
||||
* @param bool forceSelector Shall we select the suggestion?
|
||||
* @param {bool} forceSelector Shall we select the suggestion?
|
||||
*/
|
||||
phpbb.timezonePreselectSelect = function(forceSelector) {
|
||||
|
||||
@@ -893,8 +887,8 @@ phpbb.ajaxCallbacks = {};
|
||||
*
|
||||
* See the phpbb.ajaxify comments for information on stuff like parameters.
|
||||
*
|
||||
* @param string id The name of the callback.
|
||||
* @param function callback The callback to be called.
|
||||
* @param {string} id The name of the callback.
|
||||
* @param {function} callback The callback to be called.
|
||||
*/
|
||||
phpbb.addAjaxCallback = function(id, callback) {
|
||||
if (typeof callback === 'function') {
|
||||
@@ -985,7 +979,7 @@ phpbb.addAjaxCallback('toggle_link', function() {
|
||||
* types text.
|
||||
*
|
||||
* @param {jQuery} $items jQuery object(s) to resize
|
||||
* @param {object} options Optional parameter that adjusts default
|
||||
* @param {object} [options] Optional parameter that adjusts default
|
||||
* configuration. See configuration variable
|
||||
*
|
||||
* Optional parameters:
|
||||
@@ -1022,15 +1016,19 @@ phpbb.resizeTextArea = function($items, options) {
|
||||
function resetAutoResize(item) {
|
||||
var $item = $(item);
|
||||
if ($item.hasClass('auto-resized')) {
|
||||
$(item).css({height: '', resize: ''}).removeClass('auto-resized');
|
||||
$(item)
|
||||
.css({ height: '', resize: '' })
|
||||
.removeClass('auto-resized');
|
||||
configuration.resetCallback.call(item, $item);
|
||||
}
|
||||
}
|
||||
|
||||
function autoResize(item) {
|
||||
function setHeight(height) {
|
||||
height += parseInt($item.css('height')) - $item.height();
|
||||
$item.css({height: height + 'px', resize: 'none'}).addClass('auto-resized');
|
||||
height += parseInt($item.css('height'), 10) - $item.height();
|
||||
$item
|
||||
.css({ height: height + 'px', resize: 'none' })
|
||||
.addClass('auto-resized');
|
||||
configuration.resizeCallback.call(item, $item);
|
||||
}
|
||||
|
||||
@@ -1046,7 +1044,7 @@ phpbb.resizeTextArea = function($items, options) {
|
||||
configuration.maxHeight
|
||||
),
|
||||
$item = $(item),
|
||||
height = parseInt($item.height()),
|
||||
height = parseInt($item.height(), 10),
|
||||
scrollHeight = (item.scrollHeight) ? item.scrollHeight : 0;
|
||||
|
||||
if (height < 0) {
|
||||
@@ -1055,8 +1053,7 @@ phpbb.resizeTextArea = function($items, options) {
|
||||
|
||||
if (height > maxHeight) {
|
||||
setHeight(maxHeight);
|
||||
}
|
||||
else if (scrollHeight > (height + 5)) {
|
||||
} else if (scrollHeight > (height + 5)) {
|
||||
setHeight(Math.min(maxHeight, scrollHeight));
|
||||
}
|
||||
}
|
||||
@@ -1085,7 +1082,7 @@ phpbb.resizeTextArea = function($items, options) {
|
||||
* @param {Array} endTags List of end tags to look for
|
||||
* For example, Array('[/code]')
|
||||
*
|
||||
* @return {boolean} True if cursor is in bbcode tag
|
||||
* @returns {boolean} True if cursor is in bbcode tag
|
||||
*/
|
||||
phpbb.inBBCodeTag = function(textarea, startTags, endTags) {
|
||||
var start = textarea.selectionStart,
|
||||
@@ -1157,7 +1154,7 @@ phpbb.applyCodeEditor = function(textarea) {
|
||||
* @param {boolean} stripCodeStart If true, only part of line
|
||||
* after [code] tag will be returned.
|
||||
*
|
||||
* @return {string} Line of text
|
||||
* @returns {string} Line of text
|
||||
*/
|
||||
function getLastLine(stripCodeStart) {
|
||||
var start = textarea.selectionStart,
|
||||
@@ -1173,7 +1170,7 @@ phpbb.applyCodeEditor = function(textarea) {
|
||||
var tagLength = startTags[i].length;
|
||||
|
||||
value = value.substring(index + tagLength);
|
||||
if (startTags[i].lastIndexOf(startTagsEnd) != tagLength) {
|
||||
if (startTags[i].lastIndexOf(startTagsEnd) !== tagLength) {
|
||||
index = value.indexOf(startTagsEnd);
|
||||
|
||||
if (index >= 0) {
|
||||
@@ -1190,7 +1187,7 @@ phpbb.applyCodeEditor = function(textarea) {
|
||||
/**
|
||||
* Append text at cursor position
|
||||
*
|
||||
* @param {string} Text Text to append
|
||||
* @param {string} text Text to append
|
||||
*/
|
||||
function appendText(text) {
|
||||
var start = textarea.selectionStart,
|
||||
@@ -1232,6 +1229,31 @@ phpbb.applyCodeEditor = function(textarea) {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Show drag and drop animation when textarea is present
|
||||
*
|
||||
* This function will enable the drag and drop animation for a specified
|
||||
* textarea.
|
||||
*
|
||||
* @param {HTMLElement} textarea Textarea DOM object to apply editor to
|
||||
*/
|
||||
phpbb.showDragNDrop = function(textarea) {
|
||||
if (!textarea) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('body').on('dragenter dragover', function () {
|
||||
$(textarea).addClass('drag-n-drop');
|
||||
}).on('dragleave dragout dragend drop', function() {
|
||||
$(textarea).removeClass('drag-n-drop');
|
||||
});
|
||||
$(textarea).on('dragenter dragover', function () {
|
||||
$(textarea).addClass('drag-n-drop-highlight');
|
||||
}).on('dragleave dragout dragend drop', function() {
|
||||
$(textarea).removeClass('drag-n-drop-highlight');
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* List of classes that toggle dropdown menu,
|
||||
* list of classes that contain visible dropdown menu
|
||||
@@ -1324,12 +1346,15 @@ phpbb.toggleDropdown = function() {
|
||||
fullFreeSpace = freeSpace + parent.outerWidth();
|
||||
|
||||
options.dropdown.find('.dropdown-contents').each(function() {
|
||||
contentWidth = parseInt($(this).outerWidth());
|
||||
$(this).css({marginLeft: 0, left: 0});
|
||||
contentWidth = parseInt($(this).outerWidth(), 10);
|
||||
$(this).css({ marginLeft: 0, left: 0 });
|
||||
});
|
||||
|
||||
var maxOffset = Math.min(contentWidth, fullFreeSpace) + 'px';
|
||||
options.dropdown.css({'width': maxOffset, 'margin-left': '-' + maxOffset});
|
||||
options.dropdown.css({
|
||||
width: maxOffset,
|
||||
marginLeft: -maxOffset
|
||||
});
|
||||
}
|
||||
} else {
|
||||
options.dropdown.css('margin-right', '-' + (windowWidth + freeSpace) + 'px');
|
||||
@@ -1391,14 +1416,12 @@ phpbb.registerDropdown = function(toggle, dropdown, options) {
|
||||
/**
|
||||
* Get the HTML for a color palette table.
|
||||
*
|
||||
* @param string dir Palette direction - either v or h
|
||||
* @param int width Palette cell width.
|
||||
* @param int height Palette cell height.
|
||||
* @param {string} dir Palette direction - either v or h
|
||||
* @param {int} width Palette cell width.
|
||||
* @param {int} height Palette cell height.
|
||||
*/
|
||||
phpbb.colorPalette = function(dir, width, height) {
|
||||
var r = 0,
|
||||
g = 0,
|
||||
b = 0,
|
||||
var r, g, b,
|
||||
numberList = new Array(6),
|
||||
color = '',
|
||||
html = '';
|
||||
@@ -1409,32 +1432,33 @@ phpbb.colorPalette = function(dir, width, height) {
|
||||
numberList[3] = 'BF';
|
||||
numberList[4] = 'FF';
|
||||
|
||||
var tableClass = (dir == 'h') ? 'horizontal-palette' : 'vertical-palette';
|
||||
var tableClass = (dir === 'h') ? 'horizontal-palette' : 'vertical-palette';
|
||||
html += '<table class="not-responsive colour-palette ' + tableClass + '" style="width: auto;">';
|
||||
|
||||
for (r = 0; r < 5; r++) {
|
||||
if (dir == 'h') {
|
||||
if (dir === 'h') {
|
||||
html += '<tr>';
|
||||
}
|
||||
|
||||
for (g = 0; g < 5; g++) {
|
||||
if (dir == 'v') {
|
||||
if (dir === 'v') {
|
||||
html += '<tr>';
|
||||
}
|
||||
|
||||
for (b = 0; b < 5; b++) {
|
||||
color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
|
||||
html += '<td style="background-color: #' + color + '; width: ' + width + 'px; height: ' + height + 'px;">';
|
||||
html += '<a href="#" data-color="' + color + '" style="display: block; width: ' + width + 'px; height: ' + height + 'px; " alt="#' + color + '" title="#' + color + '"></a>';
|
||||
color = '' + numberList[r] + numberList[g] + numberList[b];
|
||||
html += '<td style="background-color: #' + color + '; width: ' + width + 'px; height: ' +
|
||||
height + 'px;"><a href="#" data-color="' + color + '" style="display: block; width: ' +
|
||||
width + 'px; height: ' + height + 'px; " alt="#' + color + '" title="#' + color + '"></a>';
|
||||
html += '</td>';
|
||||
}
|
||||
|
||||
if (dir == 'v') {
|
||||
if (dir === 'v') {
|
||||
html += '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if (dir == 'h') {
|
||||
if (dir === 'h') {
|
||||
html += '</tr>';
|
||||
}
|
||||
}
|
||||
@@ -1445,7 +1469,7 @@ phpbb.colorPalette = function(dir, width, height) {
|
||||
/**
|
||||
* Register a color palette.
|
||||
*
|
||||
* @param object el jQuery object for the palette container.
|
||||
* @param {jQuery} el jQuery object for the palette container.
|
||||
*/
|
||||
phpbb.registerPalette = function(el) {
|
||||
var orientation = el.attr('data-orientation'),
|
||||
@@ -1474,15 +1498,15 @@ phpbb.registerPalette = function(el) {
|
||||
}
|
||||
e.preventDefault();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Set display of page element
|
||||
*
|
||||
* @param string id The ID of the element to change
|
||||
* @param int action Set to 0 if element display should be toggled, -1 for
|
||||
* @param {string} id The ID of the element to change
|
||||
* @param {int} action Set to 0 if element display should be toggled, -1 for
|
||||
* hiding the element, and 1 for showing it.
|
||||
* @param string type Display type that should be used, e.g. inline, block or
|
||||
* @param {string} type Display type that should be used, e.g. inline, block or
|
||||
* other CSS "display" types
|
||||
*/
|
||||
phpbb.toggleDisplay = function(id, action, type) {
|
||||
@@ -1503,8 +1527,7 @@ phpbb.toggleDisplay = function(id, action, type) {
|
||||
* Toggle additional settings based on the selected
|
||||
* option of select element.
|
||||
*
|
||||
* @param jQuery el jQuery select element object.
|
||||
* @return undefined
|
||||
* @param {jQuery} el jQuery select element object.
|
||||
*/
|
||||
phpbb.toggleSelectSettings = function(el) {
|
||||
el.children().each(function() {
|
||||
@@ -1518,11 +1541,11 @@ phpbb.toggleSelectSettings = function(el) {
|
||||
* Get function from name.
|
||||
* Based on http://stackoverflow.com/a/359910
|
||||
*
|
||||
* @param string functionName Function to get.
|
||||
* @return function
|
||||
* @param {string} functionName Function to get.
|
||||
* @returns function
|
||||
*/
|
||||
phpbb.getFunctionByName = function (functionName) {
|
||||
var namespaces = functionName.split('.'),
|
||||
var namespaces = functionName.split('.'),
|
||||
func = namespaces.pop(),
|
||||
context = window;
|
||||
|
||||
@@ -1587,6 +1610,21 @@ phpbb.registerPageDropdowns = function() {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle avatars to be lazy loaded.
|
||||
*/
|
||||
phpbb.lazyLoadAvatars = function loadAvatars() {
|
||||
$('.avatar[data-src]').each(function () {
|
||||
var $avatar = $(this);
|
||||
|
||||
$avatar
|
||||
.attr('src', $avatar.data('src'))
|
||||
.removeAttr('data-src');
|
||||
});
|
||||
};
|
||||
|
||||
$(window).load(phpbb.lazyLoadAvatars);
|
||||
|
||||
/**
|
||||
* Apply code editor to all textarea elements with data-bbcode attribute
|
||||
*/
|
||||
|
@@ -159,7 +159,7 @@ function insert_text(text, spaces, popup) {
|
||||
/**
|
||||
* Add inline attachment at position
|
||||
*/
|
||||
function attach_inline(index, filename) {
|
||||
function attachInline(index, filename) {
|
||||
insert_text('[attachment=' + index + ']' + filename + '[/attachment]');
|
||||
document.forms[form_name].elements[text_name].focus();
|
||||
}
|
||||
@@ -355,6 +355,9 @@ function getCaretPosition(txtarea) {
|
||||
textarea = doc.forms[form_name].elements[text_name];
|
||||
|
||||
phpbb.applyCodeEditor(textarea);
|
||||
if ($('#attach-panel').length) {
|
||||
phpbb.showDragNDrop(textarea);
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
|
||||
|
@@ -1,26 +1,26 @@
|
||||
/* global phpbb, plupload, attachInline */
|
||||
|
||||
plupload.addI18n(phpbb.plupload.i18n);
|
||||
phpbb.plupload.ids = [];
|
||||
|
||||
(function($) { // Avoid conflicts with other libraries
|
||||
|
||||
"use strict";
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Set up the uploader.
|
||||
*
|
||||
* @return undefined
|
||||
*/
|
||||
phpbb.plupload.initialize = function() {
|
||||
// Initialize the Plupload uploader.
|
||||
uploader.init();
|
||||
phpbb.plupload.uploader.init();
|
||||
|
||||
// Set attachment data.
|
||||
phpbb.plupload.setData(phpbb.plupload.data);
|
||||
phpbb.plupload.updateMultipartParams(phpbb.plupload.getSerializedData());
|
||||
|
||||
// Only execute if Plupload initialized successfully.
|
||||
uploader.bind('Init', function() {
|
||||
phpbb.plupload.form = $(phpbb.plupload.config.form_hook)[0],
|
||||
phpbb.plupload.uploader.bind('Init', function() {
|
||||
phpbb.plupload.form = $(phpbb.plupload.config.form_hook)[0];
|
||||
phpbb.plupload.rowTpl = $('#attach-row-tpl')[0].outerHTML;
|
||||
|
||||
// Hide the basic upload panel and remove the attach row template.
|
||||
@@ -29,18 +29,18 @@ phpbb.plupload.initialize = function() {
|
||||
$('#attach-panel-multi').show();
|
||||
});
|
||||
|
||||
uploader.bind('PostInit', function() {
|
||||
phpbb.plupload.uploader.bind('PostInit', function() {
|
||||
// Point out the drag-and-drop zone if it's supported.
|
||||
if (uploader.features.dragdrop) {
|
||||
if (phpbb.plupload.uploader.features.dragdrop) {
|
||||
$('#drag-n-drop-message').show();
|
||||
}
|
||||
|
||||
// Ensure "Add files" button position is correctly calculated.
|
||||
if ($('#attach-panel-multi').is(':visible')) {
|
||||
uploader.refresh();
|
||||
phpbb.plupload.uploader.refresh();
|
||||
}
|
||||
$('[data-subpanel="attach-panel"]').one('click', function() {
|
||||
uploader.refresh();
|
||||
phpbb.plupload.uploader.refresh();
|
||||
});
|
||||
});
|
||||
};
|
||||
@@ -48,37 +48,32 @@ phpbb.plupload.initialize = function() {
|
||||
/**
|
||||
* Unsets all elements in the object uploader.settings.multipart_params whose keys
|
||||
* begin with 'attachment_data['
|
||||
*
|
||||
* @return undefined
|
||||
*/
|
||||
phpbb.plupload.clearParams = function() {
|
||||
var obj = uploader.settings.multipart_params;
|
||||
var obj = phpbb.plupload.uploader.settings.multipart_params;
|
||||
for (var key in obj) {
|
||||
if (!obj.hasOwnProperty(key) || key.indexOf('attachment_data[') !== 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
delete uploader.settings.multipart_params[key];
|
||||
delete phpbb.plupload.uploader.settings.multipart_params[key];
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Update uploader.settings.multipart_params object with new data.
|
||||
*
|
||||
* @param object obj
|
||||
* @return undefined
|
||||
* @param {object} obj
|
||||
*/
|
||||
phpbb.plupload.updateMultipartParams = function(obj) {
|
||||
uploader.settings.multipart_params = $.extend(
|
||||
uploader.settings.multipart_params,
|
||||
obj
|
||||
);
|
||||
var settings = phpbb.plupload.uploader.settings;
|
||||
settings.multipart_params = $.extend(settings.multipart_params, obj);
|
||||
};
|
||||
|
||||
/**
|
||||
* Convert the array of attachment objects into an object that PHP would expect as POST data.
|
||||
*
|
||||
* @return object An object in the form 'attachment_data[i][key]': value as
|
||||
* @returns {object} An object in the form 'attachment_data[i][key]': value as
|
||||
* expected by the server
|
||||
*/
|
||||
phpbb.plupload.getSerializedData = function() {
|
||||
@@ -100,22 +95,19 @@ phpbb.plupload.getSerializedData = function() {
|
||||
* Get the index from the phpbb.plupload.data array where the given
|
||||
* attachment id appears.
|
||||
*
|
||||
* @param int attach_id The attachment id of the file.
|
||||
* @return bool Returns false if the id cannot be found.
|
||||
* @return int Returns the index of the file if it exists.
|
||||
* @param {int} attachId The attachment id of the file.
|
||||
* @returns {bool|int} Index of the file if exists, otherwise false.
|
||||
*/
|
||||
phpbb.plupload.getIndex = function(attach_id) {
|
||||
var index = $.inArray(Number(attach_id), phpbb.plupload.ids);
|
||||
phpbb.plupload.getIndex = function(attachId) {
|
||||
var index = $.inArray(Number(attachId), phpbb.plupload.ids);
|
||||
return (index !== -1) ? index : false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the data in phpbb.plupload.data and phpbb.plupload.ids arrays.
|
||||
*
|
||||
* @param array data Array containing the new data to use. In the form of
|
||||
* array(index => object(property: value). Requires attach_id to be one of the object properties.
|
||||
*
|
||||
* @return undefined
|
||||
* @param {Array} data Array containing the new data to use. In the form of
|
||||
* array(index => object(property: value). Requires attach_id to be one of the object properties.
|
||||
*/
|
||||
phpbb.plupload.setData = function(data) {
|
||||
// Make sure that the array keys are reset.
|
||||
@@ -129,12 +121,11 @@ phpbb.plupload.setData = function(data) {
|
||||
|
||||
/**
|
||||
* Update the attachment data in the HTML and the phpbb & phpbb.plupload objects.
|
||||
*
|
||||
* @param array data Array containing the new data to use.
|
||||
* @param string action The action that required the update. Used to update the inline attachment bbcodes.
|
||||
* @param int index The index from phpbb.plupload_ids that was affected by the action.
|
||||
* @param array downloadUrl Optional array of download urls to update.
|
||||
* @return undefined
|
||||
*
|
||||
* @param {Array} data Array containing the new data to use.
|
||||
* @param {string} action The action that required the update. Used to update the inline attachment bbcodes.
|
||||
* @param {int} index The index from phpbb.plupload_ids that was affected by the action.
|
||||
* @param {Array} downloadUrl Optional array of download urls to update.
|
||||
*/
|
||||
phpbb.plupload.update = function(data, action, index, downloadUrl) {
|
||||
|
||||
@@ -147,9 +138,8 @@ phpbb.plupload.update = function(data, action, index, downloadUrl) {
|
||||
|
||||
/**
|
||||
* Update the relevant elements and hidden data for all attachments.
|
||||
*
|
||||
* @param array downloadUrl Optional array of download urls to update.
|
||||
* @return undefined
|
||||
*
|
||||
* @param {Array} downloadUrl Optional array of download urls to update.
|
||||
*/
|
||||
phpbb.plupload.updateRows = function(downloadUrl) {
|
||||
for (var i = 0; i < phpbb.plupload.ids.length; i++) {
|
||||
@@ -162,9 +152,8 @@ phpbb.plupload.updateRows = function(downloadUrl) {
|
||||
* using the id "attach-row-tpl" to be present. This snippet is cloned and the
|
||||
* data for the file inserted into it. The row is then appended or prepended to
|
||||
* #file-list based on the attach_order setting.
|
||||
*
|
||||
* @param object file Plupload file object for the new attachment.
|
||||
* @return undefined
|
||||
*
|
||||
* @param {object} file Plupload file object for the new attachment.
|
||||
*/
|
||||
phpbb.plupload.insertRow = function(file) {
|
||||
var row = $(phpbb.plupload.rowTpl);
|
||||
@@ -173,7 +162,7 @@ phpbb.plupload.insertRow = function(file) {
|
||||
row.find('.file-name').html(plupload.xmlEncode(file.name));
|
||||
row.find('.file-size').html(plupload.formatSize(file.size));
|
||||
|
||||
if (phpbb.plupload.order == 'desc') {
|
||||
if (phpbb.plupload.order === 'desc') {
|
||||
$('#file-list').prepend(row);
|
||||
} else {
|
||||
$('#file-list').append(row);
|
||||
@@ -182,10 +171,9 @@ phpbb.plupload.insertRow = function(file) {
|
||||
|
||||
/**
|
||||
* Update the relevant elements and hidden data for an attachment.
|
||||
*
|
||||
* @param int index The index from phpbb.plupload.ids of the attachment to edit.
|
||||
* @param array downloadUrl Optional array of download urls to update.
|
||||
* @return undefined
|
||||
*
|
||||
* @param {int} index The index from phpbb.plupload.ids of the attachment to edit.
|
||||
* @param {Array} downloadUrl Optional array of download urls to update.
|
||||
*/
|
||||
phpbb.plupload.updateRow = function(index, downloadUrl) {
|
||||
var attach = phpbb.plupload.data[index],
|
||||
@@ -197,7 +185,7 @@ phpbb.plupload.updateRow = function(index, downloadUrl) {
|
||||
link = $('<a></a>');
|
||||
|
||||
link.attr('href', url).html(attach.real_filename);
|
||||
row.find('.file-name').html(link)
|
||||
row.find('.file-name').html(link);
|
||||
}
|
||||
|
||||
row.find('textarea').attr('name', 'comment_list[' + index + ']');
|
||||
@@ -207,18 +195,21 @@ phpbb.plupload.updateRow = function(index, downloadUrl) {
|
||||
/**
|
||||
* Update hidden input data for an attachment.
|
||||
*
|
||||
* @param object row jQuery object for the attachment row.
|
||||
* @param object attach Attachment data object from phpbb.plupload.data
|
||||
* @param int index Attachment index from phpbb.plupload.ids
|
||||
* @return undefined
|
||||
* @param {object} row jQuery object for the attachment row.
|
||||
* @param {object} attach Attachment data object from phpbb.plupload.data
|
||||
* @param {int} index Attachment index from phpbb.plupload.ids
|
||||
*/
|
||||
phpbb.plupload.updateHiddenData = function(row, attach, index) {
|
||||
row.find('input[type="hidden"]').remove();
|
||||
|
||||
for (var key in attach) {
|
||||
if (!attach.hasOwnProperty(key)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var input = $('<input />')
|
||||
.attr('type', 'hidden')
|
||||
.attr('name', 'attachment_data[' + index + '][' + key +']')
|
||||
.attr('name', 'attachment_data[' + index + '][' + key + ']')
|
||||
.attr('value', attach[key]);
|
||||
$('textarea', row).after(input);
|
||||
}
|
||||
@@ -230,16 +221,14 @@ phpbb.plupload.updateHiddenData = function(row, attach, index) {
|
||||
* responds with the updated attachment data list so that any future
|
||||
* uploads can maintain state with the server
|
||||
*
|
||||
* @param object row jQuery object for the attachment row.
|
||||
* @param int attachId Attachment id of the file to be removed.
|
||||
*
|
||||
* @return undefined
|
||||
* @param {object} row jQuery object for the attachment row.
|
||||
* @param {int} attachId Attachment id of the file to be removed.
|
||||
*/
|
||||
phpbb.plupload.deleteFile = function(row, attachId) {
|
||||
// If there's no attach id, then the file hasn't been uploaded. Simply delete the row.
|
||||
if (typeof attachId === 'undefined') {
|
||||
var file = uploader.getFile(row.attr('id'));
|
||||
uploader.removeFile(file);
|
||||
var file = phpbb.plupload.uploader.getFile(row.attr('id'));
|
||||
phpbb.plupload.uploader.removeFile(file);
|
||||
|
||||
row.slideUp(100, function() {
|
||||
row.remove();
|
||||
@@ -267,7 +256,7 @@ phpbb.plupload.deleteFile = function(row, attachId) {
|
||||
|
||||
// trigger_error() was called which likely means a permission error was encountered.
|
||||
if (typeof response.title !== 'undefined') {
|
||||
uploader.trigger('Error', {message: response.message});
|
||||
phpbb.plupload.uploader.trigger('Error', { message: response.message });
|
||||
// We will have to assume that the deletion failed. So leave the file status as uploaded.
|
||||
row.find('.file-status').toggleClass('file-uploaded');
|
||||
|
||||
@@ -278,21 +267,21 @@ phpbb.plupload.deleteFile = function(row, attachId) {
|
||||
phpbb.plupload.handleMaxFilesReached();
|
||||
|
||||
if (row.attr('id')) {
|
||||
var file = uploader.getFile(row.attr('id'));
|
||||
uploader.removeFile(file);
|
||||
var file = phpbb.plupload.uploader.getFile(row.attr('id'));
|
||||
phpbb.plupload.uploader.removeFile(file);
|
||||
}
|
||||
row.slideUp(100, function() {
|
||||
row.remove();
|
||||
// Hide the file list if it's empty now.
|
||||
phpbb.plupload.hideEmptyList();
|
||||
});
|
||||
uploader.trigger('FilesRemoved');
|
||||
phpbb.plupload.uploader.trigger('FilesRemoved');
|
||||
};
|
||||
|
||||
$.ajax(phpbb.plupload.config.url, {
|
||||
type: 'POST',
|
||||
data: $.extend(fields, phpbb.plupload.getSerializedData()),
|
||||
headers: {'X-PHPBB-USING-PLUPLOAD': '1', 'X-Requested-With': 'XMLHttpRequest'}
|
||||
headers: phpbb.plupload.config.headers
|
||||
})
|
||||
.always(always)
|
||||
.done(done);
|
||||
@@ -300,25 +289,21 @@ phpbb.plupload.deleteFile = function(row, attachId) {
|
||||
|
||||
/**
|
||||
* Check the attachment list and hide its container if it's empty.
|
||||
*
|
||||
* @return undefined
|
||||
*/
|
||||
phpbb.plupload.hideEmptyList = function() {
|
||||
if (!$('#file-list').children().length) {
|
||||
$('#file-list-container').slideUp(100);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Update the indices used in inline attachment bbcodes. This ensures that the bbcodes
|
||||
* correspond to the correct file after a file is added or removed. This should be called
|
||||
* before the phpbb.plupload,data and phpbb.plupload.ids arrays are updated, otherwise it will
|
||||
* not work correctly.
|
||||
* Update the indices used in inline attachment bbcodes. This ensures that the
|
||||
* bbcodes correspond to the correct file after a file is added or removed.
|
||||
* This should be called before the phpbb.plupload,data and phpbb.plupload.ids
|
||||
* arrays are updated, otherwise it will not work correctly.
|
||||
*
|
||||
* @param string action The action that occurred -- either "addition" or "removal"
|
||||
* @param int index The index of the attachment from phpbb.plupload.ids that was affected.
|
||||
*
|
||||
* @return undefined
|
||||
* @param {string} action The action that occurred -- either "addition" or "removal"
|
||||
* @param {int} index The index of the attachment from phpbb.plupload.ids that was affected.
|
||||
*/
|
||||
phpbb.plupload.updateBbcode = function(action, index) {
|
||||
var textarea = $('#message', phpbb.plupload.form),
|
||||
@@ -330,64 +315,59 @@ phpbb.plupload.updateBbcode = function(action, index) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Private function used to replace the bbcode.
|
||||
var updateBbcode = function(match, fileName) {
|
||||
// Remove the bbcode if the file was removed.
|
||||
if (removal && index === i) {
|
||||
return '';
|
||||
}
|
||||
var newIndex = i + ((removal) ? -1 : 1);
|
||||
return '[attachment=' + newIndex +']' + fileName + '[/attachment]';
|
||||
};
|
||||
function runUpdate(i) {
|
||||
var regex = new RegExp('\\[attachment=' + i + '\\](.*?)\\[\\/attachment\\]', 'g');
|
||||
text = text.replace(regex, function updateBbcode(_, fileName) {
|
||||
// Remove the bbcode if the file was removed.
|
||||
if (removal && index === i) {
|
||||
return '';
|
||||
}
|
||||
var newIndex = i + ((removal) ? -1 : 1);
|
||||
return '[attachment=' + newIndex + ']' + fileName + '[/attachment]';
|
||||
});
|
||||
}
|
||||
|
||||
// Private function used to generate search regexp
|
||||
var searchRegexp = function(index) {
|
||||
return new RegExp('\\[attachment=' + index + '\\](.*?)\\[\\/attachment\\]', 'g');
|
||||
}
|
||||
// The update order of the indices is based on the action taken to ensure that we don't corrupt
|
||||
// the bbcode index by updating it several times as we move through the loop.
|
||||
// Removal loop starts at the removed index and moves to the end of the array.
|
||||
// Addition loop starts at the end of the array and moves to the added index at 0.
|
||||
var searchLoop = function() {
|
||||
if (typeof i === 'undefined') {
|
||||
i = (removal) ? index : phpbb.plupload.ids.length - 1;
|
||||
}
|
||||
return (removal) ? (i < phpbb.plupload.ids.length): (i >= index);
|
||||
}
|
||||
// Loop forwards when removing and backwards when adding ensures we don't
|
||||
// corrupt the bbcode index.
|
||||
var i;
|
||||
|
||||
while (searchLoop()) {
|
||||
text = text.replace(searchRegexp(i), updateBbcode);
|
||||
(removal) ? i++ : i--;
|
||||
if (removal) {
|
||||
for (i = index; i < phpbb.plupload.ids.length; i++) {
|
||||
runUpdate(i);
|
||||
}
|
||||
} else {
|
||||
for (i = phpbb.plupload.ids.length - 1; i >= index; i--) {
|
||||
runUpdate(i);
|
||||
}
|
||||
}
|
||||
|
||||
textarea.val(text);
|
||||
};
|
||||
|
||||
/**
|
||||
* Get Plupload file objects based on their upload status.
|
||||
*
|
||||
* @param int status Plupload status - plupload.DONE, plupload.FAILED, plupload.QUEUED,
|
||||
* plupload.STARTED, plupload.STOPPED
|
||||
* @param {int} status Plupload status - plupload.DONE, plupload.FAILED,
|
||||
* plupload.QUEUED, plupload.STARTED, plupload.STOPPED
|
||||
*
|
||||
* @return Returns an array of the Plupload file objects matching the status.
|
||||
* @returns {Array} The Plupload file objects matching the status.
|
||||
*/
|
||||
phpbb.plupload.getFilesByStatus = function(status) {
|
||||
var files = [];
|
||||
|
||||
$.each(uploader.files, function(i, file) {
|
||||
$.each(phpbb.plupload.uploader.files, function(i, file) {
|
||||
if (file.status === status) {
|
||||
files.push(file);
|
||||
}
|
||||
});
|
||||
return files;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Check whether the user has reached the maximun number of files that he's allowed
|
||||
* to upload. If so, disables the uploader and marks the queued files as failed. Otherwise
|
||||
* makes sure that the uploader is enabled.
|
||||
*
|
||||
* @return bool Returns true if the limit has been reached. False if otherwise.
|
||||
* @returns {bool} True if the limit has been reached. False if otherwise.
|
||||
*/
|
||||
phpbb.plupload.handleMaxFilesReached = function() {
|
||||
// If there is no limit, the user is an admin or moderator.
|
||||
@@ -400,41 +380,36 @@ phpbb.plupload.handleMaxFilesReached = function() {
|
||||
phpbb.plupload.markQueuedFailed(phpbb.plupload.lang.TOO_MANY_ATTACHMENTS);
|
||||
// Disable the uploader.
|
||||
phpbb.plupload.disableUploader();
|
||||
uploader.trigger('Error', {message: phpbb.plupload.lang.TOO_MANY_ATTACHMENTS});
|
||||
phpbb.plupload.uploader.trigger('Error', { message: phpbb.plupload.lang.TOO_MANY_ATTACHMENTS });
|
||||
|
||||
return true;
|
||||
} else if(phpbb.plupload.maxFiles > phpbb.plupload.ids.length) {
|
||||
} else if (phpbb.plupload.maxFiles > phpbb.plupload.ids.length) {
|
||||
// Enable the uploader if the user is under the limit
|
||||
phpbb.plupload.enableUploader();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Disable the uploader
|
||||
*
|
||||
* @return undefined
|
||||
*/
|
||||
phpbb.plupload.disableUploader = function() {
|
||||
$('#add_files').addClass('disabled');
|
||||
uploader.disableBrowse();
|
||||
}
|
||||
phpbb.plupload.uploader.disableBrowse();
|
||||
};
|
||||
|
||||
/**
|
||||
* Enable the uploader
|
||||
*
|
||||
* @return undefined
|
||||
*/
|
||||
phpbb.plupload.enableUploader = function() {
|
||||
$('#add_files').removeClass('disabled');
|
||||
uploader.disableBrowse(false);
|
||||
}
|
||||
phpbb.plupload.uploader.disableBrowse(false);
|
||||
};
|
||||
|
||||
/**
|
||||
* Mark all queued files as failed.
|
||||
*
|
||||
* @param string error Error message to present to the user.
|
||||
* @return undefined
|
||||
* @param {string} error Error message to present to the user.
|
||||
*/
|
||||
phpbb.plupload.markQueuedFailed = function(error) {
|
||||
var files = phpbb.plupload.getFilesByStatus(plupload.QUEUED);
|
||||
@@ -443,48 +418,49 @@ phpbb.plupload.markQueuedFailed = function(error) {
|
||||
$('#' + file.id).find('.file-progress').hide();
|
||||
phpbb.plupload.fileError(file, error);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Marks a file as failed and sets the error message for it.
|
||||
*
|
||||
* @param object file Plupload file object that failed.
|
||||
* @param string error Error message to present to the user.
|
||||
* @return undefined
|
||||
* @param {object} file Plupload file object that failed.
|
||||
* @param {string} error Error message to present to the user.
|
||||
*/
|
||||
phpbb.plupload.fileError = function(file, error) {
|
||||
file.status = plupload.FAILED;
|
||||
file.error = error;
|
||||
$('#' + file.id).find('.file-status').addClass('file-error').attr({'data-error-title': phpbb.plupload.lang.ERROR, 'data-error-message': error});
|
||||
}
|
||||
|
||||
|
||||
$('#' + file.id).find('.file-status')
|
||||
.addClass('file-error')
|
||||
.attr({
|
||||
'data-error-title': phpbb.plupload.lang.ERROR,
|
||||
'data-error-message': error
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Set up the Plupload object and get some basic data.
|
||||
*/
|
||||
var uploader = new plupload.Uploader(phpbb.plupload.config);
|
||||
phpbb.plupload.uploader = new plupload.Uploader(phpbb.plupload.config);
|
||||
phpbb.plupload.initialize();
|
||||
|
||||
|
||||
|
||||
var $fileList = $('#file-list');
|
||||
|
||||
/**
|
||||
* Insert inline attachment bbcode.
|
||||
*/
|
||||
$('#file-list').on('click', '.file-inline-bbcode', function(e) {
|
||||
$fileList.on('click', '.file-inline-bbcode', function(e) {
|
||||
var attachId = $(this).parents('.attach-row').attr('data-attach-id'),
|
||||
index = phpbb.plupload.getIndex(attachId);
|
||||
|
||||
attach_inline(index, phpbb.plupload.data[index].real_filename);
|
||||
attachInline(index, phpbb.plupload.data[index].real_filename);
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
/**
|
||||
* Delete a file.
|
||||
*/
|
||||
$('#file-list').on('click', '.file-delete', function(e) {
|
||||
$fileList.on('click', '.file-delete', function(e) {
|
||||
var row = $(this).parents('.attach-row'),
|
||||
attachId = row.attr('data-attach-id');
|
||||
|
||||
@@ -495,7 +471,7 @@ $('#file-list').on('click', '.file-delete', function(e) {
|
||||
/**
|
||||
* Display the error message for a particular file when the error icon is clicked.
|
||||
*/
|
||||
$('#file-list').on('click', '.file-error', function(e) {
|
||||
$fileList.on('click', '.file-error', function(e) {
|
||||
phpbb.alert($(this).attr('data-error-title'), $(this).attr('data-error-message'));
|
||||
e.preventDefault();
|
||||
});
|
||||
@@ -503,7 +479,7 @@ $('#file-list').on('click', '.file-error', function(e) {
|
||||
/**
|
||||
* Fires when an error occurs.
|
||||
*/
|
||||
uploader.bind('Error', function(up, error) {
|
||||
phpbb.plupload.uploader.bind('Error', function(up, error) {
|
||||
error.file.name = plupload.xmlEncode(error.file.name);
|
||||
|
||||
// The error message that Plupload provides for these is vague, so we'll be more specific.
|
||||
@@ -520,18 +496,15 @@ uploader.bind('Error', function(up, error) {
|
||||
* send the real filename along with the chunk. This is necessary because
|
||||
* for some reason the filename is set to 'blob' whenever a file is chunked
|
||||
*
|
||||
* @param object up The plupload.Uploader object
|
||||
* @param object file The plupload.File object that is about to be
|
||||
* uploaded
|
||||
*
|
||||
* @return undefined
|
||||
* @param {object} up The plupload.Uploader object
|
||||
* @param {object} file The plupload.File object that is about to be uploaded
|
||||
*/
|
||||
uploader.bind('BeforeUpload', function(up, file) {
|
||||
phpbb.plupload.uploader.bind('BeforeUpload', function(up, file) {
|
||||
if (phpbb.plupload.handleMaxFilesReached()) {
|
||||
return;
|
||||
}
|
||||
|
||||
phpbb.plupload.updateMultipartParams({'real_filename': file.name});
|
||||
phpbb.plupload.updateMultipartParams({ real_filename: file.name });
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -539,14 +512,12 @@ uploader.bind('BeforeUpload', function(up, file) {
|
||||
* response from the server and checks for an error. If an error occurs it
|
||||
* is reported to the user and the upload of this particular file is halted
|
||||
*
|
||||
* @param object up The plupload.Uploader object
|
||||
* @param object file The plupload.File object whose chunk has just
|
||||
* @param {object} up The plupload.Uploader object
|
||||
* @param {object} file The plupload.File object whose chunk has just
|
||||
* been uploaded
|
||||
* @param object response The response object from the server
|
||||
*
|
||||
* @return undefined
|
||||
* @param {object} response The response object from the server
|
||||
*/
|
||||
uploader.bind('ChunkUploaded', function(up, file, response) {
|
||||
phpbb.plupload.uploader.bind('ChunkUploaded', function(up, file, response) {
|
||||
if (response.chunk >= response.chunks - 1) {
|
||||
return;
|
||||
}
|
||||
@@ -567,7 +538,7 @@ uploader.bind('ChunkUploaded', function(up, file, response) {
|
||||
|
||||
// If trigger_error() was called, then a permission error likely occurred.
|
||||
if (typeof json.title !== 'undefined') {
|
||||
json.error = {message: json.message};
|
||||
json.error = { message: json.message };
|
||||
}
|
||||
|
||||
if (json.error) {
|
||||
@@ -584,10 +555,8 @@ uploader.bind('ChunkUploaded', function(up, file, response) {
|
||||
|
||||
/**
|
||||
* Fires when files are added to the queue.
|
||||
*
|
||||
* @return undefined
|
||||
*/
|
||||
uploader.bind('FilesAdded', function(up, files) {
|
||||
phpbb.plupload.uploader.bind('FilesAdded', function(up, files) {
|
||||
// Prevent unnecessary requests to the server if the user already uploaded
|
||||
// the maximum number of files allowed.
|
||||
if (phpbb.plupload.handleMaxFilesReached()) {
|
||||
@@ -595,13 +564,14 @@ uploader.bind('FilesAdded', function(up, files) {
|
||||
}
|
||||
|
||||
// Switch the active tab if the style supports it
|
||||
if (typeof activateSubPanel == 'function') {
|
||||
activateSubPanel('attach-panel');
|
||||
if (typeof activateSubPanel === 'function') {
|
||||
activateSubPanel('attach-panel'); // jshint ignore: line
|
||||
}
|
||||
|
||||
// Show the file list if there aren't any files currently.
|
||||
if (!$('#file-list-container').is(':visible')) {
|
||||
$('#file-list-container').show(100);
|
||||
var $fileListContainer = $('#file-list-container');
|
||||
if (!$fileListContainer.is(':visible')) {
|
||||
$fileListContainer.show(100);
|
||||
}
|
||||
|
||||
$.each(files, function(i, file) {
|
||||
@@ -609,7 +579,7 @@ uploader.bind('FilesAdded', function(up, files) {
|
||||
});
|
||||
|
||||
up.bind('UploadProgress', function(up, file) {
|
||||
$('#' + file.id + " .file-progress-bar").css('width', file.percent + '%');
|
||||
$('.file-progress-bar', '#' + file.id).css('width', file.percent + '%');
|
||||
$('#file-total-progress-bar').css('width', up.total.percent + '%');
|
||||
});
|
||||
|
||||
@@ -627,14 +597,12 @@ uploader.bind('FilesAdded', function(up, files) {
|
||||
* appends it to the next file upload so that the server can maintain state
|
||||
* with regards to the attachments in a given post
|
||||
*
|
||||
* @param object up The plupload.Uploader object
|
||||
* @param object file The plupload.File object that has just been
|
||||
* @param {object} up The plupload.Uploader object
|
||||
* @param {object} file The plupload.File object that has just been
|
||||
* uploaded
|
||||
* @param string response The response string from the server
|
||||
*
|
||||
* @return undefined
|
||||
* @param {string} response The response string from the server
|
||||
*/
|
||||
uploader.bind('FileUploaded', function(up, file, response) {
|
||||
phpbb.plupload.uploader.bind('FileUploaded', function(up, file, response) {
|
||||
var json = {},
|
||||
row = $('#' + file.id),
|
||||
error;
|
||||
@@ -643,7 +611,7 @@ uploader.bind('FileUploaded', function(up, file, response) {
|
||||
row.find('.file-progress').hide();
|
||||
|
||||
try {
|
||||
json = $.parseJSON(response.response);
|
||||
json = JSON.parse(response.response);
|
||||
} catch (e) {
|
||||
error = 'Error parsing server response.';
|
||||
}
|
||||
@@ -651,7 +619,7 @@ uploader.bind('FileUploaded', function(up, file, response) {
|
||||
// If trigger_error() was called, then a permission error likely occurred.
|
||||
if (typeof json.title !== 'undefined') {
|
||||
error = json.message;
|
||||
up.trigger('Error', {message: error});
|
||||
up.trigger('Error', { message: error });
|
||||
|
||||
// The rest of the queue will fail.
|
||||
phpbb.plupload.markQueuedFailed(error);
|
||||
@@ -662,25 +630,19 @@ uploader.bind('FileUploaded', function(up, file, response) {
|
||||
if (typeof error !== 'undefined') {
|
||||
phpbb.plupload.fileError(file, error);
|
||||
} else if (file.status === plupload.DONE) {
|
||||
file.attachment_data = json['data'][0];
|
||||
file.attachment_data = json.data[0];
|
||||
|
||||
row.attr('data-attach-id', file.attachment_data.attach_id);
|
||||
row.find('.file-inline-bbcode').show();
|
||||
row.find('.file-status').addClass('file-uploaded');
|
||||
phpbb.plupload.update(json['data'], 'addition', 0, [json['download_url']]);
|
||||
phpbb.plupload.update(json.data, 'addition', 0, [json.download_url]);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Fires when the entire queue of files have been uploaded.
|
||||
*
|
||||
* @param object up The plupload.Uploader object
|
||||
* @param array files An array of plupload.File objects that have just
|
||||
* been uploaded as part of a queue
|
||||
*
|
||||
* @return undefined
|
||||
* Fires when the entire queue of files have been uploaded.
|
||||
*/
|
||||
uploader.bind('UploadComplete', function(up, files) {
|
||||
phpbb.plupload.uploader.bind('UploadComplete', function() {
|
||||
// Hide the progress bar
|
||||
setTimeout(function() {
|
||||
$('#file-total-progress-bar').fadeOut(500, function() {
|
||||
|
17
phpBB/assets/plupload/plupload.full.min.js
vendored
17
phpBB/assets/plupload/plupload.full.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -34,15 +34,15 @@
|
||||
"symfony/http-kernel": "2.3.*",
|
||||
"symfony/routing": "2.3.*",
|
||||
"symfony/yaml": "2.3.*",
|
||||
"twig/twig": "1.13.*"
|
||||
"twig/twig": "1.*"
|
||||
},
|
||||
"require-dev": {
|
||||
"fabpot/goutte": "1.0.*",
|
||||
"phing/phing": "2.4.*",
|
||||
"phpunit/dbunit": "1.3.*",
|
||||
"phpunit/phpunit": "4.1.*",
|
||||
"phing/phing": "2.4.*",
|
||||
"sami/sami": "1.*",
|
||||
"squizlabs/php_codesniffer": "1.*",
|
||||
"squizlabs/php_codesniffer": "2.*",
|
||||
"symfony/browser-kit": "2.3.*",
|
||||
"symfony/css-selector": "2.3.*",
|
||||
"symfony/debug": "2.3.*",
|
||||
|
86
phpBB/composer.lock
generated
86
phpBB/composer.lock
generated
@@ -1,9 +1,10 @@
|
||||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
|
||||
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "d93446768ea0665b7c55c01890153a67",
|
||||
"hash": "5864f5064e1ca81dd9817ee2674b5dfd",
|
||||
"packages": [
|
||||
{
|
||||
"name": "lusitanian/oauth",
|
||||
@@ -649,25 +650,25 @@
|
||||
},
|
||||
{
|
||||
"name": "twig/twig",
|
||||
"version": "v1.13.2",
|
||||
"version": "v1.20.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/fabpot/Twig.git",
|
||||
"reference": "6d6a1009427d1f398c9d40904147bf9f723d5755"
|
||||
"url": "https://github.com/twigphp/Twig.git",
|
||||
"reference": "1ea4e5f81c6d005fe84d0b38e1c4f1955eb86844"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/fabpot/Twig/zipball/6d6a1009427d1f398c9d40904147bf9f723d5755",
|
||||
"reference": "6d6a1009427d1f398c9d40904147bf9f723d5755",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/1ea4e5f81c6d005fe84d0b38e1c4f1955eb86844",
|
||||
"reference": "1ea4e5f81c6d005fe84d0b38e1c4f1955eb86844",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.2.4"
|
||||
"php": ">=5.2.7"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.13-dev"
|
||||
"dev-master": "1.20-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -690,6 +691,11 @@
|
||||
"name": "Armin Ronacher",
|
||||
"email": "armin.ronacher@active-4.com",
|
||||
"role": "Project Founder"
|
||||
},
|
||||
{
|
||||
"name": "Twig Team",
|
||||
"homepage": "http://twig.sensiolabs.org/contributors",
|
||||
"role": "Contributors"
|
||||
}
|
||||
],
|
||||
"description": "Twig, the flexible, fast, and secure template language for PHP",
|
||||
@@ -697,7 +703,7 @@
|
||||
"keywords": [
|
||||
"templating"
|
||||
],
|
||||
"time": "2013-08-03 15:35:31"
|
||||
"time": "2015-08-12 15:56:39"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
@@ -763,12 +769,12 @@
|
||||
"target-dir": "Guzzle/Common",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/common.git",
|
||||
"url": "https://github.com/Guzzle3/common.git",
|
||||
"reference": "bf73c87375f60861f8c7ccc7b95878023ade5306"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/common/zipball/bf73c87375f60861f8c7ccc7b95878023ade5306",
|
||||
"url": "https://api.github.com/repos/Guzzle3/common/zipball/bf73c87375f60861f8c7ccc7b95878023ade5306",
|
||||
"reference": "bf73c87375f60861f8c7ccc7b95878023ade5306",
|
||||
"shasum": ""
|
||||
},
|
||||
@@ -807,12 +813,12 @@
|
||||
"target-dir": "Guzzle/Http",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/http.git",
|
||||
"url": "https://github.com/Guzzle3/http.git",
|
||||
"reference": "1034125dfd906b73119e535f03153a62fccb1989"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/http/zipball/1034125dfd906b73119e535f03153a62fccb1989",
|
||||
"url": "https://api.github.com/repos/Guzzle3/http/zipball/1034125dfd906b73119e535f03153a62fccb1989",
|
||||
"reference": "1034125dfd906b73119e535f03153a62fccb1989",
|
||||
"shasum": ""
|
||||
},
|
||||
@@ -864,12 +870,12 @@
|
||||
"target-dir": "Guzzle/Parser",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/parser.git",
|
||||
"url": "https://github.com/Guzzle3/parser.git",
|
||||
"reference": "a25c2ddda1c52fb69a4ee56eb530b13ddd9573c2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/parser/zipball/a25c2ddda1c52fb69a4ee56eb530b13ddd9573c2",
|
||||
"url": "https://api.github.com/repos/Guzzle3/parser/zipball/a25c2ddda1c52fb69a4ee56eb530b13ddd9573c2",
|
||||
"reference": "a25c2ddda1c52fb69a4ee56eb530b13ddd9573c2",
|
||||
"shasum": ""
|
||||
},
|
||||
@@ -908,12 +914,12 @@
|
||||
"target-dir": "Guzzle/Stream",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/stream.git",
|
||||
"url": "https://github.com/Guzzle3/stream.git",
|
||||
"reference": "a86111d9ac7db31d65a053c825869409fe8fc83f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/stream/zipball/a86111d9ac7db31d65a053c825869409fe8fc83f",
|
||||
"url": "https://api.github.com/repos/Guzzle3/stream/zipball/a86111d9ac7db31d65a053c825869409fe8fc83f",
|
||||
"reference": "a86111d9ac7db31d65a053c825869409fe8fc83f",
|
||||
"shasum": ""
|
||||
},
|
||||
@@ -1545,12 +1551,12 @@
|
||||
"version": "v1.0.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/fabpot/Pimple.git",
|
||||
"url": "https://github.com/silexphp/Pimple.git",
|
||||
"reference": "ae11e57e8c2bb414b2ff93396dbbfc0eb92feb94"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/fabpot/Pimple/zipball/ae11e57e8c2bb414b2ff93396dbbfc0eb92feb94",
|
||||
"url": "https://api.github.com/repos/silexphp/Pimple/zipball/ae11e57e8c2bb414b2ff93396dbbfc0eb92feb94",
|
||||
"reference": "ae11e57e8c2bb414b2ff93396dbbfc0eb92feb94",
|
||||
"shasum": ""
|
||||
},
|
||||
@@ -1914,41 +1920,45 @@
|
||||
},
|
||||
{
|
||||
"name": "squizlabs/php_codesniffer",
|
||||
"version": "1.5.2",
|
||||
"version": "2.3.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
|
||||
"reference": "a76a39b317ce8106abe6264daa505e24e1731860"
|
||||
"reference": "e96d8579fbed0c95ecf2a0501ec4f307a4aa6404"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/a76a39b317ce8106abe6264daa505e24e1731860",
|
||||
"reference": "a76a39b317ce8106abe6264daa505e24e1731860",
|
||||
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/e96d8579fbed0c95ecf2a0501ec4f307a4aa6404",
|
||||
"reference": "e96d8579fbed0c95ecf2a0501ec4f307a4aa6404",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-tokenizer": "*",
|
||||
"ext-xmlwriter": "*",
|
||||
"php": ">=5.1.2"
|
||||
},
|
||||
"suggest": {
|
||||
"phpunit/php-timer": "dev-master"
|
||||
},
|
||||
"bin": [
|
||||
"scripts/phpcs"
|
||||
"scripts/phpcs",
|
||||
"scripts/phpcbf"
|
||||
],
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"CodeSniffer.php",
|
||||
"CodeSniffer/CLI.php",
|
||||
"CodeSniffer/Exception.php",
|
||||
"CodeSniffer/File.php",
|
||||
"CodeSniffer/Fixer.php",
|
||||
"CodeSniffer/Report.php",
|
||||
"CodeSniffer/Reporting.php",
|
||||
"CodeSniffer/Sniff.php",
|
||||
"CodeSniffer/Tokens.php",
|
||||
"CodeSniffer/Reports/",
|
||||
"CodeSniffer/CommentParser/",
|
||||
"CodeSniffer/Tokenizers/",
|
||||
"CodeSniffer/DocGenerators/",
|
||||
"CodeSniffer/Standards/AbstractPatternSniff.php",
|
||||
@@ -1974,13 +1984,13 @@
|
||||
"role": "lead"
|
||||
}
|
||||
],
|
||||
"description": "PHP_CodeSniffer tokenises PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
|
||||
"description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
|
||||
"homepage": "http://www.squizlabs.com/php-codesniffer",
|
||||
"keywords": [
|
||||
"phpcs",
|
||||
"standards"
|
||||
],
|
||||
"time": "2014-02-04 23:49:58"
|
||||
"time": "2015-04-28 23:28:20"
|
||||
},
|
||||
{
|
||||
"name": "symfony/browser-kit",
|
||||
@@ -2236,17 +2246,13 @@
|
||||
"time": "2014-10-01 05:38:33"
|
||||
}
|
||||
],
|
||||
"aliases": [
|
||||
|
||||
],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": [
|
||||
|
||||
],
|
||||
"stability-flags": [],
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"platform-dev": [
|
||||
|
||||
]
|
||||
"platform-dev": []
|
||||
}
|
||||
|
@@ -60,6 +60,7 @@ services:
|
||||
- %core.php_ext%
|
||||
- @path_helper
|
||||
- @mimetype.guesser
|
||||
- @dispatcher
|
||||
- @cache.driver
|
||||
calls:
|
||||
- [set_name, [avatar.driver.upload]]
|
||||
|
@@ -120,6 +120,7 @@ services:
|
||||
- @config
|
||||
- @dbal.conn
|
||||
- @user
|
||||
- @dispatcher
|
||||
calls:
|
||||
- [set_name, [cron.task.core.tidy_search]]
|
||||
tags:
|
||||
|
@@ -18,15 +18,19 @@ if (php_sapi_name() != 'cli')
|
||||
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
$phpbb_root_path = __DIR__ . '/../';
|
||||
define('IN_PHPBB', true);
|
||||
|
||||
function usage()
|
||||
{
|
||||
echo "Usage: export_events_for_wiki.php COMMAND [EXTENSION]\n";
|
||||
echo "Usage: export_events_for_wiki.php COMMAND [VERSION] [EXTENSION]\n";
|
||||
echo "\n";
|
||||
echo "COMMAND:\n";
|
||||
echo " all:\n";
|
||||
echo " Generate the complete wikipage for https://wiki.phpbb.com/Event_List\n";
|
||||
echo "\n";
|
||||
echo " diff:\n";
|
||||
echo " Generate the Event Diff for the release highlights\n";
|
||||
echo "\n";
|
||||
echo " php:\n";
|
||||
echo " Generate the PHP event section of Event_List\n";
|
||||
echo "\n";
|
||||
@@ -36,6 +40,9 @@ function usage()
|
||||
echo " styles:\n";
|
||||
echo " Generate the Styles Template event section of Event_List\n";
|
||||
echo "\n";
|
||||
echo "VERSION (diff only):\n";
|
||||
echo " Filter events (minimum version)\n";
|
||||
echo "\n";
|
||||
echo "EXTENSION (Optional):\n";
|
||||
echo " If not given, only core events will be exported.\n";
|
||||
echo " Otherwise only events from the extension will be exported.\n";
|
||||
@@ -55,20 +62,32 @@ validate_argument_count($argc, 1);
|
||||
|
||||
$action = $argv[1];
|
||||
$extension = isset($argv[2]) ? $argv[2] : null;
|
||||
$min_version = null;
|
||||
require __DIR__ . '/../phpbb/event/php_exporter.' . $phpEx;
|
||||
require __DIR__ . '/../phpbb/event/md_exporter.' . $phpEx;
|
||||
require __DIR__ . '/../includes/functions.' . $phpEx;
|
||||
require __DIR__ . '/../phpbb/event/recursive_event_filter_iterator.' . $phpEx;
|
||||
require __DIR__ . '/../phpbb/recursive_dot_prefix_filter_iterator.' . $phpEx;
|
||||
|
||||
switch ($action)
|
||||
{
|
||||
|
||||
case 'diff':
|
||||
echo '== Event changes ==' . "\n";
|
||||
$min_version = $extension;
|
||||
$extension = isset($argv[3]) ? $argv[3] : null;
|
||||
|
||||
case 'all':
|
||||
echo '__FORCETOC__' . "\n";
|
||||
if ($action === 'all')
|
||||
{
|
||||
echo '__FORCETOC__' . "\n";
|
||||
}
|
||||
|
||||
|
||||
case 'php':
|
||||
$exporter = new \phpbb\event\php_exporter($phpbb_root_path, $extension);
|
||||
$exporter = new \phpbb\event\php_exporter($phpbb_root_path, $extension, $min_version);
|
||||
$exporter->crawl_phpbb_directory_php();
|
||||
echo $exporter->export_events_for_wiki();
|
||||
echo $exporter->export_events_for_wiki($action);
|
||||
|
||||
if ($action === 'php')
|
||||
{
|
||||
@@ -78,9 +97,16 @@ switch ($action)
|
||||
// no break;
|
||||
|
||||
case 'styles':
|
||||
$exporter = new \phpbb\event\md_exporter($phpbb_root_path, $extension);
|
||||
$exporter->crawl_phpbb_directory_styles('docs/events.md');
|
||||
echo $exporter->export_events_for_wiki();
|
||||
$exporter = new \phpbb\event\md_exporter($phpbb_root_path, $extension, $min_version);
|
||||
if ($min_version && $action === 'diff')
|
||||
{
|
||||
$exporter->crawl_eventsmd('docs/events.md', 'styles');
|
||||
}
|
||||
else
|
||||
{
|
||||
$exporter->crawl_phpbb_directory_styles('docs/events.md');
|
||||
}
|
||||
echo $exporter->export_events_for_wiki($action);
|
||||
|
||||
if ($action === 'styles')
|
||||
{
|
||||
@@ -90,9 +116,16 @@ switch ($action)
|
||||
// no break;
|
||||
|
||||
case 'adm':
|
||||
$exporter = new \phpbb\event\md_exporter($phpbb_root_path, $extension);
|
||||
$exporter->crawl_phpbb_directory_adm('docs/events.md');
|
||||
echo $exporter->export_events_for_wiki();
|
||||
$exporter = new \phpbb\event\md_exporter($phpbb_root_path, $extension, $min_version);
|
||||
if ($min_version && $action === 'diff')
|
||||
{
|
||||
$exporter->crawl_eventsmd('docs/events.md', 'adm');
|
||||
}
|
||||
else
|
||||
{
|
||||
$exporter->crawl_phpbb_directory_adm('docs/events.md');
|
||||
}
|
||||
echo $exporter->export_events_for_wiki($action);
|
||||
|
||||
if ($action === 'all')
|
||||
{
|
||||
|
@@ -40,7 +40,7 @@ if (!class_exists($search_type))
|
||||
}
|
||||
|
||||
$error = false;
|
||||
$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user);
|
||||
$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
|
||||
|
||||
if ($error)
|
||||
{
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<meta name="description" content="phpBB 3.1.x Changelog" />
|
||||
<title>phpBB • Changelog</title>
|
||||
|
||||
<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
|
||||
<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
|
||||
</head>
|
||||
|
||||
@@ -49,6 +49,8 @@
|
||||
<ol>
|
||||
<li><a href="#changelog">Changelog</a>
|
||||
<ul>
|
||||
<li><a href="#v315">Changes since 3.1.5</a></li>
|
||||
<li><a href="#v314">Changes since 3.1.4</a></li>
|
||||
<li><a href="#v313">Changes since 3.1.3</a></li>
|
||||
<li><a href="#v313rc1">Changes since 3.1.3-RC1</a></li>
|
||||
<li><a href="#v312">Changes since 3.1.2</a></li>
|
||||
@@ -111,6 +113,178 @@
|
||||
|
||||
<div class="content">
|
||||
|
||||
<a name="v315"></a><h3>Changes since 3.1.5</h3>
|
||||
|
||||
<h4>Bug</h4>
|
||||
<ul>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10711">PHPBB3-10711</a>] - SQL error DUPLICATE for KEY in FORUMS_TRACK_TABLE </li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13711">PHPBB3-13711</a>] - disabled accounts receive mails</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13815">PHPBB3-13815</a>] - Event parameters in posting do not affect behavior as expected</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13903">PHPBB3-13903</a>] - Container naming doesn't allow Windows' semicolon</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13930">PHPBB3-13930</a>] - Check for correct spacing between keyword & parenthesis in codesniffer</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13941">PHPBB3-13941</a>] - One test is blocked in an inifinite loop on php 5.5+ and with sqlite3</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13948">PHPBB3-13948</a>] - Only reports top level WHOIS IP for a user in ACP</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13949">PHPBB3-13949</a>] - Replace colon with colon lang key in memberlist search page</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13951">PHPBB3-13951</a>] - Jump to page function does not work since 3.1.5 upgrade</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13952">PHPBB3-13952</a>] - Fulltext Native errors from tidy_search cron task</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13955">PHPBB3-13955</a>] - 3.1.5 not loading CDN resources</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13962">PHPBB3-13962</a>] - Forum dropdown in MCP queue could expand beyond screen size</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13966">PHPBB3-13966</a>] - Change post's author --> error message</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13967">PHPBB3-13967</a>] - BBCode guide - loading phpBB logo image breaks https</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13980">PHPBB3-13980</a>] - Current avatar not removed when uploading with different extension</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13984">PHPBB3-13984</a>] - AJAX Loading Indicator broken</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14037">PHPBB3-14037</a>] - Memberlist profile fields headlines not computed from same way as data</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14049">PHPBB3-14049</a>] - Plupload delete request should use config headers</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14069">PHPBB3-14069</a>] - Incorrect sql_fetchfield call in style_update_p1 migration</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14077">PHPBB3-14077</a>] - Select all code not work in Microsoft Edge</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14082">PHPBB3-14082</a>] - Fix wrong variables in fulltext native search for keyworded results</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14083">PHPBB3-14083</a>] - Fix wrong variables in fulltext mysql search for author search</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14093">PHPBB3-14093</a>] - Hardcoded language in ucp_pm_viewfolder.html</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14103">PHPBB3-14103</a>] - Underline in abbreviations in Firefox 40</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14104">PHPBB3-14104</a>] - Fix missing variable in fulltext native search query for total results for author</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14115">PHPBB3-14115</a>] - Microdata is not valid in prosilver</li>
|
||||
</ul>
|
||||
<h4>Improvement</h4>
|
||||
<ul>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11530">PHPBB3-11530</a>] - Remove quotes that are too deep automatically</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12952">PHPBB3-12952</a>] - Display HTTP Output along with Status code in case assertion fails in functional tests</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13598">PHPBB3-13598</a>] - Add an option to post a locked topic</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13786">PHPBB3-13786</a>] - Add core events to add MCP post options</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13818">PHPBB3-13818</a>] - Browse Extensions Database link in Extension Manager</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13843">PHPBB3-13843</a>] - Add templates events to insert custom panel-tab into posting editor</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13863">PHPBB3-13863</a>] - [Template] - topiclist_row_append/topiclist_row_prepend in mcp_forum.html</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13879">PHPBB3-13879</a>] - We're using px most places but ems in others</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13882">PHPBB3-13882</a>] - Avatars in notifications should be lazy loaded</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13899">PHPBB3-13899</a>] - Add items to core.search_results_modify_search_title</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13911">PHPBB3-13911</a>] - Add configuration options to profile fields</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13931">PHPBB3-13931</a>] - Wrong order in docs/events.md</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13968">PHPBB3-13968</a>] - [PHP] - core.user_setup_after</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13971">PHPBB3-13971</a>] - Add draft_id variable to event core.posting_modify_template_vars</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13981">PHPBB3-13981</a>] - Events to intercept uploaded avatar deletion</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13995">PHPBB3-13995</a>] - Invalid HTML using Projection Media Type</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14002">PHPBB3-14002</a>] - Add template events before/after user details in ucp_main_front.html</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14005">PHPBB3-14005</a>] - Allow extensions control post buttons displaying</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14014">PHPBB3-14014</a>] - [PHP] - mcp_forum_view_actions</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14064">PHPBB3-14064</a>] - Add template events to ucp_pm_history.html</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14065">PHPBB3-14065</a>] - Add template events to attachment.html</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14067">PHPBB3-14067</a>] - Add template events to overall_header.html around feeds</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14068">PHPBB3-14068</a>] - New events around poll panel in viewtopic</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14072">PHPBB3-14072</a>] - Add core event to the function format_display()</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14085">PHPBB3-14085</a>] - [Template] - posting_topic_title_prepend</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14086">PHPBB3-14086</a>] - [Template] - Add mcp_forum_topic_title_*</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14090">PHPBB3-14090</a>] - [Template] - mcp_topic_topic_title_*</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14091">PHPBB3-14091</a>] - [Template] - mcp_topic_subject_*</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14101">PHPBB3-14101</a>] - Add core event to the download/file.php</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14116">PHPBB3-14116</a>] - sql_affectedrows has no arguments</li>
|
||||
</ul>
|
||||
<h4>New Feature</h4>
|
||||
<ul>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12692">PHPBB3-12692</a>] - Add a console command to manage the thumbnail</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13311">PHPBB3-13311</a>] - Add php event to acp manage_forums when deleting content</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13974">PHPBB3-13974</a>] - Add php event for altering data when changing a post's poster</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13997">PHPBB3-13997</a>] - [Template] - posting_editor_submit_buttons</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14006">PHPBB3-14006</a>] - [PHP] - core.ucp_register_agreement</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14041">PHPBB3-14041</a>] - [Template] - viewtopic_dropdown_top_custom</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14042">PHPBB3-14042</a>] - [Template] - viewtopic_dropdown_bottom_custom</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14043">PHPBB3-14043</a>] - [PHP] - core.get_avatar_after</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14087">PHPBB3-14087</a>] - Add an event to ucp_activate.php.</li>
|
||||
</ul>
|
||||
<h4>Sub-task</h4>
|
||||
<ul>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13694">PHPBB3-13694</a>] - Allow modifying the Postgres author search query for results</li>
|
||||
</ul>
|
||||
<h4>Task</h4>
|
||||
<ul>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13947">PHPBB3-13947</a>] - Add CHItA to developer list</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14010">PHPBB3-14010</a>] - Update Plupload to 2.1.8</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14099">PHPBB3-14099</a>] - Update Twig to 1.20</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<a name="v314"></a><h3>Changes since 3.1.4</h3>
|
||||
|
||||
<h4>Bug</h4>
|
||||
<ul>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9563">PHPBB3-9563</a>] - Empty categories showing up on index</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11521">PHPBB3-11521</a>] - Missing language string when migration is invalid</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11532">PHPBB3-11532</a>] - acp_users_overview.html autocompletes "confirm email" and "password" fields in chrome</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13516">PHPBB3-13516</a>] - icc-profiler check should skip extensions vendor</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13564">PHPBB3-13564</a>] - User is not removed from oauth tables upon deletion</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13664">PHPBB3-13664</a>] - Allow changing total list for unapproved posts in mcp_front</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13755">PHPBB3-13755</a>] - uploading attachments results in error: parsing server response. </li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13763">PHPBB3-13763</a>] - Language Spelling Error: Completly</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13771">PHPBB3-13771</a>] - AJAX responses do not support exceptions messages</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13772">PHPBB3-13772</a>] - Error in @param variable type for phpbb\passwords\manager</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13779">PHPBB3-13779</a>] - Permission set migration tool grants regular users heightened permissions</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13787">PHPBB3-13787</a>] - Duplicate entry of poll_delete in prosilver template</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13792">PHPBB3-13792</a>] - Travis fails installing hhvm-nigthly</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13819">PHPBB3-13819</a>] - Add missing sql_freeresult() to files in includes/</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13822">PHPBB3-13822</a>] - Permissions are in the wrong category</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13823">PHPBB3-13823</a>] - Update package is missing file with inline whitespace changes</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13827">PHPBB3-13827</a>] - controller\helper::message does not return JSON object for AJAX requests</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13830">PHPBB3-13830</a>] - phpcs doesn't detect class using in catch blocks</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13833">PHPBB3-13833</a>] - Submit a lot of messages without timeout between messages</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13838">PHPBB3-13838</a>] - Add a sniff to ensure that the opening brace of a control statement is on the line after</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13852">PHPBB3-13852</a>] - Inconsistent tab navigation when login in</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13861">PHPBB3-13861</a>] - Old styles are not removed by style update migration</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13868">PHPBB3-13868</a>] - Adding multiple language files for acp/mcp/ucp modules is incorrectly handled for extensions</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13873">PHPBB3-13873</a>] - Remove broken print stylesheet in preference of &view=print</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13875">PHPBB3-13875</a>] - Lint test should ignore cache, ext, and store folder</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13878">PHPBB3-13878</a>] - Properly display background images when printing with webkit browser</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13888">PHPBB3-13888</a>] - "Couldn't fetch mysqli_result" error on username search and egosearch</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13913">PHPBB3-13913</a>] - Post subject of password protected and list-only forums shown on board index</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13922">PHPBB3-13922</a>] - Whitespace found at end of line phpBB/includes/functions_admin.php</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13928">PHPBB3-13928</a>] - Fix build_cfg_template_test after ticket/sec-184 </li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13939">PHPBB3-13939</a>] - phpBB no longer shows error messages when uploading files with drag/drop</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13942">PHPBB3-13942</a>] - phpbb\user::set_lang() adds extra path and PHP extension to ext lang files</li>
|
||||
</ul>
|
||||
<h4>Improvement</h4>
|
||||
<ul>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12101">PHPBB3-12101</a>] - Redirect for Microsoft servers in /includes/functions.php:redirect()</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12542">PHPBB3-12542</a>] - Highlight textarea when files are dragged over it</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12717">PHPBB3-12717</a>] - Improve the code sniffer</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13200">PHPBB3-13200</a>] - Add autocomplete="off" to additional password fields</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13648">PHPBB3-13648</a>] - Allow extensions using custom bbcode validation methods</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13699">PHPBB3-13699</a>] - Add template events in viewforum_body.html before and after the title</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13745">PHPBB3-13745</a>] - Add veiwtopic.php core event to allow manipulating poll data</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13750">PHPBB3-13750</a>] - Add generate_forum_nav() core event to allow modifying navlinks text</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13752">PHPBB3-13752</a>] - Add viewonline.php core event to allow modifying forum data SQL query</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13753">PHPBB3-13753</a>] - Add template events to forum category header</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13778">PHPBB3-13778</a>] - Misleading instruction text for recaptcha plugin</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13790">PHPBB3-13790</a>] - Update phpcs to 2.3.2</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13791">PHPBB3-13791</a>] - Add more post buttons template events to viewtopic_body.html</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13808">PHPBB3-13808</a>] - Add event before and after the search form</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13809">PHPBB3-13809</a>] - Test php parsing on php7 on travis</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13841">PHPBB3-13841</a>] - Add event when topics are moved</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13858">PHPBB3-13858</a>] - Make the Plupload uploader instance available in the global namespace</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13872">PHPBB3-13872</a>] - Allow template events to have a changed tag</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13876">PHPBB3-13876</a>] - Use async webfontloader to load webfont from googles CDN</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13905">PHPBB3-13905</a>] - loading.gif loaded before document load when it isn't needed</li>
|
||||
</ul>
|
||||
<h4>Security Issue</h4>
|
||||
<ul>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13917">PHPBB3-13917</a>] - Use hash_equals() if possible in password driver helper</li>
|
||||
<li>[SECURITY-184] - Do not output passwords to HTML input fields</li>
|
||||
</ul>
|
||||
<h4>Sub-task</h4>
|
||||
<ul>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13660">PHPBB3-13660</a>] - Allow changing the query for total reports in mcp_front</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13661">PHPBB3-13661</a>] - Allow changing how and which logs are retrieved</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13668">PHPBB3-13668</a>] - Allow modifying the query to get details from the post report</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13672">PHPBB3-13672</a>] - Allow changing the query to obtain the user-submitted report.</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13685">PHPBB3-13685</a>] - Allow modifying the keywords search query for mysql fulltext search</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13686">PHPBB3-13686</a>] - Allow modifying the fulltext native search query for total results before before</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13689">PHPBB3-13689</a>] - Allow modifying the Postgres native search query for results</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13691">PHPBB3-13691</a>] - Allow modifying the fulltext native search query for total results for author</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13693">PHPBB3-13693</a>] - Allow modifying the MySQL author search query for results</li>
|
||||
</ul>
|
||||
<h4>Task</h4>
|
||||
<ul>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13807">PHPBB3-13807</a>] - Extend event exporter to filter by min or max version to allow generating event diffs for releases</li>
|
||||
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13887">PHPBB3-13887</a>] - JS could use some refactoring</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<a name="v313"></a><h3>Changes since 3.1.3</h3>
|
||||
|
||||
<h4>Security</h4>
|
||||
@@ -4894,7 +5068,7 @@
|
||||
</div></div>
|
||||
|
||||
<div>
|
||||
<a id="bottom" name="bottom" accesskey="z"></a>
|
||||
<a id="bottom" accesskey="z"></a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
@@ -23,6 +23,7 @@ phpBB Project Manager: Marshalrusty (Yuriy Rusko)
|
||||
phpBB Lead Developer: naderman (Nils Adermann)
|
||||
|
||||
phpBB Developers: bantu (Andreas Fischer)
|
||||
CHItA (Máté Bartus)
|
||||
dhruv.goel92 (Dhruv Goel)
|
||||
Elsensee (Oliver Schramm)
|
||||
marc1706 (Marc Alexander)
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<meta name="description" content="phpBB 3.1.x frequently asked questions" />
|
||||
<title>phpBB • FAQ</title>
|
||||
|
||||
<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
|
||||
<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
|
||||
</head>
|
||||
|
||||
@@ -343,7 +343,7 @@ I want to sue you because i think you host an illegal board!</h2>
|
||||
</div></div>
|
||||
|
||||
<div>
|
||||
<a id="bottom" name="bottom" accesskey="z"></a>
|
||||
<a id="bottom" accesskey="z"></a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<meta name="description" content="phpBB 3.1.x Installation, updating and conversion informations" />
|
||||
<title>phpBB • Install</title>
|
||||
|
||||
<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
|
||||
<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
|
||||
</head>
|
||||
|
||||
@@ -507,7 +507,7 @@
|
||||
</div></div>
|
||||
|
||||
<div>
|
||||
<a id="bottom" name="bottom" accesskey="z"></a>
|
||||
<a id="bottom" accesskey="z"></a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<meta name="description" content="phpBB 3.1.x Readme" />
|
||||
<title>phpBB • Readme</title>
|
||||
|
||||
<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
|
||||
<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
|
||||
</head>
|
||||
|
||||
@@ -366,7 +366,7 @@
|
||||
</div></div>
|
||||
|
||||
<div>
|
||||
<a id="bottom" name="bottom" accesskey="z"></a>
|
||||
<a id="bottom" accesskey="z"></a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<meta name="description" content="This is an explanation of how to use the phpBB auth/acl API" />
|
||||
<title>phpBB3 • Auth API</title>
|
||||
|
||||
<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
|
||||
<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
|
||||
</head>
|
||||
|
||||
@@ -110,7 +110,7 @@ $auth = new phpbb\auth\auth();</pre>
|
||||
<p>Following are the methods you are able to use.</p>
|
||||
|
||||
<a name="acl"></a><h3>2.i. acl</h3>
|
||||
|
||||
|
||||
<p>The <code>acl</code> method is the initialisation routine for all the acl functions. If you intend calling any acl method you must first call this. The method takes as its one and only required parameter an associative array containing user information as stored in the database. This array must contain at least the following information; user_id, user_permissions and user_type. It is called in the following way:</p>
|
||||
|
||||
<div class="codebox"><pre>
|
||||
@@ -285,7 +285,7 @@ $auth_admin = new auth_admin();</pre>
|
||||
</div></div>
|
||||
|
||||
<div>
|
||||
<a id="bottom" name="bottom" accesskey="z"></a>
|
||||
<a id="bottom" accesskey="z"></a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<meta name="description" content="Ascraeus coding guidelines document" />
|
||||
<title>phpBB3 • Coding Guidelines</title>
|
||||
|
||||
<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
|
||||
<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
|
||||
</head>
|
||||
|
||||
@@ -300,9 +300,9 @@ PHPBB_QA (Set board to QA-Mode, which means the updater also c
|
||||
<div class="indent">
|
||||
<p><code>$current_user</code> is right, but <code>$currentuser</code> and <code> $currentUser</code> are not.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<p>In JavaScript, variable names should use camel case:</p>
|
||||
|
||||
|
||||
<div class="indent">
|
||||
<p><code>currentUser</code> is right, but <code>currentuser</code> and <code>current_user</code> are not.</p>
|
||||
</div>
|
||||
@@ -431,7 +431,7 @@ function do_stuff()
|
||||
...
|
||||
}</pre>
|
||||
</div>
|
||||
|
||||
|
||||
<p>In JavaScript code, braces always go on the same line:</p>
|
||||
|
||||
<div class="codebox"><pre>
|
||||
@@ -2568,7 +2568,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
|
||||
</div></div>
|
||||
|
||||
<div>
|
||||
<a id="bottom" name="bottom" accesskey="z"></a>
|
||||
<a id="bottom" accesskey="z"></a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
@@ -22,6 +22,12 @@ acp_email_options_after
|
||||
* Since: 3.1.2-RC1
|
||||
* Purpose: Add settings to mass email form
|
||||
|
||||
acp_forums_custom_settings
|
||||
===
|
||||
* Location: adm/style/acp_forums.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add its own box (fieldset) for extension settings
|
||||
|
||||
acp_forums_main_settings_append
|
||||
===
|
||||
* Location: adm/style/acp_forums.html
|
||||
@@ -133,6 +139,13 @@ acp_posting_buttons_before
|
||||
* Since: 3.1.0-b4
|
||||
* Purpose: Add content before BBCode posting buttons in the ACP
|
||||
|
||||
acp_profile_contact_before
|
||||
===
|
||||
* Locations:
|
||||
+ adm/style/acp_profile.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add extra options to custom profile field configuration in the ACP
|
||||
|
||||
acp_ranks_edit_after
|
||||
===
|
||||
* Locations:
|
||||
@@ -277,6 +290,38 @@ acp_users_prefs_view_prepend
|
||||
* Since: 3.1.0-b3
|
||||
* Purpose: Add user options fieldset to the top of ACP users view prefs settings
|
||||
|
||||
attachment_file_after
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/attachment.html
|
||||
+ styles/subsilver2/template/attachment.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add content after the attachment.
|
||||
|
||||
attachment_file_append
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/attachment.html
|
||||
+ styles/subsilver2/template/attachment.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add custom attachment types displaying to the bottom of attachment block.
|
||||
|
||||
attachment_file_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/attachment.html
|
||||
+ styles/subsilver2/template/attachment.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add content before the attachment.
|
||||
|
||||
attachment_file_prepend
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/attachment.html
|
||||
+ styles/subsilver2/template/attachment.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add custom attachment types displaying to the top of attachment block.
|
||||
|
||||
forumlist_body_category_header_after
|
||||
===
|
||||
* Locations:
|
||||
@@ -293,6 +338,20 @@ forumlist_body_category_header_before
|
||||
* Since: 3.1.0-a4
|
||||
* Purpose: Add content before the header of the category on the forum list.
|
||||
|
||||
forumlist_body_category_header_row_append
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/forumlist_body.html
|
||||
* Since: 3.1.5-RC1
|
||||
* Purpose: Add content after the header row of the category on the forum list.
|
||||
|
||||
forumlist_body_category_header_row_prepend
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/forumlist_body.html
|
||||
* Since: 3.1.5-RC1
|
||||
* Purpose: Add content before the header row of the category on the forum list.
|
||||
|
||||
forumlist_body_forum_row_after
|
||||
===
|
||||
* Locations:
|
||||
@@ -477,6 +536,22 @@ mcp_ban_unban_before
|
||||
* Since: 3.1.0-RC3
|
||||
* Purpose: Add additional fields to the unban form in MCP
|
||||
|
||||
mcp_forum_topic_title_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/mcp_forum.html
|
||||
+ styles/subsilver2/template/mcp_forum.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add some information before the topic title
|
||||
|
||||
mcp_forum_topic_title_after
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/mcp_forum.html
|
||||
+ styles/subsilver2/template/mcp_forum.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add some information after the topic title
|
||||
|
||||
mcp_front_latest_logs_after
|
||||
===
|
||||
* Locations:
|
||||
@@ -517,6 +592,96 @@ mcp_front_latest_unapproved_before
|
||||
* Since: 3.1.3-RC1
|
||||
* Purpose: Add content before latest unapproved posts list
|
||||
|
||||
mcp_post_additional_options
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/mcp_post.html
|
||||
+ styles/subsilver2/template/mcp_post.html
|
||||
* Since: 3.1.5-RC1
|
||||
* Purpose: Add content within the list of post moderation actions
|
||||
|
||||
mcp_topic_options_after
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/mcp_topic.html
|
||||
+ styles/subsilver2/template/mcp_topic.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add some options (field, checkbox, ...) after the subject field when split a subject
|
||||
|
||||
mcp_topic_options_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/mcp_topic.html
|
||||
+ styles/subsilver2/template/mcp_topic.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add some options (field, checkbox, ...) before the subject field when split a subject
|
||||
|
||||
mcp_topic_topic_title_after
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/mcp_topic.html
|
||||
+ styles/subsilver2/template/mcp_topic.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add some information after the topic title
|
||||
|
||||
mcp_topic_topic_title_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/mcp_topic.html
|
||||
+ styles/subsilver2/template/mcp_topic.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add some information before the topic title
|
||||
|
||||
mcp_warn_post_add_warning_field_after
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/mcp_warn_post.html
|
||||
+ styles/subsilver2/template/mcp_warn_post.html
|
||||
* Since: 3.1.0-RC4
|
||||
* Purpose: Add content during warning for a post - after add warning field.
|
||||
|
||||
mcp_warn_post_add_warning_field_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/mcp_warn_post.html
|
||||
+ styles/subsilver2/template/mcp_warn_post.html
|
||||
* Since: 3.1.0-RC4
|
||||
* Purpose: Add content during warning for a post - before add warning field.
|
||||
|
||||
mcp_warn_user_add_warning_field_after
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/mcp_warn_user.html
|
||||
+ styles/subsilver2/template/mcp_warn_user.html
|
||||
* Since: 3.1.0-RC4
|
||||
* Purpose: Add content during warning a user - after add warning field.
|
||||
|
||||
mcp_warn_user_add_warning_field_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/mcp_warn_user.html
|
||||
+ styles/subsilver2/template/mcp_warn_user.html
|
||||
* Since: 3.1.0-RC4
|
||||
* Purpose: Add content during warning a user - before add warning field.
|
||||
|
||||
memberlist_body_rank_append
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/memberlist_body.html
|
||||
+ styles/subsilver2/template/memberlist_body.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add information after rank in memberlist. Works in
|
||||
all display modes (leader, group and normal memberlist).
|
||||
|
||||
memberlist_body_rank_prepend
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/memberlist_body.html
|
||||
+ styles/subsilver2/template/memberlist_body.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add information before rank in memberlist. Works in
|
||||
all display modes (leader, group and normal memberlist).
|
||||
|
||||
memberlist_body_username_append
|
||||
===
|
||||
* Locations:
|
||||
@@ -591,6 +756,48 @@ memberlist_view_content_prepend
|
||||
* Since: 3.1.0-b3
|
||||
* Purpose: Add custom content to the user profile view before the main content
|
||||
|
||||
memberlist_view_rank_after
|
||||
===
|
||||
* Locations:
|
||||
+ styles/subsilver2/template/memberlist_view.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add information after rank in memberlist
|
||||
|
||||
memberlist_view_rank_avatar_after
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/memberlist_view.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add information after rank in memberlist (with avatar)
|
||||
|
||||
memberlist_view_rank_avatar_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/memberlist_view.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add information before rank in memberlist (with avatar)
|
||||
|
||||
memberlist_view_rank_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/subsilver2/template/memberlist_view.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add information after rank in memberlist
|
||||
|
||||
memberlist_view_rank_no_avatar_after
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/memberlist_view.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add information after rank in memberlist (without avatar)
|
||||
|
||||
memberlist_view_rank_no_avatar_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/memberlist_view.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add information before rank in memberlist (without avatar)
|
||||
|
||||
memberlist_view_user_statistics_after
|
||||
===
|
||||
* Locations:
|
||||
@@ -607,38 +814,6 @@ memberlist_view_user_statistics_before
|
||||
* Since: 3.1.0-a1
|
||||
* Purpose: Add entries before the user statistics part of any user profile
|
||||
|
||||
mcp_warn_post_add_warning_field_after
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/mcp_warn_post.html
|
||||
+ styles/subsilver2/template/mcp_warn_post.html
|
||||
* Since: 3.1.0-RC4
|
||||
* Purpose: Add content during warning for a post - after add warning field.
|
||||
|
||||
mcp_warn_post_add_warning_field_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/mcp_warn_post.html
|
||||
+ styles/subsilver2/template/mcp_warn_post.html
|
||||
* Since: 3.1.0-RC4
|
||||
* Purpose: Add content during warning for a post - before add warning field.
|
||||
|
||||
mcp_warn_user_add_warning_field_after
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/mcp_warn_user.html
|
||||
+ styles/subsilver2/template/mcp_warn_user.html
|
||||
* Since: 3.1.0-RC4
|
||||
* Purpose: Add content during warning a user - after add warning field.
|
||||
|
||||
mcp_warn_user_add_warning_field_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/mcp_warn_user.html
|
||||
+ styles/subsilver2/template/mcp_warn_user.html
|
||||
* Since: 3.1.0-RC4
|
||||
* Purpose: Add content during warning a user - before add warning field.
|
||||
|
||||
navbar_header_logged_out_content
|
||||
===
|
||||
* Locations:
|
||||
@@ -832,6 +1007,14 @@ overall_header_content_before
|
||||
* Since: 3.1.0-a3
|
||||
* Purpose: Add content on all pages before the main content, after the header
|
||||
|
||||
overall_header_feeds
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/overall_header.html
|
||||
+ styles/subsilver2/template/overall_header.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add custom feeds
|
||||
|
||||
overall_header_head_append
|
||||
===
|
||||
* Locations:
|
||||
@@ -904,6 +1087,13 @@ overall_header_stylesheets_after
|
||||
* Purpose: Add asset calls after stylesheets within the `</head>` tag.
|
||||
Note that INCLUDECSS will not work with this event.
|
||||
|
||||
posting_editor_add_panel_tab
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/posting_editor.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add custom panel to post editor
|
||||
|
||||
posting_editor_bbcode_status_after
|
||||
===
|
||||
* Locations:
|
||||
@@ -992,6 +1182,21 @@ posting_editor_subject_before
|
||||
* Since: 3.1.0-a2
|
||||
* Purpose: Add field (e.g. textbox) to the posting screen before the subject
|
||||
|
||||
posting_editor_submit_buttons
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/posting_editor.html
|
||||
+ styles/subsilver2/template/posting_body.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add custom buttons in the posting editor
|
||||
|
||||
posting_layout_include_panel_body
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/posting_layout.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add include of custom panel template body in posting editor
|
||||
|
||||
posting_pm_header_find_username_after
|
||||
===
|
||||
* Locations:
|
||||
@@ -1030,6 +1235,14 @@ posting_poll_body_options_after
|
||||
* Since: 3.1.4-RC1
|
||||
* Purpose: Add content after the poll options on creating a poll
|
||||
|
||||
posting_topic_title_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/posting_layout.html
|
||||
+ styles/subsilver2/template/posting_body.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Allows to add some information on the left of the topic title in the posting form
|
||||
|
||||
quickreply_editor_panel_after
|
||||
===
|
||||
* Locations:
|
||||
@@ -1062,6 +1275,14 @@ quickreply_editor_message_before
|
||||
* Since: 3.1.0-a4
|
||||
* Purpose: Add content before the quick reply textbox
|
||||
|
||||
search_body_form_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/search_body.html
|
||||
+ styles/subsilver2/template/search_body.html
|
||||
* Since: 3.1.5-RC1
|
||||
* Purpose: Add content before the search form
|
||||
|
||||
search_results_header_after
|
||||
===
|
||||
* Locations:
|
||||
@@ -1170,9 +1391,12 @@ topiclist_row_prepend
|
||||
* Locations:
|
||||
+ styles/prosilver/template/search_results.html
|
||||
+ styles/prosilver/template/viewforum_body.html
|
||||
+ styles/prosilver/template/mcp_forum.html
|
||||
+ styles/subsilver2/template/search_results.html
|
||||
+ styles/subsilver2/template/viewforum_body.html
|
||||
+ styles/subsilver2/template/mcp_forum.html
|
||||
* Since: 3.1.0-a1
|
||||
* Changed: 3.1.6-RC1 Added event to mcp_forum.html
|
||||
* Purpose: Add content into topic rows (inside the elements containing topic titles)
|
||||
|
||||
topiclist_row_append
|
||||
@@ -1180,9 +1404,12 @@ topiclist_row_append
|
||||
* Locations:
|
||||
+ styles/prosilver/template/search_results.html
|
||||
+ styles/prosilver/template/viewforum_body.html
|
||||
+ styles/prosilver/template/mcp_forum.html
|
||||
+ styles/subsilver2/template/search_results.html
|
||||
+ styles/subsilver2/template/viewforum_body.html
|
||||
+ styles/subsilver2/template/mcp_forum.html
|
||||
* Since: 3.1.0-a1
|
||||
* Changed: 3.1.6-RC1 Added event to mcp_forum.html
|
||||
* Purpose: Add content into topic rows (inside the elements containing topic titles)
|
||||
|
||||
ucp_agreement_terms_after
|
||||
@@ -1201,6 +1428,72 @@ ucp_agreement_terms_before
|
||||
* Since: 3.1.0-b3
|
||||
* Purpose: Add content before the terms of agreement text at user registration
|
||||
|
||||
ucp_main_front_user_activity_after
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/ucp_main_front.html
|
||||
+ styles/subsilver2/template/ucp_main_front.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add content right after the user activity info viewing UCP front page
|
||||
|
||||
ucp_main_front_user_activity_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/ucp_main_front.html
|
||||
+ styles/subsilver2/template/ucp_main_front.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add content right before the user activity info viewing UCP front page
|
||||
|
||||
ucp_pm_history_post_buttons_after
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/ucp_pm_history.html
|
||||
+ styles/subsilver2/template/ucp_pm_history.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add post button to private messages in history review (next to quote etc), at
|
||||
the end of the list.
|
||||
|
||||
ucp_pm_history_post_buttons_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/ucp_pm_history.html
|
||||
+ styles/subsilver2/template/ucp_pm_history.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add post button to private messages in history review (next to quote etc), at
|
||||
the start of the list.
|
||||
|
||||
ucp_pm_history_post_buttons_list_after
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/ucp_pm_history.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add post button custom list to private messages in history review (next to quote etc),
|
||||
after the original list.
|
||||
|
||||
ucp_pm_history_post_buttons_list_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/ucp_pm_history.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add post button custom list to private messages in history review (next to quote etc),
|
||||
before the original list.
|
||||
|
||||
ucp_pm_history_review_after
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/ucp_pm_history.html
|
||||
+ styles/subsilver2/template/ucp_pm_history.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add content after the private messages history review.
|
||||
|
||||
ucp_pm_history_review_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/ucp_pm_history.html
|
||||
+ styles/subsilver2/template/ucp_pm_history.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add content before the private messages history review.
|
||||
|
||||
ucp_pm_viewmessage_avatar_after
|
||||
===
|
||||
* Locations:
|
||||
@@ -1265,6 +1558,22 @@ ucp_pm_viewmessage_post_buttons_before
|
||||
* Purpose: Add post button to private messages (next to edit, quote etc), at
|
||||
the start of the list.
|
||||
|
||||
ucp_pm_viewmessage_post_buttons_list_after
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/ucp_pm_viewmessage.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add post button custom list to private messages (next to edit, quote etc),
|
||||
after the original list.
|
||||
|
||||
ucp_pm_viewmessage_post_buttons_list_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/ucp_pm_viewmessage.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add post button custom list to private messages (next to edit, quote etc),
|
||||
before the original list.
|
||||
|
||||
ucp_pm_viewmessage_print_head_append
|
||||
===
|
||||
* Locations:
|
||||
@@ -1273,6 +1582,22 @@ ucp_pm_viewmessage_print_head_append
|
||||
* Since: 3.1.0-a1
|
||||
* Purpose: Add asset calls directly before the `</head>` tag of the Print PM screen
|
||||
|
||||
ucp_pm_viewmessage_rank_after
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/ucp_pm_viewmessage.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add data after the rank on the user profile when viewing
|
||||
a private message
|
||||
|
||||
ucp_pm_viewmessage_rank_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/ucp_pm_viewmessage.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add data before the rank on the user profile when viewing
|
||||
a private message
|
||||
|
||||
ucp_prefs_personal_prepend
|
||||
===
|
||||
* Locations:
|
||||
@@ -1493,6 +1818,20 @@ viewtopic_buttons_top_after
|
||||
* Since: 3.1.0-RC5
|
||||
* Purpose: Add buttons after Post Reply button on the top of the posts's list
|
||||
|
||||
viewtopic_dropdown_bottom_custom
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/viewtopic_body.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Create a custom dropdown menu
|
||||
|
||||
viewtopic_dropdown_top_custom
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/viewtopic_body.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Create a custom dropdown menu
|
||||
|
||||
viewforum_forum_name_append
|
||||
===
|
||||
* Locations:
|
||||
@@ -1509,6 +1848,22 @@ viewforum_forum_name_prepend
|
||||
* Since: 3.1.0-b3
|
||||
* Purpose: Add content directly before the forum name link on the View forum screen
|
||||
|
||||
viewforum_forum_title_after
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/viewforum_body.html
|
||||
+ styles/subsilver2/template/viewforum_body.html
|
||||
* Since: 3.1.5-RC1
|
||||
* Purpose: Add content directly after the forum title on the View forum screen
|
||||
|
||||
viewforum_forum_title_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/viewforum_body.html
|
||||
+ styles/subsilver2/template/viewforum_body.html
|
||||
* Since: 3.1.5-RC1
|
||||
* Purpose: Add content directly before the forum title on the View forum screen
|
||||
|
||||
viewtopic_print_head_append
|
||||
===
|
||||
* Locations:
|
||||
@@ -1567,6 +1922,22 @@ viewtopic_body_footer_before
|
||||
and quick reply, directly before the jumpbox in Prosilver, breadcrumbs in
|
||||
Subsilver2.
|
||||
|
||||
viewtopic_body_poll_after
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/viewtopic_body.html
|
||||
+ styles/subsilver2/template/viewtopic_body.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add content after the poll panel.
|
||||
|
||||
viewtopic_body_poll_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/viewtopic_body.html
|
||||
+ styles/subsilver2/template/viewtopic_body.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add content before the poll panel.
|
||||
|
||||
viewtopic_body_poll_option_after
|
||||
===
|
||||
* Locations:
|
||||
@@ -1635,6 +2006,22 @@ viewtopic_body_post_buttons_before
|
||||
* Purpose: Add post button to posts (next to edit, quote etc), at the start of
|
||||
the list.
|
||||
|
||||
viewtopic_body_post_buttons_list_after
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/viewtopic_body.html
|
||||
* Since: 3.1.5-RC1
|
||||
* Purpose: Add post button custom list to posts (next to edit, quote etc),
|
||||
after the original list.
|
||||
|
||||
viewtopic_body_post_buttons_list_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/viewtopic_body.html
|
||||
* Since: 3.1.5-RC1
|
||||
* Purpose: Add post button custom list to posts (next to edit, quote etc),
|
||||
before the original list.
|
||||
|
||||
viewtopic_body_postrow_custom_fields_after
|
||||
===
|
||||
* Locations:
|
||||
@@ -1709,6 +2096,24 @@ viewtopic_body_postrow_post_notices_before
|
||||
* Since: 3.1.0-b2
|
||||
* Purpose: Add posts specific custom notices at the notices top.
|
||||
|
||||
viewtopic_body_postrow_rank_after
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/viewtopic_body.html
|
||||
+ styles/subsilver2/template/viewtopic_body.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add data after the rank on the user profile when viewing
|
||||
a post
|
||||
|
||||
viewtopic_body_postrow_rank_before
|
||||
===
|
||||
* Locations:
|
||||
+ styles/prosilver/template/viewtopic_body.html
|
||||
+ styles/subsilver2/template/viewtopic_body.html
|
||||
* Since: 3.1.6-RC1
|
||||
* Purpose: Add data before the rank on the user profile when viewing
|
||||
a post
|
||||
|
||||
viewtopic_body_topic_actions_before
|
||||
===
|
||||
* Locations:
|
||||
|
@@ -250,6 +250,30 @@ else
|
||||
$display_cat = ATTACHMENT_CATEGORY_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Event to modify data before sending file to browser
|
||||
*
|
||||
* @event core.download_file_send_to_browser_before
|
||||
* @var int attach_id The attachment ID
|
||||
* @var array attachment Array with attachment data
|
||||
* @var int display_cat Attachment category
|
||||
* @var int download_mode File extension specific download mode
|
||||
* @var array extension Array with file extensions data
|
||||
* @var string mode Download mode
|
||||
* @var bool thumbnail Flag indicating if the file is a thumbnail
|
||||
* @since 3.1.6-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'attach_id',
|
||||
'attachment',
|
||||
'display_cat',
|
||||
'download_mode',
|
||||
'extension',
|
||||
'mode',
|
||||
'thumbnail',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.download_file_send_to_browser_before', compact($vars)));
|
||||
|
||||
if ($thumbnail)
|
||||
{
|
||||
$attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename'];
|
||||
|
@@ -500,7 +500,7 @@ class acp_board
|
||||
}
|
||||
|
||||
// We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to...
|
||||
foreach ($display_vars['vars'] as $config_name => $null)
|
||||
foreach ($display_vars['vars'] as $config_name => $data)
|
||||
{
|
||||
if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false)
|
||||
{
|
||||
@@ -514,7 +514,8 @@ class acp_board
|
||||
|
||||
if ($config_name == 'guest_style')
|
||||
{
|
||||
if (isset($cfg_array[$config_name])) {
|
||||
if (isset($cfg_array[$config_name]))
|
||||
{
|
||||
$this->guest_style_set($cfg_array[$config_name]);
|
||||
}
|
||||
continue;
|
||||
@@ -531,6 +532,13 @@ class acp_board
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
if (strpos($data['type'], 'password') === 0 && $config_value === '********')
|
||||
{
|
||||
// Do not update password fields if the content is ********,
|
||||
// because that is the password replacement we use to not
|
||||
// send the password to the output
|
||||
continue;
|
||||
}
|
||||
set_config($config_name, $config_value);
|
||||
|
||||
if ($config_name == 'allow_quick_reply' && isset($_POST['allow_quick_reply_enable']))
|
||||
@@ -559,6 +567,7 @@ class acp_board
|
||||
$old_auth_config = array();
|
||||
foreach ($auth_providers as $provider)
|
||||
{
|
||||
/** @var \phpbb\auth\provider\provider_interface $provider */
|
||||
if ($fields = $provider->acp())
|
||||
{
|
||||
// Check if we need to create config fields for this plugin and save config when submit was pressed
|
||||
@@ -574,6 +583,14 @@ class acp_board
|
||||
continue;
|
||||
}
|
||||
|
||||
if (substr($field, -9) === '_password' && $cfg_array[$field] === '********')
|
||||
{
|
||||
// Do not update password fields if the content is ********,
|
||||
// because that is the password replacement we use to not
|
||||
// send the password to the output
|
||||
continue;
|
||||
}
|
||||
|
||||
$old_auth_config[$field] = $this->new_config[$field];
|
||||
$config_value = $cfg_array[$field];
|
||||
$this->new_config[$field] = $config_value;
|
||||
|
@@ -1173,6 +1173,7 @@ class postgres_extractor extends base_extractor
|
||||
$this->flush($sql_data . ";\n");
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql_data = '-- Table: ' . $table_name . "\n";
|
||||
$sql_data .= "DROP TABLE $table_name;\n";
|
||||
@@ -1557,7 +1558,7 @@ class mssql_extractor extends base_extractor
|
||||
{
|
||||
$this->write_data_mssql($table_name);
|
||||
}
|
||||
else if($db->get_sql_layer() === 'mssqlnative')
|
||||
else if ($db->get_sql_layer() === 'mssqlnative')
|
||||
{
|
||||
$this->write_data_mssqlnative($table_name);
|
||||
}
|
||||
|
@@ -76,7 +76,7 @@ class acp_extensions
|
||||
{
|
||||
$md_manager->get_metadata('all');
|
||||
}
|
||||
catch(\phpbb\extension\exception $e)
|
||||
catch (\phpbb\extension\exception $e)
|
||||
{
|
||||
trigger_error($e, E_USER_WARNING);
|
||||
}
|
||||
@@ -352,7 +352,7 @@ class acp_extensions
|
||||
$enabled_extension_meta_data[$name]['S_VERSIONCHECK'] = true;
|
||||
$enabled_extension_meta_data[$name]['U_VERSIONCHECK_FORCE'] = $this->u_action . '&action=details&versioncheck_force=1&ext_name=' . urlencode($md_manager->get_metadata('name'));
|
||||
}
|
||||
catch(\phpbb\extension\exception $e)
|
||||
catch (\phpbb\extension\exception $e)
|
||||
{
|
||||
$this->template->assign_block_vars('disabled', array(
|
||||
'META_DISPLAY_NAME' => $this->user->lang('EXTENSION_INVALID_LIST', $name, $e),
|
||||
@@ -408,7 +408,7 @@ class acp_extensions
|
||||
$disabled_extension_meta_data[$name]['S_VERSIONCHECK'] = true;
|
||||
$disabled_extension_meta_data[$name]['U_VERSIONCHECK_FORCE'] = $this->u_action . '&action=details&versioncheck_force=1&ext_name=' . urlencode($md_manager->get_metadata('name'));
|
||||
}
|
||||
catch(\phpbb\extension\exception $e)
|
||||
catch (\phpbb\extension\exception $e)
|
||||
{
|
||||
$this->template->assign_block_vars('disabled', array(
|
||||
'META_DISPLAY_NAME' => $this->user->lang('EXTENSION_INVALID_LIST', $name, $e),
|
||||
@@ -467,7 +467,7 @@ class acp_extensions
|
||||
$available_extension_meta_data[$name]['S_VERSIONCHECK'] = true;
|
||||
$available_extension_meta_data[$name]['U_VERSIONCHECK_FORCE'] = $this->u_action . '&action=details&versioncheck_force=1&ext_name=' . urlencode($md_manager->get_metadata('name'));
|
||||
}
|
||||
catch(\phpbb\extension\exception $e)
|
||||
catch (\phpbb\extension\exception $e)
|
||||
{
|
||||
$this->template->assign_block_vars('disabled', array(
|
||||
'META_DISPLAY_NAME' => $this->user->lang('EXTENSION_INVALID_LIST', $name, $e),
|
||||
|
@@ -1786,7 +1786,7 @@ class acp_forums
|
||||
*/
|
||||
function delete_forum_content($forum_id)
|
||||
{
|
||||
global $db, $config, $phpbb_root_path, $phpEx;
|
||||
global $db, $config, $phpbb_root_path, $phpEx, $phpbb_dispatcher;
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
|
||||
|
||||
@@ -1918,6 +1918,24 @@ class acp_forums
|
||||
|
||||
$table_ary = array(FORUMS_ACCESS_TABLE, FORUMS_TRACK_TABLE, FORUMS_WATCH_TABLE, LOG_TABLE, MODERATOR_CACHE_TABLE, POSTS_TABLE, TOPICS_TABLE, TOPICS_TRACK_TABLE);
|
||||
|
||||
/**
|
||||
* Perform additional actions before forum content deletion
|
||||
*
|
||||
* @event core.delete_forum_content_before_query
|
||||
* @var array table_ary Array of tables from which all rows will be deleted that hold the forum_id
|
||||
* @var int forum_id the forum id
|
||||
* @var array topic_ids Array of the topic ids from the forum to be deleted
|
||||
* @var array post_counts Array of counts of posts in the forum, by poster_id
|
||||
* @since 3.1.6-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'table_ary',
|
||||
'forum_id',
|
||||
'topic_ids',
|
||||
'post_counts',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.delete_forum_content_before_query', compact($vars)));
|
||||
|
||||
foreach ($table_ary as $table)
|
||||
{
|
||||
$db->sql_query("DELETE FROM $table WHERE forum_id = $forum_id");
|
||||
|
@@ -107,7 +107,10 @@ class acp_jabber
|
||||
set_config('jab_host', $jab_host);
|
||||
set_config('jab_port', $jab_port);
|
||||
set_config('jab_username', $jab_username);
|
||||
set_config('jab_password', $jab_password);
|
||||
if ($jab_password !== '********')
|
||||
{
|
||||
set_config('jab_password', $jab_password);
|
||||
}
|
||||
set_config('jab_package_size', $jab_package_size);
|
||||
set_config('jab_use_ssl', $jab_use_ssl);
|
||||
|
||||
@@ -122,7 +125,7 @@ class acp_jabber
|
||||
'JAB_HOST' => $jab_host,
|
||||
'JAB_PORT' => ($jab_port) ? $jab_port : '',
|
||||
'JAB_USERNAME' => $jab_username,
|
||||
'JAB_PASSWORD' => $jab_password,
|
||||
'JAB_PASSWORD' => $jab_password !== '' ? '********' : '',
|
||||
'JAB_PACKAGE_SIZE' => $jab_package_size,
|
||||
'JAB_USE_SSL' => $jab_use_ssl,
|
||||
'S_CAN_USE_SSL' => jabber::can_use_ssl(),
|
||||
|
@@ -632,7 +632,7 @@ class acp_main
|
||||
{
|
||||
$error = false;
|
||||
$search_type = $config['search_type'];
|
||||
$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user);
|
||||
$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
|
||||
|
||||
if (!$search->index_created())
|
||||
{
|
||||
|
@@ -31,7 +31,7 @@ class acp_profile
|
||||
{
|
||||
global $config, $db, $user, $auth, $template, $cache;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
|
||||
global $request, $phpbb_container;
|
||||
global $request, $phpbb_container, $phpbb_dispatcher;
|
||||
|
||||
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
|
||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||
@@ -369,6 +369,32 @@ class acp_profile
|
||||
'field_is_contact',
|
||||
);
|
||||
|
||||
/**
|
||||
* Event to add initialization for new profile field table fields
|
||||
*
|
||||
* @event core.acp_profile_create_edit_init
|
||||
* @var string action create|edit
|
||||
* @var int step Configuration step (1|2|3)
|
||||
* @var bool submit Form has been submitted
|
||||
* @var bool save Configuration should be saved
|
||||
* @var string field_type Type of the field we are dealing with
|
||||
* @var array field_row Array of data about the field
|
||||
* @var array exclude Array of excluded fields by step
|
||||
* @var array visibility_ary Array of fields that are visibility related
|
||||
* @since 3.1.6-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'action',
|
||||
'step',
|
||||
'submit',
|
||||
'save',
|
||||
'field_type',
|
||||
'field_row',
|
||||
'exclude',
|
||||
'visibility_ary',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.acp_profile_create_edit_init', compact($vars)));
|
||||
|
||||
$options = $profile_field->prepare_options_form($exclude, $visibility_ary);
|
||||
|
||||
$cp->vars['field_ident'] = ($action == 'create' && $step == 1) ? utf8_clean_string(request_var('field_ident', $field_row['field_ident'], true)) : request_var('field_ident', $field_row['field_ident']);
|
||||
@@ -644,6 +670,33 @@ class acp_profile
|
||||
break;
|
||||
}
|
||||
|
||||
$field_data = $cp->vars;
|
||||
/**
|
||||
* Event to add template variables for new profile field table fields
|
||||
*
|
||||
* @event core.acp_profile_create_edit_after
|
||||
* @var string action create|edit
|
||||
* @var int step Configuration step (1|2|3)
|
||||
* @var bool submit Form has been submitted
|
||||
* @var bool save Configuration should be saved
|
||||
* @var string field_type Type of the field we are dealing with
|
||||
* @var array field_data Array of data about the field
|
||||
* @var array s_hidden_fields Array of hidden fields in case this needs modification
|
||||
* @var array options Array of options specific to this step
|
||||
* @since 3.1.6-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'action',
|
||||
'step',
|
||||
'submit',
|
||||
'save',
|
||||
'field_type',
|
||||
'field_data',
|
||||
's_hidden_fields',
|
||||
'options',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.acp_profile_create_edit_after', compact($vars)));
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_HIDDEN_FIELDS' => $s_hidden_fields)
|
||||
);
|
||||
@@ -810,7 +863,7 @@ class acp_profile
|
||||
*/
|
||||
function save_profile_field(&$cp, $field_type, $action = 'create')
|
||||
{
|
||||
global $db, $config, $user, $phpbb_container;
|
||||
global $db, $config, $user, $phpbb_container, $phpbb_dispatcher;
|
||||
|
||||
$field_id = request_var('field_id', 0);
|
||||
|
||||
@@ -852,6 +905,25 @@ class acp_profile
|
||||
'field_contact_url' => $cp->vars['field_contact_url'],
|
||||
);
|
||||
|
||||
$field_data = $cp->vars;
|
||||
/**
|
||||
* Event to modify profile field configuration data before saving to database
|
||||
*
|
||||
* @event core.acp_profile_create_edit_save_before
|
||||
* @var string action create|edit
|
||||
* @var string field_type Type of the field we are dealing with
|
||||
* @var array field_data Array of data about the field
|
||||
* @var array profile_fields Array of fields to be sent to the database
|
||||
* @since 3.1.6-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'action',
|
||||
'field_type',
|
||||
'field_data',
|
||||
'profile_fields',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.acp_profile_create_edit_save_before', compact($vars)));
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
$profile_fields += array(
|
||||
|
@@ -506,9 +506,9 @@ class acp_prune
|
||||
WHERE ug.group_id = ' . (int) $group_id . '
|
||||
AND ug.user_id <> ' . ANONYMOUS . '
|
||||
AND u.user_type <> ' . USER_FOUNDER . '
|
||||
AND ug.user_pending = 0 ' .
|
||||
((!empty($user_ids)) ? ' AND ' . $db->sql_in_set('ug.user_id', $user_ids) : '') . '
|
||||
AND u.user_id = ug.user_id';
|
||||
AND ug.user_pending = 0
|
||||
AND u.user_id = ug.user_id
|
||||
' . (!empty($user_ids) ? ' AND ' . $db->sql_in_set('ug.user_id', $user_ids) : '');
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
// we're performing an intersection operation, so all the relevant users
|
||||
@@ -532,10 +532,10 @@ class acp_prune
|
||||
$sql = 'SELECT u.user_id, u.username, COUNT(p.post_id) AS queue_posts
|
||||
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
|
||||
WHERE u.user_id <> ' . ANONYMOUS . '
|
||||
AND u.user_type <> ' . USER_FOUNDER .
|
||||
((!empty($user_ids)) ? ' AND ' . $db->sql_in_set('p.poster_id', $user_ids) : '') . '
|
||||
AND u.user_type <> ' . USER_FOUNDER . '
|
||||
AND ' . $db->sql_in_set('p.post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE)) . '
|
||||
AND u.user_id = p.poster_id
|
||||
' . (!empty($user_ids) ? ' AND ' . $db->sql_in_set('p.poster_id', $user_ids) : '') . '
|
||||
GROUP BY p.poster_id
|
||||
HAVING queue_posts ' . $key_match[$queue_select] . ' ' . $posts_on_queue;
|
||||
$result = $db->sql_query($sql);
|
||||
|
@@ -598,7 +598,7 @@ class acp_search
|
||||
*/
|
||||
function init_search($type, &$search, &$error)
|
||||
{
|
||||
global $phpbb_root_path, $phpEx, $user, $auth, $config, $db;
|
||||
global $phpbb_root_path, $phpEx, $user, $auth, $config, $db, $phpbb_dispatcher;
|
||||
|
||||
if (!class_exists($type) || !method_exists($type, 'keyword_search'))
|
||||
{
|
||||
@@ -607,7 +607,7 @@ class acp_search
|
||||
}
|
||||
|
||||
$error = false;
|
||||
$search = new $type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user);
|
||||
$search = new $type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
|
||||
|
||||
return $error;
|
||||
}
|
||||
|
@@ -995,7 +995,7 @@ class acp_styles
|
||||
|
||||
// Assign template variables
|
||||
$this->template->assign_block_vars('styles_list', $row);
|
||||
foreach($actions as $action)
|
||||
foreach ($actions as $action)
|
||||
{
|
||||
$this->template->assign_block_vars('styles_list.actions', $action);
|
||||
}
|
||||
|
@@ -182,6 +182,8 @@ class bbcode
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
// To perform custom second pass in extension, use $this->bbcode_second_pass_by_extension()
|
||||
// method which accepts variable number of parameters
|
||||
foreach ($bbcode_ids as $bbcode_id)
|
||||
{
|
||||
switch ($bbcode_id)
|
||||
@@ -613,4 +615,36 @@ class bbcode
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to perform custom bbcode second pass by extensions
|
||||
* can be used to assign bbcode pattern replacement
|
||||
* Example: '#\[list=([^\[]+):$uid\]#e' => "\$this->bbcode_second_pass_by_extension('\$1')"
|
||||
*
|
||||
* Accepts variable number of parameters
|
||||
*
|
||||
* @return mixed Second pass result
|
||||
*/
|
||||
function bbcode_second_pass_by_extension()
|
||||
{
|
||||
global $phpbb_dispatcher;
|
||||
|
||||
$return = false;
|
||||
$params_array = func_get_args();
|
||||
|
||||
/**
|
||||
* Event to perform bbcode second pass with
|
||||
* the custom validating methods provided by extensions
|
||||
*
|
||||
* @event core.bbcode_second_pass_by_extension
|
||||
* @var array params_array Array with the function parameters
|
||||
* @var mixed return Second pass result to return
|
||||
*
|
||||
* @since 3.1.5-RC1
|
||||
*/
|
||||
$vars = array('params_array', 'return');
|
||||
extract($phpbb_dispatcher->trigger_event('core.bbcode_second_pass_by_extension', compact($vars)));
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@ if (!defined('IN_PHPBB'))
|
||||
*/
|
||||
|
||||
// phpBB Version
|
||||
define('PHPBB_VERSION', '3.1.4');
|
||||
define('PHPBB_VERSION', '3.1.6-RC1');
|
||||
|
||||
// QA-related
|
||||
// define('PHPBB_QA', 1);
|
||||
|
@@ -1159,7 +1159,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
|
||||
/**
|
||||
* This event is used for performing actions directly before marking forums,
|
||||
* topics or posts as read.
|
||||
*
|
||||
*
|
||||
* It is also possible to prevent the marking. For that, the $should_markread parameter
|
||||
* should be set to FALSE.
|
||||
*
|
||||
@@ -1258,6 +1258,10 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
|
||||
{
|
||||
$forum_id = array($forum_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$forum_id = array_unique($forum_id);
|
||||
}
|
||||
|
||||
$phpbb_notifications = $phpbb_container->get('notification_manager');
|
||||
|
||||
@@ -2389,7 +2393,7 @@ function redirect($url, $return = false, $disable_cd_check = false)
|
||||
}
|
||||
|
||||
// Redirect via an HTML form for PITA webservers
|
||||
if (@preg_match('#Microsoft|WebSTAR|Xitami#', getenv('SERVER_SOFTWARE')))
|
||||
if (@preg_match('#WebSTAR|Xitami#', getenv('SERVER_SOFTWARE')))
|
||||
{
|
||||
header('Refresh: 0; URL=' . $url);
|
||||
|
||||
@@ -4779,13 +4783,14 @@ function phpbb_build_hidden_fields_for_query_params($request, $exclude = null)
|
||||
* @param array $user_row Row from the users table
|
||||
* @param string $alt Optional language string for alt tag within image, can be a language key or text
|
||||
* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP
|
||||
* @param bool $lazy If true, will be lazy loaded (requires JS)
|
||||
*
|
||||
* @return string Avatar html
|
||||
*/
|
||||
function phpbb_get_user_avatar($user_row, $alt = 'USER_AVATAR', $ignore_config = false)
|
||||
function phpbb_get_user_avatar($user_row, $alt = 'USER_AVATAR', $ignore_config = false, $lazy = false)
|
||||
{
|
||||
$row = \phpbb\avatar\manager::clean_row($user_row, 'user');
|
||||
return phpbb_get_avatar($row, $alt, $ignore_config);
|
||||
return phpbb_get_avatar($row, $alt, $ignore_config, $lazy);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4794,13 +4799,14 @@ function phpbb_get_user_avatar($user_row, $alt = 'USER_AVATAR', $ignore_config =
|
||||
* @param array $group_row Row from the groups table
|
||||
* @param string $alt Optional language string for alt tag within image, can be a language key or text
|
||||
* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP
|
||||
* @param bool $lazy If true, will be lazy loaded (requires JS)
|
||||
*
|
||||
* @return string Avatar html
|
||||
*/
|
||||
function phpbb_get_group_avatar($user_row, $alt = 'GROUP_AVATAR', $ignore_config = false)
|
||||
function phpbb_get_group_avatar($user_row, $alt = 'GROUP_AVATAR', $ignore_config = false, $lazy = false)
|
||||
{
|
||||
$row = \phpbb\avatar\manager::clean_row($user_row, 'group');
|
||||
return phpbb_get_avatar($row, $alt, $ignore_config);
|
||||
return phpbb_get_avatar($row, $alt, $ignore_config, $lazy);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4809,14 +4815,15 @@ function phpbb_get_group_avatar($user_row, $alt = 'GROUP_AVATAR', $ignore_config
|
||||
* @param array $row Row cleaned by \phpbb\avatar\manager::clean_row
|
||||
* @param string $alt Optional language string for alt tag within image, can be a language key or text
|
||||
* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP
|
||||
* @param bool $lazy If true, will be lazy loaded (requires JS)
|
||||
*
|
||||
* @return string Avatar html
|
||||
*/
|
||||
function phpbb_get_avatar($row, $alt, $ignore_config = false)
|
||||
function phpbb_get_avatar($row, $alt, $ignore_config = false, $lazy = false)
|
||||
{
|
||||
global $user, $config, $cache, $phpbb_root_path, $phpEx;
|
||||
global $request;
|
||||
global $phpbb_container;
|
||||
global $phpbb_container, $phpbb_dispatcher;
|
||||
|
||||
if (!$config['allow_avatar'] && !$ignore_config)
|
||||
{
|
||||
@@ -4850,12 +4857,47 @@ function phpbb_get_avatar($row, $alt, $ignore_config = false)
|
||||
|
||||
if (!empty($avatar_data['src']))
|
||||
{
|
||||
$html = '<img src="' . $avatar_data['src'] . '" ' .
|
||||
if ($lazy)
|
||||
{
|
||||
// Determine board url - we may need it later
|
||||
$board_url = generate_board_url() . '/';
|
||||
// This path is sent with the base template paths in the assign_vars()
|
||||
// call below. We need to correct it in case we are accessing from a
|
||||
// controller because the web paths will be incorrect otherwise.
|
||||
$phpbb_path_helper = $phpbb_container->get('path_helper');
|
||||
$corrected_path = $phpbb_path_helper->get_web_root_path();
|
||||
|
||||
$web_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? $board_url : $corrected_path;
|
||||
|
||||
$theme = "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme';
|
||||
|
||||
$src = 'src="' . $theme . '/images/no_avatar.gif" data-src="' . $avatar_data['src'] . '"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$src = 'src="' . $avatar_data['src'] . '"';
|
||||
}
|
||||
|
||||
$html = '<img class="avatar" ' . $src . ' ' .
|
||||
($avatar_data['width'] ? ('width="' . $avatar_data['width'] . '" ') : '') .
|
||||
($avatar_data['height'] ? ('height="' . $avatar_data['height'] . '" ') : '') .
|
||||
'alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
|
||||
}
|
||||
|
||||
/**
|
||||
* Event to modify HTML <img> tag of avatar
|
||||
*
|
||||
* @event core.get_avatar_after
|
||||
* @var array row Row cleaned by \phpbb\avatar\manager::clean_row
|
||||
* @var string alt Optional language string for alt tag within image, can be a language key or text
|
||||
* @var bool ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP
|
||||
* @var array avatar_data The HTML attributes for avatar <img> tag
|
||||
* @var string html The HTML <img> tag of generated avatar
|
||||
* @since 3.1.6-RC1
|
||||
*/
|
||||
$vars = array('row', 'alt', 'ignore_config', 'avatar_data', 'html');
|
||||
extract($phpbb_dispatcher->trigger_event('core.get_avatar_after', compact($vars)));
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
@@ -245,8 +245,13 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
|
||||
|
||||
switch ($tpl_type[0])
|
||||
{
|
||||
case 'text':
|
||||
case 'password':
|
||||
if ($new[$config_key] !== '')
|
||||
{
|
||||
// replace passwords with asterixes
|
||||
$new[$config_key] = '********';
|
||||
}
|
||||
case 'text':
|
||||
case 'url':
|
||||
case 'email':
|
||||
case 'color':
|
||||
|
@@ -500,7 +500,7 @@ function filelist($rootdir, $dir = '', $type = 'gif|jpg|jpeg|png')
|
||||
*/
|
||||
function move_topics($topic_ids, $forum_id, $auto_sync = true)
|
||||
{
|
||||
global $db;
|
||||
global $db, $phpbb_dispatcher;
|
||||
|
||||
if (empty($topic_ids))
|
||||
{
|
||||
@@ -534,6 +534,27 @@ function move_topics($topic_ids, $forum_id, $auto_sync = true)
|
||||
}
|
||||
|
||||
$table_ary = array(TOPICS_TABLE, POSTS_TABLE, LOG_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE);
|
||||
|
||||
/**
|
||||
* Perform additional actions before topics move
|
||||
*
|
||||
* @event core.move_topics_before_query
|
||||
* @var array table_ary Array of tables from which forum_id will be updated for all rows that hold the moved topics
|
||||
* @var array topic_ids Array of the moved topic ids
|
||||
* @var string forum_id The forum id from where the topics are moved
|
||||
* @var array forum_ids Array of the forums where the topics are moving (includes also forum_id)
|
||||
* @var bool auto_sync Whether or not to perform auto sync
|
||||
* @since 3.1.5-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'table_ary',
|
||||
'topic_ids',
|
||||
'forum_id',
|
||||
'forum_ids',
|
||||
'auto_sync',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.move_topics_before_query', compact($vars)));
|
||||
|
||||
foreach ($table_ary as $table)
|
||||
{
|
||||
$sql = "UPDATE $table
|
||||
@@ -920,7 +941,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
|
||||
}
|
||||
|
||||
$error = false;
|
||||
$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user);
|
||||
$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
|
||||
|
||||
if ($error)
|
||||
{
|
||||
|
@@ -30,10 +30,11 @@ if (!defined('IN_PHPBB'))
|
||||
* @param string $avatar_height Height of users avatar
|
||||
* @param string $alt Optional language string for alt tag within image, can be a language key or text
|
||||
* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP
|
||||
* @param bool $lazy If true, will be lazy loaded (requires JS)
|
||||
*
|
||||
* @return string Avatar image
|
||||
*/
|
||||
function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR', $ignore_config = false)
|
||||
function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR', $ignore_config = false, $lazy = false)
|
||||
{
|
||||
// map arguments to new function phpbb_get_avatar()
|
||||
$row = array(
|
||||
@@ -43,7 +44,7 @@ function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $
|
||||
'avatar_height' => $avatar_height,
|
||||
);
|
||||
|
||||
return phpbb_get_avatar($row, $alt, $ignore_config);
|
||||
return phpbb_get_avatar($row, $alt, $ignore_config, $lazy);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -966,7 +966,7 @@ function get_remote_avatar_dim($src, $axis)
|
||||
$protocol = (isset($url_info['scheme'])) ? $url_info['scheme'] : 'http';
|
||||
if (empty($port))
|
||||
{
|
||||
switch(strtolower($protocol))
|
||||
switch (strtolower($protocol))
|
||||
{
|
||||
case 'ftp':
|
||||
$port = 21;
|
||||
|
@@ -150,7 +150,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||
$sql = $db->sql_build_query('SELECT', $sql_ary);
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$forum_tracking_info = array();
|
||||
$forum_tracking_info = $valid_categories = array();
|
||||
$branch_root_id = $root_data['forum_id'];
|
||||
|
||||
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
|
||||
@@ -250,6 +250,12 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||
}
|
||||
}
|
||||
|
||||
// Fill list of categories with forums
|
||||
if (isset($forum_rows[$row['parent_id']]))
|
||||
{
|
||||
$valid_categories[$row['parent_id']] = true;
|
||||
}
|
||||
|
||||
//
|
||||
if ($row['parent_id'] == $root_data['forum_id'] || $row['parent_id'] == $branch_root_id)
|
||||
{
|
||||
@@ -267,6 +273,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||
$branch_root_id = $forum_id;
|
||||
}
|
||||
$forum_rows[$parent_id]['forum_id_last_post'] = $row['forum_id'];
|
||||
$forum_rows[$parent_id]['forum_password_last_post'] = $row['forum_password'];
|
||||
$forum_rows[$parent_id]['orig_forum_last_post_time'] = $row['forum_last_post_time'];
|
||||
}
|
||||
else if ($row['forum_type'] != FORUM_CAT)
|
||||
@@ -308,6 +315,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||
$forum_rows[$parent_id]['forum_last_poster_name'] = $row['forum_last_poster_name'];
|
||||
$forum_rows[$parent_id]['forum_last_poster_colour'] = $row['forum_last_poster_colour'];
|
||||
$forum_rows[$parent_id]['forum_id_last_post'] = $forum_id;
|
||||
$forum_rows[$parent_id]['forum_password_last_post'] = $row['forum_password'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -404,6 +412,12 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||
// Category
|
||||
if ($row['parent_id'] == $root_data['forum_id'] && $row['forum_type'] == FORUM_CAT)
|
||||
{
|
||||
// Do not display categories without any forums to display
|
||||
if (!isset($valid_categories[$row['forum_id']]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$cat_row = array(
|
||||
'S_IS_CAT' => true,
|
||||
'FORUM_ID' => $row['forum_id'],
|
||||
@@ -522,8 +536,15 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||
// Create last post link information, if appropriate
|
||||
if ($row['forum_last_post_id'])
|
||||
{
|
||||
$last_post_subject = $row['forum_last_post_subject'];
|
||||
$last_post_subject_truncated = truncate_string(censor_text($last_post_subject), 30, 255, false, $user->lang['ELLIPSIS']);
|
||||
if ($row['forum_password_last_post'] === '' && $auth->acl_get('f_read', $row['forum_id_last_post']))
|
||||
{
|
||||
$last_post_subject = censor_text($row['forum_last_post_subject']);
|
||||
$last_post_subject_truncated = truncate_string($last_post_subject, 30, 255, false, $user->lang['ELLIPSIS']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$last_post_subject = $last_post_subject_truncated = '';
|
||||
}
|
||||
$last_post_time = $user->format_date($row['forum_last_post_time']);
|
||||
$last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
|
||||
}
|
||||
@@ -583,7 +604,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||
'S_LOCKED_FORUM' => ($row['forum_status'] == ITEM_LOCKED) ? true : false,
|
||||
'S_LIST_SUBFORUMS' => ($row['display_subforum_list']) ? true : false,
|
||||
'S_SUBFORUMS' => (sizeof($subforums_list)) ? true : false,
|
||||
'S_DISPLAY_SUBJECT' => ($last_post_subject && $config['display_last_subject'] && !$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id'])) ? true : false,
|
||||
'S_DISPLAY_SUBJECT' => ($last_post_subject !== '' && $config['display_last_subject']) ? true : false,
|
||||
'S_FEED_ENABLED' => ($config['feed_forum'] && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $row['forum_options']) && $row['forum_type'] == FORUM_POST) ? true : false,
|
||||
|
||||
'FORUM_ID' => $row['forum_id'],
|
||||
@@ -596,8 +617,8 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||
'FORUM_FOLDER_IMG_ALT' => isset($user->lang[$folder_alt]) ? $user->lang[$folder_alt] : '',
|
||||
'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '',
|
||||
'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
|
||||
'LAST_POST_SUBJECT' => (!$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id'])) ? censor_text($last_post_subject) : "",
|
||||
'LAST_POST_SUBJECT_TRUNCATED' => (!$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id'])) ? $last_post_subject_truncated : "",
|
||||
'LAST_POST_SUBJECT' => $last_post_subject,
|
||||
'LAST_POST_SUBJECT_TRUNCATED' => $last_post_subject_truncated,
|
||||
'LAST_POST_TIME' => $last_post_time,
|
||||
'LAST_POSTER' => get_username_string('username', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
|
||||
'LAST_POSTER_COLOUR' => get_username_string('colour', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
|
||||
@@ -732,13 +753,15 @@ function generate_forum_rules(&$forum_data)
|
||||
function generate_forum_nav(&$forum_data)
|
||||
{
|
||||
global $db, $user, $template, $auth, $config;
|
||||
global $phpEx, $phpbb_root_path;
|
||||
global $phpEx, $phpbb_root_path, $phpbb_dispatcher;
|
||||
|
||||
if (!$auth->acl_get('f_list', $forum_data['forum_id']))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$navlinks = $navlinks_parents = $forum_template_data = array();
|
||||
|
||||
// Get forum parents
|
||||
$forum_parents = get_forum_parents($forum_data);
|
||||
|
||||
@@ -757,35 +780,59 @@ function generate_forum_nav(&$forum_data)
|
||||
continue;
|
||||
}
|
||||
|
||||
$template->assign_block_vars('navlinks', array(
|
||||
$navlinks_parents[] = array(
|
||||
'S_IS_CAT' => ($parent_type == FORUM_CAT) ? true : false,
|
||||
'S_IS_LINK' => ($parent_type == FORUM_LINK) ? true : false,
|
||||
'S_IS_POST' => ($parent_type == FORUM_POST) ? true : false,
|
||||
'FORUM_NAME' => $parent_name,
|
||||
'FORUM_ID' => $parent_forum_id,
|
||||
'MICRODATA' => $microdata_attr . '="' . $parent_forum_id . '"',
|
||||
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $parent_forum_id))
|
||||
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $parent_forum_id),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign_block_vars('navlinks', array(
|
||||
$navlinks = array(
|
||||
'S_IS_CAT' => ($forum_data['forum_type'] == FORUM_CAT) ? true : false,
|
||||
'S_IS_LINK' => ($forum_data['forum_type'] == FORUM_LINK) ? true : false,
|
||||
'S_IS_POST' => ($forum_data['forum_type'] == FORUM_POST) ? true : false,
|
||||
'FORUM_NAME' => $forum_data['forum_name'],
|
||||
'FORUM_ID' => $forum_data['forum_id'],
|
||||
'MICRODATA' => $microdata_attr . '="' . $forum_data['forum_id'] . '"',
|
||||
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_data['forum_id']))
|
||||
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_data['forum_id']),
|
||||
);
|
||||
|
||||
$template->assign_vars(array(
|
||||
$forum_template_data = array(
|
||||
'FORUM_ID' => $forum_data['forum_id'],
|
||||
'FORUM_NAME' => $forum_data['forum_name'],
|
||||
'FORUM_DESC' => generate_text_for_display($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options']),
|
||||
|
||||
'S_ENABLE_FEEDS_FORUM' => ($config['feed_forum'] && $forum_data['forum_type'] == FORUM_POST && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $forum_data['forum_options'])) ? true : false,
|
||||
));
|
||||
);
|
||||
|
||||
/**
|
||||
* Event to modify the navlinks text
|
||||
*
|
||||
* @event core.generate_forum_nav
|
||||
* @var array forum_data Array with the forum data
|
||||
* @var array forum_template_data Array with generic forum template data
|
||||
* @var string microdata_attr The microdata attribute
|
||||
* @var array navlinks_parents Array with the forum parents navlinks data
|
||||
* @var array navlinks Array with the forum navlinks data
|
||||
* @since 3.1.5-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'forum_data',
|
||||
'forum_template_data',
|
||||
'microdata_attr',
|
||||
'navlinks_parents',
|
||||
'navlinks',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.generate_forum_nav', compact($vars)));
|
||||
|
||||
$template->assign_block_vars_array('navlinks', $navlinks_parents);
|
||||
$template->assign_block_vars('navlinks', $navlinks);
|
||||
$template->assign_vars($forum_template_data);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@@ -976,7 +976,7 @@ class p_master
|
||||
*
|
||||
* @param string $class module class (acp/mcp/ucp)
|
||||
* @param string $name module name (class name of the module, or its basename
|
||||
* phpbb_ext_foo_acp_bar_module, ucp_zebra or zebra)
|
||||
* phpbb_ext_foo_acp_bar_module, ucp_zebra or zebra)
|
||||
* @param string $mode mode, as passed through to the module
|
||||
*
|
||||
*/
|
||||
@@ -1086,7 +1086,7 @@ class p_master
|
||||
->core_path('language/' . $user->lang_name . '/mods/')
|
||||
->find();
|
||||
|
||||
$lang_files = array_unique(array_merge($user_lang_files, $english_lang_files, $default_lang_files));
|
||||
$lang_files = array_merge($english_lang_files, $default_lang_files, $user_lang_files);
|
||||
foreach ($lang_files as $lang_file => $ext_name)
|
||||
{
|
||||
$user->add_lang_ext($ext_name, $lang_file);
|
||||
|
@@ -1542,7 +1542,14 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
return false;
|
||||
}
|
||||
|
||||
$current_time = time();
|
||||
if (!empty($data['post_time']))
|
||||
{
|
||||
$current_time = $data['post_time'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$current_time = time();
|
||||
}
|
||||
|
||||
if ($mode == 'post')
|
||||
{
|
||||
@@ -1738,6 +1745,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
'topic_type' => $topic_type,
|
||||
'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0,
|
||||
'topic_attachment' => (!empty($data['attachment_data'])) ? 1 : 0,
|
||||
'topic_status' => (isset($data['topic_status'])) ? $data['topic_status'] : ITEM_UNLOCKED,
|
||||
);
|
||||
|
||||
if (isset($poll['poll_options']) && !empty($poll['poll_options']))
|
||||
@@ -2209,7 +2217,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
}
|
||||
|
||||
$error = false;
|
||||
$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user);
|
||||
$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
|
||||
|
||||
if ($error)
|
||||
{
|
||||
|
@@ -213,6 +213,8 @@ class filespec
|
||||
*/
|
||||
static public function get_extension($filename)
|
||||
{
|
||||
$filename = utf8_basename($filename);
|
||||
|
||||
if (strpos($filename, '.') === false)
|
||||
{
|
||||
return '';
|
||||
|
@@ -500,6 +500,9 @@ function user_delete($mode, $user_ids, $retain_username = true)
|
||||
|
||||
$num_users_delta = 0;
|
||||
|
||||
// Get auth provider collection in case accounts might need to be unlinked
|
||||
$provider_collection = $phpbb_container->get('auth.provider_collection');
|
||||
|
||||
// Some things need to be done in the loop (if the query changes based
|
||||
// on which user is currently being deleted)
|
||||
$added_guest_posts = 0;
|
||||
@@ -510,6 +513,38 @@ function user_delete($mode, $user_ids, $retain_username = true)
|
||||
avatar_delete('user', $user_row);
|
||||
}
|
||||
|
||||
// Unlink accounts
|
||||
foreach ($provider_collection as $provider_name => $auth_provider)
|
||||
{
|
||||
$provider_data = $auth_provider->get_auth_link_data($user_id);
|
||||
|
||||
if ($provider_data !== null)
|
||||
{
|
||||
$link_data = array(
|
||||
'user_id' => $user_id,
|
||||
'link_method' => 'user_delete',
|
||||
);
|
||||
|
||||
// BLOCK_VARS might contain hidden fields necessary for unlinking accounts
|
||||
if (isset($provider_data['BLOCK_VARS']) && is_array($provider_data['BLOCK_VARS']))
|
||||
{
|
||||
foreach ($provider_data['BLOCK_VARS'] as $provider_service)
|
||||
{
|
||||
if (!array_key_exists('HIDDEN_FIELDS', $provider_service))
|
||||
{
|
||||
$provider_service['HIDDEN_FIELDS'] = array();
|
||||
}
|
||||
|
||||
$auth_provider->unlink_account(array_merge($link_data, $provider_service['HIDDEN_FIELDS']));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$auth_provider->unlink_account($link_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Decrement number of users if this user is active
|
||||
if ($user_row['user_type'] != USER_INACTIVE && $user_row['user_type'] != USER_IGNORE)
|
||||
{
|
||||
@@ -1367,7 +1402,7 @@ function user_ipwhois($ip)
|
||||
$match = array();
|
||||
|
||||
// Test for referrals from $whois_host to other whois databases, roll on rwhois
|
||||
if (preg_match('#ReferralServer: whois://(.+)#im', $ipwhois, $match))
|
||||
if (preg_match('#ReferralServer:[\x20]*whois://(.+)#im', $ipwhois, $match))
|
||||
{
|
||||
if (strpos($match[1], ':') !== false)
|
||||
{
|
||||
|
@@ -77,6 +77,30 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
|
||||
break;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get some data in order to execute other actions.
|
||||
*
|
||||
* @event core.mcp_forum_view_before
|
||||
* @var string action The action
|
||||
* @var array forum_info Array with forum infos
|
||||
* @var int start Start value
|
||||
* @var array topic_id_list Array of topics ids
|
||||
* @var array post_id_list Array of posts ids
|
||||
* @var array source_topic_ids Array of source topics ids
|
||||
* @var int to_topic_id Array of destination topics ids
|
||||
* @since 3.1.6-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'action',
|
||||
'forum_info',
|
||||
'start',
|
||||
'topic_id_list',
|
||||
'post_id_list',
|
||||
'source_topic_ids',
|
||||
'to_topic_id',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.mcp_forum_view_before', compact($vars)));
|
||||
|
||||
$pagination = $phpbb_container->get('pagination');
|
||||
|
||||
$selected_ids = '';
|
||||
|
@@ -41,10 +41,27 @@ function mcp_front_view($id, $mode, $action)
|
||||
|
||||
if (!empty($forum_list))
|
||||
{
|
||||
$sql = 'SELECT COUNT(post_id) AS total
|
||||
FROM ' . POSTS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('forum_id', $forum_list) . '
|
||||
AND ' . $db->sql_in_set('post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE));
|
||||
$sql_ary = array(
|
||||
'SELECT' => 'COUNT(post_id) AS total',
|
||||
'FROM' => array(
|
||||
POSTS_TABLE => 'p',
|
||||
),
|
||||
'WHERE' => $db->sql_in_set('p.forum_id', $forum_list) . '
|
||||
AND ' . $db->sql_in_set('p.post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE))
|
||||
);
|
||||
|
||||
/**
|
||||
* Allow altering the query to get the number of unapproved posts
|
||||
*
|
||||
* @event core.mcp_front_queue_unapproved_total_before
|
||||
* @var int sql_ary Query to get the total number of unapproved posts
|
||||
* @var array forum_list List of forums to look for unapproved posts
|
||||
* @since 3.1.5-RC1
|
||||
*/
|
||||
$vars = array('sql_ary', 'forum_list');
|
||||
extract($phpbb_dispatcher->trigger_event('core.mcp_front_queue_unapproved_total_before', compact($vars)));
|
||||
|
||||
$sql = $db->sql_build_query('SELECT', $sql_ary);
|
||||
$result = $db->sql_query($sql);
|
||||
$total = (int) $db->sql_fetchfield('total');
|
||||
$db->sql_freeresult($result);
|
||||
@@ -157,6 +174,18 @@ function mcp_front_view($id, $mode, $action)
|
||||
AND r.pm_id = 0
|
||||
AND r.report_closed = 0
|
||||
AND ' . $db->sql_in_set('p.forum_id', $forum_list);
|
||||
|
||||
/**
|
||||
* Alter sql query to count the number of reported posts
|
||||
*
|
||||
* @event core.mcp_front_reports_count_query_before
|
||||
* @var int sql The query string used to get the number of reports that exist
|
||||
* @var array forum_list List of forums that contain the posts
|
||||
* @since 3.1.5-RC1
|
||||
*/
|
||||
$vars = array('sql', 'forum_list');
|
||||
extract($phpbb_dispatcher->trigger_event('core.mcp_front_reports_count_query_before', compact($vars)));
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
$total = (int) $db->sql_fetchfield('total');
|
||||
$db->sql_freeresult($result);
|
||||
|
@@ -1144,7 +1144,7 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',
|
||||
function mcp_fork_topic($topic_ids)
|
||||
{
|
||||
global $auth, $user, $db, $template, $config;
|
||||
global $phpEx, $phpbb_root_path;
|
||||
global $phpEx, $phpbb_root_path, $phpbb_dispatcher;
|
||||
|
||||
if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_')))
|
||||
{
|
||||
@@ -1222,7 +1222,7 @@ function mcp_fork_topic($topic_ids)
|
||||
}
|
||||
|
||||
$error = false;
|
||||
$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user);
|
||||
$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
|
||||
$search_mode = 'post';
|
||||
|
||||
if ($error)
|
||||
|
@@ -26,6 +26,7 @@ function mcp_post_details($id, $mode, $action)
|
||||
{
|
||||
global $phpEx, $phpbb_root_path, $config;
|
||||
global $template, $db, $user, $auth, $cache;
|
||||
global $phpbb_dispatcher;
|
||||
|
||||
$user->add_lang('posting');
|
||||
|
||||
@@ -106,6 +107,21 @@ function mcp_post_details($id, $mode, $action)
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/**
|
||||
* This event allows you to handle custom post moderation options
|
||||
*
|
||||
* @event core.mcp_post_additional_options
|
||||
* @var string action Post moderation action name
|
||||
* @var array post_info Information on the affected post
|
||||
* @since 3.1.5-RC1
|
||||
*/
|
||||
$vars = array('action', 'post_info');
|
||||
extract($phpbb_dispatcher->trigger_event('core.mcp_post_additional_options', compact($vars)));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Set some vars
|
||||
@@ -197,7 +213,7 @@ function mcp_post_details($id, $mode, $action)
|
||||
$l_deleted_by = '';
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
$mcp_post_template_data = array(
|
||||
'U_MCP_ACTION' => "$url&i=main&quickmod=1&mode=post_details", // Use this for mode paramaters
|
||||
'U_POST_ACTION' => "$url&i=$id&mode=post_details", // Use this for action parameters
|
||||
'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p=$post_id&f={$post_info['forum_id']}"),
|
||||
@@ -249,7 +265,32 @@ function mcp_post_details($id, $mode, $action)
|
||||
|
||||
'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? "$url&i=$id&mode=$mode&lookup={$post_info['poster_ip']}#ip" : '',
|
||||
'U_WHOIS' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&mode=$mode&action=whois&p=$post_id&ip={$post_info['poster_ip']}") : '',
|
||||
));
|
||||
);
|
||||
|
||||
$s_additional_opts = false;
|
||||
|
||||
/**
|
||||
* Event to add/modify MCP post template data
|
||||
*
|
||||
* @event core.mcp_post_template_data
|
||||
* @var array post_info Array with the post information
|
||||
* @var array mcp_post_template_data Array with the MCP post template data
|
||||
* @var array attachments Array with the post attachments, if any
|
||||
* @var bool s_additional_opts Must be set to true in extension if additional options are presented in MCP post panel
|
||||
* @since 3.1.5-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'post_info',
|
||||
'mcp_post_template_data',
|
||||
'attachments',
|
||||
's_additional_opts',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.mcp_post_template_data', compact($vars)));
|
||||
|
||||
$template->assign_vars($mcp_post_template_data);
|
||||
$template->assign_var('S_MCP_POST_ADDITIONAL_OPTS', $s_additional_opts);
|
||||
|
||||
unset($mcp_post_template_data);
|
||||
|
||||
// Get User Notes
|
||||
$log_data = array();
|
||||
@@ -420,7 +461,7 @@ function mcp_post_details($id, $mode, $action)
|
||||
*/
|
||||
function change_poster(&$post_info, $userdata)
|
||||
{
|
||||
global $auth, $db, $config, $phpbb_root_path, $phpEx, $user;
|
||||
global $auth, $db, $config, $phpbb_root_path, $phpEx, $user, $phpbb_dispatcher;
|
||||
|
||||
if (empty($userdata) || $userdata['user_id'] == $post_info['user_id'])
|
||||
{
|
||||
@@ -497,7 +538,7 @@ function change_poster(&$post_info, $userdata)
|
||||
{
|
||||
// We do some additional checks in the module to ensure it can actually be utilised
|
||||
$error = false;
|
||||
$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user);
|
||||
$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
|
||||
|
||||
if (!$error && method_exists($search, 'destroy_cache'))
|
||||
{
|
||||
@@ -518,6 +559,17 @@ function change_poster(&$post_info, $userdata)
|
||||
|
||||
$post_info = $post_info[$post_id];
|
||||
|
||||
/**
|
||||
* This event allows you to perform additional tasks after changing a post's poster
|
||||
*
|
||||
* @event core.mcp_change_poster_after
|
||||
* @var array userdata Information on a post's new poster
|
||||
* @var array post_info Information on the affected post
|
||||
* @since 3.1.6-RC1
|
||||
*/
|
||||
$vars = array('userdata', 'post_info');
|
||||
extract($phpbb_dispatcher->trigger_event('core.mcp_change_poster_after', compact($vars)));
|
||||
|
||||
// Now add log entry
|
||||
add_log('mod', $post_info['forum_id'], $post_info['topic_id'], 'LOG_MCP_CHANGE_POSTER', $post_info['topic_title'], $from_username, $to_username);
|
||||
}
|
||||
|
@@ -404,7 +404,7 @@ class mcp_queue
|
||||
$forum_options = '<option value="0"' . (($forum_id == 0) ? ' selected="selected"' : '') . '>' . $user->lang['ALL_FORUMS'] . '</option>';
|
||||
foreach ($forum_list_approve as $row)
|
||||
{
|
||||
$forum_options .= '<option value="' . $row['forum_id'] . '"' . (($forum_id == $row['forum_id']) ? ' selected="selected"' : '') . '>' . str_repeat(' ', $row['padding']) . $row['forum_name'] . '</option>';
|
||||
$forum_options .= '<option value="' . $row['forum_id'] . '"' . (($forum_id == $row['forum_id']) ? ' selected="selected"' : '') . '>' . str_repeat(' ', $row['padding']) . truncate_string($row['forum_name'], 30, 255, false, $user->lang['ELLIPSIS']) . '</option>';
|
||||
}
|
||||
|
||||
$sort_days = $total = 0;
|
||||
|
@@ -73,18 +73,66 @@ class mcp_reports
|
||||
|
||||
// closed reports are accessed by report id
|
||||
$report_id = request_var('r', 0);
|
||||
$sql_ary = array(
|
||||
'SELECT' => 'r.post_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, r.reported_post_text, r.reported_post_uid, r.reported_post_bitfield, r.reported_post_enable_magic_url, r.reported_post_enable_smilies, r.reported_post_enable_bbcode, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour',
|
||||
|
||||
$sql = 'SELECT r.post_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, r.reported_post_text, r.reported_post_uid, r.reported_post_bitfield, r.reported_post_enable_magic_url, r.reported_post_enable_smilies, r.reported_post_enable_bbcode, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour
|
||||
FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . ' u
|
||||
WHERE ' . (($report_id) ? 'r.report_id = ' . $report_id : "r.post_id = $post_id") . '
|
||||
'FROM' => array(
|
||||
REPORTS_TABLE => 'r',
|
||||
REPORTS_REASONS_TABLE => 'rr',
|
||||
USERS_TABLE => 'u',
|
||||
),
|
||||
|
||||
'WHERE' => (($report_id) ? 'r.report_id = ' . $report_id : "r.post_id = $post_id") . '
|
||||
AND rr.reason_id = r.reason_id
|
||||
AND r.user_id = u.user_id
|
||||
AND r.pm_id = 0
|
||||
ORDER BY report_closed ASC';
|
||||
AND r.pm_id = 0',
|
||||
|
||||
'ORDER_BY' => 'report_closed ASC',
|
||||
);
|
||||
|
||||
/**
|
||||
* Allow changing the query to obtain the user-submitted report.
|
||||
*
|
||||
* @event core.mcp_reports_report_details_query_before
|
||||
* @var array sql_ary The array in the format of the query builder with the query
|
||||
* @var mixed forum_id The forum_id, the number in the f GET parameter
|
||||
* @var int post_id The post_id of the report being viewed (if 0, it is meaningless)
|
||||
* @var int report_id The report_id of the report being viewed
|
||||
* @since 3.1.5-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'sql_ary',
|
||||
'forum_id',
|
||||
'post_id',
|
||||
'report_id',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.mcp_reports_report_details_query_before', compact($vars)));
|
||||
|
||||
$sql = $db->sql_build_query('SELECT', $sql_ary);
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
$report = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
/**
|
||||
* Allow changing the data obtained from the user-submitted report.
|
||||
*
|
||||
* @event core.mcp_reports_report_details_query_after
|
||||
* @var array sql_ary The array in the format of the query builder with the query that had been executted
|
||||
* @var mixed forum_id The forum_id, the number in the f GET parameter
|
||||
* @var int post_id The post_id of the report being viewed (if 0, it is meaningless)
|
||||
* @var int report_id The report_id of the report being viewed
|
||||
* @var int report The query's resulting row.
|
||||
* @since 3.1.5-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'sql_ary',
|
||||
'forum_id',
|
||||
'post_id',
|
||||
'report_id',
|
||||
'report',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.mcp_reports_report_details_query_after', compact($vars)));
|
||||
|
||||
if (!$report)
|
||||
{
|
||||
trigger_error('NO_REPORT');
|
||||
@@ -489,6 +537,7 @@ function close_report($report_id_list, $mode, $action, $pm = false)
|
||||
{
|
||||
$post_id_list[] = $row[$id_column];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
$post_id_list = array_unique($post_id_list);
|
||||
|
||||
if ($pm)
|
||||
|
@@ -128,6 +128,9 @@ class bbcode_firstpass extends bbcode
|
||||
// [quote] in second position.
|
||||
// To parse multiline URL we enable dotall option setting only for URL text
|
||||
// but not for link itself, thus [url][/url] is not affected.
|
||||
//
|
||||
// To perform custom validation in extension, use $this->validate_bbcode_by_extension()
|
||||
// method which accepts variable number of parameters
|
||||
$this->bbcodes = array(
|
||||
'code' => array('bbcode_id' => 8, 'regexp' => array('#\[code(?:=([a-z]+))?\](.+\[/code\])#uise' => "\$this->bbcode_code('\$1', '\$2')")),
|
||||
'quote' => array('bbcode_id' => 0, 'regexp' => array('#\[quote(?:="(.*?)")?\](.+)\[/quote\]#uise' => "\$this->bbcode_quote('\$0')")),
|
||||
@@ -788,28 +791,6 @@ class bbcode_firstpass extends bbcode
|
||||
else if (preg_match('#^quote(?:="(.*?)")?$#is', $buffer, $m) && substr($out, -1, 1) == '[')
|
||||
{
|
||||
$this->parsed_items['quote']++;
|
||||
|
||||
// the buffer holds a valid opening tag
|
||||
if ($config['max_quote_depth'] && sizeof($close_tags) >= $config['max_quote_depth'])
|
||||
{
|
||||
if ($config['max_quote_depth'] == 1)
|
||||
{
|
||||
// Depth 1 - no nesting is allowed
|
||||
$error_ary['quote_depth'] = $user->lang('QUOTE_NO_NESTING');
|
||||
}
|
||||
else
|
||||
{
|
||||
// There are too many nested quotes
|
||||
$error_ary['quote_depth'] = $user->lang('QUOTE_DEPTH_EXCEEDED', (int) $config['max_quote_depth']);
|
||||
}
|
||||
|
||||
$out .= $buffer . $tok;
|
||||
$tok = '[]';
|
||||
$buffer = '';
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
array_push($close_tags, '/quote:' . $this->bbcode_uid);
|
||||
|
||||
if (isset($m[1]) && $m[1])
|
||||
@@ -1274,6 +1255,12 @@ class parse_message extends bbcode_firstpass
|
||||
return $update_this_message ? $this->warn_msg : $return_message;
|
||||
}
|
||||
|
||||
// Remove quotes that are nested too deep
|
||||
if ($config['max_quote_depth'] > 0)
|
||||
{
|
||||
$this->remove_nested_quotes($config['max_quote_depth']);
|
||||
}
|
||||
|
||||
// Check for "empty" message. We do not check here for maximum length, because bbcode, smilies, etc. can add to the length.
|
||||
// The maximum length check happened before any parsings.
|
||||
if ($mode === 'post' && utf8_clean_string($this->message) === '')
|
||||
@@ -1314,6 +1301,29 @@ class parse_message extends bbcode_firstpass
|
||||
$return_message = &$this->message;
|
||||
}
|
||||
|
||||
$text = $this->message;
|
||||
$uid = $this->bbcode_uid;
|
||||
|
||||
/**
|
||||
* Event to modify the text before it is parsed
|
||||
*
|
||||
* @event core.modify_format_display_text_before
|
||||
* @var string text The message text to parse
|
||||
* @var string uid The bbcode uid
|
||||
* @var bool allow_bbcode Do we allow bbcodes
|
||||
* @var bool allow_magic_url Do we allow magic urls
|
||||
* @var bool allow_smilies Do we allow smilies
|
||||
* @var bool update_this_message Do we update the internal message
|
||||
* with the parsed result
|
||||
* @since 3.1.6-RC1
|
||||
*/
|
||||
$vars = array('text', 'uid', 'allow_bbcode', 'allow_magic_url', 'allow_smilies', 'update_this_message');
|
||||
extract($phpbb_dispatcher->trigger_event('core.modify_format_display_text_before', compact($vars)));
|
||||
|
||||
$this->message = $text;
|
||||
$this->bbcode_uid = $uid;
|
||||
unset($text, $uid);
|
||||
|
||||
if ($this->message_status == 'plain')
|
||||
{
|
||||
// Force updating message - of course.
|
||||
@@ -1852,6 +1862,50 @@ class parse_message extends bbcode_firstpass
|
||||
$poll['poll_max_options'] = ($poll['poll_max_options'] < 1) ? 1 : (($poll['poll_max_options'] > $config['max_poll_options']) ? $config['max_poll_options'] : $poll['poll_max_options']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove nested quotes at given depth in current parsed message
|
||||
*
|
||||
* @param integer $max_depth Depth limit
|
||||
* @return null
|
||||
*/
|
||||
public function remove_nested_quotes($max_depth)
|
||||
{
|
||||
// Capture all [quote] and [/quote] tags
|
||||
preg_match_all('(\\[/?quote(?:="(.*?)")?:' . $this->bbcode_uid . '\\])', $this->message, $matches, PREG_OFFSET_CAPTURE);
|
||||
|
||||
// Iterate over the quote tags to mark the ranges that must be removed
|
||||
$depth = 0;
|
||||
$ranges = array();
|
||||
$start_pos = 0;
|
||||
foreach ($matches[0] as $match)
|
||||
{
|
||||
if ($match[0][1] === '/')
|
||||
{
|
||||
--$depth;
|
||||
if ($depth == $max_depth)
|
||||
{
|
||||
$end_pos = $match[1] + strlen($match[0]);
|
||||
$length = $end_pos - $start_pos;
|
||||
$ranges[] = array($start_pos, $length);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
++$depth;
|
||||
if ($depth == $max_depth + 1)
|
||||
{
|
||||
$start_pos = $match[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (array_reverse($ranges) as $range)
|
||||
{
|
||||
list($start_pos, $length) = $range;
|
||||
$this->message = substr_replace($this->message, '', $start_pos, $length);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter function for passing the plupload object
|
||||
*
|
||||
@@ -1875,4 +1929,36 @@ class parse_message extends bbcode_firstpass
|
||||
{
|
||||
$this->mimetype_guesser = $mimetype_guesser;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to perform custom bbcode validation by extensions
|
||||
* can be used in bbcode_init() to assign regexp replacement
|
||||
* Example: 'regexp' => array('#\[b\](.*?)\[/b\]#uise' => "\$this->validate_bbcode_by_extension('\$1')")
|
||||
*
|
||||
* Accepts variable number of parameters
|
||||
*
|
||||
* @return mixed Validation result
|
||||
*/
|
||||
public function validate_bbcode_by_extension()
|
||||
{
|
||||
global $phpbb_dispatcher;
|
||||
|
||||
$return = false;
|
||||
$params_array = func_get_args();
|
||||
|
||||
/**
|
||||
* Event to validate bbcode with the custom validating methods
|
||||
* provided by extensions
|
||||
*
|
||||
* @event core.validate_bbcode_by_extension
|
||||
* @var array params_array Array with the function parameters
|
||||
* @var mixed return Validation result to return
|
||||
*
|
||||
* @since 3.1.5-RC1
|
||||
*/
|
||||
$vars = array('params_array', 'return');
|
||||
extract($phpbb_dispatcher->trigger_event('core.validate_bbcode_by_extension', compact($vars)));
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
@@ -94,7 +94,11 @@ if (version_compare(PHP_VERSION, '5.4.0-dev', '>='))
|
||||
}
|
||||
else
|
||||
{
|
||||
@set_magic_quotes_runtime(0);
|
||||
if (get_magic_quotes_runtime())
|
||||
{
|
||||
// Deactivate
|
||||
@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'))
|
||||
|
@@ -30,7 +30,7 @@ class ucp_activate
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $phpbb_root_path, $phpEx;
|
||||
global $db, $user, $auth, $template, $phpbb_container;
|
||||
global $db, $user, $auth, $template, $phpbb_container, $phpbb_dispatcher;
|
||||
|
||||
$user_id = request_var('u', 0);
|
||||
$key = request_var('k', '');
|
||||
@@ -143,6 +143,17 @@ class ucp_activate
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This event can be used to modify data after user account's activation
|
||||
*
|
||||
* @event core.ucp_activate_after
|
||||
* @var array user_row Array with some user data
|
||||
* @var string message Language string of the message that will be displayed to the user
|
||||
* @since 3.1.6-RC1
|
||||
*/
|
||||
$vars = array('user_row', 'message');
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_activate_after', compact($vars)));
|
||||
|
||||
meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
|
||||
trigger_error($user->lang[$message]);
|
||||
}
|
||||
|
@@ -52,11 +52,11 @@ class ucp_notifications
|
||||
|
||||
$notification_methods = $phpbb_notifications->get_subscription_methods();
|
||||
|
||||
foreach($phpbb_notifications->get_subscription_types() as $group => $subscription_types)
|
||||
foreach ($phpbb_notifications->get_subscription_types() as $group => $subscription_types)
|
||||
{
|
||||
foreach($subscription_types as $type => $data)
|
||||
foreach ($subscription_types as $type => $data)
|
||||
{
|
||||
foreach($notification_methods as $method => $method_data)
|
||||
foreach ($notification_methods as $method => $method_data)
|
||||
{
|
||||
if ($request->is_set_post(str_replace('.', '_', $type . '_' . $method_data['id'])) && (!isset($subscriptions[$type]) || !in_array($method_data['id'], $subscriptions[$type])))
|
||||
{
|
||||
@@ -180,13 +180,13 @@ class ucp_notifications
|
||||
{
|
||||
$notification_methods = $phpbb_notifications->get_subscription_methods();
|
||||
|
||||
foreach($phpbb_notifications->get_subscription_types() as $group => $subscription_types)
|
||||
foreach ($phpbb_notifications->get_subscription_types() as $group => $subscription_types)
|
||||
{
|
||||
$template->assign_block_vars($block, array(
|
||||
'GROUP_NAME' => $user->lang($group),
|
||||
));
|
||||
|
||||
foreach($subscription_types as $type => $data)
|
||||
foreach ($subscription_types as $type => $data)
|
||||
{
|
||||
$template->assign_block_vars($block, array(
|
||||
'TYPE' => $type,
|
||||
@@ -197,7 +197,7 @@ class ucp_notifications
|
||||
'SUBSCRIBED' => (isset($subscriptions[$type])) ? true : false,
|
||||
));
|
||||
|
||||
foreach($notification_methods as $method => $method_data)
|
||||
foreach ($notification_methods as $method => $method_data)
|
||||
{
|
||||
$template->assign_block_vars($block . '.notification_methods', array(
|
||||
'METHOD' => $method_data['id'],
|
||||
@@ -227,7 +227,7 @@ class ucp_notifications
|
||||
{
|
||||
$notification_methods = $phpbb_notifications->get_subscription_methods();
|
||||
|
||||
foreach($notification_methods as $method => $method_data)
|
||||
foreach ($notification_methods as $method => $method_data)
|
||||
{
|
||||
$template->assign_block_vars($block, array(
|
||||
'METHOD' => $method_data['id'],
|
||||
|
@@ -55,7 +55,6 @@ function compose_pm($id, $mode, $action, $user_folders = array())
|
||||
|
||||
$address_list = $request->variable('address_list', array('' => array(0 => '')));
|
||||
|
||||
$submit = (isset($_POST['post'])) ? true : false;
|
||||
$preview = (isset($_POST['preview'])) ? true : false;
|
||||
$save = (isset($_POST['save'])) ? true : false;
|
||||
$load = (isset($_POST['load'])) ? true : false;
|
||||
@@ -69,6 +68,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
|
||||
|
||||
$refresh = isset($_POST['add_file']) || isset($_POST['delete_file']) || $save || $load
|
||||
|| $remove_u || $remove_g || $add_to || $add_bcc;
|
||||
$submit = $request->is_set_post('post') && !$refresh && !$preview;
|
||||
|
||||
$action = ($delete && !$preview && !$refresh && $submit) ? 'delete' : $action;
|
||||
$select_single = ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? false : true;
|
||||
|
@@ -265,7 +265,9 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||
* @var array message_row Array with message data
|
||||
* @var array cp_row Array with senders custom profile field data
|
||||
* @var array msg_data Template array with message data
|
||||
* @var array user_info User data of the sender
|
||||
* @since 3.1.0-a1
|
||||
* @changed 3.1.6-RC1 Added user_info into event
|
||||
*/
|
||||
$vars = array(
|
||||
'id',
|
||||
@@ -276,6 +278,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||
'message_row',
|
||||
'cp_row',
|
||||
'msg_data',
|
||||
'user_info',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_pm_view_messsage', compact($vars)));
|
||||
|
||||
|
@@ -69,7 +69,7 @@ class ucp_prefs
|
||||
* @var array data Array with current ucp options data
|
||||
* @var array error Array with list of errors
|
||||
* @since 3.1.0-a1
|
||||
* @changed 3.1.4-rc1 Added error variable to the event
|
||||
* @changed 3.1.4-RC1 Added error variable to the event
|
||||
*/
|
||||
$vars = array('submit', 'data', 'error');
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_personal_data', compact($vars)));
|
||||
|
@@ -176,6 +176,16 @@ class ucp_register
|
||||
}
|
||||
unset($lang_row);
|
||||
|
||||
/**
|
||||
* Allows to modify the agreements.
|
||||
*
|
||||
* To assign data to the template, use $template->assign_vars()
|
||||
*
|
||||
* @event core.ucp_register_agreement
|
||||
* @since 3.1.6-RC1
|
||||
*/
|
||||
$phpbb_dispatcher->dispatch('core.ucp_register_agreement');
|
||||
|
||||
$this->tpl_name = 'ucp_agreement';
|
||||
return;
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@ $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);
|
||||
$convertor_data = array(
|
||||
'forum_name' => 'phpBB 2.0.x',
|
||||
'version' => '1.0.3',
|
||||
'phpbb_version' => '3.1.4',
|
||||
'phpbb_version' => '3.1.6',
|
||||
'author' => '<a href="https://www.phpbb.com/">phpBB Limited</a>',
|
||||
'dbms' => $dbms,
|
||||
'dbhost' => $dbhost,
|
||||
|
@@ -619,7 +619,7 @@ class install_convert extends module
|
||||
{
|
||||
global $template, $user, $phpbb_root_path, $phpEx, $db, $lang, $config, $cache, $auth;
|
||||
global $convert, $convert_row, $message_parser, $skip_rows, $language;
|
||||
global $request, $phpbb_config_php_file;
|
||||
global $request, $phpbb_config_php_file, $phpbb_dispatcher;
|
||||
|
||||
extract($phpbb_config_php_file->get_all());
|
||||
|
||||
@@ -796,7 +796,7 @@ class install_convert extends module
|
||||
}
|
||||
|
||||
$error = false;
|
||||
$convert->fulltext_search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user);
|
||||
$convert->fulltext_search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
|
||||
|
||||
if ($error)
|
||||
{
|
||||
|
@@ -1459,7 +1459,7 @@ class install_install extends module
|
||||
*/
|
||||
function build_search_index($mode, $sub)
|
||||
{
|
||||
global $db, $lang, $phpbb_root_path, $phpEx, $config, $auth, $user;
|
||||
global $db, $lang, $phpbb_root_path, $phpbb_dispatcher, $phpEx, $config, $auth, $user;
|
||||
|
||||
// Obtain any submitted data
|
||||
$data = $this->get_submitted_data();
|
||||
@@ -1492,7 +1492,7 @@ class install_install extends module
|
||||
set_config_count(null, null, null, $config);
|
||||
|
||||
$error = false;
|
||||
$search = new \phpbb\search\fulltext_native($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user);
|
||||
$search = new \phpbb\search\fulltext_native($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
|
||||
|
||||
$sql = 'SELECT post_id, post_subject, post_text, poster_id, forum_id
|
||||
FROM ' . POSTS_TABLE;
|
||||
|
@@ -273,7 +273,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('use_system_cron', '0');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.1.4');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.1.6-RC1');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400');
|
||||
|
||||
|
@@ -68,6 +68,12 @@ $lang = array_merge($lang, array(
|
||||
'EXTENSION_NAME' => 'Extension Name',
|
||||
'EXTENSION_ACTIONS' => 'Actions',
|
||||
'EXTENSION_OPTIONS' => 'Options',
|
||||
'EXTENSION_INSTALL_HEADLINE'=> 'Installing an extension',
|
||||
'EXTENSION_INSTALL_EXPLAIN' => '<ol>
|
||||
<li>Download an extension from phpBB’s extensions database</li>
|
||||
<li>Unzip the extension and upload it to the <samp>ext/</samp> directory of your phpBB board</li>
|
||||
<li>Enable the extension, here in the Extensions manager</li>
|
||||
</ol>',
|
||||
'EXTENSION_UPDATE_HEADLINE' => 'Updating an extension',
|
||||
'EXTENSION_UPDATE_EXPLAIN' => '<ol>
|
||||
<li>Disable the extension</li>
|
||||
@@ -75,7 +81,7 @@ $lang = array_merge($lang, array(
|
||||
<li>Upload the new files</li>
|
||||
<li>Enable the extension</li>
|
||||
</ol>',
|
||||
'EXTENSION_REMOVE_HEADLINE' => 'Completly removing an extension from your board',
|
||||
'EXTENSION_REMOVE_HEADLINE' => 'Completely removing an extension from your board',
|
||||
'EXTENSION_REMOVE_EXPLAIN' => '<ol>
|
||||
<li>Disable the extension</li>
|
||||
<li>Delete the extension’s data</li>
|
||||
@@ -119,6 +125,8 @@ $lang = array_merge($lang, array(
|
||||
'FORCE_UNSTABLE' => 'Always check for unstable versions',
|
||||
'EXTENSIONS_VERSION_CHECK_SETTINGS' => 'Version check settings',
|
||||
|
||||
'BROWSE_EXTENSIONS_DATABASE' => 'Browse extensions database',
|
||||
|
||||
'META_FIELD_NOT_SET' => 'Required meta field %s has not been set.',
|
||||
'META_FIELD_INVALID' => 'Meta field %s is invalid.',
|
||||
));
|
||||
|
@@ -73,4 +73,6 @@ $lang = array_merge($lang, array(
|
||||
'THOSE_MISSING_LANG_VARIABLES' => 'The following language variables are missing from the “%s” language pack',
|
||||
|
||||
'UNINSTALLED_LANGUAGE_PACKS' => 'Uninstalled language packs',
|
||||
|
||||
'BROWSE_LANGUAGE_PACKS_DATABASE' => 'Browse language packs database',
|
||||
));
|
||||
|
@@ -83,4 +83,6 @@ $lang = array_merge($lang, array(
|
||||
'STYLE_USED_BY' => 'Used by (including robots)',
|
||||
|
||||
'UNINSTALL_DEFAULT' => 'You cannot uninstall the default style.',
|
||||
|
||||
'BROWSE_STYLES_DATABASE' => 'Browse styles database',
|
||||
));
|
||||
|
@@ -47,6 +47,6 @@ $lang = array_merge($lang, array(
|
||||
'RECAPTCHA_PRIVATE' => 'Private reCaptcha key',
|
||||
'RECAPTCHA_PRIVATE_EXPLAIN' => 'Your private reCaptcha key. Keys can be obtained on <a href="http://www.google.com/recaptcha">www.google.com/recaptcha</a>.',
|
||||
|
||||
'RECAPTCHA_EXPLAIN' => 'In an effort to prevent automatic submissions, we require that you enter both of the words displayed into the text field underneath.',
|
||||
'RECAPTCHA_EXPLAIN' => 'In an effort to prevent automatic submissions, we require that you type the text displayed into the field underneath.',
|
||||
'RECAPTCHA_SOCKET_ERROR' => 'There was a problem connecting to the RECAPTCHA service: could not open socket. Try again later.',
|
||||
));
|
||||
|
@@ -90,7 +90,7 @@ $help = array(
|
||||
),
|
||||
array(
|
||||
0 => 'Linking to another site',
|
||||
1 => 'phpBB BBCode supports a number of ways of creating URIs (Uniform Resource Indicators) better known as URLs.<ul><li>The first of these uses the <strong>[url=][/url]</strong> tag, whatever you type after the = sign will cause the contents of that tag to act as a URL. For example to link to phpBB.com you could use:<br /><br /><strong>[url=http://www.phpbb.com/]</strong>Visit phpBB!<strong>[/url]</strong><br /><br />This would generate the following link, <a href="http://www.phpbb.com/">Visit phpBB!</a> Please notice that the link opens in the same window or a new window depending on the users browser preferences.</li><li>If you want the URL itself displayed as the link you can do this by simply using:<br /><br /><strong>[url]</strong>http://www.phpbb.com/<strong>[/url]</strong><br /><br />This would generate the following link, <a href="http://www.phpbb.com/">http://www.phpbb.com/</a></li><li>Additionally, phpBB features something called <i>Magic Links</i>, this will turn any syntactically correct URL into a link without you needing to specify any tags or even the leading http://. For example typing www.phpbb.com into your message will automatically lead to <a href="http://www.phpbb.com/">www.phpbb.com</a> being output when you view the message.</li><li>The same thing applies equally to email addresses, you can either specify an address explicitly for example:<br /><br /><strong>[email]</strong>no.one@domain.adr<strong>[/email]</strong><br /><br />which will output <a href="mailto:no.one@domain.adr">no.one@domain.adr</a> or you can just type no.one@domain.adr into your message and it will be automatically converted when you view.</li></ul>As with all the BBCode tags you can wrap URLs around any of the other tags such as <strong>[img][/img]</strong> (see next entry), <strong>[b][/b]</strong>, etc. As with the formatting tags it is up to you to ensure the correct open and close order is following, for example:<br /><br /><strong>[url=http://www.phpbb.com/][img]</strong>http://www.phpbb.com/theme/images/logos/blue/160x52.png<strong>[/url][/img]</strong><br /><br />is <span style="text-decoration: underline">not</span> correct which may lead to your post being deleted so take care.'
|
||||
1 => 'phpBB BBCode supports a number of ways of creating URIs (Uniform Resource Indicators) better known as URLs.<ul><li>The first of these uses the <strong>[url=][/url]</strong> tag, whatever you type after the = sign will cause the contents of that tag to act as a URL. For example to link to phpBB.com you could use:<br /><br /><strong>[url=https://www.phpbb.com/]</strong>Visit phpBB!<strong>[/url]</strong><br /><br />This would generate the following link, <a href="https://www.phpbb.com/">Visit phpBB!</a> Please notice that the link opens in the same window or a new window depending on the users browser preferences.</li><li>If you want the URL itself displayed as the link you can do this by simply using:<br /><br /><strong>[url]</strong>https://www.phpbb.com/<strong>[/url]</strong><br /><br />This would generate the following link, <a href="https://www.phpbb.com/">https://www.phpbb.com/</a></li><li>Additionally, phpBB features something called <i>Magic Links</i>, this will turn any syntactically correct URL into a link without you needing to specify any tags or even the leading https://. For example typing www.phpbb.com into your message will automatically lead to <a href="https://www.phpbb.com/">www.phpbb.com</a> being output when you view the message.</li><li>The same thing applies equally to email addresses, you can either specify an address explicitly for example:<br /><br /><strong>[email]</strong>no.one@domain.adr<strong>[/email]</strong><br /><br />which will output <a href="mailto:no.one@domain.adr">no.one@domain.adr</a> or you can just type no.one@domain.adr into your message and it will be automatically converted when you view.</li></ul>As with all the BBCode tags you can wrap URLs around any of the other tags such as <strong>[img][/img]</strong> (see next entry), <strong>[b][/b]</strong>, etc. As with the formatting tags it is up to you to ensure the correct open and close order is following, for example:<br /><br /><strong>[url=https://www.phpbb.com/][img]</strong>https://www.phpbb.com/theme/images/logos/blue/160x52.png<strong>[/url][/img]</strong><br /><br />is <span style="text-decoration: underline">not</span> correct which may lead to your post being deleted so take care.'
|
||||
),
|
||||
array(
|
||||
0 => '--',
|
||||
@@ -98,7 +98,7 @@ $help = array(
|
||||
),
|
||||
array(
|
||||
0 => 'Adding an image to a post',
|
||||
1 => 'phpBB BBCode incorporates a tag for including images in your posts. Two very important things to remember when using this tag are: many users do not appreciate lots of images being shown in posts and secondly the image you display must already be available on the internet (it cannot exist only on your computer for example, unless you run a webserver!). To display an image you must surround the URL pointing to the image with <strong>[img][/img]</strong> tags. For example:<br /><br /><strong>[img]</strong>http://www.phpbb.com/theme/images/logos/blue/160x52.png<strong>[/img]</strong><br /><br />As noted in the URL section above you can wrap an image in a <strong>[url][/url]</strong> tag if you wish, e.g.<br /><br /><strong>[url=http://www.phpbb.com/][img]</strong>http://www.phpbb.com/theme/images/logos/blue/160x52.png<strong>[/img][/url]</strong><br /><br />would generate:<br /><br /><a href="http://www.phpbb.com/"><img src="http://www.phpbb.com/theme/images/logos/blue/160x52.png" alt="" /></a>'
|
||||
1 => 'phpBB BBCode incorporates a tag for including images in your posts. Two very important things to remember when using this tag are: many users do not appreciate lots of images being shown in posts and secondly the image you display must already be available on the internet (it cannot exist only on your computer for example, unless you run a webserver!). To display an image you must surround the URL pointing to the image with <strong>[img][/img]</strong> tags. For example:<br /><br /><strong>[img]</strong>https://www.phpbb.com/theme/images/logos/blue/160x52.png<strong>[/img]</strong><br /><br />As noted in the URL section above you can wrap an image in a <strong>[url][/url]</strong> tag if you wish, e.g.<br /><br /><strong>[url=https://www.phpbb.com/][img]</strong>https://www.phpbb.com/theme/images/logos/blue/160x52.png<strong>[/img][/url]</strong><br /><br />would generate:<br /><br /><a href="https://www.phpbb.com/"><img src="https://www.phpbb.com/theme/images/logos/blue/160x52.png" alt="" /></a>'
|
||||
),
|
||||
array(
|
||||
0 => 'Adding attachments into a post',
|
||||
|
@@ -52,6 +52,13 @@ $lang = array_merge($lang, array(
|
||||
'MIGRATION_SCHEMA_DONE' => 'Installed Schema: %1$s; Time: %2$.2f seconds',
|
||||
'MIGRATION_SCHEMA_RUNNING' => 'Installing Schema: %s.',
|
||||
|
||||
'MIGRATION_INVALID_DATA_MISSING_CONDITION' => 'A migration is invalid. An if statement helper is missing a condition.',
|
||||
'MIGRATION_INVALID_DATA_MISSING_STEP' => 'A migration is invalid. An if statement helper is missing a valid call to a migration step.',
|
||||
'MIGRATION_INVALID_DATA_CUSTOM_NOT_CALLABLE' => 'A migration is invalid. A custom callable function could not be called.',
|
||||
'MIGRATION_INVALID_DATA_UNKNOWN_TYPE' => 'A migration is invalid. An unknown migration tool type was encountered.',
|
||||
'MIGRATION_INVALID_DATA_UNDEFINED_TOOL' => 'A migration is invalid. An undefined migration tool was encountered.',
|
||||
'MIGRATION_INVALID_DATA_UNDEFINED_METHOD' => 'A migration is invalid. An undefined migration tool method was encountered.',
|
||||
|
||||
'MODULE_ERROR' => 'An error occurred while creating a module: %s',
|
||||
'MODULE_INFO_FILE_NOT_EXIST' => 'A required module info file is missing: %2$s',
|
||||
'MODULE_NOT_EXIST' => 'A required module does not exist: %s',
|
||||
|
@@ -61,7 +61,7 @@ abstract class base implements \phpbb\auth\provider\provider_interface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_auth_link_data()
|
||||
public function get_auth_link_data($user_id = 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@@ -289,7 +289,6 @@ class ldap extends \phpbb\auth\provider\base
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
||||
public function acp()
|
||||
{
|
||||
// These are fields required in the config table
|
||||
@@ -308,7 +307,7 @@ class ldap extends \phpbb\auth\provider\base
|
||||
'TEMPLATE_VARS' => array(
|
||||
'AUTH_LDAP_BASE_DN' => $new_config['ldap_base_dn'],
|
||||
'AUTH_LDAP_EMAIL' => $new_config['ldap_email'],
|
||||
'AUTH_LDAP_PASSORD' => $new_config['ldap_password'],
|
||||
'AUTH_LDAP_PASSORD' => $new_config['ldap_password'] !== '' ? '********' : '',
|
||||
'AUTH_LDAP_PORT' => $new_config['ldap_port'],
|
||||
'AUTH_LDAP_SERVER' => $new_config['ldap_server'],
|
||||
'AUTH_LDAP_UID' => $new_config['ldap_uid'],
|
||||
|
@@ -553,13 +553,13 @@ class oauth extends \phpbb\auth\provider\base
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_auth_link_data()
|
||||
public function get_auth_link_data($user_id = 0)
|
||||
{
|
||||
$block_vars = array();
|
||||
|
||||
// Get all external accounts tied to the current user
|
||||
$data = array(
|
||||
'user_id' => (int) $this->user->data['user_id'],
|
||||
'user_id' => ($user_id <= 0) ? (int) $this->user->data['user_id'] : (int) $user_id,
|
||||
);
|
||||
$sql = 'SELECT oauth_provider_id, provider FROM ' . $this->auth_provider_oauth_token_account_assoc . '
|
||||
WHERE ' . $this->db->sql_build_array('SELECT', $data);
|
||||
@@ -616,10 +616,13 @@ class oauth extends \phpbb\auth\provider\base
|
||||
return 'LOGIN_LINK_MISSING_DATA';
|
||||
}
|
||||
|
||||
// Remove user specified in $link_data if possible
|
||||
$user_id = isset($link_data['user_id']) ? $link_data['user_id'] : $this->user->data['user_id'];
|
||||
|
||||
// Remove the link
|
||||
$sql = 'DELETE FROM ' . $this->auth_provider_oauth_token_account_assoc . "
|
||||
WHERE provider = '" . $this->db->sql_escape($link_data['oauth_service']) . "'
|
||||
AND user_id = " . (int) $this->user->data['user_id'];
|
||||
AND user_id = " . (int) $user_id;
|
||||
$this->db->sql_query($sql);
|
||||
|
||||
// Clear all tokens belonging to the user on this servce
|
||||
|
@@ -13,7 +13,6 @@
|
||||
|
||||
namespace phpbb\auth\provider\oauth;
|
||||
|
||||
|
||||
use OAuth\OAuth1\Token\StdOAuth1Token;
|
||||
use OAuth\Common\Token\TokenInterface;
|
||||
use OAuth\Common\Storage\TokenStorageInterface;
|
||||
@@ -117,7 +116,8 @@ class token_storage implements TokenStorageInterface
|
||||
{
|
||||
$service = $this->get_service_name_for_db($service);
|
||||
|
||||
if ($this->cachedToken) {
|
||||
if ($this->cachedToken)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -232,7 +232,8 @@ class token_storage implements TokenStorageInterface
|
||||
{
|
||||
$service = $this->get_service_name_for_db($service);
|
||||
|
||||
if ($this->cachedToken instanceof TokenInterface) {
|
||||
if ($this->cachedToken instanceof TokenInterface)
|
||||
{
|
||||
return $this->cachedToken;
|
||||
}
|
||||
|
||||
|
@@ -166,6 +166,10 @@ interface provider_interface
|
||||
/**
|
||||
* Returns an array of data necessary to build the ucp_auth_link page
|
||||
*
|
||||
* @param int $user_id User ID for whom the data should be retrieved.
|
||||
* defaults to 0, which is not a valid ID. The method
|
||||
* should fall back to the current user's ID in this
|
||||
* case.
|
||||
* @return array|null If this function is not implemented on an auth
|
||||
* provider then it returns null. If it is implemented
|
||||
* it will return an array of up to four elements of
|
||||
@@ -181,7 +185,7 @@ interface provider_interface
|
||||
* 'VARS' => array(...),
|
||||
* )
|
||||
*/
|
||||
public function get_auth_link_data();
|
||||
public function get_auth_link_data($user_id = 0);
|
||||
|
||||
/**
|
||||
* Unlinks an external account from a phpBB account.
|
||||
|
@@ -23,6 +23,11 @@ class upload extends \phpbb\avatar\driver\driver
|
||||
*/
|
||||
protected $mimetype_guesser;
|
||||
|
||||
/**
|
||||
* @var \phpbb\event\dispatcher_interface
|
||||
*/
|
||||
protected $dispatcher;
|
||||
|
||||
/**
|
||||
* Construct a driver object
|
||||
*
|
||||
@@ -31,15 +36,17 @@ class upload extends \phpbb\avatar\driver\driver
|
||||
* @param string $php_ext PHP file extension
|
||||
* @param \phpbb_path_helper $path_helper phpBB path helper
|
||||
* @param \phpbb\mimetype\guesser $mimetype_guesser Mimetype guesser
|
||||
* @param \phpbb\event\dispatcher_interface $dispatcher phpBB Event dispatcher object
|
||||
* @param \phpbb\cache\driver\driver_interface $cache Cache driver
|
||||
*/
|
||||
public function __construct(\phpbb\config\config $config, $phpbb_root_path, $php_ext, \phpbb\path_helper $path_helper, \phpbb\mimetype\guesser $mimetype_guesser, \phpbb\cache\driver\driver_interface $cache = null)
|
||||
public function __construct(\phpbb\config\config $config, $phpbb_root_path, $php_ext, \phpbb\path_helper $path_helper, \phpbb\mimetype\guesser $mimetype_guesser, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\cache\driver\driver_interface $cache = null)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->phpbb_root_path = $phpbb_root_path;
|
||||
$this->php_ext = $php_ext;
|
||||
$this->path_helper = $path_helper;
|
||||
$this->mimetype_guesser = $mimetype_guesser;
|
||||
$this->dispatcher = $dispatcher;
|
||||
$this->cache = $cache;
|
||||
}
|
||||
|
||||
@@ -137,6 +144,15 @@ class upload extends \phpbb\avatar\driver\driver
|
||||
$prefix = $this->config['avatar_salt'] . '_';
|
||||
$file->clean_filename('avatar', $prefix, $row['id']);
|
||||
|
||||
// If there was an error during upload, then abort operation
|
||||
if (sizeof($file->error))
|
||||
{
|
||||
$file->remove();
|
||||
$error = $file->error;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Calculate new destination
|
||||
$destination = $this->config['avatar_path'];
|
||||
|
||||
// Adjust destination path (no trailing slash)
|
||||
@@ -151,16 +167,45 @@ class upload extends \phpbb\avatar\driver\driver
|
||||
$destination = '';
|
||||
}
|
||||
|
||||
// Move file and overwrite any existing image
|
||||
$file->move_file($destination, true);
|
||||
/**
|
||||
* Before moving new file in place (and eventually overwriting the existing avatar with the newly uploaded avatar)
|
||||
*
|
||||
* @event core.avatar_driver_upload_move_file_before
|
||||
* @var string destination Destination directory where the file is going to be moved
|
||||
* @var string prefix Prefix for the avatar filename
|
||||
* @var array row Array with avatar row data
|
||||
* @var array error Array of errors, if filled in by this event file will not be moved
|
||||
* @since 3.1.6-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'destination',
|
||||
'prefix',
|
||||
'row',
|
||||
'error',
|
||||
);
|
||||
extract($this->dispatcher->trigger_event('core.avatar_driver_upload_move_file_before', compact($vars)));
|
||||
|
||||
if (sizeof($file->error))
|
||||
if (!sizeof($error))
|
||||
{
|
||||
// Move file and overwrite any existing image
|
||||
$file->move_file($destination, true);
|
||||
}
|
||||
|
||||
// If there was an error during move, then clean up leftovers
|
||||
$error = array_merge($error, $file->error);
|
||||
if (sizeof($error))
|
||||
{
|
||||
$file->remove();
|
||||
$error = array_merge($error, $file->error);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Delete current avatar if not overwritten
|
||||
$ext = substr(strrchr($row['avatar'], '.'), 1);
|
||||
if ($ext && $ext !== $file->get('extension'))
|
||||
{
|
||||
$this->delete($row);
|
||||
}
|
||||
|
||||
return array(
|
||||
'avatar' => $row['id'] . '_' . time() . '.' . $file->get('extension'),
|
||||
'avatar_width' => $file->get('width'),
|
||||
@@ -185,10 +230,32 @@ class upload extends \phpbb\avatar\driver\driver
|
||||
*/
|
||||
public function delete($row)
|
||||
{
|
||||
$ext = substr(strrchr($row['avatar'], '.'), 1);
|
||||
$filename = $this->phpbb_root_path . $this->config['avatar_path'] . '/' . $this->config['avatar_salt'] . '_' . $row['id'] . '.' . $ext;
|
||||
|
||||
if (file_exists($filename))
|
||||
$error = array();
|
||||
$destination = $this->config['avatar_path'];
|
||||
$prefix = $this->config['avatar_salt'] . '_';
|
||||
$ext = substr(strrchr($row['avatar'], '.'), 1);
|
||||
$filename = $this->phpbb_root_path . $destination . '/' . $prefix . $row['id'] . '.' . $ext;
|
||||
|
||||
/**
|
||||
* Before deleting an existing avatar
|
||||
*
|
||||
* @event core.avatar_driver_upload_delete_before
|
||||
* @var string destination Destination directory where the file is going to be deleted
|
||||
* @var string prefix Prefix for the avatar filename
|
||||
* @var array row Array with avatar row data
|
||||
* @var array error Array of errors, if filled in by this event file will not be deleted
|
||||
* @since 3.1.6-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'destination',
|
||||
'prefix',
|
||||
'row',
|
||||
'error',
|
||||
);
|
||||
extract($this->dispatcher->trigger_event('core.avatar_driver_upload_delete_before', compact($vars)));
|
||||
|
||||
if (!sizeof($error) && file_exists($filename))
|
||||
{
|
||||
@unlink($filename);
|
||||
}
|
||||
|
2
phpBB/phpbb/cache/driver/memcache.php
vendored
2
phpBB/phpbb/cache/driver/memcache.php
vendored
@@ -50,7 +50,7 @@ class memcache extends \phpbb\cache\driver\memory
|
||||
parent::__construct();
|
||||
|
||||
$this->memcache = new \Memcache;
|
||||
foreach(explode(',', PHPBB_ACM_MEMCACHE) as $u)
|
||||
foreach (explode(',', PHPBB_ACM_MEMCACHE) as $u)
|
||||
{
|
||||
$parts = explode('/', $u);
|
||||
$this->memcache->addServer(trim($parts[0]), trim($parts[1]));
|
||||
|
@@ -350,7 +350,7 @@ class qa
|
||||
),
|
||||
);
|
||||
|
||||
foreach($schemas as $table => $schema)
|
||||
foreach ($schemas as $table => $schema)
|
||||
{
|
||||
if (!$db_tool->sql_table_exists($table))
|
||||
{
|
||||
|
@@ -100,9 +100,9 @@ class db_text
|
||||
$sql = 'UPDATE ' . $this->table . "
|
||||
SET config_value = '" . $this->db->sql_escape($value) . "'
|
||||
WHERE config_name = '" . $this->db->sql_escape($key) . "'";
|
||||
$result = $this->db->sql_query($sql);
|
||||
$this->db->sql_query($sql);
|
||||
|
||||
if (!$this->db->sql_affectedrows($result))
|
||||
if (!$this->db->sql_affectedrows())
|
||||
{
|
||||
$sql = 'INSERT INTO ' . $this->table . ' ' . $this->db->sql_build_array('INSERT', array(
|
||||
'config_name' => (string) $key,
|
||||
|
@@ -13,6 +13,7 @@
|
||||
|
||||
namespace phpbb\controller;
|
||||
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Generator\UrlGenerator;
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
@@ -212,12 +213,31 @@ class helper
|
||||
public function message($message, array $parameters = array(), $title = 'INFORMATION', $code = 200)
|
||||
{
|
||||
array_unshift($parameters, $message);
|
||||
$message_text = call_user_func_array(array($this->user, 'lang'), $parameters);
|
||||
$message_title = $this->user->lang($title);
|
||||
|
||||
if ($this->request->is_ajax())
|
||||
{
|
||||
global $refresh_data;
|
||||
|
||||
return new JsonResponse(
|
||||
array(
|
||||
'MESSAGE_TITLE' => $message_title,
|
||||
'MESSAGE_TEXT' => $message_text,
|
||||
'S_USER_WARNING' => false,
|
||||
'S_USER_NOTICE' => false,
|
||||
'REFRESH_DATA' => (!empty($refresh_data)) ? $refresh_data : null
|
||||
),
|
||||
$code
|
||||
);
|
||||
}
|
||||
|
||||
$this->template->assign_vars(array(
|
||||
'MESSAGE_TEXT' => call_user_func_array(array($this->user, 'lang'), $parameters),
|
||||
'MESSAGE_TITLE' => $this->user->lang($title),
|
||||
'MESSAGE_TEXT' => $message_text,
|
||||
'MESSAGE_TITLE' => $message_title,
|
||||
));
|
||||
|
||||
return $this->render('message_body.html', $this->user->lang($title), $code);
|
||||
return $this->render('message_body.html', $message_title, $code);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -20,24 +20,60 @@ namespace phpbb\cron\task\core;
|
||||
*/
|
||||
class tidy_search extends \phpbb\cron\task\base
|
||||
{
|
||||
/**
|
||||
* phpBB root path
|
||||
* @var string
|
||||
*/
|
||||
protected $phpbb_root_path;
|
||||
|
||||
/**
|
||||
* PHP file extension
|
||||
* @var string
|
||||
*/
|
||||
protected $php_ext;
|
||||
|
||||
/**
|
||||
* Auth object
|
||||
* @var \phpbb\auth\auth
|
||||
*/
|
||||
protected $auth;
|
||||
|
||||
/**
|
||||
* Config object
|
||||
* @var \phpbb\config\config
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* Database object
|
||||
* @var \phpbb\db\driver\driver_interface
|
||||
*/
|
||||
protected $db;
|
||||
|
||||
/**
|
||||
* User object
|
||||
* @var \phpbb\user
|
||||
*/
|
||||
protected $user;
|
||||
|
||||
/**
|
||||
* Event dispatcher object
|
||||
* @var \phpbb\event\dispatcher_interface
|
||||
*/
|
||||
protected $phpbb_dispatcher;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $phpbb_root_path The root path
|
||||
* @param string $phpbb_root_path The phpBB root path
|
||||
* @param string $php_ext The PHP file extension
|
||||
* @param \phpbb\auth\auth $auth The auth
|
||||
* @param \phpbb\config\config $config The config
|
||||
* @param \phpbb\db\driver\driver_interface $db The db connection
|
||||
* @param \phpbb\user $user The user
|
||||
* @param \phpbb\auth\auth $auth The auth object
|
||||
* @param \phpbb\config\config $config The config object
|
||||
* @param \phpbb\db\driver\driver_interface $db The database object
|
||||
* @param \phpbb\user $user The user object
|
||||
* @param \phpbb\event\dispatcher_interface $phpbb_dispatcher The event dispatcher object
|
||||
*/
|
||||
public function __construct($phpbb_root_path, $php_ext, \phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\user $user)
|
||||
public function __construct($phpbb_root_path, $php_ext, \phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\user $user, \phpbb\event\dispatcher_interface $phpbb_dispatcher)
|
||||
{
|
||||
$this->phpbb_root_path = $phpbb_root_path;
|
||||
$this->php_ext = $php_ext;
|
||||
@@ -45,6 +81,7 @@ class tidy_search extends \phpbb\cron\task\base
|
||||
$this->config = $config;
|
||||
$this->db = $db;
|
||||
$this->user = $user;
|
||||
$this->phpbb_dispatcher = $phpbb_dispatcher;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,7 +95,7 @@ class tidy_search extends \phpbb\cron\task\base
|
||||
|
||||
// We do some additional checks in the module to ensure it can actually be utilised
|
||||
$error = false;
|
||||
$search = new $search_type($error, $this->phpbb_root_path, $this->php_ext, $this->auth, $this->config, $this->db, $this->user);
|
||||
$search = new $search_type($error, $this->phpbb_root_path, $this->php_ext, $this->auth, $this->config, $this->db, $this->user, $this->phpbb_dispatcher);
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
|
@@ -962,7 +962,7 @@ abstract class driver implements driver_interface
|
||||
{
|
||||
if (preg_match('/^(UPDATE|DELETE|REPLACE)/', $query))
|
||||
{
|
||||
$this->sql_report .= 'Affected rows: <b>' . $this->sql_affectedrows($this->query_result) . '</b> | ';
|
||||
$this->sql_report .= 'Affected rows: <b>' . $this->sql_affectedrows() . '</b> | ';
|
||||
}
|
||||
$this->sql_report .= 'Before: ' . sprintf('%.5f', $this->curtime - $starttime) . 's | After: ' . sprintf('%.5f', $endtime - $starttime) . 's | Elapsed: <b>' . sprintf('%.5f', $endtime - $this->curtime) . 's</b>';
|
||||
}
|
||||
|
@@ -136,7 +136,7 @@ class style_update_p1 extends \phpbb\db\migration\migration
|
||||
if (!sizeof($valid_styles))
|
||||
{
|
||||
// No valid styles: remove everything and add prosilver
|
||||
$this->sql_query('DELETE FROM ' . STYLES_TABLE, $errored, $error_ary);
|
||||
$this->sql_query('DELETE FROM ' . STYLES_TABLE);
|
||||
|
||||
$sql_ary = array(
|
||||
'style_name' => 'prosilver',
|
||||
@@ -157,13 +157,13 @@ class style_update_p1 extends \phpbb\db\migration\migration
|
||||
$this->sql_query($sql);
|
||||
|
||||
$sql = 'SELECT style_id
|
||||
FROM ' . $table . "
|
||||
FROM ' . STYLES_TABLE . "
|
||||
WHERE style_name = 'prosilver'";
|
||||
$result = $this->sql_query($sql);
|
||||
$default_style = $this->db->sql_fetchfield($result);
|
||||
$default_style = $this->db->sql_fetchfield('style_id');
|
||||
$this->db->sql_freeresult($result);
|
||||
|
||||
set_config('default_style', $default_style);
|
||||
$this->config->set('default_style', $default_style);
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = 0';
|
||||
$this->sql_query($sql);
|
||||
|
31
phpBB/phpbb/db/migration/data/v31x/v315.php
Normal file
31
phpBB/phpbb/db/migration/data/v31x/v315.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* This file is part of the phpBB Forum Software package.
|
||||
*
|
||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||
*
|
||||
* For full copyright and license information, please see
|
||||
* the docs/CREDITS.txt file.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\db\migration\data\v31x;
|
||||
|
||||
class v315 extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v31x\v315rc1',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('config.update', array('version', '3.1.5')),
|
||||
);
|
||||
}
|
||||
}
|
31
phpBB/phpbb/db/migration/data/v31x/v315rc1.php
Normal file
31
phpBB/phpbb/db/migration/data/v31x/v315rc1.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* This file is part of the phpBB Forum Software package.
|
||||
*
|
||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||
*
|
||||
* For full copyright and license information, please see
|
||||
* the docs/CREDITS.txt file.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\db\migration\data\v31x;
|
||||
|
||||
class v315rc1 extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v31x\v314',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('config.update', array('version', '3.1.5-RC1')),
|
||||
);
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user