From 2f85d12a6c6bcaeb5e5197a86863b6915ab93ddb Mon Sep 17 00:00:00 2001 From: marijus Date: Mon, 3 Nov 2014 10:46:57 +0100 Subject: [PATCH 1/4] if deleting a photo go away to album --- mod/photos.php | 4 +++- view/tpl/photos_upload.tpl | 14 +++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index 48bc6d1e5..51ac4c25c 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)) { @@ -918,6 +918,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/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 @@
-
+
{{if $uploader}} -
-
- - +
+ +
+ {{$uploader}}
-
- {{$uploader}} {{/if}}
From 287d5e0f106eed3783ee120bafc338e7763e36e9 Mon Sep 17 00:00:00 2001 From: marijus Date: Mon, 3 Nov 2014 11:19:27 +0100 Subject: [PATCH 2/4] if uploading a photo go away to album --- mod/photos.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index 51ac4c25c..eb634259f 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -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') From 1d923d2b0d6b6b83c57d3ca257addcd1080f7f44 Mon Sep 17 00:00:00 2001 From: marijus Date: Mon, 3 Nov 2014 12:54:17 +0100 Subject: [PATCH 3/4] one
to much and css fixes --- view/css/mod_photos.css | 5 ++ view/tpl/photo_view.tpl | 157 +++++++++++++++++++--------------------- 2 files changed, 81 insertions(+), 81 deletions(-) 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 @@
{{if $like_count || $dislike_count}}
-
- {{if $like_count}} -
- - {{if $like_list_part}} - - {{else}} - - {{/if}} -
- {{/if}} - {{if $dislike_count}} -
- - {{if $dislike_list_part}} - - {{else}} - - {{/if}} -
+
+ {{if $like_count}} +
+ + {{if $like_list_part}} + + {{else}} + {{/if}}
- {{if $like_list_part}} - {{/if}} - {{if $dislike_list_part}} - + {{if $dislike_count}} +
+ + {{if $dislike_list_part}} + + {{else}} + + {{/if}} +
{{/if}}
+ {{if $like_list_part}} + + {{/if}} + {{if $dislike_list_part}} + + {{/if}}
- {{/if}} - - {{if $likebuttons}} -
- - -
- - {{/if}} - -
+ {{/if}} + {{if $likebuttons}} +
+ + +
+
+ {{/if}} +
- - {{$comments}} - - {{if $commentbox}} -
- {{$commentbox}} -
- {{/if}} - - -
-
+{{$comments}} + +{{if $commentbox}} +
+ {{$commentbox}} +
+{{/if}} + +
+ {{$paginate}} From 9984ff37e5df237ccdd0169387ade070babfd666 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Mon, 3 Nov 2014 15:33:59 +0000 Subject: [PATCH 4/4] innodb issue --- include/session.php | 5 +++-- 1 file changed, 3 insertions(+), 2 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;