[geeklog-cvs] geeklog-1.3/public_html/admin/install install.php,1.43,1.44

dhaun at geeklog.net dhaun at geeklog.net
Sun Mar 9 13:10:28 EST 2003


Update of /usr/cvs/geeklog/geeklog-1.3/public_html/admin/install
In directory internal.geeklog.net:/tmp/cvs-serv5818

Modified Files:
	install.php 
Log Message:
Fixed spelling of staticpages.PHP feature (upercase "PHP"),
test for static pages plugin can now identify a) not installed, b) original version, c) Phill's or Tom's version, d) v1.3


Index: install.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/admin/install/install.php,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** install.php	9 Mar 2003 11:47:22 -0000	1.43
--- install.php	9 Mar 2003 18:10:26 -0000	1.44
***************
*** 215,219 ****
  * Checks for Static Pages Version
  *
! * @return   1 if Static Pages 1.1 by Phill or 1.2 by Tom, 0 if original Static Pages
  *
  */
--- 215,219 ----
  * Checks for Static Pages Version
  *
! * @return   0 = not installed, 1 = original plugin, 2 = plugin by Phill or Tom, 3 = v1.3
  *
  */
***************
*** 222,235 ****
      global $_TABLES;
  
!     $result = DB_query ("SELECT * FROM {$_TABLES['staticpage']}");
!     $A = DB_fetchArray ($result);
!     $fields = array ();
!     foreach ($A as $name => $value) {
!         $fields[] = $name;
!     }
!     if (in_array ('sp_pos',$fields,true)) {  
!         $retval = 1;
!     } else {
!         $retval = 0;
      }
  
--- 222,242 ----
      global $_TABLES;
  
!     $retval = 0;
! 
!     if (DB_count ($_TABLES['plugins'], 'pi_name', 'staticpages') > 0) {
!         $result = DB_query ("DESCRIBE {$_TABLES['staticpage']}");
!         $numrows = DB_numRows ($result);
! 
!         $retval = 1; // assume v1.1 for now ...
! 
!         for ($i = 0; $i < $numrows; $i++) {
!             $A = DB_fetchArray ($result);
!             if ($A[0] == 'sp_nf') {
!                 $retval = 3; // v1.3
!                 break;
!             } elseif ($A[0] == 'sp_pos') {
!                 $retval = 2; // v1.2
!             }
!         }
      }
  
***************
*** 392,396 ****
              // upgrade Static Pages plugin
              $spversion = get_SP_ver ();
!             if ($spversion == 0) { // original version
                  DB_query ("ALTER TABLE {$_TABLES['staticpage']} "
                      . "ADD COLUMN group_id mediumint(8) unsigned DEFAULT '1',"
--- 399,403 ----
              // upgrade Static Pages plugin
              $spversion = get_SP_ver ();
!             if ($spversion == 1) { // original version
                  DB_query ("ALTER TABLE {$_TABLES['staticpage']} "
                      . "ADD COLUMN group_id mediumint(8) unsigned DEFAULT '1',"
***************
*** 402,410 ****
                      . "ADD COLUMN sp_php tinyint(1) unsigned DEFAULT '0',"
                      . "ADD COLUMN sp_nf tinyint(1) unsigned DEFAULT '0'");
!                 DB_query ("INSERT INTO {$_TABLES['features']} (ft_name, ft_descr) VALUES ('staticpages.php','Ability to use PHP in static pages')");
                  $php_id = DB_insertId ();
                  $group_id = DB_getItem ($_TABLES['groups'], 'grp_id', "grp_name = 'Static Page Admin'");
                  DB_query ("INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES ($php_id, $group_id)");
!             } else { // extended version by Phill or Tom
                  DB_query ("ALTER TABLE {$_TABLES['staticpage']} "
                      . "DROP COLUMN sp_pos,"
--- 409,417 ----
                      . "ADD COLUMN sp_php tinyint(1) unsigned DEFAULT '0',"
                      . "ADD COLUMN sp_nf tinyint(1) unsigned DEFAULT '0'");
!                 DB_query ("INSERT INTO {$_TABLES['features']} (ft_name, ft_descr) VALUES ('staticpages.PHP','Ability to use PHP in static pages')");
                  $php_id = DB_insertId ();
                  $group_id = DB_getItem ($_TABLES['groups'], 'grp_id', "grp_name = 'Static Page Admin'");
                  DB_query ("INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES ($php_id, $group_id)");
!             } elseif ($spversion == 2) { // extended version by Phill or Tom
                  DB_query ("ALTER TABLE {$_TABLES['staticpage']} "
                      . "DROP COLUMN sp_pos,"
***************
*** 412,422 ****
                      . "ADD COLUMN sp_nf tinyint(1) unsigned DEFAULT '0'");
              }
-             DB_query ("UPDATE {$_TABLES['plugins']} SET pi_version = '1.3' WHERE pi_name = 'staticpages'");
  
!             // remove Static Pages 'lock' flag
!             DB_query ("DELETE FROM {$_TABLES['vars']} WHERE name = 'staticpages'");
  
!             // remove Static Pages Admin group id
!             DB_query ("DELETE FROM {$_TABLES['vars']} WHERE name = 'sp_group_id'");
  
              $current_gl_version = '1.3.8';
--- 419,433 ----
                      . "ADD COLUMN sp_nf tinyint(1) unsigned DEFAULT '0'");
              }
  
!             if ($spversion > 0) {
!                 // update plugin version number
!                 DB_query ("UPDATE {$_TABLES['plugins']} SET pi_version = '1.3' WHERE pi_name = 'staticpages'");
  
!                 // remove Static Pages 'lock' flag
!                 DB_query ("DELETE FROM {$_TABLES['vars']} WHERE name = 'staticpages'");
! 
!                 // remove Static Pages Admin group id
!                 DB_query ("DELETE FROM {$_TABLES['vars']} WHERE name = 'sp_group_id'");
!             }
  
              $current_gl_version = '1.3.8';





More information about the geeklog-cvs mailing list