summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2000-12-10 16:12:08 +0000
committerDries Buytaert <dries@buytaert.net>2000-12-10 16:12:08 +0000
commit2a4c9cc97ba42107e55637dfc549c80c02238246 (patch)
tree780d28024e84646207ccdf7a04ae96fb96e124bd
parent5fd94b17655fc3a0154ae5b9ca75271e1922fd15 (diff)
downloadbrdo-2a4c9cc97ba42107e55637dfc549c80c02238246.tar.gz
brdo-2a4c9cc97ba42107e55637dfc549c80c02238246.tar.bz2
- added so called "blobs": something hot, something new and something cool!
-rw-r--r--includes/blob.inc22
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