Subscribe to RSS feed

splitbrain.org - electronic brain surgery since 2001

Add comments to any PHP script

I recently updated My Two Cents. My Two Cents (or MTC) is a simple PHP class to add comments to any PHP driven site. It is was written with simplicity in mind but still has some strong features and is easily tweakable.

It consists of a single PHP file and can be added with just a few lines of code.

MTC comes with a CAPTCHA mechanism and a blacklist feature to fight comment spam. The new release adds audible CAPTCHAs as described in Joining .WAVs with PHP. I also tweaked the way Gravatars are used to make additions like MonsterID easier to add.

International users will be happy to hear that all string now can be easily changed through a single language array.

To see the script in action just have a look at the comment form below. It's powered by MTC. Detailed usage infos are available in the manual.

Tags:
php,
comments,
captcha,
mtc
Similar posts:
Posted on Saturday, January the 27th 2007 (3 years ago).

Comments?

1
This is pretty awesome. I can't wait to install this on my web site!! I've been wanting to do something like this for years!!
2007-03-13 15:27:41
2
Very nice!  I will give it a try!
2007-03-15 05:08:47
3
do i get to pick my icon? hmm.. nice script!
2007-04-02 04:19:50
4
I deleted all test comments, because they add no value to the site. Just a note because some people seem to confuse it: The monster icons are *not* provided by MTC but by MonsterID which is a separate script. But both can easily work together.
2007-08-25 20:34:02
5
does it prevent the same person from constantly posting?
2007-12-18 21:57:36
Jay
6
Jay, there is no flood control. But the CAPTCHA makes flooding much harder.
2007-12-18 22:05:42
7
Wow, that wasn't all that bad to figure out.  Thank you.
2008-01-04 01:05:18
Josh
8
I get this error Fatal error: Call to a member function comments() on a non-object in E:\wamp\www\radiouri\admin\db_fns.php on line 35 , on this line i have inside a function wich display the page content :
$MTC -> comments();
$MTC -> comment_form();
2008-03-29 14:09:17
Marius
9
I figure it out !
if is inside a function it must be global, so make it global - global $MTC. That all.
And if your site is dynamic ( ?cat=1&id=2 ) you must change in mtc.class.php on line 88 from $_SERVER['PHP_SELF'] to $_SERVER['REQUEST_URI'] and probably on line 513.
2008-03-29 14:42:46
Marius
10
wow!, a very simple script i like this, and i will try this to my website

thanks
2009-05-27 18:52:51
Irvin
11
Hi I like this script but before i installed I want to know if this script have admin saction
2009-06-06 13:57:39
OMa
12
probando...
2009-07-18 14:52:51
Lili
13
testing123
2009-09-02 03:03:14
fdsafdsa
14
merci
2009-10-17 21:25:46
canari
15
This is great
2009-12-04 15:10:15
Jasmine
CAPTCHA

No HTML allowed. URLs will be linked with nofollow attribute. Whitespace is preserved.