aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/attach.php35
-rw-r--r--include/channel.php4
-rw-r--r--include/connections.php7
-rw-r--r--include/nav.php1
-rw-r--r--include/text.php4
5 files changed, 38 insertions, 13 deletions
diff --git a/include/attach.php b/include/attach.php
index ba2f60a90..dc5bfd308 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -1279,8 +1279,10 @@ function attach_delete($channel_id, $resource, $is_photo = 0) {
intval($channel_id)
);
- if(! $r)
+ if(! $r) {
+ attach_drop_photo($channel_id,$resource);
return;
+ }
$cloudpath = get_parent_cloudpath($channel_id, $channel_address, $resource);
$object = get_file_activity_object($channel_id, $resource, $cloudpath);
@@ -1326,19 +1328,10 @@ function attach_delete($channel_id, $resource, $is_photo = 0) {
);
if($r[0]['is_photo']) {
- $x = q("select id, item_hidden from item where resource_id = '%s' and resource_type = 'photo' and uid = %d",
- dbesc($resource),
- intval($channel_id)
- );
- if($x) {
- drop_item($x[0]['id'],false,(($x[0]['item_hidden']) ? DROPITEM_NORMAL : DROPITEM_PHASE1),true);
- }
- q("DELETE FROM photo WHERE uid = %d AND resource_id = '%s'",
- intval($channel_id),
- dbesc($resource)
- );
+ attach_drop_photo($channel_id,$resource);
}
+
// update the parent folder's lastmodified timestamp
$e = q("UPDATE attach SET edited = '%s' WHERE hash = '%s' AND uid = %d",
dbesc(datetime_convert()),
@@ -1351,6 +1344,24 @@ function attach_delete($channel_id, $resource, $is_photo = 0) {
return;
}
+
+function attach_drop_photo($channel_id,$resource) {
+
+ $x = q("select id, item_hidden from item where resource_id = '%s' and resource_type = 'photo' and uid = %d",
+ dbesc($resource),
+ intval($channel_id)
+ );
+ if($x) {
+ drop_item($x[0]['id'],false,(($x[0]['item_hidden']) ? DROPITEM_NORMAL : DROPITEM_PHASE1),true);
+ }
+ q("DELETE FROM photo WHERE uid = %d AND resource_id = '%s'",
+ intval($channel_id),
+ dbesc($resource)
+ );
+
+}
+
+
/**
* @brief Returns path to file in cloud/.
*
diff --git a/include/channel.php b/include/channel.php
index 5d92b4769..83f48f361 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -1278,10 +1278,14 @@ function advanced_profile(&$a) {
// logger('mod_profile: things: ' . print_r($things,true), LOGGER_DATA);
+ $exportlink = ((App::$profile['profile_vcard']) ? zid(z_root() . '/profile/' . App::$profile['channel_address'] . '/vcard') : '');
+
return replace_macros($tpl, array(
'$title' => t('Profile'),
'$canlike' => (($profile['canlike'])? true : false),
'$likethis' => t('Like this thing'),
+ '$export' => t('Export'),
+ '$exportlink' => $exportlink,
'$profile' => $profile,
'$fields' => $clean_fields,
'$editmenu' => profile_edit_menu(App::$profile['profile_uid']),
diff --git a/include/connections.php b/include/connections.php
index 31e941e95..def80441a 100644
--- a/include/connections.php
+++ b/include/connections.php
@@ -632,6 +632,9 @@ function random_profile() {
function update_vcard($arr,$vcard = null) {
+
+ // logger('update_vcard: ' . print_r($arr,true));
+
$fn = $arr['fn'];
@@ -816,8 +819,10 @@ function get_vcard_array($vc,$id) {
$type = (($adr['TYPE']) ? vcard_translate_type((string)$adr['TYPE']) : '');
$adrs[] = [
'type' => $type,
- 'address' => escape_tags($adr->getParts())
+ 'address' => $adr->getParts()
];
+ $last_entry = end($adrs);
+ array_walk($adrs[$last_entry]['address'],'array_escape_tags');
}
}
diff --git a/include/nav.php b/include/nav.php
index 2762e2a14..e389308ff 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -244,6 +244,7 @@ $powered_by = '';
App::$page['nav'] .= replace_macros($tpl, array(
'$baseurl' => z_root(),
+ '$fulldocs' => t('Documentation'),
'$sitelocation' => $sitelocation,
'$nav' => $x['nav'],
'$banner' => $banner,
diff --git a/include/text.php b/include/text.php
index bc1eff7db..f5b1803c2 100644
--- a/include/text.php
+++ b/include/text.php
@@ -3128,4 +3128,8 @@ function cleanup_bbcode($body) {
function array_trim(&$v,$k) {
$v = trim($v);
+}
+
+function array_escape_tags(&$v,$k) {
+ $v = escape_tags($v);
} \ No newline at end of file