X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=boot.php;h=65a1b8229d76eebc1c1142e490da7a905c59c1ad;hb=6ff221d5a16ed9ca18a3fe8399b1588d5234fcc5;hp=ca00a485be1efb61ad40fa0b9896240a103cbb45;hpb=4846d114a84b0c7da64501ea89a635d24e403a1d;p=friendica.git diff --git a/boot.php b/boot.php index ca00a485be..65a1b8229d 100644 --- a/boot.php +++ b/boot.php @@ -5,11 +5,12 @@ require_once('include/network.php'); require_once('include/plugin.php'); require_once('include/text.php'); require_once("include/pgettext.php"); +require_once('include/nav.php'); - -define ( 'FRIENDIKA_VERSION', '2.3.1114' ); +define ( 'FRIENDIKA_PLATFORM', 'Free Friendika'); +define ( 'FRIENDIKA_VERSION', '2.3.1124' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); -define ( 'DB_UPDATE_VERSION', 1092 ); +define ( 'DB_UPDATE_VERSION', 1094 ); define ( 'EOL', "
\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); @@ -151,6 +152,8 @@ define ( 'ACTIVITY_DISLIKE', NAMESPACE_DFRN . '/dislike' ); define ( 'ACTIVITY_OBJ_HEART', NAMESPACE_DFRN . '/heart' ); define ( 'ACTIVITY_FRIEND', NAMESPACE_ACTIVITY_SCHEMA . 'make-friend' ); +define ( 'ACTIVITY_REQ_FRIEND', NAMESPACE_ACTIVITY_SCHEMA . 'request-friend' ); +define ( 'ACTIVITY_UNFRIEND', NAMESPACE_ACTIVITY_SCHEMA . 'remove-friend' ); define ( 'ACTIVITY_FOLLOW', NAMESPACE_ACTIVITY_SCHEMA . 'follow' ); define ( 'ACTIVITY_UNFOLLOW', NAMESPACE_ACTIVITY_SCHEMA . 'stop-following' ); define ( 'ACTIVITY_POST', NAMESPACE_ACTIVITY_SCHEMA . 'post' ); @@ -248,7 +251,7 @@ class App { public $timezone; public $interactive = true; public $plugins; - public $apps; + public $apps = Array(); public $identities; private $scheme; @@ -723,14 +726,16 @@ function remote_user() { if(! function_exists('notice')) { function notice($s) { $a = get_app(); + if(! x($_SESSION,'sysmsg')) $_SESSION['sysmsg'] = array(); if($a->interactive) - $_SESSION['sysmsg'] .= $s; + $_SESSION['sysmsg'][] = $s; }} if(! function_exists('info')) { function info($s) { $a = get_app(); + if(! x($_SESSION,'sysmsg_info')) $_SESSION['sysmsg_info'] = array(); if($a->interactive) - $_SESSION['sysmsg_info'] .= $s; + $_SESSION['sysmsg_info'][] = $s; }} @@ -812,8 +817,8 @@ function profile_load(&$a, $nickname, $profile = 0) { $a->page['aside'] .= profile_sidebar($a->profile, $block); - if(! $block) - $a->page['aside'] .= contact_block(); + /*if(! $block) + $a->page['aside'] .= contact_block();*/ return; }} @@ -841,132 +846,107 @@ function profile_sidebar($profile, $block = 0) { $a = get_app(); $o = ''; - $location = ''; + $location = false; $address = false; + $pdesc = true; if((! is_array($profile)) && (! count($profile))) return $o; call_hooks('profile_sidebar_enter', $profile); - $fullname = '
' . $profile['name'] . '
'; + + // don't show connect link to yourself + $connect = (($profile['uid'] != local_user()) ? t('Connect') : False); - $pdesc = '
' . $profile['pdesc'] . '
'; + // don't show connect link to authenticated visitors either - $tabs = ''; + if((remote_user()) && ($_SESSION['visitor_visiting'] == $profile['uid'])) + $connect = False; + + + // show edit profile to yourself + if ($profile['uid'] == local_user()) { + $profile['edit'] = array($a->get_baseurl(). '/profiles', t('Profiles'),"", t('Manage/edit profiles')); + + $r = q("SELECT * FROM `profile` WHERE `uid` = %d", + local_user()); + + $profile['menu'] = array( + 'chg_photo' => t('Change profile photo'), + 'cr_new' => t('Create New Profile'), + 'entries' => array(), + ); + + if(count($r)) { - $photo = '
' . $profile['name'] . '
'; + foreach($r as $rr) { + $profile['menu']['entries'][] = array( + 'photo' => $rr['thumb'], + 'id' => $rr['id'], + 'alt' => t('Profile Image'), + 'profile_name' => $rr['profile-name'], + 'isdefault' => $rr['is-default'], + 'visibile_to_everybody' => t('visible to everybody'), + 'edit_visibility' => t('Edit visibility'), + + ); + } - // don't show connect link to yourself - $connect = (($profile['uid'] != local_user()) ? '
  • ' . t('Connect') . '
  • ' : ''); - // don't show connect link to authenticated visitors either + } + + + } + - if((remote_user()) && ($_SESSION['visitor_visiting'] == $profile['uid'])) - $connect = ''; + if((x($profile,'address') == 1) || (x($profile,'locality') == 1) || (x($profile,'region') == 1) || (x($profile,'postal-code') == 1) || (x($profile,'country-name') == 1)) - $address = true; - - if($address) { - $location .= '
    ' . t('Location:') . '
    '; - $location .= ((x($profile,'address') == 1) ? '
    ' . $profile['address'] . '
    ' : ''); - $location .= (((x($profile,'locality') == 1) || (x($profile,'region') == 1) || (x($profile,'postal-code') == 1)) - ? '' . $profile['locality'] . '' - . ((x($profile['locality']) == 1) ? t(', ') : '') - . '' . $profile['region'] . '' - . ' ' . $profile['postal-code'] . '' : ''); - $location .= ((x($profile,'country-name') == 1) ? ' ' . $profile['country-name'] . '' : ''); - $location .= '
    '; + $location = t('Location:'); - } + $gender = ((x($profile,'gender') == 1) ? t('Gender:') : False); - $gender = ((x($profile,'gender') == 1) ? '
    ' . t('Gender:') . ' ' . $profile['gender'] . '
    ' : ''); + $marital = ((x($profile,'marital') == 1) ? t('Status:') : False); - $pubkey = ((x($profile,'pubkey') == 1) ? '' : ''); + $homepage = ((x($profile,'homepage') == 1) ? t('Homepage:') : False); - $marital = ((x($profile,'marital') == 1) ? '
    ' . t('Status:') . ' ' . $profile['marital'] . '
    ' : ''); + if(($profile['hidewall'] || $block) && (! local_user()) && (! remote_user())) { + $location = $pdesc = $connect = $gender = $marital = $homepage = False; + } - $homepage = ((x($profile,'homepage') == 1) ? '
    ' . t('Homepage:') . ' ' . linkify($profile['homepage']) . '
    ' : ''); + $diaspora = array( + 'podloc' => $a->get_baseurl(), + 'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' ), + 'nickname ' => $profile['nickname'], + 'fullname' => $profile['name'], + 'photo300' => $a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg', + 'photo100' => $a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg', + 'photo50' => $a->get_baseurl() . '/photo/custom/50/' . $profile['uid'] . '.jpg', + ); - if(($profile['hidewall'] || $block) && (! local_user()) && (! remote_user())) { - $location = $pdesc = $connect = $gender = $marital = $homepage = ''; + if (!$block){ + $contact_block = contact_block(); } - $podloc = $a->get_baseurl(); - $searchable = (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' ); - $nickname = $profile['nickname']; - $photo300 = $a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg'; - $photo100 = $a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg'; - $photo50 = $a->get_baseurl() . '/photo/custom/50/' . $profile['uid'] . '.jpg'; - - $diaspora_vcard = <<< EOT - -
    -
    -
    Nickname
    -
    -$nickname -
    -
    -
    -
    Full name
    -
    -$fullname -
    -
    -
    -
    URL
    -
    -$podloc/ -
    -
    -
    -
    Photo
    -
    - -
    -
    -
    -
    Photo
    -
    - -
    -
    -
    -
    Photo
    -
    - -
    -
    -
    -
    Searchable
    -
    -$searchable -
    -
    -
    -EOT; $tpl = get_markup_template('profile_vcard.tpl'); $o .= replace_macros($tpl, array( - '$fullname' => template_escape($fullname), - '$pdesc' => template_escape($pdesc), - '$tabs' => $tabs, - '$photo' => $photo, + '$profile' => $profile, '$connect' => $connect, '$location' => template_escape($location), '$gender' => $gender, - '$pubkey' => $pubkey, - '$marital' => template_escape($marital), - '$homepage' => template_escape($homepage), - '$diaspora' => $diaspora_vcard + '$pdesc' => $pdesc, + '$marital' => $marital, + '$homepage' => $homepage, + '$diaspora' => $diaspora, + '$contact_block' => $contact_block, )); @@ -1174,3 +1154,4 @@ function load_contact_links($uid) { $a->contacts = $ret; return; }} +