aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2010-12-26 15:48:44 -0800
committerFriendika <info@friendika.com>2010-12-26 15:48:44 -0800
commit2abdfb462a34a5c469efe12243e2a91d3fa39a03 (patch)
tree4c661041f0c678738422f6ec88a98750f2d9f225 /boot.php
parente8a63b2abb24b06f4edf3be58ee07795159a1bb4 (diff)
downloadvolse-hubzilla-2abdfb462a34a5c469efe12243e2a91d3fa39a03.tar.gz
volse-hubzilla-2abdfb462a34a5c469efe12243e2a91d3fa39a03.tar.bz2
volse-hubzilla-2abdfb462a34a5c469efe12243e2a91d3fa39a03.zip
plugin changes to contact_block, also configurable limit
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/boot.php b/boot.php
index 7b7adba82..6565d40bd 100644
--- a/boot.php
+++ b/boot.php
@@ -1742,6 +1742,11 @@ if(! function_exists('contact_block')) {
function contact_block() {
$o = '';
$a = get_app();
+
+ $shown = get_pconfig($a->profile['uid'],'system','display_friend_count');
+ if(! $shown)
+ $shown = 24;
+
if((! is_array($a->profile)) || ($a->profile['hide-friends']))
return $o;
$r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0",
@@ -1754,8 +1759,9 @@ function contact_block() {
$o .= '<h4 class="contact-h4">' . t('No contacts') . '</h4>';
return $o;
}
- $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 ORDER BY RAND() LIMIT 24",
- intval($a->profile['uid'])
+ $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 ORDER BY RAND() LIMIT %d",
+ intval($a->profile['uid']),
+ intval($shown)
);
if(count($r)) {
$o .= '<h4 class="contact-h4">' . $total . ' ' . t('Contacts') . '</h4><div id="contact-block">';
@@ -1778,7 +1784,9 @@ function contact_block() {
}
- call_hooks('contact_block_end', $o);
+ $arr = array('contacts' => $r, 'output' => $o);
+
+ call_hooks('contact_block_end', $arr);
return $o;
}}