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


PHP WoW::m_filters方法代碼示例

本文整理匯總了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);
 }
開發者ID:Kheros,項目名稱:wowhead,代碼行數:101,代碼來源:class.wow.php


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