Herbalite wrote: I've created a template engine that has some added functionality
- Added include command <!-- INCLUDE mytemplate.tpl --> (path requirements same as for set_filenames)
- Passing a template by var (allows to modifiy a template on the fly or loaded from a DB)
- Allows for PHP constructs (<?php .. ?> and <?= .. ?>) in templates. <? ... ?> constructs won't work at this time, but that isn't XML compliant anyway.
- Easy extensable for new commands as the main parser is token driven.
- Debugging (Can be configured to display missing Template substitues, or insert them as HTML comments)
- Faster than the original template, especially when no block commands are in use
The parsing engine is a complete rewrite and needs at least PHP 4.0.5 to work.
I had an issue with the fileAttachment Mod, that I fixed and documented. I would be happy if some people around here can try out the template and tell me their expiriences and report if there are more incompatabilities.
The file can be downloaded from http://www.pwsol.com/Ablage/template_replacement.zip
Can't see how I get around that call to eval. I've elminiated all other evals that lurked in the original code.dank wrote: It sounds great, but I tried it out on one of my forums and still get the ol' eval() error from line 550:
I haven't really investigated what might be causing that, but I suspect eval() is going to be problematic no matter what.
PK Barbie Doll wrote: Works fine.. No need to shove everything on a single line like with the previous PHP in Templates mod. Also note that <? ?> is ok, as is <?php ?>
Actually one extension should make it easier to include subtemplate.dank wrote: No, it's a replacement for the standard template parser that is designed to make the templates more flexible by allowing PHP code to be used in them. Think of styles and themes as HTML and template parsing as programming, if that helps.
I remember that one, I have a suggestion you might want to try out.dank wrote: I believe the specific item causing the eval() error is the call to phpAdsNew in the included header. The rest of the PHP is being parsed correctly, but the header file dies with that one line.
Put that entire statement between the starting and ending PHP tag into brackets...
I meant the PHP in the template.dank wrote:Put that entire statement between the starting and ending PHP tag into brackets...
Which entire statement? The only place I can think that you might mean is the site-wide header file with the phpAdsNew call, but doing what you are saying for the purpose of phpBB alone would make a mess of the rest of the site...
view ("", 0);
it seems that the latest phpAdsNew version RC2 has provided support for template driven websites.