- Bug #7135: fixed saving of comment viewing options in PostgreSQL. Patch by Adrian.

4.5.x
Dries Buytaert 2004-05-01 09:22:16 +00:00
parent 7332215a08
commit f27d1b7b78
2 changed files with 8 additions and 2 deletions

View File

@ -516,7 +516,6 @@ function comment_render($node, $cid = 0) {
if (empty($order)) {
$order = $user->sort ? $user->sort : ($_SESSION["comment_sort"] ? $_SESSION["comment_sort"] : variable_get("comment_default_order", 1));
}
if (empty($threshold)) {
$threshold = $user->threshold ? $user->threshold : ($_SESSION["comment_threshold"] ? $_SESSION["comment_threshold"] : variable_get("comment_default_threshold", 0));
}
@ -1303,9 +1302,13 @@ function theme_comment_threshold($threshold) {
while ($filter = db_fetch_object($result)) {
$filters .= " <option value=\"$filter->fid\"". ($threshold == $filter->fid ? " selected=\"selected\"" : "") .">". t($filter->filter) ."</option>";
}
if ($filters) {
return "<select name=\"threshold\">$filters</select>\n";
}
else {
return "<input type=\"hidden\" name=\"threshold\" value=\"$threshold\" />\n";
}
}
function theme_comment_controls($threshold = 1, $mode = 3, $order = 1, $comments_per_page = 50) {

View File

@ -516,7 +516,6 @@ function comment_render($node, $cid = 0) {
if (empty($order)) {
$order = $user->sort ? $user->sort : ($_SESSION["comment_sort"] ? $_SESSION["comment_sort"] : variable_get("comment_default_order", 1));
}
if (empty($threshold)) {
$threshold = $user->threshold ? $user->threshold : ($_SESSION["comment_threshold"] ? $_SESSION["comment_threshold"] : variable_get("comment_default_threshold", 0));
}
@ -1303,9 +1302,13 @@ function theme_comment_threshold($threshold) {
while ($filter = db_fetch_object($result)) {
$filters .= " <option value=\"$filter->fid\"". ($threshold == $filter->fid ? " selected=\"selected\"" : "") .">". t($filter->filter) ."</option>";
}
if ($filters) {
return "<select name=\"threshold\">$filters</select>\n";
}
else {
return "<input type=\"hidden\" name=\"threshold\" value=\"$threshold\" />\n";
}
}
function theme_comment_controls($threshold = 1, $mode = 3, $order = 1, $comments_per_page = 50) {