當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Answer::newFromTitle方法代碼示例

本文整理匯總了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;
}
開發者ID:yusufchang,項目名稱:app,代碼行數:31,代碼來源:Answers.php

示例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;
}
開發者ID:Tjorriemorrie,項目名稱:app,代碼行數:13,代碼來源:WikiAnswers.php


注:本文中的Answer::newFromTitle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。