Solved

How to add user photo beside user name in MOSS 2007 "Welcome..."?

Posted on 2013-01-22
18
493 Views
Last Modified: 2013-01-27
Dear EE experts,

We would like to ask if it is possible to add user photo beside user's name (Name with Picture), at the "Welcome USER..." upper right part of MOSS 2007.
If it's possible, kindly advise how.

Thank you & hope to hear soon...
0
Comment
Question by:Stiebel Eltron
  • 11
  • 5
  • 2
18 Comments
 
LVL 13

Expert Comment

by:Yagya Shree
ID: 38805001
Here you go:

Display user profile picture next to welcome name
http://erikswenson.blogspot.com/2011/04/display-user-profile-picture-next-to.html
0
 

Author Comment

by:Stiebel Eltron
ID: 38805366
Hi there! Thanks for your response...
But we are using MOSS 2007 & not SP2010...
Is it possible?
0
 
LVL 13

Expert Comment

by:Yagya Shree
ID: 38805387
Yes, the code change would be same for moss.
0
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 38805535
Hi,
there would also be a client-side only Javascript solution using jQuery and SPServices to manipulate the client side dom and add the picture.
If you are interested, I might be able to prototype a solution (but would take some time).

KR
Rainer
0
 

Author Comment

by:Stiebel Eltron
ID: 38806192
@RainerJ, yes please... We would like to check it as well. We welcome all suggestions and advises...

@vagvashree, we'll check it out as well... Thanks!
0
 

Author Comment

by:Stiebel Eltron
ID: 38806231
@vagvashree, we'll just follow the script from the link that you advise? Or do we need to change anything it would support MOSS 2007?
0
 

Author Comment

by:Stiebel Eltron
ID: 38808475
@yagyashree: This is the error that we received:
"An error occurred during the processing of . Could not load file or assembly 'Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.
Troubleshoot issues with Windows SharePoint Services."

From the link that you advised, we followed the instructions and just add this:
<%@ Register Tagprefix="SPSWC" Namespace="Microsoft.SharePoint.Portal.WebControls" Assembly="Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

at the top of the masterpage.

And this:
<SPSWC:ProfilePropertyImage PropertyName="PictureUrl" style="float: left; height: 20px;" ShowPlaceholder="true" id="PictureUrlImage" runat="server"/>

right before the Welcome text, inside the masterpage...

Then after we check-in and refresh the page, we received the said error...

Kindly advise on how to resolve this...

Thank you!
0
 

Author Comment

by:Stiebel Eltron
ID: 38812762
@RainerJ, waiting for your suggestion...

Thank you :)
0
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 500 total points
ID: 38813442
Hi,
sorry I am currently busy with serious production issues on my current project (where we have a very "good" "service" provider). But I try to update it this afternoon (german time).

For the page change:
You will have to use SharePoint 2007 version which is internally 12 and not as mentioned in the article 14 (which is SharePoint 2010 - there is no Office 13 ;-)

<%@ Register Tagprefix="SPSWC" Namespace="Microsoft.SharePoint.Portal.WebControls" Assembly="Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

HTH
Rainer
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 38813791
Hi,

here is the code.
Comments:
For the sake of easier testing I just used a content editor web part on one page. For a final solution you should add the javascript to your master page.
Depending on your picture sizes, you should consider setting a percentage or an other type of resizing.

<script src="/Assets/jquery-1.8.3.min.js" type="text/javascript"></script>
<script type="text/javascript" src="/Assets/jquery.SPServices-0.7.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	// First get the current logged in user account 
	var thisUserAccount = $().SPServices.SPGetCurrentUser({
		fieldName: "Name",
		debug: false
	});
	// Now request the picture url
	$().SPServices({
    	        operation: 'GetUserProfileByName',
	            AccountName: thisUserAccount,
	            async: false,
	            completefunc: function (xData, Status) 
                {		        		        
                    var properties = xData.responseXML.getElementsByTagName('PropertyData');  
                    
                    var propertyValues = new Array();  
                    for (var i=0; i < properties.length; i++)  
                    {  
                       var propName = properties[i].getElementsByTagName('Name')[0].childNodes[0].nodeValue;                                        
                       propertyValues[propName] = properties[i].getElementsByTagName('Value');  
                       //alert(propName);
                       var oValueNode = properties[i].getElementsByTagName('Value');    
                       if(oValueNode.length > 0)
                       {
                            propertyValues[propName] = oValueNode[0].childNodes[0].nodeValue;
                       }
                       else
                       {
                            propertyValues[propName] = '';
                       }                                           
                    }      
                     		        
                    //Now set url var
                    var thisUserPictureUrl = propertyValues['PictureURL']; 

					if (thisUserPictureUrl)
						$("table .ms-globalright td:first").append('<img id="usrprofpic" src="' + thisUserPictureUrl + '" />');
	            }
            });
});
</script>

Open in new window


And thats how it could look like

User Profile Picture
HTH
Rainer
0
 

Author Comment

by:Stiebel Eltron
ID: 38814746
Hi there Rainer!

Thank you for your response...

Where can we find these files: jquery-1.8.3.min.js / jquery.SPServices-0.7.2.min.js ?

>>For the sake of easier testing I just used a content editor web part on one page.<<
- which codes you put into content editor web part?

>> For a final solution you should add the javascript to your master page.<<
- and which javascript are you referring, is it the one that you posted above?

- and where to put the location of the photos & how about its sizes?
0
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 38814874
Hi,

SPServices can be downloaded from Codeplex:
http://spservices.codeplex.com/

jQuery from
http://jquery.com

>>For the sake of easier testing I just used a content editor web part on one page.<<
The above posted code has been in a text file (EEUserProfPic.txt) which I uploaded to a doc lib. The content editor web part has then be configured to use the text file as content link.

>> For a final solution you should add the javascript to your master page.<<
Yes, exactly - the complete code should be in the header area of your master page.

The location of the user profile pics depends on your needs. In my case (where I do not have an AD - just workgroup mode) I added the picture to a picture library and set the picture URL in the user profile.
Here some suggestions:
http://social.technet.microsoft.com/forums/en-US/sharepointgenerallegacy/thread/3961ee83-7ef4-46e7-b493-f833d739e6a4

HTH
Rainer
0
 

Author Comment

by:Stiebel Eltron
ID: 38817283
I did the first advise, change the version 14, into 12...

QUESTIONS:
- How to set the vertical alignment of the "Welcome..." beside the user photo? We tried some to set it at the same level as the "My Links", but if it's not @ the bottom, it will be at the top level, we even set it to middle, but still no work...

- We noticed that it is only visible at the first page, but not visible anymore at the other pages... Kindly advise how to set it be visible globally (entire site)...
How about the js script that you advise (the other one), would it be visible the entire site or the same, just the first page only?

Thank you & hope to hear from you again soon...
Welcome-vert-alignment.jpg
0
 

Author Comment

by:Stiebel Eltron
ID: 38817861
... additional:

we noticed from the first advise, change the version 14, into 12... the user photo, shows to the PC where we open the site using SP Designer, but when we tried to view the effect from other users, it's not working... we even tried to restart one PC, just to make sure it refreshes, but still the same...
0
 
LVL 44

Assisted Solution

by:Rainer Jeschor
Rainer Jeschor earned 500 total points
ID: 38818407
Hi,
depending on your site configuration / template:
Did you publish / approve the master page?
Otherwise if the other users do not have site admin permissions, they wont see the change, hence no picture.

KR
Rainer
0
 

Author Comment

by:Stiebel Eltron
ID: 38818586
Hello!

>>Did you publish / approve the master page?<<
- could you please advise how to do that? As we're using the default template of the moss 2007...

Thank you!
0
 

Author Closing Comment

by:Stiebel Eltron
ID: 38818714
Got it! Published and approved!
0
 

Author Comment

by:Stiebel Eltron
ID: 38825604
Follow up...

Wonderin' why it didn't show up again :(

We didn't do anything, last Friday, it's working already, then this morning, when we check it out, there's no photos showed up, even me, as admin...

We tried to Publish & Approve it again, but still, no photo is showing up...

Hope to hear again...

Thank you!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now