X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=boot.php;h=197b6d2381c98c9dd8927379f068d138f05b67c2;hb=0b4a6f8eaca0d1396e7e944cd4735a573bd1d111;hp=c34002809393e79e1fe51a54ddc71241cfc19d48;hpb=6f8c4169e57188093b3d2ce6d0e66f1364b5a5fb;p=friendica.git diff --git a/boot.php b/boot.php index c340028093..197b6d2381 100644 --- a/boot.php +++ b/boot.php @@ -2,7 +2,7 @@ set_time_limit(0); -define ( 'BUILD_ID', 1029 ); +define ( 'BUILD_ID', 1030 ); define ( 'DFRN_PROTOCOL_VERSION', '2.0' ); define ( 'EOL', "
\r\n" ); @@ -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 .= '

' . t('No contacts') . '

'; 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 .= '

' . $total . ' ' . t('Contacts') . '

'; @@ -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; }} @@ -2047,7 +2055,7 @@ function profile_sidebar($profile) { if(! function_exists('register_hook')) { function register_hook($hook,$file,$function) { - $r = q("SELECT FROM `hook` WHERE `hook` = '%s' AND `file` = '%s' AND `function` = '%s' LIMIT 1", + $r = q("SELECT * FROM `hook` WHERE `hook` = '%s' AND `file` = '%s' AND `function` = '%s' LIMIT 1", dbesc($hook), dbesc($file), dbesc($function)