Skip to content

Commit

Permalink
[474] Use correct argument for sprintf function in Characters::HasTal…
Browse files Browse the repository at this point in the history
…ent(). Event check in character-feed-data.php
  • Loading branch information
Shadez committed Feb 12, 2011
1 parent ddfd673 commit ddeb98d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
5 changes: 4 additions & 1 deletion character-feed-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release 4.50
* @revision 456
* @revision 474
* @copyright (c) 2009-2011 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand Down Expand Up @@ -77,6 +77,9 @@
}
if(isset($character_feed) && is_array($character_feed) && $isCharacter) {
foreach($character_feed as $feed_item) {
if(!is_array($feed_item) || !isset($feed_item['event'])) {
continue;
}
$xml->XMLWriter()->startElement('event');
foreach($feed_item['event'] as $f_header_key => $f_header_value) {
$xml->XMLWriter()->startAttribute($f_header_key);
Expand Down
22 changes: 19 additions & 3 deletions includes/classes/class.characters.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release 4.50
* @revision 470
* @revision 474
* @copyright (c) 2009-2011 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand Down Expand Up @@ -1503,6 +1503,22 @@ public function GetCharacterReputation() {
return $factionReputation;
}

private function GetFactionCategories($faction) {
$path = array();
$in_process = true;
$id = $faction;
while($in_process) {
$id = Armory::$aDB->selectCell("SELECT `category` FROM `ARMORYDBPREFIX_faction` WHERE `id` = %d", $id);
if($id > 0) {
$path[] = $id;
}
else {
$in_process = false;
}
}
return $path;
}

/**
* Returns value of $fieldNum field. Requires $this->guid or int $guid as second parameter!
* @category Characters class
Expand Down Expand Up @@ -3050,11 +3066,11 @@ public function HasTalent($talent_id, $active_spec = true, $rank = -1) {
}
$sql_data = array(
'activeSpec' => array(
sprintf('SELECT `spell` FROM `character_talent` WHERE `spell` IN (%s) AND `guid`=%%d AND `spec`=%%d', array($talent_spells['Rank_1'], $talent_spells['Rank_2'], $talent_spells['Rank_3'], $talent_spells['Rank_4'], $talent_spells['Rank_5'])),
sprintf('SELECT `spell` FROM `character_talent` WHERE `spell` IN (%s) AND `guid`=%%d AND `spec`=%%d', $talent_spells['Rank_1'] . ', ' . $talent_spells['Rank_2'] . ', ' . $talent_spells['Rank_3'] . ', ' . $talent_spells['Rank_4'] . ', ' . $talent_spells['Rank_5']),
sprintf('SELECT 1 FROM `character_talent` WHERE `spell`=%d AND `guid`=%%d AND `spec`=%%d'. $talent_spells['Rank_' . $rank + 1])
),
'spec' => array(
sprintf('SELECT `spell` FROM `character_talent` WHERE `spell` IN (%s) AND `guid`=%%d', array($talent_spells['Rank_1'], $talent_spells['Rank_2'], $talent_spells['Rank_3'], $talent_spells['Rank_4'], $talent_spells['Rank_5'])),
sprintf('SELECT `spell` FROM `character_talent` WHERE `spell` IN (%s) AND `guid`=%%d', $talent_spells['Rank_1'] . ', ' . $talent_spells['Rank_2'] . ', ' . $talent_spells['Rank_3'] . ', ' . $talent_spells['Rank_4'] . ', ' . $talent_spells['Rank_5']),
sprintf('SELECT 1 FROM `character_talent` WHERE `spell`=%d AND `guid`=%%d', $talent_spells['Rank_' . $rank + 1])
)
);
Expand Down
2 changes: 1 addition & 1 deletion includes/revision_nr.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
define('ARMORY_REVISION', 473);
define('ARMORY_REVISION', 474);
define('DB_VERSION', 'armory_r471');
define('CONFIG_VERSION', '2001201101');
?>

0 comments on commit ddeb98d

Please sign in to comment.