PDA

View Full Version : Smarty register custom function


add
05-15-2007, 10:54 AM
Hello,

in last version (2.1.03) I cannot add my own smarty functions in template files.
Also, i noticed that there are no usual register function in /includes/classes/DirSmarty.php

In older version i used $gDirSmarty->register_function("my_own_func", "my_own_func");

now i recieve this error:

Fatal USER ERROR Smarty error: [in link-display.tpl line 19]: syntax error: unrecognized tag 'my_own_func' (Smarty_Compiler.class.php, line 590) in *censored*\includes\classes\smarty\Smarty.class.ph p:1095

Sergey Ten
05-15-2007, 11:04 AM
Hello add,

[ Open your includes/view.inc.php ]
[ Find code ]


$gDirSmarty->register_function("print_pagerank", "print_pagerank");


[ After add code ]


$gDirSmarty->register_function("my_own_func", "my_own_func");


[ Save change ]

add
05-15-2007, 05:26 PM
Sergey, excellent!

You, guys, and eSyndicat are the best support and script ever seen!

Thanks!

Sergey Ten
05-16-2007, 04:49 AM
You are welcome Alex ;)