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 2014 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: 146
Offline Offline

Gender: Male
Posts: 2579



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

Gender: Male
Posts: 2579



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
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    General discussion    Topic: How to highlight an administrator's comment?
 
Jump to: