Changed style of copyright in St. Patty; first attempt at fixing some upgrade issues from beta 3 or so
authordan
Sun, 19 Aug 2007 15:35:01 -0400
changeset 95 1dac77b46f07
parent 94 8fc958168261
child 96 0b53c89a7d11
Changed style of copyright in St. Patty; first attempt at fixing some upgrade issues from beta 3 or so
themes/stpatty/footer.tpl
upgrade.php
--- a/themes/stpatty/footer.tpl	Fri Aug 17 12:35:29 2007 -0400
+++ b/themes/stpatty/footer.tpl	Sun Aug 19 15:35:01 2007 -0400
@@ -9,7 +9,8 @@
                  
                  -Dan
                  -->
-          {COPYRIGHT} &bull; Powered by <a href="<!-- BEGIN stupid_mode -->http://enanocms.org/<!-- BEGINELSE stupid_mode -->{URL_ABOUT_ENANO}<!-- END stupid_mode -->">Enano</a>  |  <a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.1</a>  |  <a href="http://jigsaw.w3.org/css-validator/validator?uri=referer">Valid CSS</a>  |  [[Stats]]
+          <b>{COPYRIGHT}</b><br />
+          Powered by <a href="<!-- BEGIN stupid_mode -->http://enanocms.org/<!-- BEGINELSE stupid_mode -->{URL_ABOUT_ENANO}<!-- END stupid_mode -->">Enano</a>  |  <a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.1</a>  |  <a href="http://jigsaw.w3.org/css-validator/validator?uri=referer">Valid CSS</a>  |  [[Stats]]
         </div>
       </div>
     </div>
--- a/upgrade.php	Fri Aug 17 12:35:29 2007 -0400
+++ b/upgrade.php	Sun Aug 19 15:35:01 2007 -0400
@@ -214,23 +214,25 @@
     return true;
   // Find the first unused user ID
   $used = Array();
-  $q = $db->sql_query('SELECT user_id FROM '.table_prefix.'users');
+  $q = $db->sql_query('SELECT user_id FROM '.table_prefix.'users;');
   if ( !$q )
     $db->_die();
-  $c = false;
+  $notfirst = false;
   while ( $row = $db->fetchrow() )
   {
     $i = intval($row['user_id']);
     $used[$i] = true;
-    if ( !isset($used[$i - 1]) && $c )
+    if ( !isset($used[$i - 1]) && $notfirst )
     {
       $id = $i - 1;
       break;
     }
-    $c = true;
+    $notfirst = true;
   }
   if ( !isset($id) )
     $id = $i + 1;
+  if ( $id == 0 )
+    $id = 2;
   $db->free_result();
   
   $q = $db->sql_query('UPDATE '.table_prefix.'users SET user_id=' . $id . ' WHERE user_id=1;');
@@ -373,7 +375,7 @@
 function u_1_0_RC3_make_users_extra()
 {
   global $db;
-  $q = $db->sql_query('SELECT user_id FROM '.table_prefix.'users WHERE user_id > 1;');
+  $q = $db->sql_query('SELECT user_id FROM '.table_prefix.'users WHERE user_id > 0;');
   if ( !$q )
     $db->_die();
   
@@ -384,6 +386,8 @@
   }
   
   $ids = '(' . implode('),(', $ids) . ')';
+  if ( $ids == '' )
+    return false;
   $sql = "INSERT INTO " . table_prefix . "users_extra(user_id) VALUES$ids;";
   
   if ( !$db->sql_query($sql) )