From c4b292a4f103eb049c13dbe3c62f0438c18de816 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 22 Mar 2011 03:07:46 -0700 Subject: [PATCH] account/profile/contacts export --- mod/settings.php | 5 ++++ mod/uexport.php | 48 +++++++++++++++++++++++++++++++ view/de/settings.tpl | 2 ++ view/en/settings.tpl | 2 ++ view/fr/settings.tpl | 2 ++ view/it/settings.tpl | 1 + view/sv/settings.tpl | 2 ++ view/theme/duepuntozero/style.css | 5 ++-- view/theme/loozah/style.css | 8 +++--- 9 files changed, 69 insertions(+), 6 deletions(-) create mode 100644 mod/uexport.php diff --git a/mod/settings.php b/mod/settings.php index 6a2733d7c9..b20f4d11b8 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -5,6 +5,7 @@ function settings_init(&$a) { if(local_user()) { profile_load($a,$a->user['nickname']); } + } @@ -341,9 +342,13 @@ function settings_content(&$a) { $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false); + $uexport = ''; + + $o .= replace_macros($stpl,array( '$baseurl' => $a->get_baseurl(), '$oidhtml' => $oidhtml, + '$uexport' => $uexport, '$uid' => local_user(), '$username' => $username, '$openid' => $openid, diff --git a/mod/uexport.php b/mod/uexport.php new file mode 100644 index 0000000000..423c3a82fa --- /dev/null +++ b/mod/uexport.php @@ -0,0 +1,48 @@ + $v) + $user[$k] = $v; + + } + $contact = array(); + $r = q("SELECT * FROM `contact` WHERE `uid` = %d ", + local_user() + ); + if(count($r)) { + foreach($r as $rr) + foreach($rr as $k => $v) + $contact[][$k] = $v; + + } + + $profile = array(); + $r = q("SELECT * FROM `profile` WHERE `uid` = %d ", + local_user() + ); + if(count($r)) { + foreach($r as $rr) + foreach($rr as $k => $v) + $profile[][$k] = $v; + } + + + + $output = array('user' => $user, 'contact' => $contact, 'profile' => $profile); + + header("Content-type: text/json"); + echo str_replace('\\/','/',json_encode($output)); + + killme(); + +} \ No newline at end of file diff --git a/view/de/settings.tpl b/view/de/settings.tpl index 5f700ff8bd..170939991e 100644 --- a/view/de/settings.tpl +++ b/view/de/settings.tpl @@ -2,6 +2,8 @@ +$uexport + $nickname_block diff --git a/view/en/settings.tpl b/view/en/settings.tpl index 45060e1c47..134fffaf92 100644 --- a/view/en/settings.tpl +++ b/view/en/settings.tpl @@ -2,6 +2,8 @@ +$uexport + $nickname_block diff --git a/view/fr/settings.tpl b/view/fr/settings.tpl index e0334842a2..9846219ed7 100644 --- a/view/fr/settings.tpl +++ b/view/fr/settings.tpl @@ -2,6 +2,8 @@ +$uexport + $nickname_block diff --git a/view/it/settings.tpl b/view/it/settings.tpl index d1e25da81c..6679e28fe3 100644 --- a/view/it/settings.tpl +++ b/view/it/settings.tpl @@ -2,6 +2,7 @@ +$uexport $nickname_block diff --git a/view/sv/settings.tpl b/view/sv/settings.tpl index d5b8d5b3f1..2601f48513 100644 --- a/view/sv/settings.tpl +++ b/view/sv/settings.tpl @@ -2,6 +2,8 @@ +$uexport + $nickname_block diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index eda3cbf275..758ab9699d 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -372,6 +372,7 @@ input#dfrn-url { } #settings-nick-wrapper { + margin-top: 20px; margin-bottom: 30px; } @@ -2044,8 +2045,8 @@ a.mail-list-link { } -#plugin-settings-link, #account-settings-link { - margin-bottom: 25px; +#plugin-settings-link, #account-settings-link, #uexport-link { + margin-bottom: 10px; } /* end from defautlt */ diff --git a/view/theme/loozah/style.css b/view/theme/loozah/style.css index 4a092c6d29..4d2ca6d636 100644 --- a/view/theme/loozah/style.css +++ b/view/theme/loozah/style.css @@ -505,7 +505,7 @@ input#dfrn-url { } #settings-nick-wrapper { - margin-bottom: 30px; + margin-bottom: 15px; } #settings-expire-end { @@ -608,7 +608,7 @@ input#dfrn-url { } #settings-nick { - margin-bottom: 50px; + margin-bottom: 30px; } #cropimage-wrapper, #cropimage-preview-wrapper { @@ -2079,8 +2079,8 @@ a.mail-list-link { } -#plugin-settings-link, #account-settings-link { - margin-bottom: 25px; +#plugin-settings-link, #account-settings-link, #uexport-link { + margin-bottom: 10px; }