Commit f27d1b7b authored by Dries's avatar Dries
Browse files

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

parent 7332215a
......@@ -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) {
......
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment