Categories

Comment Scripts

Generally, any musician’s web site or blog worth it’s salt, sooner or later will have to add some form or means for the public to communicate it’s views and opinions to the web site’s owner or creators. This is a great way for band members, fans, musical students, other blog owners and whoever else to view their opinions and add useful and hopefully constructive comments to the site. A comment script is a great way of doing this.

PLEASE NOTE : THIS TUTORIAL RELATES TO INSTALLING COMMENT SCRIPTS ON NORMAL WEBSITES MANUALLY CREATED USING DREAMWEAVER AND OTHER CODING PROGRAMS. THIS SITE WAS PREVIOUSLY CREATED USING DREAMWEAVER WHEN THIS ARTICLE WAS WRITTEN AND HAS NOW BEEN MOVED TO WORDPRESS. THE ARTICLE NO LONGER RELATES TO THIS PARTICULAR SITE BUT STILL STANDS TRUE FOR OTHER SITES AS IT WAS ORIGINALLY INTENDED.

There are loads of different comment scripts out there available for installation ( free or otherwise ) to add to your site. You may have noticed, I have just enabled one on mine, and in doing so have encountered and overcome a few problems that many other users seem to have been having problems with. These include

  • Deciding which comment script to go for.
  • Working your way through totally useless instructions by the scripts owners.
  • Using FTP clients (File Transfer Protocol).
  • Changing file permissions .
  • Setting up databases.
  • Installing the script and adding it to your site.
  • Styling the script to suit your web site
  • Moving your site to its new language pages.
  • Using .htaccess files to manipulate the control of your site.

All of the above can be involved in installing your comments script. So let’s see if we can get through it with the minimum of hassle.

Which Comment Script ?

After much searching, reading reviews, and checking out the respective web sites and demo’s, I decided that the comment script that seemed to have the most features, flexibility and styling ability would be the Gentlesource comment script.

The script is free, can be downloaded, used and styled to it’s full capability and has smiley’s, captcha, comments moderation and loads of other features built in. The only problem with the free version is that it has a square advert at the bottom of the form advertising Gentlesource, which is perfectly understandable considering you are using the free version.

To get rid of the advert, you need to pay around 20 euro’s or £16 for the full version.

There are loads of other free ones out there to choose from but none of them seemed to look quite as good or have the other handy features such as spam protection built in etc. etc. It also works in Vista.

If you know of any better free (or paid) ones out there, then give us a shout and I’ll list them. I do not get paid for recommending them.

Divide

For new comers to the web, a couple of things you definitely need in any comment script you install on your site are Captcha and Akismet options.

A Captcha is an automated anti spam feature that generates words, distorted by graphics and images that are easily readable by humans but impossible for the millions of automated comment posting programs (bots) that crawl the web to decipher.

The idea is that they are supposed to prevent spam bots from entering and posting crappy comments on your site 24 hrs a day..

Unfortunately, spamming technology and the methods spammers use are becoming more and more sophisticated as the web develops and they are often able to surpass even the most complex Captcha scripts as the programs become more advanced. This is where Akismet comes in.

Akismet is a plugin feature from Akismet.com which analyses incoming comments and checks if that particular comment has been listed as spam. If it has, the comment does not get through.

The use of both of these features does provide reasonable protection from the unlimited amounts of spam your web site will receive if it becomes even remotely successful. This site even in it’s infancy receives over 40 odd spam comments a day, and I’ve only been going a few months. Some sites receive literally thousands every day.

Although the Gentlesource comment script’s Captcha form is not that complex, the Akismet does it’s job and so far the problem is being kept under control.

This comment script has an option to email you every time someone posts a comment to your script, (this can be turned on or off) so you can go to your admin area and edit, approve or delete comments. When it is turned on, it was initially very useful as the comments I first started receiving were genuine. Nowadays I may get 40 e mails a day informing me of spammy comments being posted, but a quick check of the latest comments in the script admin area, shows that none get through the Akismet, which is pretty handy.

! Death to the Spammers !

Installing the GentleSource Comment Script

This guide will be using a Go daddy shared hosting account on a Linux server, using Filezilla to install the software, on an html web site

These first few steps aren’t essential but it may help to find out whether your web hosting server has Freetype and GD2 installed before you start the process as if you find later you are having problems with the script, it could be because the script requires these two features for a correct installation.

If you know this already, then go to step 5.

1. Open a notepad file and copy this line onto the page.

<? phpinfo(); ?>

2. Save the file as ‘info.php’

3. Upload this info.php file to your root folder of your web site i.e. The same folder that all your visible web pages reside in.

4. In your web browser, type in

www.yourwebsite.com/info.php

where ‘yourwebsite.com or .co.uk’ etc.. is obviously the address of your own web site

You should then be presented with loads of information on your web server and a quick look will tell whether you have the correct applications installed and running.

5. Download the comment script from GentleSource.com and unzip the script using the latest free version of Winace to avoid any unzipping errors.

6. Once the folder is unzipped, open the folder comment_script_1.1.0. Inside, there should be a few other files and folders, along with a folder named named ‘cache’.

Comment Files

If there is not, then try and unzip the original file again using a different zipper. I originally used an earlier version of Winace and was left without a ‘cache’ folder. Many other’s seem to have had the same problem.
Or you can just create a new folder named ‘cache’.

7. Upload comment_script_1.1.0 to the root folder of your host account. If you are hosting many web sites on one host account, then upload the file into the root folder of the web site you want the comment script to function on.

IMPORTANT : Although the web site’s instructions say upload most of the files in ASCII and one or two in binary… If you follow these instructions, your comment script will work but you may find your captcha, social bookmarking and smiley graphics do not work. To prevent this happening, simply set Filezilla to upload all files in AUTO mode. This solves the problem.

8. Rename the uploaded folder to ‘comments’. Using Filezilla, simply right click the folder and select rename.

9. Now change the file permissions for the newly named ‘comments’ folder to ‘777’. In Filezilla, right click the file and select ‘file attributes’ from the menu.

Click the permission boxes so ALL the boxes are ticked….
and the xxx’s will change to 777.

File Permissions

Click to ‘recourse into subdirectories’ and ok, then watch Filezilla change the permissions.

10. When finished, refresh the directory list in Fillezilla as it won’t show that your permissions have changed until refreshed. People often think file permissions have not been changed at this point, when actually they have. Filezilla just needs to update it’s browser.

Check file permissions again and they should now show 777.

11. In your internet browser, type in www.yourwebsite.com/comments/admin

You should now be seeing the comments script set up screen.

12. At this point you will need to add all your various hosting database information etc. etc. If you have not set up a database on your hosting account, then go and do so now.

In Go Daddy, go to Manage account, databases, and set up a database. You will be given the information you need once the db is set up.

Now choose your own preferred log in name, email address to confirm your account, and make up your passwords to access your comment scripts admin. Proceed with the set up.

13. Log in to the admin area and check out the features.

If you find a few graphics are missing then consider step 7 again as this is where many installs go wrong. If all is well – continue.

14. Go back to Filezilla and refresh your file browser again. You should now see in the comments file, a new file called include.php. Note… If you do not refresh your browser, you will not see this. If you have this file then go to step 20.

15. If you do not have the ‘include.php’ file in your comments folder after refreshing your Filezilla browser, then to ensure the browser is refreshed properly, disconnect from the server and reconnect to your host and look in the comments folder again. You should now see the’include.php’ file. Go to step 20.

If you still do not see the file, look in – /comments/include… and find the file – include.php.tpl

Copy this to your sites root folder where all your web page files are situated that you want the comment script to work in.

You may have to copy the file back to your own desktop and then back to where you want it as Filezilla can move but not copy files and folders on the server side.

16. Right click on the new ‘include.php.tpl’ in your web pages directory and rename the file to ‘include.php’.

17. Right click this file and open it to view the contents.

To view your file, you may need to set to set Filezilla to open a web editing program.

In Filezilla, select – edit/settings/file editing, and set your default web editor by browsing to your ‘web editor’.exe file your own system.

e.g. your Dreamweaver.exe file may be in

“C:\Program Files\Adobe\Adobe Dreamweaver CS3\Dreamweaver.exe”

or notepad in

C:\Windows\System32\Notepad.exe

or what ever your favourite web editor happens to be.
In note pad the file will look different but still have the same contents.

also click
‘always use default editor’.

18. Ensure that your new include.php has the correct file path.

i.e. The section

define(‘C5T_ROOT’, ‘{$server_script_path}’);
include C5T_ROOT . ‘comment.php’;

This bit

{$server_script_path}

should be replaced with the full root path of the script in your host account.

i.e.

/home/content/h/o/s/hostaccountname/html/comments/

etc.

If you log in to your comment script admin account that you previously set up, and go to – Configuration – General settings, and scroll down to the bottom of the page, you will see your full file path name that you should use to replace the section above.

Note: If you are hosting many web sites in different folders of one host account, then you need to change the root path to represent this.

i.e.

/home/content/h/o/s/hostaccountname/html/othersitefolder/comments/

You should also be aware that if this is the case, then you need to go to the file – include.php.tpl in the comments/include folder and also ensure the path name there represents this as well. As you can imagine, it is originally designed to be set up in a normal hosting account ie. one host, one web site, so if your hosting account has other levels for other web sites, this should be represented in your site root file path as shown above.

19. Now go back to Filezilla and change the ‘comment’ folder file permissions back to 755 by un checking the boxes. Also click ‘recourse into subdirectories’ as well.

20. Now you are ready to add the script to your web site pages.

If your site is a purely html site then open a web page that you want the comment script to work on.

Go right to the top of the page, before any other writing, or code or images or anything else.

Add this code

<?php include ‘./include.php’; ?>

Note if your site is already a php site, you do not need the php tags, just use

include ‘./include.php’;

21. Now, go down to the place on your web page that you would like the comment forms to be placed and add the code

<?php echo $c5t_output; ?>

Note, if your site is already php, then avoid the php tags.

22. Now save your web page, not as an .html page, but as a .php page.

Simply change the pages extension from .html to .php and click save.

23. Now go back to the include.php file and open it up to view the file.

It looks like this

<?php

/**
* GentleSource Comment Script
*
* (C) Ralf Stadtaus http://www.gentlesource.com/
*/

define(‘C5T_ROOT’, ‘/home/content/w/h/a/whatever/html/comments/’);
include C5T_ROOT . ‘comment.php’;

echo $c5t_output;

?>

Remove the line

echo $c5t_output;

from the file and save it.

Make sure all these files have been updated to your server and now when you visit the web page you included the two lines of code on, you should have your comment forms enabled.

Voila.

Repeat steps 20 onwards to add the code to other web pages on your site.

Remember, all the html pages you have added this script to, are now saved php pages and now you must change the links to your site to reflect this. Don’t worry, this can be done in seconds.

Now you need to use an .htaccess file in your server account to redirect all the old links to your .html pages across the internet to your new php pages.

At this point, I decided to change the whole site over to php whether I had the comment script installed on a page or not. Php is a much more powerful and useful language to use when building a website than building one purely from html. The benefits gained from changing the site from html to php will become much more apparent as you implement more dynamic features on your sites such as forums and other popular scripts in the future. It also saves the hassle of redirecting my old web links to new ones as I just use an htaccess file to redirect the whole site to from html to php instead of individual pages.

Changing Your Site from Html to Php and Keeping Your Page Rank and Links

The method below uses an .htaccess file to direct your old web links to your new pages, by applying a mod rewrite to your apache server. It also tells the search engines that the rewrite is a permanent one.

This will redirect ALL requests for ANY page for your www.mywebsite.com/anypage.html to www.mywebsite.com/anypage.php

Open up a blank web page in your web editor, or notepad if you have no other.

Add these 2 lines to the page.

RewriteEngine On
RewriteRule (.*)\.html$ http://www.streetmusician.co.uk/$1.php [R=301,NC,L]

Save this file as .htaccess

If your editor does not allow this, then save it as .htaccess.txt

Upload this file to your server and place it in the root directory of the web site you are trying to rewrite.

Change the name of the file back to .htaccess

Once this page has been saved and updated to your server, you should now find that when you type in any page from your old .html web site in your browser, your server automatically directs you to your new .php pages.

You should find that when you call for the admin pages to your comment script, they are still accessible and work faultlessly.

If you have any problems with this part of the process, Google the rewrite rule and rewrite conditions for your .htaccess file. There are numerous ways to do this and often a similar approach with a slight change in code will work for your particular server.

This method however, works perfectly for me and I really hope it works as well for you. All your previously hard earned site links across the web will stay intact and hopefully so will your pagerank.

Edited 09.04.09
Posted 27.10.08

Back Home

COMMENTS FROM PREVIOUS SITE PAGE

Comments Scripts
Nice tutorial mate thanks for supplying it for free ;-)
#1 – Andy – 11/21/2008 – 11:27
No problem Andy
#2 – Kier – 11/21/2008 – 13:38
Thanks
Cheers for the tutorial and review of the script it’s nice to see it in action.. :-D
#3 – Poet – 11/27/2008 – 20:07
Glad you liked it.
#4 – Kier – 11/28/2008 – 04:35
mr
i am testing this out nowB-)
#5 – richard – 01/03/2009 – 17:04
Still ain’t working.
I’ve been trying to get this script to work all day i did exactly as you said but nothing shows up where i have . Thanks for your help anyway. Can you suggest an easier to use comment script?
#6 – Finn – 01/15/2009 – 23:53
nope
No matter what I do this will not work for me. :(

I just don’t get it. I followed your instructions precisely. Took me weeks and I still don’t get it.

Please help :(

#7 – David – 01/16/2009 – 00:36
I’ll try to help if I can.
You said.
‘ nothing shows up where i have ‘

Where does nothing show up ?
Are you on a linux server with GD2 and freetype ? Were your permissions changed properly, and back again ? Have you got your root path file name correct in the include.php and include.php.tpl files ? Is your include.php file in the correct folder on your server ? Have you changed your html page to php if necessary ? Have you added the php tags to the codes correctly, they may or may not have to be altered steps 20-22 ? This is often a fail point. Do you have the correct codes at the top of your page and also the place where you want the comment script to appear ?
There are these and many things to do, so you need to check every step exactly.
A really good method is to create a totally blank page on your website and get the script working on that. This ensures you have no other script conflicts.

#8 – Kier – 01/17/2009 – 04:05
Some kinda anchor
First of all I wanna thank you for a great write up. I finally got my script working. I added it to a test page of my site. But for some reason when the page is loaded it jumps right to the comment box on the bottom of the screen. Do you have any idea why that happens and how I could fix it? Another thing is that for some reason if I have flood protection enabled and I revisit the site after leaving a commnet, the comment box auto populates with the previous comment.
#9 – Benjamin Heil – 01/29/2009 – 08:59
Cheers.. Maybe when you ‘revisit the site after leaving a comment’, you are revisiting the ‘after comment’ page with the extention..#c5t_form on the end of your url. When I refresh my page after a comment is posted, the page I get is http://www.streetmusician.co.uk/commentscript/#c5t_form… and it is autopopulated with my previous message and a blocked content message. But when when I visit the original page http://www.streetmusician.co.uk/commentscript/ it is fine.
Maybe you could add a link back to your original page under the comment script boxes instead of returning to the #c5t_form.
As for the page jump…have you removed the line echo $c5t_output; from the include.php file ?. It’s been quite a while since I installed the script now, so I can’t remember all the ins and outs of it. The Gentlesource site and forum should be able to help you out.. It takes a while for them to respond, but they do respond in the end.
By the time they replied to my questions, I’d solved the problems on my own. That’s why I wrote this guide to save other people the hassle. I hope it’s helped a bit anyway.
#10 – Kier – 01/29/2009 – 15:53
Your help on installing the the comments was priceless! Cheers
#11 – Guitar Hack – 03/18/2009 – 16:08
Thank you very much for this instructions. This is very helpful page. I couldn’t install the script until I visit your page. Thanks again. :-D
#12 – Bojan – 07/02/2009 – 03:19
Question
I thought the script was supposed to work on html pages WITHOUT renaming all the pages to php. Nothing is simpler than html, and there is nothing inevitable about eventually going to php, nothing!

So as is, the script will not work for me.

Nonetheless, your tutorial included MANY insights not included in the original script. Thanks for that! :-)

#13 – Braulio – 08/14/2009 – 03:00

12 comments to Comment Scripts : How To Set Up & Implement On Your Website and Server

  • saran

    One question for you.

    Where to place the new include.php file and also how to enter the comments what is the url.

    I have installed in pizzahut/ folder
    comment.php and include.php is in pizzahut folder. how to call the url to enter the comments for end user.

    Thanks Saran

  • Sorry ! I’m not quite sure what you mean. If you study the steps involved, all the information you need to correctly install the script is there. Just retrace your steps and make sure you haven’t missed any of the wording – I believe this guide is complete. Thanks

  • saran

    Hi Kier,

    Now I started freshly downloaded the script and installed in the comments/ folder. I have downloaded the include.php file from the admin area and placed it in the comments/ folder. I placed include.php in comments/include folder.

    include.php file content

    ——————————-
    whether I need to remove these files in include folder. include.php.tpl and include_php.php.tpl. Either I need to modify anything in the comment.php file?. Please advice. Expecting your reply at the earliest.

    Thanks
    Saran

  • saran

    Hi Kier,

    After click on the submit comment button. the comments is not entering into the database.

    check this url :- http://122.166.5.35:8080/comments/. Is there any db configuration I need to check for the end user.

    Please let me know
    Thanks
    Saran

  • Still not sure what you mean…my site has changed to WordPress now so I don’t have the script installed anymore, but as far as I can remember with my old Dreamweaver site – You don’t down load the include.php from the admin area, it should be automatically created after you enter the details to set up page as in steps 11 to 14.
    If it is not there, you can create your own by following steps 15, 16 and 17.
    Make sure you edit the include.php file to show the correct path…as in step 18. To find the correct path name you can log in to your comment script admin account that you previously set up, and go to – Configuration – General settings, and scroll down to the bottom of the page, you will see your full file path name that you should use to replace the section above.

    Also, you don’t place the include p.h.p in the comments folder, you place it in the root folder of your site where all your web pages are stored.

    If you are still having trouble, you’ll have to use the Gentlesource forum to solve your issues as there may be many other things affecting your script.
    There used to be an independant video posted by a member of the forum which also shows the correct way to install the script…it may be an idea to find that aswell.

    Sorry I couldn’t help more.

  • saran

    Hi Kier,

    I have solved the issue. Comments is working now. How to remove the page footer ie copyright info from the form?.

    Thanks
    Saran

  • I’m afraid I paid for my script mate. Can’t help you on that one. Good luck though.

  • This script is a pain in the you what.

    I’ve done everything correct but no form on website. Keep coming up with this on webpage.

    Warning: include({/home/content/p/i/p/pipelinemarket/html/comments}comment.php) [function.include]: failed to open stream: No such file or directory in /home/content/p/i/p/pipelinemarket/html/include.php on line 10

    Warning: include() [function.include]: Failed opening ‘{/home/content/p/i/p/pipelinemarket/html/comments}comment.php’ for inclusion (include_path=’.:/usr/local/php5/lib/php’) in /home/content/p/i/p/pipelinemarket/html/include.php on line 10

    Please Help

  • Sorry mate, you’ll have to check the gentlesource comment script forum for help, this post is just an install guide as their set up instructions weren’t clear enough for general use.

  • “To find the correct path name you can log in to your comment script admin account that you previously set up, and go to – Configuration – General settings, and scroll down to the bottom of the page, you will see your full file path name that you should use to replace the section above.”
    Can about it more?

  • can captcha be included into this comment script?

  • Good question Barb..as that would make this comment script nearly perfect!

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>