diff -r 4042c4dd5ba4 -r 1c7f59df9474 includes/comment.php --- a/includes/comment.php Tue Aug 28 19:00:20 2007 -0400 +++ b/includes/comment.php Wed Aug 29 18:23:37 2007 -0400 @@ -106,11 +106,15 @@ { $ret['template'] = file_get_contents(ENANO_ROOT . '/themes/' . $template->theme . '/comment.tpl'); } - $q = $db->sql_query('SELECT c.comment_id,c.name,c.subject,c.comment_data,c.time,c.approved,u.user_level,u.user_id,u.signature FROM '.table_prefix.'comments AS c + $q = $db->sql_query('SELECT c.comment_id,c.name,c.subject,c.comment_data,c.time,c.approved,u.user_level,u.user_id,u.signature, b.buddy_id IS NOT NULL AS is_buddy, ( b.is_friend IS NOT NULL AND b.is_friend=1 ) AS is_friend FROM '.table_prefix.'comments AS c LEFT JOIN '.table_prefix.'users AS u ON (u.user_id=c.user_id) + LEFT JOIN '.table_prefix.'buddies AS b + ON ( ( b.user_id=' . $session->user_id.' AND b.buddy_user_id=c.user_id ) OR b.user_id IS NULL) WHERE page_id=\'' . $this->page_id . '\' - AND namespace=\'' . $this->namespace . '\';'); + AND namespace=\'' . $this->namespace . '\' + GROUP BY c.comment_id + ORDER BY c.time ASC;'); $count_appr = 0; $count_total = 0; $count_unappr = 0; @@ -134,6 +138,18 @@ // Format text $row['comment_data'] = RenderMan::render($row['comment_data']); + if ( $row['is_buddy'] == 1 && $row['is_friend'] == 0 ) + { + $seed = md5(sha1(mt_rand() . microtime())); + $wrapper = ' + +

Post from foe hidden. Display post

+ '; + $row['comment_data'] = $wrapper; + } + // Format date $row['time'] = date('F d, Y h:i a', $row['time']);