SharePoint 2013 显示用户Lync是否在线(集成Lync)

本文讲述如何在SharePoint 2013 中显示用户Lync的状态(是否在线等)。

一共五种显示模式:

显示模式Lync的状态用户名用户照片
DefaultRenderYesYesNo
WithPictureYesYesYes
WithPictureDetailsYesYesYes
PictureOnlyYesNoYes
PresenceOnlyYesNoNo

代码实现方式如下(注意替换邮件地址和userpictureUrl,按邮件地址确定用户):

1. DefaultRender 模式 

<span>
 <span class='ms-imnSpan'>
  <a href='#' οnclick='IMNImageOnClick(event);return false;' class='ms-imnlink ms-spimn-presenceLink' >
   <span class='ms-spimn-presenceWrapper ms-imnImg ms-spimn-imgSize-10x10'>
    <img name='imnmark' title='' ShowOfflinePawn='1' class='ms-spimn-img ms-spimn-presence-disconnected-10x10x32' src=    '/_layouts/15/images/spimn.png?rev=23' alt='User Presence' sip='test@hotmail.com' id='imn_1,ty    pe=sip' />
   </span>
  </a>
 </span>
<span>
 <a href='#' οnclick='IMNImageOnClick(event);return false;' class='ms-imnlink' tabIndex='-1'>
<img name='imnmark' title='' ShowOfflinePawn='1' class=' ms-hide' src='/_layouts/15/images/spimn.png?rev=23' alt='Us  er Presence' sip='test@hotmail.com' id='imn_2,type=sip' /></a>Raghavendra Shanbhag
</span>
</span>

2.  WithPicture 模式

<div>
<div>
    <span>
       <a href='#' οnclick='IMNImageOnClick(event);return false;' class='ms-imnlink' tabIndex='-1'><img name='imnmark'        title='' ShowOfflinePawn='1' class=' ms-hide' src='/_layouts/15/images/spimn.png?rev=23' alt='User Presence' s       ip='test@hotmail.com' id='imn_1,type=sip' /></a>
   <span>
   <img style="width:62px; height:62px; border:none" src="yourpictureUrl" alt=" Ram" />
   </span>
  </span></span>
</div>
<div class="ms-floatLeft ms-descriptiontext"><span class="ms-verticalAlignTop ms-noWrap ms-displayInlineBlock">
    <span class='ms-imnSpan'><a href='#' οnclick='IMNImageOnClick(event);return false;' class='ms-imnlink ms-spimn-presenceLink' ><span class='ms-spimn-presenceWrapper ms-imnImg ms-spimn-imgSize-10x10'><img name='imnmark' title='' ShowOfflinePawn='1' class='ms-spimn-img ms-spimn-presence-disconnected-10x10x32' src='/_layouts/15/images/spimn.png?rev=23' alt='User Presence' sip='test@hotmail.com' id='imn_2,type=sip' /></span></a></span><span class="ms-noWrap ms-imnSpan"><a href='#' οnclick='IMNImageOnClick(event);return false;' class='ms-imnlink' tabIndex='-1'><img name='imnmark' title='' ShowOfflinePawn='1' class=' ms-hide' src='/_layouts/15/images/spimn.png?rev=23' alt='User Presence' sip='test@hotmail.com' id='imn_3,type=sip' /></a>Ram</span>
</span>
</div>
</div>



3. WithPictureDetails 模式

<div>
<div class="ms-tableRow">
 <div>
  <span class='ms-imnSpan'>
  <a href='#' οnclick='IMNImageOnClick(event);return false;' class='ms-imnlink ms-spimn-presenceLink' >
   <span class='ms-spimn-presenceWrapper ms-imnImg ms-spimn-imgSize-10x10'><img name='imnmark' title='' ShowOfflinePaw   n='1' class='ms-spimn-img ms-spimn-presence-disconnected-10x10x32' src='/_layouts/15/images/spimn.png?rev=23' alt='   User Presence' sip='test@hotmail.com' id='imn_661,type=sip' /></span>
  </a>
  </span></span>
</div>
<div class="ms-tableCell ms-verticalAlignTop">
<div class="ms-peopleux-userImgDiv"><span class="ms-imnSpan"><a href='#' οnclick='IMNImageOnClick(event);return false;' class='ms-imnlink' tabIndex='-1'><img name='imnmark' title='' ShowOfflinePawn='1' class=' ms-hide' src='/_layouts/15/images/spimn.png?rev=23' alt='User Presence' sip='test@hotmail.com' id='imn_3452,type=sip' /></a><span><img style="width:62px; height:62px; border:none" src="userpictureUrl" alt=" Ram" /></span></span></span></div></div><div class="ms-tableCell ms-peopleux-userdetails ms-noList"><ul style="max-width:150px"><li><div class="ms-noWrap"><span><a href='#' οnclick='IMNImageOnClick(event);return false;' class='ms-imnlink' tabIndex='-1'><img name='imnmark' title='' ShowOfflinePawn='1' class=' ms-hide' src='/_layouts/15/images/spimn.png?rev=23' alt='User Presence' sip='test@hotmail.com' id='imn_34523,type=sip' /></a>Raghavendra Shanbhag</span></div></li></ul></div>
</div>
</div>


4. PictureOnly 模式

<div>
<div>
<div class="ms-tableCell">
  <span class='ms-imnSpan'><a href='#' οnclick='IMNImageOnClick(event);return false;' class='ms-imnlink ms-spimn-prese  nceLink' ><span class='ms-spimn-presenceWrapper ms-spimn-imgSize-8x72'><img name='imnmark' title='' ShowOfflinePawn=  '1' class='ms-spimn-img ms-spimn-presence-disconnected-8x72x32' src='/_layouts/15/images/spimn.png?rev=23' alt='User   Presence' sip='test@hotmail.com' id='imn_1,type=sip' /></span></a></span></span></div>
<div class="ms-tableCell ms-verticalAlignTop">
<div class="ms-peopleux-userImgDiv"><span class="ms-imnSpan"><a href='#' οnclick='IMNImageOnClick(event);return false;' class='ms-imnlink' tabIndex='-1'><img name='imnmark' title='' ShowOfflinePawn='1' class=' ms-hide' src='/_layouts/15/images/spimn.png?rev=23' alt='User Presence' sip='test@hotmail.com' id='imn_2,type=sip' /></a><span class="ms-peopleux-imgUserLink"><span class="ms-peopleux-userImgWrapper" style="width:72px; height:72px"><img style="min-width:72px; min-height:72px; clip:rect(0px, 72px, 72px, 0px); max-width:72px" src="userpictureurl" alt=" Ram" /></span></span></span></div>
</div>
</div>
</div>

5.  PresenceOnly  模式: 

<span class='ms-imnSpan'>
   <a href='#' οnclick='IMNImageOnClick(event);return false;' class='ms-imnlink ms-spimn-presenceLink' >
    <span class='ms-spimn-presenceWrapper ms-imnImg ms-spimn-imgSize-10x10'><img name='imnmark' title='' ShowOfflinePa    wn='1' class='ms-spimn-img ms-spimn-presence-disconnected-10x10x32' src='/_layouts/15/images/spimn.png?rev=23' alt    ='User Presence' sip='test@hotmail.com' id='imn_1,type=sip' />
   </span>
  </a>
</span>

原文来自:

http://www.sharepointcolumn.com/lync-presence-indicators-code-snippets-in-sharepoint-2013/

http://www.sharepointcolumn.com/lync-presence-indicators-in-sharepoint-2013/

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值