From 7f1f18675cb545ff92f9a2dedf83ce9a8f0964b2 Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 6 Mar 2011 19:24:01 -0800 Subject: sparkle links for friends-of-friends, bug #13 --- boot.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'boot.php') diff --git a/boot.php b/boot.php index ed7c9956c..6bd78b87d 100644 --- a/boot.php +++ b/boot.php @@ -2591,3 +2591,29 @@ function unamp($s) { return str_replace('&', '&', $s); }} +if(! function_exists('extract_item_authors')) { +function extract_item_authors($arr,$uid) { + + if((! $uid) || (! is_array($arr)) || (! count($arr))) + return array(); + $urls = array(); + foreach($arr as $rr) { + if(! in_array("'" . dbesc($rr['author-link']) . "'",$urls)) + $urls[] = "'" . dbesc($rr['author-link']) . "'"; + } + + // pre-quoted, don't put quotes on %s + if(count($urls)) { + $r = q("SELECT `id`,`url` FROM `contact` WHERE `uid` = %d AND `url` IN ( %s ) AND `network` = 'dfrn' AND `self` = 0 AND `blocked` = 0 ", + intval($uid), + implode(',',$urls) + ); + if(count($r)) { + $ret = array(); + foreach($r as $rr) + $ret[$rr['url']] = $rr['id']; + return $ret; + } + } + return array(); +}} \ No newline at end of file -- cgit v1.2.3