Skip to content

Commit

Permalink
[65] Fixes in character achievements displaying
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadez committed Feb 8, 2010
1 parent 40c43ba commit 3709217
Show file tree
Hide file tree
Showing 16 changed files with 2,915 additions and 151 deletions.
54 changes: 35 additions & 19 deletions achievements-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 61
* @revision 65
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand All @@ -30,21 +30,24 @@
if(!@include('includes/armory_loader.php')) {
die('<b>Fatal error:</b> can not load main system files!');
}

$characters->name = Utils::escape($_GET['cn']);
$achievementsCategory = (int) $_GET['c'];
$characters->_structCharacter();
$faction = ($characters->faction == 1) ? 0 : 1;
if(empty($characters->name) || empty($achievementsCategory)) {
if(isset($_GET['cn'])) {
$characters->name = Utils::escape($_GET['cn']);
}
if(isset($_GET['c'])) {
$achievementsCategory = (int) $_GET['c'];
}
if(!$characters->name || !$achievementsCategory) {
die('{"js":{"achievements":"' . $armory->tpl->get_config_vars('armory_character_achievements_unable_to_load') . '"},"text":""}');
}
$characters->_structCharacter();
$faction = ($characters->faction == 1) ? 0 : 1;
$query = $armory->aDB->select("
SELECT `id`, `parentAchievement`, `name_".$_locale."`, `description_".$_locale."`, `points`, `iconname`, `titleReward_".$_locale."`
SELECT `id`, `parentAchievement`, `name_".$_locale."`, `description_".$_locale."`, `points`, `categoryId`, `iconname`, `titleReward_".$_locale."`
FROM `armory_achievement`
WHERE `categoryId`=? AND `factionFlag` IN (?, '-1')", $achievementsCategory, $faction);
$cc = $armory->aDB->selectPage($totalCount,
"SELECT `id`
FROM `armory_achievement`
$totalCount = $armory->aDB->selectCell("
SELECT COUNT(`id`)
FROM `armory_achievement`
WHERE `categoryId`=? AND `factionFlag` IN (?, '-1')", $achievementsCategory, $faction);
$total = 0;
$string = '';
Expand All @@ -56,7 +59,7 @@
$completed = $achievements->GetAchievementDate();
if(!empty($completed)) {
$string .= "<div class='achievement' id='ach".$ach['id']."' onclick='Armory.Achievements.select(this, true)'>";
if($achievementsCategory!=81) {
if($achievementsCategory != 81) { // 'Feats of Strenght' category do not have achievement points
$string .= "<div class='pointshield'><div>".$ach['points']."</div></div>";
}
$string .= "<div class='firsts_icon' style='background-image:url(&quot;/wow-icons/_images/51x51/".$ach['iconname'].".jpg&quot;)'><img class='p' src='images/achievements/fst_iconframe.png'/></div><div class='achv_title'>".$ach['name_'.$_locale]."</div><div class='achv_desc'>".$ach['description_'.$_locale]."</div>";
Expand All @@ -69,17 +72,30 @@
$total++;
}
else {
if($achievementsCategory!=81) {
$uncompleted .= "<div class='achievement locked' id='ach".$ach['id']."' onclick='Armory.Achievements.select(this, true)'><div class='pointshield'><div>".$ach['points']."</div></div><div class='firsts_icon' style='background-image:url(&quot;/wow-icons/_images/51x51/".$ach['iconname'].".jpg&quot;)'><img class='p' src='images/achievements/fst_iconframe.png'/></div><div class='achv_title'>".$ach['name_'.$_locale]."</div><div class='achv_desc'>".$ach['description_'.$_locale]."</div>";
$uncompleted .= $achievements->AchievementProgress();
if(!empty($ach['titleReward_'.$_locale])) {
$uncompleted .="<br clear='all' /><div class='achv_reward_bg'>".$ach['titleReward_'.$_locale]."</div>";
if($achievementsCategory != 81) { // Do not show incompleted achievements in 'Feats of Strenght' category
if($ach['parentAchievement'] > 0) {
if($achievements->IsAchievementCompleted($ach['parentAchievement'])) {
$uncompleted .= "<div class='achievement locked' id='ach".$ach['id']."' onclick='Armory.Achievements.select(this, true)'><div class='pointshield'><div>".$ach['points']."</div></div><div class='firsts_icon' style='background-image:url(&quot;/wow-icons/_images/51x51/".$ach['iconname'].".jpg&quot;)'><img class='p' src='images/achievements/fst_iconframe.png'/></div><div class='achv_title'>".$ach['name_'.$_locale]."</div><div class='achv_desc'>".$ach['description_'.$_locale]."</div>";
$uncompleted .= $achievements->AchievementProgress();
if(!empty($ach['titleReward_'.$_locale])) {
$uncompleted .= "<br clear='all' /><div class='achv_reward_bg'>".$ach['titleReward_'.$_locale]."</div>";
}
$uncompleted .= "<br clear='all'/></div>";
}
}
else {
$uncompleted .= "<div class='achievement locked' id='ach".$ach['id']."' onclick='Armory.Achievements.select(this, true)'><div class='pointshield'><div>".$ach['points']."</div></div><div class='firsts_icon' style='background-image:url(&quot;/wow-icons/_images/51x51/".$ach['iconname'].".jpg&quot;)'><img class='p' src='images/achievements/fst_iconframe.png'/></div><div class='achv_title'>".$ach['name_'.$_locale]."</div><div class='achv_desc'>".$ach['description_'.$_locale]."</div>";
$uncompleted .= $achievements->AchievementProgress();
if(!empty($ach['titleReward_'.$_locale])) {
$uncompleted .= "<br clear='all' /><div class='achv_reward_bg'>".$ach['titleReward_'.$_locale]."</div>";
}
$uncompleted .= "<br clear='all'/></div>";
}
$uncompleted .= "<br clear='all'/></div>";

}
}
}
if($achievementsCategory!=81) {
if($achievementsCategory != 81) { // Do not show progress bar in 'Feats of Strenght' category
$prestring = "<div><div><div><div class='prog_bar '><div class='progress_cap'><!----></div><div class='progress_cap_r' style='background-position:bottom'><!----></div><div class='progress_int'><div class='progress_fill' style='width:".$achievements->CountAchievementPercent($total, 1)."%'><!----></div><div class='prog_int_text'>".$total." / ".$totalCount."</div></div></div></div>";
}
echo '{"js":{"achievements":"'.$prestring.$string;
Expand Down
13 changes: 7 additions & 6 deletions character-achievements.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 48
* @revision 65
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand All @@ -30,7 +30,7 @@
if(!@include('includes/armory_loader.php')) {
die('<b>Fatal error:</b> can not load main system files!');
}
// Доп. лист стилей
// Additional CSS
$armory->tpl->assign('addCssSheet', '@import "_css/int.css";');

if(isset($_GET['n'])) {
Expand All @@ -40,16 +40,16 @@
$charname = $_GET['cn'];
}
$characters->name = Utils::escape($charname);
// Проверка
// Check
if(!$characters->IsCharacter()) {
$armory->ArmoryError($armory->tpl->get_config_vars('armory_error_profile_unavailable_title'), $armory->tpl->get_config_vars('armory_error_profile_unavailable_text'));
}
// Все нормально, генерируем основные параметры чарактера
// All ok, generate basic character info
$characters->_structCharacter();
$achievements->guid = $characters->guid;
$guilds->guid = $characters->guid;

// Передаем параметры шаблонизатору
// Send data to Smarty
$armory->tpl->assign('class', $characters->class);
$armory->tpl->assign('race', $characters->race);
$armory->tpl->assign('name', $characters->name);
Expand Down Expand Up @@ -77,9 +77,10 @@
$armory->tpl->assign('achievementsTree', $achievements->buildAchievementsTree()); // Achievement categories
$armory->tpl->assign('characterArenaTeamInfoButton', $characters->getCharacterArenaTeamInfo(true));

/*** Звание ***/
/*** Character Title ***/
$charTitle = $characters->GetCharacterTitle();
$armory->tpl->assign('character_title_'.$charTitle['place'], $charTitle['title']);
$armory->tpl->assign('titleName', $characters->name);

$armory->tpl->display('overall_header.tpl');
$armory->tpl->display('character_sheet_start.tpl');
Expand Down
14 changes: 7 additions & 7 deletions character-reputation.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 48
* @revision 65
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand All @@ -30,7 +30,7 @@
if(!@include('includes/armory_loader.php')) {
die('<b>Fatal error:</b> can not load main system files!');
}
// Доп. лист стилей
// Additional CSS
$armory->tpl->assign('addCssSheet', '@import "_css/int.css";');

if(isset($_GET['n'])) {
Expand All @@ -40,16 +40,16 @@
$charname = $_GET['cn'];
}
$characters->name = Utils::escape($charname);
// Проверка
// Check
if(!$characters->IsCharacter()) {
$armory->ArmoryError($armory->tpl->get_config_vars('armory_error_profile_unavailable_title'), $armory->tpl->get_config_vars('armory_error_profile_unavailable_text'));
}
// Все нормально, генерируем основные параметры чарактера
// All ok, generate basic character info
$characters->_structCharacter();
$achievements->guid = $characters->guid;
$guilds->guid = $characters->guid;

// Передаем параметры шаблонизатору
// Send data to Smarty
$armory->tpl->assign('class', $characters->class);
$armory->tpl->assign('race', $characters->race);
$armory->tpl->assign('name', $characters->name);
Expand All @@ -63,7 +63,7 @@
$armory->tpl->assign('guildName', $guilds->getGuildName());
}

/*** Звание ***/
/*** Character Title ***/
$charTitle = $characters->GetCharacterTitle();
$armory->tpl->assign('character_title_'.$charTitle['place'], $charTitle['title']);

Expand All @@ -75,7 +75,7 @@ function cmp($a, $b) {
usort($rep, "cmp");
$armory->tpl->assign('repList', $rep);
$armory->tpl->assign('characterArenaTeamInfoButton', $characters->getCharacterArenaTeamInfo(true));

$armory->tpl->assign('titleName', $characters->name);
$armory->tpl->assign('tpl2include', 'character_reputation');
$armory->tpl->display('overall_header.tpl');
$armory->tpl->display('character_sheet_start.tpl');
Expand Down
3 changes: 2 additions & 1 deletion character-sheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 59
* @revision 65
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand Down Expand Up @@ -155,6 +155,7 @@
/*** Character Title ***/
// TODO: show commas
$charTitle = $characters->GetCharacterTitle();
$armory->tpl->assign('titleName', $characters->name);
$armory->tpl->assign('characterArenaTeamInfo', $characters->getCharacterArenaTeamInfo());
$armory->tpl->assign('characterArenaTeamInfoButton', $characters->getCharacterArenaTeamInfo(true));
$armory->tpl->assign('character_title_'.$charTitle['place'], $charTitle['title']);
Expand Down
3 changes: 2 additions & 1 deletion character-talents.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 61
* @revision 65
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand Down Expand Up @@ -163,6 +163,7 @@
$armory->tpl->assign('characterArenaTeamInfoButton', $characters->getCharacterArenaTeamInfo(true));

$charTitle = $characters->GetCharacterTitle();
$armory->tpl->assign('titleName', $characters->name);
$armory->tpl->assign('character_title_'.$charTitle['place'], $charTitle['title']);

$armory->tpl->display('overall_header.tpl');
Expand Down
5 changes: 3 additions & 2 deletions guild-bank-contents.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 49
* @revision 65
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand Down Expand Up @@ -38,7 +38,7 @@
header('Location: login.xml?guild-bank-contents');
}
$guilds->_structGuildInfo();
// Доп. лист стилей
// Additional CSS
$armory->tpl->assign('addCssSheet', '@import "_css/int.css";');

$armory->tpl->assign('guildName', $guilds->guildName);
Expand All @@ -55,6 +55,7 @@
$armory->tpl->assign('GuildBankMoney', $guilds->getGuildBankMoney());
$armory->tpl->assign('GuildBankItemList', $guilds->BuildGuildBankItemList());

$armory->tpl->assign('titleName', $guilds->guildName);
$armory->tpl->assign('tpl2include', 'guild_bank_contents');
$armory->tpl->display('overall_header.tpl');
$armory->tpl->display('overall_start.tpl');
Expand Down
5 changes: 3 additions & 2 deletions guild-info.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 30
* @revision 65
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand Down Expand Up @@ -36,7 +36,7 @@
die();
}
$guilds->_structGuildInfo();
// Доп. лист стилей
// Additional CSS
$armory->tpl->assign('addCssSheet', '@import "_css/int.css";');

$armory->tpl->assign('guildName', $guilds->guildName);
Expand All @@ -50,6 +50,7 @@
$armory->tpl->assign('guildList', $guilds->buildGuildList());
$armory->tpl->assign('gFaction', $guilds->guildFaction);

$armory->tpl->assign('titleName', $guilds->guildName);
$armory->tpl->assign('tpl2include', 'guild_sheet_info');
$armory->tpl->display('overall_header.tpl');
$armory->tpl->display('overall_start.tpl');
Expand Down
5 changes: 3 additions & 2 deletions guild-stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 30
* @revision 65
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand Down Expand Up @@ -36,7 +36,7 @@
die();
}
$guilds->_structGuildInfo();
// Доп. лист стилей
// Additional CSS
$armory->tpl->assign('addCssSheet', '@import "_css/int.css";');

$armory->tpl->assign('guildName', $guilds->guildName);
Expand All @@ -48,6 +48,7 @@
$armory->tpl->assign('guildEmblemStyle', $guilds->guildtabard);
$armory->tpl->assign('statList', $guilds->BuildStatsList());

$armory->tpl->assign('titleName', $guilds->guildName);
$armory->tpl->assign('tpl2include', 'guild_stats');
$armory->tpl->display('overall_header.tpl');
$armory->tpl->display('overall_start.tpl');
Expand Down
2 changes: 1 addition & 1 deletion includes/UpdateFields330.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

// Auto generated for version 3.3.0.11159
// Auto generated for version 3.3.2.11403

define('OBJECT_FIELD_GUID', 0x0000); // Size: 2, Type: LONG, Flags: PUBLIC
define('OBJECT_FIELD_TYPE', 0x0002); // Size: 1, Type: INT, Flags: PUBLIC
Expand Down
2 changes: 1 addition & 1 deletion includes/armory_loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
die('<b>Error:</b> can not load connector class!');
}

define('DB_VERSION', 'armory_r64');
define('DB_VERSION', 'armory_r65');
$armory = new Connector;
$armory->tpl->template_dir = 'includes/template/';
$armory->tpl->compile_dir = 'includes/cache/';
Expand Down
Loading

0 comments on commit 3709217

Please sign in to comment.