本文整理匯總了PHP中WoW::m_filters方法的典型用法代碼示例。如果您正苦於以下問題:PHP WoW::m_filters方法的具體用法?PHP WoW::m_filters怎麽用?PHP WoW::m_filters使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WoW
的用法示例。
在下文中一共展示了WoW::m_filters方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: InitFilters
//.........這裏部分代碼省略.........
$filter_filters .= $filterKey . '=';
$max = count($filterValue);
$current = 1;
foreach ($filterValue as $val) {
if ($val === null) {
continue;
}
$filter_filters .= $val;
if ($current < $max) {
$filter_filters .= ':';
}
}
$filter_filters .= ';';
} elseif ($filterValue !== null) {
$filter_filters .= $filterKey . '=' . $filterValue . ';';
}
}
$filter_filters = str_replace(array(':;', '=;'), ';', $filter_filters);
WoW::RedirectTo(self::GetPageAction() . '?filter=' . $filter_filters);
}
/*
COMMON FILTERS:
[na] => Name
[si] => Side (1 - Alliance, -1 - Alliance only, 2 - Horde, -2 - Horde only, 3 - both)
[cr] => CommonFilterID
[crs] => FirstFilterValID
[crv] => SecondFilterValID
ITEM FILTERS:
[sl] => SlotID
[qu] => QualityID
[minle] => MinItemLevel
[maxle] => MaxItemLevel
[minrl] => MinRequiredLevel
[maxrl] => MaxRequiredLevel
[ub] => UseableClassID
[gt] => GetTypes
ACHIEVEMENTS FILTERS:
[minpt] => Min Points
[maxpt] => Max Points
QUESTS FILTERS:
[minle] => MinQuestLevel
[maxle] => MaxQuestLevel
SPELLS FILTERS:
[me] => MechanicID
[dt] => DispellTypeID
[sc] => SpellSchoolID
[ra] => RaceID
NPCS FILTERS:
[ra] => ReactionAlliance
[rh] => ReactionHorde
[fa] => FamilyID
[cl] => ClassificationID
ITEMSET FILTERS:
[ta] => ItemsetTag
[ty] => ItemInventoryTypeID
*/
//WoW_Template::SetPageIndex('filters');
if (!isset($_GET['filter'])) {
return false;
}
// Try to explode
$filter_items = explode(';', $_GET['filter']);
if (!$filter_items) {
return false;
}
$filter = array();
$advanced_filters = array();
$nextId = 0;
foreach ($filter_items as $item) {
$current = explode('=', $item);
if (!$current || !isset($current[1])) {
continue;
}
$each = explode(':', $current[1]);
if ($each) {
$temp = array('key' => $current[0], 'values' => array());
if (in_array($current[0], array('cr', 'crv', 'crs'))) {
$advanced_filters[$current[0]] = array('key' => $current[0], 'values' => array());
}
foreach ($each as $value) {
if ($value !== null) {
$temp['values'][] = $value;
}
if (in_array($current[0], array('cr', 'crv', 'crs')) && !empty($value)) {
$advanced_filters[$current[0]]['values'][] = $value;
}
}
} else {
$temp = array('key' => $current[0], 'values' => $current[1]);
if (in_array($current[0], array('cr', 'crv', 'crs'))) {
$advanced_filters[$current[0]] = array('key' => $current[0], 'values' => array($current[1]));
}
}
++$nextId;
$filter[] = $temp;
}
WoW_Template::SetPageData('advanced_filters', $advanced_filters);
self::$m_filters = $filter;
unset($filter, $item);
}