Posts: 1
Threads: 1
Joined: Jun 2012
How do I set the script so that the comments will display on a separate page from the form? I tired this on page two but it did not work.
<?php
define ('IN_COMMENTICS', 'true');
require "includes/db/connect.php";
require "includes/functions/page.php";
require "includes/functions/comments.php";
$page_id = "2";
$page_id = cmtx_sanitize($page_id, true, true, true);
echo cmtx_number_of_comments(10);
echo "<br/>";
echo cmtx_average_rating();
?>
Posts: 2,895
Threads: 59
Joined: Jun 2010
Hi,
It's not really designed to be broken apart like that.
The best way might be to include the script like normal, but set a flag like:
PHP Code:
<?php
define ('SHOW_COMMENTS_ONLY', 'true');
$page_id = "1";
$reference = "Page One";
$path_to_comments_folder = "comments/";
define ('IN_COMMENTICS', 'true'); //no need to edit this line
require $path_to_comments_folder . "includes/commentics.php"; //no need to edit this line
?>
Then in /comments/includes/commentics.php:
Replace this:
PHP Code:
<?php
if ($settings->sort_order_parts == "1,2") {
require_once $path_to_comments_folder . "includes/template/comments.php"; //display comments
echo "<div class='height_for_divider'></div>"; //display divider
require_once $path_to_comments_folder . "includes/template/form.php"; //display form
} else {
require_once $path_to_comments_folder . "includes/template/form.php"; //display form
echo "<div class='height_for_divider'></div>"; //display divider
require_once $path_to_comments_folder . "includes/template/comments.php"; //display comments
}
With this:
PHP Code:
<?php
if ($settings->sort_order_parts == "1,2") {
require_once $path_to_comments_folder . "includes/template/comments.php"; //display comments
if (!defined("SHOW_COMMENTS_ONLY")) {
echo "<div class='height_for_divider'></div>"; //display divider
require_once $path_to_comments_folder . "includes/template/form.php"; //display form
}
} else {
if (!defined("SHOW_COMMENTS_ONLY")) {
require_once $path_to_comments_folder . "includes/template/form.php"; //display form
echo "<div class='height_for_divider'></div>"; //display divider
}
require_once $path_to_comments_folder . "includes/template/comments.php"; //display comments
}
I haven't tested it so I can't say for sure whether it will work. I know there will at least be a problem with the reply link.