except the home.', 'barthelme'); ?>
'', 'title_after'=>' ', 'show_images'=>true));
} else {
global $wpdb;
$cats = $wpdb->get_results("
SELECT DISTINCT link_category, cat_name, show_images,
show_description, show_rating, show_updated, sort_order,
sort_desc, list_limit
FROM `$wpdb->links`
LEFT JOIN `$wpdb->linkcategories` ON (link_category = cat_id)
WHERE link_visible = 'Y'
AND list_limit <> 0
ORDER BY cat_name ASC", ARRAY_A);
if ($cats) {
foreach ($cats as $cat) {
$orderby = $cat['sort_order'];
$orderby = (bool_from_yn($cat['sort_desc'])?'_':'') . $orderby;
echo ' ' . $cat['cat_name'] . " \n\t\n";
get_links($cat['link_category'],
''," ","\n",
bool_from_yn($cat['show_images']),
$orderby,
bool_from_yn($cat['show_description']),
bool_from_yn($cat['show_rating']),
$cat['list_limit'],
bool_from_yn($cat['show_updated']));
echo "\n\t \n \n";
}
}
}
}
function barthelme_widgets_init() {
if ( !function_exists('register_sidebars') )
return;
$p = array(
'before_title' => "\n",
);
register_sidebars(1, $p);
register_sidebar_widget(__('Search', 'barthelme'), 'widget_barthelme_search', null, 'search');
unregister_widget_control('search');
register_sidebar_widget(__('Meta', 'barthelme'), 'widget_barthelme_meta', null, 'meta');
unregister_widget_control('meta');
register_sidebar_widget(__('Links', 'barthelme'), 'widget_barthelme_links', null, 'links');
unregister_widget_control('links');
register_sidebar_widget(array('Home Link', 'widgets'), 'widget_barthelme_homelink');
register_widget_control(array('Home Link', 'widgets'), 'widget_barthelme_homelink_control', 300, 125);
register_sidebar_widget(array('RSS Links', 'widgets'), 'widget_barthelme_rsslinks');
register_widget_control(array('RSS Links', 'widgets'), 'widget_barthelme_rsslinks_control', 300, 90);
}
function barthelme_add_admin() {
if ( $_GET['page'] == basename(__FILE__) ) {
if ( 'save' == $_REQUEST['action'] ) {
update_option( 'barthelme_basefontsize', $_REQUEST['bm_basefontsize'] );
update_option( 'barthelme_basefontfamily', $_REQUEST['bm_basefontfamily'] );
update_option( 'barthelme_headingfontfamily', $_REQUEST['bm_headingfontfamily'] );
update_option( 'barthelme_posttextalignment', $_REQUEST['bm_posttextalignment'] );
update_option( 'barthelme_layoutwidth', $_REQUEST['bm_layoutwidth'] );
update_option( 'barthelme_uppercolor', $_REQUEST['bm_uppercolor'] );
update_option( 'barthelme_lowercolor', $_REQUEST['bm_lowercolor'] );
update_option( 'barthelme_headerfontcolor', $_REQUEST['bm_headerfontcolor'] );
update_option( 'barthelme_authorlink', $_REQUEST['bm_authorlink'] );
if( isset( $_REQUEST['bm_basefontsize'] ) ) { update_option( 'barthelme_basefontsize', $_REQUEST['bm_basefontsize'] ); } else { delete_option( 'barthelme_basefontsize' ); }
if( isset( $_REQUEST['bm_basefontfamily'] ) ) { update_option( 'barthelme_basefontfamily', $_REQUEST['bm_basefontfamily'] ); } else { delete_option( 'barthelme_basefontfamily' ); }
if( isset( $_REQUEST['bm_headingfontfamily'] ) ) { update_option( 'barthelme_headingfontfamily', $_REQUEST['bm_headingfontfamily'] ); } else { delete_option('barthelme_headingfontfamily'); }
if( isset( $_REQUEST['bm_posttextalignment'] ) ) { update_option( 'barthelme_posttextalignment', $_REQUEST['bm_posttextalignment'] ); } else { delete_option('barthelme_posttextalignment'); }
if( isset( $_REQUEST['bm_layoutwidth'] ) ) { update_option( 'barthelme_layoutwidth', $_REQUEST['bm_layoutwidth'] ); } else { delete_option('barthelme_layoutwidth'); }
if( isset( $_REQUEST['bm_uppercolor'] ) ) { update_option( 'barthelme_uppercolor', $_REQUEST['bm_uppercolor'] ); } else { delete_option('barthelme_uppercolor'); }
if( isset( $_REQUEST['bm_lowercolor'] ) ) { update_option( 'barthelme_lowercolor', $_REQUEST['bm_lowercolor'] ); } else { delete_option('barthelme_lowercolor'); }
if( isset( $_REQUEST['bm_headerfontcolor'] ) ) { update_option( 'barthelme_headerfontcolor', $_REQUEST['bm_headerfontcolor'] ); } else { delete_option('barthelme_headerfontcolor'); }
if( isset( $_REQUEST['bm_authorlink'] ) ) { update_option( 'barthelme_authorlink', $_REQUEST['bm_authorlink'] ); } else { delete_option('barthelme_authorlink'); }
header("Location: themes.php?page=functions.php&saved=true");
die;
} else if ( 'reset' == $_REQUEST['action'] ) {
delete_option('barthelme_basefontsize');
delete_option('barthelme_basefontfamily');
delete_option('barthelme_headingfontfamily');
delete_option('barthelme_posttextalignment');
delete_option('barthelme_layoutwidth');
delete_option('barthelme_uppercolor');
delete_option('barthelme_lowercolor');
delete_option('barthelme_headerfontcolor');
delete_option('barthelme_authorlink');
header("Location: themes.php?page=functions.php&reset=true");
die;
}
add_action('admin_head', 'barthelme_admin_head');
}
add_theme_page("Barthelme Options", "Barthelme Options", 'edit_themes', basename(__FILE__), 'barthelme_admin');
}
function barthelme_admin_head() {
?>
View site »', 'barthelme'), get_bloginfo('home') . '/'); ?>
Barthelme theme. You can customize this theme with the options below. You must click on S ave Options to save any changes. You can also discard your changes and reload the default settings by clicking on R eset .', 'barthelme'); ?>
Resetting clears all changes to the above options. After resetting, default options are loaded and this theme will continue to be the active theme. A reset does not affect the actual theme files in any way.', 'barthelme'); ?>
' . get_the_author() . ' ';
} else {
echo '' . get_the_author() . ' ';
}
} else if ( get_settings('barthelme_authorlink') =="displayed" ) {
if ( is_single() || is_page() ) {
return '' . get_the_author() . ' ';
} else {
echo '' . get_the_author() . ' ';
}
} else if ( get_settings('barthelme_authorlink') =="hidden" ) {
if ( is_single() || is_page() ) {
return '' . get_the_author() . ' ';
} else {
echo '';
}
};
}
if ( get_settings('barthelme_basefontsize') == "" ) {
$basefontsize = '75%';
} else {
$basefontsize = stripslashes( get_settings('barthelme_basefontsize') );
};
if ( get_settings('barthelme_basefontfamily') == "" ) {
$basefontfamily = 'arial,helvtica,sans-serif';
} else {
$basefontfamily = stripslashes( get_settings('barthelme_basefontfamily') );
};
if ( get_settings('barthelme_headingfontfamily') == "" ) {
$headingfontfamily = 'georgia,times,serif';
} else {
$headingfontfamily = stripslashes( get_settings('barthelme_headingfontfamily') );
};
if ( get_settings('barthelme_layoutwidth') == "" ) {
$layoutwidth = 'auto';
} else {
$layoutwidth = stripslashes( get_settings('barthelme_layoutwidth') );
};
if ( get_settings('barthelme_posttextalignment') == "" ) {
$posttextalignment = 'left';
} else {
$posttextalignment = stripslashes( get_settings('barthelme_posttextalignment') );
};
if ( get_settings('barthelme_uppercolor') == "" ) {
$uppercolor = '8a9aae';
} else {
$uppercolor = stripslashes( get_settings('barthelme_uppercolor') );
};
if ( get_settings('barthelme_lowercolor') == "" ) {
$lowercolor = 'bac8da';
} else {
$lowercolor = stripslashes( get_settings('barthelme_lowercolor') );
};
if ( get_settings('barthelme_headerfontcolor') == "" ) {
$headerfontcolor = 'fefefe';
} else {
$headerfontcolor = stripslashes( get_settings('barthelme_headerfontcolor') );
};
?>