By Steve on Thursday, 05 July 2012
Posted in General Issues
Replies 10
Likes 0
Views 1.8K
Votes 0
I am using the latest version of EasyBlog, 3.5.11974. I use Disqus for comments. I also use the Joomlaworks Disqus content plugin for Disqus elsewhere on my site and the Disqus application for Sobipro as well that only works with Sobipro. The issue I have is that I get an error when accessing my blog pages. I get the following error at the top of the page whenever I access an EasyBlog page if the Joomlaworks plugin is DISABLED:
Notice: Trying to get property of non-object in /FULLSITEPATH/plugins/system/jw_disqus/jw_disqus.php on line 65


If the Joomlaworks plugin is ENABLED I get this error just under the front-end toolbar of EasyBlog:
Notice: Undefined property: TableBlog::$access in /home/shess/public_html/singersvillage/plugins/content/jw_disqus/jw_disqus.php on line 155 Notice: Undefined variable: itemURL in /home/shess/public_html/singersvillage/plugins/content/jw_disqus/jw_disqus.php on line 170 Notice: Undefined variable: itemURL in /home/shess/public_html/singersvillage/plugins/content/jw_disqus/jw_disqus.php on line 171 Notice: Undefined property: TableBlog::$access in /home/shess/public_html/singersvillage/plugins/content/jw_disqus/jw_disqus.php on line 155 Notice: Undefined variable: itemURL in /home/shess/public_html/singersvillage/plugins/content/jw_disqus/jw_disqus.php on line 170 Notice: Undefined variable: itemURL in /home/shess/public_html/singersvillage/plugins/content/jw_disqus/jw_disqus.php on line 171 Notice: Undefined property: TableBlog::$access in /home/shess/public_html/singersvillage/plugins/content/jw_disqus/jw_disqus.php on line 155 Notice: Undefined variable: itemURL in /home/shess/public_html/singersvillage/plugins/content/jw_disqus/jw_disqus.php on line 170 Notice: Undefined variable: itemURL in /home/shess/public_html/singersvillage/plugins/content/jw_disqus/jw_disqus.php on line 171


I don't get any errors anyplace else except the blog pages and all the commenting plugins function on my site. You can check the content plugin here:
http://www.singersvillage.com/index.php?option=com_content&view=article&id=69&Itemid=211

You can see the Sobipro plugin working here:
http://www.singersvillage.com/index.php?option=com_sobipro&pid=2&sid=1480:BOXCARS-Pub-and-Grub&Itemid=143

Any idea why I am having this issue? Thanks!
I am having the same issue.

I have a local xampp joomla 3.2.3 website setup. The latest versions of easblog and the latest disqus plugin. Now, disqus works inside of easyblog. But, when i use the disqus plugin on other pages, it causes my blog and the blog modules to throw errors. So it appears that the disqus plugin conflicts with easyblog.

Errors in easyblog page and the same errors on any easblog modules.
Notice: Undefined property: EasyBlogTableBlog::$access in F:\Dev_Websites\htdocs\ttg3\plugins\content\jw_disqus\jw_disqus.php on line 177
Notice: Undefined variable: itemURL in F:\Dev_Websites\htdocs\ttg3\plugins\content\jw_disqus\jw_disqus.php on line 198
Notice: Undefined variable: itemURL in F:\Dev_Websites\htdocs\ttg3\plugins\content\jw_disqus\jw_disqus.php on line 199
·
Saturday, 15 March 2014 06:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Rodney,

The reason is because the plugin that you are using strictly enforces to be used in Joomla articles only and did not perform additional checks of the origin of the item. Hence, it is throwing errors since it is trying to access it like an article object.

There's 3 ways to fix your errors:

1. Turn off error reporting (Since these are not fatal errors, it's safe to turn off error reporting)
2. Contact the original plugin developer to add a check to determine the origin of the item (Best way to resolve this issue, so you wont hit this any longer)
3. If the developer is reluctant to fix this, then provide us with the access and FTP to the site so that we can fix it for them (Only if they are too lazy to fix their own stuffs)
·
Saturday, 15 March 2014 14:29
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you for your reply. Let me add a few more details and then ask some follow up questions.

1) I currently have the latest easyblog software running on my website found here: www.theturngroup.com
2) I have disqus comments turned on within easyblog
3) I also have the disqus plugin working on the website.
4) I created an article category called "comment pages" and any pages that I want disqus to show up on I assign those pages to the "comment pages" category
5) I have the disqus plugin instructed to only show up on the selected category "comment pages"

It is working perfectly as it should.

Problem
1) I built a brand new site in Joomla 3.2.3
2) Installed the latest easblog software
3) I have disqus comments turned on within easyblog
4) I have the EXACT same setup as above on my localhost dev site
5) and it throws the aforementioned errors in my last post to you.

My Theory
The latest disqus plugin has been changed and now conflicts with easyblog and easyblog modules.

Your suggestion was to either 1) turn off error reporting, 2) contact the disqus plugin maker or 3) have you all fix it.

More troubleshooting questions
1) Could it be throwing the error because I am on a localhost? This never happened before so not sure this is a viable problem.
2) Since it is on the localhost and I am sure others have the same problem, and since it is apparently the JoomlaWorks Disqus comment plugin V3.4, could you be so kind as to explain how i can fix it since I cannot give you access?

Thank you a head of time for your detailed response.
·
Saturday, 15 March 2014 14:43
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Rodney,

I am really sorry for the delay of this reply as it is a weekend for us here. It's throwing errors because probably your local environment configured the error reporting to report on everything (E_ALL) . The plugin that you are using is not related to the Disqus settings that is available in EasyBlog. That particular settings in EasyBlog renders the Disqus that is generated within EasyBlog.

Perhaps you can upload the file F:\Dev_Websites\htdocs\ttg3\plugins\content\jw_disqus\jw_disqus.php here and I will check their codes.
·
Saturday, 15 March 2014 23:49
·
0 Likes
·
0 Votes
·
0 Comments
·
<?php
/**
* @version 3.4
* @package DISQUS Comments for Joomla! (package)
* @author JoomlaWorks - http://www.joomlaworks.net
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
*/

// no direct access
defined('_JEXEC') or die ;

jimport('joomla.plugin.plugin');
if (version_compare(JVERSION, '1.6.0', 'ge'))
{
jimport('joomla.html.parameter');
}

class plgContentJw_disqus extends JPlugin
{

// JoomlaWorks reference parameters
var $plg_name = "jw_disqus";
var $plg_copyrights_start = "\n\n<!-- JoomlaWorks \"DISQUS Comments for Joomla!\" (v3.4) starts here -->\n";
var $plg_copyrights_end = "\n\n<!-- JoomlaWorks \"DISQUS Comments for Joomla!\" (v3.4) ends here -->\n";

function plgContentJw_disqus(&$subject, $params)
{
parent::__construct($subject, $params);

// Define the DS constant under Joomla! 3.0
if (!defined('DS'))
{
define('DS', DIRECTORY_SEPARATOR);
}
}

// Joomla! 1.5
function onPrepareContent(&$row, &$params, $page = 0)
{
$this->renderDisqus($row, $params, $page = 0);
}

// Joomla! 1.6+
function onContentPrepare($context, &$row, &$params, $page = 0)
{
$this->renderDisqus($row, $params, $page = 0);
}

// The main function
function renderDisqus(&$row, &$params, $page)
{

// API
$mainframe = JFactory::getApplication();
$document = JFactory::getDocument();
$user = JFactory::getUser();

// Assign paths
$sitePath = JPATH_SITE;
$siteUrl = JURI::root(true);

// Requests
$option = JRequest::getCmd('option');
$view = JRequest::getCmd('view');
$layout = JRequest::getCmd('layout');
$page = JRequest::getCmd('page');
$secid = JRequest::getInt('secid');
$catid = JRequest::getInt('catid');
$itemid = JRequest::getInt('Itemid');
if (!$itemid)
$itemid = 999999;

// Check if plugin is enabled
if (JPluginHelper::isEnabled('content', $this->plg_name) == false)
return;

// Load the plugin language file the proper way
JPlugin::loadLanguage('plg_content_'.$this->plg_name, JPATH_ADMINISTRATOR);

// Simple checks before parsing the plugin
$properties = get_object_vars($row);
if (!array_key_exists('catid', $properties))
return;
if (version_compare(JVERSION, '1.6.0', 'lt'))
{
if (!array_key_exists('sectionid', $properties))
return;
}
if (!$row->id || $option == 'com_rokdownloads')
return;

// ----------------------------------- Get plugin parameters -----------------------------------
$plugin = JPluginHelper::getPlugin('content', $this->plg_name);
$pluginParams = version_compare(JVERSION, '1.6.0', 'lt') ? new JParameter($plugin->params) : new JRegistry($plugin->params);

$disqusSubDomain = trim($pluginParams->get('disqusSubDomain', ''));
$disqusLanguage = $pluginParams->get('disqusLanguage');
$selectedCategories = $pluginParams->get('selectedCategories', '');
$selectedMenus = $pluginParams->get('selectedMenus', '');
$disqusListingCounter = $pluginParams->get('disqusListingCounter', 1);
$disqusArticleCounter = $pluginParams->get('disqusArticleCounter', 1);
$disqusDevMode = $pluginParams->get('disqusDevMode', 0);

// External parameter for controlling plugin layout within modules
if (!$params)
$params = version_compare(JVERSION, '1.6.0', 'lt') ? new JParameter(null) : new JRegistry(null);
$parsedInModule = $params->get('parsedInModule');

if (!$disqusSubDomain)
{
// Quick check before we proceed
// Fix: Add notice only one time in page...
if (!isset($this->noticeRaised))
{
$this->noticeRaised = true;
JError::raiseNotice('', JText::_('JW_DISQUS_PLEASE_ENTER_YOUR_DISQUS_SUBDOMAIN'));
}
return;
}
else
{
// Perform some parameter cleanups
$disqusSubDomain = str_replace(array(
'http://',
'.disqus.com/',
'.disqus.com'
), array(
'',
'',
''
), $disqusSubDomain);
}

// ----------------------------------- Before plugin render -----------------------------------

// Get the current category
$currectCategory = $row->catid;

// Define plugin category restrictions
$selectedCategories = (array)$selectedCategories;
if (sizeof($selectedCategories) == 1 && $selectedCategories[0] == '')
{
$categories[] = $currectCategory;
}
else
{
$categories = $selectedCategories;
}

// Define plugin menu restrictions
$selectedMenus = (array)$selectedMenus;
if (sizeof($selectedMenus) == 1 && $selectedMenus[0] == '')
{
$menus[] = $itemid;
}
else
{
$menus = $selectedMenus;
}

// ----------------------------------- Prepare elements -----------------------------------

// Includes
require_once (dirname(__FILE__).DS.$this->plg_name.DS.'includes'.DS.'helper.php');
require_once (JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');

// Output object
$output = new stdClass;

// Article URLs
$websiteURL = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "off") ? "https://".$_SERVER['HTTP_HOST'] : "http://".$_SERVER['HTTP_HOST'];

if (version_compare(JVERSION, '1.6.0', 'ge'))
{
$levels = $user->getAuthorisedViewLevels();
if (in_array($row->access, $levels))
{
if ($view == 'article')
{
$itemURL = $row->readmore_link;
}
else
{
$itemURL = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catid));
}
}
}
else
{
$itemURL = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid));
}

$itemURLbrowser = explode("#", $websiteURL.$_SERVER['REQUEST_URI']);
$itemURLbrowser = $itemURLbrowser[0];

// Article URL assignments
$output->itemURL = $websiteURL.$itemURL;
$output->itemURLrelative = $itemURL;
$output->itemURLbrowser = $itemURLbrowser;
$output->disqusIdentifier = substr(md5($disqusSubDomain), 0, 10).'_id'.$row->id;

// Fetch elements specific to the "article" view only
if (in_array($currectCategory, $categories) && in_array($itemid, $menus) && $option == 'com_content' && $view == 'article')
{
$output->comments = "
<div id=\"disqus_thread\"></div>
<script type=\"text/javascript\">
//<![CDATA[
var disqus_shortname = '".$disqusSubDomain."';
var disqus_url = '".$output->itemURL."';
var disqus_identifier = '".substr(md5($disqusSubDomain), 0, 10)."_id".$row->id."';
var disqus_developer = '".$disqusDevMode."';
var disqus_config = function(){
this.language = '{$disqusLanguage}';
};
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
//]]>
</script>
<noscript>
<a href=\"http://".$disqusSubDomain.".disqus.com/?url=ref\">".JText::_("JW_DISQUS_VIEW_THE_DISCUSSION_THREAD")."</a>
</noscript>
";
}

// ----------------------------------- Render the output -----------------------------------
if (in_array($currectCategory, $categories) && in_array($itemid, $menus))
{

if (!defined('JW_DISQUS'))
define('JW_DISQUS', true);

// Append head includes only when the document is in HTML mode
if (JRequest::getCmd('format') == 'html' || JRequest::getCmd('format') == '')
{

// CSS
$plgCSS = DisqusHelper::getTemplatePath($this->plg_name, 'css/template.css');
$plgCSS = $plgCSS->http;

$document->addStyleSheet($plgCSS);

// JS
if (version_compare(JVERSION, '1.6.0', 'ge'))
{
JHtml::_('behavior.framework');
}
else
{
JHTML::_('behavior.mootools');
}

if (!defined('JW_DISQUS_JS'))
{
$document->addScriptDeclaration("
window.addEvent('load',function(){
// Smooth Scroll
new SmoothScroll({
duration: 500
});
});
");
define('JW_DISQUS_JS', true);
}
}

if (($option == 'com_content' && $view == 'article') && $parsedInModule != 1)
{

// Fetch the template
ob_start();
$dsqArticlePath = DisqusHelper::getTemplatePath($this->plg_name, 'article.php');
$dsqArticlePath = $dsqArticlePath->file;
include ($dsqArticlePath);
$getArticleTemplate = $this->plg_copyrights_start.ob_get_contents().$this->plg_copyrights_end;
ob_end_clean();

// Output
$row->text = $getArticleTemplate;

}
else if ($disqusListingCounter && (($option == 'com_content' && ($view == 'frontpage' || $view == "featured" || $view == 'section' || $view == 'category')) || $parsedInModule == 1))
{

// Set '$row->text' to '$row->introtext' for J!1.6+
if (version_compare(JVERSION, '1.6.0', 'ge'))
$row->text = $row->introtext;

// Fetch the template
ob_start();
$dsqListingPath = DisqusHelper::getTemplatePath($this->plg_name, 'listing.php');
$dsqListingPath = $dsqListingPath->file;
include ($dsqListingPath);
$getListingTemplate = $this->plg_copyrights_start.ob_get_contents().$this->plg_copyrights_end;
ob_end_clean();

// Output
$row->text = $getListingTemplate;

}

} // END IF

} // END FUNCTION

} // END CLASS
·
Sunday, 16 March 2014 04:18
·
0 Likes
·
0 Votes
·
0 Comments
·
Try modifying the codes below:


function onContentPrepare($context, &$row, &$params, $page = 0)
{
$this->renderDisqus($row, $params, $page = 0);
}


To,


function onContentPrepare($context, &$row, &$params, $page = 0)
{
if (JRequest::getVar('option') == 'com_easyblog')
{
return;
}
$this->renderDisqus($row, $params, $page = 0);
}
·
Sunday, 16 March 2014 13:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you so much for working thru this with me. You are a testament to "quality customer service".
·
Monday, 17 March 2014 08:00
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome Rodney
·
Monday, 17 March 2014 10:32
·
0 Likes
·
0 Votes
·
0 Comments
·
OK, so a new problem has arose from the code you sent me that i just noticed.

But let me give you an update. I have problem in 3 area's.

1) Home Page Latest Blog Module Feed
2) Blog Page
3) Blog Page Right Side Latest Blog Module Feed

The code removed all errors from the items one and 2. What has me confused is the latest blog module is the same type module uses on the home page as it is on the blog page. That module throws no errors, but it does on the home page.

Here are the new errors in the module:

Notice: Undefined property: EasyBlogTableBlog::$access in F:\Dev_Websites\htdocs\ttg3\plugins\content\jw_disqus\jw_disqus.php on line 181
Notice: Undefined variable: itemURL in F:\Dev_Websites\htdocs\ttg3\plugins\content\jw_disqus\jw_disqus.php on line 202
Notice: Undefined variable: itemURL in F:\Dev_Websites\htdocs\ttg3\plugins\content\jw_disqus\jw_disqus.php on line 203

My code with your modification

<?php
/**
* @version 3.4
* @package DISQUS Comments for Joomla! (package)
* @author JoomlaWorks - http://www.joomlaworks.net
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
*/

// no direct access
defined('_JEXEC') or die ;

jimport('joomla.plugin.plugin');
if (version_compare(JVERSION, '1.6.0', 'ge'))
{
jimport('joomla.html.parameter');
}

class plgContentJw_disqus extends JPlugin
{

// JoomlaWorks reference parameters
var $plg_name = "jw_disqus";
var $plg_copyrights_start = "\n\n<!-- JoomlaWorks \"DISQUS Comments for Joomla!\" (v3.4) starts here -->\n";
var $plg_copyrights_end = "\n\n<!-- JoomlaWorks \"DISQUS Comments for Joomla!\" (v3.4) ends here -->\n";

function plgContentJw_disqus(&$subject, $params)
{
parent::__construct($subject, $params);

// Define the DS constant under Joomla! 3.0
if (!defined('DS'))
{
define('DS', DIRECTORY_SEPARATOR);
}
}

// Joomla! 1.5
function onPrepareContent(&$row, &$params, $page = 0)
{
$this->renderDisqus($row, $params, $page = 0);
}

// Joomla! 1.6+
function onContentPrepare($context, &$row, &$params, $page = 0)
{
if (JRequest::getVar('option') == 'com_easyblog')
{
return;
}
$this->renderDisqus($row, $params, $page = 0);
}

// The main function
function renderDisqus(&$row, &$params, $page)
{

// API
$mainframe = JFactory::getApplication();
$document = JFactory::getDocument();
$user = JFactory::getUser();

// Assign paths
$sitePath = JPATH_SITE;
$siteUrl = JURI::root(true);

// Requests
$option = JRequest::getCmd('option');
$view = JRequest::getCmd('view');
$layout = JRequest::getCmd('layout');
$page = JRequest::getCmd('page');
$secid = JRequest::getInt('secid');
$catid = JRequest::getInt('catid');
$itemid = JRequest::getInt('Itemid');
if (!$itemid)
$itemid = 999999;

// Check if plugin is enabled
if (JPluginHelper::isEnabled('content', $this->plg_name) == false)
return;

// Load the plugin language file the proper way
JPlugin::loadLanguage('plg_content_'.$this->plg_name, JPATH_ADMINISTRATOR);

// Simple checks before parsing the plugin
$properties = get_object_vars($row);
if (!array_key_exists('catid', $properties))
return;
if (version_compare(JVERSION, '1.6.0', 'lt'))
{
if (!array_key_exists('sectionid', $properties))
return;
}
if (!$row->id || $option == 'com_rokdownloads')
return;

// ----------------------------------- Get plugin parameters -----------------------------------
$plugin = JPluginHelper::getPlugin('content', $this->plg_name);
$pluginParams = version_compare(JVERSION, '1.6.0', 'lt') ? new JParameter($plugin->params) : new JRegistry($plugin->params);

$disqusSubDomain = trim($pluginParams->get('disqusSubDomain', ''));
$disqusLanguage = $pluginParams->get('disqusLanguage');
$selectedCategories = $pluginParams->get('selectedCategories', '');
$selectedMenus = $pluginParams->get('selectedMenus', '');
$disqusListingCounter = $pluginParams->get('disqusListingCounter', 1);
$disqusArticleCounter = $pluginParams->get('disqusArticleCounter', 1);
$disqusDevMode = $pluginParams->get('disqusDevMode', 0);

// External parameter for controlling plugin layout within modules
if (!$params)
$params = version_compare(JVERSION, '1.6.0', 'lt') ? new JParameter(null) : new JRegistry(null);
$parsedInModule = $params->get('parsedInModule');

if (!$disqusSubDomain)
{
// Quick check before we proceed
// Fix: Add notice only one time in page...
if (!isset($this->noticeRaised))
{
$this->noticeRaised = true;
JError::raiseNotice('', JText::_('JW_DISQUS_PLEASE_ENTER_YOUR_DISQUS_SUBDOMAIN'));
}
return;
}
else
{
// Perform some parameter cleanups
$disqusSubDomain = str_replace(array(
'http://',
'.disqus.com/',
'.disqus.com'
), array(
'',
'',
''
), $disqusSubDomain);
}

// ----------------------------------- Before plugin render -----------------------------------

// Get the current category
$currectCategory = $row->catid;

// Define plugin category restrictions
$selectedCategories = (array)$selectedCategories;
if (sizeof($selectedCategories) == 1 && $selectedCategories[0] == '')
{
$categories[] = $currectCategory;
}
else
{
$categories = $selectedCategories;
}

// Define plugin menu restrictions
$selectedMenus = (array)$selectedMenus;
if (sizeof($selectedMenus) == 1 && $selectedMenus[0] == '')
{
$menus[] = $itemid;
}
else
{
$menus = $selectedMenus;
}

// ----------------------------------- Prepare elements -----------------------------------

// Includes
require_once (dirname(__FILE__).DS.$this->plg_name.DS.'includes'.DS.'helper.php');
require_once (JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');

// Output object
$output = new stdClass;

// Article URLs
$websiteURL = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "off") ? "https://".$_SERVER['HTTP_HOST'] : "http://".$_SERVER['HTTP_HOST'];

if (version_compare(JVERSION, '1.6.0', 'ge'))
{
$levels = $user->getAuthorisedViewLevels();
if (in_array($row->access, $levels))
{
if ($view == 'article')
{
$itemURL = $row->readmore_link;
}
else
{
$itemURL = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catid));
}
}
}
else
{
$itemURL = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid));
}

$itemURLbrowser = explode("#", $websiteURL.$_SERVER['REQUEST_URI']);
$itemURLbrowser = $itemURLbrowser[0];

// Article URL assignments
$output->itemURL = $websiteURL.$itemURL;
$output->itemURLrelative = $itemURL;
$output->itemURLbrowser = $itemURLbrowser;
$output->disqusIdentifier = substr(md5($disqusSubDomain), 0, 10).'_id'.$row->id;

// Fetch elements specific to the "article" view only
if (in_array($currectCategory, $categories) && in_array($itemid, $menus) && $option == 'com_content' && $view == 'article')
{
$output->comments = "
<div id=\"disqus_thread\"></div>
<script type=\"text/javascript\">
//<![CDATA[
var disqus_shortname = '".$disqusSubDomain."';
var disqus_url = '".$output->itemURL."';
var disqus_identifier = '".substr(md5($disqusSubDomain), 0, 10)."_id".$row->id."';
var disqus_developer = '".$disqusDevMode."';
var disqus_config = function(){
this.language = '{$disqusLanguage}';
};
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
//]]>
</script>
<noscript>
<a href=\"http://".$disqusSubDomain.".disqus.com/?url=ref\">".JText::_("JW_DISQUS_VIEW_THE_DISCUSSION_THREAD")."</a>
</noscript>
";
}

// ----------------------------------- Render the output -----------------------------------
if (in_array($currectCategory, $categories) && in_array($itemid, $menus))
{

if (!defined('JW_DISQUS'))
define('JW_DISQUS', true);

// Append head includes only when the document is in HTML mode
if (JRequest::getCmd('format') == 'html' || JRequest::getCmd('format') == '')
{

// CSS
$plgCSS = DisqusHelper::getTemplatePath($this->plg_name, 'css/template.css');
$plgCSS = $plgCSS->http;

$document->addStyleSheet($plgCSS);

// JS
if (version_compare(JVERSION, '1.6.0', 'ge'))
{
JHtml::_('behavior.framework');
}
else
{
JHTML::_('behavior.mootools');
}

if (!defined('JW_DISQUS_JS'))
{
$document->addScriptDeclaration("
window.addEvent('load',function(){
// Smooth Scroll
new SmoothScroll({
duration: 500
});
});
");
define('JW_DISQUS_JS', true);
}
}

if (($option == 'com_content' && $view == 'article') && $parsedInModule != 1)
{

// Fetch the template
ob_start();
$dsqArticlePath = DisqusHelper::getTemplatePath($this->plg_name, 'article.php');
$dsqArticlePath = $dsqArticlePath->file;
include ($dsqArticlePath);
$getArticleTemplate = $this->plg_copyrights_start.ob_get_contents().$this->plg_copyrights_end;
ob_end_clean();

// Output
$row->text = $getArticleTemplate;

}
else if ($disqusListingCounter && (($option == 'com_content' && ($view == 'frontpage' || $view == "featured" || $view == 'section' || $view == 'category')) || $parsedInModule == 1))
{

// Set '$row->text' to '$row->introtext' for J!1.6+
if (version_compare(JVERSION, '1.6.0', 'ge'))
$row->text = $row->introtext;

// Fetch the template
ob_start();
$dsqListingPath = DisqusHelper::getTemplatePath($this->plg_name, 'listing.php');
$dsqListingPath = $dsqListingPath->file;
include ($dsqListingPath);
$getListingTemplate = $this->plg_copyrights_start.ob_get_contents().$this->plg_copyrights_end;
ob_end_clean();

// Output
$row->text = $getListingTemplate;

}

} // END IF

} // END FUNCTION

} // END CLASS


Interesting result: When i add a semicolon to your code at the end of the com_easblog it fixed my problem but breaks the disqus plugin:
function onContentPrepare($context, &$row, &$params, $page = 0)
{
if (JRequest::getVar('option') == 'com_easyblog');
{
return;
}
$this->renderDisqus($row, $params, $page = 0);
}
·
Wednesday, 19 March 2014 11:10
·
0 Likes
·
0 Votes
·
0 Comments
·
Try to replace the codes below,


function onContentPrepare($context, &$row, &$params, $page = 0)
{


With,


function onContentPrepare($context, &$row, &$params, $page = 0)
{
if ($context == 'com_easyblog') {
return;
}


But to be honest, these isn't an issue with EasyBlog altogether. You need to get in touch with the person that developed this plugin to add a specific check so that it only processes what is supported by their plugin.
·
Wednesday, 19 March 2014 11:56
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post