mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-17 04:45:16 +02:00
sparkle links for friends-of-friends, bug #13
This commit is contained in:
parent
fecef140d5
commit
7f1f18675c
2 changed files with 51 additions and 28 deletions
26
boot.php
26
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();
|
||||
}}
|
Loading…
Add table
Add a link
Reference in a new issue