當前位置: 首頁>>代碼示例>>PHP>>正文


PHP tservices_helper::setProtocol方法代碼示例

本文整理匯總了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 
開發者ID:Nikitian,項目名稱:fl-ru-damp,代碼行數:31,代碼來源:recomend_tu.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) {
                ?>
開發者ID:Nikitian,項目名稱:fl-ru-damp,代碼行數:31,代碼來源:tpl.card.php


注:本文中的tservices_helper::setProtocol方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。