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

Login with username, password and session length

JoomlaTune Support Forum    JComments component    Suggestions, Wishlists & Feature Requests    Topic: Make comments visible to comment author only
Pages: [1]   Go Down
  Print  
Author Topic: Make comments visible to comment author only  (Read 17480 times)
0 Members and 1 Guest are viewing this topic.
gadall
Newbie
*

Karma: 0
Offline Offline

Posts: 1


Email
« on: February 06, 2011, 01:27:13 »

I've created a legal reference library for a client of mine. My client in turn sells access to relevant sections of the library to their clients. I'm currently using flexicontent/flexiaccess to create/manage the library. However my client wants there to be a column in each law where each client can place their own annotations, with the stipulation that only the client that created the annotation can see it. I was hoping JComment could fulfill this task or be simply modified to accomplish this.
« Last Edit: February 11, 2011, 05:09:31 by gadall » Logged
smart
Administrator
Hero Member
*****

Karma: 188
Offline Offline

Gender: Male
Posts: 1883



WWW
« Reply #1 on: February 13, 2011, 23:04:59 »

So you want to have comments which will be visible only for their author? I do not know how to make this for certain category or object but I can explain how to make this for whole site.

You have to:

1. Open file /components/com_jcomments/model/jcomments.php
2. Find line:
Code: (php)
$where = array();
and add after:
Code: (php)
$where[] = "c.userid = " . $acl->getUserId();
3. Find code:
Code: (php)
$query = "SELECT count(*) "
."\nFROM #__jcomments "
."\nWHERE object_id = ".$object_id
."\nAND object_group = '".$db->getEscaped($object_group)."'"
and replace with
Code: (php)
$query = "SELECT count(*) "
."\nFROM #__jcomments "
."\nWHERE object_id = ".$object_id
."\nAND object_group = '".$db->getEscaped($object_group)."'"
."\nAND c.userid = " . $acl->getUserId();

This modification will restrict comments viewing by only user's own comments.
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
PauloOutor
Newbie
*

Karma: 0
Offline Offline

Posts: 1


Email
« Reply #2 on: April 15, 2012, 03:57:04 »

Hello,

Can you tell how to do this in version 2.3.0?

Thank you

Logged
smart
Administrator
Hero Member
*****

Karma: 188
Offline Offline

Gender: Male
Posts: 1883



WWW
« Reply #3 on: October 10, 2013, 14:31:11 »

For JComments 2.3 or JComments 3.0 you have make following:

1. Open file /components/com_jcomments/model/jcomments.php
2. Find lines:
Code: (php)
$userid = @$options['userid'];
replace with
Code: (php)
$userid = JCommentsFactory::getACL()->getUserId();
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
ssears
Newbie
*

Karma: 0
Offline Offline

Posts: 6


« Reply #4 on: October 10, 2013, 20:25:39 »

THANX!!!! That worked like a charm!
Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Suggestions, Wishlists & Feature Requests    Topic: Make comments visible to comment author only
 
Jump to: