Page 1 of 1

[solved] Blogsms oldestfirst not working

Posted: Tue Apr 01, 2008 11:19 pm
by mmaurits
I have installed Blogs made simple 0.3.0b2, i've put some entries in it and i want to show the diferent catagorys on diferent pages, i made the catagorys cat1 cat2 etc.

Now when i put this code in the content page:
{cms_module module="Blogs"}
It shows al the entries, with the newest on top, but when i call 1 catagory with this code:
{cms_module module="Blogs" catid="cat1"}
It shows only the entries from cat1 (what i asked for) but with the oldest entry on top, putting parameter
oldestfirst="false"
in it didn't change a thing, are there more people with this problem?

Re: Blogsms oldestfirst not working

Posted: Wed Apr 02, 2008 5:59 am
by chpochon
Yes, same problem here. I'm still looking everywhere for a solution.

Re: Blogsms oldestfirst not working

Posted: Wed Apr 02, 2008 6:19 am
by chpochon
I've just found a solution working for me.
In Blogs.module.php, line 358 we have :

Code: Select all

    

$query="SELECT DISTINCT entry.* FROM ".cms_db_prefix()."module_blogs_entries AS entry LEFT JOIN ".cms_db_prefix()."module_blogs_comments AS comment ON entry.id=comment.entry WHERE entry.category=? $active ORDER BY comment.createtime";


This means that the entries will be ordered by the date of the comments !!!

So I've changed that line into :

Code: Select all


$query="SELECT DISTINCT entry.* FROM ".cms_db_prefix()."module_blogs_entries AS entry LEFT JOIN ".cms_db_prefix()."module_blogs_comments AS comment ON entry.id=comment.entry WHERE entry.category=? $active ORDER BY entry.createtime"


(only changed the end of the line, "comment.createtime" becomes "entry.createtime")

And it works !

Re: Blogsms oldestfirst not working

Posted: Wed Apr 02, 2008 9:49 am
by mmaurits
Thanks, it also works here.