Support Forum
Hi,
Is there a template tag in 5.1.3 that can produce table displays similar to sf_recent_posts_expanded() from 4.x? It output table displays of topics that were recently posted to, with a parameter for the forum ID (defaulting to ALL forums) and a parameter for the number of topics to show. The table display for topics with most recent posts across all forums would look like the home page of http://www.highinterestsavings.ca/
I'm on the lookout for exactly the same thing, so following this thread.
I need to show a table with the 5 most recent posts with topic, forum, author and date. Tried tweaking the Recent Forum Posts widget but it didn't work.
The table is to be shown in a widget on a frontpage with lots of other widgets. PHP code will be fine.
I think this should be what you are looking for:
http://codex.simple-press.com/.....ent-posts/
Also available as a widget.
YELLOW
SWORDFISH
|
Thank you.
Using the shortcode + CSS, I ended up building a table-like structure, which fits my need.
I found out that I can put HTML into the befores and afters:
sp_recent_posts itemorder='TFUD' limit='4' beforeTopic='<div class="spdebatforside-emne">' afterTopic='</div>' beforeForum='<div class="spdebatforside-forum">' afterForum='</div>' beforeUser='<div class="spdebatforside-navn">' afterUser='</div>' beforeDate='<div class="spdebatforside-dato">' afterDate='</div>'
Around this I'm putting other HTML to build the rest of the structure. It is all put into a content block using Custom Post Widget and they I insert the content block in the right widget area on the frontpage.
Peter, sorry, looks like your question got skipped... No, we did not convert over the recent posts expanded template tag... at least not in its current form...
the reason primarily being that with themes now, we didnt come up with a particularly slick method of making it look the same... with v4 skins, we pretty much knew how it would look...
with v5 now and themes, the recent posts and other similar tags, use a template file for styling the output... so you could redo the default template file that we provide and try to make the style identical... not sure all the data is available in the class, but if not its easily added with a couple filters and hooks...
I should add that the recent posts tag does take a specific forum id if desire and limit the recent topics to that forum.. and number of topics... it does everything you want, I believe, except duplicate the output styling of the forum... but that is customizable as mentioned in above paragraph...
Visit Cruise Talk Central and Mr Papa's World
In modifying sp_RecentPostsTag() to add some extra information, I encountered what I think is a bug around showing first post information in the spTopicList class: in sp_listview_query(), first post information is loaded via:
$first = spdb_table(SFPOSTS, "topic_id=$r->topic_id AND post_index=1", 'row');
Then the display name is accessed via:
$list[$t]->first_display_name = sp_filter_name_display($first->display_name);
However, the display name is not stored in the posts table, so this is always blank. Presumably the original fetch needs to join the user ID to the members table OR we would just do a conditional extra database query if the user ID isn't NULL?
Are we looking at the same thing? The sp-list-topic-class.php file? Because the $first data object is populated with the following query:
spdb_select('row', 'SELECT * FROM '.SFPOSTS.' JOIN '.SFMEMBERS.' ON '.SFMEMBERS.'.user_id = '.SFPOSTS.".user_id WHERE topic_id=$r->topic_id AND post_index=1");
on code line 255 of the most recent file?
YELLOW
SWORDFISH
|
Looks like it has been fixed for the next version
http://mantis.simple-press.com.....hp?id=3251
Is the pasted code the full extent of the fix?
1 Guest(s)