Own programs






Short tutorial

Post comment (Allready 8)


The PHP-Class with the imaginative title "Comments" is for providing a comment function to websites. It's used here down at the comments (duh). It supports multiple levels of comments, email notification (if the server allows it), works without a database and is bilangual, english and german.
All HTML-anchors and POST-variables used by Comments have the prefix "comments_" to not interfere with the rest of the site.

Back to contents

Short tutorial

Firstly, put the file "comment.php" in it's own directory that has the right flags set to allow it to make new files. Then put the following code in front of the place where you first want to use it:

	include '../comments/comment.php';
	$comments = new Comments('en', 'descriptor', '', "Klaue's homepage");

The include-path is obviously to be replaced with the real one. The parameters for the constructor are: The language ("en" or "de), an unique descriptor for the actual page (Comments will generate a file with this descriptor as its name, so do not use paths or special chars), the email-adress of the admin (for notification for new comments) and the name of the webpage (for the email-notification to users.
The actual number of comments is accessed through the function "getNumOfComments" and therefore displayed, for example, like this: <?=$comments->getNumOfComments()?>.
Lastly, in the place of your site where you want to have the comments, add this code:
<?php $comments->displayComments(10, 5, false); ?>
The parameters are: Number of top-level-comments to display (answers to comments are excluded), the maximum comment level (the "depth" of the comment tree) and if the form for new comments should be at the top (true) or at the bottom (false).

Back to contents


Comments (3.3 KB, zip)

Back to contents


#6 kols wrote at 12/19/2011 11:12 AM (EST):

#7 Klaue wrote at 05/25/2012 08:13 PM (EST):

#5 kols wrote at 12/18/2011 11:06 PM (EST):

#4 long wigs wrote at 08/23/2011 03:29 AM (EST):
Your concepts were easy to understand that I wondered why I never looked at it before. <a href="">how to make hand tied wigs</a>

#3 sliqkbasz wrote at 12/26/2010 06:58 PM (EST):
8KfgYW <a href="">glqsayvlynra</a>, [url=]urdfqkmmpdmx[/url], [link=]cefibxdiwjpy[/link],

#1 Inkognito wrote at 02/10/2010 02:33 PM (EST):

Möglicherweise wäre eines dieser Haloscanalternativen noch nützlich
(auch wenns wohl leider etwas spät kommt):

#2 Klaue wrote at 02/10/2010 09:30 PM (EST):
Ja, das ist ein klein wenig zu spät ;)
Aber naja, ist sowieso besser so - ein Service weniger, von dem ich abhängig bin

#0 Klaue wrote at 02/10/2010 11:53 AM (EST):
Example Comment

Add comment


(Optional, hidden. Only if you want to be notified of replies)


* Spam check: 7 * 9 =

Back to contents