1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-09-20 13:01:35 +02:00

Compare commits

..

483 Commits

Author SHA1 Message Date
(no author)
5cfa0ec0c3 This commit was manufactured by cvs2svn to create tag
'release_3_0_B3'.

git-svn-id: file:///svn/phpbb/tags/release_3_0_B3@6579 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-12 19:45:36 +00:00
David M
714fdee6d0 *** empty log message ***
git-svn-id: file:///svn/phpbb/trunk@6578 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-12 19:45:36 +00:00
Meik Sievertsen
d420932921 let the user activity queries only update every 5 minutes
git-svn-id: file:///svn/phpbb/trunk@6577 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-12 19:24:30 +00:00
Nils Adermann
2312fb8c0b - use a font supporting unicode on Mac
git-svn-id: file:///svn/phpbb/trunk@6576 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-12 19:09:42 +00:00
Meik Sievertsen
912e142b59 change version number
git-svn-id: file:///svn/phpbb/trunk@6575 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-12 19:08:20 +00:00
Meik Sievertsen
85ddd3ea84 ok, this should work now for mail() and smtpmail. We also removed the newline from the spacer for mail_encode due to php's mail() function choking up on subjects with newlines.
git-svn-id: file:///svn/phpbb/trunk@6574 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-12 18:44:42 +00:00
Meik Sievertsen
adea08faef /me slaps nils. :)
git-svn-id: file:///svn/phpbb/trunk@6573 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-12 18:41:49 +00:00
Meik Sievertsen
d89f60f182 consistant obtain_* functions
git-svn-id: file:///svn/phpbb/trunk@6572 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-12 15:35:43 +00:00
David M
b0217ddc11 banned usernames are now cached and normalized
git-svn-id: file:///svn/phpbb/trunk@6571 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-12 15:17:46 +00:00
David M
90b16076d3 blah blah blah :D
git-svn-id: file:///svn/phpbb/trunk@6570 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-12 14:42:45 +00:00
Nils Adermann
cf34efb06c message
git-svn-id: file:///svn/phpbb/trunk@6569 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-12 14:29:32 +00:00
Meik Sievertsen
fa9d7e4ab4 #5222
git-svn-id: file:///svn/phpbb/trunk@6568 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-12 14:13:26 +00:00
Jonathan Stanley
1586aa5e04 #5226
git-svn-id: file:///svn/phpbb/trunk@6567 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-11 17:42:50 +00:00
Jonathan Stanley
ac19d4b24c #5112
git-svn-id: file:///svn/phpbb/trunk@6566 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-11 17:13:34 +00:00
Meik Sievertsen
66c2a18b82 seems like capitalizing menu titles introduced some problems. :) Also it might look strange for some languages - so therefore it is better be done within the language file directly.
git-svn-id: file:///svn/phpbb/trunk@6565 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-11 16:20:11 +00:00
Meik Sievertsen
8cf0bc433e let utf8 mails work again. I hope this is not giving problems for "strange" mail setups.
git-svn-id: file:///svn/phpbb/trunk@6564 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-11 12:24:10 +00:00
David M
a098417514 - cleaned up firebirdsql
- cleaned up install


git-svn-id: file:///svn/phpbb/trunk@6563 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-10 14:56:18 +00:00
Meik Sievertsen
a5e32e5a94 keywords is a string...
git-svn-id: file:///svn/phpbb/trunk@6562 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-10 14:55:49 +00:00
Meik Sievertsen
3d0759974b - some fixes
- added script for easy adjustement of username_clean column within the users table (please see the note i added to the utf8_clean_string() function)


git-svn-id: file:///svn/phpbb/trunk@6561 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-10 13:49:52 +00:00
Graham Eames
805af6f437 Only show reports you can handle [#5136]
git-svn-id: file:///svn/phpbb/trunk@6560 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-07 20:49:51 +00:00
Nils Adermann
11d2a37032 - Bug #5090
git-svn-id: file:///svn/phpbb/trunk@6559 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-05 20:52:52 +00:00
Graham Eames
67af543695 Slight copy and paste error
git-svn-id: file:///svn/phpbb/trunk@6558 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-05 20:42:37 +00:00
Dominik Dröscher
0ec7ca8bf7 #5092
git-svn-id: file:///svn/phpbb/trunk@6557 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-05 19:33:03 +00:00
David M
811d6ef6d1 #5122
git-svn-id: file:///svn/phpbb/trunk@6556 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-05 19:03:24 +00:00
Meik Sievertsen
830276508b - #5120
- #5104


git-svn-id: file:///svn/phpbb/trunk@6555 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-05 18:13:35 +00:00
Graham Eames
88b698c989 Some additional changes to the FAQ. This is now more or less complete, although will be subject to modification if extra issues come to light which should be in it
git-svn-id: file:///svn/phpbb/trunk@6554 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-05 13:58:40 +00:00
Meik Sievertsen
7e864e367b forgot one
git-svn-id: file:///svn/phpbb/trunk@6553 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-04 17:25:27 +00:00
Meik Sievertsen
63c0c798c8 - use the $var_ary for settings in a more logical way (hopefully removes the clutter and shows where which variable is set how)
- hopefully utf8 passwords are working too now


git-svn-id: file:///svn/phpbb/trunk@6552 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-04 17:19:33 +00:00
David M
8b90d5998b #5094
git-svn-id: file:///svn/phpbb/trunk@6551 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-04 16:30:51 +00:00
David M
1544f45621 trimmed the highlight regex
git-svn-id: file:///svn/phpbb/trunk@6550 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-04 13:37:22 +00:00
David M
8b0ec6e02d - compress is nicer (fixed a bug :P)
- UTF-8 code is nicer (fixed a bug :P)
- new CAPTCHA. Replaced the old one for size and usability issues. The old CAPTCHA will most likely be released as a separate package


git-svn-id: file:///svn/phpbb/trunk@6549 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-03 23:09:16 +00:00
Meik Sievertsen
7ab232a455 ok, i am an idiot...
git-svn-id: file:///svn/phpbb/trunk@6548 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-03 21:05:25 +00:00
David M
b0989c3f4d #5030
git-svn-id: file:///svn/phpbb/trunk@6547 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-03 20:19:52 +00:00
Meik Sievertsen
1634814e16 - make sure the sql layer for mysql always states mysql4 and get to mysql if using mysql < 4
- assign some default vars to email templates (we always need some basic ones)


git-svn-id: file:///svn/phpbb/trunk@6546 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-03 17:50:39 +00:00
Meik Sievertsen
daa3288a36 - implemented the suggested html_entity_decode function made by david
- fixed string length checking by also decoding entities for the sake of checking
- used the new html_entity_decode function


git-svn-id: file:///svn/phpbb/trunk@6545 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-03 11:26:14 +00:00
Meik Sievertsen
a3bf1ed63e some updates; and hopefully not completely breaking redirects (again). :D You know, i like breaking things.
git-svn-id: file:///svn/phpbb/trunk@6544 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-02 15:23:33 +00:00
Jonathan Stanley
21a002e4ac Bleh. @_@ (#5068)
git-svn-id: file:///svn/phpbb/trunk@6543 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-11-01 20:48:50 +00:00
Graham Eames
1128bf8788 Changing regeneration of the rand seed
git-svn-id: file:///svn/phpbb/trunk@6542 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-31 20:31:51 +00:00
Graham Eames
ace934284a Missed that there were 2 open against this file
git-svn-id: file:///svn/phpbb/trunk@6541 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-30 20:56:31 +00:00
Graham Eames
6c0b443dd7 #5020
Note, this can give a wide list, we need to look at this further


git-svn-id: file:///svn/phpbb/trunk@6540 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-30 20:32:45 +00:00
Meik Sievertsen
12c75a0991 - temporarily disable x-sendfile support (we need to look into methods of checking if it is enabled/disabled or introducing a switch)
- finally allow custom permission settings files (in acp/ as well as in mods/)


git-svn-id: file:///svn/phpbb/trunk@6539 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-30 19:51:56 +00:00
Meik Sievertsen
c44f6ca080 some fixes
git-svn-id: file:///svn/phpbb/trunk@6538 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-30 16:20:11 +00:00
Nils Adermann
7e55e53d10 - Handle upper/lower case in memberlist properly [Bug #5012]
git-svn-id: file:///svn/phpbb/trunk@6537 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-29 14:59:19 +00:00
Dominik Dröscher
b65cadf414 #5024
Missing </code>.


git-svn-id: file:///svn/phpbb/trunk@6536 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-29 09:08:36 +00:00
Jonathan Stanley
59d78ec21b #4880
#4882
#4884
#4898
#4910
#4926
#4928
#4930
#4934
#4936
#4938
#4942
#4944
#4946
#4948
#4950
#4952
#4954
#4956
#4960
#4972
#4980


git-svn-id: file:///svn/phpbb/trunk@6535 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-28 21:17:42 +00:00
Jonathan Stanley
a23103ba54 #4834
git-svn-id: file:///svn/phpbb/trunk@6534 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-28 20:22:25 +00:00
Meik Sievertsen
8130bcf44e test new mailing list rules
git-svn-id: file:///svn/phpbb/trunk@6533 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-28 11:03:33 +00:00
Meik Sievertsen
15195facc2 two tiny bugfixes
git-svn-id: file:///svn/phpbb/trunk@6532 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-27 14:40:41 +00:00
Dominik Dröscher
7058666615 #4754
MSNM should work again (as before, only on IE).


git-svn-id: file:///svn/phpbb/trunk@6531 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-26 14:46:41 +00:00
Dominik Dröscher
0b838cec29 #4802
git-svn-id: file:///svn/phpbb/trunk@6530 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-26 12:20:55 +00:00
Dominik Dröscher
b399902357 Forgot this ...
git-svn-id: file:///svn/phpbb/trunk@6529 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-26 11:48:36 +00:00
Dominik Dröscher
6f4d0c4fa2 #4696
Quoting from topic review should now work in FF 1.5.0.x.

Note to Nils: We need a utf8_addslashes function. The standard addslashes will not cut it for UTF-8. :)


git-svn-id: file:///svn/phpbb/trunk@6528 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-26 11:27:57 +00:00
Meik Sievertsen
cd3eaf0e17 some bugfixes
git-svn-id: file:///svn/phpbb/trunk@6527 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-26 10:58:58 +00:00
David M
b79f709bfc #4988
git-svn-id: file:///svn/phpbb/trunk@6526 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-25 18:53:57 +00:00
David M
2399844bef #4962
git-svn-id: file:///svn/phpbb/trunk@6525 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-23 23:01:12 +00:00
David M
ad8fa012f5 This was caused by the removal of DEFAULT on some TEXT columns (MySQL really does not allow this). Only those using MySQL felt this issue :P
git-svn-id: file:///svn/phpbb/trunk@6524 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-23 22:32:37 +00:00
David M
a0201b4958 #4850
git-svn-id: file:///svn/phpbb/trunk@6523 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-23 21:07:45 +00:00
Meik Sievertsen
74e03ddf62 - capitalize on menus (much much much much much much more readable)
- remove unneccessary "effective" (the view and the explanation should already imply this) to gain more space - we need to be as short as possible if labeling menu items.


git-svn-id: file:///svn/phpbb/trunk@6522 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-23 15:13:45 +00:00
Graham Eames
eb0c49da11 Add an optional flag to allow the disabling of generating the cron image for pages if appropriate
git-svn-id: file:///svn/phpbb/trunk@6521 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-22 18:32:06 +00:00
Meik Sievertsen
b3ab2173a4 #4896
git-svn-id: file:///svn/phpbb/trunk@6520 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-22 15:02:50 +00:00
Meik Sievertsen
0de6e24865 ENT_COMPAT is the default, with ENT_QUOTES a few features will no longer work.
git-svn-id: file:///svn/phpbb/trunk@6519 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-22 13:46:55 +00:00
Graham Eames
55e848eff8 Minor typo when the FAQ got updated
git-svn-id: file:///svn/phpbb/trunk@6518 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-22 13:37:47 +00:00
Meik Sievertsen
22129be21f - now username changes should work as desired
- removed some extract() calls


git-svn-id: file:///svn/phpbb/trunk@6517 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-22 13:32:33 +00:00
Graham Eames
44ea780de6 Increase size of font size box
git-svn-id: file:///svn/phpbb/trunk@6516 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-21 16:14:23 +00:00
Graham Eames
7470dcf709 Move outputting of TO box since it's only relevant to one module and this will ensure it is displayed however that module is loaded [#4866]
git-svn-id: file:///svn/phpbb/trunk@6515 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-21 15:46:23 +00:00
Graham Eames
1df3ccc836 #4876
git-svn-id: file:///svn/phpbb/trunk@6514 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-21 15:11:01 +00:00
Meik Sievertsen
f4da66a932 - adjust unread query a bit to cope with large topics (thanks bart!)
- fixing some bugs
- more username_clean work


git-svn-id: file:///svn/phpbb/trunk@6513 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-20 13:48:44 +00:00
Meik Sievertsen
b572e0db8f remove debug code. ;)
git-svn-id: file:///svn/phpbb/trunk@6512 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-19 14:11:03 +00:00
Meik Sievertsen
fcd9b898f1 Revised attachment categories a bit
Fixes for the following bugs:
#4830
#4818
#4816
#4810
#4808
#4798
#4796
#4772
#4662
#4646
#4546
#4524
#4270

I hope not having introduced additional severe errors :)


git-svn-id: file:///svn/phpbb/trunk@6511 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-19 13:55:48 +00:00
David M
9a0ca3d334 - typo in functions.php
- #4826


git-svn-id: file:///svn/phpbb/trunk@6510 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-18 23:58:31 +00:00
David M
2d3af47407 #4812
#4804


git-svn-id: file:///svn/phpbb/trunk@6509 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-18 21:39:28 +00:00
Meik Sievertsen
025d0bf757 let the forum link work again
(we do not need the removed check because the board url is always prefixed, except for those urls having a valid scheme and host part)


git-svn-id: file:///svn/phpbb/trunk@6508 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-18 15:32:46 +00:00
David M
771c20a5a4 #4758
git-svn-id: file:///svn/phpbb/trunk@6507 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-16 22:12:52 +00:00
Dominik Dröscher
6f23849556 Remaining files from #4760
git-svn-id: file:///svn/phpbb/trunk@6506 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-16 17:59:22 +00:00
Dominik Dröscher
2917956fe5 #4760
No more eval()


git-svn-id: file:///svn/phpbb/trunk@6505 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-16 13:42:17 +00:00
Dominik Dröscher
1d1e6d4603 #4694
Updated insert_text and removed some code duplication.


git-svn-id: file:///svn/phpbb/trunk@6504 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-16 12:07:51 +00:00
David M
c7f9d94b75 looks like nobody ever found this bug :D
git-svn-id: file:///svn/phpbb/trunk@6503 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-15 19:22:25 +00:00
Graham Eames
dd5a27dc6f Allow fractional values for sizes [#4744]
git-svn-id: file:///svn/phpbb/trunk@6502 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-14 21:13:51 +00:00
David M
4d0ebfcdf2 #4720
git-svn-id: file:///svn/phpbb/trunk@6501 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-14 21:00:26 +00:00
David M
2cc31fee0e if we want a string, don't close the DB and cache
git-svn-id: file:///svn/phpbb/trunk@6500 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-14 19:05:51 +00:00
David M
44ba76d075 fix the dbal
git-svn-id: file:///svn/phpbb/trunk@6499 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-14 18:54:37 +00:00
Graham Eames
ca19477a97 Fix time limiting in mcp [#4730]
git-svn-id: file:///svn/phpbb/trunk@6498 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-14 16:58:07 +00:00
Meik Sievertsen
4afaca12dc - store sql_layer directly within the layer itself
- new method sql_multi_insert to circumvent db-specific hacks
(hopefully not introduced any parsing errors)


git-svn-id: file:///svn/phpbb/trunk@6497 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-14 14:56:46 +00:00
Graham Eames
46922674ea Remove unused constants
git-svn-id: file:///svn/phpbb/trunk@6496 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-14 13:21:46 +00:00
Graham Eames
72f1d4f25d Need to set the clean form on install
git-svn-id: file:///svn/phpbb/trunk@6495 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-14 13:02:04 +00:00
Nils Adermann
c65048bd91 - introducing clean usernames, needs to be tested more, I'm not sure I didn't miss anything
- homograph list should probably be extended


git-svn-id: file:///svn/phpbb/trunk@6494 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-13 22:10:18 +00:00
Graham Eames
23d25ddcd1 More FAQ changes, with thanks to Techie-Micheal for assistance with some of these
git-svn-id: file:///svn/phpbb/trunk@6493 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-13 19:29:43 +00:00
David M
15ec1c443f #4710
git-svn-id: file:///svn/phpbb/trunk@6492 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-13 02:00:30 +00:00
Graham Eames
1418beacfd Use correct template variable to allow sorting to work [#4712]
git-svn-id: file:///svn/phpbb/trunk@6491 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-12 20:24:26 +00:00
Graham Eames
b6546a1487 Censor last post topic [#4714]
git-svn-id: file:///svn/phpbb/trunk@6490 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-12 20:05:50 +00:00
David M
a2ac86744f #4718
git-svn-id: file:///svn/phpbb/trunk@6489 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-12 18:59:14 +00:00
Meik Sievertsen
f373eba5a4 comment out for the moment - it may be not fair to disallow "virtual" urls. :)
git-svn-id: file:///svn/phpbb/trunk@6488 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-12 15:33:24 +00:00
Meik Sievertsen
23ef85fa74 some test code, hopefully working for all occassions where we are using the functions...
git-svn-id: file:///svn/phpbb/trunk@6487 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-12 15:20:33 +00:00
Dominik Dröscher
c2567c38ff #4316
git-svn-id: file:///svn/phpbb/trunk@6486 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-12 12:37:13 +00:00
Dominik Dröscher
7255ab8f39 I hate duplicate CSS. That was the last one for tonight. I swear!
git-svn-id: file:///svn/phpbb/trunk@6485 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-11 22:56:42 +00:00
Dominik Dröscher
cd37633cde Nicer solution for the rtl problem. Thanks Jon!
git-svn-id: file:///svn/phpbb/trunk@6484 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-11 22:54:10 +00:00
Dominik Dröscher
7c328f2de0 Yes IE6, I like you as much as you like me.
git-svn-id: file:///svn/phpbb/trunk@6483 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-11 22:42:16 +00:00
Dominik Dröscher
a1df726e9f Some subsilver fixes:
#4628
#4448
#4014


git-svn-id: file:///svn/phpbb/trunk@6482 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-11 22:35:41 +00:00
Graham Eames
152a653fd4 #3980
git-svn-id: file:///svn/phpbb/trunk@6481 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-11 20:37:53 +00:00
David M
31463d2ccc #4700
git-svn-id: file:///svn/phpbb/trunk@6480 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-11 19:56:27 +00:00
Meik Sievertsen
d7ee6969d2 :)
git-svn-id: file:///svn/phpbb/trunk@6479 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-11 14:59:28 +00:00
Meik Sievertsen
99d968dd2e some fixes
git-svn-id: file:///svn/phpbb/trunk@6478 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-11 13:48:30 +00:00
Meik Sievertsen
97c72d7075 - make sure all sort keys are valid and selectable.
git-svn-id: file:///svn/phpbb/trunk@6477 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-11 10:43:20 +00:00
Meik Sievertsen
a765165cd1 do not use parse_str because it could lead to "unexpected" output which could lead to XSS
git-svn-id: file:///svn/phpbb/trunk@6476 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-11 07:02:29 +00:00
Meik Sievertsen
e168cd2793 ok, i do not why the db is setting the type for user id to string - but with this change bots should no longer "spawn" sessions. ;)
git-svn-id: file:///svn/phpbb/trunk@6475 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-10 13:59:02 +00:00
David M
23a6cf3efb #4622
stole this bug too :P


git-svn-id: file:///svn/phpbb/trunk@6474 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-10 02:04:55 +00:00
David M
c63392c89e new collation for MySQL >= 4.1.3, should be a tad faster
git-svn-id: file:///svn/phpbb/trunk@6473 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-10 01:46:59 +00:00
David M
e9df6f3546 #4680
this bothered me :P


git-svn-id: file:///svn/phpbb/trunk@6472 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-10 01:39:48 +00:00
David M
42dcd7929e hopefully no bugs...
- faster encoding and way faster decoding (hopefully)
- waaaaay faster strtoupper strtolower transforms
- more powerful utf8_substr
- removed two (now) useless functions

P.S.
decode and upper/lower all had bugs before :P


git-svn-id: file:///svn/phpbb/trunk@6471 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-09 17:44:06 +00:00
Meik Sievertsen
0b2aaae28b - forum image being an additional image instead of replacing forum indicators
- reasons fixes


git-svn-id: file:///svn/phpbb/trunk@6470 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-08 19:04:49 +00:00
Dominik Dröscher
f8be2a133b missing span
git-svn-id: file:///svn/phpbb/trunk@6469 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-08 14:31:03 +00:00
Graham Eames
91dcde955e Changes to language functionality.
Notes to translators:
* Language directory should where possible be named xx[_yy[_zz]] as appropriate for the language code (lower case with underscores to separate)
* USER_LANG should contain the relevant iso code which is returned with page content (ie en-gb for the default language pack)


git-svn-id: file:///svn/phpbb/trunk@6468 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-08 13:42:23 +00:00
Meik Sievertsen
9cfa28b502 remove useless information from tz array
git-svn-id: file:///svn/phpbb/trunk@6467 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-08 11:25:20 +00:00
Meik Sievertsen
9a73fb26b2 filenames and directories are lowercase only
git-svn-id: file:///svn/phpbb/trunk@6466 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-08 11:21:40 +00:00
David M
df20358f6d oops ;-)
git-svn-id: file:///svn/phpbb/trunk@6465 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-07 22:53:39 +00:00
David M
722ab535a6 Case folding! :D
git-svn-id: file:///svn/phpbb/trunk@6464 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-07 22:51:55 +00:00
Graham Eames
6972d28633 View profile now shows relevant add/remove links
git-svn-id: file:///svn/phpbb/trunk@6463 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-07 21:02:06 +00:00
Graham Eames
32c2ea4339 View profile now shows relevant add/remove links
git-svn-id: file:///svn/phpbb/trunk@6462 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-07 20:11:45 +00:00
Graham Eames
d7545025c3 Make the UTF tools available - recent changes require them in the install and they are likely to be needed in conversion as well
Fix some broken redirects
Change the structure of language packs we scan for.
	(language packs should be named in the form xx-yy - all lowercase with hyphens as the separator)


git-svn-id: file:///svn/phpbb/trunk@6461 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-07 19:07:42 +00:00
Jonathan Stanley
17f25374ad Set S_USER_LANG for the installer, though requires review since phpBB3
mandates that the language pack directory is in xx/xx-YY/xx-yy format, as browsers
 choke with non-hyphenated formats, eg: xx_YY/xx_yy/xx@Zzzz.


git-svn-id: file:///svn/phpbb/trunk@6460 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-07 17:54:53 +00:00
Meik Sievertsen
485935e1f1 he braces style is deprecated as of PHP 6
git-svn-id: file:///svn/phpbb/trunk@6459 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-07 17:40:07 +00:00
Meik Sievertsen
a7df65168c better not. ;)
git-svn-id: file:///svn/phpbb/trunk@6458 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-07 17:11:51 +00:00
Meik Sievertsen
c40783e6a2 strpos...
git-svn-id: file:///svn/phpbb/trunk@6457 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-07 16:49:44 +00:00
Meik Sievertsen
eac1b02843 role_name does not need to be case-insensitive
git-svn-id: file:///svn/phpbb/trunk@6456 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-07 15:53:17 +00:00
Meik Sievertsen
f27edc4b5b for some things we do not need the utf8 function. :)
git-svn-id: file:///svn/phpbb/trunk@6455 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-07 15:47:55 +00:00
Graham Eames
66c78d114b The zebra ran into a paint factory
git-svn-id: file:///svn/phpbb/trunk@6454 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-07 14:12:50 +00:00
Graham Eames
e4a4bd0d4e Minor typo
git-svn-id: file:///svn/phpbb/trunk@6453 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-07 13:14:58 +00:00
Meik Sievertsen
f8528a659c tried to begin adjusting all string functions where applicable - still a *lot* to do.
i hope i catched all relevant sections and did not mess something up.


git-svn-id: file:///svn/phpbb/trunk@6452 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-07 12:36:31 +00:00
Jonathan Stanley
e87f740a9e Explicitly setting the (X)HTML content-language for the ACP so that Unicode font matching within browsers work correctly when Chinese/Korean/Japanese language packs are selected due to Han Unification
which map different graphemes to the same codepoint.

References:

http://www.w3.org/International/tutorials/tutorial-lang/
http://en.wikipedia.org/wiki/Han_unification


git-svn-id: file:///svn/phpbb/trunk@6451 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-07 00:56:58 +00:00
David M
3ad6069d01 *** empty log message ***
git-svn-id: file:///svn/phpbb/trunk@6450 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-06 22:44:58 +00:00
David M
6c49652a19 #4518
git-svn-id: file:///svn/phpbb/trunk@6449 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-06 22:27:17 +00:00
David M
7777bd5f50 #3794
git-svn-id: file:///svn/phpbb/trunk@6448 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-06 21:37:17 +00:00
Meik Sievertsen
0f0d160ded - support re-caching of theme data if stylesheet.css changed and load_tplcompile enabled
- mcp fixes
- fixed some usability issues


git-svn-id: file:///svn/phpbb/trunk@6447 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-06 18:43:55 +00:00
Meik Sievertsen
c645088a34 *** empty log message ***
git-svn-id: file:///svn/phpbb/trunk@6446 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-06 12:55:36 +00:00
Jonathan Stanley
d4524f1b10 oopsie?!?! :D
git-svn-id: file:///svn/phpbb/trunk@6445 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-05 23:38:13 +00:00
Jonathan Stanley
1577507574 Some initial FAQ (that's FACK, not Eff Aye Que) expansion for phpBB3, keeping in mind the secret template is a little different. ;)
git-svn-id: file:///svn/phpbb/trunk@6444 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-05 23:16:16 +00:00
Graham Eames
db202159e2 Add coluring to search-posts results
git-svn-id: file:///svn/phpbb/trunk@6443 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-05 19:58:37 +00:00
David M
9c83c919a2 #4616
git-svn-id: file:///svn/phpbb/trunk@6442 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-05 00:55:27 +00:00
Graham Eames
dcdd47cb75 Do not show styles select if overriding style
git-svn-id: file:///svn/phpbb/trunk@6441 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-04 20:51:51 +00:00
Graham Eames
50a0c827ce Check that we actually have a valid fp
git-svn-id: file:///svn/phpbb/trunk@6440 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-04 18:25:05 +00:00
Meik Sievertsen
26aba1a1f1 - finally removed sql_numrows
- sql_fetchfield now in dbal.php
- check query id correctly as well as other tiny fixes


git-svn-id: file:///svn/phpbb/trunk@6439 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-04 15:15:40 +00:00
Nils Adermann
f7f6e9bcde - query id can be zero [Bug #4584]
git-svn-id: file:///svn/phpbb/trunk@6438 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-03 20:38:03 +00:00
Meik Sievertsen
aca3b8c5cf ha, the first one...
git-svn-id: file:///svn/phpbb/trunk@6437 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-03 20:28:59 +00:00
Meik Sievertsen
5284f32178 - extend config checking to include check for writeable path
- removed not utilized user_allow_email column from schema
- removed inactive groups (they had no use at all, since inactive users are not able to login)
	The only benefit those brought are distinguish users - but this is no longer needed too due to the inactive code present. This also allows us to retain group memberships as well as default settings for users being set inactive due to profile changes.
- rewrote user_active_flip to support multiple users and a mode, as well as coping with the aforementioned changes
- implemented updated jabber class to support SRV server records and for better jabberd2 support.
- jabber errors now logged to the error log with a full transaction
- fixed user_delete calls to include usernames where possible and also update last post information correctly
- implemented additioal checks to user management to cope with common mistakes
- On installation, guess the required mysql schema as best as possible. Users now only need to decide if they want to use the mysqli extension or not (mysqli selected by default) and no longer need to know their mysql version.
- founders do not need to re-activate their account on profile changes
- remove older session if re-authentication was successful (re-authentication always assigns a new session id)
- set the cookie directly instead of using php's function
- added inactive_remind to see which users got deactivated because of reminders (or re-activation) sent out

hopefully not introduced too many bugs - those testing with CVS releases, please concentrate on user registration, activation, profile changes (email/password)...


git-svn-id: file:///svn/phpbb/trunk@6436 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-03 18:35:59 +00:00
Jonathan Stanley
d7f87be493 Reworded string to better clarify the error
git-svn-id: file:///svn/phpbb/trunk@6435 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-03 13:39:55 +00:00
David M
71c30b8157 #4226
git-svn-id: file:///svn/phpbb/trunk@6434 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-03 03:59:16 +00:00
David M
c4d8c23357 complete check for FB
git-svn-id: file:///svn/phpbb/trunk@6433 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-03 03:17:56 +00:00
David M
50dc65177f kill the cache
git-svn-id: file:///svn/phpbb/trunk@6432 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-02 22:35:50 +00:00
David M
2ce3ab3dc0 remove my debug code
git-svn-id: file:///svn/phpbb/trunk@6431 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-02 15:33:30 +00:00
David M
94121dc765 #4572
git-svn-id: file:///svn/phpbb/trunk@6430 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-02 15:32:41 +00:00
David M
ec9978f2eb #4564
git-svn-id: file:///svn/phpbb/trunk@6429 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-02 15:31:14 +00:00
Meik Sievertsen
cc4a0a2f7a consistent acp layout regarding backlinks and messages.
git-svn-id: file:///svn/phpbb/trunk@6428 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-02 15:11:40 +00:00
Graham Eames
fc76c94ab1 Make sure comments in generated language files include UTF reference
git-svn-id: file:///svn/phpbb/trunk@6427 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-01 20:49:39 +00:00
Graham Eames
17989aba24 Allow for tomorrow in relative dates
git-svn-id: file:///svn/phpbb/trunk@6426 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-01 17:18:37 +00:00
David M
aa71cfaa8b - Goodbye MySQL4, hello unified MySQL driver. MySQL 3.23 to MySQL 5.0 are now in one driver.
git-svn-id: file:///svn/phpbb/trunk@6425 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-01 16:20:05 +00:00
Graham Eames
fd0b2e7df3 Prevent reuse of previous password
git-svn-id: file:///svn/phpbb/trunk@6424 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-01 16:12:53 +00:00
Graham Eames
c42b75d1bc Prevent cookies from other applications interfering with our forms
git-svn-id: file:///svn/phpbb/trunk@6423 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-01 11:10:15 +00:00
David M
bc15445b58 - forgot to make the same change to the ODBC driver
- MySQL 3.x works now
- FirebirdSQL is now on the same level as MySQL and PostgreSQL, zero hacks exist inside the core code now


git-svn-id: file:///svn/phpbb/trunk@6422 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-10-01 08:48:32 +00:00
Graham Eames
bc770de9b9 Minor l10n change
git-svn-id: file:///svn/phpbb/trunk@6421 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-30 16:03:37 +00:00
Meik Sievertsen
4c2e2b83c7 just realizing that it is better to limit the uses of RANGE.
git-svn-id: file:///svn/phpbb/trunk@6420 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-30 15:06:03 +00:00
Meik Sievertsen
b08c54f35e - fixing a bug i am unsure about when it occurs (but it occurs). The symptoms are broken template cache files if after removing unnecessary php opening/closing tags result in statements being syntactially incorrect.
- added real syncing to forums acp (not only forum statistics rebuild)


git-svn-id: file:///svn/phpbb/trunk@6419 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-30 14:58:05 +00:00
Meik Sievertsen
e4fc191e0d of course $host instead of $domain
git-svn-id: file:///svn/phpbb/trunk@6418 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-29 12:06:06 +00:00
Jonathan Stanley
3766d9128d Teh grammar striketh! Oh... and something to please the Typographists. ;)
git-svn-id: file:///svn/phpbb/trunk@6417 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-28 17:51:30 +00:00
Jonathan Stanley
ab76b65cc4 A couple small fixes.
git-svn-id: file:///svn/phpbb/trunk@6416 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-28 17:43:13 +00:00
Meik Sievertsen
34f09c8dea err, no, from the php manual actually... the zend function has some security issues.
git-svn-id: file:///svn/phpbb/trunk@6415 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-28 15:11:57 +00:00
Meik Sievertsen
26befa0941 - added confirmation to removing bbcodes
- added optional MX and DNSBL checks
- added backtrace (triggering sql error) on error within sql_in_set as well as making sure it is handling an array
- let users having f_list access to a forum actually see the forum without a topic list and not displaying an error message - this allows for giving people access to subforums but not the parent forum without the need to add the (sub-)forum to the index.
- some additional bugfixes


git-svn-id: file:///svn/phpbb/trunk@6414 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-28 15:04:59 +00:00
Meik Sievertsen
67accdb072 updated coding guidelines. ;)
git-svn-id: file:///svn/phpbb/trunk@6413 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-28 12:42:36 +00:00
Jonathan Stanley
f48f1c743b A minor boo-boo. :P
git-svn-id: file:///svn/phpbb/trunk@6412 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-28 01:57:49 +00:00
Meik Sievertsen
734492958e These changes should let olympus scale a little bit better.
i haven't adjusted the schemas but added the details to create_schema_files - david is able to build them then in line with his changes. :)


git-svn-id: file:///svn/phpbb/trunk@6411 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-26 19:59:41 +00:00
Graham Eames
e339c36ec0 Update group faq and add section on zebras
git-svn-id: file:///svn/phpbb/trunk@6410 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-26 19:57:44 +00:00
Graham Eames
8a362bdc85 Initial cleanup of "Issues", "Private Messaging" & "Topics"
Further changes will follow


git-svn-id: file:///svn/phpbb/trunk@6409 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-25 21:02:41 +00:00
Graham Eames
9f865447f3 4+1=5
git-svn-id: file:///svn/phpbb/trunk@6408 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-25 18:59:34 +00:00
Meik Sievertsen
12f2fbc415 use the "old" approach
git-svn-id: file:///svn/phpbb/trunk@6407 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-25 14:32:05 +00:00
Dominik Dröscher
8e06ad3829 Welcome the new pagination.html - splitting up multiple pages since 1897.
git-svn-id: file:///svn/phpbb/trunk@6406 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-24 16:02:25 +00:00
Meik Sievertsen
e1beb68ae1 fix bug #4454
git-svn-id: file:///svn/phpbb/trunk@6405 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-24 15:07:08 +00:00
Dominik Dröscher
7e9a6dd8b5 Oops, will keep this out for now. Need to discuss where to put the leged first.
git-svn-id: file:///svn/phpbb/trunk@6404 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-24 14:47:42 +00:00
Meik Sievertsen
287fe750ea i am tired of the support requests for those having changed the permissions of the cache folder on an update (not intentionally most of the time though)
git-svn-id: file:///svn/phpbb/trunk@6403 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-24 14:43:33 +00:00
Dominik Dröscher
46c961b5f5 Giving breadcrumbs their own home. (#4450)
Note that this is currently kinda broken, please no bug reports on the bottom breadcrumb not showing!


git-svn-id: file:///svn/phpbb/trunk@6402 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-24 14:34:39 +00:00
Meik Sievertsen
25fc7e62cd this change may introduce yet another query (not if store_reverse is used internally most of the time), but i hardly noticable on small forums. This change scales very very better than the old method. With the old one viewforum became slower and slower the more topics were present. For me the difference for a forum with 100.000 topics were 0.4 seconds (local server) - for others the speed increase should be noticeably higher.
git-svn-id: file:///svn/phpbb/trunk@6401 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-24 14:03:57 +00:00
Graham Eames
cb31a4446d Forgot this one yesterday
git-svn-id: file:///svn/phpbb/trunk@6400 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-24 12:24:22 +00:00
Jonathan Stanley
6ac33db38d Righto... my first checkin for these language related thingies. Hopefully nothing
has blown up! ;)

The basic style guide is:

1) British English, Cambridge style... ie: -ise, not -ize, etc.
2) Sentence-case pervasively with exception of acronyms/abbreviations, which if not in their contracted form, shall be in title-case. If you don't like it, you can
 restyle it via CSS using text-transform: none|uppercase|lowercase|capitalize; ...
 additional hooks may be added to the strings to assist this.
3) For those that have missed the switch to UTF-8, it means that the language files need not use numeric entities anymore. &lt;, &gt; and &amp; stay though, as
 they must always be entitised.

There'll be more tweaks and changes, though this "big 'un" is out of the way and will get progressively chilly so that it can be frozen for RC1 after
 however many betas there may be. ;) Wooh! :P


git-svn-id: file:///svn/phpbb/trunk@6399 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-24 00:28:32 +00:00
Graham Eames
1d2e60b068 #3896
git-svn-id: file:///svn/phpbb/trunk@6398 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-23 19:30:01 +00:00
Graham Eames
11c278a037 #4422
git-svn-id: file:///svn/phpbb/trunk@6397 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-23 15:47:31 +00:00
David M
bab608a1b9 oops
git-svn-id: file:///svn/phpbb/trunk@6396 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-23 13:44:24 +00:00
Graham Eames
a5a9f16c0d And the schema changes for the inactive user changes
git-svn-id: file:///svn/phpbb/trunk@6395 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-23 12:39:48 +00:00
Graham Eames
cbece78f7b A reworking of how we handle inactive users
git-svn-id: file:///svn/phpbb/trunk@6394 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-23 12:27:51 +00:00
Meik Sievertsen
36fa521f92 #4428
git-svn-id: file:///svn/phpbb/trunk@6393 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-23 11:49:27 +00:00
Dominik Dröscher
1ab3494b44 Bug #3592
This changes the layout for links without redirect count a little but it stops breaking the layout in certain situations.


git-svn-id: file:///svn/phpbb/trunk@6392 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-23 11:40:21 +00:00
Meik Sievertsen
70dffaacbd fix custom bbcode html replacement to correctly replace references
It failed if there was a number directly after the token, resulting in $12345, where $1 was needed. Fixed by using ${x}

also made sure that newlines within the html replacement are not replaced with <br />.


git-svn-id: file:///svn/phpbb/trunk@6391 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-23 11:37:05 +00:00
Dominik Dröscher
d62e93ee30 Bug #3876
No need to have the forum list twice in the templates. Goodbye viewbody_subfourm, you served us well!


git-svn-id: file:///svn/phpbb/trunk@6390 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-23 11:17:03 +00:00
Meik Sievertsen
6d08ef7b3a made sql_rowseek consistent with the dbal methods as well as fixing sql_query_limit for mssql, especially if sql_query_limit($sql, 0, 0) is given...
git-svn-id: file:///svn/phpbb/trunk@6389 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-23 11:10:37 +00:00
Dominik Dröscher
7542fabaa7 Bug #4322
git-svn-id: file:///svn/phpbb/trunk@6388 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-23 10:48:20 +00:00
Meik Sievertsen
02c875ebb4 #3802
git-svn-id: file:///svn/phpbb/trunk@6387 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-23 10:08:05 +00:00
Meik Sievertsen
2069aa0f83 hopefully fixes bug #3135
git-svn-id: file:///svn/phpbb/trunk@6386 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-23 09:51:18 +00:00
David M
786b34e4d3 SET NAMES on the MySQL 4.1.2+ DBs
git-svn-id: file:///svn/phpbb/trunk@6385 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-23 02:54:17 +00:00
David M
0f8630e077 the tokenizer is buggy across several versions of PHP. The regex that is always used complies strictly with what the internal lexer uses, we are safe.
git-svn-id: file:///svn/phpbb/trunk@6384 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-23 02:46:43 +00:00
Meik Sievertsen
1d7e3e0fd9 some tiny fixes here and there
git-svn-id: file:///svn/phpbb/trunk@6383 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-22 22:14:05 +00:00
Meik Sievertsen
587ec3fa77 #4406
git-svn-id: file:///svn/phpbb/trunk@6382 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-20 13:20:18 +00:00
David M
b7dab9cdab - Oracle now works with large amounts of text
- MSSQL now works :P (sans UTF-8 support)
- The current schema files work well enough to install, etc. but must be tightened. Will get to it when I get some time...


git-svn-id: file:///svn/phpbb/trunk@6381 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-19 04:50:02 +00:00
Nils Adermann
ea065f3e67 - no more encoding mixture, say hello to UTF-8 (I'll add a validation solution for PHP 4.3.3/4 ASAP) [side effect: fixes Bug #3762]
- take local server time into consideration for birthday/age calculation
- faster active topic search
- allow changing active topic time frame [Bug #4150]
- reload stylesheet on language change [Bug #4222]


git-svn-id: file:///svn/phpbb/trunk@6380 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-17 22:02:28 +00:00
Graham Eames
e2ac2f9d7d Confirm zebra removal...... I mean friend/foe deletion :P
git-svn-id: file:///svn/phpbb/trunk@6379 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-17 15:22:01 +00:00
Meik Sievertsen
8b70eca57c *** empty log message ***
git-svn-id: file:///svn/phpbb/trunk@6378 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-17 14:45:52 +00:00
Meik Sievertsen
e43b9d2f9b removed debug_extra notice
other fixes
state that mysql.php shouldn't be used for mysql 4.1+ (actually, it should deny using it)


git-svn-id: file:///svn/phpbb/trunk@6377 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-17 14:43:49 +00:00
David M
c6c3df2a73 commenting some code :D
git-svn-id: file:///svn/phpbb/trunk@6376 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-17 02:52:19 +00:00
Graham Eames
bbc4a0c3fe * Fix default language option if more than one pack is present
* Fix moderator roles to match their description
* Add new forum role for closer mapping of converted permissions


git-svn-id: file:///svn/phpbb/trunk@6375 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-16 19:36:48 +00:00
Graham Eames
26d4694071 Extra check on table prefix for mysql
git-svn-id: file:///svn/phpbb/trunk@6374 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-16 14:04:20 +00:00
David M
b1aa007693 oops
git-svn-id: file:///svn/phpbb/trunk@6373 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-16 13:27:21 +00:00
David M
a46a0c10c9 drat
git-svn-id: file:///svn/phpbb/trunk@6372 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-16 13:25:31 +00:00
David M
fe1367b31e bug fixes
schema changes
i really hope nothing went wrong


git-svn-id: file:///svn/phpbb/trunk@6371 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-16 06:07:06 +00:00
David M
9479bc428f yet another oops...
git-svn-id: file:///svn/phpbb/trunk@6370 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-15 22:38:42 +00:00
David M
ccaaa3a307 whitespace :P
git-svn-id: file:///svn/phpbb/trunk@6369 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-15 22:24:41 +00:00
David M
2a4c853f87 new utf8_* stuff
git-svn-id: file:///svn/phpbb/trunk@6368 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-15 22:15:10 +00:00
Meik Sievertsen
f9297794b6 implement bare-bone validation for config variables...
git-svn-id: file:///svn/phpbb/trunk@6367 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-15 14:08:48 +00:00
Meik Sievertsen
79137c312c - Fix some bugs
- fixed retrieving of permissions if the LIKE statement is used as well as proper supporting (needs testing on mssql)


git-svn-id: file:///svn/phpbb/trunk@6366 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-14 14:57:29 +00:00
Meik Sievertsen
665adc1722 seems like i forgot something. :)
git-svn-id: file:///svn/phpbb/trunk@6365 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-13 18:19:39 +00:00
Meik Sievertsen
b76222cb6e - fixed some bugs
- changed attachment handling a bit
- tried to remove target tags out of the code
- do not add session ids to urls for bots as well as not creating a new session on each page view for them

I bet i introduced some bugs too. ;)


git-svn-id: file:///svn/phpbb/trunk@6364 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-13 16:08:36 +00:00
Meik Sievertsen
35c5fe21cb removing some test data to not give the impression we provide an update between betas.
git-svn-id: file:///svn/phpbb/trunk@6363 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-11 18:03:15 +00:00
David M
d3f8ea83db oops
git-svn-id: file:///svn/phpbb/trunk@6362 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-10 15:04:56 +00:00
Graham Eames
227980c7d1 Add the lock file to allow dynamic menus
git-svn-id: file:///svn/phpbb/trunk@6361 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-08 20:06:00 +00:00
Graham Eames
6568ab756c Next phase of last post changes + a few minor bugs
Note: This template variable is available but will not be used by default


git-svn-id: file:///svn/phpbb/trunk@6360 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-08 18:00:38 +00:00
Dominik Dröscher
b150ed0324 Some more username colouring
git-svn-id: file:///svn/phpbb/trunk@6359 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-08 17:35:21 +00:00
Dominik Dröscher
6a2197f196 Coloured usernames should always appear bold
git-svn-id: file:///svn/phpbb/trunk@6358 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-07 20:16:13 +00:00
Dominik Dröscher
2a470b7e4c #4174 - closing some spans
git-svn-id: file:///svn/phpbb/trunk@6357 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-07 08:33:19 +00:00
Nils Adermann
8799d8d65c oops
git-svn-id: file:///svn/phpbb/trunk@6356 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-06 20:58:53 +00:00
Graham Eames
4018c48abb Consistancy with the actual link text
git-svn-id: file:///svn/phpbb/trunk@6355 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-06 19:23:23 +00:00
Meik Sievertsen
504eef65c5 check file type
git-svn-id: file:///svn/phpbb/trunk@6354 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-05 15:17:45 +00:00
Meik Sievertsen
2c2a2c10d9 oh, forgot one thing
git-svn-id: file:///svn/phpbb/trunk@6353 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-05 09:22:57 +00:00
Meik Sievertsen
8ab85ebdb0 - fix security issue in download.php
- fixing some phpdocumentor warnings/errors
- adjust pop-before-smtp "auth" (nowadays no one should rely on it)
- add backtrace for smtp email errors if DEBUG_EXTRA is enabled


git-svn-id: file:///svn/phpbb/trunk@6352 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-04 20:35:46 +00:00
Meik Sievertsen
8c567e8c68 - fixing profile bug
- adjusting acl_gets calls (they are or'd - make sure they get checked correctly based on the situation)
- automatically assign the u_download and u_search permission to the guest group


git-svn-id: file:///svn/phpbb/trunk@6351 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-04 13:47:56 +00:00
Graham Eames
5ea461108e - Fix warning removal, x - 0 = x ;-)
- Make sure that the cached colour information is updated when altering groups
   - Also consolidate some related code at the same time


git-svn-id: file:///svn/phpbb/trunk@6350 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-02 15:36:45 +00:00
Meik Sievertsen
64af84dc6b the file updater. This is in CVS but the file is not able to be used without the correct update packages - no need to try.
Please note that even if the file is now in CVS it does not mean we provide an update path from Beta2 to any other version.


git-svn-id: file:///svn/phpbb/trunk@6349 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-02 14:34:20 +00:00
Meik Sievertsen
609744041b our new update_to_latest.php file replacement. ;)
Please note that even if the file is now in CVS it does not mean we provide an update path from Beta2 to any other version.


git-svn-id: file:///svn/phpbb/trunk@6348 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-02 13:53:50 +00:00
Meik Sievertsen
f3b545bb59 add version check to acp. Now no longer directly displayed at the acp index but accessible through the System tab and viewable by any admin (no special permisison needed).
git-svn-id: file:///svn/phpbb/trunk@6347 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-02 13:39:21 +00:00
Meik Sievertsen
49a94efe1f some icons from tortoiseCVS. Someone more competent in creating icons may want to replace them. ;)
git-svn-id: file:///svn/phpbb/trunk@6346 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-02 13:34:37 +00:00
Meik Sievertsen
3ea2d53cb2 some changes/fixes
git-svn-id: file:///svn/phpbb/trunk@6345 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-02 13:33:06 +00:00
Dominik Dröscher
cf7a261408 necessary!
git-svn-id: file:///svn/phpbb/trunk@6344 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-02 12:56:49 +00:00
Dominik Dröscher
5e2cfc887f Fixing a few minor things ... Sorry Jon, got bored and fixed some of the spelling mistakes assigned to you. :)
git-svn-id: file:///svn/phpbb/trunk@6343 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-02 12:00:21 +00:00
Meik Sievertsen
5f30881c2c fix some bugs - hopefully not breaking anything...
git-svn-id: file:///svn/phpbb/trunk@6342 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-09-01 13:16:22 +00:00
Dominik Dröscher
888bbf6ff4 Forgot to check whether visual confirmation displayed properly with the new reauth layout. I didn't. Did I mention that I hate working with tables for layout? Thank the gods for the new style. ;-)
git-svn-id: file:///svn/phpbb/trunk@6341 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-31 22:11:30 +00:00
Dominik Dröscher
85902a9056 - removing the registration text / privacy policy and terms of use link for admin reauthentication - --------- - changing the layout of the reauth login a little due to the above changes
git-svn-id: file:///svn/phpbb/trunk@6340 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-31 21:49:29 +00:00
Dominik Dröscher
4d61431256 Fixed cell width
git-svn-id: file:///svn/phpbb/trunk@6339 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-30 20:12:54 +00:00
Dominik Dröscher
4354729066 Some interface work on the ACP:
- #3774 and more


git-svn-id: file:///svn/phpbb/trunk@6338 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-30 19:47:36 +00:00
Graham Eames
996d946148 Correctly set IP address on initial post and user profile
git-svn-id: file:///svn/phpbb/trunk@6337 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-30 19:44:32 +00:00
Graham Eames
d64e44b878 Error if no post in a forum
git-svn-id: file:///svn/phpbb/trunk@6336 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-30 19:33:55 +00:00
David M
239bd5e37c oops :P
git-svn-id: file:///svn/phpbb/trunk@6335 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-30 13:15:36 +00:00
David M
733774d747 - Bug #3986
git-svn-id: file:///svn/phpbb/trunk@6334 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-30 01:31:50 +00:00
David M
3f6318f2b1 - Bug #4028
git-svn-id: file:///svn/phpbb/trunk@6333 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-30 01:15:40 +00:00
David M
bb3034eb26 - Bug #4000
git-svn-id: file:///svn/phpbb/trunk@6332 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-30 00:58:36 +00:00
David M
bd4391d4ca - Bug #3978
git-svn-id: file:///svn/phpbb/trunk@6331 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-30 00:52:14 +00:00
Nils Adermann
457078f2cf - only highlight when there is anything to highlight
git-svn-id: file:///svn/phpbb/trunk@6330 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-29 20:25:28 +00:00
Meik Sievertsen
1564013fdd a script to update old bbcode bitfields to the new format. ;)
git-svn-id: file:///svn/phpbb/trunk@6329 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-29 17:23:44 +00:00
Meik Sievertsen
1307146a93 small correction to the coding guidelines
git-svn-id: file:///svn/phpbb/trunk@6328 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-29 15:52:05 +00:00
Meik Sievertsen
69983a2d4e fixing bug #4078
git-svn-id: file:///svn/phpbb/trunk@6327 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-29 15:05:56 +00:00
Meik Sievertsen
284cba438b hopefully fixing bug #3966
git-svn-id: file:///svn/phpbb/trunk@6326 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-29 14:57:17 +00:00
Nils Adermann
b4c095cb3e -forgot list items
git-svn-id: file:///svn/phpbb/trunk@6325 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-28 21:15:05 +00:00
Dominik Dröscher
64dc59ac82 What is that you say? Coding guidelines? I don't know no freaking coding guidelines!
git-svn-id: file:///svn/phpbb/trunk@6324 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-28 20:20:38 +00:00
Dominik Dröscher
4cf8487e8d Some language changes. Don't get too excited when I submit stuff.
git-svn-id: file:///svn/phpbb/trunk@6323 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-28 20:11:48 +00:00
Dominik Dröscher
e59432cbc5 Hehehehe ...
git-svn-id: file:///svn/phpbb/trunk@6322 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-28 18:45:18 +00:00
Nils Adermann
c0a880b665 - birthdays/age in user's timezone and not server's local time
- parse bbcode in posts with fewer characters than selected maximum on search results page
- retrieve search word context in posts which are longer than maximum characters (no raw BBCode anymore)
- formatted text is processed in the same order everywhere now: censor_text, replace newlines, bbcode, smileys, attachments, highlighting [including Bug #2048]
- highlighting pattern updated to exclude style and script (e.g custom BBCode) [Bug #3856]
- fixed a style problem in Opera [Bug #3770]
- performance increase for user::img()
- slight adjustments to search


git-svn-id: file:///svn/phpbb/trunk@6321 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-28 17:20:21 +00:00
Meik Sievertsen
1d37b69ddd - some bugfixes
- using E_USER_WARNING if an error occurred within the ACP (sadly not able to use it as a default for trigger_error - it seems to be hardcoded in PHP)


git-svn-id: file:///svn/phpbb/trunk@6320 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-28 15:50:33 +00:00
Dominik Dröscher
902285684d Some more minor style bugs fixed.
git-svn-id: file:///svn/phpbb/trunk@6319 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-27 19:22:06 +00:00
Dominik Dröscher
6d583dcf6e Testing, testing, ... is this thing on?
Some cleaning up on view profile - bug #3834


git-svn-id: file:///svn/phpbb/trunk@6318 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-27 18:32:22 +00:00
Meik Sievertsen
e7cbcfe874 some fixes.
David, could you check the pass_complex expressions? They are:
.* PASS_TYPE_ANY (any characters are allowed, no check)
[a-zA-Z] PASS_TYPE_CASE (password must contain alphanumerics)
[a-zA-Z0-9] PASS_TYPE_ALPHA (password must contain alphanumerics and numbers)
[a-zA-Z\W] PASS_TYPE_SYMBOL (password must contain alphanumers, numbers and symbols)

At the moment the pass complexity check is done within validate_password(), but the expressions are wrong. :)


git-svn-id: file:///svn/phpbb/trunk@6317 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-25 15:15:53 +00:00
Meik Sievertsen
d1ae8c52a4 colour is a string. :)
git-svn-id: file:///svn/phpbb/trunk@6316 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-23 15:46:10 +00:00
Graham Eames
e6e1be9827 Fix some minor bugs arising from yesterday.
Nils - I haven't looked into the other related pages yet


git-svn-id: file:///svn/phpbb/trunk@6315 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-23 14:59:52 +00:00
Meik Sievertsen
5fda5b4ab0 fix redirect if we are within the admin directory (not /ucp.php but /{admin_directory}/index.php)
git-svn-id: file:///svn/phpbb/trunk@6314 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-23 07:52:07 +00:00
Meik Sievertsen
cb23c1f044 Thanks to the GPL we are able to use the pear package text_diff - now splitted into the diff classes, the renderer and the engine
git-svn-id: file:///svn/phpbb/trunk@6313 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-22 21:29:45 +00:00
Meik Sievertsen
1d42d1b981 some updates. Also adjusted the utf tools and normalizer more to our coding guidelines.
git-svn-id: file:///svn/phpbb/trunk@6312 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-22 21:26:06 +00:00
Graham Eames
b0afc8e632 Phase 2 of the changes
This should now be complete


git-svn-id: file:///svn/phpbb/trunk@6311 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-22 11:01:56 +00:00
Meik Sievertsen
556bbfe856 specialchar sql query to ensure proper display if there are html characters within the sql query
git-svn-id: file:///svn/phpbb/trunk@6310 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-22 10:57:57 +00:00
Graham Eames
4553293053 Initial batch of colourization changes. This includes:
- schema changes for first post and last post
 - display in viewforum, search and ucp of first post
 - update of database on posting
Still outstanding
 - display of last post


git-svn-id: file:///svn/phpbb/trunk@6309 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-21 15:58:48 +00:00
Meik Sievertsen
1332ec033f - add some language variables i will need at another location. ;)
- also add X-Sendfile support to the download.php file.


git-svn-id: file:///svn/phpbb/trunk@6308 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-20 19:50:08 +00:00
Graham Eames
49d56f90e5 Poll ended at....
git-svn-id: file:///svn/phpbb/trunk@6307 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-20 17:47:47 +00:00
Graham Eames
56d517d1be Duplicated entry in the sort options
+ misc template issues


git-svn-id: file:///svn/phpbb/trunk@6306 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-20 15:48:00 +00:00
Graham Eames
80162a8145 Minor schema change related to avatars so that they can be > 127px in size
Add additional note about the install directory
Remove some empty tags from the template


git-svn-id: file:///svn/phpbb/trunk@6305 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-20 12:59:15 +00:00
Meik Sievertsen
9db68f5d4e put a comment to the captcha_gd header so everyone understands that no more policies are allowed to the extend that some will most likely be removed.
git-svn-id: file:///svn/phpbb/trunk@6304 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-20 11:04:27 +00:00
David M
7c59533950 more efficient + fixing an oops
git-svn-id: file:///svn/phpbb/trunk@6303 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-19 14:36:00 +00:00
David M
f39eeda225 The regex used here are more or less identical to those used internally by the PHP lexer (ok, ok, they are a *little* bit more optimized), we should not need to call the tokenizer at all now...
git-svn-id: file:///svn/phpbb/trunk@6302 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-19 04:42:13 +00:00
David M
11dba17606 *** empty log message ***
git-svn-id: file:///svn/phpbb/trunk@6301 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-18 21:19:39 +00:00
David M
7e3c54ed60 *** empty log message ***
git-svn-id: file:///svn/phpbb/trunk@6300 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-18 20:59:43 +00:00
David M
0fa54c182a *** empty log message ***
git-svn-id: file:///svn/phpbb/trunk@6299 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-18 20:44:25 +00:00
David M
c2f253af23 *** empty log message ***
git-svn-id: file:///svn/phpbb/trunk@6298 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-17 13:23:49 +00:00
David M
6294974d86 forgot to remove some debug code :P
git-svn-id: file:///svn/phpbb/trunk@6297 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-17 04:27:38 +00:00
David M
cfc23dd562 - getcwd replacement
- realpath stuff thanks to Chris


git-svn-id: file:///svn/phpbb/trunk@6296 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-17 04:26:07 +00:00
David M
10f1be96ff If this does not fix it, I am not quite so sure it *can* be fixed as this output exactly models that of the official MySQL tools...
git-svn-id: file:///svn/phpbb/trunk@6295 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-17 01:47:14 +00:00
David M
e6be1795ca *** empty log message ***
git-svn-id: file:///svn/phpbb/trunk@6294 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-17 01:15:01 +00:00
David M
481f090a39 chr(0x20 | 0x10) = "0"
git-svn-id: file:///svn/phpbb/trunk@6293 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-15 02:13:05 +00:00
David M
75ca1c9764 If i could force you all to use PHP 5.1.0+, then i could just use the count param with preg_replace. Oh well...
git-svn-id: file:///svn/phpbb/trunk@6292 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-15 01:08:51 +00:00
Graham Eames
332bd12835 Add GD to the list of optional requirements since it allows more VC images to be used
git-svn-id: file:///svn/phpbb/trunk@6291 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-13 18:21:43 +00:00
Meik Sievertsen
125b1dde8a re-allow editing icons and smilies. :/
git-svn-id: file:///svn/phpbb/trunk@6290 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-13 14:08:23 +00:00
Nils Adermann
559ff6c678 we don't want all topics when searching for just a few\!
git-svn-id: file:///svn/phpbb/trunk@6289 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-13 12:23:32 +00:00
Graham Eames
dced943db5 Revert a deletion made earlier today
git-svn-id: file:///svn/phpbb/trunk@6287 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 20:24:25 +00:00
Meik Sievertsen
5b164b086b make sure we do not have empty select fields
git-svn-id: file:///svn/phpbb/trunk@6286 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 19:36:36 +00:00
Graham Eames
5c0b8186a0 Hide forums you can't move posts to from within the mcp
git-svn-id: file:///svn/phpbb/trunk@6285 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 19:06:09 +00:00
Nils Adermann
3675b8fcd6 - set default_style when the old default style is being deleted
- Do not search for moved topics in the premade searches (new/active/unanswered) and if one occurs for whatever reason, at least display it properly [Bug #3756]


git-svn-id: file:///svn/phpbb/trunk@6284 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 18:46:47 +00:00
David M
31cf21e3c2 radius += 2
git-svn-id: file:///svn/phpbb/trunk@6283 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 18:46:06 +00:00
David M
38397c58fa *** empty log message ***
git-svn-id: file:///svn/phpbb/trunk@6282 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 18:26:54 +00:00
David M
edb40a59aa *** empty log message ***
git-svn-id: file:///svn/phpbb/trunk@6281 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 17:56:33 +00:00
David M
e85b5d9f6e forgot this :P
git-svn-id: file:///svn/phpbb/trunk@6280 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 17:08:26 +00:00
Meik Sievertsen
2ab9ebad06 firebird :P
git-svn-id: file:///svn/phpbb/trunk@6279 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 17:06:38 +00:00
David M
974347b35a Firebird :P
git-svn-id: file:///svn/phpbb/trunk@6278 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 16:50:13 +00:00
Graham Eames
22dd6ccc5d Missing lang strings
git-svn-id: file:///svn/phpbb/trunk@6277 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 15:56:17 +00:00
Graham Eames
560c570823 Allow ACP access if install/ is present and display the generic board disabled message otherwise so that a user does not know the reason for it being disabled
git-svn-id: file:///svn/phpbb/trunk@6276 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 15:37:28 +00:00
Meik Sievertsen
f5cabf864c bugfixes
git-svn-id: file:///svn/phpbb/trunk@6275 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 15:10:43 +00:00
Nils Adermann
ef71892edd - casting to int so this won't throw any unwanted errors
git-svn-id: file:///svn/phpbb/trunk@6274 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 15:02:04 +00:00
Nils Adermann
b3b09186fe m_approve_fid should be negated
git-svn-id: file:///svn/phpbb/trunk@6273 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 14:58:02 +00:00
Nils Adermann
e9a14eebf6 - removed some more useless language strings [Bug #3648]
- removed hard to translate words "by" and "on"


git-svn-id: file:///svn/phpbb/trunk@6272 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 13:55:01 +00:00
Meik Sievertsen
8405f0d324 sql_in_set changes
git-svn-id: file:///svn/phpbb/trunk@6271 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 13:14:39 +00:00
Meik Sievertsen
0c6bfcf4c7 update schema for oracle
git-svn-id: file:///svn/phpbb/trunk@6270 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 12:54:16 +00:00
Graham Eames
5431815b0a Language variable for consistancy with the other mcp modules
git-svn-id: file:///svn/phpbb/trunk@6269 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 11:04:33 +00:00
Graham Eames
a4c580e8f8 Check the prefix length to ensure that the key names are within the maximum for that DBMS
git-svn-id: file:///svn/phpbb/trunk@6268 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 07:00:26 +00:00
David M
ca2a672d20 - New color generation system, please report any images that have issues.
git-svn-id: file:///svn/phpbb/trunk@6267 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 02:09:41 +00:00
Nils Adermann
b1ef984526 - auto sync attachment topic flag [Bug #2949]
- corrected paths for templates stored in the db and filenames displayed in the template editor [Bug #3662]
- removed some useless language strings [Bug #3648]
- corrected escaping of usernames and passwords in auth modules [Bug #3696], added ldap_escape


git-svn-id: file:///svn/phpbb/trunk@6266 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 01:58:58 +00:00
David M
b5a6291fa5 - oops
git-svn-id: file:///svn/phpbb/trunk@6265 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-12 01:38:00 +00:00
David M
a8c49875f7 heh
git-svn-id: file:///svn/phpbb/trunk@6264 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-11 22:06:54 +00:00
David M
86f3d738a0 so.... what does this thing do?
well, the super fast, ultra efficient, massively huge BBCode handling system was implemented differently on each DBMS. Although this provided the best performance, the solution was a bit hacky.

So what does this new thing do? We use base64 encoding to make everything nice and shiny, it turns into nice, safe characters that we can just jam into varchars on essentially any database. This has two implications: we must decode every bitfield we get AND we have slightly fewer IDs to work with. It goes down from 2040 BBCodes to 1512. We lose like a quarter of them :P

P.S. I hope nothing broke :P


git-svn-id: file:///svn/phpbb/trunk@6263 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-11 21:52:46 +00:00
Nils Adermann
9086adad3c Oops, I forgot the negate bit in sql_in_set()
git-svn-id: file:///svn/phpbb/trunk@6262 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-11 18:21:59 +00:00
Nils Adermann
d8af8223cd Adding the sql_in_set function which should give us a bit of a performance improvement for queries using IN with just one value
git-svn-id: file:///svn/phpbb/trunk@6261 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-11 17:43:03 +00:00
Meik Sievertsen
7508b00978 submit some attachment changes/fixes as well as fixing the language pack download for zip files.
git-svn-id: file:///svn/phpbb/trunk@6260 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-11 13:21:51 +00:00
Meik Sievertsen
b70a0369af fixing bug #3702
git-svn-id: file:///svn/phpbb/trunk@6259 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-11 10:24:37 +00:00
Meik Sievertsen
09dc825079 - include missing files in language pack download
- add mods directory, else we most likely forget that language files within the mods directory are automatically editable (to support seperating mod language files).


git-svn-id: file:///svn/phpbb/trunk@6258 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-11 10:09:54 +00:00
Nils Adermann
83e6dcb1ce - removed a useless line [Bug #3656]
- do not reuse session ids [Bug #3626]
- Bug #3684
- added refresh imageset option


git-svn-id: file:///svn/phpbb/trunk@6257 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-10 13:33:06 +00:00
Meik Sievertsen
53085a4c78 - load tracking updates. Need to be tested on a clean installation too - at the moment only tiny quirks are noticed at area51.
- reported bugs fixed


git-svn-id: file:///svn/phpbb/trunk@6256 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-09 21:03:46 +00:00
David M
b470f34807 Nobody found this bug so i guess nobody has such an old DB :P
MySQL < 4.1.2 has a broken varbinary. TINYBLOB is (2**8)-1 characters = 255. This means we can let older DBs use our stuff without any fear.


git-svn-id: file:///svn/phpbb/trunk@6255 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-09 15:53:10 +00:00
Nils Adermann
c69a6f7acd - fixed some problems with themes
- added support for {IMG_NAME_SRC}, {IMG_NAME_WIDTH} and {IMG_NAME_HEIGHT}
- fulltext_native has to use group by in a few more quries


git-svn-id: file:///svn/phpbb/trunk@6254 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-08 19:02:44 +00:00
Graham Eames
2ed25800c5 Add a missing image, thanks dhn :)
git-svn-id: file:///svn/phpbb/trunk@6253 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-07 19:44:17 +00:00
David M
285ffad3c1 This is kinda nice.. Before MySQL 5.0.3, traling spaces were removed when values were stored. This means that some BBCodes might not have worked. A bad thing. So, I cleverly stick a \0 at the end if this is the case. The \0 does not really modify the bitfield at all, it simply represents that there are no BBCodes in that range of eight. Idealy, we should do a version check to see if this is needed but this is just a nice fix for now...
git-svn-id: file:///svn/phpbb/trunk@6252 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-07 18:43:30 +00:00
Meik Sievertsen
46d7df8772 ups
git-svn-id: file:///svn/phpbb/trunk@6251 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-07 13:25:56 +00:00
Meik Sievertsen
19db55e8f3 updated schema files. Also added a new load setting and some missing keys.
git-svn-id: file:///svn/phpbb/trunk@6250 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-07 13:22:42 +00:00
Meik Sievertsen
644c4bd046 also make sure users not allowing cookies are retained on the first visit ;)
git-svn-id: file:///svn/phpbb/trunk@6249 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-07 10:45:05 +00:00
Meik Sievertsen
9193878c05 Fix session id assignment for bots (previously this bug related in bots creating a new session for every view, now bots are assigned one session like normal users - still no rotation).
If cookie is there but having an empty session try to get it through the url - but also resetting the user


git-svn-id: file:///svn/phpbb/trunk@6248 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-07 10:42:22 +00:00
David M
b789628c57 *** empty log message ***
git-svn-id: file:///svn/phpbb/trunk@6247 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-07 03:21:28 +00:00
David M
cbd65ca2c9 Databases that gain cool points:
MSSQL
Firebird
SQLite
Oracle

Databases that lose cool points:
MySQL
PostgreSQL

MySQL recently-ish gained character set features. PostgreSQL has zero, none; one must create the database as unicode. The only way I can think of getting PostgreSQL to do what I want it to do would require something rather crazy...


git-svn-id: file:///svn/phpbb/trunk@6246 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-06 19:20:35 +00:00
Nils Adermann
7c01c5ceb9 Backup files are now named backup_[timestamp].sql.*
git-svn-id: file:///svn/phpbb/trunk@6245 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-06 18:47:11 +00:00
David M
ed69b27cb6 *** empty log message ***
git-svn-id: file:///svn/phpbb/trunk@6244 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-06 18:18:02 +00:00
David M
5541765c4a - Bug
git-svn-id: file:///svn/phpbb/trunk@6243 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-06 18:06:00 +00:00
Graham Eames
34a8d610c0 Fix a minor typo
git-svn-id: file:///svn/phpbb/trunk@6242 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-06 17:43:39 +00:00
Nils Adermann
8b079894f3 - finally making the age calculation work [Bug #3582]
- replacing all occurances of L_NONE with a more specific string [Bug #3494]
- a few corrections to html id attributes in the installer
- using correct permission in mcp_report [Bug #2471]
- allow deleting the avatar, when no upload method is enabled and hide the delete button if no avatar is set


git-svn-id: file:///svn/phpbb/trunk@6241 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-06 17:25:29 +00:00
Graham Eames
4af44652ac Fix a couple of hard-coded strings in the templates
git-svn-id: file:///svn/phpbb/trunk@6240 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-06 14:18:05 +00:00
David M
f8c6379915 *** empty log message ***
git-svn-id: file:///svn/phpbb/trunk@6239 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-06 06:06:00 +00:00
David M
2f901a5203 This should end some issues we have been having regarding the proper binary encoding of stuff. :D
Acyd Burn: quit breaking the schema :P


git-svn-id: file:///svn/phpbb/trunk@6238 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-06 05:52:41 +00:00
Meik Sievertsen
b4b901b825 - fixed some bugs
- made imageset naming more consistent
- updated every schema to be consistent and also fixed it (every db should install fine now)
-


git-svn-id: file:///svn/phpbb/trunk@6237 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-05 15:49:28 +00:00
Graham Eames
0a007bd5d7 Deal with incorrect keys in the config file
git-svn-id: file:///svn/phpbb/trunk@6236 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-03 21:00:51 +00:00
Graham Eames
6742bcece7 Hide smilies if disabled
git-svn-id: file:///svn/phpbb/trunk@6235 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-03 20:24:56 +00:00
Graham Eames
a4f35f045e Min ranks
git-svn-id: file:///svn/phpbb/trunk@6234 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-03 19:52:48 +00:00
Graham Eames
957a3bcda1 Assorted minor language changes
git-svn-id: file:///svn/phpbb/trunk@6233 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-03 19:10:39 +00:00
Meik Sievertsen
82f42bb5fa - custom profile field fixed
- fixing sql_fetchfield from cache
- changing the quote parser. In my tests i have not seen changed behaviour - but i might have broken something with this change.


git-svn-id: file:///svn/phpbb/trunk@6232 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-03 15:23:34 +00:00
Graham Eames
650007a5f1 Fix a speeling error ;-)
git-svn-id: file:///svn/phpbb/trunk@6231 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-02 17:55:34 +00:00
Meik Sievertsen
a7225f2952 ok, but this time...
git-svn-id: file:///svn/phpbb/trunk@6230 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-02 17:38:48 +00:00
Meik Sievertsen
a07193a22a this change should let firebird work again correctly... or not.
git-svn-id: file:///svn/phpbb/trunk@6229 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-02 17:18:23 +00:00
Meik Sievertsen
b15a3111be - fixing some bugs
- removed file_exists calls for auth plugins since they need to be there once set up


git-svn-id: file:///svn/phpbb/trunk@6228 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-02 15:53:19 +00:00
Nils Adermann
48a48aa86d fixing a typo ;-)
git-svn-id: file:///svn/phpbb/trunk@6227 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-02 09:36:31 +00:00
Nils Adermann
63322c5a0e mysqli results are objects, not resources
git-svn-id: file:///svn/phpbb/trunk@6226 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-02 09:13:39 +00:00
Nils Adermann
09081e410f - acm_file uses an index pointer to the current row instead of shifting the result array now [Bug #2451]
- all dbals adjusted to use the cache in sql_fetchfield, sql_rowseek, sql_numrows and sql_freeresult [Bug #2451]
- use include_once for dbal.php to at least theoretically allow connections to multiple databases at once
- added a space to an SQL query [Bug #3506]
- detailed information on adding friends/foes [Bugs #2509, #2499]
- e modifier stands for evil, so I removed it ;-)
- corrected progress_bar image filename in imageset.cfg [Bug #3374]


git-svn-id: file:///svn/phpbb/trunk@6225 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-01 16:14:14 +00:00
Meik Sievertsen
ced8624b8e - fixing some bugs
- shortening some db columns to meet the requirements
- correctly increase/decrease user post counts
- fix the topic title length bug(s)


git-svn-id: file:///svn/phpbb/trunk@6224 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-01 15:29:47 +00:00
David M
541dbf8af0 - BBCode helpline is now customizable
git-svn-id: file:///svn/phpbb/trunk@6223 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-01 05:06:33 +00:00
David M
3c69c8f00a - Captcha ACP
- BBCode stuff


git-svn-id: file:///svn/phpbb/trunk@6222 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-01 04:23:13 +00:00
David M
85e049dd66 eh
git-svn-id: file:///svn/phpbb/trunk@6221 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-01 04:01:35 +00:00
David M
3fb98a7598 - Something, something, something
git-svn-id: file:///svn/phpbb/trunk@6220 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-01 03:56:36 +00:00
David M
1527407654 me === idiot
git-svn-id: file:///svn/phpbb/trunk@6219 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-08-01 03:45:40 +00:00
David M
936b1d2586 Who is an idiot? I AM
git-svn-id: file:///svn/phpbb/trunk@6218 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-30 18:21:02 +00:00
Graham Eames
8b14bdc73d Adding the new warning image to the appropriate places
Thanks to dhn for the image


git-svn-id: file:///svn/phpbb/trunk@6217 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-30 14:20:12 +00:00
Nils Adermann
0815df3c58 - removed an accidentaly pasted line [Bug #3227]
- added missing images to acp_styles [Bug #2623] and added a new image btn_warn
- use the style name when exporting a style instead of the non existant path [Bug #2343]
- fixed an incorrect call of acp_styles::install_style() [Bug #2325]
- always define $search_query in fulltext_mysql [Bug #3476]


git-svn-id: file:///svn/phpbb/trunk@6216 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-30 14:09:52 +00:00
Graham Eames
7bff8d1096 Correct some of the sort options
git-svn-id: file:///svn/phpbb/trunk@6215 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-29 11:35:32 +00:00
Graham Eames
f3610a934c Fix list indentation
git-svn-id: file:///svn/phpbb/trunk@6214 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-29 10:59:56 +00:00
David M
b8076c575c - Bugs
git-svn-id: file:///svn/phpbb/trunk@6213 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-28 03:45:32 +00:00
David M
22d778fcff - Fix Oracle
- Make MySQL schema a little different than the others...
- Fix MCP_TOPIC


git-svn-id: file:///svn/phpbb/trunk@6212 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-28 02:56:02 +00:00
Nils Adermann
007f4f6987 - fixed the age calculation (note: turn on your brain before commiting something like this the next time) [Bug #3337]
- removed the split_words array, introduced an enforced search_query
- the forum used for global topics in the search is now a forum, and no longer a category [Bug #2561]
- Bug #3404
- allow accessing reports by report_id, in contrast to mcp_queue this cannot just use the post id, since there can be multiple closed reports per post, so closed reports have to be accessed by report id, open reports, can optionally be accessed by report id or post id [Bug #3149]
- only attempt to unflag reported topics on closing a report when there are any without other reported posts [Bug #3057]
- updated fulltext_mysql to use the the search_query string
- overwrote the old fulltext_native with our improved version since it consumes too much time to maintain boths and we would switch to the improved version later anyway
- always show a link to search a user's posts even if the postcount is zero since he  might only have posted in forums which do not count posts [Bug #3267]


git-svn-id: file:///svn/phpbb/trunk@6211 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-27 19:02:47 +00:00
David M
412cf50689 oops :P
git-svn-id: file:///svn/phpbb/trunk@6210 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-25 11:58:11 +00:00
David M
9532514c2a OK...
This commit should increase the total number of BBCodes from 31 to 2040. Some things to watch out for:

Each database likes to deal with binary data in its own, special way. They are, quite frankly, too cool for school.

MySQL, MSSQL and Oracle all allow me to send in a default value for their binary column using a hex number. However, MSSQL forces me to send the specific data as a hex number and thus we must CAST it.

PostgreSQL allows me to set a binary column, but with a twist. It demands that the default be in _octal_ and its datatype allows somewhere around a gigabyte's worth of BBCodes ( PGSQL users, we shut you down to 2040 for your own good! )

Firebird has no decent mechanism for allowing me to shuttle in binary data so I must force my way in. By virtue of triggers and a UDF, we ram in our default values.

SQLite is the most bizarre of them all. They have no mechanism for turning an ASCII code into a ASCII character. Because of this, we have a trigger and a UDF (just like Firebird!) but with a twist! The UDF is defined on the PHP side of things instead of SQL. SQLite also demands that it's data be encoded before being sent off.

Other notes:
- SQLite installs again :D
- Firebird nearly installs again :P
- Database backup is not screwed up :P

P.S.
I hope nothing broke :D


git-svn-id: file:///svn/phpbb/trunk@6209 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-24 10:08:36 +00:00
Ludovic Arnaud
48b2dc1277 Fixed: bug #3243
git-svn-id: file:///svn/phpbb/trunk@6208 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-24 07:53:35 +00:00
Ludovic Arnaud
b7b8bf3857 Fixed: oops, forgot ASP-like tags
Fixed: <?! was not escaped, despite being valid PHP
(cvstats++)


git-svn-id: file:///svn/phpbb/trunk@6207 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-23 22:38:27 +00:00
Ludovic Arnaud
ed69875649 Fixed: bug #3352 (function token_get_all() is missing)
git-svn-id: file:///svn/phpbb/trunk@6206 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-23 22:16:05 +00:00
Ludovic Arnaud
afad755f93 Fixed: a double slash appears in the installer URL if you go to the board and config.php is missing
git-svn-id: file:///svn/phpbb/trunk@6205 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-23 21:26:53 +00:00
Ludovic Arnaud
185702fd5d Fixed: if phpBB isn't installed, it redirects to http://host.tld\/install/index.php on my Windows dev server
Changed: instead of undoubling double slashes, we replace any number of consecutive backslashes and forward slashes with a single slash


git-svn-id: file:///svn/phpbb/trunk@6204 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-23 20:59:41 +00:00
Graham Eames
4680dfce39 Include a link to the post by default when issuing a warning
git-svn-id: file:///svn/phpbb/trunk@6203 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-23 20:59:08 +00:00
Graham Eames
5e7f9e1a0d Silly copy and paste error :(
git-svn-id: file:///svn/phpbb/trunk@6202 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-23 18:52:56 +00:00
Graham Eames
ba5d555669 Make sure that the language does get passed between all modules
git-svn-id: file:///svn/phpbb/trunk@6201 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-23 17:43:48 +00:00
Graham Eames
4cf863dcb3 Changes to the language handling during the install
git-svn-id: file:///svn/phpbb/trunk@6200 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-23 16:04:51 +00:00
Graham Eames
5879c1c5c1 * Error handling on bans
* Missing language strings
* Grammatical correction in viewtopic (singular vs plural)


git-svn-id: file:///svn/phpbb/trunk@6199 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-21 20:44:27 +00:00
Meik Sievertsen
73ac6b1423 - some bugfixes
- set ip_check to A.B.C. by default
- display postings in other encodings by default and present link to force the encoding as usual.


git-svn-id: file:///svn/phpbb/trunk@6198 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-20 21:45:24 +00:00
Ludovic Arnaud
3f3db8cdaa Changed: add a space both before AND after Hangul and CJK characters so that they are never part of another word
git-svn-id: file:///svn/phpbb/trunk@6197 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-20 21:26:54 +00:00
Graham Eames
d20997f5bc * Missing image in imageset editing
* Sort the list of images
* Enforce default username limits on install


git-svn-id: file:///svn/phpbb/trunk@6196 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-20 20:27:23 +00:00
Meik Sievertsen
191a21d461 could have been a copy&paste error, but the expression is also removing the </script> tag from valid script blocks (javascript for example). :)
git-svn-id: file:///svn/phpbb/trunk@6195 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-20 18:39:00 +00:00
Meik Sievertsen
13bf07d275 another expression for grabbing php code in templates provided by david
also included "the ultimate solution" provided by ludovic (only added a check for T_OPEN_TAG_WITH_ECHO


git-svn-id: file:///svn/phpbb/trunk@6194 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-20 17:57:56 +00:00
Meik Sievertsen
b4d834ed09 revert a change i made (we already adjust line endings to be rfc-compliant and use \n for the php mail function as suggested by the manual)
git-svn-id: file:///svn/phpbb/trunk@6193 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-20 17:55:36 +00:00
Graham Eames
1984ab5af5 Efficiency improvement to the log viewing code
+ reverting what appears to be an accidental change to the report viewing code


git-svn-id: file:///svn/phpbb/trunk@6192 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-18 20:34:26 +00:00
Graham Eames
ec3bcb4a82 Absolutely no changes whatsoever......I'm just fixing some broken line-endings which have crept in so that they match the coding standards
git-svn-id: file:///svn/phpbb/trunk@6191 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-18 19:47:54 +00:00
Meik Sievertsen
99a7ce5bbe fix the schema files as well as other tiny bugs.
git-svn-id: file:///svn/phpbb/trunk@6190 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-17 15:32:46 +00:00
Meik Sievertsen
1a5e4f446a - fix bug within php code removal expression. Thanks to BenP for reporting it to our security tracker.
git-svn-id: file:///svn/phpbb/trunk@6189 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-17 15:06:11 +00:00
David M
fa205b922d hmm... This commit does not increase the number of BBCodes. However, this does other things that we need to do first. This splits the usage of allow_* from the BBCode bitfield in forum descriptions, forum rules and group descriptions. This also fixes a tiny, tiny severe issue that nobody found :D I hope it works :P
git-svn-id: file:///svn/phpbb/trunk@6188 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-17 03:23:31 +00:00
Ludovic Arnaud
29d92430c5 Changed: moved functions that encode/decode NCRs from and to UTF-8 to utf_tools.php
git-svn-id: file:///svn/phpbb/trunk@6187 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-15 17:01:59 +00:00
Ludovic Arnaud
7b8f0da356 Fixed: missing file
git-svn-id: file:///svn/phpbb/trunk@6186 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-15 17:01:09 +00:00
Ludovic Arnaud
791bf27040 Updated UTF files
git-svn-id: file:///svn/phpbb/trunk@6185 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-15 16:58:22 +00:00
Graham Eames
c2390e18a8 Improved i18n support within log messages
git-svn-id: file:///svn/phpbb/trunk@6184 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-15 16:21:23 +00:00
Ludovic Arnaud
603e6cf590 Fixed: no need to pad CJK and Hangul anymore
git-svn-id: file:///svn/phpbb/trunk@6183 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-15 15:46:56 +00:00
Ludovic Arnaud
5f88af1a75 Added: support for CJK and Hangul into the search engine
git-svn-id: file:///svn/phpbb/trunk@6182 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-15 15:44:54 +00:00
Ludovic Arnaud
3b4944a476 Fixed: better SQL escaping
Removed: extended inserts on mssql and sqlite, were they really worth it?


git-svn-id: file:///svn/phpbb/trunk@6181 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-15 14:23:26 +00:00
David M
0bc61ae76c - Some profile stuff :D
- Some DB stuff :D


git-svn-id: file:///svn/phpbb/trunk@6180 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-15 10:31:51 +00:00
Nils Adermann
3a883600e8 fixing a typo in postgres dbal
git-svn-id: file:///svn/phpbb/trunk@6179 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-14 22:23:44 +00:00
Meik Sievertsen
d10e5bfc1a add not applied sql_escape in memberlist
git-svn-id: file:///svn/phpbb/trunk@6178 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-14 12:59:55 +00:00
Meik Sievertsen
c4f2430645 - renamed the following columns:
comment -> attach_comment
new, forwarded, unread, marked, deleted -> pm_new, pm_forwarded, pm_unread, pm_marked, pm_deleted
module_name -> module_basename
value -> lang_value

- every column is now NOT NULL
- every column is now having a DEFAULT value
- hopefully mostly consistent across every db schema
- untested schemas: sqlite, oracle, firebird


git-svn-id: file:///svn/phpbb/trunk@6177 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-13 12:51:56 +00:00
Ludovic Arnaud
4cd73bf7e5 Fixed: unescaped SQL strings make Bertie cry
git-svn-id: file:///svn/phpbb/trunk@6176 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-12 23:41:34 +00:00
Nils Adermann
5bf6bc1880 - it's \r\n not \n\r [Bug #3121]
- a few little search bugfixes
- drop in the improved version of the native search based on UTF-8 (still needs some work before it can replace the current native search)
  Thanks Ashe :)


git-svn-id: file:///svn/phpbb/trunk@6175 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-12 23:21:57 +00:00
Ludovic Arnaud
44b78d7c8d Added: UTF-8 tools. Both functions are used by the "improved" search engine. We'll need utf8_strlen() if we go with UTF-8 in 3.2
TODO: native recoding engine, written in PHP


git-svn-id: file:///svn/phpbb/trunk@6174 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-12 22:56:04 +00:00
Meik Sievertsen
7768d67e22 this little file should help us in creating/editing all schema files. This file already includes the proposed NULL/NOT NULL/DEFAULT changes.
The resulting schema needs to be tested - postgresql schema lacks it's CHECK values and UNSIGNED has been added. MSSQL no longer uses alter stable statements to create defaults.


git-svn-id: file:///svn/phpbb/trunk@6173 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-12 16:39:15 +00:00
Ludovic Arnaud
2cc2509473 Changed: split the tables used by the search indexer in order to load them on a need-to-use basis and preserve memory
git-svn-id: file:///svn/phpbb/trunk@6172 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-12 16:29:42 +00:00
Meik Sievertsen
9c844b15ce - also check for registered users since i do not think guests and bots want to change their password.
git-svn-id: file:///svn/phpbb/trunk@6171 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-12 06:20:50 +00:00
Meik Sievertsen
f62ac3a32f #2487 Ok, this one is finally fixed. :) Thanks to Dark Soul for letting me test this at his server. :)
and now i am going into my corner crying out loud.


git-svn-id: file:///svn/phpbb/trunk@6170 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-11 22:09:56 +00:00
Ludovic Arnaud
5aed89a8a1 Fixed: forgot to remove some debug code :(
git-svn-id: file:///svn/phpbb/trunk@6169 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-11 00:37:44 +00:00
Ludovic Arnaud
7167adb2cf Fixed: bug #3191 take two. That one should work as expected.
git-svn-id: file:///svn/phpbb/trunk@6168 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-11 00:04:02 +00:00
Ludovic Arnaud
d2e81e8bee Fixed: bug #3191 as per NeoThermic's patch
git-svn-id: file:///svn/phpbb/trunk@6167 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-10 23:55:08 +00:00
Graham Eames
eb9548f465 A few miscelaneous tweaks
git-svn-id: file:///svn/phpbb/trunk@6166 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-10 19:16:47 +00:00
Meik Sievertsen
4f7c52e9e3 fix some bugs... again. :)
git-svn-id: file:///svn/phpbb/trunk@6165 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-10 15:55:10 +00:00
Ludovic Arnaud
0fa9103a0c Changed: being anal with the notation of Unicode codepoints
Fixed: moved some constants out of the if construct because they're needed by other classes, even if the utfnormal extension exists


git-svn-id: file:///svn/phpbb/trunk@6164 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-10 03:05:27 +00:00
Ludovic Arnaud
0521ffa7d8 Added: UTF-8 normalizer along with all the data files required
git-svn-id: file:///svn/phpbb/trunk@6163 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-10 01:53:30 +00:00
Ludovic Arnaud
8c5b957228 Added: finished UTF normalization conformance tests
Added: now generate_utf_files.php also generates the files needed by the search indexer


git-svn-id: file:///svn/phpbb/trunk@6162 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-10 01:40:59 +00:00
Meik Sievertsen
46af817cb0 - tackle some usability issues
- fix bug #3147
- added the lock-images made by SHS`
- fixed MSSQL errors (adding the correct ESCAPE sequence)


git-svn-id: file:///svn/phpbb/trunk@6161 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-09 16:23:57 +00:00
David M
455add06f2 Realized that we never needed to CAST() in the first place after i remembered why i chose a DOMAIN implementation over a TYPE implementation...
DOMAINs are simpler and thus the system is capable of determining what is _really_ going on (which is why it handles indexing for us :D)


git-svn-id: file:///svn/phpbb/trunk@6160 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-09 05:13:36 +00:00
David M
0424200ac6 Short story: Oracle does not like sub queries that contain columns that have the same name
Long story: Expanding the implicitly defined columns to explicitly defined columns lets us determine which columns we are actually grabbing. This lets us avoid the problem of having two columns having the same name even though one is implicit and the other is explicit.

What does this mean? It means that when doing a limit on Oracle with an implicit column and a bunch of explicit columns, the explicit columns are the ones that "win".


git-svn-id: file:///svn/phpbb/trunk@6159 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-09 05:09:37 +00:00
Ludovic Arnaud
9ab98d0d79 Added: that script will run the UTF normalizer through a serie of conformance tests designed by the Unicode consortium for that purpose. Only the first part of the tests has been implemented yet
TODO: test for invariants


git-svn-id: file:///svn/phpbb/trunk@6158 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-09 01:54:39 +00:00
Ludovic Arnaud
17cad8f11f Added: that file will generate the files needed for Unicode normalization. The actual files will be added to CVS once we decide where to store them
git-svn-id: file:///svn/phpbb/trunk@6157 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-09 01:49:01 +00:00
Graham Eames
811b63baab Fix installation and user registration bugs
git-svn-id: file:///svn/phpbb/trunk@6156 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-08 16:53:42 +00:00
Graham Eames
62230baffd Appears that the redirect in common.php didn't work on all setups we tried, so swapping it for some new code which does
git-svn-id: file:///svn/phpbb/trunk@6155 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-07 21:50:24 +00:00
Graham Eames
63dbf43693 Change redirection logic to match the RFC better in those cases before redirect() is available to us
git-svn-id: file:///svn/phpbb/trunk@6154 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-07 20:47:25 +00:00
Nils Adermann
97cd5b1c3d - fix a stupid bug in style.php
- and we'd also like the post encoding :D


git-svn-id: file:///svn/phpbb/trunk@6153 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-07 20:38:04 +00:00
Nils Adermann
c6227ad5b0 - fixed a parse error (oops)
- pass forum_ids to search indexing functions
- fixed a bug in fulltext_native's cache destroying


git-svn-id: file:///svn/phpbb/trunk@6152 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-07 18:43:52 +00:00
Nils Adermann
a5c23243c7 - display age in user profile and make it available on viewtopic
- various tiny bugfixes including [Bug #2351] [Bug #2549] [Bug #2681] [Bug #3015]
- strip first, then change newlines [Bug #2403]
- added support for creating user profiles to the login function (makes use of user_add), triggered by LOGIN_SUCCESS_CREATE_PROFILE constant
- moved newest user updating from ucp_register to user_add function
- renamed the admin_ auth module function to acp_
- added initialisation code to auth_apache which checks whether it will work
- added user_add support to both auth_ldap and auth_apache
- some auth_ldap tweaks, should work with users deeper in the organisation structure too now
- adjusted global topics in mcp_report to work like mcp_queue


git-svn-id: file:///svn/phpbb/trunk@6151 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-07 12:36:44 +00:00
Graham Eames
8c128de642 Change meta handling, we can use existing functions for what we need and remove the redundant code
git-svn-id: file:///svn/phpbb/trunk@6150 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-06 17:07:01 +00:00
Meik Sievertsen
462dc69b8e some bugfixes
git-svn-id: file:///svn/phpbb/trunk@6149 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-06 16:46:53 +00:00
Meik Sievertsen
2b531a279f fix for a bug spotted by ToonArmy within bug #3000 (thanks to him for providing a sample patch too)
git-svn-id: file:///svn/phpbb/trunk@6148 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-06 15:00:31 +00:00
Meik Sievertsen
0050879825 re-check cookie_secure value within generate_board_url() for those users having it enabled but not running on a SSL connection (which of course results in server errors). This should (hopefully) further minimize support requests. ;)
Thanks again to aninhill for giving me full access to his board to be able to spot this error.


git-svn-id: file:///svn/phpbb/trunk@6147 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-05 15:48:43 +00:00
Ludovic Arnaud
bfb26c8a4a Changed: moved the thing that compares the amount of matches to the amount of terms from outside the query (in PHP) to inside of it, thanks to a well-placed HAVING clause
git-svn-id: file:///svn/phpbb/trunk@6146 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-04 15:16:57 +00:00
David M
291ab6216e - Make sure that the table is empty before we start cramming things inside :D
git-svn-id: file:///svn/phpbb/trunk@6145 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-04 04:08:30 +00:00
David M
6a1f1f5721 - CAPTCHA: removed the extra slash
More backup stuff

- Made some things nicer for some of the DBs
- Made postgreSQL work on non empty databases
- Made SQLite ultra fast on restore

- Properly escaped (as far as I know) the profile data fields so that one may now use reserved words as column names


git-svn-id: file:///svn/phpbb/trunk@6144 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-04 03:54:41 +00:00
Ludovic Arnaud
5ccfc08d09 Fixed: PHP notices appear when a post uses an icon that does not exist anymore
PS: that's my first CVS commit in a while, my fingers are crossed


git-svn-id: file:///svn/phpbb/trunk@6143 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-04 01:51:27 +00:00
Graham Eames
9118c5ad83 Missing language string
git-svn-id: file:///svn/phpbb/trunk@6142 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-03 19:41:55 +00:00
David M
1b48afeb30 - Database: eh? meh.
- CAPTCHA: A little easier to see which options map to which controls


git-svn-id: file:///svn/phpbb/trunk@6141 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-03 00:53:54 +00:00
David M
662e12d466 - Dramatic speed-up in SQLite backup code
- Wrote *another* patch around SQLite
- SQLite has a lack of (among other things) solid definition of their tables. e.g. "foo" and foo are both valid col names... Database backup and profile creation are now both aware of such "features"

meh, i hope this all works...


git-svn-id: file:///svn/phpbb/trunk@6140 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-03 00:21:40 +00:00
Meik Sievertsen
98fc394eb3 - fixed language pack management a bit (supporting backslashes)
- fixed ftp_fsock, also fixing a reported bug in there


git-svn-id: file:///svn/phpbb/trunk@6139 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-02 21:42:54 +00:00
Graham Eames
fdd82e4c12 Force the database connection to use to avoid a couple of problems seen in internal testing
git-svn-id: file:///svn/phpbb/trunk@6137 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-02 19:33:28 +00:00
Graham Eames
4c457ecc92 Prevent sqlite databases within the forum directory
git-svn-id: file:///svn/phpbb/trunk@6136 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-01 21:45:35 +00:00
Meik Sievertsen
6df6eb0e60 - add additional auth check to the permission roles modules
- added new function to return globally used expressions (get_preg_expression($mode)). This should be very helpful in getting wide spread similar checks (regular expressions) to one place reducing the risk of forgetting to change every location if you fix one. ;) We will add additional ones later, at the moment only the email check is retrieved...
- added "active module" var to the module class returning the current active module
- changed call to image magick
- add administrator to global moderators group by default
- extend auth_option column a little bit
- other bugfixes


git-svn-id: file:///svn/phpbb/trunk@6135 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-01 19:11:52 +00:00
Graham Eames
7ad5db1856 These needed to be #p for proper compliance
git-svn-id: file:///svn/phpbb/trunk@6134 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-01 15:00:50 +00:00
David M
3efe7ffb1f bugs? bugs.
git-svn-id: file:///svn/phpbb/trunk@6133 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-07-01 06:30:49 +00:00
Graham Eames
30563df345 SOme changes to handle special characters in the database password
git-svn-id: file:///svn/phpbb/trunk@6132 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-30 20:17:55 +00:00
Graham Eames
ee8a9a6135 New template variables in the mcp (not used by subsilver)
git-svn-id: file:///svn/phpbb/trunk@6131 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-29 19:57:06 +00:00
Graham Eames
66f5db4cec Nothing interesting, just a couple of slight language alterations
git-svn-id: file:///svn/phpbb/trunk@6130 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-28 20:26:45 +00:00
David M
c748c31fe5 ketchup? catcher? catheter? no. CAPTCHA
- New CAPTCHA ACP, only lets you enable what you can actually use :D
- CAPTCHA ACP also has a nifty demo link that lets you preview a CAPTCHA with the current settings that you enable.

I hope it all works...


git-svn-id: file:///svn/phpbb/trunk@6129 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-28 02:43:44 +00:00
Graham Eames
b451ced10e Try and protect against people trying to select an inappropriate DBAL
git-svn-id: file:///svn/phpbb/trunk@6128 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-26 21:05:49 +00:00
Graham Eames
c476382934 Split the final step of the install into 2 steps
This should help to avoid any timeouts on slow servers with the amount being done


git-svn-id: file:///svn/phpbb/trunk@6127 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-26 20:13:07 +00:00
Graham Eames
2cc905b28e Some changes to the way folder images are handled for "special" topics
git-svn-id: file:///svn/phpbb/trunk@6126 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-25 15:23:01 +00:00
Graham Eames
43fd5901ae The ability to view hidden users should not be part of the standard or restricted user roles
git-svn-id: file:///svn/phpbb/trunk@6125 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-24 21:20:43 +00:00
Graham Eames
737dea1370 Show message to those browsing whilst board is disabled
git-svn-id: file:///svn/phpbb/trunk@6124 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-24 15:52:17 +00:00
Graham Eames
097769fd07 Apply load_onlinetrack to view profile as well
git-svn-id: file:///svn/phpbb/trunk@6123 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-24 13:37:23 +00:00
Meik Sievertsen
3439d0f96e ok, first attempt at solving some compatibility issues.
- dropping in replacement for realpath


git-svn-id: file:///svn/phpbb/trunk@6122 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-24 13:27:04 +00:00
Graham Eames
1042800c28 Correct info image name
git-svn-id: file:///svn/phpbb/trunk@6121 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-24 13:15:32 +00:00
Graham Eames
03956bca97 Try to at least give very old PHP versions a reason why they can't do anything
We might review this again later to try and find the reason they were getting a blank page, but given the age of 4.2.x, there hopefully won't be too many people still running it


git-svn-id: file:///svn/phpbb/trunk@6120 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-23 20:48:30 +00:00
Graham Eames
a27ce549bd - Extra error handling to deal with a user not specifying a database name
- Re-add the move of the manage users module


git-svn-id: file:///svn/phpbb/trunk@6119 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-23 20:02:16 +00:00
Meik Sievertsen
16a40387f1 forgot some changes for post_time
git-svn-id: file:///svn/phpbb/trunk@6118 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-23 14:25:21 +00:00
Meik Sievertsen
9c31a05b1c make sure set_config is called with the correct is_dynamic value
git-svn-id: file:///svn/phpbb/trunk@6117 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-23 14:04:41 +00:00
Nils Adermann
e6c3b97999 - improve newposts search performance
git-svn-id: file:///svn/phpbb/trunk@6116 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-23 12:19:27 +00:00
Meik Sievertsen
8b1555c15b change ACL_NO to ACL_NEVER and ACL_UNSET to ACL_NO to let our users get what is meant on the first look.
the downside is that the information is no more accurate (permissions are still unset, defaulting to no) - someone might to overlook all explanations. :)


git-svn-id: file:///svn/phpbb/trunk@6115 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-22 16:49:04 +00:00
Meik Sievertsen
725b21f2d2 time to squash some bugs
git-svn-id: file:///svn/phpbb/trunk@6114 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-22 15:14:03 +00:00
Graham Eames
daa0435614 Improve i18n by installing all available language packs on install
+ unb0rk the mysql schema ;)


git-svn-id: file:///svn/phpbb/trunk@6113 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-21 20:18:02 +00:00
Meik Sievertsen
8dbef23cea show error if template path could not be determined
git-svn-id: file:///svn/phpbb/trunk@6112 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-21 16:52:10 +00:00
Meik Sievertsen
d8137406e2 disable recalculating the binary tree - this function might have a severe problem. :D And additionally it should not be needed anymore.
git-svn-id: file:///svn/phpbb/trunk@6111 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-21 16:42:24 +00:00
David M
0346b9da37 schema! hooray!
git-svn-id: file:///svn/phpbb/trunk@6110 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-21 05:16:08 +00:00
Graham Eames
73c7f34176 mysqli error + email hash
git-svn-id: file:///svn/phpbb/trunk@6109 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-20 20:46:01 +00:00
Graham Eames
0cc3aff18d Prevent warning self
git-svn-id: file:///svn/phpbb/trunk@6108 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-20 20:32:53 +00:00
Nils Adermann
4448249a44 - correctly display subcategories
- use L_TRANSLATION_INFO [Bug #2357]
- always begin with ACL_UNSET in permission trace
- allow copy permissions when editing a forum
- default to parent forum for copying permissions
- no duplication of the breadcrumps on registration [Bug #2307]


git-svn-id: file:///svn/phpbb/trunk@6107 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-20 19:00:30 +00:00
David M
c125ae1276 oops?
git-svn-id: file:///svn/phpbb/trunk@6106 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-20 00:21:16 +00:00
David M
9b0d2143bb what? yeah...
- turns out the backup issue was not a backup issue but a schema issue
- let there be color


git-svn-id: file:///svn/phpbb/trunk@6105 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-20 00:09:45 +00:00
Meik Sievertsen
52045ff263 some bugfixes
git-svn-id: file:///svn/phpbb/trunk@6104 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-19 21:30:32 +00:00
Graham Eames
cbfcf07af3 A few changes to the doc links for the beta process
git-svn-id: file:///svn/phpbb/trunk@6103 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-19 21:02:44 +00:00
Graham Eames
790f4dcc02 Prevent direct access to these files
git-svn-id: file:///svn/phpbb/trunk@6102 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-19 20:52:01 +00:00
Graham Eames
aa443a868d Deleting logs
git-svn-id: file:///svn/phpbb/trunk@6101 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-19 20:40:29 +00:00
David M
ac3f3b1ae9 SQL!
git-svn-id: file:///svn/phpbb/trunk@6100 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-18 15:50:00 +00:00
David M
5735c5176e fixes...
git-svn-id: file:///svn/phpbb/trunk@6099 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-18 15:35:32 +00:00
David M
ef9b725379 dumbness++
git-svn-id: file:///svn/phpbb/trunk@6098 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-18 15:21:31 +00:00
Graham Eames
bd3c8c50c0 This fixes a consistancy issue re the ISO language code on install, but there's still a bigger issue related to thsi to look at
git-svn-id: file:///svn/phpbb/trunk@6097 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-18 14:56:17 +00:00
Graham Eames
d3b8612402 Begone damn typo's
git-svn-id: file:///svn/phpbb/trunk@6096 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-18 14:41:40 +00:00
Graham Eames
f9f10be464 Misc installation bugs
git-svn-id: file:///svn/phpbb/trunk@6095 89ea8834-ac86-4346-8a33-228a782c2dd0
2006-06-18 11:55:45 +00:00
449 changed files with 34571 additions and 19635 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

View File

@@ -11,6 +11,7 @@
/**
*/
define('IN_PHPBB', 1);
define('ADMIN_START', 1);
define('NEED_SID', true);
// Include files
@@ -135,23 +136,29 @@ function adm_page_header($page_title)
'T_RANKS_PATH' => "{$phpbb_root_path}{$config['ranks_path']}/",
'T_UPLOAD_PATH' => "{$phpbb_root_path}{$config['upload_path']}/",
'ICON_MOVE_UP' => '<img src="' . $phpbb_admin_path . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
'ICON_MOVE_DOWN' => '<img src="' . $phpbb_admin_path . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
'ICON_EDIT' => '<img src="' . $phpbb_admin_path . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
'ICON_DELETE' => '<img src="' . $phpbb_admin_path . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
'ICON_SYNC' => '<img src="' . $phpbb_admin_path . 'images/icon_sync.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
'ICON_MOVE_UP' => '<img src="' . $phpbb_admin_path . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
'ICON_MOVE_UP_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_up_disabled.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
'ICON_MOVE_DOWN' => '<img src="' . $phpbb_admin_path . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
'ICON_MOVE_DOWN_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
'ICON_EDIT' => '<img src="' . $phpbb_admin_path . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
'ICON_EDIT_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_edit_disabled.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
'ICON_DELETE' => '<img src="' . $phpbb_admin_path . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
'ICON_DELETE_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_delete_disabled.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
'ICON_SYNC' => '<img src="' . $phpbb_admin_path . 'images/icon_sync.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
'ICON_SYNC_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_sync_disabled.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
'S_USER_LANG' => $user->lang['USER_LANG'],
'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
'S_CONTENT_ENCODING' => $user->lang['ENCODING'],
'S_CONTENT_ENCODING' => 'UTF-8',
'S_CONTENT_DIR_LEFT' => $user->lang['LEFT'],
'S_CONTENT_DIR_RIGHT' => $user->lang['RIGHT'])
);
if (!empty($config['send_encoding']))
if ($config['send_encoding'])
{
header('Content-type: text/html; charset: ' . $user->lang['ENCODING']);
header('Content-type: text/html; charset=UTF-8');
}
header('Cache-Control: private, no-cache="set-cookie", pre-check=0, post-check=0');
header('Cache-Control: private, no-cache="set-cookie"');
header('Expires: 0');
header('Pragma: no-cache');
@@ -205,14 +212,7 @@ function adm_page_footer($copyright_html = true)
$template->display('body');
// Unload cache, must be done before the DB connection if closed
if (!empty($cache))
{
$cache->unload();
}
// Close our DB connection.
$db->sql_close();
garbage_collection();
exit;
}
@@ -377,4 +377,102 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
return $tpl;
}
/**
* Going through a config array and validate values, writing errors to $error.
*/
function validate_config_vars($config_vars, &$cfg_array, &$error)
{
global $phpbb_root_path, $user;
foreach ($config_vars as $config_name => $config_definition)
{
if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false)
{
continue;
}
if (!isset($config_definition['validate']))
{
continue;
}
// Validate a bit. ;) String is already checked through request_var(), therefore we do not check this again
switch ($config_definition['validate'])
{
case 'bool':
$cfg_array[$config_name] = ($cfg_array[$config_name]) ? 1 : 0;
break;
case 'int':
$cfg_array[$config_name] = (int) $cfg_array[$config_name];
break;
// Relative path (appended $phpbb_root_path)
case 'rpath':
case 'rwpath':
if (!$cfg_array[$config_name])
{
break;
}
$destination = $cfg_array[$config_name];
// Adjust destination path (no trailing slash)
if ($destination{(sizeof($destination)-1)} == '/' || $destination{(sizeof($destination)-1)} == '\\')
{
$destination = substr($destination, 0, sizeof($destination)-2);
}
$destination = str_replace(array('../', '..\\', './', '.\\'), '', $destination);
if ($destination && ($destination[0] == '/' || $destination[0] == "\\"))
{
$destination = '';
}
$cfg_array[$config_name] = trim($destination);
// Path being relative (still prefixed by phpbb_root_path), but with the ability to escape the root dir...
case 'path':
case 'wpath':
if (!$cfg_array[$config_name])
{
break;
}
$cfg_array[$config_name] = trim($cfg_array[$config_name]);
// Make sure no NUL byte is present...
if (strpos($cfg_array[$config_name], '\0') !== false || strpos($cfg_array[$config_name], '%00') !== false)
{
$cfg_array[$config_name] = '';
break;
}
if (!file_exists($phpbb_root_path . $cfg_array[$config_name]))
{
$error[] = sprintf($user->lang['DIRECTORY_DOES_NOT_EXIST'], $cfg_array[$config_name]);
}
if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !is_dir($phpbb_root_path . $cfg_array[$config_name]))
{
$error[] = sprintf($user->lang['DIRECTORY_NOT_DIR'], $cfg_array[$config_name]);
}
// Check if the path is writeable
if ($config_definition['validate'] == 'wpath' || $config_definition['validate'] == 'rwpath')
{
if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !is_writeable($phpbb_root_path . $cfg_array[$config_name]))
{
$error[] = sprintf($user->lang['DIRECTORY_NOT_WRITEABLE'], $cfg_array[$config_name]);
}
}
break;
}
}
return;
}
?>

View File

@@ -295,10 +295,9 @@
</tr>
<!-- ENDIF -->
<tr>
<input type="hidden" name="extension_change_list[]" value="{extensions.EXTENSION_ID}" />
<td><b>{extensions.EXTENSION}</b></td>
<td>{extensions.GROUP_OPTIONS}</td>
<td><input type="checkbox" class="radio" name="extension_id_list[]" value="{extensions.EXTENSION_ID}" /></td>
<td><input type="checkbox" class="radio" name="extension_id_list[]" value="{extensions.EXTENSION_ID}" /><input type="hidden" name="extension_change_list[]" value="{extensions.EXTENSION_ID}" /></td>
</tr>
<!-- END extensions -->
</tbody>
@@ -319,6 +318,7 @@
<thead>
<tr>
<th>{L_FILENAME}</th>
<th>{L_FILEDATE}</th>
<th>{L_FILESIZE}</th>
<th>{L_ATTACH_POST_ID}</th>
<th>{L_ATTACH_TO_POST}</th>
@@ -328,21 +328,24 @@
<tbody>
<!-- BEGIN orphan -->
<!-- IF orphan.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td><a href="{orphan.U_FILE}" rel="file">{orphan.FILE}</a></td>
<td><a href="{orphan.U_FILE}">{orphan.REAL_FILENAME}</a></td>
<td>{orphan.FILETIME}</td>
<td>{orphan.FILESIZE}</td>
<td><b>ID: </b><input type="text" name="post_id[{orphan.FILE}]" size="7" maxlength="10" value="{orphan.POST_IDS}" /></td>
<td><input type="checkbox" class="radio" name="add[{orphan.FILE}]" /></td>
<td><input type="checkbox" class="radio" name="delete[{orphan.FILE}]" /></td>
<td><b>ID: </b><input type="text" name="post_id[{orphan.ATTACH_ID}]" size="7" maxlength="10" value="{orphan.POST_ID}" /></td>
<td><input type="checkbox" class="radio" name="add[{orphan.ATTACH_ID}]" /></td>
<td><input type="checkbox" class="radio" name="delete[{orphan.ATTACH_ID}]" /></td>
</tr>
<!-- END orphan -->
<tr>
<td colspan="3">&nbsp;</td>
<td class="small"><a href="javascript:marklist('orphan', 'add', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('orphan', 'add', false);">{L_UNMARK_ALL}</a></td>
<td class="small"><a href="javascript:marklist('orphan', 'delete', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('orphan', 'delete', false);">{L_UNMARK_ALL}</a></td>
<tr class="row4">
<td colspan="4">&nbsp;</td>
<td class="small"><a href="#" onclick="marklist('orphan', 'add', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('orphan', 'add', false); return false;">{L_UNMARK_ALL}</a></td>
<td class="small"><a href="#" onclick="marklist('orphan', 'delete', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('orphan', 'delete', false); return false;">{L_UNMARK_ALL}</a></td>
</tr>
</tbody>
</table>
<br />
<fieldset class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />

View File

@@ -12,19 +12,19 @@
<!--
var ban_length = new Array();
ban_length[-1] = "";
ban_length[-1] = '';
<!-- BEGIN ban_length -->
ban_length['{ban_length.BAN_ID}'] = "{ban_length.A_LENGTH}";
<!-- END ban_length -->
var ban_reason = new Array();
ban_reason[-1] = "";
ban_reason[-1] = '';
<!-- BEGIN ban_reason -->
ban_reason['{ban_reason.BAN_ID}'] = "{ban_reason.A_REASON}";
<!-- END ban_reason -->
var ban_give_reason = new Array();
ban_give_reason[-1] = "";
ban_give_reason[-1] = '';
<!-- BEGIN ban_give_reason -->
ban_give_reason['{ban_give_reason.BAN_ID}'] = "{ban_give_reason.A_REASON}";
<!-- END ban_give_reason -->

View File

@@ -30,6 +30,15 @@
</dl>
</fieldset>
<fieldset>
<legend>{L_BBCODE_HELPLINE}</legend>
<p>{L_BBCODE_HELPLINE_EXPLAIN}</p>
<dl>
<dt><label for="bbcode_helpline">{L_BBCODE_HELPLINE_TEXT}</label></dt>
<dd><input type="text" id="bbcode_helpline" name="bbcode_helpline" size="60" maxlength="255" value="{BBCODE_HELPLINE}" /></dd>
</dl>
</fieldset>
<fieldset>
<legend>{L_SETTINGS}</legend>
<dl>
@@ -45,7 +54,7 @@
<br />
<table cellspacing="1">
<table cellspacing="1" id="down">
<thead>
<tr>
<th colspan="2">{L_TOKENS}</th>
@@ -76,7 +85,7 @@
<p>{L_ACP_BBCODES_EXPLAIN}</p>
<table cellspacing="1">
<table cellspacing="1" id="down">
<thead>
<tr>
<th>{L_BBCODE_TAG}</th>
@@ -87,7 +96,7 @@
<!-- BEGIN bbcodes -->
<!-- IF bbcodes.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td style="text-align: center;">{bbcodes.BBCODE_TAG}</td>
<td style="text-align: center;"><a href="{bbcodes.U_EDIT}">{ICON_EDIT}</a> <a href="{bbcodes.U_DELETE}">{ICON_DELETE}</a></td>
<td style="text-align: right; width: 40px;"><a href="{bbcodes.U_EDIT}">{ICON_EDIT}</a> <a href="{bbcodes.U_DELETE}">{ICON_DELETE}</a></td>
</tr>
<!-- END bbcodes -->
</tbody>

View File

@@ -6,6 +6,13 @@
<p>{L_TITLE_EXPLAIN}</p>
<!-- IF S_ERROR -->
<div class="errorbox">
<h3>{L_WARNING}</h3>
<p>{ERROR_MSG}</p>
</div>
<!-- ENDIF -->
<form id="acp_board" method="post" action="{U_ACTION}">
<!-- BEGIN options -->

View File

@@ -89,7 +89,7 @@
<input class="button2" name="add" type="submit" value="{L_BOT_ADD}" />
</fieldset>
<fieldset class="quick">
<fieldset class="quick" style="float: right;">
<select name="action">{S_BOT_OPTIONS}</select>
<input class="button2" name="submit" type="submit" value="{L_SUBMIT}" />
</fieldset>

View File

@@ -0,0 +1,40 @@
<!-- INCLUDE overall_header.html -->
<a name="maincontent"></a>
<h1>{L_ACP_VC_SETTINGS}</h1>
<p>{L_ACP_VC_SETTINGS_EXPLAIN}</p>
<form id="acp_captcha" method="post" action="{U_ACTION}">
<fieldset>
<legend>{L_GENERAL_OPTIONS}</legend>
<dl>
<dt><label for="enable_confirm">{L_VISUAL_CONFIRM_REG}:</label><br /><span>{L_VISUAL_CONFIRM_REG_EXPLAIN}</span></dt>
<dd><input type="radio" class="radio" id="enable_confirm" name="enable_confirm" value="1"<!-- IF REG_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_ENABLED}&nbsp; &nbsp;<input type="radio" class="radio" name="enable_confirm" value="0"<!-- IF not REG_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_DISABLED}</dd>
</dl>
<dl>
<dt><label for="enable_post_confirm">{L_VISUAL_CONFIRM_POST}:</label><br /><span>{L_VISUAL_CONFIRM_POST_EXPLAIN}</span></dt>
<dd><input type="radio" class="radio" id="enable_post_confirm" name="enable_post_confirm" value="1"<!-- IF POST_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_ENABLED}&nbsp; &nbsp;<input type="radio" class="radio" name="enable_post_confirm" value="0"<!-- IF not POST_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_DISABLED}</dd>
</dl>
<!-- IF GD -->
<dl>
<dt><label for="captcha_gd">{L_CAPTCHA_GD}:</label><br /><span>{L_CAPTCHA_GD_EXPLAIN}</span></dt>
<dd><input id="captcha_gd" name="captcha_gd" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD --> checked="checked"<!-- ENDIF --> />&nbsp;{L_YES}&nbsp;&nbsp;<input name="captcha_gd" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD --> checked="checked"<!-- ENDIF --> />&nbsp;{L_NO}</dd>
</dl>
<dl>
<dt><label for="captcha_gd_noise">{L_CAPTCHA_GD_NOISE}:</label><br /><span>{L_CAPTCHA_GD_NOISE_EXPLAIN}</span></dt>
<dd><input id="captcha_gd_noise" name="captcha_gd_noise" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_NOISE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_YES}&nbsp;&nbsp;<input name="captcha_gd_noise" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD_NOISE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_NO}</dd>
</dl>
<!-- ENDIF -->
</fieldset>
<fieldset class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</fieldset>
</form>
<!-- INCLUDE overall_footer.html -->

View File

@@ -54,7 +54,7 @@
<legend>{L_BACKUP_OPTIONS}</legend>
<dl>
<dt><label for="user">{L_BACKUP_TYPE}:</label></dt>
<dd><input type="radio" class="radio" name="type" value="full" id="type" checked="checked" />&nbsp;{L_FULL_BACKUP}&nbsp;&nbsp;<input type="radio" name="type" value="structure" id="type" />&nbsp;{L_STRUCTURE_ONLY}&nbsp;&nbsp;<input type="radio" class="radio" name="type" value="data" id="type" />&nbsp;{L_DATA_ONLY}</dd>
<dd><input type="radio" class="radio" name="type" value="full" id="type" checked="checked" />&nbsp;{L_FULL_BACKUP}&nbsp;&nbsp;<input type="radio" name="type" class="radio" value="structure" id="type" />&nbsp;{L_STRUCTURE_ONLY}&nbsp;&nbsp;<input type="radio" class="radio" name="type" value="data" id="type" />&nbsp;{L_DATA_ONLY}</dd>
</dl>
<dl>
<dt><label for="user">{L_FILE_TYPE}:</label></dt>

View File

@@ -24,7 +24,7 @@
<dl>
<dt><label for="usernames">{L_SEND_TO_USERS}:</label><br /><span>{L_SEND_TO_USERS_EXPLAIN}</span></dt>
<dd><textarea name="usernames" id="usernames" rows="5" cols="40">{USERNAMES}</textarea></dd>
<dd>[ <a href="#" onclick="window.open('{U_FIND_USERNAME}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd>
<dd>[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd>
</dl>
<dl>
<dt><label for="subject">{L_SUBJECT}:</label></dt>

View File

@@ -96,16 +96,22 @@
<dd><img src="{FORUM_IMAGE_SRC}" alt="{L_FORUM_IMAGE}" /></dd>
<!-- ENDIF -->
</dl>
<dl>
<dt><label for="forum_password">{L_FORUM_PASSWORD}:</label><br /><span>{L_FORUM_PASSWORD_EXPLAIN}</span></dt>
<dd><input type="password" id="forum_password" name="forum_password" value="{FORUM_PASSWORD}" /></dd>
</dl>
<dl>
<dt><label for="forum_password_confirm">{L_FORUM_PASSWORD_CONFIRM}:</label><br /><span>{L_FORUM_PASSWORD_CONFIRM_EXPLAIN}</span></dt>
<dd><input type="password" id="forum_password_confirm" name="forum_password_confirm" value="{FORUM_PASSWORD_CONFIRM}" /></dd>
</dl>
<dl>
<dt><label for="forum_style">{L_FORUM_STYLE}:</label></dt>
<dd><select id="forum_style" name="forum_style"><option value="0">{L_DEFAULT_STYLE}</option>{S_STYLES_OPTIONS}</select></dd>
</dl>
<!-- IF S_ADD_ACTION -->
<dl>
<dt><label for="forum_perm_from">{L_COPY_PERMISSIONS}:</label><br /><span>{L_COPY_PERMISSIONS_EXPLAIN}</span></dt>
<dd><select id="forum_perm_from" name="forum_perm_from"><option value="0">{L_NO_PERMISSIONS}</option>{S_FORUM_OPTIONS}</select></dd>
</dl>
<!-- ENDIF -->
<dl>
<dt><label for="forum_perm_from">{L_COPY_PERMISSIONS}:</label><br /><span>{L_COPY_PERMISSIONS_EXPLAIN}</span></dt>
<dd><select id="forum_perm_from" name="forum_perm_from"><option value="0">{L_NO_PERMISSIONS}</option>{S_FORUM_OPTIONS}</select></dd>
</dl>
</fieldset>
<div id="forum_cat_options"<!-- IF not S_FORUM_CAT --> style="display: none;"<!-- ENDIF -->>
@@ -125,6 +131,16 @@
<dt><label for="forum_status">{L_FORUM_STATUS}:</label></dt>
<dd><select id="forum_status" name="forum_status">{S_STATUS_OPTIONS}</select></dd>
</dl>
<!-- IF S_SHOW_DISPLAY_ON_INDEX -->
<dl>
<dt><label for="display_on_index">{L_LIST_INDEX}:</label><br /><span>{L_LIST_INDEX_EXPLAIN}</span></dt>
<dd><input type="radio" class="radio" name="display_on_index" value="1"<!-- IF S_DISPLAY_ON_INDEX --> id="display_on_index" checked="checked"<!-- ENDIF --> /> {L_YES} &nbsp; <input type="radio" class="radio" name="display_on_index" value="0"<!-- IF not S_DISPLAY_ON_INDEX --> id="display_on_index" checked="checked"<!-- ENDIF --> /> {L_NO}</dd>
</dl>
<!-- ENDIF -->
<dl>
<dt><label for="enable_post_review">{L_ENABLE_POST_REVIEW}:</label><br /><span>{L_ENABLE_POST_REVIEW_EXPLAIN}</span></dt>
<dd><input type="radio" class="radio" name="enable_post_review" value="1"<!-- IF S_ENABLE_POST_REVIEW --> id="enable_post_review" checked="checked"<!-- ENDIF --> /> {L_YES} &nbsp; <input type="radio" class="radio" name="enable_post_review" value="0"<!-- IF not S_ENABLE_POST_REVIEW --> id="enable_post_review" checked="checked"<!-- ENDIF --> /> {L_NO}</dd>
</dl>
<dl>
<dt><label for="enable_indexing">{L_ENABLE_INDEXING}:</label><br /><span>{L_ENABLE_INDEXING_EXPLAIN}</span></dt>
<dd><input type="radio" class="radio" name="enable_indexing" value="1"<!-- IF S_ENABLE_INDEXING --> id="enable_indexing" checked="checked"<!-- ENDIF --> /> {L_YES} &nbsp; <input type="radio" class="radio" name="enable_indexing" value="0"<!-- IF not S_ENABLE_INDEXING --> id="enable_indexing" checked="checked"<!-- ENDIF --> /> {L_NO}</dd>
@@ -133,22 +149,22 @@
<dt><label for="enable_icons">{L_ENABLE_TOPIC_ICONS}:</label></dt>
<dd><input type="radio" class="radio" name="enable_icons" value="1"<!-- IF S_TOPIC_ICONS --> id="enable_icons" checked="checked"<!-- ENDIF --> /> {L_YES} &nbsp; <input type="radio" class="radio" name="enable_icons" value="0"<!-- IF not S_TOPIC_ICONS --> id="enable_icons" checked="checked"<!-- ENDIF --> /> {L_NO}</dd>
</dl>
<!-- IF S_SHOW_DISPLAY_ON_INDEX -->
<dl>
<dt><label for="display_on_index">{L_LIST_INDEX}:</label><br /><span>{L_LIST_INDEX_EXPLAIN}</span></dt>
<dd><input type="radio" class="radio" name="display_on_index" value="1"<!-- IF S_DISPLAY_ON_INDEX --> id="display_on_index" checked="checked"<!-- ENDIF --> /> {L_YES} &nbsp; <input type="radio" class="radio" name="display_on_index" value="0"<!-- IF not S_DISPLAY_ON_INDEX --> id="display_on_index" checked="checked"<!-- ENDIF --> /> {L_NO}</dd>
</dl>
<!-- ENDIF -->
<dl>
<dt><label for="display_recent">{L_ENABLE_RECENT}:</label><br /><span>{L_ENABLE_RECENT_EXPLAIN}</span></dt>
<dd><input type="radio" class="radio" name="display_recent" value="1"<!-- IF S_DISPLAY_ACTIVE_TOPICS --> id="display_recent" checked="checked"<!-- ENDIF --> /> {L_YES} &nbsp; <input type="radio" class="radio" name="display_recent" value="0"<!-- IF not S_DISPLAY_ACTIVE_TOPICS --> id="display_recent" checked="checked"<!-- ENDIF --> /> {L_NO}</dd>
</dl>
<dl>
<dt><label for="enable_prune">{L_FORUM_AUTO_PRUNE}:</label><br /><span>{L_FORUM_AUTO_PRUNE_EXPLAIN}</span></dt>
<dd><input type="radio" class="radio" name="enable_prune" onchange="dE('forum_prune_options', 1)" value="1"<!-- IF S_PRUNE_ENABLE --> id="enable_prune" checked="checked"<!-- ENDIF --> /> {L_YES} &nbsp; <input type="radio" class="radio" name="enable_prune" onchange="dE('forum_prune_options', -1)" value="0"<!-- IF not S_PRUNE_ENABLE --> id="enable_prune" checked="checked"<!-- ENDIF --> /> {L_NO}</dd>
<dt><label for="topics_per_page">{L_FORUM_TOPICS_PAGE}:</label><br /><span>{L_FORUM_TOPICS_PAGE_EXPLAIN}</span></dt>
<dd><input type="text" id="topics_per_page" name="topics_per_page" value="{TOPICS_PER_PAGE}" /></dd>
</dl>
</fieldset>
<fieldset>
<legend>{L_FORUM_PRUNE_SETTINGS}</legend>
<dl>
<dt><label for="enable_prune">{L_FORUM_AUTO_PRUNE}:</label><br /><span>{L_FORUM_AUTO_PRUNE_EXPLAIN}</span></dt>
<dd><input type="radio" class="radio" name="enable_prune" value="1"<!-- IF S_PRUNE_ENABLE --> id="enable_prune" checked="checked"<!-- ENDIF --> /> {L_YES} &nbsp; <input type="radio" class="radio" name="enable_prune" value="0"<!-- IF not S_PRUNE_ENABLE --> id="enable_prune" checked="checked"<!-- ENDIF --> /> {L_NO}</dd>
</dl>
<div id="forum_prune_options"<!-- IF not S_PRUNE_ENABLE --> style="display: none;"<!-- ENDIF -->>
<dl>
<dt><label for="prune_freq">{L_AUTO_PRUNE_FREQ}:</label><br /><span>{L_AUTO_PRUNE_FREQ_EXPLAIN}</span></dt>
<dd><input type="text" id="prune_freq" name="prune_freq" value="{PRUNE_FREQ}" /> {L_DAYS}</dd>
@@ -173,20 +189,6 @@
<dt><label for="prune_sticky">{L_PRUNE_STICKY}:</label></dt>
<dd><input type="radio" class="radio" name="prune_sticky" value="1"<!-- IF S_PRUNE_STICKY --> id="prune_sticky" checked="checked"<!-- ENDIF --> /> {L_YES} &nbsp; <input type="radio" class="radio" name="prune_sticky" value="0"<!-- IF not S_PRUNE_STICKY --> id="prune_sticky" checked="checked"<!-- ENDIF --> /> {L_NO}</dd>
</dl>
</div>
<dl>
<dt><label for="topics_per_page">{L_FORUM_TOPICS_PAGE}:</label><br /><span>{L_FORUM_TOPICS_PAGE_EXPLAIN}</span></dt>
<dd><input type="text" id="topics_per_page" name="topics_per_page" value="{TOPICS_PER_PAGE}" /></dd>
</dl>
<dl>
<dt><label for="forum_password">{L_FORUM_PASSWORD}:</label><br /><span>{L_FORUM_PASSWORD_EXPLAIN}</span></dt>
<dd><input type="password" id="forum_password" name="forum_password" value="{FORUM_PASSWORD}" /></dd>
</dl>
<dl>
<dt><label for="forum_password_confirm">{L_FORUM_PASSWORD_CONFIRM}:</label><br /><span>{L_FORUM_PASSWORD_CONFIRM_EXPLAIN}</span></dt>
<dd><input type="password" id="forum_password_confirm" name="forum_password_confirm" value="{FORUM_PASSWORD_CONFIRM}" /></dd>
</dl>
</fieldset>
</div>
@@ -281,8 +283,40 @@
</form>
<!-- ELSEIF S_CONTINUE_SYNC -->
<script type="text/javascript">
<!--
var close_waitscreen = 0;
window.open('{UA_PROGRESS_BAR}', '_sync', 'height=240, resizable=yes, scrollbars=no, width=400');
//-->
</script>
<h1>{L_FORUM_ADMIN}</h1>
<p>{L_FORUM_ADMIN_EXPLAIN}</p>
<p>{L_PROGRESS_EXPLAIN}</p>
<!-- ELSE -->
<script type="text/javascript">
<!--
/**
* Popup search progress bar
*/
function popup_progress_bar()
{
var close_waitscreen = 0;
window.open('{UA_PROGRESS_BAR}', '_sync', 'height=240, resizable=yes, scrollbars=no, width=400');
}
//-->
</script>
<h1>{L_FORUM_ADMIN}</h1>
<p>{L_FORUM_ADMIN_EXPLAIN}</p>
@@ -295,12 +329,18 @@
<!-- ENDIF -->
<!-- IF S_RESYNCED -->
<script language="javascript" type="text/javascript">
<!--
var close_waitscreen = 1;
//-->
</script>
<div class="successbox">
<h3>{L_NOTIFY}</h3>
<p>{L_FORUM_RESYNCED}</p>
</div>
<!-- ENDIF -->
<p><strong>{NAVIGATION}<!-- IF S_NO_FORUMS --> [<a href="{U_EDIT}">{L_EDIT}</a> | <a href="{U_DELETE}">{L_DELETE}</a><!-- IF not S_LINK --> | <a href="{U_SYNC}">{L_RESYNC}</a><!-- ENDIF --->]<!-- ENDIF --></strong></p>
<!-- IF .forums -->
@@ -311,15 +351,31 @@
<tr>
<td style="width: 5%;">{forums.FOLDER_IMAGE}</td>
<td>
<strong><!-- IF forums.S_LINK -->{forums.FORUM_NAME}<!-- ELSE --><a href="{forums.U_FORUM}">{forums.FORUM_NAME}</a><!-- ENDIF --></strong>
<!-- IF forums.FORUM_IMAGE --><div style="float: left;">{forums.FORUM_IMAGE}</div><!-- ENDIF -->
<strong><!-- IF forums.S_FORUM_LINK -->{forums.FORUM_NAME}<!-- ELSE --><a href="{forums.U_FORUM}">{forums.FORUM_NAME}</a><!-- ENDIF --></strong>
<!-- IF forums.FORUM_DESCRIPTION --><br /><span>{forums.FORUM_DESCRIPTION}</span><!-- ENDIF -->
<!-- IF forums.S_FORUM_POST --><br /><br /><span>{L_TOPICS}: <b>{forums.FORUM_TOPICS}</b> / {L_POSTS}: <b>{forums.FORUM_POSTS}</b></span><!-- ENDIF -->
</td>
<td style="width: 15%; text-align: right; white-space: nowrap;">
<!-- IF not forums.S_FIRST_ROW --><a href="{forums.U_MOVE_UP}">{ICON_MOVE_UP}</a> <!-- ENDIF -->
<!-- IF not forums.S_LAST_ROW --><a href="{forums.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> <!-- ENDIF -->
<td style="vertical-align: top; width: 100px; text-align: right; white-space: nowrap;">
<!-- IF forums.S_FIRST_ROW && not forums.S_LAST_ROW -->
{ICON_MOVE_UP_DISABLED}
<a href="{forums.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF not forums.S_FIRST_ROW && not forums.S_LAST_ROW-->
<a href="{forums.U_MOVE_UP}">{ICON_MOVE_UP}</a>
<a href="{forums.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF forums.S_LAST_ROW && not forums.S_FIRST_ROW -->
<a href="{forums.U_MOVE_UP}">{ICON_MOVE_UP}</a>
{ICON_MOVE_DOWN_DISABLED}
<!-- ELSE -->
{ICON_MOVE_UP_DISABLED}
{ICON_MOVE_DOWN_DISABLED}
<!-- ENDIF -->
<a href="{forums.U_EDIT}">{ICON_EDIT}</a>
<!-- IF not forums.S_LINK --><a href="{forums.U_SYNC}">{ICON_SYNC}</a> <!-- ENDIF -->
<!-- IF not forums.S_FORUM_LINK -->
<a href="{forums.U_SYNC}" onclick="popup_progress_bar();">{ICON_SYNC}</a>
<!-- ELSE -->
{ICON_SYNC_DISABLED}
<!-- ENDIF -->
<a href="{forums.U_DELETE}">{ICON_DELETE}</a>
</td>
</tr>
@@ -351,4 +407,4 @@
<!-- ENDIF -->
<!-- INCLUDE overall_footer.html -->
<!-- INCLUDE overall_footer.html -->

View File

@@ -153,12 +153,16 @@
<a href="{U_BACK}" style="float: right">&laquo; {L_BACK}</a>
<h1>{L_GROUP_MEMBERS}</h1>
<h1>{L_GROUP_MEMBERS} :: {GROUP_NAME}</h1>
<p>{L_GROUP_MEMBERS_EXPLAIN}</p>
<form id="list" method="post" action="{U_ACTION}">
<fieldset class="quick">
<a href="{U_DEFAULT_ALL}">&raquo; {L_MAKE_DEFAULT_FOR_ALL}</a>
</fieldset>
<table cellspacing="1">
<thead>
<tr>
@@ -213,14 +217,14 @@
<div class="pagination" style="float: left;">
<!-- IF PAGINATION -->
<a href="javascript:jumpto();" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<!-- ELSE -->
{S_ON_PAGE}
<!-- ENDIF -->
</div>
<fieldset class="quick">
<span class="small"><a href="javascript:marklist('list', 'mark', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('list', 'mark', false);">{L_UNMARK_ALL}</a></span><br />
<span class="small"><a href="#" onclick="marklist('list', 'mark', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('list', 'mark', false); return false;">{L_UNMARK_ALL}</a></span><br />
<select name="action"><option class="sep" value="">{L_SELECT_OPTION}</option>{S_ACTION_OPTIONS}</select>
<input class="button2" type="submit" name="update" value="{L_SUBMIT}" />
@@ -243,7 +247,7 @@
<dl>
<dt><label for="usernames">{L_USERNAME}:</label><br /><span>{L_USERNAMES_EXPLAIN}</span></dt>
<dd><textarea id="usernames" name="usernames" cols="40" rows="5"></textarea></dd>
<dd>[ <a href="{U_FIND_USERNAME}" target="usersearch">{L_FIND_USERNAME}</a> ]</dd>
<dd>[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd>
</dl>
</fieldset>
@@ -259,6 +263,13 @@
<p>{L_ACP_GROUPS_MANAGE_EXPLAIN}</p>
<!-- IF S_ERROR -->
<div class="errorbox">
<h3>{L_WARNING}</h3>
<p>{ERROR_MSG}</p>
</div>
<!-- ENDIF -->
<h1>{L_USER_DEF_GROUPS}</h1>
<p>{L_USER_DEF_GROUPS_EXPLAIN}</p>
@@ -269,9 +280,10 @@
<col class="col1" /><col class="col1" /><col class="col2" /><col class="col2" /><col class="col2" />
<thead>
<tr>
<th style="width: 50%">{L_MANAGE}</th>
<th style="width: 50%">{L_GROUP}</th>
<th>{L_TOTAL_MEMBERS}</th>
<th colspan="3">{L_OPTIONS}</th>
<th colspan="2">{L_OPTIONS}</th>
<th>{L_ACTION}</th>
</tr>
</thead>
<tbody>
@@ -282,10 +294,13 @@
<fieldset class="quick">
<!-- IF S_GROUP_ADD -->
{L_CREATE_GROUP}: <input type="text" name="group_name" value="" /> <input class="button2" type="submit" name="add" value="{L_SUBMIT}" />
{L_CREATE_GROUP}: <input type="text" name="group_name" value="" /> <input class="button2" type="submit" name="submit" value="{L_SUBMIT}" />
<input type="hidden" name="add" value="1" />
<!-- ENDIF -->
</fieldset>
</form>
<h1>{L_SPECIAL_GROUPS}</h1>
<p>{L_SPECIAL_GROUPS_EXPLAIN}</p>
@@ -294,18 +309,19 @@
<col class="col1" /><col class="col1" /><col class="col2" /><col class="col2" /><col class="col2" />
<thead>
<tr>
<th style="width: 50%">{L_MANAGE}</th>
<th style="width: 50%">{L_GROUP}</th>
<th>{L_TOTAL_MEMBERS}</th>
<th colspan="3">{L_OPTIONS}</th>
<th colspan="2">{L_OPTIONS}</th>
<th>{L_ACTION}</th>
</tr>
</thead>
<tbody>
<!-- ELSE -->
<tr>
<td><a href="{groups.U_LIST}">{groups.GROUP_NAME}</a></td>
<td><strong>{groups.GROUP_NAME}</strong></td>
<td style="text-align: center;">{groups.TOTAL_MEMBERS}</td>
<td style="text-align: center;"><a href="{groups.U_DEFAULT}">{L_GROUP_DEFAULT}</a></td>
<td style="text-align: center;"><a href="{groups.U_EDIT}">{L_EDIT}</a></td>
<td style="text-align: center;"><a href="{groups.U_EDIT}">{L_SETTINGS}</a></td>
<td style="text-align: center;"><a href="{groups.U_LIST}">{L_MEMBERS}</a></td>
<td style="text-align: center;"><!-- IF not groups.S_GROUP_SPECIAL and groups.U_DELETE --><a href="{groups.U_DELETE}">{L_DELETE}</a><!-- ELSE -->{L_DELETE}<!-- ENDIF --></td>
</tr>
<!-- ENDIF -->
@@ -313,8 +329,6 @@
</tbody>
</table>
</form>
<!-- ENDIF -->
<!-- INCLUDE overall_footer.html -->

View File

@@ -139,14 +139,22 @@
</tr>
<!-- ENDIF -->
<!-- IF items.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td style="text-align: center;"><img src="{items.IMG_SRC}" width="{items.WIDTH}" height="{items.HEIGHT}" alt="{items.ALT_TEXT}" title="{items.ALT_TEXT}" /></td>
<td style="width: 85%; text-align: center;"><img src="{items.IMG_SRC}" width="{items.WIDTH}" height="{items.HEIGHT}" alt="{items.ALT_TEXT}" title="{items.ALT_TEXT}" /></td>
<!-- IF S_SMILIES -->
<td style="text-align: center;">{items.CODE}</td>
<td style="text-align: center;">{items.EMOTION}</td>
<!-- ENDIF -->
<td style="width: 15%; text-align: right; white-space: nowrap;">
<!-- IF not items.S_FIRST_ROW --><a href="{items.U_MOVE_UP}">{ICON_MOVE_UP}</a> <!-- ENDIF -->
<!-- IF not items.S_LAST_ROW --><a href="{items.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> <!-- ENDIF -->
<td style="width: 80px; text-align: right; white-space: nowrap;">
<!-- IF items.S_FIRST_ROW && not items.S_LAST_ROW -->
{ICON_MOVE_UP_DISABLED}
<a href="{items.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF not items.S_FIRST_ROW && not items.S_LAST_ROW-->
<a href="{items.U_MOVE_UP}">{ICON_MOVE_UP}</a>
<a href="{items.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF items.S_LAST_ROW && not items.S_FIRST_ROW -->
<a href="{items.U_MOVE_UP}">{ICON_MOVE_UP}</a>
{ICON_MOVE_DOWN_DISABLED}
<!-- ENDIF -->
<a href="{items.U_EDIT}">{ICON_EDIT}</a>
<a href="{items.U_DELETE}">{ICON_DELETE}</a>
</td>

View File

@@ -0,0 +1,75 @@
<!-- INCLUDE overall_header.html -->
<a name="maincontent"></a>
<h2>{L_INACTIVE_USERS}</h2>
<p>{L_INACTIVE_USERS_EXPLAIN}</p>
<form id="inactive" method="post" action="{U_ACTION}">
<div class="clearfix"></div>
<div class="pagination">
<!-- IF PAGINATION -->
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<!-- ELSE -->
{S_ON_PAGE}
<!-- ENDIF -->
</div>
<table cellspacing="1">
<thead>
<tr>
<th>{L_USERNAME}</th>
<th>{L_JOINED}</th>
<th>{L_INACTIVE_DATE}</th>
<th>{L_INACTIVE_REASON}</th>
<th>{L_LAST_VISIT}</th>
<th>{L_MARK}</th>
</tr>
</thead>
<tbody>
<!-- BEGIN inactive -->
<!-- IF inactive.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td><a href="{inactive.U_USER_ADMIN}">{inactive.USERNAME}</a></td>
<td>{inactive.JOINED}</td>
<td>{inactive.INACTIVE_DATE}</td>
<td>{inactive.REASON}</td>
<td>{inactive.LAST_VISIT}</td>
<td>&nbsp;<input type="checkbox" class="radio" name="mark[]" value="{inactive.USER_ID}" />&nbsp;</td>
</tr>
<!-- BEGINELSE -->
<tr>
<td colspan="6" style="text-align: center;">{L_NO_INACTIVE_USERS}</td>
</tr>
<!-- END inactive -->
</tbody>
</table>
<!-- IF .inactive -->
<fieldset class="quick" style="float: left;">
{L_DISPLAY_LOG}: &nbsp;{S_LIMIT_DAYS}&nbsp;{L_SORT_BY}: {S_SORT_KEY} {S_SORT_DIR}
<input class="button2" type="submit" value="{L_GO}" name="sort" />
</fieldset>
<fieldset class="quick">
<p><a href="#" onclick="marklist('inactive', 'mark', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('inactive', 'mark', false); return false;">{L_UNMARK_ALL}</a></p>
<select name="action">{S_INACTIVE_OPTIONS}</select>
<input class="button2" type="submit" name="submit" value="{L_SUBMIT}" />
</fieldset>
<!-- ENDIF -->
<div class="pagination">
<!-- IF PAGINATION -->
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<!-- ELSE -->
{S_ON_PAGE}
<!-- ENDIF -->
</div>
</form>
<!-- INCLUDE overall_footer.html -->

View File

@@ -44,7 +44,7 @@
</dl>
<dl>
<dt><label>{L_LANG_ISO_CODE}:</label></dt>
<dd><b>{LANG_ISO}</b></dd>
<dd><strong>{LANG_ISO}</strong></dd>
</dl>
<dl>
<dt><label for="lang_author">{L_LANG_AUTHOR}:</label></dt>
@@ -85,7 +85,7 @@
<tbody>
<!-- BEGIN missing -->
<tr class="row4">
<td><b>{missing.FILE}</b></td>
<td><strong>{missing.FILE}</strong></td>
<td style="text-align: right;"><input type="submit" name="missing_file[{missing.KEY}]" value="{L_SELECT}" class="button2" /></td>
</tr>
{missing.TPL}
@@ -131,8 +131,12 @@
</tr>
<!-- ENDIF -->
<tr>
<td class="row3"><b>{PRINT_MESSAGE}<!-- IF S_FROM_STORE --><br /><span style="color: red;">{L_FILE_FROM_STORAGE}</span><!-- ENDIF --></b></td>
<td class="row3" style="text-align: right;"><input type="submit" name="download_file" class="button2" value="{L_SUBMIT_AND_DOWNLOAD}" />&nbsp;&nbsp;<input type="submit" name="submit_file" class="button2" value="{L_SUBMIT}" /><!-- IF ALLOW_UPLOAD -->&nbsp;&nbsp;{L_UPLOAD_METHOD}:&nbsp;<!-- BEGIN buttons--><input type="radio" class="radio"<!-- IF buttons.S_FIRST_ROW --> id="method" checked="checked"<!-- ENDIF --> value="{buttons.VALUE}" name="method">&nbsp;{buttons.VALUE}&nbsp;<!-- END buttons --><input type="submit" name="upload_file" class="button2" value="{L_SUBMIT_AND_UPLOAD}" /><!-- ENDIF --></td>
<td rowspan="2" class="row3"><strong>{PRINT_MESSAGE}<!-- IF S_FROM_STORE --><br /><span style="color: red;">{L_FILE_FROM_STORAGE}</span><!-- ENDIF --></strong></td>
<td class="row3" style="text-align: right;"><input type="submit" name="download_file" class="button2" value="{L_SUBMIT_AND_DOWNLOAD}" />&nbsp;&nbsp;<input type="submit" name="submit_file" class="button2" value="{L_SUBMIT}" /></td>
</tr>
<tr>
<td class="row3" style="text-align: right;">
<!-- IF ALLOW_UPLOAD -->&nbsp;&nbsp;{L_UPLOAD_METHOD}:&nbsp;<!-- BEGIN buttons--><input type="radio" class="radio"<!-- IF buttons.S_FIRST_ROW --> id="method" checked="checked"<!-- ENDIF --> value="{buttons.VALUE}" name="method" />&nbsp;{buttons.VALUE}&nbsp;<!-- END buttons --><input type="submit" name="upload_file" class="button2" value="{L_SUBMIT_AND_UPLOAD}" /><!-- ENDIF --></td>
</tr>
</thead>
<tbody>
@@ -144,7 +148,10 @@
{TPL}
<!-- ENDIF -->
<tr>
<td class="row3" colspan="3" style="text-align: right;"><input type="submit" name="download_file" class="button2" value="{L_SUBMIT_AND_DOWNLOAD}" />&nbsp;&nbsp;<input type="submit" name="submit_file" class="button2" value="{L_SUBMIT}" /><!-- IF ALLOW_UPLOAD -->&nbsp;&nbsp;{L_UPLOAD_METHOD}:&nbsp;<!-- BEGIN buttons--><input type="radio" class="radio" value="{buttons.VALUE}" name="method">&nbsp;{buttons.VALUE}&nbsp;<!-- END buttons --><input type="submit" name="upload_file" class="button2" value="{L_SUBMIT_AND_UPLOAD}" /><!-- ENDIF --></td>
<td class="row3" colspan="3" style="text-align: right;"><!-- IF ALLOW_UPLOAD -->&nbsp;&nbsp;{L_UPLOAD_METHOD}:&nbsp;<!-- BEGIN buttons--><input type="radio" class="radio" value="{buttons.VALUE}" name="method" />&nbsp;{buttons.VALUE}&nbsp;<!-- END buttons --><input type="submit" name="upload_file" class="button2" value="{L_SUBMIT_AND_UPLOAD}" /><!-- ENDIF --></td>
</tr>
<tr>
<td class="row3" colspan="3" style="text-align: right;"><input type="submit" name="download_file" class="button2" value="{L_SUBMIT_AND_DOWNLOAD}" />&nbsp;&nbsp;<input type="submit" name="submit_file" class="button2" value="{L_SUBMIT}" /></td>
</tr>
</tbody>
</table>
@@ -173,12 +180,12 @@
<legend>{L_UPLOAD_SETTINGS}</legend>
<dl>
<dt><label>{L_UPLOAD_METHOD}:</label></dt>
<dd><b>{NAME}</b></dd>
<dd><strong>{NAME}</strong></dd>
</dl>
<!-- BEGIN data -->
<dl>
<dt><label for="store">{data.NAME}:</label><br /><span>{data.EXPLAIN}</span></dt>
<dd><input type="text" id="{data.DATA}" name="{data.DATA}" value="{data.DEFAULT}" checked="checked" /></dd>
<dt><label for="{data.DATA}">{data.NAME}:</label><br /><span>{data.EXPLAIN}</span></dt>
<dd><input type="text" id="{data.DATA}" name="{data.DATA}" value="{data.DEFAULT}" /></dd>
</dl>
<!-- END data -->
</fieldset>
@@ -209,27 +216,27 @@
</thead>
<tbody>
<tr>
<td class="row3" colspan="5"><b>{L_INSTALLED_LANGUAGE_PACKS}</b></td>
<td class="row3" colspan="5"><strong>{L_INSTALLED_LANGUAGE_PACKS}</strong></td>
</tr>
<!-- BEGIN lang -->
<!-- IF lang.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td><a href="{lang.U_DETAILS}">{lang.ENGLISH_NAME}</a> {lang.TAG}</td>
<td>{lang.LOCAL_NAME}</td>
<td style="text-align: center;"><b>{lang.ISO}</b></td>
<td style="text-align: center;"><strong>{lang.ISO}</strong></td>
<td style="text-align: center;">{lang.USED_BY}</td>
<td style="text-align: center;">&nbsp;<a href="{lang.U_DOWNLOAD}">{L_DOWNLOAD}</a>&nbsp;|&nbsp;<a href="{lang.U_DELETE}">{L_DELETE}</a></td>
</tr>
<!-- END lang -->
<!-- IF .notinst -->
<tr>
<td class="row3" colspan="5"><b>{L_UNINSTALLED_LANGUAGE_PACKS}</b></td>
<td class="row3" colspan="5"><strong>{L_UNINSTALLED_LANGUAGE_PACKS}</strong></td>
</tr>
<!-- ENDIF -->
<!-- BEGIN notinst -->
<!-- IF notinst.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td>{notinst.NAME}</td>
<td>{notinst.LOCAL_NAME}</td>
<td style="text-align: center;"><b>{notinst.ISO}</b></td>
<td style="text-align: center;"><strong>{notinst.ISO}</strong></td>
<td colspan="2" style="text-align: center;"><a href="{notinst.U_INSTALL}">{L_INSTALL}</a></td>
</tr>
<!-- END notinst -->

View File

@@ -17,7 +17,7 @@
<div class="pagination">
<!-- IF PAGINATION -->
<a href="javascript:jumpto();" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<!-- ELSE -->
{S_ON_PAGE}
<!-- ENDIF -->
@@ -70,12 +70,20 @@
<!-- IF S_CLEARLOGS -->
<fieldset class="quick">
<b class="small"><a href="#" onclick="marklist('list', 'mark', true);">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('list', 'mark', false);">{L_UNMARK_ALL}</a></b><br />
<b class="small"><a href="#" onclick="marklist('list', 'mark', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('list', 'mark', false); return false;">{L_UNMARK_ALL}</a></b><br />
<input class="button2" type="submit" name="delmarked" value="{L_DELETE_MARKED}" />&nbsp;
<input class="button2" type="submit" name="delall" value="{L_DELETE_ALL}" />&nbsp;
</fieldset>
<!-- ENDIF -->
<div class="pagination">
<!-- IF PAGINATION -->
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<!-- ELSE -->
{S_ON_PAGE}
<!-- ENDIF -->
</div>
</form>
<!-- INCLUDE overall_footer.html -->

View File

@@ -1,152 +1,171 @@
<!-- INCLUDE overall_header.html -->
<a name="maincontent"></a><h1>{L_WELCOME_PHPBB}</h1>
<a name="maincontent"></a>
<p>{L_ADMIN_INTRO}</p>
<!-- IF S_RESTORE_PERMISSIONS -->
<!-- IF S_DEBUG_EXTRA -->
<div class="errorbox">
<h3>{L_WARNING}</h3>
<p>{L_DEBUG_EXTRA_WARNING}</p>
</div>
<!-- ENDIF -->
<h1>{L_PERMISSIONS_TRANSFERED}</h1>
<table cellspacing="1">
<caption>{L_FORUM_STATS}</caption>
<col class="col1" /><col class="col2" /><col class="col1" /><col class="col2" />
<thead>
<tr>
<th>{L_STATISTIC}</th>
<th>{L_VALUE}</th>
<th>{L_STATISTIC}</th>
<th>{L_VALUE}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{L_NUMBER_POSTS}: </td>
<td><b>{TOTAL_POSTS}</b></td>
<td>{L_POSTS_PER_DAY}: </td>
<td><b>{POSTS_PER_DAY}</b></td>
</tr>
<tr>
<td>{L_NUMBER_TOPICS}: </td>
<td><b>{TOTAL_TOPICS}</b></td>
<td>{L_TOPICS_PER_DAY}: </td>
<td><b>{TOPICS_PER_DAY}</b></td>
</tr>
<tr>
<td>{L_NUMBER_USERS}: </td>
<td><b>{TOTAL_USERS}</b></td>
<td>{L_USERS_PER_DAY}: </td>
<td><b>{USERS_PER_DAY}</b></td>
</tr>
<tr>
<td>{L_NUMBER_FILES}: </td>
<td><b>{TOTAL_FILES}</b></td>
<td>{L_FILES_PER_DAY}: </td>
<td><b>{FILES_PER_DAY}</b></td>
</tr>
<tr>
<td>{L_BOARD_STARTED}: </td>
<td><b>{START_DATE}</b></td>
<td>{L_AVATAR_DIR_SIZE}: </td>
<td><b>{AVATAR_DIR_SIZE}</b></td>
</tr>
<tr>
<td>{L_DATABASE_SIZE}: </td>
<td><b>{DBSIZE}</b></td>
<td>{L_UPLOAD_DIR_SIZE}: </td>
<td><b>{UPLOAD_DIR_SIZE}</b></td>
</tr>
<tr>
<td>{L_GZIP_COMPRESSION}: </td>
<td><b>{GZIP_COMPRESSION}</b></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<p>{L_PERMISSIONS_TRANSFERED_EXPLAIN}</p>
<!-- IF S_ACTION_OPTIONS -->
<form id="stats" method="post" action="{U_ACTION}">
<fieldset class="quick">
<select name="action">{S_ACTION_OPTIONS}</select>
<!-- ELSE -->
<input class="button2" type="submit" name="submit" value="{L_SUBMIT}" />
</fieldset>
</form>
<!-- ENDIF -->
<h1>{L_WELCOME_PHPBB}</h1>
<!-- IF .log -->
<h2>{L_ADMIN_LOG}</h2>
<p>{L_ADMIN_INTRO}</p>
<p>{L_ADMIN_LOG_INDEX_EXPLAIN}</p>
<!-- IF S_REMOVE_INSTALL -->
<div class="errorbox">
<h3>{L_WARNING}</h3>
<p>{L_REMOVE_INSTALL}</p>
</div>
<!-- ENDIF -->
<table cellspacing="1">
<caption>{L_FORUM_STATS}</caption>
<col class="col1" /><col class="col2" /><col class="col1" /><col class="col2" />
<thead>
<tr>
<th>{L_USERNAME}</th>
<th>{L_IP}</th>
<th>{L_TIME}</th>
<th>{L_ACTION}</th>
<th>{L_STATISTIC}</th>
<th>{L_VALUE}</th>
<th>{L_STATISTIC}</th>
<th>{L_VALUE}</th>
</tr>
</thead>
<tbody>
<!-- BEGIN log -->
<!-- IF log.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td>{log.USERNAME}</td>
<td style="text-align: center;">{log.IP}</td>
<td style="text-align: center;">{log.DATE}</td>
<td>{log.ACTION}</td>
</tr>
<!-- END log -->
</tbody>
</table>
<!-- ENDIF -->
<!-- IF S_INACTIVE_USERS -->
<h2>{L_INACTIVE_USERS}</h2>
<p>{L_INACTIVE_USERS_EXPLAIN}</p>
<form id="inactive" method="post" action="{U_ACTION}">
<table cellspacing="1">
<thead>
<tr>
<th>{L_USERNAME}</th>
<th>{L_JOINED}</th>
<th>{L_MARK}</th>
<td>{L_NUMBER_POSTS}: </td>
<td><b>{TOTAL_POSTS}</b></td>
<td>{L_POSTS_PER_DAY}: </td>
<td><b>{POSTS_PER_DAY}</b></td>
</tr>
<tr>
<td>{L_NUMBER_TOPICS}: </td>
<td><b>{TOTAL_TOPICS}</b></td>
<td>{L_TOPICS_PER_DAY}: </td>
<td><b>{TOPICS_PER_DAY}</b></td>
</tr>
<tr>
<td>{L_NUMBER_USERS}: </td>
<td><b>{TOTAL_USERS}</b></td>
<td>{L_USERS_PER_DAY}: </td>
<td><b>{USERS_PER_DAY}</b></td>
</tr>
<tr>
<td>{L_NUMBER_FILES}: </td>
<td><b>{TOTAL_FILES}</b></td>
<td>{L_FILES_PER_DAY}: </td>
<td><b>{FILES_PER_DAY}</b></td>
</tr>
</thead>
<tbody>
<!-- BEGIN inactive -->
<!-- IF inactive.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td><a href="{inactive.U_USER_ADMIN}">{inactive.USERNAME}</a></td>
<td>{inactive.DATE}</td>
<td>&nbsp;<input type="checkbox" class="radio" name="mark[]" value="{inactive.USER_ID}" />&nbsp;</td>
</tr>
<!-- BEGINELSE -->
<tr>
<td colspan="3" style="text-align: center;">{L_NO_INACTIVE_USERS}</td>
</tr>
<!-- END inactive -->
<tr>
<td>{L_BOARD_STARTED}: </td>
<td><b>{START_DATE}</b></td>
<td>{L_AVATAR_DIR_SIZE}: </td>
<td><b>{AVATAR_DIR_SIZE}</b></td>
</tr>
<tr>
<td>{L_DATABASE_SIZE}: </td>
<td><b>{DBSIZE}</b></td>
<td>{L_UPLOAD_DIR_SIZE}: </td>
<td><b>{UPLOAD_DIR_SIZE}</b></td>
</tr>
<tr>
<td>{L_DATABASE_SERVER_INFO}: </td>
<td><b>{DATABASE_INFO}</b></td>
<td>{L_GZIP_COMPRESSION}: </td>
<td><b>{GZIP_COMPRESSION}</b></td>
</tr>
<!-- IF S_TOTAL_ORPHAN -->
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>{L_NUMBER_ORPHAN}: </td>
<td><b>{TOTAL_ORPHAN}</b></td>
</tr>
<!-- ENDIF -->
</tbody>
</table>
<!-- IF .inactive -->
<!-- IF S_ACTION_OPTIONS -->
<form id="stats" method="post" action="{U_ACTION}">
<fieldset class="quick">
<p><a href="javascript:marklist('inactive', 'mark', true);">{L_MARK_ALL}</a> &bull; <a href="javascript:marklist('inactive', 'mark', false);">{L_UNMARK_ALL}</a></p>
<select name="action">{S_INACTIVE_OPTIONS}</select>
<select name="action">{S_ACTION_OPTIONS}</select>
<input class="button2" type="submit" name="submit" value="{L_SUBMIT}" />
</fieldset>
</form>
<!-- ENDIF -->
</form>
<!-- IF .log -->
<h2>{L_ADMIN_LOG}</h2>
<p>{L_ADMIN_LOG_INDEX_EXPLAIN}</p>
<table cellspacing="1">
<thead>
<tr>
<th>{L_USERNAME}</th>
<th>{L_IP}</th>
<th>{L_TIME}</th>
<th>{L_ACTION}</th>
</tr>
</thead>
<tbody>
<!-- BEGIN log -->
<!-- IF log.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td>{log.USERNAME}</td>
<td style="text-align: center;">{log.IP}</td>
<td style="text-align: center;">{log.DATE}</td>
<td>{log.ACTION}</td>
</tr>
<!-- END log -->
</tbody>
</table>
<br />
<div style="text-align: right;"><a href="{U_ADMIN_LOG}">&raquo; {L_VIEW_ADMIN_LOG}</a></div>
<!-- ENDIF -->
<!-- IF S_INACTIVE_USERS -->
<h2>{L_INACTIVE_USERS}</h2>
<p>{L_INACTIVE_USERS_EXPLAIN_INDEX}</p>
<div style="text-align: right;"><a href="{U_INACTIVE_USERS}">&raquo; {L_VIEW_INACTIVE_USERS}</a></div>
<table cellspacing="1">
<thead>
<tr>
<th>{L_USERNAME}</th>
<th>{L_JOINED}</th>
<th>{L_INACTIVE_DATE}</th>
<th>{L_INACTIVE_REASON}</th>
<th>{L_LAST_VISIT}</th>
</tr>
</thead>
<tbody>
<!-- BEGIN inactive -->
<!-- IF inactive.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td><a href="{inactive.U_USER_ADMIN}">{inactive.USERNAME}</a></td>
<td>{inactive.JOINED}</td>
<td>{inactive.INACTIVE_DATE}</td>
<td>{inactive.REASON}</td>
<td>{inactive.LAST_VISIT}</td>
</tr>
<!-- BEGINELSE -->
<tr>
<td colspan="5" style="text-align: center;">{L_NO_INACTIVE_USERS}</td>
</tr>
<!-- END inactive -->
</tbody>
</table>
<!-- ENDIF -->
<!-- ENDIF -->

View File

@@ -21,16 +21,20 @@
function display_modes(value)
{
// Remove select fields
// Find the old select tag
var item = document.getElementById('module_mode');
var j = 0;
// empty existing items
for (var i = 0; i <= item.options.length; i++)
{
item.options[i] = null;
}
// Create the new select tag
var new_node = document.createElement('select');
new_node.setAttribute('id', 'module_mode');
// Substitute it for the old one
item.parentNode.replaceChild(new_node, item);
// Reset the variable
item = document.getElementById('module_mode');
var j = 0;
<!-- BEGIN m_names -->
if (value == '{m_names.NAME}')
@@ -93,9 +97,9 @@
<label><input type="radio" class="radio" name="module_display" value="0"<!-- IF not MODULE_DISPLAY --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
<dt><label for="module_name">{L_CHOOSE_MODULE}:</label><br />
<dt><label for="module_basename">{L_CHOOSE_MODULE}:</label><br />
<span>{L_CHOOSE_MODULE_EXPLAIN}</span></dt>
<dd><select name="module_name" id="module_name" onchange="display_modes(this.value);">{S_MODULE_NAMES}</select></dd>
<dd><select name="module_basename" id="module_basename" onchange="display_modes(this.value);">{S_MODULE_NAMES}</select></dd>
</dl>
<dl>
<dt><label for="module_mode">{L_CHOOSE_MODE}:</label><br />
@@ -143,11 +147,22 @@
<!-- BEGIN modules -->
<tr>
<td style="width: 5%;">{modules.MODULE_IMAGE}</td>
<td style="width: 50%;"><a href="{modules.U_MODULE}">{modules.MODULE_TITLE}</a><!-- IF not modules.MODULE_DISPLAYED --> <span class="small">[{L_HIDDEN_MODULE}]</span><!-- ENDIF --></td>
<td><a href="{modules.U_MODULE}">{modules.MODULE_TITLE}</a><!-- IF not modules.MODULE_DISPLAYED --> <span class="small">[{L_HIDDEN_MODULE}]</span><!-- ENDIF --></td>
<td style="width: 15%; white-space: nowrap; text-align: center; vertical-align: middle;">&nbsp;<!-- IF modules.MODULE_ENABLED --><a href="{modules.U_DISABLE}">{L_DISABLE}</a><!-- ELSE --><a href="{modules.U_ENABLE}">{L_ENABLE}</a><!-- ENDIF -->&nbsp;</td>
<td style="width: 20%; white-space: nowrap; text-align: center; vertical-align: middle;">
<!-- IF not modules.S_FIRST_ROW --><a href="{modules.U_MOVE_UP}">{ICON_MOVE_UP}</a> <!-- ENDIF -->
<!-- IF not modules.S_LAST_ROW --><a href="{modules.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> <!-- ENDIF -->
<td style="width:90px; white-space: nowrap; text-align: right; vertical-align: middle;">
<!-- IF modules.S_FIRST_ROW && not modules.S_LAST_ROW -->
{ICON_MOVE_UP_DISABLED}
<a href="{modules.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF not modules.S_FIRST_ROW && not modules.S_LAST_ROW-->
<a href="{modules.U_MOVE_UP}">{ICON_MOVE_UP}</a>
<a href="{modules.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF modules.S_LAST_ROW && not modules.S_FIRST_ROW -->
<a href="{modules.U_MOVE_UP}">{ICON_MOVE_UP}</a>
{ICON_MOVE_DOWN_DISABLED}
<!-- ELSE -->
{ICON_MOVE_UP_DISABLED}
{ICON_MOVE_DOWN_DISABLED}
<!-- ENDIF -->
<a href="{modules.U_EDIT}">{ICON_EDIT}</a>
<a href="{modules.U_DELETE}">{ICON_DELETE}</a>
</td>

View File

@@ -96,7 +96,7 @@
<h1>{L_ACL_TYPE}</h1>
<fieldset class="quick">
<a href="javascript: mark_options('a_options', 'y');">{L_ALL_YES}</a> &bull; <a href="javascript: mark_options('a_options', 'n');">{L_ALL_NO}</a> &bull; <a href="javascript: mark_options('a_options', 'u');">{L_ALL_UNSET}</a>
<a href="#" onclick="mark_options('a_options', 'y'); return false;">{L_ALL_YES}</a> &bull; <a href="#" onclick="mark_options('a_options', 'n'); return false;">{L_ALL_NEVER}</a> &bull; <a href="#" onclick="mark_options('a_options', 'u'); return false;">{L_ALL_NO}</a>
</fieldset>
<fieldset class="permissions">
@@ -114,14 +114,14 @@
<!-- BEGIN auth -->
<!-- IF auth.S_YES -->
<td class="preset preset_yes">
<!-- ELSEIF auth.S_NEVER -->
<td class="preset preset_never">
<!-- ELSEIF auth.S_NO -->
<td class="preset preset_no">
<!-- ELSEIF auth.S_UNSET -->
<td class="preset preset_unset">
<!-- ELSE -->
<td class="preset preset_custom">
<!-- ENDIF -->
<a href="javascript:swap_options('options{auth.S_ROW_COUNT}');"><span></span></a></td>
<a href="#" onclick="swap_options('options{auth.S_ROW_COUNT}'); return false;"><span></span></a></td>
<!-- END auth -->
</tr>
<tr class="row3">
@@ -131,18 +131,18 @@
<thead>
<tr>
<th scope="col" style="text-align: left; padding-left: 0;"><strong>{L_ACL_SETTING} [{auth.CAT_NAME}]</strong></th>
<th scope="col"><a href="javascript: mark_options('options{auth.S_ROW_COUNT}', 'y');">{L_ACL_YES}</a></th>
<th scope="col"><a href="javascript: mark_options('options{auth.S_ROW_COUNT}', 'u');">{L_ACL_UNSET}</a></th>
<th scope="col"><a href="javascript: mark_options('options{auth.S_ROW_COUNT}', 'n');">{L_ACL_NO}</a></th>
<th scope="col"><a href="#" onclick="mark_options('options{auth.S_ROW_COUNT}', 'y'); return false;">{L_ACL_YES}</a></th>
<th scope="col"><a href="#" onclick="mark_options('options{auth.S_ROW_COUNT}', 'u'); return false;">{L_ACL_NO}</a></th>
<th scope="col"><a href="#" onclick="mark_options('options{auth.S_ROW_COUNT}', 'n'); return false;">{L_ACL_NEVER}</a></th>
</tr>
</thead>
<tbody>
<!-- BEGIN mask -->
<!-- IF auth.mask.S_ROW_COUNT is even --><tr class="row4"><!-- ELSE --><tr class="row3"><!-- ENDIF -->
<th>{auth.mask.PERMISSION}</th>
<td class="unset"><input id="setting[{auth.mask.FIELD_NAME}]_y" name="setting[{auth.mask.FIELD_NAME}]" class="radio" type="radio"<!-- IF auth.mask.S_YES --> checked="checked"<!-- ENDIF --> value="1" /></td>
<td class="unset"><input id="setting[{auth.mask.FIELD_NAME}]_u" name="setting[{auth.mask.FIELD_NAME}]" class="radio" type="radio"<!-- IF auth.mask.S_UNSET --> checked="checked"<!-- ENDIF --> value="-1" /></td>
<td class="unset"><input id="setting[{auth.mask.FIELD_NAME}]_n" name="setting[{auth.mask.FIELD_NAME}]" class="radio" type="radio"<!-- IF auth.mask.S_NO --> checked="checked"<!-- ENDIF --> value="0" /></td>
<td class="no"><input id="setting[{auth.mask.FIELD_NAME}]_y" name="setting[{auth.mask.FIELD_NAME}]" class="radio" type="radio"<!-- IF auth.mask.S_YES --> checked="checked"<!-- ENDIF --> value="1" /></td>
<td class="no"><input id="setting[{auth.mask.FIELD_NAME}]_u" name="setting[{auth.mask.FIELD_NAME}]" class="radio" type="radio"<!-- IF auth.mask.S_NO --> checked="checked"<!-- ENDIF --> value="-1" /></td>
<td class="no"><input id="setting[{auth.mask.FIELD_NAME}]_n" name="setting[{auth.mask.FIELD_NAME}]" class="radio" type="radio"<!-- IF auth.mask.S_NEVER --> checked="checked"<!-- ENDIF --> value="0" /></td>
</tr>
<!-- END mask -->
</tbody>
@@ -173,10 +173,10 @@
<form id="acp_roles" method="post" action="{U_ACTION}">
<table cellspacing="1">
<col class="col1" /><col class="col1" /><col class="col2" /><col class="col2" /><col class="col2" />
<col class="col2" /><col class="col2" /><col class="col1" /><col class="col2" /><col class="col2" />
<thead>
<tr>
<th style="width: 50%">{L_ROLE_NAME}</th>
<th>{L_ROLE_NAME}</th>
<th colspan="2">{L_OPTIONS}</th>
</tr>
</thead>
@@ -186,10 +186,21 @@
<td style="vertical-align: top;"><b>{roles.ROLE_NAME}</b>
<!-- IF roles.ROLE_DESCRIPTION --><br /><span>{roles.ROLE_DESCRIPTION}</span><!-- ENDIF -->
</td>
<td style="vertical-align: top; white-space: nowrap;"><!-- IF roles.U_DISPLAY_ITEMS --><a href="{roles.U_DISPLAY_ITEMS}">{L_VIEW_ASSIGNED_ITEMS}</a><!-- ELSE -->{L_VIEW_ASSIGNED_ITEMS}<!-- ENDIF --></td>
<td style="vertical-align: top; white-space: nowrap;">
<!-- IF not roles.S_FIRST_ROW --><a href="{roles.U_MOVE_UP}">{ICON_MOVE_UP}</a> <!-- ENDIF -->
<!-- IF not roles.S_LAST_ROW --><a href="{roles.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> <!-- ENDIF -->
<td style="width: 30%; text-align: center; vertical-align: top; white-space: nowrap;"><!-- IF roles.U_DISPLAY_ITEMS --><a href="{roles.U_DISPLAY_ITEMS}">{L_VIEW_ASSIGNED_ITEMS}</a><!-- ELSE -->{L_VIEW_ASSIGNED_ITEMS}<!-- ENDIF --></td>
<td style="width: 80px; text-align: right; vertical-align: top; white-space: nowrap;">
<!-- IF roles.S_FIRST_ROW && not roles.S_LAST_ROW -->
{ICON_MOVE_UP_DISABLED}
<a href="{roles.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF not roles.S_FIRST_ROW && not roles.S_LAST_ROW-->
<a href="{roles.U_MOVE_UP}">{ICON_MOVE_UP}</a>
<a href="{roles.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF roles.S_LAST_ROW && not roles.S_FIRST_ROW -->
<a href="{roles.U_MOVE_UP}">{ICON_MOVE_UP}</a>
{ICON_MOVE_DOWN_DISABLED}
<!-- ELSE -->
{ICON_MOVE_UP_DISABLED}
{ICON_MOVE_DOWN_DISABLED}
<!-- ENDIF -->
<a href="{roles.U_EDIT}" title="{L_EDIT_ROLE}">{ICON_EDIT}</a>
<a href="{roles.U_REMOVE}" title="{L_REMOVE_ROLE}">{ICON_DELETE}</a>
</td>

View File

@@ -89,7 +89,7 @@
<dl>
<dt><label for="username">{L_FIND_USERNAME}:</label></dt>
<dd><input class="medium" type="text" id="username" name="username[]" /></dd>
<dd>[ <a href="#" onclick="window.open('{U_FIND_USERNAME}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd>
<dd>[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd>
<dd class="full" style="text-align: left;"><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> &nbsp;{L_SELECT_ANONYMOUS}</dd>
</dl>
</fieldset>
@@ -134,14 +134,13 @@
<legend>{L_MANAGE_USERS}</legend>
<dl>
<dd class="full"><select style="width: 100%;" name="user_id[]" multiple="multiple" size="5">{S_DEFINED_USER_OPTIONS}</select></dd>
<dd class="full" style="text-align: right;"><input type="checkbox" class="radio" name="all_users" value="1" />&nbsp; {L_ALL_USERS}</dd>
<!-- IF S_ALLOW_ALL_SELECT --><dd class="full" style="text-align: right;"><input type="checkbox" class="radio" name="all_users" value="1" />&nbsp; {L_ALL_USERS}</dd><!-- ENDIF -->
</dl>
</fieldset>
<fieldset class="quick">
{S_HIDDEN_FIELDS}
<input class="button2" type="submit" name="action[delete]" value="{L_REMOVE_PERMISSIONS}" /> &nbsp;
<input class="button1" type="submit" name="submit_edit_options" value="{L_EDIT_PERMISSIONS}" />
<input type="submit" class="button2" name="action[delete]" value="{L_REMOVE_PERMISSIONS}" style="width: 46% !important;" /> &nbsp; <input class="button1" type="submit" name="submit_edit_options" value="{L_EDIT_PERMISSIONS}" style="width: 46% !important;" />
</fieldset>
</form>
@@ -153,13 +152,12 @@
<p>{L_USERNAMES_EXPLAIN}</p>
<dl>
<dd class="full"><textarea id="username" name="usernames" rows="5" cols="5" style="width: 100%; height: 60px;"></textarea></dd>
<dd class="full" style="text-align: left;"><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> &nbsp;{L_SELECT_ANONYMOUS}</dd>
<dd class="full" style="text-align: left;"><div style="float: right;">[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</div><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> &nbsp;{L_SELECT_ANONYMOUS}</dd>
</dl>
</fieldset>
<fieldset class="quick">
{S_HIDDEN_FIELDS}
<input class="button2" type="submit" name="find_username" value="{L_FIND_USERNAME}" onclick="window.open('{U_FIND_USERNAME}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;" /> &nbsp;
<input class="button1" type="submit" name="submit_add_options" value="{L_ADD_PERMISSIONS}" />
</fieldset>
@@ -181,14 +179,13 @@
<legend>{L_MANAGE_GROUPS}</legend>
<dl>
<dd class="full"><select style="width: 100%;" name="group_id[]" multiple="multiple" size="5">{S_DEFINED_GROUP_OPTIONS}</select></dd>
<dd class="full" style="text-align: right;"><input type="checkbox" class="radio" name="all_groups" value="1" />&nbsp; {L_ALL_GROUPS}</dd>
<!-- IF S_ALLOW_ALL_SELECT --><dd class="full" style="text-align: right;"><input type="checkbox" class="radio" name="all_groups" value="1" />&nbsp; {L_ALL_GROUPS}</dd><!-- ENDIF -->
</dl>
</fieldset>
<fieldset class="quick">
{S_HIDDEN_FIELDS}
<input class="button2" type="submit" name="action[delete]" value="{L_REMOVE_PERMISSIONS}" />&nbsp;
<input class="button1" type="submit" name="submit_edit_options" value="{L_EDIT_PERMISSIONS}" />
<input class="button2" type="submit" name="action[delete]" value="{L_REMOVE_PERMISSIONS}" style="width: 46% !important;" /> &nbsp; <input class="button1" type="submit" name="submit_edit_options" value="{L_EDIT_PERMISSIONS}" style="width: 46% !important;" />
</fieldset>
</form>
@@ -242,7 +239,7 @@
<dl>
<dt><label for="username">{L_FIND_USERNAME}:</label></dt>
<dd><input type="text" id="username" name="username[]" /></dd>
<dd>[ <a href="#" onclick="window.open('{U_FIND_USERNAME}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd>
<dd>[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd>
<dd class="full" style="text-align: left;"><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> &nbsp;{L_SELECT_ANONYMOUS}</dd>
</dl>
</fieldset>
@@ -359,7 +356,7 @@
<fieldset class="quick" style="float: left; text-align: left;">
{L_PERMISSION_APPLIED_TO_ALL}<br />
<a href="javascript:marklist('set_permissions', 'inherit', true);">{L_MARK_ALL}</a> &bull; <a href="javascript:marklist('set_permissions', 'inherit', false);">{L_UNMARK_ALL}</a>
<a href="#" onclick="marklist('set_permissions', 'inherit', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('set_permissions', 'inherit', false); return false;">{L_UNMARK_ALL}</a>
</fieldset>
<fieldset class="quick" style="float: right;">

View File

@@ -27,10 +27,17 @@
<dt><label>{L_FIELD_TYPE}:</label><br /><span>{L_FIELD_TYPE_EXPLAIN}</span></dt>
<dd><b>{FIELD_TYPE}</b></dd>
</dl>
<!-- IF S_EDIT_MODE -->
<dl>
<dt><label>{L_FIELD_IDENT}:</label><br /><span>{L_FIELD_IDENT_EXPLAIN}</span></dt>
<dd><input type="hidden" name="field_ident" value="{FIELD_IDENT}" /><strong>{FIELD_IDENT}</strong></dd>
</dl>
<!-- ELSE -->
<dl>
<dt><label for="field_ident">{L_FIELD_IDENT}:</label><br /><span>{L_FIELD_IDENT_EXPLAIN}</span></dt>
<dd><input class="medium" type="text" id="field_ident" name="field_ident" value="{FIELD_IDENT}" /></dd>
</dl>
<!-- ENDIF -->
<dl>
<dt><label for="field_no_view">{L_DISPLAY_PROFILE_FIELD}:</label><br /><span>{L_DISPLAY_PROFILE_FIELD_EXPLAIN}</span></dt>
<dd><input type="radio" class="radio" id="field_no_view" name="field_no_view" value="0"<!-- IF not S_FIELD_NO_VIEW --> checked="checked"<!-- ENDIF --> /> {L_YES} <input type="radio" class="radio" name="field_no_view" value="1"<!-- IF S_FIELD_NO_VIEW --> checked="checked"<!-- ENDIF --> /> {L_NO}</dd>
@@ -40,7 +47,7 @@
<fieldset>
<legend>{L_VISIBILITY_OPTION}</legend>
<dl>
<dt><label for="field_option_none">{L_DISPLAY_AT_PROFILE}:</label></dt>
<dt><label for="field_option_none">{L_DISPLAY_AT_PROFILE}:</label><br /><span>{L_DISPLAY_AT_PROFILE_EXPLAIN}</span></dt>
<dd><input type="radio" class="radio" id="field_option_none" name="field_option" value="none"<!-- IF not S_SHOW_ON_REG and not S_FIELD_REQUIRED and not S_FIELD_HIDE --> checked="checked"<!-- ENDIF --> /></dd>
</dl>
<dl>
@@ -81,7 +88,13 @@
<!-- ENDIF -->
<!-- IF S_BOOL or S_DROPDOWN -->
<dl>
<dt><label for="lang_options">{L_ENTRIES}:</label><br /><span>{L_LANG_OPTIONS_EXPLAIN}</span></dt>
<dt><label for="lang_options">{L_ENTRIES}:</label>
<!-- IF S_EDIT_MODE and S_DROPDOWN -->
<br /><span>{L_EDIT_DROPDOWN_LANG_EXPLAIN}</span>
<!-- ELSE -->
<br /><span>{L_LANG_OPTIONS_EXPLAIN}</span>
<!-- ENDIF -->
</dt>
<!-- IF S_DROPDOWN -->
<dd><textarea id="lang_options" name="lang_options" rows="5" cols="80">{LANG_OPTIONS}</textarea></dd>
<!-- ELSE -->
@@ -148,14 +161,20 @@
<!-- ELSE -->
<h1>{L_ACP_CUSTOM_PROFILE_FIELDS}</h1>
<!-- IF S_NEED_EDIT -->
<div class="errorbox">
<h3>{L_WARNING}</h3>
<p>{L_CUSTOM_FIELDS_NOT_TRANSLATED}</p>
</div>
<!-- ENDIF -->
<table cellspacing="1">
<thead>
<tr>
<th>{L_FIELD_IDENT}</th>
<th>{L_FIELD_TYPE}</th>
<th>&nbsp;</th>
<th>{L_OPTIONS}</th>
<th colspan="2">{L_OPTIONS}</th>
</tr>
</thead>
<tbody>
@@ -164,12 +183,24 @@
<td>{fields.FIELD_IDENT}</td>
<td>{fields.FIELD_TYPE}</td>
<td><a href="{fields.U_ACTIVATE_DEACTIVATE}">{fields.L_ACTIVATE_DEACTIVATE}</a><!-- IF fields.S_NEED_EDIT --> | <a href="{fields.U_EDIT}"><span style="color:red;">{L_EDIT}</span><!-- ENDIF --></td>
<td style="text-align: center;"><a href="{fields.U_ACTIVATE_DEACTIVATE}">{fields.L_ACTIVATE_DEACTIVATE}</a><!-- IF fields.S_NEED_EDIT --> | <a href="{fields.U_TRANSLATE}" style="color: red;">{L_TRANSLATE}</a><!-- ENDIF --></td>
<td style="width: 15%; text-align: right; white-space: nowrap;">
<!-- IF not fields.S_FIRST_ROW --><a href="{fields.U_MOVE_UP}">{ICON_MOVE_UP}</a> <!-- ENDIF -->
<!-- IF not fields.S_LAST_ROW --><a href="{fields.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> <!-- ENDIF -->
<!-- IF not fields.S_NEED_EDIT --><a href="{fields.U_EDIT}">{ICON_EDIT}</a> <!-- ENDIF -->
<td style="width: 80px; text-align: right; white-space: nowrap;">
<!-- IF fields.S_FIRST_ROW && not fields.S_LAST_ROW -->
{ICON_MOVE_UP_DISABLED}
<a href="{fields.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF not fields.S_FIRST_ROW && not fields.S_LAST_ROW-->
<a href="{fields.U_MOVE_UP}">{ICON_MOVE_UP}</a>
<a href="{fields.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF fields.S_LAST_ROW && not fields.S_FIRST_ROW -->
<a href="{fields.U_MOVE_UP}">{ICON_MOVE_UP}</a>
{ICON_MOVE_DOWN_DISABLED}
<!-- ENDIF -->
<!-- IF not fields.S_NEED_EDIT -->
<a href="{fields.U_EDIT}">{ICON_EDIT}</a>
<!-- ELSE -->
{ICON_EDIT_DISABLED}
<!-- ENDIF -->
<a href="{fields.U_DELETE}">{ICON_DELETE}</a>
</td>
@@ -182,7 +213,8 @@
<fieldset class="quick">
<input class="small" type="text" name="field_ident" /> <select name="field_type">{S_TYPE_OPTIONS}</select>
<input class="button1" type="submit" name="create" value="{L_CREATE_NEW_FIELD}" />
<input class="button1" type="submit" name="submit" value="{L_CREATE_NEW_FIELD}" />
<input type="hidden" name="create" value="1" />
</fieldset>
</form>

View File

@@ -25,7 +25,7 @@
</tr>
<!-- BEGINELSE -->
<tr>
<td class="row3" style="text-align: center;">{L_NO_PRUNE}</td>
<td colspan="3" class="row3" style="text-align: center;">{L_NO_PRUNE}</td>
</tr>
<!-- END pruned -->
</tbody>

View File

@@ -17,19 +17,37 @@
</div>
<!-- ENDIF -->
<!-- IF not S_TRANSLATED -->
<h3>{L_AVAILABLE_TITLES}</h3>
<p>{S_AVAILABLE_TITLES}</p>
<!-- ENDIF -->
<form id="acp_reasons" method="post" action="{U_ACTION}">
<fieldset>
<legend>{L_TITLE}</legend>
<p><!-- IF S_TRANSLATED -->{L_IS_TRANSLATED}<!-- ELSE -->{L_IS_NOT_TRANSLATED}<!-- ENDIF --></p>
<p><!-- IF S_TRANSLATED -->{L_IS_TRANSLATED_EXPLAIN}<!-- ELSE -->{L_IS_NOT_TRANSLATED_EXPLAIN}<!-- ENDIF --></p>
<dl>
<dt><label for="reason_title">{L_REASON_TITLE}:</label></dt>
<dd><input name="reason_title" type="text" id="reason_title" value="{REASON_TITLE}" /></dd>
</dl>
<!-- IF S_TRANSLATED -->
<dl>
<dt>{L_REASON_TITLE_TRANSLATED}</dt>
<dd>{TRANSLATED_TITLE}</dd>
</dl>
<!-- ENDIF -->
<dl>
<dt><label for="reason_description">{L_REASON_DESCRIPTION}:</label></dt>
<dd><textarea name="reason_description" id="reason_description" rows="8">{REASON_DESCRIPTION}</textarea></dd>
</dl>
<!-- IF S_TRANSLATED -->
<dl>
<dt>{L_REASON_DESC_TRANSLATED}</dt>
<dd>{TRANSLATED_DESCRIPTION}</dd>
</dl>
<!-- ENDIF -->
</fieldset>
<fieldset class="submit-buttons">
@@ -64,11 +82,23 @@
<br /><span>{reasons.REASON_DESCRIPTION}</span>
</td>
<td style="width: 100px;">{reasons.REASON_COUNT}</td>
<td style="width: 15%; text-align: right; white-space: nowrap;">
<!-- IF not reasons.S_FIRST_ROW --><a href="{reasons.U_MOVE_UP}">{ICON_MOVE_UP}</a> <!-- ENDIF -->
<!-- IF not reasons.S_LAST_ROW --><a href="{reasons.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> <!-- ENDIF -->
<td style="width: 80px; text-align: right; white-space: nowrap;">
<!-- IF reasons.S_FIRST_ROW && not reasons.S_LAST_ROW -->
{ICON_MOVE_UP_DISABLED}
<a href="{reasons.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF not reasons.S_FIRST_ROW && not reasons.S_LAST_ROW-->
<a href="{reasons.U_MOVE_UP}">{ICON_MOVE_UP}</a>
<a href="{reasons.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF reasons.S_LAST_ROW && not reasons.S_FIRST_ROW -->
<a href="{reasons.U_MOVE_UP}">{ICON_MOVE_UP}</a>
{ICON_MOVE_DOWN_DISABLED}
<!-- ENDIF -->
<a href="{reasons.U_EDIT}">{ICON_EDIT}</a>
<!-- IF reasons.U_DELETE --><a href="{reasons.U_DELETE}">{ICON_DELETE}</a><!-- ENDIF -->
<!-- IF reasons.U_DELETE -->
<a href="{reasons.U_DELETE}">{ICON_DELETE}</a>
<!-- ELSE -->
{ICON_DELETE_DISABLED}
<!-- ENDIF -->
</td>
</tr>
<!-- END reasons -->

View File

@@ -55,8 +55,8 @@
<!-- END backend -->
<fieldset class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="Submit" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="Reset" />
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</fieldset>
</form>
@@ -82,7 +82,7 @@
<p>{L_ACP_SEARCH_INDEX_EXPLAIN}</p>
<!-- IF S_CONTINUE_INDEXING -->
<a href="{U_CONTINUE_INDEXING}" onclick="javascript:popup_progress_bar('{S_CONTINUE_INDEXING}');">{L_CONTINUE}</a>
<a href="{U_CONTINUE_INDEXING}" onclick="popup_progress_bar('{S_CONTINUE_INDEXING}');">{L_CONTINUE}</a>
<p>{L_CONTINUE_EXPLAIN}</p>
<!-- ELSE -->
@@ -121,9 +121,9 @@
<fieldset class="quick">
<!-- IF backend.S_INDEXED -->
<input class="button2" type="submit" name="action[delete]" value="{L_DELETE_INDEX}" onclick="javascript:popup_progress_bar('delete')" />
<input class="button2" type="submit" name="action[delete]" value="{L_DELETE_INDEX}" onclick="popup_progress_bar('delete');" />
<!-- ELSE -->
<input class="button2" type="submit" name="action[create]" value="{L_CREATE_INDEX}" onclick="javascript:popup_progress_bar('create')" />
<input class="button2" type="submit" name="action[create]" value="{L_CREATE_INDEX}" onclick="popup_progress_bar('create');" />
<!-- ENDIF -->
</fieldset>

View File

@@ -78,7 +78,7 @@
<td class="row1" colspan="2" align="center">
<table width="100%" cellspacing="2" cellpadding="2" border="0">
<tr>
<td width="50%" align="center"><img src="<!-- IF IMAGE_REQUEST neq '' -->{IMAGE_REQUEST}<!-- ELSE -->images/no_image.png<!-- ENDIF -->"/></td>
<td width="50%" align="center"><img src="<!-- IF IMAGE_REQUEST -->{IMAGE_REQUEST}<!-- ELSE -->images/no_image.png<!-- ENDIF -->"/></td>
<td width="50%" align="center"><img src="images/no_image.png" name="newimg" /></td>
</tr>
<tr>
@@ -94,7 +94,7 @@
</tr>
<tr>
<td class="row1" width="40%"><b>{L_IMAGE}: </b></td>
<td class="row2"><select name="imgpath" onchange="update_image(this.options[selectedIndex].value);"><option value=""<!-- IF not IMAGE_SELECT--> selected="selected"<!-- ENDIF -->>{L_NONE}</option>
<td class="row2"><select name="imgpath" onchange="update_image(this.options[selectedIndex].value);"><option value=""<!-- IF not IMAGE_SELECT--> selected="selected"<!-- ENDIF -->>{L_NO_IMAGE}</option>
<!-- BEGIN imagesetlist -->
<option class="sep" value=""><!-- IF imagesetlist.TYPE -->{L_LOCALISED_IMAGES}<!-- ELSE -->{L_GLOBAL_IMAGES}<!-- ENDIF --></option>
<!-- BEGIN images -->
@@ -330,7 +330,7 @@
</dl>
<dl>
<dt><label for="font_size">{L_FONT_SIZE}:</label></dt>
<dd><input id="font_size" name="font_size" type="text" value="{FONT_SIZE}" size="3" maxlength="3" /> <select id="font_size_unit" name="font_size_unit">{S_FONT_SIZE_UNITS}</select></dd>
<dd><input id="font_size" name="font_size" type="text" value="{FONT_SIZE}" size="5" maxlength="5" /> <select id="font_size_unit" name="font_size_unit">{S_FONT_SIZE_UNITS}</select></dd>
</dl>
<dl>
<dt><label for="font_weight">{L_BOLD}:</label></dt>
@@ -440,7 +440,7 @@
</table>
<fieldset class="quick">
<span class="small"><a href="javascript:marklist('acp_styles', 'delete', true);">Mark all</a> :: <a href="javascript:marklist('acp_styles', 'delete', false);">Unmark all</a></span><br />
<span class="small"><a href="#" onclick="marklist('acp_styles', 'delete', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('acp_styles', 'delete', false); return false;">{L_UNMARK_ALL}</a></span><br />
<input class="button1" type="submit" id="submit" name="submit" value="{L_DELETE_MARKED}" />
</fieldset>
@@ -506,15 +506,16 @@
<p>{L_EXPLAIN}</p>
<!-- IF S_STYLE --> <!-- DEFINE $COLSPAN = 4 --> <!-- ELSE --> <!-- DEFINE $COLSPAN = 3 --> <!-- ENDIF -->
<!-- IF S_STYLE --> <!-- DEFINE $COLSPAN = 5 --> <!-- ELSE --> <!-- DEFINE $COLSPAN = 4 --> <!-- ENDIF -->
<table cellspacing="1">
<col class="row1" /><!-- IF S_STYLE --><col class="row1" /><!-- ENDIF --><col class="row2" />
<col class="row1" /><!-- IF S_STYLE --><col class="row1" /><!-- ENDIF --><col class="row2" /><col class="row2" />
<thead>
<tr>
<th>{L_NAME}</th>
<!-- IF S_STYLE --><th>{L_STYLE_USED_BY}</th><!-- ENDIF -->
<th>{L_OPTIONS}</th>
<th>{L_ACTIONS}</th>
</tr>
</thead>
<tbody>
@@ -523,17 +524,20 @@
</tr>
<!-- BEGIN installed -->
<tr>
<td><a href="{installed.U_EDIT}">{installed.NAME}</a><!-- IF installed.S_DEFAULT_STYLE --> *<!-- ENDIF --></td>
<td><strong>{installed.NAME}</strong></a><!-- IF installed.S_DEFAULT_STYLE --> *<!-- ENDIF --></td>
<!-- IF S_STYLE -->
<td style="text-align: center;">{installed.STYLE_COUNT}</td>
<!-- ENDIF -->
<td style="text-align: center;">
{installed.S_OPTIONS}
</td>
<td style="text-align: center;">
<!-- IF S_STYLE -->
<a href="{installed.U_STYLE_ACT_DEACT}">{installed.L_STYLE_ACT_DEACT}</a> |
<!-- ENDIF -->
{installed.S_OPTIONS}
{installed.S_ACTIONS}
<!-- IF S_STYLE -->
| <a href="{installed.U_PREVIEW}" onclick="this.target='_preview';">{L_PREVIEW}</a>
| <a href="{installed.U_PREVIEW}">{L_PREVIEW}</a>
<!-- ENDIF -->
</td>
<!-- END installed -->
@@ -548,7 +552,7 @@
<!-- BEGIN uninstalled -->
<tr>
<td<!-- IF S_STYLE --> colspan="2"<!-- ENDIF -->><b>{uninstalled.NAME}</b><br /><span>{L_COPYRIGHT}: {uninstalled.COPYRIGHT}</span></td>
<td style="text-align: center;"><a href="{uninstalled.U_INSTALL}">{L_INSTALL}</a></td>
<td style="text-align: center;" colspan="2"><a href="{uninstalled.U_INSTALL}">{L_INSTALL}</a></td>
</tr>
<!-- END uninstalled -->
</tbody>

View File

@@ -0,0 +1,40 @@
<!-- INCLUDE overall_header.html -->
<a name="maincontent"></a>
<!-- IF S_VERSION_CHECK -->
<h1>{L_VERSION_CHECK}</h1>
<p>{L_VERSION_CHECK_EXPLAIN}</p>
<!-- IF S_UP_TO_DATE -->
<div class="successbox">
<p>{L_VERSION_UP_TO_DATE_ACP}</p>
</div>
<!-- ELSE -->
<div class="errorbox">
<p>{L_VERSION_NOT_UP_TO_DATE_ACP}</p>
</div>
<!-- ENDIF -->
<fieldset>
<legend></legend>
<dl>
<dt><label>{L_CURRENT_VERSION}</label></dt>
<dd><b>{CURRENT_VERSION}</b></dd>
</dl>
<dl>
<dt><label>{L_LATEST_VERSION}</label></dt>
<dd><b>{LATEST_VERSION}</b></dd>
</dl>
</fieldset>
<!-- IF not S_UP_TO_DATE -->
{UPDATE_INSTRUCTIONS}
<br /><br />
<!-- ENDIF -->
<!-- ENDIF -->
<!-- INCLUDE overall_footer.html -->

View File

@@ -15,7 +15,7 @@
<dl>
<dt><label for="username">{L_FIND_USERNAME}:</label></dt>
<dd><input class="medium" type="text" id="username" name="username" /></dd>
<dd>[ <a href="#" onclick="window.open('{U_FIND_USERNAME}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd>
<dd>[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd>
<dd class="full" style="text-align: left;"><input type="checkbox" class="radio" id="anonymous" name="u" value="{ANONYMOUS_USER_ID}" /> &nbsp;{L_SELECT_ANONYMOUS}</dd>
</dl>
</fieldset>
@@ -68,7 +68,7 @@
<form id="mode_select" method="post" action="{U_MODE_SELECT}">
<fieldset class="quick">
{L_SELECT_FORM}: <select name="mode" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();">{S_FORM_OPTIONS}</select>
{L_SELECT_FORM}: <select name="mode" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();">{S_FORM_OPTIONS}</select> <input class="button2" type="submit" value="{L_GO}" />
</fieldset>
</form>
@@ -83,7 +83,7 @@
<legend>{L_ACP_USER_OVERVIEW}</legend>
<dl>
<dt><label for="user">{L_USERNAME}:</label><br /><span>{L_NAME_CHARS_EXPLAIN}</span></dt>
<dd><input type="text" id="user" name="user" value="{USER}" /></dd>
<dd><input type="text" id="user" name="user" value="{USER}" /><!-- IF S_USER_INACTIVE --> [{L_USER_IS_INACTIVE}]<!-- ENDIF --></dd>
<!-- IF U_SWITCH_PERMISSIONS --><dd>[ <a href="{U_SWITCH_PERMISSIONS}">{L_USE_PERMISSIONS}</a> ]</dd><!-- ENDIF -->
</dl>
<dl>
@@ -101,6 +101,10 @@
<dt><label>{L_LAST_ACTIVE}:</label></dt>
<dd><strong>{USER_LASTACTIVE}</strong></dd>
</dl>
<dl>
<dt><label>{L_POSTS}:</label></dt>
<dd><strong>{USER_POSTS}</strong></dd>
</dl>
<dl>
<dt><label for="user_founder">{L_FOUNDER}:</label><br /><span>{L_FOUNDER_EXPLAIN}</span></dt>
<dd><input type="radio" class="radio" name="user_founder" value="1"<!-- IF S_USER_FOUNDER --> id="user_founder" checked="checked"<!-- ENDIF --><!-- IF not S_FOUNDER --> disabled="disabled"<!-- ENDIF --> />&nbsp;{L_YES}&nbsp; <input type="radio" class="radio" name="user_founder" value="0"<!-- IF not S_USER_FOUNDER --> id="user_founder" checked="checked"<!-- ENDIF --><!-- IF not S_FOUNDER --> disabled="disabled"<!-- ENDIF --> />&nbsp;{L_NO}&nbsp;</dd>
@@ -134,11 +138,13 @@
<dt><label for="quicktools">{L_QUICK_TOOLS}:</label></dt>
<dd><select id="quicktools" name="action">{S_ACTION_OPTIONS}</select></dd>
</dl>
<dl>
<dt><label for="delete_user">{L_DELETE_USER}:</label><br /><span>{L_DELETE_USER_EXPLAIN}</span></dt>
<dd><input type="checkbox" class="radio" name="delete" value="1" /></dd>
<dd><select id="delete_user" name="delete_type"><option value="retain">{L_RETAIN_POSTS}</option><option value="remove">{L_DELETE_POSTS}</option></select></dd>
</dl>
<!-- IF not S_OWN_ACCOUNT -->
<dl>
<dt><label for="delete_user">{L_DELETE_USER}:</label><br /><span>{L_DELETE_USER_EXPLAIN}</span></dt>
<dd><input type="checkbox" class="radio" name="delete" value="1" /></dd>
<dd><select id="delete_user" name="delete_type"><option value="retain">{L_RETAIN_POSTS}</option><option value="remove">{L_DELETE_POSTS}</option></select></dd>
</dl>
<!-- ENDIF -->
<!-- ENDIF -->
</fieldset>
@@ -162,7 +168,7 @@
<!-- IF PAGINATION -->
<div class="pagination">
<!-- IF PAGINATION -->
<a href="javascript:jumpto();" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<!-- ELSE -->
{S_ON_PAGE}
<!-- ENDIF -->
@@ -340,7 +346,7 @@
</dl>
<dl>
<dt><label for="tz">{L_BOARD_TIMEZONE}:</label></dt>
<dd><select id="tz" name="tz">{S_TZ_OPTIONS}</select></dd>
<dd><select id="tz" name="tz" style="width: 100%;">{S_TZ_OPTIONS}</select></dd>
</dl>
<dl>
<dt><label for="dst">{L_BOARD_DST}:</label></dt>
@@ -537,23 +543,29 @@
// Define the bbCode tags
bbcode = new Array();
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]');
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]'<!-- BEGIN custom_tags -->, {custom_tags.BBCODE_NAME}<!-- END custom_tags -->);
imageTag = false;
// Helpline messages
b_help = "{LA_BBCODE_B_HELP}";
i_help = "{LA_BBCODE_I_HELP}";
u_help = "{LA_BBCODE_U_HELP}";
q_help = "{LA_BBCODE_Q_HELP}";
c_help = "{LA_BBCODE_C_HELP}";
l_help = "{LA_BBCODE_L_HELP}";
o_help = "{LA_BBCODE_O_HELP}";
p_help = "{LA_BBCODE_P_HELP}";
w_help = "{LA_BBCODE_W_HELP}";
a_help = "{LA_BBCODE_A_HELP}";
s_help = "{LA_BBCODE_S_HELP}";
f_help = "{LA_BBCODE_F_HELP}";
e_help = "{LA_BBCODE_E_HELP}";
// Helpline messages
var help_line = {
b: '{LA_BBCODE_B_HELP}',
i: '{LA_BBCODE_I_HELP}',
u: '{LA_BBCODE_U_HELP}',
q: '{LA_BBCODE_Q_HELP}',
c: '{LA_BBCODE_C_HELP}',
l: '{LA_BBCODE_L_HELP}',
o: '{LA_BBCODE_O_HELP}',
p: '{LA_BBCODE_P_HELP}',
w: '{LA_BBCODE_W_HELP}',
a: '{LA_BBCODE_A_HELP}',
s: '{LA_BBCODE_S_HELP}',
f: '{LA_BBCODE_F_HELP}',
e: '{LA_BBCODE_E_HELP}',
d: '{LA_BBCODE_D_HELP}'
<!-- BEGIN custom_tags -->
,cb_{custom_tags.BBCODE_ID}: '{custom_tags.BBCODE_HELPLINE}'
<!-- END custom_tags -->
}
//-->
</script>
@@ -572,15 +584,23 @@
<legend>{L_SIGNATURE}</legend>
<p>{L_SIGNATURE_EXPLAIN}</p>
<div id="format-buttons">
<input class="button2" type="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onclick="bbstyle(0)" onmouseover="helpline('b')" />
<input class="button2" type="button" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onclick="bbstyle(2)" onmouseover="helpline('i')" />
<input class="button2" type="button" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onclick="bbstyle(4)" onmouseover="helpline('u')" />
<input class="button2" type="button" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" />
<input class="button2" type="button" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" />
<input class="button2" type="button" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" />
<input class="button2" type="button" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" />
<input class="button2" type="button" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" />
<input class="button2" type="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" />
<input type="button" class="button2" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px;" onclick="bbstyle(0)" onmouseover="helpline('b')" />
<input type="button" class="button2" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px;" onclick="bbstyle(2)" onmouseover="helpline('i')" />
<input type="button" class="button2" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px;" onclick="bbstyle(4)" onmouseover="helpline('u')" />
<input type="button" class="button2" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" />
<input type="button" class="button2" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" />
<input type="button" class="button2" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" />
<input type="button" class="button2" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" />
<!-- IF S_BBCODE_IMG -->
<input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" />
<!-- ENDIF -->
<!-- IF S_LINKS_ALLOWED -->
<input type="button" class="button2" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" onmouseover="helpline('d')" />
<!-- ENDIF -->
<!-- IF S_BBCODE_FLASH -->
<input type="button" class="button2" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" onmouseover="helpline('d')" />
<!-- ENDIF -->
{L_FONT_SIZE}: <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" onmouseover="helpline('f')">
<option value="7">{L_FONT_TINY}</option>
<option value="9">{L_FONT_SMALL}</option>
@@ -588,7 +608,14 @@
<option value="18">{L_FONT_LARGE}</option>
<option value="24">{L_FONT_HUGE}</option>
</select>
<a href="javascript:bbstyle(-1)" onmouseover="helpline('a')">{L_CLOSE_TAGS}</a>
<a href="#" onclick="bbstyle(-1); return false;" onmouseover="helpline('a')">{L_CLOSE_TAGS}</a>
<!-- IF .custom_tags -->
<br /><br />
<!-- BEGIN custom_tags -->
<input type="button" class="button2" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})"<!-- IF custom_tags.BBCODE_HELPLINE !== '' --> onmouseover="helpline('cb_{custom_tags.BBCODE_ID}')"<!-- ENDIF --> />
<!-- END custom_tags -->
<!-- ENDIF -->
</div>
<p><input type="text" name="helpbox" value="{L_STYLES_TIP}" class="full" style="border: 0; background: none;" /></p>
<dl>
@@ -598,10 +625,16 @@
</dt>
<dd style="text-align: left; margin-left: 95px;"><textarea name="signature" rows="10" cols="60" style="width: 80%;" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{SIGNATURE}</textarea></dd>
<dd style="text-align: left; margin-left: 95px;">
<!-- IF S_BBCODE_ALLOWED --><input type="checkbox" class="radio" name="disable_bbcode"{S_BBCODE_CHECKED} />&nbsp; {L_DISABLE_BBCODE} &nbsp;<!-- ENDIF -->
<!-- IF S_SMILIES_ALLOWED --><input type="checkbox" class="radio" name="disable_smilies"{S_SMILIES_CHECKED} />&nbsp; {L_DISABLE_SMILIES} &nbsp;<!-- ENDIF -->
<input type="checkbox" class="radio" name="disable_magic_url"{S_MAGIC_URL_CHECKED} />&nbsp; {L_DISABLE_MAGIC_URL} &nbsp;
<br /><br /><strong>{L_OPTIONS}: </strong>{BBCODE_STATUS} :: {IMG_STATUS} :: {FLASH_STATUS} :: {SMILIES_STATUS}
<!-- IF S_BBCODE_ALLOWED -->
<input type="checkbox" class="radio" name="disable_bbcode"{S_BBCODE_CHECKED} />&nbsp; {L_DISABLE_BBCODE} &nbsp;
<!-- ENDIF -->
<!-- IF S_SMILIES_ALLOWED -->
<input type="checkbox" class="radio" name="disable_smilies"{S_SMILIES_CHECKED} />&nbsp; {L_DISABLE_SMILIES} &nbsp;
<!-- ENDIF -->
<!-- IF S_LINKS_ALLOWED -->
<input type="checkbox" class="radio" name="disable_magic_url"{S_MAGIC_URL_CHECKED} />&nbsp; {L_DISABLE_MAGIC_URL} &nbsp;
<!-- ENDIF -->
<br /><br /><strong>{L_OPTIONS}: </strong>{BBCODE_STATUS} :: {IMG_STATUS} :: {FLASH_STATUS} :: {URL_STATUS} :: {SMILIES_STATUS}
</dd>
</dl>
</fieldset>
@@ -652,7 +685,7 @@
<div class="pagination" style="float: right;">
<!-- IF PAGINATION -->
<a href="javascript:jumpto();" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<!-- ELSE -->
{S_ON_PAGE}
<!-- ENDIF -->

View File

@@ -38,6 +38,15 @@
<p>{L_ACP_WORDS_EXPLAIN}</p>
<form id="acp_words" method="post" action="{U_ACTION}">
<fieldset class="quick">
{S_HIDDEN_FIELDS}
<input class="button2" name="add" type="submit" value="{L_ADD_WORD}" />
</fieldset>
</form>
<table cellspacing="1">
<thead>
<tr>
@@ -58,15 +67,6 @@
</tbody>
</table>
<form id="acp_words" method="post" action="{U_ACTION}">
<fieldset class="quick">
{S_HIDDEN_FIELDS}
<input class="button2" name="add" type="submit" value="{L_ADD_WORD}" />
</fieldset>
</form>
<!-- ENDIF -->
<!-- INCLUDE overall_footer.html -->

View File

@@ -18,6 +18,7 @@ html {
font-size: 100%;
height: 100%;
margin-bottom: 1px;
background-color: #E4EDF0;
}
body {
@@ -257,7 +258,7 @@ span.corners-top span, span.corners-bottom span {
border-top: 1px solid #FFFFFF;
}
#menu li a:hover span, #menu li#activemenu span {
#menu li a:hover span, #menu li#activemenu span, #menu li a:hover {
text-decoration: none;
background-color: #FFA34F;
color: #FFFFFF;
@@ -851,12 +852,12 @@ table.pmask td.name {
background-color: #40C53D;
}
.permissions td.no {
.permissions td.never {
width: 20px;
background-color: #EC7181;
}
.permissions td.unset {
.permissions td.no {
width: 20px;
background-color: transparent;
}
@@ -889,11 +890,11 @@ table.pmask td.name {
background: #DAE4EC url("../images/bg_hash2.gif") repeat;
}
.preset_no {
.preset_never {
background: #ECD7DA url("../images/bg_hash3.gif") repeat;
}
.preset_unset {
.preset_no {
background: #ECD7DA url("../images/bg_hash4.gif") repeat;
}
@@ -919,7 +920,8 @@ table.pmask td.name {
}
.errorbox {
background-color: #ECECEC;
background-color: #ECD7DA;
color: #990000;
}
.successbox h3, .errorbox h3 {

View File

@@ -1,7 +1,9 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Language" content="{S_USER_LANG}" />
<meta http-equiv="imagetoolbar" content="no" />
<title>{L_COLOUR_SWATCH}</title>
@@ -57,7 +59,7 @@
{
color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
document.write('<td style="background-color: #' + color + ';" onmouseover="this.className=\'over\'" onmouseout="this.className=\'out\'">');
document.write('<a href="javascript:cell(\'' + color + '\');"><img src="{T_IMAGES_PATH}spacer.gif" width="15" height="12" alt="#' + color + '" title="#' + color + '" \/><\/a>');
document.write('<a href="#" onclick="cell(\'' + color + '\'); return false;"><img src="{T_IMAGES_PATH}spacer.gif" width="15" height="12" alt="#' + color + '" title="#' + color + '" \/><\/a>');
document.writeln('<\/td>');
}
}

View File

@@ -33,7 +33,7 @@ function getarraysize(thearray)
{
for (i = 0; i < thearray.length; i++)
{
if (thearray[i] == 'undefined' || thearray[i] == '' || thearray[i] == null)
if (typeof thearray[i] == 'undefined' || thearray[i] == '' || thearray[i] == null)
{
return i;
}
@@ -208,7 +208,7 @@ function addquote(post_id, username)
theSelection = document.selection.createRange().text;
}
if (theSelection == '')
if (theSelection == '' || typeof theSelection == 'undefined' || theSelection == null)
{
if (document.all)
{
@@ -485,7 +485,7 @@ function colorPalette(dir, width, height)
{
color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
document.write('<td style="line-height: ' + height + 'px; background-color:#' + color + '; width: ' + width + 'px; height: ' + height + 'px;">');
document.write('<a href="javascript:bbfontstyle(\'[color=#' + color + ']\', \'[/color]\');" onmouseover="helpline(\'s\');"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>');
document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;" onmouseover="helpline(\'s\');"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>');
document.writeln('</td>');
}

View File

@@ -1,9 +1,10 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Language" content="{S_USER_LANG}" />
<meta http-equiv="imagetoolbar" content="no" />
<!-- IF META -->{META}<!-- ENDIF -->
<title>{PAGE_TITLE}</title>
@@ -16,6 +17,14 @@
<div id="wrap">
<div id="page-header">
<h1>{L_INSTALL_PANEL}</h1>
<!-- IF S_LANG_SELECT -->
<br />
<form method="post">
<label for="language">{L_SELECT_LANG}:</label>
{S_LANG_SELECT}
<input class="button1" type="submit" id="change_lang" name="change_lang" value="{L_CHANGE}" />
</form>
<!-- ENDIF -->
</div>
<div id="page-body">

View File

@@ -2,8 +2,8 @@
<form id="install_install" method="post" action="{U_ACTION}">
<h2>{TITLE}</h2>
<p>{BODY}</p>
<!-- IF TITLE --><h2>{TITLE}</h2><!-- ENDIF -->
<!-- IF BODY --><p>{BODY}</p><!-- ENDIF -->
<!-- IF .checks -->
<fieldset>

View File

@@ -0,0 +1,278 @@
<!-- INCLUDE install_header.html -->
<!-- IF S_ERROR -->
<h1>{L_NOTICE}</h1>
<p style="color: red;">{ERROR_MSG}</p>
<!-- ENDIF -->
<!-- IF S_INTRO -->
<form id="install_update" method="post" action="{U_ACTION}">
<h1>{L_UPDATE_INSTALLATION}</h1>
<p>{L_UPDATE_INSTALLATION_EXPLAIN}</p>
<fieldset class="submit-buttons">
<input class="button1" type="submit" name="submit" value="{L_NEXT}" />
</fieldset>
</form>
<!-- ELSEIF S_UPLOAD_SUCCESS -->
<form id="install_update" method="post" action="{U_ACTION}">
<h1>{L_UPDATE_SUCCESS}</h1>
<p>{L_UPDATE_SUCCESS_EXPLAIN}</p>
<fieldset class="submit-buttons">
<input class="button1" type="submit" name="submit" value="{L_CHECK_FILES_AGAIN}" />
</fieldset>
</form>
<!-- ENDIF -->
<!-- IF S_VERSION_CHECK -->
<h1>{L_VERSION_CHECK}</h1>
<p>{L_VERSION_CHECK_EXPLAIN}</p>
<!-- IF S_UP_TO_DATE -->
<div class="successbox">
<p>{L_VERSION_UP_TO_DATE}</p>
</div>
<!-- ELSE -->
<div class="errorbox">
<p>{L_VERSION_NOT_UP_TO_DATE}</p>
</div>
<!-- ENDIF -->
<fieldset>
<legend></legend>
<dl>
<dt><label>{L_CURRENT_VERSION}</label></dt>
<dd><b>{CURRENT_VERSION}</b></dd>
</dl>
<dl>
<dt><label>{L_LATEST_VERSION}</label></dt>
<dd><b>{LATEST_VERSION}</b></dd>
</dl>
</fieldset>
<!-- IF not S_UP_TO_DATE -->
<form id="install_update" method="post" action="{U_ACTION}">
<fieldset class="submit-buttons">
<p>{L_CHECK_FILES_EXPLAIN}</p>
<input class="button1" type="submit" name="submit" value="{L_CHECK_FILES}" />
</fieldset>
</form>
<!-- ELSE -->
<form id="install_update" method="post" action="{U_ACTION}">
<fieldset class="submit-buttons">
<p>{L_CHECK_FILES_UP_TO_DATE}</p>
<input class="button1" type="submit" name="submit" value="{L_CHECK_FILES}" />
</fieldset>
</form>
<!-- ENDIF -->
<!-- ELSEIF S_FILE_CHECK -->
<h1>{L_COLLECTED_INFORMATIONS}</h1>
<p>{L_COLLECTED_INFORMATIONS_EXPLAIN}</p>
<!-- IF S_NO_UPDATE_FILES -->
<div class="errorbox">
<h3>{L_NO_UPDATE_FILES}</h3>
<p>{L_NO_UPDATE_FILES_EXPLAIN}</p><br />
<strong>{NO_UPDATE_FILES}</strong>
</div>
<!-- ENDIF -->
<form id="install_update" method="post" action="{U_UPDATE_ACTION}">
<!-- IF .files -->
<!-- BEGIN files -->
<!-- IF files.S_STATUS -->
<!-- IF not files.S_FIRST_ROW -->
</fieldset>
<!-- ENDIF -->
<h2>{files.TITLE}</h2>
<p>{files.EXPLAIN}</p>
<!--table cellspacing="1">
<col class="row1" /><col class="row2" /><col class="row2" />
<tbody -->
<fieldset>
<legend><img src="{T_IMAGE_PATH}file_{files.STATUS}.gif" alt="{files.L_STATUS}" /></legend>
<!-- ELSE -->
<dl>
<!-- IF files.STATUS eq 'up_to_date' -->
<dd class="full" style="text-align: left;"><strong>{files.FILENAME}</strong></dd>
<!-- ELSE -->
<dt>
<strong>{files.FILENAME}</strong>
<!-- IF files.S_CUSTOM -->
<br /><span><em>{L_FILE_USED}: </em>{files.CUSTOM_ORIGINAL}</span>
<!-- ENDIF -->
<!-- IF files.NUM_CONFLICTS -->
<br /><span>{L_NUM_CONFLICTS}: {files.NUM_CONFLICTS}</span>
<!-- ENDIF -->
</dt>
<dd>[ <a href="{files.U_SHOW_DIFF}" onclick="popup({files.UA_SHOW_DIFF}, 700, 500);">{files.L_SHOW_DIFF}</a> ]</dd>
<!-- IF files.S_CUSTOM -->
<dd><input type="checkbox" name="no_update[]" value="{files.FILENAME}" class="radio" />&nbsp; {L_DO_NOT_UPDATE}</dd>
<!-- ENDIF -->
<!-- IF files.STATUS eq 'conflict' -->
<dd><input type="radio" class="radio" name="conflict[{files.FILENAME}]" value="1" checked="checked" />&nbsp; {L_MERGE_NEW_FILE_OPTION}<br /><input type="radio" class="radio" name="conflict[{files.FILENAME}]" value="2" />&nbsp; {L_MERGE_MOD_FILE_OPTION}</dd>
<!-- ENDIF -->
<!-- ENDIF -->
</dl>
<!-- ENDIF -->
<!-- END files -->
</fieldset>
<!-- ENDIF -->
<br />
<fieldset class="quick">
<input class="button1" type="submit" name="check_again" value="{L_CHECK_FILES_AGAIN}" />
</fieldset>
<br />
<!-- IF S_ALL_UP_TO_DATE -->
</form>
<!-- IF S_VERSION_UP_TO_DATE -->
<p>{L_NO_DATABASE_UPDATE_NEEDED}</p>
<!-- ELSE -->
<form id="install_dbupdate" method="post" action="{U_DB_UPDATE_ACTION}">
<fieldset class="submit-buttons">
<p>{L_ALL_FILES_UP_TO_DATE}</p>
<input class="button1" type="submit" name="db_update" value="{L_UPDATE_DATABASE}" />
</fieldset>
<!-- ENDIF -->
<!-- ELSE -->
<h1>{L_UPDATE_METHOD}</h1>
<p>{L_UPDATE_METHOD_EXPLAIN}</p>
<fieldset class="submit-buttons">
<input class="button1" type="submit" name="ftp_upload" value="{L_FTP_UPDATE_METHOD}" />&nbsp; &nbsp;<input class="button1" type="submit" name="download" value="{L_DOWNLOAD_UPDATE_METHOD}" />
</fieldset>
<!-- ENDIF -->
</form>
<!-- ELSEIF S_DOWNLOAD_FILES -->
<h1>{L_SELECT_DOWNLOAD_FORMAT}</h1>
<p>{L_DOWNLOAD_UPDATE_METHOD_EXPLAIN}</p>
<p>{L_MAPPING_FILE_STRUCTURE}</p>
<table cellspacing="1">
<col class="row1" /><col class="row2" /><col class="row1" />
<thead>
<tr>
<th style="width: 49%">{L_ARCHIVE_FILE}</th>
<th style="width: 2%">&nbsp;</th>
<th style="width: 49%">{L_DESTINATION}</th>
</tr>
</thead>
<tbody>
<!-- BEGIN location -->
<tr>
<td>{location.SOURCE}</td>
<td><strong>&raquo;</strong></td>
<td>{location.DESTINATION}</td>
</tr>
<!-- END location -->
</tbody>
</table>
<form id="install_update" method="post" action="{U_ACTION}">
<fieldset>
<legend>{L_DOWNLOAD_AS}</legend>
<dl>
<dt><label for="use_method">{L_DOWNLOAD_AS}:</label></dt>
<dd>{RADIO_BUTTONS}</dd>
</dl>
</fieldset>
<fieldset class="submit-buttons">
{S_HIDDEN_FIELDS}
<input type="submit" class="button2" value="{L_CHECK_FILES_AGAIN}" name="check_again" />&nbsp; &nbsp;<input type="submit" class="button1" value="{L_DOWNLOAD}" name="download" />
</fieldset>
</form>
<!-- ELSEIF S_FTP_UPLOAD -->
<h1>{L_SELECT_FTP_SETTINGS}</h1>
<form id="install_update" method="post" action="{U_ACTION}">
<!-- IF S_CONNECTION_SUCCESS -->
<div class="successbox">
<p>{L_CONNECTION_SUCCESS}</p>
</div>
<!-- ELSEIF S_CONNECTION_FAILED -->
<div class="errorbox">
<p>{L_CONNECTION_FAILED}<br />{ERROR_MSG}</p>
</div>
<!-- ENDIF -->
<fieldset>
<legend>{L_FTP_SETTINGS}</legend>
<dl>
<dt><label>{L_UPLOAD_METHOD}:</label></dt>
<dd><b>{UPLOAD_METHOD}</b></dd>
</dl>
<!-- BEGIN data -->
<dl>
<dt><label for="{data.DATA}">{data.NAME}:</label><br /><span>{data.EXPLAIN}</span></dt>
<dd><input type="text" id="{data.DATA}" name="{data.DATA}" value="{data.DEFAULT}" /></dd>
</dl>
<!-- END data -->
</fieldset>
<fieldset class="submit-buttons">
{S_HIDDEN_FIELDS}
<input class="button2" type="submit" name="check_again" value="{L_BACK}" />
<input class="button1" type="submit" name="test_connection" value="{L_TEST_CONNECTION}" />
<input class="button1" type="submit" name="submit" value="{L_UPDATE_FILES}" />
</fieldset>
</form>
<!-- ELSEIF S_DB_UPDATE -->
<h1>{L_PERFORM_DATABASE_UPDATE}</h1>
<p>
{L_PERFORM_DATABASE_UPDATE_EXPLAIN}<br />
<br />
<a href="{U_DB_UPDATE}"><strong>&raquo; {L_RUN_DATABASE_SCRIPT} &laquo;</strong></a>
</p>
<!-- ENDIF -->
<!-- INCLUDE install_footer.html -->

View File

@@ -0,0 +1,181 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Language" content="{S_USER_LANG}" />
<meta http-equiv="imagetoolbar" content="no" />
<!-- IF META -->{META}<!-- ENDIF -->
<title>{PAGE_TITLE}</title>
<link href="../adm/style/admin.css" rel="stylesheet" type="text/css" media="screen" />
<style type="text/css">
<!--
#main {
font-size: 1.25em;
line-height: 0.7em;
margin: 0;
padding: 0;
width: 99%;
}
<!-- IF not S_DIFF_NEW_FILE -->
/**
* Unified Diff
*/
.file {
border: 1px solid #eee;
line-height: .7em;
}
.diff {
margin: 0;
}
.added {
background-color: #dfd;
}
.removed {
background-color: #fdd;
}
.info {
color: #888;
}
.context {
background-color: #eee;
}
/**
* Inline Diff
*/
.ins {
background-color: #dfd;
text-decoration: underline;
}
.del {
background-color: #fdd;
text-decoration: line-through;
}
/**
* Column Diff
*/
table.hrdiff {
width: 99%;
margin: 0 0 8px 5px;
}
table.hrdiff th {
text-align: left;
width: 50%;
color: #333;
font-family: Verdana,Helvetica,sans-serif;
font-size: 11px;
border-bottom: 1px solid #999;
background: transparent;
}
table.hrdiff thead th {
font-weight: bold;
font-size: 110%;
padding: 2px;
}
table.hrdiff tbody th {
padding: 2em 1px 1px 1px;
font-size: 80%;
}
table.hrdiff .unmodified {
background: #fff;
}
table.hrdiff .added {
background: #9f9;
}
table.hrdiff .added_empty {
background: #cfc;
}
table.hrdiff .modified {
background: #fd9;
}
table.hrdiff .removed {
background: #f99;
}
table.hrdiff .removed_empty {
background: #fcc;
}
table.hrdiff caption {
caption-side: top;
text-align: left;
margin: 0 0 8px 5px;
font-size: 90%;
font-weight: bold;
padding: 5px;
}
table.hrdiff caption span {
height: 10px;
width: 10px;
line-height: 10px;
letter-spacing: 10px;
border: 1px solid #000;
margin-left: 0.5em;
vertical-align: baseline;
}
<!-- ENDIF -->
//-->
</style>
</head>
<body>
<div id="wrap">
<div id="page-header">
<!-- IF S_DIFF_NEW_FILE -->
<h1>{L_VIEWING_FILE_CONTENTS}</h1>
<!-- ELSE -->
<h1>{L_VIEWING_FILE_DIFF}</h1>
<!-- ENDIF -->
<!-- IF not S_DIFF_NEW_FILE -->
<br />
<form method="post">
<label for="diff_mode">{L_SELECT_DIFF_MODE}:</label>
<select name="diff_mode" id="diff_mode">{S_DIFF_MODE_OPTIONS}</select>
<input class="button1" type="submit" id="submit" name="submit" value="{L_CHANGE}" />
</form>
<!-- ENDIF -->
</div>
<div id="page-body">
<div class="panel">
<span class="corners-top"><span></span></span>
<div id="content">
<div id="main">
<!-- IF S_DIFF_CONFLICT_FILE -->
<div style="float: right;"><strong>{L_NUM_CONFLICTS}: {NUM_CONFLICTS}</strong></div>
<!-- ENDIF -->
{DIFF_CONTENT}
</div>
</div>
<span class="corners-bottom"><span></span></span>
</div>
</div>
<!-- INCLUDE simple_footer.html -->

View File

@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
<div class="successbox">
<div <!-- IF S_USER_NOTICE -->class="successbox"<!-- ELSE -->class="errorbox"<!-- ENDIF -->>
<h3>{MESSAGE_TITLE}</h3>
<p>{MESSAGE_TEXT}</p>
</div>

View File

@@ -19,8 +19,9 @@
<div id="page-footer">
<!-- IF S_COPYRIGHT_HTML -->
Powered by phpBB {VERSION} &copy; 2006 <a href="http://www.phpbb.com/">phpBB Group</a>
{L_TRANSLATION_INFO}
<!-- ENDIF -->
<!-- IF DEBUG_OUTPUT -->
<!-- IF S_COPYRIGHT_HTML --><br /><!-- ENDIF -->
{DEBUG_OUTPUT}

View File

@@ -1,9 +1,10 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Language" content="{S_USER_LANG}" />
<meta http-equiv="imagetoolbar" content="no" />
<!-- IF META -->{META}<!-- ENDIF -->
<title>{PAGE_TITLE}</title>

View File

@@ -115,7 +115,7 @@
return;
}
// Mark all options to unset first...
// Mark all options to no (unset) first...
mark_options(target_id, 'u');
for (var r in settings)
@@ -160,7 +160,7 @@
<!-- IF not p_mask.S_VIEW --><input type="checkbox" class="radio" name="inherit[{p_mask.f_mask.UG_ID}][{p_mask.f_mask.FORUM_ID}]" value="1" /><!-- ELSE -->&nbsp;<!-- ENDIF -->
</span>
</td>
<td>{p_mask.f_mask.PADDING}<!-- IF p_mask.f_mask.FOLDER_IMAGE --> {p_mask.f_mask.FOLDER_IMAGE} <!-- ENDIF --><a href="javascript:swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '0');">{p_mask.f_mask.NAME}</a></span></td>
<td><span>{p_mask.f_mask.PADDING}<!-- IF p_mask.f_mask.FOLDER_IMAGE --> {p_mask.f_mask.FOLDER_IMAGE} <!-- ENDIF --><a href="#" onclick="swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '0'); return false;">{p_mask.f_mask.NAME}</a></span></td>
<td style="text-align: right;">
<!-- IF p_mask.S_VIEW -->
&nbsp;
@@ -179,14 +179,14 @@
<!-- BEGIN category -->
<!-- IF p_mask.f_mask.category.S_YES -->
<td class="preset preset_yes">
<!-- ELSEIF p_mask.f_mask.category.S_NEVER -->
<td class="preset preset_never">
<!-- ELSEIF p_mask.f_mask.category.S_NO -->
<td class="preset preset_no">
<!-- ELSEIF p_mask.f_mask.category.S_UNSET -->
<td class="preset preset_unset">
<!-- ELSE -->
<td class="preset preset_custom">
<!-- ENDIF -->
<a href="javascript:swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '{p_mask.f_mask.category.S_ROW_COUNT}');"><span></span></a></td>
<a href="#" onclick="swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '{p_mask.f_mask.category.S_ROW_COUNT}'); return false;"><span></span></a></td>
<!-- END category -->
</tr>
<tr class="row3">
@@ -199,9 +199,9 @@
</div>
<div style="float: right; text-align: right; width: 35%;">
<p class="small">
[<a href="javascript: mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'y'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ALL_YES}</a>]<br />
[<a href="javascript: mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'n'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ALL_NO}</a>]<br />
[<a href="javascript: mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'u'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ALL_UNSET}</a>]
[<a href="#" onclick="mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'y'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); return false;">{L_ALL_YES}</a>]<br />
[<a href="#" onclick="mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'n'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); return false;">{L_ALL_NEVER}</a>]<br />
[<a href="#" onclick="mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'u'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); return false;">{L_ALL_NO}</a>]
</p>
</div>
<!-- ELSE -->
@@ -218,25 +218,25 @@
<th scope="col" style="text-align: left; padding-left: 0;"><strong>{L_ACL_SETTING} [{p_mask.f_mask.category.CAT_NAME}]</strong></th>
<!-- IF p_mask.S_VIEW -->
<th scope="col">{L_ACL_YES}</th>
<th scope="col">{L_ACL_NO}</th>
<th scope="col">{L_ACL_NEVER}</th>
<!-- ELSE -->
<th scope="col"><a href="javascript: mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'y'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ACL_YES}</a></th>
<th scope="col"><a href="javascript: mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'u'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ACL_UNSET}</a></th>
<th scope="col"><a href="javascript: mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'n'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ACL_NO}</a></th>
<th scope="col"><a href="#" onclick="mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'y'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); return false;">{L_ACL_YES}</a></th>
<th scope="col"><a href="#" onclick="mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'u'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); return false;">{L_ACL_NO}</a></th>
<th scope="col"><a href="#" onclick="mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'n'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); return false;">{L_ACL_NEVER}</a></th>
<!-- ENDIF -->
</tr>
</thead>
<tbody>
<!-- BEGIN mask -->
<!-- IF p_mask.f_mask.category.mask.S_ROW_COUNT is even --><tr class="row4"><!-- ELSE --><tr class="row3"><!-- ENDIF -->
<th><!-- IF p_mask.f_mask.category.mask.U_TRACE --><a href="#" onclick="javascript:trace('{p_mask.f_mask.category.mask.U_TRACE}')" title="{L_TRACE_SETTING}"><img src="images/icon_trace.gif" alt="{L_TRACE_SETTING}" /></a> <!-- ENDIF -->{p_mask.f_mask.category.mask.PERMISSION}</th>
<th><!-- IF p_mask.f_mask.category.mask.U_TRACE --><a href="#" onclick="trace('{p_mask.f_mask.category.mask.U_TRACE}'); return false;" title="{L_TRACE_SETTING}"><img src="images/icon_trace.gif" alt="{L_TRACE_SETTING}" /></a> <!-- ENDIF -->{p_mask.f_mask.category.mask.PERMISSION}</th>
<!-- IF p_mask.S_VIEW -->
<td<!-- IF p_mask.f_mask.category.mask.S_YES --> class="yes"<!-- ELSE --> class="unset"<!-- ENDIF -->>&nbsp;</td>
<td<!-- IF p_mask.f_mask.category.mask.S_NO --> class="no"<!-- ELSE --> class="unset"<!-- ENDIF -->>&nbsp;</td>
<td<!-- IF p_mask.f_mask.category.mask.S_YES --> class="yes"<!-- ELSE --> class="no"<!-- ENDIF -->>&nbsp;</td>
<td<!-- IF p_mask.f_mask.category.mask.S_NEVER --> class="never"<!-- ELSE --> class="no"<!-- ENDIF -->>&nbsp;</td>
<!-- ELSE -->
<td class="unset"><input onchange="reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}')" id="{p_mask.f_mask.category.mask.S_FIELD_NAME}_y" name="{p_mask.f_mask.category.mask.S_FIELD_NAME}" class="radio" type="radio"<!-- IF p_mask.f_mask.category.mask.S_YES --> checked="checked"<!-- ENDIF --> value="1" /></td>
<td class="unset"><input onchange="reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}')" id="{p_mask.f_mask.category.mask.S_FIELD_NAME}_u" name="{p_mask.f_mask.category.mask.S_FIELD_NAME}" class="radio" type="radio"<!-- IF p_mask.f_mask.category.mask.S_UNSET --> checked="checked"<!-- ENDIF --> value="-1" /></td>
<td class="unset"><input onchange="reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}')" id="{p_mask.f_mask.category.mask.S_FIELD_NAME}_n" name="{p_mask.f_mask.category.mask.S_FIELD_NAME}" class="radio" type="radio"<!-- IF p_mask.f_mask.category.mask.S_NO --> checked="checked"<!-- ENDIF --> value="0" /></td>
<td class="no"><input onchange="reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}')" id="{p_mask.f_mask.category.mask.S_FIELD_NAME}_y" name="{p_mask.f_mask.category.mask.S_FIELD_NAME}" class="radio" type="radio"<!-- IF p_mask.f_mask.category.mask.S_YES --> checked="checked"<!-- ENDIF --> value="1" /></td>
<td class="no"><input onchange="reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}')" id="{p_mask.f_mask.category.mask.S_FIELD_NAME}_u" name="{p_mask.f_mask.category.mask.S_FIELD_NAME}" class="radio" type="radio"<!-- IF p_mask.f_mask.category.mask.S_NO --> checked="checked"<!-- ENDIF --> value="-1" /></td>
<td class="no"><input onchange="reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}')" id="{p_mask.f_mask.category.mask.S_FIELD_NAME}_n" name="{p_mask.f_mask.category.mask.S_FIELD_NAME}" class="radio" type="radio"<!-- IF p_mask.f_mask.category.mask.S_NEVER --> checked="checked"<!-- ENDIF --> value="0" /></td>
<!-- ENDIF -->
</tr>
<!-- END mask -->

View File

@@ -22,20 +22,20 @@
<!-- IF trace.S_ROW_COUNT is even --><tr class="row4"><!-- ELSE --><tr class="row3"><!-- ENDIF -->
<td style="white-space: nowrap;"><strong>{trace.WHO}</strong></td>
<!-- IF trace.S_SETTING_NO -->
<td class="no">{L_ACL_NO}</td>
<!-- IF trace.S_SETTING_NEVER -->
<td class="never">{L_ACL_NEVER}</td>
<!-- ELSEIF trace.S_SETTING_YES -->
<td class="yes">{L_ACL_YES}</td>
<!-- ELSE -->
<td class="unset">{L_ACL_UNSET}</td>
<td class="no">{L_ACL_NO}</td>
<!-- ENDIF -->
<!-- IF trace.S_TOTAL_NO -->
<td class="no">{L_ACL_NO}</td>
<!-- IF trace.S_TOTAL_NEVER -->
<td class="never">{L_ACL_NEVER}</td>
<!-- ELSEIF trace.S_TOTAL_YES -->
<td class="yes">{L_ACL_YES}</td>
<!-- ELSE -->
<td class="unset">{L_ACL_UNSET}</td>
<td class="no">{L_ACL_NO}</td>
<!-- ENDIF -->
<td>{trace.INFORMATION}</td>

View File

@@ -1,4 +1,4 @@
<div style="text-align: right;"><a href="#" onclick="javascript: self.close();">{L_CLOSE_WINDOW}</a></div>
<div style="text-align: right;"><a href="#" onclick="self.close(); return false;">{L_CLOSE_WINDOW}</a></div>
<br /><br />
</div>
@@ -17,6 +17,7 @@
<!-- IF S_COPYRIGHT_HTML -->
<br />Powered by phpBB {VERSION} &copy; 2006 <a href="http://www.phpbb.com/">phpBB Group</a>
{TRANSLATION_INFO}
<!-- ENDIF -->
<!-- IF DEBUG_OUTPUT -->

View File

@@ -1,9 +1,10 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Language" content="{S_USER_LANG}" />
<meta http-equiv="imagetoolbar" content="no" />
<!-- IF META -->{META}<!-- ENDIF -->
<title>{PAGE_TITLE}</title>

View File

@@ -36,13 +36,6 @@ $template->assign_vars(array(
$template->display('body');
// Unload cache, must be done before the DB connection if closed
if (!empty($cache))
{
$cache->unload();
}
// Close our DB connection.
$db->sql_close();
garbage_collection();
?>

View File

@@ -99,19 +99,53 @@ else
if (defined('IN_CRON'))
{
chdir($phpbb_root_path);
$phpbb_root_path = getcwd() . '/';
if (@function_exists('getcwd'))
{
$phpbb_root_path = getcwd() . '/';
}
else
{
// This is a best guess
$phpbb_root_path = pathinfo($_SERVER['SCRIPT_FILENAME'], PATHINFO_DIRNAME) . '/';
}
}
if (!file_exists($phpbb_root_path . 'config.' . $phpEx))
{
die("<p>The config.$phpEx file could not be found.</p><p><a href=\"$phpbb_root_path/install/index.$phpEx\">Click here to install phpBB</a></p>");
die("<p>The config.$phpEx file could not be found.</p><p><a href=\"{$phpbb_root_path}install/index.$phpEx\">Click here to install phpBB</a></p>");
}
require($phpbb_root_path . 'config.' . $phpEx);
if (!defined('PHPBB_INSTALLED'))
{
header('Location: install/index.' . $phpEx);
// Redirect the user to the installer
// We have to generate a full HTTP/1.1 header here since we can't guarantee to have any of the information
// available as used by the redirect function
$server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
$server_port = (!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT');
$secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0;
$script_name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
if (!$script_name)
{
$script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
}
// Replace any number of consecutive backslashes and/or slashes with a single slash
// (could happen on some proxy setups and/or Windows servers)
$script_path = trim(dirname($script_name)) . '/install/index.' . $phpEx;
$script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path);
$url = (($secure) ? 'https://' : 'http://') . $server_name;
if ($server_port && (($secure && $server_port <> 443) || (!$secure && $server_port <> 80)))
{
$url .= ':' . $server_port;
}
$url .= $script_path;
header('Location: ' . $url);
exit;
}
@@ -144,6 +178,7 @@ require($phpbb_root_path . 'includes/auth.' . $phpEx);
require($phpbb_root_path . 'includes/functions.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
// Set PHP error handler to ours
set_error_handler('msg_handler');
@@ -163,12 +198,12 @@ unset($dbpasswd);
// Grab global variables, re-cache if necessary
$config = $cache->obtain_config();
$dss_seeded = false;
// Warn about install/ directory
if (file_exists($phpbb_root_path . 'install'))
// Disable board if the install/ directory is still present
if (file_exists($phpbb_root_path . 'install') && !defined('ADMIN_START'))
{
trigger_error('REMOVE_INSTALL');
$message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE';
trigger_error($message);
}
?>

View File

@@ -23,6 +23,15 @@ $auth->acl($user->data);
$cron_type = request_var('cron_type', '');
$use_shutdown_function = (@function_exists('register_shutdown_function')) ? true : false;
// Output transparent gif
header('Cache-Control: no-cache');
header('Content-type: image/gif');
header('Content-length: 43');
echo base64_decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');
flush();
/**
* Run cron-like action
* Real cron-based layer will be introduced in 3.2
@@ -217,14 +226,6 @@ else
garbage_collection();
}
// Output transparent gif
header('Cache-Control: no-cache');
header('Content-type: image/gif');
header('Content-length: 43');
echo base64_decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');
flush();
exit;
?>

View File

@@ -33,9 +33,9 @@ require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.'.$phpEx);
require($phpbb_root_path . 'includes/db/' . $dbms . '.'.$phpEx);
include($phpbb_root_path . 'includes/functions.'.$phpEx);
define('ACL_NO', 0);
define('ACL_NEVER', 0);
define('ACL_YES', 1);
define('ACL_UNSET', -1);
define('ACL_NO', -1);
define('ACL_GROUPS_TABLE', $table_prefix.'acl_groups');
define('ACL_OPTIONS_TABLE', $table_prefix.'acl_options');
@@ -212,14 +212,14 @@ foreach ($prefixes as $prefix)
echo "<p><b>Adding $auth_option...</b></p>\n";
mass_auth('group', 0, 'guests', $auth_option, ACL_NO);
mass_auth('group', 0, 'inactive', $auth_option, ACL_NO);
mass_auth('group', 0, 'inactive_coppa', $auth_option, ACL_NO);
mass_auth('group', 0, 'registered_coppa', $auth_option, ACL_NO);
mass_auth('group', 0, 'registered', $auth_option, (($prefix != 'm_' && $prefix != 'a_') ? ACL_YES : ACL_NO));
mass_auth('group', 0, 'global_moderators', $auth_option, (($prefix != 'a_') ? ACL_YES : ACL_NO));
mass_auth('group', 0, 'guests', $auth_option, ACL_NEVER);
mass_auth('group', 0, 'inactive', $auth_option, ACL_NEVER);
mass_auth('group', 0, 'inactive_coppa', $auth_option, ACL_NEVER);
mass_auth('group', 0, 'registered_coppa', $auth_option, ACL_NEVER);
mass_auth('group', 0, 'registered', $auth_option, (($prefix != 'm_' && $prefix != 'a_') ? ACL_YES : ACL_NEVER));
mass_auth('group', 0, 'global_moderators', $auth_option, (($prefix != 'a_') ? ACL_YES : ACL_NEVER));
mass_auth('group', 0, 'administrators', $auth_option, ACL_YES);
mass_auth('group', 0, 'bots', $auth_option, (($prefix != 'm_' && $prefix != 'a_') ? ACL_YES : ACL_NO));
mass_auth('group', 0, 'bots', $auth_option, (($prefix != 'm_' && $prefix != 'a_') ? ACL_YES : ACL_NEVER));
}
}
}
@@ -236,7 +236,7 @@ echo "<p><b>Done</b></p>\n";
$forum_id = forum ids (array|int|0) -> 0 == all forums
$ug_id = [int] user_id|group_id : [string] usergroup name
$acl_list = [string] acl entry : [array] acl entries
$setting = ACL_YES|ACL_NO|ACL_UNSET
$setting = ACL_YES|ACL_NEVER|ACL_NO
*/
function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting)
{
@@ -337,7 +337,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting)
switch ($setting)
{
case ACL_UNSET:
case ACL_NO:
if (isset($cur_auth[$forum][$auth_option_id]))
{
$sql_ary['delete'][] = "DELETE FROM $table
@@ -371,7 +371,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting)
switch ($sql_type)
{
case 'insert':
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'mysql':
case 'mysql4':

View File

@@ -0,0 +1,174 @@
<?php
/**
* Only adjust bitfields, do not rewrite text...
* All new parsings have the img, flash and quote modes set to true
*
* You should make a backup from your users, posts and privmsgs table in case something goes wrong
* Forum descriptions and rules need to be re-submitted manually.
*/
die("Please read the first lines of this script for instructions on how to enable it");
set_time_limit(0);
define('IN_PHPBB', true);
$phpbb_root_path = './../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
$echos = 0;
// Adjust user signatures
$message_parser = new parse_message();
$message_parser->mode = 'sig';
$message_parser->bbcode_init();
$sql = 'SELECT user_id, user_sig, user_sig_bbcode_uid, user_sig_bbcode_bitfield
FROM ' . USERS_TABLE;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
// Convert bbcodes back to their normal form
if ($row['user_sig_bbcode_uid'] && $row['user_sig'])
{
decode_message($row['user_sig'], $row['user_sig_bbcode_uid']);
$message_parser->message = $row['user_sig'];
$message_parser->prepare_bbcodes();
$message_parser->parse_bbcode();
$bitfield = $message_parser->bbcode_bitfield;
$sql = 'UPDATE ' . USERS_TABLE . " SET user_sig_bbcode_bitfield = '" . $db->sql_escape($bitfield) . "'
WHERE user_id = " . $row['user_id'];
$db->sql_query($sql);
if ($echos > 200)
{
echo '<br />' . "\n";
$echos = 0;
}
echo '.';
$echos++;
flush();
}
else
{
$sql = 'UPDATE ' . USERS_TABLE . " SET user_sig_bbcode_bitfield = ''
WHERE user_id = " . $row['user_id'];
$db->sql_query($sql);
}
}
$db->sql_freeresult($result);
// Now adjust posts
$message_parser = new parse_message();
$message_parser->mode = 'post';
$message_parser->bbcode_init();
// Update posts
$sql = 'SELECT post_id, post_text, bbcode_uid, enable_bbcode, enable_smilies, enable_sig
FROM ' . POSTS_TABLE;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
// Convert bbcodes back to their normal form
if ($row['enable_bbcode'])
{
decode_message($row['post_text'], $row['bbcode_uid']);
$message_parser->message = $row['post_text'];
$message_parser->prepare_bbcodes();
$message_parser->parse_bbcode();
$bitfield = $message_parser->bbcode_bitfield;
$sql = 'UPDATE ' . POSTS_TABLE . " SET bbcode_bitfield = '" . $db->sql_escape($bitfield) . "'
WHERE post_id = " . $row['post_id'];
$db->sql_query($sql);
if ($echos > 200)
{
echo '<br />' . "\n";
$echos = 0;
}
echo '.';
$echos++;
flush();
}
else
{
$sql = 'UPDATE ' . POSTS_TABLE . " SET bbcode_bitfield = ''
WHERE post_id = " . $row['post_id'];
$db->sql_query($sql);
}
}
$db->sql_freeresult($result);
// Now to the private messages
$message_parser = new parse_message();
$message_parser->mode = 'post';
$message_parser->bbcode_init();
// Update pms
$sql = 'SELECT msg_id, message_text, bbcode_uid, enable_bbcode
FROM ' . PRIVMSGS_TABLE;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
// Convert bbcodes back to their normal form
if ($row['enable_bbcode'])
{
decode_message($row['message_text'], $row['bbcode_uid']);
$message_parser->message = $row['message_text'];
$message_parser->prepare_bbcodes();
$message_parser->parse_bbcode();
$bitfield = $message_parser->bbcode_bitfield;
$sql = 'UPDATE ' . PRIVMSGS_TABLE . " SET bbcode_bitfield = '" . $db->sql_escape($bitfield) . "'
WHERE msg_id = " . $row['msg_id'];
$db->sql_query($sql);
if ($echos > 200)
{
echo '<br />' . "\n";
$echos = 0;
}
echo '.';
$echos++;
flush();
}
else
{
$sql = 'UPDATE ' . PRIVMSGS_TABLE . " SET bbcode_bitfield = ''
WHERE msg_id = " . $row['msg_id'];
$db->sql_query($sql);
}
}
$db->sql_freeresult($result);
// Done
$db->sql_close();
?>

View File

@@ -0,0 +1,52 @@
<?php
/**
* Adjust username_clean column.
*
* You should make a backup from your users table in case something goes wrong
*/
die("Please read the first lines of this script for instructions on how to enable it");
set_time_limit(0);
define('IN_PHPBB', true);
$phpbb_root_path = './../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
$echos = 0;
$sql = 'SELECT user_id, username
FROM ' . USERS_TABLE;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$sql = 'UPDATE ' . USERS_TABLE . "
SET username_clean = '" . $db->sql_escape(utf8_clean_string($row['username'])) . "'
WHERE user_id = " . $row['user_id'];
$db->sql_query($sql);
if ($echos > 200)
{
echo '<br />' . "\n";
$echos = 0;
}
echo '.';
$echos++;
flush();
}
$db->sql_freeresult($result);
echo 'FINISHED';
// Done
$db->sql_close();
?>

View File

@@ -313,7 +313,7 @@ function make_post($new_topic_id, $forum_id, $user_id, $post_username, $text, $m
else
{
// Rollback
if(SQL_LAYER == "mysql")
if($db->sql_layer == "mysql")
{
$sql = "DELETE FROM " . POSTS_TABLE . "
WHERE post_id = $new_post_id";

File diff suppressed because it is too large Load Diff

View File

@@ -12,7 +12,7 @@
// -------------------------------------------------------------
define('IN_PHPBB', true);
$phpbb_root_path = './';
$phpbb_root_path = './../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
@@ -22,13 +22,13 @@ header('Expires: 0');
ignore_user_abort(true);
// number of topics to create
$num_topics = 5000000;
$num_topics = 10000;
// number of topics to be generated per call
$batch_size = 100000;
$batch_size = 2000;
// max number of posts per topic
$posts_per_topic = 500000;
$posts_per_topic = 500;
// general vars
@@ -40,7 +40,7 @@ switch ($mode)
case 'generate':
$user_ids = $forum_ids = $topic_rows = array();
$sql = 'SELECT user_id FROM ' . USERS_TABLE;
$sql = 'SELECT user_id FROM ' . USERS_TABLE . ' WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ') OR user_id = ' . ANONYMOUS;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
@@ -60,7 +60,7 @@ switch ($mode)
{
$db->sql_query('TRUNCATE TABLE ' . POSTS_TABLE);
$db->sql_query('TRUNCATE TABLE ' . TOPICS_TABLE);
$db->sql_query('TRUNCATE TABLE ' . TOPICS_TABLE . '_prefetch');
// $db->sql_query('TRUNCATE TABLE ' . TOPICS_TABLE . '_prefetch');
}
$db->sql_query('LOCK TABLES ' . POSTS_TABLE . ' WRITE, ' . TOPICS_TABLE . ' WRITE');
@@ -86,7 +86,7 @@ switch ($mode)
$rows = array();
$post_time = mt_rand(0, time());
$num_posts = mt_rand(1, $posts_per_topic);
$num_posts = $posts_per_topic; //mt_rand(1, $posts_per_topic);
for ($i = 0; $i < $num_posts; ++$i)
{
$poster_id = $user_ids[array_rand($user_ids)];
@@ -108,18 +108,20 @@ switch ($mode)
if ($topic_id >= $num_topics)
{
echo '<meta http-equiv="refresh" content="0; url=fill.' . $phpEx . '?mode=sync&amp;' . time() . '">And now for something completely different...';
echo '<meta http-equiv="refresh" content="10; url=fill.' . $phpEx . '?mode=sync&amp;' . time() . '">And now for something completely different...';
$db->sql_query('ANALYZE TABLES ' . TOPICS_TABLE . ', ' . POSTS_TABLE);
flush();
}
else
{
echo '<meta http-equiv="refresh" content="0; url=fill.' . $phpEx . '?start=' . $topic_id . '&amp;' . time() . '">To the next page... (' . $topic_id . '/' . $num_topics . ')';
echo '<meta http-equiv="refresh" content="10; url=fill.' . $phpEx . '?start=' . $topic_id . '&amp;' . time() . '">To the next page... (' . $topic_id . '/' . $num_topics . ')';
flush();
}
break;
case 'sync':
error_reporting(E_ALL);
/* error_reporting(E_ALL);
$sync_all = TRUE;
if ($sync_all)
@@ -158,8 +160,11 @@ switch ($mode)
{
trigger_error('Done');
}
*/
}
$db->sql_close();
function rndm_username()
{
static $usernames;

View File

@@ -0,0 +1,147 @@
<?php
/**
*
* @package phpBB3
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (php_sapi_name() != 'cli')
{
die("This program must be run from the command line.\n");
}
set_time_limit(0);
define('IN_PHPBB', true);
$phpbb_root_path = '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
echo "Checking for required files\n";
download('http://unicode.org/Public/UNIDATA/CaseFolding.txt');
echo "\n";
/**
* Load the CaseFolding table
*/
echo "Loading CaseFolding\n";
$unidata = file_get_contents('CaseFolding.txt');
function utf8_chr($cp)
{
if ($cp > 0xFFFF)
{
return chr(0xF0 | ($cp >> 18)) . chr(0x80 | (($cp >> 12) & 0x3F)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F));
}
else if ($cp > 0x7FF)
{
return chr(0xE0 | ($cp >> 12)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F));
}
else if ($cp > 0x7F)
{
return chr(0xC0 | ($cp >> 6)) . chr(0x80 | ($cp & 0x3F));
}
else
{
return chr($cp);
}
}
preg_match_all('/^([0-9A-F]+); ([CFS]); ([0-9A-F]+(?: [0-9A-F]+)*);/im', $unidata, $array, PREG_SET_ORDER);
$uniarray = array();
foreach ($array as $value)
{
$uniarray[$value[2]][utf8_chr(hexdec((string)$value[1]))] = implode(array_map('utf8_chr', array_map('hexdec', explode(' ', $value[3]))));
}
foreach ($uniarray as $idx => $contents)
{
echo "Writing to case_fold_$idx.$phpEx\n";
$fp = fopen($phpbb_root_path . 'includes/utf/data/case_fold_' . strtolower($idx) . '.' . $phpEx, 'wb');
fwrite($fp, '<?php return ' . my_var_export($contents) . ';');
fclose($fp);
}
/**
* Return a parsable string representation of a variable
*
* This is function is limited to array/strings/integers
*
* @param mixed $var Variable
* @return string PHP code representing the variable
*/
function my_var_export($var)
{
if (is_array($var))
{
$lines = array();
foreach ($var as $k => $v)
{
$lines[] = my_var_export($k) . '=>' . my_var_export($v);
}
return 'array(' . implode(',', $lines) . ')';
}
elseif (is_string($var))
{
return "'" . str_replace(array('\\', "'"), array('\\\\', "\\'"), $var) . "'";
}
else
{
return $var;
}
}
/**
* Download a file to the develop/ dir
*
* @param string $url URL of the file to download
* @return void
*/
function download($url)
{
global $phpbb_root_path;
if (file_exists($phpbb_root_path . 'develop/' . basename($url)))
{
return;
}
echo 'Downloading from ', $url, ' ';
if (!$fpr = fopen($url, 'rb'))
{
die("Can't download from $url\nPlease download it yourself and put it in the develop/ dir, kthxbai");
}
if (!$fpw = fopen($phpbb_root_path . 'develop/' . basename($url), 'wb'))
{
die("Can't open develop/" . basename($url) . " for output... please check your permissions or something");
}
$i = 0;
$chunk = 32768;
$done = '';
while (!feof($fpr))
{
$i += fwrite($fpw, fread($fpr, $chunk));
echo str_repeat("\x08", strlen($done));
$done = ($i >> 10) . ' KiB';
echo $done;
}
fclose($fpr);
fclose($fpw);
echo "\n";
}
?>

View File

@@ -0,0 +1,559 @@
<?php
/**
*
* @package phpBB3
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (php_sapi_name() != 'cli')
{
die("This program must be run from the command line.\n");
}
set_time_limit(0);
define('IN_PHPBB', true);
$phpbb_root_path = '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
echo "Checking for required files\n";
download('http://www.unicode.org/Public/UNIDATA/CompositionExclusions.txt');
download('http://www.unicode.org/Public/UNIDATA/DerivedNormalizationProps.txt');
download('http://www.unicode.org/Public/UNIDATA/UnicodeData.txt');
echo "\n";
require_once($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
$file_contents = array();
/**
* Generate some Hangul/Jamo stuff
*/
echo "\nGenerating Hangul and Jamo tables\n";
for ($i = 0; $i < UNICODE_HANGUL_LCOUNT; ++$i)
{
$utf_char = cp_to_utf(UNICODE_HANGUL_LBASE + $i);
$file_contents['utf_normalizer_common']['utf_jamo_index'][$utf_char] = $i * UNICODE_HANGUL_VCOUNT * UNICODE_HANGUL_TCOUNT + UNICODE_HANGUL_SBASE;
$file_contents['utf_normalizer_common']['utf_jamo_type'][$utf_char] = UNICODE_JAMO_L;
}
for ($i = 0; $i < UNICODE_HANGUL_VCOUNT; ++$i)
{
$utf_char = cp_to_utf(UNICODE_HANGUL_VBASE + $i);
$file_contents['utf_normalizer_common']['utf_jamo_index'][$utf_char] = $i * UNICODE_HANGUL_TCOUNT;
$file_contents['utf_normalizer_common']['utf_jamo_type'][$utf_char] = UNICODE_JAMO_V;
}
for ($i = 0; $i < UNICODE_HANGUL_TCOUNT; ++$i)
{
$utf_char = cp_to_utf(UNICODE_HANGUL_TBASE + $i);
$file_contents['utf_normalizer_common']['utf_jamo_index'][$utf_char] = $i;
$file_contents['utf_normalizer_common']['utf_jamo_type'][$utf_char] = UNICODE_JAMO_T;
}
/**
* Load the CompositionExclusions table
*/
echo "Loading CompositionExclusion\n";
$fp = fopen('CompositionExclusions.txt', 'rt');
$exclude = array();
while (!feof($fp))
{
$line = fgets($fp, 1024);
if (!strpos(' 0123456789ABCDEFabcdef', $line[0]))
{
continue;
}
$cp = strtok($line, ' ');
if ($pos = strpos($cp, '..'))
{
$start = hexdec(substr($cp, 0, $pos));
$end = hexdec(substr($cp, $pos + 2));
for ($i = $start; $i < $end; ++$i)
{
$exclude[$i] = 1;
}
}
else
{
$exclude[hexdec($cp)] = 1;
}
}
fclose($fp);
/**
* Load QuickCheck tables
*/
echo "Generating QuickCheck tables\n";
$fp = fopen('DerivedNormalizationProps.txt', 'rt');
while (!feof($fp))
{
$line = fgets($fp, 1024);
if (!strpos(' 0123456789ABCDEFabcdef', $line[0]))
{
continue;
}
$p = array_map('trim', explode(';', strtok($line, '#')));
/**
* Capture only NFC_QC, NFKC_QC
*/
if (!preg_match('#^NFK?C_QC$#', $p[1]))
{
continue;
}
if ($pos = strpos($p[0], '..'))
{
$start = hexdec(substr($p[0], 0, $pos));
$end = hexdec(substr($p[0], $pos + 2));
}
else
{
$start = $end = hexdec($p[0]);
}
if ($start >= UTF8_HANGUL_FIRST && $end <= UTF8_HANGUL_LAST)
{
/**
* We do not store Hangul syllables in the array
*/
continue;
}
if ($p[2] == 'M')
{
$val = UNICODE_QC_MAYBE;
}
else
{
$val = UNICODE_QC_NO;
}
if ($p[1] == 'NFKC_QC')
{
$file = 'utf_nfkc_qc';
}
else
{
$file = 'utf_nfc_qc';
}
for ($i = $start; $i <= $end; ++$i)
{
/**
* The vars have the same name as the file: $utf_nfc_qc is in utf_nfc_qc.php
*/
$file_contents[$file][$file][cp_to_utf($i)] = $val;
}
}
fclose($fp);
/**
* Do mappings
*/
echo "Loading Unicode decomposition mappings\n";
$fp = fopen($phpbb_root_path . 'develop/UnicodeData.txt', 'rt');
$map = array();
while (!feof($fp))
{
$p = explode(';', fgets($fp, 1024));
$cp = hexdec($p[0]);
if (!empty($p[3]))
{
/**
* Store combining class > 0
*/
$file_contents['utf_normalizer_common']['utf_combining_class'][cp_to_utf($cp)] = (int) $p[3];
}
if (!isset($p[5]) || !preg_match_all('#[0-9A-F]+#', strip_tags($p[5]), $m))
{
continue;
}
if (strpos($p[5], '>'))
{
$map['NFKD'][$cp] = implode(' ', array_map('hexdec', $m[0]));
}
else
{
$map['NFD'][$cp] = $map['NFKD'][$cp] = implode(' ', array_map('hexdec', $m[0]));
}
}
fclose($fp);
/**
* Build the canonical composition table
*/
echo "Generating the Canonical Composition table\n";
foreach ($map['NFD'] as $cp => $decomp_seq)
{
if (!strpos($decomp_seq, ' ') || isset($exclude[$cp]))
{
/**
* Singletons are excluded from canonical composition
*/
continue;
}
$utf_seq = implode('', array_map('cp_to_utf', explode(' ', $decomp_seq)));
if (!isset($file_contents['utf_canonical_comp']['utf_canonical_comp'][$utf_seq]))
{
$file_contents['utf_canonical_comp']['utf_canonical_comp'][$utf_seq] = cp_to_utf($cp);
}
}
/**
* Decompose the NF[K]D mappings recursively and prepare the file contents
*/
echo "Generating the Canonical and Compatibility Decomposition tables\n\n";
foreach ($map as $type => $decomp_map)
{
foreach ($decomp_map as $cp => $decomp_seq)
{
$decomp_map[$cp] = decompose($decomp_map, $decomp_seq);
}
unset($decomp_seq);
if ($type == 'NFKD')
{
$file = 'utf_compatibility_decomp';
$var = 'utf_compatibility_decomp';
}
else
{
$file = 'utf_canonical_decomp';
$var = 'utf_canonical_decomp';
}
/**
* Generate the corresponding file
*/
foreach ($decomp_map as $cp => $decomp_seq)
{
$file_contents[$file][$var][cp_to_utf($cp)] = implode('', array_map('cp_to_utf', explode(' ', $decomp_seq)));
}
}
/**
* Generate and/or alter the files
*/
foreach ($file_contents as $file => $contents)
{
/**
* Generate a new file
*/
echo "Writing to $file.$phpEx\n";
if (!$fp = fopen($phpbb_root_path . 'includes/utf/data/' . $file . '.' . $phpEx, 'wb'))
{
trigger_error('Cannot open ' . $file . ' for write');
}
fwrite($fp, '<?php');
foreach ($contents as $var => $val)
{
fwrite($fp, "\n\$GLOBALS[" . my_var_export($var) . ']=' . my_var_export($val) . ";");
}
fclose($fp);
}
echo "\n*** UTF-8 normalization tables done\n\n";
/**
* Now we'll generate the files needed by the search indexer
*/
echo "Generating search indexer tables\n";
$fp = fopen($phpbb_root_path . 'develop/UnicodeData.txt', 'rt');
$map = array();
while ($line = fgets($fp, 1024))
{
/**
* The current line is split, $m[0] hold the codepoint in hexadecimal and
* all other fields numbered as in http://www.unicode.org/Public/UNIDATA/UCD.html#UnicodeData.txt
*/
$m = explode(';', $line);
/**
* @var integer $cp Current char codepoint
* @var string $utf_char UTF-8 representation of current char
*/
$cp = hexdec($m[0]);
$utf_char = cp_to_utf($cp);
/**
* $m[2] holds the "General Category" of the character
* @link http://www.unicode.org/Public/UNIDATA/UCD.html#General_Category_Values
*/
switch ($m[2][0])
{
case 'L':
/**
* We allow all letters and map them to their lowercased counterpart on the fly
*/
$map_to_hex = (isset($m[13][0])) ? $m[13] : $m[0];
if (preg_match('#^LATIN.*(?:LETTER|LIGATURE) ([A-Z]{2}(?![A-Z]))$#', $m[1], $capture))
{
/**
* Special hack for some latin ligatures. Using the name of a character
* is bad practice, but for now it works well enough.
*
* @todo Note that ligatures with combining marks such as U+01E2 are
* not supported at this time
*/
$map[$cp] = strtolower($capture[1]);
}
elseif (isset($m[13][0]))
{
/**
* If the letter has a lowercased form, use it
*/
$map[$cp] = hex_to_utf($m[13]);
}
else
{
/**
* In all other cases, map the letter to itself
*/
$map[$cp] = $utf_char;
}
break;
case 'M':
/**
* We allow all marks, they are mapped to themselves
*/
$map[$cp] = $utf_char;
break;
case 'N':
/**
* We allow all numbers, but we map them to their numeric value whenever
* possible. The numeric value (field #8) is in ASCII already
*
* @todo Note that fractions such as U+00BD will be converted to something
* like "1/2", with a slash. However, "1/2" entered in ASCII is converted
* to "1 2". This will have to be fixed.
*/
$map[$cp] = (isset($m[8][0])) ? $m[8] : $utf_char;
break;
default:
/**
* Everything else is ignored, skip to the next line
*/
continue 2;
}
}
fclose($fp);
/**
* Add some cheating
*/
$cheats = array(
'00DF' => 'ss', # German sharp S
'00D6' => 'oe', # Capital O with diaeresis
'00F6' => 'oe', # Small O with diaeresis
);
/**
* Add our "cheat replacements" to the map
*/
foreach ($cheats as $hex => $map_to)
{
$map[hexdec($hex)] = $map_to;
}
/**
* Split the map into smaller blocks
*/
$file_contents = array();
foreach ($map as $cp => $map_to)
{
$file_contents[$cp >> 11][cp_to_utf($cp)] = $map_to;
}
unset($map);
foreach ($file_contents as $idx => $contents)
{
echo "Writing to search_indexer_$idx.$phpEx\n";
$fp = fopen($phpbb_root_path . 'includes/utf/data/search_indexer_' . $idx . '.' . $phpEx, 'wb');
fwrite($fp, '<?php return ' . my_var_export($contents) . ';');
fclose($fp);
}
echo "\n*** Search indexer tables done\n\n";
die("\nAll done!\n");
////////////////////////////////////////////////////////////////////////////////
// Internal functions //
////////////////////////////////////////////////////////////////////////////////
/**
* Decompose a sequence recusively
*
* @param array $decomp_map Decomposition mapping, passed by reference
* @param string $decomp_seq Decomposition sequence as decimal codepoints separated with a space
* @return string Decomposition sequence, fully decomposed
*/
function decompose(&$decomp_map, $decomp_seq)
{
$ret = array();
foreach (explode(' ', $decomp_seq) as $cp)
{
if (isset($decomp_map[$cp]))
{
$ret[] = decompose($decomp_map, $decomp_map[$cp]);
}
else
{
$ret[] = $cp;
}
}
return implode(' ', $ret);
}
/**
* Return a parsable string representation of a variable
*
* This is function is limited to array/strings/integers
*
* @param mixed $var Variable
* @return string PHP code representing the variable
*/
function my_var_export($var)
{
if (is_array($var))
{
$lines = array();
foreach ($var as $k => $v)
{
$lines[] = my_var_export($k) . '=>' . my_var_export($v);
}
return 'array(' . implode(',', $lines) . ')';
}
elseif (is_string($var))
{
return "'" . str_replace(array('\\', "'"), array('\\\\', "\\'"), $var) . "'";
}
else
{
return $var;
}
}
/**
* Download a file to the develop/ dir
*
* @param string $url URL of the file to download
* @return void
*/
function download($url)
{
global $phpbb_root_path;
if (file_exists($phpbb_root_path . 'develop/' . basename($url)))
{
return;
}
echo 'Downloading from ', $url, ' ';
if (!$fpr = fopen($url, 'rb'))
{
die("Can't download from $url\nPlease download it yourself and put it in the develop/ dir, kthxbai");
}
if (!$fpw = fopen($phpbb_root_path . 'develop/' . basename($url), 'wb'))
{
die("Can't open develop/" . basename($url) . " for output... please check your permissions or something");
}
$i = 0;
$chunk = 32768;
$done = '';
while (!feof($fpr))
{
$i += fwrite($fpw, fread($fpr, $chunk));
echo str_repeat("\x08", strlen($done));
$done = ($i >> 10) . ' KiB';
echo $done;
}
fclose($fpr);
fclose($fpw);
echo "\n";
}
/**
* Convert a codepoint in hexadecimal to a UTF-8 char
*
* @param string $hex Codepoint, in hexadecimal
* @return string UTF-8 char
*/
function hex_to_utf($hex)
{
return cp_to_utf(hexdec($hex));
}
/**
* Return a UTF string formed from a sequence of codepoints in hexadecimal
*
* @param string $seq Sequence of codepoints, separated with a space
* @return string UTF-8 string
*/
function hexseq_to_utf($seq)
{
return implode('', array_map('hex_to_utf', explode(' ', $seq)));
}
/**
* Convert a codepoint to a UTF-8 char
*
* @param integer $cp Unicode codepoint
* @return string UTF-8 string
*/
function cp_to_utf($cp)
{
if ($cp > 0xFFFF)
{
return chr(0xF0 | ($cp >> 18)) . chr(0x80 | (($cp >> 12) & 0x3F)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F));
}
elseif ($cp > 0x7FF)
{
return chr(0xE0 | ($cp >> 12)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F));
}
elseif ($cp > 0x7F)
{
return chr(0xC0 | ($cp >> 6)) . chr(0x80 | ($cp & 0x3F));
}
else
{
return chr($cp);
}
}

View File

@@ -48,7 +48,7 @@ $sql = "CREATE TABLE {$table_prefix}attachments
AND a.post_id = p.post_id";
$db->sql_query($sql);
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'mysql':
case 'mysql4':

View File

@@ -54,7 +54,7 @@ $sql = "CREATE TABLE {$table_prefix}posts
WHERE pt.post_id = p.post_id";
$db->sql_query($sql);
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'mysql':
case 'mysql4':
@@ -150,7 +150,7 @@ while ($row = $db->sql_fetchrow($result))
}
$db->sql_freeresult($result);
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'oracle':
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id

View File

@@ -0,0 +1,380 @@
<?php
/**
*
* @package phpBB3
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (php_sapi_name() != 'cli')
{
die("This program must be run from the command line.\n");
}
set_time_limit(0);
error_reporting(E_ALL);
define('IN_PHPBB', true);
$phpbb_root_path = '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
/**
* Let's download some files we need
*/
download('http://www.unicode.org/Public/UNIDATA/NormalizationTest.txt');
download('http://www.unicode.org/Public/UNIDATA/UnicodeData.txt');
/**
* Those are the tests we run
*/
$test_suite = array(
/**
* NFC
* c2 == NFC(c1) == NFC(c2) == NFC(c3)
* c4 == NFC(c4) == NFC(c5)
*/
'NFC' => array(
'c2' => array('c1', 'c2', 'c3'),
'c4' => array('c4', 'c5')
),
/**
* NFD
* c3 == NFD(c1) == NFD(c2) == NFD(c3)
* c5 == NFD(c4) == NFD(c5)
*/
'NFD' => array(
'c3' => array('c1', 'c2', 'c3'),
'c5' => array('c4', 'c5')
),
/**
* NFKC
* c4 == NFKC(c1) == NFKC(c2) == NFKC(c3) == NFKC(c4) == NFKC(c5)
*/
'NFKC' => array(
'c4' => array('c1', 'c2', 'c3', 'c4', 'c5')
),
/**
* NFKD
* c5 == NFKD(c1) == NFKD(c2) == NFKD(c3) == NFKD(c4) == NFKD(c5)
*/
'NFKD' => array(
'c5' => array('c1', 'c2', 'c3', 'c4', 'c5')
)
);
require_once($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
$i = $n = 0;
$failed = FALSE;
$tested_chars = array();
$fp = fopen($phpbb_root_path . 'develop/NormalizationTest.txt', 'rb');
while (!feof($fp))
{
$line = fgets($fp);
++$n;
if ($line[0] == '@')
{
if ($i)
{
echo "done\n";
}
$i = 0;
echo "\n", substr($line, 1), "\n\n";
continue;
}
if (!strpos(' 0123456789ABCDEF', $line[0]))
{
continue;
}
if (++$i % 100 == 0)
{
echo $i, ' ';
}
list($c1, $c2, $c3, $c4, $c5) = explode(';', $line);
if (!strpos($c1, ' '))
{
/**
* We are currently testing a single character, we add it to the list of
* characters we have processed so that we can exclude it when testing
* for invariants
*/
$tested_chars[$c1] = 1;
}
foreach ($test_suite as $form => $serie)
{
foreach ($serie as $expected => $tests)
{
$hex_expected = ${$expected};
$utf_expected = hexseq_to_utf($hex_expected);
foreach ($tests as $test)
{
$utf_result = call_user_func(array('utf_normalizer', $form), $utf_expected);
if (strcmp($utf_expected, $utf_result))
{
$failed = TRUE;
$hex_result = utf_to_hexseq($utf_result);
echo "\nFAILED $expected == $form($test) ($hex_expected != $hex_result)";
}
}
}
if ($failed)
{
die("\n\nFailed at line $n\n");
}
}
}
fclose($fp);
/**
* Test for invariants
*/
echo "\n\nTesting for invariants...\n\n";
$fp = fopen($phpbb_root_path . 'develop/UnicodeData.txt', 'rt');
$n = 0;
while (!feof($fp))
{
if (++$n % 100 == 0)
{
echo $n, ' ';
}
$line = fgets($fp, 1024);
if (!$pos = strpos($line, ';'))
{
continue;
}
$hex_tested = $hex_expected = substr($line, 0, $pos);
if (isset($tested_chars[$hex_tested]))
{
continue;
}
$utf_expected = hex_to_utf($hex_expected);
if ($utf_expected >= UTF8_SURROGATE_FIRST
&& $utf_expected <= UTF8_SURROGATE_LAST)
{
/**
* Surrogates are illegal on their own, we expect the normalizer
* to return a replacement char
*/
$utf_expected = UTF8_REPLACEMENT;
$hex_expected = utf_to_hexseq($utf_expected);
}
foreach (array('nfc', 'nfkc', 'nfd', 'nfkd') as $form)
{
$utf_result = utf_normalizer::$form($utf_expected);
$hex_result = utf_to_hexseq($utf_result);
// echo "$form($utf_expected) == $utf_result\n";
if (strcmp($utf_expected, $utf_result))
{
$failed = 1;
echo "\nFAILED $hex_expected == $form($hex_tested) ($hex_expected != $hex_result)";
}
}
if ($failed)
{
die("\n\nFailed at line $n\n");
}
}
fclose($fp);
die("\n\nALL TESTS PASSED SUCCESSFULLY\n");
/**
* Download a file to the develop/ dir
*
* @param string $url URL of the file to download
* @return void
*/
function download($url)
{
global $phpbb_root_path;
if (file_exists($phpbb_root_path . 'develop/' . basename($url)))
{
return;
}
echo 'Downloading from ', $url, ' ';
if (!$fpr = fopen($url, 'rb'))
{
die("Can't download from $url\nPlease download it yourself and put it in the develop/ dir, kthxbai");
}
if (!$fpw = fopen($phpbb_root_path . 'develop/' . basename($url), 'wb'))
{
die("Can't open develop/" . basename($url) . " for output... please check your permissions or something");
}
$i = 0;
$chunk = 32768;
$done = '';
while (!feof($fpr))
{
$i += fwrite($fpw, fread($fpr, $chunk));
echo str_repeat("\x08", strlen($done));
$done = ($i >> 10) . ' KiB';
echo $done;
}
fclose($fpr);
fclose($fpw);
echo "\n";
}
/**
* Convert a UTF string to a sequence of codepoints in hexadecimal
*
* @param string $utf UTF string
* @return integer Unicode codepoints in hex
*/
function utf_to_hexseq($str)
{
$pos = 0;
$len = strlen($str);
$ret = array();
while ($pos < $len)
{
$c = $str[$pos];
switch ($c & "\xF0")
{
case "\xC0":
case "\xD0":
$utf_char = substr($str, $pos, 2);
$pos += 2;
break;
case "\xE0":
$utf_char = substr($str, $pos, 3);
$pos += 3;
break;
case "\xF0":
$utf_char = substr($str, $pos, 4);
$pos += 4;
break;
default:
$utf_char = $c;
++$pos;
}
$hex = dechex(utf_to_cp($utf_char));
if (!isset($hex[3]))
{
$hex = substr('000' . $hex, -4);
}
$ret[] = $hex;
}
return strtr(implode(' ', $ret), 'abcdef', 'ABCDEF');
}
/**
* Convert a UTF-8 char to its codepoint
*
* @param string $utf_char UTF-8 char
* @return integer Unicode codepoint
*/
function utf_to_cp($utf_char)
{
switch (strlen($utf_char))
{
case 1:
return ord($utf_char);
case 2:
return ((ord($utf_char[0]) & 0x1F) << 6) | (ord($utf_char[1]) & 0x3F);
case 3:
return ((ord($utf_char[0]) & 0x0F) << 12) | ((ord($utf_char[1]) & 0x3F) << 6) | (ord($utf_char[2]) & 0x3F);
case 4:
return ((ord($utf_char[0]) & 0x07) << 18) | ((ord($utf_char[1]) & 0x3F) << 12) | ((ord($utf_char[2]) & 0x3F) << 6) | (ord($utf_char[3]) & 0x3F);
default:
die('UTF-8 chars can only be 1-4 bytes long');
}
}
/**
* Return a UTF string formed from a sequence of codepoints in hexadecimal
*
* @param string $seq Sequence of codepoints, separated with a space
* @return string UTF-8 string
*/
function hexseq_to_utf($seq)
{
return implode('', array_map('hex_to_utf', explode(' ', $seq)));
}
/**
* Convert a codepoint in hexadecimal to a UTF-8 char
*
* @param string $hex Codepoint, in hexadecimal
* @return string UTF-8 char
*/
function hex_to_utf($hex)
{
return cp_to_utf(hexdec($hex));
}
/**
* Convert a codepoint to a UTF-8 char
*
* @param integer $cp Unicode codepoint
* @return string UTF-8 string
*/
function cp_to_utf($cp)
{
if ($cp > 0xFFFF)
{
return chr(0xF0 | ($cp >> 18)) . chr(0x80 | (($cp >> 12) & 0x3F)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F));
}
elseif ($cp > 0x7FF)
{
return chr(0xE0 | ($cp >> 12)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F));
}
elseif ($cp > 0x7F)
{
return chr(0xC0 | ($cp >> 6)) . chr(0x80 | ($cp & 0x3F));
}
else
{
return chr($cp);
}
}

View File

@@ -14,27 +14,30 @@ phpBB Project Manager : theFinn (James Atkinson)
phpBB Lead Developers : Acyd Burn (Meik Sievertsen)
psoTFX (Paul S. Owen) [2001 - 09/2005]
phpBB Developers : DavidMJ (David M.)
phpBB Developers : Ashe (Ludovic Arnaud) - [10/2002 - 11/2003, 06/2006 - ]
DavidMJ (David M.)
GrahamJE (Graham Eames)
naderman (Nils Aderman)
naderman (Nils Adermann)
subBlue (Tom Beddard)
Ashe (Ludovic Arnaud) - [10/2002 - 11/2003]
BartVB (Bart van Bragt) - [11/2000 - 03/2006]
Original subSilver by subBlue Design, Tom Beddard, <EFBFBD> 2001 phpBB Group
Original subSilver by subBlue Design, Tom Beddard, (c) 2001 phpBB Group
phpBB3 contains code from the following applications:
LGPL licenced:
Smarty <EFBFBD> 2001, 2002 by ispi of Lincoln, Inc, http://smarty.php.net/
Text_Diff-0.2.1 http://pear.php.net/package/Text_Diff
Smarty (c) 2001, 2002 by ispi of Lincoln, Inc, http://smarty.php.net/
GPL licenced:
phpMyAdmin <EFBFBD> 2001,2003 phpMyAdmin Devel team, http://www.phpmyadmin.net/
Jabber class <EFBFBD> 2003 Carlo Zottmann, http://phpjabber.g-blog.net
phpMyAdmin (c) 2001,2003 phpMyAdmin Devel team, http://www.phpmyadmin.net/
Jabber Class (c) 2004 Nathan Fritz, http://cjphp.netflint.net
Chora (c) 2000-2006, The Horde Project. http://horde.org/chora/
Horde Project (c) 2000-2006, The Horde Project. http://horde.org/
PHP License, version 3.0:
Pear <EFBFBD> 2001-2004 PHP Group, http://pear.php.net
Pear (c) 2001-2004 PHP Group, http://pear.php.net
Text_Diff-0.2.1 http://pear.php.net/package/Text_Diff

View File

@@ -12,7 +12,6 @@
<meta name="author" content="phpBB Group" />
<meta name="copyright" content="phpBB Group" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<link rel="shortcut icon" href="" />
<style type="text/css">
<!--
@@ -151,6 +150,10 @@ p a {
.menu li a {
font-size: 100%;
}
.comment {
color: green;
}
//-->
</style>
@@ -179,7 +182,7 @@ body {
<a name="top"></a><div id="main">
<p>These are the phpBB Coding Guidelines for Olympus, all attempts should be made to follow it as closely as possible. This document is (c) 2006 phpBB Group, copying or redistribution is not allowed without permission.</p>
<p>These are the phpBB Coding Guidelines for Olympus, all attempts should be made to follow it as closely as possible.<br />This document is (c) 2006 phpBB Group, copying or redistribution is not allowed without permission.</p>
<h1>Coding Guidelines</h1>
@@ -214,12 +217,12 @@ body {
<div class="paragraph">
<h3>Tabs vs Spaces:</h3>
<p>In order to make this as simple as possible, we will be using tabs, not spaces. Feel free to set how many spaces your editor uses when it <b>displays</b> tabs, but make sure that when you <b>save</b> the file, it's saving tabs and not spaces. This way, we can each have the code be displayed the way we like it, without breaking the layout of the actual files.</p>
<p>Additionally please check your editor for the indent size. If tabs are set to 4 spaces for example, the indent size needs to be 4 too:</p>
<p>In order to make this as simple as possible, we will be using tabs, not spaces. We enforce 4 (four) spaces for one tab - therefore you need to set your tab width within your editor to 4 spaces. Make sure that when you <b>save</b> the file, it's saving tabs and not spaces. This way, we can each have the code be displayed the way we like it, without breaking the layout of the actual files.</p>
<p>Tabs in front of lines are no problem, but having them within the text can be a problem if you do not set it to the amount of spaces every one of us uses. Here is a short example of how it should look like:</p>
<blockquote><pre>
$mode{TAB}{TAB}= request_var('mode', '');
$search_id{TAB}= request_var('search_id', '');
{TAB}$mode{TAB}{TAB}= request_var('mode', '');
{TAB}$search_id{TAB}= request_var('search_id', '');
</pre></blockquote>
<p>If entered with tabs (replace the {TAB}) both equal signs need to be on the same column.</p>
@@ -280,9 +283,7 @@ $search_id{TAB}= request_var('search_id', '');
<blockquote><pre>
/**
*
* {HEADER}
*
*/
/**
@@ -304,31 +305,26 @@ class ...
<br /><br />
<div class="paragraph">
<p>Functions used by more than one page should be placed in functions.php, functions specific to one page should be placed on that page (at the bottom) or within the relevant sections functions file.</p>
<p>Functions used by more than one page should be placed in functions.php, functions specific to one page should be placed on that page (at the bottom) or within the relevant sections functions file. Some files in <code>/includes</code> are holding functions responsible for special sections, for example uploading files, displaying &quot;things&quot;, user related functions and so forth.</p>
<p>The following packages are defined, and related new features/functions should be placed within the mentioned files/locations, as well as specifying the correct package name. The package names are bold within this list:</p>
<ul class="menu">
<li><b>phpBB3</b><br />Core files and all files not assigned to a seperate package</li>
<li><b>acm</b><br /><code>/includes/acm</code><br />Cache System, seperated because of equal class names
<ul>
<li><b>acm_main</b><br /><code>/includes/acm/acm_main.php</code><br />Base caching class. All functions obtaining cached data should be placed into this file</li>
<li><b>acm_db</b><br /><code>/includes/acm/acm_db.php</code><br />Database based caching</li>
<li><b>acm_file</b><br /><code>/includes/acm/acm_file.php</code><br />File based caching</li>
</ul>
</li>
<li><b>acm</b><br /><code>/includes/acm</code>, <code>/includes/cache.php</code><br />Cache System</li>
<li><b>acp</b><br /><code>/adm</code>, <code>/includes/acp</code>, <code>/includes/functions_admin.php</code><br />Administration Control Panel</li>
<li><b>dbal</b><br /><code>/includes/db</code><br />Database Abstraction Layer.<br />Base class is <code>dbal</code>
<ul>
<li><b>dbal_firebird</b><br /><code>/includes/db/firebird.php</code><br />Firebird/Interbase Database Abstraction Layer<br />Minimum Requirement is Firebird 1.5+/Interbase 7.1+</li>
<li><b>dbal_mssql</b><br /><code>/includes/db/msssql.php</code><br />MSSQL Database Abstraction Layer<br />Minimum Requirement is MSSQL 2000+</li>
<li><b>dbal_mssql_odbc</b><br /><code>/includes/db/mssql_odbc.php</code><br />MSSQL ODBC Database Abstraction Layer for MSSQL<br />Minimum Requirement is Version 2000+</li>
<li><b>dbal_mysql</b><br /><code>/includes/db/mysql.php</code><br />MySQL Database Abstraction Layer<br />Minimum Requirement is 3.23+/4.0+/4.1+</li>
<li><b>dbal_mysql4</b><br /><code>/includes/db/mysql4.php</code><br />MySQL4 Database Abstraction Layer<br />Minimum Requirement is 4.0+/4.1+/5.0+</li>
<li><b>dbal_mysqli</b><br /><code>/includes/db/mysqli.php</code><br />MySQLi Database Abstraction Layer<br />Minimum Requirement is MySQLi extension with MySQL 4.1+/5.0+</li>
<li><b>dbal_oracle</b><br /><code>/includes/db/oracle.php</code><br />Oracle Database Abstraction Layer</li>
<li><b>dbal_postgres</b><br /><code>/includes/db/postgres.php</code><br />PostgreSQL Database Abstraction Layer<br />Minimum Requirement is Version 7.3+</li>
<li><b>dbal_sqlite</b><br /><code>/includes/db/sqlite.php</code><br />Sqlite Database Abstraction Layer</li>
<li><code>/includes/db/dbal.php</code><br />Base DBAL class, defining the overall framework as well as common detominators</li>
<li><code>/includes/db/firebird.php</code><br />Firebird/Interbase Database Abstraction Layer</li>
<li><code>/includes/db/msssql.php</code><br />MSSQL Database Abstraction Layer</li>
<li><code>/includes/db/mssql_odbc.php</code><br />MSSQL ODBC Database Abstraction Layer for MSSQL</li>
<li><code>/includes/db/mysql.php</code><br />MySQL Database Abstraction Layer for MySQL 3.x/4.0.x</li>
<li><code>/includes/db/mysql4.php</code><br />MySQL4 Database Abstraction Layer for MySQL 4.1.x/5.x</li>
<li><code>/includes/db/mysqli.php</code><br />MySQLi Database Abstraction Layer</li>
<li><code>/includes/db/oracle.php</code><br />Oracle Database Abstraction Layer</li>
<li><code>/includes/db/postgres.php</code><br />PostgreSQL Database Abstraction Layer</li>
<li><code>/includes/db/sqlite.php</code><br />Sqlite Database Abstraction Layer</li>
</ul>
</li>
<li><b>docs</b><br /><code>/docs</code><br />phpBB Documentation</li>
@@ -336,6 +332,7 @@ class ...
<li><b>install</b><br /><code>/install</code><br />Installation System</li>
<li><b>language</b><br /><code>/language</code><br />All language files</li>
<li><b>login</b><br /><code>/includes/auth</code><br />Login Authentication Plugins</li>
<li><b>VC</b><br /><code>/includes/captcha</code><br />CAPTCHA</li>
<li><b>mcp</b><br /><code>mcp.php</code>, <code>/includes/mcp</code>, <code>report.php</code><br />Moderator Control Panel</li>
<li><b>ucp</b><br /><code>ucp.php</code>, <code>/includes/ucp</code><br />User Control Panel</li>
<li><b>search</b><br /><code>/includes/search</code>, <code>search.php</code><br />Search System</li>
@@ -350,7 +347,7 @@ class ...
<a name="code"></a><h1>2. Code Layout/Guidelines</h1>
<p>Please note that these Guidelines also applies to javascript code.</p>
<p>Please note that these Guidelines applies to all php, html, javascript and css files.</p>
<a name="namingvars"></a><b>2.i. Variable/Function Naming</b>
<br /><br />
@@ -369,6 +366,7 @@ class ...
<h3>Loop Indices:</h3>
<p>The <em>only</em> situation where a one-character variable name is allowed is when it's the index for some looping construct. In this case, the index of the outer loop should always be $i. If there's a loop inside that loop, its index should be $j, followed by $k, and so on. If the loop is being indexed by some already-existing variable with a meaningful name, this guideline does not apply, example:</p>
<blockquote><pre>
for ($i = 0; $i &lt; $outer_size; $i++)
{
@@ -404,6 +402,7 @@ for ($i = 0; $i &lt; $outer_size; $i++)
<p>This is another case of being too lazy to type 2 extra characters causing problems with code clarity. Even if the body of some construct is only one line long, do <em>not</em> drop the braces. Just don't, examples:</p>
<p class="bad">// These are all wrong. </p>
<blockquote><pre>
if (condition) do_stuff();
@@ -471,6 +470,7 @@ function do_stuff()
<p>This is another simple, easy step that helps keep code readable without much effort. Whenever you write an assignment, expression, etc.. Always leave <em>one</em> space between the tokens. Basically, write code as if it was English. Put spaces between variable names and operators. Don't put spaces just after an opening bracket or before a closing bracket. Don't put spaces just before a comma or a semicolon. This is best shown with a few examples, examples:</p>
<p>// Each pair shows the wrong way followed by the right way. </p>
<blockquote><pre>
$i=0;
$i = 0;
@@ -481,8 +481,8 @@ if ($i &lt; 7) ...
if ( ($i &lt; 7)&amp;&amp;($j &gt; 8) ) ...
if ($i &lt; 7 &amp;&amp; $j &gt; 8) ...
do_stuff( $i, "foo", $b );
do_stuff($i, "foo", $b);
do_stuff( $i, 'foo', $b );
do_stuff($i, 'foo', $b);
for($i=0; $i&lt;$size; $i++) ...
for ($i = 0; $i &lt; $size; $i++) ...
@@ -552,8 +552,18 @@ $foo = $assoc_array[blah];
$foo = $assoc_array['blah'];
</pre></blockquote>
<p class="bad">// wrong</p>
<blockquote><pre>
$foo = $assoc_array["$var"];
</pre></blockquote>
<p class="good">// right </p>
<blockquote><pre>
$foo = $assoc_array[$var];
</pre></blockquote>
<h3>Comments:</h3>
<p>Each complex function should be preceded by a comment that tells a programmer everything they need to know to use that function. The meaning of every parameter, the expected input, and the output are required as a minimal comment. The function's behaviour in error conditions (and what those error conditions are) should also be present.<br /><br />Especially important to document are any assumptions the code makes, or preconditions for its proper operation. Any one of the developers should be able to look at any part of the application and figure out what's going on in a reasonable amount of time. Avoid using <code>/* */</code> comment blocks for one-line comments, <code>//</code> should be used for one/two-liners.</p>
<p>Each complex function should be preceded by a comment that tells a programmer everything they need to know to use that function. The meaning of every parameter, the expected input, and the output are required as a minimal comment. The function's behaviour in error conditions (and what those error conditions are) should also be present - but mostly included within the comment about the output.<br /><br />Especially important to document are any assumptions the code makes, or preconditions for its proper operation. Any one of the developers should be able to look at any part of the application and figure out what's going on in a reasonable amount of time.<br /><br />Avoid using <code>/* */</code> comment blocks for one-line comments, <code>//</code> should be used for one/two-liners.</p>
<h3>Magic numbers:</h3>
<p>Don't use them. Use named constants for any literal value other than obvious special cases. Basically, it's ok to check if an array has 0 elements by using the literal 0. It's not ok to assign some special meaning to a number and then use it everywhere as a literal. This hurts readability AND maintainability. The constants <code>true</code> and <code>false</code> should be used in place of the literals 1 and 0 -- even though they have the same values (but not type!), it's more obvious what the actual logic is when you use the named constants. Typecast variables where it is needed, do not rely on the correct variable type (PHP is currently very loose on typecasting which can lead to security problems if a developer does not have a very close eye to it).</p>
@@ -590,7 +600,7 @@ $min = ($i &lt; $j) ? $i : $j;
</pre></blockquote>
<h3>Don't use uninitialized variables.</h3>
<p>For phpBB3, we intend to use a higher level of run-time error reporting. This will mean that the use of an uninitialized variable will be reported as a warning. These warnings can be avoided by using the built-in isset() function to check whether a variable has been set, examples:</p>
<p>For phpBB3, we intend to use a higher level of run-time error reporting. This will mean that the use of an uninitialized variable will be reported as a warning. These warnings can be avoided by using the built-in isset() function to check whether a variable has been set - but preferably the variable is always existing. For checking if an array has a key set this can come in handy though, examples:</p>
<p class="bad">// Wrong </p>
<blockquote><pre>
@@ -607,6 +617,8 @@ if (isset($forum)) ...
if (isset($forum) &amp;&amp; $forum == 5)
</pre></blockquote>
<p>The <code>empty()</code> function is useful if you want to check if a variable is not set or being empty (an empty string, 0 as an integer or string, NULL, false, an empty array or a variable declared, but without a value in a class). Therefore empty should be used in favor of <code>isset($array) &amp;&amp; sizeof($array) > 0</code> - this can be written in a shorter way as <code>!empty($array)</code>.</p>
<h3>Switch statements:</h3>
<p>Switch/case code blocks can get a bit long sometimes. To have some level of notice and being in-line with the opening/closing brace requirement (where they are on the same line for better readability), this also applies to switch/case code blocks and the breaks. An example:</p>
@@ -704,7 +716,7 @@ switch ($mode)
<div class="paragraph">
<h3>Common SQL Guidelines: </h3>
<p>All SQL should be cross-DB compatible, if DB specific SQL is used alternatives must be provided which work on all supported DB's (MySQL3/4/5, MSSQL (7.0 and 2000), PostgreSQL (7.0+), Firebird, SQLite, Oracle8, ODBC (generalised if possible, otherwise DB2)).</p>
<p>All SQL should be cross-DB compatible, if DB specific SQL is used alternatives must be provided which work on all supported DB's (MySQL3/4/5, MSSQL (7.0 and 2000), PostgreSQL (7.0+), Firebird, SQLite, Oracle8, ODBC (generalised if possible)).</p>
<p>All SQL commands should utilise the DataBase Abstraction Layer (DBAL)</p>
<h3>SQL code layout:</h3>
@@ -731,7 +743,7 @@ $sql = 'SELECT *
</pre></blockquote>
<h3>SQL Quotes: </h3>
<p>Double quotes where applicable ... examples: </p>
<p>Double quotes where applicable (The variables in these examples are typecasted to integers before) ... examples: </p>
<p class="bad">// These are wrong.</p>
<blockquote><pre>
@@ -752,6 +764,8 @@ $sql = 'SELECT *
<h3>Common DBAL methods: </h3>
<h3>sql_escape():</h3>
<p>Always use <code>$db-&gt;sql_escape()</code> if you need to check for a string within an SQL statement (even if you are sure the variable can not contain single quotes - never trust your input), for example:</p>
<blockquote><pre>
@@ -760,7 +774,9 @@ $sql = 'SELECT *
WHERE username = '" . $db-&gt;sql_escape($username) . "'";
</pre></blockquote>
<p>If you need to UPDATE or INSERT data, make use of the <code>$db-&gt;sql_build_array()</code> function. This function already escapes strings and checkes other types, so there is no need to do this here. The data to be inserted should go into an array - <code>$sql_ary</code> - or directly within the statement if one one or two variables needs to be inserted/updated. An example of an insert statement would be:</p>
<h3>sql_build_array():</h3>
<p>If you need to UPDATE or INSERT data, make use of the <code>$db-&gt;sql_build_array()</code> function. This function already escapes strings and checks other types, so there is no need to do this here. The data to be inserted should go into an array - <code>$sql_ary</code> - or directly within the statement if one one or two variables needs to be inserted/updated. An example of an insert statement would be:</p>
<blockquote><pre>
$sql_ary = array(
@@ -782,13 +798,127 @@ $sql_ary = array(
);
$sql = 'UPDATE ' . SOME_TABLE . '
SET ' . $db-&gt;sql_build_array('UPDATE', $sql_ary) . "
WHERE user_id = $user_id";
SET ' . $db-&gt;sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . (int) $user_id;
$db-&gt;sql_query($sql);
</pre></blockquote>
<p>The <code>$db-&gt;sql_build_array()</code> function supports the following modes: <code>INSERT</code> (example above), <code>INSERT_SELECT</code> (building query for <code>INSERT INTO table (...) SELECT value, column ...</code> statements), <code>MULTI_INSERT</code> (for returning extended inserts), <code>UPDATE</code> (example above) and <code>SELECT</code> (for building WHERE statement [AND logic]).</p>
<h3>sql_in_set():</h3>
<p>The <code>$db-&gt;sql_in_set()</code> function should be used for building <code>IN ()</code> and <code>NOT IN ()</code> constructs. Since (specifically) MySQL tend to be faster if for one value to be compared the <code>=</code> and <code>&lt;&gt;</code> operator is used, we let the DBAL decide what to do. A typical example of doing a positive match against a number of values would be:</p>
<blockquote><pre>
$sql = 'SELECT *
FROM ' . FORUMS_TABLE . '
WHERE ' . $db-&gt;sql_in_set('forum_id', $forum_ids);
$db-&gt;sql_query($sql);
</pre></blockquote>
<p>Based on the number of values in $forum_ids, the query can look differently.</p>
<p class="good">// SQL Statement if $forum_ids = array(1, 2, 3);</p>
<blockquote><pre>
SELECT FROM phpbb_forums WHERE forum_id IN (1, 2, 3)
</pre></blockquote>
<p class="good">// SQL Statement if $forum_ids = array(1) or $forum_ids = 1</p>
<blockquote><pre>
SELECT FROM phpbb_forums WHERE forum_id = 1
</pre></blockquote>
<p>Of course the same is possible for doing a negative match against a number of values:</p>
<blockquote><pre>
$sql = 'SELECT *
FROM ' . FORUMS_TABLE . '
WHERE ' . $db-&gt;sql_in_set('forum_id', $forum_ids, <strong>true</strong>);
$db-&gt;sql_query($sql);
</pre></blockquote>
<p>Based on the number of values in $forum_ids, the query can look differently here too.</p>
<p class="good">// SQL Statement if $forum_ids = array(1, 2, 3);</p>
<blockquote><pre>
SELECT FROM phpbb_forums WHERE forum_id <strong>NOT</strong> IN (1, 2, 3)
</pre></blockquote>
<p class="good">// SQL Statement if $forum_ids = array(1) or $forum_ids = 1</p>
<blockquote><pre>
SELECT FROM phpbb_forums WHERE forum_id <strong>&lt;&gt;</strong> 1
</pre></blockquote>
<p>If the given array is empty, an error will be produced.</p>
<h3>sql_build_query():</h3>
<p>The <code>$db-&gt;sql_build_query()</code> function is responsible for building sql statements for select and select distinct queries if you need to JOIN on more than one table or retrieving data from more than one table while doing a JOIN. This needs to be used to make sure the resulting statement is working on all supported db's. Instead of explaining every possible combination, i will give a short example:</p>
<blockquote><pre>
$sql_array = array(
'SELECT' => 'f.*, ft.mark_time',
'FROM' => array(
FORUMS_WATCH_TABLE => 'fw',
FORUMS_TABLE => 'f'
),
'LEFT_JOIN' => array(
array(
'FROM' => array(FORUMS_TRACK_TABLE => 'ft'),
'ON' => 'ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id'
)
);
'WHERE' => 'fw.user_id = ' . $user->data['user_id'] . '
AND f.forum_id = fw.forum_id',
'ORDER_BY' => 'left_id'
);
$sql = $db-&gt;sql_build_query('SELECT', $sql_array);
</pre></blockquote>
<p>The possible first parameter for sql_build_query() is SELECT or SELECT_DISTINCT. As you can see, the logic is pretty self-explaining. For the LEFT_JOIN key, just add another array if you want to join on to tables for example. The added benefit of using this construct is that you are able to easily build the query statement based on conditions - for example the above LEFT_JOIN is only necessary if server side topic tracking is enabled; a slight adjustement would be:</p>
<blockquote><pre>
$sql_array = array(
'SELECT' => 'f.*',
'FROM' => array(
FORUMS_WATCH_TABLE => 'fw',
FORUMS_TABLE => 'f'
),
'WHERE' => 'fw.user_id = ' . $user->data['user_id'] . '
AND f.forum_id = fw.forum_id',
'ORDER_BY' => 'left_id'
);
if ($config['load_db_lastread'])
{
$sql_array['LEFT_JOIN'] = array(
array(
'FROM' => array(FORUMS_TRACK_TABLE => 'ft'),
'ON' => 'ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id'
)
);
$sql_array['SELECT'] .= ', ft.mark_time ';
}
else
{
// Here we read the cookie data
}
$sql = $db-&gt;sql_build_query('SELECT', $sql_array);
</pre></blockquote>
</div>
<a href="#top">Top</a>
<br /><br />
@@ -818,7 +948,7 @@ for ($i = 0, $size = sizeof($post_data); $i &lt; $size; $i++)
</pre></blockquote>
<h3>Use of in_array(): </h3>
<p>Try to avoid using in_array() on huge arrays, and try to not place them into loops if the array to check consist of more than 20 entries. in_array() can be very time consuming and uses a lot of cpu processing time. For little checks it is not noticable, but if checked against a huge array within a loop those checks alone can be a bunch of seconds.</p>
<p>Try to avoid using in_array() on huge arrays, and try to not place them into loops if the array to check consist of more than 20 entries. in_array() can be very time consuming and uses a lot of cpu processing time. For little checks it is not noticable, but if checked against a huge array within a loop those checks alone can be a bunch of seconds. If you need this functionality, try using isset() on the arrays keys instead, actually shifting the values into keys and vice versa. A call to <code>isset($array[$var])</code> is a lot faster than <code>in_array($var, array_keys($array))</code> for example.</p>
</div>
<a href="#top">Top</a>
@@ -830,9 +960,11 @@ for ($i = 0, $size = sizeof($post_data); $i &lt; $size; $i++)
<div class="paragraph">
<h3>General things:</h3>
<p>Never trust user input.</p>
<p>The auth class should be used for all authorisation checking</p>
<p>No attempt should be made to remove any copyright information (either contained within the source or displayed interactively when the source is run/compiled), neither should the copyright information be altered in any way (it may be added to)</p>
<p>Never trust user input (this also applies to server variables as well as cookies).</p>
<p>Try to sanitize values returned from a function.</p>
<p>Try to sanitize given function variables within your function.</p>
<p>The auth class should be used for all authorisation checking.</p>
<p>No attempt should be made to remove any copyright information (either contained within the source or displayed interactively when the source is run/compiled), neither should the copyright information be altered in any way (it may be added to).</p>
<h3>Variables: </h3>
<p>Make use of the <code>request_var()</code> function for anything except for submit or single checking params. </p>
@@ -868,7 +1000,7 @@ $action_ary = request_var('action', array('' => 0));
<h3>Login checks/redirection: </h3>
<p>To show a forum login box use <code>login_forum_box($forum_data)</code>, else use the <code>login_box()</code> function.</p>
<p>The <code>login_box()</code> function could have a redirect as the first parameter. As a thumb of rule, specify an empty string if you want to redirect to the users current location, else do not add the <code>$SID</code> to the redirect string (for example within the ucp/login we redirect to the board index because else the user would be redirected to the login screen).</p>
<p>The <code>login_box()</code> function can have a redirect as the first parameter. As a thumb of rule, specify an empty string if you want to redirect to the users current location, else do not add the <code>$SID</code> to the redirect string (for example within the ucp/login we redirect to the board index because else the user would be redirected to the login screen).</p>
<h3>Sensitive Operations: </h3>
<p>For sensitive operations always let the user confirm the action. For the confirmation screens, make use of the <code>confirm_box()</code> function.</p>
@@ -882,22 +1014,36 @@ $auth->acl($user->data);
$user->setup();
</pre></blockquote>
<p>The <code>$user->setup()</code> call can be used to pass on additional language definitions and a custom style (used in viewforum).</p>
<p>The <code>$user->setup()</code> call can be used to pass on additional language definition and a custom style (used in viewforum).</p>
<h3>Errors and messages: </h3>
<p>All messages/errors should be output by calling <code>trigger_error()</code> using the appropriate message type and language string. Example:</p>
<p>All messages/errors should be outputed by calling <code>trigger_error()</code> using the appropriate message type and language string. Example:</p>
<blockquote><pre>
trigger_error('NO_FORUM');
</pre></blockquote>
<blockquote><pre>
trigger_error($user-&gt;lang['NO_FORUM']);
</pre></blockquote>
<blockquote><pre>
trigger_error('NO_APPROPIATE_MODE', E_USER_ERROR);
</pre></blockquote>
<h3>Url formatting</h3>
<p>All urls pointing to internal files need to be prepended by the <code>$phpbb_root_path</code> variable. Within the administration control panel all urls pointing to internal files need to be prepended by the <code>$phpbb_admin_path</code> variable. This makes sure the path is always correct and users being able to just rename the admin folder and the acp still working as intended.</p>
<p>All urls pointing to internal files need to be prepended by the <code>$phpbb_root_path</code> variable. Within the administration control panel all urls pointing to internal files need to be prepended by the <code>$phpbb_admin_path</code> variable. This makes sure the path is always correct and users being able to just rename the admin folder and the acp still working as intended (though some links will fail and the code need to be slightly adjusted).</p>
<p>The <code>append_sid()</code> function from 2.0.x is available too, though does not handle url alterations automatically. Please have a look at the code documentation if you want to get more details on how to use append_sid(). A sample call to append_sid() can look like this:</p>
<blockquote><pre>
append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;g=' . $row['group_id'])
</pre></blockquote>
<h3>General function usage: </h3>
<p>Some of these functions are only chosen over others because of a personal preference and are having no other benefit than to be consistant over the code.</p>
<p>Some of these functions are only chosen over others because of personal preference and having no other benefit than to be consistant over the code.</p>
<ul>
<li>
@@ -909,6 +1055,12 @@ trigger_error('NO_FORUM');
<li>
<p>Use <code>else if</code> instead of <code>elseif</code></p>
</li>
<li>
<p>Use <code>false</code> (lowercase) instead of <code>FALSE</code></p>
</li>
<li>
<p>Use <code>true</code> (lowercase) instead of <code>TRUE</code></p>
</li>
</ul>
</div>
@@ -921,7 +1073,7 @@ trigger_error('NO_FORUM');
<div class="paragraph">
<h3>General things</h3>
<p>Templates should be produced in a consistent manner. Where appropriate they should be based off an existing copy, e.g. index, viewforum or viewtopic (the combination of which implement a range of conditional and variable forms).</p>
<p>Templates should be produced in a consistent manner. Where appropriate they should be based off an existing copy, e.g. index, viewforum or viewtopic (the combination of which implement a range of conditional and variable forms). Please also note that the intendation and coding guidelines also apply to templates where possible.</p>
<p>The outer table class <code>forumline</code> has gone and is replaced with <code>tablebg</code>.</p>
<p>When writing <code>&lt;table&gt;</code> the order <code>&lt;table class="" cellspacing="" cellpadding="" border="" align=""&gt;</code> creates consistency and allows everyone to easily see which table produces which "look". The same applies to most other tags for which additional parameters can be set, consistency is the major aim here.</p>
@@ -945,33 +1097,33 @@ trigger_error('NO_FORUM');
<p>Use a standard cellpadding of 2 and cellspacing of 0 on outer tables. Inner tables can vary from 0 to 3 or even 4 depending on the need.</p>
<p>Use div container for styling and table for data representation</p>
<p><strong>Use div container/css for styling and table for data representation.</strong></p>
<p>The seperate catXXXX and thXXX classes are gone. When defining a header cell just use <code>&lt;th&gt;</code> rather than <code>&lt;th class="thHead"&gt;</code> etc. Similarly for cat, don't use <code>&lt;td class="catLeft"&gt;</code> use <code>&lt;td class="cat"&gt;</code> etc.</p>
<p>Try to retain consistency of basic layout and class useage, i.e. _EXPLAIN text should generally be placed below the title it explains, e.g. <code>{L_POST_USERNAME}&lt;br /&gt;&lt;span class="gensmall"&gt;{L_POST_USERNAME_EXPLAIN}&lt;/span&gt;</code> is the typical way of handling this ... there may be exceptions and this isn't a hard and fast rule</p>
<p>Try to retain consistency of basic layout and class useage, i.e. _EXPLAIN text should generally be placed below the title it explains, e.g. <code>{L_POST_USERNAME}&lt;br /&gt;&lt;span class="gensmall"&gt;{L_POST_USERNAME_EXPLAIN}&lt;/span&gt;</code> is the typical way of handling this ... there may be exceptions and this isn't a hard and fast rule.</p>
<p>Try to keep template conditional and other statements tabbed in line with the block to which they refer.</p>
<p class="bad">this is incorrect</p>
<p class="good">this is correct</p>
<blockquote><pre>
&lt;!-- BEGIN test --&gt;
<span class="comment">&lt;!-- BEGIN test --&gt;</span>
&lt;tr&gt;
&lt;td&gt;&#123;test.TEXT&#125;&lt;/td&gt;
&lt;/tr&gt;
&lt;!-- END test --&gt;
<span class="comment">&lt;!-- END test --&gt;</span>
</pre></blockquote>
<p class="good">this is correct:</p>
<p class="good">this is also correct:</p>
<blockquote><pre>
&lt;!-- BEGIN test --&gt;
<span class="comment">&lt;!-- BEGIN test --&gt;</span>
&lt;tr&gt;
&lt;td&gt;&#123;test.TEXT&#125;&lt;/td&gt;
&lt;/tr&gt;
&lt;!-- END test --&gt;
<span class="comment">&lt;!-- END test --&gt;</span>
</pre></blockquote>
<p>it gives immediate feedback on exactly what is looping.</p>
<p>it gives immediate feedback on exactly what is looping - decide which way to use based on the readability.</p>
</div>
<a href="#top">Top</a>
@@ -986,50 +1138,26 @@ trigger_error('NO_FORUM');
<p>Firstly templates now take the suffix &quot;.html&quot; rather than &quot;.tpl&quot;. This was done simply to make the lifes of some people easier wrt syntax highlighting, etc.</p>
<h3>Variables</h3>
<p>All template variables should be named appropriately (using underscores for spaces), language entries should be prefixed with L_, system data with S_, urls with U_, all other variables should be presented 'as is'.</p>
<p>All template variables should be named appropriately (using underscores for spaces), language entries should be prefixed with L_, system data with S_, urls with U_, javascript urls with UA_, language to be put in javascript statements with LA_, all other variables should be presented 'as is'.</p>
<p>Note that unlike 2.0.x most language strings are not assigned from the source. When a language variable is found {L_YYYYYY} phpBB first looks if an assigned variable exists with that name. If it does, it uses that. If not it looks if an exsting string defined in the language file exists. This should reduce the need to assign loads of new lang vars in Mods.</p>
<p>L_* template variables are automatically tried to be mapped to the corresponding language entry if the code does not set (and therefore overwrite) this variable specifically. For example <code>{L_USERNAME}</code> maps to <code>$user-&gt;lang['USERNAME']</code>. The LA_* template variables are handled within the same way, but properly escaped to be put in javascript code. This should reduce the need to assign loads of new lang vars in Mods.
</p>
<h3>Blocks</h3>
<h3>Blocks/Loops</h3>
<p>The basic block level loop remains and takes the form:</p>
<blockquote><pre>
&lt;!-- BEGIN loopname --&gt;
markup, {loopname&#46;X_YYYYY}, etc&#46;
&lt;!-- END loopname --&gt;
<span class="comment">&lt;!-- BEGIN loopname --&gt;</span>
markup, {loopname&#46;X_YYYYY}, etc&#46;
<span class="comment">&lt;!-- END loopname --&gt;</span>
</pre></blockquote>
<p>However this has now been extended with the following additions. Firstly you can set the start and end points of the loop. For example:</p>
<blockquote><pre>
&lt;!-- BEGIN loopname(2) --&gt;
markup
&lt;!-- END loopname --&gt;
</pre></blockquote>
<p>Will start the loop on the third entry (note that indexes start at zero). Extensions of this are:
<br /><br />
<code>loopname(2,4)</code>: Starts loop on third values, ends on fourth<br />
<code>loopname(-4)</code>: Starts loop fourth from last value<br />
<code>loopname(2, -4)</code>: Starts loop on third value, ends four from end<br />
<br />Note that the indexing method may change since it's not really consistent at this time :)</p>
<p>A further extension to begin is BEGINELSE:</p>
<blockquote><pre>
&lt;!-- BEGIN loop --&gt;
markup
&lt;!-- BEGINELSE --&gt;
markup
&lt;!-- END loop --&gt;
</pre></blockquote>
<p>This will cause the markup between <code>BEGINELSE</code> and <code>END</code> to be output if the loop contains no values. This is useful for forums with no topics (for example) ... in some ways it replaces &quot;bits of&quot; the existing &quot;switch_&quot; type control (the rest being replaced by conditionals, see below).</p>
<p>A bit later loops will be explained further. To not irretate you we will explain conditionals as well as other statements first.</p>
<h3>Including files</h3>
<p>Something that existed in 2.0.x which no longer exists in 3.0.x is the ability to assign a template to a variable. This was used (for example) to output the jumpbox. Instead (perhaps better, perhaps not but certainly more flexible) we now have INCLUDE. This takes the simple form:</p>
<blockquote><pre>
&lt;!-- INCLUDE filename --&gt;
<span class="comment">&lt;!-- INCLUDE filename --&gt;</span>
</pre></blockquote>
<p>You will note in the 3.0 templates the major sources start with <code>&lt;!-- INCLUDE overall_header.html --&gt;</code> or <code>&lt;!-- INCLUDE simple_header.html --&gt;</code>, etc. In 2.0.x control of &quot;which&quot; header to use was defined entirely within the code. In 3.0.x the template designer can output what they like. Note that you can introduce new templates (i.e. other than those in the default set) using this system and include them as you wish ... perhaps useful for a common &quot;menu&quot; bar or some such. No need to modify loads of files as with 2.0.x.</p>
@@ -1038,15 +1166,15 @@ markup
<p>A contentious decision has seen the ability to include PHP within the template introduced. This is achieved by enclosing the PHP within relevant tags:</p>
<blockquote><pre>
&lt;!-- PHP --&gt;
echo &quot;hello!&quot;;
&lt;!-- ENDPHP --&gt;
<span class="comment">&lt;!-- PHP --&gt;</span>
echo &quot;hello!&quot;;
<span class="comment">&lt;!-- ENDPHP --&gt;</span>
</pre></blockquote>
<p>You may also include PHP from an external file using:</p>
<blockquote><pre>
&lt;!-- INCLUDEPHP somefile&#46;php --&gt;
<span class="comment">&lt;!-- INCLUDEPHP somefile&#46;php --&gt;</span>
</pre></blockquote>
<p>it will be included and executed inline.<br /><br />A note, it is very much encouraged that template designers do not include PHP. The ability to include raw PHP was introduced primarily to allow end users to include banner code, etc. without modifying multiple files (as with 2.0.x). It was not intended for general use ... hence <!-- w --><a href="http://www.phpbb.com">www.phpbb.com</a><!-- w --> will <strong>not</strong> make available template sets which include PHP. And by default templates will have PHP disabled (the admin will need to specifically activate PHP for a template).</p>
@@ -1055,18 +1183,20 @@ echo &quot;hello!&quot;;
<p>The most significant addition to 3.0.x are conditions or control structures, &quot;if something then do this else do that&quot;. The system deployed is very similar to Smarty. This may confuse some people at first but it offers great potential and great flexibility with a little imagination. In their most simple form these constructs take the form:</p>
<blockquote><pre>
&lt;!-- IF expr --&gt;<br />markup<br />&lt;!-- ENDIF --&gt;
<span class="comment">&lt;!-- IF expr --&gt;</span>
markup
<span class="comment">&lt;!-- ENDIF --&gt;</span>
</pre></blockquote>
<p>expr can take many forms, for example:</p>
<blockquote><pre>
&lt;!-- IF loop&#46;S_ROW_COUNT is even --&gt;
markup
&lt;!-- ENDIF --&gt;
<span class="comment">&lt;!-- IF loop&#46;S_ROW_COUNT is even --&gt;</span>
markup
<span class="comment">&lt;!-- ENDIF --&gt;</span>
</pre></blockquote>
<p>This will output the markup if the S_ROW_COUNT variable in the current iteration of loop is an even value (i.e. the expr is TRUE). You can use various comparison methods (standard as well as equivalent textual versions noted in square brackets) including:</p>
<p>This will output the markup if the S_ROW_COUNT variable in the current iteration of loop is an even value (i.e. the expr is TRUE). You can use various comparison methods (standard as well as equivalent textual versions noted in square brackets) including (<code>not, or, and, eq, neq, is</code> should be used if possible for better readability):</p>
<blockquote><pre>
== [eq]
@@ -1086,6 +1216,7 @@ markup
-
*
/
,
&lt;&lt; (bitwise shift left)
&gt;&gt; (bitwise shift right)
| (bitwise or)
@@ -1106,29 +1237,29 @@ div
<p>Beyond the simple use of IF you can also do a sequence of comparisons using the following:</p>
<blockquote><pre>
&lt;!-- IF expr1 --&gt;
markup
&lt;!-- ELSEIF expr2 --&gt;
markup
&#46;
&#46;
&#46;
&lt;!-- ELSEIF exprN --&gt;
markup
&lt;!-- ELSE --&gt;
markup
&lt;!-- ENDIF --&gt;
<span class="comment">&lt;!-- IF expr1 --&gt;</span>
markup
<span class="comment">&lt;!-- ELSEIF expr2 --&gt;</span>
markup
&#46;
&#46;
&#46;
<span class="comment">&lt;!-- ELSEIF exprN --&gt;</span>
markup
<span class="comment">&lt;!-- ELSE --&gt;</span>
markup
<span class="comment">&lt;!-- ENDIF --&gt;</span>
</pre></blockquote>
<p>Each statement will be tested in turn and the relevant output generated when a match (if a match) is found. It is not necessary to always use ELSEIF, ELSE can be used alone to match &quot;everything else&quot;.<br /><br />So what can you do with all this? Well take for example the colouration of rows in viewforum. In 2.0.x row colours were predefined within the source as either row color1, row color2 or row class1, row class2. In 3.0.x this is moved to the template, it may look a little daunting at first but remember control flows from top to bottom and it's not too difficult:</p>
<blockquote><pre>
&lt;table&gt;
&lt;!-- IF loop&#46;S_ROW_COUNT is even --&gt;
&lt;tr class=&quot;row1&quot;&gt;
&lt;!-- ELSE --&gt;
&lt;tr class=&quot;row2&quot;&gt;
&lt;!-- ENDIF --&gt;
<span class="comment">&lt;!-- IF loop&#46;S_ROW_COUNT is even --&gt;</span>
&lt;tr class=&quot;row1&quot;&gt;
<span class="comment">&lt;!-- ELSE --&gt;</span>
&lt;tr class=&quot;row2&quot;&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
&lt;td&gt;HELLO!&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
@@ -1138,15 +1269,15 @@ markup
<blockquote><pre>
&lt;table&gt;
&lt;!-- IF loop&#46;S_ROW_COUNT &gt; 10 --&gt;
&lt;tr bgcolor=&quot;#FF0000&quot;&gt;
&lt;!-- ELSEIF loop&#46;S_ROW_COUNT &gt; 5 --&gt;
&lt;tr bgcolor=&quot;#00FF00&quot;&gt;
&lt;!-- ELSEIF loop&#46;S_ROW_COUNT &gt; 2 --&gt;
&lt;tr bgcolor=&quot;#0000FF&quot;&gt;
&lt;!-- ELSE --&gt;
&lt;tr bgcolor=&quot;#FF00FF&quot;&gt;
&lt;!-- ENDIF --&gt;
<span class="comment">&lt;!-- IF loop&#46;S_ROW_COUNT &gt; 10 --&gt;</span>
&lt;tr bgcolor=&quot;#FF0000&quot;&gt;
<span class="comment">&lt;!-- ELSEIF loop&#46;S_ROW_COUNT &gt; 5 --&gt;</span>
&lt;tr bgcolor=&quot;#00FF00&quot;&gt;
<span class="comment">&lt;!-- ELSEIF loop&#46;S_ROW_COUNT &gt; 2 --&gt;</span>
&lt;tr bgcolor=&quot;#0000FF&quot;&gt;
<span class="comment">&lt;!-- ELSE --&gt;</span>
&lt;tr bgcolor=&quot;#FF00FF&quot;&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
&lt;td&gt;hello!&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
@@ -1155,13 +1286,229 @@ markup
<p>This will output the row cell in purple for the first two rows, blue for rows 2 to 5, green for rows 5 to 10 and red for remainder. So, you could produce a &quot;nice&quot; gradient effect, for example.<br /><br />What else can you do? Well, you could use IF to do common checks on for example the login state of a user:</p>
<blockquote><pre>
&lt;!-- IF S_USER_LOGGED_IN --&gt;
markup
&lt;!-- ENDIF --&gt;
<span class="comment">&lt;!-- IF S_USER_LOGGED_IN --&gt;</span>
markup
<span class="comment">&lt;!-- ENDIF --&gt;</span>
</pre></blockquote>
<p>This replaces the existing (fudged) method in 2.0.x using a zero length array and BEGIN/END.</p>
<h3>Extended syntax for Blocks/Loops</h3>
<p>Back to our loops - they had been extended with the following additions. Firstly you can set the start and end points of the loop. For example:</p>
<blockquote><pre>
<span class="comment">&lt;!-- BEGIN loopname(2) --&gt;</span>
markup
<span class="comment">&lt;!-- END loopname --&gt;</span>
</pre></blockquote>
<p>Will start the loop on the third entry (note that indexes start at zero). Extensions of this are:
<br /><br />
<code>loopname(2)</code>: Will start the loop on the 3rd entry<br />
<code>loopname(-2)</code>: Will start the loop two entries from the end<br />
<code>loopname(3,4)</code>: Will start the loop on the fourth entry and end it on the fifth<br />
<code>loopname(3,-4)</code>: Will start the loop on the fourth entry and end it four from last<br />
</p>
<p>A further extension to begin is BEGINELSE:</p>
<blockquote><pre>
<span class="comment">&lt;!-- BEGIN loop --&gt;</span>
markup
<span class="comment">&lt;!-- BEGINELSE --&gt;</span>
markup
<span class="comment">&lt;!-- END loop --&gt;</span>
</pre></blockquote>
<p>This will cause the markup between <code>BEGINELSE</code> and <code>END</code> to be output if the loop contains no values. This is useful for forums with no topics (for example) ... in some ways it replaces &quot;bits of&quot; the existing &quot;switch_&quot; type control (the rest being replaced by conditionals).</p>
<p>Another way of checking if a loop contains values is by prefixing the loops name with a dot:</p>
<blockquote><pre>
<span class="comment">&lt;!-- IF .loop --&gt;</span>
<span class="comment">&lt;!-- BEGIN loop --&gt;</span>
markup
<span class="comment">&lt;!-- END loop --&gt;</span>
<span class="comment">&lt;!-- ELSE --&gt;</span>
markup
<span class="comment">&lt;!-- ENDIF --&gt;</span>
</pre></blockquote>
<p>You are even able to check the number of items within a loop by comparing it with values within the IF condition:</p>
<blockquote><pre>
<span class="comment">&lt;!-- IF .loop > 2 --&gt;</span>
<span class="comment">&lt;!-- BEGIN loop --&gt;</span>
markup
<span class="comment">&lt;!-- END loop --&gt;</span>
<span class="comment">&lt;!-- ELSE --&gt;</span>
markup
<span class="comment">&lt;!-- ENDIF --&gt;</span>
</pre></blockquote>
<p>Nesting loops cause the conditionals needing prefixed with all loops from the outer one to the inner most. An illustration of this:</p>
<blockquote><pre>
<span class="comment">&lt;!-- BEGIN firstloop --&gt;</span>
{firstloop.MY_VARIABLE_FROM_FIRSTLOOP}
<span class="comment">&lt;!-- BEGIN secondloop --&gt;</span>
{firstloop.secondloop.MY_VARIABLE_FROM_SECONDLOOP}
<span class="comment">&lt;!-- END secondloop --&gt;</span>
<span class="comment">&lt;!-- END firstloop --&gt;</span>
</pre></blockquote>
<p>Sometimes it is necessary to break out of nested loops to be able to call another loop within the current iteration. This sounds a little bit confusing and it is not used very often. The following (rather complex) example shows this quite good - it also shows how you test for the first and last row in a loop (i will explain the example in detail further down):</p>
<blockquote><pre>
<span class="comment">&lt;!-- BEGIN l_block1 --&gt;</span>
<span class="comment">&lt;!-- IF l_block1.S_SELECTED --&gt;</span>
&lt;strong&gt;{l_block1.L_TITLE}&lt;/strong&gt;
<span class="comment">&lt;!-- IF S_PRIVMSGS --&gt;</span>
<span class="comment">&lt;!-- the ! at the beginning of the loop name forces the loop to be not a nested one of l_block1 --&gt;</span>
<span class="comment">&lt;!-- BEGIN !folder --&gt;</span>
<span class="comment">&lt;!-- IF folder.S_FIRST_ROW --&gt;</span>
&lt;ul class=&quot;nav&quot;&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
&lt;li&gt;&lt;a href=&quot;{folder.U_FOLDER}&quot;&gt;{folder.FOLDER_NAME}&lt;/a&gt;&lt;/li&gt;
<span class="comment">&lt;!-- IF folder.S_LAST_ROW --&gt;</span>
&lt;/ul&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
<span class="comment">&lt;!-- END !folder --&gt;</span>
<span class="comment">&lt;!-- ENDIF --&gt;</span>
&lt;ul class=&quot;nav&quot;&gt;
<span class="comment">&lt;!-- BEGIN l_block2 --&gt;</span>
&lt;li&gt;
<span class="comment">&lt;!-- IF l_block1.l_block2.S_SELECTED --&gt;</span>
&lt;strong&gt;{l_block1.l_block2.L_TITLE}&lt;/strong&gt;
<span class="comment">&lt;!-- ELSE --&gt;</span>
&lt;a href=&quot;{l_block1.l_block2.U_TITLE}&quot;&gt;{l_block1.l_block2.L_TITLE}&lt;/a&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
&lt;/li&gt;
<span class="comment">&lt;!-- END l_block2 --&gt;</span>
&lt;/ul&gt;
<span class="comment">&lt;!-- ELSE --&gt;</span>
&lt;a class=&quot;nav&quot; href=&quot;{l_block1.U_TITLE}&quot;&gt;{l_block1.L_TITLE}&lt;/a&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
<span class="comment">&lt;!-- END l_block1 --&gt;</span>
</pre></blockquote>
<p>Let us first concentrate on this part of the example:</p>
<blockquote><pre>
<span class="comment">&lt;!-- BEGIN l_block1 --&gt;</span>
<span class="comment">&lt;!-- IF l_block1.S_SELECTED --&gt;</span>
markup
<span class="comment">&lt;!-- ELSE --&gt;</span>
&lt;a class=&quot;nav&quot; href=&quot;{l_block1.U_TITLE}&quot;&gt;{l_block1.L_TITLE}&lt;/a&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
<span class="comment">&lt;!-- END l_block1 --&gt;</span>
</pre></blockquote>
<p>Here we open the loop l_block1 and doing some things if the value S_SELECTED within the current loop iteration is true, else we write the blocks link and title. Here, you see <code>{l_block1.L_TITLE}</code> referenced - you remember that L_* variables get automatically assigned the corresponding language entry? This is true, but not within loops. The L_TITLE variable within the loop l_block1 is assigned within the code itself.</p>
<p>Let's have a closer look to the markup:</p>
<blockquote><pre>
<span class="comment">&lt;!-- BEGIN l_block1 --&gt;</span>
.
.
<span class="comment">&lt;!-- IF S_PRIVMSGS --&gt;</span>
<span class="comment">&lt;!-- BEGIN !folder --&gt;</span>
<span class="comment">&lt;!-- IF folder.S_FIRST_ROW --&gt;</span>
&lt;ul class=&quot;nav&quot;&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
&lt;li&gt;&lt;a href=&quot;{folder.U_FOLDER}&quot;&gt;{folder.FOLDER_NAME}&lt;/a&gt;&lt;/li&gt;
<span class="comment">&lt;!-- IF folder.S_LAST_ROW --&gt;</span>
&lt;/ul&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
<span class="comment">&lt;!-- END !folder --&gt;</span>
<span class="comment">&lt;!-- ENDIF --&gt;</span>
.
.
<span class="comment">&lt;!-- END l_block1 --&gt;</span>
</pre></blockquote>
<p>The <code>&lt;!-- IF S_PRIVMSGS --&gt;</code> statement clearly checks a global variable and not one within the loop, since the loop is not given here. So, if S_PRIVMSGS is true we execute the shown markup. Now, you see the <code>&lt;!-- BEGIN !folder --&gt;</code> statement. The exclamation mark is responsible for instructing the template engine to iterate through the main loop folder. So, we are now within the loop folder - with <code>&lt;!-- BEGIN folder --&gt;</code> we would have been within the loop <code>l_block1.folder</code> automatically as is the case with l_block2:</p>
<blockquote><pre>
<span class="comment">&lt;!-- BEGIN l_block1 --&gt;</span>
.
.
&lt;ul class=&quot;nav&quot;&gt;
<span class="comment">&lt;!-- BEGIN l_block2 --&gt;</span>
&lt;li&gt;
<span class="comment">&lt;!-- IF l_block1.l_block2.S_SELECTED --&gt;</span>
&lt;strong&gt;{l_block1.l_block2.L_TITLE}&lt;/strong&gt;
<span class="comment">&lt;!-- ELSE --&gt;</span>
&lt;a href=&quot;{l_block1.l_block2.U_TITLE}&quot;&gt;{l_block1.l_block2.L_TITLE}&lt;/a&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
&lt;/li&gt;
<span class="comment">&lt;!-- END l_block2 --&gt;</span>
&lt;/ul&gt;
.
.
<span class="comment">&lt;!-- END l_block1 --&gt;</span>
</pre></blockquote>
<p>You see the difference? The loop l_block2 is a member of the loop l_block1 but the loop folder is a main loop.</p>
<p>Now back to our folder loop:</p>
<blockquote><pre>
<span class="comment">&lt;!-- IF folder.S_FIRST_ROW --&gt;</span>
&lt;ul class=&quot;nav&quot;&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
&lt;li&gt;&lt;a href=&quot;{folder.U_FOLDER}&quot;&gt;{folder.FOLDER_NAME}&lt;/a&gt;&lt;/li&gt;
<span class="comment">&lt;!-- IF folder.S_LAST_ROW --&gt;</span>
&lt;/ul&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
</pre></blockquote>
<p>You may have wondered what the comparison to S_FIRST_ROW and S_LAST_ROW is about. If you haven't guessed already - it is checking for the first iteration of the loop with <code>S_FIRST_ROW</code> and the last iteration with <code>S_LAST_ROW</code>. This can come in handy quite often if you want to open or close design elements, like the above list. Let us imagine a folder loop build with three iterations, it would go this way:</p>
<blockquote><pre>
&lt;ul class=&quot;nav&quot;&gt; <span class="comment">&lt;!-- written on first iteration --&gt;</span>
&lt;li&gt;first element&lt;/li&gt; <span class="comment">&lt;!-- written on first iteration --&gt;</span>
&lt;li&gt;second element&lt;/li&gt; <span class="comment">&lt;!-- written on second iteration --&gt;</span>
&lt;li&gt;third element&lt;/li&gt; <span class="comment">&lt;!-- written on third iteration --&gt;</span>
&lt;/ul&gt; <span class="comment">&lt;!-- written on third iteration --&gt;</span>
</pre></blockquote>
<p>As you can see, all three elements are written down as well as the markup for the first iteration and the last one. Sometimes you want to omit writing the general markup - for example:</p>
<blockquote><pre>
<span class="comment">&lt;!-- IF folder.S_FIRST_ROW --&gt;</span>
&lt;ul class=&quot;nav&quot;&gt;
<span class="comment">&lt;!-- ELSEIF folder.S_LAST_ROW --&gt;</span>
&lt;/ul&gt;
<span class="comment">&lt;!-- ELSE --&gt;</span>
&lt;li&gt;&lt;a href=&quot;{folder.U_FOLDER}&quot;&gt;{folder.FOLDER_NAME}&lt;/a&gt;&lt;/li&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
</pre></blockquote>
<p>would result in the following markup:</p>
<blockquote><pre>
&lt;ul class=&quot;nav&quot;&gt; <span class="comment">&lt;!-- written on first iteration --&gt;</span>
&lt;li&gt;second element&lt;/li&gt; <span class="comment">&lt;!-- written on second iteration --&gt;</span>
&lt;/ul&gt; <span class="comment">&lt;!-- written on third iteration --&gt;</span>
</pre></blockquote>
<p>Just always remember that processing is taking place from up to down.</p>
</div>
<a href="#top">Top</a>
<br /><br />
@@ -1171,6 +1518,17 @@ markup
<a name="changes"></a><h1>5. Guidelines Changelog</h1>
<div class="paragraph">
<h2>Revision 1.8</h2>
<ul class="menu">
<li>Some adjustements to wordings</li>
<li>Updated paragraph <a href="#locations">1.iii. File Locations</a> to reflect recent changes</li>
<li>Extended paragraph <a href="#codelayout">2.ii. Code Layout</a>.</li>
<li>Added sql_in_set and sql_build_query explanation to <a href="#sql">2.iii. SQL/SQL Layout</a>.</li>
<li>Updated paragraph <a href="#styling">3. Styling</a>.</li>
<li>Updated paragraph <a href="#templating">4. Templating</a> to explain loop checking, loop breaking and other changes we recently made.</li>
</ul>
<h2>Revision 1.5</h2>
<ul class="menu">

View File

@@ -17,12 +17,10 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
$download_id = request_var('id', 0);
// Thumbnails are not handled by this file by default - but for modders this should be interesting. ;)
$thumbnail = request_var('t', false);
// Start session management
$user->session_begin();
// Start session management, do not update session page.
$user->session_begin(false);
$auth->acl($user->data);
$user->setup('viewtopic');
@@ -36,7 +34,7 @@ if (!$config['allow_attachments'] && !$config['allow_pm_attach'])
trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED');
}
$sql = 'SELECT attach_id, in_message, post_msg_id, extension
$sql = 'SELECT attach_id, in_message, post_msg_id, extension, is_orphan, poster_id
FROM ' . ATTACHMENTS_TABLE . "
WHERE attach_id = $download_id";
$result = $db->sql_query_limit($sql, 1);
@@ -54,44 +52,73 @@ if ((!$attachment['in_message'] && !$config['allow_attachments']) || ($attachmen
}
$row = array();
if (!$attachment['in_message'])
{
//
$sql = 'SELECT p.forum_id, f.forum_password, f.parent_id
FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f
WHERE p.post_id = ' . $attachment['post_msg_id'] . '
AND p.forum_id = f.forum_id';
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']))
if ($attachment['is_orphan'])
{
// We allow admins having attachment permissions to see orphan attachments...
$own_attachment = ($auth->acl_get('a_attach') || $attachment['poster_id'] == $user->data['user_id']) ? true : false;
if (!$own_attachment || ($attachment['in_message'] && !$auth->acl_get('u_pm_download')) || (!$attachment['in_message'] && !$auth->acl_get('u_download')))
{
if ($row['forum_password'])
trigger_error('ERROR_NO_ATTACHMENT');
}
$extensions = $cache->obtain_attach_extensions();
}
else
{
if (!$attachment['in_message'])
{
//
$sql = 'SELECT p.forum_id, f.forum_password, f.parent_id
FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f
WHERE p.post_id = ' . $attachment['post_msg_id'] . '
AND p.forum_id = f.forum_id';
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// Global announcement?
if (!$row)
{
// Do something else ... ?
login_forum_box($row);
$forum_id = request_var('f', 0);
$sql = 'SELECT forum_id, forum_password, parent_id
FROM ' . FORUMS_TABLE . '
WHERE forum_id = ' . $forum_id;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
}
if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']))
{
if ($row['forum_password'])
{
// Do something else ... ?
login_forum_box($row);
}
}
else
{
trigger_error('SORRY_AUTH_VIEW_ATTACH');
}
}
else
{
trigger_error('SORRY_AUTH_VIEW_ATTACH');
$row['forum_id'] = 0;
if (!$auth->acl_get('u_pm_download'))
{
trigger_error('SORRY_AUTH_VIEW_ATTACH');
}
}
}
else
{
$row['forum_id'] = 0;
if (!$auth->acl_get('u_pm_download') || !$config['auth_download_pm'])
{
trigger_error('SORRY_AUTH_VIEW_ATTACH');
}
}
// disallowed ?
$extensions = array();
if (!extension_allowed($row['forum_id'], $attachment['extension'], $extensions))
{
trigger_error(sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension']));
// disallowed ?
$extensions = array();
if (!extension_allowed($row['forum_id'], $attachment['extension'], $extensions))
{
trigger_error(sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension']));
}
}
if (!download_allowed())
@@ -102,7 +129,7 @@ if (!download_allowed())
$download_mode = (int) $extensions[$attachment['extension']]['download_mode'];
// Fetching filename here to prevent sniffing of filename
$sql = 'SELECT attach_id, in_message, post_msg_id, extension, physical_filename, real_filename, mimetype
$sql = 'SELECT attach_id, is_orphan, in_message, post_msg_id, extension, physical_filename, real_filename, mimetype
FROM ' . ATTACHMENTS_TABLE . "
WHERE attach_id = $download_id";
$result = $db->sql_query_limit($sql, 1);
@@ -114,14 +141,14 @@ if (!$attachment)
trigger_error('ERROR_NO_ATTACHMENT');
}
$attachment['physical_filename'] = basename($attachment['physical_filename']);
$display_cat = $extensions[$attachment['extension']]['display_cat'];
if ($thumbnail)
{
$attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename'];
}
else
else if (($display_cat == ATTACHMENT_CATEGORY_NONE || $display_cat == ATTACHMENT_CATEGORY_IMAGE) && !$attachment['is_orphan'])
{
// Update download count
$sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
@@ -162,88 +189,86 @@ function send_file_to_browser($attachment, $upload_dir, $category)
trigger_error($user->lang['ERROR_NO_ATTACHMENT'] . '<br /><br />' . sprintf($user->lang['FILE_NOT_FOUND_404'], $filename));
}
// Determine the Browser the User is using, because of some nasty incompatibilities.
// borrowed from phpMyAdmin. :)
$user_agent = $user->browser;
if (ereg('Opera(/| )([0-9].[0-9]{1,2})', $user_agent, $log_version))
{
$browser_version = $log_version[2];
$browser_agent = 'opera';
}
else if (ereg('MSIE ([0-9].[0-9]{1,2})', $user_agent, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'ie';
}
else if (ereg('OmniWeb/([0-9].[0-9]{1,2})', $user_agent, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'omniweb';
}
else if (ereg('(Konqueror/)(.*)(;)', $user_agent, $log_version))
{
$browser_version = $log_version[2];
$browser_agent = 'konqueror';
}
else if (ereg('Mozilla/([0-9].[0-9]{1,2})', $user_agent, $log_version) && ereg('Safari/([0-9]*)', $user_agent, $log_version2))
{
$browser_version = $log_version[1] . '.' . $log_version2[1];
$browser_agent = 'safari';
}
else if (ereg('Mozilla/([0-9].[0-9]{1,2})', $user_agent, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'mozilla';
}
else
{
$browser_version = 0;
$browser_agent = 'other';
}
// Correct the mime type - we force application/octetstream for all files, except images
// Please do not change this, it is a security precaution
if ($category == ATTACHMENT_CATEGORY_NONE && strpos($attachment['mimetype'], 'image') === false)
if (strpos($attachment['mimetype'], 'image') !== 0)
{
$attachment['mimetype'] = ($browser_agent == 'ie' || $browser_agent == 'opera') ? 'application/octetstream' : 'application/octet-stream';
$attachment['mimetype'] = (strpos(strtolower($user->browser), 'msie') !== false || strpos(strtolower($user->browser), 'opera') !== false) ? 'application/octetstream' : 'application/octet-stream';
}
if (@ob_get_length())
{
@ob_end_clean();
}
// Now the tricky part... let's dance
header('Pragma: public');
// Send out the Headers
header('Content-Type: ' . $attachment['mimetype'] . '; name="' . $attachment['real_filename'] . '"');
header('Content-Disposition: inline; filename="' . $attachment['real_filename'] . '"');
// Now send the File Contents to the Browser
$size = @filesize($filename);
if ($size)
{
header("Content-length: $size");
}
$result = @readfile($filename);
if (!$result)
// To correctly display further errors we need to make sure we are using the correct headers for both (unsetting content-length may not work)
// Check if headers already sent or not able to get the file contents.
if (headers_sent() || !@file_exists($filename) || !@is_readable($filename))
{
// PHP track_errors setting On?
if (!empty($php_errormsg))
{
trigger_error('Unable to deliver file.<br />Error was: ' . $php_errormsg, E_USER_ERROR);
trigger_error($user->lang['UNABLE_TO_DELIVER_FILE'] . '<br />' . sprintf($user->lang['TRACKED_PHP_ERROR'], $php_errormsg));
}
trigger_error('Unable to deliver file.', E_USER_ERROR);
trigger_error('UNABLE_TO_DELIVER_FILE');
}
// Now the tricky part... let's dance
header('Pragma: public');
/**
* Commented out X-Sendfile support. To not expose the physical filename within the header if xsendfile is absent we need to look into methods of checking it's status.
*
* Try X-Sendfile since it is much more server friendly - only works if the path is *not* outside of the root path...
* lighttpd has core support for it. An apache2 module is available at http://celebnamer.celebworld.ws/stuff/mod_xsendfile/
*
* Not really ideal, but should work fine...
* <code>
* if (strpos($upload_dir, '/') !== 0 && strpos($upload_dir, '../') === false)
* {
* header('X-Sendfile: ' . $filename);
* }
* </code>
*/
// Send out the Headers. Do not set Content-Disposition to inline please, it is a security measure for users using the Internet Explorer.
header('Content-Type: ' . $attachment['mimetype']);
header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename($attachment['real_filename']));
if ($size)
{
header("Content-Length: $size");
}
// Might not be ideal to store the contents, but file_get_contents is binary-safe as well as the recommended method
echo @file_get_contents($filename);
flush();
exit;
}
/*
* Get a browser friendly UTF-8 encoded filename
*/
function header_filename($file)
{
// There be dragons here...
// IE follows no RFC, follow the RFC for extended filename for the rest
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)
{
return "filename=" . rawurlencode($file);
}
else
{
return "filename*=UTF-8''" . rawurlencode($file);
}
}
/**
* Check if downloading item is allowed
*/
@@ -256,7 +281,7 @@ function download_allowed()
return true;
}
$url = (getenv('HTTP_REFERER')) ? trim(getenv('HTTP_REFERER')) : trim($_SERVER['HTTP_REFERER']);
$url = (!empty($_SERVER['HTTP_REFERER'])) ? trim($_SERVER['HTTP_REFERER']) : trim(getenv('HTTP_REFERER'));
if (!$url)
{
@@ -264,20 +289,27 @@ function download_allowed()
}
// Split URL into domain and script part
$url = explode('?', str_replace(array('http://', 'https://'), array('', ''), $url));
$hostname = trim($url[0]);
$url = @parse_url($url);
if ($url === false)
{
return ($config['secure_allow_empty_referer']) ? true : false;
}
$hostname = $url['host'];
unset($url);
$allowed = ($config['secure_allow_deny']) ? false : true;
$iplist = array();
$ip_ary = gethostbynamel($hostname);
foreach ($ip_ary as $ip)
if (($ip_ary = @gethostbynamel($hostname)) !== false)
{
if ($ip)
foreach ($ip_ary as $ip)
{
$iplist[] = $ip;
if ($ip)
{
$iplist[] = $ip;
}
}
}
@@ -311,7 +343,7 @@ function download_allowed()
{
foreach ($iplist as $ip)
{
if (preg_match('#^' . str_replace('*', '.*?', $site_ip) . '$#i', $ip))
if (preg_match('#^' . str_replace('*', '.*?', preg_quote($site_ip, '#')) . '$#i', $ip))
{
if ($row['ip_exclude'])
{
@@ -328,7 +360,7 @@ function download_allowed()
if ($site_hostname)
{
if (preg_match('#^' . str_replace('*', '.*?', $site_hostname) . '$#i', $hostname))
if (preg_match('#^' . str_replace('*', '.*?', preg_quote($site_hostname, '#')) . '$#i', $hostname))
{
if ($row['ip_exclude'])
{

View File

@@ -0,0 +1,10 @@
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
</body>
</html>

View File

@@ -19,6 +19,7 @@ class acm
var $is_modified = false;
var $sql_rowset = array();
var $sql_row_pointer = array();
/**
* Set cache path
@@ -56,6 +57,7 @@ class acm
unset($this->vars);
unset($this->var_expires);
unset($this->sql_rowset);
unset($this->sql_row_pointer);
}
/**
@@ -69,7 +71,7 @@ class acm
}
global $phpEx;
$file = '<?php $this->vars=' . $this->format_array($this->vars) . ";\n\$this->var_expires=" . $this->format_array($this->var_expires) . ' ?>';
$file = "<?php\n\$this->vars = " . $this->format_array($this->vars) . ";\n\n\$this->var_expires = " . $this->format_array($this->var_expires) . "\n?>";
if ($fp = @fopen($this->cache_dir . 'data_global.' . $phpEx, 'wb'))
{
@@ -78,6 +80,16 @@ class acm
@flock($fp, LOCK_UN);
fclose($fp);
}
else
{
// Now, this occurred how often? ... phew, just tell the user then...
if (!@is_writeable($this->cache_dir))
{
trigger_error($this->cache_dir . ' is NOT writeable.', E_USER_ERROR);
}
trigger_error('Not able to open ' . $this->cache_dir . 'data_global.' . $phpEx, E_USER_ERROR);
}
$this->is_modified = false;
}
@@ -130,7 +142,7 @@ class acm
*/
function get($var_name)
{
if ($var_name{0} == '_')
if ($var_name[0] == '_')
{
global $phpEx;
@@ -153,7 +165,7 @@ class acm
*/
function put($var_name, $var, $ttl = 31536000)
{
if ($var_name{0} == '_')
if ($var_name[0] == '_')
{
global $phpEx;
@@ -173,6 +185,32 @@ class acm
}
}
/**
* Purge cache data
*/
function purge()
{
// Purge all phpbb cache files
$dir = opendir($this->cache_dir);
while (($entry = readdir($dir)) !== false)
{
if (strpos($entry, 'sql_') !== 0 && strpos($entry, 'data_') !== 0 && strpos($entry, 'ctpl_') !== 0 && strpos($entry, 'tpl_') !== 0)
{
continue;
}
@unlink($this->cache_dir . $entry);
}
@closedir($dir);
unset($this->vars);
unset($this->var_expires);
unset($this->sql_rowset);
unset($this->sql_row_pointer);
$this->is_modified = false;
}
/**
* Destroy cache data
*/
@@ -211,7 +249,7 @@ class acm
return;
}
if ($var_name{0} == '_')
if ($var_name[0] == '_')
{
@unlink($this->cache_dir . 'data' . $var_name . ".$phpEx");
}
@@ -231,7 +269,7 @@ class acm
*/
function _exists($var_name)
{
if ($var_name{0} == '_')
if ($var_name[0] == '_')
{
global $phpEx;
return file_exists($this->cache_dir . 'data' . $var_name . ".$phpEx");
@@ -255,26 +293,28 @@ class acm
/**
* Format an array to be stored on filesystem
*/
function format_array($array)
function format_array($array, $tab = '')
{
$tab .= "\t";
$lines = array();
foreach ($array as $k => $v)
{
if (is_array($v))
{
$lines[] = "\n'$k' => " . $this->format_array($v);
$lines[] = "\n{$tab}'$k' => " . $this->format_array($v, $tab);
}
else if (is_int($v))
{
$lines[] = "\n'$k' => $v";
$lines[] = "\n{$tab}'$k' => $v";
}
else if (is_bool($v))
{
$lines[] = "\n'$k' => " . (($v) ? 'true' : 'false');
$lines[] = "\n{$tab}'$k' => " . (($v) ? 'true' : 'false');
}
else
{
$lines[] = "\n'$k' => '" . str_replace("'", "\\'", str_replace('\\', '\\\\', $v)) . "'";
$lines[] = "\n{$tab}'$k' => '" . str_replace("'", "\\'", str_replace('\\', '\\\\', $v)) . "'";
}
}
@@ -309,6 +349,8 @@ class acm
return false;
}
$this->sql_row_pointer[$query_id] = 0;
return $query_id;
}
@@ -329,6 +371,7 @@ class acm
$lines = array();
$query_id = sizeof($this->sql_rowset);
$this->sql_rowset[$query_id] = array();
$this->sql_row_pointer[$query_id] = 0;
while ($row = $db->sql_fetchrow($query_result))
{
@@ -338,7 +381,7 @@ class acm
}
$db->sql_freeresult($query_result);
fwrite($fp, "<?php\n\n/*\n$query\n*/\n\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$this->sql_rowset[\$query_id] = array(" . implode(',', $lines) . ') ?>');
fwrite($fp, "<?php\n\n/*\n" . str_replace('*/', '*\/', $query) . "\n*/\n\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$this->sql_rowset[\$query_id] = array(" . implode(',', $lines) . ') ?>');
@flock($fp, LOCK_UN);
fclose($fp);
@@ -359,7 +402,55 @@ class acm
*/
function sql_fetchrow($query_id)
{
return array_shift($this->sql_rowset[$query_id]);
if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id]))
{
return $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++];
}
return false;
}
/**
* Fetch a field from the current row of a cached database result (database)
*/
function sql_fetchfield($query_id, $field)
{
if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id]))
{
return (isset($this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field])) ? $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field] : false;
}
return false;
}
/**
* Seek a specific row in an a cached database result (database)
*/
function sql_rowseek($rownum, $query_id)
{
if ($rownum >= sizeof($this->sql_rowset[$query_id]))
{
return false;
}
$this->sql_row_pointer[$query_id] = $rownum;
return true;
}
/**
* Free memory used for a cached database result (database)
*/
function sql_freeresult($query_id)
{
if (!isset($this->sql_rowset[$query_id]))
{
return false;
}
unset($this->sql_rowset[$query_id]);
unset($this->sql_row_pointer[$query_id]);
return true;
}
}

View File

@@ -46,7 +46,8 @@ class acp_attachments
break;
default:
trigger_error('NO_MODE');
trigger_error('NO_MODE', E_USER_ERROR);
break;
}
$this->tpl_name = 'acp_attachments';
@@ -78,7 +79,7 @@ class acp_attachments
}
$db->sql_freeresult($result);
$l_legend_cat_images = $user->lang['SETTINGS_CAT_IMAGES'] . ' [' . $user->lang['ASSIGNED_GROUP'] . ': ' . ((sizeof($s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE])) ? implode(', ', $s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE]) : $user->lang['NONE']) . ']';
$l_legend_cat_images = $user->lang['SETTINGS_CAT_IMAGES'] . ' [' . $user->lang['ASSIGNED_GROUP'] . ': ' . ((sizeof($s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE])) ? implode(', ', $s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE]) : $user->lang['NO_EXT_GROUP']) . ']';
$display_vars = array(
'title' => 'ACP_ATTACHMENT_SETTINGS',
@@ -86,31 +87,42 @@ class acp_attachments
'img_max_width' => false, 'img_max_height' => false, 'img_link_width' => false, 'img_link_height' => false,
'legend1' => 'ACP_ATTACHMENT_SETTINGS',
'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false),
'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false),
'upload_path' => array('lang' => 'UPLOAD_DIR', 'type' => 'text:25:100', 'explain' => true),
'display_order' => array('lang' => 'DISPLAY_ORDER', 'type' => 'custom', 'method' => 'display_order', 'explain' => true),
'attachment_quota' => array('lang' => 'ATTACH_QUOTA', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true),
'max_filesize' => array('lang' => 'ATTACH_MAX_FILESIZE', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true),
'max_filesize_pm' => array('lang' => 'ATTACH_MAX_PM_FILESIZE','type' => 'custom', 'method' => 'max_filesize', 'explain' => true),
'max_attachments' => array('lang' => 'MAX_ATTACHMENTS', 'type' => 'text:3:3', 'explain' => false),
'max_attachments_pm' => array('lang' => 'MAX_ATTACHMENTS_PM', 'type' => 'text:3:3', 'explain' => false),
'secure_downloads' => array('lang' => 'SECURE_DOWNLOADS', 'type' => 'radio:yes_no', 'explain' => true),
'secure_allow_deny' => array('lang' => 'SECURE_ALLOW_DENY', 'type' => 'custom', 'method' => 'select_allow_deny', 'explain' => true),
'secure_allow_empty_referer' => array('lang' => 'SECURE_EMPTY_REFERER', 'type' => 'radio:yes_no', 'explain' => true),
'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'upload_path' => array('lang' => 'UPLOAD_DIR', 'validate' => 'wpath', 'type' => 'text:25:100', 'explain' => true),
'display_order' => array('lang' => 'DISPLAY_ORDER', 'validate' => 'bool', 'type' => 'custom', 'method' => 'display_order', 'explain' => true),
'attachment_quota' => array('lang' => 'ATTACH_QUOTA', 'validate' => 'int', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true),
'max_filesize' => array('lang' => 'ATTACH_MAX_FILESIZE', 'validate' => 'int', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true),
'max_filesize_pm' => array('lang' => 'ATTACH_MAX_PM_FILESIZE','validate' => 'int', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true),
'max_attachments' => array('lang' => 'MAX_ATTACHMENTS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => false),
'max_attachments_pm' => array('lang' => 'MAX_ATTACHMENTS_PM', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => false),
'secure_downloads' => array('lang' => 'SECURE_DOWNLOADS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'secure_allow_deny' => array('lang' => 'SECURE_ALLOW_DENY', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_allow_deny', 'explain' => true),
'secure_allow_empty_referer' => array('lang' => 'SECURE_EMPTY_REFERRER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend2' => $l_legend_cat_images,
'img_display_inlined' => array('lang' => 'DISPLAY_INLINED', 'type' => 'radio:yes_no', 'explain' => true),
'img_create_thumbnail' => array('lang' => 'CREATE_THUMBNAIL', 'type' => 'radio:yes_no', 'explain' => true),
'img_min_thumb_filesize' => array('lang' => 'MIN_THUMB_FILESIZE', 'type' => 'text:7:15', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
'img_imagick' => array('lang' => 'IMAGICK_PATH', 'type' => 'text:20:200', 'explain' => true, 'append' => '&nbsp;&nbsp;<span>[ <a href="' . $this->u_action . '&amp;action=imgmagick">' . $user->lang['SEARCH_IMAGICK'] . '</a> ]</span>'),
'img_max' => array('lang' => 'MAX_IMAGE_SIZE', 'type' => 'dimension:3:4', 'explain' => true),
'img_link' => array('lang' => 'IMAGE_LINK_SIZE', 'type' => 'dimension:3:4', 'explain' => true),
'img_display_inlined' => array('lang' => 'DISPLAY_INLINED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'img_create_thumbnail' => array('lang' => 'CREATE_THUMBNAIL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'img_max_thumb_width' => array('lang' => 'MAX_THUMB_WIDTH', 'validate' => 'int', 'type' => 'text:7:15', 'explain' => true, 'append' => ' px'),
'img_min_thumb_filesize' => array('lang' => 'MIN_THUMB_FILESIZE', 'validate' => 'int', 'type' => 'text:7:15', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
'img_imagick' => array('lang' => 'IMAGICK_PATH', 'validate' => 'string', 'type' => 'text:20:200', 'explain' => true, 'append' => '&nbsp;&nbsp;<span>[ <a href="' . $this->u_action . '&amp;action=imgmagick">' . $user->lang['SEARCH_IMAGICK'] . '</a> ]</span>'),
'img_max' => array('lang' => 'MAX_IMAGE_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true),
'img_link' => array('lang' => 'IMAGE_LINK_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true),
)
);
$this->new_config = $config;
$cfg_array = (isset($_REQUEST['config'])) ? request_var('config', array('' => '')) : $this->new_config;
$error = array();
// We validate the complete config if whished
validate_config_vars($display_vars['vars'], $cfg_array, $error);
// Do not write values if there is an error
if (sizeof($error))
{
$submit = false;
}
// 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)
@@ -197,7 +209,9 @@ class acp_attachments
$template->assign_vars(array(
'S_SECURE_DOWNLOADS' => $this->new_config['secure_downloads'],
'S_DEFINED_IPS' => ($defined_ips != '') ? true : false,
'S_WARNING' => (sizeof($error)) ? true : false,
'WARNING_MSG' => implode('<br />', $error),
'DEFINED_IPS' => $defined_ips,
'L_SECURE_TITLE' => $user->lang['DEFINE_' . $allow_deny . '_IPS'],
@@ -294,7 +308,7 @@ class acp_attachments
{
$sql = 'SELECT extension
FROM ' . EXTENSIONS_TABLE . '
WHERE extension_id IN (' . implode(', ', $extension_id_list) . ')';
WHERE ' . $db->sql_in_set('extension_id', $extension_id_list);
$result = $db->sql_query($sql);
$extension_list = '';
@@ -306,7 +320,7 @@ class acp_attachments
$sql = 'DELETE
FROM ' . EXTENSIONS_TABLE . '
WHERE extension_id IN (' . implode(', ', $extension_id_list) . ')';
WHERE ' . $db->sql_in_set('extension_id', $extension_id_list);
$db->sql_query($sql);
add_log('admin', 'LOG_ATTACH_EXT_DEL', $extension_list);
@@ -403,12 +417,12 @@ class acp_attachments
if ($action != 'add' && $action != 'edit')
{
trigger_error('WRONG_MODE');
trigger_error('NO_MODE', E_USER_ERROR);
}
if (!$group_id && $action == 'edit')
{
trigger_error('NO_EXT_GROUP_SPECIFIED');
trigger_error($user->lang['NO_EXT_GROUP_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if ($group_id)
@@ -437,7 +451,7 @@ class acp_attachments
{
$sql = 'SELECT group_id
FROM ' . EXTENSION_GROUPS_TABLE . "
WHERE LOWER(group_name) = '" . $db->sql_escape(strtolower($new_group_name)) . "'";
WHERE LOWER(group_name) = '" . $db->sql_escape(utf8_strtolower($new_group_name)) . "'";
$result = $db->sql_query($sql);
if ($db->sql_fetchrow($result))
@@ -508,7 +522,7 @@ class acp_attachments
{
$sql = 'UPDATE ' . EXTENSIONS_TABLE . "
SET group_id = $group_id
WHERE extension_id IN (" . implode(', ', $extension_list) . ")";
WHERE " . $db->sql_in_set('extension_id', $extension_list);
$db->sql_query($sql);
}
@@ -521,15 +535,16 @@ class acp_attachments
}
$cat_lang = array(
ATTACHMENT_CATEGORY_NONE => $user->lang['NONE'],
ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'],
ATTACHMENT_CATEGORY_WM => $user->lang['CAT_WM_FILES'],
ATTACHMENT_CATEGORY_RM => $user->lang['CAT_RM_FILES']
ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'],
ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'],
ATTACHMENT_CATEGORY_WM => $user->lang['CAT_WM_FILES'],
ATTACHMENT_CATEGORY_RM => $user->lang['CAT_RM_FILES'],
ATTACHMENT_CATEGORY_FLASH => $user->lang['CAT_FLASH_FILES'],
ATTACHMENT_CATEGORY_QUICKTIME => $user->lang['CAT_QUICKTIME_FILES'],
);
$group_id = request_var('g', 0);
$action = (isset($_POST['add'])) ? 'add' : $action;
// $action = (($action == 'add' || $action == 'edit') && $submit && !sizeof($error)) ? 'show' : $action;
switch ($action)
{
@@ -578,7 +593,7 @@ class acp_attachments
if (!$group_id)
{
trigger_error($user->lang['NO_EXTENSION_GROUP'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_EXT_GROUP_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT *
@@ -631,25 +646,30 @@ class acp_attachments
$img_path = $config['upload_icons_path'];
$imglist = filelist($phpbb_root_path . $img_path);
$imglist = array_values($imglist);
$imglist = $imglist[0];
$filename_list = '';
$no_image_select = false;
foreach ($imglist as $key => $img)
{
if (!$ext_group_row['upload_icon'])
{
$no_image_select = true;
$selected = '';
}
else
{
$selected = ($ext_group_row['upload_icon'] == $img) ? ' selected="selected"' : '';
}
$filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . htmlspecialchars($img) . '</option>';
$imglist = filelist($phpbb_root_path . $img_path);
if (sizeof($imglist))
{
$imglist = array_values($imglist);
$imglist = $imglist[0];
foreach ($imglist as $key => $img)
{
if (!$ext_group_row['upload_icon'])
{
$no_image_select = true;
$selected = '';
}
else
{
$selected = ($ext_group_row['upload_icon'] == $img) ? ' selected="selected"' : '';
}
$filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . htmlspecialchars($img) . '</option>';
}
}
$i = 0;
@@ -701,7 +721,7 @@ class acp_attachments
$sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id
FROM ' . FORUMS_TABLE . '
ORDER BY left_id ASC';
$result = $db->sql_query($sql);
$result = $db->sql_query($sql, 600);
$right = $cat_right = $padding_inc = 0;
$padding = $forum_list = $holding = '';
@@ -765,7 +785,7 @@ class acp_attachments
if (!$group_id)
{
trigger_error($user->lang['NO_EXTENSION_GROUP'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_EXT_GROUP_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . '
@@ -818,24 +838,45 @@ class acp_attachments
$add_files = (isset($_POST['add'])) ? array_keys(request_var('add', array('' => 0))) : array();
$post_ids = request_var('post_id', array('' => 0));
foreach ($delete_files as $delete)
if (sizeof($delete_files))
{
phpbb_unlink($delete);
phpbb_unlink($delete, 'thumbnail');
$sql = 'SELECT *
FROM ' . ATTACHMENTS_TABLE . '
WHERE ' . $db->sql_in_set('attach_id', $delete_files) . '
AND is_orphan = 1';
$result = $db->sql_query($sql);
$delete_files = array();
while ($row = $db->sql_fetchrow($result))
{
phpbb_unlink($row['physical_filename']);
if ($row['thumbnail'])
{
phpbb_unlink($row['physical_filename'], 'thumbnail');
}
$delete_files[$row['attach_id']] = $row['real_filename'];
}
$db->sql_freeresult($result);
}
if (sizeof($delete_files))
{
$sql = 'DELETE FROM ' . ATTACHMENTS_TABLE . '
WHERE ' . $db->sql_in_set('attach_id', array_keys($delete_files));
$db->sql_query($sql);
add_log('admin', 'LOG_ATTACH_ORPHAN_DEL', implode(', ', $delete_files));
$notify[] = sprintf($user->lang['LOG_ATTACH_ORPHAN_DEL'], implode(', ', $delete_files));
}
$upload_list = array();
foreach ($add_files as $file)
foreach ($add_files as $attach_id)
{
if (!in_array($file, $delete_files) && $post_ids[$file])
if (!in_array($attach_id, array_keys($delete_files)) && !empty($post_ids[$attach_id]))
{
$upload_list[$post_ids[$file]] = $file;
$upload_list[$attach_id] = $post_ids[$attach_id];
}
}
unset($add_files);
@@ -844,13 +885,10 @@ class acp_attachments
{
$template->assign_var('S_UPLOADING_FILES', true);
include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx);
$message_parser = new parse_message();
$sql = 'SELECT forum_id, forum_name
FROM ' . FORUMS_TABLE;
$result = $db->sql_query($sql);
$forum_names = array();
while ($row = $db->sql_fetchrow($result))
{
@@ -858,30 +896,67 @@ class acp_attachments
}
$db->sql_freeresult($result);
$sql = 'SELECT forum_id, topic_id, post_id
$sql = 'SELECT forum_id, topic_id, post_id, poster_id
FROM ' . POSTS_TABLE . '
WHERE post_id IN (' . implode(', ', array_keys($upload_list)) . ')';
WHERE ' . $db->sql_in_set('post_id', $upload_list);
$result = $db->sql_query($sql);
$post_info = array();
while ($row = $db->sql_fetchrow($result))
{
$post_info[$row['post_id']] = $row;
}
$db->sql_freeresult($result);
// Select those attachments we want to change...
$sql = 'SELECT *
FROM ' . ATTACHMENTS_TABLE . '
WHERE ' . $db->sql_in_set('attach_id', array_keys($upload_list)) . '
AND is_orphan = 1';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$return = true;
if ($auth->acl_get('f_attach', $row['forum_id']))
{
$return = $this->upload_file($row['post_id'], $row['topic_id'], $row['forum_id'], $config['upload_path'], $upload_list[$row['post_id']]);
}
$post_row = $post_info[$upload_list[$row['attach_id']]];
$template->assign_block_vars('upload', array(
'FILE_INFO' => sprintf($user->lang['UPLOADING_FILE_TO'], $upload_list[$row['post_id']], $row['post_id']),
'S_DENIED' => (!$auth->acl_get('f_attach', $row['forum_id'])) ? true : false,
'L_DENIED' => (!$auth->acl_get('f_attach', $row['forum_id'])) ? sprintf($user->lang['UPLOAD_DENIED_FORUM'], $forum_names[$row['forum_id']]) : '',
'ERROR_MSG' => ($return === true) ? false : $return)
'FILE_INFO' => sprintf($user->lang['UPLOADING_FILE_TO'], $row['real_filename'], $post_row['post_id']),
'S_DENIED' => (!$auth->acl_get('f_attach', $post_row['forum_id'])) ? true : false,
'L_DENIED' => (!$auth->acl_get('f_attach', $post_row['forum_id'])) ? sprintf($user->lang['UPLOAD_DENIED_FORUM'], $forum_names[$row['forum_id']]) : '')
);
if (!$auth->acl_get('f_attach', $post_row['forum_id']))
{
continue;
}
// Adjust attachment entry
$sql_ary = array(
'in_message' => 0,
'is_orphan' => 0,
'poster_id' => $post_row['poster_id'],
'post_msg_id' => $post_row['post_id'],
'topic_id' => $post_row['topic_id'],
);
$sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE attach_id = ' . $row['attach_id'];
$db->sql_query($sql);
$sql = 'UPDATE ' . POSTS_TABLE . '
SET post_attachment = 1
WHERE post_id = ' . $post_row['post_id'];
$db->sql_query($sql);
$sql = 'UPDATE ' . TOPICS_TABLE . '
SET topic_attachment = 1
WHERE topic_id = ' . $post_row['topic_id'];
$db->sql_query($sql);
add_log('admin', 'LOG_ATTACH_FILEUPLOAD', $post_row['post_id'], $row['real_filename']);
}
$db->sql_freeresult($result);
unset($message_parser);
}
}
@@ -889,43 +964,31 @@ class acp_attachments
'S_ORPHAN' => true)
);
$attach_filelist = array();
$dir = @opendir($phpbb_root_path . $config['upload_path']);
while (($file = @readdir($dir)) !== false)
{
if (is_file($phpbb_root_path . $config['upload_path'] . '/' . $file) && filesize($phpbb_root_path . $config['upload_path'] . '/' . $file) && $file{0} != '.' && $file != 'index.htm' && !preg_match('#^thumb\_#', $file))
{
$attach_filelist[$file] = $file;
}
}
@closedir($dir);
$sql = 'SELECT physical_filename
FROM ' . ATTACHMENTS_TABLE;
// Just get the files with is_orphan set and older than 3 hours
$sql = 'SELECT *
FROM ' . ATTACHMENTS_TABLE . '
WHERE is_orphan = 1
AND filetime < ' . (time() - 3*60*60) . '
ORDER BY filetime DESC';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
unset($attach_filelist[$row['physical_filename']]);
$size_lang = ($row['filesize'] >= 1048576) ? $user->lang['MB'] : (($row['filesize'] >= 1024) ? $user->lang['KB'] : $user->lang['BYTES']);
$row['filesize'] = ($row['filesize'] >= 1048576) ? round((round($row['filesize'] / 1048576 * 100) / 100), 2) : (($row['filesize'] >= 1024) ? round((round($row['filesize'] / 1024 * 100) / 100), 2) : $row['filesize']);
$template->assign_block_vars('orphan', array(
'FILESIZE' => $row['filesize'] . ' ' . $size_lang,
'FILETIME' => $user->format_date($row['filetime']),
'REAL_FILENAME' => basename($row['real_filename']),
'PHYSICAL_FILENAME' => basename($row['physical_filename']),
'ATTACH_ID' => $row['attach_id'],
'POST_IDS' => (!empty($post_ids[$row['attach_id']])) ? $post_ids[$row['attach_id']] : '',
'U_FILE' => append_sid($phpbb_root_path . 'download.' . $phpEx, 'id=' . $row['attach_id']))
);
}
$db->sql_freeresult($result);
$i = 0;
foreach ($attach_filelist as $file)
{
$filesize = @filesize($phpbb_root_path . $config['upload_path'] . '/' . $file);
$size_lang = ($filesize >= 1048576) ? $user->lang['MB'] : ( ($filesize >= 1024) ? $user->lang['KB'] : $user->lang['BYTES'] );
$filesize = ($filesize >= 1048576) ? round((round($filesize / 1048576 * 100) / 100), 2) : (($filesize >= 1024) ? round((round($filesize / 1024 * 100) / 100), 2) : $filesize);
$template->assign_block_vars('orphan', array(
'FILESIZE' => $filesize . ' ' . $size_lang,
'U_FILE' => $phpbb_root_path . $config['upload_path'] . '/' . $file,
'FILE' => $file,
'POST_IDS' => (!empty($post_ids[$file])) ? $post_ids[$file] : '')
);
}
break;
}
@@ -954,10 +1017,12 @@ class acp_attachments
global $db, $user;
$types = array(
ATTACHMENT_CATEGORY_NONE => $user->lang['NONE'],
ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'],
ATTACHMENT_CATEGORY_WM => $user->lang['CAT_WM_FILES'],
ATTACHMENT_CATEGORY_RM => $user->lang['CAT_RM_FILES']
ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'],
ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'],
ATTACHMENT_CATEGORY_WM => $user->lang['CAT_WM_FILES'],
ATTACHMENT_CATEGORY_RM => $user->lang['CAT_RM_FILES'],
ATTACHMENT_CATEGORY_FLASH => $user->lang['CAT_FLASH_FILES'],
ATTACHMENT_CATEGORY_QUICKTIME => $user->lang['CAT_QUICKTIME_FILES'],
);
if ($group_id)
@@ -1074,70 +1139,6 @@ class acp_attachments
return $group_select;
}
/**
* Upload already uploaded file... huh? are you kidding?
*/
function upload_file($post_id, $topic_id, $forum_id, $upload_dir, $filename)
{
global $message_parser, $db, $user, $phpbb_root_path;
$message_parser->attachment_data = array();
$message_parser->filename_data['filecomment'] = '';
$message_parser->filename_data['filename'] = $phpbb_root_path . $upload_dir . '/' . basename($filename);
$filedata = upload_attachment('local', $forum_id, true, $phpbb_root_path . $upload_dir . '/' . basename($filename));
if ($filedata['post_attach'] && !sizeof($filedata['error']))
{
$message_parser->attachment_data = array(
'post_msg_id' => $post_id,
'poster_id' => $user->data['user_id'],
'topic_id' => $topic_id,
'in_message' => 0,
'physical_filename' => $filedata['physical_filename'],
'real_filename' => $filedata['real_filename'],
'comment' => $message_parser->filename_data['filecomment'],
'extension' => $filedata['extension'],
'mimetype' => $filedata['mimetype'],
'filesize' => $filedata['filesize'],
'filetime' => $filedata['filetime'],
'thumbnail' => $filedata['thumbnail']
);
$message_parser->filename_data['filecomment'] = '';
$filedata['post_attach'] = false;
// Submit Attachment
$attach_sql = $message_parser->attachment_data;
$db->sql_transaction('begin');
$sql = 'INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $attach_sql);
$db->sql_query($sql);
$sql = 'UPDATE ' . POSTS_TABLE . "
SET post_attachment = 1
WHERE post_id = $post_id";
$db->sql_query($sql);
$sql = 'UPDATE ' . TOPICS_TABLE . "
SET topic_attachment = 1
WHERE topic_id = $topic_id";
$db->sql_query($sql);
$db->sql_transaction('commit');
add_log('admin', 'LOG_ATTACH_FILEUPLOAD', $post_id, $filename);
return true;
}
else if (sizeof($filedata['error']))
{
return sprintf($user->lang['ADMIN_UPLOAD_ERROR'], implode('<br />', $filedata['error']));
}
}
/**
* Search Imagick
*/
@@ -1145,7 +1146,7 @@ class acp_attachments
{
$imagick = '';
$exe = ((defined('PHP_OS')) && (preg_match('#win#i', PHP_OS))) ? '.exe' : '';
$exe = ((defined('PHP_OS')) && (preg_match('#^win#i', PHP_OS))) ? '.exe' : '';
$magic_home = getenv('MAGICK_HOME');
@@ -1364,20 +1365,20 @@ class acp_attachments
add_log('admin', $log_entry, $ip_list_log);
}
trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS']);
trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS'] . adm_back_link($this->u_action));
}
else if (isset($_POST['unsecuresubmit']))
{
$unip_sql = implode(', ', array_map('intval', $_POST['unip']));
$unip_sql = array_map('intval', $_POST['unip']);
if ($unip_sql != '')
if (sizeof($unip_sql))
{
$l_unip_list = '';
// Grab details of ips for logging information later
$sql = 'SELECT site_ip, site_hostname
FROM ' . SITELIST_TABLE . "
WHERE site_id IN ($unip_sql)";
FROM ' . SITELIST_TABLE . '
WHERE ' . $db->sql_in_set('site_id', $unip_sql);
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
@@ -1386,14 +1387,14 @@ class acp_attachments
}
$db->sql_freeresult($result);
$sql = 'DELETE FROM ' . SITELIST_TABLE . "
WHERE site_id IN ($unip_sql)";
$sql = 'DELETE FROM ' . SITELIST_TABLE . '
WHERE ' . $db->sql_in_set('site_id', $unip_sql);
$db->sql_query($sql);
add_log('admin', 'LOG_DOWNLOAD_REMOVE_IP', $l_unip_list);
}
trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS']);
trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS'] . adm_back_link($this->u_action));
}
}

View File

@@ -189,7 +189,7 @@ class acp_ban
$template->assign_block_vars('ban_reason', array(
'BAN_ID' => $ban_id,
'REASON' => $reason,
'A_REASON' => addslashes(html_entity_decode($reason)))
'A_REASON' => addslashes(htmlspecialchars_decode($reason)))
);
}
}
@@ -201,7 +201,7 @@ class acp_ban
$template->assign_block_vars('ban_give_reason', array(
'BAN_ID' => $ban_id,
'REASON' => $reason,
'A_REASON' => addslashes(html_entity_decode($reason)))
'A_REASON' => addslashes(htmlspecialchars_decode($reason)))
);
}
}

View File

@@ -33,12 +33,12 @@ class acp_bbcodes
switch ($action)
{
case 'add':
$bbcode_match = $bbcode_tpl = '';
$bbcode_match = $bbcode_tpl = $bbcode_helpline = '';
$display_on_posting = 0;
break;
case 'edit':
$sql = 'SELECT bbcode_match, bbcode_tpl, display_on_posting
$sql = 'SELECT bbcode_match, bbcode_tpl, display_on_posting, bbcode_helpline
FROM ' . BBCODES_TABLE . '
WHERE bbcode_id = ' . $bbcode_id;
$result = $db->sql_query($sql);
@@ -47,12 +47,13 @@ class acp_bbcodes
if (!$row)
{
trigger_error('BBCODE_NOT_EXIST');
trigger_error($user->lang['BBCODE_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$bbcode_match = $row['bbcode_match'];
$bbcode_tpl = htmlspecialchars($row['bbcode_tpl']);
$display_on_posting = $row['display_on_posting'];
$bbcode_helpline = $row['bbcode_helpline'];
break;
case 'modify':
@@ -65,7 +66,7 @@ class acp_bbcodes
if (!$row)
{
trigger_error('BBCODE_NOT_EXIST');
trigger_error($user->lang['BBCODE_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// No break here
@@ -74,7 +75,8 @@ class acp_bbcodes
$display_on_posting = request_var('display_on_posting', 0);
$bbcode_match = request_var('bbcode_match', '');
$bbcode_tpl = html_entity_decode(request_var('bbcode_tpl', ''));
$bbcode_tpl = htmlspecialchars_decode(request_var('bbcode_tpl', ''));
$bbcode_helpline = request_var('bbcode_helpline', '');
break;
}
@@ -89,8 +91,10 @@ class acp_bbcodes
'U_BACK' => $this->u_action,
'U_ACTION' => $this->u_action . '&amp;action=' . (($action == 'add') ? 'create' : 'modify') . (($bbcode_id) ? "&amp;bbcode=$bbcode_id" : ''),
'L_BBCODE_USAGE_EXPLAIN'=> sprintf($user->lang['BBCODE_USAGE_EXPLAIN'], '<a href="#down">', '</a>'),
'BBCODE_MATCH' => $bbcode_match,
'BBCODE_TPL' => $bbcode_tpl,
'BBCODE_HELPLINE' => $bbcode_helpline,
'DISPLAY_ON_POSTING' => $display_on_posting)
);
@@ -123,9 +127,11 @@ class acp_bbcodes
$info = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($info['test'] === '1' || in_array(strtolower($data['bbcode_tag']), $hard_coded))
// Grab the end, interrogate the last closing tag
preg_match('#\[/([^[]*)]$#', $bbcode_match, $regs);
if ($info['test'] === '1' || in_array(strtolower($data['bbcode_tag']), $hard_coded) || in_array(strtolower($regs[1]), $hard_coded))
{
trigger_error('BBCODE_INVALID_TAG_NAME');
trigger_error($user->lang['BBCODE_INVALID_TAG_NAME'] . adm_back_link($this->u_action), E_USER_WARNING);
}
}
@@ -134,6 +140,7 @@ class acp_bbcodes
'bbcode_match' => $bbcode_match,
'bbcode_tpl' => $bbcode_tpl,
'display_on_posting' => $display_on_posting,
'bbcode_helpline' => $bbcode_helpline,
'first_pass_match' => $data['first_pass_match'],
'first_pass_replace' => $data['first_pass_replace'],
'second_pass_match' => $data['second_pass_match'],
@@ -163,14 +170,15 @@ class acp_bbcodes
$bbcode_id = NUM_CORE_BBCODES + 1;
}
if ($bbcode_id > 31)
if ($bbcode_id > 1511)
{
trigger_error('TOO_MANY_BBCODES');
trigger_error($user->lang['TOO_MANY_BBCODES'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql_ary['bbcode_id'] = (int) $bbcode_id;
$db->sql_query('INSERT INTO ' . BBCODES_TABLE . $db->sql_build_array('INSERT', $sql_ary));
$cache->destroy('sql', BBCODES_TABLE);
$lang = 'BBCODE_ADDED';
$log_action = 'LOG_BBCODE_ADD';
@@ -181,6 +189,7 @@ class acp_bbcodes
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE bbcode_id = ' . $bbcode_id;
$db->sql_query($sql);
$cache->destroy('sql', BBCODES_TABLE);
$lang = 'BBCODE_EDITED';
$log_action = 'LOG_BBCODE_EDIT';
@@ -203,8 +212,21 @@ class acp_bbcodes
if ($row)
{
$db->sql_query('DELETE FROM ' . BBCODES_TABLE . " WHERE bbcode_id = $bbcode_id");
add_log('admin', 'LOG_BBCODE_DELETE', $row['bbcode_tag']);
if (confirm_box(true))
{
$db->sql_query('DELETE FROM ' . BBCODES_TABLE . " WHERE bbcode_id = $bbcode_id");
$cache->destroy('sql', BBCODES_TABLE);
add_log('admin', 'LOG_BBCODE_DELETE', $row['bbcode_tag']);
}
else
{
confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
'bbcode' => $bbcode_id,
'i' => $id,
'mode' => $mode,
'action' => $action))
);
}
}
break;
@@ -278,14 +300,14 @@ class acp_bbcodes
{
$token_type = $m[1][$n];
reset($tokens[$token_type]);
list($match, $replace) = each($tokens[$token_type]);
reset($tokens[strtoupper($token_type)]);
list($match, $replace) = each($tokens[strtoupper($token_type)]);
// Pad backreference numbers from tokens
if (preg_match_all('/(?<!\\\\)\$([0-9]+)/', $replace, $repad))
{
$repad = $pad + sizeof(array_unique($repad[0]));
$replace = preg_replace('/(?<!\\\\)\$([0-9]+)/e', "'\$' . (\$1 + \$pad)", $replace);
$replace = preg_replace('/(?<!\\\\)\$([0-9]+)/e', "'\${' . (\$1 + \$pad) . '}'", $replace);
$pad = $repad;
}
@@ -315,7 +337,7 @@ class acp_bbcodes
$fp_replace = str_replace($token, $replace, $fp_replace);
$sp_match = str_replace(preg_quote($token, '!'), '(.*?)', $sp_match);
$sp_replace = str_replace($token, '$' . ($n + 1), $sp_replace);
$sp_replace = str_replace($token, '${' . ($n + 1) . '}', $sp_replace);
}
$fp_match = '!' . $fp_match . '!' . $modifiers;
@@ -337,7 +359,7 @@ class acp_bbcodes
}
// Lowercase tags
$bbcode_tag = preg_replace('/.*?\[([a-z]+=?).*/i', '$1', $bbcode_match);
$bbcode_tag = preg_replace('/.*?\[([a-z0-9_-]+=?).*/i', '$1', $bbcode_match);
$fp_match = preg_replace('#\[/?' . $bbcode_tag . '#ie', "strtolower('\$0')", $fp_match);
$fp_replace = preg_replace('#\[/?' . $bbcode_tag . '#ie', "strtolower('\$0')", $fp_replace);
$sp_match = preg_replace('#\[/?' . $bbcode_tag . '#ie', "strtolower('\$0')", $sp_match);

View File

@@ -27,6 +27,7 @@ class acp_board
$action = request_var('action', '');
$submit = (isset($_POST['submit'])) ? true : false;
// Validation types are: string, int, bool, rpath (relative), rwpath (realtive, writeable), path (relative path, but able to escape the root), wpath (writeable)
switch ($mode)
{
case 'settings':
@@ -34,19 +35,19 @@ class acp_board
'title' => 'ACP_BOARD_SETTINGS',
'vars' => array(
'legend1' => 'ACP_BOARD_SETTINGS',
'sitename' => array('lang' => 'SITE_NAME', 'type' => 'text:40:255', 'explain' => false),
'site_desc' => array('lang' => 'SITE_DESC', 'type' => 'text:40:255', 'explain' => false),
'board_disable' => array('lang' => 'DISABLE_BOARD', 'type' => 'custom', 'method' => 'board_disable', 'explain' => true),
'sitename' => array('lang' => 'SITE_NAME', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => false),
'site_desc' => array('lang' => 'SITE_DESC', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => false),
'board_disable' => array('lang' => 'DISABLE_BOARD', 'validate' => 'bool', 'type' => 'custom', 'method' => 'board_disable', 'explain' => true),
'board_disable_msg' => false,
'default_lang' => array('lang' => 'DEFAULT_LANGUAGE', 'type' => 'select', 'function' => 'language_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false),
'default_dateformat' => array('lang' => 'DEFAULT_DATE_FORMAT', 'type' => 'custom', 'method' => 'dateformat_select', 'explain' => true),
'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'type' => 'select', 'function' => 'tz_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false),
'board_dst' => array('lang' => 'SYSTEM_DST', 'type' => 'radio:yes_no', 'explain' => false),
'default_style' => array('lang' => 'DEFAULT_STYLE', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', true), 'explain' => false),
'override_user_style' => array('lang' => 'OVERRIDE_STYLE', 'type' => 'radio:yes_no', 'explain' => true),
'default_lang' => array('lang' => 'DEFAULT_LANGUAGE', 'validate' => 'string', 'type' => 'select', 'function' => 'language_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false),
'default_dateformat' => array('lang' => 'DEFAULT_DATE_FORMAT', 'validate' => 'string', 'type' => 'custom', 'method' => 'dateformat_select', 'explain' => true),
'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'validate' => 'string', 'type' => 'select', 'function' => 'tz_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => false),
'board_dst' => array('lang' => 'SYSTEM_DST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'default_style' => array('lang' => 'DEFAULT_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => false),
'override_user_style' => array('lang' => 'OVERRIDE_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend2' => 'WARNINGS',
'warnings_expire_days' => array('lang' => 'WARNINGS_EXPIRE', 'type' => 'text:3:4', 'explain' => true),
'warnings_expire_days' => array('lang' => 'WARNINGS_EXPIRE', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => true),
)
);
break;
@@ -56,21 +57,25 @@ class acp_board
'title' => 'ACP_BOARD_FEATURES',
'vars' => array(
'legend1' => 'ACP_BOARD_FEATURES',
'allow_privmsg' => array('lang' => 'BOARD_PM', 'type' => 'radio:yes_no', 'explain' => true),
'allow_topic_notify' => array('lang' => 'ALLOW_TOPIC_NOTIFY', 'type' => 'radio:yes_no', 'explain' => false),
'allow_forum_notify' => array('lang' => 'ALLOW_FORUM_NOTIFY', 'type' => 'radio:yes_no', 'explain' => false),
'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'type' => 'radio:yes_no', 'explain' => false),
'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false),
'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false),
'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'type' => 'radio:yes_no', 'explain' => false),
'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig' => array('lang' => 'ALLOW_SIG', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_bbcode' => array('lang' => 'ALLOW_SIG_BBCODE', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_img' => array('lang' => 'ALLOW_SIG_IMG', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_flash' => array('lang' => 'ALLOW_SIG_FLASH', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_smilies' => array('lang' => 'ALLOW_SIG_SMILIES', 'type' => 'radio:yes_no', 'explain' => false),
'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'type' => 'radio:yes_no', 'explain' => true),
'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'type' => 'radio:yes_no', 'explain' => true),
'allow_privmsg' => array('lang' => 'BOARD_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_topic_notify' => array('lang' => 'ALLOW_TOPIC_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_forum_notify' => array('lang' => 'ALLOW_FORUM_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig' => array('lang' => 'ALLOW_SIG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend2' => 'ACP_LOAD_SETTINGS',
'load_birthdays' => array('lang' => 'YES_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_moderators' => array('lang' => 'YES_MODERATORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_memberlist' => array('lang' => 'LOAD_CPF_MEMBERLIST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_viewtopic' => array('lang' => 'LOAD_CPF_VIEWTOPIC', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
)
);
break;
@@ -82,14 +87,14 @@ class acp_board
'legend1' => 'ACP_AVATAR_SETTINGS',
'avatar_min_height' => false, 'avatar_min_width' => false, 'avatar_max_height' => false, 'avatar_max_width' => false,
'allow_avatar_local' => array('lang' => 'ALLOW_LOCAL', 'type' => 'radio:yes_no', 'explain' => false),
'allow_avatar_remote' => array('lang' => 'ALLOW_REMOTE', 'type' => 'radio:yes_no', 'explain' => true),
'allow_avatar_upload' => array('lang' => 'ALLOW_UPLOAD', 'type' => 'radio:yes_no', 'explain' => false),
'avatar_filesize' => array('lang' => 'MAX_FILESIZE', 'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
'avatar_min' => array('lang' => 'MIN_AVATAR_SIZE', 'type' => 'dimension:3:4', 'explain' => true),
'avatar_max' => array('lang' => 'MAX_AVATAR_SIZE', 'type' => 'dimension:3:4', 'explain' => true),
'avatar_path' => array('lang' => 'AVATAR_STORAGE_PATH', 'type' => 'text:20:255', 'explain' => true),
'avatar_gallery_path' => array('lang' => 'AVATAR_GALLERY_PATH', 'type' => 'text:20:255', 'explain' => true)
'allow_avatar_local' => array('lang' => 'ALLOW_LOCAL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_avatar_remote' => array('lang' => 'ALLOW_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_avatar_upload' => array('lang' => 'ALLOW_UPLOAD', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'avatar_filesize' => array('lang' => 'MAX_FILESIZE', 'validate' => 'int', 'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
'avatar_min' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true),
'avatar_max' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true),
'avatar_path' => array('lang' => 'AVATAR_STORAGE_PATH', 'validate' => 'rwpath', 'type' => 'text:20:255', 'explain' => true),
'avatar_gallery_path' => array('lang' => 'AVATAR_GALLERY_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true)
)
);
break;
@@ -100,24 +105,23 @@ class acp_board
'lang' => 'ucp',
'vars' => array(
'legend1' => 'GENERAL_SETTINGS',
'allow_privmsg' => array('lang' => 'BOARD_PM', 'type' => 'radio:yes_no', 'explain' => true),
'pm_max_boxes' => array('lang' => 'BOXES_MAX', 'type' => 'text:4:4', 'explain' => true),
'pm_max_msgs' => array('lang' => 'BOXES_LIMIT', 'type' => 'text:4:4', 'explain' => true),
'full_folder_action' => array('lang' => 'FULL_FOLDER_ACTION', 'type' => 'select', 'method' => 'full_folder_select', 'explain' => true),
'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
'allow_privmsg' => array('lang' => 'BOARD_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'pm_max_boxes' => array('lang' => 'BOXES_MAX', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true),
'pm_max_msgs' => array('lang' => 'BOXES_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true),
'full_folder_action' => array('lang' => 'FULL_FOLDER_ACTION', 'validate' => 'int', 'type' => 'select', 'method' => 'full_folder_select', 'explain' => true),
'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
'legend2' => 'GENERAL_OPTIONS',
'allow_mass_pm' => array('lang' => 'ALLOW_MASS_PM', 'type' => 'radio:yes_no', 'explain' => false),
'auth_bbcode_pm' => array('lang' => 'ALLOW_BBCODE_PM', 'type' => 'radio:yes_no', 'explain' => false),
'auth_smilies_pm' => array('lang' => 'ALLOW_SMILIES_PM', 'type' => 'radio:yes_no', 'explain' => false),
'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false),
'auth_download_pm' => array('lang' => 'ALLOW_DOWNLOAD_PM', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_pm' => array('lang' => 'ALLOW_SIG_PM', 'type' => 'radio:yes_no', 'explain' => false),
'print_pm' => array('lang' => 'ALLOW_PRINT_PM', 'type' => 'radio:yes_no', 'explain' => false),
'forward_pm' => array('lang' => 'ALLOW_FORWARD_PM', 'type' => 'radio:yes_no', 'explain' => false),
'auth_img_pm' => array('lang' => 'ALLOW_IMG_PM', 'type' => 'radio:yes_no', 'explain' => false),
'auth_flash_pm' => array('lang' => 'ALLOW_FLASH_PM', 'type' => 'radio:yes_no', 'explain' => false),
'enable_pm_icons' => array('lang' => 'ENABLE_PM_ICONS', 'type' => 'radio:yes_no', 'explain' => false)
'allow_mass_pm' => array('lang' => 'ALLOW_MASS_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'auth_bbcode_pm' => array('lang' => 'ALLOW_BBCODE_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'auth_smilies_pm' => array('lang' => 'ALLOW_SMILIES_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_pm' => array('lang' => 'ALLOW_SIG_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'print_pm' => array('lang' => 'ALLOW_PRINT_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'forward_pm' => array('lang' => 'ALLOW_FORWARD_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'auth_img_pm' => array('lang' => 'ALLOW_IMG_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'auth_flash_pm' => array('lang' => 'ALLOW_FLASH_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'enable_pm_icons' => array('lang' => 'ENABLE_PM_ICONS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false)
)
);
break;
@@ -127,31 +131,32 @@ class acp_board
'title' => 'ACP_POST_SETTINGS',
'vars' => array(
'legend1' => 'GENERAL_OPTIONS',
'allow_topic_notify' => array('lang' => 'ALLOW_TOPIC_NOTIFY', 'type' => 'radio:yes_no', 'explain' => false),
'allow_forum_notify' => array('lang' => 'ALLOW_FORUM_NOTIFY', 'type' => 'radio:yes_no', 'explain' => false),
'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'type' => 'radio:yes_no', 'explain' => false),
'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'type' => 'radio:yes_no', 'explain' => false),
'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'type' => 'radio:yes_no', 'explain' => true),
'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'type' => 'radio:yes_no', 'explain' => true),
'enable_post_confirm' => array('lang' => 'VISUAL_CONFIRM_POST', 'type' => 'radio:yes_no', 'explain' => true),
'allow_topic_notify' => array('lang' => 'ALLOW_TOPIC_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_forum_notify' => array('lang' => 'ALLOW_FORUM_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_post_links' => array('lang' => 'ALLOW_POST_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'enable_post_confirm' => array('lang' => 'VISUAL_CONFIRM_POST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend2' => 'POSTING',
'bump_type' => false,
'edit_time' => array('lang' => 'EDIT_TIME', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
'display_last_edited' => array('lang' => 'DISPLAY_LAST_EDITED', 'type' => 'radio:yes_no', 'explain' => true),
'flood_interval' => array('lang' => 'FLOOD_INTERVAL', 'type' => 'text:3:4', 'explain' => true),
'bump_interval' => array('lang' => 'BUMP_INTERVAL', 'type' => 'custom', 'method' => 'bump_interval', 'explain' => true),
'topics_per_page' => array('lang' => 'TOPICS_PER_PAGE', 'type' => 'text:3:4', 'explain' => false),
'posts_per_page' => array('lang' => 'POSTS_PER_PAGE', 'type' => 'text:3:4', 'explain' => false),
'hot_threshold' => array('lang' => 'HOT_THRESHOLD', 'type' => 'text:3:4', 'explain' => false),
'max_poll_options' => array('lang' => 'MAX_POLL_OPTIONS', 'type' => 'text:4:4', 'explain' => false),
'max_post_chars' => array('lang' => 'CHAR_LIMIT', 'type' => 'text:4:6', 'explain' => true),
'max_post_smilies' => array('lang' => 'SMILIES_LIMIT', 'type' => 'text:4:4', 'explain' => true),
'max_post_urls' => array('lang' => 'MAX_POST_URLS', 'type' => 'text:5:4', 'explain' => true),
'max_post_font_size' => array('lang' => 'MAX_POST_FONT_SIZE', 'type' => 'text:5:4', 'explain' => true),
'max_quote_depth' => array('lang' => 'QUOTE_DEPTH_LIMIT', 'type' => 'text:4:4', 'explain' => true),
'max_post_img_width' => array('lang' => 'MAX_POST_IMG_WIDTH', 'type' => 'text:5:4', 'explain' => true),
'max_post_img_height' => array('lang' => 'MAX_POST_IMG_HEIGHT', 'type' => 'text:5:4', 'explain' => true),
'edit_time' => array('lang' => 'EDIT_TIME', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
'display_last_edited' => array('lang' => 'DISPLAY_LAST_EDITED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'flood_interval' => array('lang' => 'FLOOD_INTERVAL', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => true),
'bump_interval' => array('lang' => 'BUMP_INTERVAL', 'validate' => 'int', 'type' => 'custom', 'method' => 'bump_interval', 'explain' => true),
'topics_per_page' => array('lang' => 'TOPICS_PER_PAGE', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => false),
'posts_per_page' => array('lang' => 'POSTS_PER_PAGE', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => false),
'hot_threshold' => array('lang' => 'HOT_THRESHOLD', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => false),
'max_poll_options' => array('lang' => 'MAX_POLL_OPTIONS', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => false),
'max_post_chars' => array('lang' => 'CHAR_LIMIT', 'validate' => 'int', 'type' => 'text:4:6', 'explain' => true),
'max_post_smilies' => array('lang' => 'SMILIES_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true),
'max_post_urls' => array('lang' => 'MAX_POST_URLS', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
'max_post_font_size' => array('lang' => 'MAX_POST_FONT_SIZE', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
'max_quote_depth' => array('lang' => 'QUOTE_DEPTH_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true),
'max_post_img_width' => array('lang' => 'MAX_POST_IMG_WIDTH', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
'max_post_img_height' => array('lang' => 'MAX_POST_IMG_HEIGHT', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
)
);
break;
@@ -161,19 +166,20 @@ class acp_board
'title' => 'ACP_SIGNATURE_SETTINGS',
'vars' => array(
'legend1' => 'GENERAL_OPTIONS',
'allow_sig' => array('lang' => 'ALLOW_SIG', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_bbcode' => array('lang' => 'ALLOW_SIG_BBCODE', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_img' => array('lang' => 'ALLOW_SIG_IMG', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_flash' => array('lang' => 'ALLOW_SIG_FLASH', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_smilies' => array('lang' => 'ALLOW_SIG_SMILIES', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig' => array('lang' => 'ALLOW_SIG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_bbcode' => array('lang' => 'ALLOW_SIG_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_img' => array('lang' => 'ALLOW_SIG_IMG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_flash' => array('lang' => 'ALLOW_SIG_FLASH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_smilies' => array('lang' => 'ALLOW_SIG_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_links' => array('lang' => 'ALLOW_SIG_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend2' => 'GENERAL_SETTINGS',
'max_sig_chars' => array('lang' => 'MAX_SIG_LENGTH', 'type' => 'text:5:4', 'explain' => true),
'max_sig_urls' => array('lang' => 'MAX_SIG_URLS', 'type' => 'text:5:4', 'explain' => true),
'max_sig_font_size' => array('lang' => 'MAX_SIG_FONT_SIZE', 'type' => 'text:5:4', 'explain' => true),
'max_sig_smilies' => array('lang' => 'MAX_SIG_SMILIES', 'type' => 'text:5:4', 'explain' => true),
'max_sig_img_width' => array('lang' => 'MAX_SIG_IMG_WIDTH', 'type' => 'text:5:4', 'explain' => true),
'max_sig_img_height' => array('lang' => 'MAX_SIG_IMG_HEIGHT', 'type' => 'text:5:4', 'explain' => true),
'max_sig_chars' => array('lang' => 'MAX_SIG_LENGTH', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
'max_sig_urls' => array('lang' => 'MAX_SIG_URLS', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
'max_sig_font_size' => array('lang' => 'MAX_SIG_FONT_SIZE', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
'max_sig_smilies' => array('lang' => 'MAX_SIG_SMILIES', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
'max_sig_img_width' => array('lang' => 'MAX_SIG_IMG_WIDTH', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
'max_sig_img_height' => array('lang' => 'MAX_SIG_IMG_HEIGHT', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
)
);
break;
@@ -186,51 +192,24 @@ class acp_board
'max_name_chars' => false,
'max_pass_chars' => false,
'require_activation' => array('lang' => 'ACC_ACTIVATION', 'type' => 'custom', 'method' => 'select_acc_activation', 'explain' => true),
'min_name_chars' => array('lang' => 'USERNAME_LENGTH', 'type' => 'custom', 'method' => 'username_length', 'explain' => true),
'min_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'type' => 'custom', 'method' => 'password_length', 'explain' => true),
'allow_name_chars' => array('lang' => 'USERNAME_CHARS', 'type' => 'select', 'method' => 'select_username_chars', 'explain' => true),
'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true),
'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'type' => 'text:3:3', 'explain' => true),
'require_activation' => array('lang' => 'ACC_ACTIVATION', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_acc_activation', 'explain' => true),
'min_name_chars' => array('lang' => 'USERNAME_LENGTH', 'validate' => 'int', 'type' => 'custom', 'method' => 'username_length', 'explain' => true),
'min_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int', 'type' => 'custom', 'method' => 'password_length', 'explain' => true),
'allow_name_chars' => array('lang' => 'USERNAME_CHARS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_username_chars', 'explain' => true),
'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true),
'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'legend2' => 'GENERAL_OPTIONS',
'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'type' => 'radio:yes_no', 'explain' => false),
'allow_emailreuse' => array('lang' => 'ALLOW_EMAIL_REUSE', 'type' => 'radio:yes_no', 'explain' => true),
'enable_confirm' => array('lang' => 'VISUAL_CONFIRM_REG', 'type' => 'radio:yes_no', 'explain' => true),
'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'type' => 'text:3:3', 'explain' => true),
'max_reg_attempts' => array('lang' => 'REG_LIMIT', 'type' => 'text:4:4', 'explain' => true),
'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_emailreuse' => array('lang' => 'ALLOW_EMAIL_REUSE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'enable_confirm' => array('lang' => 'VISUAL_CONFIRM_REG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'max_reg_attempts' => array('lang' => 'REG_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true),
'legend3' => 'COPPA',
'coppa_enable' => array('lang' => 'ENABLE_COPPA', 'type' => 'radio:yes_no', 'explain' => true),
'coppa_mail' => array('lang' => 'COPPA_MAIL', 'type' => 'textarea:5:40', 'explain' => true),
'coppa_fax' => array('lang' => 'COPPA_FAX', 'type' => 'text:25:100', 'explain' => false),
'coppa_hide_groups' => array('lang' => 'COPPA_HIDE_GROUPS', 'type' => 'radio:yes_no', 'explain' => true),
)
);
break;
case 'visual':
$display_vars = array(
'title' => 'ACP_VC_SETTINGS',
'vars' => array(
'legend1' => 'GENERAL_OPTIONS',
'enable_confirm' => array('lang' => 'VISUAL_CONFIRM_REG', 'type' => 'radio:yes_no', 'explain' => true),
'enable_post_confirm' => array('lang' => 'VISUAL_CONFIRM_POST', 'type' => 'radio:yes_no', 'explain' => true),
'legend2' => 'CAPTCHA_OPTIONS',
'policy_overlap' => array('lang' => 'CAPTCHA_OVERLAP', 'type' => 'radio:yes_no', 'explain' => false),
'policy_overlap_noise_pixel' => array('lang' => 'OVERLAP_NOISE_PIXEL', 'type' => 'select', 'method' => 'captcha_pixel_noise_select', 'explain' => false),
'policy_overlap_noise_line' => array('lang' => 'OVERLAP_NOISE_LINE', 'type' => 'radio:yes_no', 'explain' => false),
'policy_entropy' => array('lang' => 'CAPTCHA_ENTROPY', 'type' => 'radio:yes_no', 'explain' => false),
'policy_entropy_noise_pixel' => array('lang' => 'ENTROPY_NOISE_PIXEL', 'type' => 'select', 'method' => 'captcha_pixel_noise_select', 'explain' => false),
'policy_entropy_noise_line' => array('lang' => 'ENTROPY_NOISE_LINE', 'type' => 'radio:yes_no', 'explain' => false),
'policy_shape' => array('lang' => 'CAPTCHA_SHAPE', 'type' => 'radio:yes_no', 'explain' => false),
'policy_shape_noise_pixel' => array('lang' => 'SHAPE_NOISE_PIXEL', 'type' => 'select', 'method' => 'captcha_pixel_noise_select', 'explain' => false),
'policy_shape_noise_line' => array('lang' => 'SHAPE_NOISE_LINE', 'type' => 'radio:yes_no', 'explain' => false),
'policy_3dbitmap' => array('lang' => 'CAPTCHA_3DBITMAP', 'type' => 'radio:yes_no', 'explain' => false),
'policy_cells' => array('lang' => 'CAPTCHA_CELLS', 'type' => 'radio:yes_no', 'explain' => false),
'policy_stencil' => array('lang' => 'CAPTCHA_STENCIL', 'type' => 'radio:yes_no', 'explain' => false),
'policy_composite' => array('lang' => 'CAPTCHA_COMPOSITE', 'type' => 'radio:yes_no', 'explain' => false),
'coppa_enable' => array('lang' => 'ENABLE_COPPA', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'coppa_mail' => array('lang' => 'COPPA_MAIL', 'validate' => 'string', 'type' => 'textarea:5:40', 'explain' => true),
'coppa_fax' => array('lang' => 'COPPA_FAX', 'validate' => 'string', 'type' => 'text:25:100', 'explain' => false),
)
);
break;
@@ -240,10 +219,10 @@ class acp_board
'title' => 'ACP_COOKIE_SETTINGS',
'vars' => array(
'legend1' => 'ACP_COOKIE_SETTINGS',
'cookie_domain' => array('lang' => 'COOKIE_DOMAIN', 'type' => 'text::255', 'explain' => false),
'cookie_name' => array('lang' => 'COOKIE_NAME', 'type' => 'text::16', 'explain' => false),
'cookie_path' => array('lang' => 'COOKIE_PATH', 'type' => 'text::255', 'explain' => false),
'cookie_secure' => array('lang' => 'COOKIE_SECURE', 'type' => 'radio:disabled_enabled', 'explain' => true)
'cookie_domain' => array('lang' => 'COOKIE_DOMAIN', 'validate' => 'string', 'type' => 'text::255', 'explain' => false),
'cookie_name' => array('lang' => 'COOKIE_NAME', 'validate' => 'string', 'type' => 'text::16', 'explain' => false),
'cookie_path' => array('lang' => 'COOKIE_PATH', 'validate' => 'string', 'type' => 'text::255', 'explain' => false),
'cookie_secure' => array('lang' => 'COOKIE_SECURE', 'validate' => 'bool', 'type' => 'radio:disabled_enabled', 'explain' => true)
)
);
break;
@@ -253,27 +232,28 @@ class acp_board
'title' => 'ACP_LOAD_SETTINGS',
'vars' => array(
'legend1' => 'GENERAL_SETTINGS',
'limit_load' => array('lang' => 'LIMIT_LOAD', 'type' => 'text:4:4', 'explain' => true),
'session_length' => array('lang' => 'SESSION_LENGTH', 'type' => 'text:5:5', 'explain' => true),
'active_sessions' => array('lang' => 'LIMIT_SESSIONS', 'type' => 'text:4:4', 'explain' => true),
'load_online_time' => array('lang' => 'ONLINE_LENGTH', 'type' => 'text:4:3', 'explain' => true),
'limit_load' => array('lang' => 'LIMIT_LOAD', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true),
'session_length' => array('lang' => 'SESSION_LENGTH', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true),
'active_sessions' => array('lang' => 'LIMIT_SESSIONS', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true),
'load_online_time' => array('lang' => 'ONLINE_LENGTH', 'validate' => 'int', 'type' => 'text:4:3', 'explain' => true),
'legend2' => 'GENERAL_OPTIONS',
'load_db_track' => array('lang' => 'YES_POST_MARKING', 'type' => 'radio:yes_no', 'explain' => true),
'load_db_lastread' => array('lang' => 'YES_READ_MARKING', 'type' => 'radio:yes_no', 'explain' => true),
'load_online' => array('lang' => 'YES_ONLINE', 'type' => 'radio:yes_no', 'explain' => true),
'load_online_guests' => array('lang' => 'YES_ONLINE_GUESTS', 'type' => 'radio:yes_no', 'explain' => true),
'load_onlinetrack' => array('lang' => 'YES_ONLINE_TRACK', 'type' => 'radio:yes_no', 'explain' => true),
'load_birthdays' => array('lang' => 'YES_BIRTHDAYS', 'type' => 'radio:yes_no', 'explain' => false),
'load_moderators' => array('lang' => 'YES_MODERATORS', 'type' => 'radio:yes_no', 'explain' => false),
'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'type' => 'radio:yes_no', 'explain' => false),
'load_user_activity' => array('lang' => 'LOAD_USER_ACTIVITY','type' => 'radio:yes_no', 'explain' => true),
'load_tplcompile' => array('lang' => 'RECOMPILE_TEMPLATES', 'type' => 'radio:yes_no', 'explain' => true),
'load_db_track' => array('lang' => 'YES_POST_MARKING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'load_db_lastread' => array('lang' => 'YES_READ_MARKING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'load_anon_lastread' => array('lang' => 'YES_ANON_READ_MARKING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'load_online' => array('lang' => 'YES_ONLINE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'load_online_guests' => array('lang' => 'YES_ONLINE_GUESTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'load_onlinetrack' => array('lang' => 'YES_ONLINE_TRACK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'load_birthdays' => array('lang' => 'YES_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_moderators' => array('lang' => 'YES_MODERATORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_user_activity' => array('lang' => 'LOAD_USER_ACTIVITY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'load_tplcompile' => array('lang' => 'RECOMPILE_TEMPLATES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend3' => 'CUSTOM_PROFILE_FIELDS',
'load_cpf_memberlist' => array('lang' => 'LOAD_CPF_MEMBERLIST', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_viewtopic' => array('lang' => 'LOAD_CPF_VIEWTOPIC', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_memberlist' => array('lang' => 'LOAD_CPF_MEMBERLIST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_viewtopic' => array('lang' => 'LOAD_CPF_VIEWTOPIC', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
)
);
break;
@@ -283,7 +263,7 @@ class acp_board
'title' => 'ACP_AUTH_SETTINGS',
'vars' => array(
'legend1' => 'ACP_AUTH_SETTINGS',
'auth_method' => array('lang' => 'AUTH_METHOD', 'type' => 'select', 'method' => 'select_auth_method', 'explain' => false)
'auth_method' => array('lang' => 'AUTH_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'select_auth_method', 'explain' => false)
)
);
break;
@@ -293,20 +273,20 @@ class acp_board
'title' => 'ACP_SERVER_SETTINGS',
'vars' => array(
'legend1' => 'ACP_SERVER_SETTINGS',
'send_encoding' => array('lang' => 'SEND_ENCODING', 'type' => 'radio:yes_no', 'explain' => true),
'gzip_compress' => array('lang' => 'ENABLE_GZIP', 'type' => 'radio:yes_no', 'explain' => false),
'send_encoding' => array('lang' => 'SEND_ENCODING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'gzip_compress' => array('lang' => 'ENABLE_GZIP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'legend2' => 'PATH_SETTINGS',
'smilies_path' => array('lang' => 'SMILIES_PATH', 'type' => 'text:20:255', 'explain' => true),
'icons_path' => array('lang' => 'ICONS_PATH', 'type' => 'text:20:255', 'explain' => true),
'upload_icons_path' => array('lang' => 'UPLOAD_ICONS_PATH', 'type' => 'text:20:255', 'explain' => true),
'ranks_path' => array('lang' => 'RANKS_PATH', 'type' => 'text:20:255', 'explain' => true),
'smilies_path' => array('lang' => 'SMILIES_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
'icons_path' => array('lang' => 'ICONS_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
'upload_icons_path' => array('lang' => 'UPLOAD_ICONS_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
'ranks_path' => array('lang' => 'RANKS_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
'legend3' => 'SERVER_URL_SETTINGS',
'force_server_vars' => array('lang' => 'FORCE_SERVER_VARS', 'type' => 'radio:yes_no', 'explain' => true),
'server_protocol' => array('lang' => 'SERVER_PROTOCOL', 'type' => 'text:10:10', 'explain' => true),
'server_name' => array('lang' => 'SERVER_NAME', 'type' => 'text:40:255', 'explain' => true),
'server_port' => array('lang' => 'SERVER_PORT', 'type' => 'text:5:5', 'explain' => true),
'force_server_vars' => array('lang' => 'FORCE_SERVER_VARS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'server_protocol' => array('lang' => 'SERVER_PROTOCOL', 'validate' => 'string', 'type' => 'text:10:10', 'explain' => true),
'server_name' => array('lang' => 'SERVER_NAME', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true),
'server_port' => array('lang' => 'SERVER_PORT', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true),
)
);
break;
@@ -316,14 +296,16 @@ class acp_board
'title' => 'ACP_SECURITY_SETTINGS',
'vars' => array(
'legend1' => 'ACP_SECURITY_SETTINGS',
'allow_autologin' => array('lang' => 'ALLOW_AUTOLOGIN', 'type' => 'radio:yes_no', 'explain' => true),
'max_autologin_time' => array('lang' => 'AUTOLOGIN_LENGTH', 'type' => 'text:5:5', 'explain' => true),
'ip_check' => array('lang' => 'IP_VALID', 'type' => 'custom', 'method' => 'select_ip_check', 'explain' => true),
'browser_check' => array('lang' => 'BROWSER_VALID', 'type' => 'radio:yes_no', 'explain' => true),
'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true),
'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'type' => 'text:3:3', 'explain' => true),
'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS','type' => 'text:3:3', 'explain' => true),
'tpl_allow_php' => array('lang' => 'TPL_ALLOW_PHP', 'type' => 'radio:yes_no', 'explain' => true),
'allow_autologin' => array('lang' => 'ALLOW_AUTOLOGIN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'max_autologin_time' => array('lang' => 'AUTOLOGIN_LENGTH', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true),
'ip_check' => array('lang' => 'IP_VALID', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_ip_check', 'explain' => true),
'browser_check' => array('lang' => 'BROWSER_VALID', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'check_dnsbl' => array('lang' => 'CHECK_DNSBL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'email_check_mx' => array('lang' => 'EMAIL_CHECK_MX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true),
'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'tpl_allow_php' => array('lang' => 'TPL_ALLOW_PHP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
)
);
break;
@@ -333,28 +315,29 @@ class acp_board
'title' => 'ACP_EMAIL_SETTINGS',
'vars' => array(
'legend1' => 'GENERAL_SETTINGS',
'email_enable' => array('lang' => 'ENABLE_EMAIL', 'type' => 'radio:enabled_disabled', 'explain' => true),
'board_email_form' => array('lang' => 'BOARD_EMAIL_FORM', 'type' => 'radio:enabled_disabled', 'explain' => true),
'email_function_name' => array('lang' => 'EMAIL_FUNCTION_NAME', 'type' => 'text:20:50', 'explain' => true),
'email_package_size' => array('lang' => 'EMAIL_PACKAGE_SIZE', 'type' => 'text:5:5', 'explain' => true),
'board_contact' => array('lang' => 'CONTACT_EMAIL', 'type' => 'text:25:100', 'explain' => true),
'board_email' => array('lang' => 'ADMIN_EMAIL', 'type' => 'text:25:100', 'explain' => true),
'board_email_sig' => array('lang' => 'EMAIL_SIG', 'type' => 'textarea:5:30', 'explain' => true),
'board_hide_emails' => array('lang' => 'BOARD_HIDE_EMAILS', 'type' => 'radio:yes_no', 'explain' => true),
'email_enable' => array('lang' => 'ENABLE_EMAIL', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true),
'board_email_form' => array('lang' => 'BOARD_EMAIL_FORM', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true),
'email_function_name' => array('lang' => 'EMAIL_FUNCTION_NAME', 'validate' => 'string', 'type' => 'text:20:50', 'explain' => true),
'email_package_size' => array('lang' => 'EMAIL_PACKAGE_SIZE', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true),
'board_contact' => array('lang' => 'CONTACT_EMAIL', 'validate' => 'string', 'type' => 'text:25:100', 'explain' => true),
'board_email' => array('lang' => 'ADMIN_EMAIL', 'validate' => 'string', 'type' => 'text:25:100', 'explain' => true),
'board_email_sig' => array('lang' => 'EMAIL_SIG', 'validate' => 'string', 'type' => 'textarea:5:30', 'explain' => true),
'board_hide_emails' => array('lang' => 'BOARD_HIDE_EMAILS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend2' => 'SMTP_SETTINGS',
'smtp_delivery' => array('lang' => 'USE_SMTP', 'type' => 'radio:yes_no', 'explain' => true),
'smtp_host' => array('lang' => 'SMTP_SERVER', 'type' => 'text:25:50', 'explain' => false),
'smtp_port' => array('lang' => 'SMTP_PORT', 'type' => 'text:4:5', 'explain' => true),
'smtp_auth_method' => array('lang' => 'SMTP_AUTH_METHOD', 'type' => 'select', 'method' => 'mail_auth_select', 'explain' => true),
'smtp_username' => array('lang' => 'SMTP_USERNAME', 'type' => 'text:25:255', 'explain' => true),
'smtp_password' => array('lang' => 'SMTP_PASSWORD', 'type' => 'password:25:255', 'explain' => true)
'smtp_delivery' => array('lang' => 'USE_SMTP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'smtp_host' => array('lang' => 'SMTP_SERVER', 'validate' => 'string', 'type' => 'text:25:50', 'explain' => false),
'smtp_port' => array('lang' => 'SMTP_PORT', 'validate' => 'int', 'type' => 'text:4:5', 'explain' => true),
'smtp_auth_method' => array('lang' => 'SMTP_AUTH_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'mail_auth_select', 'explain' => true),
'smtp_username' => array('lang' => 'SMTP_USERNAME', 'validate' => 'string', 'type' => 'text:25:255', 'explain' => true),
'smtp_password' => array('lang' => 'SMTP_PASSWORD', 'validate' => 'string', 'type' => 'password:25:255', 'explain' => true)
)
);
break;
default:
trigger_error('NO_MODE');
trigger_error('NO_MODE', E_USER_ERROR);
break;
}
if (isset($display_vars['lang']))
@@ -363,7 +346,21 @@ class acp_board
}
$this->new_config = $config;
$cfg_array = (isset($_REQUEST['config'])) ? request_var('config', array('' => '')) : $this->new_config;
$cfg_array = (isset($_REQUEST['config'])) ? request_var('config', array('' => ''), true) : $this->new_config;
if (isset($_REQUEST['config']))
{
utf8_normalize_nfc(&$cfg_array);
}
$error = array();
// We validate the complete config if whished
validate_config_vars($display_vars['vars'], $cfg_array, $error);
// Do not write values if there is an error
if (sizeof($error))
{
$submit = false;
}
// 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)
@@ -417,7 +414,7 @@ class acp_board
{
include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
$method = 'admin_' . $method;
$method = 'acp_' . $method;
if (function_exists($method))
{
if ($fields = $method($this->new_config))
@@ -467,14 +464,14 @@ class acp_board
{
set_config($config_name, $config_value);
}
trigger_error($error . adm_back_link($this->u_action));
trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING);
}
}
set_config('auth_method', $cfg_array['auth_method']);
}
else
{
trigger_error('NO_AUTH_PLUGIN');
trigger_error('NO_AUTH_PLUGIN', E_USER_ERROR);
}
}
}
@@ -492,6 +489,10 @@ class acp_board
$template->assign_vars(array(
'L_TITLE' => $user->lang[$display_vars['title']],
'L_TITLE_EXPLAIN' => $user->lang[$display_vars['title'] . '_EXPLAIN'],
'S_ERROR' => (sizeof($error)) ? true : false,
'ERROR_MSG' => implode('<br />', $error),
'U_ACTION' => $this->u_action)
);
@@ -545,7 +546,7 @@ class acp_board
{
if ($method && file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx))
{
$method = 'admin_' . $method;
$method = 'acp_' . $method;
if (function_exists($method))
{
$fields = $method($this->new_config);
@@ -621,22 +622,12 @@ class acp_board
return '<option value="1"' . (($value == 1) ? ' selected="selected"' : '') . '>' . $user->lang['DELETE_OLDEST_MESSAGES'] . '</option><option value="2"' . (($value == 2) ? ' selected="selected"' : '') . '>' . $user->lang['HOLD_NEW_MESSAGES_SHORT'] . '</option>';
}
/**
* Select captcha pixel noise
*/
function captcha_pixel_noise_select($value, $key = '')
{
global $user;
return '<option value="0"' . (($value == 0) ? ' selected="selected"' : '') . '>' . $user->lang['NONE'] . '</option><option value="1"' . (($value == 1) ? ' selected="selected"' : '') . '>' . $user->lang['LIGHT'] . '</option><option value="2"' . (($value == 2) ? ' selected="selected"' : '') . '>' . $user->lang['MEDIUM'] . '</option><option value="3"' . (($value == 3) ? ' selected="selected"' : '') . '>' . $user->lang['HEAVY'] . '</option>';
}
/**
* Select ip validation
*/
function select_ip_check($value, $key = '')
{
$radio_ary = array(4 => 'ALL', 3 => 'CLASS_C', 2 => 'CLASS_B', 0 => 'NONE');
$radio_ary = array(4 => 'ALL', 3 => 'CLASS_C', 2 => 'CLASS_B', 0 => 'NO_IP_VALIDATION');
return h_radio('config[ip_check]', $radio_ary, $value, $key);
}

View File

@@ -96,7 +96,7 @@ class acp_bots
foreach ($_tables as $table)
{
$sql = "DELETE FROM $table
WHERE user_id IN (" . implode(', ', $user_id_ary) . ')';
WHERE " . $db->sql_in_set('user_id', $user_id_ary);
$db->sql_query($sql);
}
@@ -142,6 +142,12 @@ class acp_bots
}
$bot_row['bot_ip'] = str_replace(' ', '', $bot_row['bot_ip']);
// Make sure the admin is not adding a bot with an user agent similar to his one
if ($bot_row['bot_agent'] && substr($user->data['session_browser'], 0, 149) === substr($bot_row['bot_agent'], 0, 149))
{
$error[] = $user->lang['ERR_BOT_AGENT_MATCHES_UA'];
}
if (!sizeof($error))
{
$db->sql_transaction('begin');
@@ -159,7 +165,7 @@ class acp_bots
if (!$group_row)
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . "&amp;id=$bot_id&amp;action=$action"));
trigger_error($user->lang['NO_BOT_GROUP'] . adm_back_link($this->u_action . "&amp;id=$bot_id&amp;action=$action"), E_USER_WARNING);
}
$user_id = user_add(array(
@@ -197,7 +203,7 @@ class acp_bots
if (!$row)
{
trigger_error($user->lang['NO_BOT'] . adm_back_link($this->u_action . "&amp;id=$bot_id&amp;action=$action"));
trigger_error($user->lang['NO_BOT'] . adm_back_link($this->u_action . "&amp;id=$bot_id&amp;action=$action"), E_USER_WARNING);
}
$sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
@@ -237,7 +243,7 @@ class acp_bots
if (!$bot_row)
{
trigger_error($user->lang['NO_BOT'] . adm_back_link($this->u_action . "&amp;id=$bot_id&amp;action=$action"));
trigger_error($user->lang['NO_BOT'] . adm_back_link($this->u_action . "&amp;id=$bot_id&amp;action=$action"), E_USER_WARNING);
}
$bot_row['bot_lang'] = $bot_row['user_lang'];

View File

@@ -0,0 +1,59 @@
<?php
/**
*
* @package acp
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
/**
* @package acp
*/
class acp_captcha
{
var $u_action;
function main($id, $mode)
{
global $db, $user, $auth, $template;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('acp/board');
$config_vars = array(
'enable_confirm' => 'REG_ENABLE',
'enable_post_confirm' => 'POST_ENABLE',
'captcha_gd' => 'CAPTCHA_GD',
'captcha_gd_noise' => 'CAPTCHA_GD_NOISE',
);
$this->tpl_name = 'acp_captcha';
$this->page_title = 'ACP_VC_SETTINGS';
$submit = request_var('submit', '');
if ($submit)
{
$config_vars = array_keys($config_vars);
foreach ($config_vars as $config_var)
{
set_config($config_var, request_var($config_var, ''));
}
trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
}
else
{
$array = array();
if (@extension_loaded('gd') && function_exists('imagettfbbox') && function_exists('imagettftext'))
{
$template->assign_var('GD', true);
}
foreach ($config_vars as $config_var => $template_var)
{
$template->assign_var($template_var, $config[$config_var]);
}
}
}
}
?>

View File

@@ -68,7 +68,9 @@ class acp_database
@set_time_limit(1200);
$filename = time();
$time = time();
$filename = 'backup_' . $time;
// We set up the info needed for our on-the-fly creation :D
switch ($format)
@@ -111,7 +113,7 @@ class acp_database
if (!$fp)
{
trigger_error('Unable to write temporary file to storage folder');
trigger_error('Unable to write temporary file to storage folder', E_USER_ERROR);
}
}
@@ -128,13 +130,14 @@ class acp_database
$sql_data .= "#\n";
$sql_data .= "# phpBB Backup Script\n";
$sql_data .= "# Dump of tables for $table_prefix\n";
$sql_data .= "# DATE : " . gmdate("d-m-Y H:i:s", $filename) . " GMT\n";
$sql_data .= "# DATE : " . gmdate("d-m-Y H:i:s", $time) . " GMT\n";
$sql_data .= "#\n";
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'sqlite':
$sql_data .= "BEGIN TRANSACTION;\n";
$sqlite_version = sqlite_libversion();
break;
case 'postgres':
@@ -143,28 +146,66 @@ class acp_database
case 'mssql':
case 'mssql_odbc':
$sql_data .= "BEGIN TRANSACTION\nGO\n";
$sql_data .= "BEGIN TRANSACTION\n";
$sql_data .= "GO\n";
break;
}
if ($structure && $db->sql_layer == 'firebird')
{
$sql = 'SELECT RDB$FUNCTION_NAME, RDB$DESCRIPTION
FROM RDB$FUNCTIONS
ORDER BY RDB$FUNCTION_NAME';
$result = $db->sql_query($sql);
$rows = array();
while ($row = $db->sql_fetchrow($result))
{
$sql = 'SELECT F.RDB$FUNCTION_NAME, F.RDB$MODULE_NAME, F.RDB$ENTRYPOINT, F.RDB$RETURN_ARGUMENT, F.RDB$DESCRIPTION, FA.RDB$ARGUMENT_POSITION, FA.RDB$MECHANISM, FA.RDB$FIELD_TYPE, FA.RDB$FIELD_SCALE, FA.RDB$FIELD_LENGTH, FA.RDB$FIELD_SUB_TYPE, C.RDB$BYTES_PER_CHARACTER, C.RDB$CHARACTER_SET_NAME ,FA.RDB$FIELD_PRECISION
FROM RDB$FUNCTIONS F
LEFT JOIN RDB$FUNCTION_ARGUMENTS FA ON F.RDB$FUNCTION_NAME = FA.RDB$FUNCTION_NAME
LEFT JOIN RDB$CHARACTER_SETS C ON FA.RDB$CHARACTER_SET_ID = C.RDB$CHARACTER_SET_ID
WHERE (F.RDB$FUNCTION_NAME = ' . $row['FUNCTION_NAME'] . ')
ORDER BY FA.RDB$ARGUMENT_POSITION';
$result2 = $db->sql_query($sql);
while ($row2 = $db->sql_fetchrow($result2))
{
}
$db->sql_freeresult($result2);
}
$db->sql_freeresult($result);
}
foreach ($table as $table_name)
{
// Get the table structure
if ($structure)
{
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'mysqli':
case 'mysql4':
case 'mysql':
case 'sqlite':
$sql_data .= '# Table: ' . $table_name . "\n";
$sql_data .= "DROP TABLE IF EXISTS $table_name;\n";
break;
case 'oracle':
$sql_data .= '# Table: ' . $table_name . "\n";
$sql_data .= "DROP TABLE $table_name;\n\\\n";
$sql_data .= "DROP TABLE $table_name;\n";
$sql_data .= '\\' . "\n";
break;
case 'sqlite':
$sql_data .= '# Table: ' . $table_name . "\n";
if (version_compare($sqlite_version, '3.0') == -1)
{
$sql_data .= "DROP TABLE $table_name;\n";
}
else
{
$sql_data .= "DROP TABLE IF EXISTS $table_name;\n";
}
break;
case 'postgres':
@@ -177,11 +218,18 @@ class acp_database
case 'mssql_odbc':
$sql_data .= '# Table: ' . $table_name . "\n";
$sql_data .= "IF OBJECT_ID(N'$table_name', N'U') IS NOT NULL\n";
$sql_data .= "DROP TABLE $table_name;\nGO\n";
$sql_data .= "DROP TABLE $table_name;\n";
$sql_data .= "GO\n";
break;
}
$sql_data .= $this->get_table_structure($table_name);
}
else
{
// We might wanna empty out all that junk :D
$sql_data .= (($db->sql_layer == 'sqlite') ? 'DELETE FROM ' : 'TRUNCATE TABLE ') . $table_name . ";\n";
}
// Now write the data for the first time. :)
if ($store == true)
{
@@ -207,11 +255,12 @@ class acp_database
{
$sql_data .= "\n";
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'mysqli':
$sql = "SELECT * FROM $table_name";
$sql = "SELECT *
FROM $table_name";
$result = mysqli_query($db->db_connect_id, $sql, MYSQLI_USE_RESULT);
if ($result != false)
{
@@ -226,8 +275,8 @@ class acp_database
$field_set[$j] = $field[$j]->name;
}
$search = array('\\', "'", "\x00", "\x0a", "\x0d", "\x1a");
$replace = array('\\\\\\\\', "''", '\0', '\n', '\r', '\Z');
$search = array("\\", "'", "\x00", "\x0a", "\x0d", "\x1a", '"');
$replace = array("\\\\", "\\'", '\0', '\n', '\r', '\Z', '\\"');
$fields = implode(', ', $field_set);
$values = array();
$schema_insert = 'INSERT INTO ' . $table_name . ' (' . $fields . ') VALUES (';
@@ -278,7 +327,8 @@ class acp_database
case 'mysql4':
case 'mysql':
$sql = "SELECT * FROM $table_name";
$sql = "SELECT *
FROM $table_name";
$result = mysql_unbuffered_query($sql, $db->db_connect_id);
if ($result != false)
@@ -298,8 +348,8 @@ class acp_database
$field_set[$j] = $field[$j]->name;
}
$search = array('\\', "'", "\x00", "\x0a", "\x0d", "\x1a");
$replace = array('\\\\\\\\', "''", '\0', '\n', '\r', '\Z');
$search = array("\\", "'", "\x00", "\x0a", "\x0d", "\x1a", '"');
$replace = array("\\\\", "\\'", '\0', '\n', '\r', '\Z', '\\"');
$fields = implode(', ', $field_set);
$schema_insert = 'INSERT INTO ' . $table_name . ' (' . $fields . ') VALUES (';
@@ -347,12 +397,48 @@ class acp_database
break;
case 'sqlite':
// This is *not* my fault. The PHP guys forgot a call to finalize when they wrote this function. This forces all the tables to stay locked...
// They finally fixed it in 5.1.3 but 5.1.2 and under still have this so instead, we go and grab the column types by smashing open the sqlite_master table
// and grope around for things that remind us of datatypes...
if (version_compare(phpversion(), '5.1.3', '>='))
{
$col_types = sqlite_fetch_column_types($db->db_connect_id, $table_name);
}
else
{
$sql = "SELECT sql
FROM sqlite_master
WHERE type = 'table'
AND name = '" . $table_name . "'";
$table_data = sqlite_single_query($db->db_connect_id, $sql);
$table_data = preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', '', $table_data);
$table_data = trim($table_data);
$col_types = sqlite_fetch_column_types($table_name, $db->db_connect_id);
$sql = "SELECT * FROM $table_name";
$result = $db->sql_query($sql);
preg_match('#\((.*)\)#s', $table_data, $matches);
while ($row = $db->sql_fetchrow($result))
$column_list = array();
$table_cols = explode(',', trim($matches[1]));
foreach ($table_cols as $declaration)
{
$entities = preg_split('#\s+#', trim($declaration));
$column_name = preg_replace('/"?([^"]+)"?/', '\1', $entities[0]);
// Hit a primary key, those are not what we need :D
if (empty($entities[1]))
{
continue;
}
$col_types[$column_name] = $entities[1];
}
}
// Unbueffered query and the foreach make this ultra fast, we wait for nothing.
$sql = "SELECT *
FROM $table_name";
$result = sqlite_unbuffered_query($db->db_connect_id, $sql);
$rows = sqlite_fetch_all($result, SQLITE_ASSOC);
foreach ($rows as $row)
{
$names = $data = array();
foreach ($row as $row_name => $row_data)
@@ -368,7 +454,7 @@ class acp_database
{
$row_data = "''";
}
else if (strpos($col_types[$row_name], 'text') !== false || strpos($col_types[$row_name], 'char') !== false)
else if (strpos($col_types[$row_name], 'text') !== false || strpos($col_types[$row_name], 'char') !== false || strpos($col_types[$row_name], 'blob') !== false)
{
$row_data = "'" . $row_data . "'";
}
@@ -405,7 +491,7 @@ class acp_database
// Grab all of the data from current table.
$sql = "SELECT *
FROM {$table_name}";
FROM $table_name";
$result = $db->sql_query($sql);
$i_num_fields = pg_num_fields($result);
@@ -421,14 +507,14 @@ class acp_database
FROM pg_attrdef d, pg_class c
WHERE (c.relname = '{$table_name}')
AND (c.oid = d.adrelid)
AND d.adnum = " . strval($i+1);
AND d.adnum = " . strval($i + 1);
$result2 = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result2))
{
// Determine if we must reset the sequences
if (strpos($row['rowdefault'], 'nextval(\'') === 0)
if (strpos($row['rowdefault'], "nextval('") === 0)
{
$seq .= "SELECT SETVAL('{$table_name}_seq',(select case when max({$ary_name[$i]})>0 then max({$ary_name[$i]})+1 else 1 end from {$table_name}));\n";
$seq .= "SELECT SETVAL('{$table_name}_seq',(select case when max({$ary_name[$i]})>0 then max({$ary_name[$i]})+1 else 1 end FROM {$table_name}));\n";
}
}
}
@@ -442,7 +528,7 @@ class acp_database
{
$str_val = $row[$ary_name[$i]];
if (preg_match('#char|text|bool#i', $ary_type[$i]))
if (preg_match('#char|text|bool|bytea#i', $ary_type[$i]))
{
$str_quote = "'";
$str_empty = '';
@@ -476,7 +562,7 @@ class acp_database
// Take the ordered fields and their associated data and build it
// into a valid sql statement to recreate that field in the data.
$sql_data .= "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES(' . implode(', ', $schema_vals) . ");\n";
$sql_data .= "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES (' . implode(', ', $schema_vals) . ");\n";
if ($store == true)
{
@@ -526,7 +612,7 @@ class acp_database
// Grab all of the data from current table.
$sql = "SELECT *
FROM {$table_name}";
FROM $table_name";
$result = $db->sql_query($sql);
$retrieved_data = odbc_num_rows($result);
@@ -534,8 +620,8 @@ class acp_database
if ($retrieved_data)
{
$sql = "SELECT 1 as has_identity
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMNPROPERTY(object_id('$table_name'), COLUMN_NAME, 'IsIdentity') = 1";
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMNPROPERTY(object_id('$table_name'), COLUMN_NAME, 'IsIdentity') = 1";
$result2 = $db->sql_query($sql);
$row2 = $db->sql_fetchrow($result2);
if (!empty($row2['has_identity']))
@@ -563,7 +649,7 @@ class acp_database
{
$str_val = $row[$ary_name[$i]];
if (preg_match('#char|text|bool#i', $ary_type[$i]))
if (preg_match('#char|text|bool|varbinary#i', $ary_type[$i]))
{
$str_quote = "'";
$str_empty = '';
@@ -597,7 +683,7 @@ class acp_database
// Take the ordered fields and their associated data and build it
// into a valid sql statement to recreate that field in the data.
$sql_data .= "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES(' . implode(', ', $schema_vals) . ");\n";
$sql_data .= "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES (' . implode(', ', $schema_vals) . ");\n";
if ($store == true)
{
@@ -637,7 +723,7 @@ class acp_database
// Grab all of the data from current table.
$sql = "SELECT *
FROM {$table_name}";
FROM $table_name";
$result = $db->sql_query($sql);
$retrieved_data = mssql_num_rows($result);
@@ -653,8 +739,8 @@ class acp_database
if ($retrieved_data)
{
$sql = "SELECT 1 as has_identity
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMNPROPERTY(object_id('$table_name'), COLUMN_NAME, 'IsIdentity') = 1";
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMNPROPERTY(object_id('$table_name'), COLUMN_NAME, 'IsIdentity') = 1";
$result2 = $db->sql_query($sql);
$row2 = $db->sql_fetchrow($result2);
if (!empty($row2['has_identity']))
@@ -674,7 +760,7 @@ class acp_database
{
$str_val = $row[$ary_name[$i]];
if (preg_match('#char|text|bool#i', $ary_type[$i]))
if (preg_match('#char|text|bool|varbinary#i', $ary_type[$i]))
{
$str_quote = "'";
$str_empty = '';
@@ -708,7 +794,7 @@ class acp_database
// Take the ordered fields and their associated data and build it
// into a valid sql statement to recreate that field in the data.
$sql_data .= "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES(' . implode(', ', $schema_vals) . ");\n";
$sql_data .= "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES (' . implode(', ', $schema_vals) . ");\n";
if ($store == true)
{
@@ -748,7 +834,7 @@ class acp_database
// Grab all of the data from current table.
$sql = "SELECT *
FROM {$table_name}";
FROM $table_name";
$result = $db->sql_query($sql);
$i_num_fields = ibase_num_fields($result);
@@ -769,7 +855,7 @@ class acp_database
{
$str_val = $row[strtolower($ary_name[$i])];
if (preg_match('#char|text|bool#i', $ary_type[$i]))
if (preg_match('#char|text|bool|varbinary#i', $ary_type[$i]))
{
$str_quote = "'";
$str_empty = '';
@@ -803,7 +889,7 @@ class acp_database
// Take the ordered fields and their associated data and build it
// into a valid sql statement to recreate that field in the data.
$sql_data .= "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES(' . implode(', ', $schema_vals) . ");\n";
$sql_data .= "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES (' . implode(', ', $schema_vals) . ");\n";
if ($store == true)
{
@@ -833,7 +919,7 @@ class acp_database
// Grab all of the data from current table.
$sql = "SELECT *
FROM {$table_name}";
FROM $table_name";
$result = $db->sql_query($sql);
$i_num_fields = ocinumcols($result);
@@ -853,7 +939,7 @@ class acp_database
{
$str_val = $row[$ary_name[$i]];
if (preg_match('#char|text|bool#i', $ary_type[$i]))
if (preg_match('#char|text|bool|raw#i', $ary_type[$i]))
{
$str_quote = "'";
$str_empty = '';
@@ -887,7 +973,7 @@ class acp_database
// Take the ordered fields and their associated data and build it
// into a valid sql statement to recreate that field in the data.
$sql_data .= "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES(' . implode(', ', $schema_vals) . ");\n";
$sql_data .= "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES (' . implode(', ', $schema_vals) . ");\n";
if ($store == true)
{
@@ -915,7 +1001,7 @@ class acp_database
}
}
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'sqlite':
case 'postgres':
@@ -950,12 +1036,12 @@ class acp_database
unset($sql_data);
add_log('admin', 'LOG_DB_BACKUP');
trigger_error($user->lang['BACKUP_SUCCESS']);
trigger_error($user->lang['BACKUP_SUCCESS'] . adm_back_link($this->u_action));
break;
default:
$tables = array();
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'sqlite':
$sql = "SELECT name
@@ -987,9 +1073,9 @@ class acp_database
break;
case 'postgres':
$sql = "SELECT relname
$sql = 'SELECT relname
FROM pg_stat_user_tables
ORDER BY relname;";
ORDER BY relname';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
@@ -1088,18 +1174,18 @@ class acp_database
$delete = request_var('delete', '');
$file = request_var('file', '');
preg_match('#^(\d{10})\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches);
preg_match('#^(backup_\d{10,})\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches);
$file_name = $phpbb_root_path . 'store/' . $matches[0];
if (!(file_exists($file_name) && is_readable($file_name)))
{
trigger_error($user->lang['BACKUP_INVALID']);
trigger_error($user->lang['BACKUP_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if ($delete)
{
unlink($file_name);
trigger_error($user->lang['BACKUP_DELETE']);
trigger_error($user->lang['BACKUP_DELETE'] . adm_back_link($this->u_action));
}
$data = file_get_contents($file_name);
@@ -1144,44 +1230,52 @@ class acp_database
{
// Strip out sql comments...
remove_remarks($data);
switch (SQL_LAYER)
// SQLite gets improved performance when you shove all of these disk write queries at once :D
if ($db->sql_layer == 'sqlite')
{
case 'firebird':
$delim = ';;';
break;
case 'mysql':
case 'mysql4':
case 'mysqli':
case 'sqlite':
case 'postgres':
$delim = ';';
break;
case 'oracle':
$delim = '/';
break;
case 'mssql':
case 'mssql-odbc':
$delim = 'GO';
break;
$db->sql_query($data);
}
$pieces = split_sql_file($data, $delim);
$sql_count = count($pieces);
for($i = 0; $i < $sql_count; $i++)
else
{
$sql = trim($pieces[$i]);
if (!empty($sql) && $sql[0] != '#')
switch ($db->sql_layer)
{
$db->sql_query($sql);
case 'firebird':
$delim = ';;';
break;
case 'mysql':
case 'mysql4':
case 'mysqli':
case 'postgres':
$delim = ';';
break;
case 'oracle':
$delim = '/';
break;
case 'mssql':
case 'mssql-odbc':
$delim = 'GO';
break;
}
$pieces = split_sql_file($data, $delim);
$sql_count = count($pieces);
for($i = 0; $i < $sql_count; $i++)
{
$sql = trim($pieces[$i]);
if (!empty($sql) && $sql[0] != '#')
{
$db->sql_query($sql);
}
}
}
}
add_log('admin', 'LOG_DB_RESTORE');
trigger_error($user->lang['RESTORE_SUCCESS']);
trigger_error($user->lang['RESTORE_SUCCESS'] . adm_back_link($this->u_action));
break;
default:
@@ -1202,7 +1296,7 @@ class acp_database
$dh = opendir($dir);
while (($file = readdir($dh)) !== false)
{
if (preg_match('#^(\d{10})\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches))
if (preg_match('#^backup_(\d{10,})\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches))
{
$supported = in_array($matches[2], $methods);
@@ -1242,7 +1336,7 @@ class acp_database
$sql_data = '';
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'mysqli':
case 'mysql4':
@@ -1278,18 +1372,32 @@ class acp_database
}
$db->sql_freeresult($result);
$result = $db->sql_query("SHOW KEYS FROM $table_name");
$sql = "SHOW KEYS
FROM $table_name";
$result = $db->sql_query($sql);
$index = array();
while ($row = $db->sql_fetchrow($result))
{
$kname = $row['Key_name'];
if ($kname != 'PRIMARY' && $row['Non_unique'] == 0)
if ($kname != 'PRIMARY')
{
$kname = "UNIQUE|$kname";
if ($row['Index_type'] == 'FULLTEXT')
{
$kname = "FULLTEXT|$kname";
}
else if ($row['Non_unique'] == 0)
{
$kname = "UNIQUE|$kname";
}
}
if ($row['Sub_part'])
{
$row['Column_name'] .= '(' . $row['Sub_part'] . ')';
}
$index[$kname][] = $row['Column_name'];
}
$db->sql_freeresult($result);
@@ -1306,6 +1414,10 @@ class acp_database
{
$line .= 'UNIQUE ' . substr($key, 7) . ' (' . implode(', ', $columns) . ')';
}
else if (strpos($key, 'FULLTEXT') === 0)
{
$line .= 'FULLTEXT ' . substr($key, 9) . ' (' . implode(', ', $columns) . ')';
}
else
{
$line .= "KEY $key (" . implode(', ', $columns) . ')';
@@ -1403,11 +1515,12 @@ class acp_database
// We don't even care about storing the results. We already know the answer if we get rows back.
if ($db->sql_fetchrow($result))
{
$sql_data .= "DROP SEQUENCE {$table_name}_seq;\n";
$sql_data .= "CREATE SEQUENCE {$table_name}_seq;\n";
}
$db->sql_freeresult($result);
$field_query = "SELECT a.attnum, a.attname AS field, t.typname as type, a.attlen AS length, a.atttypmod as lengthvar, a.attnotnull as notnull
$field_query = "SELECT a.attnum, a.attname as field, t.typname as type, a.attlen as length, a.atttypmod as lengthvar, a.attnotnull as notnull
FROM pg_class c, pg_attribute a, pg_type t
WHERE c.relname = '" . $db->sql_escape($table_name) . "'
AND a.attnum > 0
@@ -1477,7 +1590,7 @@ class acp_database
// Get the listing of primary keys.
$sql_pri_keys = "SELECT ic.relname AS index_name, bc.relname AS tab_name, ta.attname AS column_name, i.indisunique AS unique_key, i.indisprimary AS primary_key
$sql_pri_keys = "SELECT ic.relname as index_name, bc.relname as tab_name, ta.attname as column_name, i.indisunique as unique_key, i.indisprimary as primary_key
FROM pg_class bc, pg_class ic, pg_index i, pg_attribute ta, pg_attribute ia
WHERE (bc.oid = i.indrelid)
AND (ic.oid = i.indexrelid)
@@ -1486,7 +1599,8 @@ class acp_database
AND (bc.relname = '" . $db->sql_escape($table_name) . "')
AND (ta.attrelid = i.indrelid)
AND (ta.attnum = i.indkey[ia.attnum-1])
ORDER BY index_name, tab_name, column_name ";
ORDER BY index_name, tab_name, column_name";
$result = $db->sql_query($sql_pri_keys);
$index_create = $index_rows = $primary_key = array();
@@ -1599,7 +1713,7 @@ class acp_database
if ($row['COLUMN_DEFAULT'])
{
$line .= ' CONSTRAINT [DF_' . $table_name . '_' . $row['COLUMN_NAME'] . '] DEFAULT ' . $row['COLUMN_DEFAULT'];
$line .= ' DEFAULT ' . $row['COLUMN_DEFAULT'];
}
$rows[] = $line;
@@ -1666,7 +1780,7 @@ class acp_database
$sql_data .= "\nCREATE TABLE $table_name (\n";
$sql = 'SELECT DISTINCT R.RDB$FIELD_NAME AS FNAME, R.RDB$NULL_FLAG AS NFLAG, R.RDB$DEFAULT_SOURCE AS DSOURCE, F.RDB$FIELD_TYPE AS FTYPE, F.RDB$FIELD_SUB_TYPE AS STYPE, F.RDB$FIELD_LENGTH AS FLEN
$sql = 'SELECT DISTINCT R.RDB$FIELD_NAME as FNAME, R.RDB$NULL_FLAG as NFLAG, R.RDB$DEFAULT_SOURCE as DSOURCE, F.RDB$FIELD_TYPE as FTYPE, F.RDB$FIELD_SUB_TYPE as STYPE, F.RDB$FIELD_LENGTH as FLEN
FROM RDB$RELATION_FIELDS R
JOIN RDB$FIELDS F ON R.RDB$FIELD_SOURCE=F.RDB$FIELD_NAME
LEFT JOIN RDB$FIELD_DIMENSIONS D ON R.RDB$FIELD_SOURCE = D.RDB$FIELD_NAME
@@ -1727,7 +1841,7 @@ class acp_database
$db->sql_freeresult($result);
$sql = 'SELECT I.RDB$INDEX_NAME AS INAME, I.RDB$UNIQUE_FLAG AS UFLAG, S.RDB$FIELD_NAME AS FNAME
$sql = 'SELECT I.RDB$INDEX_NAME as INAME, I.RDB$UNIQUE_FLAG as UFLAG, S.RDB$FIELD_NAME as FNAME
FROM RDB$INDICES I JOIN RDB$INDEX_SEGMENTS S ON S.RDB$INDEX_NAME=I.RDB$INDEX_NAME
WHERE (I.RDB$SYSTEM_FLAG IS NULL OR I.RDB$SYSTEM_FLAG=0)
AND I.RDB$FOREIGN_KEY IS NULL
@@ -1771,7 +1885,7 @@ class acp_database
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$sql = 'SELECT T1.RDB$DEPENDED_ON_NAME AS GEN, T1.RDB$FIELD_NAME, T1.RDB$DEPENDED_ON_TYPE
$sql = 'SELECT T1.RDB$DEPENDED_ON_NAME as GEN, T1.RDB$FIELD_NAME, T1.RDB$DEPENDED_ON_TYPE
FROM RDB$DEPENDENCIES T1
WHERE (T1.RDB$DEPENDENT_NAME = \'' . $row['dname'] . '\')
AND (T1.RDB$DEPENDENT_TYPE = 2 AND T1.RDB$DEPENDED_ON_TYPE = 14)
@@ -1800,7 +1914,9 @@ class acp_database
case 'oracle':
$sql_data .= "\nCREATE TABLE $table_name (\n";
$sql = "SELECT COLUMN_NAME, DATA_TYPE, DATA_PRECISION, DATA_LENGTH, NULLABLE, DATA_DEFAULT from ALL_TAB_COLS where table_name = '{$table_name}'";
$sql = "SELECT COLUMN_NAME, DATA_TYPE, DATA_PRECISION, DATA_LENGTH, NULLABLE, DATA_DEFAULT
FROM ALL_TAB_COLS
WHERE table_name = '{$table_name}'";
$result = $db->sql_query($sql);
$rows = array();

View File

@@ -37,12 +37,14 @@ class acp_disallow
if (!$disallowed_user)
{
trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'INSERT INTO ' . DISALLOW_TABLE . ' ' . $db->sql_build_array('INSERT', array('disallow_username' => $disallowed_user));
$db->sql_query($sql);
$cache->destroy('disallowed_usernames');
$message = $user->lang['DISALLOW_SUCCESSFUL'];
add_log('admin', 'LOG_DISALLOW_ADD', str_replace('%', '*', $disallowed_user));
@@ -54,16 +56,18 @@ class acp_disallow
if (!$disallowed_id)
{
trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'DELETE FROM ' . DISALLOW_TABLE . "
WHERE disallow_id = $disallowed_id";
$sql = 'DELETE FROM ' . DISALLOW_TABLE . '
WHERE disallow_id = ' . $disallowed_id;
$db->sql_query($sql);
$cache->destroy('disallowed_usernames');
add_log('admin', 'LOG_DISALLOW_DELETE');
trigger_error($user->lang['DISALLOWED_DELETED'] . adm_back_link($this->u_action));
trigger_error($user->lang['DISALLOWED_DELETED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// Grab the current list of disallowed usernames...

View File

@@ -28,7 +28,7 @@ class acp_email
$submit = (isset($_POST['submit'])) ? true : false;
$error = array();
$usernames = request_var('usernames', '');
$usernames = request_var('usernames', '', true);
$group_id = request_var('g', 0);
$subject = request_var('subject', '', true);
$message = request_var('message', '', true);
@@ -55,13 +55,11 @@ class acp_email
{
if ($usernames)
{
$usernames = implode(', ', preg_replace('#^[\s]*?(.*?)[\s]*?$#e', "\"'\" . \$db->sql_escape('\\1') . \"'\"", explode("\n", $usernames)));
$sql = 'SELECT username, user_email, user_jabber, user_notify_type, user_lang
FROM ' . USERS_TABLE . "
WHERE username IN ($usernames)
FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('username_clean', array_map('utf8_clean_string', explode("\n", $usernames))) . '
AND user_allow_massemail = 1
ORDER BY user_lang, user_notify_type"; // , SUBSTRING(user_email FROM INSTR(user_email, '@'))
ORDER BY user_lang, user_notify_type'; // , SUBSTRING(user_email FROM INSTR(user_email, '@'))
}
else
{
@@ -85,11 +83,11 @@ class acp_email
}
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$row)
{
trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action));
$db->sql_freeresult($result);
trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$i = $j = 0;
@@ -121,7 +119,7 @@ class acp_email
$email_list[$j][$i]['jabber'] = $row['user_jabber'];
$i++;
}
}
}
while ($row = $db->sql_fetchrow($result));
$db->sql_freeresult($result);
@@ -152,14 +150,13 @@ class acp_email
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->subject(html_entity_decode($subject));
$messenger->subject(htmlspecialchars_decode($subject));
$messenger->replyto($config['board_email']);
$messenger->set_mail_priority($priority);
$messenger->assign_vars(array(
'SITENAME' => $config['sitename'],
'CONTACT_EMAIL' => $config['board_contact'],
'MESSAGE' => html_entity_decode($message))
'MESSAGE' => htmlspecialchars_decode($message))
);
if (!($messenger->send($used_method)))
@@ -186,12 +183,13 @@ class acp_email
if (!$errored)
{
$message = ($use_queue) ? $user->lang['EMAIL_SENT_QUEUE'] : $user->lang['EMAIL_SENT'];
trigger_error($message . adm_back_link($this->u_action));
}
else
{
$message = sprintf($user->lang['EMAIL_SEND_ERROR'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&amp;mode=critical') . '">', '</a>');
trigger_error($message . adm_back_link($this->u_action), E_USER_WARNING);
}
trigger_error($message . adm_back_link($this->u_action));
}
}
@@ -217,6 +215,7 @@ class acp_email
'S_GROUP_OPTIONS' => $select_list,
'USERNAMES' => $usernames,
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=acp_email&amp;field=usernames'),
'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=acp_email&field=usernames', false),
'SUBJECT' => $subject,
'MESSAGE' => $message,
'S_PRIORITY_OPTIONS' => $s_priority_options)

View File

@@ -36,11 +36,19 @@ class acp_forums
// Check additional permissions
switch ($action)
{
case 'progress_bar':
$start = request_var('start', 0);
$total = request_var('total', 0);
$this->display_progress_bar($start, $total);
exit;
break;
case 'delete':
if (!$auth->acl_get('a_forumdel'))
{
trigger_error($user->lang['NO_PERMISSION_FORUM_DELETE'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
trigger_error($user->lang['NO_PERMISSION_FORUM_DELETE'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
break;
@@ -49,7 +57,7 @@ class acp_forums
if (!$auth->acl_get('a_forumadd'))
{
trigger_error($user->lang['NO_PERMISSION_FORUM_ADD'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
trigger_error($user->lang['NO_PERMISSION_FORUM_ADD'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
break;
@@ -94,23 +102,27 @@ class acp_forums
'forum_type' => request_var('forum_type', FORUM_POST),
'type_action' => request_var('type_action', ''),
'forum_status' => request_var('forum_status', ITEM_UNLOCKED),
'forum_parents' => '',
'forum_name' => request_var('forum_name', '', true),
'forum_link' => request_var('forum_link', ''),
'forum_link_track' => request_var('forum_link_track', false),
'forum_desc' => request_var('forum_desc', '', true),
'forum_desc_uid' => '',
'forum_desc_bitfield' => 0,
'forum_desc_options' => 7,
'forum_desc_bitfield' => '',
'forum_rules' => request_var('forum_rules', '', true),
'forum_rules_uid' => '',
'forum_rules_bitfield' => 0,
'forum_rules_options' => 7,
'forum_rules_bitfield' => '',
'forum_rules_link' => request_var('forum_rules_link', ''),
'forum_image' => request_var('forum_image', ''),
'forum_style' => request_var('forum_style', 0),
'display_on_index' => request_var('display_on_index', false),
'forum_topics_per_page' => request_var('topics_per_page', 0),
'enable_indexing' => request_var('enable_indexing',true),
'enable_indexing' => request_var('enable_indexing', true),
'enable_icons' => request_var('enable_icons', false),
'enable_prune' => request_var('enable_prune', false),
'enable_post_review' => request_var('enable_post_review', true),
'prune_days' => request_var('prune_days', 7),
'prune_viewed' => request_var('prune_viewed', 7),
'prune_freq' => request_var('prune_freq', 1),
@@ -126,13 +138,13 @@ class acp_forums
// Get data for forum rules if specified...
if ($forum_data['forum_rules'])
{
generate_text_for_storage($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], request_var('rules_parse_bbcode', false), request_var('rules_parse_urls', false), request_var('rules_parse_smilies', false));
generate_text_for_storage($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], $forum_data['forum_rules_options'], request_var('rules_parse_bbcode', false), request_var('rules_parse_urls', false), request_var('rules_parse_smilies', false));
}
// Get data for forum description if specified
if ($forum_data['forum_desc'])
{
generate_text_for_storage($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], request_var('desc_parse_bbcode', false), request_var('desc_parse_urls', false), request_var('desc_parse_smilies', false));
generate_text_for_storage($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options'], request_var('desc_parse_bbcode', false), request_var('desc_parse_urls', false), request_var('desc_parse_smilies', false));
}
$errors = $this->update_forum_data($forum_data);
@@ -142,8 +154,20 @@ class acp_forums
$forum_perm_from = request_var('forum_perm_from', 0);
// Copy permissions?
if ($forum_perm_from && $action == 'add')
if ($forum_perm_from)
{
// if we edit a forum delete current permissions first
if ($action == 'edit')
{
$sql = 'DELETE FROM ' . ACL_USERS_TABLE . '
WHERE forum_id = ' . (int) $forum_data['forum_id'];
$db->sql_query($sql);
$sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . '
WHERE forum_id = ' . (int) $forum_data['forum_id'];
$db->sql_query($sql);
}
// From the mysql documentation:
// Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query. This limitation is lifted in 4.0.14.
// Due to this we stay on the safe side if we do the insertion "the manual way"
@@ -187,34 +211,8 @@ class acp_forums
$db->sql_freeresult($result);
// Now insert the data
switch (SQL_LAYER)
{
case 'mysql':
case 'mysql4':
case 'mysqli':
if (sizeof($users_sql_ary))
{
$db->sql_query('INSERT INTO ' . ACL_USERS_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $users_sql_ary));
}
if (sizeof($groups_sql_ary))
{
$db->sql_query('INSERT INTO ' . ACL_GROUPS_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $groups_sql_ary));
}
break;
default:
foreach ($users_sql_ary as $ary)
{
$db->sql_query('INSERT INTO ' . ACL_USERS_TABLE . ' ' . $db->sql_build_array('INSERT', $ary));
}
foreach ($groups_sql_ary as $ary)
{
$db->sql_query('INSERT INTO ' . ACL_GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT', $ary));
}
break;
}
$db->sql_multi_insert(ACL_USERS_TABLE, $users_sql_ary);
$db->sql_multi_insert(ACL_GROUPS_TABLE, $groups_sql_ary);
}
$auth->acl_clear_prefetch();
@@ -250,7 +248,7 @@ class acp_forums
if (!$forum_id)
{
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
$sql = 'SELECT *
@@ -262,7 +260,7 @@ class acp_forums
if (!$row)
{
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
$move_forum_name = $this->move_forum_by($row, $action, 1);
@@ -278,10 +276,10 @@ class acp_forums
case 'sync':
if (!$forum_id)
{
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
$sql = 'SELECT forum_name
$sql = 'SELECT forum_name, forum_type
FROM ' . FORUMS_TABLE . "
WHERE forum_id = $forum_id";
$result = $db->sql_query($sql);
@@ -290,10 +288,76 @@ class acp_forums
if (!$row)
{
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
sync('forum', 'forum_id', $forum_id, false, true);
$cache->destroy('sql', FORUMS_TABLE);
$url = $this->u_action . "&amp;parent_id={$this->parent_id}&amp;f=$forum_id&amp;action=sync_topic";
meta_refresh(0, $url);
$sql = 'SELECT forum_topics_real
FROM ' . FORUMS_TABLE . "
WHERE forum_id = $forum_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$template->assign_vars(array(
'U_PROGRESS_BAR' => $this->u_action . '&amp;action=progress_bar',
'UA_PROGRESS_BAR' => str_replace('&amp;', '&', $this->u_action) . '&action=progress_bar',
'S_CONTINUE_SYNC' => true,
'L_PROGRESS_EXPLAIN' => sprintf($user->lang['SYNC_IN_PROGRESS_EXPLAIN'], 0, $row['forum_topics_real']))
);
// add_log('admin', 'LOG_FORUM_SYNC', $row['forum_name']);
return;
break;
case 'sync_topic':
@set_time_limit(0);
$sql = 'SELECT forum_name, forum_topics_real
FROM ' . FORUMS_TABLE . "
WHERE forum_id = $forum_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($row['forum_topics_real'])
{
$start = request_var('start', 0);
$batch_size = 3000;
$end = $start + $batch_size;
// Sync all topics in batch mode...
sync('topic_approved', 'range', 'topic_id BETWEEN ' . $start . ' AND ' . $end, true, false);
sync('topic', 'range', 'topic_id BETWEEN ' . $start . ' AND ' . $end, true, true);
if ($end < $row['forum_topics_real'])
{
$start += $batch_size;
$url = $this->u_action . "&amp;parent_id={$this->parent_id}&amp;f=$forum_id&amp;action=sync_topic&amp;start=$start&amp;total={$row['forum_topics_real']}";
meta_refresh(0, $url);
$template->assign_vars(array(
'U_PROGRESS_BAR' => $this->u_action . "&amp;action=progress_bar&amp;start=$start&amp;total={$row['forum_topics_real']}",
'UA_PROGRESS_BAR' => str_replace('&amp;', '&', $this->u_action) . "&action=progress_bar&start=$start&total={$row['forum_topics_real']}",
'S_CONTINUE_SYNC' => true,
'L_PROGRESS_EXPLAIN' => sprintf($user->lang['SYNC_IN_PROGRESS_EXPLAIN'], $start, $row['forum_topics_real']))
);
return;
}
}
sync('forum', 'forum_id', $forum_id);
add_log('admin', 'LOG_FORUM_SYNC', $row['forum_name']);
$cache->destroy('sql', FORUMS_TABLE);
@@ -306,12 +370,13 @@ class acp_forums
if ($update)
{
$forum_data['forum_flags'] = 0;
$forum_data['forum_flags'] += (request_var('forum_link_track', false)) ? 1 : 0;
$forum_data['forum_flags'] += (request_var('prune_old_polls', false)) ? 2 : 0;
$forum_data['forum_flags'] += (request_var('prune_announce', false)) ? 4 : 0;
$forum_data['forum_flags'] += (request_var('prune_sticky', false)) ? 8 : 0;
$forum_data['forum_flags'] += ($forum_data['show_active']) ? 16 : 0;
$forum_data['forum_flags'] = 0;
$forum_data['forum_flags'] += (request_var('forum_link_track', false)) ? FORUM_FLAG_LINK_TRACK : 0;
$forum_data['forum_flags'] += (request_var('prune_old_polls', false)) ? FORUM_FLAG_PRUNE_POLL : 0;
$forum_data['forum_flags'] += (request_var('prune_announce', false)) ? FORUM_FLAG_PRUNE_ANNOUNCE : 0;
$forum_data['forum_flags'] += (request_var('prune_sticky', false)) ? FORUM_FLAG_PRUNE_STICKY : 0;
$forum_data['forum_flags'] += ($forum_data['show_active']) ? FORUM_FLAG_ACTIVE_TOPICS : 0;
$forum_data['forum_flags'] += (request_var('enable_post_review', true)) ? FORUM_FLAG_POST_REVIEW : 0;
}
// Show form to create/modify a forum
@@ -326,7 +391,20 @@ class acp_forums
$forum_data = $row;
}
$parents_list = make_forum_select($forum_data['parent_id'], $forum_id, false, false, false);
// Make sure there is no forum displayed for parents_list having the current forum id as a parent...
$sql = 'SELECT forum_id
FROM ' . FORUMS_TABLE . '
WHERE parent_id = ' . $forum_id;
$result = $db->sql_query($sql);
$exclude_forums = array($forum_id);
while ($row = $db->sql_fetchrow($result))
{
$exclude_forums[] = $row['forum_id'];
}
$db->sql_freeresult($result);
$parents_list = make_forum_select($forum_data['parent_id'], $exclude_forums, false, false, false);
$forum_data['forum_password_confirm'] = $forum_data['forum_password'];
}
@@ -360,7 +438,7 @@ class acp_forums
'prune_days' => 7,
'prune_viewed' => 7,
'prune_freq' => 1,
'forum_flags' => 0,
'forum_flags' => FORUM_FLAG_POST_REVIEW,
'forum_password' => '',
'forum_password_confirm'=> '',
);
@@ -390,16 +468,17 @@ class acp_forums
{
// Before we are able to display the preview and plane text, we need to parse our request_var()'d value...
$forum_data['forum_rules_uid'] = '';
$forum_data['forum_rules_bitfield'] = 0;
$forum_data['forum_rules_bitfield'] = '';
$forum_data['forum_rules_options'] = 0;
generate_text_for_storage($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], request_var('rules_allow_bbcode', false), request_var('rules_allow_urls', false), request_var('rules_allow_smiliess', false));
generate_text_for_storage($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], $forum_data['forum_rules_options'], request_var('rules_allow_bbcode', false), request_var('rules_allow_urls', false), request_var('rules_allow_smiliess', false));
}
// Generate preview content
$forum_rules_preview = generate_text_for_display($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield']);
$forum_rules_preview = generate_text_for_display($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], $forum_data['forum_rules_options']);
// decode...
$forum_rules_data = generate_text_for_edit($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield']);
$forum_rules_data = generate_text_for_edit($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_options']);
}
// Parse desciption if specified
@@ -409,13 +488,14 @@ class acp_forums
{
// Before we are able to display the preview and plane text, we need to parse our request_var()'d value...
$forum_data['forum_desc_uid'] = '';
$forum_data['forum_desc_bitfield'] = 0;
$forum_data['forum_desc_bitfield'] = '';
$forum_data['forum_desc_options'] = 0;
generate_text_for_storage($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], request_var('desc_allow_bbcode', false), request_var('desc_allow_urls', false), request_var('desc_allow_smiliess', false));
generate_text_for_storage($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options'], request_var('desc_allow_bbcode', false), request_var('desc_allow_urls', false), request_var('desc_allow_smiliess', false));
}
// decode...
$forum_desc_data = generate_text_for_edit($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield']);
$forum_desc_data = generate_text_for_edit($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_options']);
}
$forum_type_options = '';
@@ -468,8 +548,9 @@ class acp_forums
'U_BACK' => $this->u_action . '&amp;parent_id=' . $this->parent_id,
'U_EDIT_ACTION' => $this->u_action . "&amp;parent_id={$this->parent_id}&amp;action=$action&amp;f=$forum_id",
'L_TITLE' => $user->lang[$this->page_title],
'ERROR_MSG' => (sizeof($errors)) ? implode('<br />', $errors) : '',
'L_COPY_PERMISSIONS_EXPLAIN' => $user->lang['COPY_PERMISSIONS_' . strtoupper($action) . '_EXPLAIN'],
'L_TITLE' => $user->lang[$this->page_title],
'ERROR_MSG' => (sizeof($errors)) ? implode('<br />', $errors) : '',
'FORUM_NAME' => $forum_data['forum_name'],
'FORUM_DATA_LINK' => $forum_data['forum_link'],
@@ -501,21 +582,22 @@ class acp_forums
'S_STATUS_OPTIONS' => $statuslist,
'S_PARENT_OPTIONS' => $parents_list,
'S_STYLES_OPTIONS' => $styles_list,
'S_FORUM_OPTIONS' => make_forum_select(false, false, false),
'S_FORUM_OPTIONS' => make_forum_select(($action == 'add') ? $forum_data['parent_id'] : false, false, false, false, false),
'S_SHOW_DISPLAY_ON_INDEX' => $s_show_display_on_index,
'S_FORUM_POST' => ($forum_data['forum_type'] == FORUM_POST) ? true : false,
'S_FORUM_ORIG_POST' => (isset($old_forum_type) && $old_forum_type == FORUM_POST) ? true : false,
'S_FORUM_LINK' => ($forum_data['forum_type'] == FORUM_LINK) ? true : false,
'S_FORUM_CAT' => ($forum_data['forum_type'] == FORUM_CAT) ? true : false,
'S_FORUM_LINK_TRACK' => ($forum_data['forum_flags'] & 1) ? true : false,
'S_ENABLE_INDEXING' => ($forum_data['enable_indexing']) ? true : false,
'S_TOPIC_ICONS' => ($forum_data['enable_icons']) ? true : false,
'S_DISPLAY_ON_INDEX' => ($forum_data['display_on_index']) ? true : false,
'S_PRUNE_ENABLE' => ($forum_data['enable_prune']) ? true : false,
'S_PRUNE_OLD_POLLS' => ($forum_data['forum_flags'] & 2) ? true : false,
'S_PRUNE_ANNOUNCE' => ($forum_data['forum_flags'] & 4) ? true : false,
'S_PRUNE_STICKY' => ($forum_data['forum_flags'] & 8) ? true : false,
'S_DISPLAY_ACTIVE_TOPICS' => ($forum_data['forum_flags'] & 16) ? true : false,
'S_FORUM_LINK_TRACK' => ($forum_data['forum_flags'] & FORUM_FLAG_LINK_TRACK) ? true : false,
'S_PRUNE_OLD_POLLS' => ($forum_data['forum_flags'] & FORUM_FLAG_PRUNE_POLL) ? true : false,
'S_PRUNE_ANNOUNCE' => ($forum_data['forum_flags'] & FORUM_FLAG_PRUNE_ANNOUNCE) ? true : false,
'S_PRUNE_STICKY' => ($forum_data['forum_flags'] & FORUM_FLAG_PRUNE_STICKY) ? true : false,
'S_DISPLAY_ACTIVE_TOPICS' => ($forum_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS) ? true : false,
'S_ENABLE_POST_REVIEW' => ($forum_data['forum_flags'] & FORUM_FLAG_POST_REVIEW) ? true : false,
)
);
@@ -527,7 +609,7 @@ class acp_forums
if (!$forum_id)
{
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
$forum_data = $this->get_forum_info($forum_id);
@@ -601,7 +683,7 @@ class acp_forums
// Jumpbox
$forum_box = make_forum_select($this->parent_id, false, false, false, false); //make_forum_select($this->parent_id);
if ($action == 'sync')
if ($action == 'sync' || $action == 'sync_topic')
{
$template->assign_var('S_RESYNCED', true);
}
@@ -644,8 +726,10 @@ class acp_forums
$template->assign_block_vars('forums', array(
'FOLDER_IMAGE' => $folder_image,
'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="" />' : '',
'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
'FORUM_NAME' => $row['forum_name'],
'FORUM_DESCRIPTION' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield']),
'FORUM_DESCRIPTION' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']),
'FORUM_TOPICS' => $row['forum_topics'],
'FORUM_POSTS' => $row['forum_posts'],
@@ -683,7 +767,10 @@ class acp_forums
'NAVIGATION' => $navigation,
'FORUM_BOX' => $forum_box,
'U_SEL_ACTION' => $this->u_action,
'U_ACTION' => $this->u_action . '&amp;parent_id=' . $this->parent_id)
'U_ACTION' => $this->u_action . '&amp;parent_id=' . $this->parent_id,
'U_PROGRESS_BAR' => $this->u_action . '&amp;action=progress_bar',
'UA_PROGRESS_BAR' => str_replace('&amp;', '&', $this->u_action) . '&action=progress_bar')
);
}
@@ -744,12 +831,14 @@ class acp_forums
// 4 = prune announcements
// 8 = prune stickies
// 16 = show active topics
// 32 = enable post review
$forum_data['forum_flags'] = 0;
$forum_data['forum_flags'] += ($forum_data['forum_link_track']) ? 1 : 0;
$forum_data['forum_flags'] += ($forum_data['prune_old_polls']) ? 2 : 0;
$forum_data['forum_flags'] += ($forum_data['prune_announce']) ? 4 : 0;
$forum_data['forum_flags'] += ($forum_data['prune_sticky']) ? 8 : 0;
$forum_data['forum_flags'] += ($forum_data['show_active']) ? 16 : 0;
$forum_data['forum_flags'] += ($forum_data['forum_link_track']) ? FORUM_FLAG_LINK_TRACK : 0;
$forum_data['forum_flags'] += ($forum_data['prune_old_polls']) ? FORUM_FLAG_PRUNE_POLL : 0;
$forum_data['forum_flags'] += ($forum_data['prune_announce']) ? FORUM_FLAG_PRUNE_ANNOUNCE : 0;
$forum_data['forum_flags'] += ($forum_data['prune_sticky']) ? FORUM_FLAG_PRUNE_STICKY : 0;
$forum_data['forum_flags'] += ($forum_data['show_active']) ? FORUM_FLAG_ACTIVE_TOPICS : 0;
$forum_data['forum_flags'] += ($forum_data['enable_post_review']) ? FORUM_FLAG_POST_REVIEW : 0;
// Unset data that are not database fields
$forum_data_sql = $forum_data;
@@ -759,6 +848,7 @@ class acp_forums
unset($forum_data_sql['prune_announce']);
unset($forum_data_sql['prune_sticky']);
unset($forum_data_sql['show_active']);
unset($forum_data_sql['enable_post_review']);
unset($forum_data_sql['forum_password_confirm']);
// What are we going to do tonight Brain? The same thing we do everynight,
@@ -785,7 +875,7 @@ class acp_forums
if (!$row)
{
trigger_error($user->lang['PARENT_NOT_EXIST'] . adm_back_link($this->u_action . '&amp;' . $this->parent_id));
trigger_error($user->lang['PARENT_NOT_EXIST'] . adm_back_link($this->u_action . '&amp;' . $this->parent_id), E_USER_WARNING);
}
$sql = 'UPDATE ' . FORUMS_TABLE . '
@@ -849,7 +939,8 @@ class acp_forums
return array($user->lang['NO_FORUM_ACTION']);
}
$forum_data_sql['forum_posts'] = $forum_data_sql['forum_topics'] = $forum_data_sql['forum_topics_real'] = 0;
$forum_data_sql['forum_posts'] = $forum_data_sql['forum_topics'] = $forum_data_sql['forum_topics_real'] = $forum_data_sql['forum_last_post_id'] = $forum_data_sql['forum_last_poster_id'] = $forum_data_sql['forum_last_post_time'] = 0;
$forum_data_sql['forum_last_poster_name'] = $forum_data_sql['forum_last_poster_colour'] = '';
}
if (sizeof($errors))
@@ -935,14 +1026,14 @@ class acp_forums
$sql = 'UPDATE ' . FORUMS_TABLE . "
SET right_id = right_id + $diff, forum_parents = ''
WHERE " . $to_data['right_id'] . ' BETWEEN left_id AND right_id
AND forum_id NOT IN (' . implode(', ', $moved_ids) . ')';
AND ' . $db->sql_in_set('forum_id', $moved_ids, true);
$db->sql_query($sql);
// Resync the righthand side of the tree
$sql = 'UPDATE ' . FORUMS_TABLE . "
SET left_id = left_id + $diff, right_id = right_id + $diff, forum_parents = ''
WHERE left_id > " . $to_data['right_id'] . '
AND forum_id NOT IN (' . implode(', ', $moved_ids) . ')';
AND ' . $db->sql_in_set('forum_id', $moved_ids, true);
$db->sql_query($sql);
// Resync moved branch
@@ -961,7 +1052,7 @@ class acp_forums
{
$sql = 'SELECT MAX(right_id) AS right_id
FROM ' . FORUMS_TABLE . '
WHERE forum_id NOT IN (' . implode(', ', $moved_ids) . ')';
WHERE ' . $db->sql_in_set('forum_id', $moved_ids, true);
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -971,7 +1062,7 @@ class acp_forums
$sql = 'UPDATE ' . FORUMS_TABLE . "
SET left_id = left_id $diff, right_id = right_id $diff, forum_parents = ''
WHERE forum_id IN (" . implode(', ', $moved_ids) . ')';
WHERE " . $db->sql_in_set('forum_id', $moved_ids);
$db->sql_query($sql);
}
@@ -1023,6 +1114,7 @@ class acp_forums
$errors = array();
$log_action_posts = $log_action_forums = $posts_to_name = $subforums_to_name = '';
$forum_ids = array($forum_id);
if ($action_posts == 'delete')
{
@@ -1066,8 +1158,6 @@ class acp_forums
if ($action_subforums == 'delete')
{
$log_action_forums = 'FORUMS';
$forum_ids = array($forum_id);
$rows = get_forum_branch($forum_id, 'children', 'descending', false);
foreach ($rows as $row)
@@ -1084,7 +1174,15 @@ class acp_forums
$diff = sizeof($forum_ids) * 2;
$sql = 'DELETE FROM ' . FORUMS_TABLE . '
WHERE forum_id IN (' . implode(', ', $forum_ids) . ')';
WHERE ' . $db->sql_in_set('forum_id', $forum_ids);
$db->sql_query($sql);
$sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_ids);
$db->sql_query($sql);
$sql = 'DELETE FROM ' . ACL_USERS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_ids);
$db->sql_query($sql);
}
else if ($action_subforums == 'move')
@@ -1132,6 +1230,14 @@ class acp_forums
$sql = 'DELETE FROM ' . FORUMS_TABLE . "
WHERE forum_id = $forum_id";
$db->sql_query($sql);
$sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . "
WHERE forum_id = $forum_id";
$db->sql_query($sql);
$sql = 'DELETE FROM ' . ACL_USERS_TABLE . "
WHERE forum_id = $forum_id";
$db->sql_query($sql);
}
}
@@ -1146,6 +1252,14 @@ class acp_forums
$sql = 'DELETE FROM ' . FORUMS_TABLE . "
WHERE forum_id = $forum_id";
$db->sql_query($sql);
$sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . "
WHERE forum_id = $forum_id";
$db->sql_query($sql);
$sql = 'DELETE FROM ' . ACL_USERS_TABLE . "
WHERE forum_id = $forum_id";
$db->sql_query($sql);
}
// Resync tree
@@ -1159,11 +1273,6 @@ class acp_forums
WHERE left_id > {$forum_data['right_id']}";
$db->sql_query($sql);
if (!isset($forum_ids) || !is_array($forum_ids))
{
$forum_ids = array($forum_id);
}
// Delete forum ids from extension groups table
$sql = 'SELECT group_id, allowed_forums
FROM ' . EXTENSION_GROUPS_TABLE;
@@ -1260,7 +1369,21 @@ class acp_forums
delete_attachments('topic', $topic_ids, false);
switch (SQL_LAYER)
// Before we remove anything we make sure we are able to adjust the post counts later. ;)
$sql = 'SELECT poster_id
FROM ' . POSTS_TABLE . '
WHERE forum_id = ' . $forum_id . '
AND post_postcount = 1';
$result = $db->sql_query($sql);
$post_counts = array();
while ($row = $db->sql_fetchrow($result))
{
$post_counts[$row['poster_id']] = (!empty($post_counts[$row['poster_id']])) ? $post_counts[$row['poster_id']] + 1 : 1;
}
$db->sql_freeresult($result);
switch ($db->sql_layer)
{
case 'mysql4':
case 'mysqli':
@@ -1332,22 +1455,21 @@ class acp_forums
if (sizeof($ids))
{
$start += sizeof($ids);
$id_list = implode(', ', $ids);
foreach ($tables as $table)
{
$db->sql_query("DELETE FROM $table WHERE $field IN ($id_list)");
$db->sql_query("DELETE FROM $table WHERE " . $db->sql_in_set($field, $ids));
}
}
}
while ($row);
}
unset($ids, $id_list);
unset($ids);
break;
}
$table_ary = array(ACL_GROUPS_TABLE, ACL_USERS_TABLE, FORUMS_ACCESS_TABLE, FORUMS_TRACK_TABLE, FORUMS_WATCH_TABLE, LOG_TABLE, MODERATOR_CACHE_TABLE, POSTS_TABLE, TOPICS_TABLE, TOPICS_TRACK_TABLE);
$table_ary = array(FORUMS_ACCESS_TABLE, FORUMS_TRACK_TABLE, FORUMS_WATCH_TABLE, LOG_TABLE, MODERATOR_CACHE_TABLE, POSTS_TABLE, TOPICS_TABLE, TOPICS_TRACK_TABLE);
foreach ($table_ary as $table)
{
@@ -1362,8 +1484,57 @@ class acp_forums
$db->sql_query("UPDATE $table SET forum_id = 0 WHERE forum_id = $forum_id");
}
// Adjust users post counts
if (sizeof($post_counts))
{
foreach ($post_counts as $poster_id => $substract)
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_posts = user_posts - ' . $substract . '
WHERE user_id = ' . $poster_id;
$db->sql_query($sql);
}
}
$db->sql_transaction('commit');
// Make sure the overall post/topic count is correct...
$sql = 'SELECT COUNT(post_id) AS stat
FROM ' . POSTS_TABLE . '
WHERE post_approved = 1';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
set_config('num_posts', (int) $row['stat'], true);
$sql = 'SELECT COUNT(topic_id) AS stat
FROM ' . TOPICS_TABLE . '
WHERE topic_approved = 1';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
set_config('num_topics', (int) $row['stat'], true);
$sql = 'SELECT COUNT(attach_id) as stat
FROM ' . ATTACHMENTS_TABLE;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
set_config('num_files', (int) $row['stat'], true);
$sql = 'SELECT SUM(filesize) as stat
FROM ' . ATTACHMENTS_TABLE;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
set_config('upload_dir_size', (int) $row['stat'], true);
add_log('admin', 'LOG_RESYNC_STATS');
return array();
}
@@ -1447,6 +1618,27 @@ class acp_forums
return $target['forum_name'];
}
/**
* Display progress bar for syncinc forums
*/
function display_progress_bar($start, $total)
{
global $template, $user;
adm_page_header($user->lang['SYNC_IN_PROGRESS']);
$template->set_filenames(array(
'body' => 'progress_bar.html')
);
$template->assign_vars(array(
'L_PROGRESS' => $user->lang['SYNC_IN_PROGRESS'],
'L_PROGRESS_EXPLAIN' => ($start && $total) ? sprintf($user->lang['SYNC_IN_PROGRESS_EXPLAIN'], $start, $total) : $user->lang['SYNC_IN_PROGRESS'])
);
adm_page_footer();
}
}
?>

View File

@@ -30,7 +30,7 @@ class acp_groups
$action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['addusers'])) ? 'addusers' : request_var('action', ''));
$group_id = request_var('g', 0);
$mark_ary = request_var('mark', array(0));
$name_ary = request_var('usernames', '');
$name_ary = request_var('usernames', '', true);
$leader = request_var('leader', 0);
$default = request_var('default', 0);
$start = request_var('start', 0);
@@ -52,7 +52,7 @@ class acp_groups
if (!$group_row)
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
}
}
@@ -64,11 +64,11 @@ class acp_groups
case 'promote':
if (!$group_id)
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// Approve, demote or promote
group_user_attributes($action, $group_id, $mark_ary, false, ($group_id) ? $group_row['group_name'] : false);
group_user_attributes($action, $group_id, $mark_ary, false, $group_row['group_name']);
switch ($action)
{
@@ -85,13 +85,15 @@ class acp_groups
break;
}
trigger_error($user->lang[$message] . adm_back_link($this->u_action));
group_update_listings($group_id);
trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id));
break;
case 'default':
if (!$group_id)
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (confirm_box(true))
@@ -134,7 +136,9 @@ class acp_groups
group_user_attributes('default', $group_id, $mark_ary, false, $group_row['group_name'], $group_row);
}
trigger_error($user->lang['GROUP_DEFS_UPDATED'] . adm_back_link($this->u_action));
group_update_listings($group_id);
trigger_error($user->lang['GROUP_DEFS_UPDATED'] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id));
}
else
{
@@ -155,7 +159,7 @@ class acp_groups
{
if (!$group_id)
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$error = '';
@@ -165,7 +169,7 @@ class acp_groups
case 'delete':
if (!$auth->acl_get('a_groupdel'))
{
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$error = group_delete($group_id, $group_row['group_name']);
@@ -176,13 +180,15 @@ class acp_groups
break;
}
$back_link = ($action == 'delete') ? $this->u_action : $this->u_action . '&amp;action=list&amp;g=' . $group_id;
if ($error)
{
trigger_error($user->lang[$error] . adm_back_link($this->u_action));
trigger_error($user->lang[$error] . adm_back_link($back_link), E_USER_WARNING);
}
$message = ($action == 'delete') ? 'GROUP_DELETED' : 'GROUP_USERS_REMOVE';
trigger_error($user->lang[$message] . adm_back_link($this->u_action));
trigger_error($user->lang[$message] . adm_back_link($back_link));
}
else
{
@@ -199,12 +205,12 @@ class acp_groups
case 'addusers':
if (!$group_id)
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (!$name_ary)
{
trigger_error($user->lang['NO_USERS'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_USERS'] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id), E_USER_WARNING);
}
$name_ary = array_unique(explode("\n", $name_ary));
@@ -212,11 +218,11 @@ class acp_groups
// Add user/s to group
if ($error = group_user_add($group_id, false, $name_ary, $group_row['group_name'], $default, $leader, 0, $group_row))
{
trigger_error($user->lang[$error] . adm_back_link($this->u_action));
trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id), E_USER_WARNING);
}
$message = ($action == 'addleaders') ? 'GROUP_MODS_ADDED' : 'GROUP_USERS_ADDED';
trigger_error($user->lang[$message] . adm_back_link($this->u_action));
$message = ($leader) ? 'GROUP_MODS_ADDED' : 'GROUP_USERS_ADDED';
trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id));
break;
case 'edit':
@@ -226,12 +232,12 @@ class acp_groups
if ($action == 'edit' && !$group_id)
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if ($action == 'add' && !$auth->acl_get('a_groupadd'))
{
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$error = array();
@@ -311,7 +317,7 @@ class acp_groups
{
if (isset($group_row['group_avatar']) && $group_row['group_avatar'])
{
avatar_delete($group_row['group_avatar']);
avatar_delete('group', $group_row);
}
}
@@ -362,24 +368,7 @@ class acp_groups
$db->sql_freeresult($result);
// Now insert the data
if (sizeof($groups_sql_ary))
{
switch (SQL_LAYER)
{
case 'mysql':
case 'mysql4':
case 'mysqli':
$db->sql_query('INSERT INTO ' . ACL_GROUPS_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $groups_sql_ary));
break;
default:
foreach ($groups_sql_ary as $ary)
{
$db->sql_query('INSERT INTO ' . ACL_GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT', $ary));
}
break;
}
}
$db->sql_multi_insert(ACL_GROUPS_TABLE, $groups_sql_ary);
$auth->acl_clear_prefetch();
}
@@ -418,7 +407,7 @@ class acp_groups
else
{
$group_name = $group_row['group_name'];
$group_desc_data = generate_text_for_edit($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_bitfield']);
$group_desc_data = generate_text_for_edit($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_options']);
$group_type = $group_row['group_type'];
$group_rank = $group_row['group_rank'];
}
@@ -540,7 +529,7 @@ class acp_groups
if (!$group_id)
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$this->page_title = 'GROUP_MEMBERS';
@@ -607,10 +596,13 @@ class acp_groups
'S_ON_PAGE' => on_page($total_members, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination($this->u_action . "&amp;action=$action&amp;g=$group_id", $total_members, $config['topics_per_page'], $start, true),
'GROUP_NAME' => ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'],
'U_ACTION' => $this->u_action . "&amp;g=$group_id",
'U_BACK' => $this->u_action,
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=list&amp;field=usernames'))
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=list&amp;field=usernames'),
'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=list&field=usernames', false),
'U_DEFAULT_ALL' => "{$this->u_action}&amp;action=default&amp;g=$group_id")
);
foreach ($group_data['leader'] as $row)
@@ -701,7 +693,6 @@ class acp_groups
$template->assign_block_vars('groups', array(
'U_LIST' => "{$this->u_action}&amp;action=list&amp;g=$group_id",
'U_DEFAULT' => "{$this->u_action}&amp;action=default&amp;g=$group_id",
'U_EDIT' => "{$this->u_action}&amp;action=edit&amp;g=$group_id",
'U_DELETE' => ($auth->acl_get('a_groupdel')) ? "{$this->u_action}&amp;action=delete&amp;g=$group_id" : '',

View File

@@ -60,7 +60,7 @@ class acp_icons
if ($action == 'edit' || $action == 'add' || $action == 'import')
{
$imglist = filelist($phpbb_root_path . $img_path, '');
foreach ($imglist as $path => $img_ary)
{
foreach ($img_ary as $img)
@@ -108,39 +108,36 @@ class acp_icons
ORDER BY {$fields}_order " . (($icon_id || $action == 'add') ? 'DESC' : 'ASC');
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result))
$data = array();
while ($row = $db->sql_fetchrow($result))
{
do
if ($action == 'add')
{
if ($action == 'add')
{
unset($_images[$row[$fields . '_url']]);
}
unset($_images[$row[$fields . '_url']]);
}
if ($row[$fields . '_id'] == $icon_id)
if ($row[$fields . '_id'] == $icon_id)
{
$after = true;
$data[$row[$fields . '_url']] = $row;
}
else
{
if ($action == 'edit' && !$icon_id)
{
$after = true;
$data[$row[$fields . '_url']] = $row;
}
else
{
if ($action == 'edit' && !$icon_id)
{
$data[$row[$fields . '_url']] = $row;
}
$selected = '';
if (!empty($after))
{
$selected = ' selected="selected"';
$after = false;
}
$after_txt = ($mode == 'smilies') ? $row['code'] : $row['icons_url'];
$order_list = '<option value="' . ($row[$fields . '_order']) . '"' . $selected . '>' . sprintf($user->lang['AFTER_' . $lang], ' -&gt; ' . htmlspecialchars($after_txt)) . '</option>' . $order_list;
$selected = '';
if (!empty($after))
{
$selected = ' selected="selected"';
$after = false;
}
$after_txt = ($mode == 'smilies') ? $row['code'] : $row['icons_url'];
$order_list = '<option value="' . ($row[$fields . '_order'] + 1) . '"' . $selected . '>' . sprintf($user->lang['AFTER_' . $lang], ' -&gt; ' . htmlspecialchars($after_txt)) . '</option>' . $order_list;
}
while ($row = $db->sql_fetchrow($result));
}
$db->sql_freeresult($result);
@@ -231,25 +228,46 @@ class acp_icons
}
$img_sql = array(
$fields . '_url' => $image,
$fields . '_width' => $image_width[$image],
$fields . '_height' => $image_height[$image],
'display_on_posting'=> (isset($image_display_on_posting[$image])) ? 1 : 0,
$fields . '_url' => $image,
$fields . '_width' => $image_width[$image],
$fields . '_height' => $image_height[$image],
'display_on_posting' => (isset($image_display_on_posting[$image])) ? 1 : 0,
);
if ($mode == 'smilies')
{
$img_sql = array_merge($img_sql, array(
'emotion' => $image_emotion[$image],
'code' => $image_code[$image])
'emotion' => $image_emotion[$image],
'code' => $image_code[$image])
);
}
// Image_order holds the 'new' order value
if (!empty($image_order[$image]))
{
$img_sql = array_merge($img_sql, array(
$fields . '_order' => $image_order[$image] . '.5')
$fields . '_order' => $image_order[$image])
);
// Since we always add 'after' an item, we just need to increase all following + the current by one
$sql = "UPDATE $table
SET {$fields}_order = {$fields}_order + 1
WHERE {$fields}_order >= {$image_order[$image]}";
$db->sql_query($sql);
// If we adjust the order, we need to adjust all other orders too - they became inaccurate...
foreach ($image_order as $_image => $_order)
{
if ($_image == $image)
{
continue;
}
if ($_order >= $image_order[$image])
{
$image_order[$_image]++;
}
}
}
if ($action == 'modify')
@@ -264,45 +282,6 @@ class acp_icons
$sql = "INSERT INTO $table " . $db->sql_build_array('INSERT', $img_sql);
$db->sql_query($sql);
}
$update = false;
if ($action == 'modify' && !empty($image_order[$image]))
{
$update = true;
$sql = "SELECT {$fields}_order
FROM $table
WHERE {$fields}_id = " . $image_id[$image];
$result = $db->sql_query($sql);
$order_old = (int) $db->sql_fetchfield($fields . '_order');
$db->sql_freeresult($result);
if ($order_old == $image_order[$image])
{
$update = false;
}
if ($order_old > $image_order[$image])
{
$sign = '+';
$where = $fields . '_order >= ' . $image_order[$image] . " AND {$fields}_order < $order_old";
}
else if ($order_old < $image_order[$image])
{
$sign = '-';
$where = "{$fields}_order > $order_old AND {$fields}_order < " . $image_order[$image];
$sql[$fields . '_order'] = $image_order[$image] - 1;
}
}
if ($update)
{
$sql = "UPDATE $table
SET {$fields}_order = {$fields}_order $sign 1
WHERE $where";
$db->sql_query($sql);
}
}
}
@@ -332,7 +311,7 @@ class acp_icons
// The user has already selected a smilies_pak file
if ($current == 'delete')
{
$db->sql_query(((SQL_LAYER != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . $table);
$db->sql_query((($db->sql_layer != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . $table);
switch ($mode)
{
@@ -351,7 +330,10 @@ class acp_icons
$cur_img = array();
$field_sql = ($mode == 'smilies') ? 'code' : 'icons_url';
$result = $db->sql_query("SELECT $field_sql FROM $table");
$sql = "SELECT $field_sql
FROM $table";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
@@ -363,7 +345,7 @@ class acp_icons
if (!($pak_ary = @file($phpbb_root_path . $img_path . '/' . $pak)))
{
trigger_error($user->lang['PAK_FILE_NOT_READABLE'] . adm_back_link($this->u_action));
trigger_error($user->lang['PAK_FILE_NOT_READABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
foreach ($pak_ary as $pak_entry)
@@ -371,21 +353,22 @@ class acp_icons
$data = array();
if (preg_match_all("#'(.*?)', #", $pak_entry, $data))
{
if ((sizeof($data[1]) != 3 && $mode == 'icons') ||
(sizeof($data[1]) != 5 && $mode == 'smilies'))
if ((sizeof($data[1]) != 4 && $mode == 'icons') ||
(sizeof($data[1]) != 6 && $mode == 'smilies'))
{
trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($this->u_action));
trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// Stripslash here because it got addslashed before... (on export)
$img = stripslashes($data[1][0]);
$width = stripslashes($data[1][1]);
$height = stripslashes($data[1][2]);
$display_on_posting = stripslashes($data[1][3]);
if (isset($data[1][3]) && isset($data[1][4]))
if (isset($data[1][4]) && isset($data[1][5]))
{
$emotion = stripslashes($data[1][3]);
$code = stripslashes($data[1][4]);
$emotion = stripslashes($data[1][4]);
$code = stripslashes($data[1][5]);
}
if ($current == 'replace' &&
@@ -394,15 +377,16 @@ class acp_icons
{
$replace_sql = ($mode == 'smilies') ? $code : $img;
$sql = array(
$fields . '_url' => $img,
$fields . '_height' => (int) $height,
$fields . '_width' => (int) $width,
$fields . '_url' => $img,
$fields . '_height' => (int) $height,
$fields . '_width' => (int) $width,
'display_on_posting' => (int) $display_on_posting,
);
if ($mode == 'smilies')
{
$sql = array_merge($sql, array(
'emotion' => $emotion
'emotion' => $emotion,
));
}
@@ -415,17 +399,18 @@ class acp_icons
++$order;
$sql = array(
$fields . '_url' => $img,
$fields . '_height' => (int) $height,
$fields . '_width' => (int) $width,
$fields . '_order' => (int) $order,
$fields . '_url' => $img,
$fields . '_height' => (int) $height,
$fields . '_width' => (int) $width,
$fields . '_order' => (int) $order,
'display_on_posting'=> (int) $display_on_posting,
);
if ($mode == 'smilies')
{
$sql = array_merge($sql, array(
'code' => $code,
'emotion' => $emotion
'code' => $code,
'emotion' => $emotion,
));
}
$db->sql_query("INSERT INTO $table " . $db->sql_build_array('INSERT', $sql));
@@ -435,7 +420,7 @@ class acp_icons
$cache->destroy('icons');
$cache->destroy('sql', $table);
trigger_error($user->lang[$lang . '_IMPORT_SUCCESS'] . adm_back_link($this->u_action));
}
else
@@ -476,7 +461,7 @@ class acp_icons
);
return;
break;
case 'send':
@@ -492,6 +477,7 @@ class acp_icons
$pak .= "'" . addslashes($row[$fields . '_url']) . "', ";
$pak .= "'" . addslashes($row[$fields . '_width']) . "', ";
$pak .= "'" . addslashes($row[$fields . '_height']) . "', ";
$pak .= "'" . addslashes($row['display_on_posting']) . "', ";
if ($mode == 'smilies')
{
@@ -505,7 +491,7 @@ class acp_icons
if ($pak != '')
{
$db->sql_close();
garbage_collection();
header('Pragma: public');
@@ -519,15 +505,16 @@ class acp_icons
}
else
{
trigger_error($user->lang['NO_' . $fields . '_EXPORT'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_' . strtoupper($fields) . '_EXPORT'] . adm_back_link($this->u_action), E_USER_WARNING);
}
break;
case 'delete':
$db->sql_query("DELETE FROM $table
WHERE {$fields}_id = $icon_id");
$sql = "DELETE FROM $table
WHERE {$fields}_id = $icon_id";
$db->sql_query($sql);
switch ($mode)
{
@@ -549,19 +536,48 @@ class acp_icons
$notice = $user->lang[$lang . '_DELETED'];
$cache->destroy('icons');
$cache->destroy('sql', $table);
break;
case 'move_up':
case 'move_down':
$image_order = request_var('order', 0);
$order_total = $image_order * 2 + (($action == 'move_up') ? -1 : 1);
// Get current order id...
$sql = "SELECT {$fields}_order as current_order
FROM $table
WHERE {$fields}_id = $icon_id";
$result = $db->sql_query($sql);
$current_order = (int) $db->sql_fetchfield('current_order');
$db->sql_freeresult($result);
$sql = 'UPDATE ' . $table . '
SET ' . $fields . "_order = $order_total - " . $fields . '_order
WHERE ' . $fields . "_order IN ($image_order, " . (($action == 'move_up') ? $image_order - 1 : $image_order + 1) . ')';
if ($current_order == 0 && $action == 'move_up')
{
break;
}
// on move_down, switch position with next order_id...
// on move_up, switch position with previous order_id...
$switch_order_id = ($action == 'move_down') ? $current_order + 1 : $current_order - 1;
//
$sql = "UPDATE $table
SET {$fields}_order = $current_order
WHERE {$fields}_order = $switch_order_id
AND {$fields}_id <> $icon_id";
$db->sql_query($sql);
// Only update the other entry too if the previous entry got updated
if ($db->sql_affectedrows())
{
$sql = "UPDATE $table
SET {$fields}_order = $switch_order_id
WHERE {$fields}_order = $current_order
AND {$fields}_id = $icon_id";
$db->sql_query($sql);
}
$cache->destroy('icons');
$cache->destroy('sql', $table);
@@ -632,8 +648,8 @@ class acp_icons
'EMOTION' => (isset($row['emotion'])) ? $row['emotion'] : '',
'U_EDIT' => $this->u_action . '&amp;action=edit&amp;id=' . $row[$fields . '_id'],
'U_DELETE' => $this->u_action . '&amp;action=delete&amp;id=' . $row[$fields . '_id'],
'U_MOVE_UP' => $this->u_action . '&amp;action=move_up&amp;order=' . $row[$fields . '_order'],
'U_MOVE_DOWN' => $this->u_action . '&amp;action=move_down&amp;order=' . $row[$fields . '_order'])
'U_MOVE_UP' => $this->u_action . '&amp;action=move_up&amp;id=' . $row[$fields . '_id'],
'U_MOVE_DOWN' => $this->u_action . '&amp;action=move_down&amp;id=' . $row[$fields . '_id'])
);
if (!$spacer && !$row['display_on_posting'])

View File

@@ -0,0 +1,184 @@
<?php
/**
*
* @package acp
* @version $Id$
* @copyright (c) 2006 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @package acp
*/
class acp_inactive
{
var $u_action;
var $p_master;
function acp_inactive(&$p_master)
{
$this->p_master = &$p_master;
}
function main($id, $mode)
{
global $config, $db, $user, $auth, $template;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
$user->add_lang('memberlist');
$action = request_var('action', '');
$mark = (isset($_REQUEST['mark'])) ? request_var('mark', array(0)) : array();
$start = request_var('start', 0);
// Sort keys
$sort_days = request_var('st', 0);
$sort_key = request_var('sk', 'i');
$sort_dir = request_var('sd', 'd');
if (sizeof($mark))
{
switch ($action)
{
case 'activate':
case 'delete':
$sql = 'SELECT username
FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('user_id', $mark);
$result = $db->sql_query($sql);
$user_affected = array();
while ($row = $db->sql_fetchrow($result))
{
$user_affected[] = $row['username'];
}
$db->sql_freeresult($result);
if ($action == 'activate')
{
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
user_active_flip('activate', $mark);
}
else if ($action == 'delete')
{
if (!$auth->acl_get('a_userdel'))
{
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'DELETE FROM ' . USER_GROUP_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $mark);
$db->sql_query($sql);
$sql = 'DELETE FROM ' . USERS_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $mark);
$db->sql_query($sql);
add_log('admin', 'LOG_INACTIVE_' . strtoupper($action), implode(', ', $user_affected));
}
break;
case 'remind':
if (empty($config['email_enable']))
{
trigger_error($user->lang['EMAIL_DISABLED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type, user_regdate, user_actkey
FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('user_id', $mark);
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result))
{
// Send the messages
include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
$messenger = new messenger();
$board_url = generate_board_url() . "/ucp.$phpEx?mode=activate";
$usernames = array();
do
{
$messenger->template('user_remind_inactive', $row['user_lang']);
$messenger->replyto($config['board_email']);
$messenger->to($row['user_email'], $row['username']);
$messenger->im($row['user_jabber'], $row['username']);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($row['username']),
'REGISTER_DATE' => $user->format_date($row['user_regdate']),
'U_ACTIVATE' => "$board_url&mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey'])
);
$messenger->send($row['user_notify_type']);
$usernames[] = $row['username'];
}
while ($row = $db->sql_fetchrow($result));
$messenger->save_queue();
add_log('admin', 'LOG_INACTIVE_REMIND', implode(', ', $usernames));
unset($usernames);
}
$db->sql_freeresult($result);
break;
}
}
// Sorting
$limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_text = array('i' => $user->lang['SORT_INACTIVE'], 'j' => $user->lang['SORT_REG_DATE'], 'l' => $user->lang['SORT_LAST_VISIT'], 'r' => $user->lang['SORT_REASON'], 'u' => $user->lang['SORT_USERNAME']);
$sort_by_sql = array('i' => 'user_inactive_time', 'j' => 'user_regdate', 'l' => 'user_lastvisit', 'r' => 'user_inactive_reason', 'u' => 'username');
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
// Define where and sort sql for use in displaying logs
$sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0;
$sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
$inactive = array();
$inactive_count = 0;
view_inactive_users($inactive, $inactive_count, $config['topics_per_page'], $start, $sql_where, $sql_sort);
foreach ($inactive as $row)
{
$template->assign_block_vars('inactive', array(
'INACTIVE_DATE' => $user->format_date($row['user_inactive_time']),
'JOINED' => $user->format_date($row['user_regdate']),
'LAST_VISIT' => (!$row['user_lastvisit']) ? ' - ' : $user->format_date($row['user_lastvisit']),
'REASON' => $row['inactive_reason'],
'USER_ID' => $row['user_id'],
'USERNAME' => $row['username'],
'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;mode=overview&amp;u={$row['user_id']}"))
);
}
$option_ary = array('activate' => 'ACTIVATE', 'delete' => 'DELETE');
if ($config['email_enable'])
{
$option_ary += array('remind' => 'REMIND');
}
$template->assign_vars(array(
'S_INACTIVE_USERS' => true,
'S_INACTIVE_OPTIONS' => build_select($option_ary),
'S_LIMIT_DAYS' => $s_limit_days,
'S_SORT_KEY' => $s_sort_key,
'S_SORT_DIR' => $s_sort_dir,
'S_ON_PAGE' => on_page($inactive_count, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination($this->u_action . "&amp;$u_sort_param", $inactive_count, $config['topics_per_page'], $start, true),
));
$this->tpl_name = 'acp_inactive';
$this->page_title = 'ACP_INACTIVE_USERS';
}
}
?>

View File

@@ -44,16 +44,9 @@ class acp_jabber
$jab_resource = request_var('jab_resource', $config['jab_resource']);
$jab_package_size = request_var('jab_package_size', $config['jab_package_size']);
$jabber = new jabber();
$jabber = new jabber($jab_host, $jab_port, $jab_username, $jab_password, $jab_resource);
$error = array();
// Setup the basis vars for jabber connection
$jabber->server = $jab_host;
$jabber->port = ($jab_port) ? $jab_port : 5222;
$jabber->username = $jab_username;
$jabber->password = $jab_password;
$jabber->resource = $jab_resource;
$message = $user->lang['JAB_SETTINGS_CHANGED'];
$log = 'JAB_SETTINGS_CHANGED';
@@ -65,7 +58,7 @@ class acp_jabber
{
if (!$jabber->connect())
{
trigger_error($user->lang['ERR_JAB_CONNECT'] . adm_back_link($this->u_action));
trigger_error($user->lang['ERR_JAB_CONNECT'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// First we'll try to authorise using this account, if that fails we'll try to create it.
@@ -94,12 +87,12 @@ class acp_jabber
{
if (!$jabber->connect())
{
trigger_error($user->lang['ERR_JAB_CONNECT'] . adm_back_link($this->u_action));
trigger_error($user->lang['ERR_JAB_CONNECT'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (!$jabber->send_auth())
{
trigger_error($user->lang['ERR_JAB_AUTH'] . adm_back_link($this->u_action));
trigger_error($user->lang['ERR_JAB_AUTH'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$jabber->send_presence(NULL, NULL, 'online');

View File

@@ -47,8 +47,10 @@ class acp_language
$missing_file = request_var('missing_file', array('' => 0));
list($_REQUEST['language_file'], ) = array_keys($missing_file);
}
list($this->language_directory, $this->language_file) = explode('|', request_var('language_file', '|common.' . $phpEx));
$selected_lang_file = request_var('language_file', '|common.' . $phpEx);
list($this->language_directory, $this->language_file) = explode('|', $selected_lang_file);
$this->language_directory = basename($this->language_directory);
$this->language_file = basename($this->language_file);
@@ -71,8 +73,13 @@ class acp_language
$transfer = new ftp(request_var('host', ''), request_var('username', ''), request_var('password', ''), request_var('root_path', ''), request_var('port', ''), request_var('timeout', ''));
break;
case 'ftp_fsock':
$transfer = new ftp_fsock(request_var('host', ''), request_var('username', ''), request_var('password', ''), request_var('root_path', ''), request_var('port', ''), request_var('timeout', ''));
break;
default:
trigger_error($user->lang['INVALID_UPLOAD_METHOD']);
trigger_error($user->lang['INVALID_UPLOAD_METHOD'], E_USER_ERROR);
break;
}
$test_connection = $transfer->open_session();
@@ -97,23 +104,13 @@ class acp_language
));
}
$entry = $_POST['entry'];
foreach ($entry as $key => $value)
{
if (is_array($value))
{
foreach ($value as $key2 => $data)
{
$entry[$key][$key2] = htmlentities($data);
}
}
else
{
$entry[$key] = htmlentities($value);
}
}
$hidden_data = build_hidden_fields(array('file' => $this->language_file, 'dir' => $this->language_directory, 'method' => $method, 'entry' => $entry));
$hidden_data = build_hidden_fields(array(
'file' => $this->language_file,
'dir' => $this->language_directory,
'method' => $method,
'entry' => $_POST['entry']),
true
);
$template->assign_vars(array(
'S_UPLOAD' => true,
@@ -130,10 +127,11 @@ class acp_language
if (!$lang_id)
{
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT * FROM ' . LANG_TABLE . "
$sql = 'SELECT *
FROM ' . LANG_TABLE . "
WHERE lang_id = $lang_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
@@ -158,17 +156,18 @@ class acp_language
case 'download_file':
case 'upload_data':
if (!$lang_id || !isset($_POST['entry']) || !is_array($_POST['entry']))
if (!$lang_id || empty($_POST['entry']))
{
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (!$this->language_file || (!$this->language_directory && !in_array($this->language_file, $this->main_files)))
{
trigger_error($user->lang['NO_FILE_SELECTED'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_FILE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT * FROM ' . LANG_TABLE . "
$sql = 'SELECT *
FROM ' . LANG_TABLE . "
WHERE lang_id = $lang_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
@@ -191,7 +190,7 @@ class acp_language
{
if (!@mkdir($dir, 0777))
{
trigger_error("Could not create directory $dir");
trigger_error("Could not create directory $dir", E_USER_ERROR);
}
@chmod($dir, 0777);
}
@@ -204,14 +203,13 @@ class acp_language
if (!$fp)
{
trigger_error($user->lang['UNABLE_TO_WRITE_FILE']);
trigger_error(sprintf($user->lang['UNABLE_TO_WRITE_FILE'], $filename) . adm_back_link($this->u_action . '&amp;id=' . $lang_id . '&amp;language_file=' . urlencode($selected_lang_file)), E_USER_WARNING);
}
if ($this->language_directory == 'email')
{
// Email Template
$entry = (STRIP) ? stripslashes($_POST['entry']) : $_POST['entry'];
$entry = preg_replace('#&amp;(\#[0-9]+;)#', '&\1', $entry);
$entry = $this->prepare_lang_entry($_POST['entry'], false);
fwrite($fp, $entry);
}
else
@@ -229,23 +227,19 @@ class acp_language
{
if (!is_array($value))
{
continue;
}
else
{
$entry = "\tarray(\n";
$entry = "\tarray(\n";
foreach ($value as $_key => $_value)
{
$_value = (STRIP) ? stripslashes($_value) : $_value;
$_value = preg_replace('#&amp;(\#[0-9]+;)#', '&\1', $_value);
$entry .= "\t\t" . (int) $_key . "\t=> '" . str_replace("'", "\\'", $_value) . "',\n";
}
$entry .= "\t),\n";
foreach ($value as $_key => $_value)
{
$entry .= "\t\t" . (int) $_key . "\t=> '" . $this->prepare_lang_entry($_value) . "',\n";
}
$entry .= "\t),\n";
fwrite($fp, $entry);
}
}
}
else
{
@@ -255,32 +249,13 @@ class acp_language
foreach ($_POST['entry'] as $key => $value)
{
if (!is_array($value))
{
$value = (STRIP) ? stripslashes($value) : $value;
$value = preg_replace('#&amp;(\#[0-9]+;)#', '&\1', $value);
$entry = "\t'" . $key . "'\t=> '" . str_replace("'", "\\'", $value) . "',\n";
}
else
{
$entry = "\n\t'" . $key . "'\t=> array(\n";
foreach ($value as $_key => $_value)
{
$_value = (STRIP) ? stripslashes($_value) : $_value;
$_value = preg_replace('#&amp;(\#[0-9]+;)#', '&\1', $_value);
$entry .= "\t\t'" . $_key . "'\t=> '" . str_replace("'", "\\'", $_value) . "',\n";
}
$entry .= "\t),\n\n";
}
$entry = $this->format_lang_array($key, $value);
fwrite($fp, $entry);
}
}
}
$footer = "));\n\n?>";
fwrite($fp, $footer);
fwrite($fp, $footer);
}
fclose($fp);
@@ -302,7 +277,8 @@ class acp_language
}
else if ($action == 'upload_data')
{
$sql = 'SELECT lang_iso FROM ' . LANG_TABLE . "
$sql = 'SELECT lang_iso
FROM ' . LANG_TABLE . "
WHERE lang_id = $lang_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
@@ -311,6 +287,8 @@ class acp_language
$file = request_var('file', '');
$dir = request_var('dir', '');
$selected_lang_file = $dir . '|' . $file;
$old_file = '/' . $this->get_filename($row['lang_iso'], $dir, $file, false, true);
$lang_path = 'language/' . $row['lang_iso'] . '/' . (($dir) ? $dir . '/' : '');
@@ -322,22 +300,31 @@ class acp_language
case 'ftp':
$transfer = new ftp(request_var('host', ''), request_var('username', ''), request_var('password', ''), request_var('root_path', ''), request_var('port', ''), request_var('timeout', ''));
break;
case 'ftp_fsock':
$transfer = new ftp_fsock(request_var('host', ''), request_var('username', ''), request_var('password', ''), request_var('root_path', ''), request_var('port', ''), request_var('timeout', ''));
break;
default:
trigger_error($user->lang['INVALID_UPLOAD_METHOD']);
trigger_error($user->lang['INVALID_UPLOAD_METHOD'], E_USER_ERROR);
break;
}
if (($result = $transfer->open_session()) !== true)
{
trigger_error($user->lang[$result] . adm_back_link($this->u_action));
trigger_error($user->lang[$result] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id . '&amp;language_file=' . urlencode($selected_lang_file)), E_USER_WARNING);
}
$transfer->rename($lang_path . $file, $lang_path . $file . '.bak');
$transfer->copy_file('store/' . $lang_path . $file, $lang_path . $file);
$transfer->close_session();
// Remove from storage folder
@unlink($phpbb_root_path . 'store/' . $lang_path . $file);
add_log('admin', 'LOG_LANGUAGE_FILE_REPLACED', $file);
trigger_error($user->lang['UPLOAD_COMPLETED']);
trigger_error($user->lang['UPLOAD_COMPLETED'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id . '&amp;language_file=' . urlencode($selected_lang_file)));
}
$action = 'details';
@@ -348,12 +335,13 @@ class acp_language
if (!$lang_id)
{
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$this->page_title = 'LANGUAGE_PACK_DETAILS';
$sql = 'SELECT * FROM ' . LANG_TABLE . '
$sql = 'SELECT *
FROM ' . LANG_TABLE . '
WHERE lang_id = ' . $lang_id;
$result = $db->sql_query($sql);
$lang_entries = $db->sql_fetchrow($result);
@@ -380,28 +368,28 @@ class acp_language
case 'email':
if (!in_array($this->language_file, $email_files))
{
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id));
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id), E_USER_WARNING);
}
break;
case 'acp':
if (!in_array($this->language_file, $acp_files))
{
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id));
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id), E_USER_WARNING);
}
break;
case 'mods':
if (!in_array($this->language_file, $mods_files))
{
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id));
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id), E_USER_WARNING);
}
break;
default:
if (!in_array($this->language_file, $this->main_files))
{
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id));
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id), E_USER_WARNING);
}
}
@@ -509,7 +497,7 @@ class acp_language
'S_MISSING_FILES' => true,
'L_MISSING_FILES' => sprintf($user->lang['THOSE_MISSING_LANG_FILES'], $lang_entries['lang_local_name']),
'MISSING_FILES' => implode('<br />', $missing_files))
);
);
}
if ($is_missing_var)
@@ -518,7 +506,7 @@ class acp_language
'S_MISSING_VARS' => true,
'L_MISSING_VARS_EXPLAIN' => sprintf($user->lang['THOSE_MISSING_LANG_VARIABLES'], $lang_entries['lang_local_name']),
'U_MISSING_ACTION' => $this->u_action . "&amp;action=$action&amp;id=$lang_id")
);
);
foreach ($missing_vars as $file => $vars)
{
@@ -550,7 +538,7 @@ class acp_language
$selected = (!$this->language_directory && $this->language_file == $file) ? ' selected="selected"' : '';
$s_lang_options .= '<option value="|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
}
// Help Files
$s_lang_options .= '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang['HELP_FILES'] . '</option>';
foreach ($this->main_files as $file)
@@ -577,7 +565,7 @@ class acp_language
}
$s_lang_options .= '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang[strtoupper($check) . '_FILES'] . '</option>';
foreach (${$check . '_files'} as $file)
{
$prefix = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, $check, $file, true, true))) ? '* ' : '';
@@ -617,6 +605,7 @@ class acp_language
unset($help);
}
}
$print_message = (($this->language_directory) ? $this->language_directory . '/' : '') . $this->language_file;
}
@@ -629,7 +618,7 @@ class acp_language
'PRINT_MESSAGE' => $print_message,
)
);
if (!$is_email_file)
{
$method = ($is_help_file) ? 'print_help_entries' : 'print_language_entries';
@@ -640,7 +629,7 @@ class acp_language
{
$tpl .= $this->$method($missing_vars[$name], '* ');
}
$tpl .= $this->$method($lang);
$template->assign_var('TPL', $tpl);
@@ -651,21 +640,23 @@ class acp_language
$template->assign_vars(array(
'LANG' => $lang)
);
unset($lang);
}
return;
break;
case 'delete':
if (!$lang_id)
{
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT * FROM ' . LANG_TABLE . '
$sql = 'SELECT *
FROM ' . LANG_TABLE . '
WHERE lang_id = ' . $lang_id;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
@@ -673,18 +664,18 @@ class acp_language
if ($row['lang_iso'] == $config['default_lang'])
{
trigger_error($user->lang['NO_REMOVE_DEFAULT_LANG'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_REMOVE_DEFAULT_LANG'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$db->sql_query('DELETE FROM ' . LANG_TABLE . ' WHERE lang_id = ' . $lang_id);
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_lang = '{$config['default_lang']}'
WHERE user_lang = '{$row['lang_iso']}'";
SET user_lang = '" . $db->sql_escape($config['default_lang']) . "'
WHERE user_lang = '" . $db->sql_escape($row['lang_iso']) . "'";
$db->sql_query($sql);
add_log('admin', 'LOG_LANGUAGE_PACK_DELETED', $row['lang_english_name']);
trigger_error(sprintf($user->lang['LANGUAGE_PACK_DELETED'], $row['lang_english_name']) . adm_back_link($this->u_action));
break;
@@ -694,7 +685,7 @@ class acp_language
if (!$lang_iso || !file_exists("{$phpbb_root_path}language/$lang_iso/iso.txt"))
{
trigger_error($user->lang['LANGUAGE_PACK_NOT_EXIST'] . adm_back_link($this->u_action));
trigger_error($user->lang['LANGUAGE_PACK_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$file = file("{$phpbb_root_path}language/$lang_iso/iso.txt");
@@ -702,26 +693,28 @@ class acp_language
$lang_pack = array(
'iso' => $lang_iso,
'name' => trim(htmlspecialchars($file[0])),
'local_name'=> trim(htmlspecialchars($file[1])),
'author' => trim(htmlspecialchars($file[2]))
'local_name'=> trim(htmlspecialchars($file[1], ENT_COMPAT, 'UTF-8')),
'author' => trim(htmlspecialchars($file[2], ENT_COMPAT, 'UTF-8'))
);
unset($file);
$sql = 'SELECT lang_iso FROM ' . LANG_TABLE . "
$sql = 'SELECT lang_iso
FROM ' . LANG_TABLE . "
WHERE lang_iso = '" . $db->sql_escape($lang_iso) . "'";
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result))
{
trigger_error($user->lang['LANGUAGE_PACK_ALREADY_INSTALLED'] . adm_back_link($this->u_action));
}
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($row)
{
trigger_error($user->lang['LANGUAGE_PACK_ALREADY_INSTALLED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (!$lang_pack['name'] || !$lang_pack['local_name'])
{
trigger_error($user->lang['INVALID_LANGUAGE_PACK'] . adm_back_link($this->u_action));
trigger_error($user->lang['INVALID_LANGUAGE_PACK'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// Add language pack
$sql_ary = array(
'lang_iso' => $lang_pack['iso'],
@@ -732,21 +725,22 @@ class acp_language
);
$db->sql_query('INSERT INTO ' . LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
add_log('admin', 'LOG_LANGUAGE_PACK_INSTALLED', $lang_pack['name']);
trigger_error(sprintf($user->lang['LANGUAGE_PACK_INSTALLED'], $lang_pack['name']) . adm_back_link($this->u_action));
break;
case 'download':
if (!$lang_id)
{
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT * FROM ' . LANG_TABLE . '
$sql = 'SELECT *
FROM ' . LANG_TABLE . '
WHERE lang_id = ' . $lang_id;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
@@ -762,7 +756,7 @@ class acp_language
{
continue;
}
$methods[] = $type;
}
@@ -783,7 +777,7 @@ class acp_language
'U_ACTION' => $this->u_action . "&amp;action=$action&amp;id=$lang_id",
'RADIO_BUTTONS' => $radio_buttons)
);
return;
}
@@ -794,7 +788,7 @@ class acp_language
include_once($phpbb_root_path . 'includes/functions_compress.' . $phpEx);
if ($use_method == 'zip')
if ($use_method == '.zip')
{
$compress = new compress_zip('w', $phpbb_root_path . 'store/lang_' . $row['lang_iso'] . $use_method);
}
@@ -818,15 +812,26 @@ class acp_language
// Add main files
$this->add_to_archive($compress, $this->main_files, $row['lang_iso']);
// Add search files if they exist...
if (file_exists($phpbb_root_path . 'language/' . $row['lang_iso'] . '/search_ignore_words.' . $phpEx))
{
$this->add_to_archive($compress, array("search_ignore_words.$phpEx"), $row['lang_iso']);
}
if (file_exists($phpbb_root_path . 'language/' . $row['lang_iso'] . '/search_synonyms.' . $phpEx))
{
$this->add_to_archive($compress, array("search_synonyms.$phpEx"), $row['lang_iso']);
}
// Write files in folders
$this->add_to_archive($compress, $email_templates, $row['lang_iso'], 'email');
$this->add_to_archive($compress, $acp_files, $row['lang_iso'], 'acp');
$this->add_to_archive($compress, $mod_files, $row['lang_iso'], 'mods');
// Write ISO File
$iso_src = html_entity_decode($row['lang_english_name']) . "\n";
$iso_src .= html_entity_decode($row['lang_local_name']) . "\n";
$iso_src .= html_entity_decode($row['lang_author']);
$iso_src = htmlspecialchars_decode($row['lang_english_name']) . "\n";
$iso_src .= htmlspecialchars_decode($row['lang_local_name']) . "\n";
$iso_src .= htmlspecialchars_decode($row['lang_author']);
$compress->add_data($iso_src, 'language/' . $row['lang_iso'] . '/iso.txt');
// index.html files
@@ -842,7 +847,7 @@ class acp_language
$compress->close();
$compress->download('lang_' . $row['lang_iso']);
@unlink($phpbb_root_path . 'store/lang_' . $row['lang_iso'] . '.' . $use_method);
@unlink($phpbb_root_path . 'store/lang_' . $row['lang_iso'] . $use_method);
exit;
@@ -862,7 +867,8 @@ class acp_language
$db->sql_freeresult($result);
$sql = 'SELECT *
FROM ' . LANG_TABLE;
FROM ' . LANG_TABLE . '
ORDER BY lang_english_name';
$result = $db->sql_query($sql);
$installed = array();
@@ -873,18 +879,16 @@ class acp_language
$tagstyle = ($row['lang_iso'] == $config['default_lang']) ? '*' : '';
$template->assign_block_vars('lang', array(
'U_DETAILS' => $this->u_action . "&amp;action=details&amp;id={$row['lang_id']}",
'U_DOWNLOAD' => $this->u_action . "&amp;action=download&amp;id={$row['lang_id']}",
'U_DELETE' => $this->u_action . "&amp;action=delete&amp;id={$row['lang_id']}",
'U_DETAILS' => $this->u_action . "&amp;action=details&amp;id={$row['lang_id']}",
'U_DOWNLOAD' => $this->u_action . "&amp;action=download&amp;id={$row['lang_id']}",
'U_DELETE' => $this->u_action . "&amp;action=delete&amp;id={$row['lang_id']}",
'ENGLISH_NAME' => $row['lang_english_name'],
'TAG' => $tagstyle,
'LOCAL_NAME' => $row['lang_local_name'],
'ISO' => $row['lang_iso'],
'USED_BY' => (isset($lang_count[$row['lang_iso']])) ? $lang_count[$row['lang_iso']] : 0,
)
);
'ENGLISH_NAME' => $row['lang_english_name'],
'TAG' => $tagstyle,
'LOCAL_NAME' => $row['lang_local_name'],
'ISO' => $row['lang_iso'],
'USED_BY' => (isset($lang_count[$row['lang_iso']])) ? $lang_count[$row['lang_iso']] : 0,
));
}
$db->sql_freeresult($result);
@@ -893,7 +897,7 @@ class acp_language
while (($file = readdir($dp)) !== false)
{
if ($file{0} != '.' && file_exists("{$phpbb_root_path}language/$file/iso.txt"))
if ($file[0] != '.' && file_exists("{$phpbb_root_path}language/$file/iso.txt"))
{
if (!in_array($file, $installed))
{
@@ -920,14 +924,14 @@ class acp_language
foreach ($new_ary as $iso => $lang_ary)
{
$template->assign_block_vars('notinst', array(
'ISO' => $lang_ary['iso'],
'LOCAL_NAME' => $lang_ary['local_name'],
'NAME' => $lang_ary['name'],
'ISO' => htmlspecialchars($lang_ary['iso']),
'LOCAL_NAME' => htmlspecialchars($lang_ary['local_name'], ENT_COMPAT, 'UTF-8'),
'NAME' => htmlspecialchars($lang_ary['name'], ENT_COMPAT, 'UTF-8'),
'U_INSTALL' => $this->u_action . '&amp;action=install&amp;iso=' . urlencode($lang_ary['iso']))
);
}
}
unset($new_ary);
}
@@ -945,7 +949,7 @@ class acp_language
* {FILENAME} [{LANG_NAME}]
*
* @package language
* @copyright (c) 2005 phpBB Group
* @copyright (c) 2006 phpBB Group
* @author {CHANGED} - {AUTHOR}
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
@@ -961,6 +965,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// \'Page %s of %s\' you can (and should) write \'Page %1$s of %2$s\', this allows
// translators to re-order the output of data while ensuring it remains correct
@@ -975,8 +981,7 @@ $lang = array_merge($lang, array(
';
// Language files in language root directory
$this->main_files = array("common.$phpEx", "groups.$phpEx", "mcp.$phpEx", "memberlist.$phpEx", "posting.$phpEx", "search.$phpEx", "ucp.$phpEx", "viewforum.$phpEx", "viewtopic.$phpEx", "help_bbcode.$phpEx", "help_faq.$phpEx");
$this->main_files = array("common.$phpEx", "groups.$phpEx", "install.$phpEx", "mcp.$phpEx", "memberlist.$phpEx", "posting.$phpEx", "search.$phpEx", "ucp.$phpEx", "viewforum.$phpEx", "viewtopic.$phpEx", "help_bbcode.$phpEx", "help_faq.$phpEx");
}
/**
@@ -1036,27 +1041,57 @@ $lang = array_merge($lang, array(
{
$tpl .= '
<tr>
<td class="row3" colspan="2">' . $key_prefix . '<b>' . $key . '</b></td>
<td class="row3" colspan="2">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '</b></td>
</tr>';
foreach ($value as $_key => $_value)
{
$tpl .= '
<tr>
<td class="row1" style="white-space: nowrap;">' . $key_prefix . '<b>' . $_key . '</b></td>
<td class="row2">';
if ($input_field)
if (is_array($_value))
{
$tpl .= '<input type="text" name="entry[' . $key . '][' . $_key . ']" value="' . htmlspecialchars($_value) . '" size="50" />';
$tpl .= '
<tr>
<td class="row3" colspan="2">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '&nbsp; &nbsp;<b>' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '</b></td>
</tr>';
foreach ($_value as $__key => $__value)
{
$tpl .= '
<tr>
<td class="row1" style="white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($__key, ENT_COMPAT, 'UTF-8') . '</b></td>
<td class="row2">';
if ($input_field)
{
$tpl .= '<input type="text" name="entry[' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '][' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '][' . htmlspecialchars($__key, ENT_COMPAT, 'UTF-8') . ']" value="' . htmlspecialchars($__value, ENT_COMPAT, 'UTF-8') . '" size="50" />';
}
else
{
$tpl .= '<b>' . htmlspecialchars($__value, ENT_COMPAT, 'UTF-8') . '</b>';
}
$tpl .= '</td>
</tr>';
}
}
else
{
$tpl .= '<b>' . htmlspecialchars($_value) . '</b>';
$tpl .= '
<tr>
<td class="row1" style="white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '</b></td>
<td class="row2">';
if ($input_field)
{
$tpl .= '<input type="text" name="entry[' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '][' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . ']" value="' . htmlspecialchars($_value, ENT_COMPAT, 'UTF-8') . '" size="50" />';
}
else
{
$tpl .= '<b>' . htmlspecialchars($_value, ENT_COMPAT, 'UTF-8') . '</b>';
}
$tpl .= '</td>
</tr>';
}
$tpl .= '</td>
</tr>';
}
$tpl .= '
@@ -1068,16 +1103,16 @@ $lang = array_merge($lang, array(
{
$tpl .= '
<tr>
<td class="row1" style="white-space: nowrap;">' . $key_prefix . '<b>' . $key . '</b></td>
<td class="row1" style="white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '</b></td>
<td class="row2">';
if ($input_field)
{
$tpl .= '<input type="text" name="entry[' . $key . ']" value="' . htmlspecialchars($value) . '" size="50" />';
$tpl .= '<input type="text" name="entry[' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . ']" value="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '" size="50" />';
}
else
{
$tpl .= '<b>' . htmlspecialchars($value) . '</b>';
$tpl .= '<b>' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '</b>';
}
$tpl .= '</td>
@@ -1101,23 +1136,23 @@ $lang = array_merge($lang, array(
{
$tpl .= '
<tr>
<td class="row3" colspan="2">' . $key_prefix . '<b>' . $key . '</b></td>
<td class="row3" colspan="2">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '</b></td>
</tr>';
foreach ($value as $_key => $_value)
{
$tpl .= '
<tr>
<td class="row1" style="width: 10%; white-space: nowrap;">' . $key_prefix . '<b>' . $_key . '</b></td>
<td class="row1" style="width: 10%; white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '</b></td>
<td class="row2">';
if ($text_field)
{
$tpl .= '<textarea name="entry[' . $key . '][' . $_key . ']" cols="80" rows="5" style="width: 90%;">' . htmlspecialchars($_value) . '</textarea>';
$tpl .= '<textarea name="entry[' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '][' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . ']" cols="80" rows="5" style="width: 90%;">' . htmlspecialchars($_value, ENT_COMPAT, 'UTF-8') . '</textarea>';
}
else
{
$tpl .= '<b>' . htmlspecialchars($_value) . '</b>';
$tpl .= '<b>' . htmlspecialchars($_value, ENT_COMPAT, 'UTF-8') . '</b>';
}
$tpl .= '</td>
@@ -1133,23 +1168,23 @@ $lang = array_merge($lang, array(
{
$tpl .= '
<tr>
<td class="row1" style="width: 10%; white-space: nowrap;">' . $key_prefix . '<b>' . $key . '</b></td>
<td class="row1" style="width: 10%; white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '</b></td>
<td class="row2">';
if ($text_field)
{
$tpl .= '<textarea name="entry[' . $key . ']" cols="80" rows="5" style="width: 90%;">' . htmlspecialchars($value) . '</textarea>';
$tpl .= '<textarea name="entry[' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . ']" cols="80" rows="5" style="width: 90%;">' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '</textarea>';
}
else
{
$tpl .= '<b>' . htmlspecialchars($value) . '</b>';
$tpl .= '<b>' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '</b>';
}
$tpl .= '</td>
</tr>';
}
}
return $tpl;
}
@@ -1191,6 +1226,49 @@ $lang = array_merge($lang, array(
return $return_ary;
}
/**
* Return language string value for storage
*/
function prepare_lang_entry($text, $store = true)
{
$text = (STRIP) ? stripslashes($text) : $text;
// Adjust for storage...
if ($store)
{
$text = str_replace("'", "\\'", str_replace('\\', '\\\\', $text));
}
return $text;
}
/**
* Format language array for storage
*/
function format_lang_array($key, $value, $tabs = "\t")
{
$entry = '';
if (!is_array($value))
{
$entry .= "{$tabs}'{$key}'\t=> '" . $this->prepare_lang_entry($value) . "',\n";
}
else
{
$_tabs = $tabs . "\t";
$entry .= "\n{$tabs}'{$key}'\t=> array(\n";
foreach ($value as $_key => $_value)
{
$entry .= $this->format_lang_array($_key, $_value, $_tabs);
}
$entry .= "{$tabs}),\n\n";
}
return $entry;
}
}
?>

View File

@@ -42,14 +42,15 @@ class acp_logs
if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs'))
{
$where_sql = '';
if ($deletemark && $marked)
if ($deletemark && sizeof($marked))
{
$sql_in = array();
foreach ($marked as $mark)
{
$sql_in[] = $mark;
}
$where_sql = ' AND log_id IN (' . implode(', ', $sql_in) . ')';
$where_sql = ' AND ' . $db->sql_in_set('log_id', $sql_in);
unset($sql_in);
}
@@ -67,7 +68,7 @@ class acp_logs
// Sorting
$limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']);
$sort_by_sql = array('u' => 'l.user_id', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation');
$sort_by_sql = array('u' => 'u.username', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation');
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);

View File

@@ -20,132 +20,43 @@ class acp_main
global $config, $db, $user, $auth, $template;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
$action = request_var('action', '');
$mark = (isset($_REQUEST['mark'])) ? implode(', ', request_var('mark', array(0))) : '';
if ($mark)
// Show restore permissions notice
if ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm'))
{
switch ($action)
{
case 'activate':
case 'delete':
$this->tpl_name = 'acp_main';
$this->page_title = 'ACP_MAIN';
if (!$auth->acl_get('a_user'))
{
trigger_error($user->lang['NO_ADMIN']);
}
$sql = 'SELECT user_id, username, user_colour
FROM ' . USERS_TABLE . '
WHERE user_id = ' . $user->data['user_perm_from'];
$result = $db->sql_query($sql);
$user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$sql = 'SELECT username
FROM ' . USERS_TABLE . "
WHERE user_id IN ($mark)";
$result = $db->sql_query($sql);
$user_affected = array();
while ($row = $db->sql_fetchrow($result))
{
$user_affected[] = $row['username'];
}
$db->sql_freeresult($result);
$perm_from = '<strong' . (($user_row['user_colour']) ? ' style="color: #' . $user_row['user_colour'] . '">' : '>');
$perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $user_row['user_id']) . '">' : '';
$perm_from .= $user_row['username'];
$perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '</a>' : '';
$perm_from .= '</strong>';
if ($action == 'activate')
{
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
$mark_ary = explode(', ', $mark);
$template->assign_vars(array(
'S_RESTORE_PERMISSIONS' => true,
'U_RESTORE_PERMISSIONS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm'),
'PERM_FROM' => $perm_from,
'L_PERMISSIONS_TRANSFERED_EXPLAIN' => sprintf($user->lang['PERMISSIONS_TRANSFERED_EXPLAIN'], $perm_from, append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm')),
));
foreach ($mark_ary as $user_id)
{
user_active_flip($user_id, USER_INACTIVE);
}
set_config('num_users', $config['num_users'] + sizeof($mark_ary), true);
// Update latest username
update_last_username();
}
else if ($action == 'delete')
{
if (!$auth->acl_get('a_userdel'))
{
trigger_error($user->lang['NO_ADMIN']);
}
$sql = 'DELETE FROM ' . USER_GROUP_TABLE . " WHERE user_id IN ($mark)";
$db->sql_query($sql);
$sql = 'DELETE FROM ' . USERS_TABLE . " WHERE user_id IN ($mark)";
$db->sql_query($sql);
add_log('admin', 'LOG_INDEX_' . strtoupper($action), implode(', ', $user_affected));
}
break;
case 'remind':
if (!$auth->acl_get('a_user'))
{
trigger_error($user->lang['NO_ADMIN']);
}
if (empty($config['email_enable']))
{
trigger_error($user->lang['EMAIL_DISABLED']);
}
$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type, user_regdate, user_actkey
FROM ' . USERS_TABLE . "
WHERE user_id IN ($mark)";
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result))
{
// Send the messages
include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
$messenger = new messenger();
$board_url = generate_board_url() . "/ucp.$phpEx?mode=activate";
$sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']);
$usernames = array();
do
{
$messenger->template('user_remind_inactive', $row['user_lang']);
$messenger->replyto($config['board_email']);
$messenger->to($row['user_email'], $row['username']);
$messenger->im($row['user_jabber'], $row['username']);
$messenger->assign_vars(array(
'EMAIL_SIG' => $sig,
'USERNAME' => html_entity_decode($row['username']),
'SITENAME' => $config['sitename'],
'REGISTER_DATE' => $user->format_date($row['user_regdate']),
'U_ACTIVATE' => "$board_url&mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey'])
);
$messenger->send($row['user_notify_type']);
$usernames[] = $row['username'];
}
while ($row = $db->sql_fetchrow($result));
$messenger->save_queue();
add_log('admin', 'LOG_INDEX_REMIND', implode(', ', $usernames));
unset($usernames);
}
$db->sql_freeresult($result);
break;
}
return;
}
$action = request_var('action', '');
switch ($action)
{
case 'online':
if (!$auth->acl_get('a_board'))
{
trigger_error($user->lang['NO_ADMIN']);
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
set_config('record_online_users', 1, true);
@@ -156,47 +67,47 @@ class acp_main
case 'stats':
if (!$auth->acl_get('a_board'))
{
trigger_error($user->lang['NO_ADMIN']);
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT COUNT(post_id) AS stat
FROM ' . POSTS_TABLE . '
WHERE post_approved = 1';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
set_config('num_posts', (int) $row['stat'], true);
$sql = 'SELECT COUNT(topic_id) AS stat
FROM ' . TOPICS_TABLE . '
WHERE topic_approved = 1';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
set_config('num_topics', (int) $row['stat'], true);
$sql = 'SELECT COUNT(user_id) AS stat
FROM ' . USERS_TABLE . '
WHERE user_type IN (' . USER_NORMAL . ',' . USER_FOUNDER . ')';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
set_config('num_users', (int) $row['stat'], true);
$sql = 'SELECT COUNT(attach_id) as stat
FROM ' . ATTACHMENTS_TABLE;
FROM ' . ATTACHMENTS_TABLE . '
WHERE is_orphan = 0';
$result = $db->sql_query($sql);
set_config('num_files', (int) $db->sql_fetchfield('stat'), true);
$db->sql_freeresult($result);
$sql = 'SELECT SUM(filesize) as stat
FROM ' . ATTACHMENTS_TABLE;
FROM ' . ATTACHMENTS_TABLE . '
WHERE is_orphan = 0';
$result = $db->sql_query($sql);
set_config('upload_dir_size', (int) $db->sql_fetchfield('stat'), true);
$db->sql_freeresult($result);
@@ -206,48 +117,29 @@ class acp_main
case 'user':
if (!$auth->acl_get('a_board'))
{
trigger_error($user->lang['NO_ADMIN']);
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$post_count_ary = $auth->acl_getf('f_postcount');
$forum_read_ary = $auth->acl_getf('f_read');
$forum_ary = array();
foreach ($post_count_ary as $forum_id => $allowed)
{
if ($allowed['f_postcount'] && $forum_read_ary[$forum_id]['f_read'])
{
$forum_ary[] = $forum_id;
}
}
$sql = 'SELECT COUNT(post_id) AS num_posts, poster_id
FROM ' . POSTS_TABLE . '
WHERE post_postcount = 1
GROUP BY poster_id';
$result = $db->sql_query($sql);
if (!sizeof($forum_ary))
while ($row = $db->sql_fetchrow($result))
{
$db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_posts = 0');
}
else
{
$sql = 'SELECT COUNT(post_id) AS num_posts, poster_id
FROM ' . POSTS_TABLE . '
WHERE poster_id <> ' . ANONYMOUS . '
AND forum_id IN (' . implode(', ', $forum_ary) . ')
GROUP BY poster_id';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$db->sql_query('UPDATE ' . USERS_TABLE . " SET user_posts = {$row['num_posts']} WHERE user_id = {$row['poster_id']}");
}
$db->sql_freeresult($result);
$db->sql_query('UPDATE ' . USERS_TABLE . " SET user_posts = {$row['num_posts']} WHERE user_id = {$row['poster_id']}");
}
$db->sql_freeresult($result);
add_log('admin', 'LOG_RESYNC_POSTCOUNTS');
break;
case 'date':
if (!$auth->acl_get('a_board'))
{
trigger_error($user->lang['NO_ADMIN']);
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
set_config('board_startdate', time() - 1);
@@ -255,7 +147,7 @@ class acp_main
break;
case 'db_track':
$db->sql_query(((SQL_LAYER != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . TOPICS_POSTED_TABLE);
$db->sql_query((($db->sql_layer != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . TOPICS_POSTED_TABLE);
// This can get really nasty... therefore we only do the last six months
$get_from_time = time() - (6 * 4 * 7 * 24 * 60 * 60);
@@ -310,24 +202,7 @@ class acp_main
}
unset($posted);
if (sizeof($sql_ary))
{
switch (SQL_LAYER)
{
case 'mysql':
case 'mysql4':
case 'mysqli':
$db->sql_query('INSERT INTO ' . TOPICS_POSTED_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary));
break;
default:
foreach ($sql_ary as $ary)
{
$db->sql_query('INSERT INTO ' . TOPICS_POSTED_TABLE . ' ' . $db->sql_build_array('INSERT', $ary));
}
break;
}
}
$db->sql_multi_insert(TOPICS_POSTED_TABLE, $sql_ary);
}
add_log('admin', 'LOG_RESYNC_POST_MARKING');
@@ -357,7 +232,7 @@ class acp_main
{
while (($file = readdir($avatar_dir)) !== false)
{
if ($file{0} != '.' && $file != 'CVS' && strpos($file, 'index.') === false)
if ($file[0] != '.' && $file != 'CVS' && strpos($file, 'index.') === false)
{
$avatar_dir_size += filesize($phpbb_root_path . $config['avatar_path'] . '/' . $file);
}
@@ -395,6 +270,21 @@ class acp_main
$files_per_day = $total_files;
}
if ($config['allow_attachments'] || $config['allow_pm_attach'])
{
$sql = 'SELECT COUNT(attach_id) AS total_orphan
FROM ' . ATTACHMENTS_TABLE . '
WHERE is_orphan = 1
AND filetime < ' . (time() - 3*60*60);
$result = $db->sql_query($sql);
$total_orphan = (int) $db->sql_fetchfield('total_orphan');
$db->sql_freeresult($result);
}
else
{
$total_orphan = false;
}
$dbsize = get_database_size();
$s_action_options = build_select(array('online' => 'RESET_ONLINE', 'date' => 'RESET_DATE', 'stats' => 'RESYNC_STATS', 'user' => 'RESYNC_POSTCOUNTS', 'db_track' => 'RESYNC_POST_MARKING'));
@@ -411,9 +301,14 @@ class acp_main
'AVATAR_DIR_SIZE' => $avatar_dir_size,
'DBSIZE' => $dbsize,
'UPLOAD_DIR_SIZE' => $upload_dir_size,
'TOTAL_ORPHAN' => $total_orphan,
'S_TOTAL_ORPHAN' => ($total_orphan === false) ? false : true,
'GZIP_COMPRESSION' => ($config['gzip_compress']) ? $user->lang['ON'] : $user->lang['OFF'],
'DATABASE_INFO' => $db->sql_server_info(),
'U_ACTION' => append_sid("{$phpbb_admin_path}index.$phpEx"),
'U_ADMIN_LOG' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&amp;mode=admin'),
'U_INACTIVE_USERS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&amp;mode=list'),
'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? $s_action_options : '',
)
@@ -439,16 +334,18 @@ class acp_main
if ($auth->acl_get('a_user'))
{
$sql = 'SELECT user_id, username, user_regdate
FROM ' . USERS_TABLE . '
WHERE user_type = ' . USER_INACTIVE . '
ORDER BY user_regdate ASC';
$result = $db->sql_query($sql);
$inactive = array();
$inactive_count = 0;
while ($row = $db->sql_fetchrow($result))
view_inactive_users($inactive, $inactive_count, 10);
foreach ($inactive as $row)
{
$template->assign_block_vars('inactive', array(
'DATE' => $user->format_date($row['user_regdate']),
'INACTIVE_DATE' => $user->format_date($row['user_inactive_time']),
'JOINED' => $user->format_date($row['user_regdate']),
'LAST_VISIT' => (!$row['user_lastvisit']) ? ' - ' : $user->format_date($row['user_lastvisit']),
'REASON' => $row['inactive_reason'],
'USER_ID' => $row['user_id'],
'USERNAME' => $row['username'],
'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;mode=overview&amp;u={$row['user_id']}"))
@@ -467,10 +364,10 @@ class acp_main
);
}
// Display debug_extra notice
if (defined('DEBUG_EXTRA'))
// Warn if install is still present
if (file_exists($phpbb_root_path . 'install'))
{
$template->assign_var('S_DEBUG_EXTRA', true);
$template->assign_var('S_REMOVE_INSTALL', true);
}
$this->tpl_name = 'acp_main';

View File

@@ -24,6 +24,7 @@
class acp_modules
{
var $module_class = '';
var $parent_id;
var $u_action;
function main($id, $mode)
@@ -51,7 +52,7 @@ class acp_modules
$this->page_title = strtoupper($this->module_class);
$parent_id = request_var('parent_id', 0);
$this->parent_id = request_var('parent_id', 0);
$module_id = request_var('m', 0);
$action = request_var('action', '');
$errors = array();
@@ -61,9 +62,9 @@ class acp_modules
case 'delete':
if (!$module_id)
{
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
if (confirm_box(true))
{
$errors = $this->delete_module($module_id);
@@ -71,7 +72,7 @@ class acp_modules
if (!sizeof($errors))
{
$this->remove_cache_file();
trigger_error($user->lang['MODULE_DELETED'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
trigger_error($user->lang['MODULE_DELETED'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
}
}
else
@@ -79,7 +80,7 @@ class acp_modules
confirm_box(false, 'DELETE_MODULE', build_hidden_fields(array(
'i' => $id,
'mode' => $mode,
'parent_id' => $parent_id,
'parent_id' => $this->parent_id,
'module_id' => $module_id,
'action' => $action,
)));
@@ -91,9 +92,9 @@ class acp_modules
case 'disable':
if (!$module_id)
{
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
$sql = 'UPDATE ' . MODULES_TABLE . '
SET module_enabled = ' . (($action == 'enable') ? 1 : 0) . "
WHERE module_id = $module_id";
@@ -108,7 +109,7 @@ class acp_modules
case 'move_down':
if (!$module_id)
{
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
$sql = 'SELECT *
@@ -121,7 +122,7 @@ class acp_modules
if (!$row)
{
trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
$move_module_name = $this->move_module_by($row, $action, 1);
@@ -144,19 +145,19 @@ class acp_modules
break;
}
list($module_name, $module_mode) = explode('::', $quick_install);
list($module_basename, $module_mode) = explode('::', $quick_install);
// Check if module name and mode exist...
$fileinfo = $this->get_module_infos($module_name);
$fileinfo = $fileinfo[$module_name];
$fileinfo = $this->get_module_infos($module_basename);
$fileinfo = $fileinfo[$module_basename];
if (isset($fileinfo['modes'][$module_mode]))
{
$module_data = array(
'module_name' => $module_name,
'module_basename' => $module_basename,
'module_enabled' => 0,
'module_display' => (isset($fileinfo['modes'][$module_mode]['display'])) ? $fileinfo['modes'][$module_mode]['display'] : 1,
'parent_id' => $parent_id,
'parent_id' => $this->parent_id,
'module_class' => $this->module_class,
'module_langname' => $fileinfo['modes'][$module_mode]['title'],
'module_mode' => $module_mode,
@@ -169,7 +170,7 @@ class acp_modules
{
$this->remove_cache_file();
trigger_error($user->lang['MODULE_ADDED'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
trigger_error($user->lang['MODULE_ADDED'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
}
}
}
@@ -178,7 +179,7 @@ class acp_modules
confirm_box(false, 'ADD_MODULE', build_hidden_fields(array(
'i' => $id,
'mode' => $mode,
'parent_id' => $parent_id,
'parent_id' => $this->parent_id,
'action' => 'quickadd',
'quick_install' => $quick_install,
)));
@@ -190,7 +191,7 @@ class acp_modules
if (!$module_id)
{
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
$module_row = $this->get_module_row($module_id);
@@ -202,7 +203,7 @@ class acp_modules
if ($action == 'add')
{
$module_row = array(
'module_name' => '',
'module_basename' => '',
'module_enabled' => 0,
'module_display' => 1,
'parent_id' => 0,
@@ -214,7 +215,7 @@ class acp_modules
$module_data = array();
$module_data['module_name'] = request_var('module_name', (string) $module_row['module_name']);
$module_data['module_basename'] = request_var('module_basename', (string) $module_row['module_basename']);
$module_data['module_enabled'] = request_var('module_enabled', (int) $module_row['module_enabled']);
$module_data['module_display'] = request_var('module_display', (int) $module_row['module_display']);
$module_data['parent_id'] = request_var('module_parent_id', (int) $module_row['parent_id']);
@@ -228,14 +229,14 @@ class acp_modules
{
if (!$module_data['module_langname'])
{
trigger_error($user->lang['NO_MODULE_LANGNAME'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
trigger_error($user->lang['NO_MODULE_LANGNAME'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
$module_type = request_var('module_type', 'category');
if ($module_type == 'category')
{
$module_data['module_name'] = $module_data['module_mode'] = $module_data['module_auth'] = '';
$module_data['module_basename'] = $module_data['module_mode'] = $module_data['module_auth'] = '';
$module_data['module_display'] = 1;
}
@@ -245,10 +246,10 @@ class acp_modules
}
// Adjust auth row
if ($module_data['module_name'] && $module_data['module_mode'])
if ($module_data['module_basename'] && $module_data['module_mode'])
{
$fileinfo = $this->get_module_infos($module_data['module_name']);
$module_data['module_auth'] = $fileinfo[$module_data['module_name']]['modes'][$module_data['module_mode']]['auth'];
$fileinfo = $this->get_module_infos($module_data['module_basename']);
$module_data['module_auth'] = $fileinfo[$module_data['module_basename']]['modes'][$module_data['module_mode']]['auth'];
}
$errors = $this->update_module_data($module_data);
@@ -257,12 +258,12 @@ class acp_modules
{
$this->remove_cache_file();
trigger_error((($action == 'add') ? $user->lang['MODULE_ADDED'] : $user->lang['MODULE_EDITED']) . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
trigger_error((($action == 'add') ? $user->lang['MODULE_ADDED'] : $user->lang['MODULE_EDITED']) . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
}
}
// Category/not category?
$is_cat = (!$module_data['module_name']) ? true : false;
$is_cat = (!$module_data['module_basename']) ? true : false;
// Get module informations
$module_infos = $this->get_module_infos();
@@ -271,20 +272,20 @@ class acp_modules
$s_name_options = $s_mode_options = '';
foreach ($module_infos as $option => $values)
{
if (!$module_data['module_name'])
if (!$module_data['module_basename'])
{
$module_data['module_name'] = $option;
$module_data['module_basename'] = $option;
}
// Name options
$s_name_options .= '<option value="' . $option . '"' . (($option == $module_data['module_name']) ? ' selected="selected"' : '') . '>' . $this->lang_name($values['title']) . ' [' . $this->module_class . '_' . $option . ']</option>';
$s_name_options .= '<option value="' . $option . '"' . (($option == $module_data['module_basename']) ? ' selected="selected"' : '') . '>' . $this->lang_name($values['title']) . ' [' . $this->module_class . '_' . $option . ']</option>';
$template->assign_block_vars('m_names', array('NAME' => $option));
// Build module modes
foreach ($values['modes'] as $m_mode => $m_values)
{
if ($option == $module_data['module_name'])
if ($option == $module_data['module_basename'])
{
$s_mode_options .= '<option value="' . $m_mode . '"' . (($m_mode == $module_data['module_mode']) ? ' selected="selected"' : '') . '>' . $this->lang_name($m_values['title']) . '</option>';
}
@@ -306,8 +307,8 @@ class acp_modules
'S_CAT_OPTIONS' => $s_cat_option . $this->make_module_select($module_data['parent_id'], ($action == 'edit') ? $module_row['module_id'] : false, false, false, false, true),
'S_MODULE_NAMES' => $s_name_options,
'S_MODULE_MODES' => $s_mode_options,
'U_BACK' => $this->u_action . '&amp;parent_id=' . $parent_id,
'U_EDIT_ACTION' => $this->u_action . '&amp;parent_id=' . $parent_id,
'U_BACK' => $this->u_action . '&amp;parent_id=' . $this->parent_id,
'U_EDIT_ACTION' => $this->u_action . '&amp;parent_id=' . $this->parent_id,
'L_TITLE' => $user->lang[strtoupper($action) . '_MODULE'],
@@ -341,7 +342,7 @@ class acp_modules
);
}
if (!$parent_id)
if (!$this->parent_id)
{
$navigation = strtoupper($this->module_class);
}
@@ -349,12 +350,13 @@ class acp_modules
{
$navigation = '<a href="' . $this->u_action . '">' . strtoupper($this->module_class) . '</a>';
$modules_nav = $this->get_module_branch($parent_id, 'parents', 'descending');
$modules_nav = $this->get_module_branch($this->parent_id, 'parents', 'descending');
foreach ($modules_nav as $row)
{
$langname = $this->lang_name($row['module_langname']);
if ($row['module_id'] == $parent_id)
if ($row['module_id'] == $this->parent_id)
{
$navigation .= ' -&gt; ' . $langname;
}
@@ -366,11 +368,11 @@ class acp_modules
}
// Jumpbox
$module_box = $this->make_module_select($parent_id, false, false, false, false);
$module_box = $this->make_module_select($this->parent_id, false, false, false, false);
$sql = 'SELECT *
FROM ' . MODULES_TABLE . "
WHERE parent_id = $parent_id
WHERE parent_id = {$this->parent_id}
AND module_class = '" . $db->sql_escape($this->module_class) . "'
ORDER BY left_id";
$result = $db->sql_query($sql);
@@ -387,17 +389,20 @@ class acp_modules
}
else
{
$module_image = (!$row['module_name'] || $row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" width="46" height="25" alt="' . $user->lang['CATEGORY'] . '" />' : '<img src="images/icon_folder.gif" width="46" height="25" alt="' . $user->lang['MODULE'] . '" />';
$module_image = (!$row['module_basename'] || $row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" width="46" height="25" alt="' . $user->lang['CATEGORY'] . '" />' : '<img src="images/icon_folder.gif" width="46" height="25" alt="' . $user->lang['MODULE'] . '" />';
}
$url = $this->u_action . '&amp;parent_id=' . $parent_id . '&amp;m=' . $row['module_id'];
$url = $this->u_action . '&amp;parent_id=' . $this->parent_id . '&amp;m=' . $row['module_id'];
$template->assign_block_vars('modules', array(
'MODULE_IMAGE' => $module_image,
'MODULE_TITLE' => $langname,
'MODULE_ENABLED' => ($row['module_enabled']) ? true : false,
'MODULE_DISPLAYED' => ($row['module_display']) ? true : false,
'S_ACP_CAT_SYSTEM' => ($this->module_class == 'acp' && $row['module_langname'] == 'ACP_CAT_SYSTEM') ? true : false,
'S_ACP_MODULE_MANAGEMENT' => ($this->module_class == 'acp' && ($row['module_basename'] == 'modules' || $row['module_langname'] == 'ACP_MODULE_MANAGEMENT')) ? true : false,
'U_MODULE' => $this->u_action . '&amp;parent_id=' . $row['module_id'],
'U_MOVE_UP' => $url . '&amp;action=move_up',
'U_MOVE_DOWN' => $url . '&amp;action=move_down',
@@ -409,11 +414,11 @@ class acp_modules
}
while ($row = $db->sql_fetchrow($result));
}
else if ($parent_id)
else if ($this->parent_id)
{
$row = $this->get_module_row($parent_id);
$row = $this->get_module_row($this->parent_id);
$url = $this->u_action . '&amp;parent_id=' . $parent_id . '&amp;m=' . $row['module_id'];
$url = $this->u_action . '&amp;parent_id=' . $this->parent_id . '&amp;m=' . $row['module_id'];
$template->assign_vars(array(
'S_NO_MODULES' => true,
@@ -449,11 +454,11 @@ class acp_modules
}
$template->assign_vars(array(
'U_SEL_ACTION' => $this->u_action,
'U_ACTION' => $this->u_action . '&amp;parent_id=' . $parent_id,
'NAVIGATION' => $navigation,
'MODULE_BOX' => $module_box,
'PARENT_ID' => $parent_id,
'U_SEL_ACTION' => $this->u_action,
'U_ACTION' => $this->u_action . '&amp;parent_id=' . $this->parent_id,
'NAVIGATION' => $navigation,
'MODULE_BOX' => $module_box,
'PARENT_ID' => $this->parent_id,
'S_INSTALL_OPTIONS' => $s_install_options,
)
);
@@ -476,7 +481,7 @@ class acp_modules
if (!$row)
{
trigger_error($user->lang['NO_MODULE']);
trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
return $row;
@@ -551,22 +556,10 @@ class acp_modules
{
global $db, $user, $auth, $config;
switch (SQL_LAYER)
{
case 'firebird':
$sql = 'SELECT module_id, module_enabled, "module_name", parent_id, module_langname, left_id, right_id, module_auth
FROM ' . MODULES_TABLE . "
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
ORDER BY left_id ASC";
break;
default:
$sql = 'SELECT module_id, module_enabled, module_name, parent_id, module_langname, left_id, right_id, module_auth
FROM ' . MODULES_TABLE . "
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
ORDER BY left_id ASC";
break;
}
$sql = 'SELECT module_id, module_enabled, module_basename, parent_id, module_langname, left_id, right_id, module_auth
FROM ' . MODULES_TABLE . "
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
ORDER BY left_id ASC";
$result = $db->sql_query($sql);
$right = $iteration = 0;
@@ -607,13 +600,13 @@ class acp_modules
}
// empty category
if (!$row['module_name'] && ($row['left_id'] + 1 == $row['right_id']) && $ignore_emptycat)
if (!$row['module_basename'] && ($row['left_id'] + 1 == $row['right_id']) && $ignore_emptycat)
{
continue;
}
// ignore non-category?
if ($row['module_name'] && $ignore_noncat)
if ($row['module_basename'] && $ignore_noncat)
{
continue;
}
@@ -723,17 +716,18 @@ class acp_modules
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
AND module_id = {$module_data['parent_id']}";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$row = $db->sql_fetchrow($result))
if (!$row)
{
if ($run_inline)
{
return 'PARENT_NO_EXIST';
}
trigger_error($user->lang['PARENT_NO_EXIST']);
trigger_error($user->lang['PARENT_NO_EXIST'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
$db->sql_freeresult($result);
$sql = 'UPDATE ' . MODULES_TABLE . "
SET left_id = left_id + 2, right_id = right_id + 2
@@ -777,7 +771,7 @@ class acp_modules
{
$row = $this->get_module_row($module_data['module_id']);
if ($module_data['module_name'] && !$row['module_name'])
if ($module_data['module_basename'] && !$row['module_basename'])
{
// we're turning a category into a module
$branch = $this->get_module_branch($module_data['module_id'], 'children', 'descending', false);
@@ -792,9 +786,12 @@ class acp_modules
{
$this->move_module($module_data['module_id'], $module_data['parent_id']);
}
$update_ary = $module_data;
unset($update_ary['module_id']);
$sql = 'UPDATE ' . MODULES_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $module_data) . "
SET ' . $db->sql_build_array('UPDATE', $update_ary) . "
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
AND module_id = {$module_data['module_id']}";
$db->sql_query($sql);
@@ -849,7 +846,7 @@ class acp_modules
SET right_id = right_id + $diff
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
AND " . $to_data['right_id'] . ' BETWEEN left_id AND right_id
AND module_id NOT IN (' . implode(', ', $moved_ids) . ')';
AND ' . $db->sql_in_set('module_id', $moved_ids, true);
$db->sql_query($sql);
// Resync the righthand side of the tree
@@ -857,7 +854,7 @@ class acp_modules
SET left_id = left_id + $diff, right_id = right_id + $diff
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
AND left_id > " . $to_data['right_id'] . '
AND module_id NOT IN (' . implode(', ', $moved_ids) . ')';
AND ' . $db->sql_in_set('module_id', $moved_ids, true);
$db->sql_query($sql);
// Resync moved branch
@@ -876,7 +873,7 @@ class acp_modules
$sql = 'SELECT MAX(right_id) AS right_id
FROM ' . MODULES_TABLE . "
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
AND module_id NOT IN (" . implode(', ', $moved_ids) . ')';
AND " . $db->sql_in_set('module_id', $moved_ids, true);
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -887,7 +884,7 @@ class acp_modules
$sql = 'UPDATE ' . MODULES_TABLE . "
SET left_id = left_id $diff, right_id = right_id $diff
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
AND module_id IN (" . implode(', ', $moved_ids) . ')';
AND " . $db->sql_in_set('module_id', $moved_ids);
$db->sql_query($sql);
}
@@ -1015,6 +1012,14 @@ class acp_modules
return $this->lang_name($target['module_langname']);
}
/**
* Check if the module or her childs hold the management module(s)
*/
function is_management_module($module_id)
{
}
}
?>

View File

@@ -26,7 +26,7 @@ class acp_permission_roles
$auth_admin = new auth_admin();
$user->add_lang('acp/permissions');
$user->add_lang('acp/permissions_phpbb');
add_permission_language();
$this->tpl_name = 'acp_permission_roles';
@@ -58,7 +58,8 @@ class acp_permission_roles
break;
default:
trigger_error('INVALID_MODE');
trigger_error('NO_MODE', E_USER_ERROR);
break;
}
$template->assign_vars(array(
@@ -75,7 +76,7 @@ class acp_permission_roles
if (!$role_id)
{
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT *
@@ -87,7 +88,7 @@ class acp_permission_roles
if (!$role_row)
{
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (confirm_box(true))
@@ -112,7 +113,7 @@ class acp_permission_roles
case 'edit':
if (!$role_id)
{
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// Get role we edit
@@ -125,7 +126,7 @@ class acp_permission_roles
if (!$role_row)
{
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// no break;
@@ -138,22 +139,22 @@ class acp_permission_roles
if (!$role_name)
{
trigger_error($user->lang['NO_ROLE_NAME_SPECIFIED'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_ROLE_NAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// if we add/edit a role we check the name to be unique among the settings...
$sql = 'SELECT role_id
FROM ' . ACL_ROLES_TABLE . "
WHERE role_type = '" . $db->sql_escape($permission_type) . "'
AND LOWER(role_name) = '" . $db->sql_escape(strtolower($role_name)) . "'";
AND role_name = '" . $db->sql_escape($role_name) . "'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// Make sure we only print out the error if we add the role or change it's name
if ($row && ($mode == 'add' || ($mode == 'edit' && strtolower($role_row['role_name']) != strtolower($role_name))))
if ($row && ($mode == 'add' || ($mode == 'edit' && $role_row['role_name'] != $role_name)))
{
trigger_error(sprintf($user->lang['ROLE_NAME_ALREADY_EXIST'], $role_name) . adm_back_link($this->u_action));
trigger_error(sprintf($user->lang['ROLE_NAME_ALREADY_EXIST'], $role_name) . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql_ary = array(
@@ -239,7 +240,7 @@ class acp_permission_roles
$auth_options = array();
while ($row = $db->sql_fetchrow($result))
{
$auth_options[$row['auth_option']] = ACL_UNSET;
$auth_options[$row['auth_option']] = ACL_NO;
}
$db->sql_freeresult($result);
}
@@ -252,7 +253,7 @@ class acp_permission_roles
{
if (!$role_id)
{
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT *
@@ -279,7 +280,7 @@ class acp_permission_roles
if (!$role_row)
{
trigger_error($user->lang['NO_PRESET_SELECTED'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$template->assign_vars(array(
@@ -294,7 +295,7 @@ class acp_permission_roles
)
);
// We need to fill the auth options array with ACL_UNSET options ;)
// We need to fill the auth options array with ACL_NO options ;)
$sql = 'SELECT auth_option_id, auth_option
FROM ' . ACL_OPTIONS_TABLE . "
WHERE auth_option LIKE '{$permission_type}%'
@@ -306,7 +307,7 @@ class acp_permission_roles
{
if (!isset($auth_options[$row['auth_option']]))
{
$auth_options[$row['auth_option']] = ACL_UNSET;
$auth_options[$row['auth_option']] = ACL_NO;
}
}
$db->sql_freeresult($result);
@@ -447,17 +448,17 @@ class acp_permission_roles
$template->assign_block_vars('auth', array(
'CAT_NAME' => $user->lang['permission_cat'][$cat],
'S_YES' => ($cat_array['S_YES'] && !$cat_array['S_NO'] && !$cat_array['S_UNSET']) ? true : false,
'S_NO' => ($cat_array['S_NO'] && !$cat_array['S_YES'] && !$cat_array['S_UNSET']) ? true : false,
'S_UNSET' => ($cat_array['S_UNSET'] && !$cat_array['S_NO'] && !$cat_array['S_YES']) ? true : false)
'S_YES' => ($cat_array['S_YES'] && !$cat_array['S_NEVER'] && !$cat_array['S_NO']) ? true : false,
'S_NEVER' => ($cat_array['S_NEVER'] && !$cat_array['S_YES'] && !$cat_array['S_NO']) ? true : false,
'S_NO' => ($cat_array['S_NO'] && !$cat_array['S_NEVER'] && !$cat_array['S_YES']) ? true : false)
);
foreach ($cat_array['permissions'] as $permission => $allowed)
{
$template->assign_block_vars('auth.mask', array(
'S_YES' => ($allowed == ACL_YES) ? true : false,
'S_NEVER' => ($allowed == ACL_NEVER) ? true : false,
'S_NO' => ($allowed == ACL_NO) ? true : false,
'S_UNSET' => ($allowed == ACL_UNSET) ? true : false,
'FIELD_NAME' => $permission,
'PERMISSION' => $user->lang['acl_' . $permission]['lang'])
@@ -484,7 +485,7 @@ class acp_permission_roles
$auth_settings = array();
while ($row = $db->sql_fetchrow($result))
{
$auth_settings[$row['auth_option']] = ACL_UNSET;
$auth_settings[$row['auth_option']] = ACL_NO;
}
$db->sql_freeresult($result);

View File

@@ -27,7 +27,7 @@ class acp_permissions
$auth_admin = new auth_admin();
$user->add_lang('acp/permissions');
$user->add_lang('acp/permissions_phpbb');
add_permission_language();
$this->tpl_name = 'acp_permissions';
@@ -47,7 +47,7 @@ class acp_permissions
return;
}
trigger_error('NO_MODE');
trigger_error('NO_MODE', E_USER_ERROR);
}
// Set some vars
@@ -70,7 +70,7 @@ class acp_permissions
if ($select_all_groups)
{
// Add default groups to selection
$sql_and = ($config['coppa_hide_groups']) ? " AND group_name NOT IN ('INACTIVE_COPPA', 'REGISTERED_COPPA')" : '';
$sql_and = (!$config['coppa_enable']) ? " AND group_name <> 'REGISTERED_COPPA'" : '';
$sql = 'SELECT group_id
FROM ' . GROUPS_TABLE . '
@@ -98,7 +98,7 @@ class acp_permissions
if (!sizeof($user_id))
{
trigger_error($user->lang['SELECTED_USER_NOT_EXIST'] . adm_back_link($this->u_action));
trigger_error($user->lang['SELECTED_USER_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
}
}
unset($username);
@@ -190,7 +190,8 @@ class acp_permissions
break;
default:
trigger_error('INVALID_MODE');
trigger_error('NO_MODE', E_USER_ERROR);
break;
}
$template->assign_vars(array(
@@ -203,7 +204,7 @@ class acp_permissions
if (!in_array($permission_type, $this->permission_dropdown))
{
trigger_error($user->lang['WRONG_PERMISSION_TYPE'] . adm_back_link($this->u_action));
trigger_error($user->lang['WRONG_PERMISSION_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
@@ -213,13 +214,38 @@ class acp_permissions
switch ($action)
{
case 'delete':
$this->remove_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id, $forum_id);
// All users/groups selected?
$all_users = (isset($_POST['all_users'])) ? true : false;
$all_groups = (isset($_POST['all_groups'])) ? true : false;
if ($all_users || $all_groups)
{
$items = $this->retrieve_defined_user_groups($permission_scope, $forum_id, $permission_type);
if ($all_users && sizeof($items['user_ids']))
{
$user_id = $items['user_ids'];
}
else if ($all_groups && sizeof($items['group_ids']))
{
$group_id = $items['group_ids'];
}
}
if (sizeof($user_id) || sizeof($group_id))
{
$this->remove_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id, $forum_id);
}
else
{
trigger_error($user->lang['NO_USER_GROUP_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
break;
case 'apply_permissions':
if (!isset($_POST['setting']))
{
trigger_error($user->lang['NO_AUTH_SETTING_FOUND'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_AUTH_SETTING_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$this->set_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id);
@@ -228,7 +254,7 @@ class acp_permissions
case 'apply_all_permissions':
if (!isset($_POST['setting']))
{
trigger_error($user->lang['NO_AUTH_SETTING_FOUND'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_AUTH_SETTING_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$this->set_all_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id);
@@ -273,7 +299,7 @@ class acp_permissions
continue 2;
}
$forum_list = make_forum_select(false, false, true, false, false, true);
$forum_list = make_forum_select(false, false, true, false, false, false, true);
// Build forum options
$s_forum_options = '';
@@ -305,7 +331,8 @@ class acp_permissions
$template->assign_vars(array(
'S_SELECT_USER' => true,
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=select_victim&amp;field=username'))
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=select_victim&amp;field=username'),
'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_victim&field=username', false))
);
break;
@@ -343,110 +370,47 @@ class acp_permissions
continue 2;
}
$sql_forum_id = ($permission_scope == 'global') ? 'AND a.forum_id = 0' : ((sizeof($forum_id)) ? 'AND a.forum_id IN (' . implode(', ', $forum_id) . ')' : 'AND a.forum_id <> 0');
$sql_permission_option = "AND o.auth_option LIKE '" . $db->sql_escape($permission_type) . "%'";
$sql = $db->sql_build_query('SELECT_DISTINCT', array(
'SELECT' => 'u.username, u.user_regdate, u.user_id',
'FROM' => array(
USERS_TABLE => 'u',
ACL_OPTIONS_TABLE => 'o',
ACL_USERS_TABLE => 'a'
),
'LEFT_JOIN' => array(
array(
'FROM' => array(ACL_ROLES_DATA_TABLE => 'r'),
'ON' => 'a.auth_role_id = r.role_id'
)
),
'WHERE' => "(a.auth_option_id = o.auth_option_id OR r.auth_option_id = o.auth_option_id)
$sql_permission_option
$sql_forum_id
AND u.user_id = a.user_id",
'ORDER_BY' => 'u.username, u.user_regdate ASC'
));
$result = $db->sql_query($sql);
$s_defined_user_options = '';
$defined_user_ids = array();
while ($row = $db->sql_fetchrow($result))
{
$s_defined_user_options .= '<option value="' . $row['user_id'] . '">' . $row['username'] . '</option>';
$defined_user_ids[] = $row['user_id'];
}
$db->sql_freeresult($result);
$sql = $db->sql_build_query('SELECT_DISTINCT', array(
'SELECT' => 'g.group_type, g.group_name, g.group_id',
'FROM' => array(
GROUPS_TABLE => 'g',
ACL_OPTIONS_TABLE => 'o',
ACL_GROUPS_TABLE => 'a'
),
'LEFT_JOIN' => array(
array(
'FROM' => array(ACL_ROLES_DATA_TABLE => 'r'),
'ON' => 'a.auth_role_id = r.role_id'
)
),
'WHERE' => "(a.auth_option_id = o.auth_option_id OR r.auth_option_id = o.auth_option_id)
$sql_permission_option
$sql_forum_id
AND g.group_id = a.group_id",
'ORDER_BY' => 'g.group_type DESC, g.group_name ASC'
));
$result = $db->sql_query($sql);
$s_defined_group_options = '';
$defined_group_ids = array();
while ($row = $db->sql_fetchrow($result))
{
$s_defined_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
$defined_group_ids[] = $row['group_id'];
}
$db->sql_freeresult($result);
$items = $this->retrieve_defined_user_groups($permission_scope, $forum_id, $permission_type);
// Now we check the users... because the "all"-selection is different here (all defined users/groups)
$all_users = (isset($_POST['all_users'])) ? true : false;
$all_groups = (isset($_POST['all_groups'])) ? true : false;
if ($all_users && sizeof($defined_user_ids))
if ($all_users && sizeof($items['user_ids']))
{
$user_id = $defined_user_ids;
$user_id = $items['user_ids'];
continue 2;
}
if ($all_groups && sizeof($defined_group_ids))
if ($all_groups && sizeof($items['group_ids']))
{
$group_id = $defined_group_ids;
$group_id = $items['group_ids'];
continue 2;
}
$template->assign_vars(array(
'S_SELECT_USERGROUP' => ($victim == 'usergroup') ? true : false,
'S_SELECT_USERGROUP_VIEW' => ($victim == 'usergroup_view') ? true : false,
'S_DEFINED_USER_OPTIONS' => $s_defined_user_options,
'S_DEFINED_GROUP_OPTIONS' => $s_defined_group_options,
'S_ADD_GROUP_OPTIONS' => group_select_options(false, $defined_group_ids),
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=add_user&amp;field=username'))
'S_DEFINED_USER_OPTIONS' => $items['user_ids_options'],
'S_DEFINED_GROUP_OPTIONS' => $items['group_ids_options'],
'S_ADD_GROUP_OPTIONS' => group_select_options(false, $items['group_ids']),
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=add_user&amp;field=username'),
'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=add_user&field=username', false))
);
break;
}
// The S_ALLOW_SELECT parameter below is a measure to lower memory usage.
// If there are more than 5 forums selected the admin is not able to select all users/groups too.
// We need to see if the number of forums can be increased or need to be decreased.
$template->assign_vars(array(
'U_ACTION' => $this->u_action,
'ANONYMOUS_USER_ID' => ANONYMOUS,
'S_SELECT_VICTIM' => true,
'S_ALLOW_ALL_SELECT' => (sizeof($forum_id) > 5) ? false : true,
'S_CAN_SELECT_USER' => ($auth->acl_get('a_authusers')) ? true : false,
'S_CAN_SELECT_GROUP' => ($auth->acl_get('a_authgroups')) ? true : false,
'S_HIDDEN_FIELDS' => $s_hidden_fields)
@@ -457,7 +421,7 @@ class acp_permissions
{
$sql = 'SELECT forum_name
FROM ' . FORUMS_TABLE . '
WHERE forum_id IN (' . implode(', ', $forum_id) . ')
WHERE ' . $db->sql_in_set('forum_id', $forum_id) . '
ORDER BY forum_name ASC';
$result = $db->sql_query($sql);
@@ -480,7 +444,7 @@ class acp_permissions
// Do not allow forum_ids being set and no other setting defined (will bog down the server too much)
if (sizeof($forum_id) && !sizeof($user_id) && !sizeof($group_id))
{
trigger_error($user->lang['ONLY_FORUM_DEFINED'] . adm_back_link($this->u_action));
trigger_error($user->lang['ONLY_FORUM_DEFINED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$template->assign_vars(array(
@@ -497,7 +461,7 @@ class acp_permissions
'S_SETTING_PERMISSIONS' => true)
);
$hold_ary = $auth_admin->get_mask('set', (sizeof($user_id)) ? $user_id : false, (sizeof($group_id)) ? $group_id : false, (sizeof($forum_id)) ? $forum_id : false, $permission_type, $permission_scope, ACL_UNSET);
$hold_ary = $auth_admin->get_mask('set', (sizeof($user_id)) ? $user_id : false, (sizeof($group_id)) ? $group_id : false, (sizeof($forum_id)) ? $forum_id : false, $permission_type, $permission_scope, ACL_NO);
$auth_admin->display_mask('set', $permission_type, $hold_ary, ((sizeof($user_id)) ? 'user' : 'group'), (($permission_scope == 'local') ? true : false));
}
else
@@ -506,7 +470,7 @@ class acp_permissions
'S_VIEWING_PERMISSIONS' => true)
);
$hold_ary = $auth_admin->get_mask('view', (sizeof($user_id)) ? $user_id : false, (sizeof($group_id)) ? $group_id : false, (sizeof($forum_id)) ? $forum_id : false, $permission_type, $permission_scope, ACL_NO);
$hold_ary = $auth_admin->get_mask('view', (sizeof($user_id)) ? $user_id : false, (sizeof($group_id)) ? $group_id : false, (sizeof($forum_id)) ? $forum_id : false, $permission_type, $permission_scope, ACL_NEVER);
$auth_admin->display_mask('view', $permission_type, $hold_ary, ((sizeof($user_id)) ? 'user' : 'group'), (($permission_scope == 'local') ? true : false));
}
}
@@ -598,7 +562,7 @@ class acp_permissions
$sql = "SELECT $sql_id
FROM $table
WHERE $sql_id IN (" . implode(', ', $ids) . ')';
WHERE " . $db->sql_in_set($sql_id, $ids);
$result = $db->sql_query($sql);
$ids = array();
@@ -610,7 +574,7 @@ class acp_permissions
if (!sizeof($ids))
{
trigger_error($user->lang['SELECTED_' . strtoupper($mode) . '_NOT_EXIST'] . adm_back_link($this->u_action));
trigger_error($user->lang['SELECTED_' . strtoupper($mode) . '_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
}
}
@@ -629,7 +593,7 @@ class acp_permissions
// Check the permission setting again
if (!$auth->acl_get('a_' . str_replace('_', '', $permission_type) . 'auth') || !$auth->acl_get('a_auth' . $ug_type . 's'))
{
trigger_error($user->lang['NO_ADMIN'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$ug_id = $forum_id = 0;
@@ -687,7 +651,7 @@ class acp_permissions
// Remove users who are now moderators or admins from everyones foes list
if ($permission_type == 'm_' || $permission_type == 'a_')
{
$this->update_foes();
update_foes();
}
$this->log_action($mode, 'add', $permission_type, $ug_type, $ug_id, $forum_id);
@@ -708,7 +672,7 @@ class acp_permissions
// Check the permission setting again
if (!$auth->acl_get('a_' . str_replace('_', '', $permission_type) . 'auth') || !$auth->acl_get('a_auth' . $ug_type . 's'))
{
trigger_error($user->lang['NO_ADMIN'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$auth_settings = (isset($_POST['setting'])) ? $_POST['setting'] : array();
@@ -754,7 +718,7 @@ class acp_permissions
// Remove users who are now moderators or admins from everyones foes list
if ($permission_type == 'm_' || $permission_type == 'a_')
{
$this->update_foes();
update_foes();
}
$this->log_action($mode, 'add', $permission_type, $ug_type, $ug_ids, $forum_ids);
@@ -783,10 +747,10 @@ class acp_permissions
}
$db->sql_freeresult($result);
// We need to add any ACL_UNSET setting from auth_settings to compare correctly
// We need to add any ACL_NO setting from auth_settings to compare correctly
foreach ($auth_settings as $option => $setting)
{
if ($setting == ACL_UNSET)
if ($setting == ACL_NO)
{
$test_auth_settings[$option] = $setting;
}
@@ -813,7 +777,7 @@ class acp_permissions
// Check the permission setting again
if (!$auth->acl_get('a_' . str_replace('_', '', $permission_type) . 'auth') || !$auth->acl_get('a_auth' . $ug_type . 's'))
{
trigger_error($user->lang['NO_ADMIN'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$auth_admin->acl_delete($ug_type, (($ug_type == 'user') ? $user_id : $group_id), (sizeof($forum_id) ? $forum_id : false), $permission_type);
@@ -847,8 +811,8 @@ class acp_permissions
}
// Logging ... first grab user or groupnames ...
$sql = ($ug_type == 'group') ? 'SELECT group_name as name, group_type FROM ' . GROUPS_TABLE . ' WHERE group_id' : 'SELECT username as name FROM ' . USERS_TABLE . ' WHERE user_id';
$sql .= ' IN (' . implode(', ', array_map('intval', $ug_id)) . ')';
$sql = ($ug_type == 'group') ? 'SELECT group_name as name, group_type FROM ' . GROUPS_TABLE . ' WHERE ' : 'SELECT username as name FROM ' . USERS_TABLE . ' WHERE ';
$sql .= $db->sql_in_set(($ug_type == 'group') ? 'group_id' : 'user_id', array_map('intval', $ug_id));
$result = $db->sql_query($sql);
$l_ug_list = '';
@@ -869,7 +833,7 @@ class acp_permissions
// Grab the forum details if non-zero forum_id
$sql = 'SELECT forum_name
FROM ' . FORUMS_TABLE . '
WHERE forum_id IN (' . implode(', ', $forum_id) . ')';
WHERE ' . $db->sql_in_set('forum_id', $forum_id);
$result = $db->sql_query($sql);
$l_forum_list = '';
@@ -883,32 +847,6 @@ class acp_permissions
}
}
/**
* Update foes - remove moderators and administrators from foe lists...
*/
function update_foes()
{
global $db, $auth;
$perms = array();
foreach ($auth->acl_get_list(false, array('a_', 'm_'), false) as $forum_id => $forum_ary)
{
foreach ($forum_ary as $auth_option => $user_ary)
{
$perms = array_merge($perms, $user_ary);
}
}
if (sizeof($perms))
{
$sql = 'DELETE FROM ' . ZEBRA_TABLE . '
WHERE zebra_id IN (' . implode(', ', array_unique($perms)) . ')
AND foe = 1';
$db->sql_query($sql);
}
unset($perms);
}
/**
* Display a complete trace tree for the selected permission to determine where settings are set/unset
*/
@@ -932,7 +870,7 @@ class acp_permissions
if (!$userdata)
{
trigger_error('NO_USERS');
trigger_error('NO_USERS', E_USER_ERROR);
}
$forum_name = false;
@@ -960,8 +898,8 @@ class acp_permissions
'WHO' => $user->lang['DEFAULT'],
'INFORMATION' => $user->lang['TRACE_DEFAULT'],
'S_SETTING_UNSET' => true,
'S_TOTAL_UNSET' => true)
'S_SETTING_NO' => true,
'S_TOTAL_NO' => true)
);
$sql = 'SELECT DISTINCT g.group_name, g.group_id, g.group_type
@@ -976,12 +914,13 @@ class acp_permissions
while ($row = $db->sql_fetchrow($result))
{
$groups[$row['group_id']] = array(
'auth_setting' => ACL_UNSET,
'auth_setting' => ACL_NO,
'group_name' => ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']
);
}
$db->sql_freeresult($result);
$total = ACL_NO;
if (sizeof($groups))
{
// Get group auth settings
@@ -993,23 +932,22 @@ class acp_permissions
}
unset($hold_ary);
$total = ACL_UNSET;
foreach ($groups as $id => $row)
{
switch ($row['auth_setting'])
{
case ACL_UNSET:
$information = $user->lang['TRACE_GROUP_UNSET'];
case ACL_NO:
$information = $user->lang['TRACE_GROUP_NO'];
break;
case ACL_YES:
$information = ($total == ACL_YES) ? $user->lang['TRACE_GROUP_YES_TOTAL_YES'] : (($total == ACL_NO) ? $user->lang['TRACE_GROUP_YES_TOTAL_NO'] : $user->lang['TRACE_GROUP_YES_TOTAL_UNSET']);
$total = ($total == ACL_UNSET) ? ACL_YES : $total;
$information = ($total == ACL_YES) ? $user->lang['TRACE_GROUP_YES_TOTAL_YES'] : (($total == ACL_NEVER) ? $user->lang['TRACE_GROUP_YES_TOTAL_NEVER'] : $user->lang['TRACE_GROUP_YES_TOTAL_NO']);
$total = ($total == ACL_NO) ? ACL_YES : $total;
break;
case ACL_NO:
$information = ($total == ACL_YES) ? $user->lang['TRACE_GROUP_NO_TOTAL_YES'] : (($total == ACL_NO) ? $user->lang['TRACE_GROUP_NO_TOTAL_NO'] : $user->lang['TRACE_GROUP_NO_TOTAL_UNSET']);
$total = ACL_NO;
case ACL_NEVER:
$information = ($total == ACL_YES) ? $user->lang['TRACE_GROUP_NEVER_TOTAL_YES'] : (($total == ACL_NEVER) ? $user->lang['TRACE_GROUP_NEVER_TOTAL_NEVER'] : $user->lang['TRACE_GROUP_NEVER_TOTAL_NO']);
$total = ACL_NEVER;
break;
}
@@ -1017,35 +955,35 @@ class acp_permissions
'WHO' => $row['group_name'],
'INFORMATION' => $information,
'S_SETTING_UNSET' => ($row['auth_setting'] == ACL_UNSET) ? true : false,
'S_SETTING_YES' => ($row['auth_setting'] == ACL_YES) ? true : false,
'S_SETTING_NO' => ($row['auth_setting'] == ACL_NO) ? true : false,
'S_TOTAL_UNSET' => ($total == ACL_UNSET) ? true : false,
'S_SETTING_YES' => ($row['auth_setting'] == ACL_YES) ? true : false,
'S_SETTING_NEVER' => ($row['auth_setting'] == ACL_NEVER) ? true : false,
'S_TOTAL_NO' => ($total == ACL_NO) ? true : false,
'S_TOTAL_YES' => ($total == ACL_YES) ? true : false,
'S_TOTAL_NO' => ($total == ACL_NO) ? true : false)
'S_TOTAL_NEVER' => ($total == ACL_NEVER) ? true : false)
);
}
}
// Get user specific permission...
$hold_ary = $auth->acl_user_raw_data($user_id, $permission, $forum_id);
$auth_setting = (!sizeof($hold_ary)) ? ACL_UNSET : $hold_ary[$user_id][$forum_id][$permission];
$auth_setting = (!sizeof($hold_ary)) ? ACL_NO : $hold_ary[$user_id][$forum_id][$permission];
switch ($auth_setting)
{
case ACL_UNSET:
$information = ($total == ACL_UNSET) ? $user->lang['TRACE_USER_UNSET_TOTAL_UNSET'] : $user->lang['TRACE_USER_KEPT'];
$total = ($total == ACL_UNSET) ? ACL_NO : $total;
case ACL_NO:
$information = ($total == ACL_NO) ? $user->lang['TRACE_USER_NO_TOTAL_NO'] : $user->lang['TRACE_USER_KEPT'];
$total = ($total == ACL_NO) ? ACL_NEVER : $total;
break;
case ACL_YES:
$information = ($total == ACL_YES) ? $user->lang['TRACE_USER_YES_TOTAL_YES'] : (($total == ACL_NO) ? $user->lang['TRACE_USER_YES_TOTAL_NO'] : $user->lang['TRACE_USER_YES_TOTAL_UNSET']);
$total = ($total == ACL_UNSET) ? ACL_YES : $total;
$information = ($total == ACL_YES) ? $user->lang['TRACE_USER_YES_TOTAL_YES'] : (($total == ACL_NEVER) ? $user->lang['TRACE_USER_YES_TOTAL_NEVER'] : $user->lang['TRACE_USER_YES_TOTAL_NO']);
$total = ($total == ACL_NO) ? ACL_YES : $total;
break;
case ACL_NO:
$information = ($total == ACL_YES) ? $user->lang['TRACE_USER_NO_TOTAL_YES'] : (($total == ACL_NO) ? $user->lang['TRACE_USER_NO_TOTAL_NO'] : $user->lang['TRACE_USER_NO_TOTAL_UNSET']);
$total = ACL_NO;
case ACL_NEVER:
$information = ($total == ACL_YES) ? $user->lang['TRACE_USER_NEVER_TOTAL_YES'] : (($total == ACL_NEVER) ? $user->lang['TRACE_USER_NEVER_TOTAL_NEVER'] : $user->lang['TRACE_USER_NEVER_TOTAL_NO']);
$total = ACL_NEVER;
break;
}
@@ -1053,12 +991,12 @@ class acp_permissions
'WHO' => $userdata['username'],
'INFORMATION' => $information,
'S_SETTING_UNSET' => ($auth_setting == ACL_UNSET) ? true : false,
'S_SETTING_YES' => ($auth_setting == ACL_YES) ? true : false,
'S_SETTING_NO' => ($auth_setting == ACL_NO) ? true : false,
'S_TOTAL_UNSET' => false,
'S_SETTING_YES' => ($auth_setting == ACL_YES) ? true : false,
'S_SETTING_NEVER' => ($auth_setting == ACL_NEVER) ? true : false,
'S_TOTAL_NO' => false,
'S_TOTAL_YES' => ($total == ACL_YES) ? true : false,
'S_TOTAL_NO' => ($total == ACL_NO) ? true : false)
'S_TOTAL_NEVER' => ($total == ACL_NEVER) ? true : false)
);
// global permission might overwrite local permission
@@ -1077,24 +1015,24 @@ class acp_permissions
if ($auth_setting)
{
$information = ($total == ACL_YES) ? $user->lang['TRACE_USER_GLOBAL_YES_TOTAL_YES'] : $user->lang['TRACE_USER_GLOBAL_YES_TOTAL_NO'];
$information = ($total == ACL_YES) ? $user->lang['TRACE_USER_GLOBAL_YES_TOTAL_YES'] : $user->lang['TRACE_USER_GLOBAL_YES_TOTAL_NEVER'];
$total = ACL_YES;
}
else
{
$information = $user->lang['TRACE_USER_GLOBAL_NO_TOTAL_KEPT'];
$information = $user->lang['TRACE_USER_GLOBAL_NEVER_TOTAL_KEPT'];
}
$template->assign_block_vars('trace', array(
'WHO' => sprintf($user->lang['TRACE_GLOBAL_SETTING'], $userdata['username']),
'INFORMATION' => sprintf($information, '<a href="' . $this->u_action . "&amp;u=$user_id&amp;f=0&amp;auth=$permission&amp;back=$forum_id\">", '</a>'),
'S_SETTING_UNSET' => false,
'S_SETTING_NO' => false,
'S_SETTING_YES' => $auth_setting,
'S_SETTING_NO' => !$auth_setting,
'S_TOTAL_UNSET' => false,
'S_SETTING_NEVER' => !$auth_setting,
'S_TOTAL_NO' => false,
'S_TOTAL_YES' => ($total == ACL_YES) ? true : false,
'S_TOTAL_NO' => ($total == ACL_NO) ? true : false)
'S_TOTAL_NEVER' => ($total == ACL_NEVER) ? true : false)
);
}
@@ -1105,15 +1043,101 @@ class acp_permissions
'WHO' => $userdata['username'],
'INFORMATION' => $user->lang['TRACE_USER_FOUNDER'],
'S_SETTING_UNSET' => ($auth_setting == ACL_UNSET) ? true : false,
'S_SETTING_YES' => ($auth_setting == ACL_YES) ? true : false,
'S_SETTING_NO' => ($auth_setting == ACL_NO) ? true : false,
'S_TOTAL_UNSET' => false,
'S_SETTING_YES' => ($auth_setting == ACL_YES) ? true : false,
'S_SETTING_NEVER' => ($auth_setting == ACL_NEVER) ? true : false,
'S_TOTAL_NO' => false,
'S_TOTAL_YES' => true,
'S_TOTAL_NO' => false)
'S_TOTAL_NEVER' => false)
);
}
}
/**
* Get already assigned users/groups
*/
function retrieve_defined_user_groups($permission_scope, $forum_id, $permission_type)
{
global $db, $user;
$sql_forum_id = ($permission_scope == 'global') ? 'AND a.forum_id = 0' : ((sizeof($forum_id)) ? 'AND ' . $db->sql_in_set('a.forum_id', $forum_id) : 'AND a.forum_id <> 0');
$sql_permission_option = "AND o.auth_option LIKE '" . $db->sql_escape($permission_type) . "%'";
$sql = $db->sql_build_query('SELECT_DISTINCT', array(
'SELECT' => 'u.username, u.user_regdate, u.user_id',
'FROM' => array(
USERS_TABLE => 'u',
ACL_OPTIONS_TABLE => 'o',
ACL_USERS_TABLE => 'a'
),
'LEFT_JOIN' => array(
array(
'FROM' => array(ACL_ROLES_DATA_TABLE => 'r'),
'ON' => 'a.auth_role_id = r.role_id'
)
),
'WHERE' => "(a.auth_option_id = o.auth_option_id OR r.auth_option_id = o.auth_option_id)
$sql_permission_option
$sql_forum_id
AND u.user_id = a.user_id",
'ORDER_BY' => 'u.username, u.user_regdate ASC'
));
$result = $db->sql_query($sql);
$s_defined_user_options = '';
$defined_user_ids = array();
while ($row = $db->sql_fetchrow($result))
{
$s_defined_user_options .= '<option value="' . $row['user_id'] . '">' . $row['username'] . '</option>';
$defined_user_ids[] = $row['user_id'];
}
$db->sql_freeresult($result);
$sql = $db->sql_build_query('SELECT_DISTINCT', array(
'SELECT' => 'g.group_type, g.group_name, g.group_id',
'FROM' => array(
GROUPS_TABLE => 'g',
ACL_OPTIONS_TABLE => 'o',
ACL_GROUPS_TABLE => 'a'
),
'LEFT_JOIN' => array(
array(
'FROM' => array(ACL_ROLES_DATA_TABLE => 'r'),
'ON' => 'a.auth_role_id = r.role_id'
)
),
'WHERE' => "(a.auth_option_id = o.auth_option_id OR r.auth_option_id = o.auth_option_id)
$sql_permission_option
$sql_forum_id
AND g.group_id = a.group_id",
'ORDER_BY' => 'g.group_type DESC, g.group_name ASC'
));
$result = $db->sql_query($sql);
$s_defined_group_options = '';
$defined_group_ids = array();
while ($row = $db->sql_fetchrow($result))
{
$s_defined_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
$defined_group_ids[] = $row['group_id'];
}
$db->sql_freeresult($result);
return array(
'group_ids' => $defined_group_ids,
'group_ids_options' => $s_defined_group_options,
'user_ids' => $defined_user_ids,
'user_ids_options' => $s_defined_user_options
);
}
}
?>

View File

@@ -22,7 +22,7 @@ class acp_php_info
if ($mode != 'info')
{
trigger_error('NO_MODE');
trigger_error('NO_MODE', E_USER_ERROR);
}
$this->tpl_name = 'acp_php_info';

View File

@@ -50,7 +50,8 @@ class acp_profile
$lang_defs = array();
$sql = 'SELECT lang_id, lang_iso
FROM ' . LANG_TABLE;
FROM ' . LANG_TABLE . '
ORDER BY lang_english_name';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
@@ -63,7 +64,7 @@ class acp_profile
$sql = 'SELECT field_id, lang_id
FROM ' . PROFILE_LANG_TABLE . '
ORDER BY lang_id';
ORDER BY lang_id';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
@@ -90,7 +91,7 @@ class acp_profile
if (!$field_id)
{
trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (confirm_box(true))
@@ -106,7 +107,7 @@ class acp_profile
$db->sql_query('DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . " WHERE field_id = $field_id");
$db->sql_query('DELETE FROM ' . PROFILE_LANG_TABLE . " WHERE field_id = $field_id");
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'sqlite':
$sql = "SELECT sql
@@ -118,20 +119,23 @@ class acp_profile
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$db->sql_transaction('begin');
// Create a temp table and populate it, destroy the existing one
$db->sql_query(preg_replace('#CREATE\s+TABLE\s+' . PROFILE_FIELDS_DATA_TABLE . '#i', 'CREATE TEMPORARY TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp', $row['sql']));
$db->sql_query(preg_replace('#CREATE\s+TABLE\s+"?' . PROFILE_FIELDS_DATA_TABLE . '"?#i', 'CREATE TEMPORARY TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp', $row['sql']));
$db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . '_temp SELECT * FROM ' . PROFILE_FIELDS_DATA_TABLE);
$db->sql_query('DROP TABLE ' . PROFILE_FIELDS_DATA_TABLE);
preg_match('#\((.*)\)#s', $row['sql'], $matches);
$new_table_cols = $matches[1];
$old_table_cols = explode(',', $new_table_cols);
$new_table_cols = trim($matches[1]);
$old_table_cols = preg_split('/,(?=[\\sa-z])/im', $new_table_cols);
$column_list = array();
foreach($old_table_cols as $declaration)
foreach ($old_table_cols as $declaration)
{
$entities = preg_split('#\s+#', $declaration);
if ($entities[0] !== $field_ident)
$entities = preg_split('#\s+#', trim($declaration));
if ($entities[0] !== 'pf_' . $field_ident)
{
$column_list[] = $entities[0];
}
@@ -139,16 +143,18 @@ class acp_profile
$columns = implode(',', $column_list);
$new_table_cols = preg_replace('/' . $field_ident . '[^,]+,/', '', $new_table_cols);
$new_table_cols = preg_replace('/' . 'pf_' . $field_ident . '[^,]+,/', '', $new_table_cols);
// create a new table and fill it up. destroy the temp one
$db->sql_query('CREATE TABLE ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $new_table_cols . ');');
$db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . PROFILE_FIELDS_DATA_TABLE . '_temp;');
$db->sql_query('DROP TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp');
$db->sql_transaction('commit');
break;
default:
$db->sql_query('ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " DROP $field_ident");
$db->sql_query('ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " DROP pf_$field_ident");
}
$order = 0;
@@ -191,7 +197,7 @@ class acp_profile
if (!$field_id)
{
trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT lang_id
@@ -203,7 +209,7 @@ class acp_profile
if (!in_array($default_lang_id, $lang_defs['entry'][$field_id]))
{
trigger_error($user->lang['DEFAULT_LANGUAGE_NOT_FILLED'] . adm_back_link($this->u_action));
trigger_error($user->lang['DEFAULT_LANGUAGE_NOT_FILLED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . "
@@ -228,7 +234,7 @@ class acp_profile
if (!$field_id)
{
trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . "
@@ -274,7 +280,7 @@ class acp_profile
{
if (!$field_id)
{
trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT l.*, f.*
@@ -288,21 +294,22 @@ class acp_profile
if (!$field_row)
{
trigger_error($user->lang['FIELD_NOT_FOUND'] . adm_back_link($this->u_action));
trigger_error($user->lang['FIELD_NOT_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$field_type = $field_row['field_type'];
// Get language entries
$sql = 'SELECT * FROM ' . PROFILE_FIELDS_LANG_TABLE . '
$sql = 'SELECT *
FROM ' . PROFILE_FIELDS_LANG_TABLE . '
WHERE lang_id = ' . $lang_defs['iso'][$config['default_lang']] . "
AND field_id = $field_id
ORDER BY option_id ASC";
ORDER BY option_id ASC";
$result = $db->sql_query($sql);
$lang_options = array();
while ($row = $db->sql_fetchrow($result))
{
$lang_options[$row['option_id']] = $row['value'];
$lang_options[$row['option_id']] = $row['lang_value'];
}
$db->sql_freeresult($result);
@@ -317,7 +324,7 @@ class acp_profile
if (!$field_type)
{
trigger_error($user->lang['NO_FIELD_TYPE'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_FIELD_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$field_row = array_merge($default_values[$field_type], array(
@@ -357,7 +364,7 @@ class acp_profile
$cp->vars['lang_name'] = request_var('lang_name', $field_row['lang_name'], true);
$cp->vars['lang_explain'] = request_var('lang_explain', $field_row['lang_explain'], true);
$cp->vars['lang_default_value'] = request_var('lang_default_value', $field_row['lang_default_value'], true);
// Field option...
if (isset($_REQUEST['field_option']))
{
@@ -474,7 +481,8 @@ class acp_profile
if ($action == 'edit')
{
// Get language entries
$sql = 'SELECT * FROM ' . PROFILE_FIELDS_LANG_TABLE . '
$sql = 'SELECT *
FROM ' . PROFILE_FIELDS_LANG_TABLE . '
WHERE lang_id <> ' . $lang_defs['iso'][$config['default_lang']] . "
AND field_id = $field_id
ORDER BY option_id ASC";
@@ -483,12 +491,13 @@ class acp_profile
$l_lang_options = array();
while ($row = $db->sql_fetchrow($result))
{
$l_lang_options[$row['lang_id']][$row['option_id']] = $row['value'];
$l_lang_options[$row['lang_id']][$row['option_id']] = $row['lang_value'];
}
$db->sql_freeresult($result);
$sql = 'SELECT lang_id, lang_name, lang_explain, lang_default_value FROM ' . PROFILE_LANG_TABLE . '
$sql = 'SELECT lang_id, lang_name, lang_explain, lang_default_value
FROM ' . PROFILE_LANG_TABLE . '
WHERE lang_id <> ' . $lang_defs['iso'][$config['default_lang']] . "
AND field_id = $field_id
ORDER BY lang_id ASC";
@@ -521,7 +530,8 @@ class acp_profile
}
}
if ($submit && $step == 1)
// Check for general issues in every step
if ($submit) // && $step == 1
{
// Check values for step 1
if ($cp->vars['field_ident'] == '')
@@ -534,18 +544,41 @@ class acp_profile
$error[] = $user->lang['INVALID_CHARS_FIELD_IDENT'];
}
if ($cp->vars['lang_name'] == '')
if (strlen($cp->vars['field_ident']) > 17)
{
$error[] = $user->lang['EMPTY_USER_FIELD_IDENT'];
$error[] = $user->lang['INVALID_FIELD_IDENT_LEN'];
}
if ($field_type == FIELD_BOOL || $field_type == FIELD_DROPDOWN)
if ($cp->vars['lang_name'] == '')
{
if (!sizeof($cp->vars['lang_options']))
$error[] = $user->lang['EMPTY_USER_FIELD_NAME'];
}
if ($field_type == FIELD_DROPDOWN && !sizeof($cp->vars['lang_options']))
{
$error[] = $user->lang['NO_FIELD_ENTRIES'];
}
if ($field_type == FIELD_BOOL && (empty($cp->vars['lang_options'][0]) || empty($cp->vars['lang_options'][1])))
{
$error[] = $user->lang['NO_FIELD_ENTRIES'];
}
// Check for already existing field ident
if ($action != 'edit')
{
$sql = 'SELECT field_ident
FROM ' . PROFILE_FIELDS_TABLE . "
WHERE field_ident = '" . $db->sql_escape($cp->vars['field_ident']) . "'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($row)
{
$error[] = $user->lang['NO_FIELD_ENTRIES'];
$error[] = $user->lang['FIELD_IDENT_ALREADY_EXIST'];
}
}
}
}
$step = (isset($_REQUEST['next'])) ? $step + 1 : ((isset($_REQUEST['prev'])) ? $step - 1 : $step);
@@ -726,12 +759,20 @@ class acp_profile
ORDER BY field_order';
$result = $db->sql_query($sql);
$s_one_need_edit = false;
while ($row = $db->sql_fetchrow($result))
{
$active_lang = (!$row['field_active']) ? 'ACTIVATE' : 'DEACTIVATE';
$active_value = (!$row['field_active']) ? 'activate' : 'deactivate';
$id = $row['field_id'];
$s_need_edit = (sizeof($lang_defs['diff'][$row['field_id']])) ? true : false;
if ($s_need_edit)
{
$s_one_need_edit = true;
}
$template->assign_block_vars('fields', array(
'FIELD_IDENT' => $row['field_ident'],
'FIELD_TYPE' => $user->lang['FIELD_' . strtoupper($cp->profile_types[$row['field_type']])],
@@ -739,15 +780,22 @@ class acp_profile
'L_ACTIVATE_DEACTIVATE' => $user->lang[$active_lang],
'U_ACTIVATE_DEACTIVATE' => $this->u_action . "&amp;action=$active_value&amp;field_id=$id",
'U_EDIT' => $this->u_action . "&amp;action=edit&amp;field_id=$id",
'U_TRANSLATE' => $this->u_action . "&amp;action=edit&amp;field_id=$id&amp;step=3",
'U_DELETE' => $this->u_action . "&amp;action=delete&amp;field_id=$id",
'U_MOVE_UP' => $this->u_action . "&amp;action=move_up&amp;order={$row['field_order']}",
'U_MOVE_DOWN' => $this->u_action . "&amp;action=move_down&amp;order={$row['field_order']}",
'S_NEED_EDIT' => (sizeof($lang_defs['diff'][$row['field_id']])) ? true : false)
'S_NEED_EDIT' => $s_need_edit)
);
}
$db->sql_freeresult($result);
// At least one option field needs editing?
if ($s_one_need_edit)
{
$template->assign_var('S_NEED_EDIT', true);
}
$s_select_type = '';
foreach ($cp->profile_types as $key => $value)
{
@@ -769,7 +817,8 @@ class acp_profile
$sql = 'SELECT lang_id, lang_iso
FROM ' . LANG_TABLE . "
WHERE lang_iso <> '" . $config['default_lang'] . "'";
WHERE lang_iso <> '" . $config['default_lang'] . "'
ORDER BY lang_english_name";
$result = $db->sql_query($sql);
$languages = array();
@@ -826,12 +875,11 @@ class acp_profile
$lang_options[$lang_id]['lang_iso'] = $lang_iso;
foreach ($options as $field => $field_type)
{
$value = ($action == 'create') ? request_var('l_' . $field, '', true) : $cp->vars['l_' . $field];
$value = ($action == 'create') ? request_var('l_' . $field, array(0 => ''), true) : $cp->vars['l_' . $field];
if ($field == 'lang_options')
{
$var = ($action == 'create' || !is_array($cp->vars['lang_options'][$lang_id])) ? $cp->vars['lang_options'] : $cp->vars['lang_options'][$lang_id];
$var = ($action == 'create' || !is_array($cp->vars['l_lang_options'][$lang_id])) ? $cp->vars['lang_options'] : $cp->vars['lang_options'][$lang_id];
switch ($field_type)
{
@@ -928,278 +976,28 @@ class acp_profile
'field_active' => 1
);
$db->sql_query('INSERT INTO ' . PROFILE_FIELDS_TABLE . ' ' . $db->sql_build_array('INSERT', $profile_fields));
$sql = 'INSERT INTO ' . PROFILE_FIELDS_TABLE . ' ' . $db->sql_build_array('INSERT', $profile_fields);
$db->sql_query($sql);
$field_id = $db->sql_nextid();
}
else
{
$db->sql_query('UPDATE ' . PROFILE_FIELDS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $profile_fields) . "
WHERE field_id = $field_id");
$sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $profile_fields) . "
WHERE field_id = $field_id";
$db->sql_query($sql);
}
if ($action == 'create')
{
switch (SQL_LAYER)
{
case 'mysql':
case 'mysql4':
case 'mysqli':
// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
$sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD `$field_ident` ";
switch ($field_type)
{
case FIELD_STRING:
$sql .= ' VARCHAR(255) ';
break;
case FIELD_DATE:
$sql .= 'VARCHAR(10) ';
break;
case FIELD_TEXT:
$sql .= "TEXT";
// ADD {$field_ident}_bbcode_uid VARCHAR(5) NOT NULL,
// ADD {$field_ident}_bbcode_bitfield INT(11) UNSIGNED";
break;
case FIELD_BOOL:
$sql .= 'TINYINT(2) ';
break;
case FIELD_DROPDOWN:
$sql .= 'MEDIUMINT(8) ';
break;
case FIELD_INT:
$sql .= 'BIGINT(20) ';
break;
}
break;
case 'sqlite':
switch ($field_type)
{
case FIELD_STRING:
$type = ' VARCHAR(255) ';
break;
case FIELD_DATE:
$type = 'VARCHAR(10) ';
break;
case FIELD_TEXT:
$type = "TEXT(65535)";
// ADD {$field_ident}_bbcode_uid VARCHAR(5) NOT NULL,
// ADD {$field_ident}_bbcode_bitfield INT(11) UNSIGNED";
break;
case FIELD_BOOL:
$type = 'TINYINT(2) ';
break;
case FIELD_DROPDOWN:
$type = 'MEDIUMINT(8) ';
break;
case FIELD_INT:
$type = 'BIGINT(20) ';
break;
}
// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
if (version_compare(sqlite_libversion(), '3.0') == -1)
{
$sql = "SELECT sql
FROM sqlite_master
WHERE type = 'table'
AND name = '" . PROFILE_FIELDS_DATA_TABLE . "'
ORDER BY type DESC, name;";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// Create a temp table and populate it, destroy the existing one
$db->sql_query(preg_replace('#CREATE\s+TABLE\s+' . PROFILE_FIELDS_DATA_TABLE . '#i', 'CREATE TEMPORARY TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp', $row['sql']));
$db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . '_temp SELECT * FROM ' . PROFILE_FIELDS_DATA_TABLE);
$db->sql_query('DROP TABLE ' . PROFILE_FIELDS_DATA_TABLE);
preg_match('#\((.*)\)#s', $row['sql'], $matches);
$new_table_cols = $matches[1];
$old_table_cols = explode(',', $new_table_cols);
$column_list = array();
foreach($old_table_cols as $declaration)
{
$entities = preg_split('#\s+#', $declaration);
$column_list[] = $entities[0];
}
$columns = implode(',', $column_list);
$new_table_cols = $field_ident . ' ' . $type . ',' . $new_table_cols;
// create a new table and fill it up. destroy the temp one
$db->sql_query('CREATE TABLE ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $new_table_cols . ');');
$db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . PROFILE_FIELDS_DATA_TABLE . '_temp;');
$db->sql_query('DROP TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp');
}
else
{
$sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD $field_ident $type";
}
break;
case 'mssql':
case 'mssql_odbc':
// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
$sql = 'ALTER TABLE [' . PROFILE_FIELDS_DATA_TABLE . "] ADD $field_ident ";
switch ($field_type)
{
case FIELD_STRING:
$sql .= ' [VARCHAR] (255) ';
break;
case FIELD_DATE:
$sql .= '[VARCHAR] (10) ';
break;
case FIELD_TEXT:
$sql .= "[TEXT]";
// ADD {$field_ident}_bbcode_uid [VARCHAR] (5) NOT NULL,
// ADD {$field_ident}_bbcode_bitfield [INT] UNSIGNED";
break;
case FIELD_BOOL:
case FIELD_DROPDOWN:
$sql .= '[INT] ';
break;
case FIELD_INT:
$sql .= '[FLOAT] ';
break;
}
break;
case 'postgres':
// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
$sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD COLUMN $field_ident ";
switch ($field_type)
{
case FIELD_STRING:
$sql .= ' VARCHAR(255) ';
break;
case FIELD_DATE:
$sql .= 'VARCHAR(10) ';
break;
case FIELD_TEXT:
$sql .= "TEXT";
// ADD {$field_ident}_bbcode_uid VARCHAR(5) NOT NULL,
// ADD {$field_ident}_bbcode_bitfield INT4 UNSIGNED";
break;
case FIELD_BOOL:
$sql .= 'INT2 ';
break;
case FIELD_DROPDOWN:
$sql .= 'INT4 ';
break;
case FIELD_INT:
$sql .= 'INT8 ';
break;
}
break;
case 'firebird':
// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
$sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD $field_ident ";
switch ($field_type)
{
case FIELD_STRING:
$sql .= ' VARCHAR(255) ';
break;
case FIELD_DATE:
$sql .= 'VARCHAR(10) ';
break;
case FIELD_TEXT:
$sql .= "BLOB SUB_TYPE TEXT";
// ADD {$field_ident}_bbcode_uid VARCHAR(5) NOT NULL,
// ADD {$field_ident}_bbcode_bitfield INTEGER UNSIGNED";
break;
case FIELD_BOOL:
case FIELD_DROPDOWN:
$sql .= 'INTEGER ';
break;
case FIELD_INT:
$sql .= 'DOUBLE PRECISION ';
break;
}
break;
case 'oracle':
// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
$sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD $field_ident ";
switch ($field_type)
{
case FIELD_STRING:
$sql .= ' VARCHAR2(255) ';
break;
case FIELD_DATE:
$sql .= 'VARCHAR2(10) ';
break;
case FIELD_TEXT:
$sql .= "CLOB";
// ADD {$field_ident}_bbcode_uid VARCHAR2(5) NOT NULL,
// ADD {$field_ident}_bbcode_bitfield NUMBER(11) UNSIGNED";
break;
case FIELD_BOOL:
$sql .= 'NUMBER(2) ';
break;
case FIELD_DROPDOWN:
$sql .= 'NUMBER(8) ';
break;
case FIELD_INT:
$sql .= 'NUMBER(20) ';
break;
}
break;
}
$profile_sql[] = $sql;
$field_ident = 'pf_' . $field_ident;
$profile_sql[] = $this->add_field_ident($field_ident, $field_type);
}
$sql_ary = array(
'lang_name' => $cp->vars['lang_name'],
'lang_explain' => $cp->vars['lang_explain'],
'lang_name' => $cp->vars['lang_name'],
'lang_explain' => $cp->vars['lang_explain'],
'lang_default_value' => $cp->vars['lang_default_value']
);
@@ -1248,10 +1046,11 @@ class acp_profile
}
}
$cp->vars['l_lang_name'] = request_var('l_lang_name', '', true);
$cp->vars['l_lang_explain'] = request_var('l_lang_explain', '', true);
$cp->vars['l_lang_default_value'] = request_var('l_lang_default_value', '', true);
$cp->vars['l_lang_options'] = request_var('l_lang_options', '', true);
// These are always arrays because the key is the language id...
$cp->vars['l_lang_name'] = request_var('l_lang_name', array(0 => ''), true);
$cp->vars['l_lang_explain'] = request_var('l_lang_explain', array(0 => ''), true);
$cp->vars['l_lang_default_value'] = request_var('l_lang_default_value', array(0 => ''), true);
$cp->vars['l_lang_options'] = request_var('l_lang_options', array(0 => ''), true);
if ($cp->vars['lang_options'])
{
@@ -1272,7 +1071,7 @@ class acp_profile
{
$sql_ary = array(
'field_type' => (int) $field_type,
'value' => $value
'lang_value' => $value
);
if ($action == 'create')
@@ -1286,9 +1085,9 @@ class acp_profile
else
{
$this->update_insert(PROFILE_FIELDS_LANG_TABLE, $sql_ary, array(
'field_id' => $field_id,
'lang_id' => (int) $default_lang_id,
'option_id' => (int) $option_id)
'field_id' => $field_id,
'lang_id' => (int) $default_lang_id,
'option_id' => (int) $option_id)
);
}
}
@@ -1327,7 +1126,7 @@ class acp_profile
'lang_id' => (int) $lang_id,
'option_id' => (int) $option_id,
'field_type' => (int) $field_type,
'value' => $value
'lang_value' => $value
);
}
}
@@ -1380,6 +1179,7 @@ class acp_profile
}
}
$db->sql_transaction('begin');
if ($action == 'create')
@@ -1399,7 +1199,7 @@ class acp_profile
}
else
{
add_log('admin', 'LOG_PROFILE_FIELD_CREATE', $field_ident . ':' . $cp->vars['lang_name']);
add_log('admin', 'LOG_PROFILE_FIELD_CREATE', substr($field_ident, 3) . ':' . $cp->vars['lang_name']);
trigger_error($user->lang['ADDED_PROFILE_FIELD'] . adm_back_link($this->u_action));
}
}
@@ -1451,6 +1251,276 @@ class acp_profile
}
}
}
/**
* Return sql statement for adding a new field ident (profile field) to the profile fields data table
*/
function add_field_ident($field_ident, $field_type)
{
global $db;
switch ($db->sql_layer)
{
case 'mysql':
case 'mysql4':
case 'mysqli':
// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
$sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD `$field_ident` ";
switch ($field_type)
{
case FIELD_STRING:
$sql .= ' VARCHAR(255) ';
break;
case FIELD_DATE:
$sql .= 'VARCHAR(10) ';
break;
case FIELD_TEXT:
$sql .= "TEXT";
// ADD {$field_ident}_bbcode_uid VARCHAR(5) NOT NULL,
// ADD {$field_ident}_bbcode_bitfield INT(11) UNSIGNED";
break;
case FIELD_BOOL:
$sql .= 'TINYINT(2) ';
break;
case FIELD_DROPDOWN:
$sql .= 'MEDIUMINT(8) ';
break;
case FIELD_INT:
$sql .= 'BIGINT(20) ';
break;
}
break;
case 'sqlite':
switch ($field_type)
{
case FIELD_STRING:
$type = ' VARCHAR(255) ';
break;
case FIELD_DATE:
$type = 'VARCHAR(10) ';
break;
case FIELD_TEXT:
$type = "TEXT(65535)";
// ADD {$field_ident}_bbcode_uid VARCHAR(5) NOT NULL,
// ADD {$field_ident}_bbcode_bitfield INT(11) UNSIGNED";
break;
case FIELD_BOOL:
$type = 'TINYINT(2) ';
break;
case FIELD_DROPDOWN:
$type = 'MEDIUMINT(8) ';
break;
case FIELD_INT:
$type = 'BIGINT(20) ';
break;
}
// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
if (version_compare(sqlite_libversion(), '3.0') == -1)
{
$sql = "SELECT sql
FROM sqlite_master
WHERE type = 'table'
AND name = '" . PROFILE_FIELDS_DATA_TABLE . "'
ORDER BY type DESC, name;";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// Create a temp table and populate it, destroy the existing one
$db->sql_query(preg_replace('#CREATE\s+TABLE\s+"?' . PROFILE_FIELDS_DATA_TABLE . '"?#i', 'CREATE TEMPORARY TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp', $row['sql']));
$db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . '_temp SELECT * FROM ' . PROFILE_FIELDS_DATA_TABLE);
$db->sql_query('DROP TABLE ' . PROFILE_FIELDS_DATA_TABLE);
preg_match('#\((.*)\)#s', $row['sql'], $matches);
$new_table_cols = trim($matches[1]);
$old_table_cols = explode(',', $new_table_cols);
$column_list = array();
foreach ($old_table_cols as $declaration)
{
$entities = preg_split('#\s+#', trim($declaration));
if ($entities == 'PRIMARY')
{
continue;
}
$column_list[] = $entities[0];
}
$columns = implode(',', $column_list);
$new_table_cols = $field_ident . ' ' . $type . ',' . $new_table_cols;
// create a new table and fill it up. destroy the temp one
$db->sql_query('CREATE TABLE ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $new_table_cols . ');');
$db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . PROFILE_FIELDS_DATA_TABLE . '_temp;');
$db->sql_query('DROP TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp');
}
else
{
$sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD $field_ident [$type]";
}
break;
case 'mssql':
case 'mssql_odbc':
// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
$sql = 'ALTER TABLE [' . PROFILE_FIELDS_DATA_TABLE . "] ADD [$field_ident] ";
switch ($field_type)
{
case FIELD_STRING:
$sql .= ' [VARCHAR] (255) ';
break;
case FIELD_DATE:
$sql .= '[VARCHAR] (10) ';
break;
case FIELD_TEXT:
$sql .= "[TEXT]";
// ADD {$field_ident}_bbcode_uid [VARCHAR] (5) NOT NULL,
// ADD {$field_ident}_bbcode_bitfield [INT] UNSIGNED";
break;
case FIELD_BOOL:
case FIELD_DROPDOWN:
$sql .= '[INT] ';
break;
case FIELD_INT:
$sql .= '[FLOAT] ';
break;
}
break;
case 'postgres':
// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
$sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD COLUMN \"$field_ident\" ";
switch ($field_type)
{
case FIELD_STRING:
$sql .= ' VARCHAR(255) ';
break;
case FIELD_DATE:
$sql .= 'VARCHAR(10) ';
break;
case FIELD_TEXT:
$sql .= "TEXT";
// ADD {$field_ident}_bbcode_uid VARCHAR(5) NOT NULL,
// ADD {$field_ident}_bbcode_bitfield INT4 UNSIGNED";
break;
case FIELD_BOOL:
$sql .= 'INT2 ';
break;
case FIELD_DROPDOWN:
$sql .= 'INT4 ';
break;
case FIELD_INT:
$sql .= 'INT8 ';
break;
}
break;
case 'firebird':
// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
$sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD \"$field_ident\" ";
switch ($field_type)
{
case FIELD_STRING:
$sql .= ' VARCHAR(255) ';
break;
case FIELD_DATE:
$sql .= 'VARCHAR(10) ';
break;
case FIELD_TEXT:
$sql .= "BLOB SUB_TYPE TEXT";
// ADD {$field_ident}_bbcode_uid VARCHAR(5) NOT NULL,
// ADD {$field_ident}_bbcode_bitfield INTEGER UNSIGNED";
break;
case FIELD_BOOL:
case FIELD_DROPDOWN:
$sql .= 'INTEGER ';
break;
case FIELD_INT:
$sql .= 'DOUBLE PRECISION ';
break;
}
break;
case 'oracle':
// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
$sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD \"$field_ident\" ";
switch ($field_type)
{
case FIELD_STRING:
$sql .= ' VARCHAR2(255) ';
break;
case FIELD_DATE:
$sql .= 'VARCHAR2(10) ';
break;
case FIELD_TEXT:
$sql .= "CLOB";
// ADD {$field_ident}_bbcode_uid VARCHAR2(5) NOT NULL,
// ADD {$field_ident}_bbcode_bitfield NUMBER(11) UNSIGNED";
break;
case FIELD_BOOL:
$sql .= 'NUMBER(2) ';
break;
case FIELD_DROPDOWN:
$sql .= 'NUMBER(8) ';
break;
case FIELD_INT:
$sql .= 'NUMBER(20) ';
break;
}
break;
}
return $sql;
}
}
?>

View File

@@ -68,7 +68,7 @@ class acp_prune
'S_PRUNED' => true)
);
$sql_forum = (sizeof($forum_id)) ? ' AND forum_id IN (' . implode(', ', $forum_id) . ')' : '';
$sql_forum = (sizeof($forum_id)) ? ' AND ' . $db->sql_in_set('forum_id', $forum_id) : '';
// Get a list of forum's or the data for the forum that we are pruning.
$sql = 'SELECT forum_id, forum_name
@@ -148,14 +148,14 @@ class acp_prune
{
$sql = 'SELECT forum_id, forum_name
FROM ' . FORUMS_TABLE . '
WHERE forum_id IN (' . implode(', ', $forum_id) . ')';
WHERE ' . $db->sql_in_set('forum_id', $forum_id);
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
if (!$row)
{
$db->sql_freeresult($result);
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$forum_list = $s_hidden_fields = '';
@@ -196,21 +196,14 @@ class acp_prune
{
if (confirm_box(true))
{
$users = request_var('users', '');
$users = request_var('users', '', true);
$action = request_var('action', 'deactivate');
$deleteposts = request_var('deleteposts', 0);
if ($users)
{
$users = explode("\n", $users);
$where_sql = '';
foreach ($users as $username)
{
$where_sql .= (($where_sql != '') ? ', ' : '') . "'" . $db->sql_escape($username) . "'";
}
$where_sql = " AND username IN ($where_sql)";
$where_sql = ' AND ' . $db->sql_in_set('username_clean', array_map('utf8_clean_string', $users));
}
else
{
@@ -232,7 +225,7 @@ class acp_prune
$sort_by_types = array('username', 'user_email', 'user_posts', 'user_regdate', 'user_lastvisit');
$where_sql = '';
$where_sql .= ($username) ? " AND username LIKE '" . $db->sql_escape(str_replace('*', '%', $username)) . "'" : '';
$where_sql .= ($username) ? " AND username_clean LIKE '" . $db->sql_escape(str_replace('*', '%', utf8_clean_string($username))) . "'" : '';
$where_sql .= ($email) ? " AND user_email LIKE '" . $db->sql_escape(str_replace('*', '%', $email)) . "' " : '';
$where_sql .= (sizeof($joined)) ? " AND user_regdate " . $key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, (int) $joined[1], (int) $joined[2], (int) $joined[0]) : '';
$where_sql .= ($count) ? " AND user_posts " . $key_match[$count_select] . " $count " : '';
@@ -252,7 +245,8 @@ class acp_prune
$db->sql_freeresult($result);
// Do not prune founder members
$sql = 'SELECT username, user_id FROM ' . USERS_TABLE . '
$sql = 'SELECT user_id, username
FROM ' . USERS_TABLE . '
WHERE user_id <> ' . ANONYMOUS . '
AND user_type <> ' . USER_FOUNDER . "
$where_sql";
@@ -275,11 +269,7 @@ class acp_prune
{
if ($action == 'deactivate')
{
foreach ($user_ids as $user_id)
{
user_active_flip($user_id, USER_NORMAL, false, false, true);
}
user_active_flip('deactivate', $user_ids);
$l_log = 'LOG_PRUNE_USER_DEAC';
}
else if ($action == 'delete')

View File

@@ -37,7 +37,7 @@ class acp_ranks
$rank_title = request_var('title', '', true);
$special_rank = request_var('special_rank', 0);
$min_posts = ($special_rank) ? -1 : request_var('min_posts', 0);
$min_posts = ($special_rank) ? 0 : request_var('min_posts', 0);
$rank_image = request_var('rank_image', '');
// The rank image has to be a jpg, gif or png
@@ -48,14 +48,14 @@ class acp_ranks
if (!$rank_title)
{
trigger_error($user->lang['NO_RANK_TITLE'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_RANK_TITLE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql_ary = array(
'rank_title' => $rank_title,
'rank_special' => $special_rank,
'rank_min' => $min_posts,
'rank_image' => html_entity_decode($rank_image)
'rank_image' => htmlspecialchars_decode($rank_image)
);
if ($rank_id)
@@ -96,7 +96,7 @@ class acp_ranks
}
else
{
trigger_error($user->lang['MUST_SELECT_RANK'] . adm_back_link($this->u_action));
trigger_error($user->lang['MUST_SELECT_RANK'] . adm_back_link($this->u_action), E_USER_WARNING);
}
break;
@@ -130,7 +130,7 @@ class acp_ranks
{
foreach ($img_ary as $img)
{
$img = substr($path, 1) . (($path != '') ? '/' : '') . $img;
$img = $path . $img;
if (!in_array($img, $existing_imgs) || $action == 'edit')
{

View File

@@ -61,11 +61,11 @@ class acp_reasons
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($row['reason_title'] == 'other')
if (strtolower($row['reason_title']) == 'other')
{
$reason_row['reason_title'] = 'other';
}
else if (strtolower($row['reason_title']) != strtolower($reason_row['reason_title']))
else if ($row['reason_title'] != $reason_row['reason_title'])
{
$check_double = true;
}
@@ -76,12 +76,12 @@ class acp_reasons
{
$sql = 'SELECT reason_id
FROM ' . REPORTS_REASONS_TABLE . "
WHERE LOWER(reason_title) = '" . strtolower($reason_row['reason_title']) . "'";
WHERE reason_title = '" . $db->sql_escape($reason_row['reason_title']) . "'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($row)
if ($row || ($action == 'add' && strtolower($reason_row['reason_title']) == 'other'))
{
$error[] = $user->lang['REASON_ALREADY_EXIST'];
}
@@ -137,7 +137,7 @@ class acp_reasons
if (!$reason_row)
{
trigger_error($user->lang['NO_REASON'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_REASON'] . adm_back_link($this->u_action), E_USER_WARNING);
}
}
@@ -159,10 +159,14 @@ class acp_reasons
'REASON_TITLE' => $reason_row['reason_title'],
'REASON_DESCRIPTION' => $reason_row['reason_description'],
'S_EDIT_REASON' => true,
'S_TRANSLATED' => $translated,
'S_ERROR' => (sizeof($error)) ? true : false,
'TRANSLATED_TITLE' => ($translated) ? $user->lang['report_reasons']['TITLE'][strtoupper($reason_row['reason_title'])] : '',
'TRANSLATED_DESCRIPTION'=> ($translated) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason_row['reason_title'])] : '',
'S_AVAILABLE_TITLES' => implode(', ', array_map('htmlspecialchars', array_keys($user->lang['report_reasons']['TITLE']))),
'S_EDIT_REASON' => true,
'S_TRANSLATED' => $translated,
'S_ERROR' => (sizeof($error)) ? true : false,
)
);
@@ -180,12 +184,12 @@ class acp_reasons
if (!$reason_row)
{
trigger_error($user->lang['NO_REASON'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_REASON'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if ($reason_row['reason_title'] == 'other')
if (strtolower($reason_row['reason_title']) == 'other')
{
trigger_error($user->lang['NO_REMOVE_DEFAULT_REASON'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_REMOVE_DEFAULT_REASON'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// Let the deletion be confirmed...
@@ -193,15 +197,51 @@ class acp_reasons
{
$sql = 'SELECT reason_id
FROM ' . REPORTS_REASONS_TABLE . "
WHERE reason_title = 'other'";
WHERE LOWER(reason_title) = 'other'";
$result = $db->sql_query($sql);
$other_reason_id = (int) $db->sql_fetchfield('reason_id');
$db->sql_freeresult($result);
// Change the reports using this reason to 'other'
$sql = 'UPDATE ' . REPORTS_TABLE . '
SET reason_id = ' . $other_reason_id . ", report_text = CONCAT('" . $db->sql_escape($reason_row['reason_description']) . "\n\n', report_text)
WHERE reason_id = $reason_id";
switch ($db->sql_layer)
{
// The ugly one!
case 'mysqli':
case 'mysql4':
case 'mysql':
// Change the reports using this reason to 'other'
$sql = 'UPDATE ' . REPORTS_TABLE . '
SET reason_id = ' . $other_reason_id . ", report_text = CONCAT('" . $db->sql_escape($reason_row['reason_description']) . "\n\n', report_text)
WHERE reason_id = $reason_id";
break;
// Nearly standard, not quite
case 'mssql':
case 'mssql_odbc':
// Change the reports using this reason to 'other'
$sql = "DECLARE @ptrval binary(16)
SELECT @ptrval = TEXTPTR(report_text)
FROM " . REPORTS_TABLE . "
WHERE reason_id = " . $reason_id . "
UPDATETEXT " . REPORTS_TABLE . ".report_text @ptrval 0 0 '" . $db->sql_escape($reason_row['reason_description']) . "\n\n'
UPDATE " . REPORTS_TABLE . '
SET reason_id = ' . $other_reason_id . "
WHERE reason_id = $reason_id";
break;
// Teh standard
case 'postgres':
case 'oracle':
case 'firebird':
case 'sqlite':
// Change the reports using this reason to 'other'
$sql = 'UPDATE ' . REPORTS_TABLE . '
SET reason_id = ' . $other_reason_id . ", report_text = '" . $db->sql_escape($reason_row['reason_description']) . "\n\n' || report_text
WHERE reason_id = $reason_id";
break;
}
$db->sql_query($sql);
$db->sql_query('DELETE FROM ' . REPORTS_REASONS_TABLE . ' WHERE reason_id = ' . $reason_id);
@@ -291,7 +331,7 @@ class acp_reasons
// If the reason is defined within the language file, we will use the localized version, else just use the database entry...
if (isset($user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])]) && isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]))
{
$row['reson_description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])];
$row['reason_description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])];
$row['reason_title'] = $user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])];
$translated = true;

View File

@@ -152,7 +152,7 @@ class acp_search
}
else
{
trigger_error($error);
trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING);
}
}
else
@@ -168,7 +168,7 @@ class acp_search
}
else
{
trigger_error($error);
trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING);
}
}
@@ -228,7 +228,8 @@ class acp_search
break;
default:
trigger_error('NO_ACTION');
trigger_error('NO_ACTION', E_USER_ERROR);
break;
}
if (empty($this->state[0]))
@@ -240,7 +241,7 @@ class acp_search
$error = false;
if ($this->init_search($this->state[0], $this->search, $error))
{
trigger_error($error);
trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING);
}
$action = &$this->state[1];
@@ -262,28 +263,29 @@ class acp_search
{
$this->state = array('');
$this->save_state();
trigger_error($error . adm_back_link($this->u_action) . $this->close_popup_js());
trigger_error($error . adm_back_link($this->u_action) . $this->close_popup_js(), E_USER_WARNING);
}
}
else
{
$sql = 'SELECT post_id, poster_id
$sql = 'SELECT post_id, poster_id, forum_id
FROM ' . POSTS_TABLE . '
WHERE post_id >= ' . (int) ($post_counter + 1) . '
AND post_id < ' . (int) ($post_counter + $this->batch_size);
$result = $db->sql_query($sql);
$ids = $posters = array();
while (false !== ($row = $db->sql_fetchrow($result)))
while ($row = $db->sql_fetchrow($result))
{
$ids[] = $row['post_id'];
$posters[] = $row['poster_id'];
$forum_ids[] = $row['forum_id'];
}
$db->sql_freeresult($result);
if (sizeof($ids))
{
$this->search->index_remove($ids, $posters);
$this->search->index_remove($ids, $posters, $forum_ids);
}
$post_counter += $this->batch_size;
@@ -293,7 +295,7 @@ class acp_search
if ($post_counter <= $this->max_post_id)
{
redirect($this->u_action . '&amp;action=delete', 3);
redirect($this->u_action . '&amp;action=delete');
}
}
@@ -313,20 +315,20 @@ class acp_search
{
$this->state = array('');
$this->save_state();
trigger_error($error . adm_back_link($this->u_action) . $this->close_popup_js());
trigger_error($error . adm_back_link($this->u_action) . $this->close_popup_js(), E_USER_WARNING);
}
}
else
{
$sql = 'SELECT post_id, post_subject, post_text, poster_id
$sql = 'SELECT post_id, post_subject, post_text, poster_id, forum_id
FROM ' . POSTS_TABLE . '
WHERE post_id >= ' . (int) ($post_counter + 1) . '
AND post_id < ' . (int) ($post_counter + $this->batch_size);
$result = $db->sql_query($sql);
while (false !== ($row = $db->sql_fetchrow($result)))
while ($row = $db->sql_fetchrow($result))
{
$this->search->index('post', $row['post_id'], $row['post_text'], $row['post_subject'], $row['poster_id']);
$this->search->index('post', $row['post_id'], $row['post_text'], $row['post_subject'], $row['poster_id'], $row['forum_id']);
}
$db->sql_freeresult($result);
@@ -337,7 +339,7 @@ class acp_search
if ($post_counter <= $this->max_post_id)
{
redirect($this->u_action . '&amp;action=create', 3);
redirect($this->u_action . '&amp;action=create');
}
}
@@ -439,7 +441,7 @@ class acp_search
adm_page_header($user->lang[$l_type]);
$template->set_filenames(array(
'body' => 'search_index_progress_bar.html')
'body' => 'progress_bar.html')
);
$template->assign_vars(array(
@@ -523,6 +525,12 @@ class acp_search
include_once("{$phpbb_root_path}includes/search/$type.$phpEx");
if (!class_exists($type))
{
$error = $user->lang['NO_SUCH_SEARCH_MODULE'];
return $error;
}
$error = false;
$search = new $type($error);

View File

@@ -27,7 +27,14 @@ class acp_styles
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
// Hardcoded template bitfield to add for new templates
define('TEMPLATE_BITFIELD', 6921);
$bitfield = new bitfield();
$bitfield->set(0);
$bitfield->set(3);
$bitfield->set(8);
$bitfield->set(9);
$bitfield->set(11);
$bitfield->set(12);
define('TEMPLATE_BITFIELD', $bitfield->get_base64());
$user->add_lang('acp/styles');
@@ -82,7 +89,32 @@ parse_css_file = {PARSE_CSS_FILE}
pagination_sep = \'{PAGINATION_SEP}\'
';
$this->imageset_keys = 'site_logo, btn_post, btn_post_pm, btn_reply, btn_reply_pm, btn_locked, btn_profile, btn_pm, btn_delete, btn_info, btn_quote, btn_search, btn_edit, btn_report, btn_email, btn_www, btn_icq, btn_aim, btn_yim, btn_msnm, btn_jabber, btn_online, btn_offline, btn_friend, btn_foe, icon_unapproved, icon_reported, icon_attach, icon_post, icon_post_new, icon_post_latest, icon_post_newest, forum, forum_new, forum_locked, forum_link, sub_forum, sub_forum_new, folder, folder_moved, folder_posted, folder_new, folder_new_posted, folder_hot, folder_hot_posted, folder_hot_new, folder_hot_new_posted, folder_locked, folder_locked_posted, folder_locked_new, folder_locked_new_posted, folder_sticky, folder_sticky_posted, folder_sticky_new, folder_sticky_new_posted, folder_announce, folder_announce_posted, folder_announce_new, folder_announce_new_posted, folder_global, folder_global_posted, folder_global_new, folder_global_new_posted, poll_left, poll_center, poll_right, attach_progress_bar, user_icon1, user_icon2, user_icon3, user_icon4, user_icon5, user_icon6, user_icon7, user_icon8, user_icon9, user_icon10';
$this->imageset_keys = array(
'logos' => array(
'site_logo',
),
'buttons' => array(
'icon_contact_aim', 'icon_contact_email', 'icon_contact_icq', 'icon_contact_jabber', 'icon_contact_msnm', 'icon_contact_pm', 'icon_contact_yahoo', 'icon_contact_www', 'icon_post_delete', 'icon_post_edit', 'icon_post_info', 'icon_post_quote', 'icon_post_report', 'icon_user_online', 'icon_user_offline', 'icon_user_profile', 'icon_user_search', 'icon_user_warn', 'button_pm_forward', 'button_pm_new', 'button_pm_reply', 'button_topic_locked', 'button_topic_new', 'button_topic_reply',
),
'icons' => array(
'icon_post_target', 'icon_post_target_unread', 'icon_topic_attach', 'icon_topic_latest', 'icon_topic_newest', 'icon_topic_reported', 'icon_topic_unapproved', 'icon_friend', 'icon_foe',
),
'forums' => array(
'forum_link', 'forum_read', 'forum_read_locked', 'forum_read_subforum', 'forum_unread', 'forum_unread_locked', 'forum_unread_subforum',
),
'folders' => array(
'topic_moved', 'topic_read', 'topic_read_mine', 'topic_read_hot', 'topic_read_hot_mine', 'topic_read_locked', 'topic_read_locked_mine', 'topic_unread', 'topic_unread_mine', 'topic_unread_hot', 'topic_unread_hot_mine', 'topic_unread_locked', 'topic_unread_locked_mine', 'sticky_read', 'sticky_read_mine', 'sticky_read_locked', 'sticky_read_locked_mine', 'sticky_unread', 'sticky_unread_mine', 'sticky_unread_locked', 'sticky_unread_locked_mine', 'announce_read', 'announce_read_mine', 'announce_read_locked', 'announce_read_locked_mine', 'announce_unread', 'announce_unread_mine', 'announce_unread_locked', 'announce_unread_locked_mine', 'global_read', 'global_read_mine', 'global_read_locked', 'global_read_locked_mine', 'global_unread', 'global_unread_mine', 'global_unread_locked', 'global_unread_locked_mine', 'pm_read', 'pm_unread',
),
'polls' => array(
'poll_left', 'poll_center', 'poll_right',
),
'ui' => array(
'upload_bar',
),
'user' => array(
'user_icon1', 'user_icon2', 'user_icon3', 'user_icon4', 'user_icon5', 'user_icon6', 'user_icon7', 'user_icon8', 'user_icon9', 'user_icon10',
),
);
// Execute overall actions
switch ($action)
@@ -159,7 +191,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if ($style_id == $config['default_style'])
{
trigger_error($user->lang['DEACTIVATE_DEFAULT'] . adm_back_link($this->u_action));
trigger_error($user->lang['DEACTIVATE_DEFAULT'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'UPDATE ' . STYLES_TABLE . '
@@ -183,7 +215,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
break;
}
$this->frontend('style', array('details', 'export', 'delete'));
$this->frontend('style', array('details'), array('export', 'delete'));
break;
case 'template':
@@ -202,7 +234,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!$template_row)
{
trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (confirm_box(true))
@@ -260,7 +292,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
break;
}
$this->frontend('template', array('cache', 'details', 'refresh', 'edit', 'export', 'delete'));
$this->frontend('template', array('edit', 'cache', 'details'), array('refresh', 'export', 'delete'));
break;
case 'theme':
@@ -279,12 +311,12 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!$theme_row)
{
trigger_error($user->lang['NO_THEME'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_THEME'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (!$theme_row['theme_storedb'])
{
trigger_error($user->lang['THEME_ERR_REFRESH_FS'] . adm_back_link($this->u_action));
trigger_error($user->lang['THEME_ERR_REFRESH_FS'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (confirm_box(true))
@@ -303,6 +335,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
$cache->destroy('sql', STYLES_THEME_TABLE);
add_log('admin', 'LOG_THEME_REFRESHED', $theme_row['theme_name']);
trigger_error($user->lang['THEME_REFRESHED'] . adm_back_link($this->u_action));
}
}
@@ -318,11 +351,77 @@ pagination_sep = \'{PAGINATION_SEP}\'
break;
}
$this->frontend('theme', array('details', 'refresh', 'edit', 'export', 'delete'));
$this->frontend('theme', array('edit', 'details'), array('refresh', 'export', 'delete'));
break;
case 'imageset':
$this->frontend('imageset', array('details', 'edit', 'delete', 'export'));
switch ($action)
{
case 'refresh':
$sql = 'SELECT *
FROM ' . STYLES_IMAGESET_TABLE . "
WHERE imageset_id = $style_id";
$result = $db->sql_query($sql);
$imageset_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$imageset_row)
{
trigger_error($user->lang['NO_IMAGESET'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (confirm_box(true))
{
$sql_ary = array();
$cfg_data = parse_cfg_file("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/imageset.cfg");
$imageset_definitions = array();
foreach ($this->imageset_keys as $topic => $key_array)
{
$imageset_definitions = array_merge($imageset_definitions, $key_array);
}
foreach ($cfg_data as $key => $value)
{
if (strpos($key, 'img_') === 0)
{
$key = substr($key, 4);
if (in_array($key, $imageset_definitions))
{
$sql_ary[$key] = str_replace('{PATH}', "styles/{$imageset_row['imageset_path']}/imageset/", trim($value));
}
}
}
unset($cfg_data);
if (sizeof($sql_ary))
{
$sql = 'UPDATE ' . STYLES_IMAGESET_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
WHERE imageset_id = $style_id";
$db->sql_query($sql);
}
$cache->destroy('sql', STYLES_IMAGESET_TABLE);
add_log('admin', 'LOG_IMAGESET_REFRESHED', $imageset_row['imageset_name']);
trigger_error($user->lang['IMAGESET_REFRESHED'] . adm_back_link($this->u_action));
}
else
{
confirm_box(false, $user->lang['CONFIRM_IMAGESET_REFRESH'], build_hidden_fields(array(
'i' => $id,
'mode' => $mode,
'action' => $action,
'id' => $style_id
)));
}
break;
}
$this->frontend('imageset', array('edit', 'details'), array('refresh', 'export', 'delete'));
break;
}
}
@@ -330,7 +429,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
/**
* Build Frontend with supplied options
*/
function frontend($mode, $options)
function frontend($mode, $options, $actions)
{
global $user, $template, $db, $config, $phpbb_root_path, $phpEx;
@@ -408,12 +507,19 @@ pagination_sep = \'{PAGINATION_SEP}\'
$s_options[] = '<a href="' . $this->u_action . "&amp;action=$option&amp;id=" . $row[$mode . '_id'] . '">' . $user->lang[strtoupper($option)] . '</a>';
}
$s_actions = array();
foreach ($actions as $option)
{
$s_actions[] = '<a href="' . $this->u_action . "&amp;action=$option&amp;id=" . $row[$mode . '_id'] . '">' . $user->lang[strtoupper($option)] . '</a>';
}
$template->assign_block_vars('installed', array(
'S_DEFAULT_STYLE' => ($mode == 'style' && $row['style_id'] == $config['default_style']) ? true : false,
'U_EDIT' => $this->u_action . '&amp;action=' . (($mode == 'style') ? 'details' : 'edit') . '&amp;id=' . $row[$mode . '_id'],
'U_STYLE_ACT_DEACT' => $this->u_action . '&amp;action=' . $stylevis . '&amp;id=' . $row[$mode . '_id'],
'L_STYLE_ACT_DEACT' => $user->lang['STYLE_' . strtoupper($stylevis)],
'S_OPTIONS' => implode(' | ', $s_options),
'S_ACTIONS' => implode(' | ', $s_actions),
'U_PREVIEW' => ($mode == 'style') ? append_sid("{$phpbb_root_path}index.$phpEx", "$mode=" . $row[$mode . '_id']) : '',
'NAME' => $row[$mode . '_name'],
@@ -430,7 +536,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
while (($file = readdir($dp)) !== false)
{
$subpath = ($mode != 'style') ? "$mode/" : '';
if ($file{0} != '.' && file_exists("{$phpbb_root_path}styles/$file/$subpath$mode.cfg"))
if ($file[0] != '.' && file_exists("{$phpbb_root_path}styles/$file/$subpath$mode.cfg"))
{
if ($cfg = file("{$phpbb_root_path}styles/$file/$subpath$mode.cfg"))
{
@@ -483,28 +589,30 @@ pagination_sep = \'{PAGINATION_SEP}\'
$filelist = $filelist_cats = array();
$template_data = (!empty($_POST['template_data'])) ? ((STRIP) ? stripslashes($_POST['template_data']) : $_POST['template_data']) : '';
$template_file = request_var('template_file', '');
// we want newlines no carriage returns!
$_POST['template_data'] = (isset($_POST['template_data']) && !empty($_POST['template_data'])) ? str_replace(array("\r\n", "\r"), array("\n", "\n"), $_POST['template_data']) : '';
$template_data = (STRIP) ? stripslashes($_POST['template_data']) : $_POST['template_data'];
$template_file = request_var('template_file', '');
$text_rows = max(5, min(999, request_var('text_rows', 20)));
$save_changes = (isset($_POST['save'])) ? true : false;
// make sure template_file path doesn't go upwards
$template_file = str_replace('..', '.', $template_file);
// we want newlines no carriage returns!
$template_data = str_replace(array("\n\r", "\r"), array("\n", "\n"), $template_data);
// Retrieve some information about the template
$sql = 'SELECT template_storedb, template_path, template_name
FROM ' . STYLES_TEMPLATE_TABLE . "
WHERE template_id = $template_id";
$result = $db->sql_query($sql);
if (!($template_info = $db->sql_fetchrow($result)))
{
trigger_error($user->lang['NO_TEMPLATE']);
}
$template_info = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$template_info)
{
trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// save changes to the template if the user submitted any
if ($save_changes && $template_file)
{
@@ -517,7 +625,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
{
if (!($fp = fopen($file, 'wb')))
{
trigger_error($user->lang['NO_TEMPLATE']);
trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
fwrite($fp, $template_data);
fclose($fp);
@@ -570,7 +678,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
{
if (!file_exists($template_path . "/$template_file") || !($template_data = file_get_contents($template_path . "/$template_file")))
{
trigger_error($user->lang['NO_TEMPLATE']);
trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
}
}
@@ -675,7 +783,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
'SELECTED_TEMPLATE' => $template_info['template_name'],
'TEMPLATE_FILE' => $template_file,
'TEMPLATE_DATA' => htmlentities($template_data),
'TEMPLATE_DATA' => htmlspecialchars($template_data),
'TEXT_ROWS' => $text_rows)
);
}
@@ -697,13 +805,14 @@ pagination_sep = \'{PAGINATION_SEP}\'
FROM ' . STYLES_TEMPLATE_TABLE . "
WHERE template_id = $template_id";
$result = $db->sql_query($sql);
if (!($template_row = $db->sql_fetchrow($result)))
{
trigger_error($user->lang['NO_TEMPLATE']);
}
$template_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$template_row)
{
trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// User wants to delete one or more files ...
if ($submit && $file_ary)
{
@@ -728,7 +837,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
'FILENAME' => str_replace('.', '/', $source) . '.html')
);
$code = str_replace(array("\n\r", "\r"), array("\n", "\n"), file_get_contents("{$phpbb_root_path}cache/{$cache_prefix}_$source.html.$phpEx"));
$code = str_replace(array("\r\n", "\r"), array("\n", "\n"), file_get_contents("{$phpbb_root_path}cache/{$cache_prefix}_$source.html.$phpEx"));
$conf = array('highlight.bg', 'highlight.comment', 'highlight.default', 'highlight.html', 'highlight.keyword', 'highlight.string');
foreach ($conf as $ini_var)
@@ -815,20 +924,20 @@ pagination_sep = \'{PAGINATION_SEP}\'
$this->page_title = 'EDIT_THEME';
// we want newlines no carriage returns!
$_POST['css_data'] = (isset($_POST['css_data']) && !empty($_POST['css_data'])) ? str_replace(array("\r\n", "\r"), array("\n", "\n"), $_POST['css_data']) : '';
// get user input
$text_rows = max(5, min(999, request_var('text_rows', 20)));
$hide_css = request_var('hidecss', false);
$show_css = !$hide_css && request_var('showcss', false);
$edit_class = request_var('css_class', '');
$custom_class = request_var('custom_class', '');
$css_data = (!empty($_POST['css_data'])) ? ((STRIP) ? stripslashes($_POST['css_data']) : $_POST['css_data']) : '';
$css_data = (STRIP) ? stripslashes($_POST['css_data']) : $_POST['css_data'];
$submit = isset($_POST['submit']) ? true : false;
$add_custom = isset($_POST['add_custom']) ? true : false;
$matches = array();
// we want newlines no carriage returns!
$css_data = str_replace(array("\n\r", "\r"), array("\n", "\n"), $css_data);
// Retrieve some information about the theme
$sql = 'SELECT theme_storedb, theme_path, theme_name, theme_data
FROM ' . STYLES_THEME_TABLE . "
@@ -837,7 +946,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!($theme_info = $db->sql_fetchrow($result)))
{
trigger_error($user->lang['NO_THEME']);
trigger_error($user->lang['NO_THEME'] . adm_bacl_link($this->u_action), E_USER_WARNING);
}
$db->sql_freeresult($result);
@@ -847,7 +956,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
{
if (!file_exists($stylesheet_path) || !($stylesheet = file_get_contents($stylesheet_path)))
{
trigger_error($user->lang['NO_THEME']);
trigger_error($user->lang['NO_THEME'] . adm_back_link($this->u_action), E_USER_WARNING);
}
}
else
@@ -857,7 +966,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
// Pull out a list of classes
$classes = array();
if (preg_match_all('/^([a-z0-9\.:#> \t]+?)[ \t\n]*?\{.*?\}/msi', $stylesheet, $matches))
if (preg_match_all('/^([a-z0-9\.,:#> \t]+?)[ \t\n]*?\{.*?\}/msi', $stylesheet, $matches))
{
$classes = $matches[1];
}
@@ -903,7 +1012,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
// Used in an sprintf statement to generate appropriate output for rawcss mode
$map_elements = array(
'colors' => '%s',
'sizes' => '%d',
'sizes' => '%1.10f',
'images' => 'url(\'./%s\')',
'repeat' => '%s',
'other' => '%s',
@@ -911,11 +1020,11 @@ pagination_sep = \'{PAGINATION_SEP}\'
$units = array('px', '%', 'em', 'pt');
$repeat_types = array(
'' => $user->lang['UNSET'],
'none' => $user->lang['REPEAT_NO'],
'repeat-x' => $user->lang['REPEAT_X'],
'repeat-y' => $user->lang['REPEAT_Y'],
'both' => $user->lang['REPEAT_ALL'],
'' => $user->lang['UNSET'],
'none' => $user->lang['REPEAT_NO'],
'repeat-x' => $user->lang['REPEAT_X'],
'repeat-y' => $user->lang['REPEAT_Y'],
'both' => $user->lang['REPEAT_ALL'],
);
// Fill css_data with the class contents from the stylesheet
@@ -926,7 +1035,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!isset($matches[1]))
{
trigger_error($user->lang['NO_CLASS']);
trigger_error($user->lang['NO_CLASS'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$css_data = implode(";\n", array_diff(array_map('trim', explode("\n", preg_replace("#;[\n]*#s", "\n", $matches[1]))), array('')));
@@ -943,7 +1052,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
$css_elements = array_diff(array_map('trim', explode("\n", preg_replace("#;[\n]*#s", "\n", $css_data))), array(''));
// Grab list of potential images for the "images" type
$imglist = filelist($phpbb_root_path . 'styles/' . $theme_info['theme_name'] . '/theme');
$img_filelist = filelist($phpbb_root_path . 'styles/' . $theme_info['theme_name'] . '/theme');
foreach ($match_elements as $type => $match_ary)
{
@@ -1009,7 +1118,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
$selected = ($unit_option == $unit) ? ' selected="selected"' : '';
$s_units .= "<option value=\"$unit_option\"$selected>$unit_option</option>";
}
$s_units = '<option value=""' . (($unit == '') ? ' selected="selected"' : '') . '>' . $user->lang['NONE'] . '</option>' . $s_units;
$s_units = '<option value=""' . (($unit == '') ? ' selected="selected"' : '') . '>' . $user->lang['NO_UNIT'] . '</option>' . $s_units;
$template->assign_vars(array(
strtoupper($var) => $value,
@@ -1020,7 +1129,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
case 'images':
// generate a list of images for this setting
$s_imglist = '';
foreach ($imglist as $path => $img_ary)
foreach ($img_filelist as $path => $img_ary)
{
foreach ($img_ary as $img)
{
@@ -1030,7 +1139,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
$s_imglist .= "<option value=\"$img\"$selected>$img</option>";
}
}
$s_imglist = '<option value=""' . (($value == '') ? ' selected="selected"' : '') . '>' . $user->lang['NONE'] . '</option>' . $s_imglist;
$s_imglist = '<option value=""' . (($value == '') ? ' selected="selected"' : '') . '>' . $user->lang['NO_IMAGE'] . '</option>' . $s_imglist;
$template->assign_vars(array(
'S_' . strtoupper($var) => $s_imglist)
@@ -1065,7 +1174,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
$s_hidden_fields['cssother'] = implode(' ;; ', $css_elements);
}
unset($imglist, $css_elements);
unset($img_filelist, $css_elements);
}
// else if we are showing raw css or the user submitted data from the simple view
// then we need to turn the given information into raw css
@@ -1079,11 +1188,11 @@ pagination_sep = \'{PAGINATION_SEP}\'
$value = '';
$unit = '';
// retrieve and validate date for this setting
// retrieve and validate data for this setting
switch ($type)
{
case 'sizes':
$value = request_var($var, 0);
$value = request_var($var, 0.0);
$unit = request_var($var . '_unit', '');
if ((request_var($var, '') === '') || !in_array($unit, $units))
@@ -1123,7 +1232,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
// use the element mapping to create raw css code
if ($value !== '')
{
$css_data .= $match . ': ' . sprintf($map_elements[$type], $value) . $unit . ";\n";
$css_data .= $match . ': ' . ($type == 'sizes' ? rtrim(sprintf($map_elements[$type], $value), '0') : sprintf($map_elements[$type], $value)) . $unit . ";\n";
}
}
}
@@ -1158,7 +1267,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
// check whether the custom class name is valid
if (!preg_match('/^[a-z0-9#:.\- ]+$/i', $add_custom))
{
trigger_error($user->lang['THEME_ERR_CLASS_CHARS'] . adm_back_link($this->u_action . "&amp;action=edit&amp;id=$theme_id&amp;text_rows=$text_rows"));
trigger_error($user->lang['THEME_ERR_CLASS_CHARS'] . adm_back_link($this->u_action . "&amp;action=edit&amp;id=$theme_id&amp;text_rows=$text_rows"), E_USER_WARNING);
}
else
{
@@ -1174,7 +1283,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
// write stylesheet to file
if (!($fp = fopen($stylesheet_path, 'wb')))
{
trigger_error($user->lang['NO_THEME']);
trigger_error($user->lang['NO_THEME'] . adm_back_link($this->u_action), E_USER_WARNING);
}
fwrite($fp, $stylesheet);
fclose($fp);
@@ -1244,37 +1353,24 @@ pagination_sep = \'{PAGINATION_SEP}\'
if ($imageset_id)
{
$sql_select = ($imgname) ? ", $imgname" : '';
$sql = "SELECT imageset_path, imageset_name, imageset_copyright$sql_select
FROM " . STYLES_IMAGESET_TABLE . "
WHERE imageset_id = $imageset_id";
$result = $db->sql_query($sql);
if (!extract($db->sql_fetchrow($result)))
{
trigger_error($user->lang['NO_IMAGESET']);
}
$imageset_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$imageset_row)
{
trigger_error($user->lang['NO_IMAGESET'] . adm_back_link($this->u_action), E_USER_WARNING);
}
extract($imageset_row);
// Check to see whether the selected image exists in the table
$valid_name = ($update) ? false : true;
$imglist = array(
'logos' => array(
'site_logo',
),
'buttons' => array(
'btn_post', 'btn_reply', 'btn_locked', 'btn_quote', 'btn_edit', 'btn_delete', 'btn_report', 'btn_post_pm', 'btn_reply_pm', 'btn_profile', 'btn_pm', 'btn_info', 'btn_search', 'btn_email', 'btn_www', 'btn_icq', 'btn_aim', 'btn_yim', 'btn_msnm', 'btn_jabber', 'btn_online', 'btn_offline',
),
'icons' => array(
'icon_unapproved', 'icon_reported', 'icon_attach', 'icon_post', 'icon_post_new', 'icon_post_latest', 'icon_post_newest',),
'forums' => array(
'forum', 'forum_new', 'forum_locked', 'forum_link', 'sub_forum', 'sub_forum_new',),
'folders' => array(
'folder', 'folder_posted', 'folder_new', 'folder_new_posted', 'folder_hot', 'folder_hot_posted', 'folder_hot_new', 'folder_hot_new_posted', 'folder_locked', 'folder_locked_posted', 'folder_locked_new', 'folder_locked_new_posted', 'folder_sticky', 'folder_sticky_posted', 'folder_sticky_new', 'folder_sticky_new_posted', 'folder_announce', 'folder_announce_posted', 'folder_announce_new', 'folder_announce_new_posted',),
'polls' => array(
'poll_left', 'poll_center', 'poll_right',),
);
foreach ($imglist as $category => $img_ary)
foreach ($this->imageset_keys as $category => $img_ary)
{
if (in_array($imgname, $img_ary))
{
@@ -1317,11 +1413,12 @@ pagination_sep = \'{PAGINATION_SEP}\'
// Generate list of image options
$img_options = '';
foreach ($imglist as $category => $img_ary)
foreach ($this->imageset_keys as $category => $img_ary)
{
$template->assign_block_vars('category', array(
'NAME' => $user->lang['IMG_CAT_' . strtoupper($category)]
));
foreach ($img_ary as $img)
{
$template->assign_block_vars('category.images', array(
@@ -1342,7 +1439,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
$dp = opendir($dir);
while (($file = readdir($dp)) !== false)
{
if (!is_file($dir . '/' . $file) && !is_link($dir . '/' . $file) && $file{0} != '.' && strtoupper($file) != 'CVS' && !sizeof($imagesetlist['lang']))
if (!is_file($dir . '/' . $file) && !is_link($dir . '/' . $file) && $file[0] != '.' && strtoupper($file) != 'CVS' && !sizeof($imagesetlist['lang']))
{
$dp2 = opendir("$dir/$file");
while (($file2 = readdir($dp2)) !== false)
@@ -1362,6 +1459,10 @@ pagination_sep = \'{PAGINATION_SEP}\'
}
closedir($dp);
// Make sure the list of possible images is sorted alphabetically
sort($imagesetlist['nolang']);
sort($imagesetlist['lang']);
$imagesetlist_options = '';
foreach ($imagesetlist as $type => $img_ary)
{
@@ -1395,7 +1496,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
'IMAGE_OPTIONS' => $img_options,
'IMAGELIST_OPTIONS' => $imagesetlist_options,
'IMAGE_SIZE' => $imgsize_bool,
'IMAGE_REQUEST' => (!empty($imgname)) ? '../styles/' . $imageset_path . '/imageset/' . str_replace('{LANG}', $imglang, $img_info[0]) : '',
'IMAGE_REQUEST' => (!empty($img_info[0])) ? '../styles/' . $imageset_path . '/imageset/' . str_replace('{LANG}', $imglang, $img_info[0]) : '',
'U_ACTION' => $this->u_action . "&amp;action=edit&amp;id=$imageset_id",
'U_BACK' => $this->u_action,
'NAME' => $imageset_name,
@@ -1408,7 +1509,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
*/
function remove($mode, $style_id)
{
global $db, $template, $user, $phpbb_root_path, $cache;
global $db, $template, $user, $phpbb_root_path, $cache, $config;
$new_id = request_var('new_id', 0);
$update = (isset($_POST['update'])) ? true : false;
@@ -1447,7 +1548,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!$style_row)
{
trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = "SELECT {$mode}_id, {$mode}_name
@@ -1468,7 +1569,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
}
else
{
trigger_error($user->lang['ONLY_' . $l_prefix] . adm_back_link($this->u_action));
trigger_error($user->lang['ONLY_' . $l_prefix] . adm_back_link($this->u_action), E_USER_WARNING);
}
$db->sql_freeresult($result);
@@ -1489,6 +1590,11 @@ pagination_sep = \'{PAGINATION_SEP}\'
SET forum_style = $new_id
WHERE forum_style = $style_id";
$db->sql_query($sql);
if ($style_id == $config['default_style'])
{
set_config('default_style', $new_id);
}
}
else
{
@@ -1621,7 +1727,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!$style_row)
{
trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action), E_USER_WARNING);
}
$var_ary = array('style_id', 'style_name', 'style_copyright', 'template_id', 'template_name', 'template_path', 'template_copyright', 'template_storedb', 'bbcode_bitfield', 'theme_id', 'theme_name', 'theme_path', 'theme_copyright', 'theme_storedb', 'theme_mtime', 'theme_data', 'imageset_id', 'imageset_name', 'imageset_path', 'imageset_copyright');
@@ -1741,11 +1847,12 @@ pagination_sep = \'{PAGINATION_SEP}\'
{
$imageset_cfg = str_replace(array('{MODE}', '{NAME}', '{COPYRIGHT}', '{VERSION}'), array($mode, $style_row['imageset_name'], $style_row['imageset_copyright'], $config['version']), $this->imageset_cfg);
$imageset_definitions = explode(', ', $this->imageset_keys);
foreach ($imageset_definitions as $key)
foreach ($this->imageset_keys as $topic => $key_array)
{
$imageset_cfg .= "\n" . $key . ' = ' . str_replace("styles/{$style_row['imageset_path']}/imageset/", '{PATH}', $style_row[$key]);
foreach ($key_array as $key)
{
$imageset_cfg .= "\nimg_" . $key . ' = ' . str_replace("styles/{$style_row['imageset_path']}/imageset/", '{PATH}', $style_row[$key]);
}
}
$files[] = array(
@@ -1794,7 +1901,14 @@ pagination_sep = \'{PAGINATION_SEP}\'
{
include($phpbb_root_path . 'includes/functions_compress.' . $phpEx);
$path = $style_row[$mode . '_path'];
if ($mode == 'style')
{
$path = preg_replace('#[^\w-]+#', '_', $style_row['style_name']);
}
else
{
$path = $style_row[$mode . '_path'];
}
if ($format == 'zip')
{
@@ -1845,7 +1959,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!$style_row)
{
trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action), E_USER_WARNING);
}
$this->page_title = $l_prefix . '_EXPORT';
@@ -1915,7 +2029,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!$style_row)
{
trigger_error($user->lang['NO_' . $l_type] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_' . $l_type] . adm_back_link($this->u_action), E_USER_WARNING);
}
$style_row['style_default'] = ($mode == 'style' && $config['default_style'] == $style_id) ? 1 : 0;
@@ -1951,12 +2065,12 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!sizeof($error))
{
// Check length settings
if (strlen($name) > 30)
if (utf8_strlen($name) > 30)
{
$error[] = $user->lang[$l_type . '_ERR_NAME_LONG'];
}
if (strlen($copyright) > 60)
if (utf8_strlen($copyright) > 60)
{
$error[] = $user->lang[$l_type . '_ERR_COPY_LONG'];
}
@@ -2202,7 +2316,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
{
foreach ($matches[0] as $idx => $match)
{
$stylesheet = str_replace($match, $this->load_css_file($theme_row['theme_path'], $matches[1][$idx]), $stylesheet);
$stylesheet = str_replace($match, acp_styles::load_css_file($theme_row['theme_path'], $matches[1][$idx]), $stylesheet);
}
}
@@ -2225,7 +2339,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
{
if (!($fp = fopen("{$phpbb_root_path}styles/$template_path$pathfile$file", 'r')))
{
trigger_error("Could not open {$phpbb_root_path}styles/$template_path$pathfile$file");
trigger_error("Could not open {$phpbb_root_path}styles/$template_path$pathfile$file", E_USER_ERROR);
}
$template_data = fread($fp, filesize("{$phpbb_root_path}styles/$template_path$pathfile$file"));
fclose($fp);
@@ -2254,7 +2368,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
// heck of a lot of data ...
$sql_ary = array(
'template_id' => $style_id,
'template_filename' => "$template_pathfile$file",
'template_filename' => "$pathfile$file",
'template_included' => (isset($includes[$file])) ? implode(':', $includes[$file]) . ':' : '',
'template_mtime' => filemtime("{$phpbb_root_path}styles/$template_path$pathfile$file"),
'template_data' => file_get_contents("{$phpbb_root_path}styles/$template_path$pathfile$file"),
@@ -2290,7 +2404,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!($dp = @opendir("{$phpbb_root_path}cache")))
{
trigger_error($user->lang['TEMPLATE_ERR_CACHE_READ']);
trigger_error($user->lang['TEMPLATE_ERR_CACHE_READ'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$file_ary = array();
@@ -2432,7 +2546,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
}
else
{
trigger_error($user->lang['NO_' . $l_type] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_' . $l_type] . adm_back_link($this->u_action), E_USER_WARNING);
}
$style_row['store_db'] = request_var('store_db', 0);
@@ -2581,7 +2695,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
{
$style_row['style_id'] = 0;
$this->install_style($error, 'add', '', $style_row['style_id'], $style_row['style_name'], $style_row['style_copyright'], $style_row['style_active'], $style_row['style_default'], $style_row);
$this->install_style($error, 'add', '', $style_row['style_id'], $style_row['style_name'], '', $style_row['style_copyright'], $style_row['style_active'], $style_row['style_default'], $style_row);
}
if (!sizeof($error))
@@ -2716,12 +2830,12 @@ pagination_sep = \'{PAGINATION_SEP}\'
}
// Check length settings
if (strlen($name) > 30)
if (utf8_strlen($name) > 30)
{
$error[] = $user->lang['STYLE_ERR_NAME_LONG'];
}
if (strlen($copyright) > 60)
if (utf8_strlen($copyright) > 60)
{
$error[] = $user->lang['STYLE_ERR_COPY_LONG'];
}
@@ -2826,12 +2940,12 @@ pagination_sep = \'{PAGINATION_SEP}\'
}
// Check length settings
if (strlen($name) > 30)
if (utf8_strlen($name) > 30)
{
$error[] = $user->lang[$l_type . '_ERR_NAME_LONG'];
}
if (strlen($copyright) > 60)
if (utf8_strlen($copyright) > 60)
{
$error[] = $user->lang[$l_type . '_ERR_COPY_LONG'];
}
@@ -2867,40 +2981,54 @@ pagination_sep = \'{PAGINATION_SEP}\'
$mode . '_path' => $path,
);
if ($mode != 'imageset')
switch ($mode)
{
switch ($mode)
{
case 'template':
// We set a pre-defined bitfield here which we may use further in 3.2
$sql_ary += array(
'bbcode_bitfield' => TEMPLATE_BITFIELD,
'template_storedb' => $store_db
);
break;
case 'template':
// We set a pre-defined bitfield here which we may use further in 3.2
$sql_ary += array(
'bbcode_bitfield' => TEMPLATE_BITFIELD,
'template_storedb' => $store_db
);
break;
case 'theme':
$sql_ary += array(
'theme_storedb' => $store_db,
'theme_data' => ($store_db) ? (($root_path) ? $this->db_theme_data($sql_ary, false, $root_path) : '') : '',
'theme_mtime' => filemtime("{$phpbb_root_path}styles/$path/theme/stylesheet.css")
);
break;
}
}
else
{
$cfg_data = parse_cfg_file("$root_path$mode/imageset.cfg");
case 'theme':
// We are only interested in the theme configuration for now
$theme_cfg = parse_cfg_file("{$phpbb_root_path}styles/$path/theme/theme.cfg");
foreach ($cfg_data as $key => $value)
{
if (strpos($key, 'img_') === 0)
if (isset($theme_cfg['parse_css_file']) && $theme_cfg['parse_css_file'])
{
$key = substr($key, 4);
$sql_ary[$key] = str_replace('{PATH}', "styles/$path/imageset/", trim($value));
$store_db = 1;
}
}
unset($cfg_data);
$sql_ary += array(
'theme_storedb' => $store_db,
'theme_data' => ($store_db) ? $this->db_theme_data($sql_ary, false, $root_path) : '',
'theme_mtime' => filemtime("{$phpbb_root_path}styles/$path/theme/stylesheet.css")
);
break;
case 'imageset':
$cfg_data = parse_cfg_file("$root_path$mode/imageset.cfg");
$imageset_definitions = array();
foreach ($this->imageset_keys as $topic => $key_array)
{
$imageset_definitions = array_merge($imageset_definitions, $key_array);
}
foreach ($cfg_data as $key => $value)
{
if (strpos($key, 'img_') === 0)
{
$key = substr($key, 4);
if (in_array($key, $imageset_definitions))
{
$sql_ary[$key] = str_replace('{PATH}', "styles/$path/imageset/", trim($value));
}
}
}
unset($cfg_data);
break;
}
$db->sql_transaction('begin');

View File

@@ -0,0 +1,61 @@
<?php
/**
*
* @package acp
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @package acp
*/
class acp_update
{
var $u_action;
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
global $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('install');
$this->tpl_name = 'acp_update';
$this->page_title = 'ACP_UPDATE';
// Get current and latest version
$errstr = '';
$errno = 0;
$info = get_remote_file('www.phpbb.com', '/updatecheck', '30x.txt', $errstr, $errno);
if ($info === false)
{
trigger_error($errstr . adm_back_link($this->u_action));
}
$info = explode("\n", $info);
$latest_version = trim($info[0]);
$announcement_url = trim($info[1]);
$update_archive_link = 'http://www.phpbb.com/files/releases/phpBB-' . $config['version'] . '_to_' . $latest_version . '.zip';
$update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update');
$up_to_date = (version_compare(strtolower($config['version']), strtolower($latest_version), '<')) ? false : true;
$template->assign_vars(array(
'S_UP_TO_DATE' => $up_to_date,
'S_VERSION_CHECK' => true,
'U_ACTION' => $this->u_action,
'LATEST_VERSION' => $latest_version,
'CURRENT_VERSION' => $config['version'],
'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $announcement_url, $update_archive_link, $update_link),
));
}
}
?>

Some files were not shown because too many files have changed in this diff Show More