#1470 config options added; some cleanup

This commit is contained in:
SirCotare 2012-06-21 22:03:36 +02:00
parent 6d827877ce
commit 0e06c1a129
7 changed files with 107 additions and 146 deletions

View file

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

View file

@ -19,7 +19,7 @@
$this->done = $data['app_date'];
$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);
for($i=0;$i<$sz;$i++) {
$this->nodes[] = $this->makeChild($res[$i]);

View file

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

View file

@ -17,4 +17,13 @@
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
function ach_render() {
global $user;
global $_USER;
$c = "<table>
<tr>
<td>".ach_render_yubopoints($user['id'])."</td>
<td>".ach_render_yubopoints($_USER->getID())."</td>
</tr>
</table>
@ -44,18 +44,12 @@
function ach_render_tiebar($cult = "c_neutral", $civ = "c_neutral",&$cat) {
global $_USER;
$html = "<style>
.o {
color:orange;
}
</style>
<div style='display:block;text-align:center;'><form method='post' action='?cat=".$cat->getID()."' id='cc_form'>
$html = "<form method='post' action='?cat=".$cat->getID()."'>
<table>
<tr>";
if($cat->isTiedCult()) {
$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_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>
@ -64,7 +58,7 @@
}
if($cat->isTiedCiv()) {
$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_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>
@ -73,52 +67,52 @@
</select>
</td>";
}
$html.= "</tr>
$html.= "<td><input type='submit' value='show' /></td></tr><tr><td>&nbsp;</td></tr>
</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
#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
#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
#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
#While being aligned with the
$html .= get_translation('ach_allegiance_start',$_USER->getLang());
if($cat->isTiedCult() && $cult != "c_neutral") {
#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") {
#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") {
#CIV
$html .= "<span class='o'>".ach_translate_cc($civ)."</span>";
$html .= "<font color='orange'>".ach_translate_cc($civ)."</font>";
}
}
#, 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;
}
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()."'");
$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;
}
@ -132,6 +126,8 @@
}
function ach_render_menu(&$menu,$sub = 0) {
global $_CONF;
$html = "";
if($sub == 0) {
$html = "<table cellpadding='2px'>";
@ -145,10 +141,10 @@
$html .= "<tr><td></td><td bgcolor='#000000'></td></tr>
<tr><td>";
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 {
$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'";
if($curr->isOpen()) {
@ -201,17 +197,19 @@
}
function ach_render_achievement_done(&$ach) {
global $_CONF;
$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 width='70px'><img src='".$_CONF['image_url']."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>
<td width='35px'><font size='24px' color='#000000'>".$ach->getValueDone()."</font><br><img src='".$_CONF['image_url']."pic/yubo_done.png'></td>
</tr>
</table>
</td>
@ -219,40 +217,11 @@
<tr><td>&nbsp;</td></tr>
</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;
}
function ach_render_achievement_open(&$ach) {
$html = "";
global $_CONF;
$html = "
<table>
@ -260,11 +229,11 @@
<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 width='70px'><img src='".$_CONF['image_url']."pic/icon/grey/".$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>
<td width='35px'><font size='22px' color='#000000'>".$ach->getValueOpen()."</font><br><img src='".$_CONF['image_url']."pic/yubo_pending.png'></td>
</tr>
</table>
</td>
@ -272,40 +241,10 @@
<tr><td>&nbsp;</td></tr>
</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;
}
function ach_render_perk_open(&$ach) {
#echo var_export($perk_list,true);
$html = "";
$perk_list = $ach->getOpen();
@ -327,6 +266,7 @@
}
function ach_render_perk_done(&$ach) {
global $_CONF;
$html = "";
$perk_list = $ach->getDone();
@ -336,7 +276,7 @@
if($perk->inDev()) {
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;
@ -395,12 +335,14 @@
}
function ach_render_obj_simple(&$obj) {
global $_CONF;
$html = "";
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 {
$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>";
@ -409,6 +351,7 @@
}
function ach_render_obj_meta(&$obj) {
global $_CONF;
$html = "";
if($obj->isdone()) {
$col = "#71BE02";
@ -421,7 +364,7 @@
return "<table cellspacing='0' cellpadding='0'>
<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>
</tr>
</table>";

View file

@ -44,7 +44,7 @@
}
function ach_render_tiebar($cult = "c_neutral", $civ = "c_neutral",&$cat) {
global $_USER;
global $_USER,$_CONF;
$html = "<style>
.o {
@ -116,11 +116,11 @@
}
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()."'");
$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;
}
@ -134,6 +134,8 @@
}
function ach_render_menu(&$menu,$sub = 0) {
global $_CONF;
$html = "<style>
.ach_menu {
display:block;
@ -160,7 +162,7 @@
$html .= "<span class='ach_mspan'><a href='?lang=en&cat=".$curr->getID()."'><table class='ach_menu'>
<tr>";
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;";
if($curr->isOpen()) {
@ -208,34 +210,34 @@
}
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>
<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>
<td width="3px"><img src="'.$_CONF['image_url'].'pic/bar_done_ul.png"></td>
<td style="background-image: url('.$_CONF['image_url'].'pic/bar_done_u.png);"></td>
<td width="3px"><img src="'.$_CONF['image_url'].'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);">
<td style="background-image: url('.$_CONF['image_url'].'pic/bar_done_l.png);"></td>
<td style="background-image: url('.$_CONF['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 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 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>
</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>
<td style="background-image: url('.$_CONF['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>
<td><img src="'.$_CONF['image_url'].'pic/bar_done_bl.png"></td>
<td style="background-image: url('.$_CONF['image_url'].'pic/bar_done_b.png);"></td>
<td><img src="'.$_CONF['image_url'].'pic/bar_done_br.png"></td>
</tr>
</tbody></table></div>';
@ -243,34 +245,34 @@
}
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>
<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>
<td width="3px"><img src="'.$_CONF['image_url'].'pic/bar_pending_ul.png"></td>
<td style="background-image: url('.$_CONF['image_url'].'pic/bar_pending_u.png);"></td>
<td width="3px"><img src="'.$_CONF['image_url'].'pic/bar_pending_ur.png"></td>
</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>
<center><table width="100%" cellspacing="0" cellpadding="0">
<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 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>
</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>
<td style="background-image: url('.$_CONF['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>
<td><img src="'.$_CONF['image_url'].'pic/bar_pending_bl.png"></td>
<td style="background-image: url('.$_CONF['image_url'].'pic/bar_pending_b.png);"></td>
<td><img src="'.$_CONF['image_url'].'pic/bar_pending_br.png"></td>
</tr>
</tbody></table></div>';
@ -300,6 +302,7 @@
}
function ach_render_perk_done(&$ach) {
global $_CONF;
$html = "";
$perk_list = $ach->getDone();
@ -309,7 +312,7 @@
if($perk->inDev()) {
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;
@ -368,12 +371,13 @@
}
function ach_render_obj_simple(&$obj) {
global $_CONF;
$html = "";
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 {
$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>";
@ -382,6 +386,7 @@
}
function ach_render_obj_meta(&$obj) {
global $_CONF;
$html = "";
if($obj->isdone()) {
$col = "#71BE02";
@ -394,7 +399,7 @@
return "<table cellspacing='0' cellpadding='0'>
<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>
</tr>
</table>";

View file

@ -49,21 +49,19 @@ require_once("class/AchObjective_class.php");
// Update user acces on Db
//$db = ryDB::getInstance(APP_NAME);
$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());
?>