当前位置: 首页>>代码示例>>PHP>>正文


PHP catch_that_image函数代码示例

本文整理汇总了PHP中catch_that_image函数的典型用法代码示例。如果您正苦于以下问题:PHP catch_that_image函数的具体用法?PHP catch_that_image怎么用?PHP catch_that_image使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了catch_that_image函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_post_featured_image_url

function get_post_featured_image_url($id = null)
{
    if (is_null($id)) {
        $id = get_the_id();
    }
    $featured_image = get_the_post_thumbnail($id, 'full');
    if (strlen($featured_image) == 0) {
        return 'image not found';
    } else {
        $image_url = catch_that_image($featured_image);
        return $image_url;
    }
}
开发者ID:jitheshkt,项目名称:material_wp,代码行数:13,代码来源:functions.php

示例2: insert_fb_in_head

function insert_fb_in_head()
{
    global $post;
    if (!is_singular()) {
        //if it is not a post or a page
        echo '<meta property="fb:admins" content="690907201"/>';
        echo '<meta property="og:title" content="' . get_bloginfo('name') . '"/>';
        echo '<meta property="og:type" content="website"/>';
        echo '<meta property="og:locale" content="fr_FR"/>';
        echo '<meta property="og:url" content="' . get_bloginfo('url') . '"/>';
        echo '<meta property="og:site_name" content="' . get_bloginfo('name') . ' : ' . get_bloginfo('description') . '"/>';
        echo "<meta property=\"og:description\" content=\"" . get_bloginfo('description') . "\"/>";
        echo '<meta property="og:image" content="' . get_bloginfo('stylesheet_directory') . '/images/avatar_fb.jpg" />';
        return;
    } else {
        echo '<meta property="fb:admins" content="690907201"/>';
        echo '<meta property="og:title" content="' . get_bloginfo('name') . " - " . get_the_title() . '"/>';
        echo '<meta property="og:type" content="article"/>';
        echo '<meta property="og:locale" content="fr_FR"/>';
        echo '<meta property="og:url" content="' . get_permalink() . '"/>';
        echo '<meta property="og:site_name" content="' . get_bloginfo('name') . ' : ' . get_bloginfo('description') . '"/>';
    }
    $content = $post->post_content;
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]&gt;', $content);
    $meta = strip_tags($content);
    $meta = str_replace(array("\n", "\r", "\t"), ' ', $meta);
    $meta = cut_text($meta);
    echo "<meta property=\"og:description\" content=\"" . $meta . "\"/>";
    $custom_fields = get_post_custom($post->ID);
    $elts = explode("\r\n", $custom_fields['illustration'][0]);
    if ("" . $elts[0] != "") {
        //the post does not have featured image, use a default image
        $img = catch_that_image();
    } else {
        $img = $elts[0];
    }
    echo '<meta property="og:image" content="' . $img . '"/>';
}
开发者ID:Djailla,项目名称:wordpress_blog_template,代码行数:39,代码来源:functions.php

示例3: post_thumbnail

function post_thumbnail($width, $height, $dataSrc)
{
    global $post;
    $blogUrl = 'http://' . $_SERVER['HTTP_HOST'];
    $isTimThumb = get_option('themes_fo2_TimThumb');
    $first_img_src = catch_that_image();
    $timthumbFlod = str_replace($blogUrl, '', get_bloginfo("template_url"));
    if (has_post_thumbnail()) {
        //如果有缩略图,则显示缩略图
        $timthumb_src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');
        $timthumb_src = str_replace($blogUrl, '', $timthumb_src[0]);
        if (isset($dataSrc)) {
            if (!$isTimThumb) {
                $post_timthumb = '<img ' . $dataSrc . '="' . $timthumbFlod . '/timthumb.php?src=' . $timthumb_src . '&amp;h=' . $height . '&amp;w=' . $width . '&amp;zc=1" alt="' . $post->post_title . '" />';
            } else {
                $post_timthumb = '<img ' . $dataSrc . '="' . $timthumb_src . '" height="' . $height . '" width="' . $width . '" alt="' . $post->post_title . '" />';
            }
        } else {
            if (!$isTimThumb) {
                $post_timthumb = '<img src=' . $timthumbFlod . '/timthumb.php?src=' . $timthumb_src . '&amp;h=' . $height . '&amp;w=' . $width . '&amp;zc=1" alt="' . $post->post_title . '" />';
            } else {
                $post_timthumb = '<img src="' . $timthumb_src . '" height="' . $height . '" width="' . $width . '" alt="' . $post->post_title . '" />';
            }
        }
        if (isset($timthumb_src[5])) {
            echo $post_timthumb;
        }
    } else {
        $first_img_src = str_replace($blogUrl, '', $first_img_src);
        if (!empty($first_img_src)) {
            //如果日志中有图片
            if (isset($dataSrc)) {
                if (!$isTimThumb) {
                    $post_timthumb = '<img ' . $dataSrc . '="' . $timthumbFlod . '/timthumb.php?src=' . $first_img_src . '&amp;h=' . $height . '&amp;w=' . $width . '&amp;zc=1" alt="' . $post->post_title . '" />';
                } else {
                    $post_timthumb = '<img ' . $dataSrc . '="' . $first_img_src . '" height="' . $height . '" width="' . $width . '" alt="' . $post->post_title . '" />';
                }
            } else {
                if (!$isTimThumb) {
                    $post_timthumb = '<img src="' . $timthumbFlod . '/timthumb.php?src=' . $first_img_src . '&amp;h=' . $height . '&amp;w=' . $width . '&amp;zc=1" alt="' . $post->post_title . '" />';
                } else {
                    $post_timthumb = '<img src="' . $first_img_src . '" height="' . $height . '" width="' . $width . '" alt="' . $post->post_title . '" />';
                }
            }
        } else {
            //如果日志中没有图片,则显示默认
            if (isset($dataSrc)) {
                $post_timthumb = '<img ' . $dataSrc . '="' . get_bloginfo("template_url") . '/images/default_thumb.gif" alt="' . $post->post_title . '" />';
            } else {
                $post_timthumb = '<img src="' . get_bloginfo("template_url") . '/images/default_thumb.gif" alt="' . $post->post_title . '" />';
            }
        }
        echo $post_timthumb;
    }
}
开发者ID:sdgdsffdsfff,项目名称:shipin,代码行数:55,代码来源:functions.php

示例4: mmimg

function mmimg($postID)
{
    $cti = catch_that_image();
    $showimg = $cti;
    has_post_thumbnail();
    if (has_post_thumbnail()) {
        $thumbnail_image_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'thumbnail');
        $shareimg = $thumbnail_image_url[0];
    } else {
        $shareimg = $showimg;
    }
    return $shareimg;
}
开发者ID:Germey,项目名称:WonderBlog,代码行数:13,代码来源:other.php

示例5: mysqli_connect

        $first_img = "images/noimages.jpg";
    }
    return $first_img;
}
$conn = mysqli_connect($config->mysqlhostname, $config->mysqluser, $config->mysqlpass, $config->mysqldbname, $config->mysqlport);
$sql = "SELECT post_date,post_content,post_title,post_status,post_type,guid FROM wp_posts WHERE post_status='publish' AND post_type='post' LIMIT 10";
$query = mysqli_query($conn, $sql) or die(mysqli_error());
echo "<div class='elgg-module elgg-module-highlight elgg-module-featured'>";
echo "<div class='elgg-head'><h3>Latest News</h3></div>";
echo "<div class='elgg-body'>";
echo "<ul class='igolf-news'>";
while ($row1 = mysqli_fetch_array($query)) {
    echo "<li>";
    ?>
	<img src="<?php 
    echo catch_that_image($row1['post_content']);
    ?>
" />
	<div class="igolf_news_intro">
		<a href="<?php 
    echo $row1['guid'];
    ?>
" target="_blank"><h3><?php 
    echo $row1['post_title'];
    ?>
</h3></a>
		<div class="igolf_news_content">
		<?php 
    $content = $row1['post_content'];
    $content = preg_replace("/<img[^>]+\\>/i", "", $content);
    echo substr($content, 0, 130) . "...";
开发者ID:duanhv,项目名称:mdg-social,代码行数:31,代码来源:index.php

示例6: unset

		
			<?php 
    if ($wpzoom_archive_thumb == 'Show') {
        ?>
			<?php 
        unset($img);
        if (current_theme_supports('post-thumbnails') && has_post_thumbnail()) {
            $thumbURL = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), '');
            $img = $thumbURL[0];
        } else {
            unset($img);
            if ($wpzoom_cf_use == 'Yes') {
                $img = get_post_meta($post->ID, $wpzoom_cf_photo, true);
            } else {
                if (!$img) {
                    $img = catch_that_image($post->ID);
                }
            }
        }
        if ($img) {
            $img = wpzoom_wpmu($img);
            ?>
				<div class="thumb"><a href="<?php 
            the_permalink();
            ?>
" rel="bookmark" title="<?php 
            the_title();
            ?>
"><img src="<?php 
            bloginfo('template_directory');
            ?>
开发者ID:xuandungpy,项目名称:vuong,代码行数:30,代码来源:author.php

示例7: while

		<div class="main">
			<div class="content">
				<!--左侧新闻-->
				<div class="left box">
					<ul class="news">
						<?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
						<?php 
        setPostViews(get_the_ID());
        ?>
						<?php 
        $fmimg = get_post_meta($post->ID, "fmimg_value", true);
        $cti = catch_that_image();
        if ($fmimg) {
            $showimg = $fmimg;
        } else {
            $showimg = $cti;
        }
        ?>
						<li style="background:none">
							<h2 style="color:#333">
								<?php 
        the_title();
        ?>
							</h2>
							<?php 
        the_content();
        ?>
开发者ID:pengwei1024,项目名称:all-in,代码行数:31,代码来源:page.php

示例8: show_posts_fade


//.........这里部分代码省略.........
            $sqlposts = " AND {$wpdb->posts}.post_type = 'page' ";
        }
        // if both checked do nothing and pages and posts shown by default
    }
    $div_title = $options['div_title'];
    if (empty($div_title)) {
        $div_title = "Featured Post";
    }
    $posts = mysql_query("\n\t\tSELECT * FROM {$wpdb->posts}\n\t\tLEFT JOIN {$wpdb->term_relationships} ON\n\t\t({$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id)\n\t\tLEFT JOIN {$wpdb->term_taxonomy} ON\n\t\t({$wpdb->term_relationships}.term_taxonomy_id = {$wpdb->term_taxonomy}.term_taxonomy_id)\n\t\tWHERE {$wpdb->posts}.post_status = 'publish'" . $sqlposts . "\n\t\tAND {$wpdb->term_taxonomy}.taxonomy = 'category'\n\t\tAND " . $sqlcat . " ORDER BY RAND()\n\t\tLIMIT " . $num_posts, $wpdb->dbh) or die(mysql_error() . ' on line: ' . __LINE__);
    if ($posts && mysql_num_rows($posts) > 0) {
        while ($thepost = mysql_fetch_object($posts)) {
            $myID = $thepost->ID;
            //if ($myID == 0) return;
            $thepost = get_post($myID);
            setup_postdata($thepost);
            ?>
<div class="topstory">
<?php 
            echo $PreFeature . "\n<div class=\"featuredpost\">\n";
            /*echo "<h2><a href=\"";
            		echo get_permalink($myID);
            		echo "\" title=\"";
            		echo apply_filters('the_title', $thepost->post_title);
            		echo "\">";
            		echo apply_filters('the_title', $thepost->post_title);
            		echo "</a></h2>\n";*/
            echo '<div class="topstory-box-img">';
            if (has_post_thumbnail()) {
                echo "<a href=\"";
                echo get_permalink($myID);
                echo "\" title=\"";
                echo apply_filters('the_title', $thepost->post_title);
                echo "\">";
                echo '<img src="' . catch_that_image($thepost) . '">';
                //the_post_thumbnail();//array(320,320));
                echo "</a>\n";
            }
            echo "</div>";
            ?>
<div class="topstory-box-txt">
<?php 
            echo "<h3>" . $div_title . "</h3>\n";
            ?>

  <h1><?php 
            echo '<span style="font-size:' . $options['headline_size'] . 'em !important; line-height:0.9em !important; ">';
            ?>
<a href="<?php 
            echo get_permalink($myID);
            ?>
" title="<?php 
            the_title_attribute();
            ?>
"><?php 
            echo apply_filters('the_title', $thepost->post_title);
            ?>
</a></span></h1>
   <div class="mousetxt">Mouse over - stop slideshow - out continue.</div>
  <?php 
            $excerpt_letters = $options['excerpt_letters'];
            //echo "<a href=\"";
            //echo get_permalink($myID);
            //echo "\" title=\"";
            //echo apply_filters('the_title', $thepost->post_title);
            //echo "\"></a>";
            //$options['show_headline_only'] = trim($_POST['show_headline_only'],'{}');
开发者ID:jhersonn20,项目名称:myportal,代码行数:67,代码来源:showpostsfade-orig.php

示例9: get_header

get_header();
?>
<div class="site-download">
	<div id="site-breadcrumbs">
		<?php 
NQD_breadcrumbs();
?>
	</div>
		<div class="post-container">
			<div class="post-info" itemscope itemtype="http://data-vocabulary.org/Recipe">
				<div class="post_thumb">
					<img itemprop="photo" src="<?php 
bloginfo('home');
?>
/media/resizer/57x57/r/<?php 
echo remove_http(catch_that_image());
?>
" title="<?php 
the_title();
?>
">
				</div>
				<h1 itemprop="name"><?php 
the_title();
?>
</h1>
				<div class="info">
					<span class="post_date"><?php 
echo time_stamp(get_post_time('U', true));
?>
</span>
开发者ID:sangpena,项目名称:appflex.mobi,代码行数:31,代码来源:download-detail.php

示例10: the_ID

<?php

/**
 * The default template for displaying the content blocks. Used for both single and index/archive/search.
 *
 * @subpackage jumpoff
 */
?>

	<article id="post-<?php 
the_ID();
?>
" class="has-table">
 	<div class="row-table">
   <section class="half has-bgimg" style="background-image:url('<?php 
echo catch_that_image($page->ID, 'fullsize');
?>
');"></section>  
  
   <section class="half has-content">
    <div class="content">	
     <span class="post-meta"><?php 
the_time('F j, Y');
?>
 - <?php 
the_author_posts_link();
?>
</span>						
     <h2><a href="<?php 
the_permalink();
?>
开发者ID:brianroach,项目名称:The-JumpOff-Wp-Kit,代码行数:31,代码来源:content.php

示例11: catch_that_image

			<?php 
        if (function_exists('has_post_thumbnail') && has_post_thumbnail()) {
            ?>
      <a href="<?php 
            echo catch_that_image();
            ?>
" class="magnifier">
			<?php 
            replican_get_thumbnail2(120, 87);
            ?>
      </a>
                <?php 
        } else {
            ?>
               <?php 
            catch_that_image(13000, 12000);
            ?>
                <?php 
            replican_get_image2(120, 87);
            ?>
</a><?php 
        }
        ?>


			<?php 
    }
    ?>
			</li>
<?php 
} else {
开发者ID:jigen7,项目名称:redrocketdigital,代码行数:31,代码来源:front-page-edited.php

示例12: recent_news

function recent_news($args)
{
    extract($args);
    $settings = get_option('widget_recent_news');
    $number = $settings['number'];
    echo $before_widget;
    echo "{$before_title}" . "{$settings['title']}" . "{$after_title}";
    ?>
<ul class="news_widget">
  <?php 
    $recent = new WP_Query('caller_get_posts=1&showposts=' . $number);
    while ($recent->have_posts()) {
        $recent->the_post();
        global $post;
        global $wp_query;
        ?>
	<li>
		<a href="<?php 
        the_permalink();
        ?>
" rel="bookmark" title="<?php 
        the_title();
        ?>
">
		<?php 
        unset($img);
        if (current_theme_supports('post-thumbnails') && has_post_thumbnail()) {
            $thumbURL = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), '');
            $img = $thumbURL[0];
        } else {
            unset($img);
            if ($wpzoom_cf_use == 'Yes') {
                $img = get_post_meta($post->ID, $wpzoom_cf_photo, true);
            } else {
                if (!$img) {
                    $img = catch_that_image($post->ID);
                }
            }
        }
        if ($img) {
            $img = wpzoom_wpmu($img);
            ?>
			<img src="<?php 
            bloginfo('template_directory');
            ?>
/scripts/timthumb.php?src=<?php 
            echo $img;
            ?>
&amp;w=65&amp;h=50&amp;zc=1" alt="<?php 
            the_title();
            ?>
" /> 
			<?php 
        }
        ?>
 		</a>
 		<a href="<?php 
        the_permalink();
        ?>
" rel="bookmark" title="Permanent Link to <?php 
        the_title();
        ?>
"><?php 
        the_title();
        ?>
</a>
		<span class="meta"><?php 
        the_time('F j, Y \\a\\t G:i');
        ?>
</span> 
 
  </li>
   
  <?php 
    }
    ?>
</ul>
  
<?php 
    echo $after_widget;
}
开发者ID:candidosales,项目名称:site-demolaypi,代码行数:81,代码来源:wpzoom-widgets.php

示例13: bd_pin_image

function bd_pin_image()
{
    global $post, $posts;
    if (has_post_thumbnail($post->ID)) {
        $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');
        echo $image[0];
    } else {
        echo catch_that_image();
    }
}
开发者ID:hunghoang179,项目名称:sitenews,代码行数:10,代码来源:functions.php

示例14: jasFeaturedStories

function jasFeaturedStories()
{
    $jasFeaturedStories_options = get_option('jasFeaturedStories_options');
    //preview mode, showing the saved options and not the published options
    $pub = '';
    if (isset($_GET['jasFeaturedStoriesPreview'])) {
        if (!$_GET['jasFeaturedStoriesPreview']) {
            $pub = '_pub';
        }
    }
    ?>

<div id="featured-stories-wrapper">
<input type="hidden" id="featured-stories-cycle-time" value="<?php 
    echo $jasFeaturedStories_options['cycle_time' . $pub];
    ?>
" />
<ul id="featured-stories" <?php 
    if ($jasFeaturedStories_options['scroll' . $pub] == 'on') {
        echo 'class="jasFeaturedStoriesScroll"';
    }
    ?>
>
	<?php 
    $prim = false;
    $sec = false;
    $tert = false;
    $url = $jasFeaturedStories_options['story1_link' . $pub];
    $postId = url_to_postid($url);
    $post = get_post($postId);
    $title = stripslashes(stripslashes($jasFeaturedStories_options['story1_headline' . $pub]));
    if (strlen($title) == 0) {
        $title = $post->post_title;
    }
    $abstract = stripslashes(stripslashes($jasFeaturedStories_options['story1_abstract' . $pub]));
    $size = '&w=214&h=120';
    if ($jasFeaturedStories_options['story1_primary'] == true) {
        $class = 'primary';
        $size = '&w=428&h=241';
        if (!$prim) {
            $class = 'primary current';
            $prim = true;
        }
    } elseif (!$sec) {
        $class = 'secondary';
        $sec = true;
    } elseif (!tert) {
        $class = 'tertiary';
        $tert = true;
    }
    $imagesrc = '';
    if (strlen($jasFeaturedStories_options['story1_imageUrl']) > 0) {
        $imagesrc = $jasFeaturedStories_options['story1_imageUrl'];
    } else {
        if (function_exists('catch_that_image')) {
            $imagesrc = catch_that_image($post);
        }
    }
    ?>
	<li class="<?php 
    echo $class;
    ?>
" id="story1">
    	
        <a class="panel" href="<?php 
    echo $url;
    ?>
" style="background-image:url('<?php 
    bloginfo('template_directory');
    ?>
/timthumb/timthumb.php?src=<?php 
    echo $imagesrc . $size;
    ?>
&zc=1');">
        	<div class="text-container">
            	<h2><?php 
    echo $title;
    ?>
</h2>
            	<p><?php 
    echo $abstract;
    ?>
</p>
            </div>
        </a>
        <!-- End Featured Box Panel -->
    </li>
    <?php 
    $url = $jasFeaturedStories_options['story2_link' . $pub];
    $postId = url_to_postid($url);
    $post = get_post($postId);
    $title = stripslashes(stripslashes($jasFeaturedStories_options['story2_headline' . $pub]));
    if (strlen($title) == 0) {
        $title = $post->post_title;
    }
    $abstract = stripslashes(stripslashes($jasFeaturedStories_options['story2_abstract' . $pub]));
    $size = '&w=214&h=120';
    if ($jasFeaturedStories_options['story2_primary'] == true) {
        $class = 'primary';
        $size = '&w=428&h=241';
//.........这里部分代码省略.........
开发者ID:jsutcliffe,项目名称:jas-featured-stories,代码行数:101,代码来源:jasFeaturedStories.php

示例15: foreach

        $sl++;
        ?>
		<div id="home_cat<?php 
        echo $sl;
        ?>
" class="home_other_cats left">
			<div class="home_cat_title"><h2><?php 
        echo $bname;
        ?>
</h2></div>
				<?php 
        foreach ($pages[$bid] as $post) {
            ?>
				<?php 
            $post_content_old = $post->post_content;
            $post_image = catch_that_image($post_content_old);
            echo '<img src="' . $post_image . '" />';
            ?>
				<h3 class="home_other_post_title left"><a href="<?php 
            echo $post->guid;
            ?>
">
				<?php 
            echo $post->post_title;
            ?>
 &raquo;</a></h3>
				<div class="home_post_wrapper left">
					<p class="cat_other_posts">
						<?php 
            $post_content = strip_tags($post_content_old);
            if (strlen($post_content) <= 350) {
开发者ID:elizabethcb,项目名称:Daily-Globe,代码行数:31,代码来源:main-home.php


注:本文中的catch_that_image函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。