Exemple #1
0
         case 'tooltip':
             $Smarty->assign('Specializations', Characters::GetSpecByTalents($CharacterData['guid']));
             $Smarty->display('blocks/character_tooltip');
             break;
         case 'simple':
             $RedirectTo = str_replace('/simple', '', str_replace('//', '/', $_SERVER['REQUEST_URI'] . '/advanced'));
             header('Location: ' . $RedirectTo);
             break;
         case 'pvp':
             $Smarty->assign('ArenaRating', Characters::GetPVPRaiting($CharacterData['guid']));
             $Smarty->assign('Page', Page::Info('community', array('bodycss' => 'character-pvp', 'pagetitle' => 'PvP - ' . $Smarty->GetConfigVars('Menu_Community') . ' - ')));
             $Smarty->display('pages/character_pvp');
             break;
         case 'advanced':
             $Smarty->translate('Raids');
             $Raids = array('Classic' => Raids::GetRaids($CharacterData['guid'], 0, false), 'TBC' => Raids::GetRaids($CharacterData['guid'], 1, false), 'WotLK' => Raids::GetRaids($CharacterData['guid'], 2, true));
             $Professions = Characters::GetCharacterProfessions($CharacterData['guid']);
             $Smarty->assign('PageType', $_REQUEST['lastcategory']);
             $Smarty->assign('Specializations', Characters::GetSpecByTalents($CharacterData['guid']));
             $Smarty->assign('Inventory', Characters::GetGearForCharacter($CharacterData['guid']));
             $Smarty->assign('Glyphs', Characters::GetCharacterGlyphs($CharacterData['guid']));
             $Smarty->assign('ArenaRating', Characters::GetPVPRaiting($CharacterData['guid']));
             $Smarty->assign('Professions', $Professions);
             $Smarty->assign('Raids', $Raids);
             $Smarty->assign('Page', Page::Info('community', array('bodycss' => 'profile_page', 'pagetitle' => $_REQUEST['subcategory'] . ' - ')));
             $Smarty->display('pages/character_main_page_advanced');
             break;
     }
 } else {
     $RedirectTo = str_replace('//', '/', $_SERVER['REQUEST_URI'] . '/advanced');
     header('Location: ' . $RedirectTo);
 public static function GetNormalRaidsManyBosses($CharacterGUID, $Expansion, $Instance, $Bosses, $Criteria, $Heroic)
 {
     global $FCCore;
     $ParametersIDs = ':id_' . implode(',:id_', array_keys($Criteria));
     $IDsAndValues = array_combine(explode(",", $ParametersIDs), $Criteria);
     $IDsAndValues = String::UnshiftAssoc($IDsAndValues, ':guid', $CharacterGUID);
     $HTML = "";
     $RaidData = array();
     $CharactersSQL = "SELECT cap.*, fa.value1 as bossid FROM character_achievement_progress cap LEFT JOIN " . $FCCore['Database']['database'] . ".freedomcore_achievementcriteria fa ON cap.criteria = fa.id WHERE guid = :guid AND criteria IN (" . $ParametersIDs . ")";
     $CharactersData = Characters::$CharConnection->prepare($CharactersSQL);
     $CharactersData->execute($IDsAndValues);
     $Result = $CharactersData->fetchAll(PDO::FETCH_ASSOC);
     $BossKills = 0;
     if (empty($Result)) {
         $AchievementsPerBoss = count($Criteria) / count($Bosses);
         $BossID = 0;
         $CriteriaID = 0;
         $ArrayIndex = 0;
         $RaidData['guid'] = $CharacterGUID;
         $RaidData['expansion'] = $Expansion;
         $RaidData['instance'] = $Instance;
         foreach ($Bosses as $Boss) {
             $BossCriteria = array_slice($Criteria, 0, 2);
             if (is_numeric($Boss)) {
                 if (strlen((string) $Boss) == 6) {
                     $RaidData['npcs'][$ArrayIndex] = Raids::GetObjectInfo($Boss);
                 } else {
                     $RaidData['npcs'][$ArrayIndex] = Raids::GetNPCInfo($Boss);
                 }
             } else {
                 $RaidData['npcs'][$ArrayIndex] = array('name' => $Boss);
             }
             $RaidData['npcs'][$ArrayIndex]['counter'] = 0;
             unset($Criteria[0]);
             unset($Criteria[1]);
             $Criteria = array_values($Criteria);
             $CriteriaID++;
             $ArrayIndex++;
         }
         $HTML .= Raids::CreateSimpleHTML($Instance, 'incomplete') . PHP_EOL;
     } else {
         $BossesInInstance = count($Bosses);
         $DataForBosses = count($Result);
         $RaidData['guid'] = $CharacterGUID;
         $RaidData['expansion'] = $Expansion;
         $RaidData['instance'] = $Instance;
         $BossID = 0;
         foreach ($Bosses as $Boss) {
             $BossKills = 0;
             foreach ($Result as $Data) {
                 if ($Boss == $Data['bossid']) {
                     $BossCriteriaPortion = array_slice($Criteria, $BossID * 2, 2);
                     if (in_array($Data['criteria'], $BossCriteriaPortion)) {
                         $BossKills = $BossKills + $Data['counter'];
                         if (is_numeric($Boss)) {
                             if (strlen((string) $Boss) == 6) {
                                 $RaidData['npcs'][$BossID] = Raids::GetObjectInfo($Boss);
                             } else {
                                 $RaidData['npcs'][$BossID] = Raids::GetNPCInfo($Boss);
                             }
                         } else {
                             $RaidData['npcs'][$BossID] = array('name' => $Boss);
                         }
                         $RaidData['npcs'][$BossID]['counter'] = $BossKills;
                     }
                 } else {
                     if (is_numeric($Boss)) {
                         if (strlen((string) $Boss) == 6) {
                             $RaidData['npcs'][$BossID] = Raids::GetObjectInfo($Boss);
                         } else {
                             $RaidData['npcs'][$BossID] = Raids::GetNPCInfo($Boss);
                         }
                     } else {
                         $RaidData['npcs'][$BossID] = array('name' => $Boss);
                     }
                     $RaidData['npcs'][$BossID]['counter'] = 0;
                 }
             }
             $BossID++;
         }
         if ($BossesInInstance == $DataForBosses) {
             $HTML .= Raids::CreateSimpleHTML($Instance, 'completed') . PHP_EOL;
         } else {
             $HTML .= Raids::CreateSimpleHTML($Instance, 'in-progress') . PHP_EOL;
         }
     }
     return array('data' => $RaidData, 'html' => $HTML);
 }