removed more of dropbar, finished the comicpress archive dropdown 2.8 widget

Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
This commit is contained in:
Philip M. Hofer (Frumph) 2009-08-27 12:48:09 -07:00
parent 6bb85f9287
commit f87ad80919
7 changed files with 94 additions and 118 deletions

View File

@ -120,6 +120,7 @@ require_once(get_template_directory() . '/widgets/comicdate.php');
require_once(get_template_directory() . '/widgets/comictitle.php');
require_once(get_template_directory() . '/widgets/comiccomments.php');
require_once(get_template_directory() . '/widgets/menubar.php');
require_once(get_template_directory() . '/widgets/archive-dropdown.php');
// FUNCTIONS & Extra's
@ -717,19 +718,6 @@ if ( function_exists('register_sidebar') ) {
register_sidebar(array('name'=>'Drop Bar','before_widget' => '<ul><li id="%1$s" class="widget %2$s">','after_widget' => '</li></ul>','before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>' ));
}
function widget_comicpress_archive_dropdown() { ?>
<ul>
<li class="archive-dropdown-wrap">
<select name="archive-dropdown" class="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'>
<option value=""><?php echo attribute_escape(__('Archives...')); ?></option>
<?php wp_get_archives('type=monthly&format=option&show_post_count=1'); ?> </select>
</li>
</ul>
<?php } if ( function_exists('register_sidebar_widget') )
register_sidebar_widget(__('Archive Dropdown'), 'widget_comicpress_archive_dropdown');
function storyline_category_list() {
$listcats = wp_list_categories('echo=0&title_li=&include='.get_all_comic_categories_as_cat_string());
$listcats = str_replace("<ul class='children'>", "<ul class='children'> &raquo; ", $listcats);

View File

@ -2,7 +2,7 @@
// Custom Image Header
define('HEADER_TEXTCOLOR', '000');
// define('HEADER_IMAGE', '%s/images/header-blank.png'); // %s is theme dir uri
define('HEADER_IMAGE', '%s/images/header-blank.png'); // %s is theme dir
define('HEADER_IMAGE_WIDTH', $custom_image_header_width);
define('HEADER_IMAGE_HEIGHT', $custom_image_header_height);

View File

@ -1,68 +0,0 @@
var DropBarMover = new Object();
DropBarMover.isMouseOver = false;
DropBarMover.isFocus = false;
DropBarMover.timerID = null;
DropBarMover.DropBarInstance = null;
DropBarMover.mouseOver = function (e)
{
this.isMouseOver = true;
this.adjustDropBar();
}
DropBarMover.mouseOut = function (e)
{
this.isMouseOver = false;
this.adjustDropBar();
}
DropBarMover.focus = function (e)
{
this.isFocus = true;
this.adjustDropBar();
}
DropBarMover.blur = function (e)
{
this.isFocus = false;
this.adjustDropBar();
}
DropBarMover.adjustDropBar = function()
{
if ( this.timerID == null )
{
if ( !this.DropBarInstance )
this.DropBarInstance = document.getElementById('DropBar');
this.timerID = window.setInterval(function(){
var Location = DropBarMover.DropBarInstance.style.top;
Location = parseInt(Location.substr(0,Location.length-2));
if ( DropBarMover.isMouseOver || DropBarMover.isFocus )
{
if ( Location < 0 )
{
Location+=5;
DropBarMover.DropBarInstance.style.top = Location + 'px';
}
else
{
window.clearInterval(DropBarMover.timerID);
DropBarMover.timerID = null;
}
}
else
{
if ( Location > -100 )
{
Location-=5;
DropBarMover.DropBarInstance.style.top = Location + 'px';
}
else
{
window.clearInterval(DropBarMover.timerID);
DropBarMover.timerID = null;
}
}
}, 20);
}
}

View File

@ -7,6 +7,7 @@
<?php comicpress_calendar() ?>
</li>
</ul>
<?php comicpress_archive_dropdown(); ?>
<?php comicpress_latest_comics() ?>
<ul>
<li>

View File

@ -0,0 +1,65 @@
<?php
/*
Widget Name:
Widget URI: http://comicpress.org/
Description:
Author: Philip M. Hofer (Frumph)
Version: 1.01
Author URI: http://webcomicplanet.com/
*/
function comicpress_archive_dropdown() { ?>
<ul>
<li class="archive-dropdown-wrap">
<select name="archive-dropdown" class="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'>
<option value=""><?php echo attribute_escape(__('Archives...')); ?></option>
<?php wp_get_archives('type=monthly&format=option&show_post_count=1'); ?> </select>
</li>
</ul>
<?php }
class widget_comicpress_archive_dropdown extends WP_Widget {
function widget_comicpress_archive_dropdown() {
$widget_ops = array('classname' => 'widget_comicpress_archive_dropdown', 'description' => 'Display a thumbnail of the latest comic, clickable to go to the comic post.' );
$this->WP_Widget('archive_dropdown', 'ComicPress Archive Dropdown', $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; };
comicpress_archive_dropdown();
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']);
?>
<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>
<?php
}
}
register_widget('widget_comicpress_archive_dropdown');
function widget_comicpress_archive_dropdown_init() {
new widget_comicpress_archive_dropdown();
}
add_action('widgets_init', 'widget_comicpress_archive_dropdown_init');
?>

View File

@ -1,14 +0,0 @@
<?php
/*
Widget Name:
Widget URI: http://comicpress.org/
Description:
Author: Philip M. Hofer (Frumph)
Version: 1.01
Author URI: http://webcomicplanet.com/
*/
?>

View File

@ -20,7 +20,11 @@ function comicpress_calendar($instance) {
<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 if (!empty($small) || !empty($medium) || !empty($large)) { ?>
<div class="wp-calendar-download">
<?php if (!empty($small)) { ?>[<a href="<?php echo $small; ?>" title="Download">S</a>] <?php } ?><?php if (!empty($medium)) { ?>[<a href="<?php echo $medium; ?>" title="Download">M</a>] <?php } ?><?php if (!empty($large)) { ?>[<a href="<?php echo $large; ?>" title="Download">L</a>] <?php } ?>
</div>
<?php } ?>
<?php } ?>
<?php get_calendar(); ?>
</div>
@ -65,7 +69,7 @@ class widget_comicpress_calendar extends WP_Widget {
?>
<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('thumbnail'); ?>">Thumbnail URL (178px by 130px): <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>