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: Max level /or min-width in JComments Tree layout
Pages: [1]   Go Down
  Print  
Author Topic: Max level /or min-width in JComments Tree layout  (Read 9160 times)
0 Members and 1 Guest are viewing this topic.
Fid3lity
Newbie
*

Karma: 0
Offline Offline

Posts: 2


« on: September 29, 2013, 14:47:05 »

This is an absolute must and going between these two options I'd prefer a "max level" solution. Is there any way to edit this into the code already? If not, it's a serious suggestion.
Logged
smart
Administrator
Hero Member
*****

Karma: 187
Offline Offline

Gender: Male
Posts: 1883



WWW
« Reply #1 on: September 30, 2013, 16:19:07 »

Solution 1
This style will remove left margin from all comments with level >= 3
Code: (php)
#comments .comments-list .comments-list .comments-list {margin-left: 0 !important;}

Soltuion 2
This solution disables Reply button in comments with level 3 so users will be not able to post replies to them and they will be not able to create 4th level of comments in tree.


I'm going to implement such option for restriction comments level, but not in nearest month.

Oh, we can try to make small modification:

1. Open file /components/com_jcomments/classes/acl.php (in old JComments versions - /components/com_jcomments/jcomments.class.php):
2. Find code:
Code: (php)
function canReply($obj = null)
{
if (is_null($obj)) {
return $this->canReply && !$this->commentsLocked;
} else {
return ($this->canReply && !$this->commentsLocked && (!isset($obj->_disable_reply)) && (!$this->isDeleted($obj))) ? 1 : 0;
}
}
and replace with:
Code: (php)
function canReply($obj = null)
{
if (is_null($obj)) {
return $this->canReply && !$this->commentsLocked;
} else {
return ($this->canReply && ($obj->level <= 3) && !$this->commentsLocked && (!isset($obj->_disable_reply)) && (!$this->isDeleted($obj))) ? 1 : 0;
}
}

I've added condition '($obj->level <= 3)' to pemissions check... You can change 3 to any value...
« Last Edit: September 30, 2013, 17:43:01 by smart » Logged

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

Karma: 0
Offline Offline

Posts: 2


« Reply #2 on: September 30, 2013, 17:36:16 »

Code: (php)
#comments .comments-list .comments-list .comments-list {margin-left: 0 !important;}
This style will remove left margin from all comments with level >= 3

Of course, thanks! Stupid I didn't figure this out earlier..
« Last Edit: September 30, 2013, 17:43:55 by smart » Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Suggestions, Wishlists & Feature Requests    Topic: Max level /or min-width in JComments Tree layout
 
Jump to: