I've already sent an email off to the creator of the script but thought one of you guys may be able to help in the meantime.
Basically, I'm trying to integrate comments on my website. For clarification the website is www.musicfromfilm.com and I'm attempting to have a comment section on each film page. So for example on http://musicfromfilm.com/movies/17again.php I'm going to have a section at the bottom for people to ask questions, leave comments, etc.
So I've looked around at scripts and stuff and settled on http://www.cubescripts.com/comment-script.php so I've bought that and begun setting it all up.
The first step was to install everything. I uploaded all the files to my root folder as the instructions said, changed permissions of certain files, created a MySQL database in cPanel and entered the name, user information, etc, into the boxes and everything seemed to install ok. The problem occurs when I'm trying to integrate it into the site.
These are the instructions:
Now I'm struggling to understand what a lot of this means. What does your .php file mean in the opening paragraph?
Does that mean the page that the comments section is to be placed?
My website's pages are .php because I have a couple of php includes on for the top contributor table and footer but surely I don't add the code in there? Above the doctype?
I realise this is quite involved but I would really appreciate any help you guys can give.
Basically, I'm trying to integrate comments on my website. For clarification the website is www.musicfromfilm.com and I'm attempting to have a comment section on each film page. So for example on http://musicfromfilm.com/movies/17again.php I'm going to have a section at the bottom for people to ask questions, leave comments, etc.
So I've looked around at scripts and stuff and settled on http://www.cubescripts.com/comment-script.php so I've bought that and begun setting it all up.
The first step was to install everything. I uploaded all the files to my root folder as the instructions said, changed permissions of certain files, created a MySQL database in cPanel and entered the name, user information, etc, into the boxes and everything seemed to install ok. The problem occurs when I'm trying to integrate it into the site.
These are the instructions:
Code:
Integration of Pro Add Comments to your web page should be easy. First, you need to include our script to your .php file. Place following code at the very top of your .php file:
-------[ code ]---------------------------------------
<?php
define('CS_COMMENTS_PATH', './comments/');
require_once CS_COMMENTS_PATH . 'engine.php';
?>
-------[ code ]---------------------------------------
Constant CS_COMMENTS_PATH should point to your comments/ folder (default: ./comments/). This will also define $comments variable in PHP, which will contain Pro Add Comments PHP object, so make sure you don't use $comments variable in your (3rd party) PHP code.
Afterwards, you need to embed CSS and JS files. Place following code just above your </head> tag:
-------[ code ]---------------------------------------
<?php
echo $comments->HTMLHeader();
?>
-------[ code ]---------------------------------------
And that's it. The script is included successfully. Now, you should call ListComments() function where you want comments to appear. This function accepts two parameters:
1) $id (string) (optional) - Id of the article being commented. Leave it as null to use path of current PHP page as ID. Prepend it with backslash (/) to make it link. Default: null
2) $order (string) (optional) - ASC or DESC. Use ASC to sort comments in ascending order, or DESC to sort them in descending order. Default: ASC
Example:
-------[ code ]---------------------------------------
<?php
$id = (isset($_GET['id'])) ? $_GET['id'] : null;
ListComments($id);
?>
-------[ code ]---------------------------------------
This will also define $comment variable in PHP, which will contain each comment/comment info, so make sure you don't use $comment variable in your (3rd party) PHP code.
The other function you need to call is CommentForm(). It accepts also two parameters:
1) $id (string) (optional) - Id of the article being commented. Leave it as null to use path of current PHP page as ID. Prepend it with backslash (/) to make it link. Default: null
2) $showinfo (boolean) (optional) - True or false, whether you want to inform user about allowed (X)HTML tags or not, respectively. Default: true
Example:
-------[ code ]---------------------------------------
<?php
CommentForm($id);
?>
-------[ code ]---------------------------------------
Now I'm struggling to understand what a lot of this means. What does your .php file mean in the opening paragraph?
Does that mean the page that the comments section is to be placed?
My website's pages are .php because I have a couple of php includes on for the top contributor table and footer but surely I don't add the code in there? Above the doctype?
I realise this is quite involved but I would really appreciate any help you guys can give.