echo add_query_arg('archive_year', $year);
        ?>
"><strong><?php 
        echo $year;
        ?>
</strong></a> |
			<?php 
    }
}
?>
		</div>

		<table class="month-table">
			<?php 
$comicArchive = new WP_Query();
$comicArchive->query('&showposts=-1&cat=' . get_all_comic_categories_as_cat_string() . '&year=' . $archive_year);
while ($comicArchive->have_posts()) {
    $comicArchive->the_post();
    ?>
				<tr><td class="archive-date"><?php 
    the_time('M j');
    ?>
</td><td class="archive-title"><a href="<?php 
    echo get_permalink($post->ID);
    ?>
" rel="bookmark" title="<?php 
    _e('Permanent Link:', 'comicpress');
    ?>
 <?php 
    the_title();
    ?>
Ejemplo n.º 2
0
function widget_comicpress_latest_comics()
{
    ?>
	<li>
		<h2>Latest Comics</h2>
		<ul>	
			 <?php 
    global $post;
    $latestcomics = get_posts('numberposts=5&category=' . get_all_comic_categories_as_cat_string());
    foreach ($latestcomics as $post) {
        ?>
				<li><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></li>
			<?php 
    }
    ?>
     	</ul>
	</li>
	<?php 
}
    function widget($args, $instance)
    {
        global $wp_query, $post;
        //		if (is_home() || is_single()) {
        $this_permalink = get_permalink();
        $temp_query = $wp_query->is_single;
        $wp_query->is_single = true;
        $prev_comic = get_previous_comic_permalink();
        $next_comic = get_next_comic_permalink();
        $wp_query->is_single = $temp_query;
        $temp_query = null;
        $first_comic = get_first_comic_permalink();
        $last_comic = get_last_comic_permalink();
        $prev_story = get_previous_storyline_start_permalink();
        $next_story = get_next_storyline_start_permalink();
        $latest_comic = get_permalink(get_terminal_post_in_category(get_all_comic_categories_as_cat_string(), false));
        ?>
<div id="comic_navi_wrapper">
	<div class="comic_navi">
		<span class="comic_navi_left">
			<?php 
        if ($instance['first'] == 'on') {
            if (!empty($first_comic) && $first_comic != $this_permalink) {
                ?>
					<a href="<?php 
                echo $first_comic;
                ?>
" class="navi navi-first" title="<?php 
                echo $instance['first_title'];
                ?>
"><?php 
                echo $instance['first_title'];
                ?>
</a>
				<?php 
            } else {
                ?>
					<div class="navi navi-first navi-void"><?php 
                echo $instance['first_title'];
                ?>
</div>
				<?php 
            }
        }
        if ($instance['story_prev'] == 'on') {
            if (!empty($prev_story)) {
                ?>
					<a href="<?php 
                echo $prev_story;
                ?>
" class="navi navi-prevchap" title="<?php 
                echo $instance['story_prev_title'];
                ?>
"><?php 
                echo $instance['story_prev_title'];
                ?>
</a>
				<?php 
            } else {
                ?>
					<div class="navi navi-prevchap navi-void"><?php 
                echo $instance['story_prev_title'];
                ?>
</div>
				<?php 
            }
        }
        if ($instance['previous'] == 'on') {
            if (!empty($prev_comic)) {
                ?>
					<a href="<?php 
                echo $prev_comic;
                ?>
" class="navi navi-prev" title="<?php 
                echo $instance['previous_title'];
                ?>
"><?php 
                echo $instance['previous_title'];
                ?>
</a>
				<?php 
            } else {
                ?>
					<div class="navi navi-prev navi-void"><?php 
                echo $instance['previous_title'];
                ?>
</div>
				<?php 
            }
        }
        ?>
		</span>
		<span class="comic_navi_center">
		<?php 
        if ($instance['archives'] == 'on' && !empty($instance['archive_path'])) {
            ?>
				<a href="<?php 
            echo $instance['archive_path'];
            ?>
" class="navi navi-archives navi-archive" title="<?php 
            echo $instance['archives_title'];
            ?>
"><?php 
            echo $instance['archives_title'];
            ?>
</a>
			<?php 
        }
        if ($instance['random'] == 'on') {
            ?>
				<a href="<?php 
            echo bloginfo('url');
            ?>
/?randomcomic" class="navi navi-random" title="<?php 
            echo $instance['random_title'];
            ?>
"><?php 
            echo $instance['random_title'];
            ?>
</a>
			<?php 
        }
        if ($instance['comictitle'] == 'on') {
            ?>
				<span class="navi-comictitle"><a href="<?php 
            the_permalink();
            ?>
">"<?php 
            the_title();
            ?>
"</a></span>
			<?php 
        }
        if ($instance['comments'] == 'on') {
            ?>
				<a href="<?php 
            the_permalink();
            ?>
#comment" class="navi navi-comments" title="<?php 
            echo $instance['comments_title'];
            ?>
"><span class="navi-comments-count"><?php 
            comments_number('0', '1', '%');
            ?>
</span><?php 
            echo $instance['comments_title'];
            ?>
</a>
			<?php 
        }
        if ($instance['buyprint'] == 'on') {
            ?>
	
				<form method="post" title="<?php 
            echo $instance['buyprint_title'];
            ?>
" action="<?php 
            global $buy_print_url;
            echo $buy_print_url;
            ?>
" class="navi-buyprint-form"> 
				<input type="hidden" name="comic" value="<?php 
            echo get_the_ID();
            ?>
" /> 
				<button class="navi navi-buyprint" type="submit" value="buyprint"><?php 
            echo $instance['buyprint_title'];
            ?>
</button> 
				</form> 
			<?php 
        }
        ?>
		</span>
		<span class="comic_navi_right">
			<?php 
        if ($instance['next'] == 'on') {
            if (!empty($next_comic)) {
                if ($next_comic == $latest_comic && $instance['lastgohome'] == 'on') {
                    ?>
						<a href="/" class="navi navi-next" title="<?php 
                    echo $instance['next_title'];
                    ?>
"><?php 
                    echo $instance['next_title'];
                    ?>
</a>
					<?php 
                } else {
                    ?>
						<a href="<?php 
                    echo $next_comic;
                    ?>
" class="navi navi-next" title="<?php 
                    echo $instance['next_title'];
                    ?>
"><?php 
                    echo $instance['next_title'];
                    ?>
</a>					
					<?php 
                }
                ?>
				<?php 
            } else {
                ?>
					<div class="navi navi-next navi-void"><?php 
                echo $instance['next_title'];
                ?>
</div>
				<?php 
            }
        }
        if ($instance['story_next'] == 'on') {
            if (!empty($next_story) && !is_home()) {
                ?>
					<a href="<?php 
                echo $next_story;
                ?>
" class="navi navi-nextchap" title="<?php 
                echo $instance['story_next_title'];
                ?>
"><?php 
                echo $instance['story_next_title'];
                ?>
</a>
				<?php 
            } else {
                ?>
					<div class="navi navi-nextchap navi-void"><?php 
                echo $instance['story_next_title'];
                ?>
</div>
				<?php 
            }
        }
        if ($instance['last'] == 'on') {
            if (!empty($last_comic) && $last_comic != $this_permalink) {
                if ($instance['lastgohome'] == 'on') {
                    ?>
						<a href="/" class="navi navi-last" title="<?php 
                    echo $instance['last_title'];
                    ?>
"><?php 
                    echo $instance['last_title'];
                    ?>
</a>
					<?php 
                } else {
                    ?>
						<a href="<?php 
                    echo $last_comic;
                    ?>
" class="navi navi-last" title="<?php 
                    echo $instance['last_title'];
                    ?>
"><?php 
                    echo $instance['last_title'];
                    ?>
</a>						
					<?php 
                }
                ?>
				<?php 
            } else {
                ?>
					<div class="navi navi-last navi-void"><?php 
                echo $instance['last_title'];
                ?>
</div>
				<?php 
            }
        }
        ?>
		</span>
	</div>
</div>
			
		<?php 
        // }
    }
Ejemplo n.º 4
0
	<?php 
    if (is_cp_theme_layout('v,v3c')) {
        ?>
		<div id="content" class="narrowcolumn">
			<?php 
        get_sidebar('overblog');
        ?>
	<?php 
    }
    ?>

<?php 
    if (is_home()) {
        if (!$comicpress_options['disable_comic_frontpage']) {
            Protect();
            $comic_query = 'showposts=1&cat=' . get_all_comic_categories_as_cat_string();
            query_posts($comic_query);
            if (have_posts()) {
                while (have_posts()) {
                    the_post();
                    $temp_single = $wp_query->is_single;
                    $wp_query->is_single = true;
                    comicpress_display_comic_area();
                    $wp_query->is_single = $temp_single;
                    $temp_single = null;
                }
            }
            Restore();
            UnProtect();
            wp_reset_query();
        }
Ejemplo n.º 5
0
    if ($year != 0) {
        ?>
<div <?php 
        post_class();
        ?>
>
	<div class="post-head"></div>
	<div class="post-content">
			<h3><?php 
        echo $year;
        ?>
</h3>
			<table class="month-table">
		<?php 
        $comicArchive = new WP_Query();
        $comicArchive->query('showposts=10000&cat=' . get_all_comic_categories_as_cat_string() . '&year=' . $year);
        while ($comicArchive->have_posts()) {
            $comicArchive->the_post();
            ?>
					<tr><td class="archive-date"><?php 
            the_time('M j');
            ?>
</td><td class="archive-title"><a href="<?php 
            echo get_permalink($post->ID);
            ?>
" rel="bookmark" title="<?php 
            _e('Permanent Link:', 'comicpress');
            ?>
 <?php 
            the_title();
            ?>
Ejemplo n.º 6
0
function random_comic()
{
    $randomComicQuery = new WP_Query();
    $randomComicQuery->query('showposts=1&orderby=rand&cat=' . get_all_comic_categories_as_cat_string());
    while ($randomComicQuery->have_posts()) {
        $randomComicQuery->the_post();
        $random_comic_id = get_the_ID();
    }
    wp_redirect(get_permalink($random_comic_id));
    exit;
}
if (have_posts()) {
    while (have_posts()) {
        the_post();
        comicpress_display_post();
    }
}
//based on Austin Matzko's code from wp-hackers email list
function filter_where($where = '')
{
    //posts in the last 30 days
    $where .= " AND post_date > '" . date('Y-m-d', strtotime('-30 days')) . "'";
    //    $where .= " AND post_date >= '2009-03-01' AND post_date < '2009-03-16'";
    return $where;
}
add_filter('posts_where', 'filter_where');
$posts = query_posts('&show_posts=-1&posts_per_page=-1&cat=' . get_all_comic_categories_as_cat_string());
?>
<div <?php 
post_class();
?>
>
	<div class="post-head"></div>
	<div class="post-content">
<?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>

				<div class="comicthumbwrap">
					<div class="comicarchiveframe">