From 1f178c6f2becfd5d735c20fcdd5eeabaeec67dd1 Mon Sep 17 00:00:00 2001
From: Eric Rasmussen <erasmussen2@unl.edu>
Date: Fri, 18 Sep 2009 13:33:49 +0000
Subject: [PATCH] friends can now be plotted
---
plugins/globe/views/default/globe/content.php | 104 ++++++++++--------
plugins/globe/views/default/globe/css.php | 10 +-
.../globe/views/default/globe/globecontrol.js | 62 +++++++++--
3 files changed, 120 insertions(+), 56 deletions(-)
diff --git a/plugins/globe/views/default/globe/content.php b/plugins/globe/views/default/globe/content.php
index d5ae7233..e3079c8b 100644
--- a/plugins/globe/views/default/globe/content.php
+++ b/plugins/globe/views/default/globe/content.php
@@ -27,14 +27,13 @@
<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 id="plotMe">
+<div class="globeGroup" id="plotMe">
<?php
if (isloggedin()) {
$me = get_user($_SESSION['user']->guid);
@@ -67,17 +66,28 @@
<div class="clear"></div>
-<div class="col left" id="plotFriends">
-
+<div class="globeGroup col left" id="plotFriends">
- <h3 class="sec_header">Your Friends</h3>
+ <h3 class="sec_header">Your Friends <span>PLOT</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 ?>','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');
+ </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)
@@ -92,7 +102,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\"><img src=\"".$CONFIG->url."mod/profile/icon.php?username=" . $user->username . "&size=tiny\" /></div>";
+ echo "<div class=\"member_icon\" style=\"cursor:default !important;\"><img src=\"".$CONFIG->url."mod/profile/icon.php?username=" . $user->username . "&size=tiny\" /></div>";
}
}
}
@@ -102,134 +112,134 @@
</div>
-<div class="col middle" id="plotGroups">
+<div class="globeGroup col middle" id="plotGroups">
<h3 class="sec_header">Your Groups</h3></div>
-<div class="col middle" id="plotRoles">
+<div class="globeGroup col middle" id="plotRoles">
<h3 class="sec_header">Other <Roles></h3></div>
-<div class="col right" id="plotXXX">
- <h3 class="sec_header">Featured Huskers</h3>
+<div class="globeGroup col right" id="plotFeatured">
+ <h3 class="sec_header">Featured Huskers <span>PLOT</span></h3>
<!-- row 1 -->
<div class="member_icon">
- <img onclick="displayNancyAndreasen();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Nancy_Andreasen_tiny.jpg" alt="Profile 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="displayAtorodAzizinamini();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Atorod_Azizinamini_tiny.jpg" alt="Profile 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="displayClaudeMBoltonJr();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Claude-M_Bolton-Jr_tiny.jpg" alt="Profile 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="displayWarrenBuffett();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Warren_Buffett_tiny.jpg" alt="Profile 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="displayAnnChangBarnes();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Ann_Chang-Barnes_tiny.jpg" alt="Profile 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="displayBingChen();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Bing_Chen_tiny.jpg" alt="Profile 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="displayXunHongChen();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Xun-Hong_Chen_tiny.jpg" alt="Profile 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="displayGranvilleCoggs();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Granville_Coggs_tiny.jpg" alt="Profile 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="displayDrLTreyColeman();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Dr-L-Trey_Coleman_tiny.jpg" alt="Profile 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="displayPamDingman();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Pam_Dingman_tiny.jpg" alt="Profile 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="displayChristopherElbow();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Christopher_Elbow_tiny.jpg" alt="Profile 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="displayShaneFarritor();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Shane_Farritor_tiny.jpg" alt="Profile 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="displaySheriFritz();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Sheri_Fritz_tiny.jpg" alt="Profile 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="displayRulonGardner();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Rulon_Gardner_tiny.jpg" alt="Profile 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="displayDavidHarwood();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/David_Harwood_tiny.jpg" alt="Profile 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="displayJohnHoerner();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/John_Hoerner_tiny.jpg" alt="Profile 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="displayMichaelHoff();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Michael_Hoff_tiny.jpg" alt="Profile 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="displayJohnJanovyJr();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/John_Janovy-Jr_tiny.jpg" alt="Profile 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="displayJayKeasling();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Jay_Keasling_tiny.jpg" alt="Profile 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="displayScottKillinger();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Scott_Killinger_tiny.jpg" alt="Profile 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="displayKarenKunc();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Karen_Kunc_tiny.jpg" alt="Profile 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="displayNithalKuwa();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Nithal_Kuwa_tiny.jpg" alt="Profile 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="displayCindyMcCaffrey();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Cindy_McCaffrey_tiny.jpg" alt="Profile 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="displayBetsyOBrien();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Betsy_O'Brien_tiny.jpg" alt="Profile 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="displayJuanitaPage();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Juanita_Page_tiny.jpg" alt="Profile 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="displayLarkinPowell();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Larkin_Powell_tiny.jpg" alt="Profile 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="displayJeffreyRaikes();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Jeffrey_Raikes_tiny.jpg" alt="Profile 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="displayBrettRatcliffe();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Brett_Ratcliffe_tiny.jpg" alt="Profile 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="displayJorgeAlbertoRodriguez();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Jorge-Alberto_Rodriguez_tiny.jpg" alt="Profile 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="displayAverySchwer();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Avery_Schwer_tiny.jpg" alt="Profile 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="displayTedSorensen();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Ted_Sorensen_tiny.jpg" alt="Profile 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="displayBobThacker();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Bob_Thacker_tiny.jpg" alt="Profile 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="displayKenVogel();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Ken_Vogel_tiny.jpg" alt="Profile 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="displaySidnieWhiteCrawford();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Sidnie_White-Crawford_tiny.jpg" alt="Profile 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="displayCharlesWood();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Charles_Wood_tiny.jpg" alt="Profile 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="displayJohnYohe();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/John_Yohe_tiny.jpg" alt="Profile 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="displayTrischaZornHudson();" src="<?php echo $CONFIG->url ?>mod/customindex/witw_icons/Trischa_Zorn-Hudson_tiny.jpg" alt="Profile 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>
diff --git a/plugins/globe/views/default/globe/css.php b/plugins/globe/views/default/globe/css.php
index b2b18a8c..41ec6444 100644
--- a/plugins/globe/views/default/globe/css.php
+++ b/plugins/globe/views/default/globe/css.php
@@ -12,6 +12,8 @@
?>
+/* You Icon
+*************/
#plotMe {
background:#eeeeee;
margin:10px 0;
@@ -24,7 +26,7 @@ span.youLarge{
font-size:18pt;
padding:20px 10px 0 0;
position:relative;
- bottom:10px;
+ bottom:15px;
}
span.locationMe{
font-size:14pt;
@@ -39,9 +41,13 @@ span.latlngMe{
#YourselfOnTheMap{
margin-right:30px;
cursor:pointer;
+ border:1px solid #ddd !important;
+ padding:1px;
}
-div.member_icon {
+/* Tiny Icons
+***************/
+div.globeGroup div.member_icon {
margin:0 0 4px 2px;
border:1px solid #eee;
padding:1px;
diff --git a/plugins/globe/views/default/globe/globecontrol.js b/plugins/globe/views/default/globe/globecontrol.js
index 5964ca69..32bdf94b 100644
--- a/plugins/globe/views/default/globe/globecontrol.js
+++ b/plugins/globe/views/default/globe/globecontrol.js
@@ -1,8 +1,7 @@
<!-- begin poly9 globe js -->
var setT;
var counter=0;
-//number of featured huskers
-var counterMax=36;
+var counterMax;
function startMap() {
//turn off the overlay
@@ -12,6 +11,34 @@ function startMap() {
if(whatToShowOnMap = 'featured') {
+ show('featured');
+ } else if(whatToShowOnMap = 'friends') {
+ show('friends');
+ } 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=='featured'){
+ counterMax = husker.length;
//put in the pins for featured huskers
for(counter=0;counter<counterMax;counter++){
per = husker[counter];
@@ -20,18 +47,38 @@ function startMap() {
//auto fill the globe with featured huskers
counter=Math.floor(Math.random()*counterMax);
- setTimeout("displayFeatured();",1000);
+ setTimeout("displayPeople('featured');",1000);
+ } else {
+ //error
}
+
};
-function displayFeatured(){
- p = husker[counter];
+function displayPeople(type){
+ if(type=='featured')
+ p = husker[counter];
+ 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);
counter++;
if(counter>=counterMax)
counter=0;
- setT=setTimeout("displayFeatured()",6000);
+ setT=setTimeout("displayPeople('"+type+"')",6000);
+ 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) {
@@ -77,7 +124,8 @@ WDN.jQuery(document).ready(function() {
map1.load();
}catch(e){}
- //WDN.jQuery('#globeInner').height(501);
+ WDN.jQuery('#plotFriends h3 span').click(function(){show('friends');});
+ WDN.jQuery('#plotFeatured h3 span').click(function(){show('featured');});
});
--
GitLab