diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-01-20 12:20:31 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-01-20 12:20:31 +0000 |
commit | 2952d16f78eea91724760f526504010cb8f796a9 (patch) | |
tree | 21598276fd9bc316be320308c5cd8eeafa77c12d /includes/function.inc | |
parent | 53b92a614a9e30b693760b8299342f9bfb01320b (diff) | |
download | brdo-2952d16f78eea91724760f526504010cb8f796a9.tar.gz brdo-2952d16f78eea91724760f526504010cb8f796a9.tar.bz2 |
- updated/improved discussion engine: it needs additional fine-tuning
though but I think this is stable enough for public consumption and
real-life testing.
==> a first big step towards a flexible comment engine.
IMPORTANT:
- Required theme updatins:
UnConeD: check your $theme->controls() as I added a very, very
dummy implementation
- Required database updates:
alter table users modify mode tinyint(1) DEFAULT '' NOT NULL;
alter table comments change sid lid int(6) DEFAULT '0' NOT NULL;
alter table comments add link varchar(16) DEFAULT '' NOT NULL;
update comments set link = 'story';
Diffstat (limited to 'includes/function.inc')
-rw-r--r-- | includes/function.inc | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/includes/function.inc b/includes/function.inc index 71276e780..e564b3149 100644 --- a/includes/function.inc +++ b/includes/function.inc @@ -12,11 +12,6 @@ function load_theme() { return new Theme(); } -function discussion_score($comment) { - $value = ($comment->votes) ? ($comment->score / $comment->votes) : (($comment->score) ? $comment->score : 0); - return (strpos($value, ".")) ? substr($value ."00", 0, 4) : $value .".00"; -} - function check_textfield($message) { global $allowed_html; return strip_tags(str_replace("\"", """, stripslashes($message)), $allowed_html); @@ -42,21 +37,6 @@ function check_output($message, $nl2br = 0) { else return strip_tags(stripslashes($message), $allowed_html); } -function discussion_num_replies($id, $count = 0) { - $result = db_query("SELECT COUNT(cid) FROM comments WHERE pid = $id"); - return ($result) ? db_result($result, 0) : 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, $singular, $plural) { return ($count == 1) ? "$count $singular" : "$count $plural"; } |