[MOD][V2.8.1] Adding PlayerCard Achievements
This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.
-
-
Okay, here's what to do (Design the New star)
Search
Replace By
PHP Source Code: ShowPlayerCardPage.class.php
- $sql = "SELECT
- u.username, u.galaxy, u.system, u.planet, u.wons, u.loos, u.draws, u.lostunits, u.desunits, u.ally_id, u.timezone, u.foto,
- p.name,
- s.tech_rank, s.tech_points, s.build_rank, s.build_points, s.defs_rank, s.defs_points, s.fleet_rank, s.fleet_points, s.total_rank, s.total_points,
- a.ally_name
- FROM %%USERS%% u
- INNER JOIN %%PLANETS%% p ON p.id = u.id_planet
- LEFT JOIN %%STATPOINTS%% s ON s.id_owner = u.id AND s.stat_type = 1
- LEFT JOIN %%ALLIANCE%% a ON a.id = u.ally_id
- WHERE u.id = :playerID AND u.universe = :universe;";
PHP Source Code: ShowPlayerCardPage.class.php
- $sql = "SELECT
- u.*,
- p.name,
- s.tech_rank, s.tech_points, s.build_rank, s.build_points, s.defs_rank, s.defs_points, s.fleet_rank, s.fleet_points, s.total_rank, s.total_points,
- a.ally_name
- FROM %%USERS%% u
- INNER JOIN %%PLANETS%% p ON p.id = u.id_planet
- LEFT JOIN %%STATPOINTS%% s ON s.id_owner = u.id AND s.stat_type = 1
- LEFT JOIN %%ALLIANCE%% a ON a.id = u.ally_id
- WHERE u.id = :playerID AND u.universe = :universe;";
PHP Source Code: ShowPlayerCardPage.class.php
- $achievementsList = array();
- if (isModuleAvailable(MODULE_ACHIEVEMENTS)) {
- foreach ($reslist['achievements'] as $Element) {
- $techTreeList = BuildFunctions::requirementsList($query, $PLANET, $Element);
- $elementBonus = BuildFunctions::getAvalibleBonus($Element);
- $achievementsList[$Element] = array(
- 'level' => $query[$resource[$Element]],
- 'maxLevel' => $pricelist[$Element]['max'],
- 'factor' => $pricelist[$Element]['factor'],
- 'elementBonus' => $elementBonus,
- 'AllTech' => $techTreeList,
- 'techacc' => BuildFunctions::isTechnologieAccessible($query, $PLANET, $Element, array()),
- );
- }
- }
Addon
Addon in TPL
Smarty-Template: page.playerCard.default.tpl
- <div class="col-12">
- <div class="card background-border-black-blue shadow">
- <div class="card-body">
- <p class="card-title text-align-center">Achievements</p>
- <div class="row">
- {foreach $achievementsList as $ID => $Element}
- <div
- class="col-2"
- style="text-align: center; margin-bottom: 10px"
- >
- <div>
- <a href="#" onclick="return Dialog.info({$ID})"
- ><img
- src="{$dpath}gebaeude/{$ID}.gif"
- alt="{$LNG.tech.{$ID}}"
- width="50px"
- /></a>
- </div>
- <div>
- <font class="gov6"
- >{$Element.level}/{$Element.maxLevel}</font
- >
- </div>
- </div>
- {/foreach}
- </div>
- </div>
- </div>
- </div>
enjoyThe post was edited 1 time, last by Danter14: Addon code ().
-
thank you
little supports always guide us and help us understand the logic, you are a marvel -
OK, I have integrated it, there is only one thing that needs to be done here, for example, my achievements are all completed, but when I look at another profile, my achievements appear, how else to do it for this, everyone should show the level of achievements they have made, is it possible to do this?
-
for my part it displays the player's completions well with the code I gave you ha the global is missing I add it at the top of the post.
-
thank you now it's done
-
Share
- Facebook 0
- Twitter 0
- Google Plus 0
- Reddit 0
-
Users Online 1
1 Guest