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

Login with username, password and session length

JoomlaTune Support Forum    JComments component    General discussion    Topic: How to highlight an administrator's comment?
Pages: [1]   Go Down
  Print  
Author Topic: How to highlight an administrator's comment?  (Read 2434 times)
0 Members and 1 Guest are viewing this topic.
KiusteR
Newbie
*

Karma: 1
Offline Offline

Posts: 8


Email
« on: December 22, 2009, 05:02:30 »

I really need help to... (how do you say) HIGHLIGHT de admin comments. I mean... when visitors see the comments, can distinguish comments from others visitors to the comments of the manager.

Good com  Cheesy

Regards!
« Last Edit: December 22, 2009, 06:56:36 by smart » Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #1 on: December 22, 2009, 06:54:57 »

At current version it could be implemented via small hack.

Open /components/com_jcomments/jcomments.php and replace code (twice):

Code: (php)
."\n, v.value as voted"
."\nFROM #__jcomments AS c"
."\nLEFT JOIN #__jcomments_votes AS v ON c.id = v.commentid " . ( $my->id ? " AND  v.userid = ".$my->id : " AND  v.ip = '".$acl->getUserIP() . "'" )
with
Code: (php)
."\n, v.value as voted"
."\n, case when c.userid = 0 then 'guest' else replace(lower(u.usertype), ' ', '-') end as usertype"
."\nFROM #__jcomments AS c"
."\nLEFT JOIN #__jcomments_votes AS v ON c.id = v.commentid " . ( $my->id ? " AND  v.userid = ".$my->id : " AND  v.ip = '".$acl->getUserIP() . "'" )
."\nLEFT JOIN #__users AS u ON c.userid = u.id"

And after that you need edit template: /components/com_jcomments/tpl/default/tpl_comment.php:

Add after line:
Code: (php)
$commentBoxIndentStyle = ($this->getVar('avatar') == 1) ? ' avatar-indent' : '';
next code:
Code: (php)
if (isset($comment->usertype)) {
$commentBoxIndentStyle .= ' usertype-' . $comment->usertype;
}

After that all your comments will have additional style like: usertype-guest, usertype-registered, ..., usertype-administrator, usertype-super-administrator
« Last Edit: December 22, 2009, 07:26:36 by smart » Logged

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

Karma: 1
Offline Offline

Posts: 8


Email
« Reply #2 on: December 31, 2009, 05:41:48 »

Hi the first code appears 3 times on jcomments.php... I replace it in the 3??
Logged
KiusteR
Newbie
*

Karma: 1
Offline Offline

Posts: 8


Email
« Reply #3 on: December 31, 2009, 05:46:56 »

nononono.....it seems to me! it's ok  Grin

Now i prove it
Logged
KiusteR
Newbie
*

Karma: 1
Offline Offline

Posts: 8


Email
« Reply #4 on: December 31, 2009, 06:05:44 »

NOP....this don't work to me!  Embarrassed
Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #5 on: January 02, 2010, 02:47:59 »

It is very strange because same modification installed on demo.joomlatune.com and I can see that it working:

Code:
<div class="comment-box avatar-indent usertype-super-administrator">

If you want I can send you upcoming version where is this modification already applied.
Logged

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

Karma: 0
Offline Offline

Gender: Female
Posts: 3


223783
WWW Email
« Reply #6 on: February 29, 2012, 16:38:44 »

Searched for same functionality in Jcomments for J2.5, but above mentioned lines are not in jcomments,php anymore. Guess should be other way to do it.
 Only what I need is highlight specified user posts (admin), so users will be able to distinguish administrator comments.
I found short solution here http://joomquery.com/vi/wordpress/wordpress-tutorials/1938-highlight-author-comments.html  but not sure if  it's great way.

BTW Спасибо за импорт udja!  Я терпеливо ждала когда выйдет Jcomments http://joomlaforum.ru/index.php/topic,178026.msg1075348.html#msg1075348
« Last Edit: February 29, 2012, 16:44:29 by Goldsnich » Logged
commentator
Newbie
*

Karma: 0
Offline Offline

Posts: 2


« Reply #7 on: March 01, 2012, 18:02:16 »

I need this functionality too. Has somebody a solution for this? Huh
We're using the Joomla 2.5 Version of JComments
Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #8 on: March 01, 2012, 19:54:11 »

In Joomla 2.5 any user could have more than one usergroup and there is no way to get usergroups names without descreasing performance. I'm still searching more correct way to return this feature in next versions.
Logged

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

Karma: 0
Offline Offline

Posts: 2


« Reply #9 on: March 04, 2012, 04:06:01 »

OK, we're just using the standard-usergroups. But it sounds great that this feature is on the to-do list. thx!  Cheesy
Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    General discussion    Topic: How to highlight an administrator's comment?
 
Jump to: