Board index Plugins 'Show Entries in sidebar' plugin - random order?

Creating and modifying plugins.
Christine
Regular
 
Posts: 51
Joined: Thu Mar 26, 2009 12:50 am

Postby Christine » Sat Jul 08, 2017 5:34 am

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?

User avatar
garvinhicking
Core Developer
 
Posts: 29970
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Mon Jul 10, 2017 1:38 pm

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: 51
Joined: Thu Mar 26, 2009 12:50 am

Postby Christine » Tue Jul 11, 2017 3:20 am

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: 51
Joined: Thu Mar 26, 2009 12:50 am

Postby Christine » Tue Jul 11, 2017 6:44 pm

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

Postby zarzanola » Wed Aug 02, 2017 12:21 pm

I'm not sure if deleting the timestamp was the right thing to do, is it all working correctly now?

Christine
Regular
 
Posts: 51
Joined: Thu Mar 26, 2009 12:50 am

Postby Christine » Mon Aug 07, 2017 3:03 am

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: 51
Joined: Thu Mar 26, 2009 12:50 am

Postby Christine » Thu Sep 28, 2017 9:10 am

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.

User avatar
onli
Regular
 
Posts: 2062
Joined: Tue Sep 09, 2008 10:04 pm

Postby onli » Thu Sep 28, 2017 7:00 pm

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



Return to Plugins

Who is online

Users browsing this forum: No registered users and 3 guests