Page 1 of 2
Help sorting Recent Entries descending order
Posted: Wed Feb 28, 2007 10:52 pm
by digitalfilm
Using the plug in "recent entries" I am unable to find a way to sort by descending order... most recent first.
I read the thread on doing this with a single category, but not for all categories. Is there something I missed?
Thank you
Re: Help sorting Recent Entries descending order
Posted: Thu Mar 01, 2007 11:40 am
by garvinhicking
Hi!
The recent entries plugin does sort the most recent first, and older bottom. In the PHP sourcecode it's "ORDER BY timestamp DESC". You cannot configure this currently, but this should already be what you're searching for?
Best regards,
Garvin
for some reason it sorts ASC
Posted: Thu Mar 01, 2007 11:31 pm
by digitalfilm
If you look at
http://group8020.com in the right hand column you will see that it is sorting with the oldest entries on top, newest on the bottom. Perhaps I am misunderstanding something?
Thanks for the assistance!
Re: for some reason it sorts ASC
Posted: Thu Mar 01, 2007 11:38 pm
by garvinhicking
Hi!
Uh, that's really strange. Could you check the file plugins/serendipity_plugin_recententries/serendipity_plugin_recententries.php and look for "ORDER BY" - and tell if if it reads 'ASC' or 'DESC' for you?
You could try to change that to read 'DESC' or 'ASC' (the opposite of what you'Re using now). But I'd be confused if it currently reads 'asc'...?!?
Regards,
Garvin
Plugin indicates sort by DESC
Posted: Fri Mar 02, 2007 12:00 am
by digitalfilm
I checked the php file and it says:
--------------------------------------------------
$entries_query = "SELECT DISTINCT id,
title,
timestamp
FROM {$serendipity['dbPrefix']}entries
$sql_join
WHERE isdraft = 'false' AND timestamp <= " . time() . "
$sql_where
ORDER BY timestamp DESC
$sql_number";
$entries = serendipity_db_query($entries_query);
--------------------------------------------------
I had also tried changing the sort order with the category properties template per a previous posting here on the board prior to asking for help but it also had no effect.
Should I try remove and then reinstalling the plugin?
Re: Plugin indicates sort by DESC
Posted: Fri Mar 02, 2007 12:02 am
by garvinhicking
Hi!
What happens if in that plugin you change it to "ORDER BY timestamp ASC"?
Regards,
Garvin
nothing changed
Posted: Fri Mar 02, 2007 6:49 pm
by digitalfilm
interestingly enough, nothing changed which seemed odd.
hmm, spartacus seems unhappy
Posted: Fri Mar 02, 2007 7:08 pm
by digitalfilm
don't know if this helps or not, but when i deleted the plugin from the admin console and removed it from my server via ftp i went to reinstall it and got the message that zero bytes are being retrieved:
Trying to open URL package_sidebar_en.xml...
Fetched 0 bytes from the URL above. Saving file as /home/server/pathl/blog/templates_c/package_sidebar_en.xml...
Data successfully fetched.
Re: hmm, spartacus seems unhappy
Posted: Sat Mar 03, 2007 11:44 pm
by garvinhicking
Hi!
Which Mirror did you set in the spartacus plugin?
Try to delete the mentioned .xml file, then spartacus will try to re-fetch it.
If the sort order didn't change after you changed the plugin php code, this should mean that you did not edit the plugin'S file that's actually active? Maybe you had a second copy lieing on the server somehow?
Regards,
Garvin
Posted: Sat Mar 10, 2007 2:54 pm
by antoniolite
Hi,
I have the same problem in
www.casarusia.com, i tried everthing but the recent entries still shows from oldest to newer.
maybe it is a x-file?
Posted: Sun Mar 11, 2007 1:18 pm
by garvinhicking
Hi antoniolite!
Which changes did you try exactly? Which file did you edit?
You could try to add some random "echo 'Tst!';" to the generate_content function of that file to see if the file you are editing is actually the right one and shows the changes?
Regards,
Garvin
Posted: Sat Apr 07, 2007 12:44 pm
by antoniolite
Hello,
i added a "echo $entries_query;" after construct the select query, and this is what i got:
Code: Select all
SELECT DISTINCT id, title, timestamp FROM s9y_entries WHERE isdraft = 'false' AND timestamp <= 1175942543 ORDER BY timestamp DESC LIMIT 10
Looks right, but i continue getting recent entries from older to newer
Regards
Posted: Tue Apr 10, 2007 10:24 am
by garvinhicking
Hi!
If you execute that SQL query in phpmyadmin, is it still the wrong order? What happens if you replace "DESC" with "ASC"?
Best regards,
Garvin
Posted: Tue Apr 10, 2007 11:29 am
by antoniolite
Very strange...
if i execute the query in phpmyadmin, i get the same result... with ASC and DESC...
I changed the query to:
Code: Select all
SELECT * FROM s9y_entries WHERE isdraft = 'false' ORDER BY id DESC LIMIT 10;
and looks like now i get the recent entries correctly. Is not a good solution, but it works

Posted: Tue Apr 10, 2007 11:47 am
by garvinhicking
Hi!
How about using this Query:
Code: Select all
SELECT DISTINCT id, title, `timestamp` FROM s9y_entries WHERE isdraft = 'false' AND timestamp <= 1175942543 ORDER BY `timestamp` DESC LIMIT 10
Maybe the reserved word 'timestamp' is somehow wrongly evaluated...?
Regards,
Garvin