Comments_model
Comments_model is used to create and manage posts (blog).
Beta: This is an Beta model. It can be changed anytime.
Functions:
- ReadComments($URLTitle)
- SaveComment()
- UpdateComment($comment_id,$page_id)
- DeleteComment($comment_id,$page_id)
- ListAllComments($pageid=1)
Comments_model Function Reference
$this->Comments_model->ReadComments($URLTitle)
Read comments for $URLTitle condition.Output will be a string.
Output
<a name="comments" id="comments"></a>
<div id="user-comments">
<h2>User Comments</h2>';
{
<a name="comments'.$row->CommentID.'" id="comments'.$row->CommentID.'"></a>
<div class="guest"><p>'.$link.' on '.$date.'</p>
<p>'.$row->Content.'</p></div>';
'<a name="comments'.$row->CommentID.'" id="comments'.$row->CommentID.'"></a>
<div class="member"><p>'.$link.' on '.$date.' - '.anchor('users/ViewProfile/'.$member['MemberID'],'View Profile').'</p>
<p>'.$row->Content.'</div></p>';
}
</div>
Brackets show loop for content. You can customize this for custom themes.
$this->Comments_model->SaveComment()
Capture the posted data using input class. Store this data into database.No argument.
$this->Comments_model->UpdateComment($comment_id,$page_id)
Grab the posted data using input class. Updates an already existing data entry of id $comment_id and redirects it to $page_id .
$this->Comments_model->DeleteComment($comment_id,$page_id)
Deletes an already existing data entry of id $comment_id and redirects it to $page_id
$this->Comments_model->ListAllComments($pageid=1)
Show the all post entries into a tabular form with values.
Comment ID | Posted In | Comment | Edit | Delete
Final Collection
$this->load->model('Comments_model');
$this->Comments_model->ReadComments($URLTitle);
$this->Comments_model->SaveComment();
$this->Comments_model->UpdateComment($comment_id,$page_id);
$this->Comments_model->DeleteComment($comment_id,$page_id);
$this->Comments_model->ListAllComments($pageid=1);