|
@@ -80,6 +80,17 @@ class Image extends Model
|
|
|
|
|
|
public function getSomebody($one, $type){
|
|
|
$f = false;
|
|
|
+// Повторное изображение из другой новости
|
|
|
+ if( isset( $this->photo_name ) && $this->photo_name != '' ){
|
|
|
+ if( is_numeric( $this->photo_name ) && is_int( $this->photo_name*1 ) ){
|
|
|
+ $obj = new image();
|
|
|
+ $obj = $obj->findOne($this->photo_name*1);
|
|
|
+ return $obj->getUrl($one, $type, false);
|
|
|
+ }
|
|
|
+ return $this->photo_name;
|
|
|
+ }
|
|
|
+//
|
|
|
+
|
|
|
foreach( self::PREFIX_IMG as $key => $pref ){
|
|
|
$key = str_replace( '_', '', $key );
|
|
|
if( $key == $one ) $f = true;
|
|
@@ -103,14 +114,6 @@ class Image extends Model
|
|
|
}
|
|
|
if( $type == 'jpg' && file_exists(\Yii::getAlias('@webroot')."/images/news/news/{$this->post_id}_{$pref}.jpg") ) return "/images/news/news/{$this->post_id}_{$pref}.jpg";
|
|
|
}
|
|
|
- if( isset( $this->photo_name ) && $this->photo_name != '' ){
|
|
|
- if( is_numeric( $this->photo_name ) && is_int( $this->photo_name*1 ) ){
|
|
|
- $obj = new image();
|
|
|
- $obj = $obj->findOne($this->photo_name*1);
|
|
|
- return $obj->getUrl($one, $type, false);
|
|
|
- }
|
|
|
- return $this->photo_name;
|
|
|
- }
|
|
|
return false;
|
|
|
}
|
|
|
public function getIcon(){
|