".ach_render_yubopoints()."
"; $menu = new AchMenu($_REQUEST['cat']); $c .= ach_render_menu($menu); $c .= " "; $open = $menu->getOpenCat(); if($open != 0) { if($_REQUEST['cult']) { $cult = $_REQUEST['cult']; } else { $cult = $_USER->getCult(); } if($_REQUEST['civ']) { $civ = $_REQUEST['civ']; } else { $civ = $_USER->getCiv(); } $cat = new AchCategory($open,$_USER->getRace(),$cult,$civ); } else { $cat = new AchSummary($menu,$_CONF['summary_size']); $c .= ach_render_summary_header(); } $c .= ach_render_category($cat); if($open == 0) { $c .= ach_render_summary_footer($cat); } $c .= "
"; return $c; } function ach_render_tiebar($cult = "c_neutral", $civ = "c_neutral",&$cat) { global $_USER; $html = "
"; if($cat->isAllowedCult()) { $html.= ""; } if($task->objDrawable()) { $html .= ""; } return $html; } function ach_render_task_done(&$ach,&$cat) { global $_CONF; $html = ""; $task_list = $ach->getDone(); while($task_list->hasNext()) { $task = $task_list->getNext(); if($task->inDev() || !$task->isTiedRace_open($cat->getCurrentRace()) || !$task->isTiedAlign_open($cat->getCurrentCult(),$cat->getCurrentCiv())) { continue; } $html .= ""; } return $html; } function ach_render_obj_list($obj) { $html = "
"; } $iter = $menu->getIterator(); while($iter->hasNext()) { $curr = $iter->getNext(); #$sz = $menu->getSize(); #for($i=0;$i<$sz;$i++) { #$curr = $menu->getChild($i); if($curr->inDev()) { continue; } if($sub == 0) { $html .= ""; } $html .= ""; if($curr->hasOpenCat() != 0) { $html .= ach_render_menu($curr,($sub+4)); } } if($sub == 0) { $html .= "
"; if($sub == 0) { $html .= "getImage()."?cacheid=".$_CONF['image_cdate']."' />"; } else { $html .= ""; } $html .= "isOpen()) { $html .= " color='orange'"; } $html .= ">".$curr->getName()."
"; } return $html; } function ach_render_category(&$cat) { global $_USER; $html = ""; if($cat->isHeroic() && !$cat->hasDone()) { return "
".get_translation('ach_no_heroic_deeds',$_USER->getLang())."
"; } if($cat->hasTieAlign_done() || $cat->hasTieAlign_open()) { $html .= ach_render_tiebar($cat->getCurrentCult(),$cat->getCurrentCiv(),$cat); } $iter = $cat->getDone(); while($iter->hasNext()) { $curr = $iter->getNext(); if($curr->inDev() || !$curr->parentDone() || !$curr->isTiedRace_done($cat->getCurrentRace()) || !$curr->isTiedAlign_done($cat->getCurrentCult(),$cat->getCurrentCiv())) { continue; } $html .= ach_render_achievement_done($curr,$cat); } if($cat->isHeroic()) { return $html; } $iter = $cat->getOpen(); while($iter->hasNext()) { $curr = $iter->getNext(); if($curr->inDev() || !$curr->parentDone() || !$curr->isTiedRace_open($cat->getCurrentRace()) || !$curr->isTiedAlign_open($cat->getCurrentCult(),$cat->getCurrentCiv())) { continue; } $html .= ach_render_achievement_open($curr,$cat); } return $html; } function ach_render_achievement_done(&$ach,&$cat) { global $_CONF; $html = "
getImage()."?cacheid=".$_CONF['image_cdate']."'>
".$ach->getName()."
".ach_render_task_done($ach,$cat)."
"; if((!$ach->isHeroic() && !$ach->isContest()) && $ach->getValueDone() > 0) { $html .= "".$ach->getValueDone()."
"; } else { $html .= '
'; } $html .= "
 
"; return $html; } function ach_render_achievement_open(&$ach,&$cat) { global $_CONF; $html = "
getImage()."?cacheid=".$_CONF['image_cdate']."'>
".$ach->getName()."
".ach_render_task_open($ach)."
"; if(!$ach->isHeroic() && !$ach->isContest()) { $html .= "".$ach->getValueOpen()."
"; } $html .= "
 
"; return $html; } function ach_render_task_open(&$ach) { $html = ""; $task_list = $ach->getOpen(); $task = $task_list->getNext(); if($task->inDev()) { return $html; } if($task->getName() != null) { $html .= "
".$task->getDisplayName()."
 
".ach_render_obj_list($task->getIterator())."
".$task->getDisplayName()."
( ".date('d.m.Y',$task->getDone())." )"; if($task->getValue() > 0) { $html .= " ".$task->getValue(); } $html .= "
"; $i = 0; $skip = false; while($obj->hasNext()) { $elem = $obj->getNext(); if(($i%2) == 0) { $html .= ""; } switch($elem->getDisplay()) { case "meta": $html .= ""; break; case "value": if(($i%2) == 1) { $html .= ""; } $html .= ""; $i++; break; case "simple": $html .= ""; break; case "hidden": default: //do nothing $skip = true; break; } if(($i%2) == 1) { $html .= ""; } if(!$skip) { $i++; } $skip = false; } if(($i%2) == 1) { $html .= ""; } $html .= "
".ach_render_obj_meta($elem)."
".ach_render_obj_value($elem)."
".ach_render_obj_simple($elem)."
"; return $html; } function ach_render_obj_simple(&$obj) { global $_CONF; $html = ""; if($obj->isdone()) { $html .= ""; } $html .= ""; $sum_done += $elem[1]; $sum_total += $elem[2]; if(($i%2) == 2) { $html .= ""; } $i++; } if(($i%2) == 2) { $html .= ""; } $html = "

".get_translation('ach_summary_stats',$_USER->getLang())."

 "; } else { $html .= "
 "; } $html .= $obj->getDisplayName()."
"; return $html; } function ach_render_obj_meta(&$obj) { global $_CONF; if($obj->isdone()) { $col = "#71BE02"; $grey = ""; } else { $col = "#999999"; $grey = "grey/"; } return "
getMetaImage()."?cacheid=".$_CONF['image_cdate']."' />   ".$obj->getDisplayName()."
"; } function ach_render_obj_value(&$obj) { $html = ""; if($obj->getName() != null) { if($obj->isdone()) { $col = "#71BE02"; } else { $col = "#999999"; } $html .= "".$obj->getDisplayName().""; } $html .= ach_render_progressbar($obj->getProgress(),$obj->getValue(),250); return $html; } function ach_render_progressbar($prog,$val,$width) { $hero = false; if($val == false) { $hero = true; $val = $prog; } $val = max(1,$val); $left = floor($width*(100*($prog/$val))/100); $left = max(1,$left); $html = "
"; if($hero == false) { if(($prog/$val) > 0.5) { $html .= " ".nf($prog)." / ".nf($val)." "; } $html .= " "; if(($prog/$val) <= 0.5) { $html .= " ".nf($prog)." / ".nf($val)." "; } } else { $html .= " ".nf($prog)." "; } $html .= "
"; 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%2) == 0) { $html .= "
".$elem[0]; if($elem[3] == false) { $html .= ach_render_progressbar($elem[1],$elem[2],150); } else { $html .= ach_render_progressbar($elem[1],false,150); } $html .= "
".get_translation('ach_summary_stats_total',$_USER->getLang()).ach_render_progressbar($sum_done,$sum_total,350)."
".$html."
"; return $html; } ?>