$result=pager_query('SELECT c.subject, c.nid, c.cid, c.comment, c.timestamp, c.status, c.name, c.homepage, u.name AS registered_name, u.uid, n.title as node_title FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid INNER JOIN {node} n ON n.nid = c.nid WHERE c.status = %d'.tablesort_sql($form['header']['#value']),50,0,NULL,$status);
// build a table listing the appropriate comments
// Build a table listing the appropriate comments.
@@ -213,12 +241,11 @@ function comment_multiple_delete_confirm_submit($form, &$form_state) {
* Menu callback; delete a comment.
*
* @param $cid
* The comment do be deleted.
* The comment to be deleted.
*/
functioncomment_delete($cid=NULL){
$comment=db_fetch_object(db_query('SELECT c.*, u.name AS registered_name, u.uid FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid WHERE c.cid = %d',$cid));
$comment=db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d',$cid));
@@ -69,10 +68,10 @@ function comment_reply($node, $pid = NULL) {
else{
// $pid indicates that this is a reply to a comment.
if($pid){
// load the comment whose cid = $pid
// Load the comment whose cid = $pid
if($comment=db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.signature, u.picture, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = %d',$pid,COMMENT_PUBLISHED))){
// If that comment exists, make sure that the current comment and the parent comment both
// belong to the same parent node.
// If that comment exists, make sure that the current comment and the
// parent comment both belong to the same parent node.
if($comment->nid!=$node->nid){
// Attempting to reply to a comment not belonging to the current nid.
drupal_set_message(t('The comment you are replying to does not exist.'),'error');