Changeset 544
- Timestamp:
- 11/07/2006 12:16:18 AM (19 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
bb-includes/functions.php (modified) (4 diffs)
-
bb-includes/template-functions.php (modified) (2 diffs)
-
bb-settings.php (modified) (4 diffs)
-
config-sample.php (modified) (2 diffs)
-
statistics.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bb-includes/functions.php
r528 r544 293 293 294 294 switch ( $option ) : 295 case 'url' :296 case 'uri' :297 $r = $bb->domain . $bb->path;298 break;299 295 case 'language': 300 296 $r = str_replace('_', '-', get_locale()); … … 307 303 return '0.73'; // Don't filter 308 304 break; 305 case 'url' : 306 $option = 'uri'; 309 307 default : 310 $option = preg_replace('|[^a-z0-9_]|i', '', $option);311 312 308 if ( isset($bb->$option) ) { 313 309 $r = $bb->$option; … … 315 311 } 316 312 317 global $bbdb, $bb_topic_cache; 318 if ( isset($bb_topic_cache[0]->$option) ) { 319 $r = $bb_topic_cache[0]->$option; 320 if ( is_wp_error( $r ) && 'bb_get_option' == $r->get_error_code() ) 321 $r = null; // see WP_Error below 322 break; 323 } 324 313 $r = bb_get_option_from_db( $option ); 314 break; 315 endswitch; 316 return apply_filters( 'bb_get_option_' . $option, $r, $option); 317 } 318 319 function bb_get_option_from_db( $option ) { 320 global $bbdb, $bb_topic_cache; 321 $option = preg_replace('|[^a-z0-9_]|i', '', $option); 322 323 if ( isset($bb_topic_cache[0]->$option) ) { 324 $r = $bb_topic_cache[0]->$option; 325 if ( is_wp_error( $r ) && 'bb_get_option' == $r->get_error_code() ) 326 $r = null; // see WP_Error below 327 } else { 325 328 $row = $bbdb->get_row("SELECT meta_value FROM $bbdb->topicmeta WHERE topic_id = 0 AND meta_key = '$option'"); 329 326 330 if ( is_object($row) ) { 327 331 $bb_topic_cache[0]->$option = $r = bb_maybe_unserialize( $row->meta_value ); … … 330 334 $bb_topic_cache[0]->$option = new WP_Error( 'bb_get_option' ); // Used internally for caching. See above. 331 335 } 332 break; 333 endswitch; 334 return apply_filters( 'bb_get_option_' . $option, $r, $option); 336 } 337 return apply_filters( 'bb_get_option_from_db_' . $option, $r, $option ); 335 338 } 336 339 -
trunk/bb-includes/template-functions.php
r535 r544 287 287 288 288 function bb_get_title() { 289 global $topic, $forum, $ static_title, $tag, $user;289 global $topic, $forum, $tag, $user; 290 290 $title = ''; 291 291 if ( is_topic() ) … … 297 297 if ( is_bb_profile() ) 298 298 $title = get_user_name( $user->ID ) . ' « '; 299 if ( !empty($static_title) )300 $title = $st atic_title . ' « ';299 if ( $st = bb_get_option( 'static_title' ) ) 300 $title = $st; 301 301 $title .= bb_get_option('name'); 302 302 return apply_filters( 'bb_get_title', $title ); -
trunk/bb-settings.php
r540 r544 68 68 $bbdb->tagged = $bb_table_prefix . 'tagged'; 69 69 70 foreach ( array('use_cache', 'secret', 'debug', 'wp_table_prefix', 'wp_home', 'wp_siteurl', 'cookiedomain', 'static_title', 'load_options') as $o ) 71 if ( !isset($bb->$o) ) 72 $bb->$o = false; 73 unset($o); 74 70 75 require( BBPATH . BBINC . '/functions.php'); 71 76 require( BBPATH . BBINC . '/formatting-functions.php'); … … 94 99 $bbdb->show_errors(); 95 100 96 $static_title = ''; 101 if ( $bb->load_options ) 102 bb_cache_all_options(); 97 103 98 104 $_GET = bb_global_sanitize($_GET ); … … 116 122 define('BBHASH', $bb->wp_siteurl ? md5($bb->wp_siteurl) : md5($bb_table_prefix) ); 117 123 124 $bb->uri = $bb->domain . $bb->path; 118 125 if ( !isset( $bb->usercookie ) ) 119 126 $bb->usercookie = ( $bb->wp_table_prefix ? 'wordpressuser_' : 'bb_user_' ) . BBHASH; … … 121 128 $bb->passcookie = ( $bb->wp_table_prefix ? 'wordpresspass_' : 'bb_pass_' ) . BBHASH; 122 129 if ( !isset( $bb->cookiepath ) ) 123 $bb->cookiepath = $bb->wp_home ? preg_replace('|https?://[^/]+|i', '', "$bb->wp_home/" ) : bb_get_option('path');130 $bb->cookiepath = $bb->wp_home ? preg_replace('|https?://[^/]+|i', '', $bb->wp_home . '/' ) : $bb->path; 124 131 if ( !isset( $bb->sitecookiepath ) ) 125 $bb->sitecookiepath = $bb->wp_siteurl ? preg_replace('|https?://[^/]+|i', '', "$bb->wp_site/" ) : bb_get_option('path');132 $bb->sitecookiepath = $bb->wp_siteurl ? preg_replace('|https?://[^/]+|i', '', $bb->wp_siteurl . '/' ) : $bb->path; 126 133 if ( !isset( $bb->tagpath ) ) 127 134 $bb->tagpath = $bb->path; -
trunk/config-sample.php
r516 r544 44 44 // of Akismet's powerful spam blocking, you'll need one. You can get an Akismet key at 45 45 // http://wordpress.com/api-keys/ 46 $bb->akismet_key = false;46 $bb->akismet_key = ''; // Example: '0123456789ab' 47 47 48 48 … … 50 50 // If you're not, just leave the rest as it is. 51 51 52 $bb->wp_table_prefix = false; // WordPress table prefix. Example: 'wp_';53 $bb->wp_home = false; // WordPress - Options->General: Blog address (URL) // No trailing slash54 $bb->wp_siteurl = false; // WordPress - Options->General: WordPress address (URL) // No trailing slash52 $bb->wp_table_prefix = ''; // WordPress table prefix. Example: 'wp_'; 53 $bb->wp_home = ''; // WordPress - Options->General: Blog address (URL) // No trailing slash. Example: 'http://example.com' 54 $bb->wp_siteurl = ''; // WordPress - Options->General: WordPress address (URL) // No trailing slash. Example: 'http://example.com' 55 55 56 56 /* Stop editing */ -
trunk/statistics.php
r516 r544 7 7 $popular = get_popular_topics(); 8 8 9 $ static_title = __('Statistics');9 $bb->static_title = __('Statistics') . ' «'; 10 10 11 11 if (file_exists( BBPATH . 'my-templates/stats.php' ))
Note: See TracChangeset
for help on using the changeset viewer.