diff --git a/_layout/character/achievements-async.xsl b/_layout/character/achievements-async.xsl index a86301381..be8183172 100644 --- a/_layout/character/achievements-async.xsl +++ b/_layout/character/achievements-async.xsl @@ -256,7 +256,7 @@
-
[]
+
[]
— diff --git a/character-achievements.php b/character-achievements.php index 27ba1def6..03bddf77b 100644 --- a/character-achievements.php +++ b/character-achievements.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release Candidate 1 - * @revision 345 + * @revision 366 * @copyright (c) 2009-2010 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -53,6 +53,21 @@ if(!isset($_GET['r'])) { $_GET['r'] = false; } +$comparisonData = false; +$comparison = false; +// Check for achievement comparison +if($comparisonData = $utils->IsAchievementsComparison()) { + // We got it + $comparison = array(); + $i = 0; + foreach($comparisonData as $char) { + $comparison[$i] = new Characters; + $comparison[$i]->BuildCharacter($char['name'], $utils->GetRealmIdByName($char['realm']), true); + $i++; + } + // + $name = $comparisonData[0]['name']; +} $realmId = $utils->GetRealmIdByName($_GET['r']); $characters->BuildCharacter($name, $realmId); $isCharacter = $characters->CheckPlayer(); @@ -75,11 +90,20 @@ } } if($achievement_category > 0) { - $armory->Log()->writeLog('character-achievements.php : detected category: %d', $achievement_category); $xml->XMLWriter()->startElement('achievements'); $xml->XMLWriter()->writeAttribute('lang', $armory->GetLocale()); $xml->XMLWriter()->writeAttribute('requestUrl', 'character-achievements.xml'); $xml->XMLWriter()->startElement('category'); + $pages = false; + if(is_array($comparison)) { + $pages = array(); + $counter_comparison = 0; + foreach($comparison as $char) { + $pages[$counter_comparison] = $char->GetAchievementMgr()->LoadAchievementPage($achievement_category, ($char->GetFaction() == 1) ? 0 : 1); + $counter_comparison++; + } + } + $pages_count = count($pages); $achievements_page = $achievements->LoadAchievementPage($achievement_category, ($characters->GetFaction() == 1) ? 0 : 1); $i = 0; if(isset($achievements_page['completed'])) { @@ -88,103 +112,149 @@ continue; } if($utils->IsWriteRaw()) { - $xml->XMLWriter()->writeRaw('XMLWriter()->writeRaw(' $a_data_value) { $xml->XMLWriter()->writeRaw(' ' . $a_data_key . '="' . $a_data_value . '"'); } - } - $xml->XMLWriter()->writeRaw('>'); - if(isset($achievement['criteria']) && is_array($achievement['criteria'])) { - foreach($achievement['criteria'] as $criteria) { - $xml->XMLWriter()->writeRaw(' $c_value) { - $xml->XMLWriter()->writeRaw(' ' . $c_key .'="' . $c_value .'"'); + $xml->XMLWriter()->writeRaw('>'); //achievement + for($aCount = 0; $aCount < $pages_count; $aCount++) { + $tmp = $pages[$aCount]; + $xml->XMLWriter()->writeRaw('XMLWriter()->writeRaw(' dateCompleted="' . $tmp['completed'][$achievement['data']['id']]['data']['dateCompleted'] . '"'); } - $xml->XMLWriter()->writeRaw('/>'); //criteria + $xml->XMLWriter()->writeRaw('/>'); //c } + $xml->XMLWriter()->writeRaw(''); //achievement } - if(isset($achievement['achievement_tree'])) { - foreach($achievement['achievement_tree'] as $achievement_tree) { - $xml->XMLWriter()->writeRaw(' $a_tree_value) { - $xml->XMLWriter()->writeRaw(' ' . $a_tree_key . '="' . $a_tree_value . '"'); + else { + $xml->XMLWriter()->writeRaw(' $a_data_value) { + $xml->XMLWriter()->writeRaw(' ' . $a_data_key . '="' . $a_data_value . '"'); + } + } + $xml->XMLWriter()->writeRaw('>'); + if(isset($achievement['criteria']) && is_array($achievement['criteria'])) { + foreach($achievement['criteria'] as $criteria) { + $xml->XMLWriter()->writeRaw(' $c_value) { + $xml->XMLWriter()->writeRaw(' ' . $c_key .'="' . $c_value .'"'); + } + $xml->XMLWriter()->writeRaw('/>'); //criteria + } + } + if(isset($achievement['achievement_tree'])) { + foreach($achievement['achievement_tree'] as $achievement_tree) { + $xml->XMLWriter()->writeRaw(' $a_tree_value) { + $xml->XMLWriter()->writeRaw(' ' . $a_tree_key . '="' . $a_tree_value . '"'); + } + $xml->XMLWriter()->writeRaw('/>'); //achievement } - $xml->XMLWriter()->writeRaw('/>'); //achievement } + $xml->XMLWriter()->writeRaw(''); //achievement } - $xml->XMLWriter()->writeRaw(''); //achievement } else { - $xml->XMLWriter()->startElement('achievement'); - if(isset($achievement['data'])) { + if(is_array($pages)) { + $xml->XMLWriter()->startElement('achievement'); foreach($achievement['data'] as $a_data_key => $a_data_value) { $xml->XMLWriter()->writeAttribute($a_data_key, $a_data_value); } - } - if(isset($achievement['criteria']) && is_array($achievement['criteria'])) { - foreach($achievement['criteria'] as $criteria) { - $xml->XMLWriter()->startElement('criteria'); - foreach($criteria as $c_key => $c_value) { - $xml->XMLWriter()->writeAttribute($c_key, $c_value); + for($aCount = 0; $aCount < $pages_count; $aCount++) { + $tmp = $pages[$aCount]; + $xml->XMLWriter()->startElement('c'); + if(isset($tmp['completed'][$achievement['data']['id']])) { + $xml->XMLWriter()->writeAttribute('dateCompleted', $tmp['completed'][$achievement['data']['id']]['data']['dateCompleted']); } - $xml->XMLWriter()->endElement(); //criteria + $xml->XMLWriter()->endElement(); //c } + $xml->XMLWriter()->endElement(); //achievement } - if(isset($achievement['achievement_tree'])) { - foreach($achievement['achievement_tree'] as $achievement_tree) { - $xml->XMLWriter()->startElement('achievement'); - foreach($achievement_tree as $a_tree_key => $a_tree_value) { - $xml->XMLWriter()->writeAttribute($a_tree_key, $a_tree_value); + else { + $xml->XMLWriter()->startElement('achievement'); + if(isset($achievement['data'])) { + foreach($achievement['data'] as $a_data_key => $a_data_value) { + $xml->XMLWriter()->writeAttribute($a_data_key, $a_data_value); + } + } + if(isset($achievement['criteria']) && is_array($achievement['criteria'])) { + foreach($achievement['criteria'] as $criteria) { + $xml->XMLWriter()->startElement('criteria'); + foreach($criteria as $c_key => $c_value) { + $xml->XMLWriter()->writeAttribute($c_key, $c_value); + } + $xml->XMLWriter()->endElement(); //criteria } - $xml->XMLWriter()->endElement(); //achievement } + if(isset($achievement['achievement_tree'])) { + foreach($achievement['achievement_tree'] as $achievement_tree) { + $xml->XMLWriter()->startElement('achievement'); + foreach($achievement_tree as $a_tree_key => $a_tree_value) { + $xml->XMLWriter()->writeAttribute($a_tree_key, $a_tree_value); + } + $xml->XMLWriter()->endElement(); //achievement + } + } + $xml->XMLWriter()->endElement(); //achievement } - $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'])) { if($utils->IsWriteRaw()) { foreach($achievements_page['incompleted'] as $achievement) { if(isset($achievement['display']) && $achievement['display'] == 0) { continue; } - $xml->XMLWriter()->writeRaw(' $a_data_value) { - $xml->XMLWriter()->writeRaw(' ' . $a_data_key . '="' . $a_data_value . '"'); + if(is_array($pages)) { + $xml->XMLWriter()->writeRaw(' $a_data_value) { + $xml->XMLWriter()->writeRaw(' ' . $a_data_key . '="' . $a_data_value . '"'); + } } - } - else { - $armory->Log()->writeLog('character-achievements.php : achievement[data] not found (player: %d; %s)!', $characters->GetGUID(), $characters->GetName()); - } - $xml->XMLWriter()->writeRaw('>'); - if(isset($achievement['criteria']) && is_array($achievement['criteria'])) { - foreach($achievement['criteria'] as $criteria) { - $xml->XMLWriter()->writeRaw(' $c_value) { - $xml->XMLWriter()->writeRaw(' ' . $c_key . '="' . $c_value . '"'); + $xml->XMLWriter()->writeRaw('>'); + for($aCount = 0; $aCount < $pages_count; $aCount++) { + $tmp = $pages[$aCount]; + $xml->XMLWriter()->writeRaw('XMLWriter()->writeRaw(' dateCompleted="' . $tmp['completed'][$achievement['data']['id']]['data']['dateCompleted'] . '"'); } - $xml->XMLWriter()->writeRaw('/>'); //criteria + $xml->XMLWriter()->writeRaw('/>'); //c } + $xml->XMLWriter()->writeRaw(''); } 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()->writeRaw(' $a_tree_value) { - $xml->XMLWriter()->writeRaw(' ' . $a_tree_key . '="' . $a_tree_value . '"'); + $xml->XMLWriter()->writeRaw(' $a_data_value) { + $xml->XMLWriter()->writeRaw(' ' . $a_data_key . '="' . $a_data_value . '"'); } - $xml->XMLWriter()->writeRaw('/>'); //achievement } + $xml->XMLWriter()->writeRaw('>'); + if(isset($achievement['criteria']) && is_array($achievement['criteria'])) { + foreach($achievement['criteria'] as $criteria) { + $xml->XMLWriter()->writeRaw(' $c_value) { + $xml->XMLWriter()->writeRaw(' ' . $c_key . '="' . $c_value . '"'); + } + $xml->XMLWriter()->writeRaw('/>'); //criteria + } + } + if(isset($achievement['achievement_tree'])) { + foreach($achievement['achievement_tree'] as $achievement_tree) { + $xml->XMLWriter()->writeRaw(' $a_tree_value) { + $xml->XMLWriter()->writeRaw(' ' . $a_tree_key . '="' . $a_tree_value . '"'); + } + $xml->XMLWriter()->writeRaw('/>'); //achievement + } + } + $xml->XMLWriter()->writeRaw(''); //achievement } - $xml->XMLWriter()->writeRaw(''); //achievement } } else { @@ -192,43 +262,53 @@ if(isset($achievement['display']) && $achievement['display'] == 0) { continue; } - $xml->XMLWriter()->startElement('achievement'); - if(isset($achievement['data'])) { - foreach($achievement['data'] as $a_data_key => $a_data_value) { - $xml->XMLWriter()->writeAttribute($a_data_key, $a_data_value); + if(is_array($pages)) { + $xml->XMLWriter()->startElement('achievement'); + if(isset($achievement['data'])) { + foreach($achievement['data'] as $a_data_key => $a_data_value) { + $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'); - foreach($criteria as $c_key => $c_value) { - $xml->XMLWriter()->writeAttribute($c_key, $c_value); + for($aCount = 0; $aCount < $pages_count; $aCount++) { + $tmp = $pages[$aCount]; + $xml->XMLWriter()->startElement('c'); + if(isset($tmp['completed'][$achievement['data']['id']])) { + $xml->XMLWriter()->writeAttribute('dateCompleted', $tmp['completed'][$achievement['data']['id']]['data']['dateCompleted']); } - $xml->XMLWriter()->endElement(); //criteria + $xml->XMLWriter()->endElement(); //c } + $xml->XMLWriter()->endElement(); //achievement } 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'); - foreach($achievement_tree as $a_tree_key => $a_tree_value) { - $xml->XMLWriter()->writeAttribute($a_tree_key, $a_tree_value); + $xml->XMLWriter()->startElement('achievement'); + if(isset($achievement['data'])) { + foreach($achievement['data'] as $a_data_key => $a_data_value) { + $xml->XMLWriter()->writeAttribute($a_data_key, $a_data_value); } - $xml->XMLWriter()->endElement(); //achievement } + if(isset($achievement['criteria']) && is_array($achievement['criteria'])) { + foreach($achievement['criteria'] as $criteria) { + $xml->XMLWriter()->startElement('criteria'); + foreach($criteria as $c_key => $c_value) { + $xml->XMLWriter()->writeAttribute($c_key, $c_value); + } + $xml->XMLWriter()->endElement(); //criteria + } + } + if(isset($achievement['achievement_tree'])) { + foreach($achievement['achievement_tree'] as $achievement_tree) { + $xml->XMLWriter()->startElement('achievement'); + foreach($achievement_tree as $a_tree_key => $a_tree_value) { + $xml->XMLWriter()->writeAttribute($a_tree_key, $a_tree_value); + } + $xml->XMLWriter()->endElement(); //achievement + } + } + $xml->XMLWriter()->endElement(); //achievement } - $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(); @@ -266,57 +346,124 @@ $character_element = $characters->GetHeader(); $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).'"'); + if(is_array($comparison)) { + foreach($comparison as $char) { + $xml->XMLWriter()->writeRaw('GetHeader(); + foreach($current_header as $header_key => $header_value) { + if($header_key == 'charUrl') { + $xml->XMLWriter()->writeRaw(' ' . $header_key . '="' . htmlspecialchars($header_value) . '"'); + } + else { + $xml->XMLWriter()->writeRaw(' ' . $header_key .'="' .$header_value.'"'); + } + } + $xml->XMLWriter()->writeRaw('/>'); + } - else { - $xml->XMLWriter()->writeRaw(' ' . $c_elem_name .'="' .$c_elem_value.'"'); + } + else { + $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(''); } - $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(is_array($comparison)) { + foreach($comparison as $char) { + $xml->XMLWriter()->startElement('character'); + $current_header = $char->GetHeader(); + foreach($current_header as $header_key => $header_value) { + $xml->XMLWriter()->writeAttribute($header_key, $header_value); + } + $xml->XMLWriter()->endElement(); //character + } + } + 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()->startElement('modelBasePath'); - $xml->XMLWriter()->writeAttribute('value', 'http://eu.media.battle.net.edgesuite.net/'); - $xml->XMLWriter()->endElement(); //modelBasePath - $xml->XMLWriter()->endElement(); //character } $xml->XMLWriter()->endElement(); //characterInfo $xml->XMLWriter()->startElement('achievements'); $xml->XMLWriter()->startElement('summary'); -$xml->XMLWriter()->startElement('c'); -$info_summary = $achievements->GetSummaryAchievementData(0); -if(is_array($info_summary)) { - foreach($info_summary as $info_key => $info_value) { - $xml->XMLWriter()->writeAttribute($info_key, $info_value); +if(is_array($comparison)) { + foreach($comparison as $char) { + $xml->XMLWriter()->startElement('c'); + $info_summary = $char->GetAchievementMgr()->GetSummaryAchievementData(0); + if(is_array($info_summary)) { + foreach($info_summary as $info_key => $info_value) { + $xml->XMLWriter()->writeAttribute($info_key, $info_value); + } + } + $xml->XMLWriter()->endElement(); //c } } -$xml->XMLWriter()->endElement(); //c +else { + $xml->XMLWriter()->startElement('c'); + $info_summary = $achievements->GetSummaryAchievementData(0); + if(is_array($info_summary)) { + foreach($info_summary as $info_key => $info_value) { + $xml->XMLWriter()->writeAttribute($info_key, $info_value); + } + } + $xml->XMLWriter()->endElement(); //c +} $info_categories = array(92, 96, 97, 95, 168, 169, 201, 155, 81); foreach($info_categories as $achievement_category) { $xml->XMLWriter()->startElement('category'); - $current_category = $achievements->GetSummaryAchievementData($achievement_category); - if($current_category) { - if($utils->IsWriteRaw()) { - $xml->XMLWriter()->writeRaw(' $category_value) { - $xml->XMLWriter()->writeRaw(' ' . $category_key .'="' . $category_value . '"'); + if(is_array($comparison)) { + foreach($comparison as $char) { + $comp_category = $char->GetAchievementMgr()->GetSummaryAchievementData($achievement_category); + if($comp_category) { + if($utils->IsWriteRaw()) { + $xml->XMLWriter()->writeRaw(' $comp_cat_value) { + $xml->XMLWriter()->writeRaw(' ' . $comp_cat_key . '="' . $comp_cat_value . '"'); + } + $xml->XMLWriter()->writeRaw('/>'); //c + } + else { + $xml->XMLWriter()->startElement('c'); + foreach($comp_category as $comp_cat_key => $comp_cat_value) { + $xml->XMLWriter()->writeAttribute($comp_cat_key, $comp_cat_value); + } + $xml->XMLWriter()->endElement(); //c + } } - $xml->XMLWriter()->writeRaw('/>'); //c } - else { - $xml->XMLWriter()->startElement('c'); - foreach($current_category as $category_key => $category_value) { - $xml->XMLWriter()->writeAttribute($category_key, $category_value); + } + else { + $current_category = $achievements->GetSummaryAchievementData($achievement_category); + if($current_category) { + if($utils->IsWriteRaw()) { + $xml->XMLWriter()->writeRaw(' $category_value) { + $xml->XMLWriter()->writeRaw(' ' . $category_key .'="' . $category_value . '"'); + } + $xml->XMLWriter()->writeRaw('/>'); //c + } + else { + $xml->XMLWriter()->startElement('c'); + foreach($current_category as $category_key => $category_value) { + $xml->XMLWriter()->writeAttribute($category_key, $category_value); + } + $xml->XMLWriter()->endElement(); //c } - $xml->XMLWriter()->endElement(); //c } } $xml->XMLWriter()->endElement(); //category diff --git a/includes/classes/class.armory.php b/includes/classes/class.armory.php index d284be036..f2b4a9533 100644 --- a/includes/classes/class.armory.php +++ b/includes/classes/class.armory.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release Candidate 1 - * @revision 357 + * @revision 366 * @copyright (c) 2009-2010 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -83,7 +83,14 @@ public function Armory() { $this->aDB = new ArmoryDatabaseHandler($this->mysqlconfig['host_armory'], $this->mysqlconfig['user_armory'], $this->mysqlconfig['pass_armory'], $this->mysqlconfig['name_armory'], $this->mysqlconfig['charset_armory'], $this->Log(), $this->armoryconfig['db_prefix']); $this->rDB = new ArmoryDatabaseHandler($this->mysqlconfig['host_realmd'], $this->mysqlconfig['user_realmd'], $this->mysqlconfig['pass_realmd'], $this->mysqlconfig['name_realmd'], $this->mysqlconfig['charset_realmd'], $this->Log()); if(isset($_GET['r'])) { - $realmName = urldecode($_GET['r']); + if(preg_match('/,/', $_GET['r'])) { + // Achievements/statistics comparison + $rData = explode(',', $_GET['r']); + $realmName = urldecode($rData[0]); + } + else { + $realmName = urldecode($_GET['r']); + } $realm_info = $this->aDB->selectRow("SELECT `id`, `version` FROM `ARMORYDBPREFIX_realm_data` WHERE `name`='%s'", $realmName); if(isset($this->realmData[$realm_info['id']])) { $this->connectionData = $this->realmData[$realm_info['id']]; @@ -102,10 +109,10 @@ public function Armory() { $this->wDB = new ArmoryDatabaseHandler($realm_info['host_world'], $realm_info['user_world'], $realm_info['pass_world'], $realm_info['name_world'], $realm_info['charset_world'], $this->Log()); } if(!$this->currentRealmInfo) { - $this->currentRealmInfo = array('name' => $this->realmData[1]['name'], 'id' => 1, 'type' => $this->realmData[1]['type'], 'connected' => true); + $this->currentRealmInfo = array('name' => $realm_info['name'], 'id' => 1, 'type' => $realm_info['type'], 'connected' => true); } if(!$this->connectionData) { - $this->connectionData = $this->realmData[1]; + $this->connectionData = $realm_info; } if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $user_locale = strtolower(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2)); diff --git a/includes/classes/class.characters.php b/includes/classes/class.characters.php index 6b2b764f0..992726361 100644 --- a/includes/classes/class.characters.php +++ b/includes/classes/class.characters.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release Candidate 1 - * @revision 365 + * @revision 366 * @copyright (c) 2009-2010 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -669,6 +669,10 @@ public function GetMoney() { } public function GetAchievementMgr() { + if(!is_object($this->m_achievementMgr)) { + $this->m_achievementMgr = new Achievements; + $this->m_achievementMgr->InitAchievements($this->GetGUID(), $this->db, true); + } return $this->m_achievementMgr; } diff --git a/includes/classes/class.utils.php b/includes/classes/class.utils.php index 12fac8cdb..b99996e1d 100644 --- a/includes/classes/class.utils.php +++ b/includes/classes/class.utils.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release Candidate 1 - * @revision 365 + * @revision 366 * @copyright (c) 2009-2010 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -901,6 +901,9 @@ public function IsRealm($rName) { * @return array **/ public function GetRealmIdByName($rName) { + if($realms = explode(',', $rName)) { + $rName = $realms[0]; + } return self::IsRealm($rName); } @@ -1034,7 +1037,6 @@ public function IsWriteRaw() { public function IsAchievementsComparison($returnFirstRealmName = false) { if(!isset($_GET['r']) || (!isset($_GET['cn']) && !isset($_GET['n']))) { - $this->Log()->writeError('%s : realms names or characters names not provided', __METHOD__); return false; } $realms = explode(',', $_GET['r']); @@ -1045,7 +1047,6 @@ public function IsAchievementsComparison($returnFirstRealmName = false) { $chars = explode(',', $_GET['cn']); } if(!is_array($realms) || !is_array($chars)) { - $this->Log()->writeError('%s : wrong data', __METHOD__); return false; } $countR = count($realms); @@ -1061,7 +1062,7 @@ public function IsAchievementsComparison($returnFirstRealmName = false) { $data = array(); for($i = 0; $i < $totalCount; $i++) { if(!isset($realms[$i]) || !isset($chars[$i])) { - $this->Log()->writeError('%s : missed data for %d count, ignore.', __METHOD__, $i); + $this->Log()->writeError('%s : missed data for %d loop, ignore.', __METHOD__, $i); continue; } $data[$i] = array('name' => $chars[$i], 'realm' => $realms[$i]); diff --git a/includes/revision_nr.php b/includes/revision_nr.php index 01d1402f2..1121656cd 100644 --- a/includes/revision_nr.php +++ b/includes/revision_nr.php @@ -1,5 +1,5 @@ \ No newline at end of file