Personal tools
Jom Comment
MyBlog

Jom Comment: 3rd Party Component Integration

From AzrulStudio

Jump to: navigation, search

You can integrate Jom Comment with almost any 3rd party component, and it only takes 3 lines.

global $mosConfig_absolute_path;
include_once($mosConfig_absolute_path. "/mambots/content/jom_comment_bot.php");
echo jomcomment($uid, "com_whatever");

where

  • $uid: the unique id for the particular content
  • "com_whatever": the name of the component

Contents

Docman Integration

File to edit: "/components/com_docman/docman.php" Replace the 'showDocumentDetails' function at line 211 as follows:

function showDocumentDetails($gid)
{
    $html = new StdClass();
    $html->menu = fetchMenu($gid);
    $html->docdetails = fetchDocument($gid);

    HTML_docman::pageDocument($html);
    
    global $mosConfig_absolute_path;
    include_once($mosConfig_absolute_path. "/mambots/content/jom_comment_bot.php");
    echo jomcomment($gid, "com_docman");
}

Remository Integration

Version 3.3 and below

File to edit: "/components/com_remository/remository.php" Replace the 'fileinfo' function at line 203, before the end of the function:

function fileinfo ( &$file, &$remUser )
{
    // Some code ....

    global $mosConfig_absolute_path;
    include_once($mosConfig_absolute_path . '/mambots/content/jom_comment_bot.php');
    echo jomcomment($file->id, 'com_remository');
}


Version 3.4 and above

Add the code below at line 69; in /components/com_remository/c-classes/remository_fileinfo_controller.php

    global $mosConfig_absolute_path;
    include_once($mosConfig_absolute_path .'/mambots/content/jom_comment_bot.php');
    echo jomcomment($file->id, 'com_remository');

Integrating Remository with Joomla 1.5

Edit the file /components/com_remository/c-classes/remository_fileinfo_controller.php and uncomment the lines 78 - 79, then place the following block of codes

require_once($interface->getCfg('absolute_path').'/plugins/content/jom_comment_bot.php');
echo jomcomment($file->id, "com_remository");

VirtueMart Integration ( Joomla 1.0 )

File to edit: "/administrator/components/com_virtuemart/html/shop.product_details.php" Add the following lines, at line 318

include_once($mosConfig_absolute_path . "/mambots/content/jom_comment_bot.php");
$product_reviews = jomcomment($product_id, "com_virtuemart");

VirtueMart Integration ( Joomla 1.5 )

File to edit: "/administrator/components/com_virtuemart/html/shop.product_details.php" Add the following lines, at line 357

require_once( JPATH_PLUGINS . DS . 'content' . DS . 'jom_comment_bot.php' );
$product_reviews = jomcomment($product_id, "com_virtuemart");

HotProperty Integration

File to edit: "/components/com_hotproperty/hotproperty.php" Add the follong code at line 307:

global $mosConfig_absolute_path;
include_once($mosConfig_absolute_path. "/mambots/content/jom_comment_bot.php");
echo jomcomment($id, "com_hotproperty");

GroupJive

Creating the Output

  • Open up components/com_groupjive/groupjive.html.php
  • Scroll down to // create template output (around line 276)
  • Look for $tmpl->addVar( 'showfullmessage', 'GJ_POST', $d->post);
  • After this line add this:
include_once("mambots/content/jom_comment_bot.php");
$tmpl->addVar( 'showfullmessage', 'GJ_JOMCOMMENT', jomcomment($d->id, "com_groupjive") );

Adding the Comments to Your Template

  • Open up components/com_groupjive/templates/your-template/groupjive.tmpl
  • Scroll down to the section saying <mos:tmpl name="showfullmessage">
  • After {GJ_POST} you need to add {GJ_JOMCOMMENT}. If neccesary, add a new table row.

Thanks to [[1]]


Moset Tree

  • Open up components/com_mtree/mtree.php
  • Scroll down to around (line 1468)
  • Look for $cache->call( 'viewlink_cache', $link, $limitstart, $custom_fields, $params, $option );
  • After this line add this:
global $mosConfig_absolute_path;	include_once($mosConfig_absolute_path."/mambots/content/jom_comment_bot.php");
echo jomcomment($link->link_id, "com_mtree");

Joomla Polls ( Joomla 1.0 )

  • Open up the file JOOMLA/components/com_poll/poll.html.php
  • Scroll down to around (line 97)
  • Look for }
  • Before this line add this:
global $mosConfig_absolute_path;
include_once($mosConfig_absolute_path. "/mambots/content/jom_comment_bot.php");
echo jomcomment($poll->id, "com_poll");

Joomla Polls ( Joomla 1.5 )

  • Open up the file JOOMLA/components/com_poll/views/poll/tmpl/default.php
  • Scroll down to around (line 23)
  • Add the following block of codes,
<!-- JomComment -->
<div>
<?php
require_once( JPATH_PLUGINS . DS . 'content' . DS . 'jom_comment_bot.php');
echo jomcomment( $this->poll->id , 'com_poll' );
?>
</div>
<!-- End -->

Pony Gallery

  • Open up the file JOOMLA/components/com_ponygallery/sub_viewdetails.php
  • At around line 122, add the block of codes below,
global $mosConfig_absolute_path;
include_once($mosConfig_absolute_path. "/mambots/content/jom_comment_bot.php");
echo jomcomment($id, "com_ponygallery");

Jobline

  • Open up the file JOOMLA/components/com_jobline/jobline.php
  • Look for the following block of codes at around line 595 - 599
HTML_jobline::show( $row );
} else {
showError( _JL_ITEM_NOT_FOUND );
}
//Show Comments for each Posting
global $mosConfig_absolute_path;
include_once($mosConfig_absolute_path. "/mambots/content/jom_comment_bot.php");
echo jomcomment($row->id, "com_jobline");
}

Joom Gallery ( Joomla 1.5 )

  • Edit the file JOOMLA/components/com_joomgallery/includes/joom.viewdetails.php and at around line 191, look for the block of codes below,
if ( $jg_showcomment && !$slideshow)
{
HTML_Joom_Detail::Joom_ShowCommentsHead_HTML($allowcomment);
if ( $jg_showcommentsarea == 2 ) {
HTML_Joom_Detail::Joom_ShowCommentsArea_HTML($allowcomment);
HTML_Joom_Detail::Joom_BuildCommentsForm_HTML($allowcomment);
} else {
HTML_Joom_Detail::Joom_BuildCommentsForm_HTML($allowcomment);
HTML_Joom_Detail::Joom_ShowCommentsArea_HTML($allowcomment);
}
HTML_Joom_Detail::Joom_ShowCommentsEnd_HTML($allowcomment);
}

Replace it with the following,

if ( $jg_showcomment && !$slideshow)
{
// Jom Comment hack
require_once( JPATH_PLUGINS . DS . 'content' . DS . 'jom_comment_bot.php' );
echo jomcomment( $id  , 'com_joomgallery' );
// End Jom Comment hack
}

RSGallery2 version 1.14.3 (SVN 649)

  • Open up the file JOOMLA/components/com_rsgallery2/templates/semantic/display.class.php * Look for the following block of codes which should be at around line 381 onwards,
		if ( $rsgConfig->get("displayComments") ) {
			$tabs->startTab(_RSGALLERY_COMMENTS, 'Comments' );
			$this->_showComments();
			$tabs->endTab();
		}
</per>

Modify it so that it would look as below,

<pre>
		if ( $rsgConfig->get("displayComments") ) {
			global $mosConfig_absolute_path;
			include_once($mosConfig_absolute_path . '/components/com_jomcomment/mambots.php');
			$item = rsgInstance::getItem();
			echo jomcomment($item->id, 'com_rsgallery2');
			$tabs->startTab(_RSGALLERY_COMMENTS, 'Comments' );
			$this->_showComments();
			$tabs->endTab();
		}