Meshing Disqus with Index and Daily Templates?

For requests for help from CG administrators, Wranglers, and experienced CG members. Please read the FAQ before posting. Also look at CG Wiki for tutorials and how-tos written by other CG webtoonists.

Meshing Disqus with Index and Daily Templates?

Postby Allroses on Fri Jun 24, 2011 5:22 pm

So I've decided to get a Disqus account to encourage some more reader feedback. The issue being that the CG index/main page is not very Disqus-friendly. What I mean is that Disqus creates a comment string based on the URL of the page you are commenting on. For the archives, this is great, because everything has it's file-name-date URL, however for the index page this doesn't work. The Index page changes every time you update content wise, but the URL doesn't change. so the place where people are most likely to comment, the newest update, would just be overflowing with comments which do not get synced up with their appropriate page. If you click on the appropriate calendar date, you can kind of force your way past this as it brings you directly to it's dailytemplate URL. But I don't think people will be likely to do this.

In an attempt to work around this, in Siteadmin I changed the index.html template to read from dailytemplate.html instead, and then attempted to change the first page people see from index.html to dailytemplate.html again. I hoped that this would automatically redirect my page to the one with the most current dailytemplate date. But it hasn't. I'm not very good with coding, only being vaguely acquainted with html and pretty much not at all with the other languages. Is there some other option that anyone can think of that will allow me to have page-specific user comments on the front page?
Val'Cielle - A post-apocalyptic winter, a dragon goddess, and people who aren't happy about either.
All Rose Have Thorns (NSFW) - A story about angsty, pansexual vampires, and the ghosts, faeries, and people that surround them.
User avatar
Allroses
Regular Poster
 
Posts: 298
Joined: Fri Feb 08, 2008 2:43 pm
Location: NY

Re: Meshing Disqus with Index and Daily Templates?

Postby Allroses on Sat Jun 25, 2011 10:49 am

A friend and I may have actually figured this out. I'll update tomorrow if every goes accordingly. Maybe it'll help someone else looking to get disqus.
Val'Cielle - A post-apocalyptic winter, a dragon goddess, and people who aren't happy about either.
All Rose Have Thorns (NSFW) - A story about angsty, pansexual vampires, and the ghosts, faeries, and people that surround them.
User avatar
Allroses
Regular Poster
 
Posts: 298
Joined: Fri Feb 08, 2008 2:43 pm
Location: NY

Re: Meshing Disqus with Index and Daily Templates?

Postby VeryCuddlyCornpone on Sat Jun 25, 2011 1:25 pm

Definitely let me know how this works :) I tried to set this up with one of my comics a while ago but figured it was a lost cause and took the code out of my pages.
Image
Don't kid yourself, friend. I still know how.
"I'd much rather dream about my co-written Meth Beatdown script tonight." -JSConner800000000
User avatar
VeryCuddlyCornpone
Cartoon Hero
 
Posts: 2984
Joined: Tue Feb 10, 2009 3:02 pm
Location: the spoonited plates of Americup

Re: Meshing Disqus with Index and Daily Templates?

Postby Allroses on Sat Jun 25, 2011 8:37 pm

Okay! We have generated success!!

To successfully use Disqus if you are code retarded there are two ways to do it. You will be using the universal code option in both attempts. One, you can install the Disqus code as is right into your Daily Template. This will generate separate comment threads into all of your archived pages but not on your main page. If you put the Disqus code into indextemplate without changing the var disqus_identifier or the var disqus_url, all of the comments made on the index page will stay on the index page and not get bumped off to their correct updates.

The second way is to do some minor code editing! Specifically this line: var disqus_url = 'http://example.com/permalink-to-page.html';

If you name your files YYYYMMDD.extension (ex. 20110625.jpg) this will work. If not, fuck I dunno? Anyway, Your code will change to: var disqus_url = 'http://userinfo.comicgenesis.com/d/***raw_date***.html'; where userinfo is your comicgen name, right? SO EASY OMG. The raw date tag inserts the correct file name right into all of your daily template and index template pages! It is amazing! So easy!! Make sure to have that line edited in both index and daily templates, and you are SET. (and run a FULL UPDATE in Siteadmin)

An alternative method, if you don't name your files YYYYMMDD, you can TRY to to change the other Disqus ID that attaches to a specific page. The code is here: var disqus_identifier = 'unique_dynamic_id_1234';, but you could replace the entire unique dynamic ID with either the ***raw_date*** tag, or the ***todays_date*** tag. However, I had a little bit of trouble when I tried this first. It could be because in attempting to test it I deleted the most current update, put it back, and ended up confusing the system majorly. If you don't delete your most current updates it MIGHT work, but no guarantee by me. Alternatively, if you know PHP or Javascript, there's some kind of fancy coding you can do, but I'm stupid in that area so this is the way to go for me!
Val'Cielle - A post-apocalyptic winter, a dragon goddess, and people who aren't happy about either.
All Rose Have Thorns (NSFW) - A story about angsty, pansexual vampires, and the ghosts, faeries, and people that surround them.
User avatar
Allroses
Regular Poster
 
Posts: 298
Joined: Fri Feb 08, 2008 2:43 pm
Location: NY

Re: Meshing Disqus with Index and Daily Templates?

Postby VeryCuddlyCornpone on Sun Jun 26, 2011 8:28 am

Awesome. I want to give this a try with my Band Geeks comic :)
Image
Don't kid yourself, friend. I still know how.
"I'd much rather dream about my co-written Meth Beatdown script tonight." -JSConner800000000
User avatar
VeryCuddlyCornpone
Cartoon Hero
 
Posts: 2984
Joined: Tue Feb 10, 2009 3:02 pm
Location: the spoonited plates of Americup

Re: Meshing Disqus with Index and Daily Templates?

Postby Adorabledesolation on Sun Jun 26, 2011 1:10 pm

I've been using IntenseDebate, and it has worked out very well. The comments on the index page wouldn't stay with the comic, so I put a link on the index page to the archived page and now the comments stay were they should. I know I could fix it with some code, but I got lazy and it works, so it's good.
Oh hey lookit. My banner's been approved! Adorable Desolation
Image
User avatar
Adorabledesolation
Regular Poster
 
Posts: 117
Joined: Mon Nov 24, 2008 10:53 am
Location: I not only drive the short bus, I'm also a passenger!

Re: Meshing Disqus with Index and Daily Templates?

Postby Phact0rri on Wed Jun 29, 2011 6:17 pm

Glad to hear Discus is indeed working on CG, however it is assumed it is going to be a rough go, on index. Of course you can use the archive pages as active comic pages too. I've seen loads of people do that. Have them click into the current comic page.
Image
<KittyKatBlack> You look deranged. But I mean that in the nicest way possible. ^_^;
User avatar
Phact0rri
The Establishment (Moderator)
The Establishment (Moderator)
 
Posts: 5775
Joined: Mon Feb 16, 2004 12:04 pm
Location: ????

Re: Meshing Disqus with Index and Daily Templates?

Postby lightbulbs on Fri Oct 21, 2011 8:08 am

Allroses wrote:Okay! We have generated success!!

To successfully use Disqus if you are code retarded there are two ways to do it. You will be using the universal code option in both attempts. One, you can install the Disqus code as is right into your Daily Template. This will generate separate comment threads into all of your archived pages but not on your main page. If you put the Disqus code into indextemplate without changing the var disqus_identifier or the var disqus_url, all of the comments made on the index page will stay on the index page and not get bumped off to their correct updates.

The second way is to do some minor code editing! Specifically this line: var disqus_url = 'http://example.com/permalink-to-page.html';

If you name your files YYYYMMDD.extension (ex. 20110625.jpg) this will work. If not, fuck I dunno? Anyway, Your code will change to: var disqus_url = 'http://userinfo.comicgenesis.com/d/***raw_date***.html'; where userinfo is your comicgen name, right? SO EASY OMG. The raw date tag inserts the correct file name right into all of your daily template and index template pages! It is amazing! So easy!! Make sure to have that line edited in both index and daily templates, and you are SET. (and run a FULL UPDATE in Siteadmin)

An alternative method, if you don't name your files YYYYMMDD, you can TRY to to change the other Disqus ID that attaches to a specific page. The code is here: var disqus_identifier = 'unique_dynamic_id_1234';, but you could replace the entire unique dynamic ID with either the ***raw_date*** tag, or the ***todays_date*** tag. However, I had a little bit of trouble when I tried this first. It could be because in attempting to test it I deleted the most current update, put it back, and ended up confusing the system majorly. If you don't delete your most current updates it MIGHT work, but no guarantee by me. Alternatively, if you know PHP or Javascript, there's some kind of fancy coding you can do, but I'm stupid in that area so this is the way to go for me!



I'm confused about how to insert the code into the template files. Could some one post an example? Um before showing the example, my pages have their names going, YYYYMMDD.
User avatar
lightbulbs
Newbie
 
Posts: 17
Joined: Mon Oct 10, 2011 10:04 am

Re: Meshing Disqus with Index and Daily Templates?

Postby STrRedWolf on Sun Oct 23, 2011 10:01 am

Use ***rawdate*** to generate the /d/blah.html files. ***todays_date*** will expand out to how you write it out in longhand (aka "Sunday, October 22nd, 2011").

Make sure you post the full details on the Tips and Techniques forum and/or the Wiki.
Kelly "STrRedWolf" Price
Admin, Comic Genesis
Artist/Writer, Stalag '99 (WolfSkunks and Drygers, oh my!)
I NEED MORE TIME, CAPTIN!
User avatar
STrRedWolf
Confuzzled CG Admin
Confuzzled CG Admin
 
Posts: 2570
Joined: Fri Jan 01, 1999 4:00 pm
Location: undef;

Re: Meshing Disqus with Index and Daily Templates?

Postby lightbulbs on Sun Oct 23, 2011 8:08 pm

...Due to that reply I guess I've greatly mistaken what was being talked about in this thread.

Off subject now I think, is it possible to code a site into allowing people to comment on it? Each comic page, on that page having feed back on it? I wouldn't think this to be a matter to question except for the fact our sites use more than one index to work.
User avatar
lightbulbs
Newbie
 
Posts: 17
Joined: Mon Oct 10, 2011 10:04 am

Re: Meshing Disqus with Index and Daily Templates?

Postby VeryCuddlyCornpone on Mon Oct 24, 2011 6:03 am

lightbulbs wrote:...Due to that reply I guess I've greatly mistaken what was being talked about in this thread.

Off subject now I think, is it possible to code a site into allowing people to comment on it? Each comic page, on that page having feed back on it? I wouldn't think this to be a matter to question except for the fact our sites use more than one index to work.


That's what this thread is about.

The problem with just entering the code as a website like, say, Disqus gives you, is the way the comic genesis update generates each archival page for you. In order for the comment code to work, you'd need to put in the exact URL for each individual page.

Each past page in your ( or anybody's here) comic ends with [the file name of that strip].html. Remember, the file names are YYYYMMDD. The code for inserting YYYYMMDD is the raw date code mentioned above. By putting "http://whateverthecomicis.comicgenesis.com/d/***raw_date***.html" into the code for Disqus or other comment code, that will insert the YYYYMMDD into the URL for you, replacing ***raw_date*** with, for instance, 20111024. That way, comments made on that specific page will remain on that specific page. Otherwise, every comment on the index page (the first page you see when you click a site) would always stay on the index page, and would not be connected to the actual strip the comment was intended for. This allows the comments to stay connected to the strips they were intended for, instead of forever remaining on the main page and looking out of context.
Image
Don't kid yourself, friend. I still know how.
"I'd much rather dream about my co-written Meth Beatdown script tonight." -JSConner800000000
User avatar
VeryCuddlyCornpone
Cartoon Hero
 
Posts: 2984
Joined: Tue Feb 10, 2009 3:02 pm
Location: the spoonited plates of Americup

Re: Meshing Disqus with Index and Daily Templates?

Postby lightbulbs on Mon Oct 24, 2011 8:56 am

I'm sure that is understood by some but not me. I can't even comprehend how to type that. Such code couldn't be put in either of the indexes because they're consistent. The only guess I have which is likely wrong is putting the code into the image file properties of the file labeled YYYYMMDD.
User avatar
lightbulbs
Newbie
 
Posts: 17
Joined: Mon Oct 10, 2011 10:04 am

Re: Meshing Disqus with Index and Daily Templates?

Postby VeryCuddlyCornpone on Mon Oct 24, 2011 9:43 am

lightbulbs wrote:I'm sure that is understood by some but not me. I can't even comprehend how to type that. Such code couldn't be put in either of the indexes because they're consistent. The only guess I have which is likely wrong is putting the code into the image file properties of the file labeled YYYYMMDD.

I typed up a very long explanation but then the forum ate it.

Let me try this again.





In this thread we are discussing, as you said, how to add in code to our sites so that people can comment on individual comic pages.

Disqus is a site that is not associated with ComicGenesis. In order to use it, one needs to sign up there and enter some information about one's website. After one does this, Disqus provides the user with a code that can be added in to that user's website templates to allow a commenting area.

The trouble is that the code Disqus gives you requires you to put into your template the exact URL of the pages you want the comment area to appear on. However, on ComicGenesis, our archival pages are created for us. All we have to work with are the daily and index template.

You are right about both the daily and index template being consistent. This is where ***raw_date*** helps. Since we cannot go in and add in each URL for every single comic page, we use ***raw_date*** to do the job for us.

***raw_date*** is a KeenTag that inserts the date of a particular comic in the form of the file name. You remember that each comic file is labelled 20111024.jpg.

Let's say that you inserted the code ***raw_date*** into your daily template file. Let's say that you put it underneath where you have the code ***todays_comics***.

Now let's also say that you have a long archive, and you decide to go back to, just for instance, November ninth, 2009.

You are looking at the page for November 9, 2009. You scroll down and underneath your comic you would see the phrase "20091109." This is because ***raw_date*** would display the file name of that comic.

I hope this is clear so far.

Here is how ***raw_date*** helps us with the code that Disqus would give us.

We'll speak hypothetically again. Let's say you sign up with Disqus, fill out your information, fill out the information about the comic you'll be using the code for, whatever it is you need to do. Now you've signed up, and Disqus displays, in text, a code that you copy and paste into your daily and index template files in accordance with the directions that Disqus provides.

At some point in that code, you will need to enter the URL for your site. All you need to do is enter http://blbla.comicgenesis.com/d/***raw_date***.html. Exactly in that format, with the KeenTag and asterisks in there and everything.

You put this into your index AND daily template files. You must put it in both, and must include ***raw_date*** in both. By including it even in the index template, you make it possible for comments made on today's comic to stay stuck to today's comic, even as you update and add more. If you did not put ***raw_date*** into the Disqus code into the index template, all comments made onto the index page (which would be http://blbllb.comicgenesis.com) would forever stay on the index page and would not stay with the comic they were directed toward.

Not speaking hypothetically anymore. Right now, you cannot do this, because you have not signed up with Disqus and received the necessary code and instructions. You would need to do that before ***raw_date*** would be of any use to you in this context.

You've been having a lot of trouble with code, though, and I would recommend waiting until you are more comfortable before you try to implement this.
Image
Don't kid yourself, friend. I still know how.
"I'd much rather dream about my co-written Meth Beatdown script tonight." -JSConner800000000
User avatar
VeryCuddlyCornpone
Cartoon Hero
 
Posts: 2984
Joined: Tue Feb 10, 2009 3:02 pm
Location: the spoonited plates of Americup

Re: Meshing Disqus with Index and Daily Templates?

Postby lightbulbs on Mon Oct 24, 2011 3:12 pm

Eep :o I think this can be displayed here since it shouldn't be of use to any one else's site. This is what I got from Disqus after registering. Does re-coding happen every time my site updates? Help :( .

Embed code

<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'example'; // required: replace example with your forum shortname

/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>


Comment count

<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'example'; // required: replace example with your forum shortname

/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>


Examples for using the comment code script

<a href="http://example.com/article1.html#disqus_thread" data-disqus-identifier="article_1_identifier">First article</a>
<a href="http://example.com/article2.html#disqus_thread">Second article</a>
<a href="http://example.com/" data-disqus-identifier="over-9000">Anchor</a>
User avatar
lightbulbs
Newbie
 
Posts: 17
Joined: Mon Oct 10, 2011 10:04 am

Re: Meshing Disqus with Index and Daily Templates?

Postby Kisai on Fri Nov 04, 2011 1:53 pm

Disqus just needs a fixed URL, just put the code provided by Disqus into the template page as-is. It's fine.

The way I do it on keenspot sites is just this:
Code: Select all
<div id="disqus_thread" style="width:600px;text-align:center;vertical-align:middle;">
</div>

Put that where you want the actual DISQUS comments to appear. Adjust css if necessary.

Then at the end of the page (before the body closing tag)
Code: Select all
<script type="text/javascript" src="http://disqus.com/forums/YOURDISQUSNAMEGOESHERE/embed.js"></script><noscript><a href="http://YOURDISQUSNAMEGOESHERE.disqus.com/?url=ref">View the discussion thread.</a></noscript><a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>


The only thing you need to take into account is that the "today" page will result in comments for index.html not TODAY day. So you just fix this by putting a link to the /d/ page for TODAY instead. The same works for any other third party commenting. Use ***raw_date*** to get today's date.
User avatar
Kisai
Goddess of Light
Goddess of Light
 
Posts: 3256
Joined: Fri Jan 01, 1999 4:00 pm
Location: The Past, the Present, The future

Re: Meshing Disqus with Index and Daily Templates?

Postby lightbulbs on Wed Nov 09, 2011 3:56 pm

Kisai wrote:Disqus just needs a fixed URL, just put the code provided by Disqus into the template page as-is. It's fine.

The way I do it on keenspot sites is just this:
Code: Select all
<div id="disqus_thread" style="width:600px;text-align:center;vertical-align:middle;">
</div>

Put that where you want the actual DISQUS comments to appear. Adjust css if necessary.

Then at the end of the page (before the body closing tag)
Code: Select all
<script type="text/javascript" src="http://disqus.com/forums/YOURDISQUSNAMEGOESHERE/embed.js"></script><noscript><a href="http://YOURDISQUSNAMEGOESHERE.disqus.com/?url=ref">View the discussion thread.</a></noscript><a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>


The only thing you need to take into account is that the "today" page will result in comments for index.html not TODAY day. So you just fix this by putting a link to the /d/ page for TODAY instead. The same works for any other third party commenting. Use ***raw_date*** to get today's date.



Thank you for replying I thought no one cared to help me fix this dilemma :). I've read over your closing comment a few times and still don't understand what it implies. I get the first halve, just not the fix. Could you please clarify it further? Just the second halve, not the first.
User avatar
lightbulbs
Newbie
 
Posts: 17
Joined: Mon Oct 10, 2011 10:04 am

Re: Meshing Disqus with Index and Daily Templates?

Postby robotthepirate on Wed Dec 14, 2011 4:00 am

lightbulbs wrote:
Kisai wrote:Disqus just needs a fixed URL, just put the code provided by Disqus into the template page as-is. It's fine.

The way I do it on keenspot sites is just this:
Code: Select all
<div id="disqus_thread" style="width:600px;text-align:center;vertical-align:middle;">
</div>

Put that where you want the actual DISQUS comments to appear. Adjust css if necessary.

Then at the end of the page (before the body closing tag)
Code: Select all
<script type="text/javascript" src="http://disqus.com/forums/YOURDISQUSNAMEGOESHERE/embed.js"></script><noscript><a href="http://YOURDISQUSNAMEGOESHERE.disqus.com/?url=ref">View the discussion thread.</a></noscript><a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>


The only thing you need to take into account is that the "today" page will result in comments for index.html not TODAY day. So you just fix this by putting a link to the /d/ page for TODAY instead. The same works for any other third party commenting. Use ***raw_date*** to get today's date.



Thank you for replying I thought no one cared to help me fix this dilemma :). I've read over your closing comment a few times and still don't understand what it implies. I get the first halve, just not the fix. Could you please clarify it further? Just the second halve, not the first.


I never really understand what Kisai says. My Dyslexia blanks in out much as it does the King James Bible. That said I'm not sure what exactly you don't understand either, so I might be teaching you to suck eggs.

I think the point is this. When you upload a new comic to your page it makes an archive page for it then and there. Normally you don't see that page because your new comic appears on the home (index) page but its there. If you type the address of your comic in http://[whatever].comicgenesis.com then add /d/[the date you updated] it'll take you there. So if you have Disqus on all you archive pages it will have it on there for your new comic.

Obviously that doesn't help because most people wont see that page but if you use the tag ***raw_date*** in a link: http://[whatever].comicgenesis.com/d/***raw_date*** then it will take your user to the hidden page and therefore to your comments.

Make any more sense?

PS No offense Kisai, its like you speak Techno.
Image Image Image Image
User avatar
robotthepirate
Regular Poster
 
Posts: 563
Joined: Wed Mar 02, 2011 11:02 am
Location: Staffordshire, UK


 

Return to Help Center



Who is online

Users browsing this forum: No registered users and 1 guest

cron