3 * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
4 * Copyright (C) 2002-2012 The Nucleus Group
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)
13 * @license http://nucleuscms.org/license.txt GNU General Public License
14 * @copyright Copyright (C) 2002-2012 The Nucleus Group
15 * @version $Id: upgrade3.3.php 1388 2009-07-18 06:31:28Z shizuki $
18 function upgrade_do330() {
20 if (upgrade_checkinstall(330))
21 return 'already installed';
23 if (!upgrade_checkIfColumnExists('comment','cemail')) {
24 $query = " ALTER TABLE " . sql_table('comment') . "
25 ADD cemail VARCHAR( 100 ) AFTER cmail ;";
27 upgrade_query('Altering ' . sql_table('comment') . ' table', $query);
30 if (!upgrade_checkIfColumnExists('blog','breqemail')) {
31 $query = " ALTER TABLE " . sql_table('blog') . "
32 ADD breqemail TINYINT( 2 ) DEFAULT '0' NOT NULL ;";
34 upgrade_query('Altering ' . sql_table('blog') . ' table', $query);
37 // check cmail column to separate to URL and cemail
39 'UPDATE ' . sql_table('comment') . ' ' .
40 "SET cemail = cmail, cmail = '' " .
41 "WHERE cmail LIKE '%@%'"
44 if (!upgrade_checkIfColumnExists('item','iposted')) {
45 $query = " ALTER TABLE " . sql_table('item') . "
46 ADD iposted TINYINT(2) DEFAULT 1 NOT NULL ;";
48 upgrade_query('Altering ' . sql_table('item') . ' table', $query);
51 if (!upgrade_checkIfColumnExists('blog','bfuturepost')) {
52 $query = " ALTER TABLE " . sql_table('blog') . "
53 ADD bfuturepost TINYINT(2) DEFAULT 0 NOT NULL ;";
55 upgrade_query('Altering ' . sql_table('blog') . ' table', $query);
59 // update database version
60 update_version('330');
62 // check to see if user turn on Weblogs.com ping, if so, suggest to install the plugin
63 $query = "SELECT bsendping FROM " . sql_table('blog') . " WHERE bsendping='1'";
64 $res = mysql_query($query);
65 if (mysql_num_rows($res) > 0) {
66 echo "<li>Note: The weblogs.com ping function is improved and moved into a plugin. To activate this function in v3.3, please go to plugin menu and install NP_Ping plugin. Also, NP_Ping is replacing NP_PingPong. If you have NP_PingPing installed, please also remove it.</li>";