10-Aug-2010, 01:08 AM
Commentics, as you all know, is a great comment script with many features. With the release of version 1.1, extra functionality has been added. On of the key features of 1.1, in my opinion, is the ability to integrate Commentics in dynamic links, such as "www.example.com/comment_page.php?variable=value". This tutorial explains how to integrate Commentics efficiently with such links.
There are several things to determine before you start, though. Some links are meant to determine which layout the site will have: ("comment_page.php?layout=article1"), others are just to determine some value: ("comment_page.php?time=800"). Sometimes, you want to put those together: ("comment_page.php?layout=article1&time=800"). Nevertheless, exactly one variable determines the layout. In some cases, you want two or more variables for the layout: ("comment_page?layout=articlepart1&sublayout=articlepart2") and ("comment_page?layout=articlepart2&sublayout=articlepart5"). First, I'll explain the first case.
Lets start by going to the dynamic page that you want to add a comment section to: ("www.example.com/comment_page.php?layout=article1").
Open up the Commentics back-end, and go to "manage->pages".
Copy the url, and paste it into the "new page URL" box.
Add a reference, and add the page. For now, let's leave it at that.
Open the source of the page that needs the comments section, and go to the include lines:
Now, instead of the page ID that's supposed to be there, you can add a string. In our case, lets change "$page_id = "1";" to:There are several things to determine before you start, though. Some links are meant to determine which layout the site will have: ("comment_page.php?layout=article1"), others are just to determine some value: ("comment_page.php?time=800"). Sometimes, you want to put those together: ("comment_page.php?layout=article1&time=800"). Nevertheless, exactly one variable determines the layout. In some cases, you want two or more variables for the layout: ("comment_page?layout=articlepart1&sublayout=articlepart2") and ("comment_page?layout=articlepart2&sublayout=articlepart5"). First, I'll explain the first case.
Lets start by going to the dynamic page that you want to add a comment section to: ("www.example.com/comment_page.php?layout=article1").
Open up the Commentics back-end, and go to "manage->pages".
Copy the url, and paste it into the "new page URL" box.
Add a reference, and add the page. For now, let's leave it at that.
Open the source of the page that needs the comments section, and go to the include lines:
PHP Code:
<?php
$page_id = "1";
$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
?>
PHP Code:
<?php
$page_id = $_GET['layout'];