Commentator is an extremely simple PHP comments system that uses a MySQL database.
Requires PHP 5+ and a MySQL database.
» commentator.zip (19KB) - changelog
Latest version: 0.7.5 (added 14 March 2011)
If updating from version 0.5, please see this comment.
You can also fork it on Github.
You need to put some PHP into your own code where you want the comments (and the comment form) to appear. For example, this page contains all comments in a DIV, with an H2 element as a heading, which includes the total number of comments.
<?php
require_once('../commentator.php');
$comments = new Commentator('lemurs', 'My page on lemurs');
?>
<h2 id="comments">Comments (<?php echo $comments->commentcount; ?>)</h2>
<div class="section">
<?php $comments->write() ?>
</div>
require_once argument needs to point to the Commentator PHP file. You only need it once, as the above code should be the only thing that varies from page to page where you want comments.Commentator() should be a name unique to the page, as it is what the MySQL table will be called.new Commentator bit.The script optionally employs the Akismet PHP5 class to avoid spam comments. I really recommend it, as it works really well and spam is pretty ubiquitous. As an example, within two days of putting this page up, there were already comments about viagra being submitted (but they got caught).
The script will also allow you to submit false positives ("Ham") and uncaught Spam to the Akismet service, which helps everyone using it. This is done automatically when you use the "Mark as spam" or "Unmark as spam" buttons (see Managing comments below).
To use it you will need a WordPress API key. It is very easy to get and does not mean you need to get any other WordPress stuff - they'll give it to you for free, which is very nice of them.
When you download the Akismet PHP class, you only need the main PHP file (Akismet.class.php).
You will need to set some variables at the top of commentator.php. None of these are absolutely critical for the operation of the script, but they are important nevertheless. They are quite self-explanatory:
$akismet_file = 'Akismet.class.php'; // Akismet PHP5 class file
$wpAPIkey = 'xxxxxxxxxxx'; // WordPress API key
$commentator_from = 'noreply@example.com'; // email address to appear in "From" field
$email_owner = 'me@example.com'; // Your address. Identifies author in comments
$preview = true; // allows users to preview comments before submitting
$send_email_on_new_comment = true; // Sends $email_owner an email when a new comment is posted
$commentator_password = 'password'; // Password to enable you to delete comments
$gravatars = true; // Use of gravatars. Set to false to disable, true to use default.
$comments_per_page = 20; // Comments to display per page. Set to false to disable pagination
$newest_first = true; // Order comments to display newest comments first.
$mark_as_spam_and_delete = true; // Delete comments automatically when marking as spam
// Allowed HTML tags in comments. Set to '' to disable HTML altogether
$html_comments = '<a><i><b><em><u><s><strong><code><pre><p>';
$htmlfixer_file = 'htmlfixer.class.php'; // HtmlFixer class file to fix bad HTML. Set to false to disable
The other gravatar defaults are supported too by setting $gravatars to one of the default gravatar keywords or to the URL for an image of your own.
If using them, the Akismet and HtmlFixer files must be in the same directory as Commentator.
As you can see in the settings section above, you can set a password. This will make a checkbox appear next to each comment, and these buttons at the bottom:
To use this feature, you must log in by clicking the "Admin" link in the bottom right of the comment-posting form. To log out click it again. The old system of putting ?password=xxxx in the address bar will still work, but its use is discouraged as it is very insecure.
Important: Once logged in, reloading the page will log you out automatically unless you have set up a PHP session in your code using session_start. This needs to be done on the page where you inserted the code in the Usage section above before any HTML is output. This is because sessions work with cookies and PHP cannot set a cookie once stuff has been sent back to the browser.
The buttons are pretty self-explanatory. The number in the last button just tells you how many comments are spam. It appears regardless of whether spam comments are showing or not, so use with caution!
The "Unmark as spam" will submit a "Ham" to Akismet, i.e. it will submit a false positive. Please use it sensibly. The same goes for the "Mark as spam", which tells Akismet about uncaught spam. You can set it to delete the comment as well (see settings above).
BSD-style license. This means you can pretty much do whatever you want as long as you give due credit.
If the steps above didn't help, if you encounter bugs or if you have any other questions, email me:
r [at] this domainNewest first Oldest first Page 1 of 10 Next 20 »
Page 1 of 10 Next 20 »
i find an online store for sales lv bags: http://www.bagmallus.com/
Louis vuitton handbags 2012 are at one's fingertips, all the modish styles and lastest styles can be develop! Louis vuitton monogram canvas in the broad collection of enduring louis vuitton handbags, they comprise the most popular louis vuitton artsy both MM and GM sizes! Nowaday, people may be like the leather handbags much more, louis vuitton leather handbags are also cause you a up to date feelling in its pock design.
I ventured out repayment for the at daybreak morning garage sales and woke up Eliza to judge if she wanted to take place together with me. She matters up like a snow pea and jumped to it. 1 discoloration (closely where I located 7 tomato cages for $2-hooray) she discovered a thwack of crayons that had been unmistakeable
#196 – 17 May, 2012 at 7:46 pm
basically if i are blessed with push the button, that have potentially $140. It is rarely pay out to any other monthly premiums of any of people for the opportunities you generally like tv programs and try an alternate website online satellite tv mac satellite tv online software reviews watch satellite tv online free download Application: You'll use minimum Window panes Does 70% Apart Noise Advantageous To a website? Most certainly, the alternative is normally one-half going to work even though ways ranging from Europe, Research, New Zealand very well as the Great. Now with
#195 – 17 May, 2012 at 5:31 am
this is my 2nd comment
#194 – 16 May, 2012 at 3:48 pm
hi theire this is my test comment
#193 – 16 May, 2012 at 3:48 pm
hi theire this is my test comment
#192 – 16 May, 2012 at 3:47 pm
#191 – 16 May, 2012 at 5:52 am
little or too much") also can explain problems with a nebulous "point of impurities and regaining their designated bodily functions. "Magnetic Resonance Stimulation" is accomplished through complete body oxygenation, anxiety. Electromagnetic treatments per. However, for thousands of years finds relief. An electromagnetic wave helmet Electric Field Therapy New York Electric Stimulation Therapy Magnetic Therapy Back and tighten up many long lasting benefits. Today, magnetic counseling is well just like the new treatment. Electromagnetic Therapy today. Prepare yourself to feel happy immediately using it has confirmed which simply treating the symptoms and retards the
#190 – 15 May, 2012 at 5:40 am
will grant his approval and lucrative conditions and terms of one's citizens of United kingdom. Citizens of United kingdom that are driven by credit good quality can anticipate some type of lease financing
prentice capital hedge fund michael zimmerman prentice prentice capital fund
They are able to Enable Your company Finance is just not viable. In the intervening time, within the 30 -40% per cent vary to permit your participation inside sectors of electrical power. With these kinds of absurdist claims
#189 – 10 May, 2012 at 4:28 am
testing ö
#188 – 9 May, 2012 at 1:22 am
The World is Mine http://www.netvibes.com/lexmar#Purchase_Lexapro_online lexapro low blood sugar , http://www.netvibes.com/lexmar lexapro directions
#187 – 5 May, 2012 at 7:57 pm
The significance of online reputation management is turning out to be an actual large offer for modest and method companies in the previous 12 weeks of this creating and is just not slowing along anytime quickly. Neither could be the have to have for on the internet status management expert services.
Reputation Management Monitoring For Online Businesses
A popularity, good or undesirable, is some thing that can comply with your organization for decades to return. A person consumer with a bad expertise could be the distinction amongst an excellent 12 months along with a painful 12 months for your business when it comes to earnings.
#186 – 2 May, 2012 at 1:58 pm
Helllo...I REALLY like this script. ~GREAT JOB! :)
#185 – 30 April, 2012 at 3:27 pm
This is a test
#184 – 30 April, 2012 at 9:35 am
Can you put multiple instances of it on one page? (I have a page with several articles on it and I wand users to be able to post comments to each of them). Thanks!
#183 – 29 April, 2012 at 4:13 am
If I put the code that calls the script on more than one page, all the pages display the same comments. That's not useful if you want to use it on different pages of your website. Does anyone have advise how to solve this?
#182 – 26 April, 2012 at 9:23 am
If I put the code that calls the script on more than one page, all the pages display the same comments. That's not useful if you want to use it on different pages of your website. Does anyone have advise how to solve this?
#181 – 26 April, 2012 at 9:18 am
how if i have code in my template like this: echo $newsRecord['num'] or $newsRecord['_link']
how insert to Commentator(''); ?
help me please
#180 – 26 April, 2012 at 5:05 am
viagra halu.com
#179 – 23 April, 2012 at 6:15 am
">
#178 – 20 April, 2012 at 2:48 pm
Roland is just testing
#177 – 18 April, 2012 at 3:54 am