1
25

Comments

All the nodes in a thread can receive comments.

Your comment:
[p] [b] [i] [u] [s] [quote] [pre] [br] [code] [url] [email] strip help 2000

Enter a maximum of 2000 characters.
Improve the presentation of your text with the following formatting tags:
[p]paragraph[/p], [b]bold[/b], [i]italics[/i], [u]underline[/u], [s]strike[/s], [quote]citation[/quote], [pre]as is[/pre], [br]line break,
[url]http://www.izend.org[/url], [url=http://www.izend.org]site[/url], [email]izend@izend.org[/email], [email=izend@izend.org]izend[/email],
[code]command[/code], [code=language]source code in c, java, php, html, javascript, xml, css, sql, bash, dos, make, etc.[/code].

See the function bbcode defined by the library which is used to format the text of a comment.

If you don't want to format code in comments, hide the button [code] and the help message about the [code] tag in the views editcomment.phtml and disable the analysis of the [code] tag in the function bbcode.

editcomment.phtml
  1. <?php if (false): ?>
  2. <span class="btn_edit btn_php" title="code" onclick="tagcomment('[code]','[/code]')">[code]</span>
  3. <?php endif; ?>
  1. <?php if (false): ?>
  2. [<b>code</b>]command[/code], [<b>code</b>=language]source code in c, java, php, html, javascript, xml, css, sql, bash, dos, make, etc.[/code].
  3. <?php endif; ?>
  4. </p>
bbcode.php
  1. //      '#\[code\=(.+?)\](.+?)\[/code\]#is'     => function($m) { return bbcode_highlite($m[2], $m[1]); },
  2. //      '#\[code\](.+?)\[/code\]#is'            => function($m) { return bbcode_highlite($m[1]); },

Comments are saved in the table comment of the database.

CREATE TABLE `comment` (
  `comment_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `node_id` INT(10) UNSIGNED NOT NULL,
  `locale` enum('en','fr') NOT NULL DEFAULT 'en',
  `created` datetime NOT NULL,
  `edited` datetime NOT NULL,
  `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
  `user_mail` VARCHAR(100) DEFAULT NULL,
  `ip_address` INT(10) UNSIGNED NOT NULL,
  `text` text NOT NULL,
  `confirmed` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`comment_id`),
  KEY `NODE` (`node_id`,`locale`)
) DEFAULT CHARSET=utf8;

comment_id is the identification number of a comment, the primary key of the table. node_id points to the node associated to the comment comment_id. locale gives the comment and the node language. created and edited register the date and the time of the creation and the last modification of a comment. user_id points to the user who has created the comment. If the comment was created by an anonymous visitor, user_id is 0. user_mail gives the email address of the author of the comment. user_mail is normally NULL if user_id isn't 0. ip_address writes down the IP address of the system which created the comment. text is the content of the comment. confirmed indicates whether the comment is confirmed. A comment is normally automatically confirmed when the author is identified or after a validation by email.

Connect as an administrator. Edit a node. Check the option comment to display the comments on the node and the option comment+ to allow adding comments to the node.

Options

To allow or to block displaying or adding comments for an entire thread, check or uncheck the options commenter and commenter+ at the thread level.

Options

Comments and the input form for a new comment are displayed at the end of the content of a node. NOTE: When a node is viewed in the editor, comments are not displayed. Pressing Comment displays the formatted comment above the input field and the buttons Edit and Validate.

Your comment:

Let me try a comment on iZend!

[p] [b] [i] [u] [s] [quote] [pre] [br] [code] [url] [email] strip help 1924

Enter a maximum of 2000 characters.
Improve the presentation of your text with the following formatting tags:
[p]paragraph[/p], [b]bold[/b], [i]italics[/i], [u]underline[/u], [s]strike[/s], [quote]citation[/quote], [pre]as is[/pre], [br]line break,
[url]http://www.izend.org[/url], [url=http://www.izend.org]site[/url], [email]izend@izend.org[/email], [email=izend@izend.org]izend[/email],
[code]command[/code], [code=language]source code in c, java, php, html, javascript, xml, css, sql, bash, dos, make, etc.[/code].

the text or it

Pressing Edit updates the formatted comment. Pressing Validate saves the comment in the database and sends a notification email to the address defined by the paramater $webmaster in the file config.inc with the subject comment@sitename.net:

127.0.0.1 2018-09-05 00:07:32 1 en 4 /en/comments
Validation

To add a comment, in the default configuration, a visitor must be identified.

Commentaires

To add a comment, click here.

The link sends back to the identification back with a return to the original page.

To change the behavior of the comment input form, edit the block nodecomment.

nodecomment.php
  1. function nodecomment($lang, $node_id, $node_user_id, $node_url, $nomore) {
  2.     $user_id=user_profile('id');
  3.     $is_moderator=user_has_role('moderator');   // $user_id == $node_user_id || user_has_role('moderator')
  4.  
  5.     $now=time();
  6.  
  7.     $message_maxlen=2000;
  8.  
  9.     $with_validation=!$user_id;
  10.     $with_mail=$with_validation;
  11.  
  12.     $with_captcha=false;

By default, $with_validation is set to false. Set this variable to !$user_id to activate the validation process if the visitor is not identified. IMPORTANT: The option $with_mail must be on if $with_validation is true. Set $with_captcha to true to ask the user to copy a verification code in order to screen attacks by robots. Note the parameter $message_maxlen which defines the maximum length of a comment.

When the option $with_mail is activated, the confirmation of a comment is completed with the input of an email address:

Your comment:

Let me try a comment on iZend!

[p] [b] [i] [u] [s] [quote] [pre] [br] [code] [url] [email] strip help 1924

Enter a maximum of 2000 characters.
Improve the presentation of your text with the following formatting tags:
[p]paragraph[/p], [b]bold[/b], [i]italics[/i], [u]underline[/u], [s]strike[/s], [quote]citation[/quote], [pre]as is[/pre], [br]line break,
[url]http://www.izend.org[/url], [url=http://www.izend.org]site[/url], [email]izend@izend.org[/email], [email=izend@izend.org]izend[/email],
[code]command[/code], [code=language]source code in c, java, php, html, javascript, xml, css, sql, bash, dos, make, etc.[/code].

Enter your email address to validate your message.

the text or it

The notification email sent to $webmaster contains the email address associated with the new comment:

127.0.0.1 2018-09-05 00:07:32 0 en 4 /en/comments frasq@frasq.org

When the option $with_validation is activated, an email with the subject Your comment is sent to the specified address with an encrypted link to the action confirmcomment with the node number, the comment number and the locale of the comment as parameters. When the user clicks on the link, confirmcomment will set the field confirmed of the comment in the database to true.

Validation

Your comment is published.

When the user confirms a comment, it's displayed with a button to modify it.

Your comment:

September 6, 2018 at 13:54

Let me try a comment on iZend!

The author of a comment can modify or delete it for 20 minutes. A moderator can always modify or delete a comment.

If the comment isn't confirmed, an alert is displayed.

Your comment:

September 6, 2018 at 13:54 -

Let me try a comment on iZend!

If the comment was entered by an identified user, the user's name and avatar are displayed.

Your comment:

September 6, 2018 at 13:54 by izend 

Let me try a comment on iZend!

A comment which is not confirmed isn't displayed anymore to its author after 20 minutes.

When a comment is modified, the same input interface is displayed with the buttons Modify and Delete.

Your comment:

Let me try a comment on iZend!

[p] [b] [i] [u] [s] [quote] [pre] [br] [code] [url] [email] strip help 1924

Enter a maximum of 2000 characters.
Improve the presentation of your text with the following formatting tags:
[p]paragraph[/p], [b]bold[/b], [i]italics[/i], [u]underline[/u], [s]strike[/s], [quote]citation[/quote], [pre]as is[/pre], [br]line break,
[url]http://www.izend.org[/url], [url=http://www.izend.org]site[/url], [email]izend@izend.org[/email], [email=izend@izend.org]izend[/email],
[code]command[/code], [code=language]source code in c, java, php, html, javascript, xml, css, sql, bash, dos, make, etc.[/code].

the comment or it

When a node is deleted, the comments which are associated to it are automatically deleted.

See the functions node_add_comment, node_delete_comment, node_set_comment, node_get_comment, node_get_all_comments and node_confirm_comment defined in the model node.inc, the action confirmcomment and the functions emailconfirmcomment and bbcode defined by the library.

Comments

Your comment:
[p] [b] [i] [u] [s] [quote] [pre] [br] [code] [url] [email] strip help 2000

Enter a maximum of 2000 characters.
Improve the presentation of your text with the following formatting tags:
[p]paragraph[/p], [b]bold[/b], [i]italics[/i], [u]underline[/u], [s]strike[/s], [quote]citation[/quote], [pre]as is[/pre], [br]line break,
[url]http://www.izend.org[/url], [url=http://www.izend.org]site[/url], [email]izend@izend.org[/email], [email=izend@izend.org]izend[/email],
[code]command[/code], [code=language]source code in c, java, php, html, javascript, xml, css, sql, bash, dos, make, etc.[/code].