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 ForumsForumForumTemporary "Anonymous Posting" solutionTemporary "Anonymous Posting" solution
Previous
 
Next
New Post
11/17/2008 10:07 AM
 

I noticed a very heated debate going on about the need for anonymous posting. About 1 year ago, the company I work for needed a forum with exactly that feature. We needed a forum to exchange ideas(technical,business, HR, etc). The feature was needed to remove "halo" effect from posts. If a manager posted something, it would get plenty of "good idea!", "you're brilliant" kind of responses. If a junior developer floated the same idea, it would get shot down in five difference colors.

To make the long story short, listed below is my solution for Anonymous posting. The solution does not require binary change so it will work in ISP scenario. It also does not modify any tables or stored procedures released by DNN Forum project. As a result, the solution has been working through many dnn software upgrades. This solution also works in multi-portal scenario. So here it goes:

1) create user with username 'Anonymous'

2) write down the GUID of the portal for which you want to enable anonymous posting.

3) connect to the database that hosts DNN and run the following(prior to runnning, make sure to replace 'GUID from step 2 goes here' with the GUID from step 2):

CREATE TRIGGER [dbo].[trgAudit] ON [dbo].[Forum_Posts] AFTER INSERT, UPDATE
AS
BEGIN
    DECLARE @uid int, @pid int

    select @uid = userid from users where username='Anonymous'

    SELECT
        @pid = portals.portalid
    FROM
        inserted
            join
        forum_threads
            on inserted.threadid = forum_threads.threadid
            join
        forum_forums
            on forum_forums.forumid = forum_threads.forumid
            join
        forum_groups
            on forum_groups.groupid = forum_forums.groupid
            join
        portals
            on portals.portalid = forum_groups.portalid
            join
        userportals
            on userportals.userid = @uid and userportals.portalid = portals.portalid
    where
        portals.guid='GUID from step 2 goes here'

    IF @uid IS NOT NULL AND @pid IS NOT NULL
    BEGIN
        exec dbo.Forum_UserAdd
           @UserId = @uid
          ,@Alias = NULL
          ,@UserAvatar = NULL
          ,@Avatar = NULL
          ,@AdditionalAvatars = NULL
          ,@Signature = NULL
          ,@Occupation = NULL
          ,@Interests = NULL
          ,@MSN = NULL
          ,@Yahoo = NULL
          ,@AIM = NULL
          ,@ICQ = NULL
          ,@Skin = NULL
          ,@IsTrusted = NULL
          ,@EnableThreadTracking = NULL
          ,@EnableDisplayUnreadThreadsOnly = NULL
          ,@EnableDisplayInMemberList = NULL
          ,@EnableOnlineStatus = NULL
          ,@ThreadsPerPage = NULL
          ,@PostsPerPage = NULL
          ,@WhatsNewScrollDirection = NULL
          ,@WhatsNewNumberOfThread = NULL
          ,@WhatsNewScrollDelay = NULL
          ,@WhatsNewScrollAmount = NULL
          ,@WhatsNewTrackingType = NULL
          ,@WhatsNewTrackingDuration = NULL
          ,@DefaultForumID = NULL
          ,@CollapseGroups = NULL
          ,@IsGlobalModerator = 0
          ,@ModeratorReturn = 0
          ,@EnablePM = 0
          ,@EnablePMNotifications = 0
   
        update forum_posts
        set userid = @uid
        from
            forum_posts
                join
            inserted
                ON inserted.postid = forum_posts.postid
        where
            inserted.userid <> @uid

    END

END
 

GO

 

This solution has worked for me for a year now without a hitch. Of course, your mileage may vary

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForumForumTemporary "Anonymous Posting" solutionTemporary "Anonymous Posting" solution


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