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


PHP Images::getMainThumb方法代码示例

本文整理汇总了PHP中Images::getMainThumb方法的典型用法代码示例。如果您正苦于以下问题:PHP Images::getMainThumb方法的具体用法?PHP Images::getMainThumb怎么用?PHP Images::getMainThumb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Images的用法示例。


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

示例1: utf8_substr

    if (utf8_strlen($title) > 30) {
        $title = utf8_substr($title, 0, 30) . '...';
    }
    // Обрезаем, если больше 20
    $description = '';
    if ($item->canShowInView('description')) {
        $description = $item->getStrByLang('description');
    }
    ?>



                    <div class="new-building-object-list">
                        <div class="image">
                            <?php 
    $res = Images::getMainThumb(300, 157, $item->images);
    $img = CHtml::image($res['thumbUrl'], $item->getStrByLang('title'), array('title' => $item->getStrByLang('title'), 'class' => 'apartment_type_img'));
    echo CHtml::link($img, $item->getUrl(), array('title' => $item->getStrByLang('title'), 'alt' => $item->getStrByLang('title')));
    ?>
                            <div class="title">
                                <a href="<?php 
    echo $item->getUrl();
    ?>
" ><?php 
    echo $title;
    ?>
</a>
                            </div>
                        </div>
                        <div class="address" style="min-height:66px">
<?php 
开发者ID:barricade86,项目名称:raui,代码行数:31,代码来源:widgetApartments_list_item_new.php

示例2: array

        ?>
/images/photo_count.png"><b><?php 
        echo $countImagesArr[$item->id];
        ?>
</b></div>
				<?php 
    }
    ?>

				<div class="apartment_type"><?php 
    echo Apartment::getNameByType($item->type);
    ?>
</div>

				<?php 
    $res = Images::getMainThumb(150, 100, $item->images);
    $img = CHtml::image($res['thumbUrl'], $item->getStrByLang('title'), array('title' => $item->getStrByLang('title'), 'class' => 'apartment_type_img'));
    echo CHtml::link($img, $item->getUrl(), array('title' => $item->getStrByLang('title')));
    ?>

                </div>
			</div>
			<div class="offer-text">
				<div class="apartment-title">
						<?php 
    $title = CHtml::encode($item->getStrByLang('title'));
    if ($item->rating && !isset($booking)) {
        //$title = truncateText($item->getStrByLang('title'), 5);
        if (utf8_strlen($title) > 21) {
            $title = utf8_substr($title, 0, 21) . '...';
        }
开发者ID:alexjkitty,项目名称:estate,代码行数:31,代码来源:widgetApartments_list_item.php

示例3: preparePosting

 public static function preparePosting(Apartment $model)
 {
     if ($model) {
         $message = '';
         $defaultLang = Lang::getDefaultLang();
         $tmp = 'title_' . $defaultLang;
         if (isset($model->{$tmp})) {
             $message .= $model->{$tmp};
         }
         // vkontakte
         if (SocialpostingModel::getSocialParamValue('useVkontakte')) {
             $vkApId = SocialpostingModel::getSocialParamValue('vkontakteApplicationId');
             $vkToken = SocialpostingModel::getSocialParamValue('vkontakteToken');
             $vkUsId = SocialpostingModel::getSocialParamValue('vkontakteUserId');
             //if ($vkApId && $vkToken && !is_numeric($model->autoVKPostId)) {
             if ($vkApId && $vkToken && utf8_strlen($model->autoVKPostId) < 1) {
                 if ($message) {
                     $imageUrl = null;
                     $res = Images::getMainThumb(300, 200, $model->images);
                     if ($res['link']) {
                         $imageUrl = $res['link'];
                     }
                     $post = self::addPostToVK($message, $vkApId, $vkToken, $vkUsId, $model->getUrl(), $imageUrl);
                     //logs(var_export($post, false));
                     //logs(var_export($post, true));
                     $postId = '0';
                     if ($post && isset($post->response)) {
                         $postId = isset($post->response->post_id) && $post->response->post_id ? $post->response->post_id : 0;
                     }
                     $model->autoVKPostId = $postId;
                     $model->update(array('autoVKPostId'));
                     /*$sql = 'UPDATE {{apartment}} SET autoVKPostId = "'.strip_tags(addslashes($postId)).'" WHERE id = '.$model->id;
                     		Yii::app()->db->createCommand($sql)->execute();*/
                 }
             }
         }
         // twitter
         if (SocialpostingModel::getSocialParamValue('useTwitter')) {
             $twApiKey = SocialpostingModel::getSocialParamValue('twitterApiKey');
             $twApiSecret = SocialpostingModel::getSocialParamValue('twitterApiSecret');
             $twTokenKey = SocialpostingModel::getSocialParamValue('twitterTokenKey');
             $twTokenSecret = SocialpostingModel::getSocialParamValue('twitterTokenSecret');
             //if ($twApiKey && $twApiSecret && $twTokenKey && $twTokenSecret && !is_numeric($model->autoTwitterPostId)) {
             if ($twApiKey && $twApiSecret && $twTokenKey && $twTokenSecret && utf8_strlen($model->autoTwitterPostId) < 1) {
                 if ($message) {
                     $post = self::addPostToTw($message, $twApiKey, $twApiSecret, $twTokenKey, $twTokenSecret, $model->getUrl());
                     //logs(var_export($post, false));
                     //logs(var_export($post, true));
                     $postId = '0';
                     if ($post && isset($post->id_str)) {
                         $postId = $post->id_str ? $post->id_str : 0;
                     }
                     $model->autoTwitterPostId = strip_tags(addslashes($postId));
                     $model->update(array('autoTwitterPostId'));
                     /*$sql = 'UPDATE {{apartment}} SET autoTwitterPostId = "'.strip_tags(addslashes($postId)).'" WHERE id = '.$model->id;
                     		Yii::app()->db->createCommand($sql)->execute();*/
                 }
             }
         }
     }
     return true;
 }
开发者ID:barricade86,项目名称:raui,代码行数:62,代码来源:SocialpostingModel.php

示例4: array

    echo Yii::app()->baseUrl;
    ?>
/images/photo_count.png"><b><?php 
    if (isset($countImagesArr[$lastEstateObject->id])) {
        echo $countImagesArr[$lastEstateObject->id];
    }
    ?>
</b></div>

                <div class="apartment_type"><?php 
    echo Apartment::getNameByType($lastEstateObject->type);
    ?>
</div>

                <?php 
    $res = Images::getMainThumb(150, 100, $lastEstateObject->images);
    $img = CHtml::image($res['thumbUrl'], $item->getStrByLang('title'), array('title' => $lastEstateObject->getStrByLang('title'), 'class' => 'apartment_type_img'));
    echo CHtml::link($img, $lastEstateObject->getUrl(), array('title' => $lastEstateObject->getStrByLang('title')));
    ?>
            </div>
        </div>
        <div class="offer-text">
            <div class="apartment-title">
                <?php 
    $title = CHtml::encode($lastEstateObject->getStrByLang('title'));
    if ($lastEstateObject->rating && !isset($booking)) {
        //$title = truncateText($item->getStrByLang('title'), 5);
        if (utf8_strlen($title) > 21) {
            $title = utf8_substr($title, 0, 21) . '...';
        }
    } else {
开发者ID:alexjkitty,项目名称:estate,代码行数:31,代码来源:lastEstateObjects.php

示例5: tt

<div class="gmap-marker">
	<div align="center" class="gmap-marker-adlink">
		<?php 
echo CHtml::link('<strong>' . tt('ID', 'apartments') . ': ' . $model->id . '</strong>, ' . Apartment::getNameByType($model->type) . ', ' . CHtml::encode($model->getStrByLang('title')), $model->getUrl());
?>
	</div>
	<?php 
$res = Images::getMainThumb(150, 100, $model->images);
?>
				<div align="center" class="gmap-marker-img">
					<?php 
echo CHtml::image($res['thumbUrl'], $model->getStrByLang('title'), array('title' => $model->getStrByLang('title')));
?>
				</div>
			<?php 
?>
	<div align="center" class="gmap-marker-adress">
		<?php 
echo CHtml::encode($model->getStrByLang('address'));
?>
	</div>
</div>
开发者ID:barricade86,项目名称:raui,代码行数:22,代码来源:_marker.php

示例6: array

            echo ' ' . Booking::getDate($model->is_free_to);
        }
        echo '</div>';
    }
    ?>
	</div>
<?php 
}
?>

<div>
	<table cellpadding="0" cellspacing="0" border="0" width="100%">
		<tr>
			<td width="320px" valign="top">
				<?php 
$res = Images::getMainThumb(300, 200, $model->images);
echo CHtml::image($res['thumbUrl'], $model->getStrByLang('title'), array('title' => $model->getStrByLang('title')));
?>
			</td>
			<td valign="top">
				<?php 
echo '<div>';
echo '<strong>' . tt('Type', 'apartments') . '</strong>: ' . Apartment::getNameByType($model->type);
echo '</div>';
?>
				<?php 
if (param('useShowUserInfo')) {
    if (issetModule('tariffPlans') && issetModule('paidservices')) {
        if (!Yii::app()->user->isGuest && TariffPlans::checkAllowShowPhone()) {
            echo '<div>';
            echo '<strong>' . tt('Owner phone', 'apartments') . '</strong>: <img src="' . Yii::app()->controller->createUrl('/apartments/main/generatephone', array('id' => $model->id, 'width' => 180)) . '" style="vertical-align: text-top;"/>';
开发者ID:barricade86,项目名称:raui,代码行数:31,代码来源:view_print.php

示例7: foreach

<?php 
if (is_array($ads) && count($ads) > 0) {
    $i = 0;
    foreach ($ads as $item) {
        if ($i == 4) {
            return;
        }
        echo '<div class="similarhr-ads-adv">';
        echo '<a href="#card-object" role="button" data-toggle="modal" class="image">';
        $res = Images::getMainThumb(297, 198, $item->images);
        echo CHtml::image($res['thumbUrl'], '', array('title' => $item->{'title_' . Yii::app()->language}, 'width' => 297, 'height' => 198));
        echo '<span>' . Apartment::getNameByType($item->type) . ' ' . $item->bt_getPriceMod() . '</span></a>';
        echo '<div class="similarhr-ads-desc">
                   		 <a href="#card-object" role="button" data-toggle="modal">' . truncateText(CHtml::encode($item->getStrByLang('title')), 6) . '</a>
                   			 <ul>
                        		<li>м. Савёловская</li>
                        		<li>ул. Раздельная, д.12</li>
                   			 </ul>
                	</div>
           ';
        echo '</div>';
        $i++;
    }
}
?>

开发者ID:barricade86,项目名称:raui,代码行数:25,代码来源:widgetSimilarAds_list.php

示例8: actionView

 public function actionView($id = 0, $url = '', $printable = 0)
 {
     //$this->showSearchForm = false;
     $this->htmlPageId = 'viewlisting';
     $apartment = NULL;
     $seo = NULL;
     if (($id || $url) && issetModule('seo')) {
         $url = $url ? $url : $id;
         $seo = SeoFriendlyUrl::getForView($url, $this->modelName);
         if ($seo) {
             $this->setSeo($seo);
             $id = $seo->model_id;
         }
     }
     if ($id) {
         $apartment = Apartment::model()->with(array('windowTo', 'objType', 'city'))->findByPk($id);
         // избавляемся от дублей
         $apartmentUrl = $apartment->getUrl(false);
         if (!$printable && issetModule('seo') && $apartment->seo && Yii::app()->request->url != $apartmentUrl) {
             $this->redirect($apartmentUrl, true, 301);
         }
     }
     if (!$apartment) {
         throw404();
     }
     if (!in_array($apartment->type, Apartment::availableApTypesIds()) || !in_array($apartment->price_type, array_keys(Apartment::getPriceArray(Apartment::PRICE_SALE, true)))) {
         throw404();
     }
     if ($apartment->owner_id != 1 && $apartment->owner_active == Apartment::STATUS_INACTIVE) {
         if (!(isset(Yii::app()->user->id) && Yii::app()->user->id == $apartment->owner_id) && !Yii::app()->user->checkAccess('backend_access')) {
             Yii::app()->user->setFlash('notice', tt('apartments_main_index_propertyNotAvailable', 'apartments'));
             throw404();
         }
     }
     if (($apartment->active == Apartment::STATUS_INACTIVE || $apartment->active == Apartment::STATUS_MODERATION) && !Yii::app()->user->checkAccess('backend_access') && !(isset(Yii::app()->user->id) && Yii::app()->user->id == $apartment->owner_id)) {
         Yii::app()->user->setFlash('notice', tt('apartments_main_index_propertyNotAvailable', 'apartments'));
         //$this->redirect(Yii::app()->homeUrl);
         throw404();
     }
     if ($apartment->active == Apartment::STATUS_MODERATION && $apartment->owner_active == Apartment::STATUS_ACTIVE && $apartment->owner_id == Yii::app()->user->id) {
         Yii::app()->user->setFlash('error', tc('Awaiting moderation'));
     }
     if ($apartment->deleted) {
         Yii::app()->user->setFlash('error', tt('Listing is deleted', 'apartments'));
     }
     $dateFree = CDateTimeParser::parse($apartment->is_free_to, 'yyyy-MM-dd');
     if ($dateFree && $dateFree < time() - 60 * 60 * 24) {
         $apartment->is_special_offer = 0;
         $apartment->update(array('is_special_offer'));
     }
     if (!Yii::app()->request->isAjaxRequest) {
         $ipAddress = Yii::app()->request->userHostAddress;
         $userAgent = Yii::app()->request->userAgent;
         Apartment::setApartmentVisitCount($apartment, $ipAddress, $userAgent);
     }
     $lastNews = News::getLastNews();
     $lastArticles = Article::getLastArticles();
     #######################################################################
     # для соц. кнопок
     if ($apartment->getStrByLang("title")) {
         Yii::app()->clientScript->registerMetaTag($apartment->getStrByLang("title"), null, null, array('property' => 'og:title'));
     }
     if ($apartment->getStrByLang("description")) {
         Yii::app()->clientScript->registerMetaTag($apartment->getStrByLang("description"), null, null, array('property' => 'og:description'));
     }
     Yii::app()->clientScript->registerMetaTag($apartment->getUrl(), null, null, array('property' => 'og:url'));
     if (Yii::app()->theme->name == 'atlas') {
         $res = Images::getMainThumb(640, 400, $apartment->images);
     } else {
         $res = Images::getMainThumb(300, 200, $apartment->images);
     }
     if (isset($res['thumbUrl']) && $res['thumbUrl']) {
         Yii::app()->clientScript->registerMetaTag($res['thumbUrl'], null, null, array('property' => 'og:image'));
         Yii::app()->clientScript->registerLinkTag('image_src', null, $res['thumbUrl']);
     }
     #######################################################################
     if ($printable) {
         $this->layout = '//layouts/print';
         $this->render('view_print', array('model' => $apartment));
     } else {
         $this->render('view', array('model' => $apartment, 'statistics' => Apartment::getApartmentVisitCount($apartment), 'lastNews' => $lastNews, 'lastArticles' => $lastArticles));
     }
 }
开发者ID:barricade86,项目名称:raui,代码行数:83,代码来源:MainController.php

示例9: array

        <?php 
if (param('useShowUserInfo')) {
    echo '<div class="apartment-user-info' . ($data->is_special_offer ? ' top50' : '') . '">';
    $this->widget('zii.widgets.jui.CJuiTabs', array('tabs' => array(tc('Listing provided by') => $this->renderPartial('//../modules/apartments/views/_user_info', array('data' => $data), true)), 'htmlOptions' => array('class' => 'info-tabs')));
    echo '</div>';
}
?>

		<div class="viewapartment-main-photo">
			<div class="apartment_type"><?php 
echo Apartment::getNameByType($data->type);
?>
</div>
			<?php 
$img = null;
$res = Images::getMainThumb(300, 200, $data->images);
$img = CHtml::image($res['thumbUrl'], $res['comment']);
if ($res['link']) {
    echo CHtml::link($img, $res['link'], array('rel' => 'prettyPhoto[img-gallery]', 'title' => $res['comment']));
} else {
    echo $img;
}
if (isFree()) {
    $var01 = 5;
    $var1 = User::model()->randomStringNonNumeric(3);
    $var2 = User::model()->randomStringNonNumeric(4);
    $var3 = User::model()->randomStringNonNumeric(5);
    $var4 = User::model()->randomStringNonNumeric(6);
    $var5 = User::model()->randomStringNonNumeric(7);
    $var6 = User::model()->randomStringNonNumeric(8);
    $var7 = User::model()->randomStringNonNumeric(3);
开发者ID:alexjkitty,项目名称:estate,代码行数:31,代码来源:_view.php

示例10: returnMainThumbForGrid

 public static function returnMainThumbForGrid($data = null)
 {
     if ($data) {
         $res = Images::getMainThumb(60, 45, $data->images);
         return CHtml::image($res['thumbUrl'], $data->getStrByLang('title'), array('title' => $data->getStrByLang('title'), 'class' => 'apartment_type_img_small'));
     }
 }
开发者ID:alexjkitty,项目名称:estate,代码行数:7,代码来源:Apartment.php

示例11: utf8_substr

    if (utf8_strlen($title) > 30) {
        $title = utf8_substr($title, 0, 30) . '...';
    }
    // Обрезаем, если больше 20
    $description = '';
    if ($item->canShowInView('description')) {
        $description = $item->getStrByLang('description');
    }
    ?>



                    <div class="add-luxury-offer">
                        <div class="image">
                            <?php 
    $res = Images::getMainThumb(526, 348, $item->images);
    $img = CHtml::image($res['thumbUrl'], $item->getStrByLang('title'), array('title' => $item->getStrByLang('title'), 'class' => 'apartment_type_img'));
    echo CHtml::link($img, $item->getUrl(), array('title' => $item->getStrByLang('title'), 'alt' => $item->getStrByLang('title')));
    ?>
                            <div class="add-luxury-offer-title">
                                <div><a href="<?php 
    echo $item->getUrl();
    ?>
"><?php 
    echo $title;
    ?>
 <?php 
    echo $item->square;
    ?>
 м<sup>2</sup></a></div>
                                <div><?php 
开发者ID:barricade86,项目名称:raui,代码行数:31,代码来源:widgetApartments_list_item_elit.php


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