Post Reply 
Comments on separate page from form
14-Jun-2012, 04:20 PM
Post: #1
Comments on separate page from form
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();
?>
Find all posts by this user
Quote this message in a reply
15-Jun-2012, 11:19 AM
Post: #2
RE: Comments on separate page from form
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:
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:
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.

Have you completed the interview?
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  misaligned on page ianheslop 4 43 15-May-2013 11:46 AM
Last Post: ianheslop
  No comments form appears despite many avenues explored... sherry 14 162 26-Apr-2013 03:05 AM
Last Post: sherry
  Submitting comment without page reload johndoe694 6 182 24-Apr-2013 10:09 PM
Last Post: johndoe694
  Comments number on another page. Edgey 4 448 17-Apr-2013 10:31 PM
Last Post: aww
  Binding Commentics to specific page on site johndoe694 2 134 12-Apr-2013 02:11 PM
Last Post: johndoe694
  How to insert comments into other place? igor74 4 139 08-Apr-2013 01:48 PM
Last Post: igor74
  SSO, dynamically loading comments and customising dcode 4 194 09-Mar-2013 03:22 AM
Last Post: dcode
  how i can page add page Jalilnet 1 182 27-Feb-2013 02:33 PM
Last Post: Steven
  Comments Appear on All Pages?! JMG 1 182 26-Feb-2013 06:24 AM
Last Post: JMG
  One url for comments sabrina 1 183 23-Feb-2013 01:25 PM
Last Post: Steven

Forum Jump:


User(s) browsing this thread: 1 Guest(s)