diff options
author | Dries Buytaert <dries@buytaert.net> | 2000-12-10 16:12:08 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2000-12-10 16:12:08 +0000 |
commit | 2a4c9cc97ba42107e55637dfc549c80c02238246 (patch) | |
tree | 780d28024e84646207ccdf7a04ae96fb96e124bd | |
parent | 5fd94b17655fc3a0154ae5b9ca75271e1922fd15 (diff) | |
download | brdo-2a4c9cc97ba42107e55637dfc549c80c02238246.tar.gz brdo-2a4c9cc97ba42107e55637dfc549c80c02238246.tar.bz2 |
- added so called "blobs": something hot, something new and something cool!
-rw-r--r-- | includes/blob.inc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/includes/blob.inc b/includes/blob.inc new file mode 100644 index 000000000..dab03ff5e --- /dev/null +++ b/includes/blob.inc @@ -0,0 +1,22 @@ +<? + +function blob_get($name) { + $result = db_query("SELECT * FROM blobs WHERE name = '$name'"); + + if ($blob = db_fetch_object($result)) { + return eval($blob->code); + } + else { + watchdog("error", "blob '$name' does not exist"); + } +} + +function blob_add($name, $help, $code, $message = "") { + $result = db_query("INSERT INTO blobs (name, help, code) VALUES ('". check_input($name) ."', '". check_input($help) ."', '". check_code($code) ."')"); +} + +function blob_delete($id) { + $result = db_query("DELETE FROM blobs WHERE id = $id"); +} + +?>
\ No newline at end of file |