]> git.mxchange.org Git - friendica.git/commitdiff
merge diaspora/friendika vcard formats - not yet complete
authorFriendika <info@friendika.com>
Mon, 1 Aug 2011 12:13:59 +0000 (05:13 -0700)
committerFriendika <info@friendika.com>
Mon, 1 Aug 2011 12:13:59 +0000 (05:13 -0700)
boot.php
include/api.php
view/profile_vcard.tpl

index 025f7ef878b58ff9151b0bd0839ecc578faf43fb..4d4b385122a1a54be13847e18cdb4bc77fc46e42 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -2396,6 +2396,8 @@ function profile_load(&$a, $nickname, $profile = 0) {
 if(! function_exists('profile_sidebar')) {
 function profile_sidebar($profile) {
 
+       $a = get_app();
+
        $o = '';
        $location = '';
        $address = false;
@@ -2454,6 +2456,41 @@ function profile_sidebar($profile) {
                $location = $gender = $marital = $homepage = '';
        }
 
+       $podloc = $a->get_baseurl();
+       $searchable = (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' );
+       $nickname = $profile['nick'];
+       $dphoto = $profile['photo'];
+
+       $diaspora_vcard = <<< EOT
+
+<div style="display:none;">
+<dl class='entity_nickname'>
+<dt>Nickname</dt>
+<dd>
+<a class="nickname url uid" href="$podloc" rel="me">$nickname</a>
+</dd>
+</dl>
+<dl class="entity_url">
+<dt>URL</dt>
+<dd>
+<a class="url" href="$podloc" id="pod_location" rel="me">$podloc</a>
+</dd>
+</dl>
+<dl class="entity_photo">
+<dt>Photo</dt>
+<dd>
+<img class="photo avatar" height="175px" src="$dphoto" width='175px'>
+</dd>
+</dl>
+<dl class='entity_searchable'>
+<dt>Searchable</dt>
+<dd>
+<span class='searchable'>$searchable</span>
+</dd>
+</dl>
+</div>
+EOT;
+
        $tpl = get_markup_template('profile_vcard.tpl');
 
        $o .= replace_macros($tpl, array(
@@ -2466,7 +2503,8 @@ function profile_sidebar($profile) {
                '$gender'   => $gender,
                '$pubkey'   => $pubkey,
                '$marital'  => $marital,
-               '$homepage' => $homepage
+               '$homepage' => $homepage,
+               '$diaspora' => $diaspora_vcard
        ));
 
 
index 7b3dd866cea85288416fc7d0464269e49b42c1c5..c77c55cef49ed51a185818b0af1c30d7fa31a4c6 100644 (file)
                                load_contact_links(local_user());
 
                                logger('API call for ' . $a->user['username'] . ': ' . $a->query_string);               
+                               logger('API parameters: ' . print_r($_REQUEST,true));
                                $type="json";           
                                if (strpos($a->query_string, ".xml")>0) $type="xml";
                                if (strpos($a->query_string, ".json")>0) $type="json";
                        }
                }
                
-               if ($user==='') {
+               if (! $user) {
                        if (local_user()===false) {
                                api_login($a); return False;
                        } else {
                        
                }
                
-
+               logger('api_user: ' . $extra_query . ' ' , $user);
                // user info            
                $uinfo = q("SELECT *, `contact`.`id` as `cid` FROM `contact`
                                WHERE 1
index 3cd96eabff8cc03273c9194fd2f99c8adb96ee31..86655951de4525318e4bedc9205d29ace9e0651e 100644 (file)
@@ -24,3 +24,5 @@ $marital
 
 $homepage
 
+$diaspora
+