[ Index ] |
PHP Cross Reference of Textpattern 4.0.8 |
[Summary view] [Print] [Text view]
1 <?php 2 3 /* 4 $HeadURL: https://textpattern.googlecode.com/svn/releases/4.0.8/source/textpattern/update/_to_4.0.7.php $ 5 $LastChangedRevision: 3014 $ 6 */ 7 8 if (!defined('TXP_UPDATE')) 9 { 10 exit("Nothing here. You can't access this file directly."); 11 } 12 13 $txpplugin = getThings('describe `'.PFX.'txp_plugin`'); 14 if (!in_array('load_order', $txpplugin)) { 15 safe_alter('txp_plugin', 16 "ADD load_order TINYINT UNSIGNED NOT NULL DEFAULT 5"); 17 } 18 19 # Enable XML-RPC server? 20 if (!safe_field('name', 'txp_prefs', "name = 'enable_xmlrpc_server'")) 21 { 22 safe_insert('txp_prefs', "prefs_id = 1, name = 'enable_xmlrpc_server', val = 0, type = 1, event = 'admin', html = 'yesnoradio', position = 130"); 23 } 24 25 if (!safe_field('name', 'txp_prefs', "name = 'smtp_from'")) 26 { 27 safe_insert('txp_prefs', "prefs_id = 1, name = 'smtp_from', val = '', type = 1, event = 'admin', position = 110"); 28 } 29 30 if (!safe_field('val', 'txp_prefs', "name='author_list_pageby'")) 31 { 32 safe_insert('txp_prefs', "prefs_id = 1, name = 'author_list_pageby', val = 25, type = 2"); 33 } 34 35 # Expiry datetime for articles 36 $txp = getThings('describe `'.PFX.'textpattern`'); 37 if (!in_array('Expires',$txp)) { 38 safe_alter("textpattern", "add `Expires` datetime NOT NULL default '0000-00-00 00:00:00' after `Posted`"); 39 } 40 41 $has_expires_idx = 0; 42 $rs = getRows('show index from `'.PFX.'textpattern`'); 43 foreach ($rs as $row) { 44 if ($row['Key_name'] == 'Expires_idx') 45 $has_expires_idx = 1; 46 } 47 48 if (!$has_expires_idx) { 49 safe_query('alter ignore table `'.PFX.'textpattern` add index Expires_idx(Expires)'); 50 } 51 52 # Publish expired articles, or return 410? 53 if (!safe_field('name', 'txp_prefs', "name = 'publish_expired_articles'")) 54 safe_insert('txp_prefs', "prefs_id = 1, name = 'publish_expired_articles', val = '0', type = '1', event='publish', html='yesnoradio', position='130'"); 55 56 # Searchable article fields hidden preference 57 if (!safe_field('name', 'txp_prefs', "name = 'searchable_article_fields'")) 58 safe_insert('txp_prefs', "prefs_id = 1, name = 'searchable_article_fields', val = 'Title, Body', type = '2', event='publish', html='text_input', position='0'"); 59 60 ?> 61
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Thu May 21 23:03:01 2009 | Cross-referenced by PHPXref 0.7 |