Initial motivation for this rework was to add support for the responsive thumbnnails (#474). But it also is a re-implementation instead of an enahncement of the existing code because the moveMediaDirectory function had grown into a mess. It was very hard to debug possible renaming bugs, like https://board.s9y.org/viewtopic.php?f=3&t=21185. This approach uses several small functions instead that can be combined and re-used.
The freetags plugin sets this->displaytag in the frontend_fetchentries hook, and only sets clean_page if it sees that variable in the entry_display hook. The result is that wrong entries are shown on tag pages. Adding the smartyvars allows caching the correct $entries the plugin would have returned, working around that limitation without simulatign the frontend_fetchentries hook.
fetchEntries is heaviliy realient on glboal state variables, and that was missed initially. The last commit c8bbb35aacee7af8527820f3d3d5fd47d1dbf340 fixed that partially, but did not catch all global state variables. Additionally, this fixed the clean_page mode as used by staticpage by adding the logic and event hook to printEntriesCached
Refer users to the code primer on docs.s9y.org
and serendipity_config.inc.php for a list of
special variables and their defaults.
Fixes#469.
Signed-off-by: Thomas Hochstein <thh@inter.net>
See #488 for the discussion.
Merge `dashboardLimit` and `dashboardDraftLimit`
to `dashboardEntriesLimit`
Signed-off-by: Thomas Hochstein <thh@inter.net>
Partially revert 7a0a9e215600284eb5aeea201d79563368f4c45b
serendipity_specialchars() and others were made to
return "" when fed something that is not a string.
So boolean values (1 or TRUE) will be returned as "",
i.e. FALSE, breaking the blog in interesting ways
(i.e. displaying wrong configuration values and
saving them to the database).
Closes#476.
Signed-off-by: Thomas Hochstein <thh@inter.net>
The dashboard will show up to $dashboardLimit future
entries; if the number of future entries is still
less than $dashboardDraftLimit, it will add drafts
up to $dashboardDraftLimit.
If there are _no_ future entries, $entries is no
array, but has a value of "1"; count($entries)
will then be one, too, so one draft less will
be shown.
Closes#465.
Signed-off-by: Thomas Hochstein <thh@inter.net>
!empty verifies that $username has been set with a significant value of any kind; is_string makes sure the type is really what is being expected in the following code.
Needs some testing, I am not sure how to solve the case now where "no category" shall be used. It will always fall back to the default category.
Probably if someone uses a default category, that's the intended behaviour?
Iconfont icons are of no value to screenreader users; in our case,
they get alternative text. By adding 'aria-hidden="true"' to the
<span> holding the iconfont icon, we avoid the screenreader trying
to announce the iconfont icon.