From 8548a2d911e2643a958eeac7f4906c764cd19810 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 30 Apr 2006 00:43:05 +0000 Subject: [PATCH] r774: Adding comment API --- includes/api_comment.php | 100 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 includes/api_comment.php diff --git a/includes/api_comment.php b/includes/api_comment.php new file mode 100644 index 0000000..ff70b9a --- /dev/null +++ b/includes/api_comment.php @@ -0,0 +1,100 @@ +load('api', null); + +/** +* API: Comment +* +* @author Iris Studios, Inc. +* @copyright Copyright ©2002 - [#]year[#], Iris Studios, Inc. +* @version $Revision$ +* @package Bugdar +* +*/ +class CommentAPI +{ + /** + * Fields + * @var array + * @access private + */ + var $fields = array( + 'commentid' => array(TYPE_UINT, REQ_AUTO, 'verify_nozero'), + 'bugid' => array(TYPE_UINT, REQ_YES, 'verify_nozero'), + 'userid' => array(TYPE_UINT, REQ_NO), + 'dateline' => array(TYPE_UINT, REQ_SET), + 'comment' => array(TYPE_STRUN, REQ_YES), + 'comment_parsed' => array(TYPE_STRUN, REQ_SET), + 'hidden' => array(TYPE_BOOL, REQ_NO) + ); + + /** + * Database table + * @var string + * @access private + */ + var $table = 'comment'; + + /** + * Table prefix + * @var string + * @access private + */ + var $prefix = TABLE_PREFIX; + + // ################################################################### + /** + * Set field: dateline + * + * @access private + */ + function set_dateline() + { + $this->set('dateline', time()); + } + + // ################################################################### + /** + * Set field: comment_parsed + * + * @access private + */ + function set_comment_parsed() + { + if (!$this->registry->options['allowhtml']) + { + $this->set('comment_parsed', $this->registry->sanitize($this->values['comment'])); + } + else + { + $this->set('comment_parsed', $this->values['comment']); + } + } +} + +/*=====================================================================*\ +|| ################################################################### +|| # $HeadURL$ +|| # $Id$ +|| ################################################################### +\*=====================================================================*/ +?> \ No newline at end of file -- 2.22.5