<?php
/*
-------------------------------------------------------------------------
ArticleComment Class
A class to be used to handle Article Comments.
-------------------------------------------------------------------------
Developer
Name -- Haddad Said.
Date -- 16-08-2005
Version -- 1.0
-------------------------------------------------------------------------
Member Functions
1.edit
2.delete
-------------------------------------------------------------------------
*/
class ArticleComment extends Comment
{
/*
-------------------------------------------------------------------------
Class Constructor
Parameters:
&db
id
Notes:
Example Usage:
-------------------------------------------------------------------------
*/
function ArticleComment(&$db, $id)
{
parent::Entry($db, $id);
$query = "SELECT comment_title, comment_date, comment_body,
comment_name, comment_web, comment_ip
FROM tblArticleComment WHERE comment_id = " . $this->getId();
if($this->result = $this->db->doQuery($query))
{
$row = $this->result->getArray();
$this->setBody($row['comment_body']);
$this->setName($row['comment_name']);
$this->setWeb($row['comment_web']);
$this->setDate($row['comment_date']);
$this->setTitle($row['comment_title']);
$this->setIp($row['comment_ip']);
}
else
{
return false;
}
}
/*
-------------------------------------------------------------------------
Function edit
Parameters:
Notes:
Example Usage:
-------------------------------------------------------------------------
*/
function edit()
{
$query = "UPDATE tblArticleComment
SET comment_body = '" . $this->getBody() ."',
comment_name = '" . $this->getName() . "',
comment_web = '" . $this->getWeb() . "',
comment_title = '" . $this->getTitle() . "'
WHERE comment_id = ". $this->getId();
if($this->result = $this->db->doQuery($query))
{
return true;
}
else
{
return false;
}
}
/*
-------------------------------------------------------------------------
Function delete
Parameters:
Notes:
Example Usage:
-------------------------------------------------------------------------
*/
function delete()
{
return(parent::delete("tblArticleComment", "comment_id"));
}
}
?>