aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-11-03 14:51:28 -0800
committerfriendica <info@friendica.com>2014-11-03 14:51:28 -0800
commitfdb9b9d52ed1959213a67b1313b617d0e4eb057f (patch)
tree99941674eaaef28467e610be302a584dcbd210b4
parenta6d8c3193a6fc243f3e516118c793e5b871b8247 (diff)
parent9984ff37e5df237ccdd0169387ade070babfd666 (diff)
downloadvolse-hubzilla-fdb9b9d52ed1959213a67b1313b617d0e4eb057f.tar.gz
volse-hubzilla-fdb9b9d52ed1959213a67b1313b617d0e4eb057f.tar.bz2
volse-hubzilla-fdb9b9d52ed1959213a67b1313b617d0e4eb057f.zip
Merge https://github.com/friendica/red into pending_merge
-rw-r--r--include/session.php5
-rw-r--r--mod/photos.php13
-rw-r--r--view/css/mod_photos.css5
-rwxr-xr-xview/tpl/photo_view.tpl153
-rwxr-xr-xview/tpl/photos_upload.tpl14
5 files changed, 99 insertions, 91 deletions
diff --git a/include/session.php b/include/session.php
index b531688e2..8500e2cd3 100644
--- a/include/session.php
+++ b/include/session.php
@@ -84,8 +84,9 @@ function ref_session_destroy ($id) {
function ref_session_gc($expire) {
q("DELETE FROM session WHERE expire < %d", dbesc(time()));
- q("OPTIMIZE TABLE session");
- return true;
+ if (! get_config('system','innodb'))
+ q("OPTIMIZE TABLE session");
+ return true;
}
$gc_probability = 50;
diff --git a/mod/photos.php b/mod/photos.php
index 48bc6d1e5..eb634259f 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -196,7 +196,7 @@ function photos_post(&$a) {
}
}
- goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
+ goaway($a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . $_SESSION['album_return']);
}
if(($a->argc > 2) && ((x($_POST,'desc') !== false) || (x($_POST,'newtag') !== false)) || (x($_POST,'albname') !== false)) {
@@ -428,8 +428,11 @@ function photos_post(&$a) {
if(! $r['success']) {
notice($r['message'] . EOL);
}
-
- goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
+
+ if($_REQUEST['newalbum'])
+ goaway($a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . bin2hex($_REQUEST['newalbum']));
+ else
+ goaway($a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . bin2hex(datetime_convert('UTC',date_default_timezone_get(),'now', 'Y')));
}
@@ -610,6 +613,8 @@ function photos_content(&$a) {
if(count($r)) {
$a->set_pager_total(count($r));
$a->set_pager_itemspage(60);
+ } else {
+ goaway($a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address']);
}
if($_GET['order'] === 'posted')
@@ -918,6 +923,8 @@ function photos_content(&$a) {
$aclselect_e = populate_acl($ph[0]);
$albums = ((array_key_exists('albums', $a->data)) ? $a->data['albums'] : photos_albums_list($a->data['channel'],$a->data['observer']));
+ $_SESSION['album_return'] = bin2hex($ph[0]['album']);
+
$edit = array(
'edit' => t('Edit photo'),
'id' => $link_item['id'],
diff --git a/view/css/mod_photos.css b/view/css/mod_photos.css
index cb3ab51c6..34bac51e9 100644
--- a/view/css/mod_photos.css
+++ b/view/css/mod_photos.css
@@ -8,6 +8,11 @@
padding: 7px 10px;
}
+.photo-like-rotator {
+ margin-top: 23px;
+ margin-right: 5px;
+}
+
#photo-photo {
display: table;
margin: 0 auto;
diff --git a/view/tpl/photo_view.tpl b/view/tpl/photo_view.tpl
index e7456427b..009158c37 100755
--- a/view/tpl/photo_view.tpl
+++ b/view/tpl/photo_view.tpl
@@ -92,97 +92,92 @@
<div class="photo-item-tools">
{{if $like_count || $dislike_count}}
<div class="photo-item-tools-left pull-left">
- <div class="{{if $like_count && $dislike_count}}btn-group{{/if}}">
- {{if $like_count}}
- <div class="btn-group">
- <button type="button" class="btn btn-default btn-sm wall-item-like dropdown-toggle" data-toggle="dropdown" id="wall-item-like-{{$id}}">{{$like_count}} {{$like_button_label}}</button>
- {{if $like_list_part}}
- <ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-like-{{$id}}">{{foreach $like_list_part as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul>
- {{else}}
- <ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-like-{{$id}}">{{foreach $like_list as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul>
- {{/if}}
- </div>
- {{/if}}
- {{if $dislike_count}}
- <div class="btn-group">
- <button type="button" class="btn btn-default btn-sm wall-item-dislike dropdown-toggle" data-toggle="dropdown" id="wall-item-dislike-{{$id}}">{{$dislike_count}} {{$dislike_button_label}}</button>
- {{if $dislike_list_part}}
- <ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-dislike-{{$id}}">{{foreach $dislike_list_part as $disliker}}<li role="presentation">{{$disliker}}</li>{{/foreach}}</ul>
- {{else}}
- <ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-dislike-{{$id}}">{{foreach $dislike_list as $disliker}}<li role="presentation">{{$disliker}}</li>{{/foreach}}</ul>
- {{/if}}
- </div>
+ <div class="{{if $like_count && $dislike_count}}btn-group{{/if}}">
+ {{if $like_count}}
+ <div class="btn-group">
+ <button type="button" class="btn btn-default btn-sm wall-item-like dropdown-toggle" data-toggle="dropdown" id="wall-item-like-{{$id}}">{{$like_count}} {{$like_button_label}}</button>
+ {{if $like_list_part}}
+ <ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-like-{{$id}}">{{foreach $like_list_part as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul>
+ {{else}}
+ <ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-like-{{$id}}">{{foreach $like_list as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul>
{{/if}}
</div>
- {{if $like_list_part}}
- <div class="modal" id="likeModal-{{$id}}">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
- <h4 class="modal-title">{{$like_modal_title}}</h4>
- </div>
- <div class="modal-body">
- <ul>{{foreach $like_list as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul>
- </div>
- <div class="modal-footer clear">
- <button type="button" class="btn btn-default" data-dismiss="modal">{{$modal_dismiss}}</button>
- </div>
- </div><!-- /.modal-content -->
- </div><!-- /.modal-dialog -->
- </div><!-- /.modal -->
{{/if}}
- {{if $dislike_list_part}}
- <div class="modal" id="dislikeModal-{{$id}}">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
- <h4 class="modal-title">{{$dislike_modal_title}}</h4>
- </div>
- <div class="modal-body">
- <ul>{{foreach $dislike_list as $disliker}}<li role="presentation">{{$disliker}}</li>{{/foreach}}</ul>
- </div>
- <div class="modal-footer clear">
- <button type="button" class="btn btn-default" data-dismiss="modal">{{$modal_dismiss}}</button>
- </div>
- </div><!-- /.modal-content -->
- </div><!-- /.modal-dialog -->
- </div><!-- /.modal -->
+ {{if $dislike_count}}
+ <div class="btn-group">
+ <button type="button" class="btn btn-default btn-sm wall-item-dislike dropdown-toggle" data-toggle="dropdown" id="wall-item-dislike-{{$id}}">{{$dislike_count}} {{$dislike_button_label}}</button>
+ {{if $dislike_list_part}}
+ <ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-dislike-{{$id}}">{{foreach $dislike_list_part as $disliker}}<li role="presentation">{{$disliker}}</li>{{/foreach}}</ul>
+ {{else}}
+ <ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-dislike-{{$id}}">{{foreach $dislike_list as $disliker}}<li role="presentation">{{$disliker}}</li>{{/foreach}}</ul>
+ {{/if}}
+ </div>
{{/if}}
</div>
+ {{if $like_list_part}}
+ <div class="modal" id="likeModal-{{$id}}">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+ <h4 class="modal-title">{{$like_modal_title}}</h4>
+ </div>
+ <div class="modal-body">
+ <ul>{{foreach $like_list as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul>
+ </div>
+ <div class="modal-footer clear">
+ <button type="button" class="btn btn-default" data-dismiss="modal">{{$modal_dismiss}}</button>
+ </div>
+ </div><!-- /.modal-content -->
+ </div><!-- /.modal-dialog -->
+ </div><!-- /.modal -->
+ {{/if}}
+ {{if $dislike_list_part}}
+ <div class="modal" id="dislikeModal-{{$id}}">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+ <h4 class="modal-title">{{$dislike_modal_title}}</h4>
+ </div>
+ <div class="modal-body">
+ <ul>{{foreach $dislike_list as $disliker}}<li role="presentation">{{$disliker}}</li>{{/foreach}}</ul>
+ </div>
+ <div class="modal-footer clear">
+ <button type="button" class="btn btn-default" data-dismiss="modal">{{$modal_dismiss}}</button>
+ </div>
+ </div><!-- /.modal-content -->
+ </div><!-- /.modal-dialog -->
+ </div><!-- /.modal -->
+ {{/if}}
</div>
- {{/if}}
-
- {{if $likebuttons}}
- <div class="photo-item-tools-right btn-group pull-right">
- <button type="button" class="btn btn-default btn-sm" onclick="dolike({{$id}},'like'); return false">
- <i class="icon-thumbs-up-alt" title="{{$likethis}}"></i>
- </button>
- <button type="button" class="btn btn-default btn-sm" onclick="dolike({{$id}},'dislike'); return false">
- <i class="icon-thumbs-down-alt" title="{{$nolike}}"></i>
- </button>
- </div>
- <div id="like-rotator-{{$id}}" class="like-rotator pull-right"></div>
- {{/if}}
-
- <div class="clear"></div>
</div>
+ {{/if}}
+ {{if $likebuttons}}
+ <div class="photo-item-tools-right btn-group pull-right">
+ <button type="button" class="btn btn-default btn-sm" onclick="dolike({{$id}},'like'); return false">
+ <i class="icon-thumbs-up-alt" title="{{$likethis}}"></i>
+ </button>
+ <button type="button" class="btn btn-default btn-sm" onclick="dolike({{$id}},'dislike'); return false">
+ <i class="icon-thumbs-down-alt" title="{{$nolike}}"></i>
+ </button>
+ </div>
+ <div id="like-rotator-{{$id}}" class="photo-like-rotator pull-right"></div>
+ {{/if}}
+ <div class="clear"></div>
</div>
+</div>
- {{$comments}}
-
- {{if $commentbox}}
- <div class="wall-item-comment-wrapper{{if $comments}} wall-item-comment-wrapper-wc{{/if}}" >
- {{$commentbox}}
- </div>
- {{/if}}
-
-
- <div class="clear"></div>
+{{$comments}}
+{{if $commentbox}}
+<div class="wall-item-comment-wrapper{{if $comments}} wall-item-comment-wrapper-wc{{/if}}" >
+ {{$commentbox}}
</div>
+{{/if}}
+
+<div class="clear"></div>
{{$paginate}}
diff --git a/view/tpl/photos_upload.tpl b/view/tpl/photos_upload.tpl
index d06af4f99..13fb41687 100755
--- a/view/tpl/photos_upload.tpl
+++ b/view/tpl/photos_upload.tpl
@@ -31,20 +31,20 @@
<div id="photos-upload-new-end" class="clear"></div>
- <div class="checkbox">
+ <div class="checkbox pull-left">
<label class="checkbox-inline" for="photos-upload-noshare" >
<input class="checkbox-inline" id="photos-upload-noshare" type="checkbox" name="not_visible" value="1" />{{$nosharetext}}
</label>
</div>
{{if $uploader}}
- <div id="photos-upload-noshare-end"></div>
- <div id="photos-upload-perms" class="photos-upload-perms" >
- <span id="jot-perms-icon" class="icon-{{$lockstate}}" ></span>
- <button class="btn btn-default btn-xs" data-toggle="modal" data-target="#aclModal" onclick="return false;">{{$permissions}}</button>
+ <div id="photos-upload-perms" class="pull-right">
+ <button class="btn btn-default btn-sm" data-toggle="modal" data-target="#aclModal" onclick="return false;">
+ <i id="jot-perms-icon" class="icon-{{$lockstate}}"></i>
+ </button>
+ <div class="pull-right">
+ {{$uploader}}
</div>
- <div id="photos-upload-perms-end" class="clear"></div>
- {{$uploader}}
{{/if}}
</form>
</div>