aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/template.php
Commit message (Collapse)AuthorAgeFilesLines
* [ticket/10145] Always recompile all templates when DEBUG_EXTRA is defined.Andreas Fischer2011-04-261-1/+1
| | | | PHPBB3-10145
* [ticket/9924] Pass template instance into $template->display hookIgor Wiedler2010-11-231-1/+1
| | | | PHPBB3-9924
* Do not store email templates in database. [Bug #54505]Nils Adermann2010-01-261-5/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To explain what this is about, first a short phpBB code history lesson: ;-) r9823 originally introduced the usage of our template class for emails. The messenger class uses set_custom_template() to initialise the template object which neither disables storedb nor inheritance. These two values are set in $user->theme rather than inside a particular template instance (quite a design failure if I may add). Thus the html page that is displayed to the user also determines these settings for the email templates. This obviously causes problems because both emails and other custom templates can quite simply not be stored in the database because the db table only stores the filename, not the path and requires a template id. r9839 then generally disabled storedb and template inheritance for custom templates to fix Bug #40515. This works for custom templates, but not for emails where lots of template objects are created. In such a situation the last call to set(_custom)_template() would now determine the values of storedb and inheritance in _tpl_load. So any page sending emails would neither load its template from the database nor use template inheritance. The same revision also introduced orig_tpl_* variables in set_template() which on their own are very much pointless, but could allow resetting the storedb and inheritance values if they were used to reset $user->theme just before template execution in _tpl_load. In r10150 these orig_tpl_* variables are correctly used to access information about the template of the page being displayed - contrary to the last template used - from within the bbcode, fixing Bug #51285. However r10150 also introduces a pointless $template_mode parameter for set_custom_template(). $template_mode is really just a boolean flag (value you can be 'template' or an arbitrary other value) that if it set circumvents the unsetting of storedb and template inheritance. The very code that had been added to prevent issues with emails and custom templates. Fixing the problem introduced by r8839 but at the same time reintroducing the much greater problem from the original implementation of email templates. And now an explanation of what I did: Based on this I have now changed the set_custom_template method to always disable storedb. It can now properly use inheritance, you simply tell it the path where the parent template can be found, by default the path is false which will turn inheritance off. To make this work the template class now always overwrites $user->theme storedb and inheritance variabbles with orig_tpl_* just before rendering a template in _tpl_load. This way they are guaranteed to always contain the value they had at the time set_template/set_custom_template were called. This fixes [Bug #54505]. In summary, using global state is simply a horrible idea in object oriented programming. Always Pass values, that an object depends on, as parameters - never through magic global variables. Following this principle will safe you from a lot of headaches. Please test this patch as much as possible to make sure templates still work properly for you, focus on multiple languages, missing language files, and custom templates in systems that make use of the template class outside of phpBB itself. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10460 89ea8834-ac86-4346-8a33-228a782c2dd0
* fix bug #52605 - regression from r9811Meik Sievertsen2009-10-091-0/+1
| | | | git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10217 89ea8834-ac86-4346-8a33-228a782c2dd0
* bugfix for non-existent handles and theme data (we really need to clean this ↵Meik Sievertsen2009-10-051-1/+6
| | | | | | up, template_files feels quite furry) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10213 89ea8834-ac86-4346-8a33-228a782c2dd0
* Fix #51285 and more issues with template inherence on set_custom_templateJoas Schilling2009-09-161-3/+8
| | | | | | | | Conflict introduced with r9839 and r9823 Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10150 89ea8834-ac86-4346-8a33-228a782c2dd0
* Check for valid $template_path in includes/template.php - Bug #50055Meik Sievertsen2009-08-201-0/+6
| | | | git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10036 89ea8834-ac86-4346-8a33-228a782c2dd0
* Small change to r9839Chris Smith2009-07-251-4/+7
| | | | git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9847 89ea8834-ac86-4346-8a33-228a782c2dd0
* Fix Bug #40515 - Fix set_custom_template for database-stored stylesJoas Schilling2009-07-241-1/+15
| | | | | | | | Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9839 89ea8834-ac86-4346-8a33-228a782c2dd0
* Preserve newlines in template files (one newline had been always dropped ↵Meik Sievertsen2009-07-211-0/+2
| | | | | | after a template variable due to PHP's handling of closing tags) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9811 89ea8834-ac86-4346-8a33-228a782c2dd0
* Fix bug #45805 - INCLUDEPHP not depending on phpbb_root_pathJoas Schilling2009-06-191-14/+33
| | | | | | Authorised by: acydburn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9633 89ea8834-ac86-4346-8a33-228a782c2dd0
* Fix problems with styles using an underscore within the filename. (Bug #34315)Meik Sievertsen2008-09-261-2/+2
| | | | | | | | - Also display inheriting template on style installation (previously, it was only displayed on template installs) - Fixes undefined variable in error message if inheriting style does not work - Fixes export of styles/templates and correctly set inherit_from variable git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8943 89ea8834-ac86-4346-8a33-228a782c2dd0
* Okay. Frozen, we never said anything about it being permafrost. Also, this ↵Henry Sudhof2008-07-281-21/+108
| | | | | | is not 100% tested, expect troubel with store_db (I'm waiting for the bug reports) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8697 89ea8834-ac86-4346-8a33-228a782c2dd0
* - fixed database updaterMeik Sievertsen2007-10-041-5/+6
| | | | | | | | - fixed hook function call in database updater - fixed bot agent detection (we used a wildcard within the w3c-agent, therefore we should really support this. ;)) git-svn-id: file:///svn/phpbb/trunk@8131 89ea8834-ac86-4346-8a33-228a782c2dd0
* ok... i seem to have overlooked the handy __CLASS__ constant. ;)Meik Sievertsen2007-09-231-3/+3
| | | | git-svn-id: file:///svn/phpbb/trunk@8106 89ea8834-ac86-4346-8a33-228a782c2dd0
* PHP4 compatibilityMeik Sievertsen2007-09-231-4/+3
| | | | git-svn-id: file:///svn/phpbb/trunk@8104 89ea8834-ac86-4346-8a33-228a782c2dd0
* new hook system (do not get it confused with events or plugins please)Meik Sievertsen2007-09-221-1/+10
| | | | | | | - introducing two new hookable functions too git-svn-id: file:///svn/phpbb/trunk@8100 89ea8834-ac86-4346-8a33-228a782c2dd0
* ok, the nasty one then... :/Meik Sievertsen2007-08-171-0/+8
| | | | git-svn-id: file:///svn/phpbb/trunk@8044 89ea8834-ac86-4346-8a33-228a782c2dd0
* #12675David M2007-07-091-0/+2
| | | | git-svn-id: file:///svn/phpbb/trunk@7853 89ea8834-ac86-4346-8a33-228a782c2dd0
* tweak the sql_like_expression feature a little bit to allow correct escapingMeik Sievertsen2007-06-241-1/+1
| | | | git-svn-id: file:///svn/phpbb/trunk@7789 89ea8834-ac86-4346-8a33-228a782c2dd0
* new wrapper for LIKE expressions to streamline the fixes. We actually need ↵Meik Sievertsen2007-06-231-1/+1
| | | | | | to adjust them for different DBMS as well as SQLite2 not supporting escaping characters in LIKE statements (which is a reason why we think about dropping sqlite support completely). git-svn-id: file:///svn/phpbb/trunk@7788 89ea8834-ac86-4346-8a33-228a782c2dd0
* some fixesMeik Sievertsen2007-04-061-24/+36
| | | | git-svn-id: file:///svn/phpbb/trunk@7286 89ea8834-ac86-4346-8a33-228a782c2dd0
* fixing some bugs, most being submitted grammatical/spelling errors.Meik Sievertsen2007-01-211-1/+1
| | | | git-svn-id: file:///svn/phpbb/trunk@6915 89ea8834-ac86-4346-8a33-228a782c2dd0
* #6642David M2006-12-281-6/+0
| | | | git-svn-id: file:///svn/phpbb/trunk@6817 89ea8834-ac86-4346-8a33-228a782c2dd0
* - quite a few optimizations to the template engine. bitwise arithmatic is ↵David M2006-12-231-6/+9
| | | | | | | | | used to check odd/even, usage of ref to the root template variables should reduce the number of hash lookups needed, usage of refs within loops should reduce the amount of hash lookups, incrementing vars were turned from class variables to regular variables, cache now uses preincrementing variables instead of postincrementing variables, some regex were optimized/trimmed - a bug fix somewhere in there... git-svn-id: file:///svn/phpbb/trunk@6796 89ea8834-ac86-4346-8a33-228a782c2dd0
* adjust some comments to work with phpdocumentor. :)Meik Sievertsen2006-11-171-18/+7
| | | | git-svn-id: file:///svn/phpbb/trunk@6595 89ea8834-ac86-4346-8a33-228a782c2dd0
* - now username changes should work as desiredMeik Sievertsen2006-10-221-1/+5
| | | | | | | - removed some extract() calls git-svn-id: file:///svn/phpbb/trunk@6517 89ea8834-ac86-4346-8a33-228a782c2dd0
* fix bug #4454Meik Sievertsen2006-09-241-1/+1
| | | | git-svn-id: file:///svn/phpbb/trunk@6405 89ea8834-ac86-4346-8a33-228a782c2dd0
* - Fix some bugsMeik Sievertsen2006-09-141-1/+1
| | | | | | | - 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
* some updates. Also adjusted the utf tools and normalizer more to our coding ↵Meik Sievertsen2006-08-221-13/+13
| | | | | | guidelines. git-svn-id: file:///svn/phpbb/trunk@6312 89ea8834-ac86-4346-8a33-228a782c2dd0
* - fixing some bugsMeik Sievertsen2006-08-011-1/+1
| | | | | | | | | - 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
* show error if template path could not be determinedMeik Sievertsen2006-06-211-0/+4
| | | | git-svn-id: file:///svn/phpbb/trunk@6112 89ea8834-ac86-4346-8a33-228a782c2dd0
* make sure custom profile fields are created correctly on registration (#2225)Meik Sievertsen2006-06-131-14/+14
| | | | git-svn-id: file:///svn/phpbb/trunk@6058 89ea8834-ac86-4346-8a33-228a782c2dd0
* - fixed a few bugsMeik Sievertsen2006-06-111-42/+33
| | | | | | | | | | | - added user_add() function - check posted images ([img]) for same domain/scipt and php files - auth_api.html updated to the coding guidelines look&feel - introduced ability to force non page-updates (cron is using it) - correctly resend coppa email git-svn-id: file:///svn/phpbb/trunk@6048 89ea8834-ac86-4346-8a33-228a782c2dd0
* ok, sorry for this. :/Meik Sievertsen2006-06-071-1/+1
| | | | | | | - cleaned up table names/constants git-svn-id: file:///svn/phpbb/trunk@6021 89ea8834-ac86-4346-8a33-228a782c2dd0
* some tiny changes...Meik Sievertsen2006-05-261-0/+2
| | | | git-svn-id: file:///svn/phpbb/trunk@5967 89ea8834-ac86-4346-8a33-228a782c2dd0
* first round of custom profile changesMeik Sievertsen2006-05-251-30/+30
| | | | git-svn-id: file:///svn/phpbb/trunk@5965 89ea8834-ac86-4346-8a33-228a782c2dd0
* - introduce new function build_url to easily build a valid url from the ↵Meik Sievertsen2006-05-121-1/+1
| | | | | | | | | | | | | | user->page object as well as optionally removing certain keys - changed attachment config to utilize the config build methods - cleaned up posting.php - the submit/delete_post functions are now usable (functions_posting.php) - adjusted header icons (transparency) - a bunch of fixes for mssql - bug fixes git-svn-id: file:///svn/phpbb/trunk@5902 89ea8834-ac86-4346-8a33-228a782c2dd0
* - added the template editor (doesn't use a hardcoded list of template ↵Nils Adermann2006-05-071-2/+2
| | | | | | | | | | filenames for categorisation anymore) - fix some bugs related to storing template files in the database - allow templates stored in subfolders of the /styles/name/template/ folder git-svn-id: file:///svn/phpbb/trunk@5894 89ea8834-ac86-4346-8a33-228a782c2dd0
* introduce LA_ for addslashing language variables for use in js vars (idea by ↵Meik Sievertsen2006-04-291-16/+11
| | | | | | naderman) git-svn-id: file:///svn/phpbb/trunk@5865 89ea8834-ac86-4346-8a33-228a782c2dd0
* - clean up marklist calls (global function)Meik Sievertsen2006-04-171-21/+32
| | | | | | | | | | - added new feature: test out others permissions (admin permissions will not be copied) - changed attachment processing by directly using the template engine - fixed some attachment related bugs - additional tiny fixes git-svn-id: file:///svn/phpbb/trunk@5790 89ea8834-ac86-4346-8a33-228a782c2dd0
* fixing a bug within the installer (displaying notices) and making sure the ↵Meik Sievertsen2006-04-141-2/+2
| | | | | | installer is using the error handler. git-svn-id: file:///svn/phpbb/trunk@5783 89ea8834-ac86-4346-8a33-228a782c2dd0
* save graham temporarly some headaches. ;)Meik Sievertsen2006-03-251-0/+7
| | | | git-svn-id: file:///svn/phpbb/trunk@5722 89ea8834-ac86-4346-8a33-228a782c2dd0
* - add our beloved in_phpbb checkMeik Sievertsen2006-03-191-0/+7
| | | | git-svn-id: file:///svn/phpbb/trunk@5670 89ea8834-ac86-4346-8a33-228a782c2dd0
* - streamlined reports to consist of the feature set we decided upon (Nils, ↵Meik Sievertsen2006-03-121-5/+5
| | | | | | | | | | | | | | your turn now) - use getenv instead of $_ENV (with $_ENV the case could be wrong) - permission fixes (there was a bug arising with getting permission flags - re-added them and handled roles deletion differently) - implemented max login attempts - changed the expected return parameters for logins/sessions - added acp page for editing report/denial reasons - other fixes here and there git-svn-id: file:///svn/phpbb/trunk@5622 89ea8834-ac86-4346-8a33-228a782c2dd0
* - implementing David's proposed expression changes (some of them already ↵Meik Sievertsen2006-02-211-8/+10
| | | | | | noted within the events CCP) git-svn-id: file:///svn/phpbb/trunk@5566 89ea8834-ac86-4346-8a33-228a782c2dd0
* - Removed a variable that has been left unused for three and a half years...David M2005-12-271-1/+0
| | | | git-svn-id: file:///svn/phpbb/trunk@5382 89ea8834-ac86-4346-8a33-228a782c2dd0
* - fixing alter_block_array function as suggested by david.Meik Sievertsen2005-12-271-4/+16
| | | | git-svn-id: file:///svn/phpbb/trunk@5379 89ea8834-ac86-4346-8a33-228a782c2dd0
* - ok, get away with the secondary style approach (styles can be mixed ↵Meik Sievertsen2005-12-221-21/+6
| | | | | | | | | | together easily with the acp) - introduce a more generic approach of defining some additional variables through cfg files as well as the name, copyright and version fields - please note that at the moment this is in flux. I added it now for Tom because he needs the theme parameters. git-svn-id: file:///svn/phpbb/trunk@5372 89ea8834-ac86-4346-8a33-228a782c2dd0
* Some fixes to the template codeGraham Eames2005-12-131-5/+5
| | | | | | | | - this handles the case where file caching is used and no cached version exists git-svn-id: file:///svn/phpbb/trunk@5331 89ea8834-ac86-4346-8a33-228a782c2dd0