*** empty log message ***

svn path=/trunk/boinc/; revision=5118
This commit is contained in:
Rom Walton 2005-01-14 01:54:52 +00:00
parent 5319aaa6ed
commit 25edc20b51
2 changed files with 20 additions and 5 deletions

View File

@ -22678,3 +22678,10 @@ David 13 Jan 2005
schema.sql
html/ops/
db_update.php
Rom 13 Jan 2005
- Checkin the changes nessassary to hide threads in the forum code.
By: Rob Ogilvie
html/inc/
forum.inc

View File

@ -93,8 +93,12 @@ function getForums($categoryID) {
return mysql_query($sql);
}
function getThreads($forumID, $min=-1, $nRec=-1, $sort_style='modified-new') {
function getThreads($forumID, $min=-1, $nRec=-1, $sort_style='modified-new', $filteron = 1) {
/* Calling function: Set $filteron to 0 if it is a moderator reading */
$sql = 'SELECT * FROM thread WHERE forum = ' . $forumID;
if ($filteron) {
$sql .= ' AND hidden = 0';
}
switch($sort_style) {
case 'modified-new':
$sql .= ' ORDER BY timestamp DESC';
@ -136,17 +140,21 @@ function getThreads($forumID, $min=-1, $nRec=-1, $sort_style='modified-new') {
return mysql_query($sql);
}
function getPosts($threadID, $min = -1, $nRec = -1, $sort_style="timestamp") {
function getPosts($threadID, $min = -1, $nRec = -1, $sort_style="timestamp", $filteron = 1) {
/* Calling function: Set $filteron = 0 when it is a moderator reading */
$sql = 'SELECT * FROM post WHERE thread = '. $threadID;
if ($filteron = 1) {
$sql .= ' AND hidden = 0';
}
switch($sort_style) {
case 'timestamp':
$sql = $sql . ' ORDER BY timestamp desc';
$sql .= ' ORDER BY timestamp desc';
break;
case 'timestamp_asc':
$sql = $sql . ' ORDER BY timestamp asc';
$sql .= ' ORDER BY timestamp asc';
break;
case 'score':
$sql = $sql . ' ORDER BY score DESC';
$sql .= ' ORDER BY score DESC';
break;
}