Hừ, pm, rồi email, rồi Y!M, rồi lập topic hỏi về cái chatbox của mybbvn mà cha admin tinh vi ko thèm đoái hoài. Bực mình ghê, tinh vi nó vừa vừa thôi nhá :-w
Tớ tuy là gà nhưng mà tớ vẫn thích đú, tạm để code đây, mấy hôm nữa xong khóa luận thì tớ chiến các bạn ;))
<table class=”tborder” border=”0″ cellspacing=”1″ cellpadding=”6″ width=”100%” align=”center”>
<tbody>
<tr>
<td class=”thead”>Chatbox</td>
</tr>
<tr>
<td class=”trow2″><form action=”javascript:fcb_postshout();” method=”post”> <input name=”huid” type=”hidden” value=”31″ />
<input name=”hgroupid” type=”hidden” value=”2″ />
<input name=”huser” type=”hidden” />
<input id=”hmess” class=”bginput” name=”hmess” size=”100″ type=”text” />
<div style=”margin-top: 2px;”><input class=”button” type=”submit” value=”Shout” />
<input class=”button” style=”font-weight: bold;” onclick=”fcb_upstyle(‘b’);” name=”hbold” type=”button” value=”B” />
<input class=”button” style=”font-style: italic;” onclick=”fcb_upstyle(‘i’);” name=”hitalic” type=”button” value=”I” />
<input class=”button” style=”text-decoration: underline;” onclick=”fcb_upstyle(‘u’);” name=”hunderline” type=”button” value=”U” /><select name=”hfont”><option>Fonts</option><option value=”Arial”>Arial</option><option value=”Arial Black”>Arial Black</option><option value=”Book Antiqua”>Book Antiqua</option><option value=”Century Gothic”>Century Gothic</option><option value=”Comic Sans MS”>Comic Sans MS</option><option value=”Courier New”>Courier New</option><option value=”Impact”>Impact</option><option value=”Tahoma”>Tahoma</option><option value=”Times New Roman”>Times New Roman</option><option value=”Trebuchet MS”>Trebuchet MS</option><option value=”Verdana”>Verdana</option></select> <select name=”hcolor”><option>Colors</option><option style=”background: Gold;” value=”Gold”>Gold</option><option style=”background: Khaki;” value=”Khaki”>Khaki</option><option style=”background: Orange;” value=”Orange”>Orange</option><option style=”background: LightPink;” value=”LightPink”>LightPink</option><option style=”background: Salmon;” value=”Salmon”>Salmon</option><option style=”background: Tomato;” value=”Tomato”>Tomato</option><option style=”background: Red;” value=”Red”>Red</option><option style=”background: Brown;” value=”Brown”>Brown</option><option style=”background: Maroon;” value=”Maroon”>Maroon</option><option style=”background: DarkGreen;” value=”DarkGreen”>DarkGreen</option><option style=”background: DarkCyan;” value=”DarkCyan”>DarkCyan</option><option style=”background: LightSeaGreen;” value=”LightSeaGreen”>LightSeaGreen</option><option style=”background: LawnGreen;” value=”LawnGreen”>LawnGreen</option><option style=”background: MediumSeaGreen;” value=”MediumSeaGreen”>MediumSeaGreen</option><option style=”background: BlueViolet;” value=”BlueViolet”>BlueViolet</option><option style=”background: Cyan;” value=”Cyan”>Cyan</option><option style=”background: Blue;” value=”Blue”>Blue</option><option style=”background: DodgerBlue;” value=”DodgerBlue”>DodgerBlue</option><option style=”background: LightSkyBlue;” value=”LightSkyBlue”>LightSkyBlue</option><option style=”background: White;” value=”White”>White</option><option style=”background: DimGray;” value=”DimGray”>DimGray</option><option style=”background: DarkGray;” value=”DarkGray”>DarkGray</option><option style=”background: Black;” value=”Black”>Black</option></select><input class=”button” onclick=”fcb_refresh();” type=”button” value=”Refresh” />
<input class=”button” onclick=”archivepage();” type=”button” value=”Archive” /></div>
</form></td>
</tr>
<tr>
<td class=”trow1″></td>
</tr>
</tbody></table>
<script type=”text/javascript”><!–
var textstyle = document.getElementById(‘hmess’);function fcb_upstyle(element)
{
if (element == ‘b’)
{
if (document.fcb_form.hbold.value == ‘B’)
{
document.fcb_form.hbold.value = ‘B*’;
textstyle.style.fontWeight = ‘bold’;
}
else
{
document.fcb_form.hbold.value = ‘B’;
textstyle.style.fontWeight = ‘normal’;
}}
else if (element == ‘i’)
{
if (document.fcb_form.hitalic.value == ‘I’)
{
document.fcb_form.hitalic.value = ‘I*’;
textstyle.style.fontStyle = ‘italic’;
}
else
{
document.fcb_form.hitalic.value = ‘I’;
textstyle.style.fontStyle = ‘normal’;
}}
else if (element == ‘u’)
{
if (document.fcb_form.hunderline.value == ‘U’)
{
document.fcb_form.hunderline.value = ‘U*’;
textstyle.style.textDecoration = ‘underline’;
}
else
{
document.fcb_form.hunderline.value = ‘U’;
textstyle.style.textDecoration = ‘none’;
}}
else if (element == ‘font’)
{
textstyle.style.fontFamily = document.fcb_form.hfont.value;
}
else if (element == ‘color’)
{
textstyle.style.color = document.fcb_form.hcolor.value;
}
}function fcb_postshout()
{
huid = document.fcb_form.huid.value;
hgroupid = document.fcb_form.hgroupid.value;
huser = document.fcb_form.huser.value;
hmess = document.fcb_form.hmess.value;
hcolor = document.fcb_form.hcolor.value;
hfont = document.fcb_form.hfont.value;
hbold = document.fcb_form.hbold.value;
hitalic = document.fcb_form.hitalic.value;
hunderline = document.fcb_form.hunderline.value;
document.fcb_form.hmess.value = ”;
if (hmess == ”)
{
alert(‘Go loi chat’);
}
else
{
fcb_frame.location = ‘http://hqth.vndv.com/mybbvnchat/index.php?do=postshout&hmess=’ + encodeURIComponent(hmess) + ‘&huid=’ + huid + ‘&hgroupid=’ + hgroupid + ‘&huser=’ + encodeURIComponent(huser) + ‘&hcolor=’ + hcolor + ‘&hfont=’ + hfont + ‘&hbold=’ + hbold + ‘&hitalic=’ + hitalic + ‘&hunderline=’ + hunderline;
}
}function archivepage()
{
window.open(“http://hqth.vndv.com/mybbvnchat/archive.php”, “”, “location=no,scrollbars=yes,width=640,height=480”);
}
function addsmilie(code)
{
document.fcb_form.hmess.value = document.fcb_form.hmess.value + code;
}
function smiliepopup()
{
window.open(“ajax.php?do=fcb_allsmilies”, “”, “location=no,scrollbars=yes,width=500,height=500”);
}function fcb_showsmilies_action()
{
if (fcb.handler.readyState == 4 && fcb.handler.status == 200)
{
document.getElementById(‘fcb_smiliebox’).innerHTML = fcb.handler.responseText;
}
}
function fcb_showsmilies()
{
fcb = new vB_AJAX_Handler(true);
fcb.onreadystatechange(fcb_showsmilies_action);
fcb.send(‘ajax.php?do=fcb_randomsmilies’);
}
function fcb_showsmiliebox()
{
if (document.getElementById(‘fcb_smilieboxmain’).style.display == ‘none’)
{
document.getElementById(‘fcb_smilieboxmain’).style.display = ‘inline’;
fcb_showsmilies();
}
else
{
document.getElementById(‘fcb_smilieboxmain’).style.display = ‘none’;
}
}
function fcb_hideshowsmiliebox()
{
document.getElementById(‘fcb_smilieboxmain’).style.display = ‘none’;
}
function fcb_refresh()
{
fcb_frame.location = ‘http://hqth.vndv.com/mybbvnchat/index.php’;
}
// –></script>