[ Index ]

PHP Cross Reference of MyBB 1.8.38

title

Body

[close]

/install/resources/ -> upgrade52.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: 1.8.24, 1.8.25 or 1.8.26
  13   */
  14  
  15   $upgrade_detail = array(
  16       "revert_all_templates" => 0,
  17       "revert_all_themes" => 0,
  18       "revert_all_settings" => 0
  19  );
  20  
  21  @set_time_limit(0);
  22  
  23  function upgrade52_dbchanges()
  24  {
  25      global $output, $cache, $db, $mybb;
  26  
  27      $output->print_header("Updating Database");
  28  
  29      echo "<p>Performing necessary upgrade queries...</p>";
  30      flush();
  31  
  32      // Add new setting for new usergroup permission if group members can hide online status
  33      if(!$db->field_exists('canbeinvisible', 'usergroups'))
  34      {
  35          switch($db->type)
  36          {
  37              case "pgsql":
  38                  $db->add_column("usergroups", "canbeinvisible", "smallint NOT NULL default '1' AFTER canusercp");
  39                  break;
  40  
  41              default:
  42                  $db->add_column("usergroups", "canbeinvisible", "tinyint(1) NOT NULL default '1' AFTER canusercp");
  43                  break;
  44          }
  45      }
  46  
  47      // Add new setting for attachments force download
  48      if(!$db->field_exists('forcedownload', 'attachtypes'))
  49      {
  50          switch($db->type)
  51          {
  52              case "pgsql":
  53                  $db->add_column("attachtypes", "forcedownload", "smallint NOT NULL default '0' AFTER enabled");
  54                  break;
  55  
  56              default:
  57                  $db->add_column("attachtypes", "forcedownload", "tinyint(1) NOT NULL default '0' AFTER enabled");
  58                  break;
  59          }
  60      }
  61  
  62      // Change default values for these settings for the guest group only
  63      $db->update_query('usergroups', array(
  64          'caneditposts' => 0,
  65          'candeleteposts' => 0,
  66          'candeletethreads' => 0,
  67          'caneditattachments' => 0,
  68          'canviewdeletionnotice' => 0
  69      ), "gid = 1");
  70  
  71      $cache->update_usergroups();
  72    
  73      $added_tasks = sync_tasks();
  74  
  75      echo "<p>Added {$added_tasks} new tasks.</p>";
  76  
  77      $output->print_contents("<p>Click next to continue with the upgrade process.</p>");
  78      $output->print_footer("52_done");
  79  }


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