Has anyone looked into setting up blogs so when you view posts, you can select the order they appear in?
As in, by default they show latest post at top. Would be great if there was an order reversal option...
Anyone looked into this yet? Im sure it should be a fairly common need for blog users.
|
|
makes sense if blogs are continuous content... such as diary, or story etc... |
exactly.
Since I can't seem to find a book mod for my site I would like to use the blog feature as an alternate but the current sorting setting is not good for such purpose.
makes sense if blogs are continuous content... such as diary, or story etc...
|
It is possible to change default sorting order in Blogs in modules/boonex/blogs/classes/BxBlogsSearchUnit.php file:
function setSorting ()
{
$this->aCurrent['sorting'] = (false !== bx_get('blogs_mode')) ? bx_get('blogs_mode') : $this->aCurrent['sorting'];
if( $this->aCurrent['sorting'] != 'top' && $this->aCurrent['sorting'] != 'last' && $this->aCurrent['sorting'] != 'score' && $this->aCurrent['sorting'] != 'popular')
$this->aCurrent['sorting'] = 'last';
}
Just change 'last' to 'popular' for example.
Rules → http://www.boonex.com/terms |
Can you just make it 'asc' as in ascending? I think that's what he wants. each of the options you list there, top, last, score, and popular won't do what he's asking. http://towtalk.net ... Hosted by Zarconia.net! |
Thanks AlexT, but do you know how to add asc/desc order so readers can choose first or last?
Mine will be used for ongoing blogs, even books in a sense! Reading latest post is great, if you've already read the rest and are keeping up with changes. For most though, will need to start at the beginning!
Any help appreciated :-)
|
To implement custom sorting you need to make changes in function just below 'setSorting' function in the same modules/boonex/blogs/classes/BxBlogsSearchUnit.php file:
function getAlterOrder()
{
if ($this->aCurrent['sorting'] == 'popular') {
$aSql = array();
$aSql['order'] = " ORDER BY `CommentsCount` DESC, `PostDate` DESC";
return $aSql;
}
return array();
}
Rules → http://www.boonex.com/terms |
thanks Alex, tried this but then get this error when viewing site
Fatal error: Cannot redeclare BxBlogsSearchUnit::getAlterOrder() in /modules/boonex/blogs/classes/BxBlogsSearchUnit.php on line 530
|
Alex, could you check this if you get a mo please, would be really helpful to get this to work but the code you posted just gives me an error and can no longer access the site when using it.
Thanks :-)
|
I am keeping up with the Kardashians ,too. |
Modzz was working to improve his module to add chapters which will make it a better "book" module. Geeks, making the world a better place |
I bought the multiple blogs mod by Modzzz which does have sort first/last filter. It's a good mod, but it changes the categories setup so that you place actual blogs into cats, instead of blog posts. This was something that didnt work on my site so gone back to ultimate blogs instead of 'standard' blogs...
still dont have first/last filtering now though!
|
AlexT, could you double check the code you posted as it just gives an error message for me.
Appreciate it.
Thanks :-)
|
What AlexT provided was a guidance, not a solution. The function exists already so you cannot copy and paste it again. he is simply saying that you need to make some modifications to that function to achieve what you want.
AlexT, could you double check the code you posted as it just gives an error message for me.
Appreciate it.
Thanks :-)
Paypal email is jeromemingo@gmail.com - http://www.boonex.com/market/posts/modzzz |
|
Ultimate Blogs module has been updated to allow members to sort postings on Blog page in Oldest or Newest order.
I bought the multiple blogs mod by Modzzz which does have sort first/last filter. It's a good mod, but it changes the categories setup so that you place actual blogs into cats, instead of blog posts. This was something that didnt work on my site so gone back to ultimate blogs instead of 'standard' blogs...
still dont have first/last filtering now though!
Paypal email is jeromemingo@gmail.com - http://www.boonex.com/market/posts/modzzz |