diff --git a/plugins/putyourselfonthemap/index.php b/plugins/putyourselfonthemap/index.php new file mode 100644 index 0000000000000000000000000000000000000000..c30aac91a8d3c26146a4f9e3fcbb695569cda86c --- /dev/null +++ b/plugins/putyourselfonthemap/index.php @@ -0,0 +1,27 @@ +<?php + /** + * Elgg globe plugin + * + * @package ElggGlobe + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Eric Rasmussen + * @copyright UNL 2009 + * @link http://planetred.unl.edu/ + */ + + require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); + + gatekeeper(); + + // Get view + $area1 = elgg_view('globe/content', array()); + + // Format + $body = elgg_view_layout('one_column', $area1); + + + + // Draw page + echo page_draw(elgg_echo(' Put Yourself On The Map'), $body); + +?> \ No newline at end of file diff --git a/plugins/putyourselfonthemap/manifest.xml b/plugins/putyourselfonthemap/manifest.xml new file mode 100644 index 0000000000000000000000000000000000000000..054266a84bd99514a6f613839c56b7deeb002e86 --- /dev/null +++ b/plugins/putyourselfonthemap/manifest.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<plugin_manifest> + <field key="author" value="Eric Rasmussen" /> + <field key="version" value=".5" /> + <field key="description" value="Globe for plotting users locations using the Poly9 globe api." /> + <field key="website" value="http://www.unl.edu/" /> + <field key="copyright" value="(C) University of Nebraska-Lincoln" /> + <field key="licence" value="BSD" /> + <field key="elgg_version" value="1.6" /> +</plugin_manifest> \ No newline at end of file diff --git a/plugins/putyourselfonthemap/start.php b/plugins/putyourselfonthemap/start.php new file mode 100644 index 0000000000000000000000000000000000000000..a5eed5125e2e47502966ce4015e0218612ba5d79 --- /dev/null +++ b/plugins/putyourselfonthemap/start.php @@ -0,0 +1,60 @@ +<?php + /** + * Elgg globe plugin + * + * @package ElggGlobe + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Eric Rasmussen + * @copyright UNL 2009 + * @link http://planetred.unl.edu/ + */ + + /** + * Initialise the groups plugin. + * Register actions, set up menus + */ + function globe_init() + { + + global $CONFIG; + + + if (isloggedin()) + { + add_menu(elgg_echo('Around the World'), $CONFIG->wwwroot . "pg/globe/"); + //add_menu(elgg_echo('groups:alldiscussion'),$CONFIG->wwwroot."mod/groups/discussions.php"); + } + else + { + add_menu(elgg_echo('Around the World'), $CONFIG->wwwroot . "pg/globe/"); + } + + + + // Extend system CSS with our own styles, which are defined in the globe/css view + extend_view('css','globe/css'); + + + register_page_handler('globe', 'globe_page_handler'); + + } + + function globe_page_handler($page) { + switch ($page[0]) + { + case 'friends': + include("globe.php"); + break; + default: + include("index.php"); + break; + } + } + + + + + register_elgg_event_handler('init','system','globe_init'); + + +?> diff --git a/plugins/putyourselfonthemap/views/default/putyourselfonthemap/content.php b/plugins/putyourselfonthemap/views/default/putyourselfonthemap/content.php new file mode 100644 index 0000000000000000000000000000000000000000..7a603450cde6ddcebcf4b75f15249ab032359172 --- /dev/null +++ b/plugins/putyourselfonthemap/views/default/putyourselfonthemap/content.php @@ -0,0 +1,343 @@ +<?php + + /** + * Elgg globe content + * + * @package ElggGlobe + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Eric Rasmussen + * @copyright UNL 2009 + * @link http://planetred.unl.edu/ + */ +?> + + +<script type="text/javascript">var config_url = "<?php echo $CONFIG->url ?>";</script> +<script type="text/javascript"> +<?php + if(!isset($_REQUEST['display']) || $_REQUEST['display'] == 'featured') + echo 'var whatToShowOnMap = "featured";'; + else if($_REQUEST['display'] == 'friends') + echo 'var whatToShowOnMap = "friends";'; + else if($_REQUEST['display'] == 'role') + echo 'var whatToShowOnMap = "role";'; + else + echo 'var whatToShowOnMap = "featured";'; +?> +</script> +<script type="text/javascript" src="http://globe.poly9.com/api.js"></script> +<script type="text/javascript" src="<?php echo $CONFIG->url ?>mod/globe/views/default/globe/globefeatured.js"></script> +<script type="text/javascript" src="<?php echo $CONFIG->url ?>mod/globe/views/default/globe/globecontrol.js"></script> + +<div id="globeInner" style="opacity:1 !important; display: block !important;width:940px;height:505px;background-color:#000;"></div> + + +<div class="clear"></div> + + +<div class="globeGroup" id="plotMe"> + <?php + + function DECtoDMS($dec) + { + $vars = explode(".",$dec); + $deg = $vars[0]; + $tempma = "0.".$vars[1]; + + $tempma = $tempma * 3600; + $min = floor($tempma / 60); + $sec = $tempma - ($min*60); + + return array("deg"=>$deg,"min"=>$min,"sec"=>$sec); + } + + if (isloggedin()) { + $me = get_user($_SESSION['user']->guid); + + ?> + <span class="youLarge">You:</span> + + <?php if($me->latitude) { ?> + <img src="<?php echo $_SESSION['user']->getIcon('small'); ?>" alt="Your Profile Icon" id="YourselfOnTheMap" onclick="window.openLocation(<?php echo "'" . $me->longitude . "','" . $me->latitude . "','" . $me->username . "',"; + if($me->profile_country) + echo "'" . $me->profile_country . " - " . str_replace("'","\'",htmlentities($me->profile_city)) . ", " . $me->profile_state . "',"; + else + echo "'',"; + echo "'" . str_replace("'","\'",htmlentities($me->name)) . "',"; + if($me->profile_attended_from != "Did Not Attend UNL" && $me->profile_attended_from != "" && $me->profile_attended_from != NULL) + echo "'Attended UNL: " . $me->profile_attended_from . "-" . $me->profile_attended_to . "'"; + else + echo "''"; + echo ",'". str_replace("'","\'",htmlentities($me->map_explanation))."'"?>)" /> + <?php } else { ?> + <img src="<?php echo $_SESSION['user']->getIcon('small'); ?>" alt="Your Profile Icon" id="YourselfOnTheMap" style="cursor:default !important" /> + <?php }?> + + <?php if($me->latitude) { $DMS_lat = DECtoDMS($me->latitude);$DMS_lng = DECtoDMS($me->longitude); ?> + <span class="locationMe">Location: <?php echo $me->profile_country . " - " . str_replace("'","\'",htmlentities(ucwords($me->profile_city))) . ", " . $me->profile_state ?></span> + <span class="latlngMe">Latitude: <?php echo $DMS_lat['deg']."° ".$DMS_lat['min']."' ".$DMS_lat['sec']."\"" ?> Longitude: <?php echo $DMS_lng['deg']."° ".$DMS_lng['min']."' ".$DMS_lng['sec']."\"" ?></span> + <?php } else { ?> + <span class="locationMe">You haven't added your location yet,</span> + <span class="latlngMe"><a href="<?php echo $CONFIG->url ?>pg/profile/<?php echo $me->username ?>/edit/">Edit your profile</a> and put yourself on the map!</span> + <?php }?> + + <div class="clear"></div> + <?php + + } + ?> + +</div> + +<div class="clear"></div> + +<div class="globeGroup col left" id="plotFriends"> + + + <h3 class="sec_header">Your Friends <span class="plotOnMap">Show All</span></h3> + <script type="text/javascript">var friend = new Array();</script> + <?php + $fc = 0; + $currentUser = get_loggedin_user(); + $friends = get_entities_from_relationship("friend",$currentUser->guid,false,"user","",0,"",100); + if($friends){ + foreach($friends as $user){ + $user = get_user($user->guid); + + ?> + <script type="text/javascript"> + friend[<?php echo $fc ?>]=new person('<?php echo $user->longitude ?>','<?php echo $user->latitude ?>','<?php echo $user->username ?>', + '<?php echo $user->profile_country . " - " . str_replace("'","\'",htmlentities($user->profile_city)) . ", " . $user->profile_state ?>','<?php echo str_replace("'","\'",htmlentities($user->name)) ?>', + '<?php if($user->profile_attended_from != "Did Not Attend UNL" && $user->profile_attended_from != "" && $user->profile_attended_from != NULL)echo "Attended UNL: " . $user->profile_attended_from . "-" . $user->profile_attended_to;?>', + '<?php echo str_replace("'","\'",htmlentities($user->map_explanation)) ?>'); + </script> + <?php + $fc++; + if($user->longitude != undefined && $user->longitude != "" && $user->map_explanation != undefined && $user->map_explanation != ""){ + echo "<div class=\"member_icon\"><img onclick=\"window.openLocation('" . $user->longitude . "','" . $user->latitude . "','" . $user->username . "',"; + if($user->profile_country) + echo "'" . $user->profile_country . " - " . str_replace("'","\'",htmlentities($user->profile_city)) . ", " . $user->profile_state . "',"; + else + echo "'',"; + echo "'" . str_replace("'","\'",htmlentities($user->name)) . "',"; + if($user->profile_attended_from != "Did Not Attend UNL" && $user->profile_attended_from != "" && $user->profile_attended_from != NULL) + echo "'Attended UNL: " . $user->profile_attended_from . "-" . $user->profile_attended_to . "'"; + else + echo "''"; + echo ",'". str_replace("'","\'",htmlentities($user->map_explanation))."');return false;\" src=\"".$CONFIG->url."mod/profile/icon.php?username=" . $user->username . "&size=tiny\" /></div>"; + } + else{ + echo "<div class=\"member_icon\" style=\"cursor:default !important; opacity:0.4;filter:alpha(opacity=40)\"><img src=\"".$CONFIG->url."mod/profile/icon.php?username=" . $user->username . "&size=tiny\" /></div>"; + } + } + } + else + echo 'You haven\'t added any friends yet but that\'s ok, <a href="' . $CONFIG->url .'pg/browse/">we\'ll help you find some</a>.'; + ?> + + +</div> + +<!-- +<div class="globeGroup col middle" id="plotGroups"> +<h3 class="sec_header">Your Groups</h3></div> +--> + + +<div class="globeGroup two_col middle" id="plotRoles"> + <h3 class="sec_header"><?php + if($me->profile_role == 'prospective student') + echo 'Other Prospective Students'; + else if($me->profile_role == 'current student') + echo 'Other Students'; + else if($me->profile_role == 'parent of a student') + echo 'Fellow Parents'; + else if($me->profile_role == 'alumnus') + echo 'Other Alumni'; + else if($me->profile_role == 'faculty/staff') + echo 'Other Faculty/Staff'; + else if($me->profile_role == 'nebraska resident') + echo 'Other Residents of Nebraska'; + else if($me->profile_role == 'friend of the university') + echo 'Other Friends of UNL'; + else + echo 'Other Users Like You'; + ?> <span class="plotOnMap">Show All</span></h3> + <script type="text/javascript">var role = new Array();</script> + <?php + $rc = 0; + $currentUser = get_loggedin_user(); + $roles = get_entities_from_metadata("profile_role", $me->profile_role, "user","",0,300); + if($me->profile_role){ + foreach($roles as $user){ + $user = get_user($user->guid); + + ?> + <script type="text/javascript"> + role[<?php echo $rc ?>]=new person('<?php echo $user->longitude ?>','<?php echo $user->latitude ?>','<?php echo $user->username ?>', + '<?php echo $user->profile_country . " - " . str_replace("'","\'",htmlentities($user->profile_city)) . ", " . $user->profile_state ?>','<?php echo str_replace("'","\'",htmlentities($user->name)) ?>', + '<?php if($user->profile_attended_from != "Did Not Attend UNL" && $user->profile_attended_from != "" && $user->profile_attended_from != NULL)echo "Attended UNL: " . $user->profile_attended_from . "-" . $user->profile_attended_to;?>', + '<?php echo str_replace("'","\'",htmlentities($user->map_explanation)) ?>'); + </script> + <?php + $rc++; + if($user->longitude != undefined && $user->longitude != ""){ + echo "<div class=\"member_icon\"><img onclick=\"window.openLocation('" . $user->longitude . "','" . $user->latitude . "','" . $user->username . "',"; + if($user->profile_country) + echo "'" . $user->profile_country . " - " . str_replace("'","\'",htmlentities($user->profile_city)) . ", " . $user->profile_state . "',"; + else + echo "'',"; + echo "'" . str_replace("'","\'",htmlentities($user->name)) . "',"; + if($user->profile_attended_from != "Did Not Attend UNL" && $user->profile_attended_from != "" && $user->profile_attended_from != NULL) + echo "'Attended UNL: " . $user->profile_attended_from . "-" . $user->profile_attended_to . "'"; + else + echo "''"; + echo ",'". str_replace("'","\'",htmlentities($user->map_explanation))."');return false;\" src=\"".$CONFIG->url."mod/profile/icon.php?username=" . $user->username . "&size=tiny\" /></div>"; + } + else{ + echo "<div class=\"member_icon\" style=\"cursor:default !important;opacity:0.4;filter:alpha(opacity=40)\"><img src=\"".$CONFIG->url."mod/profile/icon.php?username=" . $user->username . "&size=tiny\" /></div>"; + } + } + } + else + echo 'Define your relationship to UNL by <a href="'.$CONFIG->url.'pg/profile/'.$me->username.'/edit/">editing your profile</a> and see other users like you!'; + ?> + + + + +</div> + +<div class="globeGroup col right" id="plotFeatured"> + <h3 class="sec_header">Featured Huskers <span class="plotOnMap">Show All</span></h3> + + + <!-- row 1 --> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[0]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Nancy_Andreasen_tiny.jpg" alt="Profile Icon" /> + </div> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[1]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Atorod_Azizinamini_tiny.jpg" alt="Profile Icon" /> + </div> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[2]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Claude-M_Bolton-Jr_tiny.jpg" alt="Profile Icon" /> + </div> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[3]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Warren_Buffett_tiny.jpg" alt="Profile Icon" /> + </div> + <!-- row 2 --> + <!-- <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[4]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Ann_Chang-Barnes_tiny.jpg" alt="Profile Icon" /> + </div> + --> <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[5]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Bing_Chen_tiny.jpg" alt="Profile Icon" /> + </div> + <!-- <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[6]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Xun-Hong_Chen_tiny.jpg" alt="Profile Icon" /> + </div> + --> <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[7]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Granville_Coggs_tiny.jpg" alt="Profile Icon" /> + </div> + <!-- row 3 --> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[8]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Dr-L-Trey_Coleman_tiny.jpg" alt="Profile Icon" /> + </div> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[9]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Pam_Dingman_tiny.jpg" alt="Profile Icon" /> + </div> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[10]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Christopher_Elbow_tiny.jpg" alt="Profile Icon" /> + </div> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[11]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Shane_Farritor_tiny.jpg" alt="Profile Icon" /> + </div> + <!-- row 4 --> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[12]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Sheri_Fritz_tiny.jpg" alt="Profile Icon" /> + </div> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[13]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Rulon_Gardner_tiny.jpg" alt="Profile Icon" /> + </div> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[14]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/David_Harwood_tiny.jpg" alt="Profile Icon" /> + </div> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[15]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/John_Hoerner_tiny.jpg" alt="Profile Icon" /> + </div> + <!-- row 5 --> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[16]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Michael_Hoff_tiny.jpg" alt="Profile Icon" /> + </div> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[17]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/John_Janovy-Jr_tiny.jpg" alt="Profile Icon" /> + </div> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[18]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Jay_Keasling_tiny.jpg" alt="Profile Icon" /> + </div> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[19]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Scott_Killinger_tiny.jpg" alt="Profile Icon" /> + </div> + <!-- row 6 --> + <!-- <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[20]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Karen_Kunc_tiny.jpg" alt="Profile Icon" /> + </div> + --> <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[21]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Nithal_Kuwa_tiny.jpg" alt="Profile Icon" /> + </div> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[22]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Cindy_McCaffrey_tiny.jpg" alt="Profile Icon" /> + </div> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[23]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Betsy_O'Brien_tiny.jpg" alt="Profile Icon" /> + </div> + <!-- row 7 --> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[24]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Juanita_Page_tiny.jpg" alt="Profile Icon" /> + </div> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[25]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Larkin_Powell_tiny.jpg" alt="Profile Icon" /> + </div> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[26]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Jeffrey_Raikes_tiny.jpg" alt="Profile Icon" /> + </div> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[27]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Brett_Ratcliffe_tiny.jpg" alt="Profile Icon" /> + </div> + <!-- row 8 --> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[28]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Jorge-Alberto_Rodriguez_tiny.jpg" alt="Profile Icon" /> + </div> + <!-- <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[29]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Avery_Schwer_tiny.jpg" alt="Profile Icon" /> + </div> + --> <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[30]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Ted_Sorensen_tiny.jpg" alt="Profile Icon" /> + </div> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[31]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Bob_Thacker_tiny.jpg" alt="Profile Icon" /> + </div> + <!-- row 9 --> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[32]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Ken_Vogel_tiny.jpg" alt="Profile Icon" /> + </div> + <!-- <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[33]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Sidnie_White-Crawford_tiny.jpg" alt="Profile Icon" /> + </div> + --> <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[34]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Charles_Wood_tiny.jpg" alt="Profile Icon" /> + </div> + <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[35]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/John_Yohe_tiny.jpg" alt="Profile Icon" /> + </div> + <!-- row 10 --> + <!-- <div class="member_icon"> + <img onclick="displayFeaturedPerson(husker[36]);" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Trischa_Zorn-Hudson_tiny.jpg" alt="Profile Icon" /> + </div> + --> +</div> + + + +<div class="clear"></div> + +<p style="font-size:.8em;font-style:italic;margin-top:70px">Icons are only clickable if that user has edited their profile with their location. Otherwise, we don't know where to put them!</p> diff --git a/plugins/putyourselfonthemap/views/default/putyourselfonthemap/css.php b/plugins/putyourselfonthemap/views/default/putyourselfonthemap/css.php new file mode 100644 index 0000000000000000000000000000000000000000..3d92d3d732a03f9b3272e5661b8fb0c9401a865f --- /dev/null +++ b/plugins/putyourselfonthemap/views/default/putyourselfonthemap/css.php @@ -0,0 +1,72 @@ +<?php + + /** + * Elgg globe CSS extender + * + * @package ElggGlobe + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Eric Rasmussen + * @copyright UNL 2009 + * @link http://planetred.unl.edu/ + */ + +?> +span.plotOnMap { + text-indent:-99999px; + float:right; + background:url(<?php echo $vars['url']; ?>/mod/globe/graphics/showhide.png) no-repeat top right; + display:block; + width:57px; + height:40px; + margin-top:-20px; + margin-right:-2px; + cursor:pointer; + z-index:99; + position:relative; +} +span.plotOnMap.hide { + background-position:0 -40px; +} +/* You Icon +*************/ +#plotMe { + background:#eeeeee; + margin:10px 0; + padding:5px 5px 3px 15px; + -moz-border-radius:5px; + position:relative; +} + +span.youLarge{ + font-size:18pt; + padding:20px 10px 0 0; + position:relative; + bottom:15px; + } +span.locationMe{ + font-size:14pt; + position:absolute;top:5px; + color:#6b6b6b; +} +span.latlngMe{ + font-size:12pt; + position:absolute;top:28px; + color:#6b6b6b; +} +#plotMe #YourselfOnTheMap{ + margin-right:30px; + cursor:pointer; + border:1px solid #ddd !important; + padding:1px; +} + + +/* Tiny Icons +***************/ +div.globeGroup div.member_icon { + margin:0 0 4px 2px; + border:1px solid #eee; + padding:1px; + height:27px; + width:27px; +} \ No newline at end of file diff --git a/plugins/putyourselfonthemap/views/default/putyourselfonthemap/globecontrol.js b/plugins/putyourselfonthemap/views/default/putyourselfonthemap/globecontrol.js new file mode 100644 index 0000000000000000000000000000000000000000..5980fe3f0f5d08b28c38785d2088908e175202e7 --- /dev/null +++ b/plugins/putyourselfonthemap/views/default/putyourselfonthemap/globecontrol.js @@ -0,0 +1,167 @@ +<!-- begin poly9 globe js --> +var setT; +var counter=0; +var counterMax; + +function startMap() { + //turn off the overlay + this.toggleDashboard(); + //set the initial zoom level + map1.zoomTo(10505000,2.5,"easeInOutQuad"); + + + if(whatToShowOnMap = 'featured') { + show('featured'); + } else if(whatToShowOnMap = 'friends') { + show('friends'); + } else if(whatToShowOnMap = 'role') { + show('role'); + } else { + //error + } +}; + +function show(type){ + //clear the map + map1.closeInfoWindow(); + map1.clearOverlays(); + clearTimeout(setT); + + if(type=='friends'){ + counterMax = friend.length; + //put in the pins for featured huskers + for(counter=0;counter<counterMax;counter++){ + per = friend[counter]; + if(per.lng !== '' && per.lat !== '') + placePin(per.lng,per.lat,per.username,per.location,per.displayname,per.title,per.comment,per.linkname); + } + + //auto fill the globe with featured huskers + counter=0; + setTimeout("displayPeople('friends');",1000); + } else if(type=='role'){ + counterMax = role.length; + //put in the pins for featured huskers + for(counter=0;counter<counterMax;counter++){ + per = role[counter]; + if(per.lng !== '' && per.lat !== '') + placePin(per.lng,per.lat,per.username,per.location,per.displayname,per.title,per.comment,per.linkname); + } + + //auto fill the globe with featured huskers + counter=0; + setTimeout("displayPeople('role');",1000); + } else if(type=='featured'){ + counterMax = husker.length; + //put in the pins for featured huskers + for(counter=0;counter<counterMax;counter++){ + per = husker[counter]; + if(counter !== 4 && counter !== 6 && counter !== 20 && counter !== 29 && counter !== 33 && counter !== 36) + placePin(per.lng,per.lat,per.username,per.location,per.displayname,per.title,per.comment,per.linkname); + else{} + } + + //auto fill the globe with featured huskers + counter=Math.floor(Math.random()*counterMax); + if(counter == 4 || counter == 6 || counter == 20 || counter == 29 || counter == 33 || counter == 36) + counter++; + else{} + setTimeout("displayPeople('featured');",1000); + } else { + //error + } + +}; + +function displayPeople(type){ + if(type=='featured') + p = husker[counter]; + else if(type=='role'){ + p = role[counter]; + if(p.lng == ''){ + counter++; + if(counter>=counterMax) + counter=0; + clearTimeout(setT); + displayPeople(type); + return false; + } + } + else if(type=='friends'){ + p = friend[counter]; + if(p.lng == ''){ + counter++; + if(counter>=counterMax) + counter=0; + clearTimeout(setT); + displayPeople(type); + return false; + } + } + + openLocation(p.lng,p.lat,p.username,p.location,p.displayname,p.title,p.comment,p.linkname); + if(counter !== 3 && counter !== 5 && counter !== 19 && counter !== 28 && counter !== 32 && counter !== 35) + counter++; + else + counter=counter+2; + if(counter>=counterMax) + counter=0; + setT=setTimeout("displayPeople('"+type+"')",5000); + return false; +}; + +function displayFeaturedPerson(p){ + openLocation(p.lng,p.lat,p.username,p.location,p.displayname,p.title,p.comment,p.linkname); +}; + +function placePin(lng, lat, username, location, displayname, title, comment, linkname) { + var latlng = new FE.LatLng(lat,lng); + label = window.label = new FE.Pushpin(latlng,new FE.Icon(config_url+'mod/customindex/map-pin-12.png')); + //make pins clickable + FE.Event.addListener(label, 'click', function() { openLocation(lng, lat, username, location, displayname, title, comment, linkname);}); + map1.addOverlay(label); +}; + +function openLocation(lng, lat, username, location, displayname, title, comment, linkname) { + clearTimeout(setT); + var latlng = new FE.LatLng(lat,lng); + setTimeout(function(){map1.panTo(latlng,2.5,"easeInOutQuad")}, 80); + label = window.label = new FE.Pushpin(latlng,new FE.Icon(config_url+'mod/customindex/map-pin-12.png')); + map1.addOverlay(label); + applylabel(latlng, location, title, comment, displayname, username, linkname); +}; + +function applylabel(latlng, location, title, comment, displayname, username, linkname) { + if(!linkname){ //these are the most recently joined users, they dont have a linkname to a featured profile + if(comment != undefined && comment != "") + label.openInfoWindowHtml('<div id="witw_wrapper">'+ + '<a href="'+config_url+'pg/profile/' + username + '"><img class="witw_icon" src="'+config_url+'mod/profile/icondirect.php?username=' + username + '&size=medium" width="60" height="60" /></a><h1>' + displayname + '</h1>'+ + '<p class="witw_location">' + location + '</p><p class="witw_title">' + title + '</p>'+ + '<p class="witw_comment"><strong>Why here?</strong><br /><em>\"' + comment + '\"</em></p><p class="witw_comment" style="margin-top:-6px; padding-right: 12px; text-align:right;"><a href="'+config_url+'pg/profile/' + username + '">View Profile</a></p>'+ + '</div>', 256, 154); + else + label.openInfoWindowHtml('<div id="witw_wrapper">'+ + '<a href="'+config_url+'pg/profile/' + username + '"><img class="witw_icon" src="'+config_url+'mod/profile/icondirect.php?username=' + username + '&size=medium" width="60" height="60" /></a><h1>' + displayname + '</h1>' + + '<p class="witw_location">' + location + '</p><p class="witw_title">' + title + '</p>'+ + '<p class="witw_comment"></p><p class="witw_comment"><a href="'+config_url+'pg/profile/' + username + '">View Profile</a></p>'+ + '</div>', 256, 154); + } + else //these are the featured WITW Huskers (like Buffett, etc) + label.openInfoWindowHtml('<div id="witw_wrapper"><img class="witw_icon" src="'+config_url+'mod/customindex/witw_icons/' + linkname + '_medium.jpg" width="60" height="60" /><h1>' + displayname + '</h1><p class="witw_location">' + location + '</p><p class="witw_title">' + title + '</p><p class="witw_comment">' + comment + ' <a href="'+config_url+'featured/husker/' + linkname + '/">Continue Reading...</a></p></div>', 256, 154); +}; + +WDN.jQuery(document).ready(function() { + try{ + window.map1 = new FE.Map(document.getElementById("globeInner")); + map1.onLoad = startMap; + map1.load(); + }catch(e){} + + WDN.jQuery('#plotFriends h3 span').click(function(){show('friends');}); + WDN.jQuery('#plotRoles h3 span').click(function(){show('role');}); + WDN.jQuery('#plotFeatured h3 span').click(function(){show('featured');}); +}); + + +<!-- end poly9 globe js --> + diff --git a/plugins/putyourselfonthemap/views/default/putyourselfonthemap/globefeatured.js b/plugins/putyourselfonthemap/views/default/putyourselfonthemap/globefeatured.js new file mode 100644 index 0000000000000000000000000000000000000000..9ef59365d79e034efbe5ec2f23d28232f9461418 --- /dev/null +++ b/plugins/putyourselfonthemap/views/default/putyourselfonthemap/globefeatured.js @@ -0,0 +1,165 @@ +// lng, lat, username, location, displayname, title, comment(text area), linkname(the username with the underscore) + +function person(lng, lat, username, location, displayname, title, comment, linkname) +{ +this.lng=lng; +this.lat=lat; +this.username=username; +this.location=location; +this.displayname=displayname; +this.title=title; +this.comment=comment; +this.linkname=linkname; +}; + + + +var husker = new Array(); +husker[0]=new person('-91.5330870','41.6578850','demouser','USA - Iowa City, IA','Nancy Andreasen', + 'Andrew H. Woods Chair of Psychiatry and Director of its Neuroimaging Research Center', + 'Nancy Andreasen\'s Breakthrough Research Changed The Way Modern Science Understands Schizophrenia.', + 'Nancy_Andreasen'); +husker[1]=new person('126.9779692','37.5665350','demouser','South Korea','Atorod Azizinamini', + 'Professor of Civil Engineering and Director of NaBRO', + 'Atorod Azizinamini is developing better ways to renovate existing bridges and to build new ones that last a century or longer.', + 'Atorod_Azizinamini'); +husker[2]=new person('-77.0240550','38.8920910','demouser','USA - Washington, D.C.','Claude M. Bolton, Jr.', + '', + 'Air Force "Top Gun" Claude Bolton Thrives On New Challenge: Acquiring Equipment For The Army.', + 'Claude-M_Bolton-Jr'); +husker[3]=new person('-96.0247270','41.2532250','demouser','USA - Omaha, NE','Warren Buffett', + 'Chairman, Berkshire Hathaway', + 'Warren Buffett, \'50, has some investment advice for everyone: invest in yourself.', + 'Warren_Buffett'); +husker[4]=new person('4.4699360','50.5038870','demouser','Belgium','Ann Chang-Barnes', + 'Interim Executive Director, Lied Center for Performing Arts, and Artist-in-Residence', + 'Ann Chang-Barnes champions performing arts for Nebraska - she even plays a little piano herself.', + 'Ann_Chang-Barnes'); +husker[5]=new person('-96.7','40.8','demouser','USA - Lincoln, NE','Bing Chen', + 'Chair of Computer & Electronics Engineering', + 'Bing Chen has taken his robotics-based curriculum to school - in Nebraska and across the U.S.', + 'Bing_Chen'); +husker[6]=new person('116.3979471','39.9081726','demouser','China','Xun-Hong Chen', + 'Professor of Hydrogeology', + 'Xun-Hong Chen studies water in the Nebraska Sandhills in the fight against global water shortage.', + 'Xun-Hong_Chen'); +husker[7]=new person('-98.4937220','29.4250370','demouser','USA - San Antonio, TX','Granville Coggs', + '', + 'Granville Coggs, \'49, triumphed over 1940s racial discrimination to become part of a living American legend.', + 'Granville_Coggs'); +husker[8]=new person('-80.2064440','25.9794980','demouser','USA - Miami Gardens, FL','Dr. L Trey Coleman', + 'Director of Grants and Sponsored Research, Florida Memorial University', + 'Football delivered Dr. L. Trey Coleman out of a troubled past to Nebraska. He left with a future.', + 'Dr-L-Trey_Coleman'); +husker[9]=new person('-96.7','40.8','demouser','USA - Lincoln, NE','Pam Dingman', + 'CEO of Engineering Design Consultants (EDC)', + 'Pam Dingman is one of a handful of U.S. women who manages and owns a civil engineering firm.', + 'Pam_Dingman'); +husker[10]=new person('-94.5836440','39.0904310','demouser','USA - Kansas City, MO','Christopher Elbow', + '', + 'Christopher Elbow, \'96, has developed a national reputation for his exquisite handmade chocolates.', + 'Christopher_Elbow'); +husker[11]=new person('-96.7','40.8','demouser','USA - Lincoln, NE','Shane Farritor', + 'Associate Professor, Mechanical Engineering', + 'Shane Farritor, \'92, has conducted promising research on railcar derailment and surgical robots.', + 'Shane_Farritor'); +husker[12]=new person('-69.3831079','-15.7961915','demouser','Bolivia - Lake Titicaca','Sheri Fritz', + 'Willa Cather professor, Department of Geosciences', + 'Sheri Fritz studies lake mud to research climate change and human impact on the environment.', + 'Sheri_Fritz'); +husker[13]=new person('151.2071140','-33.8671390','demouser','Australia - Sydney','Rulon Gardner', + 'Olympic gold medal-winning wrestler', + 'Rulon Gardner, \'96, won Olympic gold, but he\'ll never stop pushing.', + 'Rulon_Gardner'); +husker[14]=new person('160.336071','-79.464507','demouser','Antarctica','David Harwood', + 'Professor and Stout Chair in Stratigraphy', + 'David Harwood brings the entire continent of Antarctica into his UNL classroom.', + 'David_Harwood'); +husker[15]=new person('15.4729620','49.8174920','demouser','Czech Republic, Slovakia and Hungary','John Hoerner', + '', + 'John Hoerner, \'61, has been a leader in European retail for more than 20 years.', + 'John_Hoerner'); +husker[16]=new person('30.8540570','36.9598850','demouser','Turkey - Mediterranean Coast','Michael Hoff', + 'Professor of Art History', + 'Michael Hoff explores ruins of a Roman temple in Turkey - and takes students along for the ride.', + 'Michael_Hoff'); +husker[17]=new person('-101.7204980','41.1309980','demouser','USA - Ogallala, NE','John Janovy, Jr.', + 'Varner Professor of Biological Sciences', + 'John Janovy, Jr., is at his best teaching biology in the field.', + 'John_Janovy-Jr'); +husker[18]=new person('-122.4192090','37.7752060','demouser','USA - San Francisco, CA','Jay Keasling', + '', + 'Jay Keasling, \'86, runs a lab that is creating a cure for malaria.', + 'Jay_Keasling'); +husker[19]=new person('117.2523808','39.1038561','demouser','China - Tianjin','Scott Killinger', + '', + 'Scott Killinger (\'61) specializes in planning new housing and commercial buildings in China.', + 'Scott_Killinger'); +husker[20]=new person('2.3509871','48.8566667','demouser','France, Poland and Italy','Karen Kunc', + '', + 'Karen Kunc, \'75, is an artist whose work has been shown in galleries around the world.', + 'Karen_Kunc'); +husker[21]=new person('28.2871670','-15.4081930','demouser','Zambia - Lusaka','Nithal Kuwa', + 'Graduate student, Biological Sciences', + 'Nithal Kuwa\'s research could impact more than 1.8 million children in sub-Saharan Africa.', + 'Nithal_Kuwa'); +husker[22]=new person('-122.0851100','37.4219470','demouser','USA - San Francisco, CA','Cindy McCaffrey', + '', + 'Cindy McCaffrey, \'80, shaped marketing blitz that helped make "Google" what it is today.', + 'Cindy_McCaffrey'); +husker[23]=new person('-77.0265910','38.8856150','demouser','USA - Washington, D.C.','Betsy O\'Brien', + '', + 'Betsy O\'Brien, \'67, made a career of quantifying future energy sources and costs.', + 'Betsy_O\'Brien'); +husker[24]=new person('-77.0240550','38.8920910','demouser','USA - Washington, D.C.','Juanita Page', + '', + 'Juanita Page, \'04, is the network manager and advertising sales producer for Discovery Health Channel.', + 'Juanita_Page'); +husker[25]=new person('18.4904100','-22.9576400','demouser','Namibia','Larkin Powell', + '', + 'Larkin Powell blogs about his year-long Fulbright experience in Namibia.', + 'Larkin_Powell'); +husker[26]=new person('-122.1155690','47.6722350','demouser','USA - Redmond, WA','Jeffrey Raikes', + 'CEO, Bill & Melinda Gates Foundation', + 'Jeffrey Raikes, a native of Ashland, NE, is a major supporter of the University of Nebraska-Lincoln.', + 'Jeffrey_Raikes'); +husker[27]=new person('-88.4976500','17.1898770','demouser','Belize, Guatemala, Mexico','Brett Ratcliffe', + '', + 'Brett Ratcliffe, who some call an extreme scientist, studies beetles in Central America.', + 'Brett_Ratcliffe'); +husker[28]=new person('-58.3731613','-34.6084175','demouser','Argentina','Jorge Alberto Rodriguez', + '', + 'Jorge Rodriguez, \'79, \'80, is a past chief of the Cabinet of Ministers for the Republic of Argentina.', + 'Jorge-Alberto_Rodriguez'); +husker[29]=new person('-95.9423630','41.2597510','demouser','USA - Omaha, NE','Avery Schwer', + 'Associate Professor of construction systems', + 'Avery Schwer, associate professor of construction systems, is building the house of the future.', + 'Avery_Schwer'); +husker[30]=new person('-73.9856550','40.7484330','demouser','USA - New York, NY','Ted Sorensen', + '', + 'Ted Sorensen, \'49, \'51 spent 11 years as JFK\'s highly influential speechwriter and domestic policy adviser.', + 'Ted_Sorensen'); +husker[31]=new person('-87.6348870','41.8776540','demouser','USA - Chicago, IL','Bob Thacker', + '', + 'Bob Thacker (\'70) is a legendary retail marketer whose secret is "Look before you leap - but leap!"', + 'Bob_Thacker'); +husker[32]=new person('-98.9770470','42.5366690','demouser','USA - Atkinson/Crofton, NE','Ken Vogel', + 'USDA-ARS plant geneticist at UNL', + 'Ken Vogel, \'74, studies what may become the next generation of biofuels - switchgrass.', + 'Ken_Vogel'); +husker[33]=new person('35.2007000','31.7857000','demouser','Isreal; Palestinian Terretories','Sidnie White Crawford', + 'Willa Cather Professor and Chair, Department of Classics and Religious Studies', + 'Sidnie White Crawford\'s work sheds light on Middle East conflict.', + 'Sidnie_White-Crawford'); +husker[34]=new person('31.1825290','-10.2084000','demouser','Zambia','Charles Wood', + '', + 'Charles Wood empowers Zambians to fight the HIV/AIDS battle themselves.', + 'Charles_Wood'); +husker[35]=new person('34.8888220','-6.3690280','demouser','Tanzania','John Yohe', + 'Associate Prof and Dir, Int Sorghum/Millet Collaborative Research Support Prgm', + 'John Yohe is delivering higher sorghum and millet yields in Africa - and back home.', + 'John_Yohe'); +husker[36]=new person('23.7166470','37.9791800','demouser','Athens, Seoul, Barcelona, Sydney, Beijing','Trischa Zorn-Hudson', + '', + 'Trischa Zorn-Hudson, \'87, was an athlete at Nebraska. She may be the Huskers\' biggest fan, too.', + 'Trischa_Zorn-Hudson');