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 ForumsForumForum4.3.2 comments4.3.2 comments
Previous
 
Next
New Post
2/24/2008 12:44 AM
 

Alejandro,

if you have a seperate database for your shared hosting, you can remotly access the MS-SQL server with the access data you are using in the web.config file.  To remote connect you can using the Microsoft SQL Server Manager (Express).   If the hosting is using the file connection you can download your database files, and instert the downloaded database files into a SQL Server instance on your local Computer.  There you can then modified all database data.

Regards

Matthias

 
New Post
2/24/2008 11:47 AM
 

Matthias, thank you for your prompt response!

Good news: I have been playing around with this issue and have come up with a fix that works fine in my case:

Regarding the error "ORDER BY items must appear in the select list if SELECT DISTINCT is specified." in the Forum Module v03.20.09.

The original solution (which is yellow and green higlighted in the script below) was proposed by John Liptak in:
http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/7/threadid/50943/scope/posts/threadpage/7/Default.aspx
The issue (and solution) posted in GEMINI by Alex Shirley is:
http://support.dotnetnuke.com/issue/ViewIssue.aspx?ID=3690&PROJID=7

The solution I have found for those who cannot (or just don't want to) connect directly to the database:

1. Open the web.config file and search for the Connection String to the Database

2. Copy the values of the databaseOwner and objectQualifier fields. They are typically the following:
 - databaseOwner = "dbo"
 - objectQualifier = "" or "dnn_"

3. Replace those values in the script at the end of the post
 - i.e. "{databaseOwner}" replaced by "dbo" and the same with "{objectQualifier}", do not use the quotes.

 for example, the first line of the script should look like:
   ALTER PROCEDURE dbo.Forum_SearchGetResults
     or
   ALTER PROCEDURE dbo.dnn_Forum_SearchGetResults
     or your own one.

4. From your DNN application, under Host-SQL menu:
     a) Paste the modified script
     b) Mark "Run as Script"
     c) Click on "Execute"
     d) Wait for the "The Query completed successfully!" message.

5. Check that the error on the Forum Module is gone, by clicking the "My Posts" button.

Saludos,
Alejandro.

---------------------------------------
ALTER PROCEDURE {databaseOwner}.{objectQualifier}Forum_SearchGetResults
(
@Filter  nvarchar(500),
@PageIndex int,
@PageSize int,
@UserID  int,
@ModuleID int,
@FromDate datetime,
@ToDate datetime
)
AS
 -- Create a temp table to store the select results
 CREATE TABLE #PageIndex
 (
  IndexID int IDENTITY (1, 1) NOT NULL,
  ThreadID int
 )
 -- Create dynamic SQL to populate temporary table
 DECLARE @sql nvarchar(2000)
 SELECT  @sql = 'INSERT INTO #PageIndex(ThreadID) SELECT DISTINCT(P.ThreadID) CreatedDate ' +  
    'FROM {objectQualifier}Forum_Posts P ' +
    'INNER JOIN {objectQualifier}Forum_Threads T ON P.ThreadID = T.ThreadID ' +
    'INNER JOIN {objectQualifier}Forum_Forums F ON T.ForumID = F.ForumID ' +
    'INNER JOIN {objectQualifier}Forum_Groups G ON F.GroupID = G.GroupID ' +  
    'INNER JOIN {objectQualifier}Forum_Posts LP ON T.ThreadID = LP.ThreadID ' +
    'WHERE P.ThreadID = T.ThreadID AND ' +
    'T.ForumID = F.ForumID AND ' +  
    'F.GroupID = G.GroupID ' + 
    'AND P.[CreatedDate] >  ''' + CONVERT(varchar, @FromDate) + ''' ' +
    'AND P.[CreatedDate] < ''' + CONVERT(varchar, @ToDate) + ''' ' +
    'AND P.IsApproved = 1 ' +
    'AND P.IsLocked = 0 ' +
    'AND G.ModuleID = ' + CONVERT(varchar, @ModuleID) + ' AND ' +
  
    '( F.ForumID NOT IN (SELECT ForumID FROM  {objectQualifier}Forum_PrivateForums) OR ' +
     ' F.ForumID IN ( ' +
      'SELECT ForumID  ' +
      'FROM  {objectQualifier}Forum_PrivateForums (nolock)  ' +
      'WHERE (RoleID IN (SELECT RoleID FROM  {objectQualifier}UserRoles WHERE UserID = ' + CONVERT(varchar, @UserID) + ' ) ' +
      'OR EXISTS (SELECT TOP 1 1 FROM  {objectQualifier}Users WHERE UserID = ' + CONVERT(varchar, @UserID) + '  and IsSuperUser=1))))  ' +
    @Filter + ' GROUP BY P.ThreadID , P.CreatedDate ORDER BY P.ThreadID DESC '
 Print @sql
 EXEC(@sql)
 -- All of the rows are inserted into the table - now select the correct subset
 DECLARE @PageLowerBound int
 DECLARE @PageUpperBound int
 DECLARE @RecordCount int
 -- Set the page bounds
 SET @PageLowerBound = @PageSize * @PageIndex
 SET @PageUpperBound = @PageLowerBound + @PageSize + 1
 SELECT @RecordCount = COUNT(*) FROM #PageIndex

 Print @RecordCount
 -- Select the data out of the temporary table
 -- Select the data out of the temporary table
 SELECT
  PageIndex.ThreadID, 
  P.[Subject],
  P.[CreatedDate],
  FU.[UserID],
  FU.[Alias],
  T.[ForumID],
  T.[Replies],
  T.[Views],
  F.[Name] As ForumName,
  RecordCount = @RecordCount,
  (SELECT Count([ThreadID]) FROM {objectQualifier}Forum_ThreadRating  WHERE ThreadID = PageIndex.ThreadID) As RatingCount,
  (SELECT AVG([Rate]) FROM {objectQualifier}Forum_ThreadRating  WHERE ThreadID = PageIndex.ThreadID) As Rating,
  (SELECT Distinct  Count(UserID) FROM {objectQualifier}Forum_ThreadsRead WHERE ForumID = T.[ForumID] AND UserID = FU.[UserID] AND P.[CreatedDate] > LastPurseDate AND ReadThreads NOT LIKE '%' + CONVERT(varchar, PageIndex.ThreadID) + ';%')  As IsUnRead
 FROM
  {objectQualifier}Forum_Posts P
  INNER JOIN {objectQualifier}Forum_Threads T ON P.ThreadID = T.ThreadID
  INNER JOIN {objectQualifier}Forum_Forums F ON T.ForumID = F.ForumID
  INNER JOIN {objectQualifier}Forum_Users FU ON P.UserID = FU.UserID, #PageIndex PageIndex
 WHERE
  PageIndex.IndexID > @PageLowerBound AND
  PageIndex.IndexID < @PageUpperBound AND
  PageIndex.ThreadID = P.ThreadID AND 
  FU.[UserID] = P.[UserID] AND
  P.[ThreadID] = T.[ThreadID] AND
  P.[CreatedDate] > @FromDate AND
  P.[CreatedDate] < @ToDate AND
  T.[ForumID] = F.[ForumID] AND
  (P.[CreatedDate] = (SELECT MAX([CreatedDate]) FROM {objectQualifier}Forum_Posts WHERE ThreadID = PageIndex.ThreadID)) AND
  (F.ForumID NOT IN (SELECT ForumID FROM {objectQualifier}Forum_PrivateForums) OR
  F.ForumID IN (
   SELECT ForumID
   FROM {objectQualifier}Forum_PrivateForums
   WHERE (RoleID IN (SELECT RoleID FROM {objectQualifier}UserRoles WHERE UserID = @UserID)
   OR EXISTS (SELECT TOP 1 1 FROM {objectQualifier}Users WHERE UserID = @UserID and IsSuperUser=1))))  
 ORDER BY
  P.CreatedDate DESC
---------------------------------------
 

 
New Post
2/9/2009 10:27 AM
 

WOW, good work John

Tried your solution and it worked fine. Fixed one of my problems right away.

Now I only have to fix this error

DotNetNuke.Services.Exceptions.ModuleLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.Modules.Forum.UserSettings.SelectMultiTreeItems(DnnTree objTree, Int32 ForumID) at DotNetNuke.Modules.Forum.UserSettings.Page_Load(Object sender, EventArgs e) --- End of inner exception stack trace ---
Source:

If I could only understand where to modify the My Settings parameters...

Thank you very much for posting the solution to this problem.

Aigor

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForumForum4.3.2 comments4.3.2 comments


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