I'm trying to include a comment system in my template.
This is the system: http://plohni.com/wb/content/php/Script___advanced_comment_system.php
But, I'm having problems "including" the index.php file in my template (layouts/main_template.html).
I've tried using
{include_php file="comments/index.php"}
I get nothing output from comments/index.php at all, no errors are shown, even though I have display_errors set to true. No errors in my PHP error log, either.
I cannot convert comments/index.php file to a template easily. You'd have to look at the code to see why. I've tried using this code in my /index.php (not comments/index.php), too, but it shows the PHP code instead of the rendered HTML:
$data = $smarty->fetch("content/index.html");
$smarty->assign("content", $data);
$comments = file_get_contents('comments/index.php');
$smarty->assign("comments", $comments);
$smarty->display("layouts/main_template.html");
One other thing that I've tried with no success is this, from /index.php:
$data = $smarty->fetch("content/index.html");
$smarty->assign("content", $data);
$smarty->display("layouts/main_template.html");
include("comments/index.php");
// included code from main_template.html below the place I want to have the comments here
echo ' </body> ';
echo '</html>';
I understand that {include_php} is pretty much deprecated from Smarty, so what am I supposed to do, here?
Any other suggestions?