From 8b615133d528eb074a23746afef6201f474a4e3f Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Wed, 31 Aug 2011 17:31:44 +0200 Subject: remove html from profile vcard code --- boot.php | 122 +++++++++++++++------------------------------------------------ 1 file changed, 29 insertions(+), 93 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 42a0f7207..edad6e70f 100644 --- a/boot.php +++ b/boot.php @@ -808,8 +808,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; }} @@ -837,132 +837,68 @@ 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'] . '
'; - - $pdesc = '
' . $profile['pdesc'] . '
'; - - $tabs = ''; - - $photo = '
' . $profile['name'] . '
'; - + // don't show connect link to yourself - $connect = (($profile['uid'] != local_user()) ? '
  • ' . t('Connect') . '
  • ' : ''); + $connect = (($profile['uid'] != local_user()) ? t('Connect') : False); // don't show connect link to authenticated visitors either if((remote_user()) && ($_SESSION['visitor_visiting'] == $profile['uid'])) - $connect = ''; + $connect = False; + 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:') . ' ' . $profile['gender'] . '
    ' : ''); + $gender = ((x($profile,'gender') == 1) ? t('Gender:') : False); - $pubkey = ((x($profile,'pubkey') == 1) ? '' : ''); - $marital = ((x($profile,'marital') == 1) ? '
    ' . t('Status:') . ' ' . $profile['marital'] . '
    ' : ''); + $marital = ((x($profile,'marital') == 1) ? t('Status:') : False); - $homepage = ((x($profile,'homepage') == 1) ? '
    ' . t('Homepage:') . ' ' . linkify($profile['homepage']) . '
    ' : ''); + $homepage = ((x($profile,'homepage') == 1) ? t('Homepage:') : False); if(($profile['hidewall'] || $block) && (! local_user()) && (! remote_user())) { - $location = $pdesc = $connect = $gender = $marital = $homepage = ''; + $location = $pdesc = $connect = $gender = $marital = $homepage = False; } - $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; + $diaspora = array( + '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', + ); + + if (!$block){ + $contact_block = contact_block(); + } $tpl = get_markup_template('profile_vcard.tpl'); $o .= replace_macros($tpl, array( - '$fullname' => $fullname, - '$pdesc' => $pdesc, - '$tabs' => $tabs, - '$photo' => $photo, + '$profile' => $profile, '$connect' => $connect, '$location' => $location, '$gender' => $gender, - '$pubkey' => $pubkey, + '$pdesc' => $pdesc, '$marital' => $marital, '$homepage' => $homepage, - '$diaspora' => $diaspora_vcard + '$diaspora' => $diaspora, + '$contact_block' => $contact_block, )); -- cgit v1.2.3