]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
wrong variable passed
[friendica.git] / boot.php
index 1d7135b296c7a5879cf233e20dfeabf5255e27f1..7dfaa021ee7743cb35df845166e938fa741b5c2e 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -2,9 +2,9 @@
 
 set_time_limit(0);
 
-define ( 'FRIENDIKA_VERSION',      '2.1.940' );
-define ( 'DFRN_PROTOCOL_VERSION',  '2.2'  );
-define ( 'DB_UPDATE_VERSION',      1046   );
+define ( 'FRIENDIKA_VERSION',      '2.1.946' );
+define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
+define ( 'DB_UPDATE_VERSION',      1048      );
 
 define ( 'EOL',                    "<br />\r\n"     );
 define ( 'ATOM_TIME',              'Y-m-d\TH:i:s\Z' );
@@ -73,6 +73,18 @@ define ( 'PAGE_SOAPBOX',           1 );
 define ( 'PAGE_COMMUNITY',         2 );
 define ( 'PAGE_FREELOVE',          3 );
 
+/**
+ * Network and protocol family types 
+ */
+
+define ( 'NETWORK_DFRN',             'dfrn');    // Friendika, Mistpark, other DFRN implementations
+define ( 'NETWORK_OSTATUS',          'stat');    // status.net, identi.ca, GNU-social, other OStatus implementations
+define ( 'NETWORK_FEED',             'feed');    // RSS/Atom feeds with no known "post/notify" protocol
+define ( 'NETWORK_DIASPORA',         'dspr');    // Diaspora
+define ( 'NETWORK_MAIL',             'mail');    // IMAP/POP
+define ( 'NETWORK_FACEBOOK',         'face');    // Facebook API     
+
+
 /**
  * Maximum number of "people who like (or don't like) this"  that we will list by name
  */
@@ -437,15 +449,18 @@ function check_config(&$a) {
 
        load_config('system');
 
-       if(! x($_SERVER,'SERVER_NAME'))
-               return;
-
        $build = get_config('system','build');
        if(! x($build))
                $build = set_config('system','build',DB_UPDATE_VERSION);
 
        $url = get_config('system','url');
-       if(! x($url))
+
+       // if the url isn't set or the stored url is radically different 
+       // than the currently visited url, store the current value accordingly.
+       // "Radically different" ignores common variations such as http vs https 
+       // and www.example.com vs example.com.
+
+       if((! x($url)) || (! link_compare($url,$a->get_baseurl())))
                $url = set_config('system','url',$a->get_baseurl());
 
        if($build != DB_UPDATE_VERSION) {
@@ -2298,9 +2313,9 @@ function profile_sidebar($profile) {
 
        $pubkey = ((x($profile,'pubkey') == 1) ? '<div class="key" style="display:none;">' . $profile['pubkey'] . '</div>' : '');
 
-       $marital = ((x($profile,'marital') == 1) ? '<div class="marital"><span class="marital-label"><span class="heart">&hearts;</span> ' . t('Status:') . ' </span><span class="marital-text">' . $profile['marital'] . '</span></div></div><div class="profile-clear"></div>' : '');
+       $marital = ((x($profile,'marital') == 1) ? '<div class="marital"><span class="marital-label"><span class="heart">&hearts;</span> ' . t('Status:') . ' </span><span class="marital-text">' . $profile['marital'] . '</span></div><div class="profile-clear"></div>' : '');
 
-       $homepage = ((x($profile,'homepage') == 1) ? '<div class="homepage"><span class="homepage-label">' . t('Homepage:') . ' </span><span class="homepage-url">' . linkify($profile['homepage']) . '</span></div></div><div class="profile-clear"></div>' : '');
+       $homepage = ((x($profile,'homepage') == 1) ? '<div class="homepage"><span class="homepage-label">' . t('Homepage:') . ' </span><span class="homepage-url">' . linkify($profile['homepage']) . '</span></div><div class="profile-clear"></div>' : '');
 
        $tpl = load_view_file('view/profile_vcard.tpl');
 
@@ -2659,14 +2674,19 @@ function extract_item_authors($arr,$uid) {
 
        // 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 ",
+               $r = q("SELECT `id`,`network`,`url` FROM `contact` WHERE `uid` = %d AND `url` IN ( %s )  AND `self` = 0 AND `blocked` = 0 ",
                        intval($uid),
                        implode(',',$urls)
                );
                if(count($r)) {
                        $ret = array();
-                       foreach($r as $rr)
-                               $ret[$rr['url']] = $rr['id'];
+                       $authors = array();
+                       foreach($r as $rr){
+                               if ($rr['network']=='dfrn')
+                                       $ret[$rr['url']] = $rr['id'];
+                               $authors[$r['url']]= $rr;
+                       }
+                       $a->authors = $authors;
                        return $ret;
                }
        }
@@ -2678,7 +2698,7 @@ function item_photo_menu($item){
        $a = get_app();
        
        if (!isset($a->authors)){
-               $rr = q("SELECT id, network, url FROM contact WHERE uid=%d AND self!=1", intval(local_user()));
+               $rr = q("SELECT `id`, `network`, `url` FROM `contact` WHERE `uid`=%d AND `self`=0 AND `blocked`=0 ", intval(local_user()));
                $authors = array();
                foreach($rr as $r) $authors[$r['url']]= $r;
                $a->authors = $authors;