Notifications
Clear all

[Closed] UM Integration - ordering of topics / replies / subscriptions

5 Posts
2 Users
1 Reactions
3,261 Views
Posts: 393
Topic starter
(@anonymous3542)
Honorable Member
Joined: 7 years ago

@robert is there any way we can change the ordering of the above so they are in date order ? There doesn't seem to be a way of doing this via the GUI, so I expect it's a code alteration for the MySQL query that returns the data... ?

 

Thanks

4 Replies
Robert
Posts: 10587
Admin
(@robert)
Support Team
Joined: 9 years ago

Try adding one more attribute in get_topics() and get_posts() functions. Open this file:

/wpforo/wpf-includes/integration/ultimate-member.php

Find all this rows:

'userid' => $user_id,

Add one more row below for all of them:

'userid' => $user_id,
'orderby' => 'modified',
Posts: 393
Topic starter
(@anonymous3542)
Honorable Member
Joined: 7 years ago

Thanks @robert,

Seems to work for the most part, but this function (replies) seems to have little effect

 function um_user_replies( $args ) {
$user_id = um_user('ID');
if(isset($_GET['wpfpaged']) && intval($_GET['wpfpaged'])) $paged = intval($_GET['wpfpaged']);
$paged = (isset($paged) && $paged) ? $paged : 1;
$args = array(
'offset' => ($paged - 1) * WPF()->post->options['posts_per_page'],
'row_count' => WPF()->post->options['posts_per_page'],
'userid' => $user_id,
'orderby' => 'modified',
'check_private' => true
);
Robert
Posts: 10587
Admin
(@robert)
Support Team
Joined: 9 years ago

For the replies function please use this:

'userid' => $user_id,
'orderby' => '`created` DESC',
Posts: 393
Topic starter
(@anonymous3542)
Honorable Member
Joined: 7 years ago

Works great @robert. Thanks