Added config vars to influence dashboard limit
http://board.s9y.org/posting.php?mode=quote&f=10&p=10442506
This commit is contained in:
parent
863db549f7
commit
872d978d63
12
docs/NEWS
12
docs/NEWS
@ -3,6 +3,18 @@
|
||||
Version 2.1 ()
|
||||
------------------------------------------------------------------------
|
||||
|
||||
* Added two configuration variables that can be set in
|
||||
serendipity_config_local.inc.php to influence the dashboard
|
||||
entry limit:
|
||||
|
||||
- $serendipity['dashboardLimit']: How many future entries to
|
||||
fetch (default: 5)
|
||||
- $serendipity['dashboardDraftLimit']: How many entries in total
|
||||
shall be displayed in the dashboard section (default: 5)
|
||||
|
||||
(Draft entries will only be fetched if there are less future entries
|
||||
than the total entry limit)
|
||||
|
||||
* Fix: the syndication plugin now always uses absolute links for
|
||||
the subtome-button
|
||||
|
||||
|
@ -74,10 +74,17 @@ if (is_array($comments) && count($comments) > 0) {
|
||||
|
||||
$data['comments'] = $comments;
|
||||
|
||||
if (!isset($serendipity['dashboardLimit'])) {
|
||||
$serendipity['dashboardLimit'] = 5;
|
||||
}
|
||||
if (!isset($serendipity['dashboardDraftLimit'])) {
|
||||
$serendipity['dashboardDraftLimit'] = 5;
|
||||
}
|
||||
|
||||
$entries = serendipity_fetchEntries(
|
||||
false,
|
||||
false,
|
||||
5,
|
||||
(int)$serendipity['dashboardLimit'],
|
||||
true,
|
||||
false,
|
||||
'timestamp DESC',
|
||||
@ -85,12 +92,12 @@ $entries = serendipity_fetchEntries(
|
||||
);
|
||||
|
||||
$entriesAmount = count($entries);
|
||||
if ($entriesAmount < 5) {
|
||||
if ($entriesAmount < (int)$serendipity['dashboardDraftLimit']) {
|
||||
// there is still space for drafts
|
||||
$drafts = serendipity_fetchEntries(
|
||||
false,
|
||||
false,
|
||||
5- $entriesAmount,
|
||||
(int)$serendipity['dashboardDraftLimit'] - $entriesAmount,
|
||||
true,
|
||||
false,
|
||||
'timestamp DESC',
|
||||
|
Loading…
x
Reference in New Issue
Block a user