diff --git a/character-achievements.php b/character-achievements.php index 622eea333..966e76077 100644 --- a/character-achievements.php +++ b/character-achievements.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release Candidate 1 - * @revision 122 + * @revision 147 * @copyright (c) 2009-2010 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -158,6 +158,16 @@ exit; } +/** Basic info **/ +$guilds->guid = $characters->guid; +if($isCharacter && $guilds->extractPlayerGuildId()) { + $tabUrl = sprintf('r=%s&cn=%s&gn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name), urlencode($guilds->getGuildName())); + $charTabUrl = sprintf('r=%s&cn=%s&gn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name), urlencode($guilds->getGuildName())); +} +elseif($isCharacter) { + $tabUrl = sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)); + $charTabUrl = sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)); +} /** Header **/ $xml->XMLWriter()->startElement('page'); $xml->XMLWriter()->writeAttribute('globalSearch', 1); @@ -167,7 +177,7 @@ $xml->XMLWriter()->writeAttribute('subTab', 'achievements'); $xml->XMLWriter()->writeAttribute('tab', 'character'); $xml->XMLWriter()->writeAttribute('tabGroup', 'character'); -$xml->XMLWriter()->writeAttribute('tabUrl', ($characters->IsCharacter()) ? sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)) : '' ); +$xml->XMLWriter()->writeAttribute('tabUrl', $tabUrl); $xml->XMLWriter()->endElement(); //tabInfo if(!$isCharacter) { $xml->XMLWriter()->startElement('characterInfo'); @@ -178,14 +188,6 @@ echo $xml_cache_data; exit; } -/** Basic info **/ -$guilds->guid = $characters->guid; -if($guilds->extractPlayerGuildId()) { - $charTabUrl = sprintf('r=%s&cn=%s&gn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name), urlencode($guilds->getGuildName())); -} -else { - $charTabUrl = sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)); -} $characters->GetCharacterTitle(); $character_element = array( 'battleGroup' => $armory->armoryconfig['defaultBGName'], diff --git a/character-arenateams.php b/character-arenateams.php index 46d39cc18..7897de7b7 100644 --- a/character-arenateams.php +++ b/character-arenateams.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release Candidate 1 - * @revision 122 + * @revision 147 * @copyright (c) 2009-2010 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -52,6 +52,18 @@ echo sprintf('', $cache_id); exit; } +}/** Basic info **/ +$characters->_structCharacter(); +$achievements->guid = $characters->guid; +$guilds->guid = $characters->guid; +$arenateams->guid = $characters->guid; +if($isCharacter && $guilds->extractPlayerGuildId()) { + $tabUrl = sprintf('r=%s&cn=%s&gn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name), urlencode($guilds->getGuildName())); + $charTabUrl = sprintf('r=%s&cn=%s&gn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name), urlencode($guilds->getGuildName())); +} +elseif($isCharacter) { + $tabUrl = sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)); + $charTabUrl = sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)); } /** Header **/ $xml->XMLWriter()->startElement('page'); @@ -62,7 +74,7 @@ $xml->XMLWriter()->writeAttribute('subTab', 'arena'); $xml->XMLWriter()->writeAttribute('tab', 'character'); $xml->XMLWriter()->writeAttribute('tabGroup', 'character'); -$xml->XMLWriter()->writeAttribute('tabUrl', ($characters->IsCharacter()) ? sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)) : '' ); +$xml->XMLWriter()->writeAttribute('tabUrl', $tabUrl); $xml->XMLWriter()->endElement(); //tabInfo if(!$isCharacter) { $xml->XMLWriter()->startElement('characterInfo'); @@ -73,17 +85,6 @@ echo $xml_cache_data; exit; } -/** Basic info **/ -$characters->_structCharacter(); -$achievements->guid = $characters->guid; -$guilds->guid = $characters->guid; -$arenateams->guid = $characters->guid; -if($guilds->extractPlayerGuildId()) { - $charTabUrl = sprintf('r=%s&cn=%s&gn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name), urlencode($guilds->getGuildName())); -} -else { - $charTabUrl = sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)); -} $characters->GetCharacterTitle(); $character_element = array( // TODO: add GetLocaleString() method diff --git a/character-calendar.php b/character-calendar.php index 5bc3f0432..24a3d8de2 100644 --- a/character-calendar.php +++ b/character-calendar.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release Candidate 1 - * @revision 122 + * @revision 147 * @copyright (c) 2009-2010 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -52,6 +52,16 @@ exit; } } +/** Basic info **/ +$guilds->guid = $characters->guid; +if($isCharacter && $guilds->extractPlayerGuildId()) { + $tabUrl = sprintf('r=%s&cn=%s&gn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name), urlencode($guilds->getGuildName())); + $charTabUrl = sprintf('r=%s&cn=%s&gn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name), urlencode($guilds->getGuildName())); +} +elseif($isCharacter) { + $tabUrl = sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)); + $charTabUrl = sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)); +} /** Header **/ // Load XSLT template $xml->LoadXSLT('character/calendar.xsl'); @@ -63,7 +73,7 @@ $xml->XMLWriter()->writeAttribute('subTab', 'calendar'); $xml->XMLWriter()->writeAttribute('tab', 'character'); $xml->XMLWriter()->writeAttribute('tabGroup', 'character'); -$xml->XMLWriter()->writeAttribute('tabUrl', ($characters->IsCharacter()) ? sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)) : '' ); +$xml->XMLWriter()->writeAttribute('tabUrl', $tabUrl); $xml->XMLWriter()->endElement(); //tabInfo if(!$isCharacter) { $xml->XMLWriter()->startElement('characterInfo'); @@ -74,14 +84,6 @@ echo $xml_cache_data; exit; } -/** Basic info **/ -$guilds->guid = $characters->guid; -if($guilds->extractPlayerGuildId()) { - $charTabUrl = sprintf('r=%s&cn=%s&gn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name), urlencode($guilds->getGuildName())); -} -else { - $charTabUrl = sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)); -} $characters->GetCharacterTitle(); $character_element = array( // TODO: add GetLocaleString() method diff --git a/character-reputation.php b/character-reputation.php index 0d4b47300..2975893c3 100644 --- a/character-reputation.php +++ b/character-reputation.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release Candidate 1 - * @revision 122 + * @revision 147 * @copyright (c) 2009-2010 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -54,6 +54,16 @@ } // Load XSLT template $xml->LoadXSLT('character/reputation.xsl'); +/** Basic info **/ +$guilds->guid = $characters->guid; +if($isCharacter && $guilds->extractPlayerGuildId()) { + $tabUrl = sprintf('r=%s&cn=%s&gn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name), urlencode($guilds->getGuildName())); + $charTabUrl = sprintf('r=%s&cn=%s&gn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name), urlencode($guilds->getGuildName())); +} +elseif($isCharacter) { + $tabUrl = sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)); + $charTabUrl = sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)); +} /** Header **/ $xml->XMLWriter()->startElement('page'); $xml->XMLWriter()->writeAttribute('globalSearch', 1); @@ -63,7 +73,7 @@ $xml->XMLWriter()->writeAttribute('subTab', 'reputation'); $xml->XMLWriter()->writeAttribute('tab', 'character'); $xml->XMLWriter()->writeAttribute('tabGroup', 'character'); -$xml->XMLWriter()->writeAttribute('tabUrl', ($characters->IsCharacter()) ? sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)) : '' ); +$xml->XMLWriter()->writeAttribute('tabUrl', $tabUrl); $xml->XMLWriter()->endElement(); //tabInfo if(!$isCharacter) { $xml->XMLWriter()->startElement('characterInfo'); @@ -74,14 +84,6 @@ echo $xml_cache_data; exit; } -/** Basic info **/ -$guilds->guid = $characters->guid; -if($guilds->extractPlayerGuildId()) { - $charTabUrl = sprintf('r=%s&cn=%s&gn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name), urlencode($guilds->getGuildName())); -} -else { - $charTabUrl = sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)); -} $characters->GetCharacterTitle(); $character_element = array( // TODO: add GetLocaleString() method diff --git a/character-sheet.php b/character-sheet.php index 6dfca4aa6..8d7854f90 100644 --- a/character-sheet.php +++ b/character-sheet.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release Candidate 1 - * @revision 138 + * @revision 147 * @copyright (c) 2009-2010 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -55,6 +55,19 @@ } // Load XSLT template $xml->LoadXSLT('character/sheet.xsl'); +/** Basic info **/ +$characters->_structCharacter(); +$achievements->guid = $characters->guid; +$guilds->guid = $characters->guid; +$arenateams->guid = $characters->guid; +if($isCharacter && $guilds->extractPlayerGuildId()) { + $tabUrl = sprintf('r=%s&cn=%s&gn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name), urlencode($guilds->getGuildName())); + $charTabUrl = sprintf('r=%s&cn=%s&gn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name), urlencode($guilds->getGuildName())); +} +elseif($isCharacter) { + $tabUrl = sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)); + $charTabUrl = sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)); +} /** Header **/ $xml->XMLWriter()->startElement('page'); $xml->XMLWriter()->writeAttribute('globalSearch', 1); @@ -64,7 +77,7 @@ $xml->XMLWriter()->writeAttribute('subTab', 'profile'); $xml->XMLWriter()->writeAttribute('tab', 'character'); $xml->XMLWriter()->writeAttribute('tabGroup', 'character'); -$xml->XMLWriter()->writeAttribute('tabUrl', ($characters->IsCharacter()) ? sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)) : '' ); +$xml->XMLWriter()->writeAttribute('tabUrl', $tabUrl); $xml->XMLWriter()->endElement(); //tabInfo if(!$isCharacter) { $xml->XMLWriter()->startElement('characterInfo'); @@ -75,17 +88,6 @@ echo $xml_cache_data; exit; } -/** Basic info **/ -$characters->_structCharacter(); -$achievements->guid = $characters->guid; -$guilds->guid = $characters->guid; -$arenateams->guid = $characters->guid; -if($guilds->extractPlayerGuildId()) { - $charTabUrl = sprintf('r=%s&cn=%s&gn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name), urlencode($guilds->getGuildName())); -} -else { - $charTabUrl = sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)); -} $characters->GetCharacterTitle(); $character_element = array( 'battleGroup' => $armory->armoryconfig['defaultBGName'], diff --git a/character-statistics.php b/character-statistics.php index 9e411a3c6..5f292563d 100644 --- a/character-statistics.php +++ b/character-statistics.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release Candidate 1 - * @revision 122 + * @revision 147 * @copyright (c) 2009-2010 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -95,6 +95,16 @@ exit; } +/** Basic info **/ +$guilds->guid = $characters->guid; +if($isCharacter && $guilds->extractPlayerGuildId()) { + $tabUrl = sprintf('r=%s&cn=%s&gn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name), urlencode($guilds->getGuildName())); + $charTabUrl = sprintf('r=%s&cn=%s&gn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name), urlencode($guilds->getGuildName())); +} +elseif($isCharacter) { + $tabUrl = sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)); + $charTabUrl = sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)); +} /** Header **/ $xml->XMLWriter()->startElement('page'); $xml->XMLWriter()->writeAttribute('globalSearch', 1); @@ -104,7 +114,7 @@ $xml->XMLWriter()->writeAttribute('subTab', 'statistics'); $xml->XMLWriter()->writeAttribute('tab', 'character'); $xml->XMLWriter()->writeAttribute('tabGroup', 'character'); -$xml->XMLWriter()->writeAttribute('tabUrl', ($characters->IsCharacter()) ? sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)) : '' ); +$xml->XMLWriter()->writeAttribute('tabUrl', $tabUrl); $xml->XMLWriter()->endElement(); //tabInfo if(!$isCharacter) { $xml->XMLWriter()->startElement('characterInfo'); @@ -115,14 +125,6 @@ echo $xml_cache_data; exit; } -/** Basic info **/ -$guilds->guid = $characters->guid; -if($guilds->extractPlayerGuildId()) { - $charTabUrl = sprintf('r=%s&cn=%s&gn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name), urlencode($guilds->getGuildName())); -} -else { - $charTabUrl = sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)); -} $characters->GetCharacterTitle(); $character_element = array( // TODO: add GetLocaleString() method diff --git a/character-talents.php b/character-talents.php index d887fd301..34b8e1848 100644 --- a/character-talents.php +++ b/character-talents.php @@ -3,7 +3,7 @@ /** * @package World of Warcraft Armory * @version Release Candidate 1 - * @revision 122 + * @revision 147 * @copyright (c) 2009-2010 Shadez * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -52,6 +52,18 @@ exit; } } +/** Basic info **/ +$characters->_structCharacter(); +$achievements->guid = $characters->guid; +$guilds->guid = $characters->guid; +if($isCharacter && $guilds->extractPlayerGuildId()) { + $tabUrl = sprintf('r=%s&cn=%s&gn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name), urlencode($guilds->getGuildName())); + $charTabUrl = sprintf('r=%s&cn=%s&gn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name), urlencode($guilds->getGuildName())); +} +elseif($isCharacter) { + $tabUrl = sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)); + $charTabUrl = sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)); +} /** Header **/ $xml->XMLWriter()->startElement('page'); $xml->XMLWriter()->writeAttribute('globalSearch', 1); @@ -61,7 +73,7 @@ $xml->XMLWriter()->writeAttribute('subTab', 'talents'); $xml->XMLWriter()->writeAttribute('tab', 'character'); $xml->XMLWriter()->writeAttribute('tabGroup', 'character'); -$xml->XMLWriter()->writeAttribute('tabUrl', ($characters->IsCharacter()) ? sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)) : '' ); +$xml->XMLWriter()->writeAttribute('tabUrl', $tabUrl); $xml->XMLWriter()->endElement(); //tabInfo if(!$isCharacter) { $xml->XMLWriter()->startElement('characterInfo'); @@ -72,16 +84,6 @@ echo $xml_cache_data; exit; } -/** Basic info **/ -$characters->_structCharacter(); -$achievements->guid = $characters->guid; -$guilds->guid = $characters->guid; -if($guilds->extractPlayerGuildId()) { - $charTabUrl = sprintf('r=%s&cn=%s&gn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name), urlencode($guilds->getGuildName())); -} -else { - $charTabUrl = sprintf('r=%s&cn=%s', urlencode($armory->armoryconfig['defaultRealmName']), urlencode($characters->name)); -} $characters->GetCharacterTitle(); $character_element = array( // TODO: add GetLocaleString() method @@ -167,7 +169,7 @@ $xml->XMLWriter()->endElement(); //page $xml_cache_data = $xml->StopXML(); echo $xml_cache_data; -if($armory->armoryconfig['useCache'] == true) { +if($armory->armoryconfig['useCache'] == true && !isset($_GET['skipCache'])) { // Write cache to file $cache_data = $utils->GenerateCacheData($characters->name, $characters->guid, 'character-talents'); $cache_handler = $utils->WriteCache($cache_id, $cache_data, $xml_cache_data);