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    CommunityBuilder    Topic: Jcomment as Community Builder Profilebook
Pages: [1]   Go Down
  Print  
Author Topic: Jcomment as Community Builder Profilebook  (Read 47301 times)
0 Members and 1 Guest are viewing this topic.
Fletsch
Guest
« on: October 12, 2008, 16:44:28 »

Hi all

Is it possible to use JComments as CB Profilebook? I want that users can leave comments on profiles with JComment. Alternative to the Profilebook Tab or just at the bottom of the profile site. Should be a similar Integration like in other 3th party components I think. But I don't get it to work, becaus i'm to bad in php. Would be a verry cool integration an di'm sure it is done in a few minutes for someone who can code.


Greetings fletsch
 
Logged
Fletsch
Guest
« Reply #1 on: October 12, 2008, 17:06:44 »

Okey i tried this one and it works.

Code:
global $mosConfig_absolute_path;;
$comments = $mosConfig_absolute_path . '/components/com_jcomments/jcomments.php';
if (file_exists($comments))
require_once($comments);
$return .= JComments::showComments($user->id, 'com_comprofiler');

Can someone explane me this line please?:

Code:
JComments::showComments($user->id, 'com_comprofiler');

What are the variables normaly set before and after the component name (com_comprofiler)?
What are they used for? Now I just inserted $user->id and i think thats the profile id. Shoud I set something for the second variable?

Anyway it works so far.

Now I want to link the usernames of a comment to the CB profile. Is there any solution?
« Last Edit: October 12, 2008, 19:23:07 by Fletsch » Logged
smart
Administrator
Hero Member
*****

Karma: 187
Offline Offline

Gender: Male
Posts: 1883



WWW
« Reply #2 on: October 18, 2008, 00:35:08 »

See documentation: How to display the comments
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
robertbseattle
Guest
« Reply #3 on: January 29, 2009, 03:31:56 »

Havn't tried this yet but lloks promising.  So you can actually have a JComments tab that functions like CB profilebook?  Can someone please confirm before I get to work on this. 
Logged
Fletsch
Guest
« Reply #4 on: February 22, 2009, 21:32:12 »

Havn't tried this yet but lloks promising.  So you can actually have a JComments tab that functions like CB profilebook?  Can someone please confirm before I get to work on this. 

Yes it would be promising. But I forgot, that only writers can delete their own comments. To use JComments as a real Profilebook alternative the profileowner should also be able to delete comments made on his profile. So if anyone would find a solution for that right management it would be a cool alternative. but so long you can't use jcomments as profilebook on cb.
Logged
Cypher
Newbie
*

Karma: 0
Offline Offline

Posts: 1


« Reply #5 on: February 04, 2010, 21:04:55 »

Hi,

i also want jcomments use as a profilebook in community builder, but do not really know where i´ve to put the code into and what files i have to create and to edit. i hope someone can post a short step by step tutorial. that would be nice.

the developer manual is nice, but i am more a beginner in developing.

i am using community builder 1.2.1

thx in advance
cypher
Logged
Wiz
Newbie
*

Karma: 0
Offline Offline

Posts: 9


« Reply #6 on: February 27, 2010, 21:07:14 »

any news on this?  Huh  Grin
Logged
KejeN
Newbie
*

Karma: 1
Offline Offline

Posts: 3


« Reply #7 on: November 16, 2010, 23:32:03 »

Hi,
I've came to same idea as you guys and solved it.
It requires small changes in component's code so the owner of the profil can delete any comments on his profile.

EDIT: I've published a package with this solution so there's no need to quote the code of plugins on forum:)



And the changes in component's code I've mentioned is in jcomments.class.php about line 256:

Code:
function canDelete($obj)
{
return (($this->canDelete || ($this->canDeleteOwn && ($obj->userid == $this->userID)))
&& (!$this->isLocked($obj))) ? 1 : 0;
}

make it look like this:

Code:
function canDelete($obj)
{
return (($this->canDelete || ($obj->object_id == $this->userID && $obj->object_group == 'com_comprofiler')
|| ($this->canDeleteOwn && ($obj->userid == $this->userID)))
&& (!$this->isLocked($obj))) ? 1 : 0;
}

« Last Edit: December 04, 2010, 23:44:04 by KejeN » Logged
fabidoc78
Newbie
*

Karma: 0
Offline Offline

Posts: 2


« Reply #8 on: December 01, 2010, 11:06:21 »

Thanks much KejeN.

But as my knowledge of joomla and php generally is a bit limited could you just give more specific info as to where the codes of cb plugin and jcomments plugin should be inserted to have this working. I tried different things but have not gotten anything to work.

Thank you so much. I appreciate your speedy reply.
Logged
KejeN
Newbie
*

Karma: 1
Offline Offline

Posts: 3


« Reply #9 on: December 01, 2010, 18:43:24 »

Hi,
Download this package
Unzip it and follow this instruction (placed also in READ_ME file in package) :
Quick instruction:

1. Paste file 'com_comprofiler.plugin.php' placed in dir: 'Jcomments plugin' to Jcomments plugin dir: '\components\com_jcomments\plugins' - We gotta do it by ftp client.

2. Instal CB plugin(CB_koment-tab_by_Jcomments.zip) placed in dir: 'CB plugin' by CB's instalator.

3. To allow profile owner delete any comment on his profile yo must edit file 'jcomments.class.php' which is placed in Jcomments frontend dir: \components\com_jcomments. Find about 256 line function 'canDelete' ,which looks like this:

Code:
function canDelete($obj)
{
return (($this->canDelete || ($this->canDeleteOwn && ($obj->userid == $this->userID)))
&& (!$this->isLocked($obj))) ? 1 : 0;
}

Remember to save a copy of orginal file before editing in case of any problems.Edit this function with for example Notepad++ to look like below :

Code:
function canDelete($obj)
{
return (($this->canDelete || ($obj->object_id == $this->userID && $obj->object_group == 'com_comprofiler')
|| ($this->canDeleteOwn && ($obj->userid == $this->userID)))
&& (!$this->isLocked($obj))) ? 1 : 0;
}

4. Now turn on instaled in 2nd point Cb plugin and publish tab created by it.

That's all. If everything done correctly you have Cb profile comments tab by Jcomments.

The weak point of this solution is that you will have to edit jcomments.class after every update of component..
« Last Edit: December 04, 2010, 23:45:02 by KejeN » Logged
fabidoc78
Newbie
*

Karma: 0
Offline Offline

Posts: 2


« Reply #10 on: December 02, 2010, 16:14:51 »

Thank you so much KejeN.
I will get right on it.
Logged
Wiz
Newbie
*

Karma: 0
Offline Offline

Posts: 9


« Reply #11 on: December 06, 2010, 10:28:13 »

Hi KejeN,

It works great, thanks very much... Cheesy

For a better privacy, just wanna ask how to make only 'CB Connections' can leave a comment...and if possible, a notification on a new comment into PMS uddeim...  Grin
Logged
mazao
Newbie
*

Karma: 1
Offline Offline

Posts: 2


« Reply #12 on: June 20, 2011, 12:49:54 »

Hi all

Is it possible to use JComments as CB Profilebook? I want that users can leave comments on profiles with JComment. Alternative to the Profilebook Tab or just at the bottom of the profile site. Should be a similar Integration like in other 3th party components I think. But I don't get it to work, becaus i'm to bad in php. Would be a verry cool integration an di'm sure it is done in a few minutes for someone who can code.


Greetings fletsch
 

This might be too late for this thread but i found a solution. I integrate Jcomment in CB Profile as well as other 3rd party component. Here is the code for com_comprofiler.plugin.php
Code:
class jc_com_comprofiler extends JCommentsPlugin
{
     function getTitles($ids)
{
$db = & JCommentsFactory::getDBO();
$db->setQuery( "SELECT CONCAT(username,'\'s Profile') AS title FROM #__users WHERE id IN (' . implode(',', $ids) . ')" );
return $db->loadObjectList('id');
}
function getObjectTitle($id)
{
$db = & JCommentsFactory::getDBO();
$db->setQuery( "SELECT CONCAT(username,'\'s Profile') AS title FROM #__users WHERE id = $id" );
return $db->loadResult();
}
 
function getObjectLink($id)
{
$_Itemid = JCommentsPlugin::getItemid( 'com_comprofiler' );
$link = JRoute::_( 'index.php?option=com_comprofiler&task=viewprofile&user='.$id.'&Itemid='. $_Itemid );
return $link;
}
 
}

And to show Jcomment at the bottom of CB Profile ,I insert this code to the end of static function userProfile . The function is located in comprofile.html.php
Code:
        $uid = urldecode( stripslashes( cbGetParam( $_GET, 'user', '' ) ) );
$comments = JPATH_SITE . DS .'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
if (file_exists($comments)) {
require_once($comments);
$cuser =& JFactory::getUser($uid);
//echo $uid.'------'.$cuser->name.'<br/>'; //ok
$title = $cuser->username."'s Profile.";
echo JComments::showComments($uid, 'com_comprofiler', $title);
       }
Logged
ledirlo
Newbie
*

Karma: 0
Offline Offline

Posts: 9


« Reply #13 on: September 07, 2011, 07:34:54 »

awesome job it works perfectly congrats
Logged
smart
Administrator
Hero Member
*****

Karma: 187
Offline Offline

Gender: Male
Posts: 1883



WWW
« Reply #14 on: June 18, 2012, 13:12:42 »

The CB JComments Tab 2.0 has been released! This version allows to post comments in user's profile and if user has enough permissions he will be able to moderate comments.
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Integration with third-party extensions    CommunityBuilder    Topic: Jcomment as Community Builder Profilebook
 
Jump to: