Commit 40d10cda authored by Shakarim Sapa's avatar Shakarim Sapa

Merge remote-tracking branch 'origin/master'

parents c10cddca 75f04dd9
......@@ -33,6 +33,8 @@ $(function() {
toolbar2: "| responsivefilemanager | link unlink anchor | image media | forecolor backcolor | print preview code ",
image_advtab: true ,
forced_root_block : false,
force_br_newlines : false,
force_p_newlines : true,
external_filemanager_path:"/filemanager/",
filemanager_title:"Responsive Filemanager" ,
external_plugins: { "filemanager" : "/filemanager/plugin.min.js"}
......
......@@ -52,6 +52,8 @@ class PostController extends BaseController
throw new NotFoundHttpException('The requested page does not exist.');
}
$this->meta_title = Yii::t('app', 'Tag') . ': ' . $model->name . ' - ' . \Yii::$app->params['name'];
return $this->render('tag', [
'model' => $model,
]);
......
......@@ -65,7 +65,7 @@ class PostTag extends \common\components\ActiveRecordModel
*/
public function getPosts()
{
return $this->hasMany(Post::className(), ['id' => 'post_id'])->viaTable('posts_tags_assign', ['tag_id' => 'id']);
return $this->hasMany(Post::className(), ['id' => 'post_id'])->viaTable('posts_tags_assign', ['tag_id' => 'id'])->where(['active' => 1]);
}
/**
......
......@@ -15,8 +15,9 @@ use common\models\Settings;
<div class="sidebar_module_body">
<?php $tags = PostTag::find()
->innerJoinWith('assigns')
->innerJoinWith('posts')
->groupBy(['posts_tags_assign.tag_id'])
->where(['posts.active' => 1])
->orderBy('RAND()')
->limit(7)
->all();
......
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