Browse Source

account/profile/contacts export

pull/1/head
Friendika 10 years ago
parent
commit
c4b292a4f1
9 changed files with 69 additions and 6 deletions
  1. +5
    -0
      mod/settings.php
  2. +48
    -0
      mod/uexport.php
  3. +2
    -0
      view/de/settings.tpl
  4. +2
    -0
      view/en/settings.tpl
  5. +2
    -0
      view/fr/settings.tpl
  6. +1
    -0
      view/it/settings.tpl
  7. +2
    -0
      view/sv/settings.tpl
  8. +3
    -2
      view/theme/duepuntozero/style.css
  9. +4
    -4
      view/theme/loozah/style.css

+ 5
- 0
mod/settings.php View File

@ -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 = '<div id="uexport-link"><a href="uexport" >' . t('Export Personal Data') . '</a></div>';
$o .= replace_macros($stpl,array(
'$baseurl' => $a->get_baseurl(),
'$oidhtml' => $oidhtml,
'$uexport' => $uexport,
'$uid' => local_user(),
'$username' => $username,
'$openid' => $openid,


+ 48
- 0
mod/uexport.php View File

@ -0,0 +1,48 @@
<?php
function uexport_init(&$a) {
if(! local_user())
killme();
$user = array();
$r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
local_user()
);
if(count($r)) {
foreach($r as $rr)
foreach($rr as $k => $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();
}

+ 2
- 0
view/de/settings.tpl View File

@ -2,6 +2,8 @@
<div id="plugin-settings-link"><a href="settings/addon">Plugin Einstellungen</a></div>
$uexport
$nickname_block


+ 2
- 0
view/en/settings.tpl View File

@ -2,6 +2,8 @@
<div id="plugin-settings-link"><a href="settings/addon">Plugin Settings</a></div>
$uexport
$nickname_block


+ 2
- 0
view/fr/settings.tpl View File

@ -2,6 +2,8 @@
<div id="plugin-settings-link"><a href="settings/addon">Plugin Settings</a></div>
$uexport
$nickname_block


+ 1
- 0
view/it/settings.tpl View File

@ -2,6 +2,7 @@
<div id="plugin-settings-link"><a href="settings/addon">Impostazioni Plugin</a></div>
$uexport
$nickname_block


+ 2
- 0
view/sv/settings.tpl View File

@ -2,6 +2,8 @@
<div id="plugin-settings-link"><a href="settings/addon">Plugin Settings</a></div>
$uexport
$nickname_block


+ 3
- 2
view/theme/duepuntozero/style.css View File

@ -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 */


+ 4
- 4
view/theme/loozah/style.css View File

@ -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;
}


Loading…
Cancel
Save