diff --git a/plugins/globe/views/default/globe/content.php b/plugins/globe/views/default/globe/content.php index e3079c8b5886bb3509a7de8a1489722dec9a28a1..68fecd5e396b5149a0612e56e8972e19c8136c50 100644 --- a/plugins/globe/views/default/globe/content.php +++ b/plugins/globe/views/default/globe/content.php @@ -19,6 +19,8 @@ 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";'; ?> @@ -40,7 +42,8 @@ ?> <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 . "',"; @@ -52,10 +55,18 @@ 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) { ?> + <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 $me->latitude ?> Longitude: <?php echo $me->longitude ?></span> + <?php } else { ?> + <span class="locationMe">You haven't added your location yet,</span> + <span class="latlngMe"><a href="<?php echo $CONFIG->url ?>mod/profile/edit.php?username=<?php echo $me->username ?>">Edit your profile</a> and put yourself on the map!</span> + <?php }?> - - <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 $me->latitude ?> Longitude: <?php echo $me->longitude ?></span> <div class="clear"></div> <?php @@ -81,10 +92,10 @@ ?> <script type="text/javascript"> - friend[<?php echo $fc ?>]=new person('<?php echo $user->longitude ?>','<?php echo $user->latitude ?>','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'); + 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++; @@ -102,7 +113,7 @@ 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;\"><img src=\"".$CONFIG->url."mod/profile/icon.php?username=" . $user->username . "&size=tiny\" /></div>"; + 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>"; } } } @@ -112,10 +123,76 @@ </div> + +<!-- <div class="globeGroup col middle" id="plotGroups"> <h3 class="sec_header">Your Groups</h3></div> -<div class="globeGroup col middle" id="plotRoles"> -<h3 class="sec_header">Other <Roles></h3></div> +--> + + +<div class="globeGroup two_col middle" id="plotRoles"> + <h3 class="sec_header">Other <?php + if($me->profile_role == 'prospect') + echo 'Prospective Students'; + else if($me->profile_role == 'student') + echo 'Students'; + else if($me->profile_role == 'parent') + echo 'Parents'; + else if($me->profile_role == 'alum') + echo 'Alumni'; + else if($me->profile_role == 'facstaff') + echo 'Faculty/Staff'; + else if($me->profile_role == 'resident') + echo 'Residents of Nebraska'; + else if($me->profile_role == 'friends') + echo 'Friends of UNL'; + else + echo 'Users Like You'; + ?> <span>PLOT</span></h3> + <script type="text/javascript">var role = new Array();</script> + <?php + $rc = 0; + $currentUser = get_loggedin_user(); + $roles = get_entities_from_relationship("friend",$currentUser->guid,false,"user","",0,"",100); + if($roles){ + 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 != "" && $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, we\'ll help you find some.'; + ?> + + + + +</div> <div class="globeGroup col right" id="plotFeatured"> <h3 class="sec_header">Featured Huskers <span>PLOT</span></h3> diff --git a/plugins/globe/views/default/globe/globecontrol.js b/plugins/globe/views/default/globe/globecontrol.js index 32bdf94baa4c2554357ad035f3defe57a703808f..da7a1592e0cae72d84c3b77711b445f3c28c2eff 100644 --- a/plugins/globe/views/default/globe/globecontrol.js +++ b/plugins/globe/views/default/globe/globecontrol.js @@ -14,6 +14,8 @@ function startMap() { show('featured'); } else if(whatToShowOnMap = 'friends') { show('friends'); + } else if(whatToShowOnMap = 'role') { + show('role'); } else { //error } @@ -37,6 +39,18 @@ function show(type){ //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('fole');",1000); } else if(type=='featured'){ counterMax = husker.length; //put in the pins for featured huskers @@ -57,6 +71,17 @@ function show(type){ 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 == ''){ @@ -73,7 +98,7 @@ function displayPeople(type){ counter++; if(counter>=counterMax) counter=0; - setT=setTimeout("displayPeople('"+type+"')",6000); + setT=setTimeout("displayPeople('"+type+"')",5000); return false; }; @@ -125,6 +150,7 @@ WDN.jQuery(document).ready(function() { }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');}); });