"Feedburner Address",
"header" => "Enter Your Feedburner Information",
"id" => $shortname."_feedburner_address",
"std" => "",
"type" => "text"),
);
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'Sidebar',
'before_widget' => '
',
'after_widget' => '',
'before_title' => '',
'after_title' => '
',
));
function wp_pagenavi($before = '', $after = '', $prelabel = '', $nxtlabel = '', $pages_to_show = 5, $always_show = false) {
global $request, $posts_per_page, $wpdb, $paged;
if(empty($prelabel)) {
$prelabel = '«';
}
if(empty($nxtlabel)) {
$nxtlabel = '»';
}
$half_pages_to_show = round($pages_to_show/2);
if (!is_single()) {
if(!is_category()) {
preg_match('#FROM\s(.*)\sORDER BY#siU', $request, $matches);
} else {
preg_match('#FROM\s(.*)\sGROUP BY#siU', $request, $matches);
}
$fromwhere = $matches[1];
$numposts = $wpdb->get_var("SELECT COUNT(DISTINCT ID) FROM $fromwhere");
$max_page = ceil($numposts /$posts_per_page);
if(empty($paged)) {
$paged = 1;
}
if($max_page > 1 || $always_show) {
echo "$before Page $paged of $max_page";
if ($paged >= ($pages_to_show-1)) {
echo '
1st ...
';
}
previous_posts_link($prelabel);
for($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
if ($i >= 1 && $i <= $max_page) {
if($i == $paged) {
echo "
$i";
} else {
echo '
'.$i.' ';
}
}
}
next_posts_link($nxtlabel, $max_page);
if (($paged+$half_pages_to_show) < ($max_page)) {
echo '
...
Last';
}
echo "
$after";
}
}
}
function mytheme_add_admin() {
global $themename, $shortname, $options;
if ( $_GET['page'] == basename(__FILE__) ) {
if ( 'save' == $_REQUEST['action'] ) {
foreach ($options as $value) {
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
update_option( 'db_layouttype', strip_tags( stripslashes( $_REQUEST['db_layouttype'] ) ) );
update_option( 'db_layouttype', strip_tags( stripslashes( $_REQUEST['db_layouttype'] ) ) );
foreach ($options as $value) {
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
header("Location: themes.php?page=functions.php&saved=true");
die;
} else if( 'reset' == $_REQUEST['action'] ) {
foreach ($options as $value) {
delete_option( $value['id'] ); }
delete_option('db_layouttype');
header("Location: themes.php?page=functions.php&reset=true");
die;
}
}
add_theme_page($themename." Options", "BlogDesignStudio NewBlue Options", 'edit_themes', basename(__FILE__), 'mytheme_admin');
}
function db_init() {
}
function db_add_theme_page() {
if ($_GET['page'] == basename(__FILE__)) {
if ( 'save' == $_REQUEST['action'] ) {
} }}
function mytheme_wp_head() {
$stylesheet = get_option('db_alt_stylesheet');
if($stylesheet != ''){?>
'.$themename.' settings saved.
';
if ( $_REQUEST['reset'] ) echo ''.$themename.' settings reset.
';
?>
settings
This theme is free for download and use. Leaving the credits in the footer would be appreciated. Enjoy the theme!
MakWeb.
Tested on Firefox, IE7, Safari, Opera and even IE6 ( Can you believe that? ).