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 ForumsReportsReportsForum Last Post ReportForum Last Post Report
Previous
 
Next
New Post
9/28/2006 12:01 PM
 

Has anyone got any SQL to enter into the reports module to list the latest post from the forums module and make it clickable? I can get the Subject of the latest post to show but when I try to build up the SQL to make a hyperlink I come unstuck.  :(

Many thanks,

Databasic

 

 

 
New Post
9/29/2006 11:54 AM
 

Ok i figured this out. Here is the code for anyone else that wants to put the last posts on their home page etc. I put mine in a scrolly box. You will need to change yourserver/folder and tabid to suit.

I have some Private forums. I didn't want posts appearing from private forums so I excluded these in my SQL. I also check that a forum is active and that a post has been approved. There's probably a much easier way to do this but I'm a dotnetnuke and SQL beginner so be kind

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

Cheers,

Simon

 
New Post
9/29/2006 1:40 PM
 
Great work! I'll post this in the "Favourite Reports" thread for others to see. Eventually I want to set up a place on the Project page where people can submit and browse a list of SQL Queries to do common things with the Reports Module.

Andrew Nurse
DotNetNuke Core Team Member and Reports Module Project Lead
Microsoft Certified Professional Developer

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsReportsReportsForum Last Post ReportForum Last Post Report


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