Page 1 of 1

PHP in templates

Posted: Thu Aug 17, 2017 8:24 am
by jorah
Hi, please help!

I want to mix video and pictures thumbs on main page and try to run code

<?php
for($i=1;$i<20;$i++) {
if($a%2==0)
echo '<thumb content_type=movie num='.$i.'></thumb>';
else
echo '<thumb content_type=image num='.$i.'></thumb>';
}
?>

But it doesn't works Warning: Division by zero in /home/site/scj/includes/libs/tpl_functions.php on line 0

Re: PHP in templates

Posted: Fri Aug 18, 2017 7:41 pm
by admin
First script replaces tags like <thumb and so on with actual data
and then executes you PHP code
So you can not use php code in tags' options