w3easyComment Manual

Script: w3easyComment © 2010/2011 Joachim Haack
w3easy.org and www.w3nord.de

REQUIREMENTS
PHP 5, (maybe also PHP 4 will do), NO DATABASE required.

LICENSE
GNU General Public License, Version 3

DESCRIPTION
With the w3easyComment script you can add a comment functionality to any page of your site that you want to comprehend one. You can even use it as guestbook.
As it is our philosophy it is a standalone module and can be put in any php supported website that accepts external scripts.

INSTRUCTIONS
Installation
First unpack the script folder.
Now open the file "config.inc.php" and specify the settings as it fits.
(You may also specify or change the config settings after upload in the administration area)
Then upload the main script folder "w3easyComment/" to your webspace.
Upload the subfolder "w3easyComment/w3eC_CssJs/" containing the files "styles.css", "styles_ie6.css" and "w3eC_magic-box.js" to the layout folder of your website (resp. as you have specified in the config).
Make sure that only you have access to the scriptfolder.
(I'd recommend htaccess directory protection using our w3easyProtect script...;)
Make sure that you have permission to create files and folders in the following directories:
"w3easyComment/comm_fold/"
"w3easyComment/comm_fold/comments/"
"w3easyComment/comm_fold/comments_new/"
"w3easyComment/comm_fold/comments_new_links/"
(chmod folders to 775 should do. Elsewise try 777.)
Make sure that you have permission to edit the following files:
"config.inc.php"
"uniqid.txt"
(chmod files to 664 should do. Elsewise try 666.)

To include the comment function in your site I recommend to have a look at the source code of the "index.php" file in the script folder.
First make sure that the page always will start a session when accessed. If the site not yet uses sessions, start a session on top of the page.

<?php session_start(); ?>

As you can see also in the "index.php", there are 4 parts that must be inserted in the page resp. in the template, each enclosed with the opening (= '<?php') and the closing (= '?>') php tag.
Each part begins (after the php tag) with
"###_w3eC_insert-X_begin_###"
and ends with
"###_w3eC_insert-X_end_###"
(followed by the closing php tag).

You have to edit only the 2 paths in the 1. insert part:
The path from the page where the script is included
a) to the 'w3easyComment/' script folder
b) to the 'w3eC_CssJs/' folder, i.e. the folder that contains the styles and the javascript.
Do not forget the trailing slash! (Note: it must be the paths from the page that is active, i.e. from the site, that is shown in the browser line.)
Now insert the 4 parts in your page as they are inserted in the "index.php" page:

The 1. insert part must be above the <head> tag of the page,

<?php
###_w3eC_insert-1_begin_###
// Edit the following 2 paths:
$w3eComment_path = "YOUR/PATH/TO/w3easyComment/";
$w3eC_cssjs_path = "YOUR/PATH/TO/w3eC_CssJs/";
// DO NOT EDIT
ob_start(); // begin
include ($w3eComment_path."comment.php");
$w3easyComment = ob_get_contents();
ob_end_clean();
###_w3eC_insert-1_end_###
?>


The 2. insert part must be inserted between the <head> </head> tags.

<?php
###_w3eC_insert-2_begin_###
// DO NOT EDIT
echo $w3eComment_css;
echo $w3eComment_ie6_css;
echo $w3eComment_js;
###_w3eC_insert-2_end_###
?>


With the 3. insert part you have to replace the <body> start tag of the site. No worries - there still will be a body tag for your site - hopefully...;)

<?php
###_w3eC_insert-3_begin_###
// DO NOT EDIT
if (!isset ($body)){$body = "<body>\n";}
else {$body = $body;}
echo $body;
###_w3eC_insert-3_end_###
?>


The 4. insert part must be between the <body> </body> tags. With this part the comment function is displayed on your page.

<?php
###_w3eC_insert-4_begin_###
// DO NOT EDIT
echo $w3easyComment;
###_w3eC_insert-4_end_###
?>


USAGE
User Entries
If the comment review function ($check) is activated, the entry will not be published at once. An email will be sent to the admin containing a link to the entry. Following this link the admin can review, i.e. accept, edit or delete the entry.
To edit an entry, just edit the text in the text area.
To publish an entry, type the admin password in the security field and press "submit".
To reject (=delete) an entry, type the admin password in the security field with a trailing "_del" behind and then press "submit".
If the notify function is activated, the entry will be published at once. An email will be sent to the admin containing a link to the entry.
If neither the review function is activated nor the notify function the entry will be published at once.

Admin Entries
As an admin you can always publish an entry at once. You only have to type the admin password in the security field to publish your entry.

Administration
As an admin you can check about new entries, edit and review them. Moreover you can view and edit the entry file, the config file or you can view the help file.
To access the administration, type the admin user name in the "your name" field and the admin password in the "security" field.
Note: Each admin action has to be confirmed by typing again the password in the security field, also the selection of any file you want to edit or view and also if you want to save your edits.

VERY IMPORTANT:
IF YOU EDIT THE ENTRY FILE, MAKE SURE THAT THE CURSOR WILL STAY EXACTLY AT THE BEGINNING OF AN EMPTY LINE BELOW THE LAST ENTRY AND THAT THERE WILL BE NO WHITE SPACES BEHIND THE CURSOR BEFORE YOU SAVE. OTHERWISE YOUR ENTRY FILE MIGHT GET MESSED UP AT ONCE OR BY THE NEXT ENTRY.


Have fun and take it w3easy...;)

 

Last edit: 2013-08-27 ⊗ 06:00

cms: w3easy | webdesign: w3nord

w3easy.org cms project: clear - modular - solid   facebook

contact | legal | admin