From b0d1b448211cd6616059de3a7d4889328c44710c Mon Sep 17 00:00:00 2001 From: Matthew Juhl <mjuhl24@gmail.com> Date: Wed, 9 Jun 2010 19:23:06 +0000 Subject: [PATCH] Refactor code that grabs 16 recently joined members for the map. --- .../customindex/views/default/customindex/content.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/customindex/views/default/customindex/content.php b/plugins/customindex/views/default/customindex/content.php index 27ebeb51..ecd1c3fc 100644 --- a/plugins/customindex/views/default/customindex/content.php +++ b/plugins/customindex/views/default/customindex/content.php @@ -141,15 +141,20 @@ </p> <!-- lat, lng, username, location, displayname, title, comment(text area) --> <?php - $options = array('metadata_names'=>'icontime', 'limit'=>16); + $options = array('metadata_names'=>'icontime', 'limit'=>150); $users = elgg_get_entities_from_metadata($options); + $map_count = 0; if($users){ foreach($users as $user){ + if ($map_count >= 16){ + break; + } if (filtrado($user->map_explanation . $user->profile_city . $user->username . $user->name)) { continue; } if($user->longitude != undefined && $user->longitude != "" && $user->map_explanation != undefined && $user->map_explanation != ""){ + $map_count++; echo "<div class=\"member_icon\"><img alt=\"Profile Pic\" 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 . "',"; @@ -162,7 +167,7 @@ echo "''"; echo ",'". str_replace("'","\'",htmlentities($user->map_explanation))."');return false;\" src=\"mod/profile/icon.php?username=" . $user->username . "&size=tiny\" /></div>"; } - else{} + } } ?> @@ -351,7 +356,6 @@ } ?> - </div> <div class="col right"> <h3 class="sec_main">Featured Huskers</h3> -- GitLab