I'm trying to figure out a way to list the lastest posts from the forums (4.6 Beta 2) on the home page. I've tried using Forum.LatestPosts module from Radient but it's not working. I've also tried to use some sql code in the reports module, but that's coming back with an error as well. Any ideas?
Here is the code that I tried to use:
Name: Top 10 Last Forum Posts
Info: First, replace "yourserver/dotnetnuke/forums/tabid/163" with the Url to your Forums page. Second, replace the text "Private" in "Where Forum_Groups.Name <> 'Private'" with the name of any forum group you want to hide from this list you can also simply remove that line to show all forums, and add "AND Forum_Groups.Name <> '...'" to hide other forum groups, you can also use "AND Forum_Forums.Name <> '...'" to hide single forums (NOTE, the first of these conditions must use 'WHERE', the rest should use 'AND').
SQL Query (for v4.3.1)
SELECT TOP 10
'<a href="http://yourserver/dotnetnuke/forums/tabid/163/forumid/' +
CAST(Forum_Forums.ForumID as varchar(3)) +
'/threadid/' +
CAST(Forum_Threads.ThreadID as varchar(3)) +
'/scope/posts/Default.aspx">' +
Forum_Posts.Subject +
'</a>'
FROM Forum_Posts
INNER JOIN Forum_Threads ON Forum_Posts.ThreadID = Forum_Threads.ThreadID
INNER JOIN Forum_Forums ON Forum_Threads.ForumID = Forum_Forums.ForumId
INNER JOIN Forum_Groups ON Forum_Forums.GroupID = Forum_Groups.GroupID
WHERE Forum_Groups.Name <> 'Private'
AND Forum_Forums.IsActive = '1'
AND Forum_Posts.IsApproved = '1'
ORDER BY CAST(Forum_Posts.PostID as varchar(3)) DESC
Alternate Query, using the HTML Template Renderer in v4.4.2 (again replacing the text "Private" if necessary, as above):
SELECT TOP 10
Forum_Forums.ForumID as 'ForumID',
Forum_Threads.ThreadID as 'ThreadID',
Forum_Posts.Subject as 'Subject'
FROM Forum_Posts
INNER JOIN Forum_Threads ON Forum_Posts.ThreadID = Forum_Threads.ThreadID
INNER JOIN Forum_Forums ON Forum_Threads.ForumID = Forum_Forums.ForumId
INNER JOIN Forum_Groups ON Forum_Forums.GroupID = Forum_Groups.GroupID
WHERE Forum_Groups.Name <> 'Private'
AND Forum_Forums.IsActive = '1'
AND Forum_Posts.IsApproved = '1'
ORDER BY CAST(Forum_Posts.PostID as varchar(3)) DESC
Configuring the HTML Template (v4.4.2 ONLY):
Create an HTML File with the following code (replacing http://yourserver.../, as above):
<a href="http://yourserver/dotnetnuke/forums/tabid/163/forumid/[ForumID]/threadid/[ThreadID]">
[Subject]
</a><br/>
Then upload the file to your Portals/[PortalID] directory (or use the File Manager). Enter the alternate query above into your reports module and select the "HTML Template Visualizer". Pick the HTML file you uploaded and save your changes.