Example #1
0
<?php

if (\mpf\WebApp::get()->user()->isGuest()) {
    ?>
    <?php 
    return;
}
?>
<div class="forum-user-panel">
    <div class="forum-user-panel-icon">
        <?php 
echo \mpf\web\helpers\Html::get()->link(['user', 'controlPanel'], \mpf\web\helpers\Html::get()->image(\mpf\modules\forum\components\ModelHelper::getUserIconURL(\mpf\WebApp::get()->user()->icon ?: 'default.png')));
?>
    </div>
    <div class="forum-user-panel-about">
        <?php 
echo \mpf\web\helpers\Html::get()->link(['user', 'index', ['id' => \mpf\WebApp::get()->user()->id, 'name' => \mpf\WebApp::get()->user()->name]], \mpf\WebApp::get()->user()->name, ['class' => 'form-user-panel-about-name']);
?>
        <span
            class="form-user-panel-about-title"><?php 
echo \mpf\modules\forum\components\UserAccess::get()->getUserTitle($this->sectionId, true);
?>
</span>
    </div>
    <div class="forum-user-panel-links">
        <?php 
echo \mpf\web\helpers\Html::get()->link(['home'], \mpf\modules\forum\components\Translator::get()->translate('Categories'));
?>
        <?php 
echo \mpf\web\helpers\Html::get()->link(['user', 'controlPanel'], \mpf\modules\forum\components\Translator::get()->translate('Control Panel'));
?>
Example #2
0
 public function newNotification($sectionId, $action = 'newReply')
 {
     $params = ['id' => $this->id, 'subcategory' => $this->subcategory->url_friendly_title, 'category' => $this->subcategory->category->url_friendly_name];
     if ($sectionId && 'get' == Config::value('FORUM_SECTION_ID_SOURCE')) {
         $params[Config::value('FORUM_SECTION_ID_KEY')] = $sectionId;
     }
     $url = ['thread', 'index', $params, WebApp::get()->request()->getModule()];
     $actions = ['newReply' => Translator::get()->translate('posted a new reply'), 'editReply' => Translator::get()->translate('edited a reply'), 'editThread' => Translator::get()->translate("edited the thread")];
     ModelHelper::notifySubscribers("thread.replies.{$this->id}", $url, ['threadTitle' => $this->title, 'action' => $actions[$action], 'threadId' => $this->id, 'userName' => WebApp::get()->user()->name, 'userId' => WebApp::get()->user()->id]);
 }