示例#1
0
function comicpress_add_facebook_meta()
{
    global $post;
    echo '<meta property="og:url" content="' . get_permalink() . '" />' . "\r\n";
    echo '<meta property="og:site_name" content="' . get_bloginfo('name') . '" />' . "\r\n";
    echo '<meta property="og:type" content="article" />' . "\r\n";
    if (is_single()) {
        $comic_url = get_comic_url('mini', $post);
        if (is_array($comic_url)) {
            $comic_url = reset($comic_url);
        }
        echo '<meta property="og:title" content="' . get_the_title() . '" />' . "\r\n";
        echo '<meta property="og:description" content="' . get_the_excerpt() . '" />' . "\r\n";
        if (comicpress_in_comic_category()) {
            echo '<meta property="og:image" content="' . $comic_url . '" />' . "\r\n";
        }
    } elseif (is_home()) {
        echo '<meta property="og:description" content="' . get_bloginfo('description') . '" />' . "\r\n";
    }
}
示例#2
0
function comicpress_display_comic_swf()
{
    global $post;
    $height = get_post_meta(get_the_ID(), "fheight", true);
    $width = get_post_meta(get_the_ID(), "fwidth", true);
    if (empty($height)) {
        $height = '300';
    }
    if (empty($width)) {
        $width = '100%';
    }
    $output = "<object id=\"myId\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"{$width}\" height=\"{$height}\">\r\n";
    $output .= "\t<param name=\"movie\" value=\"" . get_comic_url() . "\" />\r\n";
    $output .= "<!--[if !IE]>--><object type=\"application/x-shockwave-flash\" data=\"" . get_comic_url() . "\" width=\"{$width}\" height=\"{$height}\"><!--<![endif]-->\r\n";
    $output .= "\t\t<div>\r\n";
    $output .= "\t\t\t<h1>Get Flash!</h1>\r\n";
    $output .= "\t\t\t\t<p><a href=\"http://www.adobe.com/go/getflashplayer\"><img src=\"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif\" alt=\"Get Adobe Flash player\" /></a></p>\r\n";
    $output .= "\t\t</div>\r\n";
    $output .= "<!--[if !IE]>--></object><!--<![endif]--></object>\r\n";
    return apply_filters('comicpress_display_comic_swf', $output);
}
		<ul id="storyline" class="level-0">
<?php 
if (comicpress_themeinfo('enable-storyline-support') == 1) {
    if (($result = comicpress_themeinfo('storyline-category-order')) !== false) {
        $categories_by_id = comicpress_get_comic_category_objects_by_id();
        $current_depth = 0;
        $storyline_root = " class=\"storyline-root\"";
        foreach (explode(",", $result) as $node) {
            $parts = explode("/", $node);
            $target_depth = count($parts) - 2;
            $category_id = end($parts);
            $category = $categories_by_id[$category_id];
            $description = $category->description;
            $first_comic_in_category = comicpress_get_terminal_post_in_category($category_id);
            $first_comic_permalink = get_permalink($first_comic_in_category->ID);
            $archive_image = get_comic_url('mini', $first_comic_in_category);
            $post_title = $first_comic_in_category->post_title;
            if (!empty($archive_image) && is_array($archive_image)) {
                $archive_image = reset($archive_image);
            }
            if ($target_depth < $current_depth) {
                echo str_repeat("</ul></li>", $current_depth - $target_depth);
            }
            if ($target_depth > $current_depth) {
                for ($i = $current_depth; $i < $target_depth; ++$i) {
                    $next_i = $i + 1;
                    echo "<li><ul class=\"level-{$next_i}\">";
                }
            }
            ?>
						
if (get_option('comicpress-enable-storyline-support') == 1) {
    if (($result = get_option("comicpress-storyline-category-order")) !== false) {
        $categories_by_id = get_all_category_objects_by_id();
        $current_depth = 0;
        $storyline_root = " class=\"storyline-root\"";
        foreach (explode(",", $result) as $node) {
            $parts = explode("/", $node);
            $target_depth = count($parts) - 2;
            $category_id = end($parts);
            $category = $categories_by_id[$category_id];
            $description = $category->description;
            $first_comic_in_category = get_terminal_post_in_category($category_id);
            $first_comic_permalink = get_permalink($first_comic_in_category->ID);
            $archive_image = null;
            foreach (array("archive", "rss", "comic") as $type) {
                if (($requested_archive_image = get_comic_url("archive", $first_comic_in_category)) !== false) {
                    $archive_image = $requested_archive_image;
                    break;
                }
            }
            if ($target_depth < $current_depth) {
                echo str_repeat("</ul></li>", $current_depth - $target_depth);
            }
            if ($target_depth > $current_depth) {
                for ($i = $current_depth; $i < $target_depth; ++$i) {
                    $next_i = $i + 1;
                    echo "<li><ul class=\"level-{$next_i}\">";
                }
            }
            ?>
						
<?php

if (($result = get_option("comicpress-storyline-category-order")) !== false) {
    $categories_by_id = array();
    foreach (get_categories("hide_empty=0") as $category_object) {
        $categories_by_id[$category_object->term_id] = $category_object;
    }
    foreach (explode(",", $result) as $node) {
        $parts = explode("/", $node);
        $category_id = end($parts);
        $category = $categories_by_id[$category_id];
        $first_comic_in_category = get_terminal_post_in_category($category_id);
        $first_comic_permalink = get_permalink($first_comic_in_category->ID);
        $archive_image = get_comic_url("archive", $first_comic_in_category);
        ?>

      <div style="margin-left: <?php 
        echo (count($parts) - 2) * 50;
        ?>
px; overflow: hidden; background-color: #ddd">
        <a href="<?php 
        echo $first_comic_permalink;
        ?>
"><img src="<?php 
        echo $archive_image;
        ?>
" /></a>
        <h3><a href="<?php 
        echo get_category_link($category_id);
        ?>
"><?php 
示例#6
0
function the_comic_mini($filter = 'default')
{
    echo get_comic_url('mini', null, $filter);
}