function ceo_admin_print_styles()
{
    wp_admin_css('css/global');
    wp_admin_css('css/colors');
    wp_admin_css('css/ie');
    wp_enqueue_style('comiceasel-options-style', ceo_pluginfo('plugin_url') . 'css/config.css');
}
 function widget($args, $instance)
 {
     global $post;
     extract($args, EXTR_SKIP);
     echo $before_widget;
     $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
     if (!empty($title)) {
         echo $before_title . $title . $after_title;
     }
     if ((is_home() || is_front_page()) && !is_paged() && !ceo_pluginfo('disable_comic_on_home_page')) {
         $chapter_on_home = '';
         $chapter_on_home = get_term_by('id', ceo_pluginfo('chapter_on_home'), 'chapters');
         $chapter_on_home = !is_wp_error($chapter_on_home) && !empty($chapter_on_home) ? '&chapters=' . $chapter_on_home->slug : '';
         $order = ceo_pluginfo('display_first_comic_on_home_page') ? 'asc' : 'desc';
         $query_args = 'post_type=comic&showposts=1&order=' . $order . $chapter_on_home;
         apply_filters('ceo_display_comic_mininav_home_query', $query_args);
         $comicFrontpage = new WP_Query();
         $comicFrontpage->query($query_args);
         while ($comicFrontpage->have_posts()) {
             $comicFrontpage->the_post();
             ceo_list_jump_to_comic($instance['exclude'], false);
         }
     } elseif (!empty($post)) {
         ceo_list_jump_to_comic($instance['exclude'], false);
     }
     echo $after_widget;
 }
function ceo_check_directory($dirpath)
{
    $output = '';
    if (is_dir(ceo_pluginfo($dirpath))) {
        $output = '<span style="color:green;">' . __('Directory Exists,', 'comiceasel') . '</span>';
        if (is_writable(ceo_pluginfo($dirpath))) {
            $output .= ' <span style="color:green;">' . __('and is writable.', 'comiceasel') . '</span>';
        } else {
            $output .= ' <span style="color:red;">' . __('and is not writable.', 'comiceasel') . '</span>';
        }
    } else {
        $output = '<span style="color:red;">' . __('Directory does not exist,', 'comiceasel') . '</span>';
    }
    return $output;
}
 function widget($args, $instance)
 {
     global $post, $wp_query;
     if (!is_home() && $instance['onlyhome']) {
         return;
     }
     if (is_page() || is_archive() || is_search() || is_404()) {
         return;
     }
     extract($args, EXTR_SKIP);
     ceo_protect();
     if ((is_home() || is_front_page()) && !is_paged() && !ceo_pluginfo('disable_comic_on_home_page')) {
         $order = ceo_pluginfo('display_first_comic_on_home_page') ? 'asc' : 'desc';
         $args = array('showposts' => 1, 'posts_per_page' => 1, 'order' => $order, 'post_type' => 'comic');
         $posts = get_posts($args);
         foreach ($posts as $post) {
             setup_postdata($post);
             if (!($instance['hidecontent'] && empty($post->post_content))) {
                 echo $before_widget;
                 $temp_query = $wp_query->is_single;
                 $wp_query->is_single = true;
                 $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
                 ceo_display_comic_small_blog_post($instance);
                 $wp_query->is_single = $temp_query;
                 echo $after_widget;
             }
         }
     } elseif ($post->post_type == 'comic') {
         setup_postdata($post);
         if (!($instance['hidecontent'] && empty($post->post_content)) && $post->post_type == 'comic') {
             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";
             }
             ceo_display_comic_small_blog_post($instance);
             echo $after_widget;
         }
     }
     ceo_unprotect();
 }
function ceo_comic_archive_jump_to_chapter($hide = true, $exclude = '', $showcount = false, $jumptoarchive = false, $echo = true, $render_as_list = false)
{
    ceo_protect();
    $output = '';
    if ($render_as_list) {
        global $post;
        $the_terms = get_the_terms($post->ID, 'chapters');
        // echo "<pre>the terms ";print_r($the_terms); echo "</pre>";
        $args = array('walker' => new ceo_walker_taxonomy_list(), 'orderby' => 'menu_order', 'order' => 'ASC', 'show_count' => $showcount, 'hide_empty' => $hide, 'exclude' => $exclude, 'echo' => false, 'hierarchical' => 1, 'taxonomy' => 'chapters', 'current_category' => $the_terms, 'title_li' => null, 'jumptoarchive' => $jumptoarchive, 'render_as_list' => $render_as_list);
        $output .= '<ul class="chapter-select">';
        $output .= wp_list_categories($args);
        $output .= '</ul>';
    } else {
        $args = array('walker' => new ceo_walker_taxonomy_dropdown(), 'show_option_all' => __('Select', 'comiceasel') . ' ' . ucwords(ceo_pluginfo('chapter_type_slug_name')), 'option_none_value' => '-1', 'orderby' => 'menu_order', 'order' => 'ASC', 'name' => ceo_pluginfo('chapter_type_slug_name'), 'show_count' => $showcount, 'hide_empty' => $hide, 'exclude' => $exclude, 'echo' => false, 'hierarchical' => 1, 'taxonomy' => 'chapters', 'hide_if_empty' => $hide, 'value_field' => 'slug', 'jumptoarchive' => $jumptoarchive, 'render_as_list' => $render_as_list);
        $output .= '<form id="chapter-select" class="chapter-select" method="get">' . "\r\n";
        $select = wp_dropdown_categories($args);
        $replace = '<select$1 onchange="document.location.href=this.options[this.selectedIndex].value;">';
        $output .= preg_replace('#<select([^>]*)>#', $replace, $select);
        $output .= "\t<noscript>\r\n";
        $output .= "\t\t<input type=\"submit\" value=\"View\" />\r\n";
        $output .= "\t</noscript>\r\n";
        $output .= "</form>\r\n";
    }
    ceo_unprotect();
    if ($echo) {
        echo $output;
    } else {
        return $output;
    }
}
Exemple #6
0
function ceo_display_buycomic($atts, $content = '')
{
    global $post;
    extract(shortcode_atts(array('character' => '', 'thanks' => __('Thank you for the purchase!', 'comiceasel'), 'cancelled' => __('You have cancelled the transaction.')), $atts));
    $buy_output = '';
    if (isset($_REQUEST['id'])) {
        $comicnum = intval($_REQUEST['id']);
    }
    if (isset($_REQUEST['action'])) {
        $action = esc_attr($_REQUEST['action']);
        switch ($action) {
            case 'thankyou':
                $buy_output .= '<div class="buycomic-thankyou">';
                $buy_output .= $thanks;
                $buy_output .= '</div>';
                break;
            case 'cancelled':
                $buy_output .= '<div class="buycomic-cancelled">';
                $buy_output .= $cancelled;
                $buy_output .= '</div>';
                break;
        }
    }
    if (isset($comicnum)) {
        $buy_print_orig_amount = get_post_meta($comicnum, 'buy_print_orig_amount', true);
        if (empty($buy_print_orig_amount)) {
            $buy_print_orig_amount = ceo_pluginfo('buy_comic_orig_amount');
        }
        $buy_print_amount = get_post_meta($comicnum, 'buy_print_amount', true);
        if (empty($buy_print_amount)) {
            $buy_print_amount = ceo_pluginfo('buy_comic_print_amount');
        }
        $buyprint_status = get_post_meta($comicnum, 'buyprint-status', true);
        if (empty($buyprint_status)) {
            $buyprint_status = __('Available', 'comiceasel');
        }
        $buyorig_status = get_post_meta($comicnum, 'buyorig-status', true);
        if (empty($buyorig_status)) {
            $buyorig_status = __('Available', 'comiceasel');
        }
        ceo_protect();
        $post =& get_post($comicnum);
        // Get the post
        if (!is_wp_error($post) && !empty($post)) {
            // error check make sure it got a post
            $buy_output .= __('Comic ID', 'comiceasel') . ' #' . $comicnum . "<br />\r\n";
            $buy_output .= __('Title: ', 'comiceasel') . get_the_title($post) . "<br />\r\n";
            if (ceo_pluginfo('buy_comic_sell_print')) {
                $buy_output .= __('Print Status: ', 'comiceasel') . $buyprint_status . "<br />\r\n";
            }
            if (ceo_pluginfo('buy_comic_sell_original')) {
                $buy_output .= __('Original Status: ', 'comiceasel') . $buyorig_status . "<br />\r\n";
            }
            $buy_output .= "<br />\r\n";
            $buy_output .= '<table class="buytable" style="width:100%;">';
            $buy_output .= '<tr>';
            // buy print
            if (ceo_pluginfo('buy_comic_sell_print')) {
                $buy_output .= '<td align="left" valign="top" style="width:50%;">';
                $buy_output .= '<div class="buycomic-us-form">';
                $buy_output .= '<h4 class="buycomic-title">Print</h4>';
                $buy_output .= '$' . $buy_print_amount . '<br />';
                if ($buyprint_status == __('Available', 'comiceasel')) {
                    $buy_output .= '<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
                    $buy_output .= '<input type="hidden" name="add" value="1" />';
                    $buy_output .= '<input type="hidden" name="cmd" value="_cart" />';
                    $buy_output .= '<input type="hidden" name="notify_url" value="' . home_url() . '/?ceopaypalipn">';
                    $buy_output .= '<input type="hidden" name="item_name" value="' . __('Print', 'comiceasel') . ' - ' . get_the_title($post->ID) . ' - ' . $post->ID . '" />';
                    // Say a thank you and that transaction went through with an action
                    $url = ceo_pluginfo('buy_comic_url');
                    $url_and = strpos($url, '?') ? $url . '&amp;' : $url . '?';
                    $buy_output .= '<input type="hidden" name="return" value="' . $url_and . 'action=thankyou&amp;id=' . $comicnum . '" />';
                    $buy_output .= '<input type="hidden" name="amount" value="' . $buy_print_amount . '" />';
                    $buy_output .= '<input type="hidden" name="item_number" value="' . $comicnum . '" />';
                    $buy_output .= '<input type="hidden" name="business" value="' . ceo_pluginfo('buy_comic_email') . '" />';
                    $buy_output .= '<input type="image" src="' . ceo_pluginfo('plugin_url') . 'images/buynow_paypal.png" name="submit32" alt="' . __('Make payments with PayPal - it is fast, free and secure!', 'comicpress') . '" />';
                    $buy_output .= '</form>';
                }
                if ($buyprint_status == __('Sold', 'comiceasel')) {
                    $buy_output .= '<img src="' . ceo_pluginfo('plugin_url') . 'images/sold.png" alt="' . __('Sold', 'comiceasel') . '" />';
                } elseif ($buyprint_status == __('Out Of Stock', 'comiceasel')) {
                    $buy_output .= '<img src="' . ceo_pluginfo('plugin_url') . 'images/outofstock.png" alt="' . __('Out Of Stock', 'comiceasel') . '" />';
                } elseif ($buyprint_status == __('Not Available', 'comiceasel')) {
                    $buy_output .= '<img src="' . ceo_pluginfo('plugin_url') . 'images/notavailable.png" alt="' . __('Not Available', 'comiceasel') . '" />';
                }
                $buy_output .= '</div>';
                $buy_output .= '</td>';
            }
            // buy original
            if (ceo_pluginfo('buy_comic_sell_original')) {
                $buy_output .= '<td align="left" valign="top" style="width:50%;">';
                $buy_output .= '<div class="buycomic-us-form" style="width:100%;">';
                $buy_output .= '<h4 class="buycomic-title">Original</h4>';
                $buy_output .= '$' . $buy_print_orig_amount . '<br />';
                if ($buyorig_status == __('Available', 'comiceasel')) {
                    $buy_output .= '<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
                    $buy_output .= '<input type="hidden" name="add" value="1" />';
                    $buy_output .= '<input type="hidden" name="cmd" value="_cart" />';
                    $buy_output .= '<input type="hidden" name="notify_url" value="' . home_url() . '/?ceopaypalipn">';
                    $buy_output .= '<input type="hidden" name="item_name" value="' . __('Original', 'comiceasel') . ' - ' . get_the_title($post->ID) . ' - ' . $post->ID . '" />';
                    // Say a thank you and that transaction went through with an action
                    $url = ceo_pluginfo('buy_comic_url');
                    $url_and = strpos($url, '?') ? $url . '&amp;' : $url . '?';
                    $buy_output .= '<input type="hidden" name="return" value="' . $url_and . 'action=thankyou&amp;id=' . $comicnum . '" />';
                    $buy_output .= '<input type="hidden" name="amount" value="' . $buy_print_orig_amount . '" />';
                    $buy_output .= '<input type="hidden" name="item_number" value="' . $comicnum . '" />';
                    $buy_output .= '<input type="hidden" name="business" value="' . ceo_pluginfo('buy_comic_email') . '" />';
                    $buy_output .= '<input type="image" src="' . ceo_pluginfo('plugin_url') . 'images/buynow_paypal.png" name="submit32" alt="' . __('Make payments with PayPal - it is fast, free and secure!', 'comicpress') . '" />';
                    $buy_output .= '</form>';
                }
                if ($buyorig_status == __('Sold', 'comiceasel')) {
                    $buy_output .= '<img src="' . ceo_pluginfo('plugin_url') . 'images/sold.png" alt="' . __('Sold', 'comiceasel') . '" />';
                } elseif ($buyorig_status == __('Out Of Stock', 'comiceasel')) {
                    $buy_output .= '<img src="' . ceo_pluginfo('plugin_url') . 'images/outofstock.png" alt="' . __('Out Of Stock', 'comiceasel') . '" />';
                } elseif ($buyorig_status == __('Not Available', 'comiceasel')) {
                    $buy_output .= '<img src="' . ceo_pluginfo('plugin_url') . 'images/notavailable.png" alt="' . __('Not Available', 'comiceasel') . '" />';
                }
                $buy_output .= '</div>';
                $buy_output .= '</td>';
            }
            $buy_output .= '</tr>';
            $buy_output .= "</table>\r\n";
            $buy_output .= '<div class="buy-thumbnail">';
            $buy_output .= ceo_display_comic_thumbnail('large', $post);
            $buy_output .= "</div>\r\n";
            /*			$last_info = get_option('ceo_paypal_receiver'); // Debug to see the last transaction, which is stored in this option
            					if (!empty($last_info)) $buy_output .= nl2br($last_info); */
        } else {
            $buy_output .= __('Invalid Comic ID.', 'comiceasel') . "<br />\r\n";
        }
        ceo_unprotect();
    }
    return $buy_output;
}
function ceo_display_comic_area()
{
    global $wp_query, $post;
    if (is_single()) {
        ceo_display_comic_wrapper();
    } else {
        if ((is_home() || is_front_page()) && !is_paged() && !ceo_pluginfo('disable_comic_on_home_page')) {
            ceo_protect();
            $chapter_on_home = '';
            $chapter_on_home = get_term_by('id', ceo_pluginfo('chapter_on_home'), 'chapters');
            $chapter_on_home = !is_wp_error($chapter_on_home) && !empty($chapter_on_home) ? $chapter_on_home->slug : '';
            $order = ceo_pluginfo('display_first_comic_on_home_page') ? 'asc' : 'desc';
            $comic_args = array('showposts' => 1, 'posts_per_page' => 1, 'post_type' => 'comic', 'order' => $order, 'chapters' => $chapter_on_home);
            $comicFrontpage = new WP_Query();
            $comicFrontpage->query($comic_args);
            while ($comicFrontpage->have_posts()) {
                $comicFrontpage->the_post();
                ceo_display_comic_wrapper();
            }
            ceo_unprotect();
        }
    }
}
Exemple #8
0
    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;
    }
function ceo_social_meta()
{
    global $post;
    if (!empty($post) && $post->post_type == 'comic') {
        //		echo '<meta name="twitter:card" content="summary">'."\r\n";
        //		echo '<meta name="twitter:site" content="'.get_bloginfo('name').'">'."\r\n";
        if (is_single() || is_page()) {
            $quick_excerpt = esc_attr(get_the_excerpt());
            //			echo '<meta name="twitter:description" content="'.$quick_excerpt.'" />'."\r\n";
            //			echo '<meta name="twitter:title" content="'.get_the_title().'" />'."\r\n";
        } else {
            //			echo '<meta name="twitter:description" content="'.get_bloginfo('description').'" />'."\r\n";
            //			echo '<meta name="twitter:title" content="" />'."\r\n";
        }
        $post_image_id = get_post_thumbnail_id($post->ID);
        $thumbnail = wp_get_attachment_image_src($post_image_id, ceo_pluginfo('thumbnail_size_for_facebook'), false);
        if (is_array($thumbnail)) {
            $thumbnail = reset($thumbnail);
            echo '<meta property="og:image" content="' . $thumbnail . '" />' . "\r\n";
            //			echo '<meta name="twitter:image" content="'.$thumbnail.'" />'."\r\n";
        }
    }
}
function ceo_comic_archive_jump_to_chapter($unhide = false, $exclude = '', $showcount = false, $jumptoarchive = true, $return = false)
{
    ceo_protect();
    $args = array('pad_counts' => 1, 'orderby' => 'menu_order', 'order' => 'ASC', 'hide_empty' => $unhide, 'exclude' => $exclude, 'parent' => 0);
    $parent_chapters = get_terms('chapters', $args);
    $output = '<form method="get" class="comic-archive-dropdown-form">';
    $output .= '<select onchange="document.location.href=this.options[this.selectedIndex].value;">';
    $level = 0;
    $output .= '<option class="level-select" value="">' . __('Select', 'comiceasel') . ' ' . ucwords(ceo_pluginfo('chapter_type_slug_name')) . '</option>';
    if (!is_null($parent_chapters)) {
        foreach ($parent_chapters as $parent_chapter) {
            $thecount = $showcount ? '&nbsp;(' . $parent_chapter->count . ')' : '';
            if ($parent_chapter->count) {
                $permalink = '';
                if (!$jumptoarchive) {
                    $parent_args = array('numberposts' => 1, 'post_type' => 'comic', 'order' => 'ASC', 'post_status' => 'publish', 'chapters' => $parent_chapter->slug);
                    $qposts = get_posts($parent_args);
                    if (is_array($qposts) && !is_wp_error($qposts) && !empty($qposts)) {
                        $qposts = reset($qposts);
                        $permalink = get_permalink($qposts->ID);
                    }
                } else {
                    $permalink = get_term_link($parent_chapter->slug, 'chapters');
                }
                if (!empty($permalink)) {
                    $output .= '<option class="level-0" value="' . esc_url($permalink) . '">' . $parent_chapter->name . $thecount . '</option>';
                }
            } elseif (!$unhide) {
                $output .= '<option class="level-0" value="" disabled>' . $parent_chapter->name . '</option>';
            }
            $child_chapters = get_term_children($parent_chapter->term_id, 'chapters');
            $args = array('pad_counts' => 1, 'orderby' => 'menu_order', 'order' => 'ASC', 'hide_empty' => $unhide, 'child_of' => $parent_chapter->term_id, 'exclude' => array($exclude));
            $child_chapters = get_terms('chapters', $args);
            foreach ($child_chapters as $child) {
                $child_term = get_term_by('id', $child->term_id, 'chapters');
                $thecount = 0;
                $thecount = $showcount ? '(' . $child_term->count . ')' : '';
                if ($child_term->count) {
                    $child_args = array('numberposts' => 1, 'post_type' => 'comic', 'order' => 'ASC', 'post_status' => 'publish', 'chapters' => $child_term->slug);
                    if (!$jumptoarchive) {
                        $qcposts = get_posts($child_args);
                        if (is_array($qcposts)) {
                            $qcposts = reset($qcposts);
                            $permalink = get_permalink($qcposts->ID);
                        }
                    } else {
                        $permalink = get_term_link($child_term->slug, 'chapters');
                    }
                    if (!empty($permalink)) {
                        $output .= '<option class="level-1" value="' . esc_url($permalink) . '">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $child_term->name . ' ' . $thecount . '</option>';
                    }
                }
            }
        }
    }
    $output .= '</select>';
    $output .= '<noscript>';
    $output .= '<div><input type="submit" value="View" /></div>';
    $output .= '</noscript>';
    $output .= '</form>';
    if ($return) {
        return $output;
    } else {
        echo $output;
    }
    ceo_unprotect();
}
Exemple #11
0
    ?>
" class="comiceasel-tab <?php 
    echo $tab == $tab_id ? 'on' : 'off';
    ?>
"><span><?php 
    echo $label;
    ?>
</span></div>
		  	<?php 
}
?>
		</div>

		<div id="comiceasel-options-pages">
		  <?php 
foreach (glob(ceo_pluginfo('plugin_path') . 'options/*.php') as $file) {
    include $file;
}
?>
		</div>
	</div>
	<script type="text/javascript">
		(function($) {
			var showPage = function(which) {
				$('#comiceasel-options-pages > div').each(function(i) {
					$(this)[(this.id == 'comiceasel-' + which) ? 'show' : 'hide']();
				});
			};

			$('.comiceasel-tab').click(function() {
				$('#message').animate({height:"0", opacity:0, margin: 0}, 100, 'swing', function() { $(this).remove() });
Exemple #12
0
    function widget($args, $instance)
    {
        global $post;
        extract($args, EXTR_SKIP);
        ceo_protect();
        if (is_single() && $post->post_type == 'comic' || is_home() || is_front_page()) {
            if ((is_home() || is_front_page()) && (is_paged() || ceo_pluginfo('disable_comic_on_home_page') || is_page())) {
                return;
            }
            // This section allows the plugin to work in any sidebar even on home, except (paged) files
            if ((is_home() || is_front_page()) && !is_paged() && !ceo_pluginfo('disable_comic_on_home_page')) {
                $order = ceo_pluginfo('display_first_comic_on_home_page') ? 'asc' : 'desc';
                $args = array('showposts' => 1, 'posts_per_page' => 1, 'order' => $order, 'post_type' => 'comic');
                $posts = get_posts($args);
                $post = reset($posts);
            }
            $post_characters = get_the_terms($post->ID, 'characters');
            if (!empty($post_characters)) {
                echo $before_widget;
                $title = apply_filters('widget_title', $instance['title']);
                if ($title) {
                    echo $before_title . $title . $after_title;
                }
                ?>
<div class="castrefwidget-wrapper"><?php 
                foreach ($post_characters as $mychar) {
                    $out[] = '<span class="castrefwidget-line casthover-hovercard-hook"><a href="' . get_term_link($mychar->slug, 'characters') . '"><div class="castrefwidget-block character-' . $mychar->slug . '"></div></a>' . ceo_insert_character_hovercard($mychar->slug) . '</span>';
                }
                echo join('', $out);
                ?>
</div><?php 
                echo $after_widget;
            }
            ceo_unprotect();
        }
    }
    function form($instance)
    {
        $instance = wp_parse_args((array) $instance, array('previous_chap' => false, 'next_chap' => false, 'first_in' => false, 'last_in' => false, 'previous_in' => false, 'next_in' => false, 'first' => false, 'last' => false, 'previous' => false, 'next' => false, 'random' => false, 'archives' => false, 'comments' => false, 'comictitle' => false, 'comicchapter' => false, 'imageurl' => false, 'buycomic' => false, 'archive_path' => '', 'previous_chap_title' => __('<[ Prev Chapter', 'comiceasel'), 'next_chap_title' => __('Next Chapter ]>', 'comiceasel'), 'first_in_title' => __('<<[ First', 'comiceasel'), 'last_in_title' => __('Last ]>>', 'comiceasel'), 'previous_in_title' => __('<[ Prev', 'comiceasel'), 'next_in_title' => __('Next ]>', 'comiceasel'), 'first_title' => __('<< First', 'comiceasel'), 'last_title' => __('Last >>', 'comiceasel'), 'previous_title' => __('< Prev', 'comiceasel'), 'next_title' => __('Next >', 'comiceasel'), 'random_title' => __('Random', 'comiceasel'), 'archives_title' => __('Archives', 'comiceasel'), 'comments_title' => __('Comments', 'comiceasel'), 'buycomic_title' => __('Buy!', 'comiceasel')));
        ?>
		<input id="<?php 
        echo $this->get_field_id('first');
        ?>
" name="<?php 
        echo $this->get_field_name('first');
        ?>
" type="checkbox" value="1" <?php 
        checked(true, $instance['first']);
        ?>
 /> <label for="<?php 
        echo $this->get_field_id('first');
        ?>
"><strong><?php 
        _e('First', 'comiceasel');
        ?>
</strong></label><br />
		<input id="<?php 
        echo $this->get_field_id('first_title');
        ?>
" name="<?php 
        echo $this->get_field_name('first_title');
        ?>
" type="text" value="<?php 
        echo $instance['first_title'];
        ?>
" /><br /> 
		<br />

		<input id="<?php 
        echo $this->get_field_id('last');
        ?>
" name="<?php 
        echo $this->get_field_name('last');
        ?>
" type="checkbox" value="1" <?php 
        checked(true, $instance['last']);
        ?>
 /> <label for="<?php 
        echo $this->get_field_id('last');
        ?>
"><strong><?php 
        _e('Last', 'comiceasel');
        ?>
</strong></label><br />
		<input id="<?php 
        echo $this->get_field_id('last_title');
        ?>
" name="<?php 
        echo $this->get_field_name('last_title');
        ?>
" type="text" value="<?php 
        echo $instance['last_title'];
        ?>
" /><br />
		<br />
		
		<input id="<?php 
        echo $this->get_field_id('previous');
        ?>
" name="<?php 
        echo $this->get_field_name('previous');
        ?>
" type="checkbox" value="1" <?php 
        checked(true, $instance['previous']);
        ?>
 /> <label for="<?php 
        echo $this->get_field_id('previous');
        ?>
"><strong><?php 
        _e('Previous', 'comiceasel');
        ?>
</strong></label><br />
		<input id="<?php 
        echo $this->get_field_id('previous_title');
        ?>
" name="<?php 
        echo $this->get_field_name('previous_title');
        ?>
" type="text" value="<?php 
        echo $instance['previous_title'];
        ?>
" /><br />
		<br />
		
		<input id="<?php 
        echo $this->get_field_id('next');
        ?>
" name="<?php 
        echo $this->get_field_name('next');
        ?>
" type="checkbox" value="1" <?php 
        checked(true, $instance['next']);
        ?>
 /> <label for="<?php 
        echo $this->get_field_id('next');
        ?>
"><strong><?php 
        _e('Next', 'comiceasel');
        ?>
</strong></label><br />
		<input id="<?php 
        echo $this->get_field_id('next_title');
        ?>
" name="<?php 
        echo $this->get_field_name('next_title');
        ?>
" type="text" value="<?php 
        echo $instance['next_title'];
        ?>
" /><br />
		<br />
		
		<input id="<?php 
        echo $this->get_field_id('first_in');
        ?>
" name="<?php 
        echo $this->get_field_name('first_in');
        ?>
" type="checkbox" value="1" <?php 
        checked(true, $instance['first_in']);
        ?>
 /> <label for="<?php 
        echo $this->get_field_id('first_in');
        ?>
"><strong><?php 
        _e('First in Chapter', 'comiceasel');
        ?>
</strong></label><br />
		<input id="<?php 
        echo $this->get_field_id('first_in_title');
        ?>
" name="<?php 
        echo $this->get_field_name('first_in_title');
        ?>
" type="text" value="<?php 
        echo $instance['first_in_title'];
        ?>
" /><br />   
		<br />
		
		<input id="<?php 
        echo $this->get_field_id('last_in');
        ?>
" name="<?php 
        echo $this->get_field_name('last_in');
        ?>
" type="checkbox" value="1" <?php 
        checked(true, $instance['last_in']);
        ?>
 /> <label for="<?php 
        echo $this->get_field_id('last_in');
        ?>
"><strong><?php 
        _e('Last in Chapter', 'comiceasel');
        ?>
</strong></label><br />
		<input id="<?php 
        echo $this->get_field_id('last_in_title');
        ?>
" name="<?php 
        echo $this->get_field_name('last_in_title');
        ?>
" type="text" value="<?php 
        echo $instance['last_in_title'];
        ?>
" /><br />
		<br />
		
		<input id="<?php 
        echo $this->get_field_id('previous_in');
        ?>
" name="<?php 
        echo $this->get_field_name('previous_in');
        ?>
" type="checkbox" value="1" <?php 
        checked(true, $instance['previous_in']);
        ?>
 /> <label for="<?php 
        echo $this->get_field_id('previous_in');
        ?>
"><strong><?php 
        _e('Previous in Chapter', 'comiceasel');
        ?>
</strong></label><br />
		<input id="<?php 
        echo $this->get_field_id('previous_in_title');
        ?>
" name="<?php 
        echo $this->get_field_name('previous_in_title');
        ?>
" type="text" value="<?php 
        echo $instance['previous_in_title'];
        ?>
" /><br />   
		<br />
		
		<input id="<?php 
        echo $this->get_field_id('next_in');
        ?>
" name="<?php 
        echo $this->get_field_name('next_in');
        ?>
" type="checkbox" value="1" <?php 
        checked(true, $instance['next_in']);
        ?>
 /> <label for="<?php 
        echo $this->get_field_id('next_in');
        ?>
"><strong><?php 
        _e('Next in Chapter', 'comiceasel');
        ?>
</strong></label><br />
		<input id="<?php 
        echo $this->get_field_id('next_in_title');
        ?>
" name="<?php 
        echo $this->get_field_name('next_in_title');
        ?>
" type="text" value="<?php 
        echo $instance['next_in_title'];
        ?>
" /><br />
		<br />
		
		<input id="<?php 
        echo $this->get_field_id('previous_chap');
        ?>
" name="<?php 
        echo $this->get_field_name('previous_chap');
        ?>
" type="checkbox" value="1" <?php 
        checked(true, $instance['previous_chap']);
        ?>
 /> <label for="<?php 
        echo $this->get_field_id('previous_chap');
        ?>
"><strong><?php 
        _e('Previous Chapter', 'comiceasel');
        ?>
</strong></label><br />
		<input id="<?php 
        echo $this->get_field_id('previous_chap_title');
        ?>
" name="<?php 
        echo $this->get_field_name('previous_chap_title');
        ?>
" type="text" value="<?php 
        echo $instance['previous_chap_title'];
        ?>
" /><br />   
		<br />
		
		<input id="<?php 
        echo $this->get_field_id('next_chap');
        ?>
" name="<?php 
        echo $this->get_field_name('next_chap');
        ?>
" type="checkbox" value="1" <?php 
        checked(true, $instance['next_chap']);
        ?>
 /> <label for="<?php 
        echo $this->get_field_id('next_chap');
        ?>
"><strong><?php 
        _e('Next Chapter', 'comiceasel');
        ?>
</strong></label><br />
		<input id="<?php 
        echo $this->get_field_id('next_chap_title');
        ?>
" name="<?php 
        echo $this->get_field_name('next_chap_title');
        ?>
" type="text" value="<?php 
        echo $instance['next_chap_title'];
        ?>
" /><br />
		<br />
		
		<input id="<?php 
        echo $this->get_field_id('comictitle');
        ?>
" name="<?php 
        echo $this->get_field_name('comictitle');
        ?>
" type="checkbox" value="1" <?php 
        checked(true, $instance['comictitle']);
        ?>
 /> <label for="<?php 
        echo $this->get_field_id('comictitle');
        ?>
"><strong><?php 
        _e('Comic Title', 'comiceasel');
        ?>
</strong></label>
		<br />
		
		<input id="<?php 
        echo $this->get_field_id('comicchapter');
        ?>
" name="<?php 
        echo $this->get_field_name('comicchapter');
        ?>
" type="checkbox" value="1" <?php 
        checked(true, $instance['comicchapter']);
        ?>
 /> <label for="<?php 
        echo $this->get_field_id('comicchapter');
        ?>
"><strong><?php 
        _e('Comic Chapter', 'comiceasel');
        ?>
</strong></label><br />
		<br />
		
		<input id="<?php 
        echo $this->get_field_id('archives');
        ?>
" name="<?php 
        echo $this->get_field_name('archives');
        ?>
" type="checkbox" value="1" <?php 
        checked(true, $instance['archives']);
        ?>
 /> <label for="<?php 
        echo $this->get_field_id('archives');
        ?>
"><strong><?php 
        _e('Archives', 'comiceasel');
        ?>
</strong></label><br />
		<input id="<?php 
        echo $this->get_field_id('archives_title');
        ?>
" name="<?php 
        echo $this->get_field_name('archives_title');
        ?>
" type="text" value="<?php 
        echo $instance['archives_title'];
        ?>
" /><br />   
		Archive URL: <input class="widefat" id="<?php 
        echo $this->get_field_id('archive_path');
        ?>
" name="<?php 
        echo $this->get_field_name('archive_path');
        ?>
" type="text" value="<?php 
        echo $instance['archive_path'];
        ?>
" /><br />
		<br />
		
		<input id="<?php 
        echo $this->get_field_id('comments');
        ?>
" name="<?php 
        echo $this->get_field_name('comments');
        ?>
" type="checkbox" value="1" <?php 
        checked(true, $instance['comments']);
        ?>
 /> <label for="<?php 
        echo $this->get_field_id('comments');
        ?>
"><strong><?php 
        _e('Comments', 'comiceasel');
        ?>
</strong></label><br />
		<input id="<?php 
        echo $this->get_field_id('comments_title');
        ?>
" name="<?php 
        echo $this->get_field_name('comments_title');
        ?>
" type="text" value="<?php 
        echo $instance['comments_title'];
        ?>
" /><br />   
		<br />
		
		<input id="<?php 
        echo $this->get_field_id('random');
        ?>
" name="<?php 
        echo $this->get_field_name('random');
        ?>
" type="checkbox" value="1" <?php 
        checked(true, $instance['random']);
        ?>
 /> <label for="<?php 
        echo $this->get_field_id('random');
        ?>
"><strong><?php 
        _e('Random', 'comiceasel');
        ?>
</strong></label><br />
		<input id="<?php 
        echo $this->get_field_id('random_title');
        ?>
" name="<?php 
        echo $this->get_field_name('random_title');
        ?>
" type="text" value="<?php 
        echo $instance['random_title'];
        ?>
" /><br />   
		<br />
<?php 
        if (ceo_pluginfo('enable_buy_comic')) {
            ?>
		<input id="<?php 
            echo $this->get_field_id('buycomic');
            ?>
" name="<?php 
            echo $this->get_field_name('buycomic');
            ?>
" type="checkbox" value="1" <?php 
            checked(true, $instance['buycomic']);
            ?>
 /> <label for="<?php 
            echo $this->get_field_id('buycomic');
            ?>
"><strong><?php 
            _e('Buy!', 'comiceasel');
            ?>
</strong></label><br />
		<input id="<?php 
            echo $this->get_field_id('buycomic_title');
            ?>
" name="<?php 
            echo $this->get_field_name('buycomic_title');
            ?>
" type="text" value="<?php 
            echo $instance['buycomic_title'];
            ?>
" /><br />   
		<br />
<?php 
        }
        ?>
		
		<input id="<?php 
        echo $this->get_field_id('imageurl');
        ?>
" name="<?php 
        echo $this->get_field_name('imageurl');
        ?>
" type="checkbox" value="1" <?php 
        checked(true, $instance['imageurl']);
        ?>
 /> <label for="<?php 
        echo $this->get_field_id('imageurl');
        ?>
"><strong><?php 
        _e('ImageURL', 'comiceasel');
        ?>
</strong></label>
		<?php 
    }
function ceo_handle_edit_save_comic($post_id, $post)
{
    global $post;
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
        return $post->ID;
    }
    /* Verify the nonce before proceeding. */
    if (!isset($_POST['comic_nonce']) || !wp_verify_nonce($_POST['comic_nonce'], basename(__FILE__))) {
        return $post_id;
    }
    /* Get the post type object. */
    $post_type = get_post_type_object($post->post_type);
    /* Check if the current user has permission to edit the post. */
    if (!current_user_can($post_type->cap->edit_post, $post_id)) {
        return $post_id;
    }
    $meta_array = array('transcript', 'comic-html-above', 'comic-html-below', 'comic-hovertext', 'comic-gallery', 'comic-gallery-columns', 'comic-open-lightbox', 'comic-gallery-full', 'comic-gallery-jquery', 'buyprint-status', 'buyorig-status', 'flash_file', 'flash_height', 'flash_width', 'media_url', 'media_width', 'link-to', 'comic-has-map', 'location-overwrite');
    $defaultorigamount = ceo_pluginfo('buy_comic_orig_amount');
    $defaultbuyprintamount = ceo_pluginfo('buy_comic_print_amount');
    if (isset($_POST['buy_print_amount'])) {
        $buyprint = esc_textarea($_POST['buy_print_amount']);
        if ($buyprint !== $defaultbuyprintamount) {
            $meta_array[] = 'buy_print_amount';
        }
    }
    if (isset($_POST['buy_print_orig_amount'])) {
        $buyorig = esc_textarea($_POST['buy_print_orig_amount']);
        if ($buyorig !== $defaultorigamount) {
            $meta_array[] = 'buy_print_orig_amount';
        }
    }
    foreach ($meta_array as $meta_key) {
        $new_meta_value = isset($_POST[$meta_key]) ? esc_textarea($_POST[$meta_key]) : '';
        $meta_value = get_post_meta($post_id, $meta_key, true);
        if ($new_meta_value && '' == $meta_value) {
            add_post_meta($post_id, $meta_key, $new_meta_value, true);
        } elseif ($new_meta_value && $new_meta_value != $meta_value) {
            update_post_meta($post_id, $meta_key, $new_meta_value);
        } elseif ('' == $new_meta_value && $meta_value) {
            delete_post_meta($post_id, $meta_key, $meta_value);
        }
    }
}
function ceo_run_scripts()
{
    global $post;
    if (!empty($post)) {
        $comic_content_warning = get_post_meta($post->ID, 'comic-content-warning', true);
        if ($comic_content_warning) {
            wp_enqueue_script('ceo_comic_content_warning', ceo_pluginfo('plugin_url') . 'js/content-warning.js', null, null, true);
        }
    }
    if (!ceo_pluginfo('disable_keynav')) {
        wp_enqueue_script('ceo_keynav', ceo_pluginfo('plugin_url') . 'js/keynav.js', null, null, true);
    }
}
Exemple #16
0
function ceo_insert_comic_transcript_into_posts($content)
{
    global $post;
    if (ceo_pluginfo('enable_transcripts_in_comic_posts') && $post->post_type == 'comic') {
        $transcript = ceo_the_transcript('styled');
        return $content . $transcript;
    }
    return $content;
}
Exemple #17
0
function ceo_run_scripts()
{
    if (!ceo_pluginfo('disable_keynav')) {
        wp_enqueue_script('comicpress_keynav', ceo_pluginfo('plugin_url') . 'js/keynav.js', null, null, true);
    }
}
function ceo_display_comic_gallery($size = 'full')
{
    global $post;
    $output = '';
    if (ceo_pluginfo('click_comic_next')) {
        if (ceo_pluginfo('navigate_only_chapters')) {
            $next_comic = ceo_get_next_comic_in_chapter_permalink();
        } else {
            $next_comic = ceo_get_next_comic_permalink();
        }
    }
    $hovertext = ceo_the_hovertext();
    $comic_galleries_full = get_post_meta($post->ID, 'comic-gallery-full', true);
    if ($comic_galleries_full) {
        $comic_lightbox = get_post_meta($post->ID, 'comic-open-lightbox', true);
        $comic_galleries_jquery = get_post_meta($post->ID, 'comic-gallery-jquery', true);
        if ($images = get_posts(array('post_parent' => $post->ID, 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC'))) {
            $count = 0;
            if ($comic_galleries_jquery) {
                wp_enqueue_script('multicomic', ceo_pluginfo('plugin_url') . 'js/multicomic.js', null, null, true);
            }
            foreach ($images as $image) {
                if ($comic_galleries_jquery) {
                    $output .= '<div id="comic-' . $count . '" class="comicpane">';
                }
                $thumbnail = wp_get_attachment_image_src($image->ID, 'full');
                $thumbnail = reset($thumbnail);
                //				$thumbnail = apply_filters('jetpack_photon_url', $thumbnail);
                if ($comic_lightbox) {
                    $output .= '<a href="' . $thumbnail . '" title="' . $hovertext . '" rel="lightbox">';
                }
                if (ceo_pluginfo('click_comic_next') && !empty($next_comic) && !$comic_lightbox) {
                    $output .= '<a href="' . $next_comic . '" title="' . $hovertext . '">';
                }
                $output .= '<img src="' . $thumbnail . '" alt="' . $hovertext . '" title="' . $hovertext . '" />';
                if (ceo_pluginfo('click_comic_next') && !empty($next_comic) || $comic_lightbox) {
                    $output .= '</a>';
                }
                if ($comic_galleries_jquery) {
                    $output .= "</div>\r\n";
                }
                $count += 1;
            }
            if ($comic_galleries_jquery) {
                $output .= "<button id=\"show-" . $count . "\" type=\"button\" style=\"display:none;\">" . $count . "</button>\r\n";
            }
            //			if ($comic_lightbox) $output .= '<div class="comic-lightbox-text">'.__('Click comic to view larger version.','comiceasel').'</div>';
        }
    } else {
        $output .= ceo_display_featured_image_comic($size);
        $columns = get_post_meta($post->ID, 'comic-gallery-columns', true);
        if (empty($columns)) {
            $columns = 5;
        }
        $args = array('id' => $post->ID, 'columns' => $columns, 'exclude' => array($post->ID));
        $output .= gallery_shortcode($args);
    }
    return apply_filters('ceo_display_comic_gallery', $output);
}
			<br />
			<table class="widefat">
				<thead>
					<tr>
						<th colspan="3"><?php 
_e('Navigation Widget', 'comiceasel');
?>
</th>
					</tr>
				</thead>
<?php 
$current_gnav_directory = $ceo_options['graphic_navigation_directory'];
if (empty($current_gnav_directory)) {
    $current_gnav_directory = 'default';
}
$dirs_to_search = array_unique(array(stripslashes(ceo_pluginfo('plugin_path')), get_template_directory(), get_stylesheet_directory()));
$gnav_directories = array();
foreach ($dirs_to_search as $gnav_dir) {
    if (is_dir($gnav_dir . '/images/nav')) {
        $thisdir = null;
        $thisdir = array();
        $thisdir = glob($gnav_dir . '/images/nav/*');
        $gnav_directories = array_merge($gnav_directories, $thisdir);
    }
}
?>
				<tr>
					<th scope="row" colspan="2"><label for="graphic_navigation_directory"><?php 
_e('Graphic Navigation Set', 'comiceasel');
?>
</label>
function ceo_get_next_comic_in_chapter_permalink()
{
    $next_comic = ceo_get_next_comic(true);
    if (is_object($next_comic) && isset($next_comic->ID)) {
        return get_permalink($next_comic->ID);
    }
    // go to first comic of next chapter if possible
    if (ceo_pluginfo('enable_prevnext_chapter_traversing')) {
        $chapter = ceo_get_adjacent_chapter(false);
        if (is_object($chapter)) {
            $terminal = ceo_get_terminal_post_of_chapter($chapter->term_id, true);
            return !empty($terminal) ? get_permalink($terminal->ID) : false;
        }
    }
    return false;
}