PDA

View Full Version : Social Groups messages


kursed
05-19-2009, 07:29 AM
Right now they're in an order, where it shows older messages at front and newer messages at the end.

Can I reverse the order, if so, how? So that newer messages are shown in front, just like in 3.7 version of vBulletin.

------

I asked the same question on vBulletin.com, and was told to do the following:

Just create a plugin at group_view_message_query setting the order to desc instead of asc.

If you can't figure out how to do that, you should ask for help over on vbulletin.org

-------

So can anyone here be kind enough to guide me as to how can I create this plugin?

Thank you in advance.

--------------- Added 1242729442 at 1242729442 ---------------

Folks, it's very important that I set this setting right, it's irking my users a lot. So please, can someone guide me on how it can be done?

Lynne
05-19-2009, 03:19 PM
hook location: group_view_message_query
$this->sortfield = 'dateline';
$this->descending = 'DESC';

That should work - it's a pretty simple one.

kursed
05-20-2009, 04:03 PM
Can you please tell me as to where can I find this particular hook?

Lynne
05-20-2009, 04:53 PM
If you don't understand the plugin system, you should read this in the manual - Plugin System (http://www.vbulletin.com/docs/html/plugin_system)

kursed
05-20-2009, 05:52 PM
Thank you. Now it does show new messages on the first page. But there is one little problem. As soon as one posts a new message, he's taken to the start of the discussion (first page in this instance). How can I correct that? So that the user is taken to the page, where he's updated the message (end of discussion).

Lynne
05-20-2009, 06:25 PM
I would guess you would have to do something regarding the redirect. Look at the groups.php page and see where that is being done.

Actually, I just tested this and see a problem with the messages getting 'reposted' - I think you'll have to do a similar plugin as above to the ajax posting template. Again, take a look at the code to see what is going on.