Textpattern PHP Cross Reference Content Management Systems

Source: /textpattern/update/_to_4.0.7.php - 64 lines - 2484 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  $txpplugin = getThings('DESCRIBE `'.PFX.'txp_plugin`');
  29  
  30  if (!in_array('load_order', $txpplugin)) {
  31      safe_alter('txp_plugin', "ADD load_order TINYINT UNSIGNED NOT NULL DEFAULT 5");
  32  }
  33  
  34  // Enable XML-RPC server?
  35  if (!safe_field("name", 'txp_prefs', "name = 'enable_xmlrpc_server'")) {
  36      safe_insert('txp_prefs', "prefs_id = 1, name = 'enable_xmlrpc_server', val = 0, type = 1, event = 'admin', html = 'yesnoradio', position = 130");
  37  }
  38  
  39  if (!safe_field("name", 'txp_prefs', "name = 'smtp_from'")) {
  40      safe_insert('txp_prefs', "prefs_id = 1, name = 'smtp_from', val = '', type = 1, event = 'admin', position = 110");
  41  }
  42  
  43  if (!safe_field("val", 'txp_prefs', "name = 'author_list_pageby'")) {
  44      safe_insert('txp_prefs', "prefs_id = 1, name = 'author_list_pageby', val = 25, type = 2");
  45  }
  46  
  47  // Expiry datetime for articles.
  48  $txp = getThings("DESCRIBE `".PFX."textpattern`");
  49  
  50  if (!in_array('Expires', $txp)) {
  51      safe_alter('textpattern', "ADD Expires DATETIME AFTER Posted");
  52  }
  53  
  54  safe_create_index('textpattern', 'Expires', 'Expires_idx');
  55  
  56  // Publish expired articles, or return 410?
  57  if (!safe_field("name", 'txp_prefs', "name = 'publish_expired_articles'")) {
  58      safe_insert('txp_prefs', "prefs_id = 1, name = 'publish_expired_articles', val = '0', type = '1', event = 'publish', html = 'yesnoradio', position = '130'");
  59  }
  60  
  61  // Searchable article fields hidden preference.
  62  if (!safe_field("name", 'txp_prefs', "name = 'searchable_article_fields'")) {
  63      safe_insert('txp_prefs', "prefs_id = 1, name = 'searchable_article_fields', val = 'Title, Body', type = '2', event = 'publish', html = 'text_input', position = '0'");
  64  }

title

Description

title

Description

title

Description

title

title

Body