Textpattern PHP Cross Reference Content Management Systems

Source: /textpattern/update/_to_4.5.0.php - 67 lines - 2598 bytes - Text - Print

   1  <?php
   2  
   3  /*
   4   * Textpattern Content Management System
   5   * http://textpattern.com
   6   *
   7   * Copyright (C) 2016 The Textpattern Development Team
   8   *
   9   * This file is part of Textpattern.
  10   *
  11   * Textpattern is free software; you can redistribute it and/or
  12   * modify it under the terms of the GNU General Public License
  13   * as published by the Free Software Foundation, version 2.
  14   *
  15   * Textpattern is distributed in the hope that it will be useful,
  16   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18   * GNU General Public License for more details.
  19   *
  20   * You should have received a copy of the GNU General Public License
  21   * along with Textpattern. If not, see <http://www.gnu.org/licenses/>.
  22   */
  23  
  24  if (!defined('TXP_UPDATE')) {
  25      exit("Nothing here. You can't access this file directly.");
  26  }
  27  
  28  // Doctype prefs.
  29  if (!safe_field("name", 'txp_prefs', "name = 'doctype'")) {
  30      safe_insert('txp_prefs', "prefs_id = 1, name = 'doctype', val = 'xhtml', type = '0', event = 'publish', html = 'doctypes', position = '190'");
  31  }
  32  
  33  // Publisher's email address.
  34  if (!safe_field("name", 'txp_prefs', "name = 'publisher_email'")) {
  35      safe_insert('txp_prefs', "prefs_id = 1, name = 'publisher_email', val = '', type = 1, event = 'admin', position = 115");
  36  }
  37  // Goodbye raw ?php support.
  38  if (safe_field("name", 'txp_prefs', "name = 'allow_raw_php_scripting'")) {
  39      safe_delete('txp_prefs', "name = 'allow_raw_php_scripting'");
  40  }
  41  
  42  safe_alter('txp_users', "MODIFY RealName VARCHAR(255) NOT NULL DEFAULT ''");
  43  safe_alter('txp_users', "MODIFY email    VARCHAR(254) NOT NULL DEFAULT ''");
  44  
  45  // Remove any setup strings from lang table.
  46  safe_delete('txp_lang', "event = 'setup'");
  47  
  48  safe_create_index('textpattern', 'url_title', 'url_title_idx');
  49  
  50  // Remove is_default from txp_section table and make it a preference.
  51  $cols = getThings("DESCRIBE `".PFX."txp_section`");
  52  if (!safe_field("name", 'txp_prefs', "name = 'default_section'")) {
  53      if (in_array('is_default', $cols)) {
  54          $current_default_section = safe_field("name", 'txp_section', "is_default = 1");
  55      } else {
  56          // Nothing we can do. Pick first one.
  57          $current_default_section = safe_field("name", 'txp_section', "1 LIMIT 1");
  58      }
  59  
  60      safe_insert('txp_prefs', "prefs_id = 1, name = 'default_section', val = '".doSlash($current_default_section)."', type = '2', event = 'section', html = 'text_input', position = '0'");
  61  }
  62  
  63  if (in_array('is_default', $cols)) {
  64      safe_alter('txp_section', "DROP is_default");
  65  }
  66  
  67  safe_alter('txp_css', "MODIFY css MEDIUMTEXT NOT NULL");

title

Description

title

Description

title

Description

title

title

Body