U¿ytkownik
Mam problem z ChatBox'em! Znalaz³em taki bardzo fajny kod na Chata:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="pl" lang="pl"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="author" content="Robert (nospor) Nodzewski" /> <meta name="copyright" content="Copyright (c) 2006-2010 Robert Nodzewski" /> <meta name="description" content="Strona projektu shoutbox (chat)." /> <meta name="keywords" content="shoutbox, chat, ajax, php" /> <meta name="robots" content="index,follow" /> <link rel="canonical" href="http://nospor.pl/shoutbox.html" /><title>ShoutBox :: nospor.pl</title> <link rel="stylesheet" href="http://nospor.pl/css/style.css" type="text/css" /> <link rel="stylesheet" href="http://nospor.pl/css/rainbow.css" type="text/css" /> <script type="text/javascript" src="http://nospor.pl/scripts/jquery/jquery.js"></script> <script type="text/javascript" src="http://nospor.pl/scripts/ShoutBox.js"></script> <script type="text/javascript" src="http://nospor.pl/scripts/Cookie.js"></script> <link rel="stylesheet" href="http://nospor.pl/css/ShoutBox.css" type="text/css" /> <script type="text/javascript"> function setColor(color){ jQuery('#sb_message').val('/color '+color); sb.sendMessage(); } function addEmoticon(emot){ if (jQuery('#sb_message').val() == 'wiadomo¶æ') jQuery('#sb_message').val(''); jQuery('#sb_message').val(jQuery('#sb_message').val() + emot); } function shoutBoxResize(obj, up) { if (up){ sb.body.css('height','250px'); document.getElementById('sb_main').style.height = '285px'; jQuery('.sb_online').css('height','280px'); obj.onclick = function(){shoutBoxResize(obj, false);}; obj.firstChild.src="http://nospor.pl/images/arrow_up.png"; setShoutBoxProp('up'); } else { sb.body.css('height','120px'); document.getElementById('sb_main').style.height = '155px'; jQuery('.sb_online').css('height','150px'); obj.onclick = function(){shoutBoxResize(obj, true);}; obj.firstChild.src="http://nospor.pl/images/arrow_down.png"; setShoutBoxProp('down'); } }; function setShoutBoxProp(resize, nick){ sbprop = Cookie.getCookie('sbprop') || ''; if (resize){ if (sbprop.search(/resize=/)!=-1) { sbprop = sbprop.replace(/resize=(.*?)(;|$)/,'resize='+resize+';'); } else sbprop += ';resize='+resize; } else if (nick){ if (sbprop.search(/nick=/)!=-1) { sbprop = sbprop.replace(/nick=(.*?)(;|$)/,'nick='+nick+';'); } else sbprop += ';nick='+nick; } Cookie.setCookie('sbprop', sbprop, Cookie.month); } function getShoutBoxResize(){ sbprop = Cookie.getCookie('sbprop') || ''; match = sbprop.match(/resize=(.*?)(;|$)/); if (match && match.length == 3) return match[1]; else null; } function getShoutBoxNick(){ sbprop = Cookie.getCookie('sbprop') || ''; match = sbprop.match(/nick=(.*?)(;|$)/); if (match && match.length == 3) return match[1]; else null; } ShoutBox.txtRemoveConfirm = 'Czy na pewno chcesz usun±æ tê wiadomo¶æ?'; ShoutBox.txtRemoveError = 'Nie uda³o siê usun±æ wiadomo¶ci'; ShoutBox.txtGettingError = 'Nie uda³o siê pobraæ danych'; ShoutBox.txtEditError = 'Nie uda³o siê zmieniæ wiadomo¶ci'; ShoutBox.txtEditClick = 'Kliknij by edytowaæ'; var sb; var sh = true; var arecolors = false; var areemotki = false; jQuery(function($){ $('#sb_colors').click(function(){ $('#sb_colorsdiv').toggle(); if (!arecolors){ $.get('http://nospor.pl/index.php?m=shoutbox&a=colors', function(data) { $('#sb_colorsdiv').html(data); arecolors=true; }); } }); $('#sb_emotki').click(function(){ $('#sb_emotkidiv').toggle(); if (!areemotki){ $.get('http://nospor.pl/index.php?m=shoutbox&a=emoticons', function(data) { $('#sb_emotkidiv').html(data); areemotki=true; }); } }); // $('#shoutboxdisplay').css('top','0px'); $('#shoutboxdisplay').click(function(){ if (sh) { sb.startGetMessages(); $('#shoutbox').animate({left: '0'}, 1000,function(){}); } else { sb.stopGetMessages(); $('#shoutbox').animate({left: '-935'}, 1000,function(){}); } sh = !sh; }); sb = new ShoutBox('sb', 10000, 'http://nospor.pl/index.php?m=shoutbox&a=run&'); sb.bind('message',{moje:2},function(data){ if (data.params.actionName != "read") return true; sbs = document.getElementById("sbsound"); if (sbs) sbs.innerHTML="<embed src='http://nospor.pl/ding.wav' hidden=true autostart=true loop=false>"; return true; }); sb.stopGetMessages(); sb.getMessages(); sbresize = getShoutBoxResize(); objResize = document.getElementById('sb_resize'); if (objResize){ shoutBoxResize(objResize, (sbresize == 'up')); } sbnick = getShoutBoxNick(); if (sbnick){ objNick = document.getElementById('sb_nick'); if (objNick) objNick.value = sbnick; } }); </script><link rel="stylesheet" href="http://nospor.pl/css/form.css" type="text/css" /> <script type="text/javascript"> jQuery(function(){ jQuery('#comment-preview').show(); }); </script> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-495523-3']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </head> <body> <div id="wrapper"> <div id="header"> <style type="text/css"> <!-- #sb_main { margin: 0; } #menu { margin-top: 10px; } --> </style> <div id="shoutbox"> <div id="sb_main"> <div class="sb_online"><div class="sb_online_title">U¿ytkownicy on-line:</div><div class="sb_online_users"><ul id="sb_online_users"></ul></div></div> <div class="sb_tools"> <div id="sb_history" class="sb_history" title="Pobierz wcze¶niejsze" onclick="sb.getHistory();"></div> <div class="sb_unlocked" title="Zablokuj scroll" onclick="ShoutBox.switchScroll(this);"></div> <div style="margin-top:2px;"><a href="http://nospor.pl/shoutbox-o-co-biega-w-przykladzie.html" title="Pomoc"><img src="http://nospor.pl/images/help.png" style="border:0px;" alt="pomoc"/></a></div> <div style="margin-top:2px;cursor:pointer;" onclick="shoutBoxResize(this, true);" id="sb_resize"><img title="Zwiêksz/zmniejsz" src="http://nospor.pl/images/arrow_down.png" alt=""/></div> <div style="margin-top:2px;cursor:pointer;"> <a href="http://nospor.pl/main/mp/sbmode/normal/" title="Tryb normalny"><img src="http://nospor.pl/images/shoutboxshow.png" style="border:0px;" /></a> </div> <div style="margin-top:2px;cursor:pointer;" id="sb_colors"><img title="Zmieñ kolor" src="http://nospor.pl/images/colors.png" alt=""/></div> <div id="sb_colorsdiv" style="position:absolute;display:none;width:210px;height:140px;padding:5px;border:1px solid #E9E3CB;background-color:#ffffff;z-index:999999;">Pobieranie kolorów...</div> <div style="margin-top:2px;cursor:pointer;" id="sb_emotki"><img title="Emotikonki" src="http://nospor.pl/images/emotki.gif" alt=""/></div> <div id="sb_emotkidiv" style="position:absolute;display:none;width:120px;height:70px;padding:5px;border:1px solid #E9E3CB;background-color:#ffffff;z-index:999999;">Pobieranie emotikonek...</div> <div id="sb_wait"></div> </div> <div id="sb_body"></div> <form action="" onsubmit="sb.sendMessage();return false;"> <input type="text" id="sb_nick" maxlength="64" value="nick" onchange="setShoutBoxProp(null, this.value);" onfocus="if (this.value=='nick')this.value='';"/> <input type="text" id="sb_message" class="short" maxlength="255" value="wiadomo¶æ" onfocus="if (this.value=='wiadomo¶æ')this.value='';"/> <input type="submit" class="submit" id="sb_submit" value="Wy¶lij" /> </form> </div> <div id="shoutboxdisplay"></div> </div> </div> <!-- end #header -->
Nie wiem co mam poprawiæ, bo wszystko jest ok. Skrypt jest widoczny, jednak¿e napiszê jaki¶ post to nic siê nie dzieje... Oto przyk³ad ppokemon.pun.pl .
Masz taki ChatBox wysuwany po lewej stronie.
Offline