Wednesday, January 5, 2011

How to insert PHP code in file main.tpl

main.tpl file is a template file of DLE. There are cases when you need to insert PHP codes in It, but It is not allowed. So now I will show you a hack how to enable the insertion of PHP codes in main.tpl

1. Open file index.php
echo $tpl->result['main'];

Replace to:
eval (' ?' . '>' . $tpl->result['main'] . '<' . '?php ');

That's all you need to do.