Below you will find pages that utilize the taxonomy term “social”
Posts
Showing Birthdays and Job Anniversaries in the Newsfeed
In our project we have a requirement to show birthdays and job anniversaries in the Newsfeed. The solution is simple (when you know it) but there has not been any information about it online, until today. I want to share a few lines of PowerShell code to enable Anniversary notifications in the Newsfeed. This desired piece of code was written by my colleague Emma Degerman. Enjoy:
[source language=“PowerShell”] $job = Get-SPTimerJob | ?
Posts
Get all comments
If you try to get comments quantity for a url, you may wonder, why there is only quantity of the comments which the current user has posted:
public int GetNumberOfNewsPageComments (SPSite currentSite, string pageUrl, int max) { var serviceContext = SPServiceContext.GetContext(currentSite); var socialCommentManager = new SocialCommentManager(serviceContext); var comments = socialCommentManager .GetComments(new Uri(pageUrl), max); if (comments != null) { return comments.Length; } return -1; } ```The solution is to impersonate the SPSite object with an account who has the rights to manage social data.
Posts
SocialCommentWebPart
Lägg till en kommentarruta i din sida. Gör det lite till webb2.0. Här finns lite info. På denna sida står det hur man kan lägga till webparten mha xml. You can even provision a social comment webpart like it is done in my site:
<File Url="person.aspx" Type="Ghostable"> <AllUsersWebPart WebPartZoneID="MiddleLeftZone" WebPartOrder="3"> <!\[CDATA\[ <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2"> <Assembly>Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly> <TypeName>Microsoft.SharePoint.Portal.WebControls.SocialCommentWebPart</TypeName> <Title>$Resources:spscore,SocialComment\_WebPart\_Title</Title> <Description>$Resources:spscore,SocialComment\_WebPart\_Description</Description> <PartOrder>3</PartOrder> <FrameType>TitleBarOnly</FrameType> <AllowMinimize>true</AllowMinimize> <AllowRemove>true</AllowRemove> <IsVisible>true</IsVisible> </WebPart> \]\]> </AllUsersWebPart> </File>