comment.module

Version 1.853 (checked in on 2010/03/12 at 15:56:29 by dries)

Enables users to comment on published content.

When enabled, the Drupal comment module creates a discussion board for each Drupal node. Users can post comments to discuss a forum topic, weblog post, story, collaborative book page, etc.

Constants

NameDescription
COMMENT_ANONYMOUS_MAYNOT_CONTACTAnonymous posters cannot enter their contact information.
COMMENT_ANONYMOUS_MAY_CONTACTAnonymous posters may leave their contact information.
COMMENT_ANONYMOUS_MUST_CONTACTAnonymous posters are required to leave their contact information.
COMMENT_FORM_BELOWComment form should be shown below post or list of comments.
COMMENT_FORM_SEPARATE_PAGEComment form should be displayed on a separate page.
COMMENT_MODE_FLATComments are displayed in a flat list - expanded.
COMMENT_MODE_THREADEDComments are displayed as a threaded list - expanded.
COMMENT_NODE_CLOSEDComments for this node are closed.
COMMENT_NODE_HIDDENComments for this node are hidden.
COMMENT_NODE_OPENComments for this node are open.
COMMENT_NOT_PUBLISHEDComment is awaiting approval.
COMMENT_PUBLISHEDComment is published.

Functions

NameDescription
comment_accessThis is *not* a hook_access() implementation. This function is called to determine whether the current user has access to a particular comment.
comment_action_infoImplements hook_action_info().
comment_block_configureImplements hook_block_configure().
comment_block_infoImplements hook_block_info().
comment_block_saveImplements hook_block_save().
comment_block_viewImplements hook_block_view().
comment_build_contentBuilds a structured array representing the comment's content.
comment_count_unpublishedReturns a menu title which includes the number of unapproved comments.
comment_deleteDelete a comment and all its replies.
comment_delete_multipleDelete comments and all their replies.
comment_edit_pagePage callback for comment editing.
comment_entity_infoImplements hook_entity_info().
comment_field_extra_fieldsImplements hook_field_extra_fields().
comment_formGenerate the basic commenting form, for appending to a node or display on a separate page.
comment_form_alterImplements hook_form_alter().
comment_form_build_previewBuild a preview from submitted form values.
comment_form_node_type_form_alterImplements hook_form_FORM_ID_alter().
comment_form_submitProcess comment form submissions; prepare the comment, store it, and set a redirection target.
comment_form_submit_build_commentBuild a comment by processing form values and prepare for a form rebuild.
comment_form_validateValidate comment form submissions.
comment_get_display_ordinalGet the display ordinal for a comment, starting from 0.
comment_get_display_pageReturn the page number for a comment.
comment_get_recentFind the most recent comments that are available to the current user.
comment_get_threadRetrieve comments for a thread.
comment_helpImplements hook_help().
comment_linksHelper function, build links for an individual comment.
comment_loadLoad the entire comment by cid.
comment_load_multipleLoad comments from the database.
comment_menuImplements hook_menu().
comment_menu_alterImplements hook_menu_alter().
comment_new_page_countCalculate page number for first new comment.
comment_node_deleteImplements hook_node_delete().
comment_node_insertImplements hook_node_insert().
comment_node_loadImplements hook_node_load().
comment_node_page_additionsBuild the comment-related elements for node detail pages.
comment_node_prepareImplements hook_node_prepare().
comment_node_search_resultImplements hook_node_search_result().
comment_node_type_deleteImplements hook_node_type_delete().
comment_node_type_insertImplements hook_node_type_insert().
comment_node_type_loadMenu loader callback for Field UI paths.
comment_node_type_updateImplements hook_node_type_update().
comment_node_update_indexImplements hook_node_update_index().
comment_node_viewImplements hook_node_view().
comment_num_newGet number of new comments for current user and specified node.
comment_permalinkRedirects comment links to the correct page depending on comment settings.
comment_permissionImplements hook_permission().
comment_prepare_threadLoop over comment thread, noting indentation level.
comment_previewGenerate a comment preview.
comment_publish_actionPublishes a comment.
comment_rankingImplements hook_ranking().
comment_rdf_mappingImplements hook_rdf_mapping().
comment_saveAccepts a submission of new or changed comment content.
comment_save_actionSaves a comment.
comment_submitPrepare a comment for submission.
comment_themeImplements hook_theme().
comment_unpublish_actionUnpublishes a comment.
comment_unpublish_by_keyword_actionUnpublishes a comment if it contains certain keywords.
comment_unpublish_by_keyword_action_formForm builder; Prepare a form for blacklisted keywords.
comment_unpublish_by_keyword_action_submitProcess comment_unpublish_by_keyword_action_form form submissions.
comment_update_indexImplements hook_update_index().
comment_uriEntity uri callback.
comment_user_cancelImplements hook_user_cancel().
comment_user_deleteImplements hook_user_delete().
comment_viewGenerate an array for rendering the given comment.
comment_view_multipleConstruct a drupal_render() style array from an array of loaded comments.
int2vancodeGenerate vancode.
template_preprocess_commentProcess variables for comment.tpl.php.
template_preprocess_comment_wrapperProcess variables for comment-wrapper.tpl.php.
theme_comment_blockReturns a formatted list of recent comments to be displayed in the comment block.
theme_comment_post_forbiddenTheme a "you can't post comments" notice.
vancode2intDecode vancode back to an integer.
_comment_body_field_instance_createHelper function which creates a comment body field instance for a given node type.
_comment_get_modesReturn an array of viewing modes for comment listings.
_comment_per_pageReturn an array of "comments per page" settings from which the user can choose.
_comment_update_node_statisticsUpdates the comment statistics for a given node. This should be called any time a comment is added, deleted, or updated.