/** * ifcrush_frat() shortcode entry point * Fraternities can view their events, create events, register PNMs * * KBL todo - on failure to access due to login, maybe we should add a link to the * login page **/ function ifcrush_frat() { global $debug; if ($debug) { echo "[ifcrush_frat] "; } if (false == is_user_logged_in()) { echo "sorry you must logged in as a recruitment chair to use this page."; return; } $current_user = wp_get_current_user(); if (is_user_an_rc($current_user)) { $frat_letters = get_frat_letters($current_user); } else { echo "sorry you must be a recruitment chair to use this page"; return; } /* Now I know who I am. * Lets see if there are any forms to handle */ if (isset($_POST['action'])) { ifcrush_frat_handle_forms($_POST['action'], $frat_letters); } else { /* Create the options for a fraternity.*/ echo "Hello {$frat_letters}."; ifcrush_frat_show_options(); } }
/** * ifcrush_frat() shortcode entry point * Fraternities can view their events, create events, register PNMs * **/ function ifcrush_frat() { global $debug; //if ($debug) echo "[ifcrush_frat] "; if (!is_user_logged_in()) { echo "sorry you must logged in as a fraternity to access this page."; return; } $current_user = wp_get_current_user(); if (is_user_an_rc($current_user)) { $frat_letters = get_frat_letters($current_user); } else { echo "sorry you must be a recruitment chair to use this page"; return; } /* Now I know who I am. * Lets see if there are any forms to handle */ if (isset($_POST['action'])) { ifcrush_frat_handle_forms($_POST['action'], $frat_letters); } else { /* List events and actions for this fraternity */ echo "Hello {$frat_letters}. "; echo "Here are your events."; echo "<br>"; ifcrush_display_request_report_form(); ifcrush_display_events($frat_letters); } /** all done **/ }