diff --git a/README b/README index b687f4a66d019fe7e07b0ac3a6a990c28f4c5b81..ce316d37af6e8466dd538e96363f1d4537ebd516 100644 --- a/README +++ b/README @@ -40,4 +40,17 @@ http://ucommjuhl.unl.edu/UNL_Elgg/elgg, change it!) ******* ** Changes made to the Elgg engine for UNL's implementation (changes made inside the elgg directory) ******* --Altered /elgg/engine/lib/users.php to bar registration of accounts starting with "unl_" \ No newline at end of file +-Altered /elgg/engine/lib/users.php to bar registration of accounts starting with "unl_" + + +******* +** Plugin info +******* + +These are plugins that are included in trunk/UNL_Elgg that must be copied or sym linked to the elgg/mod directory + + flexprofile_mj (doesn't seem to work with a sym link, must be copied. not sure why.) + cas_auth + unl_theme + customindex + form \ No newline at end of file diff --git a/scripts/latlon.php b/scripts/latlon.php index f4f56d3602cc8eebc2409d471e7f674f32ccbbef..80d46cf1c34826f6c0456e6fecadde6f70808967 100644 --- a/scripts/latlon.php +++ b/scripts/latlon.php @@ -24,4 +24,4 @@ $result = $resultset[Result]; $Latitude = $result[Latitude]; $Longitude = $result[Longitude]; -echo "Latitude: " . $Latitude . " Longitude: " . $Longitude; \ No newline at end of file +echo "({'latitude': '" . $Latitude . "', 'longitude': '" . $Longitude . "'})" ; \ No newline at end of file diff --git a/unl_theme/views/default/page_elements/header.php b/unl_theme/views/default/page_elements/header.php index 20fc0574c5ef5bff9d42f615b04fdaa01831ee86..1b9a7ebb6b4219b4ee0cec213654e8c238f3f5f3 100644 --- a/unl_theme/views/default/page_elements/header.php +++ b/unl_theme/views/default/page_elements/header.php @@ -46,4 +46,28 @@ if (isset($pickerinuse) && $pickerinuse == true) { ?> <?php echo $feedref; echo elgg_view('metatags',$vars); -?> \ No newline at end of file +?> +<script type="text/javascript"> +(function($){ + // Edit Profile Stuff + function updateLL () { + var city = $("input[name=form_data_profile_city]").val(), state = $("input[name=form_data_profile_state]").val(), country = $("input[name=form_data_profile_country]").val(); + $.get("/UNL_Elgg/scripts/latlon.php",{city:city,state:state,country:country},function(response){ + try { + var data = eval(response); + $("input[name=form_data_latitude]").val(data.latitude); + $("input[name=form_data_longitude]").val(data.longitude); + } catch (e) {} + }); + }; + + $(document).ready(function(){ + // don't display the latitude/longitude fields + $("input[name=form_data_latitude],input[name=form_data_longitude]").parent().hide(); + // update the lat/long automatically whenever current location is changed + $("input[name=form_data_profile_city],input[name=form_data_profile_state],input[name=form_data_profile_country]").change(function(){ + updateLL(); + }); + }); +})(jQuery); +</script> \ No newline at end of file