Page 1 of 1

'Show Entries in sidebar' plugin - random order?

Posted: Sat Jul 08, 2017 5:34 am
by Christine
Is there a way I could set the 'Show Entries in sidebar' plugin (serendipity_plugin_showentries) to display entries in a random order, rather than by most recent?

If not, would this be an option you might consider adding in an update?

Re: 'Show Entries in sidebar' plugin - random order?

Posted: Mon Jul 10, 2017 1:38 pm
by garvinhicking
Hey,

for the time being you could try to edit the plugins/serendipity_plugin_showentries.php file and replace this:

Code: Select all

$entries     = serendipity_fetchEntries(null, true, $limit, false, false, 'timestamp DESC', '', false, true);
with:

Code: Select all

$entries     = serendipity_fetchEntries(null, true, $limit, false, false, 'RAND()', '', false, true);
That would work on MySQL; random ordering on other database backend is a problem though, which is why it's not easily available within the plugin yet.

Re: 'Show Entries in sidebar' plugin - random order?

Posted: Tue Jul 11, 2017 3:20 am
by Christine
I should have mentioned, that is the one thing I tried. But since it didn't work (it still was ordered by timestamp), I thought I was on the wrong track.

Re: 'Show Entries in sidebar' plugin - random order?

Posted: Tue Jul 11, 2017 6:44 pm
by Christine
It seems to have been to do with the Category Templates plugin. It was interfering with randomising even if I set the showentries plugin to a Category I hadn't applied any of the categorytemplates settings to.I had to uninstall it, remove it from the database, and when saving the configuration for categorytemplates, delete timestamp DESC.

Re: 'Show Entries in sidebar' plugin - random order?

Posted: Wed Aug 02, 2017 12:21 pm
by zarzanola
I'm not sure if deleting the timestamp was the right thing to do, is it all working correctly now?

Re: 'Show Entries in sidebar' plugin - random order?

Posted: Mon Aug 07, 2017 3:03 am
by Christine
Yep, it's working fine. I just meant I deleted 'timestamp DESC' on the plugin configuration page, where it was autofilling that.

Re: 'Show Entries in sidebar' plugin - random order?

Posted: Thu Sep 28, 2017 9:10 am
by Christine
Hello! No questions to ask, I just thought I might show you what I did with this plugin and why I was asking lots of strange, specific questions!

I've got 2 installations of the 'Show Entries in sidebar' plugin - one that shows the latest entry from a particular category in the sidebar of the main part of my blog, and another you can see on, for example, this page. Here, I have it show entries from a category inside a slider in a random order. I'm happy with how it's working! Thanks for all your help.

Re: 'Show Entries in sidebar' plugin - random order?

Posted: Thu Sep 28, 2017 7:00 pm
by onli
Seems to work fine, and your blog design is really something special. Nice.