• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Disqus in the cgblog module
PostPosted: Sun Jun 17, 2012 8:32 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu Feb 08, 2007 6:11 pm
Posts: 506
Location: Florida
DO IT IN ORDER:

Create 2 UDTs

1. currenturl

2. disqus


UDT called "currenturl" :

\$1:
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:

\$1:
{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):
\$1:
<a href="{$entry->detail_url}#disqus_thread" title='see the comments' data-disqus-identifier="{$entry->detail_url}">&nbsp;</a>



Top of Detail template, remove old canonical information and replace with:

\$1:
{strip}{capture assign=sid}{currenturl}{/capture}
{if isset($entry->canonical)}
{assign var='canonical' value=$sid}{/if}{/strip}


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)
\$1:
<a href="{$sid}#disqus_thread" title='see the comments' data-disqus-identifier="{$sid}">&nbsp;</a>


Put this where you want the comments and form to appear:
\$1:
{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

\$1:
#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}


NOTE: I also have global form css, example:

\$1:
input[type="text"],input[type="password"],input[type="email"], input[type="tel"],input[type="url"],textarea,select {stylesgohere}


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.

$1:
Screen Shot 2012-06-17 at 3.45.08 PM.png
Screen Shot 2012-06-17 at 3.45.08 PM.png [ 424.44 KiB | Viewed 5121 times ]

$1:
Screen Shot 2012-06-17 at 3.45.34 PM.png
Screen Shot 2012-06-17 at 3.45.34 PM.png [ 603.85 KiB | Viewed 5121 times ]

$1:
Screen Shot 2012-06-17 at 3.44.39 PM.png
Screen Shot 2012-06-17 at 3.44.39 PM.png [ 356.64 KiB | Viewed 5121 times ]


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Disqus in the cgblog module
PostPosted: Sun Jun 17, 2012 8:36 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu Feb 08, 2007 6:11 pm
Posts: 506
Location: Florida
How to do the related posts thing for a post assigned to various categories:

viewtopic.php?f=4&t=61944


Last edited by carasmo on Sun Jul 29, 2012 3:15 pm, edited 1 time in total.

Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Disqus in the cgblog module
PostPosted: Sun Jun 17, 2012 8:41 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu Feb 08, 2007 6:11 pm
Posts: 506
Location: Florida
General settings uncheck the "enable reactions" to turn this off. It looks better.


Attachments:
Screen Shot 2012-06-17 at 4.40.41 PM.png
Screen Shot 2012-06-17 at 4.40.41 PM.png [ 92.15 KiB | Viewed 5117 times ]
Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Disqus in the cgblog module
PostPosted: Sun Jul 29, 2012 8:37 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu Feb 08, 2007 6:11 pm
Posts: 506
Location: Florida
BEFORE the following works you need this:

Also you will need the following BEFORE this works:

a DETAIL cgblog template in this case called "blogsearchresults"

\$1:
{capture assign='articleDate'}{$entry->postdate|cms_date_format}{/capture}

{capture assign="articleTitle"}{$entry->title}{/capture}

{capture assign="articleURL"}{$entry->canonical}{/capture}


Also, I encourage adjusting your search module template too. When a person searches my site, I want to take them to the exact page for the cgblog entry, not one with a "return id" in it. My return id is 74, yours is something else. If you currently click from a summary blog entry to the detail entry, you'll see something like:

\$1:
http://dropsoul.com/blog/36/Pure-CSS-Page-Curl-Effect.html

36 is the entry id

but if you find it through searching you'll get something like this:

\$1:
http://dropsoul.com/blog/36/74/...

74 is the return id

I don't want the return id because I have disqus running the comments and I also have other things like FaceBook's open graph where the url must be the same. Therefore my SEARCH template looks like this:

\$1:
<h1 class="headline">{$searchresultsfor} &quot;{$phrase}&quot;</h1>
{if $itemcount > 0}
<ul>
  {foreach from=$results item=entry}

{if (empty($entry->module)) || ($entry->module != 'CGBlog')}
<li>{$entry->title} &mdash; <a href="{$entry->url}">{$entry->urltxt}</a></li>
{/if}

{*start blog*}
{if $entry->module == "CGBlog"}
<li>{$entry->title} &mdash;
{capture assign="results"}{CGBlog action=detail articleid=$entry->modulerecord detailpage="blog" detailtemplate='blogsearchresults'}{/capture}
<a href="{$articleURL|regex_replace:"/(\/)74/":""}">{$articleTitle}&mdash;{$articleDate}</a>
</li>
{/if}
{*end*}


{/foreach}
</ul>

{else}
  <p><strong>{$noresultsfound}</strong></p>
{/if}


see the line:

\$1:
<a href="{$articleURL|regex_replace:"/(\/)74/":""}">{$articleTitle}&mdash;{$articleDate}</a>


that 74 is replaced with your own return id the detail page "blog" is also replaced with your own detail page where your blog is located.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting