本文整理汇总了PHP中search::initiateQueryParameters方法的典型用法代码示例。如果您正苦于以下问题:PHP search::initiateQueryParameters方法的具体用法?PHP search::initiateQueryParameters怎么用?PHP search::initiateQueryParameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类search
的用法示例。
在下文中一共展示了search::initiateQueryParameters方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCombinedSearch
public static function getCombinedSearch()
{
$wid = "os_main";
// --------------------
// -- Assemble array with analyzed query data from GPC string
// --> $_SESSION["searchConfig"]
// --> $GLOBALS["nw_categories"]
// --> $GLOBALS["qry"]
// --> $GLOBALS["ctg"]
// --> $GLOBALS["QUERY"]
// --------------------
search::initiateQueryParameters();
// --------------------
// -- Obtain results for page and people searches:
// --------------------
$pageResult = search::getPageSearch();
$peopleResult = functions::callMethod('people', 'lib/people', 'getPeopleArray', 'search');
/* BUGFIX needed while maildb and EA databases are incomplete */
if (!empty($peopleResult)) {
foreach ($peopleResult as $usr => $record) {
if (!isset($record["nw_status"]) || strtolower($record["nw_status"]) != "active") {
unset($peopleResult[$usr]);
}
}
}
/* end BUGFIX */
// --------------------
// -- Output form and search results:
// --------------------
return search::outputCombinedSearch($GLOBALS["QUERY"], $pageResult, $peopleResult, $wid);
}
示例2: getPeopleArrayData
public static function getPeopleArrayData($searchVariant = "multiple", $mUser = FALSE, $mStatus = "active", $mInstitute = "NOR", $stopOnError = IS_TESTSERVER, $sourceDb = PEOPLE_DATA_SOURCE_DB, $startdate = "", $enddate = "")
{
$userarray = array();
if (empty($sourceDb)) {
$sourceDb = PEOPLE_DATA_SOURCE_DB;
}
// --------------------
// DETERMINE SOURCE OF PEOPLE DATA
// PEOPLE_DATA_SOURCE_DB = ["maildb"|"ea"], set in 'config.php'
// Currently maildb, but should be E&A
// --> $GLOBALS["peopleClass"]
// --------------------
//if (!isset($GLOBALS["peopleClass"]))
self::loadClass($sourceDb);
//DEBUG:
// self::loadClass("ea");
// self::loadClass("maildb");
// --------------------
// START TIMER
// --------------------
functions::timerStart("peopleSearch");
// ---------------------------------------------------------------------------
// SELECT APPROPRIATE SQL QUERY
// If $searchVariant='user', only the record for user $u is selected.
// --> $sql
// ---------------------------------------------------------------------------
switch ($searchVariant) {
case "multiple":
$mUser = FALSE;
$sql = $GLOBALS["peopleClass"]->getSqlForUserRegexp(FALSE, $mStatus, $mInstitute, $startdate, $enddate);
break;
case "user":
$sql = $GLOBALS["peopleClass"]->getSqlForUserMatch($mUser, $mStatus, $mInstitute);
break;
case "search":
if (!isset($GLOBALS["QUERY"])) {
search::initiateQueryParameters();
}
if (!count($GLOBALS["QUERY"]["terms"])) {
return "";
}
$sql = $GLOBALS["peopleClass"]->getSqlForUserSearch($GLOBALS["QUERY"], $mStatus, $mInstitute);
break;
case "employment":
$sql = $GLOBALS["peopleClass"]->getSqlForEmployment($mUser, $startdate, $enddate);
break;
default:
$sql = "";
}
// --------------------
// OBTAIN DATA FROM DATABASE
// --> $userarray
// --------------------
$rawuserarray = $GLOBALS["peopleClass"]->fetchRawUserArray($sql, $stopOnError);
//DESPERATE BUGFIX--
if ($searchVariant == "user" && count($rawuserarray) > 1) {
foreach ($rawuserarray as $key => $data) {
if (!in_array($mUser, array($key, $data["user"]))) {
unset($rawuserarray[$key]);
}
}
}
//BUGFIX--; remove once maildb phased out
/*
include PATH_DATA . "/adhoc_maildb_data.php"; // --> $maildb[]
foreach ($maildb as $user => $record) {
if (($record["status"]==$mStatus) && ($record["institution"]==$mInstitute)) {
switch ($searchVariant) {
case "all":
$rawuserarray[$user] = $record;
break;
case "user":
if ($user==$mUser) $rawuserarray[$user] = $record;
break;
case "search":
//TODO
break;
}
}
}
*/
//--end BUGFIX
if (!empty($rawuserarray)) {
$userarray = $GLOBALS["peopleClass"]->adaptRawUserArray($rawuserarray, $mStatus);
}
// --------------------
// STOP TIMER
// --------------------
functions::timerStop("peopleSearch");
// --------------------
if (IS_TESTSERVER) {
echo "<p>In getPeopleArrayData</p>";
debug::rr($userarray);
}
return $userarray;
}
示例3: array
$ctemp = array();
foreach (array("Main","Guests","Organizers","Nordic","Intranet","Newstaff","Administrators","Board") as $mycat) {
$key = array_search($mycat,$_SDATA["categories"]);
if ($key !== false) {
$ctemp[] = $mycat;
unset($_SDATA["categories"][$key]);
}
}
$_SDATA["categories"] = array_merge($ctemp,$_SDATA["categories"]);
*/
// --------------------
// -- Assemble array with analyzed query data from GPC string
// --> $GLOBALS["QUERY"]
// --------------------
$GLOBALS["nw_categories"] = search::initiateCategories($_DDATA["tablename"]);
search::initiateQueryParameters();
$GLOBALS["QUERY"] = search::analyzeQuery($GLOBALS["qry"], $GLOBALS["ctg"]);
/*
// --------------------
// -- Create cagegory GPC variable if it was not sent
// --> $_REQUEST['ctg']
// --------------------
$_REQUEST['ctg'] = (isset($_REQUEST['ctg'])) ?
$_REQUEST['ctg']
: ( (in_array(ucfirst(SUBSITE),$_SDATA["categories"])) ? ucfirst(SUBSITE) : "" );
if (!in_array($_REQUEST['ctg'], $_SDATA["categories"])) $_REQUEST['ctg'] = "";
*/
// --------------------
// -- Trim cache size if it is time to do so; otherwise mail query statistics if this is requested.