[bbDev] Unsubscribe help
Brian Phelps
briant at phelpstek.com
Thu Nov 22 15:46:41 GMT 2007
Pardon the intrusion here, but I can't figure out how to unsubscribe.
Instructions, anyone?
Brian Phelps
v. (209) 662-1991
f. (888) 869-1308
www.phelpstek.com <http://www.phelpstek.com/>
Building Business, Not Just Web Sites
_____
From: bbdev-bounces at lists.bbpress.org
[mailto:bbdev-bounces at lists.bbpress.org] On Behalf Of m at wordpress.org
Sent: Wednesday, November 21, 2007 10:46 PM
To: bbdev at lists.bbpress.org
Subject: [bbDev] [961] trunk: Some theme selection love.
Revision
961
Author
sambauers
Date
2007-11-22 06:45:36 +0000 (Thu, 22 Nov 2007)
Log Message
Some theme selection love. Fixes #725
Modified Paths
* trunk/bb-admin/themes.php <>
* trunk/bb-includes/functions.php <>
* trunk/bb-includes/template-functions.php <>
* trunk/bb-settings.php <>
Diff
Modified: trunk/bb-admin/themes.php (960 => 961)
--- trunk/bb-admin/themes.php 2007-11-22 06:17:03 UTC (rev 960)
+++ trunk/bb-admin/themes.php 2007-11-22 06:45:36 UTC (rev 961)
@@ -8,22 +8,33 @@
}
bb_check_admin_referer( 'switch-theme' );
$activetheme = stripslashes($_GET['theme']);
- bb_update_option( 'bb_active_theme', $activetheme );
+ if ($activetheme == BBDEFAULTTHEMEDIR) {
+ bb_delete_option( 'bb_active_theme' );
+ } else {
+ bb_update_option( 'bb_active_theme', $activetheme );
+ }
wp_redirect( bb_get_option( 'uri' ) .
'bb-admin/themes.php?activated' );
exit;
}
$themes = bb_get_themes();
$activetheme = bb_get_option('bb_active_theme');
+if (!$activetheme) {
+ $activetheme = BBDEFAULTTHEMEDIR;
+}
if ( isset($_GET['activated']) )
$theme_notice = bb_admin_notice( sprintf(__('Theme "%s" activated'),
basename($activetheme)) );
if ( !in_array($activetheme, $themes) ) {
- $activetheme = BBPATH . 'bb-templates/kakumei';
- bb_update_option( 'bb_active_theme', $activetheme );
- remove_action( 'bb_admin_notices', $theme_notice );
- bb_admin_notice( __('Theme not found. Default theme applied.'),
'error' );
+ if ($activetheme == BBDEFAULTTHEMEDIR) {
+ remove_action( 'bb_admin_notices', $theme_notice );
+ bb_admin_notice( __('Default theme is missing.'), 'error' );
+ } else {
+ bb_delete_option( 'bb_active_theme' );
+ remove_action( 'bb_admin_notices', $theme_notice );
+ bb_admin_notice( __('Theme not found. Default theme
applied.'), 'error' );
+ }
}
function bb_admin_theme_row( $theme ) {
@@ -37,7 +48,8 @@
<h3><a href="<?php echo $activation_url; ?>"
title="<?php echo attribute_escape( __('Click to activate') ); ?>"><?php
echo $theme_data['Title']; ?></a></h3>
<small class="version"><?php echo
$theme_data['Version']; ?></small>
<?php printf(__('by <cite>%s</cite>'),
$theme_data['Author']); if ( $theme_data['Porter'] ) printf(__(', ported by
<cite>%s</cite>'), $theme_data['Porter']); ?>
- <?php echo $theme_data['Description']; ?>
+ <p><?php echo $theme_data['Description']; ?></p>
+ <small><?php printf(__('Installed in: %s'),
basename(dirname($theme)) . '/' . basename($theme)); ?></small>
</div>
<br class="clear" />
</li>
@@ -49,7 +61,7 @@
<h2><?php _e('Current Theme'); ?></h2>
<ul class="theme-list active">
-<?php bb_admin_theme_row( $themes[basename($activetheme)] );
unset($themes[basename($activetheme)] ); ?>
+<?php bb_admin_theme_row( $themes[$activetheme] );
unset($themes[$activetheme] ); ?>
</ul>
<?php if ( !empty($themes) ) : ?>
Modified: trunk/bb-includes/functions.php (960 => 961)
--- trunk/bb-includes/functions.php 2007-11-22 06:17:03 UTC (rev 960)
+++ trunk/bb-includes/functions.php 2007-11-22 06:45:36 UTC (rev 961)
@@ -2062,7 +2062,7 @@
function bb_get_active_theme_folder() {
$activetheme = bb_get_option( 'bb_active_theme' );
if ( !$activetheme )
- $activetheme = BBPATH . 'bb-templates/kakumei/';
+ $activetheme = BBDEFAULTTHEMEDIR;
return apply_filters( 'bb_get_active_theme_folder', $activetheme );
}
@@ -2075,7 +2075,7 @@
if ( $themes_dir = @dir($theme_root) )
while( ( $theme_dir = $themes_dir->read() ) !==
false )
if ( is_dir($theme_root . $theme_dir) &&
is_readable($theme_root . $theme_dir) && '.' != $theme_dir{0} )
- $r[$theme_dir] = $theme_root .
$theme_dir . '/';
+ $r[$theme_root . $theme_dir . '/'] =
$theme_root . $theme_dir . '/';
ksort($r);
return $r;
Modified: trunk/bb-includes/template-functions.php (960 => 961)
--- trunk/bb-includes/template-functions.php 2007-11-22 06:17:03 UTC (rev
960)
+++ trunk/bb-includes/template-functions.php 2007-11-22 06:45:36 UTC (rev
961)
@@ -12,20 +12,14 @@
else
global $$v;
- if ( file_exists( bb_get_active_theme_folder() . $file) ) {
- $template = bb_get_active_theme_folder() . $file;
- } else {
- $template = BBPATH . "bb-templates/kakumei/$file";
- }
-
- $template = apply_filters( 'bb_template', $template, $file );
+ $template = apply_filters( 'bb_template', bb_get_template( $file ),
$file );
include($template);
}
function bb_get_template( $file ) {
if ( file_exists( bb_get_active_theme_folder() . $file) )
return bb_get_active_theme_folder() . $file;
- return BBPATH . "bb-templates/kakumei/$file";
+ return BBDEFAULTTHEMEDIR . $file;
}
function bb_get_header() {
@@ -60,7 +54,7 @@
if ( file_exists( $active_theme . 'style.css' ) )
$r = bb_get_active_theme_uri() . $css_file;
else
- $r = bb_get_option( 'uri' ) .
"bb-templates/kakumei/$css_file";
+ $r = BBDEFAULTTHEMEURL . $css_file;
return apply_filters( 'bb_get_stylesheet_uri', $r, $stylesheet );
}
@@ -70,7 +64,7 @@
function bb_get_active_theme_uri() {
if ( !$active_theme = bb_get_option( 'bb_active_theme' ) )
- $active_theme = BBPATH . 'bb-templates/kakumei/';
+ $active_theme = BBDEFAULTTHEMEDIR;
return apply_filters( 'bb_get_active_theme_uri', bb_get_theme_uri(
$active_theme ) );
}
Modified: trunk/bb-settings.php (960 => 961)
--- trunk/bb-settings.php 2007-11-22 06:17:03 UTC (rev 960)
+++ trunk/bb-settings.php 2007-11-22 06:45:36 UTC (rev 961)
@@ -80,6 +80,10 @@
define('BBTHEMEDIR', BBPATH . 'my-templates/');
if ( !defined('BBTHEMEURL') )
define('BBTHEMEURL', $bb->uri . 'my-templates/');
+if ( !defined('BBDEFAULTTHEMEDIR') )
+ define('BBDEFAULTTHEMEDIR', BBPATH . 'bb-templates/kakumei/');
+if ( !defined('BBDEFAULTTHEMEURL') )
+ define('BBDEFAULTTHEMEURL', $bb->uri . 'bb-templates/kakumei/');
require( BBPATH . BBINC . 'db-base.php');
if ( extension_loaded('mysql') ) {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://comox.textdrive.com/pipermail/bbdev/attachments/20071122/ea07c807/attachment.htm
More information about the bbDev
mailing list