aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-03-06 19:24:01 -0800
committerFriendika <info@friendika.com>2011-03-06 19:24:01 -0800
commit7f1f18675cb545ff92f9a2dedf83ce9a8f0964b2 (patch)
treede0b15ae96a314d164e6fd03f712dbb1c73517b4 /boot.php
parentfecef140d5181348e1f46cf8405f13bb05401b3e (diff)
downloadvolse-hubzilla-7f1f18675cb545ff92f9a2dedf83ce9a8f0964b2.tar.gz
volse-hubzilla-7f1f18675cb545ff92f9a2dedf83ce9a8f0964b2.tar.bz2
volse-hubzilla-7f1f18675cb545ff92f9a2dedf83ce9a8f0964b2.zip
sparkle links for friends-of-friends, bug #13
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php26
1 files changed, 26 insertions, 0 deletions
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('&amp;', '&', $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