At this moment, I still need to do some adjustments related to phpBB that I can't really find how to or I'm unsure if my idea on how to do it is a good one. They are as follows:
- I need to cache some of the javascript code that is produced while parsing. It must also output proper cache headers for the browser to cache.
- On each request, I need to output a set of variables that the code in 1. uses.
- Order of the output is important.
- Best way to generate javascript according to phpBB's philosophy.
As part of my idea, when there's a new version, the URL to the file changes by changing a GET variable that is not read.
Does it make sense to use the template system for this? If so, how so?
For 2., I need to output a set of language variables (for example, the most common one being L_COLON), settings variables (e.g. S_VIEWFLASH and S_VIEWIMG) and other control variables. Is this just extra code in posting.php and template variables? Does it use any kind of features or functions (the question is related to this change made: https://tracker.phpbb.com/browse/PHPBB3-10388)?
It is important to note that the number and name of the variables can change dynamically depending on the registered BBCode.
For 3., I need that the output follow a specific order: The general-purpose javascript has to be there first (contains reusable and static functions), then the output with the variables, then the output with the control and setup data. All of those must be accessible when DOMContentLoaded event is fired and the control and setup data must be added/executted after the editor's javascript and before the editor is started.
For 4., I'm currently generating the javascript by using ob_start() + js output w/ php embedded + ob_get_clean(). I'm not sure if this is the best method of doing it with phpBB but I don't know any other viable method (besides the obvious string concatenation). Is there any other method that is potentially better than this one or a method that is the right way for programs like phpBB? So far, the main advantage of the method I'm using is that the editor has all helpers to write the javascript while in the alternative I know, there's none.
For now, that's all.