Gym Media
Nuke Pro Posts:73
|
10/07/2006 8:20 PM |
|
Should be a simple module... The ablity for a user to select an avatar from images on the portal, and update their forum (Active Forums) profile to link to that avatar. |
|
GymnasticsMeida.com The Ultimate Portal for the Ultimate Sport |
|
|
Gym Media
Nuke Pro Posts:73
|
10/20/2006 7:54 PM |
|
We created the ability to select an avatar with XMod, and a AJax call to an aspx page that updated the Active Forums tables. If anyone has XMod, and Active Forums... AND would like this functionality, contact me and I'll share the code.
My Avatar @ GymnasticsMedia
http://www.gymnasticsmedia.com/Forums/MyAvatar/tabid/398/Default.aspx
Screenshot since you need to be logged in to "Select an Avatar".
http://www.gymnasticsmedia.com/portals/9/screenshots/screenshot_avatars.jpg
|
|
GymnasticsMeida.com The Ultimate Portal for the Ultimate Sport |
|
|
Lee Sykes DNN Creative Staff
Nuke Master VI Posts:4945
|
|
Gym Media
Nuke Pro Posts:73
|
10/22/2006 5:13 PM |
|
Lee,
I'm not very good at writing articles, but I gave it a try. I had a hard time with the code, and putting it in HTML, so I created a word doc. Edit it as you see fit.
|
|
GymnasticsMeida.com The Ultimate Portal for the Ultimate Sport |
|
|
Lee Sykes DNN Creative Staff
Nuke Master VI Posts:4945
|
|
Norberto Olazabal
Nuke Newbie Posts:1
|
10/24/2006 11:40 AM |
|
is it possible for the user to upload or maybe use a remote image as an avatar? |
|
|
|
|
Gym Media
Nuke Pro Posts:73
|
10/24/2006 12:35 PM |
|
Yes actually you can upload, or point to a remote image via Active Forums "My Profile". BUT I think you made a good point. A link to where the user can edit their profile should be on the same page as the "My Avatar" page.
Thanks for the suggestion! |
|
GymnasticsMeida.com The Ultimate Portal for the Ultimate Sport |
|
|
Gym Media
Nuke Pro Posts:73
|
10/24/2006 12:48 PM |
|
You can use the {XMOD_UserId} constant to embed the user id into the url to link to the user's "My Profile" page.
Below is what I used to link to the user id.
<CENTER><TABLE> <TR> <TD id="dnn_ctr761_NTForums_toolbar_tdMyProfile" nowrap="nowrap"><a id="dnn_ctr761_NTForums_toolbar_hypProfile" class="CommandButton" href="/Forums/tabid/230/view/profile/uid/{XMOD_UserId}/Default.aspx">My Profile</a></TD> </TR> </TABLE></CENTER> |
|
GymnasticsMeida.com The Ultimate Portal for the Ultimate Sport |
|
|
Steve Topilnycky
Nuke Newbie Posts:2
|
11/25/2006 5:13 AM |
|
Ken, I am trying your sample above. I ran into a little snafu.. I have admin, and a security role called Forum Admin, and of course registred users. I set the XMOD permissions so that Admin & Forum Admin can approve and Registred Users can upload. Funny, when I log in as a regular user, I can not added any Records. If I log in as Forum Admin, I can approved/disapprove of images, but can not upload. Only the Admin account current can upload. I am very new to XMOD, but I like your sample, it fills the gap where Active Forums did not add such a feature. Any suggestions on how to fix this. I have been through the configuration set up so many times I'm going blurry eyed.
Thanks in advance for your assistance.
-- Regards, Steve |
|
|
|
|
Steve Topilnycky
Nuke Newbie Posts:2
|
11/25/2006 5:20 AM |
|
>>Ken, <<
BIG OOPPPSSSS.. Sorry I meant to write Kirk... -- Regards, Steve
|
|
|
|
|
Gym Media
Nuke Pro Posts:73
|
11/25/2006 12:31 PM |
|
Steve,
Have you added a XMod Form? Only people who added the record,or have permissions to edit/delete records see have the option(s) in a ListView. Do you have a URL, or is this on your local machine?
In the below example on my site I have a list view, and a form view on the same page.
Add Gympedia Entry
On this example I have a two list views, with a link to a form is the user has no Swap Meet profile. Users must enter data through a Form View, while Admins can add through the list view, or for view.
Swap Meet
Hope this helps... |
|
GymnasticsMeida.com The Ultimate Portal for the Ultimate Sport |
|
|
Gym Media
Nuke Pro Posts:73
|
07/17/2007 4:26 PM |
|
It's been brought to my attention that the selectavatar.aspx file could be suseptible to SQL injection attacks since the sql statment is not using paramters. Here is the updated code. If you have any questions please contact me.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim objConn As New SqlClient.SqlConnection("Server=someserver;Database=somedatabase;uid=someuserid;pwd=somepassword;")
Dim objCommand As New SqlClient.SqlCommand
Dim sql As String
Dim PortalID As String
Dim UserID As String
Dim Avatar As String
Try
PortalID = Request.QueryString("pid")
UserID = Request.QueryString("uid")
Avatar = "/Portals/" & PortalID & "/SystemAvatar/" & Request.QueryString("avatar")
sql = "UPDATE NTForums_UserDetails SET AvatarLink=@Avatar, AvatarFileName='' WHERE PortalID=@PortalID AND UserID=@UserID"
objConn.Open()
objCommand.Connection = objConn
objCommand.CommandText = sql
objCommand.Parameters.Add("@Avatar", Avatar)
objCommand.Parameters.Add("@PortalID", PortalID)
objCommand.Parameters.Add("@UserID", UserID)
objCommand.ExecuteNonQuery()
Catch ex As Exception
Throw ex
Finally
objConn.Close()
objConn.Dispose()
objCommand.Dispose()
End Try
End Sub |
|
GymnasticsMeida.com The Ultimate Portal for the Ultimate Sport |
|
|
Lee Sykes DNN Creative Staff
Nuke Master VI Posts:4945
|
|