diff --git a/code/web/app/app_achievements/include/ach_render_common.php b/code/web/app/app_achievements/include/ach_render_common.php
index ae7b75035..2c49ac3a7 100644
--- a/code/web/app/app_achievements/include/ach_render_common.php
+++ b/code/web/app/app_achievements/include/ach_render_common.php
@@ -1,9 +1,20 @@
getLang());
+
+ return $t[$cc];
}
?>
\ No newline at end of file
diff --git a/code/web/app/app_achievements/include/ach_render_ig.php b/code/web/app/app_achievements/include/ach_render_ig.php
index 4abf20f83..2718bfbc0 100644
--- a/code/web/app/app_achievements/include/ach_render_ig.php
+++ b/code/web/app/app_achievements/include/ach_render_ig.php
@@ -1,6 +1,93 @@
+ .o {
+ color:orange;
+ }
+
+
+
+
+ ";
+
+ #ERROR: big flaw in logics if only one tie applies
+
+ if($cat->isTiedCult() && !$cat->isTiedCiv() && $cult == "c_neutral") { // neutral / xx
+ #While being of neutral allegiance with the higher powers
+ $html .= get_translation('ach_allegiance_neutral_cult',$_USER->getLang(),array("".get_translation('ach_c_neutral',$_USER->getLang()).""));
+ }
+ elseif($cat->isTiedCiv() && !$cat->isTiedCult() && $civ == "c_neutral") { // xx / neutral
+ #While being of neutral allegiance with the homin civilizations
+ $html .= get_translation('ach_allegiance_neutral_civ',$_USER->getLang(),array("".get_translation('ach_c_neutral',$_USER->getLang()).""));
+ }
+ elseif($cat->isTiedCiv() && $cat->isTiedCult() && $cult == "c_neutral" && $civ == "c_neutral") { // neutral / neutral
+ #While being of neutral allegiance
+ $html .= get_translation('ach_allegiance_neutral',$_USER->getLang(),array("".get_translation('ach_c_neutral',$_USER->getLang()).""));
+ }
+ else { //other
+ #While being aligned with the
+ $html .= get_translation('ach_allegiance_start',$_USER->getLang());
+ if($cat->isTiedCult() && $cult != "c_neutral") {
+ #CULT
+ $html .= "".ach_translate_cc($cult)."";
+ if($cat->isTiedCiv() && $civ != "c_neutral") {
+ #and the CIV
+ $html .= get_translation('ach_allegiance_and',$_USER->getLang())." ".ach_translate_cc($civ)."";
+ }
+ }
+ elseif($cat->isTiedCiv() && $civ != "c_neutral") {
+ #CIV
+ $html .= "".ach_translate_cc($civ)."";
+ }
+ }
+ #, accomplish the following achievements:
+ $html .= get_translation('ach_allegiance_end',$_USER->getLang())."
";
+
+ return $html;
+ }
+
+ function ach_render_yubopoints() {
+ global $DBc,$_USER;
+
+ $res = $DBc->sqlQuery("SELECT sum(ap_value) as anz FROM ach_perk,ach_player_perk WHERE ap_id=app_perk AND app_player='".$_USER->getID()."'");
+
+ $html = "".$_USER->getName()." ".$res[0]['anz']." ";
+
+ return $html;
+ }
+
+ function ach_render_facebook() {
+
+ }
+
+ function ach_render_twitter() {
}
@@ -25,17 +112,21 @@
$sz = $menu->getSize();
for($i=0;$i<$sz;$i++) {
$curr = $menu->getChild($i);
- $html .= "";
+ if($curr->hasOpenCat() != 0) {
+ $html .= "".ach_render_menu($curr,($sub+4))."
";
+ }
}
return $html;
@@ -44,6 +135,10 @@
function ach_render_category(&$cat) {
$html = "";
+ if($cat->isTiedCult() || $cat->isTiedCiv()) {
+ $html .= ach_render_tiebar($cat->getCurrentCult(),$cat->getCurrentCiv(),$cat);
+ }
+
$tmp = $cat->getDone();
$sz = sizeof($tmp);
for($i=0;$i<$sz;$i++) {
@@ -156,9 +251,6 @@
$perk = $ach->getChild($elem);
$html .= "".$perk->getName()." ( ".date('d.m.Y',$perk->getDone())." )
".$perk->getValue()."
";
}
- /*if($perk->objDrawable()) {
- $html .= "
".ach_render_obj_list($perk->getChildren());
- }*/
return $html;
}
@@ -250,31 +342,36 @@
function ach_render_obj_value(&$obj) {
$html = "";
- if($obj->isdone()) {
- $col = "#71BE02";
+ if($obj->getName() != null) {
+ if($obj->isdone()) {
+ $col = "#71BE02";
+ }
+ else {
+ $col = "#999999";
+ }
+ $html .= "".$obj->getName()."
";
}
- else {
- $col = "#999999";
- }
- $html .= "".$obj->getName()."
";
- $val = $obj->getValue();
- $prog = $obj->getProgress();
+ $html .= ach_render_progressbar($obj->getProgress(),$obj->getValue(),350);
+
+ return $html;
+ }
- $width = 350;
+ function ach_render_progressbar($prog,$val,$width) {
+ $val = max(1,$val);
$left = floor($width*(100*($prog/$val))/100);
- $html .= "
+ $html = "
";
if(($prog/$val) > 0.85) {
- $html .= " ".$prog." / ".$val." ";
+ $html .= " ".nf($prog)." / ".nf($val)." ";
}
$html .= " |
";
if(($prog/$val) <= 0.85) {
- $html .= " ".$prog." / ".$val." ";
+ $html .= " ".nf($prog)." / ".nf($val)." ";
}
$html .= " |
@@ -282,4 +379,52 @@
return $html;
}
+
+ function ach_render_summary_header() {
+ global $_USER;
+
+ return "".get_translation('ach_summary_header',$_USER->getLang())."
";
+ }
+
+ function ach_render_summary_footer(&$summary) {
+ global $_USER;
+
+ $nodes = $summary->getSummary();
+ $html = "";
+
+ $sum_done = 0;
+ $sum_total = 0;
+
+ $i = 0;
+ foreach($nodes as $elem) {
+ if(($i%3) == 0) {
+ $html .= "";
+ }
+
+ $html .= "".$elem[0]." ".ach_render_progressbar($elem[1],$elem[2],200)." | ";
+ $sum_done += $elem[1];
+ $sum_total += $elem[2];
+
+ if(($i%3) == 2) {
+ $html .= "
";
+ }
+
+ $i++;
+ }
+
+ if(($i%3) == 2) {
+ $html .= "";
+ }
+
+ $html = "
+ ".get_translation('ach_summary_stats',$_USER->getLang())."
+
+
+ ".get_translation('ach_summary_stats_total',$_USER->getLang())." ".ach_render_progressbar($sum_done,$sum_total,450)."
|
+
+ ".$html."
+
";
+
+ return $html;
+ }
?>
\ No newline at end of file
diff --git a/code/web/app/app_achievements/include/ach_render_web.php b/code/web/app/app_achievements/include/ach_render_web.php
index 8ab9f8903..2718bfbc0 100644
--- a/code/web/app/app_achievements/include/ach_render_web.php
+++ b/code/web/app/app_achievements/include/ach_render_web.php
@@ -1,25 +1,5 @@
getLang());
-
- return $t[$cc];
- }
-
- function ach_render_tiebar($cult = "c_neutral", $civ = "c_neutral",$cat) {
+ function ach_render_tiebar($cult = "c_neutral", $civ = "c_neutral",&$cat) {
global $_USER;
$html = "
- ";
return $html;
@@ -89,6 +83,14 @@
return $html;
}
+ function ach_render_facebook() {
+
+ }
+
+ function ach_render_twitter() {
+
+ }
+
function ach_render_menu(&$menu,$sub = 0) {
$html = "