The User Comments Module is a plug n' play widget for your website, allowing you to quickly set up a comments section on any page for your visitors to leave feedback. See below, in the comments section !It relies on SQLite library for PHP, thus bypassing the use of heavy, server-oriented database systems such as MySQL that require annoying admin work to deploy. Indeed, SQLite only involves .db files created on the fly and easily accessible via FTP.
And jQuery is, of course, the choice for dynamic web app behaviors !
Version 1.0 (last updated Sept. 14th 2010) - UserCommentsModule1.0.zip - PHP5 (5.2 and up) with SQLite 2.1 module enabled - 180Kb - GNU GPL 3.0 Licensed
Please note that a ready-to-use
EXAMPLE.php5 file is available in the zipped package for you to perform tests before actually including the widget in your page.
- Download the UserCommentsModule1.0.zip package, unzip it and upload the
usercommentsfolder found inside the package to the root of your website (that's where your index file lies).
- Open the php5 page file in which you wish to include the User Comments Module.
- Upload the jQuery file
jquery.jsincluded in the package at the same level as the
usercommentsfolder and link it from the
<head>tag in the chosen target file with the following :
- Still in the
- Make sure a session is opened at the very beginning of the script (ie. before any HTML tag) with the following :
<?php session_start(); ?>
Then copy/paste the following and customize with your own values and needs :
<?php $UC_MODULEID = "default"; $UC_EMAIL = "email@example.com"; ?>
$UC_MODULEIDsets the name of the .db file that will be created. It is important to choose that name well, because if you decide to run multiple User Comments Modules on different matters but those bear the same name, all their comments will be centralized in a unique file (ie.
./usercomments/data/usercomments_uniquenameyouchose.db) and displayed all together.
$UC_EMAILsets the email address where a notification will be sent to alert you, the webmaster, that a comment has been posted and requires moderation before publishing. Try and use an email address within the same domain as the one in the url of the page including the widget : that will help avoid automatic spam-fighting robots from removing the alerts from your inbox.
<?php include("./usercomments/UC_INCLUSION.inc"); ?>
usercommentsfolder found in the package, lies a
datafolder with a
.htaccessfile in it. Do not erase that file ! It protects the .db files, that contain the comments, from being wildly opened from outside the widget (ie. bypassing your moderation decisions...).
The User Comments Module uses the following technologies :