General developer forum

 
 
Picture of Irith Herman
Who's On Skype
 

Is there a block like this for moodle 2:

Who's On Skype

Thanks

Irith

 

 
Average of ratings: -
Matt Bury
Re: Who's On Skype
Group Particularly helpful Moodlers

Hi Irith,

This would be a very simple adaptation to make to the Online Users' block. It just means detecting if a user has filled in the Skype ID on their profile and then adding the Skype Javascript button embedder like this: https://dev.skype.com/skype-uri/generator

It should generate something like this:

<__script type="text/javascript" src="http://cdn.dev.skype.com/uri/skype-uri.js"></__script>
<__div id="SkypeButton_Call_matt.bury_1">
  <__script type="text/javascript">
    Skype.ui({
      "name": "call",
      "element": "SkypeButton_Call_my.skype.id_1",
      "participants": ["my.skype.id"]
    });
  </__script>
</__div>

(I've put 2 underscores before each tag so that the code doesn't get filtered out by Moodle). You just need to replace the "my.skype.id" bit with the users' Skype IDs.

I did something similar with Moodle 1.9's Online Users block.

 
Average of ratings: -
Picture of Irith Herman
תשובה ל: Re: Who's On Skype
 

Hi

I did not understand where to put this code??

 
Average of ratings: -
Matt Bury
Re: תשובה ל: Re: Who's On Skype
Group Particularly helpful Moodlers

You'll need to make a copy of the Online Users (moodle/blocks/online_users/) block module and rename it and the class names to something else, then put in the necessary JS and PHP code to make it show the users' Skype buttons.

If you're not sure how to do it, contact your IT support or ask a developer. It's a quick, simple job.

 
Average of ratings: -
Picture of Irith Herman
תשובה ל: Re: תשובה ל: Re: Who's On Skype
 

I would like to do it myself with your help , please.

1. do i have to copy the code in this file?? block_online_users.php

and what should i do with al the rest of the code in this page?

2. do i need the tests folde that is indide the block_online_users folder?

3. in the db folder what to change there somthing in the access.php?

 

Thank you

Irith

 
Average of ratings: -
Matt Bury
Re: תשובה ל: Re: תשובה ל: Re: Who's On Skype
Group Particularly helpful Moodlers

There's a guide to block development here: http://docs.moodle.org/dev/Blocks

I hope this helps! smile

 
Average of ratings: -
Picture of Irith Herman
תשובה ל: Re: תשובה ל: Re: תשובה ל: Re: Who's On Skype
 

Thank you 

i succeeded to build the block but i dont know how and where to put the javascript.

Can you help me with it , please.

Irith

 
Average of ratings: -
Picture of Irith Herman
תשובה ל: Re: תשובה ל: Re: תשובה ל: Re: Who's On Skype
 

do I havE to put it in jS filE?

 
Average of ratings: -
Matt Bury
Re: תשובה ל: Re: תשובה ל: Re: תשובה ל: Re: Who's On Skype
Group Particularly helpful Moodlers

The main JS code is hosted on Skype's servers. You just need to print out the generated button code with the user's Skype ID next to their names in the block.

 
Average of ratings: -