|
|
|
jomcomment integration 1 Year, 3 Months ago
|
|
To add karma2 to jomcomment, add this following snippet of code to /components/jom_comment/main.jomcomment.php -- This starts with the switch case statement in line 638. Add the following after line 657 | Code: : |
global $mainframe,$my;
require_once( $mainframe->getCfg('absolute_path') . '/components/com_karma/karma.class.php');
$points = CLASS_karma::getConfig("Custom2");
CLASS_karma::addPoints($my->id, 5, "Comment Submission");
|
| Code: : |
switch ($status) {
case JC_STATUS_OK :
$styles = explode(",", $_JC_CONFIG->get('cyclestyle'));
array_walk($styles, "jcTrim");
$numstyle = count($styles);
$styleCount = $this->_dataMgr->getNumComment($data->contentid, $data->option);
$count = $styleCount;
$style = $styleCount % $numstyle;
// Need to make sure that hidden value is set to false to make sure this comment gets shown
// Otherwise, it will be marked as 'lowly rated comment'
$data->hidden = false;
$newComment = $this->_viewMgr->getCommentsHTML($data);
$newComment = $this->_viewMgr->_cleaupOutput($newComment);
$objResponse->addAssign('jc_busyDiv', 'innerHTML', $responseMsg);
$objResponse->addscriptCall("jc_insertNewEntry", $newComment, "pc_" . $data->id);
$objResponse->addClear('jc_comment', 'value');
$objResponse->addClear('jc_title', 'value');
$objResponse->addAssign('jc_numComment', 'innerHTML', $this->_dataMgr->getNumComment($data->contentid, $data->option));
global $mainframe,$my;
require_once( $mainframe->getCfg('absolute_path') . '/components/com_karma/karma.class.php');
$points = CLASS_karma::getConfig("Custom2");
CLASS_karma::addPoints($my->id, 5, "Comment Submission");
break;
|
|
|
|
|
|
|
|
|
|
|
|
Re:jomcomment integration 1 Year, 3 Months ago
|
|
MindArchr wrote:Here's an alternative in case the above does not work:
On line 306, where it shows:
| Code: : | function ajaxAddComment($xajaxArgs) {
| right under *Add a new comment
add the following:
| Code: : | global $mainframe,$my;
require_once( $mainframe->getCfg('absolute_path') . '/components/com_karma/karma.class.php');
$points = CLASS_karma::getConfig("Custom3");
CLASS_karma::addPoints($my->id, 5, "Posted A Comment");
|
so that it displays like:
| Code: : | /**
* Add a new comment
*/
function ajaxAddComment($xajaxArgs) {
global $mainframe,$my;
require_once( $mainframe->getCfg('absolute_path') . '/components/com_karma/karma.class.php');
$points = CLASS_karma::getConfig("Custom3");
CLASS_karma::addPoints($my->id, 5, "Posted A Comment");
error_reporting(E_ALL);
global $_JC_CONFIG, $mainframe;
$this->cms->load('libraries','user');
$this->cms->load('libraries', 'input');
|
Again, this is only an alternative method if the above one does not work. This is for JomComment version 2.2 Build 536 and these changes can be implemented in the same file (main.jomcomment.php)
|
|
|
|
|
|
|
|
|
|
|
Re:jomcomment integration 8 Months, 1 Week ago
|
|
MindArchr wrote:MindArchr wrote: Here's an alternative in case the above does not work:
On line 306, where it shows:
| Code: : | function ajaxAddComment($xajaxArgs) {
| right under *Add a new comment
add the following:
| Code: : | global $mainframe,$my;
require_once( $mainframe->getCfg('absolute_path') . '/components/com_karma/karma.class.php');
$points = CLASS_karma::getConfig("Custom3");
CLASS_karma::addPoints($my->id, 5, "Posted A Comment");
|
so that it displays like:
| Code: : | /**
* Add a new comment
*/
function ajaxAddComment($xajaxArgs) {
global $mainframe,$my;
require_once( $mainframe->getCfg('absolute_path') . '/components/com_karma/karma.class.php');
$points = CLASS_karma::getConfig("Custom3");
CLASS_karma::addPoints($my->id, 5, "Posted A Comment");
error_reporting(E_ALL);
global $_JC_CONFIG, $mainframe;
$this->cms->load('libraries','user');
$this->cms->load('libraries', 'input');
|
Again, this is only an alternative method if the above one does not work. This is for JomComment version 2.2 Build 536 and these changes can be implemented in the same file (main.jomcomment.php)
|
|
|
|
|
|
|
|
|