From 11ee95dadc408e16e9832af9fd0b41495e78b0a6 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 19 Oct 2000 13:31:23 +0000 Subject: A big, fat commit with a shitload of internal changes. Not that much visual changes: - removed redundant files user.class.php, calendar.class.php and backend.class.php. - converted *all* mysql queries to queries supported by the database abstraction layer. - expanded the watchdog to record more information on what actually happened. - bugfix: anonymous readers where not able to view comments. - bugfix: anonymous readers could gain read-only access to the submission queue. - bugfix: invalid includes in backend.php - bugfix: invalid use of '$user->block' and last but not least: - redid 50% of the user account system --- includes/function.inc | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'includes/function.inc') diff --git a/includes/function.inc b/includes/function.inc index 281eb0358..5c1a3615a 100644 --- a/includes/function.inc +++ b/includes/function.inc @@ -1,7 +1,7 @@ $value) { - if ($key == "passwd") { $query .= "$key=PASSWORD('". addslashes($value) ."'), "; } - else { $query .= "$key='". addslashes($value) ."', "; } - } - $query = substr($query, 0, -2); - - if (!empty($id)) { db_query("UPDATE $dbase SET $query WHERE id=$id") or die(mysql_error()); return $id; } - else { db_query("INSERT INTO $dbase SET $query") or die(mysql_error()); return mysql_insert_id(); } -} - function load_theme() { global $user, $themes; @@ -44,7 +33,7 @@ function check_output($message) { function discussion_num_replies($id, $count = 0) { $result = db_query("SELECT COUNT(cid) FROM comments WHERE pid = $id"); - return ($result) ? mysql_result($result, 0) : 0; + return ($result) ? db_result($result, 0) : 0; } function format_plural($count, $one, $more) { @@ -93,14 +82,4 @@ function format_url($address, $description = "") { return ($address) ? "$description" : format_data($address); } -function format_story_link($story, $subject = "") { - global $user; - $output .= "id"; - $output .= ($user->umode) ? "&mode=$user->umode" : "&mode=threaded"; - $output .= ($user->uorder) ? "&order=$user->uorder" : "&order=0"; - $output .= ($user->thold) ? "&thold=$user->thold" : "&thold=0"; - $output .= ($subject) ? "\">$subject" : "\">$story->subject"; - return $output; -} - ?> -- cgit v1.2.3