R2i DotNetNuke® Forum

R2i wants you to have the opportunity to ask questions, post reviews, help others or just rant and rave about DotNetNuke® or any of the R2i Modules and Skins. Our team spends hour upon hour, day after day, working on custom DotNetNuke® modules and services; please feel free to ask us anything.
 
Custome Profile Lookup
Last Post 01 Jan 1900 05:00 AM by . 6 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Informative
rtoneriiUser is Offline
Basic Member
Basic Member
Posts:308

--
28 Sep 2006 08:23 PM  
I have made some user fields that I want to look up when they are logged in. Is there any way to grab it? I have tried [UserInfo.Profile.SchoolID,System] and [UserInfo.Profile.UserSettings.SchoolID,System] and it just does not work.


pauldesUser is Offline
Veteran Member
Veteran Member
Posts:1392

--
28 Sep 2006 10:24 PM  
What I do is create ListX module on every page where a user lands after successful login. There is nothing but Actions in the ListX and I hide the container in the module settings

Then in actions I set
EXECUTE[userquery]: Select a, b, c from mytable where userid = [userid,system]
Assign:Session variablea to [a.userquery]
Assign:Session variableb to [b.userquery]
Assign:Session variablec to [c.userquery]

Then the user carries these variables around with them every where they go on my site and I can call them from any other listx any time I want.


ListX....makes you look brilliant, even though you're not.
rtoneriiUser is Offline
Basic Member
Basic Member
Posts:308

--
28 Sep 2006 10:52 PM  
OK.. now i have not idea how to do that. I am brand new at ListX and really at getting deep into DNN.

HELP


pauldesUser is Offline
Veteran Member
Veteran Member
Posts:1392

--
28 Sep 2006 11:40 PM  
Have you installed the My First Listx and the other code in the samples forum? This will help you understand.

As easily as I can explain this
Add an new listX to a page where your user logs in. Assumption is that they are not being redirected to another page after login

View Options on the new listx
In General, check the box that says Use Explicit System Variables, check the box to display debug information(for testing)
Click Actions
Add New Action:execute
Enter Name for query of GetUserInfo
Enter Select * from 'whatevertablenameholdsyourprofilevalues' Where userid = [userid,system]
Add New Action:Assignment Name = variable1 Value = [afieldfromtheactionexecute,GetUserInfo]
Add New Action:Assignment Name = variable2 Value = [afieldfromtheactionexecute,GetUserInfo]
Add New Action:Assignment Name = variable3 Value = [afieldfromtheactionexecute,GetUserInfo]

When you are done, you should have 4 items in your Action list. They should NOT be indented at all, in other words, no bullet character in front of them in the list

Save your Configuration. Log out, Log in. Check the Actions and Statistics section of the Debug information. You should see the query execute and the assignments occur in Actions and the session variables your created should have values.

Attached is a snapshot of the ListX I use after someone logs in, to assign variables.

Attachment: SetSessions.jpg

ListX....makes you look brilliant, even though you're not.
rtoneriiUser is Offline
Basic Member
Basic Member
Posts:308

--
29 Sep 2006 06:51 PM  
Thanks pauldes for all of your help. I am not trying to be a pain I was just hoping [hint hint] that any custom profile fields could easily be looked up and returned.

I have made a stored procedure to do this [in-case bi4ce wants to add it in to the next release] spd_GetCustomProfileValue it will handle any custom profile look-up.

I know I have read that I can have list listen to an event firing in DNN is there any way I can just put this ListX module on maybe the home page and listen to the login event (what ever that would be) and then set the values? This would help since I can not control what page they try to go to first. If they save a URL for a shortcut then DNN will go to the login page from there.

For me it would be something like this:

spd_GetCustomProfileValue [userid,system], 'SchoolID'

Let me know your thoughts? Do you think I shoudl also pass in the portalID?

Thanks
Rick

Attachment: spd_GetCustomProfileValue.zip

pauldesUser is Offline
Veteran Member
Veteran Member
Posts:1392

--
29 Sep 2006 07:52 PM  
I don't know that the portalid is necessary as the userid can't be duplicated.

I have never tried to implement a 'listener' as concept/implementation kind of goes over my head at the moment.

I neglected to mention, that I also implement this Sessions listx module as a BI4CE skin object as outlined in the doc. It works pretty good. The module is deployed on EVERY page I have, just by embedding the module as a skin object in all the skins ASCX files.

For each module I want to appear on a page, in the skin ascx I register it
<%@ Register TagPrefix="b1" TagName="LISTX" Src="~/DesktopModules/ListX/xListingSkin.ascx" %>
and then add where I want in the page:
<b1:LISTX id="b1ListXVersion" runat="server" useCurrent="False" TabModuleID="1794" ModuleID="546" TabID="249"></b1:LISTX>


ListX....makes you look brilliant, even though you're not.
rtoneriiUser is Offline
Basic Member
Basic Member
Posts:308

--
29 Sep 2006 08:16 PM  
I think the listener is called a "Message" that all of DNN can use. I was just thinking if I have it on the home page without any return and maybe make it show up on all tabs I could always make sure it is working. It was just an idea. The idea about embedding it in the skin kind of scares me.

Rick


You are not authorized to post a reply.

Active Forums 4.1
 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seatle, WA • 410.327.0007 • info@R2Integrated.com

Bookmark & Share Bookmark and Share