1. Go to this page and download the library: Download worstinme/yii2-forum library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
public $languages = ['en'=>'English'];
public $postPageSize = 20;
public $moderRole = 'admin';
public $profileModel = '\app\models\Profile';
public $profileModelUserColumn = 'id';
public $postEditDelay = 60*5;
public $postDeleteDelay = 60*5;
public $threadEditDelay = 60*5;
public $threadDeleteDelay = 60*5;
public $processLanguageSetting = true;
namespace app\models;
use Yii;
use himiklab\thumbnail\EasyThumbnailImage;
class Profile extends \yii\db\ActiveRecord
{
public static function tableName()
{
return 'user';
}
public function getUrl() {
return ['/profile/user','id'=>$this->user_id,'lang'=>Yii::$app->language];
}
public function getName() {
return $this->name.' '.$this->surname;
}
public function getAvatarUrl() {
return EasyThumbnailImage::thumbnailFileUrl(Yii::getAlias('@common').'/files'.$this->avatar, 160, 160, EasyThumbnailImage::THUMBNAIL_OUTBOUND);
}
public function getUrl() {
return '#';
}
}