This is a relatively small plugin, but seems that a number of people wanted such a thing, so... here it is.
This plugin will allow you to use:
- PHP in templates, using <?php ... ?> tags
- Shortcut template conditionals, using <if ... then>...<elseif ... then>...<else>...</if>
- Some shortcut string functions (see below), eg <func htmlspecialchars>...</func>
- Call another template, using <template ...>, eg <template header>
For those that do not wish to allow arbitrary
PHP code execution that this plugin offers, take a look at the
Template Conditionals plugin.
Here's an example of some of the functions that this can be used for - for example, you may use this code in your postbit:
Some notes:
The functions available, with the shortcut, are:
htmlspecialchars, htmlspecialchars_uni, intval, file_get_contents, floatval, urlencode, rawurlencode, addslashes, stripslashes, trim, crc32, ltrim, rtrim, chop, md5, nl2br, strrev, strtoupper, strtolower, my_strtoupper, my_strtolower, alt_trow, get_friendly_size, filesize, strlen, my_strlen, my_wordwrap, random_str, unicode_chr, bin2hex, str_rot13, str_shuffle, strip_tags, ucfirst, ucwords, basename, dirname, unhtmlentities