- if($GLOBALS['wfpl_template']) {
- if(isset($GLOBALS['wfpl_main_template'])) {
- $sections = tem_top_subs();
- if($sections) foreach($sections as $name => $val) {
- $GLOBALS['wfpl_main_template']->append($name, $val);
+ if($GLOBALS['wfpl_template'] || $GLOBALS['wfpl_main_template']) {
+ if($GLOBALS['wfpl_main_template']) {
+ # if there was a template for that page, and one for the whole
+ # site, copy all template sections that have been show()n to the
+ # site-wide template
+ if($GLOBALS['wfpl_template']) {
+ $GLOBALS['wfpl_main_template']->merge($GLOBALS['wfpl_template']);