| [ Index ] |
|
Code source de LifeType 1.2.4 |
1 <?php 2 3 lt_include( PLOG_CLASS_PATH."class/dao/commentscommon.class.php" ); 4 lt_include( PLOG_CLASS_PATH."class/dao/usercomment.class.php" ); 5 6 /** 7 * \ingroup DAO 8 * 9 * Model for the comments each article can have 10 */ 11 class ArticleComments extends CommentsCommon 12 { 13 14 function ArticleComments() 15 { 16 $this->CommentsCommon(); 17 } 18 19 /** 20 * Retrieves all the comments for a post 21 * 22 * @param artid The article identifier 23 * @param order The order in which comments should be retrieved 24 * @param status The status that the comment should have, use COMMENT_STATUS_ALL for 25 * all possible statuses 26 * @param page 27 * @param itemsPerPage 28 * @return False if error or an array of ArticleComments objects 29 */ 30 function getPostComments( $artid, $order = COMMENT_ORDER_NEWEST_FIRST, $status = COMMENT_STATUS_ALL, $page = -1, $itemsPerPage = DEFAULT_ITEMS_PER_PAGE ) 31 { 32 return( CommentsCommon::getPostComments( $artid, $order, $status, COMMENT_TYPE_COMMENT, $page, $itemsPerPage )); 33 } 34 35 /** 36 * Returns the total number of comments for a post 37 * 38 * @param artId the post id 39 * @param status 40 * @return The number of comments 41 */ 42 function getNumPostComments( $artId, $status = COMMENT_STATUS_ALL ) 43 { 44 return( CommentsCommon::getNumPostComments( $artId, $status, COMMENT_TYPE_COMMENT )); 45 46 } 47 48 /** 49 * Returns true if there already is a comment in the database with the same 50 * article_id field, topic, text, replying to the same comment, username and so on 51 * Useful in case we want to check if the user sent the same comment by mistake 52 * by pressing the 'reload' button twice or something... 53 * 54 * @return Returns true if there already is such comment or false otherwise. 55 */ 56 function getIdenticalComment( $topic, $text, $articleId, $parentId = 0, $userName = "", $userEmail = "", $userUrl = "", $clientIp = "0.0.0.0" ) 57 { 58 return( CommentsCommon::getIdenticalComment( $topic, $text, $articleId, 59 $parentId, $userName, $userEmail, 60 $userUrl, $clientIp, COMMENT_TYPE_COMMENT )); 61 } 62 63 /** 64 * removes all comments marked as spam from the database 65 */ 66 // TODO: CommentsCommon::purgeSpamComments doesn't exist, 67 // maybe copy it from purgedata.class.php? 68 function purgeSpamComments() 69 { 70 return( CommentsCommon::purgeSpamComments( COMMENT_TYPE_COMMENT )); 71 } 72 73 74 /** 75 * returns a single comment, identified by its... identifier :) 76 */ 77 function getComment( $id ) 78 { 79 return( CommentsCommon::getComment( $id, COMMENT_TYPE_COMMENT )); 80 } 81 82 /** 83 * returns the lastest $maxItems comments received in the blog 84 * 85 * @param blogId 86 * @param order 87 * @param status 88 * @param searchTerms, 89 * @param page 90 * @param itemsPerPage 91 * @return An array of ArticleComment objects 92 */ 93 function getBlogComments( $blogId, $order = COMMENT_ORDER_NEWEST_FIRST, $status = COMMENT_STATUS_ALL, $searchTerms = "", $page = -1, $itemsPerPage = DEFAULT_ITEMS_PER_PAGE ) 94 { 95 return( CommentsCommon::getBlogComments( $blogId, $order, $status, COMMENT_TYPE_COMMENT, $searchTerms, $page, $itemsPerPage )); 96 } 97 98 /** 99 * Returns the total number of comments for a given blog 100 * 101 * @param artId the post id 102 * @param status 103 * @param type 104 * @param searchTerms 105 * @return The number of comments 106 */ 107 function getNumBlogComments( $blogId, $status = COMMENT_STATUS_ALL, $type = COMMENT_TYPE_ANY, $searchTerms = "" ) 108 { 109 return( CommentsCommon::getNumBlogComments( $blogId, $status, $type, $searchTerms )); 110 } 111 112 } 113 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Mon Nov 26 21:04:15 2007 | par Balluche grâce à PHPXref 0.7 |
|