upgrade.php
changeset 31 dc8741857bde
parent 21 663fcf528726
child 33 143d3ee32f3c
equal deleted inserted replaced
30:7e8fd44b36b0 31:dc8741857bde
    74     '1.0RC1' => Array('1.0RC2'),
    74     '1.0RC1' => Array('1.0RC2'),
    75     '1.0RC2' => Array('1.0RC3')
    75     '1.0RC2' => Array('1.0RC3')
    76   );
    76   );
    77 $this_version   = '1.0';
    77 $this_version   = '1.0';
    78 $func_list = Array(
    78 $func_list = Array(
    79     '1.0b4' => Array('u_1_0_RC1_update_user_ids', 'u_1_0_RC1_add_admins_to_group', 'u_1_0_RC1_alter_files_table', 'u_1_0_RC1_destroy_session_cookie', 'u_1_0_RC1_set_contact_email', 'u_1_0_RC1_update_page_text') // ,
    79     '1.0b4' => Array('u_1_0_RC1_update_user_ids', 'u_1_0_RC1_add_admins_to_group', 'u_1_0_RC1_alter_files_table', 'u_1_0_RC1_destroy_session_cookie', 'u_1_0_RC1_set_contact_email', 'u_1_0_RC1_update_page_text'), // ,
    80     // '1.0RC2' => Array('u_1_0_populate_userpage_comments')
    80     // '1.0RC2' => Array('u_1_0_populate_userpage_comments')
       
    81     '1.0RC3' => Array('u_1_0_RC3_make_users_extra')
    81   );
    82   );
    82 
    83 
    83 if(!isset($_GET['mode'])) 
    84 if(!isset($_GET['mode'])) 
    84 {
    85 {
    85   $_GET['mode'] = 'login';
    86   $_GET['mode'] = 'login';
   364   while ( $row = $db->fetchrow() )
   365   while ( $row = $db->fetchrow() )
   365   {
   366   {
   366     
   367     
   367   }
   368   }
   368   */
   369   */
       
   370 }
       
   371 
       
   372 function u_1_0_RC3_make_users_extra()
       
   373 {
       
   374   global $db;
       
   375   $q = $db->sql_query('SELECT user_id FROM users WHERE user_id > 1;');
       
   376   if ( !$q )
       
   377     $db->_die();
       
   378   
       
   379   $ids = array();
       
   380   while ( $row = $db->fetchrow() )
       
   381   {
       
   382     $ids[] = intval($row['user_id']);
       
   383   }
       
   384   
       
   385   $ids = '(' . implode('),(', $ids) . ')';
       
   386   $sql = "INSERT INTO " . table_prefix . "users_extra(user_id) VALUES$ids;";
       
   387   
       
   388   if ( !$db->sql_query($sql) )
       
   389     $db->_die();
   369 }
   390 }
   370 
   391 
   371 switch($_GET['mode'])
   392 switch($_GET['mode'])
   372 {
   393 {
   373   case "login":
   394   case "login":