I got it working after a loong night. Atleast partly. My template had the varibles used BEFORE the page_content
so nothing could not be seen of course.
But somehow the CODE and template's .php does not share the namespace of variables, even if changed the echo into the footer of the template.
Found out that its possbile to echo some text in to the $global[yourstuffname]
and it is seen by the template !
Other problem was ajax made session gets lost every page refresh, that is because the session need a name also in the ajaxphp. You can echo the name to see what it is and then code it
session_name(APP_NAME.'_session_id'); //put the session in the APP_NAME, self made files cannot see the
// defines of WB without includes... eg session_name('wb34343_session_id')
@session_start();