Merge branch 'master' of github.com:johnbintz/comicpress-2.8
This commit is contained in:
commit
7edeb74ffa
6
README
6
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
|
||||
|
|
|
@ -65,15 +65,14 @@ class ComicPressRelatedPosts {
|
|||
$output = array();
|
||||
if (!empty($posts)) {
|
||||
$output[] = '<div class="related_posts">';
|
||||
$output[] = '<span class="related_posts_title">' . $title . '</span>';
|
||||
$output[] = '<ul><li><table class="month-table">';
|
||||
$output[] = '<h4>' . $title . '</h4>';
|
||||
$output[] = '<ul>';
|
||||
foreach ($posts as $post) {
|
||||
if (array_intersect($this->related_categories, wp_get_post_categories($post->ID))) {
|
||||
$output[] = '<tr><td class="archive-date" align="right">' . date('M j, Y', strtotime($post->post_date)) . '</td>';
|
||||
$output[] = '<td class="archive-title"><a title="' . esc_attr(get_the_title($post)) . '" href="' . esc_attr(get_permalink($post)) . '">' . esc_html(get_the_title($post)) . '</a></td></tr>';
|
||||
$output[] = '<li><a title="' . esc_attr(get_the_title($post)) . '" href="' . esc_attr(get_permalink($post)) . '">' . esc_html(get_the_title($post)) . '</a></li>';
|
||||
}
|
||||
}
|
||||
$output[] = '</table></li></ul>';
|
||||
$output[] = '</ul>';
|
||||
$output[] = '</div>';
|
||||
}
|
||||
return implode('', $output);
|
||||
|
|
|
@ -3,19 +3,15 @@ if (!$comicpress_options['disable_lrsidebars_frontpage']) { ?>
|
|||
<div id="sidebar-left">
|
||||
<div class="sidebar-head"></div>
|
||||
<div class="sidebar">
|
||||
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Left Sidebar') ) : ?>
|
||||
<div class="widget">
|
||||
<?php comicpress_calendar_embed() ?>
|
||||
</div>
|
||||
<div class="widget">
|
||||
<?php comicpress_archive_dropdown(); ?>
|
||||
</div>
|
||||
<div class="widget">
|
||||
<ul><li>
|
||||
<?php comicpress_latest_comics() ?>
|
||||
</li></ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Left Sidebar') ) :
|
||||
if (!is_cp_theme_layout('standard,v')) {
|
||||
the_widget('CalendarWidget');
|
||||
the_widget('ArchiveDropdownWidget','mode=monthly_archive');
|
||||
}
|
||||
the_widget('LatestComicsWidget');
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
<div class="sidebar-foot"></div>
|
||||
</div>
|
||||
|
|
|
@ -3,25 +3,18 @@ if (!$comicpress_options['disable_lrsidebars_frontpage']) { ?>
|
|||
<div id="sidebar-right">
|
||||
<div class="sidebar-head"></div>
|
||||
<div class="sidebar">
|
||||
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Right Sidebar') ) : ?>
|
||||
<?php the_widget('BookmarkWidget',array(),array()); ?>
|
||||
<?php if (is_cp_theme_layout('standard,v')) { ?>
|
||||
<div class="widget">
|
||||
<?php comicpress_calendar_embed(); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="widget">
|
||||
<ul><li>
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<?php wp_list_pages('title_li=') ?>
|
||||
</ul>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div class="widget">
|
||||
<ul><?php wp_list_categories('title_li=<h2>Categories</h2>') ?></ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Right Sidebar') ) :
|
||||
the_widget('BookmarkWidget','mode=three-button');
|
||||
if (is_cp_theme_layout('standard,v')) {
|
||||
the_widget('CalendarWidget');
|
||||
the_widget('ArchiveDropdownWidget','mode=monthly_archive');
|
||||
}
|
||||
the_widget('WP_Widget_Pages');
|
||||
the_widget('WP_Widget_Categories','hierarchical=1&count=1');
|
||||
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
<div class="sidebar-foot"></div>
|
||||
</div>
|
||||
|
|
23
style.css
23
style.css
|
@ -127,7 +127,6 @@ h2, h2 a {
|
|||
margin-top: 10px;
|
||||
font-size: 28px;
|
||||
letter-spacing: -2px;
|
||||
font-weight: 500;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
|
@ -139,6 +138,13 @@ h3, h3 a {
|
|||
letter-spacing: -1px;
|
||||
}
|
||||
|
||||
h4, h4 a {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
/* THE PAGE WRAPPER */
|
||||
|
||||
#page {
|
||||
|
@ -563,21 +569,6 @@ h3, h3 a {
|
|||
font-size: 11px;
|
||||
}
|
||||
|
||||
.related_posts {
|
||||
margin-top: 10px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.related_posts_title {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.related_posts ul {
|
||||
list-style: none;
|
||||
font-weight: normal;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.post .members-only, .post-comic .members-only {
|
||||
border: 1px dotted #000;
|
||||
background: #fafafa;
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
/*
|
||||
Widget Name: Latest Comics Widget
|
||||
Widget URI: http://comicpress.org/
|
||||
Description: Display a list of links of the latest comics.
|
||||
Author: Philip M. Hofer (Frumph)
|
||||
Version: 1.02
|
||||
|
||||
*/
|
||||
|
||||
class LatestComicsWidget extends WP_Widget {
|
||||
|
||||
function LatestComicsWidget($skip_widget_init = false) {
|
||||
if (!$skip_widget_init) {
|
||||
$widget_ops = array('classname' => __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()); ?>
|
||||
<ul>
|
||||
<?php foreach($latestcomics as $post) : ?>
|
||||
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?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']);
|
||||
?>
|
||||
<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 attribute_escape($title); ?>" /></label></p>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,121 @@
|
|||
<?php
|
||||
/*
|
||||
Widget Name: Menubar Widget
|
||||
Widget URI: http://comicpress.org/
|
||||
Description: Display a calendar of this months posts.
|
||||
Author: Philip M. Hofer (Frumph)
|
||||
Version: 1.05
|
||||
Author URI: http://frumph.net/
|
||||
|
||||
*/
|
||||
|
||||
class MenubarWidget extends WP_Widget {
|
||||
|
||||
function MenubarWidget($skip_widget_init = false) {
|
||||
if (!$skip_widget_init) {
|
||||
$widget_ops = array('classname' => __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 { ?>
|
||||
<div id="menubar">
|
||||
|
||||
<div id="menunav">
|
||||
<?php if ($comicpress_options['enable_search_in_menubar']) { ?>
|
||||
<div class="menunav-search"><?php include(get_template_directory() . '/searchform.php'); ?></div>
|
||||
<?php } ?>
|
||||
<?php if ($comicpress_options['enable_rss_in_menubar']) { ?>
|
||||
<a href="<?php bloginfo('rss2_url') ?>" title="RSS Feed" class="menunav-rss">RSS</a>
|
||||
<?php } ?>
|
||||
<?php if ($comicpress_options['enable_navigation_in_menubar']) { ?>
|
||||
<?php if (is_home()) {
|
||||
$comicFrontpage = new WP_Query(); $comicFrontpage->query('showposts=1&cat='.get_all_comic_categories_as_cat_string());
|
||||
while ($comicFrontpage->have_posts()) : $comicFrontpage->the_post();
|
||||
global $wp_query; $wp_query->is_single = true; ?>
|
||||
<div class="menunav-prev">
|
||||
<?php previous_comic_link('%link', '‹'); ?>
|
||||
</div>
|
||||
<?php $wp_query->is_single = false;
|
||||
endwhile;
|
||||
} elseif (is_single() & in_comic_category()) { ?>
|
||||
<div class="menunav-prev">
|
||||
<?php previous_comic_link('%link', '‹'); ?>
|
||||
</div>
|
||||
<div class="menunav-next">
|
||||
<?php next_comic_link('%link', '›'); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php
|
||||
$linkcatid = get_term_by('name','menubar','link_category');
|
||||
$linkcatid = $linkcatid->term_id;
|
||||
$menulinks = wp_list_bookmarks('echo=0&title_li=&categorize=0&title_before=&title_after=&category_name=menubar');
|
||||
$menulinks = preg_replace('#<li ([^>]*)>#', '<li class="page-item link">', $menulinks);
|
||||
$menulinks = preg_replace('#<ul ([^>]*)>#', '', $menulinks);
|
||||
$menulinks = str_replace('</ul>', '', $menulinks);
|
||||
if ($comicpress_options['enable_blogroll_off_links']) {
|
||||
$bookmarks = wp_list_bookmarks('echo=0&title_li=&categorize=1&title_before=&title_after=&exclude_category='.$linkcatid);
|
||||
$bookmarks = preg_replace('#<li ([^>]*)>#', '<li class="page-item link">', $bookmarks);
|
||||
$bookmarks = preg_replace('#<ul ([^>]*)>#', '<ul>', $bookmarks);
|
||||
}
|
||||
$listpages = '';
|
||||
if (!$comicpress_options['disable_dynamic_menubar_links']) {
|
||||
$listpages = wp_list_pages('echo=0&sort_column=menu_order&depth=4&title_li=');
|
||||
}
|
||||
if (!empty($bookmarks) && $comicpress_options['enable_blogroll_off_links']) {
|
||||
$listpages = str_replace('Links</a></li>', 'Links</a>
|
||||
<ul>
|
||||
'.$bookmarks.'
|
||||
</ul>
|
||||
</li>
|
||||
', $listpages);
|
||||
}
|
||||
$listpages .= $menulinks;
|
||||
?>
|
||||
<ul id="menu">
|
||||
<li class="page_item page-item-home<?php if (is_home()) { ?> current_page_item<?php } ?>"><a href="<?php bloginfo('url'); ?>">Home</a></li>
|
||||
<?php echo $listpages; ?>
|
||||
<?php if ($comicpress_options['contact_in_menubar']) { ?>
|
||||
<li class="page_item page-item-contact"><a href="mailto:<?php bloginfo('admin_email'); ?>">Contact</a></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<?php }
|
||||
}
|
||||
}
|
||||
|
||||
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; };
|
||||
$this->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']);
|
||||
?>
|
||||
<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 attribute_escape($title); ?>" /></label></p>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,70 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
Widget Name: Latest Comics
|
||||
Widget URI: http://comicpress.org/
|
||||
Description: Display a list of links of the latest comics.
|
||||
Author: Philip M. Hofer (Frumph)
|
||||
Version: 1.01
|
||||
Author URI: http://frumph.net/
|
||||
|
||||
*/
|
||||
|
||||
function comicpress_latest_comics() { ?>
|
||||
<h2>Latest Comics</h2>
|
||||
<ul>
|
||||
<?php global $post;
|
||||
$latestcomics = get_posts('numberposts=5&category='.get_all_comic_categories_as_cat_string());
|
||||
foreach($latestcomics as $post) : ?>
|
||||
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php
|
||||
}
|
||||
|
||||
class widget_comicpress_latest_comics extends WP_Widget {
|
||||
|
||||
function widget_comicpress_latest_comics() {
|
||||
$widget_ops = array('classname' => '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()); ?>
|
||||
<ul>
|
||||
<?php foreach($latestcomics as $post) : ?>
|
||||
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?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']);
|
||||
?>
|
||||
<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 attribute_escape($title); ?>" /></label></p>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
register_widget('widget_comicpress_latest_comics');
|
||||
|
||||
|
||||
function widget_comicpress_latest_comics_init() {
|
||||
new widget_comicpress_latest_comics();
|
||||
}
|
||||
|
||||
add_action('widgets_init', 'widget_comicpress_latest_comics_init');
|
||||
|
||||
?>
|
Loading…
Reference in New Issue