Closed immanuelfodor closed 5 years ago
I don't think it's possible, considering the way the daily page currently works. As you said
the plugin only receives the links of the filtered day prepared and adjusted
If I'd add another hook after this line, would it be merged in a PR? https://github.com/shaarli/Shaarli/blob/master/index.php#L424
I think of something like this:
/* Hook to modify the raw links that will eventually be displayed on the Daily Shaarli. */
$pluginManager->executeHooks('filter_raw_daily', $linksToDisplay, $LINKSDB, array('loggedin' => $loginManager->isLoggedIn()));
This way a new/my new plugin could add more links (pseudocode):
$linksToDisplay += $LINKSDB->filterDay($this_day_last_week);
$linksToDisplay += $LINKSDB->filterDay($this_day_last_month);
$linksToDisplay += $LINKSDB->filterDay($this_day_last_year);
Plugins shouldn't manipulate $LINKSDB
directly as its format may change in the future.
However #160 and #161 are still open, which are feature requests to have more filter on the daily page.
Thanks, I've subscribed to those. Well, then I might patch the showDaily function directly through my custom dockerfile 😃
To be honest, I never put the Daily Shaarli a good use as I couldn't find the use case why would I want to see the links of today/previous day/etc when I'm using Shaarli as a note taking app.
This is why I wondered on creating a plugin that would add to today's links some older links that was added a week/month/year ago. It could work like Anki cards if I could see what I added before in these intervals to retain memory of information.
https://en.m.wikipedia.org/wiki/Anki_(software)
When I checked the demo plugin and how the
showDaily
function works inindex.php
, I quickly realized that the plugin only receives the links of the filtered day prepared and adjusted, so I couldn't do my own link addition here.Just in theory, could my idea work with the current plugin/database system? Before I start experimenting, I'd like to know if I could access all the links from a plugin's daily hook to make it work as described.
Ideally, it should be separate sections with its own subtitles that contains the additional links but I'd be happy even if I could mix today's links with the links posted on the same day a week/month/year ago.