Translations of this page:

Skype Me button integration

1. create file called PeopleSkypeMeButton.php

<?
class PeopleSkypeMeButton implements TemplaterComponent
{
	public function Show($attributes)
	{
		$userid = $attributes['userid'] ? $attributes['userid'] : getvar('id');
		$md_name = $attributes['md_name'] ? $attributes['md_name'] : 'skype';
 
		if (!$userid || !is_numeric($userid))
			return '';
 
		$user = new User($userid);
		$skype_id = $user->GetValue($md_name);
 
		if (strlen($skype_id) > 0)
			$result = '<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>
				<a href="skype:'.$skype_id.'?call"><img
				src="http://download.skype.com/share/skypebuttons/buttons/call_green_transparent_70x23.png"
				style="border: none;" width="70" height="23" alt="Skype Me" /></a>';
		else
			$result = '';
 
		return $result;
	}
}
?>

2. Copy this file into

/intranet/people/classes/PeopleSkypeMeButton.php

3. Insert

<component class="PeopleSkypeMeButton">

into

/interface_{custom}/people/viewprofile.html

example location:

...
<TR>
<TD colspan="2" id="PeopleSendSMSLine"> <txt name="send_sms_line" visible="0">
<img src="../../images/default/icons/comsms.gif" width="16" height="16" ><a name="send_sms" href="../communication/sms_message.php?uid={id}"><txt name="people:viewprofile:send_sms">Send an SMS message</txt></a></txt>
<img src="../../images/default/icons/comim.gif" width="16" height="16" ><a name="send_im" href="../communication/imessagesend.php?uid={id}"><txt name="people:viewprofile:send_im">Send an Instant message</txt></a>
	&nbsp;	<component class="PeopleSkypeMeButton">
</TD>
</TR>
 
...

If there is no viewprofile.html within interface_{custom} you can take a full copy from interface_default.

3. Create a custom metadata for user with the name ‘skype’

If they use different metadata key, not just “skype”, add attribute md_name=”...” into that tag: <component class=”PeopleSkypeMeButton” md_name=”usr_skype”>

4. Changing button style can done through:

http://www.skype.com/share/buttons/

 
customisation/people/skype.txt · Last modified: 07/06/2011 04:49 by admin
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki