// global variables $server_root = $_SERVER["DOCUMENT_ROOT"]."/"; $template_path = $server_root."php_inc/"; $admin_template_path = $server_root."php_inc/admin_template.html"; $notifyEmail = "tod@almosteverythingweb.com"; $adminEmail = "tod@almosteverythingweb.com"; $this_uri = $_SERVER["REQUEST_URI"]; $full_uri = "http://www.wheelingcalscoast.com".$this_uri; $facility_list = "3,2,9,1,8,4"; // list facilities to be included, in order $facilities = explode(",",$facility_list); $login_period = 86400; // one-day login period $strip_chars = array(';',')','(','{','}','/','\\','|'); // connect to database include_once "connect.php"; //dbconnect(); // function to display pages in template function display_page($template){ global $template_path, $page_content, $page_title, $keywords,$description,$crumbs,$home_btn,$use_btn,$browse_btn,$resources_btn,$search_btn,$contact_btn,$right_column,$page_bottom,$admin_btn,$sites_btn,$notes_btn,$admins_btn,$loggedin,$this_uri,$stylesheet; switch($template){ case "full": $template_path .= "template_full.html"; break; case "home": $template_path .= "template_home.html"; break; case "admin": $template_path .= "template_admin.html"; break; default: $template_path .= "template_full.html"; break; } if($stylesheet=="print" || (isset($_COOKIE["print_format"]) && $_COOKIE["print_format"] == "print")) $style_link = "."; else $style_link = ".."; if($loggedin){ $log_link = "
~~ FORM HERE DO NOT DELETE ~~
",$contact_form,$new_file); // navigation links $new_file = str_replace("",$home_btn,$new_file); $new_file = str_replace("",$use_btn,$new_file); $new_file = str_replace("",$browse_btn,$new_file); $new_file = str_replace("",$resources_btn,$new_file); $new_file = str_replace("",$search_btn,$new_file); $new_file = str_replace("",$contact_btn,$new_file); $new_file = str_replace("",$admin_btn,$new_file); $new_file = str_replace("",$sites_btn,$new_file); $new_file = str_replace("",$notes_btn,$new_file); $new_file = str_replace("",$admins_btn,$new_file); $new_file = str_replace("",$log_link,$new_file); echo $new_file; } function prep_phone($theText){ $theText = trim($theText); $theText = stripslashes($theText); $theText = preg_replace("~(\d\d\d)(\d\d\d)(\d\d\d\d)~","(\\1) \\2-\\3",$theText); $theText = preg_replace("~(\d\d\d).(\d\d\d).(\d\d\d\d)~","(\\1) \\2-\\3",$theText); $theText = preg_replace("~(\d\d\d) . (\d\d\d) . (\d\d\d\d)~","(\\1) \\2-\\3",$theText); $theText = preg_replace("~(\d\d\d) (\d\d\d) (\d\d\d\d)~","(\\1) \\2-\\3",$theText); $theText = preg_replace("~(\d\d\d) (\d\d\d).(\d\d\d\d)~","(\\1) \\2-\\3",$theText); $theText = preg_replace("~(\d\d\d)(\d\d\d).(\d\d\d\d)~","(\\1) \\2-\\3",$theText); $theText = preg_replace("~(\d\d\d)(\d\d\d).(\d\d\d\d)~","(\\1) \\2-\\3",$theText); $theText = preg_replace("~(\d\d\d).(\d\d\d)(\d\d\d\d)~","(\\1) \\2-\\3",$theText); return $theText; } function ext_links($the_link){ if(!strpos($the_link,"_blank")){ $the_link = str_replace("Your Account'; }else{ $return_val = ''; } echo $return_val; } function login_link(){ global $member_name, $user_id,$loggedin; $return_val = ''; if($loggedin){ // if logged in $return_val = 'Your Account | Log Out'; }else{ $return_val = 'Member Login | Register'; } echo $return_val; } function create_key(){ $thiskey = time(); $extra = rand(0,9). rand(0,9) . rand (0,9). rand(0,9) . rand(0,9) . rand(0,9). rand(0,9) . rand(0,9); $thiskey = $extra.$thiskey; return $thiskey; } ?>