Comment Script Installation and Configuration Guide

If you have a question or suggestion, you can post a message in our support forum.

If you find errors or typos in this manual or have suggestions, just join the discussion in our support forum: Improving the installation manual

 

 

 

1      Introduction.. 3

2      Features. 3

2.1       Outline. 3

2.2       Comment 3

2.3       Admin Area. 4

2.3.1       Latest Comments. 4

2.3.2       Page List 4

2.3.3       Comment List 4

2.3.4       Admin Account 4

2.3.5       Configuration. 4

2.3.6       Backup. 5

3      Feature Modules. 5

3.1       Available Modules. 5

3.1.1       Akismet 5

3.1.2       Boilerplate. 5

3.1.3       CAPTCHA.. 6

3.1.4       Content Block. 6

3.1.5       Content Replace. 6

3.1.6       Comment Mailer 6

3.1.7       Date Picker 6

3.1.8       Flood Protection. 6

3.1.9       IP Block. 6

3.1.10     Keyword Highlighting. 6

3.1.11     Referrer Log. 6

3.1.12     Smilies/Emoticons. 6

3.1.13     Social Links. 7

3.1.14     Text Link Ads. 7

3.1.15     Word Filter 7

3.1.16     Snap Preview.. 7

4      Installation.. 7

4.1       Step-by-Step Guide. 7

4.2       Upload. 8

4.3       File and Folder Permissions. 8

4.4       Database Access Data. 8

5      Including the Script 8

5.1       Include into an existing PHP File. 9

5.2       Include into an existing HTML file. 10

5.3       Rename the file extension from .html to .php. 10

5.4       Make an HTML file being parsed as PHP file. 10

5.5       Rename the file extension from .html to .shtml (SSI) 11

5.6       Make an HTML file being parsed as SSI file. 11

5.7       Server Side Include (SSI) 11

6      Layout Customization – Colors, Fonts, Styles. 12

7      Text, Wording and Language Files. 13

8      Backup the Database. 13

9      Update to Newer Version.. 13

10    Help and Support 13

11    Licensing.. 14

 


1         Introduction

 

Thanks for downloading and using our Comment Script. The script can be included in your website pages and allows your visitors to leave comments. The comments can be edited and deleted in the admin area.

 

The script requires either PHP/4 or PHP/5 on Unix/Linux/Windows and a MySQL database. You also need a software (WinZIP for example) to unpack the script files after downloading from our server. You should have a solid understanding of HTML and some experience with script installation.

2         Features

 

Once you have the script installed on your server you can include it in any existing PHP or HTML page. By default the script shows the form fields "name", "E-mail", "Homepage", "Title", and "Comment". You are free to remove some of the fields and only leave the ones you want. The fields "Comment" and “Name” are mandatory and the form will not submit until those fields have been filled out.

 

In order to prevent the script from being abused by automatic spam bots, you can activate several anti-spam features. Read more about that in the section “Modules”.

 

The script also features an admin area where comments can be edited and deleted. Also there is a section for settings where you can set the front end language as well as the admin account.

2.1        Outline

·        Visitors can enter a name, e-mail, homepage, comment title and comment text

·        Comment script can be included in existing web pages

·        To prevent comment spam you can enable several anti-spam features

·        Admin area for editing and deleting comments

·        Completely template driven

·        Installation routine

2.2        Comment

By default the script shows the fields name, e-mail, homepage, comment title, and comment text. You are free to remove all but the comment text field from the HTML template.

2.3        Admin Area

2.3.1        Latest Comments

The list with the latest posted comments contains all entries sorted by date descending. You can here edit, delete, approve or disapprove comments.

2.3.2        Page List

By default the script uses the request URI as a unique identifier to assign comments to their corresponding pages. The request URI is the path including all parameters behind the hostname of a URL. I.e.:

 

URL: http://www.example.com/news/page.php?id=231

 

The request URI would be:

 

/news/page.php?id=231

 

The admin area shows a list of those pages. You can assign an individual name for each page. It is also able to make the script using external identifiers which do not depend on the request URI.

2.3.3        Comment List

When you open a page a list with all corresponding comments appears. You can edit, delete, sort and search in comments. You can here edit, delete, approve or disapprove comments.

2.3.4        Admin Account

In this section you can change login name, e-mail, and login password.

2.3.5        Configuration

2.3.5.1       General Settings

 

The settings section allows you to:

·        Change the language of the script

·        Change the number of comments per page (front end)

·        Change the comment order direction (front end)

·        Set the script URL

 

2.3.5.2       Additional options in Configuration

 

Please read the next chapter about modules.

 

2.3.6        Backup

Click the button “Export Backup” if you want to backup the data of the script. The new backup will appear in the list of backups where you can download, delete and import it.

3         Feature Modules

 

Modules are small tools that are integrated into the script and add various kind of functionality.

 

These tools reside in the folder /modules/. Each module has its own language file and template file. You can find those files in the folders

 

/module/gentlesource_module_*/language/

 

and

 

/module/gentlesource_module_*/template/.

 

Not all modules are available for every script. For example, it makes no sense to include Captcha or flood protection to a script that has no user contribution capability such as commenting.

 

Please note: Some modules (i.e. Captcha, IP-Block) offer the option to moderate comments. Some scripts (i.e. Temporary E-Mail) do not support the moderation option, but only the rejection option.

3.1        Available Modules

3.1.1        Akismet

Akismet.com analyzes incoming comments and checks if that comment has been listed as Spam. You need to get an API Key from http://www.akismet.com/ by registering an account at http://www.wordpress.com/. If you leave this API key empty, Akismet will not be used.

3.1.2        Boilerplate

This module allows you to prepare text modules that you can easily insert in a text box. That saves you from writing similar text over and over again. Boilerplate refers to any text that is or can be reused in new contexts (see also Wikipedia).

 

You can create an arbitrary number of text items. The “Title” of an item appears in the select menu above the text field. After selecting an item the prepared text will be pasted into the text field.

3.1.3        CAPTCHA

The Captcha feature displays an image with a string of characters. In order to prove that the visitor is not an automatic spam program, he has to enter the characters shown in the image into a form field. In case both strings match the comment will be accepted. 

3.1.4        Content Block

This option allows you to moderate or blocks comments on the basis of the posted content. Enter one word or phrase per line in the text box.

3.1.5        Content Replace

Enter text that you want to be replaced automatically with text you can specify.

3.1.6        Comment Mailer

Activate this option if you want to have new comments mailed to your e-mail address.

 

Please note: It is advised to move this module to the bottom of the list of installed modules.

3.1.7        Date Picker

Displays an icon that links to a calendar popup and lets you select a date. This module does not appear in the module list. It is used on the article form next to the date fields.

3.1.8        Flood Protection

This module prevents users from re-submitting the same content (i.e. when hitting the reload button) over and over again. It checks the content against existing entries in the database.

3.1.9        IP Block

Moderate or block comments based on the IP address of the visitor.

3.1.10    Keyword Highlighting

This feature highlights the keywords of the search engine referrer in the text.

3.1.11    Referrer Log

The module writes date, time referrer and request URI of a visit to a text file.

3.1.12    Smilies/Emoticons

Activate this option to get ASCII emoticons such as :-) or ;-) replaced with images in the text.

3.1.13    Social Links

Enabling this feature will display a list with links to social services such as del.icio.us or digg below the page content. You can edit the list in the template link.tpl.html in the module folder.

3.1.14    Text Link Ads

Make money with your website and publish simple text link ads or buy text link ads to improve your traffic and search engine rankings. You can find more information at Text Link Ads: http://www.text-link-ads.com/?ref=37444.

 

In order to use this feature you have to register with Text Link Ads.

3.1.15    Word Filter

The word filter replaces undesirable words and phrases with a character or a string of characters that you can specify.

3.1.16    Snap Preview

Snap Preview (http://www.snap.com/) shows a preview of the website that is being linked.

4         Installation

4.1        Step-by-Step Guide

The script has been configured in a way that makes it immediately ready to use. Please follow these steps:

 

1.      Connect to your web server using an FTP program.

2.      Create a new folder on your server named e.g. comments.

3.      Upload the whole script including all files and folders to your server into the new folder. Make sure the original file structure appears on the server. Read more details in chapter 4.2 Upload.

4.      Make sure the script folder and the sub-folder cache are writable by the script (chmod 777). Read more details in the chapter 4.3 File and Folder Permissions. If those folders are not writable the installation will fail.

5.      Call the admin area of the script in your browser:

http://www.example.com/comments/admin/

6.      You are probably seeing now the installation screen of the script. Please make sure you have the database access data. Read more details in chapter 4.4 Database Access Data.

7.      Choose a prefix for the database tables. Default value is c5t_ and there is actually no need to change that unless you want to have more than one installation of the script side by side.

8.      Enter the information for the admin account you want to create and use, once the script is working.

9.      Click the button Install Now. In case the installation was successful, you will be provided with a link to the login screen where you can use the account data you just entered.

10. Once the script is installed, revert the "script" folder (e.g. comments) to chmod 755.

4.2        Upload

All files have to be uploaded in text mode (ASCII mode) except for the font file(s) in the folder /include/font/. The font file daft.ttf has to be transferred in binary mode.

Otherwise the Captcha feature will not work properly.

4.3        File and Folder Permissions

Most, if not all, FTP programs allow you to change the file permissions. That can either be done with a command line and the command chmod or with some clicks on menus and checkboxes.

 

We have published a guide with examples of common FTP programs on our website.

 

http://gentleurl.net/chmod/

4.4        Database Access Data

You need following four items:

·        Database hostname

·        Database name

·        Database user name

·        Database password

 

You either get those data from your web space control panel or ask your web space provider about them.

5         Including the Script

 

The script can be included into PHP files or into SHTML (using SSI) files. If you are unsure if SSI is the right solution for you, you can rename your HTML files to *.php.  You can use a file manager (i.e. Explorer on Windows) to rename your files.

5.1        Include into an existing PHP File

If the file(s) you want the Comment Script include into already have the extension .php, it should be very easy to get the script to work.

 

Step-by-step instruction:

 

1.      Copy the file include.php into the folder where your files reside that you want to implement with Comment Script.

 

2.  Add the PHP include statement at the very top of your existing PHP file. It is important that no output is made before the include statement.

<?php

include './include.php';

[...]

In case you have HTML code in your PHP file, it would have to look like this:

<?php include './include.php'; ?>

<html>
  <head>[...]</head>
  <body>[...]</body>
</html>

 

3.      Move the variable $c5t_output from the new include.php file to the place in your existing PHP file where you want the Comment Script content to appear.

echo $c5t_output;

In case you have HTML code in your PHP file, it would have to look like this:

<?php echo $c5t_output; ?>

It is important that you delete the variable $c5t_output from include.php once you have moved $c5t_output to your existing web page.

 

4.      The script should work now. If not, please check steps 1 and 2.

 

 

Note: Since you are including the script into an existing web page, you probably want to strip the HTML frame from the default template file layout.tpl.html. In that case you probably also want to include the script’s CSS file into the HTML head:

 

<link rel="stylesheet" href="/comments/template/default/style.css" type="text/css" />

5.2        Include into an existing HTML file

If your files have the extension .html, you have three options to include the script:

 

·        Rename the file and change the file extension from .html to .php

·        Don’t change the file extension but make the HTML file being treated as a PHP file

·        Rename the file and change the file extension from .html to .shtml (SSI)

·        Don’t change the file extension but make the HTML file being parsed as SSI file

5.3        Rename the file extension from .html to .php

This would be the easiest option. Once you have changed your .html files to .php files, you can go to chapter “Include into an existing PHP File” and follow the steps to include the script into a PHP file.

5.4        Make an HTML file being parsed as PHP file

If PHP is running as Apache module on your server, you can create an .htaccess file with following content and upload it to your server:

 

AddType application/x-httpd-php .php .html

 

If PHP is running in CGI mode on your server, it can be trickier to get .html parsed as PHP file. If in doubt, contact your webhost.

 

Create an .htaccess file with following content and upload it to your server:

 

AddHandler application/x-httpd-php .php .html

 

If that doesn’t work, try this one:

 

AddType x-mapp-php4 .html

 

If that doesn’t work, try this one:

 

AddType x-mapp-php5 .html

 

If you had no luck with all of the above options and your webhost is not of help, search the web for: htaccess html parsed php cgi

 

Once you have your .html being parsed as PHP files, you can go to chapter “Include into an existing PHP File” and follow the steps to include the script into a PHP file.

5.5        Rename the file extension from .html to .shtml (SSI)

If SSI (Server Side Includes) is enabled on your server, files with the extension .shtml will be treated as SSI files.

 

If SSI is not enabled on your server, this is what you can do. Create a new file with the name .htaccess. Open the file in a text editor and paste this code in the .htaccess file:

 

AddType text/html .shtml

AddHandler server-parsed .shtml

Options Indexes FollowSymLinks Includes

 

Save the .htaccess file and upload it to your server (into the folder where the .(s)html files reside .

5.6        Make an HTML file being parsed as SSI file

If you want to use .html instead of .shtml, instead of writing, you need to create a .htaccess file with this line:

 

AddHandler server-parsed .html

 

If you had to activate SSI like in the chapter above, just replace the line

 

AddHandler server-parsed .shtml

 

with

 

AddHandler server-parsed .html

 

Save the .htaccess file and upload it to your server (into the folder where the .(s)html files reside .

5.7        Server Side Include (SSI)

Use the include.php file to include Comment Script into an SSI HTML file.

 

<!--#include virtual="./include.php?c5t_ssi=1"-->

 

You can put it where you want. There is no need to place it at the top of the page like in the PHP include.

 

Example:

 

<html>

  <head>

    <title></title>

  </head>

 

  <body>

    [...]

 

    <!--#include virtual="./include.php?c5t_ssi=1"-->

 

    [...]

 

  </body>

</html>

 

Please make sure you set the correct path.

 

Note: As opposed to the include into a PHP file, you don’t need to move or delete the line echo $c5t_output;.

 

Note: Since you are including the script into an existing web page, you probably want to strip the HTML frame from the default template file layout.tpl.html. In that case you probably also want to include the script’s CSS file into the HTML head:

 

<link rel="stylesheet" href="/comments/template/default/style.css" type="text/css" />

 

Note: In case a user does not fill out the required fields of the form, the error screen of the script appears. That error screen uses the standalone template file layout.tpl.html. You might want to customize that template to match the layout of your website.

 

Note: The pagination feature does not work in SSI mode.

6         Layout Customization – Colors, Fonts, Styles

 

The script is template driven. That means you do not have to work with PHP source code in order to change the layout of the script.

 

Colors and fonts are controlled with CSS in the file /templates/default/style.css.

 

The template files (layout.tpl.html, comment.tpl.html) can be edited like normal HTML files. You can find those files in the folder /template/. The folder /default/ contains the front end layout.

 

It is important, that the replacement tags – {$txt_example}, {$other_example} – stay as they are. Otherwise the script will not work. Some HTML editors tend to alter the source code of an HTML. Please be careful.

 

You are free, of course, to move parts of the template files. For instance, if you wanted to move the comment form above the entries, you would have to edit the file /templates/default/comment.tpl.html. The comment form is marked with

 

<!-- Comment Form Start --> and <!-- Comment Form Start -->

7         Text, Wording and Language Files

 

All text and wording of the script is held in the language files in the folder /language/. That includes the form labels as well as all the text in the admin area. You can create your individual language file by copying and renaming one of the existing files. In order to make the new file available in the language list in the settings section, you have to add it to the list $c5t['available_languages'] in /configuration/default.inc.php.

 

There are also language files in the module folders:

 

/module/gentlesource_module_*/language/

 

Should you have translated a file into your language we would really appreciate it if you could send us the file.

8         Backup the Database

 

The script allows you to export the database content into a text file that is written on the server. All exported files are listed in the “Backup” section of the admin area. Each file can be downloaded, deleted, or imported into the script again.

9         Update to Newer Version

 

In case you want to update your script to a newer version it is recommended to backup the script files and database data.

 

Upload all script files of the new version. The script will automatically recognize the updated files and show the update screen. Enter your MySQL data,the admin login data and hit the button "Update".

10    Help and Support        

 

If you run into problems while installing or configuring Comment Script, please use our support forum at http://www.gentlesource.com/.

11    Licensing

 

The script is free for private usage and non-profit organizations. The free version requires the ad-link at the bottom of the script. If you want to use the script without the reference, you need to purchase a license on our website: http://www.gentlesource.com/

 

Purchasing a license is also required for:

 

·        Companies

·        Websites with ads or any other revenue stream

·        Adult websites

 

PHP Scripts
Website Content
Resources