Esempio n. 1
0
 function comicpress_insert_comic_feed($content)
 {
     global $wp_query, $post;
     $category = get_the_category($post->ID);
     if (is_feed() && comicpress_in_comic_category($category[0]->cat_ID)) {
         echo comicpress_comic_feed();
     }
     return apply_filters('comicpress_insert_comic_feed', $content);
 }
Esempio n. 2
0
 function comicpress_display_facebook_like($content)
 {
     global $post, $wp_query;
     if (!is_page()) {
         if (comicpress_in_comic_category() && comicpress_themeinfo('facebook_like_comic_post') || !comicpress_in_comic_category() && comicpress_themeinfo('facebook_like_blog_post')) {
             $content .= '<span class="facebook-like"><fb:like layout="box_count" show_faces="false" width="255" href="' . get_permalink() . '"></fb:like></span>';
         }
     }
     return $content;
 }
Esempio n. 3
0
 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();
 }
Esempio n. 4
0
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', '&lsaquo;');
                    ?>
					</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', '&lsaquo;');
                ?>
				</div>
				<div class="menunav-next">
				<?php 
                comicpress_next_comic_link('%link', '&rsaquo;');
                ?>
				</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 
    }
}
Esempio n. 5
0
 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();
         }
     }
 }
Esempio n. 6
0
function zappbar_inject()
{
    wp_reset_query();
    // need this or it may apply archive bars on non-archive pages!
    $zb_layout = get_option('zappbar_layout');
    global $post;
    $zb_pages = zb_paginate();
    $share_panel = 0;
    // assume no button is assigned
    $left_sidebar = 0;
    // to activate any of these
    $right_sidebar = 0;
    // panels.
    $left_appmenu = 0;
    $right_appmenu = 0;
    global $share_panel, $left_sidebar, $right_sidebar, $left_appmenu, $right_appmenu;
    function build_zappbars($value, $layout, $position, $paged)
    {
        global $post;
        $xtra = '';
        if ($position == null) {
            $position = 'top';
        }
        $zb_name = array('button_a', 'button_b', 'button_c', 'button_d', 'button_e');
        $html = '<div class="zappbar zb-' . $layout . ' ' . $position . '">';
        $x = 0;
        foreach ($value as $val) {
            $html .= '<div class="zb ' . $zb_name[$x] . ' integrated-webcomic">';
            if (array_filter($paged)) {
                if (function_exists('comicpress_display_comic') && comicpress_themeinfo('archive_display_order') == "asc") {
                    $first_page = $paged[0];
                    $last_page = $paged[3];
                } else {
                    if (function_exists('comicpress_display_comic') && comicpress_themeinfo('archive_display_order') == "desc") {
                        $first_page = $paged[3];
                        $last_page = $paged[0];
                    } else {
                        $first_page = $paged[3];
                        $last_page = $paged[0];
                    }
                }
                if ($val[2] == 'first_page') {
                    $val[2] = $first_page;
                } else {
                    if ($val[2] == 'prev_page') {
                        $val[2] = $paged[1];
                    } else {
                        if ($val[2] == 'next_page') {
                            $val[2] = $paged[2];
                        } else {
                            if ($val[2] == 'last_page') {
                                $val[2] = $last_page;
                            } else {
                            }
                        }
                    }
                }
            }
            if (get_post_type() == 'comic' || function_exists('ceo_pluginfo')) {
                if (ceo_pluginfo('navigate_only_chapters')) {
                    if ($val[2] == 'prev_chapter') {
                        $val[2] = ceo_get_previous_chapter();
                    } else {
                        if ($val[2] == 'first_comic') {
                            $val[2] = ceo_get_first_comic_in_chapter_permalink();
                        } else {
                            if ($val[2] == 'prev_comic') {
                                $val[2] = ceo_get_previous_comic_in_chapter_permalink();
                            } else {
                                if ($val[2] == 'next_comic') {
                                    $val[2] = ceo_get_next_comic_in_chapter_permalink();
                                } else {
                                    if ($val[2] == 'last_comic') {
                                        $val[2] = ceo_get_last_comic_in_chapter_permalink();
                                    } else {
                                        if ($val[2] == 'next_chapter') {
                                            $val[2] = ceo_get_next_chapter();
                                        } else {
                                            if ($val[2] == 'comic_archive') {
                                                $val[2] = get_site_url() . '/comic';
                                            } else {
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                } else {
                    if ($val[2] == 'prev_chapter') {
                        $val[2] = ceo_get_previous_chapter();
                    } else {
                        if ($val[2] == 'first_comic') {
                            $val[2] = ceo_get_first_comic_permalink();
                        } else {
                            if ($val[2] == 'prev_comic') {
                                $val[2] = ceo_get_previous_comic_permalink();
                            } else {
                                if ($val[2] == 'next_comic') {
                                    $val[2] = ceo_get_next_comic_permalink();
                                } else {
                                    if ($val[2] == 'last_comic') {
                                        $val[2] = ceo_get_last_comic_permalink();
                                    } else {
                                        if ($val[2] == 'next_chapter') {
                                            $val[2] = ceo_get_next_chapter();
                                        } else {
                                            if ($val[2] == 'comic_archive') {
                                                $val[2] = get_site_url() . '/comic';
                                            } else {
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if (function_exists('comicpress_display_comic')) {
                if ($val[2] == 'prev_chapter') {
                    $val[2] = comicpress_get_previous_storyline_start_permalink();
                } else {
                    if ($val[2] == 'first_comic') {
                        $val[2] = comicpress_get_first_comic_permalink();
                    } else {
                        if ($val[2] == 'prev_comic') {
                            $val[2] = comicpress_get_previous_comic_permalink();
                        } else {
                            if ($val[2] == 'next_comic') {
                                $val[2] = comicpress_get_next_comic_permalink();
                            } else {
                                if ($val[2] == 'last_comic') {
                                    $val[2] = comicpress_get_last_comic_permalink();
                                } else {
                                    if ($val[2] == 'next_chapter') {
                                        $val[2] = comicpress_get_next_storyline_start_permalink();
                                    } else {
                                        if ($val[2] == 'comic_archive') {
                                            $val[2] = get_site_url() . '/?cat=' . comicpress_themeinfo('comiccat') . '/';
                                        } else {
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if (preg_match('/webcomic/', get_post_type())) {
                // Yes, this is a very convoluted way of getting the URLs
                if ($val[2] == 'prev_chapter') {
                    preg_match_all('/<a[^>]+href=([\'"])(.+?)\\1[^>]*>/i', do_shortcode('[previous_webcomic_storyline_link]'), $matches);
                    $val[2] = $matches[2][0];
                } else {
                    if ($val[2] == 'first_comic') {
                        preg_match_all('/<a[^>]+href=([\'"])(.+?)\\1[^>]*>/i', do_shortcode('[first_webcomic_link]'), $matches);
                        $val[2] = $matches[2][0];
                    } else {
                        if ($val[2] == 'prev_comic') {
                            preg_match_all('/<a[^>]+href=([\'"])(.+?)\\1[^>]*>/i', do_shortcode('[previous_webcomic_link]'), $matches);
                            $val[2] = $matches[2][0];
                        } else {
                            if ($val[2] == 'next_comic') {
                                preg_match_all('/<a[^>]+href=([\'"])(.+?)\\1[^>]*>/i', do_shortcode('[next_webcomic_link]'), $matches);
                                $val[2] = $matches[2][0];
                            } else {
                                if ($val[2] == 'last_comic') {
                                    preg_match_all('/<a[^>]+href=([\'"])(.+?)\\1[^>]*>/i', do_shortcode('[last_webcomic_link]'), $matches);
                                    $val[2] = $matches[2][0];
                                } else {
                                    if ($val[2] == 'next_chapter') {
                                        preg_match_all('/<a[^>]+href=([\'"])(.+?)\\1[^>]*>/i', do_shortcode('[next_webcomic_storyline_link]'), $matches);
                                        $val[2] = $matches[2][0];
                                    } else {
                                        if ($val[2] == 'comic_archive') {
                                            preg_match_all('/<a[^>]+href=([\'"])(.+?)\\1[^>]*>/i', do_shortcode('[the_webcomic_collections]'), $matches);
                                            $val[2] = $matches[2][0];
                                        } else {
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if (class_exists('woocommerce') && (is_product() || is_cart() || is_checkout() || is_account_page())) {
                global $woo_options, $woocommerce;
                if ($val[2] == 'woo_store') {
                    $val[2] = get_permalink(woocommerce_get_page_id('shop'));
                }
                if ($val[2] == 'woo_cart' && (is_product() || is_cart() || is_checkout() || is_account_page())) {
                    $val[2] = $woocommerce->cart->get_cart_url();
                    $cartcount = sprintf(_n('%d', '%d', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);
                    $label = '<span class="amount">' . $woocommerce->cart->get_cart_total() . '</span>';
                    if ($cartcount != '0') {
                        $label .= '<span class="contents">' . $cartcount . '</span>';
                    }
                    $val[1] = $label;
                } else {
                    if ($val[2] == 'woo_review' && is_product()) {
                        global $product;
                        if (get_option('woocommerce_enable_review_rating') === 'yes' && ($count = $product->get_rating_count())) {
                            $val[1] = $val[1] . '<span class="contents">' . $count . '</span>';
                        }
                    } else {
                        if ($val[2] == 'woo_account' && (is_product() || is_cart() || is_checkout() || is_account_page())) {
                            $val[2] = get_permalink(get_option('woocommerce_myaccount_page_id'));
                            if (is_user_logged_in()) {
                                $who = wp_get_current_user();
                                if (strlen($who->display_name) > 10) {
                                    $val[1] = __('Account', 'woothemes');
                                } else {
                                    $val[1] = $who->display_name;
                                }
                            } else {
                                $val[1] = __('Login', 'woothemes');
                            }
                        } else {
                            if (in_array($val[2], array('woo_search', 'woo_search_left', 'woo_search_right'))) {
                                if ($val[2] == 'woo_search_left') {
                                    $shift = ' left';
                                } else {
                                    if ($val[2] == 'woo_search_right') {
                                        $shift = ' right';
                                    } else {
                                        $shift = ' center';
                                    }
                                }
                                $xtra = " searchbox" . $shift;
                                $val[1] = $val[1] . '</span><span class="search out">
					<form role="search" method="get" action="' . esc_url(home_url('/')) . '">
						<label class="screen-reader-text" for="s">' . __('Search Products:', 'woothemes') . '</label>
						<input type="search" results=5 autosave="' . esc_url(home_url('/')) . '" class="input-text" placeholder="' . esc_attr__('Search Products', 'woothemes') . '" value="' . get_search_query() . '" name="s" />
						<input type="submit" class="button" value="' . esc_attr__('Search', 'woothemes') . '" />
						<input type="hidden" name="post_type" value="product" />
					</form>
					</span>';
                            } else {
                            }
                        }
                    }
                }
            }
            if ($val[2] == 'appmenu_left') {
                global $left_appmenu;
                $left_appmenu = 1;
            }
            if ($val[2] == 'appmenu_right') {
                global $right_appmenu;
                $right_appmenu = 1;
            }
            if ($val[2] == 'sidebar_left') {
                global $left_sidebar;
                $left_sidebar = 1;
            }
            if ($val[2] == 'sidebar_right') {
                global $right_sidebar;
                $right_sidebar = 1;
            }
            if ($val[2] == 'custom_email') {
                $zb_social = get_option('zappbar_social');
                $val[2] = 'mailto:' . $zb_social['email_address'];
            }
            if ($val[2] == 'blogposts') {
                $cats = get_categories();
                $pls = get_option('permalink_structure');
                /*	Page title is usually "Category Archives: First_Category_Name"
                				but we want to trick it to only say "Category Archives:" so we
                				inject cat_ID=1000 or category slug "all" which most likely do
                				not exist, which leaves the name part of the title blank
                			*/
                if ($pls == '') {
                    $category = '/?cat=1000,';
                } else {
                    if ($pls == '/archives/%post_id%') {
                        $category = '/archives/category/all,';
                    } else {
                        $category = '/category/all,';
                    }
                }
                $val[2] = esc_url(home_url()) . $category;
                $c = 0;
                foreach ($cats as $cat) {
                    if ($pls == '') {
                        $val[2] .= $cat->cat_ID;
                    } else {
                        $val[2] .= $cat->slug;
                    }
                    if ($c < count($cats) - 1) {
                        $val[2] .= ',';
                    }
                    $c++;
                }
                $val[2] .= '/';
            }
            if ($val[2] == 'ryuzine_rack') {
                $val[2] = esc_url(home_url()) . '/ryuzine-rack/';
            }
            if (in_array($val[2], array('search_box', 'search_left', 'search_right'))) {
                if ($val[2] == 'search_left') {
                    $shift = ' left"';
                } else {
                    if ($val[2] == 'search_right') {
                        $shift = ' right"';
                    } else {
                        $shift = ' center';
                    }
                }
                $xtra = " searchbox" . $shift;
                $val[1] = $val[1] . '</span><span class="search out">
					<form role="search" method="get" class="search-form" action="' . home_url('/') . '">
						<label>
							<span class="screen-reader-text">Search for:</span>
							<input type="search" results=5 class="input-text" placeholder="Search Site" value="" name="s" title="Search for:" />
						</label>
						<input type="submit" class="search-submit" value="Search" />
					</form>
					</span>';
            }
            // now all the share options
            if ($val[2] == 'commentform') {
                if (get_comments_number() > 0) {
                    $count = '<span class="contents">' . get_comments_number() . '</span>';
                } else {
                    $count = '';
                }
                $val[1] = $val[1] . $count;
            } else {
                if ($val[2] == 'share_this') {
                    global $share_panel;
                    $share_panel = 1;
                } else {
                    if ($val[2] == 'share_fb') {
                        $val[2] = 'http://www.facebook.com/sharer.php?u=' . urlencode(get_permalink($post->ID)) . '&amp;t=' . urlencode(get_the_title($post->ID)) . '';
                        $xtra = ' zb-social';
                    } else {
                        if ($val[2] == 'share_twitter') {
                            $val[2] = 'http://twitter.com/share?text=' . urlencode(get_the_title($post->ID)) . '&url=' . urlencode(wp_get_shortlink($post->ID)) . '';
                            $xtra = ' zb-social';
                        } else {
                            if ($val[2] == 'share_gplus') {
                                $val[2] = 'https://plus.google.com/share?url=' . urlencode(get_permalink($post->ID));
                                $xtra = ' zb-social';
                            } else {
                                if ($val[2] == 'share_reddit') {
                                    $val[2] = 'http://www.reddit.com/submit?url=' . urlencode(get_permalink($post->ID)) . '&amp;title=' . urlencode(get_the_title($post->ID)) . '';
                                    $xtra = ' zb-social';
                                } else {
                                    if ($val[2] == 'share_stumble') {
                                        $val[2] = 'http://www.stumbleupon.com/submit?url=' . urlencode(get_permalink($post->ID)) . '&amp;title=' . urlencode(get_the_title($post->ID)) . '';
                                        $xtra = ' zb-social';
                                    } else {
                                        if ($val[2] == 'share_digg') {
                                            $val[2] = 'http://digg.com/submit?url=' . urlencode(get_permalink($post->ID)) . '&amp;title=' . urlencode(get_the_title($post->ID)) . '';
                                            $xtra = ' zb-social';
                                        } else {
                                            if ($val[2] == 'share_linkedin') {
                                                $val[2] = 'http://www.linkedin.com/shareArticle?mini=true&amp;title=' . urlencode(get_the_title($post->ID)) . '&amp;url=' . urlencode(wp_get_shortlink($post->ID)) . '';
                                                $xtra = ' zb-social';
                                            } else {
                                                if ($val[2] == 'share_pinterest') {
                                                    $val[2] = 'http://pinterest.com/pin/create/button/?url=' . urlencode(get_permalink($post->ID)) . '&media=' . urlencode(wp_get_attachment_url(get_post_thumbnail_id($post->ID))) . '';
                                                    $xtra = ' zb-social';
                                                } else {
                                                    if ($val[2] == 'share_delicious') {
                                                        $val[2] = 'http://del.icio.us/post?url=' . urlencode(get_permalink($post->ID)) . '&amp;title=' . urlencode(get_the_title($post->ID)) . '';
                                                        $xtra = ' zb-social';
                                                    } else {
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            $icon = explode('|', $val[0]);
            $html .= '<a href="' . $val[2] . '" class="button' . $xtra . '" target="_self"><div class="icon ' . $icon[0] . ' ' . $icon[1] . '"></div><br/><span class="zb-label">' . $val[1] . '</span></a>';
            $html .= '</div>';
            $x++;
        }
        $html .= '</div>';
        echo $html;
    }
    $zb_site = get_option('zappbar_site');
    if ($zb_site['showon'] != 'none') {
        if (class_exists('woocommerce') && $zb_layout['use_woo_top_bar'] == 'yes' && (is_product() || is_cart() || is_checkout() || is_account_page())) {
            build_zappbars($zb_layout['woo_top_bar'], $zb_layout['button_layout'], 'top', $zb_pages);
        } else {
            if ((isset($post->post_type) && ($post->post_type == 'comic' || $post->post_type == 'mangapress') || function_exists('comicpress_display_comic') && comicpress_in_comic_category() && !is_home() || preg_match('/webcomic/', get_post_type())) && $zb_layout['use_comic_top_bar'] == 'yes' && !is_archive()) {
                build_zappbars($zb_layout['comic_top_bar'], $zb_layout['button_layout'], 'top', $zb_pages);
            } else {
                if ($zb_layout['use_archive_top_bar'] == 'yes' && (is_archive() || is_search())) {
                    build_zappbars($zb_layout['archive_top_bar'], $zb_layout['button_layout'], 'top', $zb_pages);
                } else {
                    build_zappbars($zb_layout['default_top'], $zb_layout['button_layout'], 'top', $zb_pages);
                }
            }
        }
        if (class_exists('woocommerce') && $zb_layout['use_woo_bottom_bar'] == 'yes' && is_product()) {
            build_zappbars($zb_layout['woo_bottom_bar'], $zb_layout['button_layout'], 'bottom', $zb_pages);
        } else {
            if ((isset($post->post_type) && ($post->post_type == 'comic' || $post->post_type == 'mangapress') || function_exists('comicpress_display_comic') && comicpress_in_comic_category() && !is_home() || preg_match('/webcomic/', get_post_type())) && $zb_layout['use_comic_top_bar'] == 'yes' && !is_archive()) {
                build_zappbars($zb_layout['comic_bottom_bar'], $zb_layout['button_layout'], 'bottom', $zb_pages);
            } else {
                if ($zb_layout['use_archive_bottom_bar'] == 'yes' && (is_archive() || is_search())) {
                    build_zappbars($zb_layout['archive_bottom_bar'], $zb_layout['button_layout'], 'bottom', $zb_pages);
                } else {
                    build_zappbars($zb_layout['default_bottom'], $zb_layout['button_layout'], 'bottom', $zb_pages);
                }
            }
        }
    }
    $panels = get_option('zappbar_panels');
    if ($left_appmenu == 1 || $right_appmenu == 1) {
        $menu_args = array(array('theme_location' => 'zb-menu-left', 'depth' => isset($panels['panel_menu']) && !is_null($panels['panel_menu']) ? $panels['panel_menu'] : '0'), array('theme_location' => 'zb-menu-right', 'depth' => isset($panels['panel_menu']) && !is_null($panels['panel_menu']) ? $panels['panel_menu'] : '0'));
    }
    if ($left_appmenu == 1) {
        ?>
		<div id="zappbar_menu_left" class="zb-panel left hide"><div class="marginbox"><?php 
        wp_nav_menu($menu_args[0]);
        ?>
</div></div>
	<?php 
    }
    if ($right_appmenu == 1) {
        ?>
		<div id="zappbar_menu_right" class="zb-panel right hide"><div class="marginbox"><?php 
        wp_nav_menu($menu_args[1]);
        ?>
</div></div>
	<?php 
    }
    if ($panels['panel_tabs'] == 'yes' || $left_sidebar == 1) {
        ?>
		<div id="zappbar_sidebar_left" class="zb-panel <?php 
        if ($panels['panel_tabs'] == 'no') {
            echo 'notabs ';
        }
        ?>
left hide"><div class="marginbox"><?php 
        if (dynamic_sidebar('zb-panel-left')) {
        } else {
        }
        ?>
</div></div>
	<?php 
    }
    if ($panels['panel_tabs'] == 'yes' || $right_sidebar == 1) {
        ?>
		<div id="zappbar_sidebar_right" class="zb-panel <?php 
        if ($panels['panel_tabs'] == 'no') {
            echo 'notabs ';
        }
        ?>
right hide"><div class="marginbox"><?php 
        if (dynamic_sidebar('zb-panel-right')) {
        } else {
        }
        ?>
</div></div>
	<?php 
    }
    if ($share_panel == 1 && !is_404()) {
        ?>
		<div id="zappbar_share_this" class="zb-panel right hide"><div class="marginbox">
			<h2>Share this On:</h2>
			<?php 
        global $post;
        $zb_social = get_option('zappbar_social');
        $zb_social_panel = isset($zb_social['social_panel']) ? $zb_social['social_panel'] : [];
        if ($zb_social_panel['facebook'] != '') {
            ?>
			<a href="http://www.facebook.com/sharer.php?u=<?php 
            echo urlencode(get_permalink($post->ID));
            ?>
&amp;t=<?php 
            echo urlencode(get_the_title($post->ID));
            ?>
" title="Share on Facebook" rel="nofollow" target="_blank" class="zb-social facebook">Facebook</a>
			<?php 
        }
        if ($zb_social_panel['twitter'] != '') {
            ?>
			<a href="http://twitter.com/share?text=<?php 
            echo urlencode(get_the_title($post->ID));
            ?>
&url=<?php 
            echo urlencode(wp_get_shortlink($post->ID));
            ?>
" title="Share on Twitter" rel="nofollow" target="_blank" class="zb-social twitter">Twitter</a>
			<?php 
        }
        if ($zb_social_panel['google'] != '') {
            ?>
			<a href="https://plus.google.com/share?url=<?php 
            echo urlencode(get_permalink($post->ID));
            ?>
" title="Share on Google+" rel="nofollow" target="_blank" class="zb-social google-plus">Google+</a>
			<?php 
        }
        if ($zb_social_panel['reddit'] != '') {
            ?>
			<a href="http://www.reddit.com/submit?url=<?php 
            echo urlencode(get_permalink($post->ID));
            ?>
&amp;title=<?php 
            echo urlencode(get_the_title($post->ID));
            ?>
" title="Share on Reddit" rel="nofollow" target="_blank" class="zb-social reddit">Reddit</a>
			<?php 
        }
        if ($zb_social_panel['stumble'] != '') {
            ?>
			<a href="http://www.stumbleupon.com/submit?url=<?php 
            echo urlencode(get_permalink($post->ID));
            ?>
&amp;title=<?php 
            echo urlencode(get_the_title($post->ID));
            ?>
" title="Stumble It" rel="nofollow" target="_blank" class="zb-social stumbleupon">Stumble It</a>
			<?php 
        }
        if ($zb_social_panel['digg'] != '') {
            ?>
			<a href="http://digg.com/submit?url=<?php 
            urlencode(get_permalink($post->ID));
            ?>
&amp;title=<?php 
            urlencode(get_the_title($post->ID));
            ?>
" title="Digg this!" rel="nofollow" target="_blank" class="zb-social digg">Digg this!</a>
			<?php 
        }
        if ($zb_social_panel['linkedin'] != '') {
            ?>
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;title=<?php 
            echo urlencode(get_the_title($post->ID));
            ?>
&amp;url=<?php 
            echo urlencode(wp_get_shortlink($post->ID));
            ?>
" title="Share on LinkedIn" rel="nofollow" target="_blank" class="zb-social linkedin">LinkedIn</a>
			<?php 
        }
        if ($zb_social_panel['pinterest'] != '') {
            ?>
			<a href="http://pinterest.com/pin/create/button/?url=<?php 
            echo urlencode(get_permalink($post->ID));
            ?>
&media=<?php 
            echo urlencode(wp_get_attachment_url(get_post_thumbnail_id($post->ID)));
            ?>
" title="Pin this!" rel="nofollow" target="_blank" class="zb-social pinterest">Pinterest</a>
			<?php 
        }
        if ($zb_social_panel['delicious'] != '') {
            ?>
			<a href="http://del.icio.us/post?url=<?php 
            echo urlencode(get_permalink($post->ID));
            ?>
&amp;title=<?php 
            echo urlencode(get_the_title($post->ID));
            ?>
" title="Bookmark on del.icio.us" rel="nofollow" target="_blank" class="zb-social delicious">Del.icio.us</a>
			<?php 
        }
        if ($zb_social_panel['rss'] != '') {
            ?>
			<a href="<?php 
            echo get_site_url();
            ?>
/?feed=rss" title="RSS Feed" rel="nofollow" target="_blank" class="zb-social rss-feed">RSS Feed</a>
			<?php 
        }
        if ($zb_social_panel['email'] != '') {
            ?>
			<a href="mailto:?subject=Sharing: <?php 
            echo get_the_title($post->ID);
            ?>
&amp;body=%0AThought you might be interested in this:%0A%0A<?php 
            echo get_the_title($post->ID);
            ?>
%0A%0A<?php 
            echo urlencode(get_permalink($post->ID));
            ?>
%0A%0A" title="Share by E-mail" rel="nofollow" target="_blank" class="zb-mail">E-mail Link!</a>
			<?php 
        }
        ?>
		</div></div>
	<?php 
    }
    if ($panels['panel_tabs'] == 'yes') {
        ?>
		<div id="zappbar_sbtab_left" class="sbtab hide"><span></span></div>
		<div id="zappbar_sbtab_right" class="sbtab hide"><span></span></div>
	<?php 
    }
    if ($zb_site['splash_screen'] != '') {
        ?>
		<div id="zappbar_splash"><span></span></div>
	<?php 
    }
    ?>
		<div id="zappbar_notice" class="out"></div>
	<?php 
}
Esempio n. 7
0
			<?php 
        } else {
            if ($config) {
                $byline = $config['byline'];
            } else {
                $byline = $options_page['byline'];
            }
            if ($byline == "1") {
                echo '<small>' . the_time('F jS, Y') . " by " . the_author_posts_link() . '<small>';
            }
            if ($config) {
                $postbody = $config['postbody'];
            } else {
                $postbody = $options_page['postbody'];
            }
            if (function_exists('comicpress_display_comic') && comicpress_in_comic_category()) {
                // ComicPress support
                echo ryuzine_display_comic();
                if ($postbody == "1") {
                    the_content();
                }
                // If in comics category and text enabled
            } else {
                if ('webcomic_post' == get_post_type()) {
                    the_webcomic_object('full');
                    if ($postbody == "1") {
                        the_content();
                    }
                    // If in comics category and text enabled
                } else {
                    if ('comic' == get_post_type()) {
Esempio n. 8
0
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', '&lsaquo;');
                    ?>
					</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', '&lsaquo;');
                ?>
				</div>
				<div class="menunav-next">
				<?php 
                comicpress_next_comic_link('%link', '&rsaquo;');
                ?>
				</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 
    }
}
Esempio n. 9
0
    function comicpress_display_post()
    {
        global $post, $wp_query;
        $is_comic = 0;
        if (comicpress_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($is_comic);
        ?>
			<?php 
        if (comicpress_themeinfo('enable_caps')) {
            ?>
<div class="post-head"></div><?php 
        }
        ?>
			<div class="post-content">
				<div class="post-info">
					<?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($is_comic);
        if (!is_page()) {
            comicpress_display_post_author();
            comicpress_display_post_date();
            comicpress_display_post_time();
            if (!is_archive() && !is_search()) {
                edit_post_link(__('Edit', 'comicpress'), ' <span class="pipe">|</span> <span class="post-edit">', '</span>');
            }
            comicpress_display_post_category($is_comic);
            if (function_exists('the_ratings') && $post->post_type == 'post') {
                the_ratings();
            }
        }
        ?>
					</div>
				</div>
				<div class="clear"></div>
				<div class="entry">
					<?php 
        comicpress_display_the_content($is_comic);
        ?>
					<div class="clear"></div>
				</div>
				<div class="clear"></div>
				<?php 
        if (!is_page()) {
            ?>
				<div class="post-extras">
					<?php 
            comicpress_display_post_tags();
            ?>
					<?php 
            comicpress_display_comment_link();
            ?>
					<?php 
            if ($is_comic) {
                if (function_exists('comicpress_related_comics_shortcode') && comicpress_themeinfo('enable_related_comics')) {
                    echo comicpress_related_comics_shortcode();
                }
            } else {
                if (function_exists('comicpress_related_posts_shortcode') && comicpress_themeinfo('enable_related_posts')) {
                    echo comicpress_related_posts_shortcode();
                }
            }
            ?>
					<div class="clear"></div>
				</div>
				<?php 
        }
        ?>
				<?php 
        if (is_page()) {
            edit_post_link(__('Edit this page.', 'comicpress'), '', '');
        }
        ?>
			</div>
			<?php 
        if (comicpress_themeinfo('enable_caps')) {
            ?>
<div class="post-foot"></div><?php 
        }
        ?>
		</div>
		<?php 
    }
Esempio n. 10
0
                    $posts =& query_posts($blog_query);
                    if (have_posts()) {
                        while (have_posts()) {
                            the_post();
                            comicpress_display_post();
                            comments_template('', true);
                        }
                    }
                }
                UnProtect();
            } else {
                comicpress_dual_columns(true);
            }
        }
    }
    if (comicpress_in_comic_category() && comicpress_themeinfo('enable_comments_when_comic_blog_disabled') && comicpress_themeinfo('disable_comic_blog_single')) {
        comments_template('', true);
    }
} else {
    ?>
	<div <?php 
    post_class();
    ?>
>
		<?php 
    if (comicpress_themeinfo('enable_caps')) {
        ?>
<div class="post-head"></div><?php 
    }
    ?>
		<div class="post">
Esempio n. 11
0
<?php

get_header();
// set to empty
$order = $post_count = $theCatID = $is_comic = '';
if (is_category()) {
    $theCatID = get_term_by('slug', $wp_query->query_vars['category_name'], 'category');
    if (!empty($theCatID)) {
        $theCatID = $theCatID->term_id;
    }
    if (isset($wp_query->query_vars['cat'])) {
        $theCatID = (int) $wp_query->query_vars['cat'];
    }
}
if (!empty($theCatID) && comicpress_in_comic_category($theCatID)) {
    $is_comic = true;
}
$count = "No";
if (have_posts()) {
    $count = $wp_query->found_posts;
    $post = $posts[0];
    // Hack. Set $post so that the_date() works
    $post_title_type = $title_string = '';
    if ($post->post_type !== 'post') {
        $post_title_type = $post->post_type . '-';
    }
    // extra space at the end for visual
    if (is_category()) {
        /* Category */
        $title_string = __('Archive for &#8216;', 'comicpress') . $post_title_type . single_cat_title('', false) . __('&#8217;', 'comicpress');
    } elseif (is_tag()) {
Esempio n. 12
0
function comicpress_buyprint_edit_post()
{
    global $post;
    if (comicpress_in_comic_category()) {
        $currentbuyprintoption = get_post_meta($post->ID, 'buyprint-status', true);
        if (empty($currentbuyprintoption)) {
            $currentbuyprintoption = 'Available';
        }
        $currentbuyorigoption = get_post_meta($post->ID, 'buyorig-status', true);
        if (empty($currentbuyorigoption)) {
            $currentbuyorigoption = 'Available';
        }
        $currentbuyprintamount = get_post_meta($post->ID, 'buy_print_amount', true);
        if (empty($currentbuyprintamount)) {
            $currentbuyprintamount = comicpress_themeinfo('buy_print_amount');
        }
        $currentbuyorigamount = get_post_meta($post->ID, 'buy_print_orig_amount', true);
        if (empty($currentbuyorigamount)) {
            $currentbuyorigamount = comicpress_themeinfo('buy_print_orig_amount');
        }
        ?>
		<table>
		<tr>
			<td align="left" valign="top" width="50%">
				The Print Cost <input name="buy_print_amount" id="buy_print_amount" type="text" size="5" value="<?php 
        echo $currentbuyprintamount;
        ?>
" />  <br />
				<input name="buyprint-status" id="buyprint-available" type="radio" value="Available" <?php 
        if ($currentbuyprintoption == 'Available' || empty($currentbuyprintoption)) {
            echo " checked";
        }
        ?>
 /> Available<br />
				<input name="buyprint-status" id="buyprint-sold" type="radio" value="Sold" <?php 
        if ($currentbuyprintoption == 'Sold') {
            echo " checked";
        }
        ?>
 /> Sold<br />
				<input name="buyprint-status" id="buyprint-outofstock" type="radio" value="Out Of Stock" <?php 
        if ($currentbuyprintoption == 'Out Of Stock') {
            echo " checked";
        }
        ?>
 /> Out of Stock<br />
				<input name="buyprint-status" id="buyprint-notavail" type="radio" value="Not Available" <?php 
        if ($currentbuyprintoption == 'Not Available') {
            echo " checked";
        }
        ?>
 /> Not Available<br />
			</td>
		<?php 
        if (comicpress_themeinfo('buy_print_sell_original')) {
            ?>
			<td align="left" valign="top">
				Original Cost <input name="buy_print_orig_amount" id="buy_print_orig_amount" size="5" type="text" value="<?php 
            echo $currentbuyorigamount;
            ?>
" /><br />
				<input name="buyorig-status" id="buyorig-available" type="radio" value="Available" <?php 
            if ($currentbuyorigoption == 'Available' || empty($currentbuyorigoption)) {
                echo " checked";
            }
            ?>
 /> Available<br />
				<input name="buyorig-status" id="buyorig-sold" type="radio" value="Sold" <?php 
            if ($currentbuyorigoption == 'Sold') {
                echo " checked";
            }
            ?>
 /> Sold<br />
				<input name="buyorig-status" id="buyorig-outofstock" type="radio" value="Out Of Stock" <?php 
            if ($currentbuyorigoption == 'Out Of Stock') {
                echo " checked";
            }
            ?>
 /> Out of Stock<br />
				<input name="buyorig-status" id="buyorig-notavail" type="radio" value="Not Available" <?php 
            if ($currentbuyorigoption == 'Not Available') {
                echo " checked";
            }
            ?>
 /> Not Available<br />
			</td>
		<?php 
        }
        ?>
		</tr>
		</table>
	<?php 
    } else {
        _e('No prints available for non-comic categories.', 'comicpress');
    }
}
Esempio n. 13
0
function comicpress_post_class($classes = '')
{
    global $post;
    static $post_alt;
    $is_comic = comicpress_in_comic_category();
    // This used to do something, it no longer does
    /*
    	$args = array(
    		'entry_tax' => array( 'category', 'post_tag' )
    	);
    */
    /* Microformats. */
    $classes[] = 'uentry';
    /* if a comic category */
    if ($is_comic) {
        $classes[] = 'post-comic';
    }
    if (is_page()) {
        $classes[] = 'post-page';
    }
    if (!$is_comic && !is_page()) {
        $classes[] = 'post-blog';
    }
    /* Post alt class. */
    $classes[] = 'postonpage-' . ++$post_alt;
    if ($post_alt % 2) {
        $classes[] = 'odd';
    } else {
        $classes[] = 'even';
    }
    /* Sticky class (only on home/blog page). */
    if (is_sticky() && is_home()) {
        $classes[] = 'sticky';
    }
    /* Author class. */
    if (!is_attachment()) {
        $classes[] = 'post-author-' . sanitize_html_class(get_the_author_meta('user_nicename'), get_the_author_meta('ID'));
    }
    /* User-created classes. This serves no purpose anymore */
    /*
    	if ( !empty( $class ) ) :
    		if ( !is_array( $class ) )
    			$class = preg_split( '#\s+#', $class );
    		$classes = array_merge( $classes, $class );
    	endif;
    */
    /* Password-protected posts. */
    if (post_password_required()) {
        $classes[] = 'protected';
    }
    return $classes;
}
Esempio n. 14
0
 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();
 }