Главная » 2014 » Август » 20 » Skype и Wordpress
10:31 PM
Skype и Wordpress

Недавно написал скрипт для wordpress, а он не пригодился. Скрипт служит для звонков в скайп прямо с сайта.

Функция

function getSkypeStatus($login = false){
if(!$login){
//логин скайп по умолчанию, если не передан другой
$login = 'masheco2013';
}
/*
возвращаемые статусы
2 - онлайн
1 - оффлайн
0 - нет такого пользователя
*/
$status = file_get_contents('http://mystatus.skype.com/'.$login.'.num');

$off = (int)$status == 2 ? '' : '-off';

if ($status==2) {$show='<div class="manincall"></div><a href="skype:'.$login.'?call" class="skype'.$off.'"></a>
<a href="skype:'.$login.'?chat" class="chat"></a>';}
else {$show='<div class="manoutcall"></div><a href="skype:'.$login.'?chat" class="skype'.$off.'"></a>';}
echo $show;
}

 

Её вызов в футере (вызывал там потому что мне так казалось удобнее)


<script>
(function($) {
$(function() {

$('#callmeoff').click(function() {
document.getElementById('callme').style.display = 'none';
document.getElementById('skype-hidden').style.display = 'block';
return false;
})

})
})(jQuery)
</script>

<div id="callme">
<a href="#" id="callmeoff" title="Убрать меню!"></a>
<?php getSkypeStatus(); ?>
</div>

<!--- прячем скайп -->
<script>
(function($) {
$(function() {

$('#skype-hidden').click(function() {
document.getElementById('skype-hidden').style.display = 'none';
document.getElementById('callme').style.display = 'block';
return false;
})

})
})(jQuery)
</script>
<a href="#" id="skype-hidden" title="Открыть звонки!" style="display:none;"></a>

 

 

И style.css, естественно

/*-------- CALLMENOW _________________________*/

#callme{
position: fixed;
bottom: 0px;
right: 0;
padding: 10px;
color: #fff;
background: #000;
-webkit-border-top-left-radius: 10px;
-webkit-border-bottom-left-radius: 10px;
-moz-border-radius-topleft: 10px;
-moz-border-radius-bottomleft: 10px;
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
}

#callmeoff{
background: url("images/sk_arr_r.jpg") no-repeat #000000;
min-height: 56px;
width: 31px;
display: block;
float: left;
border-right: 1px solid #FFF;
margin-right: 200px;
}
.manincall{
background: url("images/man-in-call.png") no-repeat;
height: 306px;
width: 188px;
display: block;
z-index: 20;
position: absolute;
margin-left: 40px;
margin-top: -240px;
}
.manoutcall{
background: url("images/man-out-call.png") no-repeat;
height: 306px;
width: 188px;
display: block;
z-index: 20;
position: absolute;
margin-left: 40px;
margin-top: -240px;
}
.skype {
background: url("images/skype_on.jpg") no-repeat #000000;
min-height: 56px;
height: 56px;
width: 138px;
max-width: 138px;
display: block;
float: left;
}
.skype-off{
background: url("images/skype_off.jpg") no-repeat #000000;
min-height: 56px;
height: 56px;
width: 248px;
max-width: 248px;
display: block;
float: left;
margin-left: 20px;
margin-right: 10px;
}
.chat{
background: url("images/chat.jpg") no-repeat #000000;
min-height: 56px;
height: 56px;
width: 188px;
max-width: 188px;
display: block;
float: left;
}
#skype-hidden{
width: 35px;
height: 56px;
position: fixed;
bottom: 0;
right: 0;
padding: 10px;
background: #000;
-webkit-border-top-left-radius: 10px;
-webkit-border-bottom-left-radius: 10px;
-moz-border-radius-topleft: 10px;
-moz-border-radius-bottomleft: 10px;
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
background: url("images/sk_arr_l.gif") no-repeat #000000;
background-position-x: 10px;
background-position-y: 10px;
}

Не пригодилось. Ну и фиг с ним.

 

Просмотров: 452 | Добавил: 9dem | Рейтинг: 0.0/0
Всего комментариев: 0
avatar