Jom Comment: 3rd Party Component Integration
From AzrulStudio
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');
VirtueMart Integration
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");
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
- 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");
Pony Gallery
- Open up the file ponygallery.php
- Before the break; line add the following:
global $mosConfig_absolute_path; include_once($mosConfig_absolute_path. "/mambots/content/jom_comment_bot.php"); echo jomcomment($id, "com_ponygallery"); break;
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");
}
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();
}
