> Forums > Active Social > Themes and Templates > Join group via URL
Last Post 09 Jul 2010 11:45 AM by Caleb Hanson. 8 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Not Resolved
jbrunken
Customers
jbrunken
Post Count:479

--
22 Oct 2009 02:13 PM
    Does anyone know of a way to construct a URL so a user can join a public group with a single click?

    I want to have an HTML module at the top of my pages that encourages users who are not a already in a group to join one and allows them to pick and join a group with a single click.

    I can use DNN 5 permissions to hide the module from anyone who is already a member of a group.

    Thanks in advance.

    -JB
    Jason Brunken

    GIRS Webmaster
    http://www.greateriowareefsociety.org/
    Zymm
    Customers
    Zymm
    Post Count:79

    --
    27 Oct 2009 02:00 PM
    I needed to tie in my Dynamic Registration with the AS Groups, so that when someone picks the type of group they want to be in, it fires an SQL event to add them.. so I just dug up the stored procedure called Active_Social_Groups_members_add and used the logic in there:


    USE [mydatabase]
    GO
    /****** Object: StoredProcedure [dbo].[activesocial_Groups_Members_Add] Script Date: 10/27/2009 12:53:01 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[activesocial_Groups_Members_Add]
    @GroupId int,
    @UserId int,
    @MemberStatus int,
    @Note nvarchar(1000),
    @DateCreated datetime,
    @DateApproved datetime = NULL
    AS
    IF NOT EXISTS(SELECT UserId FROM dbo.activesocial_Groups_Members WHERE GroupId = @GroupId AND UserId = @UserId)
    BEGIN

    INSERT INTO dbo.activesocial_Groups_Members
    (GroupId, UserId, MemberStatus,Note,DateCreated,DateApproved)
    VALUES
    (@GroupId, @UserId, @MemberStatus,@Note,@DateCreated,@DateApproved)

    END



    Seems to work well enough. So you could write some code that reads their UserID via a querystring, and fire off that SQL. For security you might want to add a second querystring value with a unique code, so that people couldn't tamper with the URL and add other people to groups - an easy way to do this would be to give each user a GUID, which (if you're not using it otherwise) could be plunked into the "AffiliateCode" column of the DNN Users table.
    Caleb Hanson
    Customers
    Caleb Hanson
    Post Count:69

    --
    06 Jul 2010 05:38 PM
    jbrunken, did you ever figure out a way to do this? Using Zymm's suggestion wouldn't work for me because the user would not be associated with all the roles and such. Anyone from AS want to throw an opinion out? :)
    Caleb Hanson
    Customers
    Caleb Hanson
    Post Count:69

    --
    07 Jul 2010 06:16 PM
    I've setup a custom page that joins them to the group and adds them to the correct role but I'm still missing the entries into the Journal table and any other housekeeping tasks that AS performs. Could one of the AS staff respond on the other steps that I would need to take to make this just like if I clicked the Join Group button from the Group View page please?
    Will Morgenweck Forum Admin
    DotNetNuke Staff
    Will Morgenweck
    Post Count:7666

    --
    08 Jul 2010 02:43 PM
    Could one of the AS staff respond on the other steps that I would need to take to make this just like if I clicked the Join Group button from the Group View page please?

    Updating the journal outside of Active Social with just SQL is not and will not be supported any time soon. We would have to create an API for group joins in order to make sure the journal data is managed properly.
    Will Morgenweck
    Director of Product Management
    DotNetNuke Corp.
    jbrunken
    Customers
    jbrunken
    Post Count:479

    --
    08 Jul 2010 05:58 PM
    I never figured out a single click solution. I just have a nag box that takes them to the group home page where they need to click "Join Group".

    -JB
    Jason Brunken

    GIRS Webmaster
    http://www.greateriowareefsociety.org/
    fatgeorge
    Customers
    fatgeorge
    Post Count:291

    --
    08 Jul 2010 06:31 PM
    Is the 'Join Group' an option in the asClient api?
    Caleb Hanson
    Customers
    Caleb Hanson
    Post Count:69

    --
    09 Jul 2010 08:57 AM

    Posted By Will Morgenweck on 08 Jul 2010 02:43 PM
    Could one of the AS staff respond on the other steps that I would need to take to make this just like if I clicked the Join Group button from the Group View page please?

    Updating the journal outside of Active Social with just SQL is not and will not be supported any time soon. We would have to create an API for group joins in order to make sure the journal data is managed properly.


    Far enough, I totally understand that. After talking with my client it's not a big deal if the journal text is created when someone joins a group. Can you verify that I'm not missing an important step in the group join process though? My steps are:

    1. Create the Group Member relationship using activesocial_Groups_Members_Add stored procedure
    2. Find linked member role for group
    3. Insert User Role assignment using AddUserRole stored procedure.

    Pretty simple really, I'm just afraid that I'm missing a step that is done by AS.
    Caleb Hanson
    Customers
    Caleb Hanson
    Post Count:69

    --
    09 Jul 2010 11:45 AM
    BTW, I know this would not be supported by AS and your process would be subject to change without warning.
    You are not authorized to post a reply.
    > Forums > Active Social > Themes and Templates > Join group via URL
    test
    Copyright 2012 by DotNetNuke Corporation / Terms of Use / Privacy