#1003 - Создать раздел и модуль Блог

parent e446be09
...@@ -47,6 +47,8 @@ class BidController extends \common\components\BaseController ...@@ -47,6 +47,8 @@ class BidController extends \common\components\BaseController
$model->file = null; $model->file = null;
}*/ }*/
// Yii::$app->user->identity->afterSubscribe(12);
$model->save(); $model->save();
$model->send(); $model->send();
......
...@@ -82,4 +82,16 @@ class PostLang extends \common\components\ActiveRecordModel ...@@ -82,4 +82,16 @@ class PostLang extends \common\components\ActiveRecordModel
{ {
return $this->hasOne(Languages::className(), ['id' => 'lang_id']); return $this->hasOne(Languages::className(), ['id' => 'lang_id']);
} }
public function cutText($chars)
{
$text = strip_tags($this->text, '<a>');
$text = $text . " ";
$text = substr($text, 0, $chars);
$text = substr($text, 0, strrpos($text, ' '));
$text = $text . "...";
return '<p>'.$text.'</p>';
}
} }
...@@ -18,15 +18,9 @@ use yii\helpers\Url; ...@@ -18,15 +18,9 @@ use yii\helpers\Url;
<?=$model->getViews()->count()?> <?=$model->getViews()->count()?>
<div class="blog_toltip_left">Количество просмотров</div> <div class="blog_toltip_left">Количество просмотров</div>
</span> </span>
<!-- <ul class="article_short_social">
<li> <?=$this->render('_social', ['link' => Url::to(['/blog/'.$model->url], true), 'title' => $model->lang->title])?>
<a href="#"><img src="/images/icon/sh_social_vk.png" height="30" width="30" alt=""></a>
<a href="#"><img src="/images/icon/sh_social_fb.png" height="30" width="30" alt=""></a>
<a href="#"><img src="/images/icon/sh_social_tw.png" height="30" width="30" alt=""></a>
<a href="#"><img src="/images/icon/sh_social_gp.png" height="30" width="30" alt=""></a>
<a href="#"><img src="/images/icon/sh_social_t.png" height="30" width="30" alt=""></a>
</li>
</ul> -->
</div> </div>
<div class="article_short_tags"> <div class="article_short_tags">
...@@ -43,7 +37,7 @@ use yii\helpers\Url; ...@@ -43,7 +37,7 @@ use yii\helpers\Url;
echo Html::img($model->preview); echo Html::img($model->preview);
endif; ?> endif; ?>
<?=$model->lang->text?> <?=$model->lang->cutText(650)?>
</div> </div>
</article> </article>
......
<ul class="article_short_social">
<li>
<a href="#" onclick="return window.open('http://vkontakte.ru/share.php?url=<?=$link?>&title=<?=$title?>', 'Soc', 'screenX=100,screenY=100,height=500,width=500,location=no,toolbar=no,directories=no,menubar=no,status=no');"><img src="/images/icon/sh_social_vk.png" height="30" width="30" alt=""></a>
<a href="#" onclick="return window.open('http://www.facebook.com/share.php?u=<?=$title?>', 'Soc', 'screenX=100,screenY=100,height=500,width=500,location=no,toolbar=no,directories=no,menubar=no,status=no');"><img src="/images/icon/sh_social_fb.png" height="30" width="30" alt=""></a>
<a href="#" onclick="return window.open('http://twitter.com/timeline/home?status=<?=$title?>%20<?=$link?>', 'Soc', 'screenX=100,screenY=100,height=500,width=500,location=no,toolbar=no,directories=no,menubar=no,status=no');;"><img src="/images/icon/sh_social_tw.png" height="30" width="30" alt=""></a>
<a href="#" onclick="return window.open('https://plus.google.com/share?url=<?=$link?>', 'Soc', 'screenX=100,screenY=100,height=500,width=500,location=no,toolbar=no,directories=no,menubar=no,status=no');"><img src="/images/icon/sh_social_gp.png" height="30" width="30" alt=""></a>
<!-- <a href="#"><img src="/images/icon/sh_social_t.png" height="30" width="30" alt=""></a> -->
</li>
</ul>
\ No newline at end of file
...@@ -21,15 +21,9 @@ use yii\helpers\Html; ...@@ -21,15 +21,9 @@ use yii\helpers\Html;
<?=$model->getViews()->count()?> <?=$model->getViews()->count()?>
<div class="blog_toltip_left">Количество просмотров</div> <div class="blog_toltip_left">Количество просмотров</div>
</span> </span>
<!-- <ul class="article_short_social">
<li> <?=$this->render('_social', ['link' => Url::to(['/blog/'.$model->url], true), 'title' => $model->lang->title])?>
<a href="#"><img src="/images/icon/sh_social_vk.png" height="30" width="30" alt=""></a>
<a href="#"><img src="/images/icon/sh_social_fb.png" height="30" width="30" alt=""></a>
<a href="#"><img src="/images/icon/sh_social_tw.png" height="30" width="30" alt=""></a>
<a href="#"><img src="/images/icon/sh_social_gp.png" height="30" width="30" alt=""></a>
<a href="#"><img src="/images/icon/sh_social_t.png" height="30" width="30" alt=""></a>
</li>
</ul> -->
</div> </div>
<div class="article_short_tags"> <div class="article_short_tags">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment