Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

JoomlaTune Support Forum    JComments component    Integration with third-party extensions    Topic: sobi2 integration
Pages: [1]   Go Down
  Print  
Author Topic: sobi2 integration  (Read 2198 times)
0 Members and 1 Guest are viewing this topic.
patrickus
Newbie
*

Karma: 0
Offline Offline

Posts: 2


Email
« on: March 19, 2011, 18:06:29 »

I'm using sobi2 with jcomments plugin plugin.
For my use, I need that the "submit comment" button only appears for the owner of the sobi entry.
The other logged users can read the comments, but only post on their own entries...

If anyone has a solution ...
I've looked around tpl_form.php  line 221 but I don't know how to make that.
Thx
(sorry for my english)

« Last Edit: March 21, 2011, 11:27:48 by patrickus » Logged
patrickus
Newbie
*

Karma: 0
Offline Offline

Posts: 2


Email
« Reply #1 on: March 21, 2011, 11:26:42 »

Found the solution!

In C:\wamp\www\xxx\components\com_jcomments\tpl\default\tpl_form.php
line 213 à 228
Replace :
Code:
<?php
   
}

   
/*
    *
    * Displays link to show comments form
    *
    */
   
function getCommentsFormLink()
   {
      
$object_id $this->getVar('comment-object_id');
      
$object_group $this->getVar('comment-object_group');
?>

<div id="comments-form-link">
<a id="addcomments" class="showform" href="#addcomments" onclick="jcomments.showForm(<?php echo $object_id?>,'<?php echo $object_group?>', 'comments-form-link'); return false;"><?php echo JText::_('FORM_HEADER'); ?></a>
</div>

by

Code:
<?php
}

/*
 *
 * Displays link to show comments form
 *
 */
        
function getCommentsFormLink()
{
$object_id $this->getVar('comment-object_id');
$object_group $this->getVar('comment-object_group');

?>


<?php
 
$user =& JFactory::getUser();
     
$user_id $user->get('id');
 $db = & JFactory::getDBO();
 $sql"SELECT owner FROM #__sobi2_item WHERE itemid = " .$sobi2Id=JRequest::getVar("sobi2Id") ;
 $db->setQuery($sql);
 $userid $db->loadResult();
     if( 
$user_id == $userid ) {
 
?>

    <div id="comments-form-link">
    <a id="addcomments" class="showform" href="#addcomments" onclick="jcomments.showForm(<?php echo $object_id?>,'<?php echo $object_group?>', 'comments-form-link'); return false;"><?php echo JText::_('FORM_HEADER'); ?></a>
<?php
}
?>

 </div>
« Last Edit: March 21, 2011, 19:28:30 by patrickus » Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Integration with third-party extensions    Topic: sobi2 integration
 
Jump to: