本文整理汇总了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;
}
}
示例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(']]>', ']]>', $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 . '"/>';
}
示例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 . '&h=' . $height . '&w=' . $width . '&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 . '&h=' . $height . '&w=' . $width . '&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 . '&h=' . $height . '&w=' . $width . '&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 . '&h=' . $height . '&w=' . $width . '&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;
}
}
示例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;
}
示例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) . "...";
示例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');
?>
示例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();
?>
示例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'],'{}');
示例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>
示例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();
?>
示例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 {
示例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;
?>
&w=65&h=50&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;
}
示例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();
}
}
示例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';
//.........这里部分代码省略.........
示例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;
?>
»</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) {