diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-04-14 19:33:53 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-04-14 19:33:53 +0000 |
commit | 024c75e7205302a99a48710888f1b5cfb46345ab (patch) | |
tree | e706fbf129362830ef264173bdbfe3e7e25a2512 /includes | |
parent | 4847cb22f53e10c67bd837dfb5de3d246e6c7b59 (diff) | |
download | brdo-024c75e7205302a99a48710888f1b5cfb46345ab.tar.gz brdo-024c75e7205302a99a48710888f1b5cfb46345ab.tar.bz2 |
- tidied up the old code
Diffstat (limited to 'includes')
-rw-r--r-- | includes/section.inc | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/includes/section.inc b/includes/section.inc index 6ed1d4030..ad25b179c 100644 --- a/includes/section.inc +++ b/includes/section.inc @@ -1,38 +1,5 @@ <?php -function _section_get($field, $value) { - return db_query("SELECT * FROM section WHERE $field = '$value'"); -} - -function section_get_object($field, $value) { - return db_fetch_object(_section_get($field, $value)); -} - -function section_get_array($field, $value) { - return db_fetch_array(_section_get($field, $value)); -} - -function section_save($edit) { - if ($edit["sid"]) db_query("UPDATE section SET name = '". check_input($edit[name]) ."', pid = '". check_input($edit[pid]) ."' WHERE sid = $edit[sid]", 1); - else db_query("INSERT INTO section (name, pid) VALUES ('". check_input($edit[name])."', '". check_input($edit[pid]) ."')", 1); - - $sid = ($edit[sid] ? $edit[sid] : db_insert_id()); - - db_query("DELETE FROM section_type WHERE sid = '$sid'", 1); - foreach ($edit[type] as $key=>$type) db_query("INSERT INTO section_type (sid, type) VALUES ('". check_input($sid) ."', '". check_input($type) ."')", 1); -} - -function section_tree($parent = 0, $name = "", $tree = array()) { - $result = db_query("SELECT * FROM section WHERE pid = '$parent'"); - while ($section = db_fetch_object($result)) { - $tree[$section->sid] = ($name ? "$name - $section->name" : $section->name); - $tree = section_tree($section->sid, $tree[$section->sid], $tree); - } - return $tree; -} - -///// old ///// - function section_get() { $array = array(); $result = db_query("SELECT name FROM sections"); |