. # This file is useful for putting message box(es) on the screen. # # Just call message("message here") whenever you have something to report. # # Once a template is loaded, call display_messages(). Your template should have # a section with a ~text:html~ tag in it. # # If you want a divider (any text between message boxes when there are # multiple boxes) provide a sub-template section named "separator" # INSIDE "message" at the begining of it. # # If you'd like something around the group of all message boxes, you can put # the whole thing in a sub-template section called "messages" # Simple example: # # #

~text:html~

# # Full-featured example: # # #
# # #
# #

~text:html~

# #
# require_once('code/wfpl/template.php'); function message($msg) { if(!isset($GLOBALS['wfpl_messages'])) { if(function_exists('session_restore_messages')) { $GLOBALS['wfpl_messages'] = session_restore_messages(); } else $GLOBALS['wfpl_messages'] = array(); } $GLOBALS['wfpl_messages'][] = $msg; } function display_messages(&$tem = NULL) { if(!$GLOBALS['wfpl_messages']) return; foreach($GLOBALS['wfpl_messages'] as $msg) { $sub = array('text' => $msg); $GLOBALS['wfpl_tem_data']['message'][] = $sub; $GLOBALS['wfpl_tem_data']['messages'] = TRUE; } }