function widget($args, $instance) { global $post, $wp_query; Protect(); extract($args, EXTR_SKIP); $post_query = 'showposts=1&cat=' . $instance['thecat']; $posts =& query_posts($post_query); if (have_posts()) { while (have_posts()) { the_post(); echo $before_widget; $title = empty($instance['title']) ? 'Latest Excerpt' : apply_filters('widget_title', $instance['title']); if (!empty($title)) { echo $before_title . $title . $after_title; } ?> <ul> <li><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></li> <li><?php the_excerpt(); ?> </li> </ul> <?php echo $after_widget; } } UnProtect(); }
function widget($args, $instance) { Protect(); extract($args, EXTR_SKIP); echo $before_widget; $title = empty($instance['title']) ? __('Scheduled Posts', 'comicpress') : apply_filters('widget_title', $instance['title']); if (!empty($title)) { echo $before_title . $title . $after_title; } $scheduled_posts = get_posts('post_status=future&numberposts=-1'); if (empty($scheduled_posts)) { echo '<ul><li>None.</li></ul>'; } else { ?> <ul> <?php foreach ($scheduled_posts as $post) { ?> <li><span class="scheduled-post-date"><?php echo date('m/d/Y', strtotime($post->post_date)); ?> </span> <span class="scheduled-post-title"><?php echo $post->post_title; ?> </span></li> <?php } ?> </ul> <?php } echo $after_widget; UnProtect(); }
function widget($args, $instance) { global $post; Protect(); extract($args, EXTR_SKIP); echo $before_widget; $title = empty($instance['title']) ? __('Hosted Site List', 'comicpress') : apply_filters('widget_title', $instance['title']); if (!empty($title)) { echo $before_title . $title . $after_title; } $blogs = get_last_updated(); if (is_array($blogs)) { ?> <ul> <?php foreach ($blogs as $details) { ?> <li><a href="http://<?php echo $details['domain'] . $details['path']; ?> "><?php echo get_blog_option($details['blog_id'], 'blogname'); ?> </a></li> <?php } ?> </ul> <?php } echo $after_widget; UnProtect(); }
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 widget($args, $instance) { global $wp_query, $post; Protect(); extract($args, EXTR_SKIP); $this_post_id = $post->ID; // Check if the category is a comic category. $in_comic_cat = false; if (comicpress_in_comic_category(array($instance['thumbcat'])) > 0) { $in_comic_cat = true; } if ($instance['first']) { $order = 'ASC'; } else { $order = 'DESC'; } $comic_query = 'showposts=1&order=' . $order . '&cat=' . $instance['thumbcat']; if ($instance['random']) { $comic_query .= '&orderby=rand'; } if (!empty($post) && $instance['random']) { $comic_query .= '&exclude=' . $post->ID; } $found_posts =& get_posts($comic_query); $archive_image = null; foreach ($found_posts as $post) { setup_postdata($post); $temp_query = $wp_query->is_single; $wp_query->is_single = true; if ($in_comic_cat) { echo $before_widget; $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); if (!empty($title)) { echo $before_title . $title . $after_title; } echo "<a href=\"" . get_permalink($post->ID) . "\" title=\"" . $post->post_title . "\">" . comicpress_display_comic_thumbnail('mini', $post, true, 0, false) . "</a>\r\n"; echo $after_widget; } else { if (function_exists('has_post_thumbnail')) { if (has_post_thumbnail($post->ID)) { echo $before_widget; $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); if (!empty($title)) { echo $before_title . $title . $after_title; } echo "<a href=\"" . get_permalink($post->ID) . "\" rel=\"bookmark\" title=\"Permanent Link to " . get_the_title() . "\">" . get_the_post_thumbnail($post->ID, 'medium') . "</a>\r\n"; echo $after_widget; } } } $wp_query->is_single = $temp_query; $temp_query = null; } UnProtect(); }
function comicpress_dual_columns($whereclause = false) { global $wp_query; ?> <div id="dualcolumns"> <div class="column_one"> <div class="column_one_header"></div> <?php Protect(); $wp_query->in_the_loop = true; $blog_query = new WP_Query(); if ($whereclause) { add_filter('posts_where', 'comicpress_dual_filter_where'); } $blog_query->query('showposts=' . comicpress_themeinfo('blog_postcount') . '&cat=' . comicpress_exclude_comic_categories() . '&author=' . comicpress_themeinfo('author_column_one') . '&paged=' . $paged); if (have_posts()) { while ($blog_query->have_posts()) { $blog_query->the_post(); comicpress_display_post(); } } UnProtect(); ?> </div> <div class="column_two"> <div class="column_two_header"></div> <?php Protect(); $wp_query->in_the_loop = true; $blog_query = new WP_Query(); if ($whereclause) { add_filter('posts_where', 'comicpress_dual_filter_where'); } $blog_query->query('showposts=' . comicpress_themeinfo('blog_postcount') . '&cat=' . comicpress_exclude_comic_categories() . '&author=' . comicpress_themeinfo('author_column_two')); if (have_posts()) { while ($blog_query->have_posts()) { $blog_query->the_post(); comicpress_display_post(); } } UnProtect(); ?> </div> <div class="clear"></div> </div> <?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(); ?> "><?php the_title(); ?> </a></td></tr> <?php } ?> </table> <div class="clear"></div> </div> <?php if (comicpress_themeinfo('enable_caps')) { ?> <div class="post-foot"></div><?php } ?> </div> <?php UnProtect(); get_footer();
function widget($args, $instance) { global $post, $wp_query; if (is_home() || is_single()) { 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; } comicpress_classic_bookmark(); echo $after_widget; UnProtect(); } }
function widget($args, $instance) { global $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; } comicpress_menubar(); echo $after_widget; UnProtect(); }
function widget($args, $instance) { global $post, $wp_query; Protect(); extract($args, EXTR_SKIP); echo $before_widget; if (!empty($instance)) { extract($instance); } ?> <?php if (comicpress_themeinfo('enable_caps')) { ?> <div id="wp-calendar-head"></div><?php } ?> <div id="wp-calendar-wrap"> <?php if (!empty($thumbnail)) { ?> <div class="wp-calendar-download"> <?php if (!empty($link)) { ?> <a href="<?php echo esc_attr($link); ?> "><img src="<?php echo esc_attr($thumbnail); ?> " class="wp-calendar-thumb" alt="" /></a> <?php } else { ?> <img src="<?php echo esc_attr($thumbnail); ?> " class="wp-calendar-thumb" alt="" /> <?php } ?> <div class="wp-calendar-download-links"> <?php if (!empty($small) || !empty($medium) || !empty($large)) { ?> <?php _e('DOWNLOAD', 'comicpress'); ?> <?php foreach (array('small' => array(__('Download Small', 'comicpress'), __('S', 'comicpress')), 'medium' => array(__('Download Medium', 'comicpress'), __('M', 'comicpress')), 'large' => array(__('Download Large', 'comicpress'), __('L', 'comicpress'))) as $field => $text) { if (!empty(${$field})) { ?> <a href="<?php echo esc_attr(${$field}); ?> " title="<?php echo esc_attr($text[0]); ?> "><?php echo esc_html($text[1]); ?> </a><?php } } } ?> </div> </div> <?php } ?> <?php get_calendar(); ?> </div> <?php if (comicpress_themeinfo('enable_caps')) { ?> <div id="wp-calendar-foot"></div><?php } ?> <?php echo $after_widget; UnProtect(); }
function widget($args, $instance) { global $post, $wp_query; Protect(); extract($args, EXTR_SKIP); echo $before_widget; $title = empty($instance['title']) ? __('Reference', 'comicpress') : apply_filters('widget_title', $instance['title']); if (!empty($title)) { echo $before_title . $title . $after_title; } $tags_list = get_the_terms($post->ID, 'post_tag'); if (!empty($tags_list)) { foreach ($tags_list as $tagname) { if (!empty($tagname->description)) { ?> <div class="refwrap"> <?php if (file_exists(get_stylesheet_directory() . '/images/ref/' . $tagname->slug . '.png')) { $image_file = trailingslashit(get_stylesheet_directory_uri()) . 'images/ref/' . $tagname->slug . '.png'; ?> <div class="refimage refimage-<?php echo $tagname->slug; ?> "> <img src="<?php echo $image_file; ?> " alt="<?php echo $tagname->slug; ?> " /> </div> <?php } ?> <div class="reftext reftext-<?php echo $tagname->slug; ?> "> <div class="refname refname-<?php echo $tagname - slug; ?> "><?php echo $tagname->name; ?> </div> <?php if (!empty($tagname->description)) { echo $tagname->description; } ?> <div class="clear"></div> </div> <div class="clear"></div> </div> <?php } } if (!empty($instance['info'])) { ?> <div class="refinfo"><?php echo $instance['info']; ?> </div> <?php } } echo $after_widget; UnProtect(); }
function widget($args, $instance) { extract($args, EXTR_SKIP); Protect(); echo $before_widget; $title = empty($instance['title']) ? __('Control Panel', 'comicpress') : apply_filters('widget_title', $instance['title']); if (!empty($title)) { echo $before_title . $title . $after_title; } $this->comicpress_show_control_panel(); echo $after_widget; UnProtect(); }
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(); }