本文整理汇总了PHP中Answer::getSpecialCategory方法的典型用法代码示例。如果您正苦于以下问题:PHP Answer::getSpecialCategory方法的具体用法?PHP Answer::getSpecialCategory怎么用?PHP Answer::getSpecialCategory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Answer
的用法示例。
在下文中一共展示了Answer::getSpecialCategory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: answerCategoryOtherSection
function answerCategoryOtherSection(&$catView, &$r)
{
global $wgUser;
if (empty($catView->answers)) {
return true;
}
$ti = htmlspecialchars($catView->title->getText());
$cat = $catView->getCat();
$r .= "<table style=\"width: 100%\"><tr>";
if (!empty($catView->answers["answered_questions"])) {
$r .= "<td style=\"width: 50%; vertical-align: top\">\n";
$r .= "<div id=\"mw-pages\">\n";
$r .= "<h2>" . Answer::getSpecialCategory("answered") . "</h2>";
$r .= wfMsgExt('answers-category-count-answered', array('parsemag'), count($catView->answers['answered_questions']));
$r .= "<ul>\n";
foreach ($catView->answers["answered_questions"] as $q) {
$r .= "<li>{$q}</li>\n";
}
$r .= "</ul>\n";
$r .= "</div>\n";
$r .= "</td>\n";
}
if (!empty($catView->answers["unanswered_questions"])) {
$r .= "<td style=\"width: 50%; vertical-align: top\">\n";
$r .= "<div id=\"mw-pages\">\n";
$r .= "<h2>" . str_replace("-", "", Answer::getSpecialCategory("unanswered")) . "</h2>";
$r .= wfMsgExt('answers-category-count-unanswered', array('parsemag'), count($catView->answers['unanswered_questions']));
$r .= "<ul>\n";
foreach ($catView->answers["unanswered_questions"] as $q) {
$r .= "<li>{$q}</li>\n";
}
$r .= "</ul>\n";
$r .= "</div>\n";
$r .= "</td>\n";
}
$r .= "</tr></table>\n";
/*
$dbcnt = $cat->getPageCount() - $cat->getSubcatCount() - $cat->getFileCount();
$rescnt = count( $catView->answers );
if( $rescnt > 0 ) {
$r = "<div id=\"mw-pages\">\n";
$r .= '<h2>' . wfMsg( "blog-header", $ti ) . "</h2>\n";
$r .= $catView->formatList( $catView->blogs, $catView->blogs_start_char );
$r .= "\n</div>";
}
*/
return true;
}
示例2: wfWikiAnswersAnswerBox
/**
* @param OutputPage $out
* @param string $html
* @return bool
*/
function wfWikiAnswersAnswerBox(&$out, &$html)
{
$answerObj = Answer::newFromTitle($out->getTitle());
if ($answerObj->isQuestion() && in_array(ucfirst(Answer::getSpecialCategory("unanswered")), $out->getCategories())) {
$html = F::app()->getView('WikiAnswers', 'AnswerBox')->render();
}
return true;
}