浏览代码

logrid img

amic 2 月之前
父节点
当前提交
448c0a54ca
共有 2 个文件被更改,包括 13 次插入0 次删除
  1. 1 0
      models/News.php
  2. 12 0
      views/news/view.php

+ 1 - 0
models/News.php

@@ -186,6 +186,7 @@ class News extends \app\models\base\News
 	public function isPhotosOnNews( $dt_pub = null )
 	{
 		if( $this->inscription) return true;
+		if( isset( $this->photo_title ) && stripos($this->photo_title, 'amic.ru') !== false ) return true;
 		if( $dt_pub ){
 			$dt_pub = strtotime($dt_pub);
 		}else{

+ 12 - 0
views/news/view.php

@@ -38,6 +38,18 @@ $retina = $preview->getUrl(Image::SIZE_1040x586,"jpg");
 $normal = $preview->getUrl(Image::SIZE_841x473,"webp");
 $bad = $preview->getUrl(Image::SIZE_680x383,'jpg');
 
+if( $model->type == 6 ){; //лонгрид
+	$retina = $preview->getUrl(Image::SIZE_HD,"jpg");
+	$normal = $preview->getUrl(Image::SIZE_HD,"jpg");
+	$bad = $preview->getUrl(Image::SIZE_1040x586,"webp");
+}
+
+if( $model->type == 2 ){; //разворот
+	$retina = $preview->getUrl(Image::SIZE_HD,"jpg");
+	$normal = $preview->getUrl(Image::SIZE_1040x586,"webp");
+	$bad = $preview->getUrl(Image::SIZE_841x473,"webp");
+}
+
 $bad = $bad?$bad:'/images/default.jpg';
 
 if( $retina === false || $normal === false ){