aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/default/tidypics/tagging.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/views/default/tidypics/tagging.php b/views/default/tidypics/tagging.php
index eb5f7e208..513845e32 100644
--- a/views/default/tidypics/tagging.php
+++ b/views/default/tidypics/tagging.php
@@ -30,7 +30,14 @@
<?php
if($viewer) {
- $friends = get_entities_from_relationship('friend', $viewer->getGUID(), false, 'user', '', 0);
+ $friends = get_entities_from_relationship('friend', $viewer->getGUID(), false, 'user', '', 0, 'time_created desc', 1000);
+
+ if ($friends) {
+ foreach($friends as $friend) {
+ $friend_array[$friend->name] = $friend->getGUID();
+ }
+ }
+ ksort($friend_array);
$content = "<input type='hidden' name='image_guid' value='{$file_guid}' />";
$content .= "<input type='hidden' name='coordinates' id='coordinates' value='' />";
@@ -41,8 +48,8 @@
$content .= "<li><a href='javascript:void(0)' onclick='selectUser({$viewer->getGUID()},\"{$viewer->name}\")'> {$viewer->name} (" . elgg_echo('me') . ")</a></li>";
if ($friends) {
- foreach($friends as $friend) {
- $content .= "<li><a href='javascript:void(0)' onclick='selectUser({$friend->getGUID()}, \"{$friend->name}\")'>{$friend->name}</a></li>";
+ foreach($friend_array as $friend_name => $friend_guid) {
+ $content .= "<li><a href='javascript:void(0)' onclick='selectUser({$friend_guid}, \"{$friend_name}\")'>{$friend_name}</a></li>";
}
}
}