query("SELECT * FROM feedback WHERE CommentID = '{$sql['cid']}'", SQL_INIT, SQL_ASSOC); $comment = $db->record; $tpl->assign('comment',$comment); } // Get whether helpful or not... if (isset($_GET['r'])) { switch ($_GET['r']) { case 'yes': $clean['r'] = 'yes'; $clean['helpful'] = 'helpful'; break; case 'no': $clean['r'] = 'no'; $clean['helpful'] = 'not helpful'; break; } } // If our form was submitted, try to process the results. $success = $db->query(" UPDATE feedback SET `helpful-{$clean['r']}` = `helpful-{$clean['r']}` + 1 WHERE CommentID = {$sql['cid']} ", SQL_NONE); if ($success) { $tpl->assign('success',true); } else { triggerError('Query failed. Could not enter comment rating.'); } $tpl->assign( array( 'title' => 'Rate a Comment for ' . $addon->Name, 'content' => 'ratecomment.tpl', 'addon' => $addon, 'clean' => $clean, 'sidebar' => 'inc/addon-sidebar.tpl') ); ?>