aboutsummaryrefslogtreecommitdiffstats
path: root/include/Contact.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-02-20 17:20:24 -0800
committerfriendica <info@friendica.com>2014-02-20 17:20:24 -0800
commite12f6f1bd93bb42bf0fe9fc9d9a1ff08cd162a0d (patch)
tree6b3736b42759800b585e733c37bd7e4633fd8605 /include/Contact.php
parent057e6660ca6d7eadb2119b2467191510b916c04c (diff)
downloadvolse-hubzilla-e12f6f1bd93bb42bf0fe9fc9d9a1ff08cd162a0d.tar.gz
volse-hubzilla-e12f6f1bd93bb42bf0fe9fc9d9a1ff08cd162a0d.tar.bz2
volse-hubzilla-e12f6f1bd93bb42bf0fe9fc9d9a1ff08cd162a0d.zip
small changes to a couple of lookup functions which we need to use a bit more
Diffstat (limited to 'include/Contact.php')
-rw-r--r--include/Contact.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/Contact.php b/include/Contact.php
index 09f7925cb..9883c598d 100644
--- a/include/Contact.php
+++ b/include/Contact.php
@@ -52,24 +52,27 @@ function abook_self($channel_id) {
}
function channelx_by_nick($nick) {
- return q("SELECT * FROM channel left join xchan on channel_hash = xchan_hash WHERE channel_address = '%s' and not ( channel_pageflags & %d ) LIMIT 1",
+ $r = q("SELECT * FROM channel left join xchan on channel_hash = xchan_hash WHERE channel_address = '%s' and not ( channel_pageflags & %d ) LIMIT 1",
dbesc($nick),
intval(PAGE_REMOVED)
);
+ return(($r) ? $r[0] : false);
}
function channelx_by_hash($hash) {
- return q("SELECT * FROM channel left join xchan on channel_hash = xchan_hash WHERE channel_hash = '%s' and not ( channel_pageflags & %d ) LIMIT 1",
+ $r = q("SELECT * FROM channel left join xchan on channel_hash = xchan_hash WHERE channel_hash = '%s' and not ( channel_pageflags & %d ) LIMIT 1",
dbesc($hash),
intval(PAGE_REMOVED)
);
+ return(($r) ? $r[0] : false);
}
function channelx_by_n($id) {
- return q("SELECT * FROM channel left join xchan on channel_hash = xchan_hash WHERE channel_id = %d and not ( channel_pageflags & %d ) LIMIT 1",
+ $r = q("SELECT * FROM channel left join xchan on channel_hash = xchan_hash WHERE channel_id = %d and not ( channel_pageflags & %d ) LIMIT 1",
dbesc($id),
intval(PAGE_REMOVED)
);
+ return(($r) ? $r[0] : false);
}