Yes only the PIREPAdmin.php file, try this
public function deletecomment() {
if (!isset($this->post)) {
return;
}
$commentid = DB::escape($this->post->id);
$comment = DB::get_row("SELECT * FROM ".TABLE_PREFIX."pirepcomments WHERE `id` = '$commentid'");
LogData::addLog(Auth::$userinfo->pilotid, 'Deleted a comment to PIREP #: '.$comment->pirepid);
PIREPData::deleteComment($this->post->id);
$this->set('message', 'Comment deleted!');
$this->render('core_success.tpl');
}
The query looks right, I think it might have been deleting the comment and then trying to find it which wouldn't work.
You could also do it this way I would think (that way it will only log it if it has been deleted, but it should do it 99% of the time anyway)
$commentid = DB::escape($this->post->id);
$comment = DB::get_row("SELECT * FROM ".TABLE_PREFIX."pirepcomments WHERE `id` = '$commentid'");
PIREPData::deleteComment($this->post->id);
LogData::addLog(Auth::$userinfo->pilotid, 'Deleted a comment to PIREP #: '.$comment->pirepid);