PHP in templates

Post Reply
jorah
Posts: 9
Joined: Fri Jun 30, 2017 6:54 am

PHP in templates

Post 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
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: PHP in templates

Post 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
Don't forget to run script update
Post Reply