#1470 and here comes the ingame rendering

This commit is contained in:
SirCotare 2012-06-21 20:55:52 +02:00
parent a84b0aae5e
commit 30677cfe4a
15 changed files with 225 additions and 117 deletions

View file

@ -32,7 +32,7 @@
$sz = sizeof($res); $sz = sizeof($res);
for($i=0;$i<$sz;$i++) { for($i=0;$i<$sz;$i++) {
#echo "Z"; #echo "Z";
$tmp = new AchPerk($res[$i],$this); $tmp = $this->makeChild($res[$i],$this);
#echo var_export($tmp,true); #echo var_export($tmp,true);
@ -52,6 +52,10 @@
#echo "X-".$this->hasOpen(); #echo "X-".$this->hasOpen();
} }
private function makeChild(&$a,$b) {
return new AchPerk($a,$b);
}
function getID() { function getID() {
return $this->id; return $this->id;
} }

View file

@ -29,7 +29,7 @@
$sz = sizeof($res); $sz = sizeof($res);
for($i=0;$i<$sz;$i++) { for($i=0;$i<$sz;$i++) {
#echo "Y"; #echo "Y";
$tmp = new AchAchievement($res[$i]); $tmp = $this->makeChild($res[$i]);
#echo var_export($tmp,true); #echo var_export($tmp,true);
if($tmp->hasOpen()) { if($tmp->hasOpen()) {
$this->child_open[] = sizeof($this->nodes); $this->child_open[] = sizeof($this->nodes);
@ -54,6 +54,10 @@
$this->ties_civ_dev = $res[0]['anz']; $this->ties_civ_dev = $res[0]['anz'];
} }
private function makeChild(&$a) {
return new AchAchievement($a);
}
function getID() { function getID() {
return $this->id; return $this->id;
} }

View file

@ -11,15 +11,15 @@
$tmp['ac_id'] = 0; $tmp['ac_id'] = 0;
$tmp['ac_parent'] = null; $tmp['ac_parent'] = null;
$tmp['acl_name'] = get_translation('ach_summary',$_USER->getLang()); $tmp['acl_name'] = get_translation('ach_summary',$_USER->getLang());
$tmp['ac_image'] = ""; $tmp['ac_image'] = "test.png";
$tmp['ac_order'] = -1; $tmp['ac_order'] = -1;
$this->nodes[] = new AchMenuNode($tmp,$open,$lang); $this->nodes[] = new AchMenuNode($tmp,$open);
$res = $DBc->sqlQuery("SELECT * FROM ach_category LEFT JOIN (ach_category_lang) ON (acl_lang='".$_USER->getLang()."' AND acl_category=ac_id) WHERE ac_parent IS NULL ORDER by ac_order ASC, acl_name ASC"); $res = $DBc->sqlQuery("SELECT * FROM ach_category LEFT JOIN (ach_category_lang) ON (acl_lang='".$_USER->getLang()."' AND acl_category=ac_id) WHERE ac_parent IS NULL ORDER by ac_order ASC, acl_name ASC");
$sz = sizeof($res); $sz = sizeof($res);
for($i=0;$i<$sz;$i++) { for($i=0;$i<$sz;$i++) {
$this->nodes[] = new AchMenuNode($res[$i],$open); $this->nodes[] = $this->makeChild($res[$i],$open);
} }
} }
@ -36,6 +36,10 @@
} }
return 0; return 0;
} }
private function makeChild(&$a,$b) {
return new AchMenuNode($a,$b);
}
} }
class AchMenuNode extends RenderNodeIterator { class AchMenuNode extends RenderNodeIterator {
@ -61,10 +65,14 @@
$sz = sizeof($res); $sz = sizeof($res);
for($i=0;$i<$sz;$i++) { for($i=0;$i<$sz;$i++) {
$this->nodes[] = new AchMenuNode($res[$i],$open); $this->nodes[] = $this->makeChild($res[$i],$open);
} }
} }
private function makeChild(&$a,$b) {
return new AchMenuNode($a,$b);
}
function getID() { function getID() {
return $this->id; return $this->id;
} }

View file

@ -22,10 +22,14 @@
$res = $DBc->sqlQuery("SELECT * FROM ach_objective LEFT JOIN (ach_objective_lang) ON (aol_lang='".$_USER->getLang()."' AND aol_objective=ao_id) LEFT JOIN (ach_player_objective) ON (apo_objective=ao_id AND apo_player='".$_USER->getID()."') WHERE ao_perk='".$this->id."'"); $res = $DBc->sqlQuery("SELECT * FROM ach_objective LEFT JOIN (ach_objective_lang) ON (aol_lang='".$_USER->getLang()."' AND aol_objective=ao_id) LEFT JOIN (ach_player_objective) ON (apo_objective=ao_id AND apo_player='".$_USER->getID()."') WHERE ao_perk='".$this->id."'");
$sz = sizeof($res); $sz = sizeof($res);
for($i=0;$i<$sz;$i++) { for($i=0;$i<$sz;$i++) {
$this->nodes[] = new AchObjective($res[$i]); $this->nodes[] = $this->makeChild($res[$i]);
} }
} }
private function makeChild(&$a) {
return new AchObjective($a);
}
function getID() { function getID() {
return $this->id; return $this->id;
} }

View file

@ -15,13 +15,17 @@
$sz = sizeof($res); $sz = sizeof($res);
for($i=0;$i<$sz;$i++) { for($i=0;$i<$sz;$i++) {
$tmp = new AchAchievement($res[$i]); $tmp = $this->makeChild($res[$i]);
$this->child_done[] = sizeof($this->nodes); $this->child_done[] = sizeof($this->nodes);
$this->nodes[] = $tmp; $this->nodes[] = $tmp;
} }
} }
private function makeChild(&$a) {
return new AchAchievement($a);
}
function getSummary() { function getSummary() {
if(!is_array($this->stats)) { // only load if needed if(!is_array($this->stats)) { // only load if needed
//now we have to find the # of perks for each main menu entry //now we have to find the # of perks for each main menu entry

View file

@ -1,4 +1,46 @@
<?php <?php
function ach_render() {
global $user;
$c = "<table>
<tr>
<td>".ach_render_yubopoints($user['id'])."</td>
</tr>
</table>
<table>
<tr>
<td width='230px'>";
$menu = new AchMenu($_REQUEST['cat']);
$c .= ach_render_menu($menu);
$c .= "</td>
<td width='455px'>";
$open = $menu->getOpenCat();
if($open != 0) {
$cat = new AchCategory($open,$_REQUEST['cult'],$_REQUEST['civ']);
}
else {
$cat = new AchSummary($menu,8);
$c .= ach_render_summary_header();
}
$c .= ach_render_category($cat);
if($open == 0) {
$c .= ach_render_summary_footer($cat);
}
$c .= "</td>
</tr>
</table>";
return $c;
}
function ach_render_tiebar($cult = "c_neutral", $civ = "c_neutral",&$cat) { function ach_render_tiebar($cult = "c_neutral", $civ = "c_neutral",&$cat) {
global $_USER; global $_USER;
@ -37,8 +79,6 @@
<div style='display:block;font-weight:bold;font-size:20px;color:#FFFFFF;text-align:center;margin-bottom:5px;'>"; <div style='display:block;font-weight:bold;font-size:20px;color:#FFFFFF;text-align:center;margin-bottom:5px;'>";
#ERROR: big flaw in logics if only one tie applies
if($cat->isTiedCult() && !$cat->isTiedCiv() && $cult == "c_neutral") { // neutral / xx if($cat->isTiedCult() && !$cat->isTiedCiv() && $cult == "c_neutral") { // neutral / xx
#While being of neutral allegiance with the higher powers #While being of neutral allegiance with the higher powers
$html .= get_translation('ach_allegiance_neutral_cult',$_USER->getLang(),array("<span class='o'>".get_translation('ach_c_neutral',$_USER->getLang())."</span>")); $html .= get_translation('ach_allegiance_neutral_cult',$_USER->getLang(),array("<span class='o'>".get_translation('ach_c_neutral',$_USER->getLang())."</span>"));
@ -78,7 +118,7 @@
$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()."'"); $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 = "<div style='display:block;border-bottom:1px solid #000000;'><span style='font-size:32px;'>".$_USER->getName()."&nbsp;<img src='pic/yubo_done.png'>&nbsp;".$res[0]['anz']."</span></div>"; $html = "<font size='32px'>".$_USER->getName()."&nbsp;<img src='http://www.3025-game.de/special/app_achievements/pic/yubo_done.png'>&nbsp;".$res[0]['anz']."</font>";
return $html; return $html;
} }
@ -92,50 +132,45 @@
} }
function ach_render_menu(&$menu,$sub = 0) { function ach_render_menu(&$menu,$sub = 0) {
$html = "<style> $html = "";
.ach_menu { if($sub == 0) {
display:block; $html = "<table cellpadding='2px'>";
padding:2px; }
border:1px solid #000000;
margin-bottom:2px;
color:#FFFFFF;
}
.ach_menu:hover {
color:orange;
}
.ach_mspan a {
text-decoration:none;
}
</style>";
$sz = $menu->getSize(); $sz = $menu->getSize();
for($i=0;$i<$sz;$i++) { for($i=0;$i<$sz;$i++) {
$curr = $menu->getChild($i); $curr = $menu->getChild($i);
if($curr->inDev()) { if($curr->inDev()) {
continue; continue;
} }
$html .= "<span class='ach_mspan'><a href='?lang=en&cat=".$curr->getID()."'><table class='ach_menu'> $html .= "<tr><td></td><td bgcolor='#000000'></td></tr>
<tr>"; <tr><td>";
if($sub == 0) { if($sub == 0) {
$html .= "<td><img src='pic/menu/test.png' /></td>"; $html .= "<img src='http://www.3025-game.de/special/app_achievements/pic/menu/ig_".$curr->getImage()."' />";
} }
$html .= "<td style='font-size:".(20-$sub)."px;font-weight:bold;"; else {
$html .= "<img src='http://www.3025-game.de/special/app_achievements/pic/menu_space.png' />";
}
$html .= "</td><td><a href='?lang=en&cat=".$curr->getID()."'><font size='".(16-$sub)."px'";
if($curr->isOpen()) { if($curr->isOpen()) {
$html .= "color:orange;"; $html .= " color='orange'";
} }
$html .= "'>".$curr->getName()."</td> $html .= "><b>".$curr->getName()."</b></font></a></td>
</tr> </tr>";
</table></a></span>";
if($curr->hasOpenCat() != 0) { if($curr->hasOpenCat() != 0) {
$html .= "<div style='display:block;margin-left:25px;'>".ach_render_menu($curr,($sub+4))."</div>"; $html .= ach_render_menu($curr,($sub+4));
} }
} }
if($sub == 0) {
$html .= "<tr><td></td><td bgcolor='#000000'></td></tr></table>";
}
return $html; return $html;
} }
function ach_render_category(&$cat) { function ach_render_category(&$cat) {
#return "";
$html = ""; $html = "";
if($cat->isTiedCult() || $cat->isTiedCiv()) { if($cat->isTiedCult() || $cat->isTiedCiv()) {
@ -166,9 +201,25 @@
} }
function ach_render_achievement_done(&$ach) { function ach_render_achievement_done(&$ach) {
$html = ""; $html = "
<table>
<tr>
<td width='450px' bgcolor='#D2CBDC88'>
<table width='450px' cellpadding='3px'>
<tr>
<td width='70px'><img src='http://www.3025-game.de/special/app_achievements/pic/icon/".$ach->getImage()."'></td>
<td><center><font size='22px'><b>".$ach->getName()."</b></font></center>
<table>".ach_render_perk_done($ach)."</table>
</td>
<td width='35px'><font size='24px' color='#000000'>".$ach->getValueDone()."</font><br><img src='http://www.3025-game.de/special/app_achievements/pic/yubo_done.png'></td>
</tr>
</table>
</td>
</tr>
<tr><td>&nbsp;</td></tr>
</table>";
$html .= '<div style="display: block; margin-bottom: 5px;"><table cellpadding="0" cellspacing="0" width="100%"> /*$html .= '<div style="display: block; margin-bottom: 5px;"><table cellpadding="0" cellspacing="0" width="100%">
<tbody><tr> <tbody><tr>
<td width="3px"><img src="pic/bar_done_ul.png"></td> <td width="3px"><img src="pic/bar_done_ul.png"></td>
<td style="background-image: url(pic/bar_done_u.png);"></td> <td style="background-image: url(pic/bar_done_u.png);"></td>
@ -179,7 +230,7 @@
<td style="background-image: url(pic/bar_done_bg.png);"> <td style="background-image: url(pic/bar_done_bg.png);">
<center><table width="100%" cellspacing="0" cellpadding="0"> <center><table width="100%" cellspacing="0" cellpadding="0">
<tbody><tr> <tbody><tr>
<td rowspan="2" valign="top"><img src="pic/icon/test.png"></td> <td rowspan="2" valign="top"><img src="pic/icon/'.$ach->getImage().'"></td>
<td width="100%"><center><span style="font-weight:bold;font-size:24px;color:#000000;">'.$ach->getName().'</span></center></td> <td width="100%"><center><span style="font-weight:bold;font-size:24px;color:#000000;">'.$ach->getName().'</span></center></td>
<td rowspan="2" valign="top" style="font-weight: bold; text-align: center; font-size: 30px;color:#000000;padding-right:10px;"> <td rowspan="2" valign="top" style="font-weight: bold; text-align: center; font-size: 30px;color:#000000;padding-right:10px;">
'.$ach->getValueDone().'<br><img src="pic/yubo_done.png"> '.$ach->getValueDone().'<br><img src="pic/yubo_done.png">
@ -195,7 +246,7 @@
<td style="background-image: url(pic/bar_done_b.png);"></td> <td style="background-image: url(pic/bar_done_b.png);"></td>
<td><img src="pic/bar_done_br.png"></td> <td><img src="pic/bar_done_br.png"></td>
</tr> </tr>
</tbody></table></div>'; </tbody></table></div>';*/
return $html; return $html;
} }
@ -203,7 +254,25 @@
function ach_render_achievement_open(&$ach) { function ach_render_achievement_open(&$ach) {
$html = ""; $html = "";
$html .= '<div style="display: block; margin-bottom: 5px;"><table cellpadding="0" cellspacing="0" width="100%"> $html = "
<table>
<tr>
<td width='450px' bgcolor='#D2CBDC33'>
<table width='450px' cellpadding='3px'>
<tr>
<td width='70px'><img src='http://www.3025-game.de/special/app_achievements/pic/icon/".$ach->getImage()."'></td>
<td><center><font size='22px'><b>".$ach->getName()."</b></font></center>
<table>".ach_render_perk_open($ach)."</table>
</td>
<td width='35px'><font size='22px' color='#000000'>".$ach->getValueOpen()."</font><br><img src='http://www.3025-game.de/special/app_achievements/pic/yubo_pending.png'></td>
</tr>
</table>
</td>
</tr>
<tr><td>&nbsp;</td></tr>
</table>";
/*$html .= '<div style="display: block; margin-bottom: 5px;"><table cellpadding="0" cellspacing="0" width="100%">
<tbody><tr> <tbody><tr>
<td width="3px"><img src="pic/bar_pending_ul.png"></td> <td width="3px"><img src="pic/bar_pending_ul.png"></td>
<td style="background-image: url(pic/bar_pending_u.png);"></td> <td style="background-image: url(pic/bar_pending_u.png);"></td>
@ -214,7 +283,7 @@
<td> <td>
<center><table width="100%" cellspacing="0" cellpadding="0"> <center><table width="100%" cellspacing="0" cellpadding="0">
<tbody><tr> <tbody><tr>
<td rowspan="2" valign="top"><img src="pic/icon/test.png"></td> <td rowspan="2" valign="top"><img src="pic/icon/'.$ach->getImage().'"></td>
<td width="100%"><center><span style="font-weight:bold;font-size:24px;color:#FFFFFF;">'.$ach->getName().'</span></center></td> <td width="100%"><center><span style="font-weight:bold;font-size:24px;color:#FFFFFF;">'.$ach->getName().'</span></center></td>
<td rowspan="2" valign="top" style="font-weight: bold; text-align: center; font-size: 30px;color:#FFFFFF;padding-right:10px;"> <td rowspan="2" valign="top" style="font-weight: bold; text-align: center; font-size: 30px;color:#FFFFFF;padding-right:10px;">
'.$ach->getValueOpen().'<br><img src="pic/yubo_pending.png"> '.$ach->getValueOpen().'<br><img src="pic/yubo_pending.png">
@ -230,7 +299,7 @@
<td style="background-image: url(pic/bar_pending_b.png);"></td> <td style="background-image: url(pic/bar_pending_b.png);"></td>
<td><img src="pic/bar_pending_br.png"></td> <td><img src="pic/bar_pending_br.png"></td>
</tr> </tr>
</tbody></table></div>'; </tbody></table></div>';*/
return $html; return $html;
} }
@ -248,10 +317,10 @@
} }
if($perk->getName() != null) { if($perk->getName() != null) {
$html .= "<span style='color:#999999;font-weight:bold;display:block;'>".$perk->getName()."</span>"; $html .= "<tr><td><font color='#999999' size='12px'><b>".$perk->getName()."</b></font></td></tr><tr><td>&nbsp;</td></tr>";
} }
if($perk->objDrawable()) { if($perk->objDrawable()) {
$html .= ach_render_obj_list($perk->getChildren()); $html .= "<tr><td>".ach_render_obj_list($perk->getChildren())."</td></tr>";
} }
return $html; return $html;
@ -267,14 +336,14 @@
if($perk->inDev()) { if($perk->inDev()) {
continue; continue;
} }
$html .= "<div style='display:block;'><span style='color:#66CC00;font-weight:bold;'>".$perk->getName()."</span> ( ".date('d.m.Y',$perk->getDone())." ) <img src='pic/yubo_done.png' width='15px' /> ".$perk->getValue()."</div>"; $html .= "<tr><td><font color='#66CC00'><b>".$perk->getName()."</b></font> ( ".date('d.m.Y',$perk->getDone())." ) <img src='http://www.3025-game.de/special/app_achievements/pic/yubo_done_small.png' /> ".$perk->getValue()."</td></tr>";
} }
return $html; return $html;
} }
function ach_render_obj_list(&$obj) { function ach_render_obj_list(&$obj) {
$html = "<center><table width='90%'>"; $html = "<table width='90%'>";
$i = 0; $i = 0;
$skip = false; $skip = false;
@ -320,7 +389,7 @@
$html .= "</tr>"; $html .= "</tr>";
} }
$html .= "</table></center>"; $html .= "</table>";
return $html; return $html;
} }
@ -328,13 +397,13 @@
function ach_render_obj_simple(&$obj) { function ach_render_obj_simple(&$obj) {
$html = ""; $html = "";
if($obj->isdone()) { if($obj->isdone()) {
$html .= "<img src='pic/check.png' height='10px' />&nbsp;<span style='color:#71BE02;'>"; $html .= "<img src='http://www.3025-game.de/special/app_achievements/pic/check.png' height='10px' />&nbsp;<font color='#71BE02;'>";
} }
else { else {
$html .= "<img src='pic/pending.png' height='10px' />&nbsp;<span style='color:#999999;'>"; $html .= "<img src='http://www.3025-game.de/special/app_achievements/pic/pending.png' height='10px' />&nbsp;<font color='#999999;'>";
} }
$html .= $obj->getName()."</span>"; $html .= $obj->getName()."</font>";
return $html; return $html;
} }
@ -352,8 +421,8 @@
return "<table cellspacing='0' cellpadding='0'> return "<table cellspacing='0' cellpadding='0'>
<tr> <tr>
<td><img src='pic/icon/".$grey."test.png' width='20px' /></td> <td><img src='http://www.3025-game.de/special/app_achievements/pic/icon/".$grey."small/test.png' /></td>
<td valign='middle'><span style='color:".$col.";'>&nbsp;".$obj->getName()."</span></td> <td><font color='".$col."'>&nbsp;".$obj->getName()."</font></td>
</tr> </tr>
</table>"; </table>";
} }
@ -367,10 +436,10 @@
else { else {
$col = "#999999"; $col = "#999999";
} }
$html .= "<div style='color:".$col.";display:block;'>".$obj->getName()."</div>"; $html .= "<font color='".$col."'>".$obj->getName()."</font>";
} }
$html .= ach_render_progressbar($obj->getProgress(),$obj->getValue(),350); $html .= ach_render_progressbar($obj->getProgress(),$obj->getValue(),250);
return $html; return $html;
} }
@ -378,20 +447,26 @@
function ach_render_progressbar($prog,$val,$width) { function ach_render_progressbar($prog,$val,$width) {
$val = max(1,$val); $val = max(1,$val);
$left = floor($width*(100*($prog/$val))/100); $left = floor($width*(100*($prog/$val))/100);
$left = max(1,$left);
$html = " $html = "<table width='".($width+12)."px'>
<table width='".$width."px' cellspacing='0' cellpadding='0' style='border:1px solid #FFFFFF;color:#000000;'>
<tr> <tr>
<td bgcolor='#66CC00' width='".$left."px' align='right'>"; <td width='10px'></td>
<td><table cellpadding='1px' width='".($width+2)."px'><tr><td bgcolor='#FFFFFF'>
<table width='".$width."px' cellspacing='0' cellpadding='0'>
<tr>
<td bgcolor='#66CC00' width='".$left."px'><font color='#000000'>";
if(($prog/$val) > 0.85) { if(($prog/$val) > 0.85) {
$html .= "&nbsp;".nf($prog)." / ".nf($val)."&nbsp;"; $html .= "&nbsp;".nf($prog)." / ".nf($val)."&nbsp;";
} }
$html .= "</td> $html .= "</font></td>
<td align='left' style='color:#FFFFFF;'>"; <td align='left' bgcolor='#00000066'><font color='#FFFFFF'>";
if(($prog/$val) <= 0.85) { if(($prog/$val) <= 0.85) {
$html .= "&nbsp;".nf($prog)." / ".nf($val)."&nbsp;"; $html .= "&nbsp;".nf($prog)." / ".nf($val)."&nbsp;";
} }
$html .= "</td> $html .= "</font></td>
</tr>
</table></td></tr></table></td>
</tr> </tr>
</table>"; </table>";
@ -400,8 +475,8 @@
function ach_render_summary_header() { function ach_render_summary_header() {
global $_USER; global $_USER;
return "<div style='display:block;font-weight:bold;font-size:30px;color:#FFFFFF;text-align:center;margin-bottom:10px;'>".get_translation('ach_summary_header',$_USER->getLang())."</div>"; return "<font size='30px' color='#FFFFFF'>".get_translation('ach_summary_header',$_USER->getLang())."</font>";
} }
function ach_render_summary_footer(&$summary) { function ach_render_summary_footer(&$summary) {
@ -415,32 +490,34 @@
$i = 0; $i = 0;
foreach($nodes as $elem) { foreach($nodes as $elem) {
if(($i%3) == 0) { if(($i%2) == 0) {
$html .= "<tr>"; $html .= "<tr>";
} }
$html .= "<td width='50%' align='center'>".$elem[0]."<br>".ach_render_progressbar($elem[1],$elem[2],200)."</td>"; $html .= "<td width='225px'>".$elem[0]."<br>".ach_render_progressbar($elem[1],$elem[2],150)."</td>";
$sum_done += $elem[1]; $sum_done += $elem[1];
$sum_total += $elem[2]; $sum_total += $elem[2];
if(($i%3) == 2) { if(($i%2) == 2) {
$html .= "</tr>"; $html .= "</tr>";
} }
$i++; $i++;
} }
if(($i%3) == 2) { if(($i%2) == 2) {
$html .= "</tr>"; $html .= "</tr>";
} }
$html = "<p /> $html = "<p />
<div style='display:block;font-weight:bold;font-size:30px;color:#FFFFFF;text-align:center;margin-bottom:10px;'>".get_translation('ach_summary_stats',$_USER->getLang())."</div> <font size='30px' color='#FFFFFF'>".get_translation('ach_summary_stats',$_USER->getLang())."</font>
<table> <table width='450px'>
<tr> <tr>
<td colspan='3' align='center'>".get_translation('ach_summary_stats_total',$_USER->getLang())."<br>".ach_render_progressbar($sum_done,$sum_total,450)."<br></td> <td width='450px'>".get_translation('ach_summary_stats_total',$_USER->getLang())."<br>".ach_render_progressbar($sum_done,$sum_total,350)."<br></td>
</tr>
<tr>
<td width='450px'><table width='450px'>".$html."</table></td>
</tr> </tr>
".$html."
</table>"; </table>";
return $html; return $html;

View file

@ -1,4 +1,48 @@
<?php <?php
function ach_render() {
global $user;
$c = "<center><table>
<tr>
<td colspan='2' align='left'>".ach_render_yubopoints($user['id'])."</td>
</tr>
<tr>
<td valign='top'><div style='width:230px;font-weight:bold;font-size:14px;'>";
#$_REQUEST['mid'] = 1;
$menu = new AchMenu($_REQUEST['cat']);
$c .= ach_render_menu($menu);
$c .= "</div></td>
<td width='645px' valign='top'>";
/*for($i=0;$i<15;$i++) {
$c .= ach_render_box_done("Bejeweled");
}*/
$open = $menu->getOpenCat();
if($open != 0) {
$cat = new AchCategory($open,$_REQUEST['cult'],$_REQUEST['civ']);
}
else {
$cat = new AchSummary($menu,8);
$c .= ach_render_summary_header();
}
$c .= ach_render_category($cat);
if($open == 0) {
$c .= ach_render_summary_footer($cat);
}
$c .= "</td>
</tr>
</table></center>";
return $c;
}
function ach_render_tiebar($cult = "c_neutral", $civ = "c_neutral",&$cat) { function ach_render_tiebar($cult = "c_neutral", $civ = "c_neutral",&$cat) {
global $_USER; global $_USER;
@ -37,8 +81,6 @@
<div style='display:block;font-weight:bold;font-size:20px;color:#FFFFFF;text-align:center;margin-bottom:5px;'>"; <div style='display:block;font-weight:bold;font-size:20px;color:#FFFFFF;text-align:center;margin-bottom:5px;'>";
#ERROR: big flaw in logics if only one tie applies
if($cat->isTiedCult() && !$cat->isTiedCiv() && $cult == "c_neutral") { // neutral / xx if($cat->isTiedCult() && !$cat->isTiedCiv() && $cult == "c_neutral") { // neutral / xx
#While being of neutral allegiance with the higher powers #While being of neutral allegiance with the higher powers
$html .= get_translation('ach_allegiance_neutral_cult',$_USER->getLang(),array("<span class='o'>".get_translation('ach_c_neutral',$_USER->getLang())."</span>")); $html .= get_translation('ach_allegiance_neutral_cult',$_USER->getLang(),array("<span class='o'>".get_translation('ach_c_neutral',$_USER->getLang())."</span>"));
@ -118,7 +160,7 @@
$html .= "<span class='ach_mspan'><a href='?lang=en&cat=".$curr->getID()."'><table class='ach_menu'> $html .= "<span class='ach_mspan'><a href='?lang=en&cat=".$curr->getID()."'><table class='ach_menu'>
<tr>"; <tr>";
if($sub == 0) { if($sub == 0) {
$html .= "<td><img src='pic/menu/test.png' /></td>"; $html .= "<td><img src='pic/menu/".$curr->getImage()."' /></td>";
} }
$html .= "<td style='font-size:".(20-$sub)."px;font-weight:bold;"; $html .= "<td style='font-size:".(20-$sub)."px;font-weight:bold;";
if($curr->isOpen()) { if($curr->isOpen()) {
@ -179,7 +221,7 @@
<td style="background-image: url(pic/bar_done_bg.png);"> <td style="background-image: url(pic/bar_done_bg.png);">
<center><table width="100%" cellspacing="0" cellpadding="0"> <center><table width="100%" cellspacing="0" cellpadding="0">
<tbody><tr> <tbody><tr>
<td rowspan="2" valign="top"><img src="pic/icon/test.png"></td> <td rowspan="2" valign="top"><img src="pic/icon/'.$ach->getImage().'"></td>
<td width="100%"><center><span style="font-weight:bold;font-size:24px;color:#000000;">'.$ach->getName().'</span></center></td> <td width="100%"><center><span style="font-weight:bold;font-size:24px;color:#000000;">'.$ach->getName().'</span></center></td>
<td rowspan="2" valign="top" style="font-weight: bold; text-align: center; font-size: 30px;color:#000000;padding-right:10px;"> <td rowspan="2" valign="top" style="font-weight: bold; text-align: center; font-size: 30px;color:#000000;padding-right:10px;">
'.$ach->getValueDone().'<br><img src="pic/yubo_done.png"> '.$ach->getValueDone().'<br><img src="pic/yubo_done.png">
@ -214,7 +256,7 @@
<td> <td>
<center><table width="100%" cellspacing="0" cellpadding="0"> <center><table width="100%" cellspacing="0" cellpadding="0">
<tbody><tr> <tbody><tr>
<td rowspan="2" valign="top"><img src="pic/icon/test.png"></td> <td rowspan="2" valign="top"><img src="pic/icon/'.$ach->getImage().'"></td>
<td width="100%"><center><span style="font-weight:bold;font-size:24px;color:#FFFFFF;">'.$ach->getName().'</span></center></td> <td width="100%"><center><span style="font-weight:bold;font-size:24px;color:#FFFFFF;">'.$ach->getName().'</span></center></td>
<td rowspan="2" valign="top" style="font-weight: bold; text-align: center; font-size: 30px;color:#FFFFFF;padding-right:10px;"> <td rowspan="2" valign="top" style="font-weight: bold; text-align: center; font-size: 30px;color:#FFFFFF;padding-right:10px;">
'.$ach->getValueOpen().'<br><img src="pic/yubo_pending.png"> '.$ach->getValueOpen().'<br><img src="pic/yubo_pending.png">

View file

@ -5,8 +5,8 @@ ini_set("display_errors","1");
define('APP_NAME', 'app_achievements'); define('APP_NAME', 'app_achievements');
require_once('../config.php'); require_once('../webig/config.php');
include_once('../lang.php'); include_once('../webig/lang.php');
include_once('lang.php'); include_once('lang.php');
require_once('conf.php'); require_once('conf.php');
@ -20,6 +20,7 @@ $user['name'] = 'Talvela';
$user['race'] = "r_matis"; $user['race'] = "r_matis";
$user['civilization'] = "c_neutral"; $user['civilization'] = "c_neutral";
$user['cult'] = "c_neutral"; $user['cult'] = "c_neutral";
$user['ig'] = ($_REQUEST['ig']==1);
require_once("class/RyzomUser_class.php"); require_once("class/RyzomUser_class.php");
$_USER = new RyzomUser($user); $_USER = new RyzomUser($user);
@ -47,7 +48,7 @@ require_once("class/AchObjective_class.php");
// Update user acces on Db // Update user acces on Db
//$db = ryDB::getInstance(APP_NAME); //$db = ryDB::getInstance(APP_NAME);
$DBc = ryDB::getInstance(APP_NAME); $DBc = ryDB::getInstance("ahufler");
/*$db->setDbDefs('test', array('id' => SQL_DEF_INT, 'num_access' => SQL_DEF_INT)); /*$db->setDbDefs('test', array('id' => SQL_DEF_INT, 'num_access' => SQL_DEF_INT));
$num_access = $db->querySingleAssoc('test', array('id' => $user['id'])); $num_access = $db->querySingleAssoc('test', array('id' => $user['id']));
@ -61,44 +62,8 @@ $c = _t('access', $num_access['num_access']).'<br/>';*/
#$c = var_export($user,true); #$c = var_export($user,true);
$c = "<center><table>
<tr>
<td colspan='2' align='left'>".ach_render_yubopoints(1)."</td>
</tr>
<tr>
<td valign='top'><div style='width:230px;font-weight:bold;font-size:14px;'>";
#$_REQUEST['mid'] = 1;
$menu = new AchMenu($_REQUEST['cat']);
$c .= ach_render_menu($menu);
$c .= "</div></td>
<td width='645px' valign='top'>";
/*for($i=0;$i<15;$i++) { echo ryzom_app_render("achievements", ach_render(), $_USER->isIG());
$c .= ach_render_box_done("Bejeweled");
}*/
$open = $menu->getOpenCat();
if($open != 0) {
$cat = new AchCategory($open,$_REQUEST['cult'],$_REQUEST['civ']);
}
else {
$cat = new AchSummary($menu,8);
$c .= ach_render_summary_header();
}
$c .= ach_render_category($cat);
if($open == 0) {
$c .= ach_render_summary_footer($cat,1);
}
$c .= "</td>
</tr>
</table></center>";
echo ryzom_app_render("achievements", $c, $_USER->isIG());
?> ?>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 B