Changeset 1251
- Timestamp:
- 08/10/08 15:27:19 (4 months ago)
- Files:
-
- all-settings/trunk/all-settings-admin.php (modified) (6 diffs)
- all-settings/trunk/all-settings.php (modified) (1 diff)
- all-settings/trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
all-settings/trunk/all-settings-admin.php
r1249 r1251 15 15 <table class="widefat"> 16 16 <?php 17 global $cache_options, $db_options, $bb_options ;17 global $cache_options, $db_options, $bb_options, $get_options; 18 18 $options=all_settings_options(); 19 19 20 20 foreach ( (array) $options as $option) : 21 21 $disabled = ''; 22 $get_option=false; 22 23 $bb_config=false; 24 if (in_array($option->option_name,$get_options)) { 25 $disabled = ' disabled="disabled"'; 26 $class = 'all-settings disabled'; 27 $get_option=true; 28 } else { 23 29 if ($option->option_value != $cache_options[$option->option_name]->option_value && $option->option_value != $db_options[$option->option_name]->option_value) {$bb_config=true;} 30 } 24 31 $option->option_name = attribute_escape($option->option_name); 25 32 if ( is_serialized($option->option_value) ) { … … 41 48 $value = ($option->option_value) ? "true" : "false"; 42 49 $disabled = ' disabled="disabled"'; 43 $class = 'all-settings disabled'; 50 $class = 'all-settings disabled'; 44 51 } else { 45 52 $value = $option->option_value; 46 53 $options_to_update[] = $option->option_name; 47 54 $class = 'all-settings'; 48 } 55 } 49 56 echo " 50 57 <tr> … … 56 63 57 64 if ($bb_config) {echo " (<small>bb-config.php</small>) ";} 65 if ($get_option) {echo " (<small>calculated</small>) ";} 58 66 59 67 echo "</td> … … 65 73 <p class="submit"><input type="hidden" name="page_options" value="<?php echo $options_to_update; ?>" /><input type="submit" name="Update" value="<?php _e('Save Changes') ?>" /></p> 66 74 67 <p><small>(bb-config.php) indicates option is either currently set in bb-config.php or might only be changeable from there via $bb->option=value;</small></p> 75 <p><small>(bb-config.php) indicates option is either currently set in bb-config.php or might only be changeable from there via <b>$bb->option="value";</b></small></p> 76 <p><small>(calcuated) indicates option has been determined by bbPress based on other options, might be changeable in bb-config.php</small></p> 68 77 69 78 </form> … … 73 82 74 83 function all_settings_options() { 75 global $bb, $bbdb, $bb_topic_cache, $ cache_options, $db_options, $bb_options;84 global $bb, $bbdb, $bb_topic_cache, $wp_object_cache, $cache_options, $db_options, $bb_options, $get_options; 76 85 77 bb_cache_all_options(); 78 foreach ((array) $ bb_topic_cache[0]as $name=>$value) {$cache_options[$name]->option_name=$name; $cache_options[$name]->option_value=$value;}86 bb_cache_all_options(); $options=(empty($bb_topic_cache[0])) ? $wp_object_cache->cache['bb_option'] : $bb_topic_cache[0]; 87 foreach ((array) $options as $name=>$value) {$cache_options[$name]->option_name=$name; $cache_options[$name]->option_value=$value;} 79 88 80 $options=$bbdb->get_results("SELECT meta_key as option_name, meta_value as option_value FROM $bbdb->topicmeta WHERE topic_id = 0 ORDER BY option_name"); 89 if (bb_get_option('bb_db_version')>1600) {$optiontable="$bbdb->meta WHERE object_type='bb_option'";} 90 else {$optiontable="$bbdb->topicmeta WHERE topic_id = 0";} 91 92 $options=$bbdb->get_results("SELECT meta_key as option_name, meta_value as option_value FROM $optiontable ORDER BY option_name"); 81 93 foreach ((array) $options as $option) {$db_options[$option->option_name]->option_name=$option->option_name; $db_options[$option->option_name]->option_value=$option->option_value;} 82 94 … … 85 97 if ( version_compare(PHP_VERSION, '5.0', '>') ) {$constants=get_defined_constants(true); $constants=$constants['user'];} // to do 86 98 87 $options = array_merge($cache_options, $db_options, $bb_options); // merge options from everywhere 99 $options=array(); // merge options from everywhere 100 if (is_array($cache_options)) {$options=array_merge($options,$cache_options);} 101 if (is_array($db_options)) {$options=array_merge($options,$db_options);} 102 if (is_array($bb_options)) {$options=array_merge($options,$bb_options);} 103 unset($options['topic_id']); // messy 88 104 89 // print_r($options); 90 91 unset($options['topic_id']); // messy 105 $get_options=array('language','text_direction','version','bb_db_version','html_type','charset','url','bb_table_prefix','table_prefix','mod_rewrite','page_topics','edit_lock','gmt_offset','uri_ssl'); 106 foreach ((array) $get_options as $key) {if (array_key_exists($key,$options)) {unset($get_options[$key]);} else {$options[$key]->option_name=$key; $options[$key]->option_value=bb_get_option($key);}} 92 107 93 108 return $options; all-settings/trunk/all-settings.php
r1249 r1251 6 6 Author: _ck_ 7 7 Author URI: http://bbShowcase.org 8 Version: 0.0. 18 Version: 0.0.2 9 9 10 10 License: CC-GNU-GPL http://creativecommons.org/licenses/GPL/2.0/ all-settings/trunk/readme.txt
r1249 r1251 59 59 * first public release 60 60 61 = Version 0.0.2 (2008-08-10) = 62 63 * array merge error fix, hardcoded bb_get_options displayed, 1.0 alpha compatibility fix for new bb_meta 64 61 65 == To Do == 62 66
