• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Armory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Armory的典型用法代码示例。如果您正苦于以下问题:PHP Armory类的具体用法?PHP Armory怎么用?PHP Armory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Armory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: LoadTemplate

 public static function LoadTemplate($template_name, $overall = false)
 {
     if ($overall) {
         $template = __ARMORYDIRECTORY__ . '/admin/template/overall/overall_' . $template_name . '.php';
     } else {
         $template = __ARMORYDIRECTORY__ . '/admin/template/' . $template_name . '.php';
     }
     if (file_exists($template)) {
         include $template;
     } else {
         Armory::Log()->writeError('%s : unable to find template "%s" (template theme: %s, overall: %d, path: %s)!', __METHOD__, $template_name, self::GetTemplateTheme(), (int) $overall, $template);
     }
 }
开发者ID:DizKragnet,项目名称:wowarmory,代码行数:13,代码来源:class.template.php


示例2: BuildOpposingTeamList

 /**
  * Build opponents list for current arena team
  * @category Arenateams class
  * @access   public
  * @return   array
  **/
 public function BuildOpposingTeamList()
 {
     if (!$this->arenateamid) {
         Armory::Log()->writeError('%s : arenateamid not provided', __METHOD__);
         return false;
     }
     $game_ids = Armory::$cDB->select("SELECT DISTINCT `gameid` FROM `armory_game_chart` WHERE `teamid`=%d", $this->arenateamid);
     if (!$game_ids) {
         Armory::Log()->writeLog('%s : unable to find any game for teamId %d', __METHOD__, $this->arenateamid);
         return false;
     }
     $all_games = array();
     $counter = count($game_ids);
     foreach ($game_ids as $game) {
         $all_games[] = $game['gameid'];
     }
     $game_chart = Armory::$cDB->select("\n        SELECT\n        `armory_game_chart`.`gameid`,\n        `armory_game_chart`.`teamid`,\n        `armory_game_chart`.`guid`,\n        COUNT(`armory_game_chart`.`teamid`) AS `countTeam`,\n        `arena_team`.`name`,\n        `arena_team`.`type`\n        FROM `armory_game_chart` AS `armory_game_chart`\n        LEFT JOIN `arena_team` AS `arena_team` ON `arena_team`.`arenateamid`=`armory_game_chart`.`teamid`\n        WHERE `armory_game_chart`.`gameid` IN (%s) AND `armory_game_chart`.`teamid` <> %d\n        GROUP BY `armory_game_chart`.`gameid`", $all_games, $this->arenateamid);
     if (!$game_chart) {
         Armory::Log()->writeError('%s : game_ids were fetched from DB, but script was unable to get data for these matches from characters DB (arenateamid:%d)', __METHOD__, $this->arenateamid);
         return false;
     }
     $chart_data = array();
     foreach ($game_chart as $team) {
         if (!isset($chart_data[$team['teamid']])) {
             // Do not add same teams more than 1 time
             $rating_change = Armory::$cDB->select("SELECT `gameid`, `changeType`, `ratingChange` FROM `armory_game_chart` WHERE `teamid`=%d AND `gameid` IN (%s)", $team['teamid'], $all_games);
             $rd = 0;
             if ($rating_change) {
                 $exists = array();
                 foreach ($rating_change as $rCh) {
                     if (!isset($exists[$rCh['gameid']])) {
                         if ($rCh['changeType'] == 1) {
                             $rd += $rCh['ratingChange'];
                         } else {
                             $rd -= $rCh['ratingChange'];
                         }
                         $exists[$rCh['gameid']] = true;
                     }
                 }
             }
             $losses = Armory::$cDB->selectCell("SELECT COUNT(distinct(`gameid`)) FROM `armory_game_chart` WHERE `changeType`=1 AND `teamid`='%d' AND `gameid` IN (%s)", $team['teamid'], $all_games);
             $wins = Armory::$cDB->selectCell("SELECT COUNT(distinct(`gameid`)) FROM `armory_game_chart` WHERE `changeType`=2 AND `teamid`='%d' AND `gameid` IN (%s)", $team['teamid'], $all_games);
             $chart_data[$team['teamid']] = array('deleted' => $this->TeamExists($team['teamid']) ? 'false' : 'true', 'games' => $losses + $wins, 'losses' => $losses, 'rd' => $rd, 'realm' => Armory::$currentRealmInfo['name'], 'teamName' => $team['name'], 'teamUrl' => sprintf("r=%s&ts=%d&t=%s", urlencode(Armory::$currentRealmInfo['name']), $team['type'], urlencode($team['name'])), 'wins' => $wins);
             $chart_data[$team['teamid']]['winPer'] = Utils::GetPercent($chart_data[$team['teamid']]['games'], $chart_data[$team['teamid']]['wins']);
         }
     }
     return $chart_data;
 }
开发者ID:saqar,项目名称:WoW-Armory,代码行数:54,代码来源:class.arenateams.php


示例3: GetRandomSuffixData

 /**
  * @return array
  **/
 public function GetRandomSuffixData()
 {
     if ($this->m_server != SERVER_MANGOS) {
         Armory::Log()->writeError('%s : this method is usable with MaNGOS servers only.', __METHOD__);
         return false;
     }
     return array($this->GetUInt32Value(ITEM_FIELD_ENCHANTMENT_8_1), $this->GetUInt32Value(ITEM_FIELD_ENCHANTMENT_9_1), $this->GetUInt32Value(ITEM_FIELD_ENCHANTMENT_10_1));
 }
开发者ID:Lankytim,项目名称:wowarmory,代码行数:11,代码来源:class.item.php


示例4: die

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 **/
if (!defined('__ARMORY__')) {
    die('Direct access to this file not allowed!');
}
session_start();
if (!@(include 'classes/class.armory.php')) {
    die('<b>Error:</b> unable to load Armory class!');
}
if (!@(include 'revision_nr.php')) {
    die('<b>Error:</b> unable to load revision_nr.php!');
}
$_SESSION['last_url'] = str_replace('.php', '.xml', $_SERVER['PHP_SELF']) . '?' . str_replace('locale=', 'l=', $_SERVER['QUERY_STRING']);
$armory = new Armory();
/* Check DbVersion */
$dbVersion = $armory->aDB->selectCell("SELECT `version` FROM `ARMORYDBPREFIX_db_version`");
if ($dbVersion != DB_VERSION) {
    if (!$dbVersion) {
        if (isset($armory->armoryconfig['checkVersionType']) && $armory->armoryconfig['checkVersionType'] == 'log') {
            $armory->Log()->writeError('ArmoryChecker: wrong Armory DB name!');
        } else {
            echo '<b>Fatal error</b>: wrong Armory DB name<br/>';
        }
    }
    $errorDBVersion = sprintf('Current version is %s but expected %s.<br />
    Apply all neccessary updates from \'sql/updates\' folder and refresh this page.', $dbVersion ? "'" . $dbVersion . "'" : 'not defined', "'" . DB_VERSION . "'");
    if (isset($armory->armoryconfig['checkVersionType']) && $armory->armoryconfig['checkVersionType'] == 'log') {
        $armory->Log()->writeError('ArmoryChecker : DB_VERSION error: %s', defined('DB_VERSION') ? $errorDBVersion : 'DB_VERSION constant not defined!');
    } else {
开发者ID:Wisher,项目名称:wowarmory,代码行数:31,代码来源:armory_loader.php


示例5: define

 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 **/
define('__ARMORY__', true);
if (!@(include 'includes/armory_loader.php')) {
    die('<b>Fatal error:</b> unable to load system files.');
}
header('Content-type: text/xml');
$page_element = array('globalSearch' => 1, 'lang' => Armory::GetLocale(), 'requestUrl' => 'login-status.xml');
$xml->XMLWriter()->startElement('page');
foreach ($page_element as $page_key => $page_value) {
    $xml->XMLWriter()->writeAttribute($page_key, $page_value);
}
$xml->XMLWriter()->startElement('loginStatus');
if (isset($_SESSION['username'])) {
    $xml->XMLWriter()->writeAttribute('username', $_SESSION['username']);
} else {
    $xml->XMLWriter()->writeAttribute('username', null);
}
$xml->XMLWriter()->endElement();
//loginStatus
$xml->XMLWriter()->endElement();
//page
echo $xml->StopXML();
开发者ID:Lankytim,项目名称:wowarmory,代码行数:31,代码来源:login-status.php


示例6: GetServerTypeByString

 /**
  * Returns server type ID
  * @category Utils class
  * @access   public
  * @param    string $server
  * @return   int
  **/
 public function GetServerTypeByString($server)
 {
     $server = strtolower($server);
     if ($server == 'mangos') {
         return SERVER_MANGOS;
     } elseif ($server == 'trinity') {
         return SERVER_TRINITY;
     }
     Armory::Log()->writeError('%s : unsupported server type ("%s")!', __METHOD__, $server);
     return UNK_SERVER;
 }
开发者ID:Lankytim,项目名称:wowarmory,代码行数:18,代码来源:class.utils.php


示例7: define

 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 **/
define('__ARMORY__', true);
define('__ARMORYDIRECTORY__', dirname(dirname(__FILE__)));
if (!@(include __ARMORYDIRECTORY__ . '/includes/classes/class.armory.php')) {
    die('<b>Error:</b> unable to load Armory class!');
}
$update_type = 'echo';
// Change to 'echo' to show query in you browser. Or choose 'update' to execute all queries directly to DB.
Armory::InitializeArmory();
echo '<title>World of Warcraft Armory</title>';
$check_builded = Armory::$aDB->selectCell("SELECT `loot_builded` FROM `ARMORYDBPREFIX_db_version`");
if ($check_builded === 1) {
    die("You've already builded loot tables for bosses. If you want to re-build list, change field `loot_builded` to 0 in `armory_db_version` table: <br /><code>UPDATE `armory_db_version` SET `loot_builded`=0;</code>");
}
// Select all ids
$instance_data = Armory::$aDB->select("SELECT `id`, `name_id`, `type` FROM `ARMORYDBPREFIX_instance_data`");
if (!$instance_data) {
    die('Error: can not find any boss data!');
}
foreach ($instance_data as $data) {
    switch ($data['type']) {
        case 'npc':
            if (isset($data['name_id']) && $data['name_id'] > 0) {
                $data['id'] = $data['name_id'];
开发者ID:DizKragnet,项目名称:wowarmory,代码行数:31,代码来源:build_loot_tables.php


示例8: die

    if (!(include __ARMORYDIRECTORY__ . '/includes/classes/class.arenateams.php')) {
        die('<b>Error:</b> unable to load arenateams class!');
    }
    $arenateams = new Arenateams();
}
if (defined('load_search_class')) {
    if (!(include __ARMORYDIRECTORY__ . '/includes/classes/class.search.php')) {
        die('<b>Error:</b> unable to load search engine class!');
    }
    $search = new SearchMgr();
}
if (defined('load_itemprototype_class')) {
    if (!(include __ARMORYDIRECTORY__ . '/includes/classes/class.itemprototype.php')) {
        die('<b>Error:</b> unable to load ItemPrototype class!');
    }
    // Do not create class instance here. It should be created in Characters or Items classes.
}
if (defined('load_item_class')) {
    if (!(include __ARMORYDIRECTORY__ . '/includes/classes/class.item.php')) {
        die('<b>Error:</b> unable to load Item class!');
    }
    // Do not create class instance here. It should be created in Characters or Items classes.
}
// Start XML parser
if (!(include __ARMORYDIRECTORY__ . '/includes/classes/class.xmlhandler.php')) {
    die('<b>Error:</b> unable to load XML Handler class!');
}
$xml = new XMLHandler(Armory::GetLocale());
if (!defined('RSS_FEED')) {
    $xml->StartXML();
}
开发者ID:saqar,项目名称:WoW-Armory,代码行数:31,代码来源:armory_loader.php


示例9: foreach

    $xml->XMLWriter()->writeAttribute('name', Armory::$aDB->selectCell("SELECT `name_" . Armory::GetLocale() . "` FROM `ARMORYDBPREFIX_petcalc` WHERE `id` < 0 AND `key`='tenacity'"));
    $xml->XMLWriter()->writeAttribute('order', 1);
    $pet_tenacity = $utils->GetPetTalentCalculatorData('tenacity');
    foreach ($pet_tenacity as $tenacity) {
        $xml->XMLWriter()->startElement('family');
        foreach ($tenacity as $tenacity_key => $tenacity_value) {
            $xml->XMLWriter()->writeAttribute($tenacity_key, $tenacity_value);
        }
        $xml->XMLWriter()->endElement();
        //family
    }
    $xml->XMLWriter()->endElement();
    //petTalentTab
    $xml->XMLWriter()->startElement('petTalentTab');
    $xml->XMLWriter()->writeAttribute('key', 'Ferocity');
    $xml->XMLWriter()->writeAttribute('name', Armory::$aDB->selectCell("SELECT `name_" . Armory::GetLocale() . "` FROM `ARMORYDBPREFIX_petcalc` WHERE `id` < 0 AND `key`='ferocity'"));
    $xml->XMLWriter()->writeAttribute('order', 0);
    $pet_ferocity = $utils->GetPetTalentCalculatorData('ferocity');
    foreach ($pet_ferocity as $ferocity) {
        $xml->XMLWriter()->startElement('family');
        foreach ($ferocity as $ferocity_key => $ferocity_value) {
            $xml->XMLWriter()->writeAttribute($ferocity_key, $ferocity_value);
        }
        $xml->XMLWriter()->endElement();
        //family
    }
    $xml->XMLWriter()->endElement();
    //petTalentTab
}
$xml->XMLWriter()->endElement();
//talentTabs or petTalentTabs
开发者ID:Lankytim,项目名称:wowarmory,代码行数:31,代码来源:talent-calc.php


示例10: SetLocale

 /**
  * Sets locale
  * @category Armory class
  * @access   public
  * @return   bool
  **/
 public static function SetLocale($locale, $locale_id)
 {
     self::$_locale = $locale;
     self::$_loc = $locale_id;
     return true;
 }
开发者ID:saqar,项目名称:WoW-Armory,代码行数:12,代码来源:class.armory.php


示例11: _query

 protected function _query($safe_sql, $queryType)
 {
     // Execute query and calculate execution time
     $make_array = array();
     $query_start = microtime(true);
     $this->queryCount++;
     $performed_query = mysql_query($safe_sql, $this->connectionLink);
     if (!$performed_query) {
         if (!$this->disableNextError) {
             Armory::Log()->writeLog('%s : unable to execute SQL query (%s). MySQL error: %s', __METHOD__, $safe_sql, mysql_error($this->connectionLink) ? sprintf('"%s" (Error #%d)', mysql_error($this->connectionLink), mysql_errno($this->connectionLink)) : 'none');
         }
         if ($this->disableNextError) {
             $this->disableNextError = false;
         }
         return false;
     }
     $result = false;
     switch ($queryType) {
         case QueryType::SINGLE_CELL:
             $row = mysql_fetch_row($performed_query);
             $result = $row[0];
             break;
         case QueryType::SINGLE_ROW:
             $result = mysql_fetch_assoc($performed_query);
             if (is_array($result)) {
                 foreach ($result as $rKey => $rValue) {
                     if (is_string($rKey)) {
                         $make_array[$rKey] = $rValue;
                     }
                 }
                 $result = $make_array;
             }
             break;
         case QueryType::MULTIPLY_ROW:
             $result = array();
             while ($_result = mysql_fetch_assoc($performed_query)) {
                 if (is_array($_result)) {
                     foreach ($_result as $rKey => $rValue) {
                         if (is_string($rKey)) {
                             $make_array[$rKey] = $rValue;
                         }
                     }
                     $result[] = $make_array;
                 } else {
                     $result[] = $_result;
                 }
             }
             break;
         case QueryType::OBJECT_QUERY:
             $result = array();
             while ($_result = mysql_fetch_object($performed_query)) {
                 $result[] = $_result;
             }
             break;
         case QueryType::SQL_QUERY:
             $result = true;
             break;
         default:
             $result = false;
             break;
     }
     $query_end = microtime(true);
     $queryTime = round($query_end - $query_start, 4);
     Armory::Log()->writeSql('[%s ms]: %s', $queryTime, $safe_sql);
     $this->queryTimeGeneration += $queryTime;
     return $result;
 }
开发者ID:Lankytim,项目名称:wowarmory,代码行数:67,代码来源:class.mysqlClient.php


示例12: array

$xml->LoadXSLT('items/info.xsl');
$xml->XMLWriter()->startElement('page');
$xml->XMLWriter()->writeAttribute('globalSearch', 1);
$xml->XMLWriter()->writeAttribute('lang', Armory::GetLocale());
$xml->XMLWriter()->writeAttribute('requestUrl', 'item-info.xml');
$xml->XMLWriter()->writeAttribute('requestQuery', 'i=' . $itemID);
if (!$items->IsItemExists($itemID)) {
    $xml->XMLWriter()->startElement('itemInfo');
    $xml->XMLWriter()->endElement();
    //itemInfo
    echo $xml->StopXML();
    exit;
}
// Do not query all rows - item data generated by item-tooltip.php
$data = $items->GetItemData($itemID);
$item_data = array('icon' => $items->GetItemIcon($itemID, $data['displayid']), 'id' => $itemID, 'level' => $data['ItemLevel'], 'name' => Armory::GetLocale() == 'en_gb' || Armory::GetLocale() == 'en_us' ? $data['name'] : $items->GetItemName($itemID), 'quality' => $data['Quality'], 'type' => null);
$xml->XMLWriter()->startElement('itemInfo');
$xml->XMLWriter()->startElement('item');
foreach ($item_data as $item_data_key => $item_data_value) {
    $xml->XMLWriter()->writeAttribute($item_data_key, $item_data_value);
}
$extended_cost = $mangos->GetVendorExtendedCost($itemID);
if ($data['SellPrice'] > 0 || $data['BuyPrice'] || $extended_cost > 0) {
    $xml->XMLWriter()->startElement('cost');
    if ($data['SellPrice'] > 0) {
        $xml->XMLWriter()->writeAttribute('sellPrice', $data['SellPrice']);
    }
    if ($data['BuyPrice'] > 0 && $items->IsVendorItem($itemID)) {
        $xml->XMLWriter()->writeAttribute('buyPrice', $data['BuyPrice']);
    }
    $cost_info = $mangos->GetExtendedCost($extended_cost);
开发者ID:Lankytim,项目名称:wowarmory,代码行数:31,代码来源:item-info.php


示例13: ConvertArray

 protected function ConvertArray($source)
 {
     if (!is_array($source)) {
         Armory::Log()->writeError('%s : source must have array type!', __METHOD__);
         return null;
     }
     $returnString = null;
     $count = count($source);
     for ($i = 0; $i < $count; $i++) {
         if (!isset($source[$i])) {
             continue;
         }
         if ($i) {
             $returnString .= ", '" . $this->SanitizeString($source[$i]) . "'";
         } else {
             $returnString .= "'" . $this->SanitizeString($source[$i]) . "'";
         }
     }
     return $returnString;
 }
开发者ID:Lankytim,项目名称:wowarmory,代码行数:20,代码来源:class.databaseHandler.php


示例14: strtolower

    $xml->XMLWriter()->endElement();
    //title
    $xml->XMLWriter()->startElement('updated');
    $xml->XMLWriter()->text($fdate);
    $xml->XMLWriter()->endElement();
    //updated
    $xml->XMLWriter()->startElement('published');
    $xml->XMLWriter()->text($fdate);
    $xml->XMLWriter()->endElement();
    //published
    $xml->XMLWriter()->startElement('id');
    $xml->XMLWriter()->text(sprintf('%s@%s_%s_%s', strtolower(urlencode($characters->GetName())), strtolower(urlencode($characters->GetRealmName())), $feed['hard_data'], date('dmYHis', $feed['hard_date'])));
    $xml->XMLWriter()->endElement();
    //id
    $xml->XMLWriter()->startElement('link');
    $xml->XMLWriter()->writeAttribute('href', sprintf('character-feed.xml?r=%s&cn=%s&locale=%s', urldecode($characters->GetRealmName()), urldecode($characters->GetName()), Armory::GetLocale()));
    $xml->XMLWriter()->endElement();
    //link
    $xml->XMLWriter()->startElement('content');
    $xml->XMLWriter()->writeAttribute('type', 'html');
    $xml->XMLWriter()->writeCData($feed['desc']);
    $xml->XMLWriter()->endElement();
    //content
    $xml->XMLWriter()->endElement();
    //entry
}
$xml->XMLWriter()->endElement();
//feed
$xml_cache_data = $xml->StopXML();
echo $xml_cache_data;
if (Armory::$armoryconfig['useCache'] == true && !isset($_GET['skipCache'])) {
开发者ID:Lankytim,项目名称:wowarmory,代码行数:31,代码来源:character-feed-atom.php


示例15: GenerateAchievements

 private function GenerateAchievements()
 {
     if (!is_array($this->achievements_storage)) {
         Armory::Log()->writeError('%s : unable to generate achievements ID: achievements storage is empty!', __METHOD__);
         return false;
     }
     $this->achievements_id = array();
     $ach_storage = array();
     $criterias_storage = array();
     $latest_count = 0;
     foreach ($this->achievements_storage as $achievement) {
         if ($latest_count < 6) {
             $this->latest_achievements[] = $achievement;
             $latest_count++;
         }
         $ach_storage[$achievement['achievement']] = $achievement;
         $this->achievements_id[] = $achievement['achievement'];
     }
     foreach ($this->achievements_progress_storage as $criteria) {
         $criterias_storage[$criteria['criteria']] = $criteria;
     }
     $this->achievements_storage = $ach_storage;
     $this->achievements_progress_storage = $criterias_storage;
     unset($ach_storage, $criterias_storage);
     return true;
 }
开发者ID:DizKragnet,项目名称:wowarmory,代码行数:26,代码来源:class.achievements.php


示例16: LoadItem

 public function LoadItem($item_entry, $itemGuid = 0, $ownerGuid = 0)
 {
     $item_row = Armory::$wDB->selectRow("SELECT * FROM `item_template` WHERE `entry` = '%d' LIMIT 1", $item_entry);
     if (!$item_row) {
         Armory::Log()->writeError('%s : item #%d (GUID: %d) was not found in `item_template` table.', __METHOD__, $item_entry, $itemGuid);
         return false;
     }
     // FlagsExtra check
     if (isset($item_row['FlagsExtra'])) {
         $item_row['Flags2'] = $item_row['FlagsExtra'];
         unset($item_row['FlagsExtra']);
         // For compatibility
     }
     // Assign variables
     foreach ($item_row as $field => $value) {
         $this->{$field} = $value;
     }
     // Create arrays
     // Item mods
     for ($i = 0; $i < MAX_ITEM_PROTO_STATS + 1; $i++) {
         $key = $i + 1;
         if (isset($this->{'stat_type' . $key})) {
             $this->ItemStat[$i] = array('type' => $this->{'stat_type' . $key}, 'value' => $this->{'stat_value' . $key});
         }
     }
     // Item damages
     for ($i = 0; $i < MAX_ITEM_PROTO_DAMAGES + 1; $i++) {
         $key = $i + 1;
         if (isset($this->{'dmg_type' . $key})) {
             $this->Damage[$i] = array('type' => $this->{'dmg_type' . $key}, 'min' => $this->{'dmg_min' . $key}, 'max' => $this->{'dmg_max' . $key});
         }
     }
     // Item spells
     for ($i = 0; $i < MAX_ITEM_PROTO_SPELLS + 1; $i++) {
         $key = $i + 1;
         if (isset($this->{'spellid_' . $key})) {
             $this->Spells[$i] = array('spellid' => $this->{'spellid_' . $key}, 'trigger' => $this->{'spelltrigger_' . $key}, 'charges' => $this->{'spellcharges_' . $key}, 'ppmRate' => $this->{'spellppmRate_' . $key}, 'cooldown' => $this->{'spellcooldown_' . $key}, 'category' => $this->{'spellcategory_' . $key}, 'categorycooldown' => $this->{'spellcategorycooldown_' . $key});
         }
     }
     // Item sockets
     for ($i = 0; $i < MAX_ITEM_PROTO_SOCKETS + 1; $i++) {
         $key = $i + 1;
         if (isset($this->{'socketColor_' . $key})) {
             $this->Socket[$i] = array('color' => $this->{'socketColor_' . $key}, 'content' => $this->{'socketContent_' . $key});
         }
     }
     $this->m_guid = $itemGuid;
     // Can have NULL value.
     $this->m_owner = $ownerGuid;
     // Can have NULL value.
     $this->loaded = true;
     return true;
 }
开发者ID:DizKragnet,项目名称:wowarmory,代码行数:53,代码来源:class.itemprototype.php


示例17: GetGuildRanks

 /**
  * Returns array with guild rank IDs.
  * @category Guilds class
  * @access   public
  * @return   array
  **/
 public function GetGuildRanks()
 {
     if (!$this->guildId) {
         Armory::Log()->writeError('%s : guildId not defined', __METHOD__);
         return false;
     }
     return Armory::$cDB->select("SELECT `rid` AS `id`, `rname` AS `name` FROM `guild_rank` WHERE `guildid`=%d", $this->guildId);
 }
开发者ID:Lankytim,项目名称:wowarmory,代码行数:14,代码来源:class.guilds.php


示例18: GetExtendedCost

 /**
  * Returns extended cost info for $costId cost.
  * @category Mangos class
  * @access   public
  * @param    int $costId
  * @return   array
  **/
 public function GetExtendedCost($costId)
 {
     if ($costId == 0) {
         return false;
     }
     if ($costId < 0) {
         $costId = abs($costId);
     }
     $costInfo = Armory::$aDB->selectRow("SELECT * FROM `ARMORYDBPREFIX_extended_cost` WHERE `id`=%d LIMIT 1", $costId);
     if (!$costInfo) {
         Armory::Log()->writeError('%s : wrong cost id: #%d', __METHOD__, $costId);
         return false;
     }
     $extended_cost = array();
     for ($i = 1; $i < 6; $i++) {
         if ($costInfo['item' . $i] > 0) {
             $extended_cost[$i]['count'] = $costInfo['item' . $i . 'count'];
             $extended_cost[$i]['icon'] = Items::GetItemIcon($costInfo['item' . $i]);
             $extended_cost[$i]['id'] = $costInfo['item' . $i];
         }
     }
     return $extended_cost;
 }
开发者ID:Lankytim,项目名称:wowarmory,代码行数:30,代码来源:class.mangos.php


示例19: GetItemSourceArray

 /**
  * Returns array with item sources (for search results)
  * @category Search class
  * @access   private
  * @param    array $items
  * @return   array
  **/
 private function GetItemSourceArray($items)
 {
     // Get item IDs first
     $result_ids = array();
     foreach ($items as $item) {
         $curr_item_id = 0;
         if (!isset($item['id']) && !isset($item['entry'])) {
             continue;
         } elseif (isset($item['id'])) {
             $curr_item_id = $item['id'];
         } elseif (isset($item['entry'])) {
             $curr_item_id = $item['entry'];
         }
         if ($curr_item_id == 0) {
             continue;
         }
         $result_ids[] = $curr_item_id;
     }
     // Get item sources
     $data = Armory::$aDB->select("\n        SELECT\n        `ARMORYDBPREFIX_source`.`item`,\n        `ARMORYDBPREFIX_source`.`source`,\n        `ARMORYDBPREFIX_source`.`areaKey`,\n        `ARMORYDBPREFIX_source`.`areaUrl`,\n        `ARMORYDBPREFIX_source`.`isHeroic`,\n        `ARMORYDBPREFIX_instance_template`.`name_%s` AS `areaName`,\n        `ARMORYDBPREFIX_instance_template`.`id` AS `areaId`\n        FROM `ARMORYDBPREFIX_source` AS `ARMORYDBPREFIX_source`\n        LEFT JOIN `ARMORYDBPREFIX_instance_template` AS `ARMORYDBPREFIX_instance_template` ON `ARMORYDBPREFIX_instance_template`.`key`=`ARMORYDBPREFIX_source`.`areaKey`\n        WHERE `ARMORYDBPREFIX_source`.`item` IN (%s)", Armory::GetLocale(), $result_ids);
     if (!$data) {
         Armory::Log()->writeError('%s : unable to get item sources from DB!', __METHOD__);
         return false;
     }
     $sources_result = array();
     foreach ($data as $entry) {
         if (!isset($sources_result[$entry['item']])) {
             $sources_result[$entry['item']] = $entry;
         }
     }
     return $sources_result;
 }
开发者ID:Lankytim,项目名称:wowarmory,代码行数:39,代码来源:class.search.php


示例20: isset

<!-- CONTENT START -->
    <div class="grid_16" id="content">
   <!-- CONTENT TITLE -->
    <div class="grid_9">
    <h1 class="content_edit">News Manager</h1>
    </div>
<!--    TEXT CONTENT OR ANY OTHER CONTENT START     -->
    <div class="grid_15" id="textcontent">
    <?php 
$news_item = Template::GetPageData('news_item');
if (is_array($news_item)) {
    $title = '';
    if (isset($news_item['title_' . Armory::GetLocale()]) && $news_item['title_' . Armory::GetLocale()] != null) {
        $title = $news_item['title_' . Armory::GetLocale()];
    } else {
        $title = isset($news_item['title_en_gb']) ? $news_item['title_en_gb'] : null;
    }
    echo '<h2>' . $title . '</h2>';
} else {
    echo '<h2><a href="?action=news&subaction=add">Add New Item</a><br />Select Item to Edit:</h2>';
    $armory_news = Utils::GetArmoryNews(true);
    if (is_array($armory_news)) {
        $count = count($armory_news);
        echo '<ul>';
        for ($i = 0; $i < $count; ++$i) {
            echo sprintf('<li><a href="?action=news&subaction=edit&itemid=%d">%s</a> (%s)</li>', $armory_news[$i]['id'], $armory_news[$i]['title'], $armory_news[$i]['date']);
        }
        echo '</ul>';
    }
}
?>
开发者ID:DizKragnet,项目名称:wowarmory,代码行数:31,代码来源:content_news.php



注:本文中的Armory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Arr类代码示例发布时间:2022-05-23
下一篇:
PHP Armor类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap