|
From: Florin C B. <ory...@us...> - 2013-03-18 03:41:27
|
Update of /cvsroot/mxbb/mx_smartor In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30185 Modified Files: db_install.php db_uninstall.php db_upgrade.php Log Message: database schema upgrade for mx_smartor 3.0 and FAP 1.5.0 plus some files Index: db_uninstall.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/db_uninstall.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** db_uninstall.php 3 Mar 2011 14:28:40 -0000 1.13 --- db_uninstall.php 18 Mar 2013 03:41:25 -0000 1.14 *************** *** 39,45 **** "DROP TABLE ".$mx_table_prefix."smartor_album_rate ", "DROP TABLE ".$mx_table_prefix."smartor_album_comment ", "DROP TABLE ".$mx_table_prefix."smartor_album_cat ", "DROP TABLE ".$mx_table_prefix."smartor_album_config ", ! "DROP TABLE ".$mx_table_prefix."smartor_album_sp_config " ); --- 39,46 ---- "DROP TABLE ".$mx_table_prefix."smartor_album_rate ", "DROP TABLE ".$mx_table_prefix."smartor_album_comment ", + "DROP TABLE ".$mx_table_prefix."smartor_album_comment_watch ", "DROP TABLE ".$mx_table_prefix."smartor_album_cat ", "DROP TABLE ".$mx_table_prefix."smartor_album_config ", ! "DROP TABLE ".$mx_table_prefix."smartor_album_sp_config " ); Index: db_install.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/db_install.php,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** db_install.php 9 Aug 2011 04:32:19 -0000 1.35 --- db_install.php 18 Mar 2013 03:41:25 -0000 1.36 *************** *** 37,42 **** switch (PORTAL_BACKEND) { ! case 'internal': ! case 'phpbb2': --- 37,41 ---- switch (PORTAL_BACKEND) { ! case 'internal': case 'phpbb2': *************** *** 52,56 **** } ! $mx_module_version = '2.9.9'; $mx_module_copy = 'Mx-Publisher <i> - smartor album FAP </i> module by <a href="" target="_blank">Jon Ohlsson</a> & <a href="http://mxpcms.sourceforge.net/" target="_blank">Florin C. Bodin</a> & <a href="http://www.icyphoenix.com/" target="_blank">Mighty Gorgon</a> & <a href="http://smartor.is-root.com/" target="_blank">Smartor</a>'; --- 51,55 ---- } ! $mx_module_version = '3.0.0-RC'; $mx_module_copy = 'Mx-Publisher <i> - smartor album FAP </i> module by <a href="" target="_blank">Jon Ohlsson</a> & <a href="http://mxpcms.sourceforge.net/" target="_blank">Florin C. Bodin</a> & <a href="http://www.icyphoenix.com/" target="_blank">Mighty Gorgon</a> & <a href="http://smartor.is-root.com/" target="_blank">Smartor</a>'; *************** *** 93,97 **** $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_sp_config VALUES ('midthumb_cache', '1')"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_sp_config VALUES ('jaime_lettering', '0')"; ! $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('fap_version', '1.4.1')"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('show_index_thumb', '0')"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('show_index_total_pics', '1')"; --- 92,96 ---- $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_sp_config VALUES ('midthumb_cache', '1')"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_sp_config VALUES ('jaime_lettering', '0')"; ! $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('fap_version', '1.5.0')"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('show_index_thumb', '0')"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('show_index_total_pics', '1')"; *************** *** 161,165 **** $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('show_last_comments', '0')"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('enable_mooshow', '0')"; ! $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('enable_fullurl', '0')"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('enable_integration', '1')"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('override_default_pages', '0')"; --- 160,164 ---- $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('show_last_comments', '0')"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('enable_mooshow', '0')"; ! $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('enable_fullurl', '0')"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('enable_integration', '1')"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('override_default_pages', '0')"; *************** *** 169,178 **** $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('show_all_pics_link', '1')"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('show_personal_galleries_link', '1')"; ! $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('fullurl', '".PORTAL_URL."')"; ! $sql[] = "ALTER TABLE ".$mx_table_prefix."smartor_album_rate ADD rate_hon_point TINYINT(3) DEFAULT '0' NOT NULL"; ! $sql[] = "ALTER TABLE ".$mx_table_prefix."smartor_album_cat ADD cat_wm TEXT AFTER cat_desc"; ! $sql[] = "ALTER TABLE ".$mx_table_prefix."smartor_album_cat ADD cat_parent MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER cat_approval"; ! $sql[] = "ALTER TABLE ".$mx_table_prefix."smartor_album_cat ADD cat_user_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER cat_parent"; ! $sql[] = "ALTER TABLE ".$mx_table_prefix."smartor_album_comment ADD comment_cat_id int(11) NOT NULL default '0' AFTER comment_pic_id"; $n = 0; --- 168,172 ---- $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('show_all_pics_link', '1')"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('show_personal_galleries_link', '1')"; ! $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('fullurl', '".PORTAL_URL."')"; $n = 0; *************** *** 206,209 **** --- 200,204 ---- pic_id int(11) UNSIGNED NOT NULL auto_increment, pic_filename varchar(255) NOT NULL, + pic_size INT(15) unsigned NOT NULL DEFAULT '0', pic_thumbnail varchar(255), pic_title mediumtext, *************** *** 253,256 **** --- 248,260 ---- ) TYPE=MyISAM"; + $sql[] = "CREATE TABLE ".$mx_table_prefix."smartor_album_comment_watch ( + pic_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0', + user_id MEDIUMINT(8) NOT NULL DEFAULT '0', + notify_status TINYINT(1) NOT NULL DEFAULT '0', + KEY pic_id (pic_id), + KEY user_id (user_id), + KEY notify_status (notify_status) + ) TYPE=MyISAM"; + $sql[] = "CREATE TABLE ".$mx_table_prefix."smartor_album_cat ( cat_id mediumint(8) UNSIGNED NOT NULL auto_increment, *************** *** 258,261 **** --- 262,266 ---- cat_desc text, cat_wm text, + cat_pics MEDIUMINT(8) unsigned NOT NULL DEFAULT '0', cat_order mediumint(8) NOT NULL, cat_view_level tinyint(3) NOT NULL DEFAULT '-1', Index: db_upgrade.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/db_upgrade.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** db_upgrade.php 9 Aug 2011 04:32:19 -0000 1.32 --- db_upgrade.php 18 Mar 2013 03:41:25 -0000 1.33 *************** *** 47,55 **** $upgrade_2142 = 0; $upgrade_2990 = 0; // // validate before 2.00 // ! $result = $db->sql_query( "SELECT cat_user_id from " . $mx_table_prefix . "smartor_album_cat" ); if (@$db->sql_numrows($result) == 0) { --- 47,56 ---- $upgrade_2142 = 0; $upgrade_2990 = 0; + $upgrade_3000 = 0; // // validate before 2.00 // ! $result = $db->sql_query( "SELECT cat_wm from " . $mx_table_prefix . "smartor_album_cat" ); if (@$db->sql_numrows($result) == 0) { *************** *** 67,85 **** { $upgrade_2990 = 1; ! } $message = "<b>Upgrading!</b><br/><br/>"; if ($upgrade_2000 = 1) { ! $message .= "<b>Upgrading to v. 2.00...</b><br/><br/>"; $sql[] = "UPDATE ". $mx_table_prefix ."smartor_album_config ! SET config_value = '0.54' WHERE config_name = 'album_version'"; $sql[] = "ALTER TABLE ".$mx_table_prefix."smartor_album_cat ADD cat_wm TEXT AFTER cat_desc"; $sql[] = "ALTER TABLE ".$mx_table_prefix."smartor_album_cat ADD cat_parent MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER cat_approval"; $sql[] = "ALTER TABLE ".$mx_table_prefix."smartor_album_cat ADD cat_user_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER cat_parent"; ! $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('fap_version', '1.4.0')"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('show_index_thumb', '0')"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('show_index_total_pics', '1')"; --- 68,91 ---- { $upgrade_2990 = 1; ! } + $result = $db->sql_query( "SELECT config_value from " . $mx_table_prefix . "smartor_album_comment_watch WHERE config_name = 'pic_id'" ); + if (@$db->sql_numrows($result) == 0) + { + $upgrade_3000 = 1; + } $message = "<b>Upgrading!</b><br/><br/>"; if ($upgrade_2000 = 1) { ! $message .= "<b>Upgrading to v. 2.0000...</b><br/><br/>"; $sql[] = "UPDATE ". $mx_table_prefix ."smartor_album_config ! SET config_value = '.0.54' WHERE config_name = 'album_version'"; $sql[] = "ALTER TABLE ".$mx_table_prefix."smartor_album_cat ADD cat_wm TEXT AFTER cat_desc"; $sql[] = "ALTER TABLE ".$mx_table_prefix."smartor_album_cat ADD cat_parent MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER cat_approval"; $sql[] = "ALTER TABLE ".$mx_table_prefix."smartor_album_cat ADD cat_user_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER cat_parent"; ! $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('fap_version', '1.2.0')"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('show_index_thumb', '0')"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('show_index_total_pics', '1')"; *************** *** 163,168 **** $message .= "<b>Upgrading to v. 2.100...</b><br/><br/>"; $sql[] = "UPDATE ". $mx_table_prefix ."smartor_album_config ! SET config_value = '1.4.2' WHERE config_name = 'fap_version'"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('invert_nav_arrows', '0')"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('show_otf_link', '1')"; --- 169,180 ---- $message .= "<b>Upgrading to v. 2.100...</b><br/><br/>"; $sql[] = "UPDATE ". $mx_table_prefix ."smartor_album_config ! SET config_value = '1.3.0' WHERE config_name = 'fap_version'"; + $sql[] = "UPDATE ". $mx_table_prefix ."smartor_album_config + SET config_value = '.0.54' + WHERE config_name = 'album_version'"; + ######################################## + ## BUILD 055 ## + ######################################## $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('invert_nav_arrows', '0')"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('show_otf_link', '1')"; *************** *** 178,184 **** if ($upgrade_2990 = 1) { ! $message .= "<b>Upgrading to v. 2.990...</b><br/><br/>"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('enable_fullurl', '0')"; ! $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('fullurl', '".PORTAL_URL."')"; } else --- 190,232 ---- if ($upgrade_2990 = 1) { ! $message .= "<b>Upgrading to v. 3.000-RC</b><br/><br/>"; ! $sql[] = "UPDATE ". $mx_table_prefix ."smartor_album_config ! SET config_value = '1.4.0' ! WHERE config_name = 'fap_version'"; ! $sql[] = "UPDATE ". $mx_table_prefix ."smartor_album_config ! SET config_value = '.0.55' ! WHERE config_name = 'album_version'"; $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('enable_fullurl', '0')"; ! $sql[] = "INSERT INTO ".$mx_table_prefix."smartor_album_config VALUES ('fullurl', '".PORTAL_URL."')"; ! } ! ! if ($upgrade_3000 = 1) ! { ! $message .= "<b>Upgrading to v. 3.000-RC</b><br/><br/>"; ! $sql[] = "UPDATE ". $mx_table_prefix ."smartor_album_config ! SET config_value = '1.5.0' ! WHERE config_name = 'fap_version'"; ! $sql[] = "UPDATE ". $mx_table_prefix ."smartor_album_config ! SET config_value = '.0.56' ! WHERE config_name = 'album_version'"; ! $sql[] = "CREATE TABLE ".$mx_table_prefix."smartor_album_comment_watch ( ! pic_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0', ! user_id MEDIUMINT(8) NOT NULL DEFAULT '0', ! notify_status TINYINT(1) NOT NULL DEFAULT '0', ! KEY pic_id (pic_id), ! KEY user_id (user_id), ! KEY notify_status (notify_status) ! ) TYPE=MyISAM"; ! ######################################## ! ## BUILD 056 ## ! ######################################## ! $sql[] = "ALTER TABLE ".$mx_table_prefix."smartor_album_cat ADD cat_pics MEDIUMINT(8) unsigned NOT NULL DEFAULT '0' AFTER cat_wm"; ! $sql[] = "ALTER TABLE ".$mx_table_prefix."smartor_album ADD COLUMN pic_size int(15) unsigned default '0' NOT NULL AFTER pic_filename"; ! ! $sql[] = "ALTER TABLE ".$mx_table_prefix."smartor_album_comment CHANGE comment_user_ip comment_user_ip varchar(40) NOT NULL DEFAULT ''"; ! $sql[] = "ALTER TABLE ".$mx_table_prefix."smartor_album_rate CHANGE rate_user_ip rate_user_ip varchar(40) NOT NULL DEFAULT ''"; ! ! $sql[] = "UPDATE ". $mx_table_prefix ."smartor_album_comment ip SET ip.comment_user_ip = INET_NTOA(CONV(ip.comment_user_ip, 16, 10))"; ! $sql[] = "UPDATE ". $mx_table_prefix ."smartor_album_rate ip SET ip.rate_user_ip = INET_NTOA(CONV(ip.rate_user_ip, 16, 10))"; } else *************** *** 186,195 **** $message .= "<b>Nothing to upgrade...</b><br/><br/>"; } ! $sql[] = "UPDATE " . $mx_table_prefix . "module" . " SET module_version = '" . $mx_module_version . "', module_copy = '" . $mx_module_copy . "' WHERE module_id = '" . $mx_module_id . "'"; - $message .= mx_do_install_upgrade($sql); } --- 234,242 ---- $message .= "<b>Nothing to upgrade...</b><br/><br/>"; } ! $sql[] = "UPDATE " . $mx_table_prefix . "module" . " SET module_version = '" . $mx_module_version . "', module_copy = '" . $mx_module_copy . "' WHERE module_id = '" . $mx_module_id . "'"; $message .= mx_do_install_upgrade($sql); } |