![]() |
I am using this with 3 styles.
Do you get any php errors when switching styles? Check your logs :) White page usually means errors. |
Removed this post on author's request.
|
orban, can you briefly explain how/why this new experimental one is better than the released product?
|
Well, the old one used the following "hack" for the template evals:
eval('$navbar = include("templates/1234.php");'); And that only for larger templates. Smaller ones (default setting 4500 bytes I think) were still executed the old way (even if stored in a file). This one, however, takes a different approach. eval('$navbar = template_1234($spacer_open, $stylevar, $GLOBALS, $welcomeheaders)'); All templates are parsed and stored in functions, and all "template function" for one page are stored in a file. So basically all eval()s only execute a function call. This means all eval calls are nearly completely avoided, and there is just one file for every page. The files aren't too big on disk (40-100kb) but up to 2.5mb in xcache which isn't an issue though so far (I think this is because vB compiles all templates as one very long string with <if> calls being ternary conditionals). |
Yeah, I noticed coding one of my plugins that using a bunch of eval()s really slows things down. I ended up rewriting the code 3 times before I came up with a way that didn't use a more than one eval() on runtime.
Thanks for the update! |
What could be causing fatal undefined function errors when using the experimental code?
|
That the file doesn't get included, have you created a writable cache/ folder?
|
That's really great thinking, orban. What is stopping you from making this the default method?
|
Well, you can't easily "exclude" templates like in the default method so all addons that dynamically modify templates on run time will break and it's mostly untested. :)
But yeah I might release it as a second option. |
Quote:
I reverted to the default method to "fix" the issue. |
All times are GMT. The time now is 06:00 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|