diff options
author | Dries Buytaert <dries@buytaert.net> | 2000-11-07 08:58:36 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2000-11-07 08:58:36 +0000 |
commit | ed1a244398d83e6232469d5f7dfae2b82ecfde9b (patch) | |
tree | 742e19f9b4663446616e3cbc18cd106087511d37 /includes/function.inc | |
parent | e1130946c83fa6de65fdb8083f78fcfd33eacf19 (diff) | |
download | brdo-ed1a244398d83e6232469d5f7dfae2b82ecfde9b.tar.gz brdo-ed1a244398d83e6232469d5f7dfae2b82ecfde9b.tar.bz2 |
- fixed bug in backend.inc
(check http://www.drop.org/backend.php)
- update theme.inc to use widget.inc
- small enhancements to function.inc
Diffstat (limited to 'includes/function.inc')
-rw-r--r-- | includes/function.inc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/includes/function.inc b/includes/function.inc index 1331a21e6..0215955d0 100644 --- a/includes/function.inc +++ b/includes/function.inc @@ -15,7 +15,6 @@ function load_theme() { else { include $themes[key($themes)][0]; } - return new Theme(); } @@ -41,13 +40,16 @@ function discussion_num_replies($id, $count = 0) { function discussion_num_filtered($sid, $pid) { global $user; + $threshold = ($user->id) ? $user->threshold : "0"; + $pid = ($pid) ? $pid : 0; + $result = db_query("SELECT COUNT(cid) FROM comments WHERE sid = $sid AND pid = $pid AND (votes != 0 AND score / votes < $threshold)"); return ($result) ? db_result($result, 0) : 0; } -function format_plural($count, $one, $more) { - return ($count == 1) ? "$count $one" : "$count $more"; +function format_plural($count, $singular, $plural) { + return ($count == 1) ? "$count $singular" : "$count $plural"; } function format_date($timestamp, $type = "medium") { |