コード例 #1
0
 function widget($args, $instance)
 {
     global $post;
     extract($args, EXTR_SKIP);
     echo $before_widget;
     $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
     if (!empty($title)) {
         echo $before_title . $title . $after_title;
     }
     if (!isset($instance['hide'])) {
         $instance['hide'] = 1;
     }
     ceo_comic_archive_jump_to_chapter($instance['hide'], $instance['exclude'], $instance['showcount'], $instance['jumptoarchive'], true, $instance['render_as_list']);
     echo $after_widget;
 }
コード例 #2
0
function ceo_display_comic_navigation()
{
    global $post, $wp_query;
    if (ceo_pluginfo('navigate_only_chapters')) {
        $first_comic = ceo_get_first_comic_in_chapter_permalink();
        $last_comic = ceo_get_last_comic_in_chapter_permalink();
        $next_comic = ceo_get_next_comic_in_chapter_permalink();
        $prev_comic = ceo_get_previous_comic_in_chapter_permalink();
    } else {
        $first_comic = ceo_get_first_comic_permalink();
        $last_comic = ceo_get_last_comic_permalink();
        $next_comic = ceo_get_next_comic_permalink();
        $prev_comic = ceo_get_previous_comic_permalink();
    }
    $first_text = __('‹‹ First', 'comiceasel');
    $last_text = __('Last ››', 'comiceasel');
    $next_text = __('Next ›', 'comiceasel');
    $prev_text = __('‹ Prev', 'comiceasel');
    ?>
	<table id="comic-nav-wrapper">
		<tr class="comic-nav-container">
			<td class="comic-nav"><?php 
    if (get_permalink() != $first_comic) {
        ?>
<a href="<?php 
        echo $first_comic;
        ?>
" class="comic-nav-base comic-nav-first<?php 
        if (get_permalink() == $first_comic) {
            ?>
 comic-nav-inactive<?php 
        }
        ?>
"><?php 
        echo $first_text;
        ?>
</a><?php 
    } else {
        echo '<span class="comic-nav-base comic-nav-first comic-nav-void">' . $first_text . '</span>';
    }
    ?>
</td>
			<td class="comic-nav"><?php 
    if ($prev_comic) {
        ?>
<a href="<?php 
        echo $prev_comic;
        ?>
" class="comic-nav-base comic-nav-previous<?php 
        if (!$prev_comic) {
            ?>
 comic-nav-inactive<?php 
        }
        ?>
"><?php 
        echo $prev_text;
        ?>
</a><?php 
    } else {
        echo '<span class="comic-nav-base comic-nav-previous comic-nav-void ">' . $prev_text . '</span>';
    }
    ?>
</td>
<?php 
    if (ceo_pluginfo('enable_buy_comic') && !wp_is_mobile()) {
        if (strpos(ceo_pluginfo('buy_comic_url'), '?') !== false) {
            $bpsep = '&';
        } else {
            $bpsep = '?';
        }
        ?>
		<td class="comic-nav"><a href="<?php 
        echo ceo_pluginfo('buy_comic_url') . $bpsep . 'id=' . $post->ID;
        ?>
" class="comic-nav-base comic-nav-buycomic" title="Buy Comic"><?php 
        _e('Buy!', 'comiceasel');
        ?>
</a></td>
<?php 
    }
    if (ceo_pluginfo('enable_comment_nav') && !wp_is_mobile()) {
        $commentscount = get_comments_number();
        ?>
			<td class="comic-nav"><a href="<?php 
        comments_link();
        ?>
" class="comic-nav-comments" title="<?php 
        the_title();
        ?>
"><span class="comic-nav-comment-count"><?php 
        echo sprintf(_n('Comment(%d)', 'Comments(%d)', $commentscount, 'comiceasel'), $commentscount);
        ?>
</span></a></td>
<?php 
    }
    if (ceo_pluginfo('enable_random_nav') && !wp_is_mobile()) {
        $stay = '';
        if (ceo_pluginfo('enable_chapter_only_random')) {
            $chapter = get_the_terms($post->ID, 'chapters');
            if (!empty($chapter) && !is_wp_error($chapter)) {
                $stay = '&stay=' . reset($chapter)->term_id;
            }
        }
        ?>
			<td class="comic-nav"><a href="<?php 
        bloginfo('url');
        ?>
?random&nocache=1<?php 
        echo $stay;
        ?>
" class="comic-nav-random" title="Random Comic"><?php 
        _e('Random', 'comiceasel');
        ?>
</a></td>
<?php 
    }
    ?>
	<td class="comic-nav"><?php 
    if ($next_comic) {
        ?>
<a href="<?php 
        echo $next_comic;
        ?>
" class="comic-nav-base comic-nav-next<?php 
        if (!$next_comic) {
            ?>
 comic-nav-inactive<?php 
        }
        ?>
"><?php 
        echo $next_text;
        ?>
</a><?php 
    } else {
        echo '<span class="comic-nav-base comic-nav-next comic-nav-void ">' . $next_text . '</span>';
    }
    ?>
</td>
	<td class="comic-nav"><?php 
    if (get_permalink() != $last_comic) {
        ?>
<a href="<?php 
        echo $last_comic;
        ?>
" class="comic-nav-base comic-nav-last<?php 
        if (get_permalink() == $last_comic) {
            ?>
 comic-nav-inactive<?php 
        }
        ?>
"><?php 
        echo $last_text;
        ?>
</a><?php 
    } else {
        echo '<span class="comic-nav-base comic-nav-last comic-nav-void ">' . $last_text . '</span>';
    }
    ?>
</td>
<?php 
    if (ceo_pluginfo('enable_chapter_nav')) {
        ?>
				
			<td class="comic-nav comic-nav-jumpto"><?php 
        ceo_comic_archive_jump_to_chapter(true, '', false, ceo_pluginfo('default_nav_bar_chapter_goes_to_archive'));
        ?>
</td>
<?php 
    }
    if (ceo_pluginfo('enable_comic_nav')) {
        ?>
				
			<td class="comic-nav comic-nav-jumptocomic"><?php 
        ceo_list_jump_to_comic();
        ?>
</td>
<?php 
    }
    ?>
		</tr>
<?php 
    if (ceo_pluginfo('enable_embed_nav') && !wp_is_mobile()) {
        ?>
		<tr>
			<td class="comic-nav" colspan="15">
				<?php 
        $post_image_id = get_post_thumbnail_id($post->ID);
        $thumbnail = wp_get_attachment_image_src($post_image_id, 'full', false);
        if (is_array($thumbnail)) {
            $thumbnail = reset($thumbnail);
            echo $thumbnail;
        }
        ?>
			</td>
		</tr>
<?php 
    }
    ?>
 
	</table>
	<?php 
}
コード例 #3
0
ファイル: shortcodes.php プロジェクト: hmharvey/comic-easel
function ceo_comic_archive_dropdown($atts, $content = '')
{
    extract(shortcode_atts(array('unhide' => false, 'exclude' => '', 'showcount' => false, 'jumptoarchive' => false, 'return' => true), $atts));
    return ceo_comic_archive_jump_to_chapter($unhide, $exclude, $showcount, $jumptoarchive, $return);
}
コード例 #4
0
 function widget($args, $instance)
 {
     global $post;
     extract($args, EXTR_SKIP);
     echo $before_widget;
     $title = empty($instance['title']) ? __('Comic Chapters', 'comiceasel') : apply_filters('widget_title', $instance['title']);
     if (!empty($title)) {
         echo $before_title . $title . $after_title;
     }
     ceo_comic_archive_jump_to_chapter($instance['unhide'], $instance['exclude'], $instance['showcount'], $instance['jumptoarchive']);
     echo $after_widget;
 }