session_name ('handstandseverywhere.com'); session_start(); // INITIALIZE USER SESSION IN THE VERY FIRST LINE // the above lines create a session and name it on behalf of the website // AUTHOR NOTES // created in 2006 by eugene ahn. august // the entirely of this website is contained all on one page -- just for fun! php is used to generate what shows up on the page. the intention of this structure is to explore simplicity. with functions, libraries, ajax, etc. the prevailing convention is to support the architecture of a dynamic website with many files to categorize the objects, but still it seems unnecessary for a website to have lots and lots of pages and still deliver a rich experience. // VERSION NOTES - what's new in this version of code // 061124 - at gina's: added the login page and functions // 061125 - on swa: started updating quieries to pull record data and row data // 061128 - at lucy's: finished pdatiing all the queries to pull record data and row data; added global website variable id; added some themes; updated some content // 070202 - yeahstudio: the guys from turkey inspire me to finally put together the code that displays comments for photos. now just need a way for people to submit comments // 070211 - added bystander recent three to the people profile page. need to put bystander on the photo page and the people detail line. and make a bystander mini icon. some bystanders include: dad, crystal, amy, grace, jade, manas, vince, bryan, galust, carey, kristen, cameron, antonio, lori, jay, eleen, jose, megan, edward, . mom. gina, ruby, debbie, karine // 070214 - added place stuff to place page, on phoot page did formatting to comments, move themes to themes // 070215 - beefed up the search, covering name, place, and comment // 070216 - added geo locator string with linkbacks on the image detail page; added bystander to the photo detail page. also added multiple credits. need to consolidate the functions later, parameters are one or many, link or not, and label or chunk. this last one to build the entire ; updated bystander records // 070311 - tested limit 3 to limit 6. seems to make sense, makes pages look richer when there is more. but not yet. not enough previews even have three to preview. so maybe in future. added blog comment summary to main profile page. added see all link to the main profile page so that it's easy to see all photos. and fixed the link in the header when displaying names. bunch of cleanups today. makes things a lot better. // 070421 - inspired by rachel's barrage of europe photos, i changed up the homepage a little bit. added a spotlight section which grabs some photos randomly from a new theme called spotlight. // 070620 - added the on this day link; finally hid the empty credits on the view image page // 070626 - added links from the place summary page to google, wunderground, and wikipedia, using the geotag information // 070920 - bless that rachel. she submitted so many handstand photos this week that i've switched around the content blocks on the home page. now, recent handstands show up above spotlight handstands. // 070926 - lots of incoming handstands. so changing the limits on the homepage from 6 recent / 6 highlight to 9 recent / 3 highlight // 070927 - updated the people display, adding top handstanders and top photographers, and sorting the list as a grid. it looks better. also created a bunch of icons. looks good too. there is a problem at the end of the page. not a show stopper. leave it for troubleshooting later. // 071010 - changed the homepage setnumber back to six. hopefully this is better for the db. // 071022 - change the database connection // 080504 - added comment capture function on single image detail pages // 081614 - updated the roundup limits from 3 to 6 on all but the front page highlight roundup // 080614 - turned the spotlight roundup into an object function and am now recycling that object as a content enticement on support pages: places, about, contact, etc., as well as on the homepage // 080614 - cleaned up the section bar: changed the color from that steel blue to beige, it works much better. went through all the pages and made the font style consistent. and applied the section bar to titles that should have it, like the people segment headers, and the photo segment headers for comments and themes. // 080614 - set long overdue link colors for text class (adho_mukha_vrksasana) and the credit class (thumbnail_credit) // 080614 - organized the people section. the main page has top eight of handstanders, photographers, and members. then there is a link to a page that lists everyone, randomly. // 080614 - fixed the region display on the first continent feature. it now shows continent name, not country name. basically i cloned the region title generator, and made it do something specific for this feature. // 080614 - also, started playing around with the menu, which is due to change soon // 080615 - added the new menu lineup, made it work and look good // 080615 - built the guru page, content and q&a surface function for the guru page, tried the bio on the sidebar and then eventually settled with under the header // 080615 - reset the bar parameters cellspacing from 5 to 0 // 091001 - update categories method, and change input forms for comments and guru to write to database, instead of mailing // 091016 - start conversion. looking up from media and fish and category stead of content. many things have been converted: display names, image calls. It's partially done, and funcitoning, so put to live. need to complete it before i can standardize the input. // 091020 - updated input method from master.php to changethewebsite.com, fixed pacifica category to connect media_attribute records to category records, fixed category query, added bystander count, updated image path, moved images from 213 to media, changed featured themes from static to full list // 091103 - updated theme browser and theme lists by merging them. theme lists now appear as bolded items within the full theme browser. to promote exploration. also changed the category roundup pages to call from id instead of name in the querystring. // 110916 - updated the on this day function, since the new york times resource appears to be no longer available. pushing link to on-this-day.com now. // 120630 - updated the guru section, added content, expanded guru list, moved content to wiki // 180503 - on homepage hid TR code for the world map, since it does not work in modern browsers, because it uses flash. // 180503 - on world map page, hid text talking about the world map, since it is no longer presented. // 180503 - can't believe this website is // CONNECT TO THE DATABASE require_once ('../meta/mysql/mysqli_connect_wigglefish.php'); // REGISTER WEBSITE GLOBAL VARIABLES define("WEBSITE_ID" ,"10"); // this website variable is used in almost every database query to ensure records retrieves are intended for this website. define("WEBSITE" ,"$_SERVER[SERVER_NAME]"); // this gets the www.blah.com so we don't have to keep typing it in. // REGISTER INCOMING VARIABLES // here are incomings via get $this_view = $_GET['view']; $this_viewtype = $_GET['image']; $this_image_id = $_GET['image_id']; $this_person_id = $_GET['person']; // here are incomings via post $this_message_action = $_POST['message_action']; $this_message_from = $_POST['message_from']; $this_message_from_email = $_POST['message_from_email']; $this_message_to = $_POST['message_to']; $this_message_subject = $_POST['message_subject']; $this_message = $_POST['message']; // here are the incomings via get or post::: check for both in special circumstances where inbounds are utilizing varying methods depending on function if ($_GET['view']=="sign_in"){$this_view = $_GET['view'];} if ($_POST['view']=="sign_in"){$this_view = $_POST['view'];} if ($_POST['action'] == "submit_comment") { $this_view = $_POST['view']; $this_viewtype = $_POST['viewtype']; $this_image_id = $_POST['image_id']; // create the record $this_target = "feedback"; $this_id = NULL; $this_website_id = WEBSITE_ID; $this_status = "0"; $this_type = "Comment"; $this_name = stripslashes($_POST['name']); $this_user = stripslashes($_POST['name']); $this_relate_value = $_POST['image_id']; $this_content = stripslashes($_POST['comment']); add_primary_record($this_target,$this_id,$this_website_id,$this_status,$this_type,$this_name,$this_user); // next, get the record id and use it to do secondary writes $query = "select id from $this_target order by id DESC"; $this_record = mysqli_query($mysqli,$query); if ($getID = mysqli_fetch_assoc($this_record)) { $lastID = $getID['id']; $this_id = $lastID; } // create a secondary record with the user value for the declared website $this_target = "feedback_attribute"; $this_type = "Subject"; $this_name = null; $this_description = null; $this_content = null; $this_value = null; $this_relate_key = "media"; $this_relate_value = "$this_relate_value"; add_secondary_record($this_target,$this_id,$this_website_id,$this_status,$this_type,$this_name,$this_description,$this_content,$this_value,$this_relate_key,$this_relate_value,$this_user); $this_type = "Author"; $this_name = stripslashes($_POST['name']); $this_description = null; $this_content = stripslashes($_POST['name']); $this_value = null; $this_relate_key = null; $this_relate_value = null; add_secondary_record($this_target,$this_id,$this_website_id,$this_status,$this_type,$this_name,$this_description,$this_content,$this_value,$this_relate_key,$this_relate_value,$this_user); $this_target = "feedback_content"; $this_type = "Main Content"; $this_name = null; $this_description = null; $this_content = stripslashes($_POST['comment']); $this_value = null; $this_relate_key = null; $this_relate_value = null; add_secondary_record($this_target,$this_id,$this_website_id,$this_status,$this_type,$this_name,$this_description,$this_content,$this_value,$this_relate_key,$this_relate_value,$this_user); } if ($_POST['action'] == "ask_guru") { $this_name = $_POST['name']; $this_question = $_POST['question']; $feedback_name = stripslashes($_POST['name']); $feedback_question = stripslashes($_POST['question']); $feedback_image = stripslashes($_POST['image_id']); // create the record $this_target = "feedback"; $this_id = NULL; $this_website_id = WEBSITE_ID; $this_status = "0"; $this_type = "Question"; $this_name = stripslashes($_POST['name']); $this_user = stripslashes($_POST['name']); $this_relate_value = $_POST['image_id']; $this_content = stripslashes($_POST['question']); add_primary_record($this_target,$this_id,$this_website_id,$this_status,$this_type,$this_name,$this_user); // next, get the record id and use it to do secondary writes $query = "select id from $this_target order by id DESC"; $this_record = mysqli_query($mysqli,$query); if ($getID = mysqli_fetch_assoc($this_record)) { $lastID = $getID['id']; $this_id = $lastID; } // create a secondary record with the user value for the declared website $this_target = "feedback_attribute"; $this_type = "Subject"; $this_name = "Ask Guru"; $this_description = null; $this_content = null; $this_value = null; $this_relate_key = null; $this_relate_value = null; add_secondary_record($this_target,$this_id,$this_website_id,$this_status,$this_type,$this_name,$this_description,$this_content,$this_value,$this_relate_key,$this_relate_value,$this_user); $this_type = "Author"; $this_name = stripslashes($_POST['name']); $this_description = null; $this_content = stripslashes($_POST['name']); $this_value = null; $this_relate_key = null; $this_relate_value = null; add_secondary_record($this_target,$this_id,$this_website_id,$this_status,$this_type,$this_name,$this_description,$this_content,$this_value,$this_relate_key,$this_relate_value,$this_user); $this_target = "feedback_content"; $this_type = "Main Content"; $this_name = null; $this_description = null; $this_content = stripslashes($_POST['question']); $this_value = null; $this_relate_key = null; $this_relate_value = null; add_secondary_record($this_target,$this_id,$this_website_id,$this_status,$this_type,$this_name,$this_description,$this_content,$this_value,$this_relate_key,$this_relate_value,$this_user); } // CHECK FOR E-MAIL ACTION if ($this_message_action == 'process') { // select the message recipient e-mail address if ($this_message_to == 'handstandseverywhere.com'){$mail_to = 'handstandseverywhere@gmail.com';} elseif ($this_message_to == 'Forrest'){$mail_to = 'eugeneahn@gmail.com';} elseif ($this_message_to == 'Kam'){$mail_to = 'eugeneahn@gmail.com';} else {$mail_to = 'handstandseverywhere@gmail.com';} // prepare the message content $clean_message_sender = stripslashes($this_message_from); $clean_message_sender_email = stripslashes($message_from_email); $clean_message_body = stripslashes($this_message); $text = " Dear $this_message_to - Someone calling themself $clean_message_sender ($clean_message_sender_email) submitted this message using the handstandseverywhere.com contact page: #################### #################### $clean_message_body #################### #################### This e-mail was generated from the handstandseverywhere.com mail server. Do not reply to this message, as no one will receive it! "; // send the message via e-mail $mail_subject = 'From ' . stripslashes($message_from) . ': ' . stripslashes($message_subject); $mail_body = $text; $mail_headers = 'From: handstandseverywhere@gmail.com'; mail($mail_to,$mail_subject,$mail_body,$mail_headers); // generate a message // direct to a landing page that will display the message } // if there is no pagetype declared then forward to the homepage: // REGISTER THE WEBSITE'S GLOBAL DEFINITIONS $website_id = "10"; $color_world_map = "#0066CC"; // this comes from ammap setting // DEFINE MENU STYLES - THIS IS IN A LOGICAL SEQUENCE // 1. define the styles and corresponding values for inactive state $places_background_inactive = "#006699"; $places_text_inactive = "#FFFFFF"; $photographers_background_inactive = "#006699"; $photographers_text_inactive = "#FFFFFF"; $handstanders_background_inactive = "#006699"; $handstanders_text_inactive = "#FFFFFF"; $people_background_inactive = "#006699"; $people_text_inactive = "#FFFFFF"; $photographs_background_inactive = "#006699"; $photographs_text_inactive = "#FFFFFF"; $world_map_background_inactive = "#006699"; $world_map_text_inactive = "#FFFFFF"; $featured_photos_background_inactive = "#006699"; $featured_photos_text_inactive = "#FFFFFF"; $submit_a_photo_background_inactive = "#006699"; $submit_a_photo_text_inactive = "#FFFFFF"; $how_to_how_to_do_a_handstand_background_inactive = "#006699"; $how_to_how_to_do_a_handstand_text_inactive = "#FFFFFF"; $about_background_inactive = "#006699"; $about_text_inactive = "#FFFFFF"; $contact_background_inactive = "#006699"; $contact_text_inactive = "#FFFFFF"; $you_background_inactive = "#006699"; $you_text_inactive = "#FFFFFF"; $guru_background_inactive = "#006699"; $guru_text_inactive = "#FFFFFF"; $wikihandstandpediablog_background_inactive = "#006699"; $wikihandstandpediablog_text_inactive = "#FFFFFF"; $places_tie_inactive = ""; $photographers_tie_inactive = ""; $handstanders_tie_inactive = ""; $people_tie_inactive = ""; $photographs_tie_inactive = ""; $world_map_tie_inactive = ""; $featured_photos_tie_inactive = ""; $submit_a_photo_tie_inactive = ""; $how_to_how_to_do_a_handstand_tie_inactive = ""; $about_tie_inactive = ""; $contact_tie_inactive = ""; $you_tie_inactive = ""; $guru_tie_inactive = ""; $wikihandstandpediablog_tie_inactive = ""; // 2. define the styles and corresponding values for active states $places_background_active = "#F9F9EB"; $places_text_active = "#000000"; $photographers_background_active = "#F9F9EB"; $photographers_text_active = "#000000"; $handstanders_background_active = "#F9F9EB"; $handstanders_text_active = "#000000"; $people_background_active = "#F9F9EB"; $people_text_active = "#000000"; $photographs_background_active = "#F9F9EB"; $photographs_text_active = "#000000"; $world_map_background_active = "#F9F9EB"; $world_map_text_active = "#000000"; $featured_photos_background_active = "#F9F9EB"; $featured_photos_text_active = "#000000"; $submit_a_photo_background_active = "#F9F9EB"; $submit_a_photo_text_active = "#000000"; $how_to_how_to_do_a_handstand_background_active = "#F9F9EB"; $how_to_how_to_do_a_handstand_text_active = "#000000"; $about_background_active = "#F9F9EB"; $about_text_active = "#000000"; $contact_background_active = "#F9F9EB"; $contact_text_active = "#000000"; $you_background_active = "#F9F9EB"; $you_text_active = "#000000"; $guru_background_active = "#F9F9EB"; $guru_text_active = "#000000"; $wikihandstandpediablog_background_active = "#F9F9EB"; $wikihandstandpediablog_text_active = "#000000"; $places_tie_active = "#F9F9EB"; $photographers_tie_active = "#F9F9EB"; $handstanders_tie_active = "#F9F9EB"; $people_tie_active = "#F9F9EB"; $photographs_tie_active = "#F9F9EB"; $world_map_tie_active = "#F9F9EB"; $featured_photos_tie_active = "#F9F9EB"; $submit_a_photo_tie_active = "#F9F9EB"; $how_to_how_to_do_a_handstand_tie_active = "#F9F9EB"; $about_tie_active = "#F9F9EB"; $contact_tie_active = "#F9F9EB"; $you_tie_active = "#F9F9EB"; $guru_tie_active = "#F9F9EB"; $wikihandstandpediablog_tie_active = "#F9F9EB"; // make the base assignments: everything is inactive $background_color_places = $places_background_inactive; $background_color_photographers = $photographers_background_inactive; $background_color_handstanders = $handstanders_background_inactive; $background_color_people = $people_background_inactive; $background_color_photographs = $photographs_background_inactive; $background_color_world_map = $world_map_background_inactive; $background_color_featured_photos = $featured_photos_background_inactive; $background_color_submit_a_photo = $submit_a_photo_background_inactive; $background_color_how_to_do_a_handstand = $how_to_how_to_do_a_handstand_background_inactive; $background_color_about = $about_background_inactive; $background_color_contact = $contact_background_inactive; $background_color_you = $you_background_inactive; $background_color_guru = $guru_background_inactive; $background_color_wikihandstandpediablog = $wikihandstandpediablog_background_inactive; $menu_color_places = $places_text_inactive; $menu_color_photographers = $photographers_text_inactive; $menu_color_handstanders = $handstanders_text_inactive; $menu_color_people = $people_text_inactive; $menu_color_photographs = $photographs_text_inactive; $menu_color_world_map = $world_map_text_inactive; $menu_color_featured_photos = $featured_photos_text_inactive; $menu_color_submit_a_photo = $submit_a_photo_text_inactive; $menu_color_how_to_do_a_handstand = $how_to_how_to_do_a_handstand_text_inactive; $menu_color_about = $about_text_inactive; $menu_color_contact = $contact_text_inactive; $menu_color_you = $you_text_inactive; $menu_color_guru = $guru_text_inactive; $menu_color_wikihandstandpediablog = $wikihandstandpediablog_text_inactive; $tie_color_places = $places_tie_inactive; $tie_color_photographers = $photographers_tie_inactive; $tie_color_handstanders = $handstanders_tie_inactive; $tie_color_people = $people_tie_inactive; $tie_color_photographs = $photographs_tie_inactive; $tie_color_world_map = $world_map_tie_inactive; $tie_color_featured_photos = $featured_photos_tie_inactive; $tie_color_submit_a_photo = $submit_a_photo_tie_inactive; $tie_color_how_to_do_a_handstand = $how_to_how_to_do_a_handstand_tie_inactive; $tie_color_about = $about_tie_inactive; $tie_color_contact = $contact_tie_inactive; $tie_color_you = $you_tie_inactive; $tie_color_guru = $guru_tie_inactive; $tie_color_wikihandstandpediablog = $wikihandstandpediablog_tie_inactive; // check the view code. make adjustments based on this. if ($this_view == "places") { // the page view is countries $background_color_places = $places_background_active; $menu_color_places = $places_text_active; $tie_color_places = $places_tie_active; $content_background = $places_background_active; } if ($this_view == "photographers") { // the page view is photographers $background_color_photographers = $photographers_background_active; $menu_color_photographers = $photographers_text_active; $tie_color_photographers = $photographers_tie_active; $content_background = $photographers_background_active; } if ($this_view == "handstanders") { // the page view is handstanders $background_color_handstanders = $handstanders_background_active; $menu_color_handstanders = $handstanders_text_active; $tie_color_handstanders = $handstanders_tie_active; $content_background = $handstanders_background_active; } if ($this_view == "people") { // the page view is people $background_color_people = $people_background_active; $menu_color_people = $people_text_active; $tie_color_people = $people_tie_active; $content_background = $people_background_active; } if ($this_view == "photographs") { // the page view is photographs $background_color_photographs = $photographs_background_active; $menu_color_photographs = $photographs_text_active; $tie_color_photographs = $photographs_tie_active; $content_background = $photographs_background_active; } if ($this_view == "world_map") { // the page view is world_map $background_color_world_map = $world_map_background_active; $menu_color_world_map = $world_map_text_active; $tie_color_world_map = $world_map_tie_active; $content_background = $world_map_background_active; } if ($this_view == "featured_photos") { // the page view is featured_photos $background_color_featured_photos = $featured_photos_background_active; $menu_color_featured_photos = $featured_photos_text_active; $tie_color_featured_photos = $featured_photos_tie_active; $content_background = $featured_photos_background_active; } if ($this_view == "submit_a_photo") { // the page view is submit_a_photo $background_color_submit_a_photo = $submit_a_photo_background_active; $menu_color_submit_a_photo = $submit_a_photo_text_active; $tie_color_submit_a_photo = $submit_a_photo_tie_active; $content_background = $submit_a_photo_background_active; } if ($this_view == "do_a_handstand") { // the page view is do_a_handstand $background_color_how_to_do_a_handstand = $how_to_how_to_do_a_handstand_background_active; $menu_color_how_to_do_a_handstand = $how_to_how_to_do_a_handstand_text_active; $tie_color_how_to_do_a_handstand = $how_to_how_to_do_a_handstand_tie_active; $content_background = $how_to_how_to_do_a_handstand_background_active; } if ($this_view == "about") { // the page view is about $background_color_about = $about_background_active; $menu_color_about = $about_text_active; $tie_color_about = $about_tie_active; $content_background = $about_background_active; } if ($this_view == "contact") { // the page view is contact $background_color_contact = $contact_background_active; $menu_color_contact = $contact_text_active; $tie_color_contact = $contact_tie_active; $content_background = $contact_background_active; } if ($this_view == "you") { // the page view is yourstuff $background_color_you = $you_background_active; $menu_color_you = $you_text_active; $tie_color_you = $you_tie_active; $content_background = $you_background_active; } if ($this_view == "guru") { // the page view is guru $background_color_guru = $guru_background_active; $menu_color_guru = $guru_text_active; $tie_color_guru = $guru_tie_active; $content_background = $guru_background_active; } if ($this_view == "wikihandstandpediablog") { // the page view is wiki $background_color_wikihandstandpediablog = $wikihandstandpediablog_background_active; $menu_color_wikihandstandpediablog = $wikihandstandpediablog_text_active; $tie_color_wikihandstandpediablog = $wikihandstandpediablog_tie_active; $content_background = $wikihandstandpediablog_background_active; } if ($this_view == "instagram") { $background_color_photographs = $photographs_background_active; $menu_color_photographs = $photographs_text_active; $tie_color_photographs = $photographs_tie_active; $content_background = $photographs_background_active; } if (!isset($this_view)) { // there is no view code set. assume we are on the home page. i do a funny thing here. if this is the home page, i override the active states for the world map. cuz i'm having the menu blend with the map ocean color. $background_color_world_map = "#0066CC"; $menu_color_world_map = "#FFFFFF"; $tie_color_world_map = "#0066CC"; $background_color_photographs = $featured_photos_background_active; $menu_color_photographs = $featured_photos_text_active; $tie_color_photographs = $featured_photos_tie_active; } ?>