summaryrefslogtreecommitdiff
path: root/includes/function.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2000-10-19 13:31:23 +0000
committerDries Buytaert <dries@buytaert.net>2000-10-19 13:31:23 +0000
commit11ee95dadc408e16e9832af9fd0b41495e78b0a6 (patch)
treea8f5ca3387e360b37d0eafc4edfdc5fdc52d3b87 /includes/function.inc
parent43af5a7389265891770e4a283e4748678754797f (diff)
downloadbrdo-11ee95dadc408e16e9832af9fd0b41495e78b0a6.tar.gz
brdo-11ee95dadc408e16e9832af9fd0b41495e78b0a6.tar.bz2
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
Diffstat (limited to 'includes/function.inc')
-rw-r--r--includes/function.inc25
1 files changed, 2 insertions, 23 deletions
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 @@
<?
include "includes/database.inc";
-include "includes/log.inc";
+include "includes/watchdog.inc";
function id2story($id) {
### Perform query:
@@ -9,17 +9,6 @@ function id2story($id) {
return db_fetch_object($result);
}
-function dbsave($dbase, $data, $id=0) {
- foreach ($data as $key=>$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) ? "<A HREF=\"$address\">$description</A>" : format_data($address);
}
-function format_story_link($story, $subject = "") {
- global $user;
- $output .= "<A HREF=\"discussion.php?id=$story->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</A>" : "\">$story->subject</A>";
- return $output;
-}
-
?>