From b8757fb45624d038e1f072fa40fb439608532164 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 3 Mar 2011 15:41:08 -0800 Subject: make sure db queries never get called if the database isn't open --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 3cf01b4a0..a97f85814 100644 --- a/boot.php +++ b/boot.php @@ -3,7 +3,7 @@ set_time_limit(0); define ( 'BUILD_ID', 1039 ); -define ( 'FRIENDIKA_VERSION', '2.10.0908' ); +define ( 'FRIENDIKA_VERSION', '2.10.0909' ); define ( 'DFRN_PROTOCOL_VERSION', '2.1' ); define ( 'EOL', "
\r\n" ); -- cgit v1.2.3 From 3c076b53fe0fb3d5e625b773a5e4723dece0a057 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 3 Mar 2011 23:13:16 -0800 Subject: use prepare_text instead of prepare_body --- boot.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index a97f85814..ed7c9956c 100644 --- a/boot.php +++ b/boot.php @@ -40,6 +40,8 @@ define ( 'REGISTER_OPEN', 2 ); /** * relationship types + * When used in contact records, this indicates that 'uid' has + * this relationship with contact['name'] */ define ( 'REL_VIP', 1); @@ -2417,10 +2419,15 @@ function link_compare($a,$b) { if(! function_exists('prepare_body')) { function prepare_body($item) { + return prepare_text($item['body']); +}} + +if(! function_exists('prepare_text')) { +function prepare_text($text) { require_once('include/bbcode.php'); - $s = smilies(bbcode($item['body'])); + $s = smilies(bbcode($text)); return $s; }} -- cgit v1.2.3 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