Permalink
Browse files

Added Tip Jar and changed some styles and displaycomic.php notice fix…

… with multicomics

Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
  • Loading branch information...
1 parent 14ca08f commit fe53acd1d626cb16fc2de1af2ea4637ab499c2c0 Philip M. Hofer (Frumph) committed Nov 28, 2010
View
@@ -5,6 +5,8 @@ added .post-time / .posted-at new function comicpress_display_post_time() which
alt-text/hovertext change in the displaypost.php file, it now outputs the hovertext/alt-text on thumbnails and rss feeds
and shows the alt-text whether Rascal is active or not
removed extra id="" in the textarea for the comment form, #comment-textarea no longer exists, its just #comment now
+set $outputscript = ''; in the displaycomic.php so it doesn't give notice if it doesn't exist, which it doesn't anyways but oh well; future endeavors.
+
2.9.2.24
Removed the tabindex from the comments.php field for textarea
@@ -18,8 +20,7 @@ implemented easel's menubar code which uses less CSS then the new comicpress's /
fixed classic menubar's error with the comicpress_get_all_comic_categories_as_cat_string() when its supposed to be: comicpress_all_comic_categories_string()
You can now assign comics to individual posts, which means.. yes.. multiple comics per day with multiple posts. A little bit extra work than just uploading but works great.
Still need to make comicpress managers bulk editor recognize which comic is assigned to it and think about making an assign comic box for the post editor.
-* Added new widget "Donation" widget which lets you set a 'target' donation amount and then set how much in donations
-* Added new widget "Incentive" which displays a portion of a thumbnail based on how much has been donated, when 100% links to the donation image.
+* Added new widget "Tip Jar" widget which lets you set a 'target' donation amount and then set how much in donations
you currently have and it displays a nice little donation image percentile of how far its got to go to get the target mark
Fixed Notice that appears on 404 and search pages when no results found.
added info about child themes on the layout options page and links to download them
@@ -171,6 +171,7 @@ function comicpress_display_comic() {
if (is_array($comics)) {
$count = 1;
$outputlist = '';
+ $outputscript = '';
foreach ($comics as $comic) {
$comicsplit = explode(".", $comic);
switch (strtolower($comicsplit[1])) {
Deleted file not rendered
View
Deleted file not rendered
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -43,7 +43,9 @@
<td>
<input id="enable_multicomic_jquery" name="enable_multicomic_jquery" type="checkbox" value="1" <?php checked(true, comicpress_themeinfo('enable_multicomic_jquery')); ?> />
</td>
- <td></td>
+ <td>
+ <?php _e('This is if you have uploaded multiple comics on the same date, it puts button navigation under the comic so you can navigate the comics that are on the same date.','comicpress'); ?>
+ </td>
</tr>
</table>
View
@@ -387,6 +387,15 @@ h4, h4 a {
text-align: center;
}
+/* the style of this is further down */
+#comic button {
+ float: left;
+}
+
+.ie #comic button {
+ color: #fff;
+}
+
/* THE FOOTER */
#footer {
@@ -1051,7 +1060,7 @@ table#wp-calendar td {
background: #fff;
}
-#submit, #searchform button {
+#submit, #searchform button, #comic button {
background: #111;
color: #000;
-moz-border-radius: 10px;
@@ -1624,26 +1633,13 @@ textarea {
overflow: auto;
}
-#comic button {
- background: #efefef;
- color: #000;
- float: left;
- margin: 2px 0px 2px 5px;
-}
-
-.donatebox-wrap, .donatebox, .donateunderbox {
- height: 100px;
- width: 100px;
+.tipjar-wrap, .tipjarbox, .tipjarunderbox {
+ height: 200px;
+ width: 200px;
float: right;
overflow: hidden;
}
-.donateunderbox {
- background: url('images/donatebox-amount.png') top center no-repeat;
+.tipjarunderbox {
+ background: url('images/gauge.png') top center no-repeat;
}
-
-.donate-message {
- padding: 2px;
- font-size: 10px;
- color: #333;
-}
View
@@ -0,0 +1,85 @@
+<?php
+/*
+Widget Name: Tip Jar Widget
+Widget URI: http://comicpress.org/
+Description: Display a Tip Jar that has gauge to goal.
+Author: Philip M. Hofer (Frumph)
+Author URI: http://frumph.net/
+Version: 1.0
+*/
+
+class comicpress_tipjar_widget extends WP_Widget {
+
+ function comicpress_tipjar_widget($skip_widget_init = false) {
+ if (!$skip_widget_init) {
+ $widget_ops = array('classname' => __CLASS__, 'description' => __('Displays a Tip Jar box and shows how much has been donated with goal.','comicpress') );
+ $this->WP_Widget(__CLASS__, __('Tip Jar','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; };
+ $total = $instance['total'];
+ $current = $instance['current'];
+ $height = $instance['height'];
+ if (empty($height)) $height = '200';
+ if (empty($total)) $total = '100';
+ if (empty($current)) $current = '0';
+ $gauge = get_template_directory_uri().'/images/gauge.png';
+ $tipjarimage = get_template_directory_uri().'/images/tip-jar.png';
+ if (is_child_theme()) {
+ if (file_exists(get_stylesheet_directory().'/images/tip-jar.png')) {
+ $tipjarimage = get_stylesheet_directory_uri().'/images/tip-jar.png';
+ }
+ if (file_exists(get_stylesheet_directory().'/images/gauge.png')) {
+ $gauge = get_stylesheet_directory_uri().'/images/gauge.png';
+ }
+ }
+ $percent = $height-(2*(number_format(($current * 100) / $total)));
+ // $percent = 100-$percent;
+ ?>
+ <div class="tipjarbox-wrap">
+ <div class="tipjarunderbox" style="background: url('<?php echo $gauge; ?>') no-repeat; background-position: 0 <?php echo $percent; ?>px;">
+ <div class="tipjarbox" style="background: url('<?php echo $tipjarimage; ?>') top center no-repeat;"></div>
+ </div>
+ </div>
+ <?php
+ echo $after_widget;
+ }
+
+ function update($new_instance, $old_instance) {
+ $instance = $old_instance;
+ $instance['title'] = strip_tags($new_instance['title']);
+ $instance['total'] = strip_tags($new_instance['total']);
+ $instance['current'] = strip_tags($new_instance['current']);
+ $instance['url'] = esc_attr($new_instance['url']);
+ $instance['height'] = strip_tags($new_instance['height']);
+ return $instance;
+ }
+
+ function form($instance) {
+ $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'total' => '100', 'current' => '0', 'url' => 'http://yourdomain.com/pathtodonationpage', 'height' => '200') );
+ $title = strip_tags($instance['title']);
+ $total = strip_tags($instance['total']);
+ $current = strip_tags($instance['current']);
+ $url = esc_attr($instance['url']);
+ $height = strip_tags($instance['height']);
+ ?>
+ <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:','comicpress'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></label></p>
+ <?php _e('Just input an integer number like 200 or 300, not a dollar amount.','comicpress'); ?><br />
+ <p><label for="<?php echo $this->get_field_id('total'); ?>"><?php _e('Total $ Looking For::','comicpress'); ?> <input class="widefat" id="<?php echo $this->get_field_id('total'); ?>" name="<?php echo $this->get_field_name('total'); ?>" type="text" value="<?php echo esc_attr($total); ?>" /></label></p>
+ <?php _e('Make sure the number in the current is LESS then the number of the total.','comicpress'); ?><br />
+ <p><label for="<?php echo $this->get_field_id('current'); ?>"><?php _e('Current $ Received:','comicpress'); ?> <input class="widefat" id="<?php echo $this->get_field_id('current'); ?>" name="<?php echo $this->get_field_name('current'); ?>" type="text" value="<?php echo esc_attr($current); ?>" /></label></p>
+ <p><label for="<?php echo $this->get_field_id('url'); ?>"><?php _e('URL To Donation Page:','comicpress'); ?> <input class="widefat" id="<?php echo $this->get_field_id('url'); ?>" name="<?php echo $this->get_field_name('url'); ?>" type="text" value="<?php echo esc_attr($url); ?>" /></label></p>
+ <p><label for="<?php echo $this->get_field_id('height'); ?>"><?php _e('Height of the image area to use in the math for percent total (if you did not make custom graphics, this should not change).','comicpress'); ?> <input class="widefat" id="<?php echo $this->get_field_id('height'); ?>" name="<?php echo $this->get_field_name('height'); ?>" type="text" value="<?php echo esc_attr($height); ?>" /></label></p>
+ <?php
+ }
+}
+register_widget('comicpress_tipjar_widget');
+
+?>

0 comments on commit fe53acd

Please sign in to comment.