X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=boot.php;h=7dfaa021ee7743cb35df845166e938fa741b5c2e;hb=ff15ea099310bab5cdcaa724274f3ef22301fcb4;hp=1d7135b296c7a5879cf233e20dfeabf5255e27f1;hpb=d2b28206ceb093f908f131980f9a02adbce327d2;p=friendica.git diff --git a/boot.php b/boot.php index 1d7135b296..7dfaa021ee 100644 --- 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', "
\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) ? '' : ''); - $marital = ((x($profile,'marital') == 1) ? '
' . t('Status:') . ' ' . $profile['marital'] . '
' : ''); + $marital = ((x($profile,'marital') == 1) ? '
' . t('Status:') . ' ' . $profile['marital'] . '
' : ''); - $homepage = ((x($profile,'homepage') == 1) ? '
' . t('Homepage:') . ' ' . linkify($profile['homepage']) . '
' : ''); + $homepage = ((x($profile,'homepage') == 1) ? '
' . t('Homepage:') . ' ' . linkify($profile['homepage']) . '
' : ''); $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;