except the home.', 'veryplaintxt'); ?>
'', '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 veryplaintxt_widgets_init() {
if ( !function_exists('register_sidebars') )
return;
$p = array(
'before_title' => "\n",
);
register_sidebars(1, $p);
register_sidebar_widget(__('Search', 'veryplaintxt'), 'widget_veryplaintxt_search', null, 'search');
unregister_widget_control('search');
register_sidebar_widget(__('Meta', 'veryplaintxt'), 'widget_veryplaintxt_meta', null, 'meta');
unregister_widget_control('meta');
register_sidebar_widget(__('Links', 'veryplaintxt'), 'widget_veryplaintxt_links', null, 'links');
unregister_widget_control('links');
register_sidebar_widget(array('Home Link', 'widgets'), 'widget_veryplaintxt_homelink', null, 'homelink');
register_widget_control(array('Home Link', 'widgets'), 'widget_veryplaintxt_homelink_control', 300, 125, 'homelink');
register_sidebar_widget(array('RSS Links', 'widgets'), 'widget_veryplaintxt_rsslinks', null, 'rsslinks');
register_widget_control(array('RSS Links', 'widgets'), 'widget_veryplaintxt_rsslinks_control', 300, 90, 'rsslinks');
}
function veryplaintxt_add_admin() {
if ( $_GET['page'] == basename(__FILE__) ) {
if ( 'save' == $_REQUEST['action'] ) {
update_option( 'veryplaintxt_basefontsize', $_REQUEST['vp_basefontsize'] );
update_option( 'veryplaintxt_basefontfamily', $_REQUEST['vp_basefontfamily'] );
update_option( 'veryplaintxt_headingfontfamily', $_REQUEST['vp_headingfontfamily'] );
update_option( 'veryplaintxt_posttextalignment', $_REQUEST['vp_posttextalignment'] );
update_option( 'veryplaintxt_layoutwidth', $_REQUEST['vp_layoutwidth'] );
update_option( 'veryplaintxt_maxwidth', $_REQUEST['vp_maxwidth'] );
update_option( 'veryplaintxt_minwidth', $_REQUEST['vp_minwidth'] );
update_option( 'veryplaintxt_sidebarposition', $_REQUEST['vp_sidebarposition'] );
update_option( 'veryplaintxt_sidebartextalignment', $_REQUEST['vp_sidebartextalignment'] );
if( isset( $_REQUEST['vp_basefontsize'] ) ) { update_option( 'veryplaintxt_basefontsize', $_REQUEST['vp_basefontsize'] ); } else { delete_option( 'veryplaintxt_basefontsize' ); }
if( isset( $_REQUEST['vp_basefontfamily'] ) ) { update_option( 'veryplaintxt_basefontfamily', $_REQUEST['vp_basefontfamily'] ); } else { delete_option( 'veryplaintxt_basefontfamily' ); }
if( isset( $_REQUEST['vp_headingfontfamily'] ) ) { update_option( 'veryplaintxt_headingfontfamily', $_REQUEST['vp_headingfontfamily'] ); } else { delete_option('veryplaintxt_headingfontfamily'); }
if( isset( $_REQUEST['vp_posttextalignment' ] ) ) { update_option( 'veryplaintxt_posttextalignment', $_REQUEST['vp_posttextalignment'] ); } else { delete_option('veryplaintxt_posttextalignment'); }
if( isset( $_REQUEST['vp_layoutwidth' ] ) ) { update_option( 'veryplaintxt_layoutwidth', $_REQUEST['vp_layoutwidth'] ); } else { delete_option('veryplaintxt_layoutwidth'); }
if( isset( $_REQUEST['vp_maxwidth' ] ) ) { update_option( 'veryplaintxt_maxwidth', $_REQUEST['vp_maxwidth'] ); } else { delete_option('veryplaintxt_maxwidth'); }
if( isset( $_REQUEST['vp_minwidth' ] ) ) { update_option( 'veryplaintxt_minwidth', $_REQUEST['vp_minwidth'] ); } else { delete_option('veryplaintxt_minwidth'); }
if( isset( $_REQUEST['vp_sidebarposition' ] ) ) { update_option( 'veryplaintxt_sidebarposition', $_REQUEST['vp_sidebarposition'] ); } else { delete_option('veryplaintxt_sidebarposition'); }
if( isset( $_REQUEST['vp_sidebartextalignment' ] ) ) { update_option( 'veryplaintxt_sidebartextalignment', $_REQUEST['vp_sidebartextalignment'] ); } else { delete_option('veryplaintxt_sidebartextalignment'); }
header("Location: themes.php?page=functions.php&saved=true");
die;
} else if( 'reset' == $_REQUEST['action'] ) {
delete_option('veryplaintxt_basefontsize');
delete_option('veryplaintxt_basefontfamily');
delete_option('veryplaintxt_headingfontfamily');
delete_option('veryplaintxt_posttextalignment');
delete_option('veryplaintxt_layoutwidth');
delete_option('veryplaintxt_maxwidth');
delete_option('veryplaintxt_minwidth');
delete_option('veryplaintxt_sidebarposition');
delete_option('veryplaintxt_sidebartextalignment');
header("Location: themes.php?page=functions.php&reset=true");
die;
}
add_action('admin_head', 'veryplaintxt_admin_head');
}
add_theme_page("veryplaintxt Options", "veryplaintxt Options", 'edit_themes', basename(__FILE__), 'veryplaintxt_admin');
}
function veryplaintxt_admin_head() {
?>
View site ›', 'veryplaintxt'), get_bloginfo('home') . '/'); ?>
veryplaintxt 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 .', 'veryplaintxt'); ?>
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.', 'veryplaintxt'); ?>