OSDN Git Service

78d8b2149fd308d5d29e55ac4e5a975ee4150cc7
[nucleus-jp/nucleus-jp-ancient.git] / nucleus / upgrades / upgrade3.31.php
1 <?php
2 /*
3  * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
4  * Copyright (C) 2002-2012 The Nucleus Group
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  * (see nucleus/documentation/index.html#license for more info)
11  */
12
13 function upgrade_do331() {
14
15     if (upgrade_checkinstall(331))
16         return 'インストール済みです';
17
18     if (!upgrade_checkIfColumnExists('item','iposted')) {
19         $query = "  ALTER TABLE `" . sql_table('item') . "`
20                                 ADD `iposted` TINYINT(2) DEFAULT 1 NOT NULL ;";
21
22         upgrade_query('Altering ' . sql_table('item') . ' table', $query);
23     }
24
25     if (!upgrade_checkIfColumnExists('blog','bfuturepost')) {
26         $query = "  ALTER TABLE `" . sql_table('blog') . "`
27                                 ADD `bfuturepost` TINYINT(2) DEFAULT 0 NOT NULL ;";
28
29         upgrade_query('Altering ' . sql_table('blog') . ' table', $query);
30     }
31
32     // 3.3 -> 3.31
33     // update database version
34     update_version('331');
35
36     // check to see if user turn on Weblogs.com ping, if so, suggest to install the plugin
37     $query = "SELECT bsendping FROM " . sql_table('blog') . " WHERE bsendping='1'"; 
38     $res = mysql_query($query);
39     if (mysql_num_rows($res) > 0) {
40         echo "<li>メモ: weblogs.com ping 機能が向上しプラグイン化されました。この機能を有効化するには、プラグインの管理メニューを開き、NP_Ping プラグインをインストールしてください。また NP_Ping は NP_PingPong を置き換えるものです。もしすでに NP_PingPong をインストール済みであれば削除してください。</li>";
41     }
42 }
43
44 ?>