resolve merge conflict
This commit is contained in:
commit
b93e252368
|
@ -36,7 +36,7 @@
|
|||
<?php /* Paged Archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
|
||||
<h2 class="pagetitle"><?php _e('Archives','comicpress'); ?></h2>
|
||||
<?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" />
|
||||
</div>
|
||||
<div class="post-foot"></div>
|
||||
|
|
|
@ -44,7 +44,7 @@ class ComicPressRelatedPosts {
|
|||
function _handle_shortcode_attrs($attrs) {
|
||||
return shortcode_atts(array(
|
||||
'limit' => '5',
|
||||
), $atts);
|
||||
), $attrs);
|
||||
}
|
||||
|
||||
function _new_comicpressstoryline() { return new ComicPressStoryline(); }
|
||||
|
|
|
@ -22,7 +22,7 @@ $archive_comic_width = "380";
|
|||
$rss_comic_width = "600";
|
||||
|
||||
//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 = "80";
|
||||
|
|
|
@ -5,7 +5,13 @@ function options() {
|
|||
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" />
|
||||
<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]-->
|
||||
|
@ -14,122 +20,164 @@ function comicpress_admin_page_head() { ?>
|
|||
|
||||
function comicpress_admin() {
|
||||
global $upload_path, $blogcat;
|
||||
$comicpress_options = get_option('comicpress_options'); ?>
|
||||
|
||||
$comicpress_options = get_option('comicpress_options');
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
|
||||
|
||||
<div id="cpadmin-headericon" style="background: url('<?php echo get_template_directory_uri(); ?>/images/options/comicpress_icon.png') no-repeat;"></div>
|
||||
<h2 class="alignleft"><?php _e('ComicPress Options','comicpress'); ?></h2>
|
||||
<div class="clear"></div>
|
||||
<?php
|
||||
<?php
|
||||
$tab = '';
|
||||
if ( wp_verify_nonce($_POST['_wpnonce'], 'update-options') ) {
|
||||
|
||||
|
||||
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';
|
||||
update_option('comicpress_options',$comicpress_options);
|
||||
}
|
||||
|
||||
|
||||
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 );
|
||||
$comicpress_options['disable_comment_note'] = (bool)($_REQUEST['disable_comment_note'] == 1 ? true : false );
|
||||
$comicpress_options['enable_numbered_pagination'] = (bool)($_REQUEST['enable_numbered_pagination'] == 1 ? true : false );
|
||||
$comicpress_options['comic_clicks_next'] = (bool)($_REQUEST['comic_clicks_next'] == 1 ? true : false );
|
||||
$comicpress_options['disable_default_comic_nav'] = (bool)($_REQUEST['disable_default_comic_nav'] == 1 ? true : false );
|
||||
$comicpress_options['graphicnav_directory'] = wp_filter_nohtml_kses($_REQUEST['graphicnav_directory']);
|
||||
$comicpress_options['enable_widgetarea_use_sidebar_css'] = (bool)($_REQUEST['enable_widgetarea_use_sidebar_css'] == 1 ? true : false );
|
||||
$comicpress_options['disable_lrsidebars_frontpage'] = (bool)($_REQUEST['disable_lrsidebars_frontpage'] == 1 ? true : false );
|
||||
$comicpress_options['disable_footer_text'] = (bool)($_REQUEST['disable_footer_text'] == 1 ? true : false );
|
||||
$comicpress_options['disable_blogheader'] = (bool)($_REQUEST['disable_blogheader'] == 1 ? true : false );
|
||||
$comicpress_options['disable_rss_comments_count'] = (bool)($_REQUEST['disable_rss_comments_count'] == 1 ? true : false );
|
||||
$comicpress_options['enable_comicpress_debug'] = (bool)($_REQUEST['enable_comicpress_debug'] == 1 ? true : false );
|
||||
$comicpress_options['enable_full_post_check'] = (bool)($_REQUEST['enable_full_post_check'] == 1 ? true : false );
|
||||
|
||||
foreach (array(
|
||||
'disable_page_restraints',
|
||||
'rascal_says',
|
||||
'disable_comment_note',
|
||||
'enable_numbered_pagination',
|
||||
'enable_comment_count_in_rss',
|
||||
'comic_clicks_next',
|
||||
'disable_default_comic_nav',
|
||||
'enable_widgetarea_use_sidebar_css',
|
||||
'disable_lrsidebars_frontpage',
|
||||
'disable_footer_text',
|
||||
'disable_blogheader',
|
||||
'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';
|
||||
update_option('comicpress_options',$comicpress_options);
|
||||
}
|
||||
|
||||
|
||||
if ($_REQUEST['action'] == 'comicpress_save_index') {
|
||||
$comicpress_options['disable_comic_frontpage'] = (bool)($_REQUEST['disable_comic_frontpage'] == 1 ? true : false );
|
||||
$comicpress_options['disable_comic_blog_frontpage'] = (bool)($_REQUEST['disable_comic_blog_frontpage'] == 1 ? true : false );
|
||||
$comicpress_options['disable_comic_blog_single'] = (bool)($_REQUEST['disable_comic_blog_single'] == 1 ? true : false );
|
||||
$comicpress_options['disable_blog_frontpage'] = (bool)($_REQUEST['disable_blog_frontpage'] == 1 ? true : false );
|
||||
foreach (array(
|
||||
'disable_comic_frontpage',
|
||||
'disable_comic_blog_frontpage',
|
||||
'disable_comic_blog_single',
|
||||
'disable_blog_frontpage'
|
||||
) as $key) {
|
||||
$comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
|
||||
}
|
||||
|
||||
$tab = 'index';
|
||||
update_option('comicpress_options',$comicpress_options);
|
||||
update_option('comicpress_options',$comicpress_options);
|
||||
}
|
||||
|
||||
|
||||
if ($_REQUEST['action'] == 'comicpress_save_post') {
|
||||
$comicpress_options['transcript_in_posts'] = (bool)($_REQUEST['transcript_in_posts'] == 1 ? true : false );
|
||||
$comicpress_options['enable_related_comics'] = (bool)($_REQUEST['enable_related_comics'] == 1 ? true : false );
|
||||
$comicpress_options['enable_related_posts'] = (bool)($_REQUEST['enable_related_posts'] == 1 ? true : false );
|
||||
$comicpress_options['remove_wptexturize'] = (bool)($_REQUEST['remove_wptexturize'] == 1 ? true : false );
|
||||
|
||||
$comicpress_options['split_column_in_two'] = (bool)($_REQUEST['split_column_in_two'] == 1 ? true : false );
|
||||
$comicpress_options['author_column_one'] = wp_filter_nohtml_kses($_REQUEST['author_column_one']);
|
||||
$comicpress_options['author_column_two'] = wp_filter_nohtml_kses($_REQUEST['author_column_two']);
|
||||
|
||||
$comicpress_options['enable_comic_post_author_gravatar'] = (bool)($_REQUEST['enable_comic_post_author_gravatar'] == 1 ? true : false );
|
||||
$comicpress_options['enable_post_author_gravatar'] = (bool)($_REQUEST['enable_post_author_gravatar'] == 1 ? true : false );
|
||||
$comicpress_options['avatar_directory'] = wp_filter_nohtml_kses($_REQUEST['avatar_directory']);
|
||||
$comicpress_options['moods_directory'] = wp_filter_nohtml_kses($_REQUEST['moods_directory']);
|
||||
|
||||
$comicpress_options['calendar_directory'] = wp_filter_nohtml_kses($_REQUEST['calendar_directory']);
|
||||
$comicpress_options['enable_comic_post_calendar'] = (bool)($_REQUEST['enable_comic_post_calendar'] == 1 ? true : false );
|
||||
$comicpress_options['enable_post_calendar'] = (bool)($_REQUEST['enable_post_calendar'] == 1 ? true : false );
|
||||
|
||||
$comicpress_options['disable_tags_in_posts'] = (bool)($_REQUEST['disable_tags_in_posts'] == 1 ? true : false );
|
||||
$comicpress_options['disable_categories_in_posts'] = (bool)($_REQUEST['disable_categories_in_posts'] == 1 ? true : false );
|
||||
|
||||
$comicpress_options['blogposts_with_comic'] = (bool)($_REQUEST['blogposts_with_comic'] == 1 ? true : false );
|
||||
$comicpress_options['static_blog'] = (bool)($_REQUEST['static_blog'] == 1 ? true : false );
|
||||
$comicpress_options['disable_page_titles'] = (bool)($_REQUEST['disable_page_titles'] == 1 ? true : false );
|
||||
|
||||
foreach (array(
|
||||
'transcript_in_posts',
|
||||
'enable_related_comics',
|
||||
'enable_related_posts',
|
||||
'remove_wptexturize',
|
||||
'enable_comic_post_author_gravatar',
|
||||
'enable_post_author_gravatar',
|
||||
'split_column_in_two',
|
||||
'enable_comic_post_calendar',
|
||||
'enable_post_calendar',
|
||||
'disable_tags_in_posts',
|
||||
'disable_categories_in_posts',
|
||||
'blogposts_with_comic',
|
||||
'static_blog',
|
||||
'disable_page_titles'
|
||||
) as $key) {
|
||||
$comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
|
||||
}
|
||||
foreach (array(
|
||||
'author_column_one',
|
||||
'author_column_two',
|
||||
'avatar_directory',
|
||||
'moods_directory',
|
||||
'calendar_directory'
|
||||
) as $key) {
|
||||
$comicpress_options[$key] = wp_filter_nohtml_kses($_REQUEST[$key]);
|
||||
}
|
||||
$tab = 'post';
|
||||
update_option('comicpress_options',$comicpress_options);
|
||||
update_option('comicpress_options',$comicpress_options);
|
||||
}
|
||||
|
||||
|
||||
if ($_REQUEST['action'] == 'comicpress_save_archivesearch') {
|
||||
$comicpress_options['archive_display_order'] = $_REQUEST['archive_display_order'];
|
||||
$comicpress_options['excerpt_or_content_archive'] = $_REQUEST['excerpt_or_content_archive'];
|
||||
$comicpress_options['excerpt_or_content_search'] = $_REQUEST['excerpt_or_content_search'];
|
||||
$comicpress_options['category_thumbnail_postcount'] = $_REQUEST['category_thumbnail_postcount'];
|
||||
foreach (array(
|
||||
'archive_display_order',
|
||||
'excerpt_or_content_archive',
|
||||
'excerpt_or_content_search',
|
||||
'category_thumbnail_postcount'
|
||||
) as $key) {
|
||||
$comicpress_options[$key] = wp_filter_nohtml_kses($_REQUEST[$key]);
|
||||
}
|
||||
$tab = 'archivesearch';
|
||||
update_option('comicpress_options',$comicpress_options);
|
||||
}
|
||||
|
||||
|
||||
if ($_REQUEST['action'] == 'comicpress_save_menubar') {
|
||||
$comicpress_options['enable_search_in_menubar'] = (bool)($_REQUEST['enable_search_in_menubar'] == 1 ? true : false );
|
||||
$comicpress_options['enable_rss_in_menubar'] = (bool)($_REQUEST['enable_rss_in_menubar'] == 1 ? true : false );
|
||||
$comicpress_options['enable_navigation_in_menubar'] = (bool)($_REQUEST['enable_navigation_in_menubar'] == 1 ? true : false );
|
||||
$comicpress_options['contact_in_menubar'] = (bool)($_REQUEST['contact_in_menubar'] == 1 ? true : false );
|
||||
$comicpress_options['disable_dynamic_menubar_links'] = (bool)($_REQUEST['disable_dynamic_menubar_links'] == 1 ? true : false );
|
||||
$comicpress_options['disable_default_menubar'] = (bool)($_REQUEST['disable_default_menubar'] == 1 ? true : false );
|
||||
$comicpress_options['enable_blogroll_off_links'] = (bool)($_REQUEST['enable_blogroll_off_links'] == 1 ? true : false );
|
||||
foreach (array(
|
||||
'enable_search_in_menubar',
|
||||
'enable_rss_in_menubar',
|
||||
'enable_navigation_in_menubar',
|
||||
'contact_in_menubar',
|
||||
'disable_dynamic_menubar_links',
|
||||
'disable_default_menubar',
|
||||
'enable_blogroll_off_links'
|
||||
) as $key) {
|
||||
$comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
|
||||
}
|
||||
$tab = 'menubar';
|
||||
update_option('comicpress_options',$comicpress_options);
|
||||
}
|
||||
|
||||
|
||||
if ($_REQUEST['action'] == 'comicpress_save_customheader') {
|
||||
$comicpress_options['enable_custom_image_header'] = (bool)($_REQUEST['enable_custom_image_header'] == 1 ? true : false );
|
||||
$comicpress_options['custom_image_header_width'] = wp_filter_nohtml_kses($_REQUEST['custom_image_header_width']);
|
||||
$comicpress_options['custom_image_header_height'] = wp_filter_nohtml_kses($_REQUEST['custom_image_header_height']);
|
||||
foreach (array(
|
||||
'enable_custom_image_header'
|
||||
) 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';
|
||||
update_option('comicpress_options',$comicpress_options);
|
||||
}
|
||||
|
||||
|
||||
if ($_REQUEST['action'] == 'comicpress_save_buyprint') {
|
||||
$comicpress_options['buy_print_email'] = wp_filter_nohtml_kses($_REQUEST['buy_print_email']);
|
||||
$comicpress_options['buy_print_url'] = wp_filter_nohtml_kses($_REQUEST['buy_print_url']);
|
||||
$comicpress_options['buy_print_us_amount'] = wp_filter_nohtml_kses($_REQUEST['buy_print_us_amount']);
|
||||
$comicpress_options['buy_print_int_amount'] = wp_filter_nohtml_kses($_REQUEST['buy_print_int_amount']);
|
||||
$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']);
|
||||
$comicpress_options['buy_print_int_ship'] = wp_filter_nohtml_kses($_REQUEST['buy_print_int_ship']);
|
||||
foreach (array(
|
||||
'buy_print_add_shipping'
|
||||
) as $key) {
|
||||
$comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
|
||||
}
|
||||
foreach (array(
|
||||
'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';
|
||||
update_option('comicpress_options',$comicpress_options);
|
||||
}
|
||||
|
||||
|
||||
if ($_REQUEST['action'] == 'comicpress_save_members') {
|
||||
$comicpress_options['members_post_category'] = wp_filter_nohtml_kses($_REQUEST['members_post_category']);
|
||||
$tab = 'members';
|
||||
|
@ -139,9 +187,9 @@ function comicpress_admin() {
|
|||
?>
|
||||
<div id="message" class="updated fade"><p><strong><?php _e('ComicPress Settings SAVED!','comicpress'); ?></strong></p></div>
|
||||
<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');
|
||||
$comicpress_options = comicpress_load_options();
|
||||
?>
|
||||
|
@ -149,9 +197,9 @@ function comicpress_admin() {
|
|||
<script>function hidemessage() { document.getElementById('message').style.display = 'none'; }</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<div id="poststuff" class="metabox-holder">
|
||||
|
||||
<div id="cpadmin" onclick="hidemessage();">
|
||||
|
@ -165,22 +213,19 @@ 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 == 'members') { ?>on<?php } else { ?>off<?php } ?>" title="membersoptions"><span><?php _e('Members','comicpress'); ?></span></div>
|
||||
</div>
|
||||
<?php include(get_template_directory() . '/options/themestyle.php'); ?>
|
||||
<?php include(get_template_directory() . '/options/generaloptions.php'); ?>
|
||||
<?php include(get_template_directory() . '/options/indexoptions.php'); ?>
|
||||
<?php include(get_template_directory() . '/options/postoptions.php'); ?>
|
||||
<?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'); ?>
|
||||
|
||||
<?php
|
||||
foreach (glob(get_template_directory() . '/options/*.php') as $file) {
|
||||
include($file);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
|
||||
add_action('admin_menu', 'options');
|
||||
|
||||
?>
|
||||
?>
|
|
@ -27,13 +27,15 @@
|
|||
<span class="footer-pipe">|</span>
|
||||
Subscribe: <a href="<?php bloginfo('rss2_url') ?>">RSS</a>
|
||||
</span>
|
||||
<?php if ($comicpress_options['enable_scroll_to_top']) { ?>
|
||||
<span class="footer-uptotop">
|
||||
<span class="footer-pipe">|</span>
|
||||
<a href="#outside" onclick="scrollup(); return false;"><?php _e('Back to Top ↑','comicpress'); ?></a>
|
||||
</span>
|
||||
<br /><?php echo get_num_queries() ?> queries. <?php timer_stop(1) ?> seconds.
|
||||
<?php } ?>
|
||||
</p>
|
||||
<?php } ?>
|
||||
<p><?php echo get_num_queries() ?> queries. <?php timer_stop(1) ?> seconds.</p>
|
||||
</div>
|
||||
|
||||
<?php if (!$comicpress_options['disable_page_restraints']) { ?>
|
||||
|
|
|
@ -44,6 +44,9 @@ function __comicpress_widgets_init() {
|
|||
|
||||
function __comicpress_init() {
|
||||
global $comicpress_options, $__comicpress_handlable_classes;
|
||||
|
||||
$comicpress_options = array();
|
||||
|
||||
// Check if the $comicpress_options exist, if not set defaults
|
||||
$comicpress_options = comicpress_load_options();
|
||||
// xili-language plugin check
|
||||
|
@ -55,7 +58,9 @@ function __comicpress_init() {
|
|||
}
|
||||
|
||||
// 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
|
||||
if (function_exists('id_get_comment_number')) {
|
||||
|
@ -120,10 +125,14 @@ if (!empty($wpmu_version)) {
|
|||
|
||||
function comicpress_load_options() {
|
||||
global $comicpress_options;
|
||||
|
||||
|
||||
$comicpress_options = get_option('comicpress_options');
|
||||
if (empty($comicpress_options)) {
|
||||
$comicpress_options['comicpress_version'] = '2.9.0.7';
|
||||
$comicpress_options['comicpress_version'] = '2.9.0.9';
|
||||
foreach (array(
|
||||
'cp_theme_layout' => 'standard',
|
||||
|
||||
'disable_comic_frontpage' => false,
|
||||
'disable_comic_blog_frontpage' => false,
|
||||
'disable_comic_blog_single' => false,
|
||||
|
@ -196,7 +205,10 @@ function comicpress_load_options() {
|
|||
'enable_comicpress_debug' => true,
|
||||
'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) {
|
||||
$comicpress_options[$field] = $value;
|
||||
|
@ -205,17 +217,28 @@ function comicpress_load_options() {
|
|||
add_option('comicpress_options', $comicpress_options, '', 'yes');
|
||||
// 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);
|
||||
return $comicpress_options;
|
||||
}
|
||||
|
||||
function is_cp_theme_layout($choices) {
|
||||
global $comicpress_options;
|
||||
$comicpress_options = comicpress_load_options();
|
||||
$choices = explode(",", $choices);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,6 +91,8 @@ function comicpress_post_class($classes = '') {
|
|||
global $post;
|
||||
static $post_alt;
|
||||
|
||||
$is_comic = in_comic_category();
|
||||
|
||||
$args = array(
|
||||
'entry_tax' => array( 'category', 'post_tag' )
|
||||
);
|
||||
|
@ -99,9 +101,9 @@ function comicpress_post_class($classes = '') {
|
|||
$classes[] = 'uentry';
|
||||
|
||||
/* if a comic category */
|
||||
if (in_comic_category()) $classes[] = 'post-comic';
|
||||
if ($is_comic) $classes[] = 'post-comic';
|
||||
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. */
|
||||
|
|
|
@ -36,34 +36,34 @@ if ($comicpress_options['enable_custom_image_header']) {
|
|||
|
||||
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?
|
||||
// If so, set display to equal none
|
||||
if ( 'blank' == get_header_textcolor() ) { ?>
|
||||
#header h1, #header .description {
|
||||
display: none;
|
||||
}
|
||||
<?php } else {
|
||||
// Otherwise, set the color to be the user selected one
|
||||
?>
|
||||
#header *
|
||||
{
|
||||
color: #<?php header_textcolor();?>;
|
||||
}
|
||||
}
|
||||
<?php } ?>
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
|
||||
#header h1, #header .description {
|
||||
display: none;
|
||||
}
|
||||
|
||||
<?php } else {
|
||||
// Otherwise, set the color to be the user selected one
|
||||
?>
|
||||
|
||||
#header * {
|
||||
color: #<?php header_textcolor();?>;
|
||||
}
|
||||
<?php } ?>
|
||||
</style>
|
||||
|
||||
<?php }
|
||||
|
||||
if ( function_exists('add_custom_image_header') ) {
|
||||
add_custom_image_header('theme_header_style', 'theme_admin_header_style');
|
||||
}
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
<?php
|
||||
|
||||
function comicpress_display_post_title() {
|
||||
function comicpress_display_post_title($is_comic = false) {
|
||||
global $post, $wp_query;
|
||||
if (is_page()) {
|
||||
$post_title = "<h2 class=\"page-title\">";
|
||||
} else {
|
||||
$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();
|
||||
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";
|
||||
echo apply_filters('comicpress_display_post_title',$post_title);
|
||||
}
|
||||
|
||||
function comicpress_display_post_thumbnail() {
|
||||
function comicpress_display_post_thumbnail($is_comic = false) {
|
||||
global $post;
|
||||
if (function_exists('has_post_thumbnail')) {
|
||||
if (function_exists('has_post_thumbnail') && !$is_comic) {
|
||||
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";
|
||||
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;
|
||||
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_gravatar = "<div class=\"post-author-gravatar\">".$author_get_gravatar."</div>\r\n";
|
||||
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;
|
||||
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";
|
||||
echo apply_filters('comicpress_display_post_calendar',$post_calendar);
|
||||
}
|
||||
|
@ -43,14 +43,14 @@ function comicpress_display_post_calendar() {
|
|||
|
||||
function comicpress_display_post_author() {
|
||||
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);
|
||||
}
|
||||
|
||||
function comicpress_display_post_category() {
|
||||
function comicpress_display_post_category($is_comic = false) {
|
||||
global $post, $wp_query, $comicpress_options;
|
||||
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(' » </li><li>', 'multiple')."</li></ul>\r\n";
|
||||
} else {
|
||||
$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() {
|
||||
global $post;
|
||||
global $post, $wp_query;
|
||||
if ('open' == $post->comment_status && !is_page()) {
|
||||
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"> </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;
|
||||
if (in_comic_category() && $comicpress_options['enable_related_comics']) {
|
||||
if ($is_comic && $comicpress_options['enable_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();
|
||||
}
|
||||
}
|
||||
|
||||
function comicpress_display_blog_navigation() {
|
||||
function comicpress_display_blog_navigation($is_comic = false) {
|
||||
global $post, $wp_query;
|
||||
if (is_single() && !in_comic_category()) { ?>
|
||||
if (is_single() && !$is_comic) { ?>
|
||||
<div class="blognav">
|
||||
<div class="nav-single">
|
||||
<?php previous_post_link('%link',__(' ‹ Previous ','comicpress'), TRUE); ?>
|
||||
|
@ -100,12 +100,13 @@ function comicpress_display_blog_navigation() {
|
|||
<?php }
|
||||
}
|
||||
|
||||
function comicpress_display_comic_navigation() {
|
||||
function comicpress_display_comic_navigation($is_comic = false) {
|
||||
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();
|
||||
$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">
|
||||
<?php if ( get_permalink() != $first_comic ) { ?><div class="nav-first"><a href="<?php echo $first_comic ?>"><?php _e('‹‹ 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', __('‹ 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;
|
||||
if (is_archive() || is_search()) {
|
||||
if (in_comic_category()) { ?>
|
||||
if ($is_comic) { ?>
|
||||
<div class="comicarchiveframe">
|
||||
<a href="<?php the_permalink() ?>"><img src="<?php the_comic_archive() ?>" alt="<?php the_title() ?>" title="Click for full size." /></a>
|
||||
</div>
|
||||
|
@ -140,23 +141,25 @@ function comicpress_display_the_content() {
|
|||
|
||||
|
||||
function comicpress_display_post() {
|
||||
global $post, $wp_query; ?>
|
||||
<?php comicpress_display_blog_navigation(); ?>
|
||||
<?php comicpress_display_comic_navigation(); ?>
|
||||
global $post, $wp_query;
|
||||
$is_comic = 0;
|
||||
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(); ?>>
|
||||
<?php comicpress_display_post_thumbnail(); ?>
|
||||
<?php comicpress_display_post_thumbnail($is_comic); ?>
|
||||
<div class="post-head"></div>
|
||||
<div class="post-content">
|
||||
<div class="post-info">
|
||||
<?php comicpress_display_author_gravatar(); ?>
|
||||
<?php comicpress_display_post_calendar(); ?>
|
||||
<?php comicpress_display_author_gravatar($is_comic); ?>
|
||||
<?php comicpress_display_post_calendar($is_comic); ?>
|
||||
<?php if (function_exists('comicpress_show_mood_in_post')) comicpress_show_mood_in_post(); ?>
|
||||
<div class="post-text">
|
||||
<?php
|
||||
comicpress_display_post_title();
|
||||
comicpress_display_post_title($is_comic);
|
||||
if (!is_page()) {
|
||||
comicpress_display_post_author();
|
||||
comicpress_display_post_category();
|
||||
comicpress_display_post_author($is_comic);
|
||||
comicpress_display_post_category($is_comic);
|
||||
if (function_exists('the_ratings')) { the_ratings(); }
|
||||
if (!is_archive() && !is_search()) { ?>
|
||||
<small><?php edit_post_link(__('Edit Post','comicpress'), ' [ ', ' ] '); ?></small>
|
||||
|
@ -166,7 +169,7 @@ function comicpress_display_post() {
|
|||
</div>
|
||||
<div class="clear"></div>
|
||||
<div class="entry">
|
||||
<?php comicpress_display_the_content(); ?>
|
||||
<?php comicpress_display_the_content($is_comic); ?>
|
||||
<br class="clear-margins" />
|
||||
</div>
|
||||
<?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_comment_link(); ?>
|
||||
<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>'); } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -75,7 +75,7 @@ function comicpress_showmood_edit_post() {
|
|||
$newmood = $newmood[0]; ?>
|
||||
<div style="float:left; margin-top: 10px; text-align: center; width: 68px; overflow: hidden;">
|
||||
<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; ?>
|
||||
</label>
|
||||
<br />
|
||||
|
|
|
@ -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 ¬','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');
|
||||
|
||||
?>
|
||||
|
||||
*/
|
|
@ -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 ¬','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');
|
||||
|
||||
?>*/
|
|
@ -4,9 +4,62 @@
|
|||
* Author: Philip M. Hofer (Frumph)
|
||||
* 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.
|
||||
* TODO Make this togglable via options.
|
||||
* @param string $title The 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');
|
||||
}
|
||||
|
||||
function comicpress_init_rss() {
|
||||
$comicpress_options = comicpress_load_options();
|
||||
if ($comicpress_options['disable_rss_comments_count']) {
|
||||
add_filter('the_title_rss', 'comicpress_the_title_rss');
|
||||
add_action('export_wp', 'comicpress_export_wp');
|
||||
}
|
||||
global $comicpress_options;
|
||||
if ($comicpress_options['enable_comment_count_in_rss']) {
|
||||
add_filter('the_title_rss', 'comicpress_the_title_rss');
|
||||
add_action('export_wp', 'comicpress_export_wp');
|
||||
}
|
||||
|
||||
add_action('init', 'comicpress_init_rss');
|
||||
|
|
|
@ -92,9 +92,15 @@ if ($comicpress_options['enable_numbered_pagination']) {
|
|||
echo '<li class="paginav-extend">'.$pagenavi_options['dotleft_text'].'</li>';
|
||||
}
|
||||
}
|
||||
echo '<li class="paginav-previous">';
|
||||
previous_posts_link($pagenavi_options['prev_text']);
|
||||
echo '</li>';
|
||||
$prev_post_link = get_previous_posts_link( $pagenavi_options['prev_text'] );
|
||||
|
||||
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++) {
|
||||
if($i == $paged) {
|
||||
$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 class="paginav-next">';
|
||||
next_posts_link($pagenavi_options['next_text'], $max_page);
|
||||
echo '</li>';
|
||||
$next_post_link = get_next_posts_link($pagenavi_options['next_text'], $max_page);
|
||||
if (!empty($next_post_link)) {
|
||||
echo "<li class=\"paginav-next\">\r\n";
|
||||
echo $next_post_link ."\r\n";
|
||||
echo "</li>\r\n";
|
||||
}
|
||||
if ($end_page < $max_page) {
|
||||
if(!empty($pagenavi_options['dotright_text'])) {
|
||||
echo '<li class="paginav-extend">'.$pagenavi_options['dotright_text'].'</li>';
|
||||
|
|
36
header.php
36
header.php
|
@ -23,39 +23,37 @@
|
|||
<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') ?>" />
|
||||
<meta name="ComicPress" content="<?php echo $comicpress_options['comicpress_version']; ?>" />
|
||||
|
||||
<!--[if lt IE 7]>
|
||||
<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/ie6submenus.js"></script>
|
||||
<![endif]-->
|
||||
<?php wp_head(); ?>
|
||||
|
||||
<?php wp_head(); ?>
|
||||
|
||||
</head>
|
||||
|
||||
<body <?php if (function_exists('body_class')) { body_class(); } ?>>
|
||||
|
||||
<?php do_action('comicpress-header'); ?>
|
||||
<?php get_sidebar('above'); ?>
|
||||
|
||||
<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')) { ?>
|
||||
<div id="page-wrap"><!-- Wraps outside the site width -->
|
||||
<div id="page"><!-- Defines entire site width - Ends in Footer -->
|
||||
<div id="page-wrap"><!-- Wraps outside the site width -->
|
||||
<div id="page"><!-- Defines entire site width - Ends in Footer -->
|
||||
<?php } else { ?>
|
||||
<div id="page-wide-wrap">
|
||||
<div id="page-wide">
|
||||
<div id="page-wide-wrap"><!-- Wraps outside the site width -->
|
||||
<div id="page-wide"><!-- Defines entire site width - Ends in Footer -->
|
||||
<?php }
|
||||
} ?>
|
||||
|
||||
<?php if (comicpress_check_child_file('partials/headerarea') == false) { ?>
|
||||
<div id="header">
|
||||
<?php if (function_exists('the_project_wonderful_ad')) { ?>
|
||||
<div class="headerpwad">
|
||||
<?php the_project_wonderful_ad('header'); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<h1><a href="<?php bloginfo('wpurl'); ?>"><?php bloginfo('name') ?></a></h1>
|
||||
<div id="header">
|
||||
<?php if (function_exists('the_project_wonderful_ad')) {
|
||||
the_project_wonderful_ad('header');
|
||||
} ?>
|
||||
<h1><a href="<?php bloginfo('wpurl'); ?>"><?php bloginfo('name') ?></a></h1>
|
||||
<div class="description"><?php bloginfo('description') ?></div>
|
||||
<?php get_sidebar('header'); ?>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<?php get_sidebar('header'); ?>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php get_sidebar('menubar'); ?>
|
||||
|
|
|
@ -12,7 +12,9 @@
|
|||
endwhile;
|
||||
}
|
||||
Restore();
|
||||
UnProtect(); ?>
|
||||
UnProtect();
|
||||
wp_reset_query();
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if (function_exists('the_project_wonderful_ad')) {
|
||||
|
@ -49,6 +51,7 @@
|
|||
}
|
||||
Restore();
|
||||
UnProtect();
|
||||
wp_reset_query();
|
||||
} ?>
|
||||
|
||||
<?php get_sidebar('underblog'); ?>
|
||||
|
|
|
@ -14,14 +14,14 @@
|
|||
<div id="pagewrap-left">
|
||||
<?php } ?>
|
||||
|
||||
<?php if (!is_cp_theme_layout('gn,rgn,v3cr')) { ?>
|
||||
<?php if (is_cp_theme_layout('v,v3c')) { ?>
|
||||
<div id="content" class="narrowcolumn">
|
||||
<div class="column">
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
Protect();
|
||||
if (!$comicpress_options['disable_comic_frontpage'] && is_home()) {
|
||||
Protect();
|
||||
$comic_query = 'showposts=1&cat='.get_all_comic_categories_as_cat_string();
|
||||
$posts = query_posts($comic_query);
|
||||
if (have_posts()) {
|
||||
|
@ -30,9 +30,10 @@
|
|||
display_comic_area();
|
||||
endwhile;
|
||||
}
|
||||
Restore();
|
||||
UnProtect();
|
||||
wp_reset_query();
|
||||
}
|
||||
Restore();
|
||||
UnProtect();
|
||||
if (is_single() & in_comic_category()) {
|
||||
display_comic_area();
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<form method="post" id="myForm" name="template" enctype="multipart/form-data">
|
||||
<?php wp_nonce_field('update-options') ?>
|
||||
|
||||
|
||||
<div id="comicpress-options">
|
||||
|
||||
<table class="widefat">
|
||||
|
@ -41,23 +41,23 @@
|
|||
<tr>
|
||||
<th scope="row"><label for="disable_blogheader"><?php _e('Disable blog header','comicpress'); ?></label></th>
|
||||
<td>
|
||||
<input id="disable_blogheader" name="disable_blogheader" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_blogheader']); ?> />
|
||||
<input id="disable_blogheader" name="disable_blogheader" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_blogheader']); ?> />
|
||||
</td>
|
||||
<td>
|
||||
<?php _e('Checkmark this and your site will not display the contents of #blogheader.','comicpress'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="disable_rss_comments_count"><?php _e('Disable RSS comments count','comicpress'); ?></label></th>
|
||||
<tr class="alternate">
|
||||
<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>
|
||||
<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>
|
||||
<?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>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<table class="widefat">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -91,34 +91,34 @@
|
|||
<?php _e('The default comic post navigation is above each comic blog post.','comicpress'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
<?php
|
||||
$current_gnav_directory = $comicpress_options['graphicnav_directory'];
|
||||
if (empty($current_gnav_directory)) $current_gnav_directory = 'default';
|
||||
$dirs_to_search = array_unique(array(get_template_directory(),get_stylesheet_directory()));
|
||||
$gnav_directories = array();
|
||||
foreach ($dirs_to_search as $dir) { $gnav_directories = array_merge($gnav_directories,glob("${dir}/images/nav/*")); }
|
||||
?>
|
||||
?>
|
||||
<tr>
|
||||
<th scope="row" colspan="2"><label for="graphicnav_directory"><?php _e('Graphic Navigation Directory','comicpress'); ?></label>
|
||||
|
||||
<th scope="row" colspan="2"><label for="graphicnav_directory"><?php _e('Graphic Navigation Directory','comicpress'); ?></label>
|
||||
|
||||
<select name="graphicnav_directory" id="graphicnav_directory">
|
||||
<?php
|
||||
foreach ($gnav_directories as $gnav_dirs) {
|
||||
if (is_dir($gnav_dirs)) {
|
||||
if (is_dir($gnav_dirs)) {
|
||||
$gnav_dir_name = basename($gnav_dirs); ?>
|
||||
<option class="level-0" value="<?php echo $gnav_dir_name; ?>" <?php if ($current_gnav_directory == $gnav_dir_name) { ?>selected="selected"<?php } ?>><?php echo $gnav_dir_name; ?></option>
|
||||
<?php }
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
|
||||
</th>
|
||||
<td>
|
||||
<?php _e('Choose a directory to get the graphic navigation styling from. To create your own custom graphic navigation menu buttons just create a directory under <i>images/nav/</i> and place your image files inside of it and create a navstyle.css file to determine the style of your navigation display.','comicpress'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<table class="widefat">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -142,9 +142,9 @@
|
|||
<td>
|
||||
<?php _e('Your home page will not display the default left/right sidebars. Minimalists dream. WARNING: Not recommended for use with Graphic Novel layouts.','comicpress'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<table class="widefat">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -160,8 +160,17 @@
|
|||
<?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>
|
||||
</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 class="widefat">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -187,7 +196,7 @@
|
|||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="comicpress-options-save">
|
||||
|
@ -199,7 +208,8 @@
|
|||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
|
|
@ -20,17 +20,34 @@
|
|||
<th colspan="4"><?php _e('Layout','comicpress'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php global $avail_layouts; ?>
|
||||
<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>
|
||||
<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>
|
||||
<?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>
|
||||
<?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>
|
||||
<?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>
|
||||
<?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>
|
||||
<?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>
|
||||
<?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>
|
||||
<?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>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</th>
|
||||
<td>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php if (comicpress_check_child_file('searchform') == false) { ?>
|
||||
|
||||
<form method="get" id="searchform" action="<?php bloginfo('wpurl'); ?>/">
|
||||
<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;" />
|
||||
|
@ -6,4 +7,5 @@
|
|||
</div>
|
||||
<div class="clear"></div>
|
||||
</form>
|
||||
|
||||
<?php } ?>
|
|
@ -7,7 +7,7 @@ if (!$comicpress_options['disable_lrsidebars_frontpage']) { ?>
|
|||
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Left Sidebar') ) :
|
||||
if (!is_cp_theme_layout('standard,v')) {
|
||||
the_widget('ComicPressCalendarWidget');
|
||||
the_widget('ComicPressArchiveDropdownWidget','mode=monthly_archive');
|
||||
the_widget('ComicPressArchiveDropdownWidget', 'mode=storyline_order');
|
||||
}
|
||||
the_widget('ComicPressLatestComicsWidget');
|
||||
endif;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php global $comicpress_options;
|
||||
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')) { ?>
|
||||
|
|
|
@ -5,18 +5,15 @@ if (!$comicpress_options['disable_lrsidebars_frontpage']) { ?>
|
|||
<div class="sidebar">
|
||||
<?php
|
||||
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Right Sidebar') ) :
|
||||
the_widget('ComicpressBookmarkWidget','mode=three-button');
|
||||
if (is_cp_theme_layout('standard,v')) {
|
||||
the_widget('ComicPressCalendarWidget');
|
||||
the_widget('ComicpressArchiveDropdownWidget','mode=monthly_archive');
|
||||
the_widget('ComicPressArchiveDropdownWidget', 'mode=storyline_order');
|
||||
}
|
||||
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_Categories','hierarchical=1&count=1');
|
||||
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
|
|
11
style.css
11
style.css
|
@ -859,6 +859,16 @@ ul.children {
|
|||
padding: 3px;
|
||||
}
|
||||
|
||||
.sidebar .ComicPressLatestThumbnailWidget h2 {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.sidebar .ComicPressLatestThumbnailWidget {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* WIDGETS */
|
||||
|
||||
.random-comic-icon, .random-post-icon {
|
||||
|
@ -970,6 +980,7 @@ ul.children {
|
|||
/* SEARCH */
|
||||
|
||||
#s-search, #s-transcript {
|
||||
height: 15px;
|
||||
width: 140px;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,20 +13,42 @@ class ComicPressComicBlogPostWidget extends WP_Widget {
|
|||
|
||||
function ComicPressComicBlogPostWidget($skip_widget_init = false) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
function widget($args, $instance) {
|
||||
global $post, $wp_query;
|
||||
if ((is_home() || is_single()) && in_comic_category()) {
|
||||
extract($args, EXTR_SKIP);
|
||||
if (!is_home() && $instance['onlyhome'] || (is_page() || is_archive() || is_search())) return;
|
||||
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)) {
|
||||
echo $before_widget;
|
||||
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
|
||||
if ( !empty( $title ) ) { echo '<div class="heading">'.$title.'</div>'; }
|
||||
echo $post->post_content;
|
||||
if ( !empty( $title ) ) { echo "<div class=\"comic-post-header\">".$title."</div>\r\n"; }
|
||||
the_content();
|
||||
echo $after_widget;
|
||||
}
|
||||
}
|
||||
|
@ -35,15 +57,17 @@ class ComicPressComicBlogPostWidget extends WP_Widget {
|
|||
function update($new_instance, $old_instance) {
|
||||
$instance = $old_instance;
|
||||
$instance['title'] = strip_tags($new_instance['title']);
|
||||
$instance['onlyhome'] = (bool)( $new_instance['onlyhome'] == 1 ? true : false );
|
||||
return $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']);
|
||||
$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('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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ class ComicPressLatestComicsWidget extends WP_Widget {
|
|||
function widget($args, $instance) {
|
||||
global $post;
|
||||
extract($args, EXTR_SKIP);
|
||||
|
||||
Protect();
|
||||
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; };
|
||||
|
@ -30,7 +30,10 @@ class ComicPressLatestComicsWidget extends WP_Widget {
|
|||
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php echo $after_widget;
|
||||
<?php
|
||||
Restore();
|
||||
UnProtect();
|
||||
echo $after_widget;
|
||||
}
|
||||
|
||||
function update($new_instance, $old_instance) {
|
||||
|
|
|
@ -19,43 +19,62 @@ class ComicPressLatestThumbnailWidget extends WP_Widget {
|
|||
}
|
||||
|
||||
function widget($args, $instance) {
|
||||
global $post;
|
||||
if (is_home()) {
|
||||
extract($args, EXTR_SKIP);
|
||||
|
||||
echo $before_widget;
|
||||
$title = empty($instance['title']) ? __('Latest Comic','comicpress') : apply_filters('widget_title', $instance['title']);
|
||||
if ( !empty( $title ) ) { echo $before_title . $title . $after_title; };
|
||||
$latestcomics = get_posts('numberposts=1&category='.get_all_comic_categories_as_cat_string());
|
||||
$archive_image = null;
|
||||
|
||||
foreach($latestcomics as $post) :
|
||||
foreach (array("archive", "rss", "mini", "comic") as $type) {
|
||||
if (($requested_archive_image = get_comic_url($type, $post)) !== false) {
|
||||
$archive_image = $requested_archive_image; break;
|
||||
global $post, $wp_query;
|
||||
if (!is_home() && $instance['onlyhome']) return;
|
||||
|
||||
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; };
|
||||
Protect();
|
||||
$comic_query = 'showposts=1&cat='.get_all_comic_categories_as_cat_string();
|
||||
query_posts($comic_query);
|
||||
$archive_image = null;
|
||||
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;
|
||||
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;
|
||||
}
|
||||
} ?>
|
||||
<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;
|
||||
endwhile;
|
||||
}
|
||||
Restore();
|
||||
UnProtect();
|
||||
wp_reset_query();
|
||||
echo $after_widget;
|
||||
}
|
||||
|
||||
function update($new_instance, $old_instance) {
|
||||
$instance = $old_instance;
|
||||
$instance['title'] = strip_tags($new_instance['title']);
|
||||
$instance['onlyhome'] = (bool)( $new_instance['onlyhome'] == 1 ? true : false );
|
||||
return $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']);
|
||||
$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>
|
||||
<?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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,15 +24,17 @@ class ComicPressMenubarWidget extends WP_Widget {
|
|||
if (file_exists(get_stylesheet_directory() . '/custom-menubar.php')) {
|
||||
include(get_stylesheet_directory() . '/custom-menubar.php');
|
||||
} else { ?>
|
||||
<div id="menubar">
|
||||
|
||||
<div id="menunav">
|
||||
|
||||
<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>
|
||||
<div class="menunav-search">
|
||||
<?php the_widget('WP_Widget_Search',array(),array('before_widget'=>'', 'after_widget'=>'')); ?>
|
||||
</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() && !$comicpress_options['disable_comic_frontpage']) {
|
||||
$comicFrontpage = new WP_Query(); $comicFrontpage->query('showposts=1&cat='.get_all_comic_categories_as_cat_string());
|
||||
|
|
Loading…
Reference in New Issue