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?
'Show Entries in sidebar' plugin - random order?
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: 'Show Entries in sidebar' plugin - random order?
Hey,
for the time being you could try to edit the plugins/serendipity_plugin_showentries.php file and replace this:
with:
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.
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);
Code: Select all
$entries = serendipity_fetchEntries(null, true, $limit, false, false, 'RAND()', '', false, true);
# 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/
# 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/
Re: 'Show Entries in sidebar' plugin - random order?
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?
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?
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?
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?
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.
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?
Seems to work fine, and your blog design is really something special. Nice.