Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Recent Posts Widget
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Aug 19, 2013 - 2:43 am

its clearer now, yes...  but afraid we dont have anything built in that does that...  frankly, we have not ever had anyone that I can recall request such a thing...  99.9% of the folks want go to the last post for obvious reasons...

but we might be able to use our api and hooks and filters to get you what you want...

first, use the newest topics template tag like recommended before...  if you only want it for a specific forum, remember to add the forum id argument(see http://codex.simple-press.com/.....st-topics/)....   then add this code to our spFunctions.php of your sp theme (as always this should be yours - see: http://codex.simple-press.com/.....g-a-theme/):

add_filter('sph_NewestTopicsTag_args', 'my_newestopics_args');
 function my_newestopics_args($args) {
     add_filter('sph_post_list_record', 'my_query_filter', 10, 2);
     return $args;
 }
 
 function my_query_filter($list, $record) {
     remove_filter('sph_post_list_record', 'my_query_filter', 10, 2);
     $list->post_permalink = sp_build_url($record->forum_slug, $record->topic_slug, 0);
     return $list;
 }

playing a little double filter dance there to keep from affecting other uses of the list post class...  must also say I have not tested this...

Avatar
Chris Hustad
Member
Free Members
sp_UserOfflineSmall Offline
Aug 20, 2013 - 4:15 am

That worked well. Thank you for the quick response and for providing me with a solution.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 20, 2013 - 5:41 am

Glad it is OK for you.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Chris Hustad
Member
Free Members
sp_UserOfflineSmall Offline
Aug 20, 2013 - 11:33 am

I spoke too soon....hehe

It works for the most recent topic...but the rest in the "list" link to the most recent post.

http://www.werejustparents.com/  (See bottom right hand corner in sidebar)

Site is in BETA - so no hurries.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Aug 20, 2013 - 6:21 pm

take out the remove_filter line... 

shouldnt be removed until after all have been done... and then add this in:

apply_filters('sph_NewestTopicsTag', 'my_query_remove');
function my_query_remove($out) {
    remove_filter('sph_post_list_record', 'my_query_filter', 10, 2);
    return $out;
}
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17363
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625