[ Index ]

PHP Cross Reference of MyBB 1.8.38

title

Body

[close]

/install/resources/ -> upgrade4.php (source)

   1  <?php
   2  /**
   3   * MyBB 1.8
   4   * Copyright 2014 MyBB Group, All Rights Reserved
   5   *
   6   * Website: http://www.mybb.com
   7   * License: http://www.mybb.com/about/license
   8   *
   9   */
  10  
  11  /**
  12   * Upgrade Script: Preview Release 2
  13   */
  14  
  15  $upgrade_detail = array(
  16      "revert_all_templates" => 0,
  17      "revert_all_themes" => 0,
  18      "revert_all_settings" => 1,
  19      "requires_deactivated_plugins" => 1,
  20  );
  21  
  22  @set_time_limit(0);
  23  
  24  function upgrade4_dbchanges()
  25  {
  26      global $db, $output;
  27  
  28      $output->print_header("Performing Queries");
  29  
  30      echo "<p>Performing necessary upgrade queries..</p>";
  31  
  32      $db->write_query("UPDATE ".TABLE_PREFIX."users SET style='0' WHERE style='-1';");
  33      $db->write_query("UPDATE ".TABLE_PREFIX."users SET displaygroup='0' WHERE displaygroup='-1';");
  34      $db->write_query("UPDATE ".TABLE_PREFIX."forums SET style='0' WHERE style='-1';");
  35      $query = $db->simple_select("adminoptions", "uid='0'");
  36      $test = $db->fetch_array($query);
  37      if(!isset($test['uid']))
  38      {
  39          $db->write_query("UPDATE ".TABLE_PREFIX."adminoptions SET uid='0' WHERE uid='-1';");
  40      }
  41  
  42      if($db->field_exists('messageindex', "threads"))
  43      {
  44          $db->write_query("ALTER TABLE ".TABLE_PREFIX."threads DROP messageindex;");
  45      }
  46      if($db->field_exists('subjectindex', "threads"))
  47      {
  48          $db->write_query("ALTER TABLE ".TABLE_PREFIX."threads DROP subjectindex;");
  49      }
  50      if($db->field_exists('moderators', "forums"))
  51      {
  52          $db->write_query("ALTER TABLE ".TABLE_PREFIX."forums DROP moderators;");
  53      }
  54  
  55      if($db->field_exists('version', "templates"))
  56      {
  57          $db->write_query("ALTER TABLE ".TABLE_PREFIX."templates DROP version;");
  58      }
  59      $db->write_query("ALTER TABLE ".TABLE_PREFIX."templates ADD version varchar(20) NOT NULL default '0';");
  60  
  61      if($db->field_exists('status', "templates"))
  62      {
  63          $db->write_query("ALTER TABLE ".TABLE_PREFIX."templates DROP status;");
  64      }
  65      $db->write_query("ALTER TABLE ".TABLE_PREFIX."templates ADD status varchar(10) NOT NULL default '';");
  66  
  67      if($db->field_exists('dateline', "templates"))
  68      {
  69          $db->write_query("ALTER TABLE ".TABLE_PREFIX."templates DROP dateline;");
  70      }
  71      $db->write_query("ALTER TABLE ".TABLE_PREFIX."templates ADD dateline int(10) NOT NULL default '0';");
  72  
  73      $db->write_query("UPDATE ".TABLE_PREFIX."templates SET version='100.06' WHERE sid>0");
  74  
  75      echo "Done</p>";
  76  
  77      $contents .= "Click next to continue with the upgrade process.</p>";
  78      $output->print_contents($contents);
  79      $output->print_footer("4_done");
  80  }
  81  


2005 - 2021 © MyBB.de | Alle Rechte vorbehalten! | Sponsor: netcup Cross-referenced by PHPXref