/** * @return string */ public function getActionForList() { switch ($this->last_activity) { case "create": return Translator::get()->translate("Created by"); case "edit": return Translator::get()->translate("Edited by"); case "reply": return Translator::get()->translate("Reply from"); } }
<?php /* @var $this \mpf\modules\forum\components\Controller */ /* @var $model \mpf\modules\forum\models\ForumThread */ echo \app\components\htmltools\Page::get()->title(\mpf\web\helpers\Html::get()->link($this->updateURLWithSection(['home', 'index']), $this->forumTitle) . " " . \mpf\modules\forum\components\Config::value('FORUM_PAGE_TITLE_SEPARATOR') . " " . \mpf\web\helpers\Html::get()->link($this->updateURLWithSection(['category', 'index', ['category' => $model->subcategory->category->url_friendly_name, 'id' => $model->subcategory->category_id]]), $model->subcategory->category->name) . " " . \mpf\modules\forum\components\Config::value('FORUM_PAGE_TITLE_SEPARATOR') . " " . \mpf\web\helpers\Html::get()->link($this->updateURLWithSection(['subcategory', 'index', ['category' => $model->subcategory->category->url_friendly_name, 'subcategory' => $model->subcategory->url_friendly_title, 'id' => $model->subcategory->category_id]]), $model->subcategory->title) . " " . \mpf\modules\forum\components\Config::value('FORUM_PAGE_TITLE_SEPARATOR') . " " . \mpf\web\helpers\Html::get()->link($this->updateURLWithSection(['thread', 'index', ['category' => $model->subcategory->category->url_friendly_name, 'subcategory' => $model->subcategory->url_friendly_title, 'id' => $model->id]]), $model->title) . " " . \mpf\modules\forum\components\Config::value('FORUM_PAGE_TITLE_SEPARATOR') . " " . \mpf\modules\forum\components\Translator::get()->translate("Move post")); ?> <div class="forum-page <?php echo $this->forumPageTheme; ?> "> <?php $this->displayComponent('searchbar'); ?> <?php $this->displayComponent('topuserpanel'); ?> <?php echo \mpf\widgets\form\Form::get(['name' => 'move', 'model' => $model, 'theme' => 'default-wide', 'fields' => [['name' => 'subcategory_id', 'type' => 'select', 'options' => \mpf\modules\forum\models\ForumSubcategory::getAllForSelectTree($this->sectionId)]]])->display(); ?> </div>
<?php if ($thread->last_reply_id) { ?> <?php echo $thread->getLastActiveProfileLink(); ?> <span><?php echo \mpf\helpers\DateTimeHelper::get()->niceDate($thread->last_reply_date, false, false); ?> </span> <?php } else { ?> <span class="thread-no-replies-message"> <?php echo \mpf\modules\forum\components\Translator::get()->translate("no replies"); ?> </span> <?php } ?> </td> </tr> <?php } ?> <?php } ?> </table> </div>
<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')); ?> <?php echo \mpf\web\helpers\Html::get()->link(['search', 'recent'], \mpf\modules\forum\components\Translator::get()->translate('Recent Threads')); ?> <?php echo \mpf\web\helpers\Html::get()->link(['members'], \mpf\modules\forum\components\Translator::get()->translate('Members')); ?> </div> </div>
echo $thread->getLastActiveProfileLink(); ?> <span><?php echo \mpf\helpers\DateTimeHelper::get()->niceDate($thread->last_reply_date, false, false); ?> </span> <?php } else { ?> <span class="thread-no-replies-message"> <?php echo \mpf\modules\forum\components\Translator::get()->translate("no replies"); ?> </span> <?php } ?> </td> </tr> <?php } ?> <?php } ?> </table> <?php $this->displayComponent("pagelist", ['elementsName' => \mpf\modules\forum\components\Translator::get()->translate('threads'), 'totalElements' => $numberOfThreads, 'visibleElements' => count($threads), 'totalPages' => (int) ($numberOfThreads / \mpf\modules\forum\components\Config::value('FORUM_THREADS_PER_PAGE') + ($numberOfThreads % \mpf\modules\forum\components\Config::value('FORUM_THREADS_PER_PAGE') ? 1 : 0)), 'currentPage' => $currentPage]); ?> </div>
<?php } ?> <?php } ?> function showHideHiddenSubcategories(button) { if ($('.forum-section').hasClass('forum-hide-hidden')) { $('.forum-section').removeClass('forum-hide-hidden'); $(button).text('<?php echo \mpf\modules\forum\components\Translator::get()->translate("Hide Hidden Subcategories"); ?> '); } else { console.log("doesn't have class"); $('.forum-section').addClass('forum-hide-hidden'); $(button).text('<?php echo \mpf\modules\forum\components\Translator::get()->translate("Show Hidden Subcategories"); ?> '); } return false; } $(document).ready(function () { $('#jump-to-category').change(function () { window.location = Categories2URLs[$(this).val()]; }); }) </script>
echo \mpf\modules\forum\components\Translator::get()->translate("Can't access this category!"); ?> <?php } elseif ('userprofile' == $location) { ?> <?php if (\mpf\WebApp::get()->user()->isGuest()) { ?> <?php echo \mpf\modules\forum\components\Translator::get()->translate("Must login to see user profile!"); ?> <?php } else { ?> <?php echo \mpf\modules\forum\components\Translator::get()->translate("Can't access user profile!"); ?> <?php } ?> <?php } else { ?> <?php echo \mpf\modules\forum\components\Translator::get()->translate("Access denied"); ?> <?php } ?> </div>
?> <?php $this->display("_replies", ['reply' => $reply, 'level' => 2]); ?> </td> </tr> <tr class="forum-between-replies"> <td colspan="2"><span> </span></td> </tr> <?php } ?> </table> <?php $this->displayComponent("pagelist", ['elementsName' => \mpf\modules\forum\components\Translator::get()->translate('replies'), 'totalElements' => $thread->first_level_replies . ' ( ' . $thread->replies . ' )', 'visibleElements' => count($replies), 'totalPages' => (int) ($thread->first_level_replies / \mpf\modules\forum\components\Config::value('FORUM_REPLIES_PER_PAGE') + ($thread->first_level_replies % \mpf\modules\forum\components\Config::value('FORUM_REPLIES_PER_PAGE') ? 1 : 0)), 'currentPage' => $currentPage]); ?> </div> <script> $(document).ready(function () { $('.reply-to-existing-reply').each(function () { var className = $(this).attr('href').substring(11); $(this).click(function (e) { $('.forum-subreply-' + className).show(); var _self = $('.forum-subreply-' + className, this.parentNode.parentNode); setTimeout(function () { $('textarea', _self).focus(); }, 200); e.preventDefault();
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]); }
*/ ?> <div class="forum-page-list"> <span class="forum-page-list-elements"> <?php echo $visibleElements . ' / ' . $totalElements . ' ' . $elementsName; ?> <?php if (isset($order)) { ?> | <?php echo \mpf\web\helpers\Form::get()->openForm(['method' => 'get', 'style' => 'display:inline;']); ?> <?php echo \mpf\modules\forum\components\Translator::get()->translate('Order By'); ?> <?php echo \mpf\web\helpers\Form::get()->select('order', \mpf\modules\forum\models\ForumReply::getOrdersForSelect(), $order, ['onchange' => 'this.form.submit();']); ?> <?php echo \mpf\web\helpers\Form::get()->closeForm(); ?> <?php } ?> </span> <?php if ($totalPages > 1) { ?> <ul class="forum-page-list-pages">
<div class="forum-section-footer"> <?php if (\mpf\modules\forum\components\UserAccess::get()->isCategoryModerator($subcategory->category_id, $this->sectionId)) { ?> <div class="forum-section-actions"> <?php echo \mpf\web\helpers\Html::get()->link($this->updateURLWithSection(['manage', 'editSubcategory', ['id' => $subcategory->id]]), \mpf\modules\forum\components\Translator::get()->translate("Edit subcategory")); ?> </div> <?php } ?> <div class="forum-section-jump-to-category"> <select id="jump-to-category"> <option><?php echo \mpf\modules\forum\components\Translator::get()->translate("--jump to category--"); ?> </option> <?php foreach ($categories as $category) { ?> <optgroup label="<?php echo $category->name; ?> "> <?php foreach ($category->subcategories as $subcategory) { ?> <option value="<?php echo $subcategory->id; ?>
public function getContent() { if ($this->deleted) { if ($this->deleted_user_id != $this->user_id) { return Html::get()->tag("div", Translator::get()->translate("[DELETED BY MODERATOR]"), ['class' => "forum-reply-deleted-message"]); } else { return Html::get()->tag("div", Translator::get()->translate("[DELETED]"), ['class' => "forum-reply-deleted-message"]); } } if (Config::value("FORUM_TEXT_PARSER_CALLBACK") && is_callable(Config::value("FORUM_TEXT_PARSER_CALLBACK"))) { $text = call_user_func(Config::value("FORUM_TEXT_PARSER_CALLBACK"), $this->content); } else { $text = Markdown::processText($this->content); } return $text . Html::get()->scriptFile(WebApp::get()->request()->getWebRoot() . 'main/highlight/highlight.pack.js') . Html::get()->cssFile(WebApp::get()->request()->getWebRoot() . 'main/highlight/styles/github.css') . Html::get()->script('hljs.tabReplace = \' \';hljs.initHighlightingOnLoad();'); }
<?php echo \mpf\helpers\DateTimeHelper::get()->niceDate($subReply->edit_time, false, false); ?> <?php } ?> </div> <?php } ?> <?php if (!$reply->deleted && \mpf\modules\forum\components\Config::value('FORUM_MAX_REPLY_LEVELS') != $level && \mpf\modules\forum\components\UserAccess::get()->canReplyToThread($subcategory->category_id, $this->sectionId)) { ?> <div class="forum-thread-reply-actions"> <?php echo \mpf\web\helpers\Html::get()->link('#reply-for-' . $level . '-' . $subReply->id, \mpf\modules\forum\components\Translator::get()->translate('Reply'), ['class' => 'new-reply-button reply-to-existing-reply']); ?> </div> <?php } ?> <?php if ($subReply->sectionAuthor->getSignature()) { ?> <?php echo \mpf\modules\forum\components\Config::value('FORUM_THREAD_SIGNATURE_SEPARATOR'); ?> <?php echo $subReply->sectionAuthor->getSignature(); ?> <?php
<?php /* @var $this \mpf\modules\forum\controllers\Home */ /* @var $categories \mpf\modules\forum\models\ForumCategory[] */ $menu = []; if (\mpf\modules\forum\components\UserAccess::get()->isSectionAdmin($this->sectionId)) { ?> <?php $menu = [['url' => $this->updateURLWithSection(['manage', 'groups']), 'label' => 'Manage Groups'], ['url' => $this->updateURLWithSection(['manage', 'categories']), 'label' => 'Manage Categories'], ['url' => $this->updateURLWithSection(['manage', 'users']), 'label' => 'Manage Users'], ['url' => $this->updateURLWithSection(['manage', 'titles']), 'label' => 'Manage Titles']]; } echo \app\components\htmltools\Page::get()->title(\mpf\web\helpers\Html::get()->link($this->updateURLWithSection(['home']), \mpf\modules\forum\components\Translator::get()->translate($this->forumTitle)) . " " . \mpf\modules\forum\components\Config::value("FORUM_PAGE_TITLE_SEPARATOR") . " " . \mpf\modules\forum\components\Translator::get()->translate("Advanced Search"), $menu); ?> <div class="forum-page <?php echo $this->forumPageTheme; ?> "> <?php $this->displayComponent('topuserpanel'); ?> <?php if (!\mpf\modules\forum\components\UserAccess::get()->canRead($this->sectionId)) { ?> <?php $this->displayComponent('accessdenied', ['location' => 'section']); ?> <?php return; ?> <?php }
/* @var $this \mpf\modules\forum\components\Controller */ $url = $this->updateURLWithSection(['search', 'index']); ?> <div class="forum-search-panel"> <form method="get" class="forum-search-panel-form" action="<?php echo $this->getRequest()->createURL($url[0], $url[1], isset($url[2]) ? $url[2] : []); ?> "> <input type="text" name="search" placeholder="<?php echo \mpf\modules\forum\components\Translator::get()->translate("Search forum.."); ?> " class="forum-search-panel-input" /> <input type="submit" value="<?php echo \mpf\modules\forum\components\Translator::get()->translate("Search"); ?> " class="forum-search-panel-button" /> </form> </div> <script> $(document).ready(function () { $('.forum-search-panel-form').submit(function(){ //can't search with empty form; if ($('.forum-search-panel-input', this).val() == "" || $('.forum-search-panel-input', this).val() == "<?php echo \mpf\modules\forum\components\Translator::get()->translate("Search forum.."); ?> "){ return false; } }); }); </script>