Professional Documents
Culture Documents
Input The Comment Data
Input The Comment Data
01 function addComment($option) 02 { 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 if($user->id) { $row->user_id = $user->id; } $user =& JFactory::getUser(); $row->comment_date = date ( 'Y-m-d H:i:s' ); $row =& JTable::getInstance( 'comment' , 'Table' ); if (!$row->bind(JRequest::get( 'post' ))) { JError::raiseError(500, $row->getError() ); } global $mainframe;
20 21 22 23 24 25 26 27 28 29 30 }
if(!$row->store()) { JError::raiseError(500, $row->getError() ); } $link = JRoute::_( 'index.php?option='.$option. '&id='.$row->book_id . '&task=view' ); $mainframe->redirect( $link, 'Komentar Anda berhasil diinputkan' );
Now, you can try to write the comment and save it.
Picture 8.28 Message if the comment is succeeded in inputted Previous: 8.21 Make the Comment Form Next: 8.23 Publish the Comment