[geeklog-cvs] geeklog: Updated Geeklog from 1.9.0 to 2.0.0

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Thu Mar 22 20:49:47 EDT 2012


changeset 8546:32bfb8b273a2
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/32bfb8b273a2
user: Tom <websitemaster at cogeco.net>
date: Thu Mar 22 20:41:56 2012 -0400
description:
Updated Geeklog from 1.9.0 to 2.0.0

diffstat:

 plugins/links/autoinstall.php             |    2 +-
 plugins/staticpages/autoinstall.php       |    2 +-
 public_html/admin/install/lib-install.php |    2 +-
 public_html/admin/install/lib-upgrade.php |   10 +-
 public_html/siteconfig.php.dist           |    2 +-
 sql/updates/mssql_1.8.1_to_2.0.0.php      |  126 ++++++++++++++++++++++++++++++
 sql/updates/mysql_1.8.1_to_2.0.0.php      |  124 +++++++++++++++++++++++++++++
 sql/updates/pgsql_1.8.1_to_2.0.0.php      |  126 ++++++++++++++++++++++++++++++
 8 files changed, 385 insertions(+), 9 deletions(-)

diffs (truncated from 461 to 300 lines):

diff -r 2593957646db -r 32bfb8b273a2 plugins/links/autoinstall.php
--- a/plugins/links/autoinstall.php	Tue Mar 20 12:32:59 2012 -0400
+++ b/plugins/links/autoinstall.php	Thu Mar 22 20:41:56 2012 -0400
@@ -52,7 +52,7 @@
         'pi_name'         => $pi_name,
         'pi_display_name' => $pi_display_name,
         'pi_version'      => '2.1.2',
-        'pi_gl_version'   => '1.9.0',
+        'pi_gl_version'   => '2.0.0',
         'pi_homepage'     => 'http://www.geeklog.net/'
     );
 
diff -r 2593957646db -r 32bfb8b273a2 plugins/staticpages/autoinstall.php
--- a/plugins/staticpages/autoinstall.php	Tue Mar 20 12:32:59 2012 -0400
+++ b/plugins/staticpages/autoinstall.php	Thu Mar 22 20:41:56 2012 -0400
@@ -52,7 +52,7 @@
         'pi_name'         => $pi_name,
         'pi_display_name' => $pi_display_name,
         'pi_version'      => '1.6.5',
-        'pi_gl_version'   => '1.9.0',
+        'pi_gl_version'   => '2.0.0',
         'pi_homepage'     => 'http://www.geeklog.net/'
     );
 
diff -r 2593957646db -r 32bfb8b273a2 public_html/admin/install/lib-install.php
--- a/public_html/admin/install/lib-install.php	Tue Mar 20 12:32:59 2012 -0400
+++ b/public_html/admin/install/lib-install.php	Thu Mar 22 20:41:56 2012 -0400
@@ -56,7 +56,7 @@
     * This constant defines Geeklog's version number. It will be written to
     * siteconfig.php and the database (in the latter case minus any suffix).
     */
-    define('VERSION', '1.9.0');
+    define('VERSION', '2.0.0');
 }
 if (!defined('XHTML')) {
     define('XHTML', ' /');
diff -r 2593957646db -r 32bfb8b273a2 public_html/admin/install/lib-upgrade.php
--- a/public_html/admin/install/lib-upgrade.php	Tue Mar 20 12:32:59 2012 -0400
+++ b/public_html/admin/install/lib-upgrade.php	Thu Mar 22 20:41:56 2012 -0400
@@ -482,16 +482,16 @@
             // there were no database changes in 1.8.0
 
         case '1.8.1':
-            require_once $_CONF['path'] . 'sql/updates/' . $_DB_dbms . '_1.8.1_to_1.9.0.php';
+            require_once $_CONF['path'] . 'sql/updates/' . $_DB_dbms . '_1.8.1_to_2.0.0.php';
             INST_updateDB($_SQL);
             
-            update_ConfValuesFor190();
+            update_ConfValuesFor200();
             
-            update_BlockTopicAssignmentsFor190();
+            update_BlockTopicAssignmentsFor200();
             
-            update_StoryTopicAssignmentsFor190();
+            update_StoryTopicAssignmentsFor200();
             
-            $current_gl_version = '1.9.0';
+            $current_gl_version = '2.0.0';
             $_SQL = '';
             break;
             
diff -r 2593957646db -r 32bfb8b273a2 public_html/siteconfig.php.dist
--- a/public_html/siteconfig.php.dist	Tue Mar 20 12:32:59 2012 -0400
+++ b/public_html/siteconfig.php.dist	Thu Mar 22 20:41:56 2012 -0400
@@ -38,7 +38,7 @@
   define('LB',"\n");
 }
 if (!defined('VERSION')) {
-  define('VERSION', '1.9.0');
+  define('VERSION', '2.0.0');
 }
 
 ?>
diff -r 2593957646db -r 32bfb8b273a2 sql/updates/mssql_1.8.1_to_2.0.0.php
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sql/updates/mssql_1.8.1_to_2.0.0.php	Thu Mar 22 20:41:56 2012 -0400
@@ -0,0 +1,126 @@
+<?php
+
+// Add Topic Assignment Table
+$_SQL[] = "
+CREATE TABLE  [dbo].[{$_TABLES['topic_assignments']}] (
+  [tid] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
+  [type]  [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
+  [id]  [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, 
+  [inherit] [tinyint] NOT NULL, 
+  [tdefault] [tinyint] NOT NULL
+) ON [PRIMARY]
+";
+
+// Add new Topic Columns used for Child Topics
+$_SQL[] = "ALTER TABLE {$_TABLES['topics']} ADD [parent_id] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL AFTER [archive_flag]";
+$_SQL[] = "ALTER TABLE {$_TABLES['topics']} ADD [inherit] [tinyint] NOT NULL AFTER [parent_id]";
+$_SQL[] = "ALTER TABLE {$_TABLES['topics']} ADD [hidden] [tinyint] NOT NULL AFTER [inherit]";
+
+// Update Session Table
+$_SQL[] = "ALTER TABLE {$_TABLES['sessions']} ADD [whos_online] [tinyint] NOT NULL AFTER [md5_sess_id]";
+$_SQL[] = "ALTER TABLE {$_TABLES['sessions']} ADD [topic] [varchar] (20) NOT NULL AFTER [whos_online]";
+
+// Password Updates
+$_SQL[] = "ALTER TABLE {$_TABLES['users']} ALTER COLUMN [passwd] [varchar] (128) NOT NULL default ''";
+$_SQL[] = "ALTER TABLE {$_TABLES['users']} ADD [salt] [varchar] (64) NOT NULL default '' AFTER [passwd]";
+$_SQL[] = "ALTER TABLE {$_TABLES['users']} ADD [algorithm] [tinyint] NOT NULL default '0' AFTER [salt]";
+$_SQL[] = "ALTER TABLE {$_TABLES['users']} ADD [stretch] [int] NOT NULL default '1' AFTER [algorithm]";
+
+/**
+ * Create Story and Submission Topic assignments
+ *
+ */
+function update_StoryTopicAssignmentsFor200()
+{
+    global $_TABLES;
+    
+    $story_tables[] = $_TABLES['stories'];
+    $story_tables[] = $_TABLES['storysubmission'];
+
+    foreach ($story_tables as $story_table) {
+        $sql = "SELECT * FROM $story_table";
+        $result = DB_query($sql);
+        $nrows = DB_numRows($result);
+    
+        for ($i = 0; $i < $nrows; $i++) {
+            $A = DB_fetchArray($result);
+            
+            $sql = "INSERT INTO {$_TABLES['topic_assignments']} (tid, type, id, inherit, tdefault) VALUES ('{$A['tid']}', 'article', '{$A['sid']}', 1, 1)";
+            DB_query($sql);
+        }
+        
+        // Remove tid from table
+        $sql = "ALTER TABLE $story_table DROP tid";
+        DB_query($sql);
+    }
+
+}
+
+/**
+ * Create Block Topic assignments
+ *
+ */
+function update_BlockTopicAssignmentsFor200()
+{
+    global $_TABLES;
+    
+    
+    $sql = "SELECT * FROM {$_TABLES['blocks']}";
+    $result = DB_query($sql);
+    $nrows = DB_numRows($result);
+
+    for ($i = 0; $i < $nrows; $i++) {
+        $A = DB_fetchArray($result);
+        
+        $sql = "INSERT INTO {$_TABLES['topic_assignments']} (tid, type, id, inherit, tdefault) VALUES ('{$A['tid']}', 'block', '{$A['bid']}', 1, 0)";
+        DB_query($sql);
+    }
+
+    // Remove Topic Id from blocks table
+    $sql = "ALTER TABLE {$_TABLES['blocks']} DROP tid";    
+    DB_query($sql);
+    
+}
+
+
+/**
+ * Add new config options
+ *
+ */
+function update_ConfValuesFor200()
+{
+    global $_CONF, $_TABLES;
+
+    require_once $_CONF['path_system'] . 'classes/config.class.php';
+
+    $c = config::get_instance();
+
+    $me = 'Core';
+    
+    // Breadcrumbs
+    $c->add('tab_topics', NULL, 'tab', 7, 45, NULL, 0, TRUE, $me, 45);
+    $c->add('fs_breadcrumbs', NULL, 'fieldset', 7, 45, NULL, 0, TRUE, $me, 45);
+    $c->add('disable_breadcrumbs_topics', 0, 'select', 7, 45, 0, 2000, TRUE, $me, 45);
+    $c->add('disable_breadcrumbs_articles', 0, 'select', 7, 45, 0, 2010, TRUE, $me, 45);
+    $c->add('disable_breadcrumbs_plugins', 0, 'select', 7, 45, 0, 2020, TRUE, $me, 45);    
+    
+    // Password Update
+    $c->add('fs_pass', NULL, 'fieldset', 4, 42, NULL, 0, TRUE, $me, 18);
+    $c->add('pass_alg', 1, 'select', 4, 42, 29, 800, TRUE, $me, 18);
+    $c->add('pass_stretch', 4096, 'text', 4, 42, NULL, 810, TRUE, $me, 18);
+
+    // Max Link Text
+    $c->add('linktext_maxlen',50,'text',7,31,NULL,1754,TRUE, $me,31);   
+    
+    // Email CC settings
+    $c->add('mail_cc_enabled', 1, 'select', 0, 1, 0, 180, TRUE, $me, 1);
+    $c->add('mail_cc_default', 0, 'select', 0, 1, 0, 190, TRUE, $me, 1);
+
+    // Comments    
+    $c->add('comment_on_same_page',0,'select',4,21,0, 1690, TRUE, $me, 21);
+    $c->add('show_comments_at_replying',0,'select',4,21,0, 1691, TRUE, $me, 21);      
+    
+    return true;
+}
+
+?>
diff -r 2593957646db -r 32bfb8b273a2 sql/updates/mysql_1.8.1_to_2.0.0.php
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sql/updates/mysql_1.8.1_to_2.0.0.php	Thu Mar 22 20:41:56 2012 -0400
@@ -0,0 +1,124 @@
+<?php
+
+// Add Topic Assignment Table
+$_SQL[] = "
+CREATE TABLE `{$_TABLES['topic_assignments']}` (
+  `tid` varchar(20) NOT NULL,
+  `type` varchar(30) NOT NULL,
+  `id` varchar(40) NOT NULL,
+  `inherit` tinyint(1) NOT NULL default '1',
+  `tdefault` tinyint(1) NOT NULL default '0',
+  PRIMARY KEY  (`tid`,`type`,`id`)
+) ENGINE=MyISAM";
+
+// Add new Topic Columns used for Child Topics
+$_SQL[] = "ALTER TABLE {$_TABLES['topics']} ADD parent_id varchar(20) NOT NULL default 'root' AFTER archive_flag";
+$_SQL[] = "ALTER TABLE {$_TABLES['topics']} ADD inherit tinyint(1) NOT NULL default '1' AFTER parent_id";
+$_SQL[] = "ALTER TABLE {$_TABLES['topics']} ADD hidden tinyint(1) NOT NULL default '0' AFTER inherit";
+
+// Update Session Table
+$_SQL[] = "ALTER TABLE {$_TABLES['sessions']} ADD whos_online tinyint(1) NOT NULL default '1' AFTER md5_sess_id";
+$_SQL[] = "ALTER TABLE {$_TABLES['sessions']} ADD topic varchar(20) NOT NULL default '' AFTER whos_online";
+
+// Password Updates
+$_SQL[] = "ALTER TABLE {$_TABLES['users']} MODIFY passwd varchar(128) NOT NULL default ''";
+$_SQL[] = "ALTER TABLE {$_TABLES['users']} ADD salt varchar(64) NOT NULL default '' AFTER passwd";
+$_SQL[] = "ALTER TABLE {$_TABLES['users']} ADD algorithm tinyint(3) NOT NULL default 0 AFTER salt";
+$_SQL[] = "ALTER TABLE {$_TABLES['users']} ADD stretch int(8) unsigned NOT NULL default 1 AFTER algorithm";
+
+/**
+ * Create Story and Submission Topic assignments
+ *
+ */
+function update_StoryTopicAssignmentsFor200()
+{
+    global $_TABLES;
+    
+    $story_tables[] = $_TABLES['stories'];
+    $story_tables[] = $_TABLES['storysubmission'];
+
+    foreach ($story_tables as $story_table) {
+        $sql = "SELECT * FROM $story_table";
+        $result = DB_query($sql);
+        $nrows = DB_numRows($result);
+    
+        for ($i = 0; $i < $nrows; $i++) {
+            $A = DB_fetchArray($result);
+            
+            $sql = "INSERT INTO {$_TABLES['topic_assignments']} (tid, type, id, inherit, tdefault) VALUES ('{$A['tid']}', 'article', '{$A['sid']}', 1, 1)";
+            DB_query($sql);
+        }
+        
+        // Remove tid from table
+        $sql = "ALTER TABLE $story_table DROP tid";
+        DB_query($sql);
+    }
+
+}
+
+/**
+ * Create Block Topic assignments
+ *
+ */
+function update_BlockTopicAssignmentsFor200()
+{
+    global $_TABLES;
+    
+    $sql = "SELECT * FROM {$_TABLES['blocks']}";
+    $result = DB_query($sql);
+    $nrows = DB_numRows($result);
+
+    for ($i = 0; $i < $nrows; $i++) {
+        $A = DB_fetchArray($result);
+        
+        $sql = "INSERT INTO {$_TABLES['topic_assignments']} (tid, type, id, inherit, tdefault) VALUES ('{$A['tid']}', 'block', '{$A['bid']}', 1, 0)";
+        DB_query($sql);
+    }
+
+    // Remove Topic Id from blocks table
+    $sql = "ALTER TABLE {$_TABLES['blocks']} DROP `tid`";    
+    DB_query($sql);
+    
+}
+
+/**
+ * Add new config options
+ *
+ */
+function update_ConfValuesFor200()
+{
+    global $_CONF, $_TABLES;
+
+    require_once $_CONF['path_system'] . 'classes/config.class.php';
+



More information about the geeklog-cvs mailing list