From c152c42574f6ff5da08396d778360d9023df7e0f Mon Sep 17 00:00:00 2001 From: Shadez Date: Fri, 28 May 2010 22:53:47 +0900 Subject: [PATCH] [217] Added some debug messages to achievement-firsts & character-achievements pages --- achievement-firsts.php | 7 ++++++- character-achievements.php | 15 ++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/achievement-firsts.php b/achievement-firsts.php index 57e6fdb2b..367967bbf 100644 --- a/achievement-firsts.php +++ b/achievement-firsts.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release Candidate 1 - * @revision 192 + * @revision 217 * @copyright (c) 2009-2010 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -44,6 +44,7 @@ $realmName = (isset($_GET['r'])) ? urldecode($_GET['r']) : $armory->currentRealmInfo['name']; $isRealm = $utils->IsRealm($realmName); if($isRealm) { + $armory->Log()->writeLog('achievement-firsts.php : realm %s defined', $realmName); $xml->XMLWriter()->startElement('realmInfo'); $xml->XMLWriter()->writeAttribute('realm', $realmName); // Get achievements @@ -74,9 +75,13 @@ $xml->XMLWriter()->endElement(); //achievement } } + else { + $armory->Log()->writeError('achievement-firsts.php : achievement_firsts variable must be in array!'); + } $xml->XMLWriter()->endElement(); //realmInfo } else { + $armory->Log()->writeLog('Unable to find any achievement firsts'); $xml->XMLWriter()->startElement('error'); $xml->XMLWriter()->writeAttribute('errCode', 'noData'); $xml->XMLWriter()->endElement(); //error diff --git a/character-achievements.php b/character-achievements.php index 8f3ec9e98..d27a582cb 100644 --- a/character-achievements.php +++ b/character-achievements.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release Candidate 1 - * @revision 208 + * @revision 217 * @copyright (c) 2009-2010 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -71,6 +71,7 @@ } } if($achievement_category > 0) { + $armory->Log()->writeLog('character-achievements.php : detected category: %d', $achievement_category); $xml->XMLWriter()->startElement('achievements'); $xml->XMLWriter()->writeAttribute('lang', $armory->_locale); $xml->XMLWriter()->writeAttribute('requestUrl', 'character-achievements.xml'); @@ -109,6 +110,9 @@ $xml->XMLWriter()->endElement(); //achievement } } + else { + $armory->Log()->writeLog('character-achievements.php : player %d (%s) does not have any completed achievements in %d category', $characters->GetGUID(), $characters->GetName(), $achievement_category); + } if(isset($achievements_page['incompleted'])) { foreach($achievements_page['incompleted'] as $achievement) { if(isset($achievement['display']) && $achievement['display'] == 0) { @@ -120,6 +124,9 @@ $xml->XMLWriter()->writeAttribute($a_data_key, $a_data_value); } } + else { + $armory->Log()->writeLog('character-achievements.php : achievement[data] not found (player: %d; %s)!', $characters->GetGUID(), $characters->GetName()); + } if(isset($achievement['criteria']) && is_array($achievement['criteria'])) { foreach($achievement['criteria'] as $criteria) { $xml->XMLWriter()->startElement('criteria'); @@ -129,6 +136,9 @@ $xml->XMLWriter()->endElement(); //criteria } } + else { + $armory->Log()->writeLog('character-achievements.php : achievement[critera] not found (player: %d; %s)!', $characters->GetGUID(), $characters->GetName()); + } if(isset($achievement['achievement_tree'])) { foreach($achievement['achievement_tree'] as $achievement_tree) { $xml->XMLWriter()->startElement('achievement'); @@ -141,6 +151,9 @@ $xml->XMLWriter()->endElement(); //achievement } } + else { + $armory->Log()->writeLog('character-achievements.php : player %d (%s) does not have any incompleted achievements in %d category', $characters->GetGUID(), $characters->GetName(), $achievement_category); + } $xml->XMLWriter()->endElement(); //category $xml->XMLWriter()->endElement(); //achievements $xml_cache_data = $xml->StopXML();