'Show Entries in sidebar' plugin - random order?

Creating and modifying plugins.
Post Reply
Christine
Regular
Posts: 54
Joined: Wed Mar 25, 2009 11:50 pm

'Show Entries in sidebar' plugin - random order?

Post 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?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

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

Post 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.
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Christine
Regular
Posts: 54
Joined: Wed Mar 25, 2009 11:50 pm

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

Post 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.
Christine
Regular
Posts: 54
Joined: Wed Mar 25, 2009 11:50 pm

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

Post 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.
zarzanola
Regular
Posts: 15
Joined: Mon Jul 03, 2017 10:34 am

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

Post by zarzanola »

I'm not sure if deleting the timestamp was the right thing to do, is it all working correctly now?
Christine
Regular
Posts: 54
Joined: Wed Mar 25, 2009 11:50 pm

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

Post by Christine »

Yep, it's working fine. I just meant I deleted 'timestamp DESC' on the plugin configuration page, where it was autofilling that.
Christine
Regular
Posts: 54
Joined: Wed Mar 25, 2009 11:50 pm

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

Post 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.
onli
Regular
Posts: 2822
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

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

Post by onli »

Seems to work fine, and your blog design is really something special. Nice.
Post Reply