refactor config
common.inc.php prototype done
add template global var