member list as module?

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
4/6/2012 12:04:12 PM
Gravatar
Total Posts 104

member list as module?

has anyone developed a member list as an add-in module?  I'm getting nowhere today trying to unravel the code in the MemberList.aspx.cs file and related, and just wondering if anyone had manged to separate this out into a stand alone module...

thanks! : )

4/6/2012 12:44:55 PM
Gravatar
Total Posts 81
Website Hobbyist and Software Engineer
Proud member of the mojoPortal team
www.doan.me

Re: member list as module?

I have not created one, but let us know what particular parts you are struggling with figuring out and we will see if we can help guide you down the right path.

4/6/2012 12:53:39 PM
Gravatar
Total Posts 104

Re: member list as module?

when trying to create a new .ascx file, and related code behind to come up with a member list that I can drop in anywhere, I'm copying the code behind over from MemberList.aspx.cs to the new module's code behind page, and only copying over the markup between the <portal:InnerBodyPanel> tags... outside of that, I'm not sure what I would need to change in the Inherits area, or the Using statements, just to get to some basic, functional item that displays members

4/6/2012 12:55:31 PM
Gravatar
Total Posts 104

Re: member list as module?

I can figure out how to create a user control with a gridview that displays data from some other database using sql statements and connection strings that are all included within the user control, but trying to unravel all of this to try to get something equivilent seems to be a challenge today...

4/6/2012 12:56:21 PM
Gravatar
Total Posts 104

Re: member list as module?

and thanks for any input you could provide to point me in the right direction here....  : )

4/6/2012 1:09:10 PM
Gravatar
Total Posts 81
Website Hobbyist and Software Engineer
Proud member of the mojoPortal team
www.doan.me

Re: member list as module?

Are you just trying to re-create the Member List functionality? If so, why don't you just expose the mojoPortal MemberList functionality to the desired roles for them to view?

If you really need to get/display the data in a different way, the BindAlphaList() function of the MemberList.aspx.cs is an example of how to get the data. SiteUser also has other Get methods that allow you to get the data in many ways. This is all built using the n-Tier architecture that Joe and others describe in the development documentation.

4/6/2012 1:15:54 PM
Gravatar
Total Posts 104

Re: member list as module?

pretty much Kerry - but I'm trying to get it into a module that I can then add into a page, just like all of the other parts that one can add into a page through the CMS UI....  BindAlphaList() is most of the information I want, but I also want to try to display the avatar and all of the related profile data for each one in the list...  I just can't figure out how to get this piece pulled out and working in another module

4/6/2012 1:33:22 PM
Gravatar
Total Posts 81
Website Hobbyist and Software Engineer
Proud member of the mojoPortal team
www.doan.me

Re: member list as module?

Then you may also want to reference ProfileView.aspx and its code behind. This shows how all the different parts of the Profile information is pulled out, including the Avatar (line 114: basically using the URL to the image to use as the src for an img tag).

4/6/2012 1:38:13 PM
Gravatar
Total Posts 2253

Re: member list as module?

Hi,

We did this recently for a company intranet. It wasn't too difficult really.

We did it by creating our own Stored Procedures for pulling the data the way we needed it and then we created an "Employee" object which contained the data and populated the GridView with a List of that object.

Note that we used the standard separation between the db, business and ui layers, as Joe Audette does in mojoPortal.

HTH,
Joe D.

4/6/2012 7:22:08 PM
Gravatar
Total Posts 104

Re: member list as module?

Thanks for your input Joe, I wasn't quite sure what direction to go with that.... I don't suppose you might be willing to share your select/join query? :D
4/7/2012 8:35:22 AM
Gravatar
Total Posts 2253

Re: member list as module?

Here's what the StoredProc which grabs all of the users with the custom properties I want looks like.

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[Custom_UserProfiles_SelectAll]
/*
Last Modified:		2011-11-27
*/

@SiteID  int

AS

CREATE TABLE #usersWithProperties
(
SiteID int,
UserID int,
UserGuid uniqueidentifier,
FirstName nVarChar(Max),
LastName nVarChar(Max),
Email nVarChar(Max),
Gender nVarChar(1),
Supervisor nVarChar(Max),
SupervisorID int,
JobTitle nVarChar(Max),
Organization nVarChar(Max),
MobilePhone nVarChar(Max),
WorkPhone nVarChar(Max),
Photo nVarChar(Max),
Birthdate nVarChar(Max)
)

INSERT INTO #usersWithProperties (SiteID, UserID, UserGuid, FirstName, LastName, Email, Photo, Gender)
SELECT SiteID, UserID, UserGuid, FirstName, LastName, Email, AvatarUrl, Gender
FROM mp_Users
WHERE SiteID = @SiteID
AND mp_Users.DisplayInMemberList = 'True'

UPDATE #usersWithProperties
SET	Supervisor = (
		SELECT u.Name FROM mp_Users u
		WHERE u.UserID = (
			SELECT uP.PropertyValueString FROM mp_UserProperties uP
			WHERE uP.PropertyName = 'Supervisor'
			AND #usersWithProperties.UserGuid  = uP.UserGuid
		)
	)
	,SupervisorID = (
		SELECT uP.PropertyValueString FROM mp_UserProperties uP
		WHERE uP.PropertyName = 'Supervisor'
		AND #usersWithProperties.UserGuid  = uP.UserGuid
	)
	,Organization = (
		SELECT REPLACE(r.DisplayName, 'org_', '') FROM mp_Roles r
		WHERE r.RoleID = (
			SELECT uP.PropertyValueString FROM mp_UserProperties uP
			WHERE uP.PropertyName = 'Organization'
			AND #usersWithProperties.UserGuid  = uP.UserGuid
		)
	)
	,JobTitle = (
		SELECT PropertyValueString FROM mp_UserProperties uP
		WHERE uP.PropertyName = 'JobTitle'
		AND #usersWithProperties.UserGuid = uP.UserGuid
	)
	,MobilePhone = (
		SELECT PropertyValueString FROM mp_UserProperties uP
		WHERE uP.PropertyName = 'MobilePhone'
		AND #usersWithProperties.UserGuid = uP.UserGuid
	)
	,WorkPhone = (
		SELECT PropertyValueString FROM mp_UserProperties uP
		WHERE uP.PropertyName = 'WorkPhone'
		AND #usersWithProperties.UserGuid = uP.UserGuid
	)
	,Birthdate = (
		SELECT PropertyValueString FROM mp_UserProperties uP
		WHERE uP.PropertyName = 'Birthdate'
		AND #usersWithProperties.UserGuid = uP.UserGuid
	)
SELECT * FROM #usersWithProperties
DROP TABLE #usersWithProperties

We had a lot of other fields but this should get you started. 

You must sign in to post in the forums. This thread is closed to new posts.