Disqus in the cgblog module
Posted: Sun Jun 17, 2012 8:32 pm
DO IT IN ORDER:
Create 2 UDTs
1. currenturl
2. disqus
UDT called "currenturl" :
UDT called "disqus"
See UDT here: http://dev.cmsmadesimple.org/projects/disqus
That UDT is for NEWS, THESE instructions are for CGBlog
All you do in the UDT is ignore most of the the instructions except 2 things:
1. Change line #26 in the file to your disqus short name...
$d_Shortname = "thenameyouhavewithyourdisqusaccount"; //<--- #### CHANGE THIS BY YOU OWN "disqus shortname". More informations on http://disqus.com/
2. Before the body close tag on your PAGE template (not the detail template of the blog) past this:
Putting the code in the respective templates in CGBlog:
Summary template to show the links and comment count on the summary loop (this goes somewhere inside the foreach of each summary):
Top of Detail template, remove old canonical information and replace with:
This is because the $entry->detail_url is not the same as the canonical in the latest CGBlog module, it used to be.
Detail template (the link to the comments and showing of the comments)
Put this where you want the comments and form to appear:
All other stuff, formatting and words you need to learn how to use disqus and change appearances.
You can purchase the ability to adjust themes or you can use some css and target the ids and classes, I've done just enough to match my theme and use my fonts:
CSS
NOTE: I also have global form css, example:
I don't have time to support this, please be patient as the js running disqus is slowish and so comment counting doesn't show up for a little while. More stuff here: http://www.siterehab.com/disqus-custom-css/
You can change some of the wording in your disqus/ settings /appearance, but it only goes so far.
Create 2 UDTs
1. currenturl
2. disqus
UDT called "currenturl" :
Code: Select all
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
echo curPageURL();
UDT called "disqus"
See UDT here: http://dev.cmsmadesimple.org/projects/disqus
That UDT is for NEWS, THESE instructions are for CGBlog
All you do in the UDT is ignore most of the the instructions except 2 things:
1. Change line #26 in the file to your disqus short name...
$d_Shortname = "thenameyouhavewithyourdisqusaccount"; //<--- #### CHANGE THIS BY YOU OWN "disqus shortname". More informations on http://disqus.com/
2. Before the body close tag on your PAGE template (not the detail template of the blog) past this:
Code: Select all
{disqus counter='whatever'}
Putting the code in the respective templates in CGBlog:
Summary template to show the links and comment count on the summary loop (this goes somewhere inside the foreach of each summary):
Code: Select all
<a href="{$entry->detail_url}#disqus_thread" title='see the comments' data-disqus-identifier="{$entry->detail_url}"> </a>
Top of Detail template, remove old canonical information and replace with:
Code: Select all
{strip}{capture assign=sid}{currenturl}{/capture}
{if isset($entry->canonical)}
{assign var='canonical' value=$sid}{/if}{/strip}
Detail template (the link to the comments and showing of the comments)
Code: Select all
<a href="{$sid}#disqus_thread" title='see the comments' data-disqus-identifier="{$sid}"> </a>
Code: Select all
{disqus comments=$sid}
All other stuff, formatting and words you need to learn how to use disqus and change appearances.
You can purchase the ability to adjust themes or you can use some css and target the ids and classes, I've done just enough to match my theme and use my fonts:
CSS
Code: Select all
#disqus_thread h3 {
text-transform:lowercase;
font-size:120%;
font-weight:normal!important;
}
#dsq-reply h3 {font-size:200%;font-weight: 300!important;}
#disqus_thread {
color:#000;
font-weight:normal;
font-family: 'Lato', helvetica, arial, sans-serif;
font-size:90%;
}
#disqus_thread select {
font-size:80%;
}
#disqus_thread a, #dsq-footer a {text-decoration: none!important;}
#dsq-content #dsq-footer * {text-decoration: none!important;}
div.dsq-trackback-url input {width:80%}
div.dsq-comment-header {border-color:#ddd}
a.dsq-brlink {text-decoration:none;display:block;width:100%;text-align:right}
Code: Select all
input[type="text"],input[type="password"],input[type="email"], input[type="tel"],input[type="url"],textarea,select {stylesgohere}
You can change some of the wording in your disqus/ settings /appearance, but it only goes so far.