Order posts in Orca forum

Hello,

Is there a way to have posts ordered from most recent to oldest in Orca forum?

Quote · 29 May 2011

Hello, yes it's possible I think. Post this in jobs section

PS: If possible do not write me personally, please try to ask on the forum first
Quote · 30 May 2011

 

Hello, yes it's possible I think. Post this in jobs section

 seriously, you cant just tell them how to change the sql statement for the sort order? you want this posted in the jobs section. unreal. this should be a controlled factor for administration of the site for the admin to be able to set the sort order of the posts.

When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support
Quote · 30 May 2011

Another issue with Orca forums I've noticed recently is posts remain in the forum even if a user is deleted. I can understand you might not want a deleted member's posts deleted from a forum as it may form the basis of that discussion/thread, but in the case of members who spam the forums it would be nice to not need to delete each post individually. It would be good to have an admin option for purging deleted members posts, if required - or, a at least checkbox when deleting a specific member who is also a persistent spammer (to delete their posts). 

Quote · 30 May 2011

Hello,

My question was more to know if this choice (order of posts) is already a parameter that can be set somewhere using web interface.

Of course I can try find the SQL request and change DESC by ASC and frankly speaking this is what I did. I have found this SQL request:

    function getTopicPost ($t, $x = 'last')
    {
        global $gConf;
        return $this->getRow ( "SELECT `user`, t1.`when` AS `when2`, DATE_FORMAT(FROM_UNIXTIME(`when`),'{$gConf['date_format']}') AS `when` FROM " . TF_FORUM_POST . " AS t1 WHERE `topic_id` = '$t' ORDER BY t1.`when` " . ('last' == $x ?  'DESC' : 'ASC') .  "  LIMIT 1");
    }

This let me think that this is already made to use a parameter to define if it must be ASC or DESC. But where and how?

Quote · 30 May 2011

Anyone have an idea on this yet. I also need to do this fix and not finding the proper file to edit topic display to DESC.

thanks

Quote · 23 Sep 2011

Hi,

I solved this by modifiying modules/boonex/forum/classes/DbForum.php file at line 480.

Before:

$sql =  "SELECT `ft`.`forum_id`, `t1`.`topic_id`, `t1`.`post_id`, `user`, `post_text`, `votes`, `hidden`, $sql_add1 DATE_FORMAT(FROM_UNIXTIME(t1.`when`),'{$gConf['date_format']}') AS `when` FROM " . TF_FORUM_POST . " AS t1 $sql_add2 INNER JOIN " . TF_FORUM_TOPIC . " AS `ft`  ON (`ft`.`topic_id` = `t1`.`topic_id`) WHERE $sName = '$sVal' ORDER BY t1.`when` ASC";

After:

$sql =  "SELECT `ft`.`forum_id`, `t1`.`topic_id`, `t1`.`post_id`, `user`, `post_text`, `votes`, `hidden`, $sql_add1 DATE_FORMAT(FROM_UNIXTIME(t1.`when`),'{$gConf['date_format']}') AS `when` FROM " . TF_FORUM_POST . " AS t1 $sql_add2 INNER JOIN " . TF_FORUM_TOPIC . " AS `ft`  ON (`ft`.`topic_id` = `t1`.`topic_id`) WHERE $sName = '$sVal' ORDER BY t1.`when` DESC";

Quote · 25 Sep 2011

That did the the trick. thanks

 

For groups forum it's - classes/en/DbForum.php

Quote · 19 Oct 2011

In 7.1 I think it is like this, it seems to work...

$sql =  "SELECT `ft`.`forum_id`, `t1`.`topic_id`, `t1`.`post_id`, `user`, `post_text`, `votes`, `hidden`, t1.`when` $sql_add1 FROM " . TF_FORUM_POST . " AS t1 $sql_add2 INNER JOIN " . TF_FORUM_TOPIC . " AS `ft`  ON (`ft`.`topic_id` = `t1`.`topic_id`) WHERE $sName = '$sVal' ORDER BY t1.`when` " . ('ASC' == $sOrder ? 'ASC' : 'DESC') . ((int)$iLimit ? ' LIMIT ' . (int)$iLimit : '');

$sql = "SELECT `ft`.`forum_id`, `t1`.`topic_id`, `t1`.`post_id`, `user`, `post_text`, `votes`, `hidden`, t1.`when` $sql_add1 FROM " . TF_FORUM_POST . " AS t1 $sql_add2 INNER JOIN " . TF_FORUM_TOPIC . " AS `ft` ON (`ft`.`topic_id` = `t1`.`topic_id`) WHERE $sName = '$sVal' ORDER BY t1.`when` " . ('DESC' == $sOrder ? 'ASC' : 'DESC') . ((int)$iLimit ? ' LIMIT ' . (int)$iLimit : '');

Baloo
Quote · 9 Feb 2013

And in SMF one can set on a per user basis if the forum posts should be ascending or descending as well as the admin setting a default for the board.

Geeks, making the world a better place
Quote · 9 Feb 2013

Not working for me.  $sOrder is passed in the function; but changing it there does not see to matter either.

Geeks, making the world a better place
Quote · 9 Feb 2013

    function getTopicPost ($t, $x = 'last')
    {
        global $gConf;
        $sOrderDir = ('first' == $x ?  'DESC' : 'ASC');
        return $this->getRow ( "SELECT `user`, t1.`when` AS `when2`, `when` FROM " . TF_FORUM_POST . " AS t1 WHERE `topic_id` = '$t' ORDER BY t1.`when` $sOrderDir, t1.`post_id` $sOrderDir LIMIT 1");
    }

Works on the test site but not on the production site; caches cleared.

Geeks, making the world a better place
Quote · 9 Feb 2013

Interesting, even rewriting the files back, the test site order will not change.

Geeks, making the world a better place
Quote · 9 Feb 2013

 

Not working for me.  $sOrder is passed in the function; but changing it there does not see to matter either.

 geek_girl it works fine with me since, but I think I have to recompile the language so that it works in addition to clear cache

Baloo
Quote · 22 Feb 2013

I upgraded to 7.1.4 today (from 7.0.9) and was unable to find a way to get forum posts from most recent as I managed to have.

Did anyone find a way to achieve it?

Quote · 9 Mar 2015
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.