вопрос
hello gays need help in shortstory i need to show last coments date can someone help me ?
Create file /engine/mods/last_comm_date.php with code:
Include it in shortstory.tpl
Not tested, but i hope this should work.
<?php
if (!defined('DATALIFEENGINE')) {
die("Hacking attempt!");
}
$post_id = intval($post_id);
$comm = $db->super_query("SELECT date
FROM ".PREFIX."_comments
WHERE post_id = $post_id AND approve
ORDER BY date DESC
LIMIT 1
");
if ($comm['date']) {
$comm['date'] = strtotime($comm['date']);
$date = date("Y-m-d H:i", $comm['date']);
echo <<<HTML
Last comment date: {$date}
HTML;
}
Include it in shortstory.tpl
{include file="engine/mods/last_comm_date.php?post_id={news-id}"}
Not tested, but i hope this should work.