function widget($args, $instance) { global $post, $wp_query; Protect(); extract($args, EXTR_SKIP); echo $before_widget; $title = empty($instance['title']) ? __('Latest Comics', 'comicpress') : apply_filters('widget_title', $instance['title']); if (!empty($title)) { echo $before_title . $title . $after_title; } $latestcomics =& get_posts('numberposts=5&category=' . comicpress_all_comic_categories_string()); ?> <ul> <?php foreach ($latestcomics as $post) { ?> <li><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></li> <?php } ?> </ul> <?php echo $after_widget; UnProtect(); }
function comicpress_random_comic() { $randomComicQuery = new WP_Query(); $randomComicQuery->query('showposts=1&orderby=rand&cat=' . comicpress_all_comic_categories_string()); if ($randomComicQuery->have_posts()) { $randomComicQuery->the_post(); $random_comic_id = get_the_ID(); define('DONOTCACHEPAGE', true); wp_redirect(get_permalink($random_comic_id)); } exit; }
"><strong><?php echo $year; ?> </strong></a> | <?php } } ?> </div> <div class="clear"></div> <table class="month-table"> <?php if (comicpress_themeinfo('template-comic-year-all-cats')) { $posts =& query_posts('showposts=-1&year=' . (int) $archive_year); } else { $posts =& query_posts('showposts=-1&cat=' . comicpress_all_comic_categories_string() . '&year=' . (int) $archive_year); } while (have_posts()) { 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();
function comicpress_menubar() { if (file_exists(get_stylesheet_directory() . '/custom-menubar.php')) { include get_stylesheet_directory() . '/custom-menubar.php'; } else { ?> <div id="menubar-wrapper"> <?php do_action('comicpress-menubar-before'); ?> <div class="menunav"> <?php if (comicpress_themeinfo('enable_search_in_menubar')) { ?> <div class="menunav-search"> <?php get_search_form(); ?> </div> <?php } ?> <?php do_action('comicpress-menubar-menunav'); ?> <?php if (comicpress_themeinfo('enable_rss_in_menubar')) { ?> <a href="<?php bloginfo('rss2_url'); ?> " title="RSS Feed" class="menunav-rss">RSS</a> <?php } ?> <?php if (comicpress_themeinfo('enable_navigation_in_menubar')) { ?> <?php if (is_home() && !comicpress_themeinfo('disable_comic_frontpage')) { $comicMenubar = new WP_Query(); $order = 'DESC'; if (comicpress_themeinfo('display_first_comic_on_home')) { $order = 'ASC'; } $comicMenubar->query('showposts=1&order=' . $order . '&cat=' . comicpress_all_comic_categories_string()); while ($comicMenubar->have_posts()) { $comicMenubar->the_post(); global $wp_query; $temp_query = $wp_query->is_single; $wp_query->is_single = true; ?> <div class="menunav-prev"> <?php comicpress_previous_comic_link('%link', '‹'); ?> </div> <?php $wp_query->is_single = $temp_query; $temp_query = null; } } elseif (is_single() && comicpress_in_comic_category()) { ?> <div class="menunav-prev"> <?php comicpress_previous_comic_link('%link', '‹'); ?> </div> <div class="menunav-next"> <?php comicpress_next_comic_link('%link', '›'); ?> </div> <?php } ?> <?php } ?> </div> <?php wp_nav_menu(array('sort_column' => 'menu_order', 'container_class' => 'menu', 'theme_location' => 'menubar')); ?> <?php do_action('comicpress-menubar-after'); ?> <div class="clear"></div> </div> <?php } }
function comicpress_inject_comic_home() { global $wp_query; if (!is_paged() && is_home()) { if (!comicpress_themeinfo('disable_comic_frontpage')) { $order = 'DESC'; $wp_query->in_the_loop = true; $comicFrontpage = new WP_Query(); if (comicpress_themeinfo('display_first_comic_on_home')) { $order = 'ASC'; } $comicFrontpage->query('showposts=1&order=' . $order . '&cat=' . comicpress_all_comic_categories_string()); while ($comicFrontpage->have_posts()) { $comicFrontpage->the_post(); comicpress_display_comic_area(); } } } else { if (is_single() && comicpress_in_comic_category()) { comicpress_display_comic_area(); } } }
function comicpress_exclude_comic_categories() { global $comicpress_exclude_comic_categories; if (empty($comicpress_exclude_comic_categories)) { $comicpress_exclude_comic_categories = '-' . str_replace(",", ",-", comicpress_all_comic_categories_string()); } return $comicpress_exclude_comic_categories; }
function comicpress_classic_menubar() { global $comicpress_options; if (file_exists(get_stylesheet_directory() . '/custom-menubar.php')) { include get_stylesheet_directory() . '/custom-menubar.php'; } else { ?> <div id="menubar"> <div id="menunav"> <?php if (comicpress_themeinfo('enable_search_in_menubar')) { ?> <div class="menunav-search"> <?php get_search_form(); ?> </div> <?php } ?> <?php if (comicpress_themeinfo('enable_rss_in_menubar')) { ?> <a href="<?php bloginfo('rss2_url'); ?> " title="RSS Feed" class="menunav-rss">RSS</a> <?php } ?> <?php if (comicpress_themeinfo('enable_navigation_in_menubar')) { Protect(); ?> <?php if (is_home() && !comicpress_themeinfo('disable_comic_frontpage')) { $comicMenubar = new WP_Query(); $comicMenubar->query('showposts=1&cat=' . comicpress_all_comic_categories_string()); while ($comicMenubar->have_posts()) { $comicMenubar->the_post(); global $wp_query; $temp_query = $wp_query->is_single; $wp_query->is_single = true; ?> <div class="menunav-prev"> <?php comicpress_previous_comic_link('%link', '‹'); ?> </div> <?php $wp_query->is_single = $temp_query; $temp_query = null; } } elseif (is_single() && comicpress_in_comic_category()) { ?> <div class="menunav-prev"> <?php comicpress_previous_comic_link('%link', '‹'); ?> </div> <div class="menunav-next"> <?php comicpress_next_comic_link('%link', '›'); ?> </div> <?php } UnProtect(); ?> <?php } ?> </div> <?php $linkcatid = get_term_by('name', 'menubar', 'link_category'); $linkcatid = $linkcatid->term_id; $menulinks = wp_list_bookmarks('echo=0&title_li=&categorize=0&title_before=&title_after=&category_name=menubar'); $menulinks = str_replace('<li>', '<li class="page-item page-item-link">', $menulinks); $menulinks = str_replace('<ul>', '', $menulinks); $menulinks = str_replace('</ul>', '', $menulinks); if ($comicpress_options['enable_blogroll_off_links']) { $bookmarks = wp_list_bookmarks('echo=0&title_li=&categorize=1&title_before=&title_after=&exclude_category=' . $linkcatid); $bookmarks = str_replace('<li>', '<li class="page-item page-item-link">', $bookmarks); // $bookmarks = str_replace('<ul>', '<ul>', $bookmarks); } $listpages = ''; if (!comicpress_themeinfo('disable_dynamic_menubar_links')) { $listpages = wp_list_pages('echo=0&sort_column=menu_order&depth=4&title_li='); } if (!empty($bookmarks) && comicpress_themeinfo('enable_blogroll_off_links')) { $listpages = str_replace('Links</a></li>', 'Links</a> <ul> ' . $bookmarks . ' </ul> </li> ', $listpages); } $listpages .= $menulinks; ?> <ul id="menu"> <li class="<?php if (is_home()) { ?> current_page_item <?php } ?> page_item page-item-home"><a href="<?php echo home_url(); ?> ">Home</a></li> <?php echo $listpages; ?> <?php if ($comicpress_options['contact_in_menubar']) { ?> <li class="page_item page-item-contact"><a href="mailto:<?php bloginfo('admin_email'); ?> ">Contact</a></li> <?php } ?> </ul> <div class="clear"></div> </div> <?php } }
function comicpress_get_last_comic() { return comicpress_get_terminal_post_in_category(comicpress_all_comic_categories_string(), false); }
$archive_year = get_post_time('Y', false, $latest_comic, true); } if (empty($archive_year)) { $archive_year = date('Y'); } $firstDayMargins = array(); for ($i = 1; $i <= 12; ++$i) { $dateInfo = getdate(mktime(0, 0, 0, $i, 1, $archive_year)); $firstDayMargins[$i] = $dateInfo['wday'] * $cpdayWidth; } $tempPost = $post; $comicArchive = new WP_Query(); if (comicpress_themeinfo('template-comic-year-all-cats')) { $comicArchive->query('showposts=-1&posts_per_page=-1&year=' . $archive_year); } else { $comicArchive->query('showposts=-1&posts_per_page=-1&cat=' . comicpress_all_comic_categories_string() . '&year=' . $archive_year); } while ($comicArchive->have_posts()) { $comicArchive->the_post(); $calTitle = get_the_title(); $calLink = get_permalink(); $calDay = get_the_time('j'); $calMonth = get_the_time('F'); $calComic[$calMonth . $calDay] = array('link' => $calLink, 'title' => $calTitle); } $post = $tempPost; function leapYear($yr) { if ($yr % 4 != 0) { return 28; } else {
/* Template Name: This Month of Comics */ get_header(); //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'); $wp_query->in_the_loop = true; $archiveQuery = new WP_Query(); $archiveQuery->query('show_posts=-1&posts_per_page=-1&cat=' . comicpress_all_comic_categories_string()); ?> <div <?php post_class(); ?> > <?php if (comicpress_themeinfo('enable_caps')) { ?> <div class="post-head"></div><?php } ?> <div class="post-content"> <div class="post-info"> <div class="post-text"> <h2 class="page-title"><?php
<div class="post-head"></div><?php } ?> <div class="post-content"> <div class="post-info"> <div class="post-text"> <h3><?php echo $year; ?> </h3> </div> </div> <table class="month-table"> <?php $comicArchive = new WP_Query(); $comicArchive->query('showposts=10000&cat=' . comicpress_all_comic_categories_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(); ?>
function widget($args, $instance) { global $post, $wp_query; if (!is_home() && $instance['onlyhome']) { return; } if (is_page() || is_archive() || is_search()) { return; } extract($args, EXTR_SKIP); Protect(); if (is_home()) { $comic_query = 'showposts=1&cat=' . comicpress_all_comic_categories_string(); $posts =& query_posts($comic_query); if (have_posts()) { while (have_posts()) { the_post(); if (!(empty($post->post_content) && $instance['hidecontent'])) { 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-widget-header\">" . $title . "</div>\r\n"; } if ($instance['showtitle']) { echo "<h2 class=\"comic-post-widget-title\">" . get_the_title() . "</h2>\r\n"; } if ($instance['showdate']) { echo "<div class=\"comic-post-widget-date\">" . get_the_time('F jS, Y') . "</div>\r\n"; } the_content(); if ($instance['showcommentlink']) { comicpress_display_comment_link(); } $wp_query->is_single = $temp_query; echo $after_widget; } } } wp_reset_query(); } else { setup_postdata($post); if (!(empty($post->post_content) && $instance['hidecontent']) && comicpress_in_comic_category()) { echo $before_widget; $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); if (!empty($title)) { echo "<div class=\"comic-post-widget-header\">" . $title . "</div>\r\n"; } if ($instance['showtitle']) { echo "<h2 class=\"comic-post-widget-title\">" . get_the_title() . "</h2>\r\n"; } if ($instance['showdate']) { echo "<div class=\"comic-post-widget-date\">" . get_the_time('F jS, Y') . "</div>\r\n"; } the_content(); if ($instance['showcommentlink']) { comicpress_display_comment_link(); } echo $after_widget; } } UnProtect(); }
function widget($args, $instance) { global $wp_query, $post; Protect(); $this_permalink = get_permalink(); $temp_query = $wp_query->is_single; $wp_query->is_single = true; if ($instance['previous']) { $prev_comic = comicpress_get_previous_comic_permalink(false); } if ($instance['prev_in'] && comicpress_themeinfo('enable-storyline-support') == 1) { $prev_in_chapter = comicpress_get_previous_comic_permalink(true); } if ($instance['next']) { $next_comic = comicpress_get_next_comic_permalink(false); } if ($instance['next_in'] && comicpress_themeinfo('enable-storyline-support') == 1) { $next_in_chapter = comicpress_get_next_comic_permalink(true); } $wp_query->is_single = $temp_query; $temp_query = null; if ($instance['first']) { $first_comic = comicpress_get_first_comic_permalink(); } if ($instance['last']) { $last_comic = comicpress_get_last_comic_permalink(); } if ($instance['first_in'] && comicpress_themeinfo('enable-storyline-support') == 1) { $first_in_chapter = comicpress_get_terminal_post_of_chapter_permalink(true); } if ($instance['last_in'] && comicpress_themeinfo('enable-storyline-support') == 1) { $last_in_chapter = comicpress_get_terminal_post_of_chapter_permalink(false); } if ($instance['story_prev'] && comicpress_themeinfo('enable-storyline-support') == 1) { $prev_story = comicpress_get_previous_storyline_start_permalink(); } if ($instance['story_next'] && comicpress_themeinfo('enable-storyline-support') == 1) { $next_story = comicpress_get_next_storyline_start_permalink(); } $latest_comic = get_permalink(comicpress_get_terminal_post_in_category(comicpress_all_comic_categories_string(), false)); UnProtect(); ?> <div class="comic_navi_wrapper"> <table class="comic_navi"> <tr> <td class="comic_navi_left"> <?php if ($instance['first']) { 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 { ?> <span class="navi navi-first navi-void"><?php echo $instance['first_title']; ?> </span> <?php } } if ($instance['first_in'] && comicpress_themeinfo('enable-storyline-support') == 1) { if (!empty($first_in_chapter) && $first_in_chapter != $this_permalink) { ?> <a href="<?php echo $first_in_chapter; ?> " class="navi navi-firstinchap" title="<?php echo $instance['first_in_title']; ?> "><?php echo $instance['first_in_title']; ?> </a> <?php } else { ?> <span class="navi navi-firstinchap navi-void"><?php echo $instance['first_in_title']; ?> </span> <?php } } if ($instance['story_prev'] && comicpress_themeinfo('enable-storyline-support') == 1) { 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 { ?> <span class="navi navi-prevchap navi-void"><?php echo $instance['story_prev_title']; ?> </span> <?php } } if ($instance['prev_in'] && comicpress_themeinfo('enable-storyline-support') == 1) { if (!empty($prev_in_chapter)) { ?> <a href="<?php echo $prev_in_chapter; ?> " class="navi navi-prev-in" title="<?php echo $instance['prev_in_title']; ?> "><?php echo $instance['prev_in_title']; ?> </a> <?php } else { ?> <span class="navi navi-prev-in navi-void"><?php echo $instance['prev_in_title']; ?> </span> <?php } } if ($instance['previous']) { 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 { ?> <span class="navi navi-prev navi-void"><?php echo $instance['previous_title']; ?> </span> <?php } } ?> </td> <td class="comic_navi_center"> <?php if ($instance['archives'] && !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']) { ?> <a href="<?php echo home_url(); ?> /?randomcomic&nocache=1" class="navi navi-random" title="<?php echo $instance['random_title']; ?> "><?php echo $instance['random_title']; ?> </a> <?php } if ($instance['comictitle']) { ?> <span class="navi-comictitle"><a href="<?php the_permalink(); ?> ">"<?php the_title(); ?> "</a></span> <?php } if ($instance['comments']) { ?> <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 (comicpress_themeinfo('enable_buy_print') && $instance['buyprint']) { if (strpos(comicpress_themeinfo('buy_print_url'), '?') !== false) { $bpsep = '&'; } else { $bpsep = '?'; } ?> <a href="<?php echo comicpress_themeinfo('buy_print_url'); echo $bpsep; ?> comic=<?php echo $post->ID; ?> " class="navi navi-buyprint" title="<?php echo $instance['buyprint_title']; ?> "><?php echo $instance['buyprint_title']; ?> </a> <?php } if ($instance['sharethis']) { $url = get_permalink($post->ID); $title = $post->post_title; $title = str_replace(' ', '%20', $title); $rss = get_bloginfo('rss2_url'); $blogname = urlencode(get_bloginfo('name') . " " . get_bloginfo('description')); // Grab the excerpt, if there is no excerpt, create one $excerpt = urlencode(strip_tags(strip_shortcodes($post->post_excerpt))); if ($excerpt == "") { $excerpt = urlencode(substr(strip_tags(strip_shortcodes($post->post_content)), 0, 250)); } // Clean the excerpt for use with links $excerpt = str_replace('+', '%20', $excerpt); ?> <script type="text/javascript"> function sharethis() { var sharewin = document.getElementById('navi-share-box'); if ( sharewin.style.display == 'block' ) { sharewin.style.display = 'none'; } else { sharewin.style.display = 'block'; } } </script> <a href="javascript:sharethis()" class="navi" id="navi-share" title="<?php echo $instance['sharethis_title']; ?> "><?php echo $instance['sharethis_title']; ?> </a> <?php } if ($instance['subscribe']) { ?> <a href="<?php bloginfo('rss2_url'); ?> " class="navi navi-subscribe" title="<?php echo $instance['subscribe_title']; ?> "><?php echo $instance['subscribe_title']; ?> </a> <?php } ?> </td> <td class="comic_navi_right"> <?php if ($instance['next']) { if (!empty($next_comic)) { ?> <a href="<?php echo $next_comic; ?> " class="navi navi-next" title="<?php echo $instance['next_title']; ?> "><?php echo $instance['next_title']; ?> </a> <?php } else { ?> <span class="navi navi-next navi-void"><?php echo $instance['next_title']; ?> </span> <?php } } if ($instance['next_in'] && comicpress_themeinfo('enable-storyline-support') == 1) { if (!empty($next_in_chapter)) { ?> <a href="<?php echo $next_in_chapter; ?> " class="navi navi-next-in" title="<?php echo $instance['next_in_title']; ?> "><?php echo $instance['next_in_title']; ?> </a> <?php } else { ?> <span class="navi navi-next-in navi-void"><?php echo $instance['next_in_title']; ?> </span> <?php } } if ($instance['story_next'] && comicpress_themeinfo('enable-storyline-support') == 1) { 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 { ?> <span class="navi navi-nextchap navi-void"><?php echo $instance['story_next_title']; ?> </span> <?php } } if ($instance['last_in'] && comicpress_themeinfo('enable-storyline-support') == 1) { if (!empty($last_in_chapter) && $last_in_chapter != $this_permalink) { ?> <a href="<?php echo $last_in_chapter; ?> " class="navi navi-lastinchap" title="<?php echo $instance['last_in_title']; ?> "><?php echo $instance['last_in_title']; ?> </a> <?php } else { ?> <span class="navi navi-lastinchap navi-void"><?php echo $instance['last_in_title']; ?> </span> <?php } } if ($instance['last']) { if (!empty($last_comic) && $last_comic != $this_permalink) { if (isset($instance['lastgohome']) && $instance['lastgohome']) { ?> <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 { ?> <span class="navi navi-last navi-void"><?php echo $instance['last_title']; ?> </span> <?php } } ?> </td> </tr> </table> <?php if ($instance['sharethis']) { ?> <div id="navi-share-box"> <a href="http://reddit.com/submit?url=<?php echo $url; ?> &title=<?php echo comicpress_clean_url($title); ?> " title="Reddit">Reddit</a> <a href="http://digg.com/submit?phase=2&url=<?php echo $url; ?> &title=<?php echo $title; ?> " title="Digg">Digg</a> <a href="http://www.facebook.com/share.php?u=<?php echo $url; ?> " title="Facebook">Facebook</a> <a href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&u=<?php echo $url; ?> &t=<?php echo $title; ?> &c=" title="MySpace">MySpace</a> <a href="http://del.icio.us/post?url=<?php echo $url; ?> " title="Delicious">Delicious</a> <a href="http://www.stumbleupon.com/submit?url=<?php echo $url; ?> &title=<?php echo $title; ?> " title="Stumbleupon">Stumbleupon</a> <a href="http://buzz.yahoo.com/submit/?submitUrl=<?php echo $url; ?> &submitHeadline=<?php echo $title; ?> " title="Buzz Up!">Buzz Up!</a> <a href="http://www.mixx.com/submit?page_url=<?php echo $url; ?> " title="Mixx">Mixx</a> <a href="http://www.technorati.com/faves?add=<?php echo $url; ?> " title="Technorati">Technorati</a> <a href="http://www.google.com/bookmarks/mark?op=edit&bkmk=<?php echo $url; ?> &title=<?php echo $title; ?> " title="Google Bookmarks">Google Bookmarks</a> <a href="http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&u=<?php echo $url; ?> &t=<?php echo $title; ?> " title="Yahoo Bookmarks">Yahoo Bookmarks</a> <a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=<?php echo $url; ?> &t=<?php echo $title; ?> " title="Yahoo MyWeb">Yahoo MyWeb</a> <a href="https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url=<?php echo $url; ?> &title=<?php echo $title; ?> " title="Windows Live">Windows Live</a> <a href="http://www.propeller.com/submit/?U=<?php echo $url; ?> &T=<?php echo $title; ?> " title="Propeller">Propeller</a> <a href="http://friendfeed.com/share?url=<?php echo $url; ?> &title=<?php echo $title; ?> " title="FriendFeed">FriendFeed</a> <a href="http://www.newsvine.com/_tools/seed&save?popoff=0&u=<?php echo $url; ?> &h=<?php echo $title; ?> " title="Newsvine">Newsvine</a> <a href="http://www.xanga.com/private/editorx.aspx?t=<?php echo $title; ?> &u=<?php echo $url; ?> &s=" title="Xanga">Xanga</a> <a href="http://www.linkedin.com/shareArticle?mini=true&url=<?php echo $url; ?> &title=<?php echo $title; ?> &summary=<?php echo $excerpt; ?> &source=" title="LinkedIn">LinkedIn</a> <a href="http://blinklist.com/index.php?Action=Blink/addblink.php&Url=<?php echo $url; ?> &Title=<?php echo $title; ?> " title="Blinklist">Blinklist</a> <a href="http://twitter.com/intent/tweet?original_referer=<?php echo $url; ?> &source=tweetbutton&text=<?php echo $title; ?> &url=<?php echo $url; ?> " title="Twitter">Twitter</a> </div> <?php } ?> </div> <?php // } }
function widget($args, $instance) { global $wp_query, $post; Protect(); 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; } ?> <div class="archive-dropdown-wrap"> <select name="archive-dropdown" class="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> <option value=""><?php echo esc_attr(__('Archives...', 'comicpress')); ?> </option> <?php switch ($instance['mode']) { case "monthly": wp_get_archives('type=monthly&format=option&show_post_count=-1'); break; case "yearly": wp_get_archives('type=yearly&format=option&show_post_count=-1'); break; case "allposts": wp_get_archives('type=postbypost&format=option&show_post_count=-1'); break; case "blogposts": $comicArchive = new WP_Query(); $comicArchive->query('showposts=-1&cat=-' . comicpress_exclude_comic_categories()); while ($comicArchive->have_posts()) { $comicArchive->the_post(); ?> <option value="<?php echo get_permalink($post->ID); ?> "><?php the_title(); ?> </option> <?php } break; case "comicposts": $comicArchive = new WP_Query(); $comicArchive->query('showposts=-1&cat=' . comicpress_all_comic_categories_string()); while ($comicArchive->have_posts()) { $comicArchive->the_post(); ?> <option value="<?php echo get_permalink($post->ID); ?> "><?php the_title(); ?> </option> <?php } break; case "currentcat": $currentcat = get_the_category($post->ID); $currentcat = $currentcat[0]->cat_ID; $comicArchive = new WP_Query(); $comicArchive->query('showposts=-1&cat=' . $currentcat); while ($comicArchive->have_posts()) { $comicArchive->the_post(); ?> <option value="<?php echo get_permalink($post->ID); ?> "><?php the_title(); ?> </option> <?php } break; case "allcats": $args = array('hide_empty' => 1, 'orderby' => 'group'); $categories = get_categories($args); foreach ($categories as $cat) { if ($cat->category_count > 0) { $option = '<option value="' . get_category_link($cat->term_id) . '">'; $option .= $cat->cat_name; $option .= ' (' . $cat->category_count . ')'; $option .= '</option>'; echo $option; } } break; case "blogcats": $args = array('hide_empty' => 1, 'orderby' => 'group', 'order' => 'ASC', 'exclude' => comicpress_all_comic_categories_string()); $categories = get_categories($args); foreach ($categories as $cat) { if ($cat->category_count > 0) { $option = '<option value="' . get_category_link($cat->term_id) . '">'; $option .= $cat->cat_name; $option .= ' (' . $cat->category_count . ')'; $option .= '</option>'; echo $option; } } break; case "storylines": if (($result = comicpress_themeinfo('storyline-category-order')) !== false) { $comicpress_storyline_dropdown_archive = wp_cache_get('comicpress', 'archivedropdown'); if (empty($comicpress_storyline_dropdown_archive)) { $categories_by_id = comicpress_get_comic_category_objects_by_id(); $current_depth = 0; $comicpress_storyline_dropdown_archive = ''; foreach (explode(",", $result) as $node) { $parts = explode("/", $node); $target_depth = count($parts) - 1; $category_id = end($parts); $category = $categories_by_id[$category_id]; $description = $category->description; $first_comic_in_category = comicpress_get_terminal_post_in_category($category_id); $first_comic_permalink = get_permalink($first_comic_in_category->ID); $padding = str_repeat(" ", $target_depth - 1); $option = '<option value="' . get_category_link($category_id) . '">'; $option .= $padding . $category->name; if ($category->count > 0) { $option .= ' (' . $category->count . ')'; } $option .= '</option>' . "\r\n"; $comicpress_storyline_dropdown_archive .= $option; $current_depth = $target_depth; } wp_cache_set('comicpress', $comicpress_storyline_dropdown_archive, 'archivedropdown', 7200); } echo $comicpress_storyline_dropdown_archive; } break; case "comiccats": default: $args = array('hierarchical ' => 1, 'orderby' => 'group', 'include' => comicpress_all_comic_categories_string()); $categories = get_categories($args); foreach ($categories as $cat) { if ($cat->category_count > 0) { $option = '<option value="' . get_category_link($cat->term_id) . '">'; $option .= $cat->cat_name; $option .= ' (' . $cat->category_count . ')'; $option .= '</option>'; echo $option; } } break; } ?> </select> </div> <?php echo $after_widget; UnProtect(); }
<?php get_header(); if (!comicpress_themeinfo('disable_comic_frontpage') && !comicpress_themeinfo('disable_comic_blog_frontpage') && !is_paged()) { $wp_query->in_the_loop = true; $comicFrontpage = new WP_Query(); $order = 'DESC'; if (comicpress_themeinfo('display_first_comic_on_home')) { $order = 'ASC'; } $comicFrontpage->query('showposts=1&order=' . $order . '&cat=' . comicpress_all_comic_categories_string()); while ($comicFrontpage->have_posts()) { $comicFrontpage->the_post(); comicpress_display_post(); if (comicpress_themeinfo('disable_blog_frontpage') && comicpress_themeinfo('display_comments_on_home')) { $withcomments = 1; comments_template('', true); } } } if (is_active_sidebar('blog')) { get_sidebar('blog'); } if (!comicpress_themeinfo('disable_blogheader')) { ?> <div id="blogheader"><?php echo comicpress_themeinfo('blogheader_text'); ?> </div> <?php }