aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-03-16 17:08:50 -0700
committerfriendica <info@friendica.com>2015-03-16 17:08:50 -0700
commit178b768e3ce43f3c75abec1540fcdc909c8c2197 (patch)
treeb8e53da8fae91ae135a763365340ad08d9eb91d2 /include
parentccf4734f7bb525ae6b1ebe63e3a2b6b00c4f823b (diff)
downloadvolse-hubzilla-178b768e3ce43f3c75abec1540fcdc909c8c2197.tar.gz
volse-hubzilla-178b768e3ce43f3c75abec1540fcdc909c8c2197.tar.bz2
volse-hubzilla-178b768e3ce43f3c75abec1540fcdc909c8c2197.zip
openid cleanup
Diffstat (limited to 'include')
-rw-r--r--include/text.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/include/text.php b/include/text.php
index 4c64c71bb..7468a3622 100644
--- a/include/text.php
+++ b/include/text.php
@@ -736,7 +736,7 @@ function contact_block() {
if((! is_array($a->profile)) || ($a->profile['hide_friends']))
return $o;
- $r = q("SELECT COUNT(abook_id) AS total FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d and not ( abook_flags & %d )>0 and not (xchan_flags & %d)>0",
+ $r = q("SELECT COUNT(abook_id) AS total FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d and ( abook_flags & %d ) = 0 and ( xchan_flags & %d ) = 0",
intval($a->profile['uid']),
intval($abook_flags),
intval($xchan_flags)
@@ -748,12 +748,10 @@ function contact_block() {
$contacts = t('No connections');
$micropro = null;
} else {
- if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
- $randfunc = 'RANDOM()';
- } else {
- $randfunc = 'RAND()';
- }
- $r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash WHERE abook_channel = %d AND not ( abook_flags & %d)>0 and not (xchan_flags & %d )>0 ORDER BY $randfunc LIMIT %d",
+
+ $randfunc = db_getfunc('RAND');
+
+ $r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash WHERE abook_channel = %d AND ( abook_flags & %d ) = 0 and ( xchan_flags & %d ) = 0 ORDER BY $randfunc LIMIT %d",
intval($a->profile['uid']),
intval($abook_flags|ABOOK_FLAG_ARCHIVED),
intval($xchan_flags),