示例#1
0
 * @uses WebcomicTag::the_webcomic()
 * @uses WebcomicTag::webcomic_dropdown_transcript_terms()
 * @uses WebcomicTag::get_webcomic_transcript_authors()
 * @uses WebcomicTag::get_the_webcomic_transcript_term_list()
 * @uses is_webcomic()
 * @uses webcomic_prints_available()
 * @uses is_webcomic_archive()
 * @uses is_webcomic_storyline()
 * @uses is_webcomic_character()
 */
if (is_webcomic()) {
    global $post;
    if (webcomic_prints_available()) {
        $prints = array();
        $prints[] = WebcomicTag::webcomic_print_form("domestic", sprintf(__('%1$s%2$s%%total Domestic', "webcomic"), __("%dec.", "webcomic"), __("%sep,", "webcomic")));
        $prints[] = WebcomicTag::webcomic_print_form("international", sprintf(__('%1$s%2$s%%total International', "webcomic"), __("%dec.", "webcomic"), __("%sep,", "webcomic")));
        if (webcomic_prints_available("original")) {
            $prints[] = WebcomicTag::webcomic_print_form("original", sprintf(__('%1$s%2$s%%total Original', "webcomic"), __("%dec.", "webcomic"), __("%sep,", "webcomic")));
        }
        if ("_cart" === self::$config["collections"][$post->post_type]["commerce"]["method"]) {
            $prints[] = WebcomicTag::webcomic_print_form("cart");
        }
        $append .= "<div class='webcomic-prints'><style scoped>.webcomic-prints form{display:inline}</style><h2>" . __("Prints", "webcomic") . "</h2><div>" . implode("\n", $prints) . "</div></div><!-- .webcomic-prints -->";
    }
    $append .= WebcomicTag::webcomic_collection_link("<div class='webcomic-collection'>%link</div><!-- .webcomic-collection -->", "%title");
    $append .= WebcomicTag::get_the_webcomic_term_list($post->ID, 'storyline', '<div class="webcomic-storylines"><b>' . __("Part of ", "webcomic") . "</b>", ", ", "</div><!-- .webcomic-storylines -->");
    $append .= WebcomicTag::get_the_webcomic_term_list($post->ID, 'character', '<div class="webcomic-characters"><b>' . __("Featuring ", "webcomic") . "</b>", ", ", "</div><!-- .webcomic-characters -->");
    $append .= WebcomicTag::webcomic_dropdown_transcript_terms(array("before" => "<div class='webcomic-transcript-languages'>", "sep" => __(" | ", "webcomic"), "after" => "</div><!-- .webcomic-transcript-languages-->", "show_option_all" => __("- Transcript Language -", "webcomic"), "taxonomy" => "webcomic_language"));
} elseif (is_webcomic_archive() or is_webcomic_storyline() or is_webcomic_character() or is_search()) {
    $prepend = "<div class='integrated-webcomic'><div class='webcomic-img'>" . WebcomicTag::the_webcomic("medium", "self") . "</div><!-- .webcomic-img --></div><!-- .integrated-webcomic -->";
}
示例#2
0
 /**
  * Render the widget.
  * 
  * @param array $args General widget arguments.
  * @param array $instance Specific instance arguments.
  * @uses WebcomicTag::get_webcomic_collection()
  * @uses WebcomicTag::relative_webcomic_term_link()
  */
 public function widget($args, $instance)
 {
     extract($args);
     extract($instance);
     $collection = $collection ? $collection : WebcomicTag::get_webcomic_collection();
     if (!empty($image) and $image = wp_get_attachment_image($image, 'full')) {
         $link = preg_replace('/alt=".+?"/', 'alt="' . $link . '"', $image);
     }
     if ($output = WebcomicTag::webcomic_collection_link('%link', $link, $collection)) {
         echo $before_widget, empty($title) ? '' : $before_title . $title . $after_title, $output, $after_widget;
     }
 }
示例#3
0
文件: tags.php 项目: ecerta/webcomic
 /**
  * Render a webcomic collection link.
  * 
  * <code class="php">
  * // render a link to the collection archive page for the collection the current webcomic belongs to
  * webcomic_collection_link();
  * 
  * // render a link to the collection 42 archive with a small poster preview
  * webcomic_collection_link( '%link', '%thumbnail', 'webcomic42' );
  * </code>
  * 
  * <code class="bbcode">
  * // render a link to the collection archive page for the collection the current webcomic belongs to
  * [webcomic_collection_link]
  * 
  * // render a link to the collection 42 archive with a small poster preview
  * [webcomic_collection_link collection="webcomic42"]%thumbnail[/the_webcomic_collection]
  * </code>
  * 
  * @package Webcomic
  * @param string $format Format string for the link. Should include the %link token, which will be replaced by the actual link.
  * @param string $link Format string for the link text. Accepts %title and image size tokens tokens.
  * @param string $collection The collection ID to render a link for.
  * @uses WebcomicTag::webcomic_collection_link()
  */
 function webcomic_collection_link($format = '%link', $link = '', $collection = '')
 {
     echo WebcomicTag::webcomic_collection_link($format, $link, $collection);
 }
示例#4
0
 /**
  * Handle webcomic_collection_link shortcode.
  * 
  * @param array $atts Shortcode attributes.
  * @param string $content Shortcode content.
  * @param string $name Shortcode name.
  * @return string
  * @uses WebcomicTag::webcomic_collection_link()
  */
 public function webcomic_collection_link($atts, $content, $name)
 {
     extract(shortcode_atts(array('format' => '%link', 'link' => '', 'collection' => ''), $atts));
     if (!$link and $content) {
         $link = do_shortcode($content);
     }
     return WebcomicTag::webcomic_collection_link($format, $link, $collection);
 }