本文整理汇总了PHP中Answer::newFromTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Answer::newFromTitle方法的具体用法?PHP Answer::newFromTitle怎么用?PHP Answer::newFromTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Answer
的用法示例。
在下文中一共展示了Answer::newFromTitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fnAddAnswerJSGlobalVariables
function fnAddAnswerJSGlobalVariables(array &$vars)
{
global $wgTitle, $wgContLang;
$vars['wgAskFormTitle'] = wfMsgForContent("ask_a_question");
$vars['wgAskFormCategory'] = wfMsgForContent("in_category");
$vars['wgAnswerMsg'] = wfMsg("answer_title");
$vars['wgRenameMsg'] = wfMsg("movepagebtn");
$vars['wgDeleteMsg'] = wfMsg("delete");
$vars['wgSaveMsg'] = wfMsg("save");
$vars['wgCategorizeMsg'] = wfMsg("categorize");
$vars['wgCategorizeHelpMsg'] = wfMsg("categorize_help");
$vars['wgNextPageMsg'] = wfMsg("next_page");
$vars['wgPrevPageMsg'] = wfMsg("prev_page");
$vars['wgMoreMsg'] = wfMsg("more");
$vars['wgActionPanelTitleMsg'] = wfMsg("quick_action_panel");
$vars['wgIsQuestion'] = Answer::newFromTitle($wgTitle)->isQuestion();
$vars['wgIsAnswered'] = Answer::newFromTitle($wgTitle)->isArticleAnswered();
$vars['wgAnsweredCategory'] = Answer::getSpecialCategory("answered");
$vars['wgUnAnsweredCategory'] = Answer::getSpecialCategory("unanswered");
$vars['wgAdsByGoogleMsg'] = wfMsg("ads_by_google");
$vars['wgUnansweredRecentChangesURL'] = htmlspecialchars(SpecialPage::getTitleFor('RecentChangesLinked')->getFullURL()) . "/" . Title::makeTitle(NS_CATEGORY, Answer::getSpecialCategory("unanswered"))->getPrefixedText();
$vars['wgUnansweredRecentChangesText'] = wfMsg("see_all");
$vars['wgCategoryName'] = $wgContLang->getNsText(NS_CATEGORY);
global $wgMinimalPasswordLength;
$vars['wgMinimalPasswordLength'] = $wgMinimalPasswordLength;
global $wgIsMainpage;
$vars['wgIsMainpage'] = $wgIsMainpage ? $wgIsMainpage : false;
global $wgAnswersRecentUnansweredQuestionsLimit;
$vars["recent_questions_limit"] = $wgAnswersRecentUnansweredQuestionsLimit ? $wgAnswersRecentUnansweredQuestionsLimit : HomePageList::RECENT_UNANSWERED_QUESTIONS_LIMIT;
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;
}