|
@@ -183,7 +183,17 @@ class News extends \app\models\base\News
|
|
|
.date(" Y, H:i", strtotime($this->dt_pub))
|
|
|
;
|
|
|
}
|
|
|
-
|
|
|
+ public function isPhotosOnNews( $dt_pub = null )
|
|
|
+ {
|
|
|
+ if( $this->inscription) return true;
|
|
|
+ if( $dt_pub ){
|
|
|
+ $dt_pub = strtotime($dt_pub);
|
|
|
+ }else{
|
|
|
+ $dt_pub = strtotime($this->dt_pub);
|
|
|
+ }
|
|
|
+ if( $dt_pub >= strtotime(Yii::$app->params['delPhotoB']) && $dt_pub < strtotime(Yii::$app->params['delPhotoE']) ) return false;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
public function renderBody()
|
|
|
{
|
|
|
$post = $this;
|
|
@@ -197,7 +207,7 @@ class News extends \app\models\base\News
|
|
|
$body = self::processTextImg($body);
|
|
|
$body = self::processInjects($body);
|
|
|
$body = self::processAudio($body);
|
|
|
- if( strtotime( $post->getDatePub() ) >= strtotime(Yii::$app->params['delPhoto']) ){
|
|
|
+ if( $this->isPhotosOnNews($post->getDatePub() ) ){
|
|
|
$body = self::processSlider($body, $post); //old slider
|
|
|
$body = self::processGalleriesInjects($body, $post);
|
|
|
}
|
|
@@ -537,7 +547,7 @@ class News extends \app\models\base\News
|
|
|
/*
|
|
|
После этой даты не выводить фото до подтверждения юриста
|
|
|
*/
|
|
|
- if( strtotime( $obj->getDatePub() ) < strtotime(Yii::$app->params['delPhoto']) ){
|
|
|
+ if( !$this->isPhotosOnNews( $obj->getDatePub() ) ){
|
|
|
$bad = '/images/default.jpg';
|
|
|
return '<span><picture class="w-100"><img src="'.$bad.'" width="100%"/></picture></span>';
|
|
|
};
|