From e8f665c7214f8a299976455f136e807a4b0b67b9 Mon Sep 17 00:00:00 2001 From: "Philip M. Hofer (Frumph)" Date: Mon, 21 Dec 2009 15:07:40 -0800 Subject: [PATCH] Deleting Deprecated files, moved widgets to .inc (most) Signed-off-by: Philip M. Hofer (Frumph) --- functions/checkbrowser.php | 3 - functions/rawformatting.php | 3 - functions/shortcodes.php | 10 ++++ functions/userpages.php | 3 - widgets/BuyPrintWidget.inc | 63 +++++++++++++++++++++ widgets/ComicBlogPostWidget.inc | 52 +++++++++++++++++ widgets/ComicDateWidget.inc | 53 ++++++++++++++++++ widgets/ComicTitleWidget.inc | 39 +++++++++++++ widgets/CommentsWidget.inc | 55 ++++++++++++++++++ widgets/ControlPanelWidget.inc | 82 +++++++++++++++++++++++++++ widgets/LatestThumbnailWidget.inc | 62 +++++++++++++++++++++ widgets/NonMemberTextWidget.inc | 50 +++++++++++++++++ widgets/PermalinkWidget.inc | 51 +++++++++++++++++ widgets/ScheduledPostsWidget.inc | 57 +++++++++++++++++++ widgets/SocialWidget.inc | 89 ++++++++++++++++++++++++++++++ widgets/TranscriptSearchWidget.inc | 47 ++++++++++++++++ widgets/TranscriptWidget.inc | 56 +++++++++++++++++++ 17 files changed, 766 insertions(+), 9 deletions(-) delete mode 100644 functions/checkbrowser.php delete mode 100644 functions/rawformatting.php create mode 100644 functions/shortcodes.php delete mode 100644 functions/userpages.php create mode 100644 widgets/BuyPrintWidget.inc create mode 100644 widgets/ComicBlogPostWidget.inc create mode 100644 widgets/ComicDateWidget.inc create mode 100644 widgets/ComicTitleWidget.inc create mode 100644 widgets/CommentsWidget.inc create mode 100644 widgets/ControlPanelWidget.inc create mode 100644 widgets/LatestThumbnailWidget.inc create mode 100644 widgets/NonMemberTextWidget.inc create mode 100644 widgets/PermalinkWidget.inc create mode 100644 widgets/ScheduledPostsWidget.inc create mode 100644 widgets/SocialWidget.inc create mode 100644 widgets/TranscriptSearchWidget.inc create mode 100644 widgets/TranscriptWidget.inc diff --git a/functions/checkbrowser.php b/functions/checkbrowser.php deleted file mode 100644 index 7ac7fd1..0000000 --- a/functions/checkbrowser.php +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/functions/rawformatting.php b/functions/rawformatting.php deleted file mode 100644 index 7ac7fd1..0000000 --- a/functions/rawformatting.php +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/functions/shortcodes.php b/functions/shortcodes.php new file mode 100644 index 0000000..1fb03c5 --- /dev/null +++ b/functions/shortcodes.php @@ -0,0 +1,10 @@ +'.$comicpress_version['comicpress_version'].''; +} + +?> \ No newline at end of file diff --git a/functions/userpages.php b/functions/userpages.php deleted file mode 100644 index 7ac7fd1..0000000 --- a/functions/userpages.php +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/widgets/BuyPrintWidget.inc b/widgets/BuyPrintWidget.inc new file mode 100644 index 0000000..3042768 --- /dev/null +++ b/widgets/BuyPrintWidget.inc @@ -0,0 +1,63 @@ + __CLASS__, 'description' => __('Adds a button that goes to the buy print template page.','comicpress') ); + $this->WP_Widget(__CLASS__, __('ComicPress Buy This Print','comicpress'), $widget_ops); + } + } + + function init() { + add_filter('comicpress_buy_print_structure', array(&$this, 'buy_print_structure')); + } + + function widget($args, $instance) { + extract($args, EXTR_SKIP); + + echo $before_widget; + $title = apply_filters('widget_title', $instance['title']); + if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }; + + if ( get_post_meta( get_the_ID(), "buythiscomic", true ) !== 'sold' ) { + echo apply_filters('comicpress_buy_print_structure', ''); + } + + echo $after_widget; + } + + function buy_print_structure($content = '') { + $comicpress_options = comicpress_load_options(); ?> +
+ +
+
+ '' ) ); + $title = strip_tags($instance['title']); + ?> +

+ __CLASS__, 'description' => __('Displays the comic blog post, ..used to be around the comic areas.','comicpress') ); + $this->WP_Widget(__CLASS__, __('ComicPress Comic Blog Post','comicpress'), $widget_ops); + } + } + + function widget($args, $instance) { + global $post, $wp_query; + if (is_home() || is_single()) { + extract($args, EXTR_SKIP); + if (!empty($post->post_content)) { + echo $before_widget; + $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); + if ( !empty( $title ) ) { echo '
'.$title.'
'; } + + display_comic_post(); + 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/ComicDateWidget.inc b/widgets/ComicDateWidget.inc new file mode 100644 index 0000000..bc2412b --- /dev/null +++ b/widgets/ComicDateWidget.inc @@ -0,0 +1,53 @@ + __CLASS__, 'description' => __('Displays the date of the post of the comic.','comicpress') ); + $this->WP_Widget(__CLASS__, __('ComicPress Comic Date','comicpress'), $widget_ops); + } + } + + function widget($args, $instance) { + global $post; + extract($args, EXTR_SKIP); + + echo $before_widget; + $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); + if ( !empty( $title ) ) { echo $title; } ?> + '', 'format' => '' ) ); + $title = strip_tags($instance['title']); + $format = strip_tags($instance['format']); + if (empty($format)) $format = 'F jS, Y'; + ?> +

+

+

+ + \ No newline at end of file diff --git a/widgets/ComicTitleWidget.inc b/widgets/ComicTitleWidget.inc new file mode 100644 index 0000000..b93caa4 --- /dev/null +++ b/widgets/ComicTitleWidget.inc @@ -0,0 +1,39 @@ + __CLASS__, 'description' => __('Displays the title of the comic. (used in comic sidebars)','comicpress') ); + $this->WP_Widget(__CLASS__, __('ComicPress Comic Title','comicpress'), $widget_ops); + } + } + + function widget($args, $instance) { + global $post; + extract($args, EXTR_SKIP); + + echo $before_widget;?> + + \ No newline at end of file diff --git a/widgets/CommentsWidget.inc b/widgets/CommentsWidget.inc new file mode 100644 index 0000000..f2589fe --- /dev/null +++ b/widgets/CommentsWidget.inc @@ -0,0 +1,55 @@ + __CLASS__, 'description' => __('Displays a comments link. (used in comic sidebars)','comicpress') ); + $this->WP_Widget(__CLASS__, __('ComicPress Comic Comments','comicpress'), $widget_ops); + } + } + + function widget($args, $instance) { + global $post; + extract($args, EXTR_SKIP); + + echo $before_widget; + $title = empty($instance['title']) ? __('Permalink','comicpress') : apply_filters('widget_title', $instance['title']); ?> + comment_status) { ?> + '') ); + $title = strip_tags($instance['title']); + ?> +

+ \ No newline at end of file diff --git a/widgets/ControlPanelWidget.inc b/widgets/ControlPanelWidget.inc new file mode 100644 index 0000000..3096227 --- /dev/null +++ b/widgets/ControlPanelWidget.inc @@ -0,0 +1,82 @@ + __CLASS__, 'description' => __('Login/Logoff menu with register/lost password links if not logged on. (use only if registrations are enabled.','comicpress') ); + $this->WP_Widget(__CLASS__, __('ComicPress Control Panel','comicpress'), $widget_ops); + } + } + + function comicpress_show_control_panel() { + global $wpmu_version; ?> + +
+
+

+
+
+
+
+ + +
+
+ + + + + comicpress_show_control_panel(); + 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/LatestThumbnailWidget.inc b/widgets/LatestThumbnailWidget.inc new file mode 100644 index 0000000..e3d831b --- /dev/null +++ b/widgets/LatestThumbnailWidget.inc @@ -0,0 +1,62 @@ + __CLASS__, 'description' => __('Display a thumbnail of the latest comic, clickable to go to the comic post.','comicpress') ); + $this->WP_Widget(__CLASS__, __('ComicPress Latest Thumbnail','comicpress'), $widget_ops); + } + } + + function widget($args, $instance) { + global $post; + if (is_home()) { + extract($args, EXTR_SKIP); + + echo $before_widget; + $title = empty($instance['title']) ? __('Latest Comic','comicpress') : apply_filters('widget_title', $instance['title']); + if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }; + $latestcomics = get_posts('numberposts=1&category='.get_all_comic_categories_as_cat_string()); + $archive_image = null; + + foreach($latestcomics as $post) : + foreach (array("archive", "rss", "mini", "comic") as $type) { + if (($requested_archive_image = get_comic_url($type, $post)) !== false) { + $archive_image = $requested_archive_image; break; + } + } ?> +
+ <?php the_title() ?> - <?php the_date(); ?>
+ +
+ '' ) ); + $title = strip_tags($instance['title']); + ?> +

+ \ No newline at end of file diff --git a/widgets/NonMemberTextWidget.inc b/widgets/NonMemberTextWidget.inc new file mode 100644 index 0000000..2033b8e --- /dev/null +++ b/widgets/NonMemberTextWidget.inc @@ -0,0 +1,50 @@ + __CLASS__, 'description' => __('Displays Whatever is in the text box to non-members only.','comicpress') ); + $this->WP_Widget(__CLASS__, __('ComicPress Non-Member Text','comicpress'), $widget_ops); + } + } + + function widget($args, $instance) { + global $post, $wp_query; + if (!comicpress_is_member()) { + extract($args, EXTR_SKIP); + echo $before_widget; + $title = empty($instance['title']) ? '': apply_filters('widget_title', $instance['title']); + echo stripslashes($instance['textinfo']); + echo $after_widget; + } + } + + function update($new_instance, $old_instance) { + $instance = $old_instance; + $instance['title'] = strip_tags($new_instance['title']); + $instance['textinfo'] = addslashes($new_instance['textinfo']); + return $instance; + } + + function form($instance) { + $instance = wp_parse_args( (array) $instance, array( 'title' => '' , 'textinfo' => '') ); + $title = strip_tags($instance['title']); + $textinfo = stripslashes($instance['textinfo']); + ?> +

+

+ \ No newline at end of file diff --git a/widgets/PermalinkWidget.inc b/widgets/PermalinkWidget.inc new file mode 100644 index 0000000..e31b390 --- /dev/null +++ b/widgets/PermalinkWidget.inc @@ -0,0 +1,51 @@ + __CLASS__, 'description' => __('Displays a permalink. (used in comic sidebars)','comicpress') ); + $this->WP_Widget(__CLASS__, __('ComicPress Permalink','comicpress'), $widget_ops); + } + } + + function widget($args, $instance) { + global $post; + extract($args, EXTR_SKIP); + + echo $before_widget; + $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); ?> + + '' , 'comment' => '') ); + $title = strip_tags($instance['title']); + $comment = strip_tags($instance['comment']); + ?> +

+

+ + \ No newline at end of file diff --git a/widgets/ScheduledPostsWidget.inc b/widgets/ScheduledPostsWidget.inc new file mode 100644 index 0000000..6541842 --- /dev/null +++ b/widgets/ScheduledPostsWidget.inc @@ -0,0 +1,57 @@ + __CLASS__, 'description' => __('Display a list of posts that are scheduled to be published.','comicpress') ); + $this->WP_Widget(__CLASS__, __('ComicPress Scheduled Posts','comicpress'), $widget_ops); + } + } + + function widget($args, $instance) { + extract($args, EXTR_SKIP); + + echo '
'; + echo $before_widget; + $title = empty($instance['title']) ? __('Scheduled Posts','comicpress') : apply_filters('widget_title', $instance['title']); + if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }; + $scheduled_posts = get_posts('post_status=future&numberposts=-1'); + if (empty($scheduled_posts)) { + echo '
  • None.
'; + } else { ?> +
    + +
  • post_title; ?>
  • + +
+ '; + } + + 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/SocialWidget.inc b/widgets/SocialWidget.inc new file mode 100644 index 0000000..d7811a9 --- /dev/null +++ b/widgets/SocialWidget.inc @@ -0,0 +1,89 @@ + __CLASS__, 'description' => __('Display a user defined social button, with translated URL.','comicpress') ); + $this->WP_Widget(__CLASS__, __('ComicPress Social','comicpress'), $widget_ops); + } + } + + function widget($args, $instance) { + global $post; + extract($args, EXTR_SKIP); + + /* Get the info necessary */ + $permalink = get_permalink($post->ID); + $posttitle = $post->post_title; + $posttitle = str_replace(' ', '%20', $posttitle); + $title = $instance['title']; + if (empty($title)) $title = $posttitle; + + $rss = get_bloginfo('rss2_url'); + $blogname = urlencode(get_bloginfo('name')." ".get_bloginfo('description')); + // Grab the excerpt, if there is no excerpt, create one + $excerpt = urlencode(strip_tags(strip_shortcodes($post->post_excerpt))); + if ($excerpt == "") { + $excerpt = urlencode(substr(strip_tags(strip_shortcodes($post->post_content)),0,250)); + } + // Clean the excerpt for use with links + $excerpt = str_replace('+','%20',$excerpt); + + echo $before_widget; + $url = $instance['urlstr']; + $url = str_replace('[URL]', $permalink, $url); + $url = str_replace('[TITLE]', $posttitle, $url); + $url = str_replace('[RSS]', $rss, $url); + $url = str_replace('[BLOGNAME]', $blogname, $url); + $url = str_replace('[EXCERPT]', $excerpt, $url); ?> + + + 'Share This!', 'urlstr' => '', 'image' => '') ); + $title = strip_tags($instance['title']); + if (empty($title)) $title = 'Share This!'; + $urlstr = strip_tags($instance['urlstr']); + $image = strip_tags($instance['image']); + ?> + + Translated Strings: [URL] [TITLE] [RSS] [BLOGNAME] [EXCERPT]
+ Examples:
+ http://twitter.com/home?status=[TITLE]%20-%20[URL]
+ http://www.stumbleupon.com/submit?url=[URL]&title=[TITLE]
+
+
+

+

+

+ \ No newline at end of file diff --git a/widgets/TranscriptSearchWidget.inc b/widgets/TranscriptSearchWidget.inc new file mode 100644 index 0000000..f5c77c3 --- /dev/null +++ b/widgets/TranscriptSearchWidget.inc @@ -0,0 +1,47 @@ + __CLASS__, 'description' => __('Displays a form input box for searching transcripts.','comicpress') ); + $this->WP_Widget(__CLASS__, __('ComicPress Search Transcripts','comicpress'), $widget_ops); + } + } + + function widget($args, $instance) { + global $post; + extract($args, EXTR_SKIP); + + echo $before_widget; + $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); + if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }; + include(get_template_directory() . '/searchform-transcript.php'); + 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/TranscriptWidget.inc b/widgets/TranscriptWidget.inc new file mode 100644 index 0000000..b8dee3c --- /dev/null +++ b/widgets/TranscriptWidget.inc @@ -0,0 +1,56 @@ + __CLASS__, 'description' => __('Display the transcription of the current post if there is one. (used in comic sidebars)','comicpress') ); + $this->WP_Widget(__CLASS__, __('ComicPress Transcript','comicpress'), $widget_ops); + } + } + + function widget($args, $instance) { + extract($args, EXTR_SKIP); + + echo $before_widget; + $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); + $transtype = empty($instance['transtype']) ? 'empty' : apply_filters('widget_transtype', $instance['transtype']); + if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }; + the_transcript($transtype); + echo $after_widget; + } + + function update($new_instance, $old_instance) { + $instance = $old_instance; + $instance['title'] = strip_tags($new_instance['title']); + $instance['transtype'] = strip_tags($new_instance['transtype']); + return $instance; + } + + function form($instance) { + $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'transtype' => '' ) ); + $title = strip_tags($instance['title']); + $transtype = strip_tags($instance['transtype']); + if (empty($transtype)) $transtype = 'styled'; + ?> +

+

+
+
+ +

+ \ No newline at end of file