Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
This commit is contained in:
commit
e843d27f8c
@ -692,19 +692,16 @@ class Photos extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$album = (($datum) ? hex2bin($datum) : '');
|
$album = (($datum) ? hex2bin($datum) : '');
|
||||||
|
|
||||||
|
|
||||||
\App::$page['htmlhead'] .= "\r\n" . '<link rel="alternate" type="application/json+oembed" href="' . z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . \App::$cmd) . '" title="oembed" />' . "\r\n";
|
\App::$page['htmlhead'] .= "\r\n" . '<link rel="alternate" type="application/json+oembed" href="' . z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . \App::$cmd) . '" title="oembed" />' . "\r\n";
|
||||||
|
|
||||||
$r = q("SELECT resource_id, max(imgscale) AS imgscale FROM photo WHERE uid = %d AND album = '%s'
|
//check if the album exists and if we have perms
|
||||||
AND imgscale <= 4 and photo_usage IN ( %d, %d ) and is_nsfw = %d $sql_extra GROUP BY resource_id",
|
$r = q("SELECT album FROM photo WHERE uid = %d AND album = '%s' and is_nsfw = %d $sql_extra LIMIT 1",
|
||||||
intval($owner_uid),
|
intval($owner_uid),
|
||||||
dbesc($album),
|
dbesc($album),
|
||||||
intval(PHOTO_NORMAL),
|
|
||||||
intval(PHOTO_PROFILE),
|
|
||||||
intval($unsafe)
|
intval($unsafe)
|
||||||
);
|
);
|
||||||
if(count($r)) {
|
|
||||||
\App::set_pager_total(count($r));
|
if($r) {
|
||||||
\App::set_pager_itemspage(60);
|
\App::set_pager_itemspage(60);
|
||||||
} else {
|
} else {
|
||||||
goaway(z_root() . '/photos/' . \App::$data['channel']['channel_address']);
|
goaway(z_root() . '/photos/' . \App::$data['channel']['channel_address']);
|
||||||
|
@ -464,10 +464,15 @@ function photos_albums_list($channel, $observer, $sort_key = 'album', $direction
|
|||||||
$sort_key = dbesc($sort_key);
|
$sort_key = dbesc($sort_key);
|
||||||
$direction = dbesc($direction);
|
$direction = dbesc($direction);
|
||||||
|
|
||||||
$albums = q("SELECT count( distinct resource_id ) as total, album from photo where uid = %d and photo_usage IN ( %d, %d ) $sql_extra group by album order by $sort_key $direction",
|
//$albums = q("SELECT count( distinct resource_id ) as total, album from photo where uid = %d and photo_usage IN ( %d, %d ) $sql_extra group by album order by $sort_key $direction",
|
||||||
intval($channel_id),
|
// intval($channel_id),
|
||||||
intval(PHOTO_NORMAL),
|
// intval(PHOTO_NORMAL),
|
||||||
intval(PHOTO_PROFILE)
|
// intval(PHOTO_PROFILE)
|
||||||
|
//);
|
||||||
|
|
||||||
|
// this query provides the same results but might perform better
|
||||||
|
$albums = q("SELECT count( distinct resource_id ) as total, album from photo where uid = %d and os_storage = 1 $sql_extra group by album order by $sort_key $direction",
|
||||||
|
intval($channel_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
// add various encodings to the array so we can just loop through and pick them out in a template
|
// add various encodings to the array so we can just loop through and pick them out in a template
|
||||||
@ -490,6 +495,8 @@ function photos_albums_list($channel, $observer, $sort_key = 'album', $direction
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
App::$data['albums'] = $ret;
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
/* generals */
|
/* generals */
|
||||||
html {
|
html {
|
||||||
font-size: 100%;
|
font-size: 100%;
|
||||||
overflow-x: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@ -21,7 +20,6 @@ body {
|
|||||||
background-size: cover;
|
background-size: cover;
|
||||||
color: $font_colour;
|
color: $font_colour;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
overflow-x: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
aside {
|
aside {
|
||||||
|
@ -99,11 +99,13 @@ function makeFullScreen(full) {
|
|||||||
function toggleAside() {
|
function toggleAside() {
|
||||||
$('#expand-aside-icon').toggleClass('fa-arrow-circle-right').toggleClass('fa-arrow-circle-left');
|
$('#expand-aside-icon').toggleClass('fa-arrow-circle-right').toggleClass('fa-arrow-circle-left');
|
||||||
if($('main').hasClass('region_1-on')){
|
if($('main').hasClass('region_1-on')){
|
||||||
|
$('html, body').css('overflow-x', '');
|
||||||
$('main').removeClass('region_1-on')
|
$('main').removeClass('region_1-on')
|
||||||
$('#overlay').remove();
|
$('#overlay').remove();
|
||||||
$('#left_aside_wrapper').trigger("sticky_kit:detach");
|
$('#left_aside_wrapper').trigger("sticky_kit:detach");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
$('html, body').css('overflow-x', 'hidden');
|
||||||
$('main').addClass('region_1-on')
|
$('main').addClass('region_1-on')
|
||||||
$('<div id="overlay"></div>').appendTo('section');
|
$('<div id="overlay"></div>').appendTo('section');
|
||||||
$('#left_aside_wrapper').stick_in_parent({
|
$('#left_aside_wrapper').stick_in_parent({
|
||||||
|
Reference in New Issue
Block a user