YAFLogo

anz
  • anz
  • 50.2% (Neutral)
  • YAF Forumling Topic Starter
9 years ago
Hi All,

I am working with YAF + Umbraco integration and so far all is working really nice..

Now I want to change the sort order of forum posts an I cant really find a setting to do that..

I have checked the [yaf_post_list] stored procedure and found changing the @SortPosted parameter to 2 will do the trick.. I have hard coded this value with in the procedure and it worked fine..
SET @SortPosted = 2

but now I have problem with direct link to messages from notification email etc.. They are going to wrong page/post.. I have gone through the code and understood the problem is with finding the messagePosition

int findMessageId = this.GetFindMessageId(showDeleted, userId, out messagePosition);
or
[yaf_message_findunread]

but I can't figure out how to fix this.. Any help will be greatly appreciated..

Basically I want a way to sort the forum posts from newest to oldest and all other YAF functionality should just work as it should be ..

Thanks and Best Regards,
Ansar
Sponsor

bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
9 years ago
message_findunread returns a post position number from the latest post by default. It has parallel code with post_list. When your change sort order your are getting an old post postion. Try to change message find unread or better change position in post_list by simply using totalcount - old position. I was primarily writing the feature in this manner exactly to get the flexibility you want, but didn't implemented it to the end because there was no demand for it. I can't say what exactly to do right now due to lack of time, but this is an educated guess from the horse's mouth 🙂
You can check wether the functionality works or not more easily by using search. Link should lead you exactly to a required post.
anz
  • anz
  • 50.2% (Neutral)
  • YAF Forumling Topic Starter
9 years ago
Hi,

Thank you for your reply..

I have already done this by changing only the stored procedure [yaf_post_list].

Will be great if you can have a look and suggest me if its right.. I have tested myself and all working good..

Look for the changes inside the comments
-- Anz change Start

-- Anz change End

Regards,
Ansar
YAF Logo Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved
About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button