diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-05-01 09:22:16 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-05-01 09:22:16 +0000 |
commit | f27d1b7b78634126d39dbe805036b2c3718ed523 (patch) | |
tree | 44471421588770839dfabf1bae53be788bd876f0 /modules | |
parent | 7332215a088436f1a232888e1c905fa4b69ec21d (diff) | |
download | brdo-f27d1b7b78634126d39dbe805036b2c3718ed523.tar.gz brdo-f27d1b7b78634126d39dbe805036b2c3718ed523.tar.bz2 |
- Bug #7135: fixed saving of comment viewing options in PostgreSQL. Patch by Adrian.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/comment.module | 5 | ||||
-rw-r--r-- | modules/comment/comment.module | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/modules/comment.module b/modules/comment.module index daa14b9e5..6311f983e 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -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) { diff --git a/modules/comment/comment.module b/modules/comment/comment.module index daa14b9e5..6311f983e 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -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) { |