Write a comment on this article

Advanced comment system

Links

< back to free scripts main page

Quickmenu: About "Advanced comment system", features, installation, browser compatibility

About "Advanced comment system"
This script provides an advanced comment system you can include in any of your PHP pages easily. The scripts needs to be installed only once and can be used on many different pages. It is very similar to the comment system which is in use on this website (see example on the bottom of this page).
The package comes with the JavaScript library MooTools (version 1.2.0) which is used for the slider and the hide-comments feature.

Features
The advanced comment system contains many features which can be enabled and disabled in one central configuration file. There is no need to edit the script except you want some additional functionality (at your own risk!).

Installation
All you need for the installation is a simple text editor to edit the files and an FTP client to transfer the files to your server. Follow the instructions below to install the advanced comment system on your website:

  1. Download and unpack script
    Download the script using the following link and unpack it on your computer:

    Download.php?file=../php/download/Advanced_comment_system_1-0.zip

  2. Edit configuration
    Open the file advanced_comment_system/config.php and adjust the variables to your needs and save the file. The following variables are essential that the script will work:

    • $ACS_CONFIG["db_server"]
      The hostname of your MySQL database server. Mostly "localhost".
    • $ACS_CONFIG["db_name"]
      The name of your MySQL database.
    • $ACS_CONFIG["db_user"]
      The username of your MySQL database. Mostly "root".
    • $ACS_CONFIG["db_password"]
      The password of your MySQL database. Mostly blank.
    • $ACS_CONFIG["db_table"]
      The name of the table which will store the comments. This table will be created automatically when you run the installation script later.
    • $ACS_CONFIG["url"]
      The complete URL to the script folder on your website. Must begin with http:// and end with a slash. Example: http://yourdomain.com/advanced_comment_system/
    • $ACS_CONFIG["admin_password"]
      The password to access the administration page. You should change this password for security reasons.
  3. Script path
    Next you need to declare the variable $ACS_path at the very beginning of your PHP file. The variable must contain the relative path to the folder which contains the advanced comment system. Open your file and paste the following line of code to the very beginning:

    <?php $ACS_path = "advanced_comment_system/"; ?>
     

    Now you need to adjust the path "advanced_comment_system/". It must point to the folder which contains the advanced comment system based on your PHP file and it must end with a slash. If the advanced comment system is in the same folder as your PHP file, you don't need to make any changes. Here are some examples:

    Operating system Path to your PHP file Path to the comment folder $ACS_path
    Windows C:\apache\htdocs\php\files\my.php C:\apache\htdocs\comments\ ../../comments/
    Windows C:\html\my_site\my_file.php C:\html\my_site\comments\ comments/
    Unix /var/www/html/php/files/my.php /var/www/html/comments/ ../../comments/
    Unix /html/my_site/my_file.php /html/my_site/comments\ comments/

    Keep your PHP file open, you will need it for the next two steps as well.

  4. CSS & JavaScript
    The advanced comment system requires one CSS and two JavaScript files which come with the package. Because the comment system is not a standalone script, you need to include those files in your PHP file. Copy the three HTML elements (1x <link>, 2x <script>) to the head (between <head> and </head>) of your PHP file. You don't need to make any changes to the code.

    <link type="text/css" rel="stylesheet" href="<?php echo $ACS_path; ?>css/style.css" />
    <script src="<?php echo $ACS_path; ?>js/common.js" type="text/javascript"></script>
    <script src="<?php echo $ACS_path; ?>js/mootools.js" type="text/javascript"></script>
     
  5. Initialize JavaScript
    Add the following line of code to the onload-event of the body in your PHP file:

    ACS_init();
     

    This will initialize the slider and the hide-comments function. If the body doesn't contain an onload-event yet, you may add the following line:

    onload="ACS_init();"
     

  6. The comments
    Copy the following line of code to your PHP file. At this location the comments will be shown. If you want the comments at the bottom of your page, paste this line in the end of your file. You don't need to make any changes to the code.

    <?php include($ACS_path."index.php"); ?>
     
  7. Repeat the steps 03, 04, 05 and 06 with any other of your PHP files which should contain the comment system.

  8. Upload files
    Upload all files (your modified PHP files and the files from the advanced comment system) to your server. Note that text files (PHP, CSS, JS) need be upload in ASCII mode, images in binary mode.

  9. Create MySQL table
    Call install.php in your webbrowser (e.g. http://yourdomain.com/advanced_comment_system/install.php). It will create the MySQL table you specified in the configuration file. If the table was created successfully, you will see an according message. Otherwise check the variables in the configuration file.

You have now successfully installed the advanced comment system on your website. If you have any questions about this script or experience troubles with the installation, please have a look at the sample.php (comes with the package) or leave a comment on this page.

Browser compatibility
The script has been tested with

If you find any incompatibilities with one of the browser versions above or tested successfully with any other version, please leave a comment. Thanks in advance!

< back to free scripts main page

Tags

PHP, script, comment, system

Comments (45)

Leave a comment

If you have a question or a problem and you're looking for a solution, please use the forum. Comments might not be answered.

Your name (required, maximum 255 characters) ( remember)
Your message (required, maximum 5000 characters)
 
Insert these letters into the textfield below: SKfK (required, case-sensitive)
Drag the slider to the right (required)