Jump to content

- - - - -

Help me with this chat box code - two different codes, one difference

  • Please log in to reply
No replies to this topic

#1 Waker



  • Knight
  • 783 posts
  • a boy with lots of lists and books

Posted 06 September 2015 - 10:50 PM

Alrighty, I'm an admin for a site and I'm trying to get this chat box for it updated kinda and I just copy+pasted the new code over where the old one was and got "chat box is loading..." once I saved the changes. It's supposed to have the chat's previous post, the post box, and the arrows for viewing more pages of the chat box history. Interestingly, when I put the code in a real-time HTML editor, it works but still doesn't have the old chat entries. It's for https://sites.google...ide/dashboard2. I'm trying to fix it since when I try to post a new comment, it doesn't show, and looking at the old comments it seems like others may have had the same problem recently, so there have been no new comments in a while.
Here's the code for the old one:
<!-- begin htmlcommentbox.com -->
 <div id="HCB_comment_box"><a href="http://www.htmlcommentbox.com">HTML Comment Box</a> is loading comments...</div>
 <link rel="stylesheet" type="text/css" href="http://www.htmlcommentbox.com/static/skins/simple/skin.css" />
 <script type="text/javascript" language="javascript" id="hcb"> /*<!--*/ if(!window.hcb_user){hcb_user={};} hcb_user.PAGE="https://sites.google.com/site/scienceandmathguide/";(function(){s=document.createElement("script");s.setAttribute("type","text/javascript");s.setAttribute("src", "http://www.htmlcommentbox.com/jread?page="+escape((window.hcb_user && hcb_user.PAGE)||(""+window.location)).replace("+","+")+"&mod=$1$wq1rdBcg$bHyPM4fdc5lhfWxnwIAe8."+"&opts=414&num=15");if (typeof s!="undefined") document.getElementsByTagName("head")[0].appendChild(s);})(); /*-->*/ </script>
<!-- end htmlcommentbox.com -->
Here's the code for the new one:
<!-- begin wwww.htmlcommentbox.com -->
 <div id="HCB_comment_box"><a href="http://www.htmlcommentbox.com">HTML Comment Box</a> is loading comments...</div>
 <link rel="stylesheet" type="text/css" href="//www.htmlcommentbox.com/static/skins/bootstrap/twitter-bootstrap.css?v=0" />
 <script type="text/javascript" id="hcb"> /*<!--*/ if(!window.hcb_user){hcb_user={};} (function(){var s=document.createElement("script"), l=hcb_user.PAGE || (""+window.location).replace(/'/g,"'"), h="//www.htmlcommentbox.com";s.setAttribute("type","text/javascript");s.setAttribute("src", h+"/jread?page="+encodeURIComponent(l).replace("+","+")+"&mod=$1$wq1rdBcg$QmPAF6SH5mJB1Ng4aQllx."+"&opts=16894&num=10&ts=1441594287518");if (typeof s!="undefined") document.getElementsByTagName("head")[0].appendChild(s);})(); /*-->*/ </script>
<!-- end www.htmlcommentbox.com -->

alt in case some stuff is shown differently: http://pastebin.com/sfV5PmGK, especially the part with replace "+" with "%2B"
I've isolated the part of the codes that make them different, using this editor: http://htmledit.squarefree.com/ just c+p-ing different segments.
here's the segment for the old one:
hcb_user.PAGE="https://sites.google.com/site/scienceandmathguide/";(function(){s=document.createElement("script");s.setAttribute("type","text/javascript");s.setAttribute("src", "http://www.htmlcommentbox.com/jread?page="+escape((window.hcb_user && hcb_user.PAGE)||(""+window.location)).replace("+","+")+"&mod=$1$wq1rdBcg$bHyPM4fdc5lhfWxnwIAe8."
here's the segment for the new one:
(function(){var s=document.createElement("script"), l=hcb_user.PAGE || (""+window.location).replace(/'/g,"'"), h="//www.htmlcommentbox.com";s.setAttribute("type","text/javascript");s.setAttribute("src", h+"/jread?page="+encodeURIComponent(l).replace("+","+")+"&mod=$1$wq1rdBcg$QmPAF6SH5mJB1Ng4aQllx."
Looking at it generally, it looks like it's supposed to do the same thing, but I don't know exactly what, it looks so complicated to me, I don't know all the syntax/conventions.
what it looks like when i c+p the new over the old:

Edited by Waker, 06 September 2015 - 11:07 PM.


"Censorship is telling a man he can't have a steak just because a baby can't chew it."
— Mark Twain


“I divide my officers into four classes; the clever, the lazy, the industrious, and the stupid. Each officer possesses at least two of these qualities. Those who are clever and industrious are fitted for the highest staff appointments. Use can be made of those who are stupid and lazy. The man who is clever and lazy however is for the very highest command; he has the temperament and nerves to deal with all situations. But whoever is stupid and industrious is a menace and must be removed immediately!”
— General Kurt von Hammerstein-Equord