[geeklog-cvs] Geeklog-1.x/public_html/admin/plugins/polls install.php, 1.19, 1.20

Dirk Haun dhaun at qs1489.pair.com
Sat Mar 15 14:11:45 EDT 2008


Update of /cvsroot/geeklog/Geeklog-1.x/public_html/admin/plugins/polls
In directory qs1489.pair.com:/tmp/cvs-serv92558/public_html/admin/plugins/polls

Modified Files:
	install.php 
Log Message:
Polls plugin configuration


Index: install.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/admin/plugins/polls/install.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** install.php	10 Oct 2007 02:00:21 -0000	1.19
--- install.php	15 Mar 2008 18:11:42 -0000	1.20
***************
*** 3,7 ****
  /* Reminder: always indent with 4 spaces (no tabs). */
  // +---------------------------------------------------------------------------+
! // | Polls plugin 1.1 for Geeklog                                              |
  // +---------------------------------------------------------------------------+
  // | install.php                                                               |
--- 3,7 ----
  /* Reminder: always indent with 4 spaces (no tabs). */
  // +---------------------------------------------------------------------------+
! // | Polls plugin 2.0 for Geeklog                                              |
  // +---------------------------------------------------------------------------+
  // | install.php                                                               |
***************
*** 12,16 ****
  // | Based on the Universal Plugin and prior work by the following authors:    |
  // |                                                                           |
! // | Copyright (C) 2002-2006 by the following authors:                         |
  // |                                                                           |
  // | Authors: Tony Bibbs        - tony AT tonybibbs DOT com                    |
--- 12,16 ----
  // | Based on the Universal Plugin and prior work by the following authors:    |
  // |                                                                           |
! // | Copyright (C) 2002-2008 by the following authors:                         |
  // |                                                                           |
  // | Authors: Tony Bibbs        - tony AT tonybibbs DOT com                    |
***************
*** 39,44 ****
  // $Id$
  
! require_once ('../../../lib-common.php');
! require_once ($_CONF['path'] . 'plugins/polls/config.php');
  
  // Plugin information
--- 39,43 ----
  // $Id$
  
! require_once '../../../lib-common.php';
  
  // Plugin information
***************
*** 48,55 ****
  $pi_display_name = 'Polls';
  $pi_name         = 'polls';
! $pi_version      = $_PO_CONF['version'];
! $gl_version      = '1.4.1';
  $pi_url          = 'http://www.geeklog.net/';
  
  // name of the Admin group
  $pi_admin        = $pi_display_name . ' Admin';
--- 47,56 ----
  $pi_display_name = 'Polls';
  $pi_name         = 'polls';
! $pi_version      = '2.0.1';
! $gl_version      = '1.5.0';
  $pi_url          = 'http://www.geeklog.net/';
  
+ $base_path = $_CONF['path'] . 'plugins/' . $pi_name . '/';
+ 
  // name of the Admin group
  $pi_admin        = $pi_display_name . ' Admin';
***************
*** 96,99 ****
--- 97,116 ----
  
  /**
+ * Loads the configuration records for the GL Online Config Manager
+ *
+ * @return   boolean     true = proceed with install, false = an error occured
+ *
+ */
+ function plugin_load_configuration()
+ {
+     global $_CONF, $base_path;
+ 
+     require_once $_CONF['path_system'] . 'classes/config.class.php';
+     require_once $base_path . 'install_defaults.php';
+ 
+     return plugin_initconfig_polls();
+ }
+ 
+ /**
  * When the install went through, give the plugin a chance for any
  * plugin-specific post-install fixes
***************
*** 127,130 ****
--- 144,148 ----
  }
  
+ 
  //
  // ----------------------------------------------------------------------------
***************
*** 133,145 ****
  // require modifications.
  
- $base_path = $_CONF['path'] . 'plugins/' . $pi_name . '/';
  $langfile = $base_path . $_CONF['language'] . '.php';
! if (file_exists ($langfile)) {
!     require_once ($langfile);
  } else {
!     require_once ($base_path . 'language/english.php');
  }
! require_once ($base_path . 'config.php');
! require_once ($base_path . 'functions.inc');
  
  
--- 151,161 ----
  // require modifications.
  
  $langfile = $base_path . $_CONF['language'] . '.php';
! if (file_exists($langfile)) {
!     require_once $langfile;
  } else {
!     require_once $base_path . 'language/english.php';
  }
! require_once $base_path . 'functions.inc';
  
  
***************
*** 182,186 ****
          if (DB_error ()) {
              PLG_uninstall ($pi_name);
- 
              return false;
          }
--- 198,201 ----
***************
*** 202,206 ****
  
      if (count ($_SQL) > 0) {
!          $use_innodb = false;
          if (($_DB_dbms == 'mysql') &&
              (DB_getItem ($_TABLES['vars'], 'value', "name = 'database_engine'")
--- 217,221 ----
  
      if (count ($_SQL) > 0) {
!         $use_innodb = false;
          if (($_DB_dbms == 'mysql') &&
              (DB_getItem ($_TABLES['vars'], 'value', "name = 'database_engine'")
***************
*** 270,274 ****
          DB_query ($sql, 1);
          if (DB_error ()) {
-             COM_errorLog ($sql, 1);
              PLG_uninstall ($pi_name);
  
--- 285,288 ----
***************
*** 277,280 ****
--- 291,302 ----
      }
  
+     // Load the online configuration records
+     if (function_exists('plugin_load_configuration')) {
+         if (!plugin_load_configuration()) {
+             PLG_uninstall($pi_name);
+             return false;
+         }
+     }
+ 
      // Finally, register the plugin with Geeklog
      COM_errorLog ("Registering $pi_display_name plugin with Geeklog", 1);
***************
*** 311,315 ****
  
  if ($_REQUEST['action'] == 'uninstall') {
!     if (PLG_uninstall ($pi_name)) {
          $display = COM_refresh ($_CONF['site_admin_url']
                                  . '/plugins.php?msg=45');
--- 333,338 ----
  
  if ($_REQUEST['action'] == 'uninstall') {
!     $uninstall_plugin = 'plugin_uninstall_' . $pi_name;
!     if ($uninstall_plugin ()) {
          $display = COM_refresh ($_CONF['site_admin_url']
                                  . '/plugins.php?msg=45');
***************
*** 337,359 ****
                   . COM_siteFooter ();
      }
- } else if ($_REQUEST['action'] == 'upgrade') {
-     $result = PLG_upgrade ($pi_name);
-     if ($result > 0 ) {
-         if ($result === TRUE) { // Catch returns that are just true/false
-             $display .= COM_refresh ($_CONF['site_admin_url']
-                     . '/plugins.php?msg=60');
-         } else {  // Plugin returned a message number
-             $display = COM_refresh ($_CONF['site_admin_url']
-                     . '/plugins.php?msg=' . $result . '&plugin='
-                     . $pi_name);
-         }
-     } else {  // Plugin function returned a false
-         $timestamp = strftime ($_CONF['daytime']);
-         $display .= COM_showMessage($LANG08[6]);
-     }
- } else if (DB_getItem($_TABLES['plugins'],'pi_version','pi_name="polls"') !== $_PO_CONF['version']) {
-     $display .= $LANG_POLLS['upgrade1']
-         . COM_createLink($LANG_POLLS['upgrade2'], $_CONF['site_admin_url']
-         . '/plugins/polls/install.php?action=upgrade');
  } else {
      // plugin already installed
--- 360,363 ----




More information about the geeklog-cvs mailing list