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: Any way to highlight or change the color of a comment made by an administrator.
Pages: 1 [2]   Go Down
  Print  
Author Topic: Any way to highlight or change the color of a comment made by an administrator.  (Read 6365 times)
0 Members and 1 Guest are viewing this topic.
smart
Administrator
Hero Member
*****

Karma: 163
Offline Offline

Gender: Male
Posts: 2161



WWW
« Reply #15 on: October 11, 2011, 03:17:53 »

This style is applyed to whole div with class comment-box and it contains not only comment-body but title and other elements. But if you want you can surround all block with some new div and move these styles some lines higher...

I mean that you can move code:
Code: (php)
$comment_number = $this->getVar('comment-number', 1);
$thisurl = $this->getVar('thisurl', '');

$commentBoxIndentStyle = ($this->getVar('avatar') == 1) ? ' avatar-indent' : '';

if (isset($comment->usertype)) {
$commentBoxIndentStyle .= ' usertype-' . $comment->usertype;
}

$commentVote = intval($comment->isgood) - intval($comment->ispoor);
if ($commentVote != 0)  {
$commentBoxIndentStyle .=  (($commentVote >= 0) ? ' positive-' : ' negative-') . ($commentVote - ($commentVote % 5));
}

right after line:
Code: (php)
// return all comment item

Change code:
Code: (php)
?>
<div class="rbox"><div class="rbox_tr"><div class="rbox_tl"><div class="rbox_t">&nbsp;</div></div></div><div class="rbox_m">
<?php
with (we've added <div> with style)
Code: (php)
?>
<div class="<?php echo trim($commentBoxIndentStyle); ?>">
<div class="rbox"><div class="rbox_tr"><div class="rbox_tl"><div class="rbox_t">&nbsp;</div></div></div><div class="rbox_m">
<?php

And change:
Code: (php)
?>
</div><div class="rbox_br"><div class="rbox_bl"><div class="rbox_b">&nbsp;</div></div></div></div>
<?php
with (extra </div> added)
Code: (php)
?>
</div><div class="rbox_br"><div class="rbox_bl"><div class="rbox_b">&nbsp;</div></div></div></div></div>
<?php

I did not tested this code but I hope it will work Wink I want to show you the idea...
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
mb21
Jr. Member
**

Karma: -17
Offline Offline

Posts: 10


« Reply #16 on: October 12, 2011, 02:21:21 »

smart, what would the css be for our new div class, which I presume is this one:

<div class="<?php echo trim($commentBoxIndentStyle); ?>">

Thanks a lot.
Logged
Thatoo
Newbie
*

Karma: 0
Offline Offline

Posts: 9


« Reply #17 on: March 20, 2012, 06:16:37 »

Hello,

It worked very great before with the previous version, as I said in the previous page?
However, now, I update to the new 2.3 version and I don't manage to do it.
Why it doesn't work any more?
What should I change?
Logged
Thatoo
Newbie
*

Karma: 0
Offline Offline

Posts: 9


« Reply #18 on: March 26, 2012, 06:16:33 »

It doesn't work any more on Joomla 1.5, neither on Joomla 2.5....
So sad!!!!
Logged
Thatoo
Newbie
*

Karma: 0
Offline Offline

Posts: 9


« Reply #19 on: March 28, 2012, 16:54:24 »

Nobody knows why that doesn't work anymore on Jcomments 2.3.
Does someone manage to keep this function?
Logged
gregloones
Newbie
*

Karma: 0
Offline Offline

Posts: 1


« Reply #20 on: March 30, 2012, 21:33:06 »

I can't get it to work either Thatoo. It seems like the usertype code was removed again from the tpl_comment.php file in version 2.3.

If anyone knows how or where to add the code again I'd be much obliged.

I love this extension by the way!  Cool
Logged
Thatoo
Newbie
*

Karma: 0
Offline Offline

Posts: 9


« Reply #21 on: May 24, 2012, 10:13:28 »

So we should add the usertype code in the tpl_comment.php file?
I don't know how to do that... Cry

any idea?  Huh

Thanks anyway for this great extension.
Logged
aminp
Newbie
*

Karma: 0
Offline Offline

Posts: 3


« Reply #22 on: May 24, 2012, 13:40:12 »

hello
I have joomla 2.5.4 and jcomments 2.3.0 stable
i couldn't find this code in my web page source
Code:
<div class="comment-box usertype-super-administrator">
and also this code in /components/com_jcomments/tpl/default/tpl_comment.php
Code:
if (isset($comment->usertype)) {
$commentBoxIndentStyle .= ' usertype-' . $comment->usertype;
}
please help me i want to  highlight the administrator comments in my website i need it
 Huh
this is my comments source
Code:
<div class="odd" id="comment-item-17">
<div class="rbox"><div class="rbox_tr"><div class="rbox_tl"><div class="rbox_t">&nbsp;</div></div></div><div class="rbox_m">
<div class="comment-avatar"><img src="http://www.gravatar.com/avatar.php?gravatar_id=ca6ce6d24cc2e9edc532605bcfe1bf40&amp;default=http%3A%2F%2Fwww.arasdesign.ir%2Fcomponents%2Fcom_jcomments%2Fimages%2Fno_avatar.png" alt="امین پورسعید" /></div>
<div class="comment-box avatar-indent">
<a class="comment-anchor" href="/blog/26-aras-design#comment-17" id="comment-17">#</a>
<span class="comment-author">امین پورسعید</span>
<span class="comment-date">1391-03-03 16:47</span>
<div class="comment-body" id="comment-body-17"><ul><li>sss</li></ul></div>
<span class="comments-buttons">
<a href="#" onclick="jcomments.showReply(17); return false;">پاسخ دادن</a>
 | <a href="#" onclick="jcomments.showReply(17,1); return false;">پاسخ به نقل قول</a> |
<a href="#" onclick="jcomments.quoteComment(17); return false;">نقل قول کردن</a>
</span>
« Last Edit: May 24, 2012, 13:42:21 by aminp » Logged
smart
Administrator
Hero Member
*****

Karma: 163
Offline Offline

Gender: Male
Posts: 2161



WWW
« Reply #23 on: May 30, 2012, 17:07:34 »

In Joomla 1.5 and lower any user has only one usergroup and this feature has worked. In Joomla 2.5 user can have any number of groups and there is no easy way to get user groups list without decreasing peformance (I mean to get user groups for all users in comments list). So temporary this feature has been disabled. I still searching the solution to enable it again.
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
Pages: 1 [2]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    General discussion    Topic: Any way to highlight or change the color of a comment made by an administrator.
 
Jump to: