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 3728 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: 163
Offline Offline

Gender: Male
Posts: 2161



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: 163
Offline Offline

Gender: Male
Posts: 2161



WWW
« Reply #3 on: May 30, 2012, 14:44:24 »

Can you tell how to do this in version 2.3.0?
In my mind it would be same just changed path to /components/com_jcomments/models/jcomments.php
Logged

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

Karma: 0
Offline Offline

Posts: 1


« Reply #4 on: May 08, 2013, 00:25:34 »

Hi smart, i tried to use your advise for v. 2.3.0
but

1)     $where = array();

is present twice (so what ?)

2)  
       $query = "SELECT count(*) "
       ."\nFROM #__jcomments "
       ."\nWHERE object_id = ".$object_id
       ."\nAND object_group = '".$db->getEscaped($object_group)."'"

is not easy to find (maybe it was modified?)


Thanks
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: