- Posts: 1
COMMUNITY FORUM
- Forum
- Free Joomla Extensions & Templates
- DISQUS Comments for Joomla!
- Block Disqus from certain pages.
Block Disqus from certain pages.
- redmonds
- Topic Author
- Offline
- New Member
How do I block any commenting system from appearing on specific pages. IE Terms and COnditions/ Policy pages. I don;t want ratings (i worked this out) or comments for these pages.
Thanks
Ral
Please Log in or Create an account to join the conversation.
- monkeyman
- Offline
- New Member
- Posts: 4
For example, I have a certain category as menu item and I don't want to see Disqus only in some articles from this category. Can't do.
Please, add this feature. It's very easy to implement. Put something like {disqus off} in article and parse it with plugin.
Please Log in or Create an account to join the conversation.
- monkeyman
- Offline
- New Member
- Posts: 4
1. Open article.php in plugins/jw-disqus/tmpl folder and change everything BELOW "<!-- Disqus Comments -->" string on this:
<?php
$switchregex = "#{disqus (on|off)}#s";
if (strpos($row->text, '{disqus off}') === false )
{
echo preg_replace($switchregex, '', $row->text);
echo "<hr /><div class='jwDisqusForm'>".$output->comments."</div><div class='jwDisqusBackToTop'><a href='".$output->itemURL."#startOfPage'>".JText::_("back to top")."</a><div class='clr'></div></div><div class='clr'></div>";
}
else
{
echo preg_replace($switchregex, '', $row->text);
}
?>
2. Remove this ABOVE "<!-- Disqus Comments -->" string:
<?php echo $row->text; ?>
<hr />
3. Then if you want to disable Disqus comments, just put {disqus off} in any place of your article.
4. Enjoy!
Please Log in or Create an account to join the conversation.
- jason559
- Offline
- New Member
- Posts: 3
Please Log in or Create an account to join the conversation.
- monkeyman
- Offline
- New Member
- Posts: 4
Can't really say, man. Works pretty fine on me and should work on others. These changes are very simple actually.When I place "{disqus off}" (without quotes) in an article, I just get that same thing shown in the article. Am I doing something wrong? I made the changes to article.php
Please Log in or Create an account to join the conversation.
- jason559
- Offline
- New Member
- Posts: 3
My articles.php was located in /htdocs/plugins/content/jw_disqus/tmpl
Please Log in or Create an account to join the conversation.
- monkeyman
- Offline
- New Member
- Posts: 4
Yep, Joomla 1.5.22 here. Same folder as well.Just wanted to double check, are you using 1.5?
My articles.php was located in /htdocs/plugins/content/jw_disqus/tmpl
Try to change the whole code in your article.php to mine:
<?php
/*
// JoomlaWorks "Disqus Comment System" Plugin for Joomla! 1.5.x - Version 2.2
// Copyright (c) 2006 - 2009 JoomlaWorks Ltd. All rights reserved.
// Released under the GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
// More info at https://www.joomlaworks.net
// Designed and developed by the JoomlaWorks team
// ***Last update: November 14th, 2009***
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
?>
<span id="startOfPage"></span>
<?php if($disqusArticleCounter): ?>
<!-- Disqus comments counter and anchor link -->
<div class="jwDisqusArticleCounter">
<a class="jwDisqusArticleCounterLink" href="<?php echo $output->itemURL; ?>#disqus_thread"><?php echo JText::_('View Comments'); ?></a>
<div class="clr"></div>
</div>
<?php endif; ?>
<!-- Disqus Comments -->
<?php
$switchregex = "#{disqus (on|off)}#s";
if (strpos($row->text, '{disqus off}') === false )
{
echo preg_replace($switchregex, '', $row->text);
echo "<!--hr /--><div class='jwDisqusForm'>".$output->comments."</div><div class='jwDisqusBackToTop'><a href='".$output->itemURL."#startOfPage'>".JText::_("back to top")."</a><div class='clr'></div></div><div class='clr'></div>";
}
else
{
echo preg_replace($switchregex, '', $row->text);
}
?>
Please Log in or Create an account to join the conversation.
- jason559
- Offline
- New Member
- Posts: 3
Please Log in or Create an account to join the conversation.
- Forum
- Free Joomla Extensions & Templates
- DISQUS Comments for Joomla!
- Block Disqus from certain pages.