Hướng dẫn đưa phòng chat ra ngoài trang chủ phpbb3x

Admin

AdminAdmin is verified member.

Well-Known Member
Staff member
Administrator
Đầu tiên thì anh em phải add mod phòng chat trước nha (phải hack trên styles mobile nữa đấy.
Sau đó thì làm tiếp như sau:
Mở styles /(tên _style )/ template /index_body.html
Tìm :

Thêm đằng sau:
<script type ="text / javascript "> // <![CDATA [ var form _name = 'postform '; var text _name = 'message '; var fieldname = 'chat '; var last_time = 0; var xmlHttp = http _object (); var last_id = {LAST _ID}; var type = 'receive '; var post_time = {TIME }; var read_interval = 15000; var interval = setInterval ('handle_send("read", last_id);', read_interval ); function handle_send (mode, f) { if (xmlHttp .readyState == 4 || xmlHttp .readyState == 0) { indicator _switch ('on'); type = 'receive '; param = 'mode=' + mode; param += '&last_id=' + last_id; param += '&last_time =' + last_time ; param += '&last_post=' + post_time ; param += '&read_interval =' + read_interval ; if (mode == 'add' && document .postform .message .value ! = '') { type = 'send'; for (var i = 0; i < f.elements .length ; i++) { elem = f.elements ; param += '&' + elem.name + '=' + encodeURIComponent (elem.value ); } document .postform .message .value = ''; } else if (mode == 'delete ') { type = 'delete '; param += '&chat _id=' + f; } xmlHttp .open("POST", '{FILENAME }', true ); xmlHttp .setRequestHeader ('Content -Type ', 'application /x-www- form -urlencoded '); xmlHttp .onreadystatechange = handle_return ; xmlHttp .send(param); } } function handle_return () { if (xmlHttp .readyState == 4) { if (type != 'delete ') { results = xmlHttp .responseText .split ('--!--'); if (results [1]) { if (last_id == 0) { document .getElementById (fieldname ).innerHTML = results [0]; } else { document .getElementById (fieldname ).innerHTML = results [0] + document .getElementById (fieldname ).innerHTML ; } last_id = results [1]; if (results [2]) { document .getElementById ('whois_online').innerHTML = results [2]; last_time = results [3]; if (results [4] != read_interval * 1000) { window.clearInterval (interval ); read_interval = results [4] * 1000; interval = setInterval ('handle_send("read", last_id);', read_interval ); document .getElementById ('update _seconds ').innerHTML = results [4]; } post_time = results [5]; } } } indicator _switch ('off '); } } function delete _post (chatid ) { document .getElementById ('p' + chatid ).style .display = 'none'; handle_send('delete ', chatid ); } function indicator _switch (mode) { if (document .getElementById ("act _indicator ")) { var img = document .getElementById ("act _indicator "); if(img.style .visibility == "hidden" && mode == 'on') { img.style .visibility = "visible "; } else if (mode == 'off ') { img.style .visibility = "hidden" } } } function http _object () { if (window.XMLHttpRequest ) { return new XMLHttpRequest (); } else if (window.ActiveXObject ) { return new ActiveXObject ("Microsoft .XMLHTTP "); } else { document .getElementById ('p_status ').innerHTML = 'Status : Cound not create XmlHttpRequest Object . Consider upgrading your browser .'; } } // ]]> </script > <span class="corners - top"><span></span></ span> <div class="header "> <div class=nav>Chatbox </ b></div> <div style ="text -align: center "> <form name="postform " id="text " method ="post" action ="javascript :void (0);" onSubmit ="handle_send ('add', this)"> <div class=head1><strong style ="color: aqua;"> {L_MESSAGE }:</ strong > <input type ="text " tabindex ="1" name="message " id="message " class="inputbox chatinput " /> <input type ="submit " class="button 1" value ="{L_SUBMIT }" name="submit " tabindex ="6" accesskey ="s"/>
</form ></div> <b style ="color: white ;">You must be a Registered User to Chat in the Shoutbox
</div> </div> <span class="corners - bottom "><span></ span></span> </div> </div> <div align="left "> <div class="inner"> <span class="corners - top"><span></span></ span> <div class="shouts "> <div id="chat "> <div id="p {chatrow .MESSAGE _ID}" class="post bg {chatrow .CLASS }"> <div class="inner"><span class="corners - top"><span></span></ span> <div class="postbody "> <ul class="profile -icons"> <li class="delete -icon"> <span> {L_DELETE _POST}</ span> [/list] <div> {chatrow .USERNAME _FULL } « <b style ="font -size: 0.9em;"> {chatrow .TIME }[/b]</ div> <div class="head"> {chatrow .MESSAGE }</ div> </div> <dl class="postprofile " id="profile {postrow .POST_ID}"> </dl> <span class="corners - bottom "><span></ span></span> </div> </div>

sau khi làm xong các bạn vào admcp, xóa bộ nhớ đệm, ra index tận hưởng nào
 
:dobanhne: thế mà có thấy post đâu
 
:dobanhne: thế mà có thấy post đâu

mình làm cái này từ khi ttvn chưa xuất hiện @-). Phpbb3 còn rất nhiều thứ mình chưa công bố ;)). Mà h cũng quên sạch rùi
 
Để lục tìm lại xem..
 
Sao em làm như anh nói mà sao toàn ra cái gì đâu không á.Ai giúp up mấy mod cơ bản cho phpbb3 với.
 

Facebook Comments

Similar threads

W
Replies
4
Views
1K
cuongpro9xcuongpro9x is verified member.
cuongpro9x
Back
Top