From 2d1e9126cb10f52e7711ce121f8bdaa5bdc71aa4 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 16 Sep 2001 11:33:14 +0000 Subject: - Added the new user module! --- modules/box.module | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'modules/box.module') diff --git a/modules/box.module b/modules/box.module index 6618f6b60..8c0ba63a5 100644 --- a/modules/box.module +++ b/modules/box.module @@ -18,7 +18,7 @@ function box_help() {

If we are however dealing with a registered user, we can customize the message by using:

-   if ($user->id) {
+   if ($user->uid) {
      return "Welcome $user->name, ... welcome message goes here ...";
    }
    else {
@@ -44,7 +44,6 @@ function box_block() {
     $blocks[$i]["subject"] = check_output($block->title);
     $blocks[$i]["content"] = ($block->type == 2) ? eval($block->body) : $block->body;
     $blocks[$i]["info"] = check_output($block->info);
-    $blocks[$i]["link"] = check_output($block->link);
     $i++;
   }
   return $blocks;
@@ -65,7 +64,6 @@ function box_display() {
     $output .= " Body:". nl2br(htmlentities($block->body)) ."\n";
     $output .= " Type:". $type[$block->type] ."\n";
     $output .= " Description:". check_output($block->info) ."\n";
-    $output .= " Link:". format_url($block->link) ."\n";
     $output .= " Operations:bid\">edit\n";
     $output .= "\n";
     $output .= "

\n"; @@ -76,13 +74,13 @@ function box_display() { function box_save($edit) { if ($edit[bid] && $edit[title]) { - db_query("UPDATE boxes SET title = '". check_input($edit[title]) ."', body = '". check_input($edit[body]) ."', info = '". check_input($edit[info]) ."', link = '". check_input($edit[link]) ."', type = '". check_input($edit[type]) ."' WHERE bid = '". check_input($edit[bid]) ."'"); + db_query("UPDATE boxes SET title = '". check_input($edit[title]) ."', body = '". check_input($edit[body]) ."', info = '". check_input($edit[info]) ."', type = '". check_input($edit[type]) ."' WHERE bid = '". check_input($edit[bid]) ."'"); } else if ($edit[bid]) { db_query("DELETE FROM boxes WHERE bid = '". check_input($edit[bid]) ."'"); } else { - db_query("INSERT INTO boxes (title, body, info, link, type) VALUES ('". check_input($edit[title]) ."', '". check_input($edit[body]) ."', '". check_input($edit[info]) ."', '". check_input($link) ."', '". check_input($edit[type]) ."')"); + db_query("INSERT INTO boxes (title, body, info, type) VALUES ('". check_input($edit[title]) ."', '". check_input($edit[body]) ."', '". check_input($edit[info]) ."', '". check_input($edit[type]) ."')"); } } @@ -95,7 +93,6 @@ function box_form($edit = array()) { $form .= form_textfield("Description", "info", $edit[info], 50, 64); $form .= form_textarea("Body", "body", $edit[body], 70, 10); $form .= form_select("Type", "type", $edit[type], $type); - $form .= form_textfield("Link", "link", $edit[link], 50, 64); if ($edit[bid]) { $form .= form_submit("Delete"); -- cgit v1.2.3