aboutsummaryrefslogtreecommitdiffstats
path: root/mod/ratings.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-02-03 22:55:01 -0800
committerfriendica <info@friendica.com>2015-02-03 22:55:01 -0800
commit0cc29af6d0c305efa35fbe3b0c7bc314f21b4166 (patch)
tree73577a93b6987b539d70cbc46ad6da146e99b19d /mod/ratings.php
parent4ead2cd79d3c7e5c29a11785a3ceefef6d3ba93f (diff)
downloadvolse-hubzilla-0cc29af6d0c305efa35fbe3b0c7bc314f21b4166.tar.gz
volse-hubzilla-0cc29af6d0c305efa35fbe3b0c7bc314f21b4166.tar.bz2
volse-hubzilla-0cc29af6d0c305efa35fbe3b0c7bc314f21b4166.zip
order ratings friends first
Diffstat (limited to 'mod/ratings.php')
-rw-r--r--mod/ratings.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/mod/ratings.php b/mod/ratings.php
index 4b94f0e52..66392fe2b 100644
--- a/mod/ratings.php
+++ b/mod/ratings.php
@@ -8,6 +8,9 @@ function ratings_init(&$a) {
return;
}
+ if(local_channel())
+ load_contact_links(local_channel());
+
$dirmode = intval(get_config('system','directory_mode'));
$x = find_upstream_directory($dirmode);
@@ -46,7 +49,20 @@ function ratings_init(&$a) {
}
$a->poi = $results['target'];
- $a->data = $results['ratings'];
+
+ $friends = array();
+ $others = array();
+
+ if($results['ratings']) {
+ foreach($results['ratings'] as $n) {
+ if(array_key_exists($n['xchan_hash'],$a->contacts))
+ $friends[] = $n;
+ else
+ $others[] = $n;
+ }
+ }
+
+ $a->data = array_merge($friends,$others);
if(! $a->data) {
notice( t('No ratings') . EOL);