本文整理汇总了PHP中ImageHelper::getImages方法的典型用法代码示例。如果您正苦于以下问题:PHP ImageHelper::getImages方法的具体用法?PHP ImageHelper::getImages怎么用?PHP ImageHelper::getImages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageHelper
的用法示例。
在下文中一共展示了ImageHelper::getImages方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionDescription
public function actionDescription()
{
Yii::app()->page->setInfo(array("description" => $this->description, "keyWord" => $this->keyWord));
$id = 0;
$class = $this->classModel;
if (!empty($_GET["slug"])) {
$model = $class::fetchBySlug(trim($_GET["slug"]));
if ($model->id > 0) {
$_GET["id"] = $model->id;
$id = $model->id;
} else {
$arrId = explode("-", $_GET["slug"]);
if (sizeof($arrId) > 0) {
$id = (int) $arrId[0];
}
}
}
$error = Yii::t("page", "Произошла ошибка перехода на страницу, проверьте правильно написания адреса страницы");
if ($id > 0) {
$item = CatalogTours::fetch($id);
if ($item->id > 0) {
LogHelper::saveCatLogTours($item->id);
CCModelHelper::colCounter($item);
// Картинки тура
$images = ImageHelper::getImages($item);
Yii::app()->page->title = $item->name . ", тур " . $item->category_id->name . ", " . $item->country_id->name;
$this->render('description', array("item" => $item, "images" => $images, "otherTours" => CatalogTours::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("image>'' AND country_id=:country_id AND id!=:id AND firm_id!=:firm_id")->setParams(array(":country_id" => $item->country_id->id, ":id" => $item->id, ":firm_id" => $item->firm_id->id))->setOrderBy("col DESC")->setLimit(6)), "firmsTours" => CatalogTours::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("image>'' AND firm_id=:firm_id AND id!=:id")->setParams(array(":firm_id" => $item->firm_id->id, ":id" => $item->id))->setOrderBy("col DESC")->setLimit(6)), "tourCount" => CatalogTours::count(DBQueryParamsClass::CreateParams()->setConditions("country_id=:country")->setParams(array(":country" => $item->country_id->id))), "firmCount" => CatalogFirms::count(DBQueryParamsClass::CreateParams()->setConditions("country_id=:country")->setParams(array(":country" => $item->country_id->id)))));
} else {
throw new CHttpException("", $error);
}
} else {
throw new CHttpException("", $error);
}
}
示例2: actionDescription
public function actionDescription()
{
Yii::app()->page->setInfo(array("description" => $this->description, "keyWord" => $this->keyWord));
$id = 0;
$class = $this->classModel;
if (!empty($_GET["slug"])) {
$model = $class::fetchBySlug(trim($_GET["slug"]));
if ($model->id > 0) {
$_GET["id"] = $model->id;
$id = $model->id;
}
}
$error = Yii::t("page", "Произошла ошибка перехода на страницу, проверьте правильно написания адреса страницы");
if ($id > 0) {
$item = CatalogFirmsService::fetch($id);
if ($item->id > 0) {
CCModelHelper::colCounter($item);
// Картинки тура
$images = ImageHelper::getImages($item);
Yii::app()->page->title = $item->name . " - " . Yii::t("page", "услуги от компании");
$this->render('description', array("item" => $item, "images" => $images, "firmsService" => CatalogFirmsService::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("firm_id=:firm_id AND id!=:id")->setParams(array(":firm_id" => $item->firm_id, ":id" => $item->id))->setCache(0)), "firmsItems" => CatalogFirmsItems::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("firm_id=:firm_id")->setParams(array(":firm_id" => $item->firm_id))->setCache(0))));
} else {
throw new CHttpException("", $error);
}
} else {
throw new CHttpException("", $error);
}
}
示例3: actionDescription
public function actionDescription()
{
Yii::app()->page->setInfo(array("description" => $this->description, "keyWord" => $this->keyWord));
$id = 0;
$class = $this->classModel;
$slug = !empty($_GET["slug"]) ? $_GET["slug"] : "";
if (!empty($_GET["slug"])) {
$model = $class::fetchBySlug(trim($slug));
if ($model->id > 0) {
$_GET["id"] = $model->id;
$id = $model->id;
}
}
// Проверяем по ID
if ($id == 0) {
$ar = explode("-", $slug);
if ((int) $ar[0] > 0) {
$model = $class::fetch((int) $ar[0]);
$id = $model->id;
}
}
if ($id > 0) {
if ($model->id > 0) {
$item = $model;
} else {
$item = $class::fetch($id);
}
if ($item->id > 0) {
$images = ImageHelper::getImages($item);
$other = $class::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("category_id=:category_id AND id!=:id")->setParams(array(":category_id" => $item->category_id->id, ":id" => $item->id))->setOrderBy("id DESC")->setLimit(12));
$tourCategory = $item->tour_category;
if (!empty($tourCategory) && sizeof($tourCategory) > 0) {
$dopSQL = " AND ( ";
$m = 0;
foreach ($tourCategory as $tCategory) {
if ($m > 0) {
$dopSQL .= " OR ";
}
$dopSQL .= "category_id=" . $tCategory->id;
$m++;
}
$dopSQL .= ") ";
$tours = CatalogTours::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("country_id=:country_id " . $dopSQL)->setParams(array(":country_id" => $item->country_id->id))->setOrderBy("rating DESC")->setLimit(9));
} elseif ($item->country_id->id > 0) {
$tours = CatalogTours::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("country_id=:country_id")->setParams(array(":country_id" => $item->country_id->id))->setOrderBy("rating DESC")->setLimit(10));
} else {
$tours = array();
}
Yii::app()->page->title = $item->name;
$this->render('description', array("item" => $item, "other" => $other, "images" => $images, "tours" => $tours, "hotelCount" => $class::count(DBQueryParamsClass::CreateParams()->setConditions("category_id=:category_id")->setParams(array(":category_id" => $item->category_id->id)))));
} else {
throw new CHttpException("Ошибка", Yii::t("page", "Ошибка перехода на страницу"));
}
} else {
throw new CHttpException("Ошибка", Yii::t("page", "Ошибка перехода на страницу"));
}
}
示例4: actionDescription
public function actionDescription()
{
$slug = Yii::app()->request->getParam("slug", "");
if (!empty($slug)) {
$item = CatalogAttractions::fetchBySlug($slug);
if ($item->id > 0) {
Yii::app()->page->setTitle($item->name);
$list = CatalogAttractions::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("city_id=:cid AND id!=:id")->setParams(array(":cid" => $item->city_id->id, ":id" => $item->id))->setLimit(4));
$images = ImageHelper::getImages($item);
$this->render("description", array("item" => $item, "other" => $list, "images" => $images));
}
}
}
示例5:
<?php
if (!$tour->slug) {
$tour->slug = SiteHelper::getSlug($tour);
}
$listImages = ImageHelper::getImages($tour, 1);
?>
<div class="IBItem IBTours">
<?php
if ($tour->price > 0) {
?>
<p><?php
echo Yii::t("page", "цена");
?>
:<b><?php
echo $tour->price;
?>
</b>у.е.</p><?php
}
?>
<?php
if ($tour->col > 0) {
?>
<div class="floatRight rightInfo"><?php
echo Yii::t("page", "просмотров");
?>
: <b><?php
echo $tour->col;
?>
</b></div><?php
示例6: array
<?php
$this->widget('addressLineWidget', array('links' => array(Yii::t("page", "объявления о работе") => SiteHelper::createUrl("/work"), $item->category_id->name => SiteHelper::createUrl("/work") . "/" . $item->category_id->slug . ".html", $item->name)));
$images = ImageHelper::getImages($item);
?>
<div id="InnerText">
<br/>
<?php
SiteHelper::renderDinamicPartial("pageDescriptionTop");
?>
<h1><?php
echo $item->name;
?>
</h1>
<div id="ITText">
<div class="LParams">
<br/>
<?php
echo Yii::t("page", "дата");
?>
: <?php
echo SiteHelper::getDateOnFormat($item->date, "d.m.Y");
?>
<br/>
<a href="<?php
echo SiteHelper::createUrl("/work") . "/" . $item->category_id->slug;
?>
.html"><?php
echo $item->category_id->name;
?>
示例7:
<tr <?php
echo $banner->hot == 1 ? 'class="isHot"' : "";
?>
>
<td><?php
echo $banner->id;
?>
</td>
<td>
<?php
if (!$banner->image) {
$countImages = 5;
} else {
$countImages = 4;
}
$listImages = ImageHelper::getImages($banner, $countImages);
if (sizeof($listImages) > 0 || $banner->image) {
?>
<div class="listItemsImages">
<?php
if ($banner->image) {
?>
<div class="LII_1"><img src="<?php
echo ImageHelper::getImage($banner->image, 3);
?>
" alt="" /></div><?php
}
?>
<?php
if ($banner->image) {
$i = 2;
示例8: getRelatedImagesWidget
function getRelatedImagesWidget($title)
{
global $wgUser;
$exceptions = wfMsg('ih_exceptions');
$imageExceptions = split("\n", $exceptions);
$articles = ImageHelper::getLinkedArticles($title);
$images = array();
foreach ($articles as $t) {
$results = ImageHelper::getImages($t->getArticleID());
if (count($results) <= 1) {
continue;
}
$titleDb = $title->getDBkey();
foreach ($results as $row) {
if ($row['il_to'] != $titleDb && !in_array($row['il_to'], $imageExceptions)) {
$images[] = $row['il_to'];
}
}
}
$count = 0;
$maxLoc = count($images);
$maxImages = $maxLoc;
$finalImages = array();
while ($count < 6 && $count < $maxImages) {
$loc = rand(0, $maxLoc);
if ($images[$loc] != null) {
$image = Title::newFromText("Image:" . $images[$loc]);
if ($image && $image->getArticleID() > 0) {
$file = wfFindFile($image);
if ($file && isset($file)) {
$finalImages[] = array('title' => $image, 'file' => $file);
$images[$loc] = null;
$count++;
} else {
$maxImages--;
}
} else {
$maxImages--;
}
$images[$loc] = null;
}
}
if (count($finalImages) > 0) {
$html = '<div><h3>' . wfMsg('ih_relatedimages_widget') . '</h3><table style="margin-top:10px" class="image_siderelated">';
$count = 0;
foreach ($finalImages as $imageObject) {
$image = $imageObject['title'];
$file = $imageObject['file'];
if ($count % 2 == 0) {
$html .= "<tr>";
}
$heightPreference = ImageHelper::heightPreference(127, 140, $file);
$thumb = $file->getThumbnail(127, 140, true, true, $heightPreference);
$imageUrl = $image->getFullURL();
$thumbUrl = $thumb->url;
$imageTitle = $imageName;
$html .= "<td valign='top'>\n\t\t\t\t\t\t\t<a href='" . $imageUrl . "' title='" . $imageTitle . "' class='image'>\n\t\t\t\t\t\t\t<img border='0' class='mwimage101' src='" . wfGetPad($thumbUrl) . "' alt='" . $imageTitle . "'>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</td>";
if ($count % 2 == 2) {
$html .= "</tr>";
}
$count++;
}
if ($count % 3 != 2) {
$html .= "</tr>";
}
$html .= "</table></div>";
return $html;
}
}
示例9:
<tr <?php
echo $item->is_hot == 1 ? 'class="isHot"' : "";
?>
>
<td><?php
echo $item->id;
?>
</td>
<td>
<?php
if (!$item->image) {
$countImages = 5;
} else {
$countImages = 4;
}
$listImages = ImageHelper::getImages($item, $countImages);
if (sizeof($listImages) > 0 || $item->image) {
?>
<div class="listItemsImages">
<?php
if ($item->image) {
?>
<div class="LII_1"><img src="<?php
echo ImageHelper::getImage($item->image, 3);
?>
" alt="" /></div><?php
}
?>
<?php
if ($item->image) {
$i = 2;
示例10: run
public function run()
{
$images = ImageHelper::getImages($this->item, 1);
$this->render("info", array('link' => $this->link, 'images' => $images, 'item' => $this->item));
}
示例11: getAnimateImageBlock
static function getAnimateImageBlock($item, $link, $title = "", $count = 3)
{
if (!$item->image) {
$countImages = $count + 1;
} else {
$countImages = $count;
}
$count = 0;
if (defined("YII_SUBDOMAIN") && YII_SUBDOMAIN == "wap-") {
$countImages = 1;
}
$titleValue = !empty($title) ? $title : $item->name;
$listImages = ImageHelper::getImages($item, $countImages);
echo '<div class="listItemsImages">';
if (sizeof($listImages) > 0 || $item->image) {
?>
<?php
if ($item->image) {
?>
<div class="LII_1"><a href="<?php
echo $link;
?>
" title="<?php
echo $titleValue;
?>
"><img src="<?php
echo ImageHelper::getImage($item->image, 2);
?>
" alt="<?php
echo $titleValue;
?>
" /></a></div><?php
}
?>
<?php
if ($item->image) {
$i = 2;
} else {
$i = 1;
}
foreach ($listImages as $LItem) {
if ($i == 1) {
$imageSize = 2;
} else {
$imageSize = 3;
}
?>
<div class="LII_<?php
echo $i;
?>
">
<?php
if ($i == 1) {
?>
<a href="<?php
echo $link;
?>
" title="<?php
echo $titleValue;
?>
"><?php
}
?>
<img src="<?php
echo ImageHelper::getImage($LItem->image, $imageSize);
?>
" alt="<?php
echo $titleValue;
?>
" />
<?php
if ($i == 1) {
?>
</a><?php
}
?>
</div>
<?php
$i++;
}
?>
<?php
}
echo '</div>';
}
示例12: foreach
<?php
if ($this->beginCache($link . "_error-page" . Yii::app()->getLanguage(), array('duration' => 3600 * 12))) {
?>
<div class="ListTours">
<h2>Смотрите также</h2>
<?php
$i = 0;
foreach ($list as $line) {
$i++;
if ($i == 11) {
break;
}
if ($line->image) {
$image = $line->image;
} else {
$images = ImageHelper::getImages($line, 1);
if (sizeof($images) > 0) {
$image = $images[0]->image;
}
}
if (empty($image)) {
$i--;
continue;
}
?>
<div class="LTItem">
<div class="LTImag LTI2"><a href="<?php
echo SiteHelper::createUrl("/" . $link . "/description") . "/" . $line["slug"];
?>
.html" title="<?php
echo $line["name"];
示例13: actionShow
public function actionShow($idIn = 0, $locatIn = "", $return = FALSE)
{
$id = (int) Yii::app()->request->getParam("id", 0);
if ($id == 0 && $idIn > 0) {
$id = $idIn;
}
$locat = Yii::app()->request->getParam("location", "");
if (empty($locat) && !empty($locatIn)) {
$locat = $locatIn;
}
/*
График:
По странам ( сортировка по цене ) 31
По категориям ( сортировка по цене ) 30
По странам ( сортировка по просмотрам)
По категориям ( сортировка по просмотрам )
Определям кандидата по очереди сначала города потом категории
Выбираем по сортировке первую страну
Проверяем по очередньсти
Формируем письмо
Заголовок ( зависит от того по стране или категории + от сортировки )
указываем группу подписциков
указываем группу рассылоку
И полетели
*/
$cout = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Cache-Control" content="public"/>
<meta http-equiv="Cache-Control" content="max-age=86400, must-revalidate"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>';
$logTable = SubscribeTable::fetch($id);
if ($logTable->id > 0) {
if ($locat == "uzb" && $logTable->country_id->id == 1) {
return "";
}
$countryId = 0;
$categoryId = 0;
if ($logTable->country_id->id > 0) {
$countryId = $logTable->country_id->id;
$countryModel = CatalogCountry::fetch($countryId);
}
if ($logTable->category_id->id > 0) {
$categoryId = $logTable->category_id->id;
$categoryModel = CatalogToursCategory::fetch($categoryId);
}
if ($countryId > 0 || $categoryId > 0) {
$info = [];
if ($countryId > 0) {
$toursMinPrice = CatalogTours::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("country_id=:cid AND price>0 AND active=1")->setParams([":cid" => $countryModel->id])->setOrderBy("price")->setLimit(1)->setCache(0));
$tours = CatalogTours::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("country_id=:cid AND id !=:id AND active=1")->setParams([":cid" => $countryModel->id, ":id" => $toursMinPrice[0]->id])->setLimit(7)->setOrderBy("rating DESC, price"));
$tours[] = $toursMinPrice[0];
$info = CatalogInfo::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("country_id=:cid")->setParams([":cid" => $countryModel->id])->setLimit(4)->setOrderBy("id DESC"));
$subject = $countryModel->title . ", от " . $tours[sizeof($tours) - 1]->price . ($tours[sizeof($tours) - 1]->currency_id->id ? $tours[sizeof($tours) - 1]->currency_id->title : "\$");
} else {
$params = [":cid" => $categoryModel->id];
$condition = "category_id=:cid";
if ($locat == "uzb") {
echo $locat . "==uzb<br/>";
$params = array_merge($params, [":country" => 1]);
$condition .= " AND country_id!=:country";
} else {
$params = array_merge($params, [":country" => 1]);
$condition .= " AND country_id=:country";
}
echo $condition . "*";
$toursMinPrice = CatalogTours::fetchAll(DBQueryParamsClass::CreateParams()->setConditions($condition)->setParams($params)->setOrderBy("price")->setLimit(1)->setCache(0));
$tours = CatalogTours::fetchAll(DBQueryParamsClass::CreateParams()->setConditions($condition . " AND id !=:id")->setParams(array_merge($params, [":id" => $toursMinPrice[0]->id]))->setLimit(7)->setOrderBy("rating DESC, price"));
$tours[] = $toursMinPrice[0];
//$info = CatalogInfo::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("country_id=:cid")->setParams([":cid" => $categoryModel->id])->setLimit(4)->setOrderBy("id DESC"));
if ($tours[sizeof($tours) - 1]->price > 0) {
$subject = "Тур - " . $categoryModel->name . ", от " . $tours[sizeof($tours) - 1]->price . ($tours[sizeof($tours) - 1]->currency_id->id ? $tours[sizeof($tours) - 1]->currency_id->title : "\$");
} else {
$subject = "Тур - " . $categoryModel->name;
}
}
$message = "Предлагаем Вашему вниманию интересную подборку с нашего портала <a href=\"http://www.world-travel.uz\">World-Travel.uz</a>.<br/><br/><h1>" . $subject . "</h1><br/><table>";
$n = 0;
$reserveNum = 0;
$reserveList = [];
foreach ($tours as $tour) {
if ($tour->id == 0) {
continue;
}
$image = ImageHelper::getImages($tour, 1);
// Если картинки для тура нету, то берем её из резерва catalog_image_reserve
if (sizeof($image) == 0) {
if (sizeof($reserveList) == 0) {
$reserveList = CatalogImageReserve::findByAttributes(["country_id" => $tour->country_id->id]);
}
if (sizeof($reserveList) > 0) {
$new = new CatGallery();
if (!empty($reserveList[$reserveNum])) {
$new->image = $reserveList[$reserveNum]->image;
} else {
//.........这里部分代码省略.........