Skype presence html

Skype presence html

by Jamie Pratt -
Number of replies: 84
I just added a Skype block with some info about my Skype presence to my site http://jamiep.org Attached is a screen shot.

Thought I would share the html I used to do this for anyone elses benefit. I found the some of the code on the jyve site would only work if your users had the jyve skype plug-in installed but the html below should work for anyone who has skype. There is some javascript available on the skype site that can detect the presence or nonpresence of Skype on your users system and direct the user to a page saying he needs skype if he doesn't have it, but unfortunately I couldn't use that in the html block because Moodle stripped out the code when I tried to submit it (guess if I put the code directly into the db it might be a quick workaround for that?!?thoughtful).

Below is the html I ended up with.

<p style="text-align: center;">
I am currently :
<a href="http://skypecard.jyve.com/test123.htm">
<img border="0" title="Click Here for My Contact Info" alt="Click Here for My Contact Info" src="http://www.skypepresence.com/callbutton/test123.gif" /></a>
<br />
on Skype
<br />
<a href="http://skypecard.jyve.com/test123.htm">
<em>Click Here For More Contact Info For Me.</em></a>
<br />Or :<br /> <a href="skype:test123?add">
<img border="0" src="http://jyvetools.jyve.com/addcontact.gif" title="Click Here To Add Me as A Skype Contact" alt="Click Here To Add Me as A Skype Contact" /></a>
<br /> <a href="skype://test123?chat">
<img border="0" src="http://jyvetools.jyve.com/sendmsg.gif" title="Send Me a Text Message With Skype" alt="Send Me a Text Message With Skype" /></a></p>

  • Just replace test123 with your skype name and put the html in a html block.
  • You need to download the jyve skype plug-in in order to have the presence detection work. Download the jyve plug in (only for Windows I'm afraid) from http://plugin.jyve.com/?fuse=download and run the self installer.
  • I also made a 'SkypeCard' on the web site which gives people useful information about the local time where I am. If you don't make a card then you should maybe point the link for more contact info at your user profile instead of http://skypecard.jyve.com/test123.htm

Notice I didn't put any button in the block that would directly fire up skype and phone me. I preferred to add the button for people to text me or to check out my skype card which includes another suggestion to text me before calling. I'm not sure if that is necessary I was just a bit worried that I might get a flood of phone calls.

Jamie



Attachment skype.gif
Average of ratings: -
In reply to Jamie Pratt

Re: Skype presence html

by Darren Smith -
I like that! That is great smile

It would be really stunning if somebody intergrated it within the users profile page cool
In reply to Darren Smith

Re: Skype presence html

by Jamie Pratt -
The skype presence detection requires you to install the jyve plug in for skype (only available for Windoze). But you could add as an option to the user profile - 'Do you have jyve skype plug in?' I guess and then print the presence icon for people who say they have the plug in.
In reply to Jamie Pratt

Re: Skype presence html

by N Hansen -
This is great. I just tried pasting this into a resource, and it seems to work there  as well. This means I can use this as "voice assignment module." I am going to require my students to contact me via Skype to do an assignment where I must listen to them and this is a great way to do it. I'm going to test it now with the assignment module and make it an offline assignment. That way I could check off when students have completed the voice assignment.
In reply to N Hansen

Re: Skype presence html

by N Hansen -
Here's the preliminary report on my experiment. I do want it to fire up and call me. But using the standard script from the Jyve website doesn't work in Moodle because Moodle rewrites the code once you put it into the html editor. But I found that using a bit of code from elsewhere in Moodle works. You just need to add:
<a href="callto:yourskypename">Call me now</a>
In reply to N Hansen

Re: Skype presence html

by Jamie Pratt -
I've paid for a phone no in the UK with Skype and got free voice mail for only 10 euros for 3 months which I think is pretty reasonable. If you get voice mail which on its own is half the price then you can use a link with button or whatever with this url skype://username?voicemail also you can do skype://username?call and similarly ?chat. But I think the voicemail option might be quite nice for an assignment - your user would be played an automated message and then would be able to record a ten minute reply.

Jamie

In reply to Jamie Pratt

Re: Skype presence html

by Jamie Pratt -
I posted the following to the jyve forums :

subject:anyway to detect who has jyve??

Hi,

Is there anyway to detect whether a user of a certain Skype Name has the jyve plug in?

This would be a wonderful feature.

Moodle LMS currently accepts a Skype name when a user registers. And when you view a user profile a link is displayed to call their skype name. It would be nice to be able to print a Skype presence indicator in their profile to show if they are online but most users won't have the jyve plugin I expect.

What would be really cool is if we could contact the jyve web server using a web service and ask if the user is registered at jyve (could possibly do an update of this info whenever the user updates his profile) and then if they are print the jyve-skype presence indicator.

I've worked quite a lot doing Moodle development work. There is a good deal of interest in Skype and haveing Skype enabling Moodle installations. See this post on the Moodle forums for instance :

http://moodle.org/mod/forum/discuss.php?d=26833

and my post about Jyve :

http://moodle.org/mod/forum/discuss.php?d=33259

Jamie


In reply to Jamie Pratt

Re: Skype presence html

by Jamie Pratt -

Seems that Skype is working on a web presence api that will be available for access by developers. This it appears will work with Skype 2.0 after the beta, might even work with Skype 1.0??? Below taken from share.skype.com/developer_zone/

Web Presence API. It has been clear for a while that there is an enormous demand for an extended presence service which will allow web sites to publish the presence status of participating users.

Our new Web presence API will do just that. The presence servers will sit at the heart of the Skype network for maximum performance and scalability. Users will be given a new configuration option within their profiles to allow their presence to be visible to anyone.

This will mean we won't need the jyve plug in anymore and possibly we will be able to query the web service for every Moodle user to see if there is info on their skype presence.

In reply to Jamie Pratt

Re: Skype presence html

by Tim Allen -
Perhaps beside the field for the skype ID, there could be a checkbox saying "Do you wish to show your online skype status?", with a popup window giving the download for the jyve skype plugin.

The tricky bit is how to check to see if the individual user has actually installed the plugin, and thus to enable the presence button. We could use the javascript check at http://plugin.jyve.com/js/plugin_card.js but when to check it is difficult - this could probably only work while the user is logged into Moodle. As Jamie suggested below, it would be best to do it via a direct call to the jyve system.

Tim.
In reply to Jamie Pratt

Re: Skype presence html

by Tim Allen -
Hi Jamie and other Skype Moodlers,

This is indeed an exciting tool. big grin

I found that I was able to enter the javascript code into a Moodle HTML block successfully, but it took a lot of trial and error. I kept on entering the code until it stuck - a very time-consuming process and not a little frustrating - but ultimately successful. I did it in the Moodle HTML Editor in Firefox, and here is how I modified the code (remeber to replace test123 with your own skype name):

<p style="text-align: center;">I am currently : <a href="http://skypecard.jyve.com/test123.htm"><img border="0" src="http://www.skypepresence.com/callbutton/test123.gif" alt="My Details" title="My Details" /></a> <br />on Skype <br /><a href="http://skypecard.jyve.com/test123.htm"><em>My Contact Info</em></a> <br />Or :<br /><a href="skype:scop22?add" onclick="return skypeCheck();"><img border="0" src="http://jyvetools.jyve.com/addcontact.gif /></a><br /><a href="skype:test123?chat" onclick="return skypeCheck();"><img border="0" src="http://jyvetools.jyve.com/createchat.gif" /></a><br /><a href="imto://test123" onclick="return skypeCheck();"><img border="0" src="http://jyvetools.jyve.com/IMTO.gif" /></a></p>

(Note that I put the onclick='return skypeCheck();' text in the a (anchor) tag and not in the img tag, in contrast to the code on the jyve website, following the example from the skype website at http://share.skype.com/tools_for_sharing/skype_buttons/advanced_skype_buttons/)

I put the javascript file reference in the header.html of my Moodle theme, just above the closing </head> tag, like this:

<script language="JavaScript" type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>

It didn't work well when I put the line in the HTML block itself, this seems to work better.

The result of this is that if the user doesn't have skype installed and they click on a button to contact me, they will get a popup window with a link to download skype. You can test this on my homepage at http://tim.hannam.ac.kr

As you said Jamie, some of the links require not only skype but also the jyve plugin to work. I put an extra button (IM) in my HTML block to test this. I found a javascript file on the jyve site that will also test this and cause a pop-up window to download jyve also. The javascript file is here:
http://plugin.jyve.com/js/plugin_card.js
And the javascript call is:
onclick='setENDown();'


I am still working on how to get this working too by integrating this second javascript, maybe just add it like the first one? If anyone wants to have a look at this you are welcome! wink

Tim.

PS In the code above, remove the X from Xonclick, the HTML Editor puts that in automatically, probably for security reasons. wink
In reply to Jamie Pratt

Re: Skype presence html

by Matt Crosslin -
This is a great feature.  I was wondering, has anyone developed a block for this?  Since a teacher's Skype ID is stored in the profile, wouldn't it make sense to have a php script that extracts that ID and inserts it into this script?  Then a teacher could just select a "Skype" block, put it where they want it, and they are set up.  It wouldn't seem that hard, but I wouldn't want to re-invent the wheel if I don't have to.
In reply to Matt Crosslin

Re: Skype presence html

by Matt Crosslin -
I have a working version of a Skype Presence block going.  The only problem is, my background is in MySQL and I can only get the function working with MySQL like commands.  I just don't know how to translate this into Moodle-ese.  I've tried, but It's not working.  Here is what I am doing:

// get the course id and global CGF from the page:
$id = $this->instance->pageid;
global $CFG;

// get the main teacher's id from the teacher's database and pass it forward:
$query ="SELECT id FROM {$CFG->prefix}user_teachers WHERE course = '$id' AND authority = 1";
$result=mysql_query($query);
while($r=mysql_fetch_array($result))
{
$teacherid=$r["id"];
}

// get the main teacher's Skype id from the user database:
$query2 ="SELECT skype FROM {$CFG->prefix}user WHERE id = '$teacherid'";
$result2=mysql_query($query2);
while($r2=mysql_fetch_array($result2))
{
$skypeID=$r2["skype"];
}

Then I use an if/then statement to detect if there is a Skype id in the profile.  If not, the teacher gets instructions on how to set up Skype and Jyve, and then enter in the id.  If so, they see the code from the blovk above.

If I can get the code fixed so that it works in the Moodle framework, I can post the block so that it can be used by all.  You just load up the files, install the block, and any teacher can use it in their course.
In reply to Matt Crosslin

Re: Skype presence html

by Tim Allen -
Matt,

I am out of my depth here, so can not help with the code, but I am cheering you on from the sidelines.

I hope someone else can help you out, as this would be a great block in many ways. 

Please keep up the effort.  smile

Tim.
In reply to Jamie Pratt

Re: Skype presence html

by Matt Crosslin -
Here is the first version of the Skype presence block.  It's pretty simple to upload and implement.  This is my first block, so if you use this and run into any problems, please let me know.  I test installed this in Moodle 1.5.3 and it worked great.  I don't know about any earlier versions.

The current version of this block is in English, but the lang file can be edited to allow for use in any other language.

This only works with the Jyve plug-in for Skype (see the Read Me file for instructions).  But when Skype creates their own web presence functions, I will upgrade this script to work accordingly.
In reply to Matt Crosslin

Re: Skype presence html

by Bryan Williams -
Matt,

Doesn't seem to be detected for me, as after meeting all requirements I get this message displayed within the block:

STOP!
You need to configure a Skype account for this function to work:
  1. Go to Skype.com to dowload and set up a Skype account
  2. Download and install the Jyve plug-in for Skype. Make sure you have both Skype and Jyve opened on your computer before continuing.
  3. Go to your user account and enter you Skype account into the Skype ID section of your profile.
  4. Once you have completed this list, this Block will automatically update

In reply to Bryan Williams

Re: Skype presence html

by Matt Crosslin -
This message just basically means that there is no Skype ID in the profile of the main teacher of your course (see #3 in the list).
In reply to Matt Crosslin

Re: Skype presence html

by Bryan Williams -
Actually there is a Skype ID in this (mine) profile.
In reply to Bryan Williams

Re: Skype presence html

by Matt Crosslin -
But are you the main teacher (teacher #1)? The script looks for the Skype ID in the profile for the teacher with authority level 1 in Moodle 1.5.3.

Go into the course, click on the Teachers link in the Administration Block.  Your name would need to have a 1 in the order box.
In reply to Matt Crosslin

Re: Skype presence html

by Tim Allen -
I have exactly the same problem as Bryan and I am definitely the first teacher.  sad
In reply to Matt Crosslin

Re: Skype presence html

by Bryan Williams -
Yes, I'm teacher #1. I'm also the admin for this site; would that make any difference?
In reply to Matt Crosslin

Re: Skype presence html

by Matt Crosslin -
Hmmm..... programming is always tricky.

The Moodle install that I tested it on has an admin as the teacher.  So that shouldn't be causing it.  I went back and added another teacher, and it still worked.  But then I changed that second teacher to #1 (so that there were two), and I got the error message.  This block is designed just for one #1 level teacher, and having more than one will shut it down.  So, I guess the next thing to ask is: do you have more than one teacher with #1 level access, or hidden access maybe?  I had to look in the teacher's list to be sure.

If not, then we will have to keep digging.  I have only tried this on one install of Moodle, where it is working.  But that doesn't mean that it is ready for everyone.  That message you are getting is really the default error message.  It only appears when SQL can't find a skype ID in for the #1 teacher of that specific course, or of ot finds more than one.
In reply to Matt Crosslin

Re: Skype presence html

by Bryan Williams -
There are 6 teachers in this course, numbered 1-6. My own account is #1, and my Skype account from the profile link works fine.
In reply to Matt Crosslin

Re: Skype presence html

by Matt Crosslin -
Allright - I found the problem (hopefully).  It just goes to me being a newbie at Moodle programming.  I set up a second course on my Moodle test and found that the Skype Block didn't work there, even for the same teacher that it worked for in the other class.

I was looking for the wrong ID in the teacher's database.  I fixed that and now it works in both courses.  I have uploaded the block with these changes, and so I hope it will work for everyone now.  Maybe it just likes me because I am the creator.

If you want to go in and manually fix the problem, then find line 44 of blocks/skype/block_skype.php:

$profile = get_record('user','id',$entry->id);

and change it to this:

$profile = get_record('user','id',$entry->userid);
In reply to Matt Crosslin

Re: Skype presence html

by Bryan Williams -
Well now it works! wink  Shame about this jyve thing being required.
In reply to Bryan Williams

Re: Skype presence html

by Matt Crosslin -
Yes! Skype is "supposed" to develop a web presence application that works like Jyve, so as soon as it comes out, I will update this block to skip that extra step.

I noticed that Jyve has a shared browser application though, so the person you are talking to can look at the same page that you are.  That would be a nice feature in Moodle.  All it would really have to be is an iframe connected to a database that stores the pages that the instructor is surfing to.
In reply to Jamie Pratt

Re: Skype presence html

by Matt Crosslin -
I don't know if anyone noticed, but Jyve changed the way they do Web presence a little.  So I upgraded the Skype presence block to reflect those changes.  And a few glitches I found.
In reply to Matt Crosslin

Re: Skype presence html

by Ray Lawrence -
Hi,

It looks like a Jybe substitute is on its way.


In reply to Ray Lawrence

Vast: Re: Skype presence html

by Petri Niemi -
Hi all

I made a SkypeWeb block, which is based on Matt's block, but my block uses SkypeWeb instead of jyve and I made some other changes also =) It's not ready, but should be working.
In reply to Petri Niemi

Re: Vast: Re: Skype presence html

by Matt Crosslin -
I wish you had contacted me BEFORE doing this, because most of this work has already been done, with a few additional ideas, too.
In reply to Matt Crosslin

Re: Vast: Re: Skype presence html

by Jamie Pratt -
I was interested in this part of the blog post on the developer blog :

Developers
For developers returning a button may or may not be helpful in your application, so by changing the query string you can retrieve a text string:

http://mystatus.skype.com/lestermadden.txt
or if you prefer the result in a localized language
http://mystatus.skype.com/lestermadden.txt.fr

Similarly you can retrieve the status represented as a numeric value or in XML which will return all the localized strings.

http://mystatus.skype.com/lestermadden.xml

It seems it would be possible to query a url like http://mystatus.skype.com/lestermadden.txt every 5 minutes by a cron for all your users with skype ids and then display a list of course participants currently online on Skype in a block.

In reply to Jamie Pratt

Vast: Re: Vast: Re: Skype presence html

by Petri Niemi -
Hi Jamie

If I understood correctly, your point was updating a block for users statuses once in each five minutes? Sorry my bad english =P

I guess that it would be quite easy to do, but in my opinion page will be anyway refreshed by user more than once in a five minutes so the list of participants statuses will be updated during those refreshes. I guess that cron time should be much shorter so it makes any differense.

Correct me if I didn't get your point =)
In reply to Petri Niemi

New Skype presence web service

by Jamie Pratt -
Hi Petri and Matt,

My idea is that you could have a block listing all online users who are publishing there skype status, and not list users that are not showing there skype status. The new simple skype service will allow our Moodle application to know whether a user is online or not and so we can do more complicated things. Maybe we don't actually need to??

The cron checking might be useful just to check through all the skype ids that have been entered in profiles and to check who is showing whether they are online or offline and then only display those users status in the block. Another nice feature would be a 'last seen online on skype' output for each user in the block as well.

I guess for real time data it would be better to load a graphic from the skype server. This would not hold up sending the page because the graphic will be loaded after all the html for the page is sent.

I've not tried this web service out yet. Is it really not working properly. I've read somewhere you need to install absolutely the latest version of Skype 2.0 and you need to turn on showing your web presence in the options settings.

I'm looking forward to getting rid of Jyve. It keeps on displaying a pop up window every time I start up Windows.

Jamie
Average of ratings: Useful (1)
In reply to Jamie Pratt

Re: New Skype presence web service

by Jamie Pratt -

It seems that Skype 2.0.0.79 supports the new web service. This is currently the official Skype for Windows release, Skype 2 has come out of beta (for windows only I think).

In reply to Jamie Pratt

Re: New Skype presence web service

by Jamie Pratt -
The web service works well for me. You can see the text web service at :

http://mystatus.skype.com/jamiepratt.txt

It say I'm online. I think 'Unknown' must mean that you haven't got Skype Web set up properly. It was very easy to set up, I just installed Skype 2.0 and checked 'allow my status to be shown on the web' on the privacy screen of the options dialogue box.

The important thing about this is that it is machine readable (we could get Moodle to examine the image data returned from another url but that would be not be so nice).

Jamie
In reply to Jamie Pratt

Re: New Skype presence web service

by Jamie Pratt -
The simple 'web service' returns 'Offline' when I'm offline not 'Unknown' this means we can tell whether someone is showing there skype presence.
In reply to Jamie Pratt

Re: New Skype presence web service

by Jamie Pratt -

Other outputs from the web service :

Away
Not Available
Do Not Disturb
Skype Me

Notice the capitalisation.

The web service seems fast and seemingly instantly shows changes in status.


In reply to Jamie Pratt

Re: New Skype presence web service

by Jamie Pratt -
There is a video about SkypeWeb here

There have been some small changes in how SkypeWeb works since the video was made.

There is a forum for developer support for SkypeWeb here
In reply to Jamie Pratt

Re: New Skype presence web service

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I've added a small status icon to CVS on the user profile page.  Finally Skype is where ICQ was about 5 years ago.  wink

eg see my profile here on moodle.org
In reply to Martin Dougiamas

Re: New Skype presence web service

by Jens Gammelgaard -
Picture of Translators
How often does this status icon update?
In reply to Jens Gammelgaard

Re: New Skype presence web service

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
It's instant.  If I change settings in Skype and reload then it's changed on the web too.
In reply to Martin Dougiamas

Re: New Skype presence web service

by Jens Gammelgaard -
Picture of Translators
Looking forward to see the real update. My profile is still not Skype presence updated for hours now.
In reply to Jens Gammelgaard

Re: New Skype presence web service

by Jamie Pratt -
You need Skype 2.0.79 (windows only as yet but linux and mac versions should soon follow apparently) and you need to go to Tools->Options->Privacy and turn on sharing your presense on the web.
In reply to Jamie Pratt

Re: New Skype presence web service

by Jens Gammelgaard -
Picture of Translators
Jamie, thanks - that works wink
In reply to Jens Gammelgaard

Re: New Skype presence web service

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
More about that skype presence webservice.

I noticed that when I put my computer in stand by modus, my status stays on line (when I look at it with another computer off course).

I'm not going to tell my boss wink
In reply to Jamie Pratt

Vast: New Skype presence web service

by Petri Niemi -
Hi Jamie.

You already noticed that you have to have the newest skype to get this feature available. It's working nicely =)

You would like to have list which shows only those users whom status is not 'I'm not telling'. It should not be to hard to do with if thing. I still rather don't like to drop those who has not make them status available via web, because you can still add them to your contacts, chat whit them or call to them. Users can also leave skype id out of moodle if they do not want to get any contacts from there.

My status :P
http://mystatus.skype.com/NiemiPT
In reply to Jamie Pratt

Re: Vast: Re: Skype presence html

by Matt Crosslin -
I saw that, too. Have they posted any guidelines for how to use this? I could always sit there and test it out with Skype to see what those variables return, but it would be nice for them to say "a user online will return this value", etc.  All I get from the stuff above is "Unknown."  A lot of good that does.

I wonder - would a cron be needed, or just a script that checks each time you go on the front page of a class?  I guess it depends on how often a student hits the first page, maybe....
In reply to Matt Crosslin

Vast: Re: Vast: Re: Skype presence html

by Petri Niemi -
I'm sorry Matt. I wasn't going to steal your work or anything. We just needed this block asap and I made it for our use. Just pasted it here if somebody get's something from it and this seemed to be the right place because I got so much from your block.

I'm very keen to see what you have done.
In reply to Petri Niemi

Re: Vast: Re: Vast: Re: Skype presence html

by Matt Crosslin -
I'm not mad or anything - I just always feel it is better to collaborate.  Plus, my employer is going to flip when they see that you used their name without all the accompanying legal jargon that they want to go with it.  But that's their problem.

Mainly, I wanted the student's Skype to be set-up different, because we have some classes with 200+ students.  So, it's not very practical to set-up student list on the front page of a class.  I think it would be best to have an admin area that allows the teacher to control what gets displayed.

Once again, I am not mad.  I just think we could have saved some time AND ended up with a block that we could both use.  And one with the same name smile
In reply to Matt Crosslin

Vast: Re: Vast: Re: Vast: Re: Skype presence html

by Petri Niemi -
I maybe slightly misunderstood your first post =)

I made it because we needed it during the same day and named it differenly because I didn't want to mess your versioning.

I agree that working together is the best way and I think that we already did so.

I'm still very keen to see what you have done :P
In reply to Petri Niemi

Re: Vast: Re: Vast: Re: Vast: Re: Skype presence html

by Matt Crosslin -
So does this mean you are using it in a live class now?

Do you know if SkypeWeb is really working?  I haven't had a chance to dig into it much yet, but I only seem to get "unkown" and "I'm not Telling" for every ID that I try it with.  But I can't verify if the ones that I am using have upgraded to SkypeWeb yet, or if SkypeWeb is still being tinkered with.

The biggest thing that would help is if Skype had some developer's guide for SkypeWeb.  Maybe there is.  Most of what I am trying to do has to do with the layout of the Block - more info, less pics (for classes with several teachers).

So, the txt and xml functions would be graet, if I had a guide for knowing what different functions return.
In reply to Matt Crosslin

Vast: Re: Vast: Re: Vast: Re: Vast: Re: Skype presence html

by Petri Niemi -
Hi Matt

Like Jamie said SkybeWeb is working nicely. You just must have the most recent version of skype. That unknown means just that you haven't allow showing your status in skype.

I'm sure that you already noticed that link which Jamie pasted. There you can find more information about SkybeWeb.
In reply to Matt Crosslin

Re: Vast: Re: Skype presence html

by Paul Nijbakker -
Dear Matt,

If you do not wish other people to use your block and modify it, you should not post it here. I checked Petri's block and your credits remain in there.approve

When you post a better solution, we will test that too and if it works better adopt it and perhaps modify it as well. Isn't that the way this is supposed to work?thoughtful

Rgrds,
Paul.
In reply to Paul Nijbakker

Re: Vast: Re: Skype presence html

by Matt Crosslin -
Ummm.... did you read my post?  I said that it was just that he spent time doing work that I had already done.

The way it's supposed to work, from what I read on Moodle, is that you ask first before doing something so that you don't waste time duplicating effort.  It's not a deal about modifying someone's work - it's just that time could have been saved, and we could have collaborated.  Now it will look like we are competing, which we're not, but it sounds like you want to make it that way.  I thought collaboration was the way it was supposed to work.  I'm all for open-source, people modifying, etc.  But I'm even more for collaborating because it leads to better results that way.  I've only been in the open-source community for 2 years or so, but my experience with other projects has been that you check first to see if no one is doing it.  If someone is, then you ask if they plan to do the modifications you want.  You'll usually get either a "yep - we've already got it done" or a "nope - you wanna do that?"  answer, and you go from there.  See the Quickmail update thread for an example of this.

Please read my post first before reacting to what you think I am saying.
In reply to Matt Crosslin

Re: Vast: Re: Skype presence html

by Paul Nijbakker -
"...it sounds like..." Now who is reading things into whose message?

You were the one shouting in your message and you did not mention the word collaboration in any form there.

Best regards,
Paul.
In reply to Paul Nijbakker

Re: Vast: Re: Skype presence html

by Matt Crosslin -
"I wish you had contacted me"

Sounds like collaboration to me.  And one capitalized word in a post does not denote shouting.  It denotes emphasis.
In reply to Petri Niemi

Re: Vast: Re: Skype presence html

by Colin McQueen -
Hi

Got this installed. Two problems.
  1. I got errors about foreach() lines 40 and 44 - I had to chage the lines to be nested inside a check in case the queries empty.
  2. I don't get skypeweb block appearing on the homepage Add blocks menu. It appears inside courses OK and works. Any chance of it being able to be put on the homepage?
Good work by the way both of you.
In reply to Petri Niemi

Re:Is it work with moodle 1.7

by Leva Tabasi -

Dears,

We want to migrate to moodle 1.7 from 1.5.3+ . we have arround 2000 users it is very important for us not have any critical issues. Is this block works with moodle 1.7? if there is any problem while installing in moodle 1.7?

Thanks for your help,

Leva

In reply to Jamie Pratt

Re: Skype presence html

by Matt Crosslin -
Okay - here is the Skype block updated with all of the most recent information.  Thanks for everyone who hunted down that info.  This version will work on the front page of a site.  It also has a link to a seperate page that lists all student Skype status icons.  All functions and links now use Skype controls, no Jyve at all smile
Average of ratings: Useful (1)
In reply to Matt Crosslin

Re: Skype presence html

by Colin McQueen -
OK I've changed from the Skypeweb block by Pietri to Skype by Matt. It works on the home page but I had to give admin a skype id. Still got two problems:-

  1. On the Administration page I get
    Warning: Invalid argument supplied for foreach() in /home/hiasict/public_html/moodle/blocks/skype/block_skype.php on line 63
  2. On the student view page I get
    Warning
    : Invalid argument supplied for foreach() in /home/hiasict/public_html/moodle/blocks/skype/students.php on line 51 Class Skype Status:
I assume 1. is because there is no skypeid for teacher #1 for this page whoever that may be? Not sure what to do about this?

I guess 2. is because this course has no students with skypeids or perhaps because there are no students just teachers?

The errors are related to the foreach() function. Would it not be best to check whether the database query returns any records. If none are returned miss out the foreach() and put in a message about "No teachers with Skype" and "No students with Skype"? Obviously using the relevant teacher and student string.

I have tried to fix this and ended up with this bit as a block_skype.php fix to stop the error on the admin page:-

// get the primary teacher's Skype id
$teachers = get_records('user_teachers','course',$this->instance->pageid);
// If there are no teacher users then don't check for Skype IDs
if ($teachers == FALSE) {
}
else
{
foreach ($teachers as $teacher)
{
$profile = get_record('user','id',$teacher->userid);
$skypeID=$profile->skype;

// If there is no Skype ID, then don't print out the teacher
IF (!$skypeID) {
$this->content->text = $this->content->text.'';
}

// If there is a Skype ID, print the contact info from SkypeWeb
ELSE
{

// If you want to change the images used in this script, make the changes below
$this->content->text = $this->content->text.'<div align="left">'.$profile->firstname.' '.$profile->lastname.': <img border="0" src="http://mystatus.skype.com/smallicon/'.$skypeID.'.png" alt="My Status" title="My Status" /></div><div class="logininfo"><a href="skype:'.$skypeID.'?call">'.$callme.'</a> | <a href="skype:'.$skypeID.'?chat">'.$chat.'</a> | <a href="skype:'.$skypeID.'?add">'.$addcontact.'</a></div><br />';
}
}
}

And this for students.php:-

$students = get_records('user_students','course', $id);
// If there are no student users then print a message
if ($students == FALSE) {
echo '<tr><td align=center">There are no students in this course</td></tr>';
}
else
{
echo '<tr><td class="header" colspan="3">'.$strstudentheader.'</td></tr>';
foreach ($students as $student)
{
$profile = get_record('user','id',$student->userid);
$skypeID=$profile->skype;
// If there are no student users with SKYPE IDs then print nothing
IF (!$skypeID) {
}
// If there is a Skype ID, print the contact info from SkypeWeb
ELSE
{
// If you want to change the images used in this script, make the changes below
echo '<tr><td align="left">'.$profile->firstname.' '.$profile->lastname.': </td><td align="left"><img border="0" src="http://mystatus.skype.com/smallclassic/'.$skypeID.'.png" alt="My Status" title="My Status" /></td><td><div class="logininfo"><a href="skype:'.$skypeID.'?call">'.$callme.'</a> | <a href="skype:'.$skypeID.'?chat">'.$chat.'</a> | <a href="skype:'.$skypeID.'?add">'.$addcontact.'</a></div></td></tr>';
}
}
}

I brought part of the header into the if ... else ... section to avoid that part of the header appearing if there were no students. Not ideal I know. Also the message about no students needs to be moved into the lang folder and the 'students' word needs tagging with the configured term. Not sure how to do this.

Anyway this works for me to fix the error on the admin page and the students page if there are no students. HTH

Great work though. I like the fact the image used is the small one to save space. Pietri's version gave you the image chosen by the skype user so you got big images which look nice but take up too much space. Also a separate page for students is a better way to organise things.
In reply to Colin McQueen

Svar: Re: Skype presence html

by Anders Berggren -

I get the same problem.

On the admin page:

Warning: Invalid argument supplied for foreach() in c:\easyphp\www\moodle\blocks\skype\block_skype.php on line 63

In reply to Colin McQueen

Re: Skype presence html

by Matt Crosslin -
hmm.... never tested in a class without students.  I will have to look into this.  As far as the admin page error, never ran into that either.  That line about "primary teachers" is just left-over code from a previous version.  The block just now looks for anyone listed as a teacher.  So I will have to look into this, too.  Thanks for letting me know about this.  I'll let you know what I find.
In reply to Matt Crosslin

Re: Skype presence html

by Matt Crosslin -
I got the same problem, too.  I have the fix almost ready to go.  Thanks for finding that!
In reply to Matt Crosslin

Vast: Re: Skype presence html

by Petri Niemi -
I tested your block and it worked very nicely. It's great to get rid of that jyve!!! I also translated your block to Finnish.
In reply to Petri Niemi

Re: Vast: Re: Skype presence html

by Matt Crosslin -
I agree about the Jyve!  I have one line to add to the lang file, thanks to the bugs found above.  The line goes like this:

$string['nostudents'] = "This course has no";

And it is combined with the course definition of the term "student" to print out:

"This course has no students."

How would that look in Finnish (so I can add the lang block to the next zip file)?

Is the abbreviation for Finnish FI in Moodle?
In reply to Matt Crosslin

Vast: Re: Vast: Re: Skype presence html

by Petri Niemi -
"This course has no students." is "Tällä kurssilla ei ole opiskelijoita" in Finnish. That "student" is "opiskelijat", which is little problem. In Finnish suffixes are includet in word, which makes words work only in one context. For example "autossa" is "in car", "autolla" is "by car" and "auto" is just "a  car".

Well anyway.. "This course has no" is "Tällä kurssilla ei ole" in Finnish. We can't do anything for that translation problem and this is not the only place where we have it.
In reply to Jamie Pratt

knock knock voice app

by Jamie Pratt -
Try my automated knock knock voice app through Skype dial +990009369991423762 (it is a free call). You can also dial :

Direct Local # (321) 558-2512
PIN Access (800) 289-5570 then PIN: 9991423762
PIN Access (407) 386-2174 then PIN: 9991423762
Skype VoIP +99000936 9991423762
FWD VoIP **86919991423762
SIP VoIP SIP:9991423762@sip.voxeo.net


This is a voiceXML application. I used a free developer account at Voxeo to set this up. Voxeo is a Skype 'Voice Service Provider'. They offer 500 minutes of free calls a month from Skype, unlimited calls from a SIP or FWD Voip phone and free phone nos. all in Florida in the US it seems to call into your app on.

With voicexml you can script a voice application. You can conference call, record voice and send it to your server, do voice recognition and lots of other interesting stuff.

This voice app is scripted using php. The output from the php script can be seen here :

http://jamiep.org/voicexml/knock/knock.php

View source in your browser to see the voicexml which is randomly generated on every load.

Jamie
In reply to Jamie Pratt

Re: Skype presence html

by Matt Crosslin -
Here's the latest Skype block with bugs fixed (I hope smile and the Finnish tranlation added.
In reply to Matt Crosslin

Re: Skype presence html

by Tomasz Walasek -
Dear Matt,
I have installed the skype block and have some problems. This is how it looks in Moodle. The block itself doesn't show as "Who's On Skype" but blocktitle. My Moodle is in Polish but I have tried to change everything into en and it still doesn't work. I have newest Moodle 1.6. Can it be a problem?
Best regards
Tomek
Attachment skype.jpg
In reply to Tomasz Walasek

Re: Skype presence html

by Matt Crosslin -
I'm not sure about 1.6, but that should be fine.  Stuff like blocktitle appears when anything in Moodle can't find the language file.  I would first make sure that the skype presence language file is in the same folder as the default language that is set up in your admin settings.  For example, if your Moodle is set to polish, the language file would have to be in the polish language folder (even if you use the English one).  Hope that helps.
In reply to Matt Crosslin

Re: Skype presence html

by Tomasz Walasek -
Thank you,
Just for a future users: In Moodle 1.6 you need to have the block_skype.php language file in the language directory  (as for me it is  pl_utf8). And it works perfectly. The Skype Presence Block is great.
Regards
Tomek
In reply to Matt Crosslin

Re: Skype presence html

by Wei Tang -
I've test Skype block in Moodle 1.6 stable release. Merged some change from Colin McQueen which fixed foreach error when there were no teacher or no students.

Alos, I've added a zh_cn language file for it.

Hope Matt can accept it as a office release tongueout

Tang
In reply to Wei Tang

Re: Skype presence html

by Randy Ahn -
Loaded your fix and it looks to be working fine. This is the first time I've used the skype block and it looks great under my online_users block. ... hmm. Would be nice to integrate the two.
In reply to Randy Ahn

Re: Skype presence html

by Wei Tang -

Good idea!

I'll take a look at online_users block and trying to integrated the two. If any problem, I'll contact you.

You can do it too if you have free time.

Tang

In reply to Wei Tang

Re: Skype presence html

by Matt Crosslin -
Sounds great to me.  I've been thinking I need to check it 1.6, but haven't had the time to get around to it.  There was something else I needed to fix, too - but I can't remember what it was.  I'll try to dig back in and see what it was.  The online user's integration sounds nice, too.
In reply to Matt Crosslin

Re: Skype presence html

by Randy Ahn -
Here's an issue if you or anyone else is interested. I run moodle via ssl and the block renders great in FF. But alas, IE complains about the skype icons being insecure. (A user can adjust their browser security settings to avoid the alert, but then you'd have to tell users how to do this -- and we all know this is asking for trouble. So, let's avoid that.) Unfortunately, the skype status server does not run over https and a second issue is that it generates pngs on the fly. So there needs to be a fix. One idea I had was to grab the png and reconstruct it with imagecreatepng() and serve it up with imagepng() in order to keep IE happy. This works in a separate template, but not in the block template because you run into a "headers have already been sent" error. Maybe I need to stick the png in an array? I don't know. IE!!! and also the AOL browser does this, I'm told.
In reply to Matt Crosslin

Re: Skype presence html

by Juvenal Sahiri -
Matt,
I have a question concerning Skype plugin in Moodle. If one is using Moodle in a Local area network and is not connected to the internet, can students registered in a course / teachers logged in Moodle (localhost installation) from their respective computers use skype to talk to each other if they have their skype parameters registered in their profile?

Had always thought that Skype presence detection goes through Skype servers, thus requires a connection to the internet.

Why am I asking this question? Think of Moodle being used in a secondary school which doesn't have a permanent connection to the internet but has a LAN and where the installation is on a localhost.

Thanks
Juvenal
In reply to Juvenal Sahiri

Re: Skype presence html

by Anthony Williams -

Is this block still being maintained?

I tried to install on 1.7 but got a this SQl relies on obselete tables error. 

In reply to Anthony Williams

Re: Skype presence html

by Matt Crosslin -
If you look at the most recent thread on this block, which I can't seem to find right now, you will find the most recent version of the Skype Block that works with Moodle 1.7.
In reply to Anthony Williams

Re: Skype presence html

by Howard Vickers -
Hi

Perhaps a little out of my depth here, but in the Readme file it says to "4. Go to your Admin panel to install the Skype block."

How do you do this?

I've done the rest.

Thank you.

In reply to Howard Vickers

Re: Skype presence html

by Matt Crosslin -
It really depends on what version you are using. But basically it means logging in as an admin and then hitting the admin page. This usually initiates the installation process. I think it is slightly different in Moodle 1.7, but I haven't used it a lot recently to be able to tell. I think you have to go to the Notifications section to install new blocks.
In reply to Matt Crosslin

Re: Skype presence html

by Sylvain Houmeau -
Hello eveyone,
I have gone through the install process for the skype block. ONce I try to install it, i get this message:

This SQL relies on obsolete tables! Your code must be fixed by a developer.

Can someone help?

I see that these posts are 2 years old. Have you people found a better solution or moved to another and better one?

Thank you for your replies.
sylvain
In reply to Jamie Pratt

Re: Skype presence html / skype presence button

by Miro Iliaš -

Greetings,

though a lot of time passed since this discussion, I am interested in the feaure of skype button integration.


Following this link

http://www.skype.com/en/features/skype-buttons/create-skype-buttons/

I tried to put the generated javascript code (starting as "<script type="text/javascript" src="http://www.skypeassets.com/i/scom/js/skype-uri.js..."   into a course web page, but no way.


Any help how to integrate skype presence button into Moodle course ? 


Yours,  Miro