forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: flapane on January 13, 2013, 10:36:17 pm

Title: HOWTO: Add Disqus commenting system AND show last Disqus comments
Post by: flapane on January 13, 2013, 10:36:17 pm
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
Code: [Select]
<a href="{LASTCOM_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{LASTCOM_LNK}">{LASTCOM_LNK}</a>
with

Code: [Select]
<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:
Code: [Select]
<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. :)
Title: Re: HOWTO: Add Disqus commenting system AND show last Disqus comments
Post by: flapane on January 13, 2013, 10:47:49 pm
Woops, I posted the article containing the old version of the script.
MODs please substitute the link in the original post with: http://aaronjwhite.org/index.php/component/content/article/5-php/18-updated-recent-comments-widget-in-php-for-disquss-api
Title: Re: HOWTO: Add Disqus commenting system AND show last Disqus comments
Post by: Αndré on January 17, 2013, 02:04:55 pm
MODs please substitute the link in the original post with: http://aaronjwhite.org/index.php/component/content/article/5-php/18-updated-recent-comments-widget-in-php-for-disquss-api

Done.
Title: Re: HOWTO: Add Disqus commenting system AND show last Disqus comments
Post by: plancast on March 27, 2015, 02:42:22 pm
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
Title: Re: HOWTO: Add Disqus commenting system AND show last Disqus comments
Post by: flapane on March 27, 2015, 06:40:13 pm
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.