diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-05-15 18:38:57 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-05-15 18:38:57 +0000 |
commit | 14ddbc473c3ccfc03773bd684cd41255cc951507 (patch) | |
tree | 3310c06c4323dfc5690d6e78236158b7bac2f428 /modules/page/page.module | |
parent | 1da587a9d9df433952981da62dda4f2b216799c7 (diff) | |
download | brdo-14ddbc473c3ccfc03773bd684cd41255cc951507.tar.gz brdo-14ddbc473c3ccfc03773bd684cd41255cc951507.tar.bz2 |
- Created 2 new functions:
+ path_uri(): returns the fully-qualified URI of your drupal site.
+ path_img(): returns the image directory or http://image-server.com/
in case you prefer to load-balance bandwidth usage.
Replaced all occurences of the variable "site_url" with path_uri()
and removed "site_url" from "setting.module".
- Drastically simplified the node_save() API, which should make the
node-forms more secure. Updated "story.module", "book.module",
"forum.module", "page.module" and "node.module" to reflect this
change. This is needs more testing so hit it, beat it, tease it.
- Fixed an occasional glitch in the configuration file loading logic.
- Made "queue.module" display an informative notice when an anonymous
user tries accessing the moderation queue.
- Updated the hard-coded information in drupal.module a bit.
Diffstat (limited to 'modules/page/page.module')
-rw-r--r-- | modules/page/page.module | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/page/page.module b/modules/page/page.module index c1c380a11..39ab6f63b 100644 --- a/modules/page/page.module +++ b/modules/page/page.module @@ -1,6 +1,6 @@ <?php -$GLOBALS[format] = array(0 => HTML, 1 => PHP, 2 => text); +$GLOBALS[format] = array(0 => "HTML", 1 => "PHP", 2 => "text"); function page_view($node, $main = 0) { global $format, $theme; @@ -37,8 +37,11 @@ function page_form($edit = array()) { } function page_save($edit) { - global $status; - node_save(array_merge($edit, array(type => "page", status => $status[posted]))); + global $status, $user; + + if (user_access($user)) { + node_save($edit, array(author => $user->id, body, cid, comment => category_comment($edit[cid]), format, moderate => topic_moderate($edit[tid]), promote => category_promote($edit[cid]), score => 0, status => $status[posted], tid, timestamp => time(), title, type => "page", votes => 0)); + } } function page_query($type = "") { |