Skinning and designing Serendipity (CSS, HTML, Smarty)
reinhardl
Regular
Posts: 258 Joined: Wed Jun 20, 2007 8:54 am
Location: Germany
Post
by reinhardl » Tue Feb 08, 2011 3:12 pm
Hallo,
if I use
Code: Select all
{assign var=bildname value=".serendipityThumb.JPG"|explode:$entry.properties.ep_MimboImage}
I will get this Message:
Smarty error: [in entries_single.tpl line 13]: [plugin] (secure mode) modifier 'explode' is not allowed (Smarty_Compiler.class.php, line 1934
is the an alternative funktion?
thanks
garvinhicking
Core Developer
Posts: 30022 Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:
Post
by garvinhicking » Tue Feb 08, 2011 3:51 pm
Hi!
You can disable the security mode in your template's config.inc.php.
However, the cleaner syntax would be to create your custom smarty modifier:
Code: Select all
<?php
function serendipity_smarty_bildname(&$var, $input) {
$parts = explode(',', $input);
foreach($parts AS $part) {
$var .= $part . '.serendipityThumb.jpg';
}
}
$serendipity['smarty']->register_modifier('serendipity_smarty_bildname', 'serendipity_smarty_bildname');
and in TPL:
Code: Select all
{$bildname|@serendipity_smarty_bildname:$entry.properties.ep_MimboImage}
(I don't know what you want to do do exactly, though, so you might need to use your own PHP function there
Regards,
Garvin