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 @@