private function onReply(Module_Comments $mod_c, GWF_News $news, GWF_Comments $comments) { $ipp = 10; $nItems = $comments->getVar('cmts_count'); $nPages = GWF_PageMenu::getPagecount($ipp, $nItems); $page = Common::clamp(Common::getGetInt('cpage'), 1, $nPages); $href = GWF_WEB_ROOT . 'news-comments-' . $news->getID() . '-' . $news->displayTitle() . '-page-' . $page . '.html'; $me = $mod_c->getMethod('Reply'); $me instanceof Comments_Reply; return $me->onReply($href); }
public function validate_cmts_id($arg, $check_enabled) { if (false === ($comments = GWF_Comments::getByID($arg))) { return $this->lang('err_comments'); } if ($check_enabled && !$comments->isEnabled()) { return $this->lang('err_disabled'); } return false; }
public function sanitize($check_enabled = true) { if ('' === ($cmts_id = Common::getGetString('cmts_id'))) { return $this->module->error('err_comments'); } if (false === ($c = GWF_Comments::getByID($cmts_id))) { return $this->module->error('err_comments'); } if ($check_enabled) { if (!$c->isEnabled()) { return $this->module->error('err_disabled'); } } $this->comments = $c; return false; }
/** * 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')); }
/** * Get the comments thread for this comment. * @return GWF_Comments */ public function getComments() { return GWF_Comments::getByID($this->getVar('cmt_cid')); }
<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; ?>