本文整理汇总了PHP中SearchForm::getSearchServerQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP SearchForm::getSearchServerQuery方法的具体用法?PHP SearchForm::getSearchServerQuery怎么用?PHP SearchForm::getSearchServerQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SearchForm
的用法示例。
在下文中一共展示了SearchForm::getSearchServerQuery方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wfSpecialSearch
/**
* Called to display the Special:Search page
*
* @param unknown_type $par
* @param unknown_type $specialPage
*/
function wfSpecialSearch($par = NULL, $specialPage)
{
global $wgOut, $wgRequest, $wgScriptPath, $wrSidebarHtml;
$searchForm = new SearchForm();
// read query parameters into variables
$searchForm->readQueryParms($par);
// check if we should redirect to a specific page
$redirTitle = $searchForm->getRedirTitle();
if ($redirTitle) {
$wgOut->redirect($redirTitle->getFullURL());
return;
}
$wgOut->setPageTitle($searchForm->target ? 'Search for possible matches' : 'Search WeRelate');
$wgOut->addScript("<script type=\"text/javascript\" src=\"{$wgScriptPath}/search.31.js\"></script>");
$wgOut->addScript("<script type=\"text/javascript\" src=\"{$wgScriptPath}/autocomplete.10.js\"></script>");
// construct query to send to server
$errMsg = $searchForm->validateQuery();
$searchServerQuery = '';
if (!$errMsg) {
$searchServerQuery = $searchForm->getSearchServerQuery($par);
}
$formHtml = $searchForm->getFormHtml();
if ($searchServerQuery || $errMsg) {
if ($errMsg) {
$sideText = '';
$errMsg = htmlspecialchars($errMsg);
$results = "<p><font color=\"red\">{$errMsg}</font></p>";
} else {
list($sideText, $results) = $searchForm->getSearchResultsHtml($searchServerQuery);
}
$wrSidebarHtml = "<div id=\"wr-search-sidebar\">{$sideText}</div>";
$wgOut->addHTML(<<<END
<p>{$formHtml}</p>
{$results}
END
);
} else {
$sideText = $searchForm->getStatsHtml();
$endText = wfMsgWikiHtml('searchend');
$wrSidebarHtml = "<div id=\"wr-search-sidebar\">{$sideText}</div>";
$wgOut->addHTML(<<<END
<p>{$formHtml}</p><p> </p>
{$endText}
END
);
}
}