From 1ceb695ffc3960a7b640390de53fc19f24d343fa Mon Sep 17 00:00:00 2001 From: "Philip M. Hofer (Frumph)" Date: Mon, 21 Dec 2009 14:26:24 -0800 Subject: [PATCH] MenubarWidget.inc LatestComicsWidget.inc dep'd latestcomics.php, revamped sidebar-left.php and sidebar-right.php to use the_widget() Signed-off-by: Philip M. Hofer (Frumph) --- README | 6 +- sidebar-left.php | 22 +++--- sidebar-right.php | 31 ++++----- widgets/LatestComicsWidget.inc | 51 ++++++++++++++ widgets/MenubarWidget.inc | 121 +++++++++++++++++++++++++++++++++ widgets/latestcomics.php | 70 ------------------- 6 files changed, 196 insertions(+), 105 deletions(-) create mode 100644 widgets/LatestComicsWidget.inc create mode 100644 widgets/MenubarWidget.inc diff --git a/README b/README index 26b0e68..687eb68 100644 --- a/README +++ b/README @@ -1,8 +1,8 @@ ComicPress is the WordPress Comic Pubishing Theme. -Copyright 2005-2009 Tyler Martin -Copyright 2008-2009 John Bintz -Copyright 2009 Philip M. Hofer +Copyright 2005-2010 Tyler Martin +Copyright 2008-2010 John Bintz +Copyright 2009-2010 Philip M. Hofer This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/sidebar-left.php b/sidebar-left.php index e2949e0..fddaef6 100644 --- a/sidebar-left.php +++ b/sidebar-left.php @@ -3,19 +3,15 @@ if (!$comicpress_options['disable_lrsidebars_frontpage']) { ?> diff --git a/sidebar-right.php b/sidebar-right.php index 19ef237..e25199f 100644 --- a/sidebar-right.php +++ b/sidebar-right.php @@ -3,25 +3,18 @@ if (!$comicpress_options['disable_lrsidebars_frontpage']) { ?> diff --git a/widgets/LatestComicsWidget.inc b/widgets/LatestComicsWidget.inc new file mode 100644 index 0000000..fbd4d2a --- /dev/null +++ b/widgets/LatestComicsWidget.inc @@ -0,0 +1,51 @@ + __CLASS__, 'description' => __('Display a list of the latest comics available.','comicpress') ); + $this->WP_Widget(__CLASS__, __('ComicPress Latest Comics','comicpress'), $widget_ops); + } + } + + function widget($args, $instance) { + global $post; + extract($args, EXTR_SKIP); + + echo $before_widget; + $title = empty($instance['title']) ? __('Latest Comics','comicpress') : apply_filters('widget_title', $instance['title']); + if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }; + $latestcomics = get_posts('numberposts=5&category='.get_all_comic_categories_as_cat_string()); ?> + + '' ) ); + $title = strip_tags($instance['title']); + ?> +

+ \ No newline at end of file diff --git a/widgets/MenubarWidget.inc b/widgets/MenubarWidget.inc new file mode 100644 index 0000000..fa48ac7 --- /dev/null +++ b/widgets/MenubarWidget.inc @@ -0,0 +1,121 @@ + __CLASS__, 'description' => __('Displays a menubar.','comicpress') ); + $this->WP_Widget(__CLASS__, __('Comicpress Menubar','comicpress'), $widget_ops); + } + } + + function comicpress_menubar() { + global $comicpress_options; + if (comicpress_check_child_file('menubar') == false) { + if (file_exists(get_stylesheet_directory() . '/custom-menubar.php')) { + include(get_stylesheet_directory() . '/custom-menubar.php'); + } else { ?> + + comicpress_menubar(); + echo $after_widget; + } + + function update($new_instance, $old_instance) { + $instance = $old_instance; + $instance['title'] = strip_tags($new_instance['title']); + return $instance; + } + + function form($instance) { + $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) ); + $title = strip_tags($instance['title']); + ?> +

+ \ No newline at end of file diff --git a/widgets/latestcomics.php b/widgets/latestcomics.php index 2d3c76c..e69de29 100644 --- a/widgets/latestcomics.php +++ b/widgets/latestcomics.php @@ -1,70 +0,0 @@ - -

Latest Comics

- - 'widget_comicpress_latest_comics', 'description' => __('Display a list of the latest comics available.','comicpress') ); - $this->WP_Widget('comicpress_latest_comics', __('ComicPress Latest Comics','comicpress'), $widget_ops); - } - - function widget($args, $instance) { - global $post; - extract($args, EXTR_SKIP); - - echo $before_widget; - $title = empty($instance['title']) ? __('Latest Comics','comicpress') : apply_filters('widget_title', $instance['title']); - if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }; - $latestcomics = get_posts('numberposts=5&category='.get_all_comic_categories_as_cat_string()); ?> - - '' ) ); - $title = strip_tags($instance['title']); - ?> -

- \ No newline at end of file