resolve merge conflict

This commit is contained in:
John Bintz 2009-12-31 08:44:14 -05:00
commit b93e252368
28 changed files with 493 additions and 420 deletions

View File

@ -36,7 +36,7 @@
<?php /* Paged Archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?> <?php /* Paged Archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h2 class="pagetitle"><?php _e('Archives','comicpress'); ?></h2> <h2 class="pagetitle"><?php _e('Archives','comicpress'); ?></h2>
<?php } ?> <?php } ?>
<div class="searchresults"><?php printf(__ngettext("%d item.", "%d items.", $count,'comicpress'),$count); ?></div> <div class="searchresults"><?php printf(_n("%d item.", "%d items.", $count,'comicpress'),$count); ?></div>
<br class="clear-margins" /> <br class="clear-margins" />
</div> </div>
<div class="post-foot"></div> <div class="post-foot"></div>

View File

@ -44,7 +44,7 @@ class ComicPressRelatedPosts {
function _handle_shortcode_attrs($attrs) { function _handle_shortcode_attrs($attrs) {
return shortcode_atts(array( return shortcode_atts(array(
'limit' => '5', 'limit' => '5',
), $atts); ), $attrs);
} }
function _new_comicpressstoryline() { return new ComicPressStoryline(); } function _new_comicpressstoryline() { return new ComicPressStoryline(); }

View File

@ -22,7 +22,7 @@ $archive_comic_width = "380";
$rss_comic_width = "600"; $rss_comic_width = "600";
//BLOG POSTCOUNT - the number of blog entries to appear on the home page (default "5"). //BLOG POSTCOUNT - the number of blog entries to appear on the home page (default "5").
$blog_postcount = "3"; $blog_postcount = "5";
//Mini Comic Width - The width your comics will appear in minithumbs (default "100") //Mini Comic Width - The width your comics will appear in minithumbs (default "100")
$mini_comic_width = "80"; $mini_comic_width = "80";

View File

@ -5,7 +5,13 @@ function options() {
add_action('admin_head-'.$pagehook, 'comicpress_admin_page_head'); add_action('admin_head-'.$pagehook, 'comicpress_admin_page_head');
} }
function comicpress_admin_page_head() { ?> function comicpress_admin_page_head() {
wp_admin_css( 'css/global' );
wp_admin_css();
wp_admin_css( 'css/colors' );
wp_admin_css( 'css/ie' );
wp_enqueue_script('utils');
?>
<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/options/options.css" type="text/css" media="screen" /> <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/options/options.css" type="text/css" media="screen" />
<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/tabbed_pages.js"></script> <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/tabbed_pages.js"></script>
<!--[if lt ie 8]> <style> div.show { position: static; margin-top: 1px; } #cpadmin div.off { height: 22px; } </style> <![endif]--> <!--[if lt ie 8]> <style> div.show { position: static; margin-top: 1px; } #cpadmin div.off { height: 22px; } </style> <![endif]-->
@ -14,7 +20,8 @@ function comicpress_admin_page_head() { ?>
function comicpress_admin() { function comicpress_admin() {
global $upload_path, $blogcat; global $upload_path, $blogcat;
$comicpress_options = get_option('comicpress_options'); ?> $comicpress_options = get_option('comicpress_options');
?>
<div class="wrap"> <div class="wrap">
@ -26,106 +33,147 @@ function comicpress_admin() {
if ( wp_verify_nonce($_POST['_wpnonce'], 'update-options') ) { if ( wp_verify_nonce($_POST['_wpnonce'], 'update-options') ) {
if ($_REQUEST['action'] == 'comicpress_save_layout') { if ($_REQUEST['action'] == 'comicpress_save_layout') {
$comicpress_options['cp_theme_layout'] = $_REQUEST['cp_theme_layout']; $comicpress_options['cp_theme_layout'] = wp_filter_nohtml_kses($_REQUEST['cp_theme_layout']);
$tab = 'themestyle'; $tab = 'themestyle';
update_option('comicpress_options',$comicpress_options); update_option('comicpress_options',$comicpress_options);
} }
if ($_REQUEST['action'] == 'comicpress_save_general') { if ($_REQUEST['action'] == 'comicpress_save_general') {
$comicpress_options['disable_page_restraints'] = (bool)( $_REQUEST['disable_page_restraints'] == 1 ? true : false );
$comicpress_options['rascal_says'] = (bool)($_REQUEST['rascal_says'] == 1 ? true : false ); foreach (array(
$comicpress_options['disable_comment_note'] = (bool)($_REQUEST['disable_comment_note'] == 1 ? true : false ); 'disable_page_restraints',
$comicpress_options['enable_numbered_pagination'] = (bool)($_REQUEST['enable_numbered_pagination'] == 1 ? true : false ); 'rascal_says',
$comicpress_options['comic_clicks_next'] = (bool)($_REQUEST['comic_clicks_next'] == 1 ? true : false ); 'disable_comment_note',
$comicpress_options['disable_default_comic_nav'] = (bool)($_REQUEST['disable_default_comic_nav'] == 1 ? true : false ); 'enable_numbered_pagination',
$comicpress_options['graphicnav_directory'] = wp_filter_nohtml_kses($_REQUEST['graphicnav_directory']); 'enable_comment_count_in_rss',
$comicpress_options['enable_widgetarea_use_sidebar_css'] = (bool)($_REQUEST['enable_widgetarea_use_sidebar_css'] == 1 ? true : false ); 'comic_clicks_next',
$comicpress_options['disable_lrsidebars_frontpage'] = (bool)($_REQUEST['disable_lrsidebars_frontpage'] == 1 ? true : false ); 'disable_default_comic_nav',
$comicpress_options['disable_footer_text'] = (bool)($_REQUEST['disable_footer_text'] == 1 ? true : false ); 'enable_widgetarea_use_sidebar_css',
$comicpress_options['disable_blogheader'] = (bool)($_REQUEST['disable_blogheader'] == 1 ? true : false ); 'disable_lrsidebars_frontpage',
$comicpress_options['disable_rss_comments_count'] = (bool)($_REQUEST['disable_rss_comments_count'] == 1 ? true : false ); 'disable_footer_text',
$comicpress_options['enable_comicpress_debug'] = (bool)($_REQUEST['enable_comicpress_debug'] == 1 ? true : false ); 'disable_blogheader',
$comicpress_options['enable_full_post_check'] = (bool)($_REQUEST['enable_full_post_check'] == 1 ? true : false ); 'enable_comicpress_debug',
'enable_full_post_check',
'enable_scroll_to_top'
) as $key) {
$comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
}
foreach (array(
'graphicnav_directory'
) as $key) {
$comicpress_options[$key] = wp_filter_nohtml_kses($_REQUEST[$key]);
}
$tab = 'general'; $tab = 'general';
update_option('comicpress_options',$comicpress_options); update_option('comicpress_options',$comicpress_options);
} }
if ($_REQUEST['action'] == 'comicpress_save_index') { if ($_REQUEST['action'] == 'comicpress_save_index') {
$comicpress_options['disable_comic_frontpage'] = (bool)($_REQUEST['disable_comic_frontpage'] == 1 ? true : false ); foreach (array(
$comicpress_options['disable_comic_blog_frontpage'] = (bool)($_REQUEST['disable_comic_blog_frontpage'] == 1 ? true : false ); 'disable_comic_frontpage',
$comicpress_options['disable_comic_blog_single'] = (bool)($_REQUEST['disable_comic_blog_single'] == 1 ? true : false ); 'disable_comic_blog_frontpage',
$comicpress_options['disable_blog_frontpage'] = (bool)($_REQUEST['disable_blog_frontpage'] == 1 ? true : false ); 'disable_comic_blog_single',
'disable_blog_frontpage'
) as $key) {
$comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
}
$tab = 'index'; $tab = 'index';
update_option('comicpress_options',$comicpress_options); update_option('comicpress_options',$comicpress_options);
} }
if ($_REQUEST['action'] == 'comicpress_save_post') { if ($_REQUEST['action'] == 'comicpress_save_post') {
$comicpress_options['transcript_in_posts'] = (bool)($_REQUEST['transcript_in_posts'] == 1 ? true : false ); foreach (array(
$comicpress_options['enable_related_comics'] = (bool)($_REQUEST['enable_related_comics'] == 1 ? true : false ); 'transcript_in_posts',
$comicpress_options['enable_related_posts'] = (bool)($_REQUEST['enable_related_posts'] == 1 ? true : false ); 'enable_related_comics',
$comicpress_options['remove_wptexturize'] = (bool)($_REQUEST['remove_wptexturize'] == 1 ? true : false ); 'enable_related_posts',
'remove_wptexturize',
$comicpress_options['split_column_in_two'] = (bool)($_REQUEST['split_column_in_two'] == 1 ? true : false ); 'enable_comic_post_author_gravatar',
$comicpress_options['author_column_one'] = wp_filter_nohtml_kses($_REQUEST['author_column_one']); 'enable_post_author_gravatar',
$comicpress_options['author_column_two'] = wp_filter_nohtml_kses($_REQUEST['author_column_two']); 'split_column_in_two',
'enable_comic_post_calendar',
$comicpress_options['enable_comic_post_author_gravatar'] = (bool)($_REQUEST['enable_comic_post_author_gravatar'] == 1 ? true : false ); 'enable_post_calendar',
$comicpress_options['enable_post_author_gravatar'] = (bool)($_REQUEST['enable_post_author_gravatar'] == 1 ? true : false ); 'disable_tags_in_posts',
$comicpress_options['avatar_directory'] = wp_filter_nohtml_kses($_REQUEST['avatar_directory']); 'disable_categories_in_posts',
$comicpress_options['moods_directory'] = wp_filter_nohtml_kses($_REQUEST['moods_directory']); 'blogposts_with_comic',
'static_blog',
$comicpress_options['calendar_directory'] = wp_filter_nohtml_kses($_REQUEST['calendar_directory']); 'disable_page_titles'
$comicpress_options['enable_comic_post_calendar'] = (bool)($_REQUEST['enable_comic_post_calendar'] == 1 ? true : false ); ) as $key) {
$comicpress_options['enable_post_calendar'] = (bool)($_REQUEST['enable_post_calendar'] == 1 ? true : false ); $comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
}
$comicpress_options['disable_tags_in_posts'] = (bool)($_REQUEST['disable_tags_in_posts'] == 1 ? true : false ); foreach (array(
$comicpress_options['disable_categories_in_posts'] = (bool)($_REQUEST['disable_categories_in_posts'] == 1 ? true : false ); 'author_column_one',
'author_column_two',
$comicpress_options['blogposts_with_comic'] = (bool)($_REQUEST['blogposts_with_comic'] == 1 ? true : false ); 'avatar_directory',
$comicpress_options['static_blog'] = (bool)($_REQUEST['static_blog'] == 1 ? true : false ); 'moods_directory',
$comicpress_options['disable_page_titles'] = (bool)($_REQUEST['disable_page_titles'] == 1 ? true : false ); 'calendar_directory'
) as $key) {
$comicpress_options[$key] = wp_filter_nohtml_kses($_REQUEST[$key]);
}
$tab = 'post'; $tab = 'post';
update_option('comicpress_options',$comicpress_options); update_option('comicpress_options',$comicpress_options);
} }
if ($_REQUEST['action'] == 'comicpress_save_archivesearch') { if ($_REQUEST['action'] == 'comicpress_save_archivesearch') {
$comicpress_options['archive_display_order'] = $_REQUEST['archive_display_order']; foreach (array(
$comicpress_options['excerpt_or_content_archive'] = $_REQUEST['excerpt_or_content_archive']; 'archive_display_order',
$comicpress_options['excerpt_or_content_search'] = $_REQUEST['excerpt_or_content_search']; 'excerpt_or_content_archive',
$comicpress_options['category_thumbnail_postcount'] = $_REQUEST['category_thumbnail_postcount']; 'excerpt_or_content_search',
'category_thumbnail_postcount'
) as $key) {
$comicpress_options[$key] = wp_filter_nohtml_kses($_REQUEST[$key]);
}
$tab = 'archivesearch'; $tab = 'archivesearch';
update_option('comicpress_options',$comicpress_options); update_option('comicpress_options',$comicpress_options);
} }
if ($_REQUEST['action'] == 'comicpress_save_menubar') { if ($_REQUEST['action'] == 'comicpress_save_menubar') {
$comicpress_options['enable_search_in_menubar'] = (bool)($_REQUEST['enable_search_in_menubar'] == 1 ? true : false ); foreach (array(
$comicpress_options['enable_rss_in_menubar'] = (bool)($_REQUEST['enable_rss_in_menubar'] == 1 ? true : false ); 'enable_search_in_menubar',
$comicpress_options['enable_navigation_in_menubar'] = (bool)($_REQUEST['enable_navigation_in_menubar'] == 1 ? true : false ); 'enable_rss_in_menubar',
$comicpress_options['contact_in_menubar'] = (bool)($_REQUEST['contact_in_menubar'] == 1 ? true : false ); 'enable_navigation_in_menubar',
$comicpress_options['disable_dynamic_menubar_links'] = (bool)($_REQUEST['disable_dynamic_menubar_links'] == 1 ? true : false ); 'contact_in_menubar',
$comicpress_options['disable_default_menubar'] = (bool)($_REQUEST['disable_default_menubar'] == 1 ? true : false ); 'disable_dynamic_menubar_links',
$comicpress_options['enable_blogroll_off_links'] = (bool)($_REQUEST['enable_blogroll_off_links'] == 1 ? true : false ); 'disable_default_menubar',
'enable_blogroll_off_links'
) as $key) {
$comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
}
$tab = 'menubar'; $tab = 'menubar';
update_option('comicpress_options',$comicpress_options); update_option('comicpress_options',$comicpress_options);
} }
if ($_REQUEST['action'] == 'comicpress_save_customheader') { if ($_REQUEST['action'] == 'comicpress_save_customheader') {
$comicpress_options['enable_custom_image_header'] = (bool)($_REQUEST['enable_custom_image_header'] == 1 ? true : false ); foreach (array(
$comicpress_options['custom_image_header_width'] = wp_filter_nohtml_kses($_REQUEST['custom_image_header_width']); 'enable_custom_image_header'
$comicpress_options['custom_image_header_height'] = wp_filter_nohtml_kses($_REQUEST['custom_image_header_height']); ) as $key) {
$comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
}
foreach (array(
'custom_image_header_width',
'custom_image_header_height'
) as $key) {
$comicpress_options[$key] = wp_filter_nohtml_kses($_REQUEST[$key]);
}
$tab = 'customheader'; $tab = 'customheader';
update_option('comicpress_options',$comicpress_options); update_option('comicpress_options',$comicpress_options);
} }
if ($_REQUEST['action'] == 'comicpress_save_buyprint') { if ($_REQUEST['action'] == 'comicpress_save_buyprint') {
$comicpress_options['buy_print_email'] = wp_filter_nohtml_kses($_REQUEST['buy_print_email']); foreach (array(
$comicpress_options['buy_print_url'] = wp_filter_nohtml_kses($_REQUEST['buy_print_url']); 'buy_print_add_shipping'
$comicpress_options['buy_print_us_amount'] = wp_filter_nohtml_kses($_REQUEST['buy_print_us_amount']); ) as $key) {
$comicpress_options['buy_print_int_amount'] = wp_filter_nohtml_kses($_REQUEST['buy_print_int_amount']); $comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
$comicpress_options['buy_print_add_shipping'] = (bool)($_REQUEST['buy_print_add_shipping'] == 1 ? true : false ); }
$comicpress_options['buy_print_us_ship'] = wp_filter_nohtml_kses($_REQUEST['buy_print_us_ship']); foreach (array(
$comicpress_options['buy_print_int_ship'] = wp_filter_nohtml_kses($_REQUEST['buy_print_int_ship']); 'buy_print_email',
'buy_print_url',
'buy_print_us_amount',
'buy_print_int_amount',
'buy_print_us_ship',
'buy_print_int_ship'
) as $key) {
$comicpress_options[$key] = wp_filter_nohtml_kses($_REQUEST[$key]);
}
$tab = 'buyprint'; $tab = 'buyprint';
update_option('comicpress_options',$comicpress_options); update_option('comicpress_options',$comicpress_options);
} }
@ -141,7 +189,7 @@ function comicpress_admin() {
<script>function hidemessage() { document.getElementById('message').style.display = 'none'; }</script> <script>function hidemessage() { document.getElementById('message').style.display = 'none'; }</script>
<?php } <?php }
} }
if ($_REQUEST['action'] == 'comicpress_reset') { if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'comicpress_reset') {
delete_option('comicpress_options'); delete_option('comicpress_options');
$comicpress_options = comicpress_load_options(); $comicpress_options = comicpress_load_options();
?> ?>
@ -165,15 +213,12 @@ function comicpress_admin() {
<div class="<?php if ($tab == 'buyprint') { ?>on<?php } else { ?>off<?php } ?>" title="buyprintoptions"><span><?php _e('Buy Print','comicpress'); ?></span></div> <div class="<?php if ($tab == 'buyprint') { ?>on<?php } else { ?>off<?php } ?>" title="buyprintoptions"><span><?php _e('Buy Print','comicpress'); ?></span></div>
<div class="<?php if ($tab == 'members') { ?>on<?php } else { ?>off<?php } ?>" title="membersoptions"><span><?php _e('Members','comicpress'); ?></span></div> <div class="<?php if ($tab == 'members') { ?>on<?php } else { ?>off<?php } ?>" title="membersoptions"><span><?php _e('Members','comicpress'); ?></span></div>
</div> </div>
<?php include(get_template_directory() . '/options/themestyle.php'); ?>
<?php include(get_template_directory() . '/options/generaloptions.php'); ?> <?php
<?php include(get_template_directory() . '/options/indexoptions.php'); ?> foreach (glob(get_template_directory() . '/options/*.php') as $file) {
<?php include(get_template_directory() . '/options/postoptions.php'); ?> include($file);
<?php include(get_template_directory() . '/options/archivesearchoptions.php'); ?> }
<?php include(get_template_directory() . '/options/menubaroptions.php'); ?> ?>
<?php include(get_template_directory() . '/options/customheaderoptions.php'); ?>
<?php include(get_template_directory() . '/options/buyprintoptions.php'); ?>
<?php include(get_template_directory() . '/options/membersoptions.php'); ?>
</div> </div>
</div> </div>

View File

@ -27,13 +27,15 @@
<span class="footer-pipe">|</span> <span class="footer-pipe">|</span>
Subscribe: <a href="<?php bloginfo('rss2_url') ?>">RSS</a> Subscribe: <a href="<?php bloginfo('rss2_url') ?>">RSS</a>
</span> </span>
<?php if ($comicpress_options['enable_scroll_to_top']) { ?>
<span class="footer-uptotop"> <span class="footer-uptotop">
<span class="footer-pipe">|</span> <span class="footer-pipe">|</span>
<a href="#outside" onclick="scrollup(); return false;"><?php _e('Back to Top &uarr;','comicpress'); ?></a> <a href="#outside" onclick="scrollup(); return false;"><?php _e('Back to Top &uarr;','comicpress'); ?></a>
</span> </span>
<br /><?php echo get_num_queries() ?> queries. <?php timer_stop(1) ?> seconds. <?php } ?>
</p> </p>
<?php } ?> <?php } ?>
<p><?php echo get_num_queries() ?> queries. <?php timer_stop(1) ?> seconds.</p>
</div> </div>
<?php if (!$comicpress_options['disable_page_restraints']) { ?> <?php if (!$comicpress_options['disable_page_restraints']) { ?>

View File

@ -44,6 +44,9 @@ function __comicpress_widgets_init() {
function __comicpress_init() { function __comicpress_init() {
global $comicpress_options, $__comicpress_handlable_classes; global $comicpress_options, $__comicpress_handlable_classes;
$comicpress_options = array();
// Check if the $comicpress_options exist, if not set defaults // Check if the $comicpress_options exist, if not set defaults
$comicpress_options = comicpress_load_options(); $comicpress_options = comicpress_load_options();
// xili-language plugin check // xili-language plugin check
@ -55,7 +58,9 @@ function __comicpress_init() {
} }
// Queue up the scripts. // Queue up the scripts.
wp_enqueue_script('comicpress_scroll', get_template_directory_uri() . '/js/scroll.js'); if (!is_admin() && $comicpress_options['enable_scroll_to_top']) {
wp_enqueue_script('comicpress_scroll', get_template_directory_uri() . '/js/scroll.js');
}
// remove intense debates control over the comment numbers // remove intense debates control over the comment numbers
if (function_exists('id_get_comment_number')) { if (function_exists('id_get_comment_number')) {
@ -120,10 +125,14 @@ if (!empty($wpmu_version)) {
function comicpress_load_options() { function comicpress_load_options() {
global $comicpress_options; global $comicpress_options;
$comicpress_options = get_option('comicpress_options'); $comicpress_options = get_option('comicpress_options');
if (empty($comicpress_options)) { if (empty($comicpress_options)) {
$comicpress_options['comicpress_version'] = '2.9.0.7'; $comicpress_options['comicpress_version'] = '2.9.0.9';
foreach (array( foreach (array(
'cp_theme_layout' => 'standard',
'disable_comic_frontpage' => false, 'disable_comic_frontpage' => false,
'disable_comic_blog_frontpage' => false, 'disable_comic_blog_frontpage' => false,
'disable_comic_blog_single' => false, 'disable_comic_blog_single' => false,
@ -196,7 +205,10 @@ function comicpress_load_options() {
'enable_comicpress_debug' => true, 'enable_comicpress_debug' => true,
'enable_full_post_check' => false, 'enable_full_post_check' => false,
'enable_blogroll_off_links' => false 'enable_blogroll_off_links' => false,
'enable_comment_count_in_rss' => false,
'enable_scroll_to_top' => false
) as $field => $value) { ) as $field => $value) {
$comicpress_options[$field] = $value; $comicpress_options[$field] = $value;
@ -205,17 +217,28 @@ function comicpress_load_options() {
add_option('comicpress_options', $comicpress_options, '', 'yes'); add_option('comicpress_options', $comicpress_options, '', 'yes');
// update_option('comicpress_options', $comicpress_options); // update_option('comicpress_options', $comicpress_options);
} }
$comicpress_options['comicpress_version'] = '2.9.0.7'; $comicpress_options['comicpress_version'] = '2.9.0.9';
update_option('comicpress_options', $comicpress_options); update_option('comicpress_options', $comicpress_options);
return $comicpress_options; return $comicpress_options;
} }
function is_cp_theme_layout($choices) { function is_cp_theme_layout($choices) {
global $comicpress_options; $comicpress_options = comicpress_load_options();
$choices = explode(",", $choices); $choices = explode(",", $choices);
foreach ($choices as $choice) { foreach ($choices as $choice) {
if ($comicpress_options['cp_theme_layout'] == $choice) {
return true;
}
}
return false;
}
if ($choice == $comicpress_options['cp_theme_layout']) { function is_cp_layout_avail($layout, $avail_layouts) {
if (empty($layout)) return false;
if (empty($avail_layouts)) $avail_layouts = 'standard,v,3c,3c2r,v3c,v3cr,gn,rgn';
$avail_layouts = explode(",",$avail_layouts);
foreach ($avail_layouts as $able_layout) {
if ($layout == $able_layout) {
return true; return true;
} }
} }

View File

@ -91,6 +91,8 @@ function comicpress_post_class($classes = '') {
global $post; global $post;
static $post_alt; static $post_alt;
$is_comic = in_comic_category();
$args = array( $args = array(
'entry_tax' => array( 'category', 'post_tag' ) 'entry_tax' => array( 'category', 'post_tag' )
); );
@ -99,9 +101,9 @@ function comicpress_post_class($classes = '') {
$classes[] = 'uentry'; $classes[] = 'uentry';
/* if a comic category */ /* if a comic category */
if (in_comic_category()) $classes[] = 'post-comic'; if ($is_comic) $classes[] = 'post-comic';
if (is_page()) $classes[] = 'post-page'; if (is_page()) $classes[] = 'post-page';
if (!in_comic_category() && !is_page()) $classes[] = 'post-blog'; if (!$is_comic && !is_page()) $classes[] = 'post-blog';
/* Post alt class. */ /* Post alt class. */

View File

@ -36,33 +36,33 @@ if ($comicpress_options['enable_custom_image_header']) {
function theme_header_style() { function theme_header_style() {
?> ?>
<style type="text/css">
#header
{
width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
background: url(<?php header_image(); ?>) no-repeat center;
}
<?php <style type="text/css">
#header {
width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
background: url(<?php header_image(); ?>) center center no-repeat;
}
<?php
// Has the text been hidden? // Has the text been hidden?
// If so, set display to equal none // If so, set display to equal none
if ( 'blank' == get_header_textcolor() ) { ?> if ( 'blank' == get_header_textcolor() ) { ?>
#header h1, #header .description { #header h1, #header .description {
display: none; display: none;
} }
<?php } else {
// Otherwise, set the color to be the user selected one <?php } else {
?> // Otherwise, set the color to be the user selected one
#header * ?>
{
color: #<?php header_textcolor();?>; #header * {
} color: #<?php header_textcolor();?>;
} }
<?php } ?> <?php } ?>
</style> </style>
<?php
} <?php }
if ( function_exists('add_custom_image_header') ) { if ( function_exists('add_custom_image_header') ) {
add_custom_image_header('theme_header_style', 'theme_admin_header_style'); add_custom_image_header('theme_header_style', 'theme_admin_header_style');

View File

@ -1,22 +1,22 @@
<?php <?php
function comicpress_display_post_title() { function comicpress_display_post_title($is_comic = false) {
global $post, $wp_query; global $post, $wp_query;
if (is_page()) { if (is_page()) {
$post_title = "<h2 class=\"page-title\">"; $post_title = "<h2 class=\"page-title\">";
} else { } else {
$post_title = "<h2 class=\"post-title\">"; $post_title = "<h2 class=\"post-title\">";
} }
if (is_home() || is_search() || is_archive() || in_comic_category() && !is_page()) $post_title .= "<a href=\"".get_permalink()."\">"; if (is_home() || is_search() || is_archive() || $is_comic && !is_page()) $post_title .= "<a href=\"".get_permalink()."\">";
$post_title .= get_the_title(); $post_title .= get_the_title();
if (is_home() || is_search() || is_archive() || in_comic_category() && !is_page()) $post_title .= "</a>"; if (is_home() || is_search() || is_archive() || $is_comic && !is_page()) $post_title .= "</a>";
$post_title .= "</h2>\r\n"; $post_title .= "</h2>\r\n";
echo apply_filters('comicpress_display_post_title',$post_title); echo apply_filters('comicpress_display_post_title',$post_title);
} }
function comicpress_display_post_thumbnail() { function comicpress_display_post_thumbnail($is_comic = false) {
global $post; global $post;
if (function_exists('has_post_thumbnail')) { if (function_exists('has_post_thumbnail') && !$is_comic) {
if ( has_post_thumbnail() ) { if ( has_post_thumbnail() ) {
$post_thumbnail = "<div class=\"post-image\"><a href=\"".get_permalink()."\" rel=\"bookmark\" title=\"Permanent Link to ".get_the_title()."\">".get_the_post_thumbnail($post->ID,'full')."</a></div>\r\n"; $post_thumbnail = "<div class=\"post-image\"><a href=\"".get_permalink()."\" rel=\"bookmark\" title=\"Permanent Link to ".get_the_title()."\">".get_the_post_thumbnail($post->ID,'full')."</a></div>\r\n";
echo apply_filters('comicpress_display_post_thumbnail',$post_thumbnail); echo apply_filters('comicpress_display_post_thumbnail',$post_thumbnail);
@ -24,18 +24,18 @@ function comicpress_display_post_thumbnail() {
} }
} }
function comicpress_display_author_gravatar() { function comicpress_display_author_gravatar($is_comic = false) {
global $post, $wp_query, $comicpress_options; global $post, $wp_query, $comicpress_options;
if (((!in_comic_category() && $comicpress_options['enable_post_author_gravatar']) || (in_comic_category() && $comicpress_options['enable_comic_post_author_gravatar'])) && !is_page()) { if (((!$is_comic && $comicpress_options['enable_post_author_gravatar']) || ($is_comic && $comicpress_options['enable_comic_post_author_gravatar'])) && !is_page()) {
$author_get_gravatar = str_replace("alt='", "alt='".get_the_author_meta('display_name')."' title='".get_the_author_meta('display_name'),comicpress_get_avatar(get_the_author_meta('email'), 64)); $author_get_gravatar = str_replace("alt='", "alt='".get_the_author_meta('display_name')."' title='".get_the_author_meta('display_name'),comicpress_get_avatar(get_the_author_meta('email'), 64));
$author_gravatar = "<div class=\"post-author-gravatar\">".$author_get_gravatar."</div>\r\n"; $author_gravatar = "<div class=\"post-author-gravatar\">".$author_get_gravatar."</div>\r\n";
echo apply_filters('comicpress_display_author_gravatar', $author_gravatar); echo apply_filters('comicpress_display_author_gravatar', $author_gravatar);
} }
} }
function comicpress_display_post_calendar() { function comicpress_display_post_calendar($is_comic = false) {
global $post, $wp_query, $comicpress_options; global $post, $wp_query, $comicpress_options;
if ((!in_comic_category() && $comicpress_options['enable_post_calendar']) || (in_comic_category() && $comicpress_options['enable_comic_post_calendar']) && !is_page()) { if ((!$is_comic && $comicpress_options['enable_post_calendar']) || ($is_comic && $comicpress_options['enable_comic_post_calendar']) && !is_page()) {
$post_calendar = "<div class=\"post-calendar-date\"><div class=\"calendar-date\"><span>".get_the_time('M')."</span>".get_the_time('d')."</div></div>\r\n"; $post_calendar = "<div class=\"post-calendar-date\"><div class=\"calendar-date\"><span>".get_the_time('M')."</span>".get_the_time('d')."</div></div>\r\n";
echo apply_filters('comicpress_display_post_calendar',$post_calendar); echo apply_filters('comicpress_display_post_calendar',$post_calendar);
} }
@ -43,14 +43,14 @@ function comicpress_display_post_calendar() {
function comicpress_display_post_author() { function comicpress_display_post_author() {
global $post; global $post;
$post_author = "<div class=\"post-author\"><span class=\"post-date\">".get_the_time('F jS, Y')."</span> <span class=\"pipe\">|</span> ".__(' by ','comicpress'). get_the_author_meta('display_name')."</div>\r\n"; $post_author = "<span class=\"post-date\">".get_the_time('F jS, Y')."</span> <span class=\"pipe\">|</span> <span class=\"post-author\"> ".__(' by ','comicpress'). get_the_author_meta('display_name')."</span>\r\n";
echo apply_filters('comicpress_display_post_author',$post_author); echo apply_filters('comicpress_display_post_author',$post_author);
} }
function comicpress_display_post_category() { function comicpress_display_post_category($is_comic = false) {
global $post, $wp_query, $comicpress_options; global $post, $wp_query, $comicpress_options;
if (!$comicpress_options['disable_categories_in_posts']) { if (!$comicpress_options['disable_categories_in_posts']) {
if (get_option('comicpress-enable-storyline-support') == 1 && in_comic_category()) { if (get_option('comicpress-enable-storyline-support') == 1 && $is_comic) {
$post_category = "<ul class=\"storyline-cats\"><li class=\"storyline-root\">". get_the_category_list(' &raquo; </li><li>', 'multiple')."</li></ul>\r\n"; $post_category = "<ul class=\"storyline-cats\"><li class=\"storyline-root\">". get_the_category_list(' &raquo; </li><li>', 'multiple')."</li></ul>\r\n";
} else { } else {
$post_category = "<div class=\"post-cat\">". __('Posted In: ','comicpress') .get_the_category_list(',')."</div>\r\n"; $post_category = "<div class=\"post-cat\">". __('Posted In: ','comicpress') .get_the_category_list(',')."</div>\r\n";
@ -68,7 +68,7 @@ function comicpress_display_post_tags() {
} }
function comicpress_display_comment_link() { function comicpress_display_comment_link() {
global $post; global $post, $wp_query;
if ('open' == $post->comment_status && !is_page()) { if ('open' == $post->comment_status && !is_page()) {
if (comicpress_check_child_file('partials/commentlink') == false && !is_single()) { if (comicpress_check_child_file('partials/commentlink') == false && !is_single()) {
$post_comment_link = "<div class=\"comment-link\">".get_comment_reply_link('<span class="comment-balloon comment-balloon-empty">&nbsp;</span> '.__('Comment ','comicpress'), '<span class="comment-balloon">1</span> '.__('Comment ','comicpress'), '<span class="comment-balloon">%</span> '.__('Comments ','comicpress'))."</div>\r\n"; $post_comment_link = "<div class=\"comment-link\">".get_comment_reply_link('<span class="comment-balloon comment-balloon-empty">&nbsp;</span> '.__('Comment ','comicpress'), '<span class="comment-balloon">1</span> '.__('Comment ','comicpress'), '<span class="comment-balloon">%</span> '.__('Comments ','comicpress'))."</div>\r\n";
@ -77,19 +77,19 @@ function comicpress_display_comment_link() {
} }
} }
function comicpress_display_related_posts() { function comicpress_display_related_posts($is_comic = false) {
global $post, $comicpress_options; global $post, $comicpress_options;
if (in_comic_category() && $comicpress_options['enable_related_comics']) { if ($is_comic && $comicpress_options['enable_related_comics']) {
echo ComicPressRelatedPosts::display_related_comics(); echo ComicPressRelatedPosts::display_related_comics();
} }
if (!in_comic_category() && $comicpress_options['enable_related_posts']) { if (!$is_comic && $comicpress_options['enable_related_posts']) {
echo ComicPressRelatedPosts::display_related_posts(); echo ComicPressRelatedPosts::display_related_posts();
} }
} }
function comicpress_display_blog_navigation() { function comicpress_display_blog_navigation($is_comic = false) {
global $post, $wp_query; global $post, $wp_query;
if (is_single() && !in_comic_category()) { ?> if (is_single() && !$is_comic) { ?>
<div class="blognav"> <div class="blognav">
<div class="nav-single"> <div class="nav-single">
<?php previous_post_link('%link',__(' &lsaquo; Previous ','comicpress'), TRUE); ?> <?php previous_post_link('%link',__(' &lsaquo; Previous ','comicpress'), TRUE); ?>
@ -100,12 +100,13 @@ function comicpress_display_blog_navigation() {
<?php } <?php }
} }
function comicpress_display_comic_navigation() { function comicpress_display_comic_navigation($is_comic = false) {
global $post, $wp_query, $comicpress_options; global $post, $wp_query, $comicpress_options;
if (!$comicpress_options['disable_default_comic_nav']) { if (!$comicpress_options['disable_default_comic_nav'] && $is_comic) {
$first_comic = get_first_comic_permalink(); $first_comic = get_first_comic_permalink();
$last_comic = get_last_comic_permalink(); $last_comic = get_last_comic_permalink();
if (!is_search() && !is_archive() && !is_page() && in_comic_category()) { ?> $wp_query->is_single = true;
if (!is_search() && !is_archive() && !is_page()) { ?>
<div class="nav"> <div class="nav">
<?php if ( get_permalink() != $first_comic ) { ?><div class="nav-first"><a href="<?php echo $first_comic ?>"><?php _e('&lsaquo;&lsaquo; First','comicpress'); ?></a></div><?php } ?> <?php if ( get_permalink() != $first_comic ) { ?><div class="nav-first"><a href="<?php echo $first_comic ?>"><?php _e('&lsaquo;&lsaquo; First','comicpress'); ?></a></div><?php } ?>
<div class="nav-previous"><?php $temp_query = $wp_query->is_single; $wp_query->is_single = true; previous_comic_link('%link', __('&lsaquo; Previous','comicpress')); $wp_query->is_single = $temp_query;$temp_query = null; ?></div> <div class="nav-previous"><?php $temp_query = $wp_query->is_single; $wp_query->is_single = true; previous_comic_link('%link', __('&lsaquo; Previous','comicpress')); $wp_query->is_single = $temp_query;$temp_query = null; ?></div>
@ -118,10 +119,10 @@ function comicpress_display_comic_navigation() {
} }
function comicpress_display_the_content() { function comicpress_display_the_content($is_comic = false) {
global $post, $wp_query, $comicpress_options; global $post, $wp_query, $comicpress_options;
if (is_archive() || is_search()) { if (is_archive() || is_search()) {
if (in_comic_category()) { ?> if ($is_comic) { ?>
<div class="comicarchiveframe"> <div class="comicarchiveframe">
<a href="<?php the_permalink() ?>"><img src="<?php the_comic_archive() ?>" alt="<?php the_title() ?>" title="Click for full size." /></a> <a href="<?php the_permalink() ?>"><img src="<?php the_comic_archive() ?>" alt="<?php the_title() ?>" title="Click for full size." /></a>
</div> </div>
@ -140,23 +141,25 @@ function comicpress_display_the_content() {
function comicpress_display_post() { function comicpress_display_post() {
global $post, $wp_query; ?> global $post, $wp_query;
<?php comicpress_display_blog_navigation(); ?> $is_comic = 0;
<?php comicpress_display_comic_navigation(); ?> if (in_comic_category()) $is_comic = 1; ?>
<?php comicpress_display_blog_navigation($is_comic); ?>
<?php comicpress_display_comic_navigation($is_comic); ?>
<div <?php post_class(); ?>> <div <?php post_class(); ?>>
<?php comicpress_display_post_thumbnail(); ?> <?php comicpress_display_post_thumbnail($is_comic); ?>
<div class="post-head"></div> <div class="post-head"></div>
<div class="post-content"> <div class="post-content">
<div class="post-info"> <div class="post-info">
<?php comicpress_display_author_gravatar(); ?> <?php comicpress_display_author_gravatar($is_comic); ?>
<?php comicpress_display_post_calendar(); ?> <?php comicpress_display_post_calendar($is_comic); ?>
<?php if (function_exists('comicpress_show_mood_in_post')) comicpress_show_mood_in_post(); ?> <?php if (function_exists('comicpress_show_mood_in_post')) comicpress_show_mood_in_post(); ?>
<div class="post-text"> <div class="post-text">
<?php <?php
comicpress_display_post_title(); comicpress_display_post_title($is_comic);
if (!is_page()) { if (!is_page()) {
comicpress_display_post_author(); comicpress_display_post_author($is_comic);
comicpress_display_post_category(); comicpress_display_post_category($is_comic);
if (function_exists('the_ratings')) { the_ratings(); } if (function_exists('the_ratings')) { the_ratings(); }
if (!is_archive() && !is_search()) { ?> if (!is_archive() && !is_search()) { ?>
<small><?php edit_post_link(__('Edit Post','comicpress'), ' [ ', ' ] '); ?></small> <small><?php edit_post_link(__('Edit Post','comicpress'), ' [ ', ' ] '); ?></small>
@ -166,7 +169,7 @@ function comicpress_display_post() {
</div> </div>
<div class="clear"></div> <div class="clear"></div>
<div class="entry"> <div class="entry">
<?php comicpress_display_the_content(); ?> <?php comicpress_display_the_content($is_comic); ?>
<br class="clear-margins" /> <br class="clear-margins" />
</div> </div>
<?php wp_link_pages(array('before' => '<div class="linkpages"><span class="linkpages-pagetext">'.__('Pages:','comicpress').'</span> ', 'after' => '</div>', 'next_or_number' => 'number')); ?> <?php wp_link_pages(array('before' => '<div class="linkpages"><span class="linkpages-pagetext">'.__('Pages:','comicpress').'</span> ', 'after' => '</div>', 'next_or_number' => 'number')); ?>
@ -174,7 +177,7 @@ function comicpress_display_post() {
<?php comicpress_display_post_tags(); ?> <?php comicpress_display_post_tags(); ?>
<?php comicpress_display_comment_link(); ?> <?php comicpress_display_comment_link(); ?>
<div class="clear"></div> <div class="clear"></div>
<?php comicpress_display_related_posts(); ?> <?php comicpress_display_related_posts($is_comic); ?>
<?php if (is_page()) { edit_post_link(__('Edit this page.','comicpress'), '<p>', '</p>'); } ?> <?php if (is_page()) { edit_post_link(__('Edit this page.','comicpress'), '<p>', '</p>'); } ?>
</div> </div>
</div> </div>

View File

@ -75,7 +75,7 @@ function comicpress_showmood_edit_post() {
$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="postmood-<?php echo $newmood; ?>" style="cursor:pointer;"> <label for="postmood-<?php echo $newmood; ?>" style="cursor:pointer;">
<img src="<?php echo $moods_uri; ?>/images/moods/<?php echo $moods_directory; ?>/<?php echo basename($file); ?>"><br /> <img src="<?php echo $moods_uri; ?>/images/moods/<?php echo $moods_directory; ?>/<?php echo basename($file); ?>" /><br />
<?php echo $newmood; ?> <?php echo $newmood; ?>
</label> </label>
<br /> <br />

View File

@ -1,73 +0,0 @@
<?php
/**
* Related comics
* Displays a list of comic links that are related to this current one using shortcode.
*
* Usage: [related_comics]
*
*/
/*
function related_comics_shortcode( $atts = '' ) {
extract(shortcode_atts(array(
'limit' => '5',
), $atts));
global $wpdb, $post, $table_prefix, $category_tree;
if ($post->ID) {
// Get tags
$tags = wp_get_post_tags($post->ID);
$tagsarray = array();
foreach ($tags as $tag) {
$tagsarray[] = $tag->term_id;
}
$tagslist = implode(',', $tagsarray);
if (empty($tagslist)) return;
if (empty($limit)) $limit = 5;
// Do the query
$q = "SELECT p.*, count(tr.object_id) as count
FROM $wpdb->term_taxonomy AS tt, $wpdb->term_relationships AS tr, $wpdb->posts AS p WHERE tt.taxonomy ='post_tag' AND tt.term_taxonomy_id = tr.term_taxonomy_id AND tr.object_id = p.ID AND tt.term_id IN ($tagslist) AND p.ID != $post->ID
AND p.post_status = 'publish'
AND p.post_date_gmt < NOW()
GROUP BY tr.object_id
ORDER BY count DESC, p.post_date_gmt DESC
LIMIT $limit;";
$related = $wpdb->get_results($q);
if ( $related ) {
$retval = '
<div class="related_posts">
'.__('Related Comics &not;','comicpress');
$retval .= '
<ul><li>';
$comic_categories = array();
foreach ($category_tree as $node) {
$comic_categories[] = end(explode("/", $node));
}
$in_comic_cat = 0;
$retval .= '
<table class="month-table">';
foreach($related as $r) :
if (count(array_intersect($comic_categories, wp_get_post_categories($r->ID))) > 0)
$retval .= '
<tr><td class="archive-date" align="right">'.date('M j, Y',strtotime($r->post_date)).'</td><td class="archive-title"><a title="'.wptexturize($r->post_title).'" href="'.get_permalink($r->ID).'">'.wptexturize($r->post_title).'</a></td></tr>';
endforeach;
$retval .= '
</table>';
} else {
$retval .= '
<li>'.__('No related comics found','comicpress').'</li>';
}
$retval .= '
</li></ul>';
$retval .= '
</div>';
return $retval;
}
return;
}
// add_shortcode('related_comics', 'related_comics_shortcode');
?>
*/

View File

@ -1,74 +0,0 @@
<?php
/**
* Related posts
* Displays a list of blog links that are related to this current one using shortcode.
*
* Usage: [related_posts]
*
*/
/*
function related_posts_shortcode( $atts = '' ) {
extract(shortcode_atts(array(
'limit' => '5',
), $atts));
global $wpdb, $post, $table_prefix, $category_tree;
if ($post->ID) {
// Get tags
$tags = wp_get_post_tags($post->ID);
$tagsarray = array();
foreach ($tags as $tag) {
$tagsarray[] = $tag->term_id;
}
$tagslist = implode(',', $tagsarray);
if (empty($tagslist)) return;
if (empty($limit)) $limit = 5;
// Do the query
$q = "SELECT p.*, count(tr.object_id) as count
FROM $wpdb->term_taxonomy AS tt, $wpdb->term_relationships AS tr, $wpdb->posts AS p WHERE tt.taxonomy ='post_tag' AND tt.term_taxonomy_id = tr.term_taxonomy_id AND tr.object_id = p.ID AND tt.term_id IN ($tagslist) AND p.ID != $post->ID
AND p.post_status = 'publish'
AND p.post_date_gmt < NOW()
GROUP BY tr.object_id
ORDER BY count DESC, p.post_date_gmt DESC
LIMIT $limit;";
$related = $wpdb->get_results($q);
if ( $related ) {
$retval = '
<div class="related_posts">
'.__('Related Posts &not;','comicpress');
$retval .= '
<ul><li>';
$comic_categories = array();
foreach ($category_tree as $node) {
$comic_categories[] = end(explode("/", $node));
}
$in_comic_cat = 0;
$counter = 0;
$retval .= '
<table class="month-table">';
foreach($related as $r) :
if (count(array_intersect($comic_categories, wp_get_post_categories($r->ID))) == 0)
$retval .= '
<tr><td class="archive-date" align="right">'.date('M j, Y',strtotime($r->post_date)).'</td><td class="archive-title"><a title="'.wptexturize($r->post_title).'" href="'.get_permalink($r->ID).'">'.wptexturize($r->post_title).'</a></td></tr>';
endforeach;
$retval .= '
</table>';
} else {
$retval .= '
<li>'.__('No related posts found','comicpress').'</li>';
}
$retval .= '
</li></ul>';
$retval .= '
</div>';
return $retval;
}
return;
}
// add_shortcode('related_posts', 'related_posts_shortcode');
?>*/

View File

@ -4,9 +4,62 @@
* Author: Philip M. Hofer (Frumph) * Author: Philip M. Hofer (Frumph)
* In Testing * In Testing
*/ */
/*
function cp_add_to_feed_count_rss() {
$feedcount = get_option('comicpress_feed_count_rss');
if (!empty($feedcount)) {
$feedcount = $feedcount + 1;
update_option('comicpress_feed_count_rss', $feedcount);
} else {
add_option('comicpress_feed_count_rss', 1, ' ', 'yes');
}
}
add_action('do_feed_rss', 'cp_add_to_feed_count_rss',5);
function cp_add_to_feed_count_rdf() {
$feedcount = get_option('comicpress_feed_count_rdf');
if (!empty($feedcount)) {
$feedcount = $feedcount + 1;
update_option('comicpress_feed_count_rdf', $feedcount);
} else {
add_option('comicpress_feed_count_rdf', 1, ' ', 'yes');
}
}
add_action('do_feed_rdf', 'cp_add_to_feed_count_rdf',5);
function cp_add_to_feed_count_atom() {
$feedcount = get_option('comicpress_feed_count_atom');
if (!empty($feedcount)) {
$feedcount = $feedcount + 1;
update_option('comicpress_feed_count_atom', $feedcount);
} else {
add_option('comicpress_feed_count_atom', 1, ' ', 'yes');
}
}
add_action('do_feed_atom', 'cp_add_to_feed_count_atom',5);
function cp_add_to_feed_count_rss2() {
$feedcount = get_option('comicpress_feed_count_rss2');
if (!empty($feedcount)) {
$feedcount = $feedcount + 1;
update_option('comicpress_feed_count_rss2', $feedcount);
} else {
add_option('comicpress_feed_count_rss2', 1, ' ', 'yes');
}
}
add_action('do_feed_rss2', 'cp_add_to_feed_count_rss2',5);
*/
/** /**
* Add the number of post comments to the title of the RSS feed items. * Add the number of post comments to the title of the RSS feed items.
* TODO Make this togglable via options.
* @param string $title The title of the post. * @param string $title The title of the post.
* @return string The filtered title of the post. * @return string The filtered title of the post.
*/ */
@ -33,12 +86,8 @@ function comicpress_export_wp() {
remove_filter('the_title_rss', 'comicpress_the_title_rss'); remove_filter('the_title_rss', 'comicpress_the_title_rss');
} }
function comicpress_init_rss() { global $comicpress_options;
$comicpress_options = comicpress_load_options(); if ($comicpress_options['enable_comment_count_in_rss']) {
if ($comicpress_options['disable_rss_comments_count']) { add_filter('the_title_rss', 'comicpress_the_title_rss');
add_filter('the_title_rss', 'comicpress_the_title_rss'); add_action('export_wp', 'comicpress_export_wp');
add_action('export_wp', 'comicpress_export_wp');
}
} }
add_action('init', 'comicpress_init_rss');

View File

@ -92,9 +92,15 @@ if ($comicpress_options['enable_numbered_pagination']) {
echo '<li class="paginav-extend">'.$pagenavi_options['dotleft_text'].'</li>'; echo '<li class="paginav-extend">'.$pagenavi_options['dotleft_text'].'</li>';
} }
} }
echo '<li class="paginav-previous">'; $prev_post_link = get_previous_posts_link( $pagenavi_options['prev_text'] );
previous_posts_link($pagenavi_options['prev_text']);
echo '</li>'; if (!empty($prev_post_link)) {
echo "<li class=\"paginav-previous\">\r\n";
echo $prev_post_link . "\r\n";
echo "</li>\r\n";
}
for($i = $start_page; $i <= $end_page; $i++) { for($i = $start_page; $i <= $end_page; $i++) {
if($i == $paged) { if($i == $paged) {
$current_page_text = str_replace("%PAGE_NUMBER%", number_format_i18n($i), $pagenavi_options['current_text']); $current_page_text = str_replace("%PAGE_NUMBER%", number_format_i18n($i), $pagenavi_options['current_text']);
@ -104,9 +110,12 @@ if ($comicpress_options['enable_numbered_pagination']) {
echo '<li><a href="'.clean_url(get_pagenum_link($i)).'" title="'.$page_text.'">'.$page_text.'</a></li>'; echo '<li><a href="'.clean_url(get_pagenum_link($i)).'" title="'.$page_text.'">'.$page_text.'</a></li>';
} }
} }
echo '<li class="paginav-next">'; $next_post_link = get_next_posts_link($pagenavi_options['next_text'], $max_page);
next_posts_link($pagenavi_options['next_text'], $max_page); if (!empty($next_post_link)) {
echo '</li>'; echo "<li class=\"paginav-next\">\r\n";
echo $next_post_link ."\r\n";
echo "</li>\r\n";
}
if ($end_page < $max_page) { if ($end_page < $max_page) {
if(!empty($pagenavi_options['dotright_text'])) { if(!empty($pagenavi_options['dotright_text'])) {
echo '<li class="paginav-extend">'.$pagenavi_options['dotright_text'].'</li>'; echo '<li class="paginav-extend">'.$pagenavi_options['dotright_text'].'</li>';

View File

@ -23,39 +23,37 @@
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name') ?> Atom Feed" href="<?php bloginfo('atom_url') ?>" /> <link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name') ?> Atom Feed" href="<?php bloginfo('atom_url') ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url') ?>" /> <link rel="pingback" href="<?php bloginfo('pingback_url') ?>" />
<meta name="ComicPress" content="<?php echo $comicpress_options['comicpress_version']; ?>" /> <meta name="ComicPress" content="<?php echo $comicpress_options['comicpress_version']; ?>" />
<!--[if lt IE 7]> <!--[if lt IE 7]>
<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/ie6submenus.js"></script> <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/ie6submenus.js"></script>
<![endif]--> <![endif]-->
<?php wp_head(); ?>
<?php wp_head(); ?>
</head> </head>
<body <?php if (function_exists('body_class')) { body_class(); } ?>> <body <?php if (function_exists('body_class')) { body_class(); } ?>>
<?php do_action('comicpress-header'); ?> <?php do_action('comicpress-header'); ?>
<?php get_sidebar('above'); ?> <?php get_sidebar('above'); ?>
<div id="page-head"></div> <div id="page-head"></div>
<?php if (!$comicpress_options['disable_page_restraints']) { <?php if (!$comicpress_options['disable_page_restraints']) {
if (is_cp_theme_layout('standard,v')) { ?> if (is_cp_theme_layout('standard,v')) { ?>
<div id="page-wrap"><!-- Wraps outside the site width --> <div id="page-wrap"><!-- Wraps outside the site width -->
<div id="page"><!-- Defines entire site width - Ends in Footer --> <div id="page"><!-- Defines entire site width - Ends in Footer -->
<?php } else { ?> <?php } else { ?>
<div id="page-wide-wrap"> <div id="page-wide-wrap"><!-- Wraps outside the site width -->
<div id="page-wide"> <div id="page-wide"><!-- Defines entire site width - Ends in Footer -->
<?php } <?php }
} ?> } ?>
<?php if (comicpress_check_child_file('partials/headerarea') == false) { ?> <?php if (comicpress_check_child_file('partials/headerarea') == false) { ?>
<div id="header"> <div id="header">
<?php if (function_exists('the_project_wonderful_ad')) { ?> <?php if (function_exists('the_project_wonderful_ad')) {
<div class="headerpwad"> the_project_wonderful_ad('header');
<?php the_project_wonderful_ad('header'); ?> } ?>
</div> <h1><a href="<?php bloginfo('wpurl'); ?>"><?php bloginfo('name') ?></a></h1>
<?php } ?>
<h1><a href="<?php bloginfo('wpurl'); ?>"><?php bloginfo('name') ?></a></h1>
<div class="description"><?php bloginfo('description') ?></div> <div class="description"><?php bloginfo('description') ?></div>
<?php get_sidebar('header'); ?> <?php get_sidebar('header'); ?>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<?php } ?> <?php } ?>
<?php get_sidebar('menubar'); ?> <?php get_sidebar('menubar'); ?>

View File

@ -12,7 +12,9 @@
endwhile; endwhile;
} }
Restore(); Restore();
UnProtect(); ?> UnProtect();
wp_reset_query();
?>
<?php } ?> <?php } ?>
<?php if (function_exists('the_project_wonderful_ad')) { <?php if (function_exists('the_project_wonderful_ad')) {
@ -49,6 +51,7 @@
} }
Restore(); Restore();
UnProtect(); UnProtect();
wp_reset_query();
} ?> } ?>
<?php get_sidebar('underblog'); ?> <?php get_sidebar('underblog'); ?>

View File

@ -14,14 +14,14 @@
<div id="pagewrap-left"> <div id="pagewrap-left">
<?php } ?> <?php } ?>
<?php if (!is_cp_theme_layout('gn,rgn,v3cr')) { ?> <?php if (is_cp_theme_layout('v,v3c')) { ?>
<div id="content" class="narrowcolumn"> <div id="content" class="narrowcolumn">
<div class="column"> <div class="column">
<?php } ?> <?php } ?>
<?php <?php
Protect();
if (!$comicpress_options['disable_comic_frontpage'] && is_home()) { if (!$comicpress_options['disable_comic_frontpage'] && is_home()) {
Protect();
$comic_query = 'showposts=1&cat='.get_all_comic_categories_as_cat_string(); $comic_query = 'showposts=1&cat='.get_all_comic_categories_as_cat_string();
$posts = query_posts($comic_query); $posts = query_posts($comic_query);
if (have_posts()) { if (have_posts()) {
@ -30,9 +30,10 @@
display_comic_area(); display_comic_area();
endwhile; endwhile;
} }
Restore();
UnProtect();
wp_reset_query();
} }
Restore();
UnProtect();
if (is_single() & in_comic_category()) { if (is_single() & in_comic_category()) {
display_comic_area(); display_comic_area();
} }

View File

@ -47,13 +47,13 @@
<?php _e('Checkmark this and your site will not display the contents of #blogheader.','comicpress'); ?> <?php _e('Checkmark this and your site will not display the contents of #blogheader.','comicpress'); ?>
</td> </td>
</tr> </tr>
<tr> <tr class="alternate">
<th scope="row"><label for="disable_rss_comments_count"><?php _e('Disable RSS comments count','comicpress'); ?></label></th> <th scope="row"><label for="enable_comment_count_in_rss"><?php _e('Enable the comment count to show in feed title.','comicpress'); ?></label></th>
<td> <td>
<input id="disable_rss_comments_count" name="disable_rss_comments_count" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_rss_comments_count']); ?> /> <input id="enable_comment_count_in_rss" name="enable_comment_count_in_rss" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_comment_count_in_rss']); ?> />
</td> </td>
<td> <td>
<?php _e('Enable this option to not show comment counts in RSS feed post titles.','comicpress'); ?> <?php _e('Will show how many comments there are in the title of the post in the feed.','comicpress'); ?>
</td> </td>
</tr> </tr>
</table> </table>
@ -160,6 +160,15 @@
<?php _e('Default text in the footer will not display. Enable this if you do not want any text in the footer. If you wish to add you own custom content, you may do so via Appearance -> Widgets-> Footer.', 'comicpress'); ?> <?php _e('Default text in the footer will not display. Enable this if you do not want any text in the footer. If you wish to add you own custom content, you may do so via Appearance -> Widgets-> Footer.', 'comicpress'); ?>
</td> </td>
</tr> </tr>
<tr>
<th scope="row"><label for="enable_scroll_to_top"><?php _e('Enable the scroll to top link in the footer?','comicpress'); ?></label></th>
<td>
<input id="enable_scroll_to_top" name="enable_scroll_to_top" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_scroll_to_top']); ?> />
</td>
<td>
<?php _e('When this link is clicked on long pages it will scroll back to the top.','comicpress'); ?>
</td>
</tr>
</table> </table>
<table class="widefat"> <table class="widefat">
@ -203,3 +212,4 @@
</form> </form>
</div> </div>

View File

@ -20,17 +20,34 @@
<th colspan="4"><?php _e('Layout','comicpress'); ?></th> <th colspan="4"><?php _e('Layout','comicpress'); ?></th>
</tr> </tr>
</thead> </thead>
<?php global $avail_layouts; ?>
<tr class="alternate"> <tr class="alternate">
<th scope="row" style="width:250px"><label for="cp_theme_layout" style="text-align:left"><?php _e('Choose Your Website Layout','comicpress'); ?></label> <th scope="row" style="width:250px"><label for="cp_theme_layout" style="text-align:left"><?php _e('Choose Your Website Layout','comicpress'); ?></label>
<select name="cp_theme_layout" id="cp_theme_layout" onchange="showimage(this,'cpthemestyle')"> <select name="cp_theme_layout" id="cp_theme_layout" onchange="showimage(this,'cpthemestyle')">
<?php if (is_cp_layout_avail('standard',$avail_layouts)) { ?>
<option class="level-0" value="standard" <?php if ($comicpress_options['cp_theme_layout'] == 'standard') { ?>selected="selected" <?php } ?>><?php _e('2 Column - Standard','comicpress'); ?></option> <option class="level-0" value="standard" <?php if ($comicpress_options['cp_theme_layout'] == 'standard') { ?>selected="selected" <?php } ?>><?php _e('2 Column - Standard','comicpress'); ?></option>
<?php } ?>
<?php if (is_cp_layout_avail('v',$avail_layouts)) { ?>
<option class="level-0" value="v" <?php if ($comicpress_options['cp_theme_layout'] =='v') { ?>selected="selected" <?php } ?>><?php _e('2 Column - Vertical','comicpress'); ?></option> <option class="level-0" value="v" <?php if ($comicpress_options['cp_theme_layout'] =='v') { ?>selected="selected" <?php } ?>><?php _e('2 Column - Vertical','comicpress'); ?></option>
<?php } ?>
<?php if (is_cp_layout_avail('3c',$avail_layouts)) { ?>
<option class="level-0" value="3c" <?php if ($comicpress_options['cp_theme_layout'] =='3c') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Standard ','comicpress'); ?></option> <option class="level-0" value="3c" <?php if ($comicpress_options['cp_theme_layout'] =='3c') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Standard ','comicpress'); ?></option>
<?php } ?>
<?php if (is_cp_layout_avail('3c2r',$avail_layouts)) { ?>
<option class="level-0" value="3c2r" <?php if ($comicpress_options['cp_theme_layout'] =='3c2r') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Double Right Sidebar','comicpress'); ?></option> <option class="level-0" value="3c2r" <?php if ($comicpress_options['cp_theme_layout'] =='3c2r') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Double Right Sidebar','comicpress'); ?></option>
<?php } ?>
<?php if (is_cp_layout_avail('v3c',$avail_layouts)) { ?>
<option class="level-0" value="v3c" <?php if ($comicpress_options['cp_theme_layout'] =='v3c') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Vertical','comicpress'); ?></option> <option class="level-0" value="v3c" <?php if ($comicpress_options['cp_theme_layout'] =='v3c') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Vertical','comicpress'); ?></option>
<?php } ?>
<?php if (is_cp_layout_avail('v3cr',$avail_layouts)) { ?>
<option class="level-0" value="v3cr" <?php if ($comicpress_options['cp_theme_layout'] =='v3c') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Vertical Double Right Sidebar','comicpress'); ?></option> <option class="level-0" value="v3cr" <?php if ($comicpress_options['cp_theme_layout'] =='v3c') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Vertical Double Right Sidebar','comicpress'); ?></option>
<?php } ?>
<?php if (is_cp_layout_avail('gn',$avail_layouts)) { ?>
<option class="level-0" value="gn" <?php if ($comicpress_options['cp_theme_layout'] =='gn') { ?>selected="selected" <?php } ?>><?php _e('Graphic Novel - Left Sidebar','comicpress'); ?></option> <option class="level-0" value="gn" <?php if ($comicpress_options['cp_theme_layout'] =='gn') { ?>selected="selected" <?php } ?>><?php _e('Graphic Novel - Left Sidebar','comicpress'); ?></option>
<?php } ?>
<?php if (is_cp_layout_avail('rgn',$avail_layouts)) { ?>
<option class="level-0" value="rgn" <?php if ($comicpress_options['cp_theme_layout'] =='rgn') { ?>selected="selected" <?php } ?>><?php _e('Graphic Novel - Right Sidebar','comicpress'); ?></option> <option class="level-0" value="rgn" <?php if ($comicpress_options['cp_theme_layout'] =='rgn') { ?>selected="selected" <?php } ?>><?php _e('Graphic Novel - Right Sidebar','comicpress'); ?></option>
<?php } ?>
</select> </select>
</th> </th>
<td> <td>

View File

@ -1,4 +1,5 @@
<?php if (comicpress_check_child_file('searchform') == false) { ?> <?php if (comicpress_check_child_file('searchform') == false) { ?>
<form method="get" id="searchform" action="<?php bloginfo('wpurl'); ?>/"> <form method="get" id="searchform" action="<?php bloginfo('wpurl'); ?>/">
<div> <div>
<input type="text" value="<?php _e('Search...','comicpress'); ?>" name="s" id="s-search" onfocus="this.value=(this.value=='<?php _e('Search...','comicpress'); ?>') ? '' : this.value;" onblur="this.value=(this.value=='') ? '<?php _e('Search...','comicpress'); ?>' : this.value;" /> <input type="text" value="<?php _e('Search...','comicpress'); ?>" name="s" id="s-search" onfocus="this.value=(this.value=='<?php _e('Search...','comicpress'); ?>') ? '' : this.value;" onblur="this.value=(this.value=='') ? '<?php _e('Search...','comicpress'); ?>' : this.value;" />
@ -6,4 +7,5 @@
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</form> </form>
<?php } ?> <?php } ?>

View File

@ -7,7 +7,7 @@ if (!$comicpress_options['disable_lrsidebars_frontpage']) { ?>
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Left Sidebar') ) : if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Left Sidebar') ) :
if (!is_cp_theme_layout('standard,v')) { if (!is_cp_theme_layout('standard,v')) {
the_widget('ComicPressCalendarWidget'); the_widget('ComicPressCalendarWidget');
the_widget('ComicPressArchiveDropdownWidget','mode=monthly_archive'); the_widget('ComicPressArchiveDropdownWidget', 'mode=storyline_order');
} }
the_widget('ComicPressLatestComicsWidget'); the_widget('ComicPressLatestComicsWidget');
endif; endif;

View File

@ -1,6 +1,6 @@
<?php global $comicpress_options; <?php global $comicpress_options;
if (!$comicpress_options['disable_default_menubar']) { if (!$comicpress_options['disable_default_menubar']) {
the_widget('ComicPressMenubarWidget',array(),array()); the_widget('ComicPressMenubarWidget',array(),array('before_widget'=>'', 'after_widget'=>''));
} }
?> ?>
<?php if (comicpress_is_active_sidebar('Menubar')) { ?> <?php if (comicpress_is_active_sidebar('Menubar')) { ?>

View File

@ -5,18 +5,15 @@ if (!$comicpress_options['disable_lrsidebars_frontpage']) { ?>
<div class="sidebar"> <div class="sidebar">
<?php <?php
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Right Sidebar') ) : if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Right Sidebar') ) :
the_widget('ComicpressBookmarkWidget','mode=three-button');
if (is_cp_theme_layout('standard,v')) { if (is_cp_theme_layout('standard,v')) {
the_widget('ComicPressCalendarWidget'); the_widget('ComicPressCalendarWidget');
the_widget('ComicpressArchiveDropdownWidget','mode=monthly_archive'); the_widget('ComicPressArchiveDropdownWidget', 'mode=storyline_order');
} }
if ($comicpress_options['disable_comic_frontpage']) { if ($comicpress_options['disable_comic_frontpage']) {
the_widget('ComicPressLatestThumbnailWidget'); the_widget('ComicPressLatestThumbnailWidget','title=Latest Comic&onlyhome=true');
} }
the_widget('WP_Widget_Search');
the_widget('WP_Widget_Pages'); the_widget('WP_Widget_Pages');
the_widget('WP_Widget_Categories','hierarchical=1&count=1'); the_widget('WP_Widget_Categories','hierarchical=1&count=1');
endif; endif;
?> ?>
</div> </div>

View File

@ -859,6 +859,16 @@ ul.children {
padding: 3px; padding: 3px;
} }
.sidebar .ComicPressLatestThumbnailWidget h2 {
text-align: left;
}
.sidebar .ComicPressLatestThumbnailWidget {
text-align: center;
}
/* WIDGETS */ /* WIDGETS */
.random-comic-icon, .random-post-icon { .random-comic-icon, .random-post-icon {
@ -970,6 +980,7 @@ ul.children {
/* SEARCH */ /* SEARCH */
#s-search, #s-transcript { #s-search, #s-transcript {
height: 15px;
width: 140px; width: 140px;
} }

View File

@ -13,20 +13,42 @@ class ComicPressComicBlogPostWidget extends WP_Widget {
function ComicPressComicBlogPostWidget($skip_widget_init = false) { function ComicPressComicBlogPostWidget($skip_widget_init = false) {
if (!$skip_widget_init) { if (!$skip_widget_init) {
$widget_ops = array('classname' => __CLASS__, 'description' => __('Displays the comic blog post, ..used to be around the comic areas.','comicpress') ); $widget_ops = array('classname' => __CLASS__, 'description' => __('Displays the comic blog post. (used within the comic sidebar areas)','comicpress') );
$this->WP_Widget(__CLASS__, __('ComicPress Comic Blog Post','comicpress'), $widget_ops); $this->WP_Widget(__CLASS__, __('ComicPress Comic Blog Post','comicpress'), $widget_ops);
} }
} }
function widget($args, $instance) { function widget($args, $instance) {
global $post, $wp_query; global $post, $wp_query;
if ((is_home() || is_single()) && in_comic_category()) { if (!is_home() && $instance['onlyhome'] || (is_page() || is_archive() || is_search())) return;
extract($args, EXTR_SKIP); extract($args, EXTR_SKIP);
if (is_home()) {
Protect();
$comic_query = 'showposts=1&cat='.get_all_comic_categories_as_cat_string();
$posts = query_posts($comic_query);
if (have_posts()) {
while (have_posts()) : the_post();
if (!empty($post->post_content)) {
echo $before_widget;
$temp_query = $wp_query->is_single;
$wp_query->is_single = true;
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
if ( !empty( $title ) ) { echo "<div class=\"comic-post-header\">".$title."</div>\r\n"; }
the_content();
$wp_query->is_single = $temp_query;
echo $after_widget;
}
endwhile;
}
Restore();
UnProtect();
wp_reset_query();
} else {
if (!empty($post->post_content)) { if (!empty($post->post_content)) {
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 '<div class="heading">'.$title.'</div>'; } if ( !empty( $title ) ) { echo "<div class=\"comic-post-header\">".$title."</div>\r\n"; }
echo $post->post_content; the_content();
echo $after_widget; echo $after_widget;
} }
} }
@ -35,15 +57,17 @@ class ComicPressComicBlogPostWidget extends WP_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['onlyhome'] = (bool)( $new_instance['onlyhome'] == 1 ? true : false );
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' => '', 'onlyhome' => false ) );
$title = strip_tags($instance['title']); $title = strip_tags($instance['title']);
$onlyhome = $instance['onlyhome'];
?> ?>
<p><label for="<?php echo $this->get_field_id('title'); ?>">Heading:<br /><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'); ?>">Heading:<br /><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('onlyhome'); ?>"><input id="<?php echo $this->get_field_id('onlyhome'); ?>" name="<?php echo $this->get_field_name('onlyhome'); ?>" type="checkbox" value="1" <?php checked(true, $onlyhome); ?> /> Display only on the home page?</label></p>
<?php <?php
} }
} }

View File

@ -20,7 +20,7 @@ class ComicPressLatestComicsWidget extends WP_Widget {
function widget($args, $instance) { function widget($args, $instance) {
global $post; global $post;
extract($args, EXTR_SKIP); extract($args, EXTR_SKIP);
Protect();
echo $before_widget; echo $before_widget;
$title = empty($instance['title']) ? __('Latest Comics','comicpress') : apply_filters('widget_title', $instance['title']); $title = empty($instance['title']) ? __('Latest Comics','comicpress') : apply_filters('widget_title', $instance['title']);
if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }; if ( !empty( $title ) ) { echo $before_title . $title . $after_title; };
@ -30,7 +30,10 @@ class ComicPressLatestComicsWidget extends WP_Widget {
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php echo $after_widget; <?php
Restore();
UnProtect();
echo $after_widget;
} }
function update($new_instance, $old_instance) { function update($new_instance, $old_instance) {

View File

@ -19,43 +19,62 @@ class ComicPressLatestThumbnailWidget extends WP_Widget {
} }
function widget($args, $instance) { function widget($args, $instance) {
global $post; global $post, $wp_query;
if (is_home()) { if (!is_home() && $instance['onlyhome']) return;
extract($args, EXTR_SKIP);
echo $before_widget; extract($args, EXTR_SKIP);
$title = empty($instance['title']) ? __('Latest Comic','comicpress') : apply_filters('widget_title', $instance['title']); echo $before_widget;
if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }; $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
$latestcomics = get_posts('numberposts=1&category='.get_all_comic_categories_as_cat_string()); if ( !empty( $title ) ) { echo $before_title . $title . $after_title; };
$archive_image = null; Protect();
$comic_query = 'showposts=1&cat='.get_all_comic_categories_as_cat_string();
foreach($latestcomics as $post) : query_posts($comic_query);
foreach (array("archive", "rss", "mini", "comic") as $type) { $archive_image = null;
if (($requested_archive_image = get_comic_url($type, $post)) !== false) { if (have_posts()) {
$archive_image = $requested_archive_image; break; while (have_posts()) : the_post();
if (!empty($post->post_content)) {
echo $before_widget;
$temp_query = $wp_query->is_single;
$wp_query->is_single = true;
foreach (array("archive", "rss", "mini", "comic") as $type) {
if (($requested_archive_image = get_comic_url($type, $post)) !== false) {
$archive_image = "<img src=\"$requested_archive_image\" alt=\"".get_the_title()."\" title=\"".get_the_title()."\" />";
break;
}
}
if (function_exists('has_post_thumbnail')) {
if ( has_post_thumbnail($post->ID) ) {
$archive_image = get_the_post_thumbnail($post->ID,'full');
}
} ?>
<a href="<?php the_permalink(); ?>"><?php echo $archive_image; ?></a>
<?php
$wp_query->is_single = $temp_query;
echo $after_widget;
} }
} ?> endwhile;
<center>
<a href="<?php the_permalink(); ?>"><img src="<?php echo $archive_image ?>" alt="<?php the_title() ?> - <?php the_date(); ?>" title="<?php the_hovertext() ?>" /></a><br />
<span class="latest_thumbnail_date"><?php the_date(); ?></span>
</center>
<?php endforeach;
echo $after_widget;
} }
Restore();
UnProtect();
wp_reset_query();
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['onlyhome'] = (bool)( $new_instance['onlyhome'] == 1 ? true : false );
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' => '', 'onlyhome' => false ) );
$title = strip_tags($instance['title']); $title = strip_tags($instance['title']);
$onlyhome = $instance['onlyhome'];
?> ?>
<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> <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 <p><label for="<?php echo $this->get_field_id('onlyhome'); ?>"><input id="<?php echo $this->get_field_id('onlyhome'); ?>" name="<?php echo $this->get_field_name('onlyhome'); ?>" type="checkbox" value="1" <?php checked(true, $onlyhome); ?> /> Display only on the home page?</label></p>
<?php
} }
} }

View File

@ -24,15 +24,17 @@ class ComicPressMenubarWidget extends WP_Widget {
if (file_exists(get_stylesheet_directory() . '/custom-menubar.php')) { if (file_exists(get_stylesheet_directory() . '/custom-menubar.php')) {
include(get_stylesheet_directory() . '/custom-menubar.php'); include(get_stylesheet_directory() . '/custom-menubar.php');
} else { ?> } else { ?>
<div id="menubar">
<div id="menunav"> <div id="menubar">
<div id="menunav">
<?php if ($comicpress_options['enable_search_in_menubar']) { ?> <?php if ($comicpress_options['enable_search_in_menubar']) { ?>
<div class="menunav-search"><?php include(get_template_directory() . '/searchform.php'); ?></div> <div class="menunav-search">
<?php } ?> <?php the_widget('WP_Widget_Search',array(),array('before_widget'=>'', 'after_widget'=>'')); ?>
<?php if ($comicpress_options['enable_rss_in_menubar']) { ?> </div>
<a href="<?php bloginfo('rss2_url') ?>" title="RSS Feed" class="menunav-rss">RSS</a>
<?php } ?> <?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 ($comicpress_options['enable_navigation_in_menubar']) { ?>
<?php if (is_home() && !$comicpress_options['disable_comic_frontpage']) { <?php if (is_home() && !$comicpress_options['disable_comic_frontpage']) {
$comicFrontpage = new WP_Query(); $comicFrontpage->query('showposts=1&cat='.get_all_comic_categories_as_cat_string()); $comicFrontpage = new WP_Query(); $comicFrontpage->query('showposts=1&cat='.get_all_comic_categories_as_cat_string());