Comic Fury Webcomic Hosting - Embedding Comment Box into the Layout Problems

You are not logged in. Log in, Register, More info
Forum > Layouts, HTML, CSS & Javascript > Embedding Comment Box into the Layout Problems
Pages: [1]

"Embedding Comment Box into the Layout Problems", 3rd Aug 2012, 4:02 AM #1
Kupocake

User avatar
Posts: 935
Referrals: 0
Registration date: 14th Mar 2012
Location: S. California
Hey everyone, I'm in need of some help.
I'm trying to get the comment box to show up in the layout itself, so that no pop-up window appears. I've been using the It Figures guide, which is fairly outdated since I had to change up some of the coding manually. But I had some amount of success, I was able to embed an iFrame with a comment box into the layout.

Now, here's where I'm having problems.
1) How/where do you customize the comment box (change the colors/field descriptions)?
2) How do you make it so that the entire page refreshes when someone makes a comment? (Tried the It Figures code -- no dice!)
3) How do you center the iFrame comment box?

Here's what I got for the iFrame.

<div style="display: block; margin: 0 auto; width: 800px">
<iframe src="[v:commentlink]" id="commentFrame" style="width: 80%; height: 300px;">
    <a href="[commentlink]">Leave a Comment</a>
</iframe>
</div>
<script type="text/javascript" src="/files/static/jquery-1.3.2.min.js"></script>
<script type="text/javascript"><!--
 $(function() {
            var commentFrameLoads = 0;
            $('#frame').load(function() {
                if (commentFrameLoads==1){
                    top.location.assign(location);
                }
                commentFrameLoads++;
            });
        });
    
//--></script>


I might be in need of more help in the future. I'll also note that I'm a complete idiot when it comes to coding, so please excuse my stupidity. Also, for your reference, this is how the comment box is appearing in its natural, gray, non-centered form: test site link.
_______________________
[ Tumblr ] [ DeviantArt ]
image
Updates Tuesdays!
3rd Aug 2012, 5:44 AM #2
blockcomics♂

User avatar
Posts: 25
Referrals: 0
Registration date: 19th Apr 2011
Hey there, Kupocake.

That looks pretty nice for a test site (I'm assuming it must be a copy of your actual comic site for testing purposes.)

I'm not much help when it comes to coding (at least not the jquery parts - I know my way around JavaScript in general well enough, though).

But I do have a suggestion for centering your iframe; try putting "margin:0 auto;" in the style for the iframe itself. You may want to put the old "text-align:center;" in the style for your div unless there will be other text that you don't want centered in it. (Because it's possible not all browsers will center elements using "margin:0 auto;" correctly.)


I've looked into doing inline comments this way, but personally, I'm not a big fan of iframes, as some of my readers have them disabled or blocked in their browsers. I think iframes can also freak out people's internet security and make them think a site isn't safe, because they're often used to put non-friendly webpages into seemingly-friendly ones as a sneaky back door. I think that after this long, ComicFury could have come up with an inline commenting system, like the way almost all other websites with comments handle them, but I understand ComicFury can't be perfect.

Good luck with the rest of it, anyway. I hope I was at least able to help solve your centering problem.
_______________________
image
Zombie Outbrick

The story of one man as the city in which he lives is overrun by the undead... A story told with LEGO® bricks.
3rd Aug 2012, 5:50 AM #3
Kupocake

User avatar
Posts: 935
Referrals: 0
Registration date: 14th Mar 2012
Location: S. California
Hi BlockComics!

Yeah, it's a copy of my actual comic site, but messing around with the coding. I had no idea that iFrames do weird things to some browsers, so that IS a problem. I'll mess with the coding for centering, thanks!

If I can't work this out, I'll just switch back to Disqus since the embedded commenting system looks great anyway. But, I'd really rather use CF's default system at this point. I mean, that's what it's there for. X_X
_______________________
[ Tumblr ] [ DeviantArt ]
image
Updates Tuesdays!
3rd Aug 2012, 5:56 AM #4
blockcomics♂

User avatar
Posts: 25
Referrals: 0
Registration date: 19th Apr 2011
You're welcome, I'm glad to have been some help.

And I considered getting a third party commenting system for my site, but then I realized that I didn't want to lose the 600+ comments I already had, so that would've been tricky. Because the comments are CF's default, there are some benefits to having them, I suppose.

And by an incredible stroke of luck, I seem to have found the answer to your second question in the random code snippets thread (it also looks like it could help with your first question, as well):

JustNoPoint:This code will place the reply box wherever you would like on your site. So that people can make quick comments without clicking the comment link and using the pop up box.

You can also use various tags listed to alter the way the box looks.

<script type="text/javascript" src="/files/static/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
    //Copy-paste tips and other jQuery code after this line
    $(function() {
        var commentFrameLoads = 0;
        $('#frame').load(function() {
            if (commentFrameLoads==1){
                top.location.assign(location);
            }
            commentFrameLoads++;
        });
    });
</script>

Add the above between the <head></head> tags. This will make it so that when a comment is made the page will automatically refresh itself and your commenter will see the new comment right away.

<iframe id="frame" frameBorder="0" src="[v:commentlink]" width="500" height="255"></iframe>


The above line is placed where you want your comment box. This is the best width and length I could determine for the iframe box. It makes it so guests and CF members can see the whole box without much excess space taken up so you will not have a scroll bar. However as the comic author you WILL see a scroll bar because you have more options. If that annoys you increase the height a bit.
Another note the id="frame" needs to be here if you want the comic page to refresh itself with the code given earlier.

Now for the fun stuff so you can customize colors and fonts

bgcolor
tacolor
sepcolor
tatextcolor
h1bgcolor
h1fontcolor
fontcolor
h1bordercolor
formbgcolor
formbordercolor
submitcolor
submittextcolor
submitbordercolor
notitle

Simply put these behind the [v:commentlink] tag with & like so
[v:commentlink]&bgcolor=e3e9e8&sepcolor=899ba8



Here is the complete code from my site as an example
<iframe id="frame" frameBorder="0" src="[v:commentlink]&bgcolor=e3e9e8&sepcolor=899ba8&h1bgcolor=899ba8&h1bordercolor=5d6a71&formbgcolor=b3bfc7&formbordercolor=5d6a71&submitbordercolor=39703c&submitcolor=5d9760" width="500" height="255"></iframe>


_______________________
image
Zombie Outbrick

The story of one man as the city in which he lives is overrun by the undead... A story told with LEGO® bricks.
3rd Aug 2012, 6:00 AM #5
Kupocake

User avatar
Posts: 935
Referrals: 0
Registration date: 14th Mar 2012
Location: S. California
Oh my god, you're awesome! Thank you! :D

Let's see what this'll do.
_______________________
[ Tumblr ] [ DeviantArt ]
image
Updates Tuesdays!
3rd Aug 2012, 6:02 AM #6
blockcomics♂

User avatar
Posts: 25
Referrals: 0
Registration date: 19th Apr 2011
You're welcome! I hope it works for you.
_______________________
image
Zombie Outbrick

The story of one man as the city in which he lives is overrun by the undead... A story told with LEGO® bricks.
3rd Aug 2012, 5:02 PM #7
Kupocake

User avatar
Posts: 935
Referrals: 0
Registration date: 14th Mar 2012
Location: S. California
Still got one unresolved question.

Can I change the text in the comment box descriptions? Like, "Leaving a comment on "_____"", Name, Title, Comment. I especially want to change the title on the top of the comment box, I find it really wordy. Also, is there a way to change the position of the "post the comment" button?
_______________________
[ Tumblr ] [ DeviantArt ]
image
Updates Tuesdays!
3rd Aug 2012, 5:46 PM #8
blockcomics♂

User avatar
Posts: 25
Referrals: 0
Registration date: 19th Apr 2011
From what I understand, I don't think changing the actual text of the ComicFury comment box is possible. I could be wrong, though.

I wish CF would release their comment code for people to play with, so those of us who knew how to use it could make non-iframe inline comments if we wanted to - but I suppose there'd probably be security risks involved.

I feel like the closest you could get to changing the text in the box would be to put opaque elements from your comic page over the iframe, with whatever you wanted to say inside. That could cause some issues, and it's kind of a quick and dirty solution, but it's all I could think of.
_______________________
image
Zombie Outbrick

The story of one man as the city in which he lives is overrun by the undead... A story told with LEGO® bricks.
3rd Aug 2012, 7:43 PM #9
Kupocake

User avatar
Posts: 935
Referrals: 0
Registration date: 14th Mar 2012
Location: S. California
That sucks. :/ Well, if I can't get this working after all that, I guess I can always fall back to Disqus. I'm afraid of using opaque elements over the iFrame, since I can foresee issues with things such as 1) different browsers 2) different monitors that will make the comment box show up incorrectly. Not to mention it'd be a pain to work it out. Still, I'll mess with it and see what happens.
_______________________
[ Tumblr ] [ DeviantArt ]
image
Updates Tuesdays!
3rd Aug 2012, 9:00 PM #10
Kyo♂
I got to choose mine
User avatar
Posts: 6889
Referrals: 0
Registration date: 6th Jul 2008
Location: Germany
blockcomics:I've looked into doing inline comments this way, but personally, I'm not a big fan of iframes, as some of my readers have them disabled or blocked in their browsers. I think iframes can also freak out people's internet security and make them think a site isn't safe, because they're often used to put non-friendly webpages into seemingly-friendly ones as a sneaky back door.


This is just objectively wrong. Facebook likes, facebook comments, disqus, all these systems use iframes. Tumblr uses them too. They're a big part of the internet, and while they can be used for shady things, using them alone will not make any tool think your site is suspicious. They also work in virtually any browser configuration, even if you have javascript disabled. I'm guessing you are getting javascript and iframes confused, or are talking about javascript generated iframes.

If the browser does have iframes disabled, you can deliver a fallback like this:

<iframe>text here will only appear if iframes are disabled


but AFAIK browsers don't really have an option to disable iframes, just javascript (which things like disqus use to generate iframes).

I think that after this long, ComicFury could have come up with an inline commenting system, like the way almost all other websites with comments handle them, but I understand ComicFury can't be perfect.


The problem with this is that true inline commenting is a security issue. If the comment form is part of the page (not via an iframe or any sort of other magic), that means that you can tamper with it using javascript, and make logged in people submit arbitrary comments to arbitrary webcomics. There is no way around this unless it uses some sort of iframe (in the same way disqus, blogspot and others do), or not allowing people to use javascript on their webcomics at all (the IMO worse option of the two)

if you would like to do more reading about this, here's the wikipedia article on the topic.

I am planning to eventually have better comment integration, but it will still rely on iframes. I've just been busy with real life lately and unfortunately I also have other responsibilities (like earning money)

I wish CF would release their comment code for people to play with, so those of us who knew how to use it could make non-iframe inline comments if we wanted to - but I suppose there'd probably be security risks involved.


This isn't really possible. Comments are part of the whole package, there isn't really such a thing as "comment code", there's just comicfury code. Additionally, this would not be of much use to you. Comicfury doesn't allow you to upload php files, as how you say, there would be huge security risks associated with it. You could look at it, but you couldn't change anything. See my comment above about why non-iframe inline comments are just not possible. If they were they would have been the default. Alas, they are not.

The whole comment window customization is a bit hacky. I will eventually add an option in comic management that should make it easier for you to change things.

Kupocake:Still got one unresolved question.

Can I change the text in the comment box descriptions? Like, "Leaving a comment on "_____"", Name, Title, Comment. I especially want to change the title on the top of the comment box, I find it really wordy. Also, is there a way to change the position of the "post the comment" button?




Right now you cannot change the title. You can get rid of the title entirely though. Append &noheadline to the url.
_______________________
hello
3rd Aug 2012, 11:56 PM #11
Kupocake

User avatar
Posts: 935
Referrals: 0
Registration date: 14th Mar 2012
Location: S. California
Kyo:

Kupocake:Still got one unresolved question.

Can I change the text in the comment box descriptions? Like, "Leaving a comment on "_____"", Name, Title, Comment. I especially want to change the title on the top of the comment box, I find it really wordy. Also, is there a way to change the position of the "post the comment" button?




Right now you cannot change the title. You can get rid of the title entirely though. Append &noheadline to the url.


That's a good alternative. :U Thank you!
_______________________
[ Tumblr ] [ DeviantArt ]
image
Updates Tuesdays!
4th Aug 2012, 4:42 AM #12
blockcomics♂

User avatar
Posts: 25
Referrals: 0
Registration date: 19th Apr 2011
Kyo:
blockcomics:I've looked into doing inline comments this way, but personally, I'm not a big fan of iframes, as some of my readers have them disabled or blocked in their browsers. I think iframes can also freak out people's internet security and make them think a site isn't safe, because they're often used to put non-friendly webpages into seemingly-friendly ones as a sneaky back door.


This is just objectively wrong. Facebook likes, facebook comments, disqus, all these systems use iframes. Tumblr uses them too. They're a big part of the internet, and while they can be used for shady things, using them alone will not make any tool think your site is suspicious. They also work in virtually any browser configuration, even if you have javascript disabled. I'm guessing you are getting javascript and iframes confused, or are talking about javascript generated iframes.

If the browser does have iframes disabled, you can deliver a fallback like this:

<iframe>text here will only appear if iframes are disabled


but AFAIK browsers don't really have an option to disable iframes, just javascript (which things like disqus use to generate iframes).

I think that after this long, ComicFury could have come up with an inline commenting system, like the way almost all other websites with comments handle them, but I understand ComicFury can't be perfect.


The problem with this is that true inline commenting is a security issue. If the comment form is part of the page (not via an iframe or any sort of other magic), that means that you can tamper with it using javascript, and make logged in people submit arbitrary comments to arbitrary webcomics. There is no way around this unless it uses some sort of iframe (in the same way disqus, blogspot and others do), or not allowing people to use javascript on their webcomics at all (the IMO worse option of the two)

if you would like to do more reading about this, here's the wikipedia article on the topic.

I am planning to eventually have better comment integration, but it will still rely on iframes. I've just been busy with real life lately and unfortunately I also have other responsibilities (like earning money)

I wish CF would release their comment code for people to play with, so those of us who knew how to use it could make non-iframe inline comments if we wanted to - but I suppose there'd probably be security risks involved.


This isn't really possible. Comments are part of the whole package, there isn't really such a thing as "comment code", there's just comicfury code. Additionally, this would not be of much use to you. Comicfury doesn't allow you to upload php files, as how you say, there would be huge security risks associated with it. You could look at it, but you couldn't change anything. See my comment above about why non-iframe inline comments are just not possible. If they were they would have been the default. Alas, they are not.


Wow - well I suppose I'd better apologize for my utter ignorance of the way things actually work. I'm probably not the best person for advice around here...

Thanks for clearing everything up, Kyo. Someone told me that iframes weren't very nice when I tried to use them for something once, and I sort of took their word for it.
_______________________
image
Zombie Outbrick

The story of one man as the city in which he lives is overrun by the undead... A story told with LEGO® bricks.
4th Aug 2012, 3:36 PM #13
Kyo♂
I got to choose mine
User avatar
Posts: 6889
Referrals: 0
Registration date: 6th Jul 2008
Location: Germany
No problem, that's what I'm here for *sunglasses*
_______________________
hello
11th Aug 2012, 4:51 PM #14
Kupocake

User avatar
Posts: 935
Referrals: 0
Registration date: 14th Mar 2012
Location: S. California
Hate to revive this week-old thread, but I'm running into more problems.

I'm happy with how the embedded comic box looks, but it only shows up on ONE of three pages instead of showing up at every page. I have the comment box code pasted into the "Comic Strip Display" part of the HTML management.


edit: NEVER MIND FIXED THAT PART.

Additionally, I'm having problems with centering the banner. A complete newbie question, I know, but it's just I do have a few double-spread pages in my comic, and it's important for me that the banner stays centered regardless how wide the pages are.

Here's my test site where all the problems are happening.
_______________________
[ Tumblr ] [ DeviantArt ]
image
Updates Tuesdays!
11th Aug 2012, 9:02 PM #15
Kyo♂
I got to choose mine
User avatar
Posts: 6889
Referrals: 0
Registration date: 6th Jul 2008
Location: Germany
always good to say how you fixed it instead of just "nevermind, fixed" in case someone finds this thread and has the same problem.

try this css maybe:

#sitetitle {
   text-align:center;
}
_______________________
hello
11th Aug 2012, 9:24 PM #16
Kupocake

User avatar
Posts: 935
Referrals: 0
Registration date: 14th Mar 2012
Location: S. California
Good plan. What I found was that when I put the comment box/iframe beneath the <div class="comments"> tag, it disappears unless a comment has already been posted. However, under the <div class="afterheading"> tag, it shows up regardless if there's comments or not. Not really sure why exactly, but hey it fixed it.

Back to the centering banner business, this is my CSS code for the #sitetitle part:
#sitetitle {
 text-align:center;
 margin:0px;
 color:#FFFFFF;
 position:absolute;
 padding-right:8px;
 font-family:"Century Gothic","AppleGothic","MgOpen Modata","Avant Garde Gothic","Gill Sans","Gill Sans MT",sans-serif;
 letter-spacing:1px;
}


I have text-align:center; already on there, but it doesn't seem to affect the banner. Additionally, I tried some basic fixes like the <center></center> tag in the HTML part where the banner image is, and that didn't do anything.
_______________________
[ Tumblr ] [ DeviantArt ]
image
Updates Tuesdays!
12th Aug 2012, 7:50 AM #17
Kyo♂
I got to choose mine
User avatar
Posts: 6889
Referrals: 0
Registration date: 6th Jul 2008
Location: Germany
Kupocake:Good plan. What I found was that when I put the comment box/iframe beneath the <div class="comments"> tag, it disappears unless a comment has already been posted. However, under the <div class="afterheading"> tag, it shows up regardless if there's comments or not. Not really sure why exactly, but hey it fixed it.

Back to the centering banner business, this is my CSS code for the #sitetitle part:
#sitetitle {
 text-align:center;
 margin:0px;
 color:#FFFFFF;
 position:absolute;
 padding-right:8px;
 font-family:"Century Gothic","AppleGothic","MgOpen Modata","Avant Garde Gothic","Gill Sans","Gill Sans MT",sans-serif;
 letter-spacing:1px;
}


I have text-align:center; already on there, but it doesn't seem to affect the banner. Additionally, I tried some basic fixes like the <center></center> tag in the HTML part where the banner image is, and that didn't do anything.


probably a [/] between there, closing the "hascomments" condition, so it only shows up if the strip has comments.

in #sitetitle you could try adding margin:auto; underneath the margin:0px;

you can also probably get rid of the position:absolute if that doesn't fix it,
_______________________
hello
12th Aug 2012, 3:40 PM #18
Kupocake

User avatar
Posts: 935
Referrals: 0
Registration date: 14th Mar 2012
Location: S. California
Kyo:
Kupocake:Good plan. What I found was that when I put the comment box/iframe beneath the <div class="comments"> tag, it disappears unless a comment has already been posted. However, under the <div class="afterheading"> tag, it shows up regardless if there's comments or not. Not really sure why exactly, but hey it fixed it.

Back to the centering banner business, this is my CSS code for the #sitetitle part:
#sitetitle {
 text-align:center;
 margin:0px;
 color:#FFFFFF;
 position:absolute;
 padding-right:8px;
 font-family:"Century Gothic","AppleGothic","MgOpen Modata","Avant Garde Gothic","Gill Sans","Gill Sans MT",sans-serif;
 letter-spacing:1px;
}


I have text-align:center; already on there, but it doesn't seem to affect the banner. Additionally, I tried some basic fixes like the <center></center> tag in the HTML part where the banner image is, and that didn't do anything.


probably a [/] between there, closing the "hascomments" condition, so it only shows up if the strip has comments.

in #sitetitle you could try adding margin:auto; underneath the margin:0px;

you can also probably get rid of the position:absolute if that doesn't fix it,


Awesome, that did it! Thank you! :U

Edit: Oh no, running into another problem. When I got rid of position:absolute, the banner centers on the double-spread just fine, but on a normal page, it doesn't align properly with the rest of the body. Position:absolute definitely aligned it, but without position:absolute, it doesn't reach out to the edge like it did before. I tested to see if just making the banner wider would do anything, but it just stretched out the container/body and still had that annoying extra space.

Found out the problem was the "padding-right:8px;" part. I just got rid of that and it aligned properly. Derp. X_X
_______________________
[ Tumblr ] [ DeviantArt ]
image
Updates Tuesdays!
Forum > Layouts, HTML, CSS & Javascript > Embedding Comment Box into the Layout Problems
Pages: [1]