Changeset 930
- Timestamp:
- 03/06/08 18:33:25 (9 months ago)
- Files:
-
- bbpress-theme-switcher/trunk/bb-theme-switcher.php (modified) (3 diffs)
- bbpress-theme-switcher/trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
bbpress-theme-switcher/trunk/bb-theme-switcher.php
r878 r930 4 4 Plugin URI: http://bbpress.org/plugins/topic/70 5 5 Description: Allows your members and guests to switch between themes. Optional timer to return to default theme. 6 Version: 1.1 06 Version: 1.14 7 7 Author: _ck_ 8 8 Author URI: http://bbshowcase.org … … 76 76 $theme = bb_ts_get_theme(); 77 77 if (empty($theme)) {return $uri;} 78 $active_uri=bb_get_theme_uri(bb_get_one_theme($theme)); 78 $theme=bb_get_one_theme($theme); 79 $active_uri=""; 80 if ( 0 === strpos($theme, BBTHEMEDIR) ) 81 $active_uri = BBTHEMEURL . substr($theme, strlen(BBTHEMEDIR)); 82 elseif ( 0 === strpos($theme, BBPATH) ) 83 $active_uri = bb_get_option( 'uri' ) . substr($theme, strlen(BBPATH)); 79 84 if ($active_uri) {return $active_uri;} else {return $uri;} 80 85 } 81 86 82 87 function bb_get_one_theme($theme) { 83 $themes = bb_get_all_themes(); 88 $themes = bb_get_all_themes(); 89 // print " <!-- "; print bb_get_option( 'uri' ).'/'.str_replace(BBPATH,'',$themes[$theme]); print BBPATH.' - '.$themes[$theme]; print " --> "; // diagnostic 84 90 if (array_key_exists($theme, $themes)) {return $themes[$theme];} 85 91 return NULL; … … 121 127 122 128 123 function bb_theme_switcher($style = "text") { global $bbhash; 129 function bb_theme_switcher($style = "text") { 130 global $bbhash; 124 131 $themes = bb_get_all_themes(); 125 126 $default_theme = array_search(bb_get_option('bb_active_theme'),$themes); // get_current_theme(); 127 132 133 $default_theme=str_replace(array('core#', 'user#'),'', bb_get_option('bb_active_theme')); 134 if (!array_key_exists($default_theme, $themes)) {$default_theme =array_search($default_theme,$themes);} 135 128 136 if (count($themes) > 1) { 129 137 $theme_names = array_keys($themes); bbpress-theme-switcher/trunk/readme.txt
r878 r930 63 63 * enhanced to return to original location after theme switch instead of front page, also small bug fixes/tweaks 64 64 65 = Version 1.14 (2008-3-06) = 66 67 * update to match theme method in 0.8.4 while remaining backward compatible with 0.8.3
