Advisor Bio

[insert_php] include_once(ABSPATH.’inc/functions.php’); console(“ENTERED bio page”); console($_GET, “bio page, GET array”); console($_POST, “bio page, POST array”); //set_magic_quotes_runtime(0); if (isset($_GET[‘p1’])) $user_id = $_GET[‘p1’]; //handle email notification form if (isset($_POST[‘viz_submit’])) { $email = $_POST[‘viz_email’]; $user_id = $_POST[‘viz_user_id’]; $fields = array(“:email”, “:user_id”, “:is_notified”); $values = array($email, $user_id, ‘0’); $types = array(PDO::PARAM_STR, PDO::PARAM_INT, PDO::PARAM_STR); $rows = getRows(“SELECT * FROM notify WHERE email=? AND user_id=? AND is_notified=?”, $values); if (!$rows) { $result = sqlExec(“INSERT INTO notify SET email=:email, user_id=:user_id, is_notified=:is_notified”, $fields, $values, $types); console($result, “bio page, result of notification insert”); if ($result) { wp_redirect(get_home_url().”/advisors/?p1=”.$user_id.”&p2=true”); } else { console($result, “failure inserting email notification”); wp_redirect(get_home_url().”/advisors/?p1=”.$user_id.”&p2=failure”); } } else { //rows were found console(“bio page, advisor already has a notification from user”); wp_redirect(get_home_url().”/advisors/?p1=”.$user_id.”&p2=exists”); } exit; } if (isset($user_id)) { $user_details = getUserById($user_id); $username = ucfirst(strtolower($user_details[‘user’])); } [/insert_php]
[insert_php] echo show_advisor($user_details, ‘bio’); [/insert_php]
[insert_php] //console($user_details, “user_details”); echo ““.$user_details[‘card_desc’].”

“.$user_details[‘profile’].”

“; [/insert_php]
 
[insert_php] show_audio_controls($user_details[‘phone’], $user_details[‘secondary_phone’]); [/insert_php]
  [insert_php] if ($user_details[‘is_online’] !== “1”) { echo ”
Want to be notified when “.$username.” comes online?

 
“; } //now show a few advisors… show_advisors(7, $user_id); [/insert_php]