Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForumForumLatest Posts?Latest Posts?
Previous
 
Next
New Post
7/19/2010 1:36 PM
 
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.
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForumForumLatest Posts?Latest Posts?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out