diff --git a/character-achievements.php b/character-achievements.php index 346076422..299764c3b 100644 --- a/character-achievements.php +++ b/character-achievements.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release Candidate 1 - * @revision 296 + * @revision 297 * @copyright (c) 2009-2010 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -265,11 +265,29 @@ $character_title = $characters->GetChosenTitleInfo(); $character_element = $characters->GetHeader($achievements); $xml->XMLWriter()->startElement('characterInfo'); -$xml->XMLWriter()->startElement('character'); -foreach($character_element as $c_elem_name => $c_elem_value) { - $xml->XMLWriter()->writeAttribute($c_elem_name, $c_elem_value); +if($utils->IsWriteRaw()) { + $xml->XMLWriter()->writeRaw(' $c_elem_value) { + if($c_elem_name == 'charUrl') { + $xml->XMLWriter()->writeRaw(' ' . $c_elem_name .'="' .htmlspecialchars($c_elem_value).'"'); + } + else { + $xml->XMLWriter()->writeRaw(' ' . $c_elem_name .'="' .$c_elem_value.'"'); + } + } + $xml->XMLWriter()->writeRaw('>'); + $xml->XMLWriter()->writeRaw(''); +} +else { + $xml->XMLWriter()->startElement('character'); + foreach($character_element as $c_elem_name => $c_elem_value) { + $xml->XMLWriter()->writeAttribute($c_elem_name, $c_elem_value); + } + $xml->XMLWriter()->startElement('modelBasePath'); + $xml->XMLWriter()->writeAttribute('value', 'http://eu.media.battle.net.edgesuite.net/'); + $xml->XMLWriter()->endElement(); //modelBasePath + $xml->XMLWriter()->endElement(); //character } -$xml->XMLWriter()->endElement(); //character $xml->XMLWriter()->endElement(); //characterInfo $xml->XMLWriter()->startElement('achievements'); $xml->XMLWriter()->startElement('summary'); diff --git a/character-arenateams.php b/character-arenateams.php index ca3478165..ced6f0e6a 100644 --- a/character-arenateams.php +++ b/character-arenateams.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release Candidate 1 - * @revision 257 + * @revision 297 * @copyright (c) 2009-2010 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -84,38 +84,78 @@ } $character_title = $characters->GetChosenTitleInfo(); $character_element = $characters->GetHeader($achievements); -$xml->XMLWriter()->startElement('characterInfo'); -$xml->XMLWriter()->startElement('character'); -foreach($character_element as $c_elem_name => $c_elem_value) { - $xml->XMLWriter()->writeAttribute($c_elem_name, $c_elem_value); -} $character_arenateams = $arenateams->GetCharacterArenaTeamInfo(); -if(is_array($character_arenateams)) { - $xml->XMLWriter()->startElement('arenaTeams'); - foreach($character_arenateams as $arenateam) { - $xml->XMLWriter()->startElement('arenaTeam'); - foreach($arenateam['data'] as $team_key => $team_value) { - $xml->XMLWriter()->writeAttribute($team_key, $team_value); +$xml->XMLWriter()->startElement('characterInfo'); +if($utils->IsWriteRaw()) { + $xml->XMLWriter()->writeRaw(' $c_elem_value) { + if($c_elem_name == 'charUrl') { + $xml->XMLWriter()->writeRaw(' ' . $c_elem_name .'="' .htmlspecialchars($c_elem_value).'"'); + } + else { + $xml->XMLWriter()->writeRaw(' ' . $c_elem_name .'="' .$c_elem_value.'"'); } - $xml->XMLWriter()->startElement('emblem'); - foreach($arenateam['emblem'] as $emblem_key => $emblem_value) { - $xml->XMLWriter()->writeAttribute($emblem_key, $emblem_value); + } + if($character_arenateams && is_array($character_arenateams)) { + $xml->XMLWriter()->writeRaw('>'); // close tag before open new + foreach($character_arenateams as $arenateam) { + $xml->XMLWriter()->writeRaw(' $team_value) { + $xml->XMLWriter()->writeRaw(' ' . $team_key.'="' . htmlspecialchars($team_value).'"'); + } + $xml->XMLWriter()->writeRaw('> $emblem_value) { + $xml->XMLWriter()->writeRaw(' ' . $emblem_key.'="' . $emblem_value.'"'); + } + $xml->XMLWriter()->writeRaw('>'); + foreach($arenateam['members'] as $member) { + $xml->XMLWriter()->writeRaw(' $member_value) { + $xml->XMLWriter()->writeRaw(' ' . $member_key .'="' . htmlspecialchars($member_value) . '"'); + } + $xml->XMLWriter()->writeRaw('/>'); //member + } + $xml->XMLWriter()->writeRaw(''); } - $xml->XMLWriter()->endElement(); //emblem - $xml->XMLWriter()->startElement('members'); - foreach($arenateam['members'] as $member) { - $xml->XMLWriter()->startElement('character'); - foreach($member as $member_key => $member_value) { - $xml->XMLWriter()->writeAttribute($member_key, $member_value); + $xml->XMLWriter()->writeRaw(''); + } + $xml->XMLWriter()->writeRaw(''); +} +else { + $xml->XMLWriter()->startElement('character'); + foreach($character_element as $c_elem_name => $c_elem_value) { + $xml->XMLWriter()->writeAttribute($c_elem_name, $c_elem_value); + } + if($character_arenateams && is_array($character_arenateams)) { + $xml->XMLWriter()->startElement('arenaTeams'); + foreach($character_arenateams as $arenateam) { + $xml->XMLWriter()->startElement('arenaTeam'); + foreach($arenateam['data'] as $team_key => $team_value) { + $xml->XMLWriter()->writeAttribute($team_key, $team_value); + } + $xml->XMLWriter()->startElement('emblem'); + foreach($arenateam['emblem'] as $emblem_key => $emblem_value) { + $xml->XMLWriter()->writeAttribute($emblem_key, $emblem_value); + } + $xml->XMLWriter()->endElement(); //emblem + $xml->XMLWriter()->startElement('members'); + foreach($arenateam['members'] as $member) { + $xml->XMLWriter()->startElement('character'); + foreach($member as $member_key => $member_value) { + $xml->XMLWriter()->writeAttribute($member_key, $member_value); + } + $xml->XMLWriter()->endElement(); //character } - $xml->XMLWriter()->endElement(); //character + $xml->XMLWriter()->endElement(); //members + $xml->XMLWriter()->endElement(); //arenaTeam } - $xml->XMLWriter()->endElement(); //members - $xml->XMLWriter()->endElement(); //arenaTeam + $xml->XMLWriter()->endElement(); //arenaTeams } - $xml->XMLWriter()->endElement(); //arenaTeams + $xml->XMLWriter()->startElement('modelBasePath'); + $xml->XMLWriter()->writeAttribute('value', 'http://eu.media.battle.net.edgesuite.net/'); + $xml->XMLWriter()->endElement(); //modelBasePath + $xml->XMLWriter()->endElement(); //character } -$xml->XMLWriter()->endElement(); //character $xml->XMLWriter()->endElement(); //characterInfo $xml->XMLWriter()->endElement(); //page $xml_cache_data = $xml->StopXML(); diff --git a/character-calendar.php b/character-calendar.php index ae2f4d775..1f86bed2e 100644 --- a/character-calendar.php +++ b/character-calendar.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release Candidate 1 - * @revision 257 + * @revision 297 * @copyright (c) 2009-2010 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -83,11 +83,29 @@ $character_title = $characters->GetChosenTitleInfo(); $character_element = $characters->GetHeader($achievements); $xml->XMLWriter()->startElement('characterInfo'); -$xml->XMLWriter()->startElement('character'); -foreach($character_element as $c_elem_name => $c_elem_value) { - $xml->XMLWriter()->writeAttribute($c_elem_name, $c_elem_value); +if($utils->IsWriteRaw()) { + $xml->XMLWriter()->writeRaw(' $c_elem_value) { + if($c_elem_name == 'charUrl') { + $xml->XMLWriter()->writeRaw(' ' . $c_elem_name .'="' .htmlspecialchars($c_elem_value).'"'); + } + else { + $xml->XMLWriter()->writeRaw(' ' . $c_elem_name .'="' .$c_elem_value.'"'); + } + } + $xml->XMLWriter()->writeRaw('>'); + $xml->XMLWriter()->writeRaw(''); +} +else { + $xml->XMLWriter()->startElement('character'); + foreach($character_element as $c_elem_name => $c_elem_value) { + $xml->XMLWriter()->writeAttribute($c_elem_name, $c_elem_value); + } + $xml->XMLWriter()->startElement('modelBasePath'); + $xml->XMLWriter()->writeAttribute('value', 'http://eu.media.battle.net.edgesuite.net/'); + $xml->XMLWriter()->endElement(); //modelBasePath + $xml->XMLWriter()->endElement(); //character } -$xml->XMLWriter()->endElement(); //character $xml->XMLWriter()->endElement(); //characterInfo $xml->XMLWriter()->endElement(); //page $xml_cache_data = $xml->StopXML(); diff --git a/character-feed.php b/character-feed.php index 35a6dffe8..07342dac6 100644 --- a/character-feed.php +++ b/character-feed.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release Candidate 1 - * @revision 257 + * @revision 297 * @copyright (c) 2009-2010 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -73,11 +73,29 @@ $character_title = $characters->GetChosenTitleInfo(); $character_element = $characters->GetHeader($achievements); $xml->XMLWriter()->startElement('characterInfo'); -$xml->XMLWriter()->startElement('character'); -foreach($character_element as $c_elem_name => $c_elem_value) { - $xml->XMLWriter()->writeAttribute($c_elem_name, $c_elem_value); +if($utils->IsWriteRaw()) { + $xml->XMLWriter()->writeRaw(' $c_elem_value) { + if($c_elem_name == 'charUrl') { + $xml->XMLWriter()->writeRaw(' ' . $c_elem_name .'="' .htmlspecialchars($c_elem_value).'"'); + } + else { + $xml->XMLWriter()->writeRaw(' ' . $c_elem_name .'="' .$c_elem_value.'"'); + } + } + $xml->XMLWriter()->writeRaw('>'); + $xml->XMLWriter()->writeRaw(''); +} +else { + $xml->XMLWriter()->startElement('character'); + foreach($character_element as $c_elem_name => $c_elem_value) { + $xml->XMLWriter()->writeAttribute($c_elem_name, $c_elem_value); + } + $xml->XMLWriter()->startElement('modelBasePath'); + $xml->XMLWriter()->writeAttribute('value', 'http://eu.media.battle.net.edgesuite.net/'); + $xml->XMLWriter()->endElement(); //modelBasePath + $xml->XMLWriter()->endElement(); //character } -$xml->XMLWriter()->endElement(); //character $xml->XMLWriter()->endElement(); //characterInfo $xml->XMLWriter()->endElement(); //page $xml_cache_data = $xml->StopXML(); diff --git a/character-model-embed.php b/character-model-embed.php index 9556d91c0..e9f2f78de 100644 --- a/character-model-embed.php +++ b/character-model-embed.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release Candidate 1 - * @revision 257 + * @revision 297 * @copyright (c) 2009-2010 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -83,11 +83,29 @@ $character_title = $characters->GetChosenTitleInfo(); $character_element = $characters->GetHeader($achievements); $xml->XMLWriter()->startElement('characterInfo'); -$xml->XMLWriter()->startElement('character'); -foreach($character_element as $c_elem_name => $c_elem_value) { - $xml->XMLWriter()->writeAttribute($c_elem_name, $c_elem_value); +if($utils->IsWriteRaw()) { + $xml->XMLWriter()->writeRaw(' $c_elem_value) { + if($c_elem_name == 'charUrl') { + $xml->XMLWriter()->writeRaw(' ' . $c_elem_name .'="' .htmlspecialchars($c_elem_value).'"'); + } + else { + $xml->XMLWriter()->writeRaw(' ' . $c_elem_name .'="' .$c_elem_value.'"'); + } + } + $xml->XMLWriter()->writeRaw('>'); + $xml->XMLWriter()->writeRaw(''); +} +else { + $xml->XMLWriter()->startElement('character'); + foreach($character_element as $c_elem_name => $c_elem_value) { + $xml->XMLWriter()->writeAttribute($c_elem_name, $c_elem_value); + } + $xml->XMLWriter()->startElement('modelBasePath'); + $xml->XMLWriter()->writeAttribute('value', 'http://eu.media.battle.net.edgesuite.net/'); + $xml->XMLWriter()->endElement(); //modelBasePath + $xml->XMLWriter()->endElement(); //character } -$xml->XMLWriter()->endElement(); //character $xml->XMLWriter()->endElement(); //characterInfo $xml->XMLWriter()->endElement(); //page $xml_cache_data = $xml->StopXML(); diff --git a/character-reputation.php b/character-reputation.php index 6f0451cd8..cd5edf109 100644 --- a/character-reputation.php +++ b/character-reputation.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release Candidate 1 - * @revision 296 + * @revision 297 * @copyright (c) 2009-2010 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -83,11 +83,29 @@ $character_title = $characters->GetChosenTitleInfo(); $character_element = $characters->GetHeader($achievements); $xml->XMLWriter()->startElement('characterInfo'); -$xml->XMLWriter()->startElement('character'); -foreach($character_element as $c_elem_name => $c_elem_value) { - $xml->XMLWriter()->writeAttribute($c_elem_name, $c_elem_value); +if($utils->IsWriteRaw()) { + $xml->XMLWriter()->writeRaw(' $c_elem_value) { + if($c_elem_name == 'charUrl') { + $xml->XMLWriter()->writeRaw(' ' . $c_elem_name .'="' .htmlspecialchars($c_elem_value).'"'); + } + else { + $xml->XMLWriter()->writeRaw(' ' . $c_elem_name .'="' .$c_elem_value.'"'); + } + } + $xml->XMLWriter()->writeRaw('>'); + $xml->XMLWriter()->writeRaw(''); +} +else { + $xml->XMLWriter()->startElement('character'); + foreach($character_element as $c_elem_name => $c_elem_value) { + $xml->XMLWriter()->writeAttribute($c_elem_name, $c_elem_value); + } + $xml->XMLWriter()->startElement('modelBasePath'); + $xml->XMLWriter()->writeAttribute('value', 'http://eu.media.battle.net.edgesuite.net/'); + $xml->XMLWriter()->endElement(); //modelBasePath + $xml->XMLWriter()->endElement(); //character } -$xml->XMLWriter()->endElement(); //character $xml->XMLWriter()->startElement('reputationTab'); $character_reputation = $characters->GetCharacterReputation(); if($character_reputation) { diff --git a/character-statistics.php b/character-statistics.php index 1d2773059..fa94e93e9 100644 --- a/character-statistics.php +++ b/character-statistics.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release Candidate 1 - * @revision 257 + * @revision 297 * @copyright (c) 2009-2010 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -77,11 +77,20 @@ $i = 0; if($statistics_page) { foreach($statistics_page as $stat) { - $xml->XMLWriter()->startElement('statistic'); - foreach($stat as $statistic_key => $statistic_value) { - $xml->XMLWriter()->writeAttribute($statistic_key, $statistic_value); + if($utils->IsWriteRaw()) { + $xml->XMLWriter()->writeRaw(' $statistic_value) { + $xml->XMLWriter()->writeRaw(' ' . $statistic_key . '="' . $statistic_value . '"'); + } + $xml->XMLWriter()->writeRaw('/>'); + } + else { + $xml->XMLWriter()->startElement('statistic'); + foreach($stat as $statistic_key => $statistic_value) { + $xml->XMLWriter()->writeAttribute($statistic_key, $statistic_value); + } + $xml->XMLWriter()->endElement(); } - $xml->XMLWriter()->endElement(); } } $xml->XMLWriter()->endElement(); //category @@ -119,11 +128,29 @@ $character_title = $characters->GetChosenTitleInfo(); $character_element = $characters->GetHeader($achievements); $xml->XMLWriter()->startElement('characterInfo'); -$xml->XMLWriter()->startElement('character'); -foreach($character_element as $c_elem_name => $c_elem_value) { - $xml->XMLWriter()->writeAttribute($c_elem_name, $c_elem_value); +if($utils->IsWriteRaw()) { + $xml->XMLWriter()->writeRaw(' $c_elem_value) { + if($c_elem_name == 'charUrl') { + $xml->XMLWriter()->writeRaw(' ' . $c_elem_name .'="' .htmlspecialchars($c_elem_value).'"'); + } + else { + $xml->XMLWriter()->writeRaw(' ' . $c_elem_name .'="' .$c_elem_value.'"'); + } + } + $xml->XMLWriter()->writeRaw('>'); + $xml->XMLWriter()->writeRaw(''); +} +else { + $xml->XMLWriter()->startElement('character'); + foreach($character_element as $c_elem_name => $c_elem_value) { + $xml->XMLWriter()->writeAttribute($c_elem_name, $c_elem_value); + } + $xml->XMLWriter()->startElement('modelBasePath'); + $xml->XMLWriter()->writeAttribute('value', 'http://eu.media.battle.net.edgesuite.net/'); + $xml->XMLWriter()->endElement(); //modelBasePath + $xml->XMLWriter()->endElement(); //character } -$xml->XMLWriter()->endElement(); //character $xml->XMLWriter()->endElement(); //characterInfo $xml->XMLWriter()->startElement('statistics'); $xml->XMLWriter()->startElement('summary'); @@ -131,18 +158,40 @@ $xml->XMLWriter()->startElement('rootCategories'); $root_categories = $achievements->BuildStatisticsCategoriesTree(); foreach($root_categories as $category) { - $xml->XMLWriter()->startElement('category'); - $xml->XMLWriter()->writeAttribute('id', $category['id']); - $xml->XMLWriter()->writeAttribute('name', $category['name']); - if(isset($category['child']) && is_array($category['child'])) { - foreach($category['child'] as $category_child) { - $xml->XMLWriter()->startElement('category'); - $xml->XMLWriter()->writeAttribute('name', $category_child['name']); - $xml->XMLWriter()->writeAttribute('id', $category_child['id']); - $xml->XMLWriter()->endElement(); //category + if($utils->IsWriteRaw()) { + $xml->XMLWriter()->writeRaw('XMLWriter()->writeRaw(' id="' . $category['id'] . '"'); + if($category['id'] == 14807) { + $xml->XMLWriter()->writeRaw(' name="' . htmlspecialchars($category['name']) . '"'); + } + else { + $xml->XMLWriter()->writeRaw(' name="' . $category['name'] . '"'); + } + $xml->XMLWriter()->writeRaw('>'); + if(isset($category['child']) && is_array($category['child'])) { + foreach($category['child'] as $category_child) { + $xml->XMLWriter()->writeRaw('XMLWriter()->writeRaw(' name="' . $category_child['name'] . '"'); + $xml->XMLWriter()->writeRaw(' id="' . $category_child['id'] . '"'); + $xml->XMLWriter()->writeRaw('/>'); //category + } + } + $xml->XMLWriter()->writeRaw(''); //category + } + else { + $xml->XMLWriter()->startElement('category'); + $xml->XMLWriter()->writeAttribute('id', $category['id']); + $xml->XMLWriter()->writeAttribute('name', $category['name']); + if(isset($category['child']) && is_array($category['child'])) { + foreach($category['child'] as $category_child) { + $xml->XMLWriter()->startElement('category'); + $xml->XMLWriter()->writeAttribute('name', $category_child['name']); + $xml->XMLWriter()->writeAttribute('id', $category_child['id']); + $xml->XMLWriter()->endElement(); //category + } } + $xml->XMLWriter()->endElement(); //category } - $xml->XMLWriter()->endElement(); //category } $xml->XMLWriter()->endElement(); //rootCategories $xml->XMLWriter()->endElement(); //statistics diff --git a/character-talents.php b/character-talents.php index c43f88d5c..973177ccf 100644 --- a/character-talents.php +++ b/character-talents.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release Candidate 1 - * @revision 257 + * @revision 297 * @copyright (c) 2009-2010 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -84,11 +84,29 @@ $character_title = $characters->GetChosenTitleInfo(); $character_element = $characters->GetHeader($achievements); $xml->XMLWriter()->startElement('characterInfo'); -$xml->XMLWriter()->startElement('character'); -foreach($character_element as $c_elem_name => $c_elem_value) { - $xml->XMLWriter()->writeAttribute($c_elem_name, $c_elem_value); +if($utils->IsWriteRaw()) { + $xml->XMLWriter()->writeRaw(' $c_elem_value) { + if($c_elem_name == 'charUrl') { + $xml->XMLWriter()->writeRaw(' ' . $c_elem_name .'="' .htmlspecialchars($c_elem_value).'"'); + } + else { + $xml->XMLWriter()->writeRaw(' ' . $c_elem_name .'="' .$c_elem_value.'"'); + } + } + $xml->XMLWriter()->writeRaw('>'); + $xml->XMLWriter()->writeRaw(''); +} +else { + $xml->XMLWriter()->startElement('character'); + foreach($character_element as $c_elem_name => $c_elem_value) { + $xml->XMLWriter()->writeAttribute($c_elem_name, $c_elem_value); + } + $xml->XMLWriter()->startElement('modelBasePath'); + $xml->XMLWriter()->writeAttribute('value', 'http://eu.media.battle.net.edgesuite.net/'); + $xml->XMLWriter()->endElement(); //modelBasePath + $xml->XMLWriter()->endElement(); //character } -$xml->XMLWriter()->endElement(); //character $talent_build = $characters->CalculateCharacterTalentBuild(); $talent_points = $characters->CalculateCharacterTalents(); $build = array(); diff --git a/includes/classes/class.achievements.php b/includes/classes/class.achievements.php index 741f468f3..0020eca37 100644 --- a/includes/classes/class.achievements.php +++ b/includes/classes/class.achievements.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release Candidate 1 - * @revision 226 + * @revision 297 * @copyright (c) 2009-2010 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -467,6 +467,12 @@ public function LoadAchievementPage($page_id, $faction) { } public function BuildAchievementCriteriaTable() { + if($this->_locale == 'es_es' || $this->_locale == 'es_mx') { + $locale = 'en_gb'; + } + else { + $locale = $this->_locale; + } if(!$this->guid || !$this->achId) { $this->Log()->writeError('%s : player guid or achievement id not defiend', __METHOD__); return false; @@ -490,7 +496,7 @@ public function BuildAchievementCriteriaTable() { if(isset($m_data['date']) && $m_data['date'] > 0) { $achievement_criteria[$i]['date'] = date('Y-m-d\TH:i:s\+01:00', $m_data['date']); } - $achievement_criteria[$i]['name'] = $criteria['name_'.$this->_locale]; + $achievement_criteria[$i]['name'] = $criteria['name_'.$locale]; if($criteria['completionFlag']&ACHIEVEMENT_CRITERIA_FLAG_SHOW_PROGRESS_BAR || $criteria['completionFlag']&ACHIEVEMENT_FLAG_COUNTER) { if($criteria['completionFlag']&ACHIEVEMENT_CRITERIA_FLAG_MONEY_COUNTER) { $achievement_criteria[$i]['maxQuantityGold'] = $criteria['value']; diff --git a/includes/revision_nr.php b/includes/revision_nr.php index 02b6aaf94..86c5118f3 100644 --- a/includes/revision_nr.php +++ b/includes/revision_nr.php @@ -1,6 +1,6 @@ \ No newline at end of file