Skip to content
Snippets Groups Projects
Commit b3f3225c authored by Eric Rasmussen's avatar Eric Rasmussen
Browse files

more work on globe plugin

parent 04963321
No related branches found
No related tags found
No related merge requests found
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
echo 'var whatToShowOnMap = "featured";'; echo 'var whatToShowOnMap = "featured";';
else if($_REQUEST['display'] == 'friends') else if($_REQUEST['display'] == 'friends')
echo 'var whatToShowOnMap = "friends";'; echo 'var whatToShowOnMap = "friends";';
else if($_REQUEST['display'] == 'role')
echo 'var whatToShowOnMap = "role";';
else else
echo 'var whatToShowOnMap = "featured";'; echo 'var whatToShowOnMap = "featured";';
?> ?>
...@@ -41,6 +43,7 @@ ...@@ -41,6 +43,7 @@
?> ?>
<span class="youLarge">You:</span> <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 . "',"; <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) if($me->profile_country)
echo "'" . $me->profile_country . " - " . str_replace("'","\'",htmlentities($me->profile_city)) . ", " . $me->profile_state . "',"; echo "'" . $me->profile_country . " - " . str_replace("'","\'",htmlentities($me->profile_city)) . ", " . $me->profile_state . "',";
...@@ -52,10 +55,18 @@ ...@@ -52,10 +55,18 @@
else else
echo "''"; echo "''";
echo ",'". str_replace("'","\'",htmlentities($me->map_explanation))."'"?>)" /> 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="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 ?> &nbsp;&nbsp;&nbsp; Longitude: <?php echo $me->longitude ?></span> <span class="latlngMe">Latitude: <?php echo $me->latitude ?> &nbsp;&nbsp;&nbsp; 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 }?>
<div class="clear"></div> <div class="clear"></div>
<?php <?php
...@@ -81,10 +92,10 @@ ...@@ -81,10 +92,10 @@
?> ?>
<script type="text/javascript"> <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', friend[<?php echo $fc ?>]=new person('<?php echo $user->longitude ?>','<?php echo $user->latitude ?>','<?php echo $user->username ?>',
'Andrew H. Woods Chair of Psychiatry and Director of its Neuroimaging Research Center', '<?php echo $user->profile_country . " - " . str_replace("'","\'",htmlentities($user->profile_city)) . ", " . $user->profile_state ?>','<?php echo str_replace("'","\'",htmlentities($user->name)) ?>',
'Nancy Andreasen\'s Breakthrough Research Changed The Way Modern Science Understands Schizophrenia.', '<?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;?>',
'Nancy_Andreasen'); '<?php echo str_replace("'","\'",htmlentities($user->map_explanation)) ?>');
</script> </script>
<?php <?php
$fc++; $fc++;
...@@ -102,7 +113,7 @@ ...@@ -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>"; echo ",'". str_replace("'","\'",htmlentities($user->map_explanation))."');return false;\" src=\"".$CONFIG->url."mod/profile/icon.php?username=" . $user->username . "&size=tiny\" /></div>";
} }
else{ 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 @@ ...@@ -112,10 +123,76 @@
</div> </div>
<!--
<div class="globeGroup col middle" id="plotGroups"> <div class="globeGroup col middle" id="plotGroups">
<h3 class="sec_header">Your Groups</h3></div> <h3 class="sec_header">Your Groups</h3></div>
<div class="globeGroup col middle" id="plotRoles"> -->
<h3 class="sec_header">Other &lt;Roles&gt;</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"> <div class="globeGroup col right" id="plotFeatured">
<h3 class="sec_header">Featured Huskers <span>PLOT</span></h3> <h3 class="sec_header">Featured Huskers <span>PLOT</span></h3>
......
...@@ -14,6 +14,8 @@ function startMap() { ...@@ -14,6 +14,8 @@ function startMap() {
show('featured'); show('featured');
} else if(whatToShowOnMap = 'friends') { } else if(whatToShowOnMap = 'friends') {
show('friends'); show('friends');
} else if(whatToShowOnMap = 'role') {
show('role');
} else { } else {
//error //error
} }
...@@ -37,6 +39,18 @@ function show(type){ ...@@ -37,6 +39,18 @@ function show(type){
//auto fill the globe with featured huskers //auto fill the globe with featured huskers
counter=0; counter=0;
setTimeout("displayPeople('friends');",1000); 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'){ } else if(type=='featured'){
counterMax = husker.length; counterMax = husker.length;
//put in the pins for featured huskers //put in the pins for featured huskers
...@@ -57,6 +71,17 @@ function show(type){ ...@@ -57,6 +71,17 @@ function show(type){
function displayPeople(type){ function displayPeople(type){
if(type=='featured') if(type=='featured')
p = husker[counter]; 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'){ else if(type=='friends'){
p = friend[counter]; p = friend[counter];
if(p.lng == ''){ if(p.lng == ''){
...@@ -73,7 +98,7 @@ function displayPeople(type){ ...@@ -73,7 +98,7 @@ function displayPeople(type){
counter++; counter++;
if(counter>=counterMax) if(counter>=counterMax)
counter=0; counter=0;
setT=setTimeout("displayPeople('"+type+"')",6000); setT=setTimeout("displayPeople('"+type+"')",5000);
return false; return false;
}; };
...@@ -125,6 +150,7 @@ WDN.jQuery(document).ready(function() { ...@@ -125,6 +150,7 @@ WDN.jQuery(document).ready(function() {
}catch(e){} }catch(e){}
WDN.jQuery('#plotFriends h3 span').click(function(){show('friends');}); 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');}); WDN.jQuery('#plotFeatured h3 span').click(function(){show('featured');});
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment