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/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. 

4/9/2012 8:21:21 AM
Gravatar
Total Posts 104

Re: member list as module?

thanks for that Joe - that should help a lot in getting something going here... and thanks for all of the assistance Kerry!

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