mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=5118
This commit is contained in:
parent
5319aaa6ed
commit
25edc20b51
|
@ -22678,3 +22678,10 @@ David 13 Jan 2005
|
||||||
schema.sql
|
schema.sql
|
||||||
html/ops/
|
html/ops/
|
||||||
db_update.php
|
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
|
||||||
|
|
|
@ -93,8 +93,12 @@ function getForums($categoryID) {
|
||||||
return mysql_query($sql);
|
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;
|
$sql = 'SELECT * FROM thread WHERE forum = ' . $forumID;
|
||||||
|
if ($filteron) {
|
||||||
|
$sql .= ' AND hidden = 0';
|
||||||
|
}
|
||||||
switch($sort_style) {
|
switch($sort_style) {
|
||||||
case 'modified-new':
|
case 'modified-new':
|
||||||
$sql .= ' ORDER BY timestamp DESC';
|
$sql .= ' ORDER BY timestamp DESC';
|
||||||
|
@ -136,17 +140,21 @@ function getThreads($forumID, $min=-1, $nRec=-1, $sort_style='modified-new') {
|
||||||
return mysql_query($sql);
|
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;
|
$sql = 'SELECT * FROM post WHERE thread = '. $threadID;
|
||||||
|
if ($filteron = 1) {
|
||||||
|
$sql .= ' AND hidden = 0';
|
||||||
|
}
|
||||||
switch($sort_style) {
|
switch($sort_style) {
|
||||||
case 'timestamp':
|
case 'timestamp':
|
||||||
$sql = $sql . ' ORDER BY timestamp desc';
|
$sql .= ' ORDER BY timestamp desc';
|
||||||
break;
|
break;
|
||||||
case 'timestamp_asc':
|
case 'timestamp_asc':
|
||||||
$sql = $sql . ' ORDER BY timestamp asc';
|
$sql .= ' ORDER BY timestamp asc';
|
||||||
break;
|
break;
|
||||||
case 'score':
|
case 'score':
|
||||||
$sql = $sql . ' ORDER BY score DESC';
|
$sql .= ' ORDER BY score DESC';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue