]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
detect empty .htconfig.php - in case permissions need to be set on it in order to...
[friendica.git] / boot.php
index 4a0acef936bb4e848057dd43950b8be62c775525..d3380a395b6815e73ed826d6c7152d2c79bb4e07 100644 (file)
--- 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.0910' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.1'  );
 
 define ( 'EOL',                    "<br />\r\n"     );
@@ -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);
@@ -197,6 +199,7 @@ class App {
        public  $interactive = true;
        public  $plugins;
        public  $apps;
+       public  $identities;
 
        private $scheme;
        private $hostname;
@@ -1941,8 +1944,10 @@ function get_mentions($item) {
        $arr = explode(',',$item['tag']);
        foreach($arr as $x) {
                $matches = null;
-               if(preg_match('/@\[url=([^\]]*)\]/',$x,$matches))
+               if(preg_match('/@\[url=([^\]]*)\]/',$x,$matches)) {
                        $o .= "\t\t" . '<link rel="mentioned" href="' . $matches[1] . '" />' . "\r\n";
+                       $o .= "\t\t" . '<link rel="ostatus:attention" href="' . $matches[1] . '" />' . "\r\n";
+               }
        }
        return $o;
 }}
@@ -2414,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;
 }}
@@ -2581,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