calendar now allows options for thumbnails and wallpaper links some styling fixes

Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
This commit is contained in:
Philip M. Hofer (Frumph) 2009-08-26 19:08:01 -07:00
parent 94ad13698a
commit 2b863e844f
5 changed files with 37 additions and 9 deletions

View File

@ -90,7 +90,7 @@ function comicpress_admin() {
switch ( $value['type'] ) { switch ( $value['type'] ) {
case "comicpress-cp_theme_style": ?> case "comicpress-cp_theme_style": ?>
<tr> <tr>
<th scope="row"><strong>Choose which theme style you want to use.</strong><br /><br />This is the style in which your theme will be presented.<br /><br /></th> <th scope="row"><strong>Choose which theme style you want to use.</strong><br /><br />This is the style in which your theme will be presented.<br /><br />NOTE: Use 3-Column theme if you're using ComicPress as a Blog.</th>
<td valign="top"> <td valign="top">
<label> <label>
<select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" class="code" onchange="showimage(this,'cpthemestyle')"> <select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" class="code" onchange="showimage(this,'cpthemestyle')">

View File

@ -10,7 +10,7 @@
<?php } ?> <?php } ?>
<?php get_sidebar('footer'); ?> <?php get_sidebar('footer'); ?>
<p> <p>
&copy;<?php echo cp_copyright_year(); ?> <?php echo the_author_meta('firstname',0); echo "&nbsp;"; echo the_author_meta('lastname'); ?>. <?php bloginfo('name') ?> is powered by <a href="http://wordpress.org/">WordPress</a> with <a href="http://comicpress.org/">ComicPress</a> &copy;<?php echo cp_copyright_year(); ?> <?php echo the_author_meta('firstname',0); echo "&nbsp;"; echo the_author_meta('lastname',0); ?>. <?php bloginfo('name') ?> is powered by <a href="http://wordpress.org/">WordPress</a> with <a href="http://comicpress.org/">ComicPress</a>
| Subscribe: <a href="<?php bloginfo('rss2_url') ?>">RSS Feed</a> | <a href="#outside" onclick="scrollup(); return false;">Back to Top &uarr;</a><br /> | Subscribe: <a href="<?php bloginfo('rss2_url') ?>">RSS Feed</a> | <a href="#outside" onclick="scrollup(); return false;">Back to Top &uarr;</a><br />
<!-- <?php echo get_num_queries() ?> queries. <?php timer_stop(1) ?> seconds. --> <!-- <?php echo get_num_queries() ?> queries. <?php timer_stop(1) ?> seconds. -->
</p> </p>

View File

@ -64,7 +64,7 @@ function comicpress_showmood_edit_post() {
$newmood = explode(".", $newmood_file); $newmood = explode(".", $newmood_file);
$newmood = $newmood[0]; ?> $newmood = $newmood[0]; ?>
<div style="float:left; margin-top: 10px; text-align: center; width: 68px; overflow: hidden;"> <div style="float:left; margin-top: 10px; text-align: center; width: 68px; overflow: hidden;">
<label for="<?php echo $newmood; ?>" style="cursor:pointer;"> <label for="postmood-<?php echo $newmood; ?>" style="cursor:pointer;">
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/moods/<?php echo $moods_directory; ?>/<?php echo basename($file); ?>"><br /> <img src="<?php bloginfo('stylesheet_directory'); ?>/images/moods/<?php echo $moods_directory; ?>/<?php echo basename($file); ?>"><br />
<?php echo $newmood; ?> <?php echo $newmood; ?>
</label> </label>

View File

@ -373,7 +373,6 @@ h3, h3 a {
background:#fff; background:#fff;
padding:10px 0; padding:10px 0;
border:1px solid #999; border:1px solid #999;
margin:10px 0 0 0;
text-align: center; text-align: center;
z-index: 100; z-index: 100;
} }
@ -908,6 +907,12 @@ ul.children {
margin: 0 auto; margin: 0 auto;
} }
.wp-calendar-thumb {
width: 178px;
height: 130px;
margin: 0 auto;
}
#wp-calendar th { #wp-calendar th {
font-size: 10px; font-size: 10px;

View File

@ -1,6 +1,6 @@
<?php <?php
/* /*
Widget Name: Calendar Widget Name: ComicPress Calendar
Widget URI: http://comicpress.org/ Widget URI: http://comicpress.org/
Description: Display a calendar of this months posts. Description: Display a calendar of this months posts.
Author: Philip M. Hofer (Frumph) Author: Philip M. Hofer (Frumph)
@ -9,10 +9,19 @@ Author URI: http://webcomicplanet.com/
*/ */
function comicpress_calendar() { function comicpress_calendar($instance) {
global $post; ?> global $post;
$thumbnail = $instance['thumbnail'];
$small = $instance['small'];
$medium = $instance['medium'];
$large = $instance['large'];
?>
<div id="wp-calendar-top"></div> <div id="wp-calendar-top"></div>
<div id="wp-calendar-wrap"> <div id="wp-calendar-wrap">
<?php if (!empty($thumbnail)) { ?>
<img src="<?php echo $thumbnail; ?>" alt="" class="wp-calendar-thumb" /><br />
<?php if (!empty($small)) { ?>[<a href="<?php echo $small; ?>">S</a>] <?php } ?><?php if (!empty($medium)) { ?>[<a href="<?php echo $medium; ?>">M</a>] <?php } ?><?php if (!empty($large)) { ?>[<a href="<?php echo $large; ?>">L</a>] <?php } ?>
<?php } ?>
<?php get_calendar(); ?> <?php get_calendar(); ?>
</div> </div>
<div id="wp-calendar-bottom"></div> <div id="wp-calendar-bottom"></div>
@ -32,21 +41,35 @@ class widget_comicpress_calendar extends WP_Widget {
echo $before_widget; echo $before_widget;
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }; if ( !empty( $title ) ) { echo $before_title . $title . $after_title; };
comicpress_calendar(); comicpress_calendar($instance);
echo $after_widget; echo $after_widget;
} }
function update($new_instance, $old_instance) { function update($new_instance, $old_instance) {
$instance = $old_instance; $instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']); $instance['title'] = strip_tags($new_instance['title']);
$instance['thumbnail'] = strip_tags($new_instance['thumbnail']);
$instance['small'] = strip_tags($new_instance['small']);
$instance['medium'] = strip_tags($new_instance['medium']);
$instance['large'] = strip_tags($new_instance['large']);
return $instance; return $instance;
} }
function form($instance) { function form($instance) {
$instance = wp_parse_args( (array) $instance, array( 'title' => '' ) ); $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'thumbnail' => '', 'small' => '', 'medium' => '', 'large' => '') );
$title = strip_tags($instance['title']); $title = strip_tags($instance['title']);
$thumbnail = strip_tags($instance['thumbnail']);
$small = strip_tags($instance['small']);
$medium = strip_tags($instance['medium']);
$large = strip_tags($instance['large']);
?> ?>
<p><label for="<?php echo $this->get_field_id('title'); ?>">Title: <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" /></label></p> <p><label for="<?php echo $this->get_field_id('title'); ?>">Title: <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" /></label></p>
<p><label for="<?php echo $this->get_field_id('thumbnail'); ?>">Thumbnail URL: <input class="widefat" id="<?php echo $this->get_field_id('thumbnail'); ?>" name="<?php echo $this->get_field_name('thumbnail'); ?>" type="text" value="<?php echo attribute_escape($thumbnail); ?>" /></label></p>
<p><label for="<?php echo $this->get_field_id('small'); ?>">Wallpaper URL (Small): <input class="widefat" id="<?php echo $this->get_field_id('small'); ?>" name="<?php echo $this->get_field_name('small'); ?>" type="text" value="<?php echo attribute_escape($small); ?>" /></label></p>
<p><label for="<?php echo $this->get_field_id('medium'); ?>">Wallpaper URL (Medium): <input class="widefat" id="<?php echo $this->get_field_id('medium'); ?>" name="<?php echo $this->get_field_name('medium'); ?>" type="text" value="<?php echo attribute_escape($medium); ?>" /></label></p>
<p><label for="<?php echo $this->get_field_id('large'); ?>">Wallpaper URL (Large): <input class="widefat" id="<?php echo $this->get_field_id('large'); ?>" name="<?php echo $this->get_field_name('large'); ?>" type="text" value="<?php echo attribute_escape($large); ?>" /></label></p>
<?php <?php
} }
} }