#1470 class files moved; some rendering improvements;

--HG--
branch : gsoc2012-achievements
This commit is contained in:
SirCotare 2012-05-31 15:15:36 +02:00
parent c4962725a3
commit 29d1d9372f
15 changed files with 272 additions and 177 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View file

@ -8,9 +8,10 @@
private $tie_cult; private $tie_cult;
private $image; private $image;
private $name; private $name;
private $template;
function AchAchievement(&$data,$lang,$user) { function AchAchievement(&$data) {
global $db; global $DBc,$_USER;
$this->id = $data['aa_id']; $this->id = $data['aa_id'];
$this->parent = $data['aa_parent']; $this->parent = $data['aa_parent'];
@ -20,16 +21,16 @@
$this->tie_cult = $data['aa_tie_cult']; $this->tie_cult = $data['aa_tie_cult'];
$this->image = $data['aa_image']; $this->image = $data['aa_image'];
$this->name = $data['aal_name']; $this->name = $data['aal_name'];
$this->done = $data['']; $this->template = $data['aal_template'];
#echo $this->id; #echo $this->id;
$res = $db->sqlQuery("SELECT * FROM ach_perk LEFT JOIN (ach_perk_lang) ON (apl_lang='".$lang."' AND apl_perk=ap_id) LEFT JOIN (ach_player_perk) ON (app_perk=ap_id AND app_player='".$user."') WHERE ap_achievement='".$this->id."' AND ap_parent IS NULL"); $res = $DBc->sqlQuery("SELECT * FROM ach_perk LEFT JOIN (ach_perk_lang) ON (apl_lang='".$_USER->getLang()."' AND apl_perk=ap_id) LEFT JOIN (ach_player_perk) ON (app_perk=ap_id AND app_player='".$_USER->getID()."') WHERE ap_achievement='".$this->id."' AND ap_parent IS NULL");
#MISSING: or parent is done #MISSING: or parent is done
$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],$lang,$user); $tmp = new AchPerk($res[$i],$this);
#echo var_export($tmp,true); #echo var_export($tmp,true);
@ -88,5 +89,20 @@
function getValueOpen() { function getValueOpen() {
return $this->nodes[$this->child_open[0]]->getValue(); return $this->nodes[$this->child_open[0]]->getValue();
} }
function getTemplate($insert = array()) {
if($this->template == null) {
return implode(";",$insert);
}
else {
$tmp = $this->template;
$match = array();
preg_match_all('#\[([0-9]+)\]#', $this->template, $match);
foreach($match[0] as $key=>$elem) {
$tmp = str_replace("[".$match[1][$key]."]",$insert[$key],$tmp);
}
return $tmp;
}
}
} }
?> ?>

View file

@ -0,0 +1,48 @@
<?php
class AchCategory extends AchList {
private $id = false;
private $ties_cult;
private $ties_civ;
function AchCategory($id,$cult,$civ) {
global $DBc,$_USER;
$this->id = $id;
$res = $DBc->sqlQuery("SELECT * FROM ach_achievement LEFT JOIN (ach_achievement_lang) ON (aal_lang='".$_USER->getLang()."' AND aal_achievement=aa_id) WHERE aa_category='".$this->id."' AND aa_parent IS NULL AND (aa_tie_race IS NULL OR aa_tie_race='".$_USER->getParam('race')."') AND (aa_tie_cult IS NULL OR aa_tie_cult='".$cult."') AND (aa_tie_civ IS NULL OR aa_tie_civ='".$civ."') ORDER by aal_name ASC");
#MISSING: or parent is done
$sz = sizeof($res);
for($i=0;$i<$sz;$i++) {
#echo "Y";
$tmp = new AchAchievement($res[$i]);
#echo var_export($tmp,true);
if($tmp->hasOpen()) {
$this->child_open[] = sizeof($this->nodes);
}
if($tmp->hasDone()) {
$this->child_done[] = sizeof($this->nodes);
}
$this->nodes[] = $tmp;
}
$res = $DBc->sqlQuery("SELECT count(*) FROM ach_achievement WHERE aa_tie_cult IS NOT NULL");
$this->ties_cult = $res[0]['anz'];
$res = $DBc->sqlQuery("SELECT count(*) FROM ach_achievement WHERE aa_tie_civ IS NOT NULL");
$this->ties_civ = $res[0]['anz'];
}
function getID() {
return $this->id;
}
function isTiedCult() {
return ($this->ties_cult > 0);
}
function isTiedCiv() {
return ($this->ties_civ > 0);
}
}
?>

View file

@ -1,24 +1,4 @@
<?php <?php
abstract class RenderNodeIterator {
protected $nodes = array();
function getSize() {
return sizeof($this->nodes);
}
function getChild($i) {
return $this->nodes[$i];
}
function isEmpty() {
return (sizeof($this->nodes) == 0);
}
function getChildren() {
return $this->nodes;
}
}
abstract class AchList extends RenderNodeIterator { abstract class AchList extends RenderNodeIterator {
protected $child_done = array(); protected $child_done = array();
protected $child_open = array(); protected $child_open = array();

View file

@ -2,24 +2,24 @@
class AchMenu extends RenderNodeIterator { class AchMenu extends RenderNodeIterator {
var $open; var $open;
function AchMenu($open = false,$lang = 'en') { function AchMenu($open = false) {
global $db; global $DBc,$_USER;
$this->open = $open; $this->open = $open;
$tmp = array(); $tmp = array();
$tmp['ac_id'] = 0; $tmp['ac_id'] = 0;
$tmp['ac_parent'] = null; $tmp['ac_parent'] = null;
$tmp['acl_name'] = get_translation('ach_summary',$lang); $tmp['acl_name'] = get_translation('ach_summary',$_USER->getLang());
$tmp['ac_image'] = ""; $tmp['ac_image'] = "";
$tmp['ac_order'] = -1; $tmp['ac_order'] = -1;
$this->nodes[] = new AchMenuNode($tmp,$open,$lang); $this->nodes[] = new AchMenuNode($tmp,$open,$lang);
$res = $db->sqlQuery("SELECT * FROM ach_category LEFT JOIN (ach_category_lang) ON (acl_lang='".$lang."' 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,$lang); $this->nodes[] = new AchMenuNode($res[$i],$open);
} }
} }
@ -46,8 +46,8 @@
private $image; private $image;
private $order; private $order;
function AchMenuNode(&$data,$open,$lang) { function AchMenuNode(&$data,$open) {
global $db; global $DBc,$_USER;
$this->id = $data['ac_id']; $this->id = $data['ac_id'];
$this->parent = $data['ac_parent']; $this->parent = $data['ac_parent'];
@ -56,11 +56,11 @@
$this->order = $data['ac_order']; $this->order = $data['ac_order'];
$this->open = ($this->id == $open); $this->open = ($this->id == $open);
$res = $db->sqlQuery("SELECT * FROM ach_category LEFT JOIN (ach_category_lang) ON (acl_lang='".$lang."' AND acl_category=ac_id) WHERE ac_parent='".$this->id."' 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='".$this->id."' 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,$lang); $this->nodes[] = new AchMenuNode($res[$i],$open);
} }
} }

View file

@ -9,8 +9,8 @@
private $done; private $done;
private $progress; private $progress;
function AchObjective(&$data,$lang,$user) { function AchObjective(&$data) {
global $db; global $DBc,$_USER;
$this->id = $data['ao_id']; $this->id = $data['ao_id'];
$this->perk = $data['ao_perk']; $this->perk = $data['ao_perk'];
@ -23,7 +23,7 @@
$this->progress = $this->value; $this->progress = $this->value;
if(!$this->isDone()) { if(!$this->isDone()) {
$res = $db->sqlQuery("SELECT count(*) as anz FROM ach_player_atom,ach_atom WHERE apa_atom=atom_id AND atom_objective='".$this->id."' AND apa_player='".$user."'"); $res = $DBc->sqlQuery("SELECT count(*) as anz FROM ach_player_atom,ach_atom WHERE apa_atom=atom_id AND atom_objective='".$this->id."' AND apa_player='".$_USER->getId()."'");
$this->progress = $res[0]['anz']; $this->progress = $res[0]['anz'];
} }
} }

View file

@ -7,20 +7,20 @@
private $name; private $name;
private $done; private $done;
function AchPerk(&$data,$lang,$user) { function AchPerk(&$data,&$parent) {
global $db; global $DBc,$_USER;
$this->id = $data['ap_id']; $this->id = $data['ap_id'];
$this->parent = $data['ap_parent']; $this->parent = $parent;
$this->achievement = $data['ap_achievement']; $this->achievement = $data['ap_achievement'];
$this->value = $data['ap_value']; $this->value = $data['ap_value'];
$this->name = $data['apl_name']; $this->name = $data['apl_name'];
$this->done = $data['app_date']; $this->done = $data['app_date'];
$res = $db->sqlQuery("SELECT * FROM ach_objective LEFT JOIN (ach_objective_lang) ON (aol_lang='".$lang."' AND aol_objective=ao_id) LEFT JOIN (ach_player_objective) ON (apo_objective=ao_id AND apo_player='".$user."') 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],$lang,$user); $this->nodes[] = new AchObjective($res[$i]);
} }
} }
@ -41,7 +41,7 @@
} }
function getName() { function getName() {
return $this->name; return $this->parent->getTemplate(explode(";",$this->name));
} }
function objDrawable() { function objDrawable() {

View file

@ -0,0 +1,69 @@
<?php
class AchSummary extends AchList {
private $menu;
private $stats;
function AchSummary(&$menu,$size = 10) {
global $DBc,$_USER;
$this->menu = $menu;
//read all recent perks of user
//make distinct achievement list
$res = $DBc->sqlQuery("SELECT DISTINCT aa_id,ach.*,(SELECT aal_name FROM ach_achievement_lang WHERE aal_lang='".$_USER->getLang()."' AND aal_achievement=ach.aa_id) as aal_name FROM ach_achievement as ach,ach_perk,ach_player_perk WHERE ap_achievement=aa_id AND app_player='".$_USER->getID()."' AND app_perk=ap_id ORDER by app_date DESC LIMIT 0,".($size-1));
$sz = sizeof($res);
for($i=0;$i<$sz;$i++) {
$tmp = new AchAchievement($res[$i]);
$this->child_done[] = sizeof($this->nodes);
$this->nodes[] = $tmp;
}
}
function getSummary() {
if(!is_array($this->stats)) { // only load if needed
//now we have to find the # of perks for each main menu entry
//and also sum up how many have been completed
$this->stats = array(); // [][name,done,total]
$tmp = $this->menu->getChildren();
foreach($tmp as $elem) {
if($elem->getID() == 0) {
continue; // skip summary page
}
$res = $this->sumStats($elem);
$this->stats[] = array($elem->getName(),$res[0],$res[1]);
}
}
return $this->stats;
}
private function sumStats(&$node) {
global $DBc,$_USER;
$done = 0;
$total = 0;
//read for current ID
//sum
$res = $DBc->sqlQuery("SELECT count(ap_id) as anz FROM ach_perk,ach_achievement,ach_player_perk WHERE aa_category='".$node->getID()."' AND ap_achievement=aa_id AND app_player='".$_USER->getID()."' AND app_perk=ap_id");
$done += $res[0]["anz"];
$res = $DBc->sqlQuery("SELECT count(ap_id) as anz FROM ach_perk,ach_achievement WHERE aa_category='".$node->getID()."' AND ap_achievement=aa_id");
$total += $res[0]["anz"];
$tmp = $node->getChildren();
foreach($tmp as $elem) {
$res = $this->sumStats($elem);
$done += $res[0];
$total += $res[1];
}
return array($done,$total);
}
}
?>

View file

@ -0,0 +1,21 @@
<?php
abstract class RenderNodeIterator {
protected $nodes = array();
function getSize() {
return sizeof($this->nodes);
}
function getChild($i) {
return $this->nodes[$i];
}
function isEmpty() {
return (sizeof($this->nodes) == 0);
}
function getChildren() {
return $this->nodes;
}
}
?>

View file

@ -0,0 +1,25 @@
<?php
class RyzomUser {
private $data;
function RyzomUser($data) {
$this->data = $data;
}
function getID() {
return 1;
}
function getLang() {
return $this->data['lang'];
}
function isIG() {
return $this->data['ig'];
}
function getParam($p) {
return $this->data[$p];
}
}
?>

View file

@ -1,32 +0,0 @@
<?php
class AchCategory extends AchList {
private $id = false;
function AchCategory($id,$user = 0,$lang = 'en') {
global $db;
$this->id = $id;
$res = $db->sqlQuery("SELECT * FROM ach_achievement LEFT JOIN (ach_achievement_lang) ON (aal_lang='".$lang."' AND aal_achievement=aa_id) WHERE aa_category='".$this->id."' AND aa_parent IS NULL ORDER by aal_name ASC");
#MISSING: or parent is done
$sz = sizeof($res);
for($i=0;$i<$sz;$i++) {
#echo "Y";
$tmp = new AchAchievement($res[$i],$lang,$user);
#echo var_export($tmp,true);
if($tmp->hasOpen()) {
$this->child_open[] = sizeof($this->nodes);
}
if($tmp->hasDone()) {
$this->child_done[] = sizeof($this->nodes);
}
$this->nodes[] = $tmp;
}
}
function getID() {
return $this->id;
}
}
?>

View file

@ -1,69 +0,0 @@
<?php
class AchSummary extends AchList {
private $menu;
private $stats;
function AchSummary(&$menu,$user,$size = 10,$lang = 'en') {
global $db;
$this->menu = $menu;
//read all recent perks of user
//make distinct achievement list
$res = $db->sqlQuery("SELECT DISTINCT aa_id,ach.*,(SELECT aal_name FROM ach_achievement_lang WHERE aal_lang='".$lang."' AND aal_achievement=ach.aa_id) as aal_name FROM ach_achievement as ach,ach_perk,ach_player_perk WHERE ap_achievement=aa_id AND app_player='".$user."' AND app_perk=ap_id ORDER by app_date DESC LIMIT 0,".($size-1));
$sz = sizeof($res);
for($i=0;$i<$sz;$i++) {
$tmp = new AchAchievement($res[$i],$lang,$user);
$this->child_done[] = sizeof($this->nodes);
$this->nodes[] = $tmp;
}
}
function getSummary($lang,$user) {
if(!is_array($this->stats)) { // only load if needed
//now we have to find the # of perks for each main menu entry
//and also sum up how many have been completed
$this->stats = array(); // [][name,done,total]
$tmp = $this->menu->getChildren();
foreach($tmp as $elem) {
if($elem->getID() == 0) {
continue; // skip summary page
}
$res = $this->sumStats($elem,$user);
$this->stats[] = array($elem->getName(),$res[0],$res[1]);
}
}
return $this->stats;
}
private function sumStats(&$node,$user) {
global $db;
$done = 0;
$total = 0;
//read for current ID
//sum
$res = $db->sqlQuery("SELECT count(ap_id) as anz FROM ach_perk,ach_achievement,ach_player_perk WHERE aa_category='".$node->getID()."' AND ap_achievement=aa_id AND app_player='".$user."' AND app_perk=ap_id");
$done += $res[0]["anz"];
$res = $db->sqlQuery("SELECT count(ap_id) as anz FROM ach_perk,ach_achievement WHERE aa_category='".$node->getID()."' AND ap_achievement=aa_id");
$total += $res[0]["anz"];
$tmp = $node->getChildren();
foreach($tmp as $elem) {
$res = $this->sumStats($elem,$user);
$done += $res[0];
$total += $res[1];
}
return array($done,$total);
}
}
?>

View file

@ -1,7 +1,21 @@
<?php <?php
function ach_render_tiebar($cult = "neutral", $civ = "neutral") { function nf($n) {
return number_format($n, 0, '.', ',');
}
function ach_render_tiebar($cult = "neutral", $civ = "neutral") {
global $_USER;
}
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 = "<div style='display:block;border-bottom:1px solid #000000;'><img src='pic/yubo_done.png'>&nbsp;<span style='font-size:32px;'>".$res[0]['anz']."</span></div>";
return $html;
} }
function ach_render_menu(&$menu,$sub = 0) { function ach_render_menu(&$menu,$sub = 0) {
@ -160,9 +174,6 @@
$perk = $ach->getChild($elem); $perk = $ach->getChild($elem);
$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='pic/yubo_done.png' width='15px' /> ".$perk->getValue()."</div>";
} }
/*if($perk->objDrawable()) {
$html .= "<br>".ach_render_obj_list($perk->getChildren());
}*/
return $html; return $html;
} }
@ -254,13 +265,15 @@
function ach_render_obj_value(&$obj) { function ach_render_obj_value(&$obj) {
$html = ""; $html = "";
if($obj->isdone()) { if($obj->getName() != null) {
$col = "#71BE02"; if($obj->isdone()) {
$col = "#71BE02";
}
else {
$col = "#999999";
}
$html .= "<div style='color:".$col.";display:block;'>".$obj->getName()."</div>";
} }
else {
$col = "#999999";
}
$html .= "<div style='color:".$col.";display:block;'>".$obj->getName()."</div>";
$html .= ach_render_progressbar($obj->getProgress(),$obj->getValue(),350); $html .= ach_render_progressbar($obj->getProgress(),$obj->getValue(),350);
@ -276,12 +289,12 @@
<tr> <tr>
<td bgcolor='#66CC00' width='".$left."px' align='right'>"; <td bgcolor='#66CC00' width='".$left."px' align='right'>";
if(($prog/$val) > 0.85) { if(($prog/$val) > 0.85) {
$html .= "&nbsp;".$prog." / ".$val."&nbsp;"; $html .= "&nbsp;".nf($prog)." / ".nf($val)."&nbsp;";
} }
$html .= "</td> $html .= "</td>
<td align='left' style='color:#FFFFFF;'>"; <td align='left' style='color:#FFFFFF;'>";
if(($prog/$val) <= 0.85) { if(($prog/$val) <= 0.85) {
$html .= "&nbsp;".$prog." / ".$val."&nbsp;"; $html .= "&nbsp;".nf($prog)." / ".nf($val)."&nbsp;";
} }
$html .= "</td> $html .= "</td>
</tr> </tr>
@ -290,12 +303,16 @@
return $html; return $html;
} }
function ach_render_summary_header($lang) { function ach_render_summary_header() {
return "<div style='display:block;font-weight:bold;font-size:30px;color:#FFFFFF;text-align:center;margin-bottom:10px;'>".get_translation('ach_summary_header',$lang)."</div>"; 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>";
} }
function ach_render_summary_footer($lang,&$summary,$user) { function ach_render_summary_footer(&$summary) {
$nodes = $summary->getSummary($lang,$user); global $_USER;
$nodes = $summary->getSummary();
$html = ""; $html = "";
$sum_done = 0; $sum_done = 0;
@ -323,10 +340,10 @@
} }
$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',$lang)."</div> <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>
<table> <table>
<tr> <tr>
<td colspan='3' align='center'>".get_translation('ach_summary_stats_total',$lang)."<br>".ach_render_progressbar($sum_done,$sum_total,450)."<br></td> <td colspan='3' align='center'>".get_translation('ach_summary_stats_total',$_USER->getLang())."<br>".ach_render_progressbar($sum_done,$sum_total,450)."<br></td>
</tr> </tr>
".$html." ".$html."
</table>"; </table>";

View file

@ -13,7 +13,10 @@ require_once('conf.php');
// Ask to authenticate user (using ingame or session method) and fill $user with all information // Ask to authenticate user (using ingame or session method) and fill $user with all information
ryzom_app_authenticate($user, false); ryzom_app_authenticate($user, false);
if($user['ig']) { require_once("class/RyzomUser_class.php");
$_USER = new RyzomUser($user);
if($_USER->isIG()) {
require_once("include/ach_render_ig.php"); require_once("include/ach_render_ig.php");
} }
else { else {
@ -21,20 +24,21 @@ else {
} }
require_once("include/ach_render_common.php"); require_once("include/ach_render_common.php");
require_once("include/AchCommon_class.php"); require_once("class/RenderNodeIteraor_abstract.php");
require_once("include/AchMenu_class.php"); require_once("class/AchList_abstract.php");
require_once("include/AchSummary_class.php");
require_once("include/AchCategory_class.php");
require_once("include/AchAchievement_class.php"); require_once("class/AchMenu_class.php");
require_once("include/AchPerk_class.php"); require_once("class/AchSummary_class.php");
require_once("include/AchObjective_class.php"); require_once("class/AchCategory_class.php");
require_once("class/AchAchievement_class.php");
require_once("class/AchPerk_class.php");
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);
$db = ryDB::getInstance(APP_NAME); $DBc = ryDB::getInstance(APP_NAME);
/*$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']));
@ -49,11 +53,14 @@ $c = _t('access', $num_access['num_access']).'<br/>';*/
#$c = var_export($user,true); #$c = var_export($user,true);
$c = "<center><table> $c = "<center><table>
<tr>
<td colspan='2'>".ach_render_yubopoints(1)."</td>
</tr>
<tr> <tr>
<td valign='top'><div style='width:230px;font-weight:bold;font-size:14px;'>"; <td valign='top'><div style='width:230px;font-weight:bold;font-size:14px;'>";
#$_REQUEST['mid'] = 1; #$_REQUEST['mid'] = 1;
$menu = new AchMenu($_REQUEST['cat'],$user['lang']); $menu = new AchMenu($_REQUEST['cat']);
$c .= ach_render_menu($menu); $c .= ach_render_menu($menu);
@ -67,22 +74,35 @@ $c .= "</div></td>
$open = $menu->getOpenCat(); $open = $menu->getOpenCat();
if($open != 0) { if($open != 0) {
$cat = new AchCategory($open,1,$user['lang']); if($_REQUEST['cult']) {
$cult = mysql_real_escape_string($_REQUEST['cult']);
}
else {
$cult = $_USER->getParam('cult');
}
if($_REQUEST['civ']) {
$civ = mysql_real_escape_string($_REQUEST['civ']);
}
else {
$civ = $_USER->getParam('civ');
}
$cat = new AchCategory($open,$cult,$civ);
} }
else { else {
$cat = new AchSummary($menu,1,8,$user['lang']); $cat = new AchSummary($menu,8);
$c .= ach_render_summary_header($user['lang']); $c .= ach_render_summary_header();
} }
$c .= ach_render_category($cat); $c .= ach_render_category($cat);
if($open == 0) { if($open == 0) {
$c .= ach_render_summary_footer($user['lang'],$cat,1); $c .= ach_render_summary_footer($cat,1);
} }
$c .= "</td> $c .= "</td>
</tr> </tr>
</table></center>"; </table></center>";
echo ryzom_app_render("achievements", $c, $user['ig']); echo ryzom_app_render("achievements", $c, $_USER->isIG());
?> ?>