[geeklog-cvs] Geeklog-1.x/sql/updates mysql_1.4.1_to_1.5.0.php, 1.61, 1.62

Dirk Haun dhaun at qs1489.pair.com
Sun Feb 3 14:11:52 EST 2008


Update of /cvsroot/geeklog/Geeklog-1.x/sql/updates
In directory qs1489.pair.com:/tmp/cvs-serv13605/sql/updates

Modified Files:
	mysql_1.4.1_to_1.5.0.php 
Log Message:
Added Links plugin config to the configuration GUI


Index: mysql_1.4.1_to_1.5.0.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/sql/updates/mysql_1.4.1_to_1.5.0.php,v
retrieving revision 1.61
retrieving revision 1.62
diff -C2 -d -r1.61 -r1.62
*** mysql_1.4.1_to_1.5.0.php	2 Feb 2008 20:03:07 -0000	1.61
--- mysql_1.4.1_to_1.5.0.php	3 Feb 2008 19:11:50 -0000	1.62
***************
*** 331,335 ****
          // Rename the existing config.php as it's not needed any more
          $ren = @rename($plugin_path . 'config.php',
!                        $plugin_path . 'config-pre1.4.3.php');
      }
  
--- 331,335 ----
          // Rename the existing config.php as it's not needed any more
          $ren = @rename($plugin_path . 'config.php',
!                        $plugin_path . 'config-pre1.5.0.php');
      }
  
***************
*** 370,374 ****
  }
  
! // spamx plugin updates
  function upgrade_SpamXPlugin()
  {
--- 370,374 ----
  }
  
! // Spam-X plugin updates
  function upgrade_SpamXPlugin()
  {
***************
*** 398,407 ****
      }
  
      return true;
  }
  
  function upgrade_LinksPlugin()
  {
!     global $_TABLES, $_LI_CONF;
  
      $P_SQL = array();
--- 398,432 ----
      }
  
+     if (file_exists($plugin_path . 'config.php')) {
+         // Rename the existing config.php as it's not needed any more
+         $ren = @rename($plugin_path . 'config.php',
+                        $plugin_path . 'config-pre1.5.0.php');
+     }
+ 
      return true;
  }
  
+ // Links plugin updates
  function upgrade_LinksPlugin()
  {
!     global $_CONF, $_TABLES;
! 
!     require_once $_CONF['path_system'] . 'classes/config.class.php';
! 
!     $plugin_path = $_CONF['path'] . 'plugins/links/';
!     require_once $plugin_path . 'install_defaults.php';
! 
!     if (!plugin_initconfig_links()) {
!         echo 'There was an error upgrading the Links plugin';
!         return false;
!     }
! 
!     $li_config = config::get_instance();
!     $_LI_CONF = $li_config->get_config('links');
! 
!     if (empty($_LI_CONF['root'])) {
!         $_LI_CONF['root'] = 'site';
!     }
!     $root = addslashes($_LI_CONF['root']);
  
      $P_SQL = array();
***************
*** 432,441 ****
      $P_SQL[] = "ALTER TABLE {$_TABLES['linksubmission']} CHANGE category cid varchar(32) NOT NULL";
      $P_SQL[] = "ALTER TABLE {$_TABLES['links']} CHANGE category cid varchar(32) NOT NULL";
!     $P_SQL[] = "INSERT INTO {$_TABLES['linkcategories']} (cid, pid, category, description, tid, created, modified, group_id, owner_id, perm_owner, perm_group, perm_members, perm_anon) "
!         . "VALUES ('site', 'root', 'Root', 'Website root', '', NOW(), NOW(), 5, 2, 3, 3, 2, 2)";
!     $P_SQL[] = "INSERT INTO {$_TABLES['blocks']} (is_enabled, name, type, title, tid, blockorder, content, allow_autotags, rdfurl, rdfupdated, rdflimit, onleft, phpblockfn, help, owner_id, group_id, perm_owner, perm_group, perm_members, perm_anon) "
!         . "VALUES (1, 'links_topic_links', 'phpblock', 'Topic Links', 'all', 0, '', 0, '', '0000-00-00 00:00:00', 0, 0, 'phpblock_topic_links', '', 2, {$blockadmin_id}, 3, 3, 2, 2)";
!     $P_SQL[] = "INSERT INTO {$_TABLES['blocks']} (is_enabled, name, type, title, tid, blockorder, content, allow_autotags, rdfurl, rdfupdated, rdflimit, onleft, phpblockfn, help, owner_id, group_id, perm_owner, perm_group, perm_members, perm_anon) "
!         . "VALUES (1, 'links_topic_categories', 'phpblock', 'Topic Categories', 'all', 0, '', 0, '', '0000-00-00 00:00:00', 0, 0, 'phpblock_topic_categories', '', 2, {$blockadmin_id}, 3, 3, 2, 2)";
      $P_SQL[] = "UPDATE {$_TABLES['plugins']} SET pi_version = '2.0.0', pi_gl_version='1.5.0' WHERE pi_name='links'";
  
--- 457,463 ----
      $P_SQL[] = "ALTER TABLE {$_TABLES['linksubmission']} CHANGE category cid varchar(32) NOT NULL";
      $P_SQL[] = "ALTER TABLE {$_TABLES['links']} CHANGE category cid varchar(32) NOT NULL";
!     $P_SQL[] = "INSERT INTO {$_TABLES['linkcategories']} (cid, pid, category, description, tid, created, modified, group_id, owner_id, perm_owner, perm_group, perm_members, perm_anon) VALUES ('{$root}', 'root', 'Root', 'Website root', NULL, NOW(), NOW(), 5, 2, 3, 3, 2, 2)";
!     $P_SQL[] = "INSERT INTO {$_TABLES['blocks']} (is_enabled, name, type, title, tid, blockorder, content, allow_autotags, rdfurl, rdfupdated, rdflimit, onleft, phpblockfn, help, owner_id, group_id, perm_owner, perm_group, perm_members, perm_anon) VALUES (1, 'links_topic_links', 'phpblock', 'Topic Links', 'all', 0, '', 0, '', '0000-00-00 00:00:00', 0, 0, 'phpblock_topic_links', '', 2, {$blockadmin_id}, 3, 3, 2, 2)";
!     $P_SQL[] = "INSERT INTO {$_TABLES['blocks']} (is_enabled, name, type, title, tid, blockorder, content, allow_autotags, rdfurl, rdfupdated, rdflimit, onleft, phpblockfn, help, owner_id, group_id, perm_owner, perm_group, perm_members, perm_anon) VALUES (1, 'links_topic_categories', 'phpblock', 'Topic Categories', 'all', 0, '', 0, '', '0000-00-00 00:00:00', 0, 0, 'phpblock_topic_categories', '', 2, {$blockadmin_id}, 3, 3, 2, 2)";
      $P_SQL[] = "UPDATE {$_TABLES['plugins']} SET pi_version = '2.0.0', pi_gl_version='1.5.0' WHERE pi_name='links'";
  
***************
*** 452,459 ****
      $group_id = DB_getItem($_TABLES['groups'], 'grp_id',
                             "grp_name = 'Links Admin'");
-     if (empty($_LI_CONF['root'])) {
-         $_LI_CONF['root'] = 'site';
-     }
-     $root = addslashes($_LI_CONF['root']);
  
      // loop through adding to category table, then update links table with cids
--- 474,477 ----
***************
*** 461,469 ****
      $nrows = DB_numRows($result);
      for ($i = 0; $i < $nrows; $i++) {
          $A = DB_fetchArray($result);
          $category = addslashes($A['category']);
          $cid = $category;
!         DB_query("INSERT INTO {$_TABLES['linkcategories']} (cid,pid,category,description,tid,owner_id,group_id,created,modified) "
!             . "VALUES ('{$cid}','{$root}','{$category}','{$category}','all',2,'{$group_id}',NOW(),NOW())",1);
          if ($cid != $category) { // still experimenting ...
              DB_query("UPDATE {$_TABLES['links']} SET cid='{$cid}' WHERE cid='{$category}'",1);
--- 479,487 ----
      $nrows = DB_numRows($result);
      for ($i = 0; $i < $nrows; $i++) {
+ 
          $A = DB_fetchArray($result);
          $category = addslashes($A['category']);
          $cid = $category;
!         DB_query("INSERT INTO {$_TABLES['linkcategories']} (cid,pid,category,description,tid,owner_id,group_id,created,modified) VALUES ('{$cid}','{$root}','{$category}','{$category}','all',2,'{$group_id}',NOW(),NOW())",1);
          if ($cid != $category) { // still experimenting ...
              DB_query("UPDATE {$_TABLES['links']} SET cid='{$cid}' WHERE cid='{$category}'",1);
***************
*** 473,476 ****
--- 491,500 ----
              return false;
          }
+     }
+ 
+     if (file_exists($plugin_path . 'config.php')) {
+         // Rename the existing config.php as it's not needed any more
+         $ren = @rename($plugin_path . 'config.php',
+                        $plugin_path . 'config-pre1.5.0.php');
      }
  




More information about the geeklog-cvs mailing list