Merge branch 'develop' into issue/#3062
* develop: (68 commits) Added documentation update to the translation update to the translations translation docs now contain basic usage of the Transifex client - Replace TinyMCE-enabled filebrowser.tpl by filebrowser_plain.tpl content - Remove misc TinyMCE mentions in docs and minifyjs - Remove $theme_richtext_editor boot var - Remove "richtext" feature - Remove fix_mce_lf() function - Remove nomce parameter - Remove TinyMCE mentions in themes - Remove tinyMCE mentions or convert to addeditortext() - Remove $editselect template value Remove tinyMCE libraries limit the description of the meta tag to 160 characters in /mod/display Improved handling of non string values in the config Bugfix: Caching of non string cache values now works. Reformatted stuff, improved query Auto-focus first input field of modal when shown Use cache instead of config for storing last proc_run time Some added logging Bugfix for masses of php warnings Rearranged the logging Some changed logging ... # Conflicts: # view/theme/frost-mobile/js/theme.js # view/theme/frost/js/theme.js
This commit is contained in:
commit
c38a5e443d
438 changed files with 108865 additions and 144355 deletions
|
@ -10,6 +10,8 @@ require_once('include/tags.php');
|
|||
require_once('include/threads.php');
|
||||
require_once('include/Probe.php');
|
||||
|
||||
use \Friendica\Core\Config;
|
||||
|
||||
function photos_init(App $a) {
|
||||
|
||||
if ($a->argc > 1)
|
||||
|
@ -1339,35 +1341,38 @@ function photos_content(App $a) {
|
|||
$prevlink = '';
|
||||
$nextlink = '';
|
||||
|
||||
if ($_GET['order'] === 'posted')
|
||||
$order = 'ASC';
|
||||
else
|
||||
$order = 'DESC';
|
||||
/// @todo This query is totally bad, the whole functionality has to be changed
|
||||
// The query leads to a really intense used index.
|
||||
// By now we hide it if someone wants to.
|
||||
if (!Config::get('system', 'no_count', false)) {
|
||||
if ($_GET['order'] === 'posted')
|
||||
$order = 'ASC';
|
||||
else
|
||||
$order = 'DESC';
|
||||
|
||||
$prvnxt = qu("SELECT `resource-id` FROM `photo` WHERE `album` = '%s' AND `uid` = %d AND `scale` = 0
|
||||
$sql_extra ORDER BY `created` $order ",
|
||||
dbesc($ph[0]['album']),
|
||||
intval($owner_uid)
|
||||
);
|
||||
|
||||
$prvnxt = qu("SELECT `resource-id` FROM `photo` WHERE `album` = '%s' AND `uid` = %d AND `scale` = 0
|
||||
$sql_extra ORDER BY `created` $order ",
|
||||
dbesc($ph[0]['album']),
|
||||
intval($owner_uid)
|
||||
);
|
||||
|
||||
if (count($prvnxt)) {
|
||||
for($z = 0; $z < count($prvnxt); $z++) {
|
||||
if ($prvnxt[$z]['resource-id'] == $ph[0]['resource-id']) {
|
||||
$prv = $z - 1;
|
||||
$nxt = $z + 1;
|
||||
if ($prv < 0)
|
||||
$prv = count($prvnxt) - 1;
|
||||
if ($nxt >= count($prvnxt))
|
||||
$nxt = 0;
|
||||
break;
|
||||
if (count($prvnxt)) {
|
||||
for($z = 0; $z < count($prvnxt); $z++) {
|
||||
if ($prvnxt[$z]['resource-id'] == $ph[0]['resource-id']) {
|
||||
$prv = $z - 1;
|
||||
$nxt = $z + 1;
|
||||
if ($prv < 0)
|
||||
$prv = count($prvnxt) - 1;
|
||||
if ($nxt >= count($prvnxt))
|
||||
$nxt = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$edit_suffix = ((($cmd === 'edit') && ($can_post)) ? '/edit' : '');
|
||||
$prevlink = 'photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$prv]['resource-id'] . $edit_suffix . (($_GET['order'] === 'posted') ? '?f=&order=posted' : '');
|
||||
$nextlink = 'photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$nxt]['resource-id'] . $edit_suffix . (($_GET['order'] === 'posted') ? '?f=&order=posted' : '');
|
||||
}
|
||||
|
||||
$edit_suffix = ((($cmd === 'edit') && ($can_post)) ? '/edit' : '');
|
||||
$prevlink = 'photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$prv]['resource-id'] . $edit_suffix . (($_GET['order'] === 'posted') ? '?f=&order=posted' : '');
|
||||
$nextlink = 'photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$nxt]['resource-id'] . $edit_suffix . (($_GET['order'] === 'posted') ? '?f=&order=posted' : '');
|
||||
}
|
||||
}
|
||||
|
||||
if (count($ph) == 1)
|
||||
$hires = $lores = $ph[0];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue