Собственно сам код:
- Код: Выделить всё
<!-- Статус Агент@mail.ru modified by Vanofuture -->
<input id="email" type="text" style="width:140px ">
<input type="submit" onClick="statusimage_bbcode();statusimage();" class="but" value="Получить код!">
<table>
<tr>
<td style="display:none;" id="status_div">
<h3>Ваш html код:</h3>
<textarea readonly id="stcode" cols="20" rows="3"></textarea>
<script type="text/javascript">
function statusimage()
{
var a = document.getElementById('email').value;
if(a.indexOf('@mail.ru')!=-1 || a.indexOf('@bk.ru')!=-1 || a.indexOf('@list.ru')!=-1 || a.indexOf('@corp.mail.ru')!=-1 || a.indexOf('@inbox.ru')!=-1){
document.getElementById('status_div').style.display = '';
document.getElementById('stcode').value='<a href="http://www.mail.ru/agent?message&to='+a+'"><img src="http://status.mail.ru/?'+a+'" width="13" height="13" title="Статус в Агент@mail.ru" border="0"></a>';
} else {
alert('Неправильный E-mail!')
}
}
</script>
</td>
<td style="display:none;" id="status_div_bbcode">
<h3>Ваш BB-код:</h3>
<textarea readonly id="stcode_bbcode" cols="20" rows="3"></textarea>
<script type="text/javascript">
function statusimage_bbcode()
{
var a = document.getElementById('email').value;
if(a.indexOf('@mail.ru')!=-1 || a.indexOf('@bk.ru')!=-1 || a.indexOf('@list.ru')!=-1 || a.indexOf('@corp.mail.ru')!=-1 || a.indexOf('@inbox.ru')!=-1){
document.getElementById('status_div_bbcode').style.display = '';
document.getElementById('stcode_bbcode').value='[url=http://www.mail.ru/agent?message&to='+a+'][img]http://status.mail.ru/?'+a+'[/img][/url]';
}
}
</script>
</td>
</tr>
</table>
<!-- Статус Агент@mail.ru modified by Vanofuture -->
Скрипт взят отсюда. Я его модифицировал, чтоб он также выдавал BB-код чтоб вставлять в подписи на форуме.
P.S. Уберёш копирайты - убью
