Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
THEMES: What do you do with your page_end.php file?
I'm writing a little cache extension for Vanilla.
In the default "vanilla" theme, page_end.php does nothing more than adding "</body></html>" to the html code. So I decided to not cache this basic part, and when I have a cache hit, I just add "manually" this page end "</body></html>".
Now if people here tell me that they put interesting things in this file, I'll change my mind.
So you "themes guys", do you have heavy modifications to your page_end.php files?
0
This discussion has been closed.
Comments
I have an empty page_end.php, because vanilla output is wrapped in my own, object based, template system (close to the HoP library I recently released).
So if you force add global closing tags it would brake my markup (if ever you caching extension is compatible with it).
IMO, you should not make any assertion of the theme file content because this is just the reason they are there: to put customization. I agree that you can avoid caching it but you still need to output its content, as it is.
Or am I missing the point?
I must include a string whatever the theme is (before the closing of the document), and in two very different situations.
My first solution was to echo it before PageEnd, and then let PageEnd close the document.
But I think that at the end, I'll let PageEnd do its job (allowing me to cache its output), then torture the buffer for my string insertion before the document closing.
What I need is to know what kind of document closing I will meet. , \n...
And how to insert my string before it with no resource waste.
I just discovered substr_replace, is it quicker than str_replace?substr_replace is not what I want.Parsing the buffer for closing tag is not, IMO, the way to go. You'll have to account for HTML4 theme XHTML theme or whatever.
Something like
$output = str_replace( '</body>', $OptionalContent.'</body>', $buffer );
should do the trick most of the time.