' . oc_('All Threads') . ' » '; printHeader($hdr, $access); // Display paper info print '
'; if (!empty($paperLink)) { print '' . $_REQUEST['thread'] . '. ' . safeHTMLstr($paper['title']) . ''; } else { print $_REQUEST['thread'] . '. ' . safeHTMLstr($paper['title']); } print '
'; // Submit? if (isset($_POST['submit']) && ($uid == 0) && ($_POST['submit'] == 'Delete Checked Posts')) { if (isset($_POST['posts']) && is_array($_POST['posts']) && !empty($_POST['posts'])) { foreach ($_POST['posts'] as $p) { if (ctype_digit($p)) { issueSQL("DELETE FROM `" . OCC_TABLE_MODULE_OC_DISCUSSION_POST . "` WHERE `postid`='" . safeSQLstr($p) . "'"); } } } } // 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`='" . $_REQUEST['thread'] . "' 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 '' . oc_('No comments have been posted yet.') . '
'; } else { print ' '; // Update lastread - Yes, INSERT ON DUPLICATE KEY UPDATE would have been nice $q = "DELETE FROM `" . OCC_TABLE_MODULE_OC_DISCUSSION_READ . "` WHERE `accountid`='" . $uid . "' AND `paperid`='" . $_REQUEST['thread'] . "'"; $r = ocsql_query($q) or err('Unable to update last read post'); $q = "INSERT INTO `" . OCC_TABLE_MODULE_OC_DISCUSSION_READ . "` SET `lastread`='" . $lastpost . "', `accountid`='" . $uid . "', `paperid`='" . $_REQUEST['thread'] . "'"; $r = ocsql_query($q) or err('Unable to update last read post (2)'); } // Display post entry box print '