[geeklog-cvs] Geeklog-1.x/plugins/staticpages config.php, 1.20, 1.21 functions.inc, 1.106, 1.107

Blaine Lang blaine at qs1489.pair.com
Thu Jan 3 18:58:49 EST 2008


Update of /cvsroot/geeklog/Geeklog-1.x/plugins/staticpages
In directory qs1489.pair.com:/tmp/cvs-serv19670

Modified Files:
	config.php functions.inc 
Log Message:
Updates to support new config class. You can now run the plugin upgrade and it will add the new config table records.

Index: functions.inc
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/plugins/staticpages/functions.inc,v
retrieving revision 1.106
retrieving revision 1.107
diff -C2 -d -r1.106 -r1.107
*** functions.inc	31 Dec 2007 12:48:46 -0000	1.106
--- functions.inc	3 Jan 2008 23:58:47 -0000	1.107
***************
*** 52,55 ****
--- 52,56 ----
  if (file_exists("{$plugin_path}config.php")) {
     include $plugin_path . 'config.php';
+    $_SP_CONF['version'] = '1.5';
  } else {
      require_once $_CONF['path_system'] . 'classes/config.class.php';
***************
*** 1033,1037 ****
          if(! $sp_config->group_exists('staticpages')){
              $sp_config->add('version', '1.5', 'text', 0, 0, null, 0, true, 'staticpages');
- 
              $sp_config->add('allow_php', $_SP_CONF['allow_php'], 'text', 0, 0, null, 10, true, 'staticpages');
              $sp_config->add('sort_by', $_SP_CONF['sort_by'],  'text', 0, 0, null, 20, true, 'staticpages');
--- 1034,1037 ----
***************
*** 1045,1056 ****
              $sp_config->add('default_permissions', $_SP_CONF['default_permissions'], '@text', 0, 0, null, 100, true, 'staticpages');
  
!             //$sp_config->add('aftersave', 'item', 'text', 0, 0, null, 0, true, 'staticpages');
!             //$sp_config->add('atom_max_items', 10, 'text', 0, 0, null, 0, true, 'staticpages');
!             if($sp_config->group_exists('staticpages')){
!                 DB_query ("UPDATE {$_TABLES['plugins']} SET pi_version = '1.5' WHERE pi_name = 'staticpages'");
!             }
  
              // Rename the existing config.php as it's not needed now
!             @rename ("{$plugin_path}config.php","{$plugin_path}config-pre1.4.3.php");
          }
  
--- 1045,1062 ----
              $sp_config->add('default_permissions', $_SP_CONF['default_permissions'], '@text', 0, 0, null, 100, true, 'staticpages');
  
!             $sp_config->add('aftersave', 'item', 'text', 0, 0, null, 110, true, 'staticpages');
!             $sp_config->add('atom_max_items', 10, 'text', 0, 0, null, 120, true, 'staticpages');
  
              // Rename the existing config.php as it's not needed now
!             $ret = @rename ("{$plugin_path}config.php","{$plugin_path}config-pre1.4.3.php");
!             if (!$ret) {
!                 COM_errorLog("Staticpages upgrade to 1.5 error - unable to rename plugins config.php to complete upgrade");
!                 return '3003';
!             } elseif($sp_config->group_exists('staticpages')){
!                 DB_query ("UPDATE {$_TABLES['plugins']} SET pi_version = '1.5' WHERE pi_name = 'staticpages'");
!             } else {
!                 COM_errorLog("Staticpages upgrade to 1.5 failed");
!                 return '3001';
!             }
          }
  

Index: config.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/plugins/staticpages/config.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** config.php	31 Dec 2007 11:51:28 -0000	1.20
--- config.php	3 Jan 2008 23:58:47 -0000	1.21
***************
*** 1,32 ****
  <?php
  
! require_once $_CONF['path_system'] . 'classes/config.class.php';
! $sp_config = config::get_instance();
! $sp_config->initConfig();
  
  
! $LANG_configsubgroups['staticpages'][0] = 'Main Settings';
! $LANG_fs['staticpages'][0] = 'Main Settings';
  
- if(! $sp_config->group_exists('staticpages')){
  
!     $sp_config->add('version', '1.5.0', 'text', 0, 0, null, 0, true, 'staticpages');
!     $sp_config->add('allow_php', 1, 'text', 0, 0, null, 0, true, 'staticpages');
!     $sp_config->add('sort_by', 'id',  'text', 0, 0, null, 0, true, 'staticpages');
!     $sp_config->add('sort_menu_by', 'label', 'text', 0, 0, null, 0, true, 'staticpages');
!     $sp_config->add('delete_pages', 0 , 'text', 0, 0, null, 0, true, 'staticpages');
!     $sp_config->add('aftersave', 'item', 'text', 0, 0, null, 0, true, 'staticpages');
!     $sp_config->add('in_block', 1, 'text', 0, 0, null, 0, true, 'staticpages');
!     $sp_config->add('show_hits', 1, 'text', 0, 0, null, 0, true, 'staticpages');
!     $sp_config->add('show_date', 1, 'text', 0, 0, null, 0, true, 'staticpages');
!     $sp_config->add('filter_html', 0, 'text', 0, 0, null, 0, true, 'staticpages');
!     $sp_config->add('censor', 1, 'text', 0, 0, null, 0, true, 'staticpages');
!     $sp_config->add('default_permissions', array (3,2,2,2), '@text', 0, 0, null, 0, true, 'staticpages');
!     $sp_config->add('atom_max_items', 10, 'text', 0, 0, null, 0, true, 'staticpages');
  
  
- }
  
! $_SP_CONF = $sp_config->get_config('staticpages');
  
! ?>
--- 1,67 ----
  <?php
  
! $_SP_CONF['version'] = '1.4.3';
  
+ // If you don't plan on using PHP code in static pages, you should set this
+ // to 0, thus disabling the execution of PHP.
  
! $_SP_CONF['allow_php'] = 1;
  
  
! // If you have more than one static page that is to be displayed in Geeklog's
! // center area, you can specify how to sort them:
  
+ $_SP_CONF['sort_by'] = 'id'; // can be 'id', 'title', 'date'
  
  
! // sort the static pages that are listed in the site's menu
! // (assuming you're using a theme that uses the {plg_menu_elements} variable)
  
! $_SP_CONF['sort_menu_by'] = 'label'; // can be 'id', 'label', 'title', 'date'
! 
! 
! // When a user is deleted, ownership of static pages created by that user can
! // be transfered to a user in the Root group (= 0) or the pages can be
! // deleted (= 1).
! $_SP_CONF['delete_pages'] = 0;
! 
! /** What to show after a page has been saved? Possible choices:
!  * 'item' -> forward to the static page
!  * 'list' -> display the admin-list of the static pages
!  * 'home' -> display the site homepage
!  * 'admin' -> display the site admin homepage
!  */
! $_SP_CONF['aftersave'] = 'item';
! 
! // Static pages can optionally be wrapped in a block. This setting defines
! // the default for that option (1 = wrap in a block, 0 = don't).
! $_SP_CONF['in_block'] = 1;
! 
! // Do you want to show the hits on static pages?
! // the default for that option (1 = show hits, 0 = don't).
! $_SP_CONF['show_hits'] = 1;
! 
! // Do you want to show the last update date/time on static pages?
! // the default for that option (1 = show date, 0 = don't).
! $_SP_CONF['show_date'] = 1;
! 
! // If you experience timeout issues, you may need to set both of the
! // following values to 0 as they are intensive
! 
! // NOTE: using filter_html will render any blank pages useless
! $_SP_CONF['filter_html'] = 0;
! $_SP_CONF['censor'] = 1;
! 
! // Define default permissions for new pages created from the Admin panel.
! // Permissions are perm_owner, perm_group, perm_members, perm_anon (in that
! // order). Possible values:
! // 3 = read + write permissions (perm_owner and perm_group only)
! // 2 = read-only
! // 0 = neither read nor write permissions
! // (a value of 1, ie. write-only, does not make sense and is not allowed)
! $_SP_CONF['default_permissions'] = array (3, 2, 2, 2);
! 
! // The maximum number of items displayed when an Atom feed is requested
! $_SP_CONF['atom_max_items'] = 10;
! 
! ?>
\ No newline at end of file




More information about the geeklog-cvs mailing list