示例#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
文件: tags.php 项目: ecerta/webcomic
 /**
  * Render a `<select>` element of webcomic transcript terms.
  * 
  * Because this function relies on get_terms() to retrieve the term
  * list the $args parameter accepts any arguments that get_terms()
  * may accept. Only those get_terms() arguments that differ from
  * their defaults are detailed here.
  * 
  * ### Arguments
  * 
  * - `string` **$select_name** - Value for the name attribute of the `<select>` element.
  * - `string` **$id** - Value of the id attribute of the `<select>` element.
  * - `mixed` **$class** - String or array of additional classes for the `<select>` element.
  * - `string` **$before** - Content to display before the output.
  * - `string` **$after** - Content to display after the output.
  * - `string` **$show_option_all** - String to display for an "all" `<option>` (value="0").
  * - `string` **$show_option_none** - String to display for a "none" `<option>` (value="-1").
  * - `boolean` **$hierarchical** - Whether to indent child terms.
  * - `boolean` **$hide_empty** - Whether to hide empty terms. Defaults to the opposite of WebcomicTag::webcomic_transcripts_open().
  * - `boolean` **$hide_if_empty** - Whether to display the `<select>` even if it contains no `<option>'s`.
  * - `string` **$orderby** - What field to sort terms by.
  * - `object` **$walker** - Custom walker object. Defaults Walker_WebcomicTerm_Dropdown.
  * - `integer` **$depth** - How deep the walker should run. Defaults to 0 (all levels). A -1 depth will result in flat output.
  * - `integer` **$selected** - The ID of the selected term.
  * 
  * <code class="php">
  * // render a dropdown of available transcript languages
  * webcomic_dropdown_transcript_languages();
  * 
  * // render a dropdown with an "all languages" option
  * webcomic_dropdown_transcript_languages( array( 'show_option_all' => '- Languages -' ) );
  * </code>
  * 
  * @package Webcomic
  * @param array $args Array of arguments. See function description for detailed information.
  * @param mixed $the_post The post object or ID transcripts should be related to.
  * @return string
  * @uses webcomic_transcripts_open()
  * @uses WebcomicTag::webcomic_dropdown_transcript_terms()
  */
 function webcomic_dropdown_transcript_languages($args = array(), $the_post = false)
 {
     $r = wp_parse_args($args, array('select_name' => 'webcomic_terms', 'id' => '', 'class' => '', 'before' => '', 'after' => '', 'show_option_all' => '', 'show_option_none' => '', 'hierarchical' => true, 'hide_empty' => !webcomic_transcripts_open($the_post), 'hide_if_empty' => true, 'orderby' => 'name', 'walker' => false, 'depth' => 0, 'selected' => 0));
     $r['taxonomy'] = 'webcomic_language';
     echo WebcomicTag::webcomic_dropdown_transcript_terms($r, $the_post);
 }