X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fphotos.php;h=e680bc5a2fc3c2c5ead0e188c62d0dbd677dde7d;hb=5933f13ab72337554d5fa23a064a3f61f3dee5e4;hp=6894483ae2d1cdbf5f2013f3b98463b3903f5370;hpb=a48efe0bc0ff035137d519988619c6e79c371425;p=friendica.git diff --git a/mod/photos.php b/mod/photos.php index 6894483ae2..e680bc5a2f 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -1,6 +1,7 @@ store($_SESSION['uid'], 0, $photo_hash, $filename, $album, 0 ); + $r = $ph->store($_SESSION['uid'], 0, $photo_hash, $filename, $album, 0 , 0, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny); if(! $r) { notice( t('Image upload failed.') . EOL ); @@ -105,13 +135,13 @@ function photos_post(&$a) { if($width > 640 || $height > 640) { $ph->scaleImage(640); - $ph->store($_SESSION['uid'], 0, $photo_hash, $filename, $album, 1 ); + $ph->store($_SESSION['uid'], 0, $photo_hash, $filename, $album, 1, 0, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny); $smallest = 1; } if($width > 320 || $height > 320) { $ph->scaleImage(320); - $ph->store($_SESSION['uid'], 0, $photo_hash, $filename, $album, 2 ); + $ph->store($_SESSION['uid'], 0, $photo_hash, $filename, $album, 2, 0, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny); $smallest = 2; } @@ -292,6 +322,8 @@ function photos_content(&$a) { '$existalbumtext' => t('or existing album name: '), '$filestext' => t('Select files to upload: '), '$albumselect' => $albumselect, + '$permissions' => t('Permissions'), + '$aclselect' => populate_acl($a->user), '$archive' => $a->get_baseurl() . '/jumploader_z.jar', '$nojava' => t('Use the following controls only if the Java uploader (above) fails to launch.'), '$uploadurl' => $a->get_baseurl() . '/photos', @@ -316,7 +348,7 @@ function photos_content(&$a) { $r = q("SELECT `resource-id`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` = '%s' - $sql_extra GROUP BY `resource-id` LIMIT %d , %d", + $sql_extra GROUP BY `resource-id` ORDER BY `created` DESC LIMIT %d , %d", intval($a->data['user']['uid']), dbesc($album), intval($a->pager['start']), @@ -348,7 +380,7 @@ function photos_content(&$a) { require_once('security.php'); require_once('bbcode.php'); - // fetch item containing image, then comments + // fetch image, item containing image, then comments $ph = q("SELECT * FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s' $sql_extra ORDER BY `scale` ASC ", @@ -364,10 +396,19 @@ function photos_content(&$a) { if(count($ph) == 1) $hires = $lores = $ph[0]; if(count($ph) > 1) { + if($ph[1]['scale'] == 2) { + // original is 640 or less, we can display it directly + $hires = $lores = $ph[0]; + } + else { $hires = $ph[0]; $lores = $ph[1]; + } } + + $o .= '

' . '' . $ph[0]['album'] . '

'; + $o .= '' . $ph['desc'] . ''; + $o .= '
' . $ph[0]['desc'] . '
'; if(strlen($i1[0]['tag'])) { // parse tags and add links @@ -422,6 +462,13 @@ function photos_content(&$a) { $o .= '
' . $i1[0]['tag'] . '
'; } + if($cmd == 'edit') { + $edit_tpl = file_get_contents('view/photo_edit.tpl'); + $o .= replace_macros($edit_tpl, array( + '$id' => $ph[0]['id'] + )); + } + // pull out how many people like the photo $cmnt_tpl = file_get_contents('view/comment_item.tpl');