当前位置: 首页>>代码示例>>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;未经允许,请勿转载。