code:
<?php

namespace app\modules\yboard\models;

use Yii;
use app\modules\yboard\YBoard;
use app\modules\yboard\components\Utils;
use yii\db\Query;

/**
 * This is the model class for table "yboard_post".
 *
 * @property string $id
 * @property string $subject
 * @property string $content
 * @property string $user_id
 * @property string $topic_id
 * @property string $forum_id
 * @property string $original_post
 * @property string $ip
 * @property string $create_time
 * @property integer $approved
 * @property string $change_id
 * @property string $change_time
 * @property string $change_reason
 * @property integer $upvoted
 *
 * @property YBoardLogTopic[] $yboardLogTopics
 * @property YBoardMessage[] $yboardMessages
 * @property YBoardPoll[] $yboardPolls
 * @property YBoardForum $forum
 * @property YBoardPost $topic
 * @property YBoardPost[] $yboardPosts
 * @property YBoardMember $user
 * @property YBoardUpvoted[] $yboardUpvoteds
 */
class YBoardPost extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'YBoardPost';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['subject', 'content'], 'required'],
            [['content'], 'string'],
            [['user_id', 'topic_id', 'forum_id', 'approved', 'change_id', 'upvoted'], 'integer'],
            [['create_time', 'original_post','change_time'], 'safe'],
            [['subject', 'change_reason'], 'string', 'max' => 255],
            [['ip'], 'string', 'max' => 39]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => YBoard::t('yboard', 'ID'),
            'subject' => YBoard::t('yboard', 'Subject'),
            'content' => YBoard::t('yboard', 'Content'),
            'user_id' => YBoard::t('yboard', 'User ID'),
            'topic_id' => YBoard::t('yboard', 'Topic ID'),
            'forum_id' => YBoard::t('yboard', 'Forum ID'),
            'ip' => YBoard::t('yboard', 'Ip'),
            'create_time' => YBoard::t('yboard', 'Create Time'),
            'approved' => YBoard::t('yboard', 'Approved'),
            'change_id' => YBoard::t('yboard', 'Change ID'),
            'change_time' => YBoard::t('yboard', 'Change Time'),
            'change_reason' => YBoard::t('yboard', 'Change Reason'),
            'upvoted' => YBoard::t('yboard', 'Upvoted'),
            'original_post' => YBoard::t('yboard', 'Original Post'),
        ];
    }

    public function beforeSave($insert)
    {
        if($this->isNewRecord){
            $this->create_time = time(); // new \yii\db\Expression('NOW()');
        }
        else
        {
            $this->change_time = time(); //new \yii\db\Expression('NOW()');
        }

        $this->content = Utils::cleanHtml($this->content);

        return parent::beforeSave($insert);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getLogTopics()
    {
        return $this->hasMany(YBoardLogTopic::className(), ['last_post_id' => 'id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getMessages()
    {
        return $this->hasMany(YBoardMessage::className(), ['post_id' => 'id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getPolls()
    {
        return $this->hasMany(YBoardPoll::className(), ['post_id' => 'id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getForum()
    {
        return $this->hasOne(YBoardForum::className(), ['id' => 'forum_id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getTopic()
    {
        return $this->hasOne(YBoardTopic::className(), ['id' => 'topic_id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getPosts()
    {
        return $this->hasMany(YBoardPost::className(), ['topic_id' => 'id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getPoster()
    {
        return $this->hasOne(YBoardMember::className(), ['id' => 'user_id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getUpvotes()
    {
        return $this->hasMany(YBoardUpvoted::className(), ['post_id' => 'id']);
    }

    /**
     * @inheritdoc
     * @return YBoardForumQuery
     */
    public static function find()
    {
        return new \app\modules\yboard\models\YBoardPostQuery(get_called_class());
    }

    public function afterSave($insert, $changedAttributes)
    {
        $this->resetRank(); // post added, change user rank to reflect post count

        return parent::afterSave($insert, $changedAttributes);
    }

    public function beforeDelete()
    {
        if (parent::beforeDelete()) {
            //delete all upvotes and polls
            YBoardUpvoted::deleteAll(['post_id'=>$this->id]);
            YBoardPoll::deleteAll(['post_id'=>$this->id]);

            return true;
        } else {
            return false;
        }
    }

    public function afterDelete()
    {
        $this->resetRank(); // post deleted, change user rank to reflect post count
        $this->resetLastPost();
        $this->resetFirstTopicPost();

        return parent::afterDelete();
    }

    protected function resetRank()
    {
        $author = YBoardMember::findOne($this->user_id);
        if($author!==null)
        {
            $query = new Query;
            $query->select('id')
                ->from('YBoardRank')
                ->orderBy('min_posts ASC')
                ->where('min_posts>='.$author->totalReplies)
                ->limit(1);

            $count = $query->count();
            $id = $query->one();

            if($author->rank_id!=$id['id'] && $count>0)
            {
                $author->setAttribute('rank_id', $id['id']);
                $author->save();
            }
        }
    }

    /**
	 * Reset the last post of a topic and a forum when post is deleted
	 */
	private function resetLastPost() {
		$forum = YBoardForum::find()->where(['last_post_id'=>$this->id])->one();
		$topic = YBoardTopic::find()->where(['last_post_id'=>$this->id])->one();

		if($forum !== null) {
			$post = YBoardPost::find()
            ->where(['forum_id'=>$forum->id, 'approved'=>1])
            ->orderBy('id DESC')
            ->limit(1)
            ->one();

			if($post === null) {
				$forum->last_post_id = null;
			} else {
				$forum->last_post_id = $post->id;
			}
			$forum->update();
		}

		if($topic !== null) {
			$post = YBoardPost::find()
            ->where(['topic_id'=>$topic->id, 'approved'=>1])
            ->orderBy('id DESC')
            ->limit(1)
            ->one();

			if($post === null) {
				$topic->last_post_id = null;
			} else {
				$topic->last_post_id = $post->id;
			}
			$topic->update();
		}
	}

    /**
	 * Reset the first post id of a topic when a first post is deleted
	 */
	private function resetFirstTopicPost() {
		$model = YBoardTopic::find()
        ->where(['first_post_id'=>$this->id])
        ->one();

		if($model !== null) {
			$post = YBoardPost::find()
            ->where(['topic_id'=>$model->id])
            ->orderBy('id DESC')
            ->one();

			if($post !== null) {
				$model->user_id = $post->user_id;
				$model->first_post_id = $post->id;
				$model->save();
			}
		}
	}

}


code:
<?php
//Scopes for YBoardForum et al
namespace app\modules\yboard\models;

class YBoardPostQuery extends \yii\db\ActiveQuery
{
    public function approvedScope()
    {
        return $this->andWhere(['approved' => 1]);
    }

    public function unapprovedScope()
    {
        return $this->andWhere(['approved' => 0]);
    }
}

license: mit


code:
<?php

namespace app\modules\yboard\models;

use Yii;
use app\modules\yboard\YBoard;

/**
 * This is the model class for table "YBoardRank".
 *
 * @property integer $id
 * @property string $title
 * @property integer $min_posts
 * @property integer $stars
 *
 * @property YBoardMember[] $yBoardMembers
 */
class YBoardRank extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'YBoardRank';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['title', 'min_posts'], 'required'],
            [['min_posts', 'stars'], 'integer'],
            [['title'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => YBoard::t('yboard', 'ID'),
            'title' => YBoard::t('yboard', 'Title'),
            'min_posts' => YBoard::t('yboard', 'Min Posts'),
            'stars' => YBoard::t('yboard', 'Stars'),
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getYBoardMembers()
    {
        return $this->hasMany(YBoardMember::className(), ['rank_id' => 'id']);
    }
}


code:
<?php

namespace app\modules\yboard\models;

use Yii;
use app\modules\yboard\YBoard;

/**
 * This is the model class for table "yboard_session".
 *
 * @property string $id
 * @property string $last_visit
 */
class YBoardSession extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'YBoardSession';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'last_visit'], 'required'],
            [['user_id'], 'safe'],
            [['id'], 'string', 'max' => 128]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => YBoard::t('yboard', 'ID'),
            'last_visit' => YBoard::t('yboard', 'Last Visit'),
        ];
    }

    /**
     * @inheritdoc
     * @return YBoardMemberQuery
     */
    public static function find()
    {
        return new YBoardSessionQuery(get_called_class());
    }
}


code:
<?php
//Scopes for YBoardMember et al
namespace app\modules\yboard\models;

class YBoardSessionQuery extends \yii\db\ActiveQuery
{
    public function approvedScope()
    {
        return $this->andWhere(['approved' => 1]);
    }

    public function presentScope()
    {
		$recent = date('Y-m-d H:i:s', time() - 900);
        return $this->andWhere("last_visit > '$recent'")
        ->orderBy('last_visit DESC');
    }
}


code:
<?php

namespace app\modules\yboard\models;

use Yii;
use app\modules\yboard\YBoard;

/**
 * This is the model class for table "yboard_setting".
 *
 * @property string $id
 * @property string $key
 * @property string $value
 */
class YBoardSetting extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'YBoardSetting';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['key','value'], 'required'],
            [['key'], 'string', 'max' => 50],
            [['value'], 'string', 'max' => 100],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => YBoard::t('yboard', 'ID'),
            'key' => YBoard::t('yboard', 'Key'),
            'value' => YBoard::t('yboard', 'Value'),
        ];
    }
}


code:
<?php

namespace app\modules\yboard\models;

use Yii;
use app\modules\yboard\YBoard;

/**
 * This is the model class for table "yboard_spider".
 *
 * @property string $id
 * @property string $name
 * @property string $user_agent
 * @property string $hits
 * @property string $last_visit
 */
class YBoardSpider extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'YBoardSpider';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['name', 'user_agent', 'last_visit'], 'required'],
            [['hits'], 'integer'],
            [['last_visit'], 'safe'],
            [['name'], 'string', 'max' => 45],
            [['user_agent'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => YBoard::t('yboard', 'ID'),
            'name' => YBoard::t('yboard', 'Name'),
            'user_agent' => YBoard::t('yboard', 'User Agent'),
            'hits' => YBoard::t('yboard', 'Hits'),
            'last_visit' => YBoard::t('yboard', 'Last Visit'),
        ];
    }

	public function getUrl() {
		preg_match_all('#\bhttps?://[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/))#', $this->user_agent, $match);
		if(isset($match[0][0])) {
			return $match[0][0];
		} else {
			return '';
		}
	}

    /**
     * @inheritdoc
     * @return YBoardSpiderQuery
    */
    public static function find()
    {
        return new YBoardSpiderQuery(get_called_class());
    }
}


code:
<?php
//Scopes for YBoardMember et al
namespace app\modules\yboard\models;

class YBoardSpiderQuery extends \yii\db\ActiveQuery
{
    public function presentScope()
    {
		$recent = date('Y-m-d H:i:s', time() - 900);
        return $this->andWhere("last_visit > '$recent'")
        ->orderBy('last_visit DESC');
    }
}


code:
<?php

namespace app\modules\yboard\models;

use Yii;
use app\modules\yboard\YBoard;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use app\modules\yboard\models\YBoardSpider;

/**
 * YBoardSpiderSearch represents the model behind the search form about `app\modules\yboard\models\YBoardSpider`.
 */
class YBoardSpiderSearch extends YBoardSpider
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'hits'], 'integer'],
            [['name', 'user_agent', 'last_visit'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = YBoardSpider::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        if (!($this->load($params) && $this->validate())) {
            return $dataProvider;
        }

        $query->andFilterWhere([
            'id' => $this->id,
            'hits' => $this->hits,
            'last_visit' => $this->last_visit,
        ]);

        $query->andFilterWhere(['like', 'name', $this->name])
            ->andFilterWhere(['like', 'user_agent', $this->user_agent]);

        return $dataProvider;
    }
}


code:
<?php

namespace app\modules\yboard\models;

use Yii;
use app\modules\yboard\YBoard;

/**
 * This is the model class for table "yboard_topic".
 *
 * @property string $id
 * @property string $forum_id
 * @property string $user_id
 * @property string $title
 * @property string $first_post_id
 * @property string $last_post_id
 * @property string $num_replies
 * @property string $num_views
 * @property integer $approved
 * @property integer $locked
 * @property integer $sticky
 * @property integer $global
 * @property string $moved
 * @property integer $upvoted
 *
 * @property YBoardLogTopic $yboardLogTopic
 * @property YBoardMember[] $members
 * @property YBoardForum $forum
 */
class YBoardTopic extends \yii\db\ActiveRecord
{
	public $merge;

    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'YBoardTopic';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['forum_id', 'title', 'first_post_id', 'last_post_id'], 'required'],
            [['forum_id', 'user_id', 'first_post_id', 'last_post_id', 'num_replies', 'num_views', 'approved', 'locked', 'sticky', 'global', 'moved', 'upvoted'], 'integer'],
            [['title'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => YBoard::t('yboard', 'ID'),
            'forum_id' => YBoard::t('yboard', 'Forum ID'),
            'user_id' => YBoard::t('yboard', 'User ID'),
            'title' => YBoard::t('yboard', 'Title'),
            'first_post_id' => YBoard::t('yboard', 'First Post ID'),
            'last_post_id' => YBoard::t('yboard', 'Last Post ID'),
            'num_replies' => YBoard::t('yboard', 'Replies'),
            'num_views' => YBoard::t('yboard', 'Views'),
            'approved' => YBoard::t('yboard', 'Approved'),
            'locked' => YBoard::t('yboard', 'Locked'),
            'sticky' => YBoard::t('yboard', 'Sticky'),
            'global' => YBoard::t('yboard', 'Global'),
            'moved' => YBoard::t('yboard', 'Moved'),
            'upvoted' => YBoard::t('yboard', 'Upvoted'),
			'merge' => YBoard::t('yboard', 'Merge with topic'),
        ];
    }

    /**
	 * Returns the css class when a member has posted in a topic
	 */
	public function hasPostedClass() {
		if(!\Yii::$app->user->isGuest && YBoardPost::find()->where("topic_id = $this->id and user_id = ".\Yii::$app->user->id)->exists()) {
			return 'posted';
		}
		return '';
	}

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getLogTopic()
    {
        return $this->hasOne(YBoardLogTopic::className(), ['topic_id' => 'id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getMembers()
    {
        return $this->hasMany(YBoardMember::className(), ['id' => 'member_id'])->viaTable('yboard_log_topic', ['topic_id' => 'id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getForum()
    {
        return $this->hasOne(YBoardForum::className(), ['id' => 'forum_id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getStarter()
    {
        return $this->hasOne(YBoardMember::className(), ['id' => 'user_id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getFirstPost()
    {
        return $this->hasOne(YBoardPost::className(), ['id' => 'first_post_id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getLastPost()
    {
        return $this->hasOne(YBoardPost::className(), ['id' => 'last_post_id']);
    }

    public function beforeSave($insert)
    {
        $this->user_id = \Yii::$app->user->identity->id;
        return parent::beforeSave($insert);
    }

    public function beforeDelete()
    {
        if (parent::beforeDelete()) {
            //delete all upvotes and polls
            YBoardPost::deleteAll(['topic_id'=>$this->id]);
            YBoardLogTopic::deleteAll(['topic_id'=>$this->id]);

            return true;
        } else {
            return false;
        }
    }

}


code:
<?php

namespace app\modules\yboard\models;

use Yii;
use app\modules\yboard\YBoard;

/**
 * This is the model class for table "yboard_upvoted".
 *
 * @property string $member_id
 * @property string $post_id
 *
 * @property YBoardMember $member
 * @property YBoardPost $post
 */
class YBoardUpvoted extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'YBoardUpvoted';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['member_id', 'post_id'], 'required'],
            [['member_id', 'post_id'], 'integer']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'member_id' => YBoard::t('yboard', 'Member ID'),
            'post_id' => YBoard::t('yboard', 'Post ID'),
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getMember()
    {
        return $this->hasOne(YBoardMember::className(), ['id' => 'member_id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getPost()
    {
        return $this->hasOne(YBoardPost::className(), ['id' => 'post_id']);
    }
}


code:
<?php

namespace app\modules\yboard\models;

use Yii;
use app\modules\yboard\YBoard;

/**
 * This is the model class for table "yboard_vote".
 *
 * @property integer $poll_id
 * @property integer $choice_id
 * @property integer $user_id
 *
 * @property YBoardChoice $choice
 * @property YBoardPoll $poll
 * @property YBoardMember $user
 */
class YBoardVote extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'YBoardVote';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['poll_id', 'choice_id', 'user_id'], 'required'],
            [['poll_id', 'choice_id', 'user_id'], 'integer']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'poll_id' => YBoard::t('yboard', 'Poll ID'),
            'choice_id' => YBoard::t('yboard', 'Choice ID'),
            'user_id' => YBoard::t('yboard', 'User ID'),
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getChoice()
    {
        return $this->hasOne(YBoardChoice::className(), ['id' => 'choice_id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getPoll()
    {
        return $this->hasOne(YBoardPoll::className(), ['id' => 'poll_id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getUser()
    {
        return $this->hasOne(YBoardMember::className(), ['id' => 'user_id']);
    }
}


code:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use app\components\ckeditor\CKEditor;

/**
 * @var yii\web\View $this
 * @var app\modules\yboard\models\YBoardMessage $model
 * @var yii\widgets\ActiveForm $form
 */
?>

<div class="yboard-message-form">

    <?php $form = ActiveForm::begin([
        'id'=>'pm-form',
    ]); ?>

    <?= $form->field($model, 'subject')->textInput(['maxlength' => 255]) ?>

    <?= CKEditor::widget([
        'model' => $model,
        'attribute'=>'content',
        'id'=>'pmEditor',
    ]) ?>

    <?= Html::hiddenInput('url', \Yii::$app->urlManager->createAbsoluteUrl($this->context->module->id.'/message/create'), ['id'=>'pm-url']) ?>

    <?= Html::activeHiddenInput($model, 'sendfrom') ?>

    <?= Html::activeHiddenInput($model, 'sendto', ['id'=>'YBoardMessage_send_to']) ?>

    <?php ActiveForm::end(); ?>

</div>


code:
<?php

use yii\helpers\Html;
use app\modules\yboard\YBoard;

/* @var $this yii\web\View */

//for datepicker
$this->registerJs('
    $( "#ban-expires" ).datepicker({dateFormat:"yy-mm-dd"});
');
?>

    <?= Html::beginForm() ?>

            <?= YBoard::t('yboard', 'Ban Reason') ?>

        <?= Html::textArea('message', null, ['id'=>'ban-message', 'maxlength' => 255, 'class'=>'form-control']) ?>

            <?= YBoard::t('yboard', 'Ban Expiry Date ({format})', ['format'=>'YYYY-MM-DD']) ?>

        <?= Html::textInput('expires', null, ['id'=>'ban-expires', 'maxlength' => 255,  'class'=>'form-control']) ?>

    <?= Html::endForm(); ?>


code:
<?php
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\helpers\BaseUrl;
use app\modules\yboard\models\YBoardForum;
use  app\modules\yboard\YBoard;
?>

            <?php if(!\Yii::$app->user->isGuest) echo Html::a(YBoard::t('yboard','Mark all read'), ['forum/mark-all-read'], ['class'=>'btn btn-warning btn-xs',]); ?>

            <?= Html::dropDownList('yboard-jumpto', '',
                ArrayHelper::map(YBoardForum::getForumOptions(Yii::$app->user->isGuest, Yii::$app->user->id), 'id', 'name', 'group'),
                [
                    'empty'=>YBoard::t('yboard','Select forum'),
                    'onchange'=>"
                        group = $(this.options[this.selectedIndex]).closest('optgroup').prop('label');
                        window.location.href='" . BaseUrl::toRoute(['forum']) . "?id='+$(this).val()",
                    'class'=>'form-control',
                    'id'=>'forum-categories-list',
            ]) ?>

            <?php
            if(isset($_GET['id']))
                $this->registerJs("$('#forum-categories-list option[value=".$_GET['id']."]').prop('selected', true);");
            ?>


code:
<?php
use app\modules\yboard\models\YBoardMember;
use app\modules\yboard\models\YBoardSession;
use app\modules\yboard\models\YBoardTopic;
use app\modules\yboard\models\YBoardPost;
use app\modules\yboard\models\YBoardSpider;
use yii\helpers\Html;
use  app\modules\yboard\YBoard;

/* @var $this ForumController */
$guests =  YBoardSession::find()->where('user_id IS NULL')->count();
$members =  YBoardSession::find()->where('user_id IS NOT NULL')->count();

?>

				<?php echo YBoard::t('yboard','{{guests}} guest(s) and {{members}} active member(s)', ['{guests}'=>($guests), '{members}'=>$members]);?>
				<?php echo YBoard::t('yboard','(in the past 15 minutes)');?>

				<?php $members = YBoardMember::find()->presentScope()->all();
					foreach($members as $member) {
                        echo Html::a($member->profile->username, ['member/view', 'id'=>$member->id], ['style'=>'color:#'.($member->group==null?'':$member->group->color)]) . ' ';
					}
					$spiders = YBoardSpider::find()->presentScope()->all();
					foreach($spiders as $spider) {
						echo Html::a($spider->name, $spider->url, array('class'=>'spider','target'=>'_new')) . ' ';
					}
				?>
				<?php echo YBoard::t('yboard','({hidden} anonymous member(s))', array('hidden'=>YBoardMember::find()->hiddenScope()->presentScope()->count())); ?>

				<?php echo YBoard::t('yboard','Board Statistics'); ?>

<?php echo YBoard::t('yboard','Total topics'); ?>

<?php echo  YBoardTopic::find()->count(); ?>

<?php echo YBoard::t('yboard','Total posts'); ?>

<?php echo YBoardPost::find()->count(); ?>

<?php echo YBoard::t('yboard','Total members'); ?>

<?php echo  YBoardMember::find()->count(); ?>

<?php echo YBoard::t('yboard','Newest member'); ?>

 <?php $member = YBoardMember::find()->newestScope()->one();
                echo $member===null?' '.YBoard::t('yboard','No new member yet'):Html::a($member->profile->username, ['member/view', 'id'=>$member->id]); ?>

<?= $this->render('_changeForum') ?>


code:
<?php
/* @var $this ForumController */
/* @var $post YBoardPost */
/* @var $form ActiveForm */

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use app\components\ckeditor\CKEditor;
use app\modules\yboard\YBoard;
?>

<?= YBoard::t('yboard','Your web browser does not support JavaScript, or you have temporarily disabled scripting. This site needs JavaScript to function correct.') ?>

    <?php $form = ActiveForm::begin([
		'id'=>'create-topic-form',
		'enableAjaxValidation'=>false,
    ]) ?>

		<?= $form->errorSummary($post) ?>

        <?= isset($hide_title)?Html::activeHiddenInput($post,'subject') :$form->field($post,'subject')->textInput() ?>

		<?= CKEditor::widget([
            'model' => $post,
            'attribute'=>'content',
        ]) ?>

        <?= $post->isNewRecord?"":$form->field($post,'change_reason')->textInput() ?>

        <?= Html::activeHiddenInput($post, 'forum_id') ?>
        <?= Html::activeHiddenInput($post, 'topic_id') ?>

<?= Html::submitButton($post->isNewRecord?YBoard::t('yboard','Post'):YBoard::t('yboard','Save'), ['class'=>'btn btn-primary btn-md']) ?>

    <?php ActiveForm::end(); ?>


code:
<?php
use  app\modules\yboard\YBoard;
use yii\helpers\Html;
use app\modules\yboard\components\DateTimeCalculation;

/* @var $this ForumController */
/* @var $model YBoardForum */

?>

        <div class="forum-category" onclick="YBoard.toggleForumGroup(<?php echo $model->id; ?>,'<?php echo \Yii::$app->urlManager->createAbsoluteUrl($this->context->module->id.'/forum/setCollapsed'); ?>');">

<?= Html::encode($model->name) ?>

<?= YBoard::t('yboard', 'Posts') ?>

<?= YBoard::t('yboard', 'Topics') ?>

<?= YBoard::t('yboard', 'Last Post') ?>

                <?= Html::encode($model->subtitle) ?>

    <div class="forum-group" id="category_<?php echo $model->id; ?>"  <?php if($this->context->collapsed($model->id)) { echo 'style="display:none;"';}?>>

        <?php /*set current user querying, -1 means admin */ $model->uid = Yii::$app->user->can('admin') ? -1: Yii::$app->user->id; ?>
        <?php foreach($model->forums as $forum): ?>

            <?php
            $foroimage = 'forum';
                if(!isset($forum->last_post_id) || $this->context->forumIsRead($forum->id)) {
                    $foroimage .= '1';
                } else {
                    $foroimage .= '2';
                }

                if($forum->locked) {
                    $foroimage .= 'l';
                }

                if($forum->moderated) {
                    $foroimage .= 'm';
                }

            ?>
                <div class="forum-cell col-md-1 hidden-xs <?= $foroimage ?>">

                        <?php echo Html::a(Html::encode($forum->name).($forum->public==1?'':' [Private]'), ['forum', 'id'=>$forum->id]); ?>

                        <?php echo Html::encode($forum->subtitle); ?>
                        <?php if($index == $lastIndex){ echo '

'; } ?>

                    <?php echo Html::encode($forum->num_posts); ?>

                    <?php echo Html::encode($forum->num_topics); ?>

                        <?php if($forum->last_post_id && $forum->lastPost) {
                            echo Html::a(Html::encode($forum->lastPost->topic->title), ['topic', 'id'=>$forum->lastPost->topic_id]);

                            echo '
'.YBoard::t('yboard', 'Last post by') . ' ' .Html::encode($forum->lastPost->poster->profile->username);

                            echo Html::a(Html::img($this->context->module->getRegisteredImage('next.png'), ['style'=>'margin-left:5px;', 'title'=>YBoard::t('yboard', 'view last post')]), ['topic', 'id'=>$forum->lastPost->topic_id, 'nav'=>'last']);

                            echo '
';

                            echo ' ' . YBoard::t('yboard', 'on') . ' ' . DateTimeCalculation::medium($forum->lastPost->create_time);
                        } else {
                            echo YBoard::t('yboard', 'No posts');
                        }
                        ?>

                        <?= YBoard::t('yboard', '{topics, plural, =0{No Topic} =1{One Topic} other{# Topics}}. Last Post {time}', ['topics'=>$forum->num_topics==null? 0 : $forum->num_topics, 'time'=>DateTimeCalculation::short($forum->lastPost==null ? 0 : $forum->lastPost->create_time)]) ?>

        <?php endforeach; ?>


code:
<?php
/* @var $this ForumController */
use  app\modules\yboard\models\YBoardTopic;
use  app\modules\yboard\models\YBoardPost;
use  app\modules\yboard\models\YBoardMember;
use  app\modules\yboard\models\YBoardSession;
use \yii\helpers\Html;
use app\modules\yboard\YBoard;
?>

                    <?php echo YBoard::t('yboard','Forum Legend'); ?>

                    <?php echo YBoard::t('yboard','Unread topic'); ?>

                    <?php echo YBoard::t('yboard','Sticky topic'); ?>

                    <?php echo YBoard::t('yboard','Poll'); ?>

                    <?php echo YBoard::t('yboard','Read topic'); ?>

                    <?php echo YBoard::t('yboard','Locked topic'); ?>

                    <?php echo YBoard::t('yboard','Global topic'); ?>

                    <?php echo YBoard::t('yboard','Board Statistics'); ?>

<?php echo YBoard::t('yboard','Total topics'); ?>

<?php echo YBoardTopic::find()->count(); ?>

<?php echo YBoard::t('yboard','Total posts'); ?>

<?php echo YBoardPost::find()->count(); ?>

<?php echo YBoard::t('yboard','Total members'); ?>

<?php echo YBoardMember::find()->count(); ?>

<?php echo YBoard::t('yboard','Newest member'); ?>

<?php $member = YBoardMember::find()->newestScope()->one(); echo $member==null?YBoard::t('yboard','None'):Html::a($member->profile->username, ['member/view', 'id'=>$member->id]); ?>

<?php echo YBoard::t('yboard','Visitors today'); ?>

<?php echo YBoardSession::find()->count(); ?>

<?= $this->render('_changeForum') ?>


code:
<?php
/* @var $this ForumController */
/* @var $model YBoardChoice */

use yii\helpers\Html;
?>

        <?php if($this->context->poll->allow_multiple): ?>
            <?php echo Html::checkBox('choice['.$model->id.']', false, array('value'=>$model->id)); ?>
        <?php else: ?>
            <?php echo Html::radio('choice[]', false, array('value'=>$model->id)); ?>
        <?php endif;?>
        <?php echo $model->choice; ?>


code:
<?php
/* @var $this ForumController */
/* @var $model YBoardChoice */
$percentage = ($this->context->poll->votes)?(($model->votes/$this->context->poll->votes)*100):0;
$percentage = round($percentage);

use yii\jui\ProgressBar;
?>

<div class="poll">
    <?php echo $model->choice . ' (' . $model->votes . ' ' . YBoard::t('yboard','votes') . ' ' . $percentage . '%)'; ?>
    <?= ProgressBar::widget([
        'class'=>'poll-progress',
        'clientOptions' => [
            'value' => $percentage,
        ],
    ]) ?>
</div>


code:
<?php
/* @var $this ForumController */
/* @var $model YBoardPost */
/* @var $postId integer */

use app\modules\yboard\YBoard;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;
use yii\web\JsExpression;
use yii\jui\Dialog;
use yii\widgets\ListView;
use app\modules\yboard\components\DateTimeCalculation;
use kartik\widgets\StarRating;
use yii\bootstrap\ButtonDropdown;
?>
<div id="<?= $model->id ?>">
    <?php if($this->context->poll !== null && $this->context->poll->post_id == $model->id): ?>

			<?php echo YBoard::t('yboard', 'Poll') . ': ' .$this->context->poll->question; ?>

                <?php if($this->context->voted): ?>

                    <?= ListView::widget([
                        'id'=>'yboardPoll',
                        'itemView'=>'_pollResult',
                        'dataProvider'=>$dataProvider,
                        'summary'=>false,
                    ]);

                    echo '
';
                    if($this->context->poll->user_id == Yii::$app->user->id || Yii::$app->user->can('moderator')) {
                        echo Html::button(YBoard::t('yboard', 'Edit poll'), array('class'=>'btn btn-default btn-sm','onclick'=>'editPoll(' . $this->context->poll->id . ', "' . Yii::$app->urlManager->createAbsoluteUrl($this->context->module->id.'/forum/edit-poll') . '");'))." ";
                    }
                    if(!Yii::$app->user->isGuest && $this->context->poll->allow_revote && (!isset($this->context->poll->expire_date) || $this->context->poll->expire_date > date('Y-m-d'))) {
                        echo " ".Html::button(YBoard::t('yboard', 'Change vote'), array('class'=>'btn btn-default btn-sm','onclick'=>'changeVote(' . $this->context->poll->id . ', "' . Yii::$app->urlManager->createAbsoluteUrl($this->context->module->id.'/forum/display-vote') . '");'));
                    }
                    echo '
';
                    ?>
                <?php else: ?>
                    <?php echo Html::beginForm('', 'post', array('id'=>'yboard-poll-form'));
                    echo Html::hiddenInput('poll_id', $this->context->poll->id);

                    echo ListView::widget([
                        'id'=>'yboardPoll',
                        'itemView'=>'_pollChoice',
                        'dataProvider'=>$this->context->choiceProvider,
                        'summary'=>false,
                    ]);

                    echo '
';
                    echo Html::button(YBoard::t('yboard', 'Vote'), [
                        'onclick'=>'vote("' . Yii::$app->urlManager->createAbsoluteUrl($this->context->module->id.'/forum/vote') . '");',
                        'class'=>'btn btn-default btn-sm',
                    ]);
                    echo '
';
                    echo Html::endForm(); ?>
                <?php endif; ?>

    <?php endif; ?>

    <?php if($index==0): ?>

<?= $topic->approved == 0 ? $topic->title.' '.YBoard::t('yboard', '[Pending]') :  $topic->title ?>

    <?php endif; ?>

                <?php echo Html::img((isset($model->poster->profile->image))?$model->poster->profile->image:$this->context->module->getRegisteredImage('empty.jpeg'), ['alt'=>'avatar']); ?>
                <?php if(!Yii::$app->user->isGuest && Yii::$app->user->identity->id!=$model->poster->id): ?>

                        <?= Html::button(YBoard::t('yboard', 'Send PM').' '.Html::img($this->context->module->getRegisteredImage('pm.png'),  ['alt'=>'', 'style'=>'border:none;']), ['title'=>YBoard::t('yboard', 'Send private message'), 'style'=>'cursor:pointer; margin:5px;', 'class'=>'btn btn-info btn-sm', 'onclick'=>'sendPm('.$model->poster->id.');']) ?>

                <?php endif; ?>

                    <?php echo Html::a(Html::encode($model->poster->profile->username), ['member/view', 'id'=>$model->poster->id], ['class'=>'header2']); ?>

                    <?= strcasecmp($model->poster->status, 'hidden')==0 ? '' :
                        (Html::img($this->context->module->getRegisteredImage($model->poster->status==YBoard::t('yboard','Online')?'buddy_online.gif':'buddy_offline.gif'), ['alt'=>'Online', 'title'=>'Use is online']).' '.$model->poster->status)
                    ?>

                    <?= Html::img($this->context->module->getRegisteredImage('groups/'.$model->poster->group->image.'?t='.time()), ['alt'=>'', 'title'=>$model->poster->group->description, 'class'=>'pull-right']) ?>

                <?php if($model->poster->rank!==null): ?>

                        <?= $model->poster->isBanned() ? YBoard::t('yboard', 'Banned') :
                         Html::img($this->context->module->getRegisteredImage('ranks/'.$model->poster->rank->stars.'.png?t='.time()), ['alt'=>'', 'title'=>$model->poster->rank->title, 'class'=>'']) ?>

                <?php endif; ?>

                    <?php if($model->poster->twitter!=''): ?>
                        <?= Html::a(Html::img($this->context->module->getSocialImage('twitter.png'), ['class'=>'round-grey', 'title'=>YBoard::t('yboard', 'Twitter'), 'style'=>'border:0; height:24px;']), strncmp($model->poster->twitter, 'http', 4)==0 ? $model->poster->twitter : "http://twitter.com/{$model->poster->twitter}") ?>
                    <?php endif; ?>

                    <?php if($model->poster->skype!=''): ?>
                        <?= Html::a(Html::img($this->context->module->getSocialImage('skype.png'), ['class'=>'round-grey', 'title'=>YBoard::t('yboard', 'Login to Skype and click me!'), 'style'=>'border:0; height:24px;']), "skype:{$model->poster->skype}?userinfo") ?>
                    <?php endif; ?>

                    <?php if($model->poster->github!=''): ?>
                        <?= Html::a(Html::img($this->context->module->getSocialImage('github.png'), ['class'=>'round-grey', 'title'=>YBoard::t('yboard', 'Twitter'), 'style'=>'border:0; height:24px;']), strncmp($model->poster->github, 'http', 4)==0 ? $model->poster->github : "http://github.com/{$model->poster->github}") ?>
                    <?php endif; ?>

                    <?php if($model->poster->linkedin!=''): ?>
                        <?= Html::a(Html::img($this->context->module->getSocialImage('linkedin.png'), ['class'=>'round-grey', 'title'=>YBoard::t('yboard', 'LinkedIn'), 'style'=>'border:0; height:24px;']), $model->poster->linkedin) ?>
                    <?php endif; ?>

                    <?= YBoard::t('yboard', 'Topics') . ': ' . Html::encode($model->poster->startedTopics) ?>

                    <?= YBoard::t('yboard', 'Replied') . ': ' . Html::encode($model->poster->totalReplies) ?>

                    <?= YBoard::t('yboard', 'Joined') . ': ' . DateTimeCalculation::shortDate($model->poster->first_visit) ?>

                    <?= YBoard::t('yboard', 'Appreciation{plural} : {appr} ', ['appr'=>$model->poster->appreciations>0 ? $model->poster->appreciations : YBoard::t('yboard', 'No'), 'plural'=>$model->poster->appreciations>1?'s':''])  ?>
                    <?php if($model->poster->location!=''): ?>

                            <?= YBoard::t('yboard', 'Location: {loc}', ['loc'=>Html::encode($model->poster->location)]) ?>

                    <?php endif; ?>

        <?= YBoard::t('yboard', 'Posted on {time}', ['time'=>DateTimeCalculation::medium($model->create_time)]) ?>
        <?= Html::a(YBoard::t('yboard', '{pl} (permalink)', ['pl'=>'#'.($index+1)]), Url::to(['forum/topic', 'id' => $model->topic_id, '#' => $model->id]), ['class'=>'pull-right']) ?>

                <?php echo Html::img((isset($model->poster->profile->image))?$model->poster->profile->image:$this->context->module->getRegisteredImage('empty.jpeg'), ['alt'=>'avatar']); ?>

                <?php echo Html::a(Html::encode($model->poster->profile->username), ['member/view', 'id'=>$model->poster->id], ['class'=>'header2']); ?>

                <?= DateTimeCalculation::short($model->create_time) ?>

        <?php echo $model->content; ?>

        <?php echo $model->poster->signature; ?>
        <?php echo $this->render('_upvotedBy', ['post_id'=>$model->id]); ?>

                <?php if(!Yii::$app->user->isGuest && Yii::$app->user->identity->id!=$model->poster->id): ?>
                    <?php echo $this->context->showUpvote($model->id); ?>
                    <?php echo Html::button(YBoard::t('yboard', 'report').' ', ['class'=>'btn btn-sm btn-default','title'=>YBoard::t('yboard', 'Report post'), 'style'=>'cursor:pointer;', 'onclick'=>'reportPost(' . $model->id . ')']); ?>
                <?php endif; ?>

                <?php if(!Yii::$app->user->isGuest && !$model->topic->locked || Yii::$app->user->can('moderator')): ?>

                    <?php $form = ActiveForm::begin([
                        'action'=>['forum/quote', 'id'=>$model->id],
                        'enableAjaxValidation'=>false,
                    ]) ?>
                        <?php echo Html::submitButton(YBoard::t('yboard','Quote').' ', ['class'=>'btn btn-default btn-sm']); ?>
                    <?php ActiveForm::end(); ?>

                    <?php $form = ActiveForm::begin([
                        'action'=>['forum/reply', 'id'=>$model->topic_id],
                        'enableAjaxValidation'=>false,
                    ]) ?>
                        <?php echo Html::submitButton(YBoard::t('yboard','Reply').' ', ['class'=>'btn btn-default btn-sm']); ?>
                    <?php ActiveForm::end(); ?>

                    <?php if($model->user_id == Yii::$app->user->id || Yii::$app->user->can('moderator')): ?>
                        <?php $form = ActiveForm::begin([
                            'action'=>['forum/update', 'id'=>$model->id],
                            'enableAjaxValidation'=>false,
                        ]) ?>
                            <?php echo Html::submitButton(YBoard::t('yboard','Edit').' ', ['class'=>'btn btn-default btn-sm']); ?>
                        <?php ActiveForm::end(); ?>
                    <?php endif; ?>

                <?php endif; ?>
                <?php if(Yii::$app->user->can('moderator')): ?>

                    <?= ButtonDropdown::widget([
                        'label' => YBoard::t('yboard','Mod'),
                        'options'=>[
                            'class'=>'btn btn-default btn-sm pull-left',
                        ],
                        'dropdown' => [
                            'encodeLabels' =>false,
                            'items' =>array_merge(!Yii::$app->user->can('admin')||$model->original_post==1 ? [] :
                            [
                                [
                                    'label' => YBoard::t('yboard','Delete post').' ',
                                    'url' => '/',
                                    'options'=>[
                                        //'class'=>'btn btn-danger btn-sm',
                                    ],
                                    'linkOptions'=>[
                                        'onclick'=>'if(confirm("' . YBoard::t('yboard','Want to delete this post?') . '")) { deletePost("' . Yii::$app->urlManager->createAbsoluteUrl([$this->context->module->id.'/moderator/delete', 'id'=>$model->id]) . '"); return false; }',
                                    ],
                                ]
                            ],
                            [
                                [
                                    'label' => YBoard::t('yboard','Disapprove post').' ',
                                    'url' => '#',
                                    'options'=>[
                                        //'class'=>'btn btn-danger btn-sm',
                                    ],
                                    'linkOptions'=>[
                                        'onclick'=>'if(confirm("' . YBoard::t('yboard','Want to Remove post from visible Posts?') . '")) { deletePost("' . Yii::$app->urlManager->createAbsoluteUrl([$this->context->module->id.'/moderator/disapprove', 'id'=>$model->id]) . '"); return false; }',
                                    ],
                                ],
                                [
                                    'label' => YBoard::t('yboard','Ban user').' ',
                                    'url' => '',
                                    'options'=>[
                                        //'class'=>'btn btn-danger btn-sm',
                                    ],
                                    'linkOptions'=>[
                                    'title'=>YBoard::t('yboard', 'Ban this user'),
                                        'onclick'=>'if(confirm("' . YBoard::t('yboard','Do you really want to Ban this User?') . '")) { banUser('.Yii::$app->user->id.', "' . Yii::$app->urlManager->createAbsoluteUrl([$this->context->module->id.'/moderator/ban-user', 'id'=>$model->user_id]) . '");  }return false;',
                                    ],
                                ],
                                [
                                    'label' => YBoard::t('yboard','Ban user IP').' ',
                                    'visible' =>Yii::$app->user->can('admin'),
                                    'url' => '/',
                                    'options'=>[
                                        //'class'=>'btn btn-danger btn-sm',
                                    ],
                                    'linkOptions'=>[
                                    'title'=>YBoard::t('yboard', 'Ban IP user\'saddress'),
                                        'onclick'=>'if(confirm("' . YBoard::t('yboard','Do you really want to ban this IP address?') . '")) { banIp(' . $model->id . ', "' . Yii::$app->urlManager->createAbsoluteUrl('moderator/ban-ip') . '"); }return false; ',
                                    ],
                                ],
                             ]),
                        ],
                    ]) ?>
                <?php endif; ?>

            <?php if($model->change_reason): ?>
                <?php echo YBoard::t('yboard','last modified on {date}, Reason: {reason}',
                    [
                        'date'=> DateTimeCalculation::medium($model->change_time),
                        'reason'=>Html::encode($model->change_reason)
                    ]
            ); ?>
            <?php endif; ?>


code:
<?php
/* @var $this ForumController */
/* @var $model YBoardMessage */
/* @var $form ActiveForm */

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use app\components\ckeditor\CKEditor;
?>

<div class="form">
 <?php $form = ActiveForm::begin([
        'id'=>'report-form',
        'enableAjaxValidation'=>true,
]) ?>

		<?= CKEditor::widget([
            'model' => $model,
            'attribute'=>'content',
        ]) ?>

        <?= Html::activeHiddenInput($model, 'post_id', ['id'=>'YBoardMessage_post_id']) ?>
		<?= Html::hiddenInput('url', \Yii::$app->urlManager->createAbsoluteUrl($this->context->module->id.'/message/send-report'), ['id'=>'url']) ?>

<?php ActiveForm::end(); ?>

</div><!-- form -->


code:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/**
 * @var yii\web\View $this
 * @var app\modules\yboard\models\YBoardForumSearch $model
 * @var yii\widgets\ActiveForm $form
 */
?>

    <?php $form = ActiveForm::begin([
        'action' => ['index'],
        'method' => 'get',
    ]); ?>

    <?= $form->field($model, 'id') ?>

    <?= $form->field($model, 'cat_id') ?>

    <?= $form->field($model, 'name') ?>

    <?= $form->field($model, 'subtitle') ?>

    <?= $form->field($model, 'type') ?>

    <?php // echo $form->field($model, 'public') ?>

    <?php // echo $form->field($model, 'locked') ?>

    <?php // echo $form->field($model, 'moderated') ?>

    <?php // echo $form->field($model, 'sort') ?>

    <?php // echo $form->field($model, 'num_posts') ?>

    <?php // echo $form->field($model, 'num_topics') ?>

    <?php // echo $form->field($model, 'last_post_id') ?>

    <?php // echo $form->field($model, 'poll') ?>

    <?php // echo $form->field($model, 'membergroup_id') ?>

        <?= Html::submitButton(YBoard::t('yboard', 'Search'), ['class' => 'btn btn-primary']) ?>
        <?= Html::resetButton(YBoard::t('yboard', 'Reset'), ['class' => 'btn btn-default']) ?>

    <?php ActiveForm::end(); ?>


code:
<?php
/* @var $this ForumController */
/* @var $model YBoardTopic */
use \yii\helpers\Html;
use app\modules\yboard\YBoard;
use app\modules\yboard\components\DateTimeCalculation;
?>

    <div class="col-xs-2 forum-cell <?php echo $this->context->topicIcon($model); ?>">

            <?php echo Html::a(Html::encode($model->title).' '.($model->approved==0? YBoard::t('yboard', '[Pending]') : ''), ['topic', 'id'=>$model->id], ['class'=>$model->hasPostedClass()]); ?>

            <?= YBoard::t('yboard', '{replies, plural, =0{No Reply} =1{One Reply} other{# Replies}}. Last: {user} {time}', ['replies'=>$model->num_replies, 'user'=>Html::encode($model->lastPost->poster->profile->username), 'time'=>DateTimeCalculation::short($model->lastPost->create_time)]) ?>

    <div class="col-md-1 forum-cell <?php echo $this->context->topicIcon($model); ?>">

                <?php echo Html::a(Html::encode($model->title).' '.($model->approved==0? YBoard::t('yboard', '[Pending]') : ''), ['topic', 'id'=>$model->id], ['class'=>$model->hasPostedClass()]); ?>

                <?php if(Yii::$app->user->can('moderator')): ?>
                    <?php echo Html::img($this->context->module->getRegisteredImage('empty.png'), ['alt'=>'empty']); ?>
                    <?php echo Html::img($this->context->module->getRegisteredImage('update.png'), ['update', 'title'=>YBoard::t('yboard', 'Update topic'), 'style'=>'cursor:pointer', 'onclick'=>'YBoard.updateTopic(' . $model->id . ', "' . \Yii::$app->urlManager->createAbsoluteUrl($this->context->module->id.'/moderator/topic') . '")']); ?>
                <?php endif; ?>

                <?php echo YBoard::t('yboard', 'started by ') . Html::encode($model->starter->profile->username);?>
                <?php echo ' ' . YBoard::t('yboard', 'on') . ' ' . DateTimeCalculation::medium($model->firstPost->create_time); ?>

        <?php echo Html::encode($model->num_replies); ?>

        <?php echo Html::encode($model->getAttributeLabel('num_replies')); ?>

        <?php echo Html::encode($model->num_views); ?>

        <?php echo Html::encode($model->getAttributeLabel('num_views')); ?>

        <?php
            echo Html::encode($model->lastPost->poster->profile->username);
            echo Html::a(Html::img($this->context->module->getRegisteredImage('next.png'), ['alt'=>'next', 'style'=>'margin-left:5px;']), ['topic', 'id'=>$model->id, 'nav'=>'last'], ['title'=>YBoard::t('yboard', 'Last Reply')]);
            echo '
';
            echo DateTimeCalculation::longDate($model->lastPost->create_time);
        ?>


code:
<?php
/* @var $this ForumController */
/* @var $model YBoardTopic */
/* @var $form ActiveForm */

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use app\modules\yboard\YBoard;
use app\modules\yboard\models\YBoardForum;
?>

<div class="form">

    <?php $form = ActiveForm::begin([
		'id'=>'update-topic-form',
        'action'=>['forum/quote', 'id'=>$model->id],
        'enableAjaxValidation'=>true,
        'validateOnSubmit'=>true,
        'validateOnChange'=>false,
    ]) ?>

		<?= $form->errorSummary($model)  ?>

        <?= $form->field($model,'forum_id')->dropDownList(ArrayHelper::map(YBoardForum::find()->forumScope()->all(), 'id', 'name'), [
            'onchange'=>'refreshTopics(this, "' . \Yii::$app->urlManager->createAbsoluteUrl('moderator/refreshTopics') . '")',
            'id'=>'YBoardTopic_forum_id',
        ])  ?>

        <?= $form->field($model,'merge')->dropDownList([], ['id'=>'YBoardTopic_merge'])  ?>

        <?= $form->field($model,'title')->textInput(['id'=>'YBoardTopic_title']) ?>

        <?= $form->field($model,'locked')->dropDownList(['0'=>YBoard::t('yboard','No'), '1'=>YBoard::t('yboard','Yes')], ['id'=>'YBoardTopic_locked'])  ?>

        <?= $form->field($model,'sticky')->dropDownList(['0'=>YBoard::t('yboard','No'), '1'=>YBoard::t('yboard','Yes')], ['id'=>'YBoardTopic_sticky'])  ?>

        <?= $form->field($model,'global')->dropDownList(['0'=>YBoard::t('yboard','No'), '1'=>YBoard::t('yboard','Yes')], ['id'=>'YBoardTopic_global'])  ?>

        <?= $form->field($model,'approved')->dropDownList(['0'=>YBoard::t('yboard','No'), '1'=>YBoard::t('yboard','Yes')], ['id'=>'YBoardTopic_approved'])  ?>

        <?= Html::activeHiddenInput($model, 'id', ['id'=>'yboard-post-update-id']) ?>

    <?php ActiveForm::end(); ?>
</div><!-- form -->


code:
<?php
/* @var $post_id integer */
use app\modules\yboard\YBoard;
use app\modules\yboard\models\YBoardUpvoted;
use app\modules\yboard\models\YBoardMember;
use yii\helpers\Html;

$models = YBoardUpvoted::find()->where(['post_id'=>$post_id])->all();
$count = count($models);

if($count) {
	echo '
' . PHP_EOL;
	echo YBoard::t('yboard', 'This post is appreciated by {no} member{plural}', ['no'=>$count, 'plural'=>$count>1?'s':'']).' ';
    $users = [];
	foreach($models as $model) {
		$member = YBoardMember::findOne($model->member_id);
		if($member !== null) {
			$users[] = Html::a(Html::encode($member->profile->username), ["member/view", "id"=>$member->id], ['target'=>'_blank']);
		}
	}

	$members =  ''.implode(', ', $users).'';
    echo Html::a(YBoard::t('yboard', '[view]'), '#', ['onclick'=>'showAppreciation(\''.$members.'\'); return false;']);

	echo '
' . PHP_EOL;
}


code:
<?php
/* @var $this ForumController */
/* @var $error Exception */

use yii\helpers\Html;
use app\modules\yboard\YBoard;
use app\modules\yboard\components\DateTimeCalculation;

$this->title = YBoard::t('yboard', 'You are Banned!');

$this->params['breadcrumbs'] = [
	['label'=>YBoard::t('yboard', 'Forum'), 'url'=>['forum/index']],
    YBoard::t('yboard', 'Banned Member')
];

?>

<?= YBoard::t('yboard', 'You\'ve been Banned ') ?>

<?php echo nl2br(YBoard::t('yboard', 'Dear {username}, you have been banned.
                If You think its a mistake please consider reporting to use at [{email}].
                You can send an appeal there stating your reasons why ban should be lifted up.
                Below are ban details.
                Thank you,
                Management
            ',
            [
                'username'=>$member->profile->username,
                'email'=>$email,
                'br'=>'\n'
            ]
            )); ?>

            <?= YBoard::t('yboard', 'Ban Details') ?>

<?= YBoard::t('yboard', 'Banned on: {time}', ['time'=>DateTimeCalculation::long($model->banned_on)]) ?>

<?= YBoard::t('yboard', 'Ban Type: {type}', ['type'=>$isIp ? YBoard::t('yboard', 'IP Ban') : YBoard::t('yboard', 'Member Ban')]) ?>

<?= YBoard::t('yboard', 'Reason: {reason}', ['reason'=>$model->message]) ?>

<?= YBoard::t('yboard', 'Ban to Lift on: {time}', ['time'=>DateTimeCalculation::long($model->expires)]) ?>

<?= YBoard::t('yboard', 'Ban length: {days} days {hours} hours', DateTimeCalculation::getDiff($model->banned_on, $model->expires)) ?>

<?= YBoard::t('yboard', 'Remained: {days} days {hours} hours', DateTimeCalculation::getDiff(time(), $model->expires)) ?>


code:
<?php
/* @var $this ForumController */
/* @var $forum YBoardForum */
/* @var $post YBoardPost */
/* @var $poll YBoardPoll */
/* @var $choices array */

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use app\components\ckeditor\CKEditor;
use  app\modules\yboard\YBoard;

$this->params['breadcrumbs']=[
	['label'=>YBoard::t('yboard', 'Forums'), 'url'=>['forum/index']],
	['label'=>$forum->name,  'url'=> ['forum/forum', 'id'=>$forum->id]],
	YBoard::t('yboard', 'New topic'),
];

$items = array(
	array('label'=>YBoard::t('yboard', 'Forums'), 'url'=>array('forum/index')),
	array('label'=>YBoard::t('yboard', 'Members'), 'url'=>array('member/index'))
);

$this->title = YBoard::t('yboard', '{forum} - New Topic', ['forum'=>$forum->name]);

if(empty($poll->question) && !$poll->hasErrors()) {
	$show = false;
} else {
	$show = true;
}
?>

            <?php echo YBoard::t('yboard','Your web browser does not support JavaScript, or you have temporarily disabled scripting. This site needs JavaScript to function correct.'); ?>

        <?php $form = ActiveForm::begin([
            'id' => 'create-topic-form',
            'enableAjaxValidation'=>false,
        ]); ?>

        <?= $form->errorSummary($post) ?>
        <?= Html::errorSummary($poll) ?>

		<?php if($forum->poll == 2 || ($forum->poll == 1 && Yii::$app->user->can('moderator'))): ?>
			<div class="row" style="<?php echo ($show?'display:none;':''); ?>">

                    <?php echo Html::button(YBoard::t('yboard','Add poll').' ', ['class'=>'btn btn-primary btn-sm','onclick'=>'showPoll()']); ?>

			<div class="row poll-form-showhide" style="<?php echo ($show?'':'display:none;'); ?>">

                    <?php echo Html::hiddenInput('addPoll','no', ['id'=>'addPoll']); ?>
                    <?php echo Html::button(YBoard::t('yboard','Remove poll').' ',  ['class'=>'btn btn-primary btn-sm','onclick'=>'hidePoll()']); ?>

			<div class="col-md-12 poll-form poll-form-showhide panel yboard-panel" style="<?php echo ($show?'':'display:none;'); ?>" class="yboard-poll-form">

                    <?php echo Html::label($poll->getAttributeLabel('question'), false, ['class'=>'form-label']); ?>
                    <?php echo Html::activeTextInput($poll,'question',['maxlength'=>255, 'class'=>'form-control']); ?>

                    <?php echo Html::label(YBoard::t('yboard','Choices'),false, ['class'=>'form-label']); ?>
					<?php foreach($choices as $key => $value): ?>

                            <?php echo Html::textInput('choice['.$key.']',$value,[
                                'maxlength'=>80,
                                'class'=>'form-control',
                                'id'=>$key+1,
                                'onchange'=>'pollChange(this)',
                            ]); ?>

					<?php endforeach; ?>

					<?php echo Html::activeCheckbox($poll,'allow_revote'); ?>
					<?php echo Html::activeCheckbox($poll,'allow_multiple'); ?>
					<?php echo Html::activeHiddenInput($poll,'expire_date', ['id'=>'expire_date']); ?>

                            <?php echo YBoard::t('yboard','Poll expires'); ?>:

                        <?= \yii\jui\DatePicker::widget([
                            'name' => 'expiredate',
                            'dateFormat' => 'yyyy-MM-dd',
                            'clientOptions' => [
                                'defaultDate' => $poll->expire_date,
                                'showAnim'=>'fold',
                                'onSelect' =>new \yii\web\JsExpression('function(date, picker){
                                    $("#expire_date").val(date);
                                }')
                            ],
                        ]) ?>

		<?php endif; ?>

        <?= $form->field($post, 'subject') ?>

        <?= CKEditor::widget([
            'model' => $post,
            'attribute'=>'content',
        ]) ?>

		<?php if(Yii::$app->user->can('moderator')): ?>

                    <?php echo YBoard::t('yboard','Sticky'); ?>:
                    <?php echo Html::checkbox('sticky'); ?>
                    <?php echo YBoard::t('yboard','Global'); ?>:
                    <?php echo Html::checkbox('global'); ?>
                    <?php echo YBoard::t('yboard','Locked'); ?>:
                    <?php echo Html::checkbox('locked'); ?>

		<?php endif; ?>

        <?php echo Html::activeHiddenInput($post, 'forum_id'); ?>

       <?php echo Html::submitButton(YBoard::t('yboard','Save Post'),['class'=>'btn btn-primary btn-md']); ?>
    <?php ActiveForm::end(); ?>


code:
<?php
/* @var $this ForumController */
/* @var $poll YBoardPoll */
/* @var $choices array */

use yii\helpers\Html;
use yii\widgets\ActiveForm;
?>

     <?php $form = ActiveForm::begin([
        'id'=>'edit-poll-form',
        'action'=>array('forum/update-poll','id'=>$poll->id),
        'enableAjaxValidation'=>false,
    ]) ?>

        <?php echo Html::activeLabel($poll,'question'); ?>
        <?php echo Html::activeTextInput($poll,'question',['maxlength'=>255, 'class'=>'form-control']); ?>

    <?php echo Html::errorSummary($poll); ?>

        <?php echo Html::label(YBoard::t('yboard','Choices'),false, ['class'=>'form-label']); ?>
        <?php foreach($choices as $key => $value): ?>

                <?php echo Html::textInput('choice['.$key.']',$value,[
                    'maxlength'=>80,
                    'class'=>'form-control',
                    'id'=>$key+1,
                    'onchange'=>'pollChange(this)',
                ]); ?>

        <?php endforeach; ?>

        <?php echo Html::activeCheckbox($poll,'allow_revote'); ?>
        <?php echo Html::activeCheckbox($poll,'allow_multiple'); ?>
        <?php echo Html::activeHiddenInput($poll,'expire_date', ['id'=>'expire_date']); ?>

            <?php echo YBoard::t('yboard','Poll expires'); ?>:

        <?= \yii\jui\DatePicker::widget([
            'name' => 'expiredate',
            'dateFormat' => 'yyyy-MM-dd',
            'clientOptions' => [
                'defaultDate' => $poll->expire_date,
                'showAnim'=>'fold',
                'onSelect' =>new \yii\web\JsExpression('function(date, picker){
                    $("#expire_date").val(date);
                }')
            ],
        ]) ?>

           <?php echo Html::submitButton(YBoard::t('yboard','Save'),['class'=>'btn btn-primary btn-md']); ?>

    <?php ActiveForm::end(); ?>


code:
<?php
/* @var $this ForumController */
/* @var $error Exception */

use yii\helpers\Html;
use app\modules\yboard\YBoard;

$this->title = YBoard::t('yboard', 'We found problem!');

$this->params['breadcrumbs'] = [
	['label'=>YBoard::t('yboard', 'Forum'), 'url'=>['forum/index']],
    YBoard::t('yboard', 'Error reporter')
];

?>

<?php echo YBoard::t('yboard', 'We\'ve got Error with Code ') . ' ' . $exception->statusCode; ?>

<?= YBoard::t('yboard', ' Dear customer, we are sorry that you got this message. Please try to check URL to see if you have typed Correctly') ?>

<?= YBoard::t('yboard', 'If the error persists Please send us full error below with error code and URL. Your subject should be RE: Site Error.') ?>

<?= YBoard::t('yboard', 'Thank you!') ?>

                <?= YBoard::t('yboard', 'Message') ?>

                <?php echo Html::encode($exception->getMessage()); ?>


code:
<?php
/* @var $this ForumController */
/* @var $forum YBoardForum */
/* @var $dataProvider DataProvider */

use app\modules\yboard\YBoard;
use app\modules\yboard\models\YBoardPost;
use app\modules\yboard\models\YBoardTopic;
use app\modules\yboard\models\YBoardMessage;
use yii\widgets\ListView;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\jui\Dialog;
use yii\web\JsExpression;

$this->params['breadcrumbs'] = [
	['label'=>YBoard::t('yboard', 'Forums'), 'url'=>['forum/index']],
	$forum->name,
];

$approvals = YBoardPost::find()->unapprovedScope()->count();
$reports = YBoardMessage::find()->reportScope()->count();

$this->title = $forum->name;
?>

<?php  if(\Yii::$app->session->hasFlash('moderation')): ?>

	<?php echo \Yii::$app->session->getFlash('moderation'); ?>

<?php endif; ?>

	<?php if(!\Yii::$app->user->isGuest && !$forum->locked || Yii::$app->user->can('moderator')): ?>

                <?php $form = ActiveForm::begin([
                        'id'=>'create-topic-form',
                        'action'=>['forum/create-topic'],
                        'enableAjaxValidation'=>false,
                    ]) ?>
                    <?= Html::activeHiddenInput($forum, 'id') ?>
                    <?= Html::submitButton(YBoard::t('yboard','New Topic'), ['class'=>'btn btn-info btn-sm pull-right']) ?>
                 <?php ActiveForm::end(); ?>

	<?php endif; ?>

                <?php  echo $forum->name; ?>

             <?= ListView::widget([
                'summary'=>false, //YBoard::t('yboard', 'Showing {count} of {totalCount} topics'),
                'itemView'=>'_topic',
                'id'=>'yboardTopic',
                'dataProvider'=>$dataProvider,
            ])
            ?>

        <?php echo $this->render('_forumfooter'); ?>

<?php
if(Yii::$app->user->can('moderator')) {
    Dialog::begin([
		'id'=>'dlgTopicForm',
        'clientOptions' => [
            'modal' => true,
			'title'=>YBoard::t('yboard', 'Update topic'),
            'autoOpen'=>false,
            'modal'=>true,
            'height'=>400,
            'width'=>300,
            'buttons'=> [
                [
                    'text'=>YBoard::t('yboard', 'Change'),
                    'class'=>'btn btn-sm btn-success',
                    'click'=>new JsExpression(' function() { YBoard.changeTopic("' . \Yii::$app->urlmanager->createAbsoluteUrl($this->context->module->id.'/moderator/change-topic') . '"); }')
                ],
                [
                    'text'=>YBoard::t('yboard', 'Cancel'),
                    'class'=>'btn btn-sm btn-danger',
                    'click'=>new JsExpression(' function() { $( this ).dialog( "close" ); }')
                ]
            ],
        ],
    ]);

		echo $this->render('_topicForm', array('model'=>new YBoardTopic));

    Dialog::end();
}
?>


code:
<?php

use yii\helpers\Html;
use yii\widgets\ListView;
use  app\modules\yboard\YBoard;
use app\modules\yboard\components\DateTimeCalculation;

/**
 * @var yii\web\View $this
 * @var yii\data\ActiveDataProvider $dataProvider
 * @var app\modules\yboard\models\YBoardForumSearch $searchModel
/* @var $this ForumController */

$this->title = $this->context->module->forumTitle;
$this->params['breadcrumbs'][] = $this->title;

$this->params['breadcrumbs'] = [
	YBoard::t('yboard', 'Forums'),
];

?>

            <?= ListView::widget([
                'itemOptions' => ['class' => 'item'],
                'id'=>'yboardForum',
                'dataProvider'=>$dataProvider,
                'itemView'=>'_forum',
                'viewParams'=>['lastIndex'=>($dataProvider->count - 1)],
                'summary'=>false,
            ]) ?>

<?= YBoard::t('yboard','Latest Topics') ?>

                    <?php $idx=0; ?>
                    <?php foreach($recentTopics as $topic): ?>
                        <div class="<?= $idx%2==0?'even' : 'odd'?>">
                            <?= YBoard::t('yboard', '{topic} by {user}. {time}', ['topic'=>Html::a($topic->title, ['topic', 'id'=>$topic->id]), 'user'=>Html::a($topic->starter->profile->username, ['member/view', 'id'=>$topic->starter->id]), 'time'=>DateTimeCalculation::medium($topic->lastPost->create_time)]) ?>

                            <?php $idx = $idx+1; ?>

                    <?php endforeach; ?>

<?= YBoard::t('yboard','Recent Replies') ?>

                    <?php $idx=0; ?>
                    <?php foreach($recentReplies as $post): ?>
                        <div class="<?= $idx%2==0?'even' : 'odd'?>">
                            <?= YBoard::t('yboard', '{user} replied to {topic} on {time}', ['topic'=>Html::a($post->topic->title, ['topic', 'id'=>$post->topic->id]), 'user'=>Html::a($post->poster->profile->username, ['member/view', 'id'=>$topic->starter->id]), 'time'=>DateTimeCalculation::medium($post->create_time)]) ?>

                            <?php $idx = $idx+1; ?>

                    <?php endforeach; ?>

        <?= $this->render('_footer'); ?>


code:
<?php
/* @var $this ForumController */
/* @var $choiceProvider ActiveDataProvider */

use yii\widgets\ListView;
?>

 <?= ListView::widget([
    'id'=>'yboardPoll',
    'itemView'=>'_pollResult',
    'dataProvider'=>$choiceProvider,
    'summary'=>false,
]);


code:
<?php
/* @var $this ForumController */
/* @var $forum YBoardForum */
/* @var $topic YBoardTopic */
/* @var $post YBoardPost */

use app\modules\yboard\YBoard;

//print_r($forum); die();

$this->params['breadcrumbs']=[
	['label'=>YBoard::t('yboard', 'Forums'), 'url'=>['forum/index']],
	['label'=>$forum->name, 'url'=>['forum/forum', 'id'=>$forum->id]],
	['label'=>$topic->title, 'url'=>['forum/topic', 'id'=>$topic->id]],
	YBoard::t('yboard', 'Reply'),
];

$items = [
	['label'=>YBoard::t('yboard', 'Forums'), 'url'=>['forum/index']],
	['label'=>YBoard::t('yboard', 'Members'), 'url'=>['member/index']]
];

$this->title = YBoard::t('yboard', 'New Reply');
?>
<div id="yboard-wrapper">
	<?php echo $this->render('_form', ['post'=>$post, 'hide_title'=>true]); ?>
</div>


code:
<?php
/* @var $this ForumController */
/* @var $forum YBoardForum */
/* @var $topic YBoardTopic */
/* @var $dataProvider CActiveDataProvider */
/* @var $postId integer */

use app\modules\yboard\YBoard;
use app\modules\yboard\models\YBoardPost;
use app\modules\yboard\models\YBoardMessage;
use yii\web\View;
use yii\bootstrap\Alert;
use app\components\ckeditor\CKEditor;

use yii\widgets\ListView;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\jui\Dialog;

$this->params['breadcrumbs']=[
	['label'=>YBoard::t('yboard', 'Forums'), 'url'=>['forum/index']],
	['label'=>$forum->name, 'url'=>['forum/forum', 'id'=>$forum->id]],
    $topic->title,
];

$this->title = Html::encode($topic->title);

$this->registerJs('language', "
	var language = \"" . substr(Yii::$app->language, 0, 2) . "\";",
View::POS_BEGIN);

$this->registerJs('scrollToPost', "
	var aTag = $('a[name=\"" . $postId . "\"]');
	if(aTag.length > 0) {
		$('html,body').animate({scrollTop: aTag.offset().top},'fast');
	}
");

?>

<?php if(Yii::$app->session->hasFlash('moderation')): ?>
    <?= Alert::widget([
        'options' => [
            'class' => 'alert-info',
        ],
        'body' => Yii::$app->session->getFlash('moderation')
    ])?>

<?php endif; ?>

	<?php if(!(Yii::$app->user->isGuest || $topic->locked) || Yii::$app->user->can('moderator')): ?>

            <?php $form = ActiveForm::begin([
                    'id'=>'create-post-form',
                    'action'=>['forum/reply', 'id'=>$topic->id],
                    'enableAjaxValidation'=>false,
            ]) ?>
                <?= Html::activeHiddenInput($forum, 'id') ?>
                <?php echo Html::submitButton(YBoard::t('yboard','New Reply'), ['class'=>'btn btn-info btn-sm pull-right', 'style'=>'margin:5px;']); ?>
            <?php ActiveForm::end(); ?>

	<?php endif; ?>

         <?= ListView::widget([
            'summary'=>'', //YBoard::t('yboard', 'Showing {begin} of {totalCount} posts'),
            'id'=>'yboardPost',
            'itemView'=>'_post',
            'dataProvider'=>$dataProvider,
            'viewParams'=>['postId'=>$postId, 'dataProvider'=>$choiceProvider, 'topic'=>$topic],
        ]) ?>

<?php if(!Yii::$app->user->isGuest): ?>

        <?php $form = ActiveForm::begin([
            'id'=>'create-topic-form',
            'action'=>['/'.$this->context->module->id.'/forum/reply', 'id'=>$reply->topic_id],
            'enableAjaxValidation'=>false,
        ]) ?>

            <?= $form->errorSummary($reply) ?>

            <?= Html::activeHiddenInput($reply,'subject') ?>

            <?= CKEditor::widget([
                'model' => $reply,
                'attribute'=>'content',
            ]) ?>

            <?= $reply->isNewRecord?"":$form->field($reply,'change_reason')->textInput() ?>

            <?= Html::activeHiddenInput($reply, 'forum_id') ?>
            <?= Html::activeHiddenInput($reply, 'topic_id') ?>

<?= Html::submitButton($reply->isNewRecord?YBoard::t('yboard','Reply'):YBoard::t('yboard','Save'), ['class'=>'btn btn-primary btn-sm']) ?>

        <?php ActiveForm::end(); ?>

<?php endif; ?>

<?php
if(!Yii::$app->user->isGuest)
{
    Dialog::begin([
        'id'=>'dlgReportForm',
        'clientOptions' => [
            'modal' => true,
            'title'=>YBoard::t('yboard', 'Report post'),
            'autoOpen'=>false,
            'modal'=>true,
            'height'=>'auto',
            'width'=>'auto',

            'buttons'=>[
                [
                    'text'=>YBoard::t('yboard', 'Send'),
                    'class'=>'btn btn-sm btn-success',
                    'click'=>new \yii\web\JsExpression('function(){
                        for(instance in CKEDITOR.instances)
                        {
                            CKEDITOR.instances[instance].updateElement();
                        }
                        sendReport();
                    }')
                ],
                [
                    'text'=>YBoard::t('yboard', 'Cancel'),
                    'class'=>'btn btn-sm btn-danger',
                    'click'=>new \yii\web\JsExpression(' function() { $( this ).dialog( "close" ); }')
                ]
            ],
        ],
    ]);

        echo $this->render('_reportForm', ['model'=>new YBoardMessage]);

    Dialog::end();

    Dialog::begin([
        'id'=>'dlgPrivateMsg',
        'clientOptions' => [
            'modal' => true,
            'title'=>YBoard::t('yboard', 'Send Private Message'),
            'autoOpen'=>false,
            'modal'=>true,
            'height'=>'auto',
            'width'=>'auto',
            'buttons'=>[
                [
                    'text'=>YBoard::t('yboard', 'Send'),
                    'class'=>'btn btn-sm btn-success',
                    'click'=>new \yii\web\JsExpression('function(){
                        for(instance in CKEDITOR.instances)
                        {
                            CKEDITOR.instances[instance].updateElement();
                        }
                        sendPMForm();
                    }')
                ],
                [
                    'text'=>YBoard::t('yboard', 'Cancel'),
                    'class'=>'btn btn-sm btn-danger',
                    'click'=>new \yii\web\JsExpression(' function() { $( this ).dialog( "close" ); }')
                ]
            ],
        ],
    ]);

        echo $this->render('_PrivateMsgForm', ['model'=>new YBoardMessage(['sendfrom'=>Yii::$app->user->identity->id, 'sendto'=>0])]);

    Dialog::end();
}

//for viewing who appreciated post
Dialog::begin([
    'id'=>'dlg-appreciated',
    'clientOptions' => [
        'modal' => true,
        'title'=>YBoard::t('yboard', 'Member Appreciated'),
        'autoOpen'=>false,
        'modal'=>true,
        'height'=>'auto',
        'width'=>'300',
        'buttons'=>[
            [
                'text'=>YBoard::t('yboard', 'close'),
                'class'=>'btn btn-sm btn-default',
                'click'=>new \yii\web\JsExpression(' function() { $( this ).dialog( "close" ); }')
            ]
            ],
    ],
]);

echo '

';

Dialog::end();

?>

<?php
//for banning Users
Dialog::begin([
    'id'=>'dlg-ban',
    'clientOptions' => [
        'modal' => true,
        'title'=>YBoard::t('yboard', 'Ban User'),
        'autoOpen'=>false,
        'modal'=>true,
        'height'=>'auto',
        'width'=>'300',
    ],
]);

        echo $this->render('_banForm', ['model'=>new YBoardMessage(['sendfrom'=>Yii::$app->user->id, 'sendto'=>0])]);

Dialog::end();

?>


code:
<?php
/* @var $this ForumController */
/* @var $forum YBoardForum */
/* @var $topic YBoardTopic */
/* @var $post YBoardPost */

use app\modules\yboard\YBoard;

$this->params['breadcrumbs'] = [
	['label'=>YBoard::t('yboard', 'Forums'), 'url'=>['forum/index']],
	['label'=>$forum->name, 'url'=>['/forum/forum/forum', 'id'=>$forum->id]],
	['label'=>$topic->title, 'url'=>['/forum/forum/forum', 'id'=>$forum->id]],
	YBoard::t('yboard', 'Change'),
];

$items =[
	['label'=>YBoard::t('yboard', 'Forums'), 'url'=>['/forum/forum/index']],
	['label'=>YBoard::t('yboard', 'Members'), 'url'=>['/forum/member/index']]
];
$this->title = YBoard::t('yboard', 'Updating {post}', ['post'=>$topic->title]);
?>
<div id="yboard-wrapper">

	<?php echo $this->render('_form', ['post'=>$post]); ?>
</div>


code:
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/**
 * @var yii\web\View $this
 * @var app\modules\yboard\models\YBoardForum $model
 */

$this->title = $model->name;

$this->params['breadcrumbs']=[
	['label'=>YBoard::t('yboard', 'Forums'), 'url'=>['forum/index']],
	['label' => YBoard::t('yboard', 'YBoard Forums'), 'url' => ['index']],
    $this->title
];

?>

<?= Html::encode($this->title) ?>

        <?= Html::a(YBoard::t('yboard', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a(YBoard::t('yboard', 'Delete'), ['delete', 'id' => $model->id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => YBoard::t('yboard', 'Are you sure you want to delete this item?'),
                'method' => 'post',
            ],
        ]) ?>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            'cat_id',
            'name',
            'subtitle',
            'type',
            'public',
            'locked',
            'moderated',
            'sort',
            'num_posts',
            'num_topics',
            'last_post_id',
            'poll',
            'membergroup_id',
        ],
    ]) ?>


code:
<?php
/* @var $this ForumController */
/* @var $choiceProvider ActiveDataProvider */

use yii\helpers\Html;
use yii\widgets\ListView;

echo Html::beginForm('', 'post', array('id'=>'yboard-poll-form'));
echo Html::hiddenInput('poll_id', $this->context->poll->id);

echo ListView::widget([
	'id'=>'yboardPoll',
	'dataProvider'=>$choiceProvider,
	'itemView'=>'_pollChoice',
	'summary'=>false,
]);
echo '<div>';
echo Html::button(YBoard::t('yboard', 'Vote'), [
    'class'=>'btn btn-default btn-sm','onclick'=>'vote("' . Yii::$app->urlManager->createAbsoluteUrl($this->context->module->id.'/forum/vote') . '");'
]);
echo '</div>';
echo Html::endForm();
?>


code:
<?php
use app\modules\yboard\YBoard;
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use yii\widgets\Menu;
use app\modules\yboard\models\YBoardMessage;

/* @var $this \yii\web\View */
/* @var $content string */

$this->registerJs('hljs.initHighlightingOnLoad();');
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">

    <meta charset="<?= Yii::$app->charset ?>"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>

<?php $this->beginBody() ?>
    <?php
            NavBar::begin([
                'brandLabel' => '
'.Html::img($this->context->module->getRegisteredImage('logo.png'), ['class'=>'hidden-xs' ])
                        .Html::img($this->context->module->getRegisteredImage('logo_22.png'), ['class'=>'visible-xs' ])
                        .' '.$this->context->module->forumTitle.'
',
                'brandUrl' => ['/'.$this->context->module->id.'/forum/'],
                'options' => [
                    'class' => 'navbar-custom navbar-static-top',
                ],
            ]);
            echo Nav::widget([
                'options' => ['class' => 'navbar-nav navbar-right visible-xs'],
                'items' =>  isset($this->context->module->params['foroMenu'])?
                    array_merge($this->context->module->params['foroMenu'],
                         [
                            ['label' => YBoard::t('yboard', 'Login'), 'url' => ['/profile/account/login'], 'visible' => Yii::$app->user->isGuest],
                            ['label' => YBoard::t('yboard', 'Logout'), 'url' => ['/profile/account/logout'], 'visible' => !Yii::$app->user->isGuest, 'linkOptions' => ['data-method' => 'post']]
                         ]
                    )
                    :[]
            ]);
            NavBar::end();
        ?>

                <?php if(!Yii::$app->user->isGuest) : ?>

                        <?=Html::a( YBoard::t('yboard', 'Welcome back {uname}!', ['uname'=>Yii::$app->user->identity->username]), ['member/view','id'=>Yii::$app->user->id]) ?>

                        <?php $unread = YBoardMessage::find()->inboxScope()->unreadScope()->andWhere(['sendto' =>\Yii::$app->user->id])->count(); ?>
                        <?php $total = YBoardMessage::find()->inboxScope()->andWhere(['sendto' =>\Yii::$app->user->id])->count(); ?>

                            <?= Html::a(Html::img($this->context->module->getRegisteredImage('msg.png')).' '.YBoard::t('yboard', '({unread} of {total})',['unread'=>$unread, 'total'=>$total]), ['message/inbox'], ['title'=>YBoard::t('yboard','Private Messages')]) ?>

                <?php endif; ?>

                    <?php if(!Yii::$app->user->isGuest) : ?>
                    <?=Html::a(Html::img($this->context->module->getRegisteredImage('usercp.png')).' '.YBoard::t('yboard', 'User CP'), ['member/profile','id'=>Yii::$app->user->id], ['title'=>YBoard::t('yboard', 'User Control Panel'),'style'=>'vertical-align:bottom; ']) ?>
                    <?php endif; ?>

                    <?php if(Yii::$app->user->can('moderator')) : ?>
                    <?=Html::a(Html::img($this->context->module->getRegisteredImage('modcp.png')).' '.YBoard::t('yboard', 'Mod CP'), ['moderator/index'], ['title'=>YBoard::t('yboard', 'Moderator Control Panel'),'style'=>'vertical-align:bottom;']) ?>
                    <?php endif; ?>

                    <?php if(Yii::$app->user->can('admin')): ?>
                    <?= Html::a(Html::img($this->context->module->getRegisteredImage('admincp.png')).' '.YBoard::t('yboard', 'Admin CP'), ['setting/index'], ['title'=>YBoard::t('yboard', 'Admin Control Parent'),'style'=>'vertical-align:bottom;']) ?>
                    <?php endif; ?>

               <?php
                    if(isset($this->context->module->params['foroMenu']))
                    {
                        echo '
';
                            echo Menu::widget([
                                'items' =>array_merge($this->context->module->params['foroMenu'],
                                     [
                                        ['label' => YBoard::t('yboard', 'Login'), 'url' => ['/profile/account/login'], 'visible' => Yii::$app->user->isGuest],
                                        ['label' => YBoard::t('yboard', 'Logout'), 'url' => ['/profile/account/logout'], 'visible' => !Yii::$app->user->isGuest,'template' => '{label}']
                                     ]
                                )

                            ]);
                        echo '
';
                    }
                ?>

    <?php if(isset($this->params['breadcrumbs'])):  ?>

            <?= Breadcrumbs::widget([
                'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
            ]) ?>

    <?php endif; ?>

        <?php if(isset($this->params['adminMenu'])): ?>

<?= isset($this->params['adminMenu']['title'])?$this->params['adminMenu']['title']:$this->title ?>

                        <?php foreach($this->params['adminMenu'] as $item): ?>
                            <?php if(isset($item['label']) && isset($item['url'])): ?>

<?= Html::a($item['label'], $item['url']) ?>

                            <?php endif; ?>
                        <?php endforeach; ?>

                <?= $content ?>

        <?php else: ?>

                <?= $content ?>

        <?php endif; ?>

YiiBoard <?= YBoard::t('yboard','v{v}', ['v' =>$this->context->module->version]) ?> © 2013-2014,  Hosanna Higher Technologies Ltd.  <?= Yii::powered() ?>

<?php $this->endBody() ?>

<?php $this->endPage() ?>


code:
<?php
use app\modules\yboard\YBoard;
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use yii\widgets\Menu;
use app\modules\yboard\models\YBoardMessage;

/* @var $this \yii\web\View */
/* @var $content string */

$this->registerJs('hljs.initHighlightingOnLoad();');

$unread = YBoardMessage::find()->inboxScope()->unreadScope()->andWhere(['sendto' =>\Yii::$app->user->id])->count();
$total = YBoardMessage::find()->inboxScope()->andWhere(['sendto' =>\Yii::$app->user->id])->count();

?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">

    <meta charset="<?= Yii::$app->charset ?>"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>

<?php $this->beginBody() ?>
    <?php
            NavBar::begin([
                'brandLabel' => '
'.Html::img($this->context->module->getRegisteredImage('logo.png'), ['class'=>'hidden-xs' ])
                        .Html::img($this->context->module->getRegisteredImage('logo_22.png'), ['class'=>'visible-xs' ])
                        .' '.$this->context->module->forumTitle.'
',
                'brandUrl' => ['/'.$this->context->module->id.'/forum/'],
                'options' => [
                    'class' => 'navbar-custom navbar-static-top',
                ],
            ]);
            echo Nav::widget([
                'options' => ['class' => 'navbar-nav navbar-right visible-xs'],
                'items' =>  isset($this->context->module->params['foroMenu'])?
                    array_merge($this->context->module->params['foroMenu'],
                         [
                            ['label' => YBoard::t('yboard', 'Login'), 'url' => ['/profile/account/login'], 'visible' => Yii::$app->user->isGuest],
                            ['label' => YBoard::t('yboard', 'Logout'), 'url' => ['/profile/account/logout'], 'visible' => !Yii::$app->user->isGuest, 'linkOptions' => ['data-method' => 'post']]
                         ]
                    )
                    :[]
            ]);
            NavBar::end();
        ?>

                <?php if(!Yii::$app->user->isGuest) : ?>

                        <?=Html::a( YBoard::t('yboard', 'Welcome back {uname}!', ['uname'=>Yii::$app->user->identity->username]), ['member/view','id'=>Yii::$app->user->id]) ?>

                            <?= Html::a(Html::img($this->context->module->getRegisteredImage('msg.png')).' '.YBoard::t('yboard', '({unread} of {total})',['unread'=>$unread, 'total'=>$total]), ['message/inbox'], ['title'=>YBoard::t('yboard','Private Messages')]) ?>

                <?php endif; ?>

                    <?php if(!Yii::$app->user->isGuest) : ?>
                    <?=Html::a(Html::img($this->context->module->getRegisteredImage('usercp.png')).' '.YBoard::t('yboard', 'User CP'), ['member/profile','id'=>Yii::$app->user->id], ['title'=>YBoard::t('yboard', 'User Control Panel'),'style'=>'vertical-align:bottom; ']) ?>

                            <?= Html::a(Html::img($this->context->module->getRegisteredImage('msg.png')).' '.YBoard::t('yboard', '({unread} of {total})',['unread'=>$unread, 'total'=>$total]), ['message/inbox'], ['title'=>YBoard::t('yboard','Private Messages')]) ?>

                    <?php endif; ?>

                    <?php if(Yii::$app->user->can('moderator')) : ?>
                    <?=Html::a(Html::img($this->context->module->getRegisteredImage('modcp.png')).' '.YBoard::t('yboard', 'Mod CP'), ['moderator/index'], ['title'=>YBoard::t('yboard', 'Moderator Control Panel'),'style'=>'vertical-align:bottom;']) ?>
                    <?php endif; ?>

                    <?php if(Yii::$app->user->can('admin')): ?>
                    <?= Html::a(Html::img($this->context->module->getRegisteredImage('admincp.png')).' '.YBoard::t('yboard', 'Admin CP'), ['setting/index'], ['title'=>YBoard::t('yboard', 'Admin Control Parent'),'style'=>'vertical-align:bottom;']) ?>
                    <?php endif; ?>

               <?php
                    if(isset($this->context->module->params['foroMenu']))
                    {
                        echo '
';
                            echo Menu::widget([
                                'items' =>array_merge($this->context->module->params['foroMenu'],
                                     [
                                        ['label' => YBoard::t('yboard', 'Login'), 'url' => ['/profile/account/login'], 'visible' => Yii::$app->user->isGuest],
                                        ['label' => YBoard::t('yboard', 'Logout'), 'url' => ['/profile/account/logout'], 'visible' => !Yii::$app->user->isGuest,'template' => '{label}']
                                     ]
                                )

                            ]);
                        echo '
';
                    }
                ?>

    <?php if(isset($this->params['breadcrumbs'])):  ?>

            <?= Breadcrumbs::widget([
                'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
            ]) ?>

    <?php endif; ?>

        <?= $content ?>

YiiBoard <?= YBoard::t('yboard','v{v}', ['v' =>$this->context->module->version]) ?> © 2013-2014,  Hosanna Higher Technologies Ltd.  <?= Yii::powered() ?>

<?php $this->endBody() ?>

<?php $this->endPage() ?>


code:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use app\modules\yboard\YBoard;

/**
 * @var yii\web\View $this
 * @var app\modules\yboard\modelsYBoardMember $model
 * @var yii\widgets\ActiveForm $form
 */
?>

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'location')->textInput(['maxlength' => 255]) ?>

    <?= $form->field($model, 'personal_text')->textInput(['maxlength' => 255]) ?>

    <?= $form->field($model, 'show_online')->dropDownList([0=>YBoard::t('yboard', 'No'), 1=>YBoard::t('yboard', 'Yes')]) ?>

    <?= $form->field($model, 'contact_pm')->dropDownList([0=>YBoard::t('yboard', 'No'), 1=>YBoard::t('yboard', 'Yes')]) ?>

    <?= $form->field($model, 'signature')->textarea(['rows' => 6]) ?>

    <?= $form->field($model, 'website')->textInput(['maxlength' => 255])->label($model->getAttributeLabel('website').' '.Html::img($this->context->module->getSocialImage('globe.png'), ['alt'=>'website', 'style'=>'vertical-align:middle'])) ?>

    <?= $form->field($model, 'facebook')->textInput(['maxlength' => 255])->label($model->getAttributeLabel('facebook').' '.Html::img($this->context->module->getSocialImage('facebook.png'), ['alt'=>'facebook', 'style'=>'vertical-align:middle'])) ?>

   <?= $form->field($model, 'twitter')->textInput(['maxlength' => 255])->label($model->getAttributeLabel('twitter').' '.Html::img($this->context->module->getSocialImage('twitter.png'), ['alt'=>'twitter', 'style'=>'vertical-align:middle'])) ?>

    <?= $form->field($model, 'google')->textInput(['maxlength' => 255])->label($model->getAttributeLabel('google').' '.Html::img($this->context->module->getSocialImage('google.png'), ['alt'=>'google', 'style'=>'vertical-align:middle'])) ?>

    <?= $form->field($model, 'linkedin')->textInput(['maxlength' => 255])->label($model->getAttributeLabel('linkedin').' '.Html::img($this->context->module->getSocialImage('linkedin.png'), ['alt'=>'linkedin', 'style'=>'vertical-align:middle'])) ?>

    <?= $form->field($model, 'blogger')->textInput(['maxlength' => 255])->label($model->getAttributeLabel('blogger').' '.Html::img($this->context->module->getSocialImage('blogger.png'), ['alt'=>'blogger', 'style'=>'vertical-align:middle'])) ?>

   <?= $form->field($model, 'youtube')->textInput(['maxlength' => 255])->label($model->getAttributeLabel('youtube').' '.Html::img($this->context->module->getSocialImage('youtube.png'), ['alt'=>'youtube', 'style'=>'vertical-align:middle'])) ?>

   <?= $form->field($model, 'yahoo')->textInput(['maxlength' => 255])->label($model->getAttributeLabel('yahoo').' '.Html::img($this->context->module->getSocialImage('yahoo.png'), ['alt'=>'yahoo', 'style'=>'vertical-align:middle'])) ?>

    <?= $form->field($model, 'skype')->textInput(['maxlength' => 255])->label($model->getAttributeLabel('skype').' '.Html::img($this->context->module->getSocialImage('skype.png'), ['alt'=>'skype', 'style'=>'vertical-align:middle'])) ?>

    <?= $form->field($model, 'metacafe')->textInput(['maxlength' => 255])->label($model->getAttributeLabel('metacafe').' '.Html::img($this->context->module->getSocialImage('metacafe.png'), ['alt'=>'Metacafe', 'style'=>'vertical-align:middle'])) ?>

   <?= $form->field($model, 'github')->textInput(['maxlength' => 255])->label($model->getAttributeLabel('github').' '.Html::img($this->context->module->getSocialImage('github.png'), ['alt'=>'github', 'style'=>'vertical-align:middle'])) ?>

   <?= $form->field($model, 'orkut')->textInput(['maxlength' => 255])->label($model->getAttributeLabel('orkut').' '.Html::img($this->context->module->getSocialImage('orkut.png'), ['alt'=>'orkut', 'style'=>'vertical-align:middle'])) ?>

   <?= $form->field($model, 'wordpress')->textInput(['maxlength' => 255])->label($model->getAttributeLabel('wordpress').' '.Html::img($this->context->module->getSocialImage('wordpress.png'), ['alt'=>'wordpress', 'style'=>'vertical-align:middle'])) ?>

   <?= $form->field($model, 'tumblr')->textInput(['maxlength' => 255])->label($model->getAttributeLabel('tumblr').' '.Html::img($this->context->module->getSocialImage('tumblr.png'), ['alt'=>'tumblr', 'style'=>'vertical-align:middle'])) ?>

        <?= Html::submitButton($model->isNewRecord ? YBoard::t('yboard', 'Add Profile') : YBoard::t('yboard', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>

    <?php ActiveForm::end(); ?>


code:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use app\modules\yboard\YBoard;

/**
 * @var yii\web\View $this
 * @var app\modules\yboard\models\YBoardMemberSearch $model
 * @var yii\widgets\ActiveForm $form
 */
?>

            <?php $form = ActiveForm::begin([
                'action' => ['index'],
                'method' => 'get',
            ]); ?>

                <?= $form->field($model, 'username')->label("")->hint(YBoard::t('yboard', 'search username')) ?>

            <?php ActiveForm::end(); ?>


code:
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
use app\modules\yboard\YBoard;
?>

               <?= Html::img(isset($model->profile->image)? $model->profile->image:$this->context->module->getRegisteredImage("empty.jpeg"),['id'=>'user-avatar'])  ?>

                <?= Html::a(ucwords($model->profile->{$this->context->module->userNameColumn}), ['member/view', 'id'=>$model->id]) ?>

                <?php
                    $gender = $this->context->module->genderColumn;
                    $regdate = $this->context->module->regdateColumn;

                    $timezone = isset($model->profile->timezone)? new DateTimeZone($model->profile->timezone) : new DateTimeZone() ;
                ?>

                <?= DetailView::widget([
                    'model' => $model,
                    'options'=>[
                        'class' => 'table table-striped detail-view'
                    ],
                    'attributes' => [
                        [
                            'label'=>YBoard::t('yboard', 'Last Visit'),
                            'value'=>date_format(date_timezone_set(date_create($model->last_visit), $timezone), 'l, d-M-y H:i T'),
                        ],
                        [
                            'label'=>YBoard::t('yboard', 'Gender'),
                            'value'=>($model->profile->{$gender}==1?YBoard::t('yboard', 'Male'):YBoard::t('yboard', 'Female'))                        ],
                        [
                            'label'=>YBoard::t('yboard', 'Joined'),
                            'value'=>$regdate==null?YBoard::t('yboard', 'None'): date_format(date_timezone_set(date_timestamp_set(date_create(), $model->profile->{$regdate}), $timezone), 'l, d-M-y H:i T'),
                        ],
                        [
                            'label'=>YBoard::t('yboard', 'Group'),
                            'value'=> isset($model->group)? Html::encode($model->group->name) : Yiit('app', 'Member')
,
                        ],
                        'status',
                    ],
                ]) ?>


code:
<?php

use yii\helpers\Html;
use app\modules\yboard\YBoard;

/**
 * @var yii\web\View $this
 * @var app\modules\yboard\models\YBoardMember $model
 */

$this->title = YBoard::t('yboard', 'Add Forum Profile');
$this->params['breadcrumbs'][] = ['label' => YBoard::t('yboard', 'Member List'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>

<?= Html::encode($this->title) ?>

    <?= $this->render('_form', [
        'model' => $model,
    ]) ?>


code:
<?php

use yii\helpers\Html;
use yii\widgets\ListView;
use app\modules\yboard\YBoard;

/**
 * @var yii\web\View $this
 * @var yii\data\ActiveDataProvider $dataProvider
 * @var app\modules\yboard\models\YBoardMemberSearch $searchModel
 */

$this->title = YBoard::t('yboard', 'Member Profiles');
$this->params['breadcrumbs'][] = $this->title;

$this->params['breadcrumbs']=[
	['label'=>YBoard::t('yboard', 'Forums'), 'url'=>['forum/index']],
    $this->title
];

?>

        <?php echo $this->render('_search', ['model' => $searchModel]); ?>

        <?= ListView::widget([
            'id'=>'member-list',
            'dataProvider' => $dataProvider,
            'itemOptions' => ['class' => 'item'],
            'itemView' =>'_singleUser',
            'summary' =>'',
        ]) ?>