Robert Kabacoff
new to the springs Posts:4
|
01-13-2009 06:13 AM |
|
Using Dynamic Registration V3.2 our users upload a photo of themselves. It displays fine in their own profile page.
In the User Directory (Dynamic User Directory v2.4), I want to include their photo in the details page. When I use the token [Photo], I get an image name (e.g. 13ee2d28-5fa3-42c4-b51c-7cf4ab56d54c.jpg) rather than the photo.
How can I have the photo display? |
|
|
|
|
Candace
river guide Posts:2431
|
01-13-2009 07:58 AM |
|
Hi Robert,
Can you please try this? If you already have the image field in your registration form, then
1. In User Directory, Edit template. When you click on image button, you'll get a pop up box for image properties.
2. Add this to the URL field: http://www.yourbusiness.com/portals...Field]
where [ImageField] is the short field name for the image.
Let me know if that works for you. Thanks.
Candace |
|
|
|
|
Robert Kabacoff
new to the springs Posts:4
|
01-13-2009 08:31 AM |
|
Candice, this is great. It worked like a charm.
Thanks!
Rob |
|
|
|
|
Candace
river guide Posts:2431
|
|
Wong
new to the springs Posts:1
|
07-07-2009 05:21 PM |
|
Another here>>>If im using sharepoint picture library...i upload the photo to the picture library..and now i using the report builder to get the photo from picture library ...can i do that??... |
|
|
|
|
Miguel Clara
going with the flow Posts:56
|
02-28-2010 03:31 PM |
|
I've got to this part easy... but I would like to show a deafult picture in case the user didn't upload anythig.... is this possible?
How could I do it?? |
|
|
|
|
David To
river guide Posts:2719
|
03-01-2010 06:43 AM |
|
HI, it's possible but I believe you will have to use SQL stored procedure to set the profile field to be some default image if the user didn't choose one. Are you using Dynamic Registration as the module for the user to register/update their DNN profile fields? Or are you simply using the default DNN version? -- David |
|
|
|
|
Miguel Clara
going with the flow Posts:56
|
03-03-2010 01:48 AM |
|
Yes David, I am using Dynamic Registration 4! |
|
|
|
|
David To
river guide Posts:2719
|
03-04-2010 07:48 AM |
|
If you are using Dynamic Registration, you could create an SQL form completion event insert a user profile with default image if they don't have an image. 1) check the "profilepropertydefinition" sql table to get the "PropertyDefinitionID" of the image property 2) then check the userprofile table to see if this propertydefintionid for this userid exists 3) if not add it the the userprofile table with a default image I hope this points you in the right direction. -- David |
|
|
|
|
Miguel Clara
going with the flow Posts:56
|
03-05-2010 01:03 AM |
|
Thank you David... but I am a bit dum.. lol
DR already was the "default value" so I can simply upload a "default_avatar.png" to the DR folder in my portal...
If the user does change nothing... the avatar will be the one I upload...
I still have to change that value depending on a choice.... cause this site has "Male" "Female" and "Couple" as gender choice... so it would be nice to have a default picture depending on that selection...
I can do this with the "Affected Question New Default Value" in the question events...
So sorry for the time I made you dig this.. I was just not being very thorough, the options exist with no need for SQL
Thanks! |
|
|
|
|
Miguel Clara
going with the flow Posts:56
|
03-16-2010 08:52 AM |
|
Ok this works very well for new users... but for all that already exists its more complicated.. The query I would have to use is an insert... and I'm afraid I might end up make a big mess to DNN DB... so I've tried another approach.. I was trying to use Java Script to do this (show a default imagage in cause img src=.... fails...) But I can't make this work... no matter what I change DUD allways changes my template source code to some big mess... in IE i get an error loading the page... Is DUD not compatible with JavaScript??? |
|
|
|
|
David To
river guide Posts:2719
|
03-16-2010 09:30 AM |
|
HI, I don't know about placing javascript in the listing template but a user have successfully placed javascript in the detail template though. Personally, I believe running an SQL query to insert the record into the user profile is an easier way to go. -- David |
|
|
|
|
Miguel Clara
going with the flow Posts:56
|
03-18-2010 04:54 AM |
|
Hum.. but there are user who have allready a diferent value for that field... I would have to take that in count in the query....
You wouldn't mind sharing the query, you usualy use, would you?
Does this only needs to "mess" with one table? |
|
|
|
|
David To
river guide Posts:2719
|
03-18-2010 06:06 AM |
|
Hi, you would use something like the stored procedure (needs to retrieve the ImageUpload field and the UserID): create procedure usp_dynamicregistration_setdefaultimage (@ImageUpload nvarchar(200),@UserID int) as begin declare @CompanyLogoID int set @CompanyLogoID = (select propertydefinitionID from {objectQualifier}profilepropertydefinition where propertyname = 'CompanyLogo') if (@ImageUpload = '') begin if not exists (select UserID from {objectQualifier}userprofile where userid=@UserID and propertydefinitionID = @CompanyLogoID) insert into {objectQualifier}userprofile(UserID,PropertyDefinitionID,PropertyValue, PropertyText,Visibility,LastUpdatedDate) values(@UserID,@CompanyLogoID,'defaultimage.jpg','',2,getdate()) end if (@ImageUpload != '') begin if not exists (select UserID from {objectQualifier}userprofile where userid=@UserID and propertydefinitionID = @CompanyLogoID) insert into {objectQualifier}userprofile(UserID,PropertyDefinitionID,PropertyValue, PropertyText,Visibility,LastUpdatedDate) values(@UserID,@CompanyLogoID,@ImageUpload,'',2,getdate()) end end If @ImageUpload is blank and the userprofile doesn't exist, then insert it with a default image. If @ImageUpload is not blank, and the userprofile doesn't exist, then insert it with the corresponding image. Now, what about existing users that don't have an image yet? Let's say the propertydefinitionid for the picture is 223. Then you can do something like this: select userid,'223' as PropertyDefinitionID,'defaultimage.jpg' as PropertyValue,space(10) as PropertyText, 2 as Visibility,getdate() as LastupdatedDate into templogo from users where userid not in (select userid from userprofile where propertydefinitionid = 223) insert into {objectQualifier}userprofile(UserID,PropertyDefinitionID,PropertyValue,PropertyText,Visibility,LastupdatedDate) select * from templogo Test it out and see if it works for you. You may have to tweak the SQL query a bit but it points you in the right direction. -- David |
|
|
|
|