diff -rup --strip-trailing-cr -x .svn sites/all/modules/site_tour/site_tour.admin.inc ../sites/all/modules/site_tour/site_tour.admin.inc
--- sites/all/modules/site_tour/site_tour.admin.inc	2009-02-12 10:53:01.338250000 +0100
+++ sites/all/modules/site_tour/site_tour.admin.inc	2009-02-12 10:51:35.103875000 +0100
@@ -293,9 +293,9 @@ function site_tour_admin_edit_submit($fo
   $tour = (object)$form_values;
   $tour->description = truncate_utf8($tour->description, 255, TRUE, TRUE);
   if ($tour->id) {
-    db_query('UPDATE {site_tour} SET title="%s", description="%s", status=%d, close_url="%s", exit_url="%s", skin="%s",
+    db_query('UPDATE {site_tour} SET url="%s", title="%s", description="%s", status=%d, close_url="%s", exit_url="%s", skin="%s",
       text_of="%s", text_close="%s", btn_prev="%s", btn_next="%s", close_btn_action="%s", cover_body="%s",
-      cover_click_close="%s" WHERE id=%d', $tour->title, $tour->description, $tour->status, $tour->close_url,
+      cover_click_close="%s" WHERE id=%d', $tour->url, $tour->title, $tour->description, $tour->status, $tour->close_url,
       $tour->exit_url, $tour->skin, $tour->text_of, $tour->text_close, $tour->btn_prev, $tour->btn_next,
       $tour->close_btn_action, $tour->cover_body, $tour->cover_click_close, $tour->id);
     if (!db_affected_rows()) {
@@ -304,16 +304,30 @@ function site_tour_admin_edit_submit($fo
     }
   }
   else {
-    db_query('INSERT INTO {site_tour} (title, description, status, close_url, exit_url, skin, text_of, text_close,
-      btn_prev, btn_next, close_btn_action, cover_body=, cover_click_close) VALUES("%s", "%s", %d, "%s", "%s", "%s",
-      "%s", "%s", "%s", "%s", "%s", "%s", "%s")', $tour->title, $tour->description, $tour->status, $tour->close_url,
-      $tour->exit_url, $tour->skin, $tour->text_of, $tour->text_close, $tour->btn_prev, $tour->btn_next,
-      $tour->close_btn_action, $tour->cover_body, $tour->cover_click_close);
-    if (!db_affected_rows()) {
-      drupal_set_message(t('There was an error saving the tour.'), 'error');
-      return;
-    }      
-    $tour->id = db_last_insert_id('site_tour', 'id');
+    // IF drupal 6
+    if (function_exists('db_last_insert_id')) {
+      db_query('INSERT INTO {site_tour} (url, title, description, status, close_url, exit_url, skin, text_of, text_close,
+        btn_prev, btn_next, close_btn_action, cover_body, cover_click_close) VALUES("%s", "%s", %d, "%s", "%s", "%s",
+        "%s", "%s", "%s", "%s", "%s", "%s", "%s")', $tour->url, $tour->title, $tour->description, $tour->status, $tour->close_url,
+        $tour->exit_url, $tour->skin, $tour->text_of, $tour->text_close, $tour->btn_prev, $tour->btn_next,
+        $tour->close_btn_action, $tour->cover_body, $tour->cover_click_close);
+      if (!db_affected_rows()) {
+        drupal_set_message(t('There was an error saving the tour.'), 'error');
+        return;
+      }      
+      $tour->id = db_last_insert_id('site_tour', 'id');
+    } else {
+      $tour->id = db_next_id('site_tour', 'id');
+      db_query('INSERT INTO {site_tour} (id, url, title, description, status, close_url, exit_url, skin, text_of, text_close,
+        btn_prev, btn_next, close_btn_action, cover_body, cover_click_close) VALUES(%d, "%s", "%s", %d, "%s", "%s", "%s",
+        "%s", "%s", "%s", "%s", "%s", "%s", "%s")', $tour->id, $tour->url, $tour->title, $tour->description, $tour->status, $tour->close_url,
+        $tour->exit_url, $tour->skin, $tour->text_of, $tour->text_close, $tour->btn_prev, $tour->btn_next,
+        $tour->close_btn_action, $tour->cover_body, $tour->cover_click_close);
+      if (!db_affected_rows()) {
+        drupal_set_message(t('There was an error saving the tour.'), 'error');
+        return;
+      }
+    }
   }
   drupal_set_message(t('The tour has been successfully saved.'));
   if (!$tour->pages_count) {
@@ -577,4 +591,5 @@ function theme_site_tour_page_add(&$form
   $output .= '<div style="clear:both;"></div>';
   $output .= drupal_render($form);
   return $output;
-}
\ No newline at end of file
+}
+
