###########################################################
# phpMyCoCo - Count and Comment
# Version: 0.9.9
# Author: Matthias Richter <alhague@penguinpowered.com>
# Date: 20010310
###########################################################
<u>Setup: It's all easy.</u>
1) Optional: Edit <a href="setup.mysql.php4">setup.mysql</a> to set your desired Tablenames.
You are not encouraged to change this file, however, so
only make changes if your really need to do
so.
2) Mandatory: run mysql -u$DBUSER -p $DBNAME < setup.mysql
$DBUSER needs at least CREATE, SELECT, UPDATE und INSERT on $DBNAME
Wondering how to set this up? Snip this:
@-- snip
GRANT
select, insert, update, create
ON
$DBNAME.*
TO
$DBUSER@$DBHOST
IDENTIFIED BY
'$DBPASS';
@-- snip
3) Mandatory: Put the files
* comment.php4
* coco.css
somewhere below your Document Root so that they can
be accessed from the web.
Put all the files from include/ somewhere where they can
be included by the webserver (if you've got the chance:
not below document root. There is a .htaccess-File in
the include/ directory preventing access however, so
putting the files below DocRoot is not too bad)
4) Mandatory: Set vars in include/conf.vars.php4 to reflect your Setup.
COCO_CONF_VARS is essential, COCO_STRINGS only contains
the strings (a german and an english version are available.
If you translate it into different languages, please send
me your strings).
Setting up COCO_CONF_VARS:
* DBHOST,DBUSER,DBPASS,DBNAME :- your database details
* TBACCESS,TBCOUNTER,TBCOMMENT :- Names of the tables.
If you had to change them in <a href="setup.mysql.php4">setup.mysql</a> you need to change
them here as well.
* RELOADTIMEOUT :- How many Seconds should have to pass by
before a pagehit from a distinct IP gets counted again.
* REQUIREMAIL :- set this to "yes" if you
want to use <a href="http://phpclasses.upperdesign.com/browse.html/file/28">email_validation.php</a> from Manuel Lemos <<a href="mailto:mlemos@acm.org">mlemos@acm.org</a>>
This class is not included in <b>phpMyCoCo</b>. But you can
easily use it within <b>phpMyCoCo</b>. Just put the file
email_validation.php into the include/ directory and set
REQUIREMAIL to "yes".
* REQUIRETEXT :- require text to be entered for comments
* TIMESTRING :- how to format time. See <a href="http://www.php.net/manual/en/function.date.php">function.date.php</a>
from the PHP-Manual for details.
* ALLOWED_TAGS :- These tags are allowed in comment texts
* COMMENT / CSSFILE :- URLs to use for comment.php4 and coco.css
* TARGETBLANK :- Set this to "yes" to open a new window
on "read" and "write"
* ORDER_T_COMMENTS :- Order top-level comments by time
LATEST :- newest first
FIRST :- oldest first
* ORDER_S_COMMENTS :- same thing for sub-comments
* PASSWORD :- Require this password to be entered if
comments are to be modified or descriptions are entered
5) Mandatory: You need to tell comment.php4 where its include-files are.
That's what the variable $COCOPATH is for.
You need to put the absolute PATH for the include - directory
into cocopath.
Example: Document-Root on a default installation of the
Apache-Webserver on Debian GNU/Linux is /var/www. Consider I
put the include directory into $DocumentRoot/phpmycoco/include
I have to set $COCOPATH="/var/www/phpmycoco/include"
You can look at $HTTP_SERVER_VARS[SCRIPT_FILENAME] if you do
not have any clue where your include-files are on the server.
6) Mandatory: Include the following Code into any Page you want to be
counted and commented:
@-- snip
<?php
$COCOPATH="< -- what you figured out in 5 -- >";
if(!include("$COCOPATH/coco.main.php4"))
{
echo "Cannot include coco!\n";
}
$coco = new phpMyCoCo;
$coco -> init(); $coco ->
includePageComments();
?>
@-- snip
That's it. If the force is strong with you, no further action will
have to be taken. It it does not work: send me a bugfix / bugreport!
<a href="mailto:alhague@penguinpowered.com">alhague@penguinpowered.com</a>
|