Пример #1
0
function ryuzine_display_comic()
{
    global $post;
    $output = '';
    // ComicPress 2.x
    if (function_exists('comicpress_the_hovertext')) {
        $comics = get_comic_path('comic', $post);
        if (is_array($comics)) {
            foreach ($comics as $comic) {
                $cdn_url = comicpress_themeinfo('cdn_url');
                if (!empty($cdn_url)) {
                    $thumbnail = trailingslashit($cdn_url) . comicpress_clean_url($comic);
                } else {
                    $thumbnail = comicpress_themeinfo('baseurl') . comicpress_clean_url($comic);
                }
                $hovertext = comicpress_the_hovertext($post);
            }
        }
    }
    // Comic Easel (ComicPress 4)
    if (function_exists('ceo_the_hovertext')) {
        $post_image_id = get_post_thumbnail_id($post->ID);
        if ($post_image_id) {
            // If there's a featured image.
            $hovertext = ceo_the_hovertext();
            $thumbnail = wp_get_attachment_image_src($post_image_id, 'full', false);
            if (is_array($thumbnail)) {
                $thumbnail = reset($thumbnail);
            }
        }
    }
    // MangaPress
    if (defined('MP_FOLDER')) {
        $post_image_id = get_post_thumbnail_id($post->ID);
        if ($post_image_id) {
            $hovertext = '';
            $thumbnail = wp_get_attachment_image_src($post_image_id, 'full', false);
            if (is_array($thumbnail)) {
                $thumbnail = reset($thumbnail);
            }
        }
    }
    $output .= '<img src="' . $thumbnail . '" alt="' . $hovertext . '" title="' . $hovertext . '" />';
    return apply_filters('ryuzine_display_comic', $output);
}
Пример #2
0
/**
 * function display_comics_multi
 * July 26th, 2009
 * Philip M. Hofer (Frumph)
 * 
 * Displays multiple comics based on the array return with get_comic_path ($folder, $override_post, $filter, #) 0=no array, 1=array;
 */
function display_comics_multi()
{
    global $post;
    if (($result = get_comic_path('comic', '', '', 1)) !== false) {
        foreach ($result as $pathto_comic) {
            ?>
			<div class="comicdisp">
			<img src="<?php 
            echo get_option('home') . '/' . $pathto_comic;
            ?>
" alt="<?php 
            the_title();
            ?>
" title="<?php 
            echo the_hovertext();
            ?>
" />
			</div>
		<?php 
        }
    }
    return false;
}
Пример #3
0
/**
* Find a comic file in the filesystem and return an absolute URL to that file.
* @param string $folder The folder name to search.
* @param string $override_post A WP Post object to use in place of global $post.
* @param string $filter The $comic_filename_filters to use.
* @return string The absolute URL to the comic file, or false if not found.
*/
function get_comic_url($folder = 'comic', $override_post = null, $filter = 'default')
{
    if (($results = get_comic_path($folder, $override_post, $filter)) !== false) {
        $newresults = array();
        foreach ($results as $result) {
            ltrim($result, '/');
            $newresults[] = trailingslashit(comicpress_themeinfo('baseurl')) . $result;
        }
        return $newresults;
    }
    return false;
}
Пример #4
0
/**
 *  get_comic_filename
 *	returns the filename of the comic for the individual date.
 *
 */
function get_comic_filename($folder = 'comic', $override_post = null, $filter = 'default')
{
    if (($result = get_comic_path($folder, $override_post, $filter)) !== false) {
        return $result;
    }
}