diff --git a/code/web/app/app_achievements/_AchWebParser/_doc/Class_scheme.dia b/code/web/app/app_achievements/_AchWebParser/_doc/Class_scheme.dia
deleted file mode 100644
index 2295a2aff..000000000
Binary files a/code/web/app/app_achievements/_AchWebParser/_doc/Class_scheme.dia and /dev/null differ
diff --git a/code/web/app/app_achievements/_AchWebParser/_doc/Class_scheme.png b/code/web/app/app_achievements/_AchWebParser/_doc/Class_scheme.png
deleted file mode 100644
index fc92edd83..000000000
Binary files a/code/web/app/app_achievements/_AchWebParser/_doc/Class_scheme.png and /dev/null differ
diff --git a/code/web/app/app_achievements/_AchWebParser/class/DataDispatcher_class.php b/code/web/app/app_achievements/_AchWebParser/class/DataDispatcher_class.php
index 2ee25d979..2e296e715 100644
--- a/code/web/app/app_achievements/_AchWebParser/class/DataDispatcher_class.php
+++ b/code/web/app/app_achievements/_AchWebParser/class/DataDispatcher_class.php
@@ -1,4 +1,9 @@
event = array();
}
+ //registering atoms
+
function registerValue($name,$callback) {
if(!is_array($this->value[$name])) {
$this->value[$name] = array();
@@ -31,6 +38,8 @@
$this->event[$name][] = $callback;
}
+ //unregistering atoms
+
function unregisterValue($name,$callback) {
$res = array_search($callback,$this->value[$name],true);
if($res !== false) {
@@ -52,6 +61,8 @@
}
}
+ //dispatching data
+
function dispatchValue($key,$val) {
if(is_array($this->value[$key])) {
foreach($this->value[$key] as $callback) {
diff --git a/code/web/app/app_achievements/_AchWebParser/class/DataSourceHandler_class.php b/code/web/app/app_achievements/_AchWebParser/class/DataSourceHandler_class.php
index a36347969..7388cc6e4 100644
--- a/code/web/app/app_achievements/_AchWebParser/class/DataSourceHandler_class.php
+++ b/code/web/app/app_achievements/_AchWebParser/class/DataSourceHandler_class.php
@@ -1,4 +1,7 @@
source[] = $src;
}
- function drive($cid) {
+ function drive($cid) { // tell the datasources to start reading data
foreach($this->source as $elem) {
$elem->drive($cid);
}
diff --git a/code/web/app/app_achievements/_AchWebParser/class/Entity_abstract.php b/code/web/app/app_achievements/_AchWebParser/class/Entity_abstract.php
index e7322444a..73155597b 100644
--- a/code/web/app/app_achievements/_AchWebParser/class/Entity_abstract.php
+++ b/code/web/app/app_achievements/_AchWebParser/class/Entity_abstract.php
@@ -1,4 +1,7 @@
char = false;
}
- function setChar($c) {
+ function setChar($c) { // select the character
$this->char = $c;
}
- function writeData($key,$val) {
+ function writeData($key,$val) { // write to cache
global $DBc;
$DBc->sendSQL("INSERT INTO ach_player_valuecache (apv_name,apv_player,apv_value,apv_date) VALUES ('".$this->user."','".$DBc->mre($key)."','".$DBc->mre($val)."','".time()."') ON DUPLICATE KEY UPDATE apv_value='".$DBc->mre($val)."', apv_date='".time()."'","NONE");
}
- function getData($key) {
+ function getData($key) { // read from cache
global $DBc;
$res = $DBc->sendSQL("SELECT apv_value as value, apv_date as date FROM ach_player_valuecache WHERE apv_name='".$DBc->mre($key)."' AND apv_player='".$this->char."'","ARRAY");
diff --git a/code/web/app/app_achievements/_AchWebParser/class/mySQL_class.php b/code/web/app/app_achievements/_AchWebParser/class/mySQL_class.php
index 7e1fd43c2..e93194675 100644
--- a/code/web/app/app_achievements/_AchWebParser/class/mySQL_class.php
+++ b/code/web/app/app_achievements/_AchWebParser/class/mySQL_class.php
@@ -1,10 +1,13 @@
$elem) {
$in[$key] = mysql_real_escape_string(stripslashes($elem));
@@ -16,20 +19,21 @@
return $in;
}
- function mySQL($err=false) {
+ function mySQL($err=false) { // constructor
$this->DBstats = array();
$this->DBc = false;
+ //set error handling
if($err === "DIE" || $err === "PRINT" || $err === "ALERT" || $err === "HIDE" || $err === "LOG") {
$this->DBerror = $err;
}
else {
$this->DBerror = "HIDE";
}
- $this->resetStats();
+ $this->resetStats(); // reset stats counter
$this->cached = false;
}
- function connect($ip,$user,$pass,$db=false) {
+ function connect($ip,$user,$pass,$db=false) { // connect
$this->DBc = mysql_pconnect($ip,$user,$pass) or $this->error(mysql_error());
if($this->DBc && $db) {
$this->database($db);
@@ -37,7 +41,7 @@
$this->resetStats();
}
- function database($db) {
+ function database($db) { // set database
if(!$this->DBc) {
return false;
}
@@ -49,14 +53,11 @@
$this->DBstats['error'] = 0;
}
- function getStats() {
+ function getStats() { // return stats
return $this->DBstats;
}
function sendSQL($query,$handling="PLAIN",$buffer=false) { // can be INSERT, DELETE, UPDATE, ARRAY, NONE, PLAIN
- #if($this->cached !== false) {
- #$this->unlinkSql($this->cached);
- #}
if(!$this->DBc) {
return false;
}
@@ -68,8 +69,6 @@
$res = mysql_query($query,$this->DBc) or $this->error(mysql_error(),$query);
}
- #$this->cached = $res;
-
$this->DBstats['query']++;
if($res) {
@@ -95,7 +94,6 @@
else {
return $res;
}
- //mysql_free_result($res);
}
else {
return false;
@@ -131,7 +129,7 @@
}
}
- private function error($error,$query = false) {
+ private function error($error,$query = false) { // error handler
global $log;
$this->DBstats['error']++;
diff --git a/code/web/app/app_achievements/_AchWebParser/include/functions_inc.php b/code/web/app/app_achievements/_AchWebParser/include/functions_inc.php
index ed1a02ded..bc0a1d960 100644
--- a/code/web/app/app_achievements/_AchWebParser/include/functions_inc.php
+++ b/code/web/app/app_achievements/_AchWebParser/include/functions_inc.php
@@ -1,22 +1,4 @@
append("[".date('H:i:s',time())."] ".$txt);
- }
- }
-
- function logi($txt,$i = 1) {
- $tmp = "";
- for($v=0;$v<$i;$v++) {
- $tmp .= " ";
- }
- return $tmp."> ".$txt;
- }
-
function dateTime_to_timestamp($dt) {
#2012-05-12 00:26:40
$tmp = explode(" ",$dt);
@@ -31,7 +13,7 @@
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_URL, $URL);
$contents = curl_exec($c);
- $err = curl_getinfo($c,CURLINFO_HTTP_CODE);
+ #$err = curl_getinfo($c,CURLINFO_HTTP_CODE);
curl_close($c);
if ($contents) return $contents;
else return FALSE;
diff --git a/code/web/app/app_achievements/_AchWebParser/script/in_region_script.php b/code/web/app/app_achievements/_AchWebParser/script/in_region_script.php
index 282670c79..9008a907b 100644
--- a/code/web/app/app_achievements/_AchWebParser/script/in_region_script.php
+++ b/code/web/app/app_achievements/_AchWebParser/script/in_region_script.php
@@ -1,4 +1,8 @@
conf = $_CONF;
-
-
$this->lock = 0;
$this->open = null;
$this->entity = null;
diff --git a/code/web/app/app_achievements/_AchWebParser/source/PDRtoXMLdriver/conf.php b/code/web/app/app_achievements/_AchWebParser/source/PDRtoXMLdriver/conf.php
deleted file mode 100644
index 5bf95e0d4..000000000
--- a/code/web/app/app_achievements/_AchWebParser/source/PDRtoXMLdriver/conf.php
+++ /dev/null
@@ -1,6 +0,0 @@
-
\ No newline at end of file
diff --git a/code/web/app/app_achievements/_doc/ER & Class Schema.pdf b/code/web/app/app_achievements/_doc/ER & Class Schema.pdf
new file mode 100644
index 000000000..721d6d59e
Binary files /dev/null and b/code/web/app/app_achievements/_doc/ER & Class Schema.pdf differ
diff --git a/code/web/app/app_achievements/_doc/Ryzom Player Achievements.pdf b/code/web/app/app_achievements/_doc/Ryzom Player Achievements.pdf
index 6ae82b1f1..80edb86bb 100644
Binary files a/code/web/app/app_achievements/_doc/Ryzom Player Achievements.pdf and b/code/web/app/app_achievements/_doc/Ryzom Player Achievements.pdf differ
diff --git a/code/web/app/app_achievements/_doc/testdata.sql b/code/web/app/app_achievements/_doc/testdata.sql
deleted file mode 100644
index 8f230fd55..000000000
--- a/code/web/app/app_achievements/_doc/testdata.sql
+++ /dev/null
@@ -1,211 +0,0 @@
--- phpMyAdmin SQL Dump
--- version 3.3.3
--- http://www.phpmyadmin.net
---
--- Host: localhost
--- Erstellungszeit: 28. Mai 2012 um 21:07
--- Server Version: 5.1.46
--- PHP-Version: 5.3.2
-
-SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
-
-
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
-/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
-/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
-/*!40101 SET NAMES utf8 */;
-
---
--- Datenbank: `app_achievements`
---
-
---
--- Daten für Tabelle `ach_achievement`
---
-
-INSERT INTO `ach_achievement` (`aa_id`, `aa_category`, `aa_parent`, `aa_tie_race`, `aa_tie_cult`, `aa_tie_civ`, `aa_image`) VALUES
-(1, 1, NULL, NULL, NULL, NULL, ''),
-(2, 1, NULL, NULL, NULL, NULL, ''),
-(3, 1, NULL, NULL, NULL, NULL, ''),
-(4, 1, NULL, NULL, NULL, NULL, '');
-
---
--- Daten für Tabelle `ach_achievement_lang`
---
-
-INSERT INTO `ach_achievement_lang` (`aal_achievement`, `aal_lang`, `aal_name`) VALUES
-(1, 'en', 'Kill the Bait'),
-(2, 'en', 'Grill the Bill'),
-(3, 'en', 'Killing Spree'),
-(4, 'en', 'The Burning Desert');
-
---
--- Daten für Tabelle `ach_atom`
---
-
-INSERT INTO `ach_atom` (`atom_id`, `atom_objective`, `atom_mandatory`, `atom_ruleset`, `atom_primary`) VALUES
-(1, 13, 0, '', 0);
-
---
--- Daten für Tabelle `ach_category`
---
-
-INSERT INTO `ach_category` (`ac_id`, `ac_parent`, `ac_order`, `ac_image`) VALUES
-(1, NULL, 20, ''),
-(2, NULL, 40, ''),
-(3, 1, 2000, ''),
-(4, 1, 2000, ''),
-(5, 1, 2000, ''),
-(6, NULL, 70, ''),
-(7, NULL, 30, ''),
-(8, NULL, 50, ''),
-(9, NULL, 10, ''),
-(10, 1, 2000, ''),
-(11, 1, 2010, ''),
-(12, 8, 5000, ''),
-(13, 8, 5000, ''),
-(14, 8, 5000, ''),
-(15, 8, 5000, ''),
-(16, 6, 7010, ''),
-(17, 6, 7020, ''),
-(18, 6, 7200, ''),
-(19, 7, 3010, ''),
-(20, 7, 3010, ''),
-(21, 7, 3020, ''),
-(22, 7, 3020, ''),
-(23, 7, 3020, ''),
-(24, 7, 3030, ''),
-(25, 7, 3040, ''),
-(26, 7, 3020, ''),
-(27, 6, 7100, ''),
-(28, NULL, 60, ''),
-(29, 28, 6010, ''),
-(30, 28, 6020, ''),
-(31, NULL, 80, '');
-
---
--- Daten für Tabelle `ach_category_lang`
---
-
-INSERT INTO `ach_category_lang` (`acl_category`, `acl_lang`, `acl_name`) VALUES
-(1, 'en', 'Exploration'),
-(2, 'en', 'Occupations'),
-(3, 'en', 'Aeden Aqueous'),
-(4, 'en', 'Burning Desert'),
-(5, 'en', 'Witherings'),
-(6, 'en', 'The Saga of Ryzom'),
-(7, 'en', 'Fame'),
-(8, 'en', 'Skills'),
-(9, 'en', 'General'),
-(10, 'en', 'Verdant Heights'),
-(11, 'en', 'Prime Roots'),
-(12, 'en', 'Craft'),
-(13, 'en', 'Fight'),
-(14, 'en', 'Harvest'),
-(15, 'en', 'Magic'),
-(16, 'en', 'Episode I'),
-(17, 'en', 'Episode II'),
-(18, 'en', 'Legacy'),
-(19, 'en', 'Civilizations'),
-(20, 'en', 'Higher Powers'),
-(21, 'en', 'Aeden Aqueous'),
-(22, 'en', 'Burning Desert'),
-(23, 'en', 'Verdant Heights'),
-(24, 'en', 'The Nexus'),
-(25, 'en', 'Prime Roots'),
-(26, 'en', 'Witherings'),
-(27, 'en', 'Encyclopedia'),
-(28, 'en', 'PvP'),
-(29, 'en', 'Civilizations'),
-(30, 'en', 'Higher Powers'),
-(31, 'en', 'Ryzom Ring');
-
---
--- Daten für Tabelle `ach_objective`
---
-
-INSERT INTO `ach_objective` (`ao_id`, `ao_perk`, `ao_condition`, `ao_value`, `ao_display`) VALUES
-(1, 1, 'all', NULL, 'simple'),
-(2, 1, 'all', NULL, 'simple'),
-(3, 1, 'all', NULL, 'simple'),
-(4, 1, 'all', NULL, 'simple'),
-(5, 1, 'all', NULL, 'simple'),
-(6, 2, 'all', NULL, 'hidden'),
-(7, 3, 'all', 30, 'value'),
-(8, 4, 'all', NULL, 'meta'),
-(9, 4, 'all', NULL, 'meta'),
-(10, 4, 'all', NULL, 'meta'),
-(11, 4, 'all', NULL, 'meta'),
-(12, 4, 'all', NULL, 'meta'),
-(13, 3, 'all', 30, 'value');
-
---
--- Daten für Tabelle `ach_objective_lang`
---
-
-INSERT INTO `ach_objective_lang` (`aol_objective`, `aol_lang`, `aol_name`) VALUES
-(1, 'en', 'Kill A'),
-(2, 'en', 'Kill B'),
-(3, 'en', 'Kill C'),
-(4, 'en', 'Kill D'),
-(5, 'en', 'Kill E'),
-(7, 'en', 'Kill 30 random Yubos'),
-(8, 'en', 'Meta A'),
-(9, 'en', 'Meta B'),
-(10, 'en', 'Meta C'),
-(11, 'en', 'Meta D'),
-(12, 'en', 'Meta E'),
-(13, 'en', 'Kill 30 random Gingos');
-
---
--- Daten für Tabelle `ach_perk`
---
-
-INSERT INTO `ach_perk` (`ap_id`, `ap_achievement`, `ap_parent`, `ap_value`) VALUES
-(1, 1, NULL, 50),
-(2, 2, NULL, 10),
-(3, 3, NULL, 10),
-(4, 4, NULL, 20),
-(5, 2, NULL, 10),
-(6, 2, NULL, 10);
-
---
--- Daten für Tabelle `ach_perk_lang`
---
-
-INSERT INTO `ach_perk_lang` (`apl_perk`, `apl_lang`, `apl_name`) VALUES
-(1, 'en', 'Murder every boss listed below'),
-(2, 'en', 'Grill "Bill the Vile"'),
-(3, 'en', 'Kill 30 of each mob type listed below'),
-(4, 'en', 'Explore all regions of the Burning Desert'),
-(5, 'en', 'Grill "Peter the Pan"'),
-(6, 'en', 'Grill "Ivan the Slayer"');
-
---
--- Daten für Tabelle `ach_player_atom`
---
-
-INSERT INTO `ach_player_atom` (`apa_atom`, `apa_player`, `apa_date`, `apa_expire`) VALUES
-(1, 1, 0, '');
-
---
--- Daten für Tabelle `ach_player_objective`
---
-
-INSERT INTO `ach_player_objective` (`apo_objective`, `apo_player`, `apo_date`) VALUES
-(4, 1, 500),
-(7, 1, 500),
-(11, 1, 500);
-
---
--- Daten für Tabelle `ach_player_perk`
---
-
-INSERT INTO `ach_player_perk` (`app_perk`, `app_player`, `app_date`) VALUES
-(2, 1, 600),
-(5, 1, 100);
-
---
--- Daten für Tabelle `ach_player_valuecache`
---
-
diff --git a/code/web/app/app_achievements/class/AVLTree_class.php b/code/web/app/app_achievements/class/AVLTree_class.php
index 4c751d041..3af314081 100644
--- a/code/web/app/app_achievements/class/AVLTree_class.php
+++ b/code/web/app/app_achievements/class/AVLTree_class.php
@@ -20,7 +20,7 @@
$this->AVLpreorder($this->root);
}
- private function AVLpreorder($p) {
+ private function AVLpreorder($p) { // recursive; output preorder representation
if($p != null) {
echo $p->getID().", ";
$this->AVLpreorder($p->getLeft());
@@ -32,7 +32,7 @@
$this->AVLinorder($this->root);
}
- private function AVLinorder($p) {
+ private function AVLinorder($p) { // recursive; output postorder representation
if($p != null) {
$this->AVLinorder($p->getLeft());
echo $p->getID().", ";
@@ -40,7 +40,7 @@
}
}
- function insert($node) {
+ function insert($node) { // insert a new node
if($this->root == null) {
$this->root = new AVLTreeNode($node);
}
@@ -49,7 +49,7 @@
}
}
- function remove($id) {
+ function remove($id) { // remove a node
$n = $this->AVLfind($id,$this->root);
if($n != null) {
@@ -59,8 +59,7 @@
return null;
}
- function find($id) {
- #echo "
search!";
+ function find($id) { // find a node
$res = $this->AVLfind($id,$this->root);
if($res != null) {
return $res->getNode();
@@ -68,10 +67,8 @@
return null;
}
- private function AVLfind($id,$n) {
- #echo "
".$id;
+ private function AVLfind($id,$n) { // recursive; search for a node
if($n != null) {
- #echo "
searching for ".$id." compare to ".$n->getID();
if($n->getID() != $id) {
if($n->getID() > $id) {
$n = $this->AVLfind($id,$n->getLeft());
@@ -85,7 +82,7 @@
return $n;
}
- private function AVLremove($r,$n) {
+ private function AVLremove($r,$n) { // remove a node from the actual tree
if($n->getLeft() == null || $n->getRight() == null) {
$s = $n;
}
@@ -121,7 +118,7 @@
return $r;
}
- private function AVLinsert($r,$n) {
+ private function AVLinsert($r,$n) { // insert a node into the actual tree
if($r == null) {
$r = $n;
}
@@ -129,12 +126,12 @@
if($n->getID() < $r->getID()) {
$r->setLeft($this->AVLinsert($r->getLeft(),$n));
- $r = $this->balance($r);
+ $r = $this->balance($r); // rebalance
}
elseif($n->getID() > $r->getID()) {
$r->setRight($this->AVLinsert($r->getRight(),$n));
- $r = $this->balance($r);
+ $r = $this->balance($r); // rebalance
}
$r->setHeight(max($r->getHeightLeft(),$r->getHeightRight())+1);
@@ -143,8 +140,7 @@
return $r;
}
- private function balance($r) {
- #return $r;
+ private function balance($r) { // do a rebalancation of the tree
if($r->bal() == -2) {
$lc = $r->getLeft();
if($lc->getHeightLeft() >= $lc->getHeightRight()) {
@@ -168,8 +164,7 @@
return $r;
}
- private function Successor($r) {
- #echo "succ: ".$r->getID();
+ private function Successor($r) { // find the successor for a node
if($r->getRight() != null) {
return $this->Minimum($r->getRight());
}
@@ -184,7 +179,7 @@
}
}
- private function Minimum($r) {
+ private function Minimum($r) { // find the minimum of a tree
if($r == null) {
return null;
}
@@ -201,6 +196,8 @@
return $p;
}
+ //rotations
+
private function RotateToRight($r) {
if($this->debug) {
echo "rotaRight
";
@@ -238,8 +235,14 @@
$r->setRight($this->RotateToRight($r->getRight()));
return $this->RotateToLeft($r);
}
+
+ //end rotations
}
+ /*
+ * AVL tree nodes
+ */
+
class AVLTreeNode {
private $height;
private $left;
@@ -249,10 +252,10 @@
function AVLTreeNode($node) {
$this->height = 0;
- $this->left = null;
- $this->right = null;
- $this->node = $node;
- $this->parent = null;
+ $this->left = null; // left child
+ $this->right = null; // right child
+ $this->node = $node; // actual data stored
+ $this->parent = null; // parent node
}
function getParent() {
@@ -289,7 +292,7 @@
return $this->right->getHeight();
}
- function bal() {
+ function bal() { // calculate value to eval balancing
$r = -1;
$l = -1;
diff --git a/code/web/app/app_achievements/class/AchAchievement_class.php b/code/web/app/app_achievements/class/AchAchievement_class.php
index f4f69e9e2..b1e3e1511 100644
--- a/code/web/app/app_achievements/class/AchAchievement_class.php
+++ b/code/web/app/app_achievements/class/AchAchievement_class.php
@@ -1,4 +1,9 @@
setParent($parent);
+ $this->setParent($parent); // real parent node
$this->setID($data['aa_id']);
- $this->parent_id = $data['aa_parent'];
+ $this->parent_id = $data['aa_parent']; // id of parent
$this->category = $data['aa_category'];
$this->tie_race = $data['aa_tie_race'];
$this->tie_civ = $data['aa_tie_civ'];
@@ -72,7 +77,7 @@
}
}
- function parentDone() {
+ function parentDone() { // check if the parent is complete
if($this->parent_id == null) {
return true;
}
@@ -83,19 +88,11 @@
}
}
+ #@override Parentum::makeChild()
protected function makeChild($a) {
return new AchTask($a,$this);
}
- function unlockedByParent() {
- if($this->parent_id != null) {
- $tmp = $this->parent->getChildByID($this->parent_id);
- return ($tmp->hasOpen() == false);
- }
-
- return true;
- }
-
function getParentID() {
return $this->parent_id;
}
@@ -120,7 +117,7 @@
return $this->name;
}
- function getValueDone() {
+ function getValueDone() { // calculate the yubopoints that are already done
$val = 0;
$iter = $this->getDone();
while($iter->hasNext()) {
@@ -130,7 +127,7 @@
return $val;
}
- function getValueOpen() {
+ function getValueOpen() { // get the yubopoints of the next open task
$iter = $this->getOpen();
if($iter->hasNext()) {
$curr = $iter->getNext();
@@ -139,7 +136,7 @@
return 0;
}
- function fillTemplate($insert = array()) {
+ function fillTemplate($insert = array()) { // fill the naming template with given value
if($this->template == null) {
return implode(";",$insert);
}
@@ -170,7 +167,7 @@
return ($this->sticky == 1);
}
- function isHeroic() {
+ function isHeroic() { // check parent category if it is heroic
return $this->parent->isHeroic();
}
diff --git a/code/web/app/app_achievements/class/AchCategory_class.php b/code/web/app/app_achievements/class/AchCategory_class.php
index a43aad899..3c4e0a457 100644
--- a/code/web/app/app_achievements/class/AchCategory_class.php
+++ b/code/web/app/app_achievements/class/AchCategory_class.php
@@ -1,4 +1,8 @@
addChild($this->makeChild($res[$i]));
}
- #echo var_export($this->nodes->findNode(1),true);
}
function getOpen() { // just returns the previously set ID of the currently open MenuNode
diff --git a/code/web/app/app_achievements/class/DLL_class.php b/code/web/app/app_achievements/class/DLL_class.php
index 2d989208e..4d0eb3a1f 100644
--- a/code/web/app/app_achievements/class/DLL_class.php
+++ b/code/web/app/app_achievements/class/DLL_class.php
@@ -1,4 +1,9 @@
last;
}
- function addNode($data,$before = null) {
+ function addNode($data,$before = null) { // add a node
if($this->findNode($data->getID()) != null) {
return false;
}
@@ -71,13 +76,13 @@
$this->first = $n;
}
- $this->avl->insert($n);
+ $this->avl->insert($n); // pass on to avl tree
$this->size++;
return null;
}
- function removeNode($id) {
+ function removeNode($id) { // remove a node
$this->avl->inorder();
$n = $this->findNode($id);
@@ -109,7 +114,7 @@
}
}
- $this->avl->remove($id);
+ $this->avl->remove($id); // pass on to avl tree
$this->size--;
}
@@ -120,6 +125,10 @@
}
}
+ /*
+ * List nodes
+ */
+
class DLLnode {
private $parent;
private $child;
@@ -128,7 +137,7 @@
function DLLNode($d) {
$this->parent = null;
$this->child = null;
- $this->data = $d;
+ $this->data = $d; // actual data
}
final function getParent() {
diff --git a/code/web/app/app_achievements/class/Parentum_abstract.php b/code/web/app/app_achievements/class/Parentum_abstract.php
index db1c53c21..5bd0c45c4 100644
--- a/code/web/app/app_achievements/class/Parentum_abstract.php
+++ b/code/web/app/app_achievements/class/Parentum_abstract.php
@@ -30,11 +30,11 @@
$this->nodes->removeNode($id);
}
- function getChildByID($id) {
+ function getChildByID($id) { // returns a DLL node
return $this->nodes->findNode($id);
}
- function getChildDataByID($id) {
+ function getChildDataByID($id) { // returns the actual content of the found DLL node
$tmp = $this->getChildByID($id);
if($tmp != null) {
return $tmp->data;
diff --git a/code/web/app/app_achievements/include/ach_render_web.php b/code/web/app/app_achievements/include/ach_render_web.php
index a82005496..2ab0a7240 100644
--- a/code/web/app/app_achievements/include/ach_render_web.php
+++ b/code/web/app/app_achievements/include/ach_render_web.php
@@ -223,9 +223,7 @@
$iter = $cat->getDone();
while($iter->hasNext()) {
$curr = $iter->getNext();
- #$sz = sizeof($tmp);
- #for($i=0;$i<$sz;$i++) {
- #echo "A";
+
if($curr->inDev() || !$curr->parentDone()) {
continue;
}
@@ -239,9 +237,7 @@
$iter = $cat->getOpen();
while($iter->hasNext()) {
$curr = $iter->getNext();
- #$sz = sizeof($tmp);
- #for($i=0;$i<$sz;$i++) {
- #echo "B";
+
if($curr->inDev() || !$curr->parentDone()) {
continue;
}
@@ -367,7 +363,7 @@
$skip = false;
while($obj->hasNext()) {
- #foreach($obj as $elem) {
+
$elem = $obj->getNext();
if(($i%2) == 0) {
$html .= "