Commit afd178cc authored by Skia's avatar Skia

Improve family graph generation

parent 581a98bf
......@@ -40,6 +40,9 @@ class genealogie
/* utilisateur (id) */
var $id_utl;
/* profondeur */
var $depth;
/* utilisateur (surnom) */
var $surnom;
......@@ -72,11 +75,12 @@ class genealogie
$this->out_conf .= "\tnode [shape=box,style=filled,color=firebrick1];\n";
}
function generate_filiation_utl ($id_utl, $db)
function generate_filiation_utl ($id_utl, $db, $depth)
{
/* affectation variables membres */
$this->id_utl = $id_utl;
$this->db = $db;
$this->depth = $depth;
/* tableau des fillots deja parses */
$this->explored = array ();
......@@ -104,7 +108,7 @@ class genealogie
$this->explored[] = $rs[1];
$nom = $rs[0];
$this->get_childs ($this->id_utl, $nom, 3);
$this->get_childs ($this->id_utl, $nom, $this->depth);
/* fin configuration */
$this->out_conf .= "}\n";
......
......@@ -53,9 +53,13 @@ if ( !$site->user->is_valid() )
}
$id = mysql_real_escape_string($_REQUEST['id']);
$depth = 3;
if(isset($_REQUEST['depth'])) {
$depth = intval(mysql_real_escape_string($_REQUEST['depth']));
}
$gene = new genealogie ();
$gene->generate_filiation_utl ($id, $site->db);
$gene->generate_filiation_utl ($id, $site->db, $depth);
$gene->generate ();
$gene->destroy ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment