#1470 config options added; some cleanup

--HG--
branch : gsoc2012-achievements
This commit is contained in:
SirCotare 2012-06-21 22:03:36 +02:00
parent 3056f7b8e7
commit 139be8d7dd
7 changed files with 107 additions and 146 deletions

View file

@ -8,6 +8,7 @@
private $display; private $display;
private $done; private $done;
private $progress; private $progress;
private $meta_image;
function AchObjective(&$data) { function AchObjective(&$data) {
global $DBc,$_USER; global $DBc,$_USER;
@ -19,6 +20,7 @@
$this->name = $data['aol_name']; $this->name = $data['aol_name'];
$this->display = $data['ao_display']; $this->display = $data['ao_display'];
$this->done = $data['apo_date']; $this->done = $data['apo_date'];
$this->meta_image = $data['aa_image'];
$this->progress = $this->value; $this->progress = $this->value;
@ -28,6 +30,10 @@
} }
} }
function getMetaImage() {
return $this->meta_image;
}
function getID() { function getID() {
return $this->id; return $this->id;
} }

View file

@ -19,7 +19,7 @@
$this->done = $data['app_date']; $this->done = $data['app_date'];
$this->dev = $data['ap_dev']; $this->dev = $data['ap_dev'];
$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()."') LEFT JOIN (ach_achievement) ON (aa_id=ao_metalink) 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[] = $this->makeChild($res[$i]); $this->nodes[] = $this->makeChild($res[$i]);

View file

@ -3,11 +3,11 @@
die(-1); die(-1);
} }
$achConf = array(); $_CONF = array();
$achConf['summary_size'] = 12; $_CONF['summary_size'] = 5;
$achConf['default_lang'] = 'en'; #$_CONF['default_lang'] = 'en';
$achConf['enable_webig'] = true; $_CONF['enable_webig'] = true;
$achConf['enable_offgame'] = true; $_CONF['enable_offgame'] = true;
$achConf['use_cache'] = false; $_CONF['image_url'] = "http://www.3025-game.de/special/app_achievements/";
?> ?>

View file

@ -17,4 +17,13 @@
return $t[$cc]; return $t[$cc];
} }
function ach_render_forbidden($ig) {
if($ig) {
return "This app is NOT available INGAME!";
}
else {
return "This app is NOT available from the WEB!";
}
}
?> ?>

View file

@ -1,10 +1,10 @@
<?php <?php
function ach_render() { function ach_render() {
global $user; global $_USER;
$c = "<table> $c = "<table>
<tr> <tr>
<td>".ach_render_yubopoints($user['id'])."</td> <td>".ach_render_yubopoints($_USER->getID())."</td>
</tr> </tr>
</table> </table>
@ -44,18 +44,12 @@
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;
$html = "<style> $html = "<form method='post' action='?cat=".$cat->getID()."'>
.o {
color:orange;
}
</style>
<div style='display:block;text-align:center;'><form method='post' action='?cat=".$cat->getID()."' id='cc_form'>
<table> <table>
<tr>"; <tr>";
if($cat->isTiedCult()) { if($cat->isTiedCult()) {
$html.= "<td> $html.= "<td>
<select name='cult' onchange='document.getElementById(\"cc_form\").submit();'> <select name='cult'>
<option value='c_neutral'"; if($cult == "c_neutral") { $html.= " selected='selected'"; } $html .= ">".get_translation('ach_c_neutral',$_USER->getLang())."</option> <option value='c_neutral'"; if($cult == "c_neutral") { $html.= " selected='selected'"; } $html .= ">".get_translation('ach_c_neutral',$_USER->getLang())."</option>
<option value='c_kami'"; if($cult == "c_kami") { $html.= " selected='selected'"; } $html .= ">Kami</option> <option value='c_kami'"; if($cult == "c_kami") { $html.= " selected='selected'"; } $html .= ">Kami</option>
<option value='c_karavan'"; if($cult == "c_karavan") { $html.= " selected='selected'"; } $html .= ">Karavan</option> <option value='c_karavan'"; if($cult == "c_karavan") { $html.= " selected='selected'"; } $html .= ">Karavan</option>
@ -64,7 +58,7 @@
} }
if($cat->isTiedCiv()) { if($cat->isTiedCiv()) {
$html.= "<td> $html.= "<td>
<select name='civ' onchange='document.getElementById(\"cc_form\").submit();'> <select name='civ'>
<option value='c_neutral'"; if($civ == "c_neutral") { $html.= " selected='selected'"; } $html .= ">".get_translation('ach_c_neutral',$_USER->getLang())."</option> <option value='c_neutral'"; if($civ == "c_neutral") { $html.= " selected='selected'"; } $html .= ">".get_translation('ach_c_neutral',$_USER->getLang())."</option>
<option value='c_fyros'"; if($civ == "c_fyros") { $html.= " selected='selected'"; } $html .= ">Fyros</option> <option value='c_fyros'"; if($civ == "c_fyros") { $html.= " selected='selected'"; } $html .= ">Fyros</option>
<option value='c_matis'"; if($civ == "c_matis") { $html.= " selected='selected'"; } $html .= ">Matis</option> <option value='c_matis'"; if($civ == "c_matis") { $html.= " selected='selected'"; } $html .= ">Matis</option>
@ -73,52 +67,52 @@
</select> </select>
</td>"; </td>";
} }
$html.= "</tr> $html.= "<td><input type='submit' value='show' /></td></tr><tr><td>&nbsp;</td></tr>
</table> </table>
</form></div> </form>
<div style='display:block;font-weight:bold;font-size:20px;color:#FFFFFF;text-align:center;margin-bottom:5px;'>"; <font size='12px' color='#FFFFFF'>";
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("<font color='orange'>".get_translation('ach_c_neutral',$_USER->getLang())."</font>"));
} }
elseif($cat->isTiedCiv() && !$cat->isTiedCult() && $civ == "c_neutral") { // xx / neutral elseif($cat->isTiedCiv() && !$cat->isTiedCult() && $civ == "c_neutral") { // xx / neutral
#While being of neutral allegiance with the homin civilizations #While being of neutral allegiance with the homin civilizations
$html .= get_translation('ach_allegiance_neutral_civ',$_USER->getLang(),array("<span class='o'>".get_translation('ach_c_neutral',$_USER->getLang())."</span>")); $html .= get_translation('ach_allegiance_neutral_civ',$_USER->getLang(),array("<font color='orange'>".get_translation('ach_c_neutral',$_USER->getLang())."</font>"));
} }
elseif($cat->isTiedCiv() && $cat->isTiedCult() && $cult == "c_neutral" && $civ == "c_neutral") { // neutral / neutral elseif($cat->isTiedCiv() && $cat->isTiedCult() && $cult == "c_neutral" && $civ == "c_neutral") { // neutral / neutral
#While being of neutral allegiance #While being of neutral allegiance
$html .= get_translation('ach_allegiance_neutral',$_USER->getLang(),array("<span class='o'>".get_translation('ach_c_neutral',$_USER->getLang())."</span>")); $html .= get_translation('ach_allegiance_neutral',$_USER->getLang(),array("<font color='orange'>".get_translation('ach_c_neutral',$_USER->getLang())."</font>"));
} }
else { //other else { //other
#While being aligned with the #While being aligned with the
$html .= get_translation('ach_allegiance_start',$_USER->getLang()); $html .= get_translation('ach_allegiance_start',$_USER->getLang());
if($cat->isTiedCult() && $cult != "c_neutral") { if($cat->isTiedCult() && $cult != "c_neutral") {
#CULT #CULT
$html .= "<span class='o'>".ach_translate_cc($cult)."</span>"; $html .= "<font color='orange'>".ach_translate_cc($cult)."</font>";
if($cat->isTiedCiv() && $civ != "c_neutral") { if($cat->isTiedCiv() && $civ != "c_neutral") {
#and the CIV #and the CIV
$html .= get_translation('ach_allegiance_and',$_USER->getLang())." <span class='o'>".ach_translate_cc($civ)."</span>"; $html .= get_translation('ach_allegiance_and',$_USER->getLang())." <font color='orange'>".ach_translate_cc($civ)."</font>";
} }
} }
elseif($cat->isTiedCiv() && $civ != "c_neutral") { elseif($cat->isTiedCiv() && $civ != "c_neutral") {
#CIV #CIV
$html .= "<span class='o'>".ach_translate_cc($civ)."</span>"; $html .= "<font color='orange'>".ach_translate_cc($civ)."</font>";
} }
} }
#, accomplish the following achievements: #, accomplish the following achievements:
$html .= get_translation('ach_allegiance_end',$_USER->getLang())."</div>"; $html .= get_translation('ach_allegiance_end',$_USER->getLang())."</font><br><br>";
return $html; return $html;
} }
function ach_render_yubopoints() { function ach_render_yubopoints() {
global $DBc,$_USER; global $DBc,$_USER,$_CONF;
$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 = "<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>"; $html = "<font size='32px'>".$_USER->getName()."&nbsp;<img src='".$_CONF['image_url']."pic/yubo_done.png'>&nbsp;".$res[0]['anz']."</font>";
return $html; return $html;
} }
@ -132,6 +126,8 @@
} }
function ach_render_menu(&$menu,$sub = 0) { function ach_render_menu(&$menu,$sub = 0) {
global $_CONF;
$html = ""; $html = "";
if($sub == 0) { if($sub == 0) {
$html = "<table cellpadding='2px'>"; $html = "<table cellpadding='2px'>";
@ -145,10 +141,10 @@
$html .= "<tr><td></td><td bgcolor='#000000'></td></tr> $html .= "<tr><td></td><td bgcolor='#000000'></td></tr>
<tr><td>"; <tr><td>";
if($sub == 0) { if($sub == 0) {
$html .= "<img src='http://www.3025-game.de/special/app_achievements/pic/menu/ig_".$curr->getImage()."' />"; $html .= "<img src='".$_CONF['image_url']."pic/menu/ig_".$curr->getImage()."' />";
} }
else { else {
$html .= "<img src='http://www.3025-game.de/special/app_achievements/pic/menu_space.png' />"; $html .= "<img src='".$_CONF['image_url']."pic/menu_space.png' />";
} }
$html .= "</td><td><a href='?lang=en&cat=".$curr->getID()."'><font size='".(16-$sub)."px'"; $html .= "</td><td><a href='?lang=en&cat=".$curr->getID()."'><font size='".(16-$sub)."px'";
if($curr->isOpen()) { if($curr->isOpen()) {
@ -201,17 +197,19 @@
} }
function ach_render_achievement_done(&$ach) { function ach_render_achievement_done(&$ach) {
global $_CONF;
$html = " $html = "
<table> <table>
<tr> <tr>
<td width='450px' bgcolor='#D2CBDC88'> <td width='450px' bgcolor='#D2CBDC88'>
<table width='450px' cellpadding='3px'> <table width='450px' cellpadding='3px'>
<tr> <tr>
<td width='70px'><img src='http://www.3025-game.de/special/app_achievements/pic/icon/".$ach->getImage()."'></td> <td width='70px'><img src='".$_CONF['image_url']."pic/icon/".$ach->getImage()."'></td>
<td><center><font size='22px'><b>".$ach->getName()."</b></font></center> <td><center><font size='22px'><b>".$ach->getName()."</b></font></center>
<table>".ach_render_perk_done($ach)."</table> <table>".ach_render_perk_done($ach)."</table>
</td> </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> <td width='35px'><font size='24px' color='#000000'>".$ach->getValueDone()."</font><br><img src='".$_CONF['image_url']."pic/yubo_done.png'></td>
</tr> </tr>
</table> </table>
</td> </td>
@ -219,40 +217,11 @@
<tr><td>&nbsp;</td></tr> <tr><td>&nbsp;</td></tr>
</table>"; </table>";
/*$html .= '<div style="display: block; margin-bottom: 5px;"><table cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td width="3px"><img src="pic/bar_done_ul.png"></td>
<td style="background-image: url(pic/bar_done_u.png);"></td>
<td width="3px"><img src="pic/bar_done_ur.png"></td>
</tr>
<tr>
<td style="background-image: url(pic/bar_done_l.png);"></td>
<td style="background-image: url(pic/bar_done_bg.png);">
<center><table width="100%" cellspacing="0" cellpadding="0">
<tbody><tr>
<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 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">
</td>
</tr><tr><td align="center" valign="top">';
$html .= ach_render_perk_done($ach);
$html .= '</td></tr></tbody></table></center>
</td>
<td style="background-image: url(pic/bar_done_r.png);"></td>
</tr>
<tr>
<td><img src="pic/bar_done_bl.png"></td>
<td style="background-image: url(pic/bar_done_b.png);"></td>
<td><img src="pic/bar_done_br.png"></td>
</tr>
</tbody></table></div>';*/
return $html; return $html;
} }
function ach_render_achievement_open(&$ach) { function ach_render_achievement_open(&$ach) {
$html = ""; global $_CONF;
$html = " $html = "
<table> <table>
@ -260,11 +229,11 @@
<td width='450px' bgcolor='#D2CBDC33'> <td width='450px' bgcolor='#D2CBDC33'>
<table width='450px' cellpadding='3px'> <table width='450px' cellpadding='3px'>
<tr> <tr>
<td width='70px'><img src='http://www.3025-game.de/special/app_achievements/pic/icon/".$ach->getImage()."'></td> <td width='70px'><img src='".$_CONF['image_url']."pic/icon/grey/".$ach->getImage()."'></td>
<td><center><font size='22px'><b>".$ach->getName()."</b></font></center> <td><center><font size='22px'><b>".$ach->getName()."</b></font></center>
<table>".ach_render_perk_open($ach)."</table> <table>".ach_render_perk_open($ach)."</table>
</td> </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> <td width='35px'><font size='22px' color='#000000'>".$ach->getValueOpen()."</font><br><img src='".$_CONF['image_url']."pic/yubo_pending.png'></td>
</tr> </tr>
</table> </table>
</td> </td>
@ -272,40 +241,10 @@
<tr><td>&nbsp;</td></tr> <tr><td>&nbsp;</td></tr>
</table>"; </table>";
/*$html .= '<div style="display: block; margin-bottom: 5px;"><table cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td width="3px"><img src="pic/bar_pending_ul.png"></td>
<td style="background-image: url(pic/bar_pending_u.png);"></td>
<td width="3px"><img src="pic/bar_pending_ur.png"></td>
</tr>
<tr>
<td style="background-image: url(pic/bar_pending_l.png);"></td>
<td>
<center><table width="100%" cellspacing="0" cellpadding="0">
<tbody><tr>
<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 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">
</td>
</tr><tr><td align="center" valign="top">';
$html .= ach_render_perk_open($ach);
$html .= '</td></tr></tbody></table></center>
</td>
<td style="background-image: url(pic/bar_pending_r.png);"></td>
</tr>
<tr>
<td><img src="pic/bar_pending_bl.png"></td>
<td style="background-image: url(pic/bar_pending_b.png);"></td>
<td><img src="pic/bar_pending_br.png"></td>
</tr>
</tbody></table></div>';*/
return $html; return $html;
} }
function ach_render_perk_open(&$ach) { function ach_render_perk_open(&$ach) {
#echo var_export($perk_list,true);
$html = ""; $html = "";
$perk_list = $ach->getOpen(); $perk_list = $ach->getOpen();
@ -327,6 +266,7 @@
} }
function ach_render_perk_done(&$ach) { function ach_render_perk_done(&$ach) {
global $_CONF;
$html = ""; $html = "";
$perk_list = $ach->getDone(); $perk_list = $ach->getDone();
@ -336,7 +276,7 @@
if($perk->inDev()) { if($perk->inDev()) {
continue; continue;
} }
$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>"; $html .= "<tr><td><font color='#66CC00'><b>".$perk->getName()."</b></font> ( ".date('d.m.Y',$perk->getDone())." ) <img src='".$_CONF['image_url']."pic/yubo_done_small.png' /> ".$perk->getValue()."</td></tr>";
} }
return $html; return $html;
@ -395,12 +335,14 @@
} }
function ach_render_obj_simple(&$obj) { function ach_render_obj_simple(&$obj) {
global $_CONF;
$html = ""; $html = "";
if($obj->isdone()) { if($obj->isdone()) {
$html .= "<img src='http://www.3025-game.de/special/app_achievements/pic/check.png' height='10px' />&nbsp;<font color='#71BE02;'>"; $html .= "<img src='".$_CONF['image_url']."pic/check.png' height='10px' />&nbsp;<font color='#71BE02;'>";
} }
else { else {
$html .= "<img src='http://www.3025-game.de/special/app_achievements/pic/pending.png' height='10px' />&nbsp;<font color='#999999;'>"; $html .= "<img src='".$_CONF['image_url']."pic/pending.png' height='10px' />&nbsp;<font color='#999999;'>";
} }
$html .= $obj->getName()."</font>"; $html .= $obj->getName()."</font>";
@ -409,6 +351,7 @@
} }
function ach_render_obj_meta(&$obj) { function ach_render_obj_meta(&$obj) {
global $_CONF;
$html = ""; $html = "";
if($obj->isdone()) { if($obj->isdone()) {
$col = "#71BE02"; $col = "#71BE02";
@ -421,7 +364,7 @@
return "<table cellspacing='0' cellpadding='0'> return "<table cellspacing='0' cellpadding='0'>
<tr> <tr>
<td><img src='http://www.3025-game.de/special/app_achievements/pic/icon/".$grey."small/test.png' /></td> <td><img src='".$_CONF['image_url']."pic/icon/".$grey."small/".$obj->getMetaImage()."' /></td>
<td><font color='".$col."'>&nbsp;".$obj->getName()."</font></td> <td><font color='".$col."'>&nbsp;".$obj->getName()."</font></td>
</tr> </tr>
</table>"; </table>";

View file

@ -44,7 +44,7 @@
} }
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,$_CONF;
$html = "<style> $html = "<style>
.o { .o {
@ -116,11 +116,11 @@
} }
function ach_render_yubopoints() { function ach_render_yubopoints() {
global $DBc,$_USER; global $DBc,$_USER,$_CONF;
$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 = "<div style='display:block;border-bottom:1px solid #000000;'><span style='font-size:32px;'>".$_USER->getName()."&nbsp;<img src='".$_CONF['image_url']."pic/yubo_done.png'>&nbsp;".$res[0]['anz']."</span></div>";
return $html; return $html;
} }
@ -134,6 +134,8 @@
} }
function ach_render_menu(&$menu,$sub = 0) { function ach_render_menu(&$menu,$sub = 0) {
global $_CONF;
$html = "<style> $html = "<style>
.ach_menu { .ach_menu {
display:block; display:block;
@ -160,7 +162,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/".$curr->getImage()."' /></td>"; $html .= "<td><img src='".$_CONF['image_url']."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()) {
@ -208,34 +210,34 @@
} }
function ach_render_achievement_done(&$ach) { function ach_render_achievement_done(&$ach) {
$html = ""; global $_CONF;
$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="'.$_CONF['image_url'].'pic/bar_done_ul.png"></td>
<td style="background-image: url(pic/bar_done_u.png);"></td> <td style="background-image: url('.$_CONF['image_url'].'pic/bar_done_u.png);"></td>
<td width="3px"><img src="pic/bar_done_ur.png"></td> <td width="3px"><img src="'.$_CONF['image_url'].'pic/bar_done_ur.png"></td>
</tr> </tr>
<tr> <tr>
<td style="background-image: url(pic/bar_done_l.png);"></td> <td style="background-image: url('.$_CONF['image_url'].'pic/bar_done_l.png);"></td>
<td style="background-image: url(pic/bar_done_bg.png);"> <td style="background-image: url('.$_CONF['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/'.$ach->getImage().'"></td> <td rowspan="2" valign="top"><img src="'.$_CONF['image_url'].'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="'.$_CONF['image_url'].'pic/yubo_done.png">
</td> </td>
</tr><tr><td align="center" valign="top">'; </tr><tr><td align="center" valign="top">';
$html .= ach_render_perk_done($ach); $html .= ach_render_perk_done($ach);
$html .= '</td></tr></tbody></table></center> $html .= '</td></tr></tbody></table></center>
</td> </td>
<td style="background-image: url(pic/bar_done_r.png);"></td> <td style="background-image: url('.$_CONF['image_url'].'pic/bar_done_r.png);"></td>
</tr> </tr>
<tr> <tr>
<td><img src="pic/bar_done_bl.png"></td> <td><img src="'.$_CONF['image_url'].'pic/bar_done_bl.png"></td>
<td style="background-image: url(pic/bar_done_b.png);"></td> <td style="background-image: url('.$_CONF['image_url'].'pic/bar_done_b.png);"></td>
<td><img src="pic/bar_done_br.png"></td> <td><img src="'.$_CONF['image_url'].'pic/bar_done_br.png"></td>
</tr> </tr>
</tbody></table></div>'; </tbody></table></div>';
@ -243,34 +245,34 @@
} }
function ach_render_achievement_open(&$ach) { function ach_render_achievement_open(&$ach) {
$html = ""; global $_CONF;
$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_pending_ul.png"></td> <td width="3px"><img src="'.$_CONF['image_url'].'pic/bar_pending_ul.png"></td>
<td style="background-image: url(pic/bar_pending_u.png);"></td> <td style="background-image: url('.$_CONF['image_url'].'pic/bar_pending_u.png);"></td>
<td width="3px"><img src="pic/bar_pending_ur.png"></td> <td width="3px"><img src="'.$_CONF['image_url'].'pic/bar_pending_ur.png"></td>
</tr> </tr>
<tr> <tr>
<td style="background-image: url(pic/bar_pending_l.png);"></td> <td style="background-image: url('.$_CONF['image_url'].'pic/bar_pending_l.png);"></td>
<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/'.$ach->getImage().'"></td> <td rowspan="2" valign="top"><img src="'.$_CONF['image_url'].'pic/icon/grey/'.$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="'.$_CONF['image_url'].'pic/yubo_pending.png">
</td> </td>
</tr><tr><td align="center" valign="top">'; </tr><tr><td align="center" valign="top">';
$html .= ach_render_perk_open($ach); $html .= ach_render_perk_open($ach);
$html .= '</td></tr></tbody></table></center> $html .= '</td></tr></tbody></table></center>
</td> </td>
<td style="background-image: url(pic/bar_pending_r.png);"></td> <td style="background-image: url('.$_CONF['image_url'].'pic/bar_pending_r.png);"></td>
</tr> </tr>
<tr> <tr>
<td><img src="pic/bar_pending_bl.png"></td> <td><img src="'.$_CONF['image_url'].'pic/bar_pending_bl.png"></td>
<td style="background-image: url(pic/bar_pending_b.png);"></td> <td style="background-image: url('.$_CONF['image_url'].'pic/bar_pending_b.png);"></td>
<td><img src="pic/bar_pending_br.png"></td> <td><img src="'.$_CONF['image_url'].'pic/bar_pending_br.png"></td>
</tr> </tr>
</tbody></table></div>'; </tbody></table></div>';
@ -300,6 +302,7 @@
} }
function ach_render_perk_done(&$ach) { function ach_render_perk_done(&$ach) {
global $_CONF;
$html = ""; $html = "";
$perk_list = $ach->getDone(); $perk_list = $ach->getDone();
@ -309,7 +312,7 @@
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 .= "<div style='display:block;'><span style='color:#66CC00;font-weight:bold;'>".$perk->getName()."</span> ( ".date('d.m.Y',$perk->getDone())." ) <img src='".$_CONF['image_url']."pic/yubo_done.png' width='15px' /> ".$perk->getValue()."</div>";
} }
return $html; return $html;
@ -368,12 +371,13 @@
} }
function ach_render_obj_simple(&$obj) { function ach_render_obj_simple(&$obj) {
global $_CONF;
$html = ""; $html = "";
if($obj->isdone()) { if($obj->isdone()) {
$html .= "<img src='pic/check.png' height='10px' />&nbsp;<span style='color:#71BE02;'>"; $html .= "<img src='".$_CONF['image_url']."pic/check.png' height='10px' />&nbsp;<span style='color:#71BE02;'>";
} }
else { else {
$html .= "<img src='pic/pending.png' height='10px' />&nbsp;<span style='color:#999999;'>"; $html .= "<img src='".$_CONF['image_url']."pic/pending.png' height='10px' />&nbsp;<span style='color:#999999;'>";
} }
$html .= $obj->getName()."</span>"; $html .= $obj->getName()."</span>";
@ -382,6 +386,7 @@
} }
function ach_render_obj_meta(&$obj) { function ach_render_obj_meta(&$obj) {
global $_CONF;
$html = ""; $html = "";
if($obj->isdone()) { if($obj->isdone()) {
$col = "#71BE02"; $col = "#71BE02";
@ -394,7 +399,7 @@
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='".$_CONF['image_url']."pic/icon/".$grey.$obj->getMetaImage()."' width='20px' /></td>
<td valign='middle'><span style='color:".$col.";'>&nbsp;".$obj->getName()."</span></td> <td valign='middle'><span style='color:".$col.";'>&nbsp;".$obj->getName()."</span></td>
</tr> </tr>
</table>"; </table>";

View file

@ -49,21 +49,19 @@ 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("ahufler"); $DBc = ryDB::getInstance("ahufler");
/*$db->setDbDefs('test', array('id' => SQL_DEF_INT, 'num_access' => SQL_DEF_INT));
$num_access = $db->querySingleAssoc('test', array('id' => $user['id']));
if ($num_access)
$db->update('test', array('num_access' => ++$num_access['num_access']), array('id' => $user['id']));
else
$db->insert('test', array('num_access' => $num_access['num_access']=1, 'id' => $user['id']));
// Content
$c = _t('access', $num_access['num_access']).'<br/>';*/
#$c = var_export($user,true);
if(!$_USER->isIG && $_CONF['enable_webig'] == false) {
$c = ach_render_forbidden(false);
}
elseif($_USER->isIG && $_CONF['enable_offgame'] == false) {
$c = ach_render_forbidden(true);
}
else {
$c = ach_render();
}
echo ryzom_app_render("achievements", ach_render(), $_USER->isIG());
echo ryzom_app_render("achievements", $c, $_USER->isIG());
?> ?>