aboutsummaryrefslogtreecommitdiffstats
path: root/mod/photos.php
diff options
context:
space:
mode:
authorHaakon Meland Eriksen <haakon.eriksen@far.no>2015-08-06 23:57:28 +0200
committerHaakon Meland Eriksen <haakon.eriksen@far.no>2015-08-06 23:57:28 +0200
commit07cd0c870f48ec838c23fa7c6966ceb1c41f06ab (patch)
tree26a1177441c40c2d3e42d3fc3617302dc2d86f12 /mod/photos.php
parent2b1e6723168665039cdccb951e29c4220351367a (diff)
parent1b0cb9388cd5c416af5ba270127b14efdd1c0a6b (diff)
downloadvolse-hubzilla-07cd0c870f48ec838c23fa7c6966ceb1c41f06ab.tar.gz
volse-hubzilla-07cd0c870f48ec838c23fa7c6966ceb1c41f06ab.tar.bz2
volse-hubzilla-07cd0c870f48ec838c23fa7c6966ceb1c41f06ab.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mod/photos.php')
-rw-r--r--mod/photos.php72
1 files changed, 44 insertions, 28 deletions
diff --git a/mod/photos.php b/mod/photos.php
index b65218e94..dc70e4f90 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -107,11 +107,16 @@ function photos_post(&$a) {
$newalbum = notags(trim($_REQUEST['albumname']));
if($newalbum != $album) {
- $x = photos_album_rename($page_owner_uid,$album,$newalbum);
- if($x) {
- $newurl = str_replace(bin2hex($album),bin2hex($newalbum),$_SESSION['photo_return']);
- goaway($a->get_baseurl() . '/' . $newurl);
- }
+
+ // @fixme - syncronise with DAV or disallow completely
+
+ goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
+
+// $x = photos_album_rename($page_owner_uid,$album,$newalbum);
+// if($x) {
+// $newurl = str_replace(bin2hex($album),bin2hex($newalbum),$_SESSION['photo_return']);
+// goaway($a->get_baseurl() . '/' . $newurl);
+// }
}
/*
@@ -474,7 +479,12 @@ function photos_content(&$a) {
$datatype = argv(2);
$datum = argv(3);
} else {
- $datatype = 'summary';
+ if(argc() > 2) {
+ $datatype = argv(2);
+ $datum = '';
+ }
+ else
+ $datatype = 'summary';
}
if(argc() > 4)
@@ -563,10 +573,12 @@ function photos_content(&$a) {
$albums = ((array_key_exists('albums', $a->data)) ? $a->data['albums'] : photos_albums_list($a->data['channel'],$a->data['observer']));
- $def_album = get_pconfig($a->data['channel']['channel_id'],'system','photo_path');
- if($def_album) {
- $selname = filepath_macro($def_album);
- $albums['album'][] = array('text' => $selname);
+ if(! $selname) {
+ $def_album = get_pconfig($a->data['channel']['channel_id'],'system','photo_path');
+ if($def_album) {
+ $selname = filepath_macro($def_album);
+ $albums['album'][] = array('text' => $selname);
+ }
}
$tpl = get_markup_template('photos_upload.tpl');
@@ -602,15 +614,15 @@ function photos_content(&$a) {
if($datatype === 'album') {
-
-
- if((strlen($datum) & 1) || (! ctype_xdigit($datum))) {
- notice( t('Album name could not be decoded') . EOL);
- logger('mod_photos: illegal album encoding: ' . $datum);
- $datum = '';
+ if(strlen($datum)) {
+ if((strlen($datum) & 1) || (! ctype_xdigit($datum))) {
+ notice( t('Album name could not be decoded') . EOL);
+ logger('mod_photos: illegal album encoding: ' . $datum);
+ $datum = '';
+ }
}
- $album = hex2bin($datum);
+ $album = (($datum) ? hex2bin($datum) : '');
$r = q("SELECT `resource_id`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` = '%s'
AND `scale` <= 4 and photo_usage IN ( %d, %d ) and is_nsfw = %d $sql_extra GROUP BY `resource_id`",
@@ -657,17 +669,21 @@ function photos_content(&$a) {
$album_e = $album;
}
$albums = ((array_key_exists('albums', $a->data)) ? $a->data['albums'] : photos_albums_list($a->data['channel'],$a->data['observer']));
- $edit_tpl = get_markup_template('album_edit.tpl');
- $album_edit = replace_macros($edit_tpl,array(
- '$nametext' => t('Enter a new album name'),
- '$name_placeholder' => t('or select an existing one (doubleclick)'),
- '$nickname' => $a->data['channel']['channel_address'],
- '$album' => $album_e,
- '$albums' => $albums['albums'],
- '$hexalbum' => bin2hex($album),
- '$submit' => t('Submit'),
- '$dropsubmit' => t('Delete Album')
- ));
+
+ // @fixme - syncronise actions with DAV
+
+// $edit_tpl = get_markup_template('album_edit.tpl');
+// $album_edit = replace_macros($edit_tpl,array(
+// '$nametext' => t('Enter a new album name'),
+// '$name_placeholder' => t('or select an existing one (doubleclick)'),
+// '$nickname' => $a->data['channel']['channel_address'],
+// '$album' => $album_e,
+// '$albums' => $albums['albums'],
+// '$hexalbum' => bin2hex($album),
+// '$submit' => t('Submit'),
+// '$dropsubmit' => t('Delete Album')
+// ));
+
}
}