HOWTO: Add Disqus commenting system AND show last Disqus comments HOWTO: Add Disqus commenting system AND show last Disqus comments
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

HOWTO: Add Disqus commenting system AND show last Disqus comments

Started by flapane, January 13, 2013, 10:36:17 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

flapane

I made a little modification to my gallery and thought I'd share it with you.
Social sharing plugin, http://forum.coppermine-gallery.net/index.php/topic,70221.0/nowap.html allows to enable Disqus commenting system.
All you have to do is register on Disqus and then create a new FORUM.
Then, copy the FORUM name in the Social Sharing Plugin (Disqus Shortname for the Disqus Comments function. Register with Disqus to get one.)

You're set! You can disable the plain old CPG commenting system and leave just DISQUS one.

However there's no way to show the last Disqus comments for the whole gallery.

This article ( http://aaronjwhite.org/index.php/component/content/article/5-php/18-updated-recent-comments-widget-in-php-for-disquss-api ) helped me to create a little php script that shows the last comments for a given Disqus FORUM.
Follow the instruction in the article (I repeat, please follow the instructions) and upload your script somewhere.

However, Coppermine menu still shows the link to the old cpg "recent comments".
You have to edit your theme.php and substitute
<a href="{LASTCOM_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{LASTCOM_LNK}">{LASTCOM_LNK}</a>

with

<a href="/your_lastcomments_script.php" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{LASTCOM_LNK}">{LASTCOM_LNK}</a>

This is the result on my website: http://www.flapane.com/gallery_lastcomments.php

I themed it with some css code:

<style type="text/css">
/*disqus - last comments su gallery coppermine*/
.dqCommentAvatar
{
  height:40px;
  width:40px;
}

.dqCommentThread
{ font-weight : bold; }

.dqCommentAuthor
{ font-weight : bold; }

div.dqAvatarWrap {
float: left;
padding-right:5px;
}

div.dqCommentMeta {
float: right;
}

div.dqCommentHead div.dqCommentMeta span.dqCommentTime {
    font-size: 10px;
}

div.dqCommentHead div.dqCommentMeta span {
    display: block;
}

div.dqCommentText { font-style : italic; }
</style>


Hope it helps. :)
Flapane
www.flapane.com

Gallery
www.gallery.flapane.com

flapane

Flapane
www.flapane.com

Gallery
www.gallery.flapane.com


plancast

Hi,

Could you let me know how to disable comments to allow Disqus to work?  Also, do a completely lose all previously made comments?

Thanks,

Chris

flapane

Yes, you loose all your comments.
You can manually create and import a Disqus backup file (check the Disqus documentation, I don't remember the exact steps), but it makes sense if you only have a bunch of comments.
Flapane
www.flapane.com

Gallery
www.gallery.flapane.com