本文整理汇总了PHP中tservices_helper::setProtocol方法的典型用法代码示例。如果您正苦于以下问题:PHP tservices_helper::setProtocol方法的具体用法?PHP tservices_helper::setProtocol怎么用?PHP tservices_helper::setProtocol使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tservices_helper
的用法示例。
在下文中一共展示了tservices_helper::setProtocol方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<div class="b-layout b-layout_center" style="width:222px;">
<?php
foreach ($tservices as $tservice) {
$user = $tservice['user'];
$user_url = sprintf('/users/%s', $user['login']);
$tservice_url = sprintf('/tu/%d/%s.html', $tservice['id'], tservices_helper::translit($tservice['title']));
$avatar_url = tservices_helper::photo_src($user['photo'], $user['login']);
$hasVideo = false;
if ($hasVideo) {
$video = current($tservice['videos']);
$video_thumbnail_url = tservices_helper::setProtocol($video['image']);
$thumbnail200x150 = '<img width="200" height="150" class="b-pic" src="' . $video_thumbnail_url . '">';
} elseif (!empty($tservice['file'])) {
$image_url = tservices_helper::image_src($tservice['file'], $user['login']);
$thumbnail200x150 = '<img width="200" height="150" class="b-pic" src="' . $image_url . '">';
} else {
$thumbnail200x150 = '<div class="b-pic b-pic_no_img b-pic_w200_h150 b-pic_bg_f2"></div>';
}
$hasVideo = !empty($tservice['videos']) && count($tservice['videos']);
$sold_count = isset($tservice['count_sold']) ? $tservice['count_sold'] : $tservice['total_feedbacks'];
?>
<figure class="i-pic i-pic_pad_10 i-pic_height_265 i-pic_bord_green_hover">
<div class="b-layout b-layout_relative">
<a class="b-pic__lnk b-pic__lnk_relative" href="<?php
echo $tservice_url;
?>
">
<?php
if ($hasVideo) {
?>
<div class="b-icon b-icon__play b-icon_absolute b-icon_bot_4 b-icon_left_4"></div><?php
示例2: foreach
<a data-type="video" data-autoplay="<?php
if ($key > 0) {
?>
1<?php
} else {
?>
0<?php
}
?>
" data-source="<?php
echo $video['video'];
?>
" class="b-gallery__link" href="javascript:void(0)">
<div class="b-gallery__play-btn"></div>
<img alt="" class="b-gallery__thumb" src="<?php
echo tservices_helper::setProtocol($video['image']);
?>
" />
</a>
</li>
<?php
}
}
?>
<?php
if ($cnt_img) {
foreach ($data['images'] as $key => $image) {
?>
<li class="b-gallery__item <?php
if ($hide_img) {
?>