[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/dao/ -> commentscommon.class.php (sommaire)

different orders that comments can have

Poids: 563 lignes (20 kb)
Inclus ou requis:0 fois
Référencé: 5 fois
Nécessite: 0 fichiers

Définit 1 class

CommentsCommon:: (13 méthodes):
  CommentsCommon()
  addComment()
  getPostComments()
  getNumPostComments()
  getNumBlogComments()
  deleteComment()
  updateComment()
  getComment()
  getBlogComments()
  mapRow()
  getSearchConditions()
  deleteBlogComments()
  deleteArticleComments()


Classe: CommentsCommon  - X-Ref

\ingroup DAO

Since comments and trackbacks are now in the same table, this class contains all the
common code needed to deal with these items. Most of the methods are exactly the same in both
ArticleComments and Trackbacks except that they take an additional parameter called 'status'
which can either be

- COMMENT_TYPE_COMMENT
- COMMENT_TYPE_TRACKBACK
- COMMENT_TYPE_ANY

Depending on whether we'd like to retrieve a trackback or a comment.
CommentsCommon()   X-Ref
Pas de description

addComment( &$comment )   X-Ref
Adds a comment to an article

param: comment the UserComment object that we're going to add.
return: Returns true if successful or false if error. Also in case of success, it will modify the UserComment

getPostComments( $artid, $order = COMMENT_ORDER_NEWEST_FIRST, $status = COMMENT_STATUS_ALL, $type = COMMENT_TYPE_ANY, $page = -1, $itemsPerPage = DEFAULT_ITEMS_PER_PAGE )   X-Ref
Retrieves all the comments for a post

param: artid The article identifier
param: order The order in which comments should be retrieved
param: status The status that the comment should have, use COMMENT_STATUS_ALL for
param: page
param: itemsPerPage
return: False if error or an array of ArticleComments objects

getNumPostComments( $artId, $status = COMMENT_STATUS_ALL, $type = COMMENT_TYPE_ANY )   X-Ref
Returns the total number of comments for a post

param: artId the post id
param: status
return: The number of comments

getNumBlogComments( $blogId, $status = COMMENT_STATUS_ALL, $type = COMMENT_TYPE_ANY, $searchTerms = "" )   X-Ref
returns the number of comments that a blog has

param: blogId
param: status
param: type
param: searchTerms
return: The number of comments, or 0 if error or no comments

deleteComment( $commentid )   X-Ref
Removes a comment from a post. It also updates all the other posts that
have this one as the parent and makes them look as if they were 'top level'
comments with no parent.

param: artid The article identifier.
param: commentid The comment identifier.

updateComment( $comment )   X-Ref
Updates a comment. It also takes into account status changes and updates counters in
the blogs and articles table accordingly.

param: comment An UserComment object
return: true if update successful or false otherwise.

getComment( $id, $type = COMMENT_TYPE_ANY )   X-Ref
returns a single comment, identified by its identifier

param: type

getBlogComments( $blogId, $order = COMMENT_ORDER_NEWEST_FIRST, $status = COMMENT_STATUS_ALL, $type = COMMENT_TYPE_ANY, $searchTerms = "", $page = -1, $itemsPerPage = DEFAULT_ITEMS_PER_PAGE )   X-Ref
returns the comments received in the blog

param: blogId
param: order
param: status
param: type
param: searchTerms
param: page
param: itemsPerPage
return: An array of ArticleComment objects

mapRow( $row )   X-Ref


getSearchConditions( $searchTerms )   X-Ref

param: searchTerms

deleteBlogComments( $blogId )   X-Ref
Delete all the blog comments


deleteArticleComments( $articleId )   X-Ref
Delete all the article comments

param: blogId



Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics