Guest
10 Oct 2013 11:24

Greetings,

I have noticed that when someone makes a new comment to a forum post, the category or forum view doesn't move that post to the top like it does in typical forum software.

In other words, lets say I have a forum named "All About Pizza"...

I have several topics in that forum: "Meat Lovers Pizza", "Cheese Only", and "Supreme all the way".

Because the Supreme all the Way topic was created last, it is the first topic listed in the forum view page. Put if a new comment was made to the Meat Lover's Pizza, thus making that the latest topic to be updated, it still stays at the bottom. How do I get the Cobalt Forum Module to let me sort it so that the latest comments causes the forum topic sorting?

Attached is a screenshot of one of my forum categories to show you what I mean. Servants of the Eternal Flame hast the latest comment, but it stays farther down the list behind topics who's comments are before that.

Last Modified: 02 Mar 2014


Guest
10 Oct 2013 13:10

Thanks for your reply,

Unfortunately, "Least Commented" does not achieve what I am after. It put the topic that has the least amount of replies on top.

What I am after is a sorting that the topic that was the most recently posted/commented into goes first, regardless of how many replies said topic has or when said topic was originally posted. That way the topics order always reflects posting activity like in most typical forum software.

I know and understand that Cobalt, despite having some awesome forum stuff, is first and foremost a content construction kit. I also am using it for character profile forms, blogs, and am thinking of creating "faction private forums" with it as well. It is an awesome tool that I know that I am bending to cover an area that is not the tool's first priority.

But sorting by latest/most recent comment should be possible, yes?

Thanks again for your time.


pepperstreet VIP
Total posts: 3,837
10 Oct 2013 13:32

Unfortunately, "Least Commented" does not achieve what I am after. It put the topic that has the least amount of replies on top.

Bummer! My fault ._. I was in a hurry, and simply read it as "last" :D


pepperstreet VIP
Total posts: 3,837
10 Oct 2013 13:36

But sorting by latest/most recent comment should be possible, yes?

For sure, a very good point. Maybe "Sergey" can answer it... and maybe implement something like this. In general, it should be possible. Not sure about any performance- or technical issues though.


pepperstreet VIP
Total posts: 3,837
10 Oct 2013 13:43

Just a quick thought, if a sorting order option is not possible for some reason:

  • A new comment could modify and trigger the "last modified" date of the topic. Maybe in-correct to use and change this information, but a possible workaround. Actually the "topic" has not changed... but it was updated... and that is the important info for the visiter.

  • If section could be sorted by default by a custom date field ;-) That would be a cleaner solution.


Guest
10 Oct 2013 14:09

We shall wait on Sergey then :).

For the record, I tried all of the other ordering methods as well. So yeah... My guess is that since Cobalt is almost always used for form generation and creation, and forum use is a very minor part of it (they don't know what they are missing though) that ordering based on last/latest comment wasn't considered before.


Sergey
Total posts: 13,748
11 Oct 2013 01:31

On every comment, article modification time is altered. So if you order by latest modified, you get what you need.


Guest
11 Oct 2013 06:28

I wish that was true Sergey, maybe something is broken on my site?

I have it as "Last Modified" I had it as "Last Modified in the screenshot above. But the Last Modified post (as in pst with the most resent comment) still shos up beneath a post who's comment was a day earlier thus an older comment.

I'm going to provide a direct link - you should be able to see it as a guest. If this breaks the rules here, my appologies and feel free to remove said link or tell me to (if it will let me edit the post).

http://legendsofnorova.com/index.php/community-forum-pack073a51/category-items/1-community-forum/15-chalcedonia

On that pae you should see what I described. I have it set as Forum: Last Modified, Chalcedonia: Last Modified. On the Forum index page it shows the latest post. On the Chalcedonia forum topic listing page, the order does not get sorted.


pepperstreet VIP
Total posts: 3,837
11 Oct 2013 17:24

Not Modified. No new order with "last modified" after adding comments.

"Problem" confirmed on my demo, too. :(


Sergey
Total posts: 13,748
14 Oct 2013 02:08

I see. Fixed. To fix manually open models/record.php and line 529

$record->comments = $db->loadResult();

Change to

$record->comments = $db->loadResult();

$record->mtime = JDate::getInstance()->toSql();


Sergey
Total posts: 13,748
15 Oct 2013 05:58

and only meant to be for "real" article modifications?

There is audit log that can save date of every modification.


Sergey
Total posts: 13,748
16 Oct 2013 02:44

What if article modified date is important... and only meant to be for "real" article modifications? That would mean I can`t use comments for this type.

If you want to know readl modification time you can use audit log. It will tell you who and when explicitly edited article.


Sergey
Total posts: 13,748
18 Oct 2013 01:58

Article modification time means that something was changed. It means that there is an updated info inside the article. And comments are part of article content. To me it is very streamlined to update mtime on comments added. To add comment means change article content and means edit article.


Guest
24 Oct 2013 17:10

In my view - using this a forum tool that is - comments are articles themselves really. They are responce articles to either the original article or in my case a continuation of the story / posts preceding.

In a forum you have the first post that starts the topic. Each additional post adds to the topic, but are also posts themselves and thusly could be responded to or dealt with.

So the question here is, would this fix mean that if someone made a post to the topic that was created, would the topic date change? That could be problematic as in not having the original date of the topic. Also what happens when you have to delete a post in a topic?

I am thinking that it would be best if the sorting could be done based on latests post in a topic, but not modifing the original post of a topic's date.

Adding a comment to a forum topic (thuis adding a post in an ongoing topic) isn't a change of an article, it is an addition to a string of articles following the same topic.


Sergey
Total posts: 13,748
28 Oct 2013 00:07

In my view - using this a forum tool that is - comments are articles themselves really. They are responce articles to either the original article or in my case a continuation of the story / posts preceding.

In a forum you have the first post that starts the topic. Each additional post adds to the topic, but are also posts themselves and thusly could be responded to or dealt with.

There are 2 comment type in Cobalt. Comments and Cobalt articles. When you use Cobalt articles then it is another articles that could be commented. But you can use comments which become part of commented article.

In my view - using this a forum tool that is - comments are articles themselves really. They are responce articles to either the original article or in my case a continuation of the story / posts preceding.

In a forum you have the first post that starts the topic. Each additional post adds to the topic, but are also posts themselves and thusly could be responded to or dealt with.

I am thinking that it would be best if the sorting could be done based on latests post in a topic, but not modifing the original post of a topic's date

We could sort on last comment add time, but we will have to add left joins or subqueries that will be used for sorting. That will definitely slow down performance. That is why we are keeping what we have :)

Powered by Cobalt