?> <a class="screencast-play" href="<?php echo $video; ?> " rel="prettyPhoto"><img class="opaque" src="<?php echo get_template_directory_uri(); ?> /resources/images/screencast-play.png" alt="screencast play" /></a> <?php video_lightbox(get_the_ID(), 205, 140); ?> <?php } else { ?> <a href="<?php echo get_thumbnail_url(); ?> " title="<?php the_title(); ?> " rel="prettyPhoto[gallery]"><?php resize_img("width=205&height=140"); ?> </a> <?php } ?> </div> <?php } elseif (has_post_thumbnail()) { ?>
/** * Creates a style tag in the header with the background image * * @return void */ public function background_images() { $output = ''; $image = get_thumbnail_url(get_the_ID(), 'full'); if (!$image) { $image = get_theme_mod('default_bg_image'); } if (!empty($image)) { $output .= '<style>'; $output .= '@media screen and (min-width:768px){.site-header{background-image:url(' . $image . ');}'; $output .= '</style>'; } echo $output; }
/** * Funktio yhdistää tuotteeseen Infot ja kuvan url:in. * Huom! Listassa olevilla tuotteilla oltava ominaisuus articleId. * @param $products */ function merge_products_with_optional_data($products) { foreach ($products as $product) { $response = getOptionalData($product->articleId); $product->thumburl = get_thumbnail_url($response[0]); $product->infos = get_infos($response[0]); } }
/** * 文件详细信息页 * @method detail * @param GET: id * @author NewFuture[newfuture@yunyin.org] */ public function detail() { $sid = I('id', null, 'int'); //分享的ID $uid = use_id(); /*读取分享内容*/ $share = D('ShareView')->where('share.id=%d', $sid)->find(); if ($share) { $share['url'] = get_thumbnail_url($share['url']); } $this->share = $share; /*获取分享内容的标签*/ $this->tags = M('hastag')->join('tag ON tag.id=hastag.tag_id')->where('share_id=%d', $sid)->field('tag.name as name,tag_id')->select(); if ($uid) { /*判断是否登录*/ $user = M('User')->Field('sch_id,phone')->getById($uid); $this->lock = $user['phone'] ? 1 : 0; $condition['sch_id'] = $user['sch_id']; $condition['status'] = 1; $this->printers = M('printer')->where($condition)->order('rank desc')->Field('id,name,address')->select(); } else { $share['user_name'] = mb_substr($share['user_name'], 0, 1, 'utf-8') . '**'; } $this->display(); }