19-Mar-2014, 01:19 PM
I've upgraded to V2.5 (fresh install, not update) and the former code I used to show the comment count doesn't seem to work (and actually crashes the whole script). I get "access denied" message instead of a count and the comments form doesn't even show up (as the first code of comment count is used before the form).
<?php
$id = "34"; //The ID of the page. You can get this from Manage -> Pages.
define('IN_COMMENTICS', '1');
require_once ($_SERVER['DOCUMENT_ROOT'].'comments/includes/db/connect.php');
$query = mysql_query("SELECT * FROM `".$cmtx_mysql_table_prefix."commentics` WHERE is_approved = '1' AND page_id = '$id'");
$total = mysql_num_rows($query);
echo $total;
?>
Tried to delete the define line, but no difference.
<?php
$id = "34"; //The ID of the page. You can get this from Manage -> Pages.
define('IN_COMMENTICS', '1');
require_once ($_SERVER['DOCUMENT_ROOT'].'comments/includes/db/connect.php');
$query = mysql_query("SELECT * FROM `".$cmtx_mysql_table_prefix."commentics` WHERE is_approved = '1' AND page_id = '$id'");
$total = mysql_num_rows($query);
echo $total;
?>
Tried to delete the define line, but no difference.