public function execute() { if (false === ($mod_c = GWF_Module::loadModuleDB('Comments', true, true))) { return GWF_HTML::err('ERR_MODULE_MISSING', array('Comments')); } if (false === ($news = GWF_News::getByID(Common::getGetString('newsid')))) { return $this->module->error('err_news'); } $key = $news->getCommentsKey(); $gid = GWF_Group::getByName(GWF_Group::MODERATOR)->getID(); if (false === ($comments = GWF_Comments::getOrCreateComments($key, 0, $gid))) { return $this->module->error('err_news'); } $_REQUEST['cmts_id'] = $comments->getID(); $back = ''; if (isset($_POST['reply'])) { return $this->onReply($mod_c, $news, $comments); } return $back . $this->templateComments($mod_c, $news, $comments); }
/** * Get the comments thread. * @return GWF_Comments */ public function getComments() { if (false === ($mod_c = GWF_Module::loadModuleDB('Comments', true, true))) { return false; } return GWF_Comments::getOrCreateComments('_GWF_PBC_' . $this->getID(), $this->getVar('page_author')); }
<h3><?php echo GWF_HTML::display($news['newst_title']); ?> </h3> <div class="cb"></div> </div> <?php #if ($is_staff) { echo '<div class="gwf_newsbox_translate">'.$news->getTranslateSelect().'</div>'; } ?> <?php $more = ''; if ($module->cfgAllowComments()) { if (false !== ($comments = GWF_Module::loadModuleDB('Comments', true, true, true))) { $comments instanceof Module_Comments; $gid = GWF_Group::getByName(GWF_Group::MODERATOR)->getID(); if (false !== ($c = GWF_Comments::getOrCreateComments('_NEWS_ID_' . $news['news_id'], 0, $gid))) { } $c instanceof GWF_Comments; // $more .= '<br/>'.$c->displayMore($tVars['href_comments_more']); // $more .= '<br/>'.$c->displayTopComments(); // $more .= '<br/>'.$c->displayReplyForm($tVars['href_comments_reply']); $more .= '<br/>' . $c->displayMore(); $more .= '<br/>' . $c->displayTopComments(); $more .= '<br/>' . $c->displayReplyForm(); } } ?> <article class="gwf_newsbox_message"><?php echo GWF_Message::display($news['newst_message']) . $more; ?>