Discussion: '; // Get posts $q = "SELECT `" . OCC_TABLE_MODULE_OC_DISCUSSION_POST . "`.*, CONCAT_WS(' ',`" . OCC_TABLE_REVIEWER . "`.`name_first`, `" . OCC_TABLE_REVIEWER . "`.`name_last`) AS `name`, `" . OCC_TABLE_REVIEWER . "`.`email` FROM `" . OCC_TABLE_MODULE_OC_DISCUSSION_POST . "` LEFT JOIN (`" . OCC_TABLE_REVIEWER . "`) ON (`" . OCC_TABLE_MODULE_OC_DISCUSSION_POST . "`.`accountid`=`" . OCC_TABLE_REVIEWER . "`.`reviewerid`) WHERE `" . OCC_TABLE_MODULE_OC_DISCUSSION_POST . "`.`paperid`='" . $pid . "' ORDER BY `" . OCC_TABLE_MODULE_OC_DISCUSSION_POST . "`.`time` ASC"; $r = ocsql_query($q) or err('Unable to retrieve posts'); if (mysql_num_rows($r) == 0) { print '
No comments have been posted.
'; } else { // Display posts $lastpost = 0; // track last post while ($l = mysql_fetch_assoc($r)) { $lastpost = $l['postid']; print '