本文整理汇总了PHP中CommentModel::getNewThreeComment方法的典型用法代码示例。如果您正苦于以下问题:PHP CommentModel::getNewThreeComment方法的具体用法?PHP CommentModel::getNewThreeComment怎么用?PHP CommentModel::getNewThreeComment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommentModel
的用法示例。
在下文中一共展示了CommentModel::getNewThreeComment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDetails
private function getDetails()
{
if (isset($_GET['id'])) {
parent::__construct($this->_tpl, new ContentModel());
$this->_model->id = $_GET['id'];
if (!$this->_model->getOneContent()) {
Tool::alertBack('警告:不存在此文档!');
}
$_content = $this->_model->getOneContent();
$_comment = new CommentModel();
$_comment->cid = $this->_model->id;
$_tarArr = explode(',', $_content->tag);
if (is_array($_tarArr)) {
foreach ($_tarArr as $_value) {
$_content->tag = str_replace($_value, '<a href="search.php?type=3&inputkeyword=' . $_value . '">' . $_value . '</a>', $_content->tag);
}
}
$this->_tpl->assign('id', $_content->id);
$this->_tpl->assign('titlec', $_content->title);
$this->_tpl->assign('date', $_content->date);
$this->_tpl->assign('source', $_content->source);
$this->_tpl->assign('author', $_content->author);
$this->_tpl->assign('info', $_content->info);
$this->_tpl->assign('tag', $_content->tag);
$this->_tpl->assign('content', Tool::unHtml($_content->content));
$this->getNav($_content->nav);
if (IS_CAHCE) {
$this->_tpl->assign('count', '<script type="text/javascript">getContentCount();</script>');
} else {
$this->_tpl->assign('count', $_content->count);
}
$this->_tpl->assign('comment', $_comment->getCommentTotal());
$_object = $_comment->getNewThreeComment();
if ($_object) {
foreach ($_object as $_value) {
switch ($_value->manner) {
case -1:
$_value->manner = '反对';
break;
case 0:
$_value->manner = '中立';
break;
case 1:
$_value->manner = '支持';
break;
}
if (empty($_value->face)) {
$_value->face = '00.gif';
}
if (!empty($_value->oppose)) {
$_value->oppose = '-' . $_value->oppose;
}
}
}
$this->_tpl->assign('NewThreeComment', $_object);
$this->_model->nav = $_content->nav;
$_object = $this->_model->getMonthNavRec();
$this->setObject($_object);
$this->_tpl->assign('MonthNavRec', $_object);
$_object = $this->_model->getMonthNavHot();
$this->setObject($_object);
$this->_tpl->assign('MonthNavHot', $_object);
$_object = $this->_model->getMonthNavPic();
$this->setObject($_object);
$this->_tpl->assign('MonthNavPic', $_object);
} else {
Tool::alertBack('警告:非法操作!');
}
}
示例2: getDetails
private function getDetails()
{
if (isset($_GET['id'])) {
parent::__construct($this->_tpl, new ContentModel());
$this->_model->id = $_GET['id'];
if (!$this->_model->setContentCount()) {
Tool::alertBack('article not existing');
}
$_content = $this->_model->getOneContent();
$_comment = new CommentModel();
$_comment->cid = $this->_model->id;
$this->_tpl->assign('id', $_content->id);
$this->_tpl->assign('titlec', $_content->title);
$this->_tpl->assign('date', $_content->date);
$this->_tpl->assign('source', $_content->source);
$this->_tpl->assign('author', $_content->author);
$this->_tpl->assign('info', $_content->info);
$this->_tpl->assign('tag', $_content->tag);
$this->_tpl->assign('content', Tool::unHtml($_content->content));
$this->getNav($_content->nav);
if (IS_CACHE) {
$this->_tpl->assign('count', '<script>getContentCount();</script>');
} else {
$this->_tpl->assign('count', $_content->count);
}
$this->_tpl->assign('comment', $_comment->getCommentTotal());
$_object = $_comment->getNewThreeComment();
if ($_object) {
foreach ($_object as $_value) {
switch ($_value->manner) {
case -1:
$_value->manner = 'disagree';
break;
case 0:
$_value->manner = 'no opinion';
break;
case 1:
$_value->manner = 'agree';
break;
}
if (empty($_value->face)) {
$_value->face = '00.png';
}
if (!empty($_value->oppose)) {
$_value->oppose = '-' . $_value->oppose;
}
}
}
$this->_tpl->assign('NewThreeComment', $_object);
$this->_model->nav = $_content->nav;
$_object = $this->_model->getMonthNavRec();
$this->setObject($_object);
$this->_tpl->assign('MonthNavRec', $_object);
$_object = $this->_model->getMonthNavHot();
$this->setObject($_object);
$this->_tpl->assign('MonthNavHot', $_object);
$_object = $this->_model->getMonthNavPic();
$this->setObject($_object);
$this->_tpl->assign('MonthNavPic', $_object);
} else {
Tool::alertBack('illegal act');
}
}