×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Moderator comment styling

Moderator comment styling 14 years 7 months ago #9654

  • Alexander
  • Alexander's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0
It's often necessary for my moderators to reply to (rather than censor or delete) user comments. This works OK, but there's a problem: If they reply as <company name>, it sounds very impersonal. But if they reply using their own name, any random user could pretend to work for the company.

I'd like to subtly differentiate (using CSS) between normal user comments and moderator comments so that users can get a personal response, but still know they're getting an official answer.

It would be nice to have a bit more flexibility with template tags. If {usertype} returned just "sadministrator" instead of "<span class="administrator">SAdministrator</span>" I could do something like:
<li class = 'post {usertype}'>
and then have the flexibility to style anything under that top li based on that CSS class.

As it is, I managed to get what I wanted by doing:
...{usertype}<div class='posthead'>...
and
#Comments ul li.post span.administrator {
    display: none;
}
#Comments ul li.post span.administrator + div.posthead {
    background-color: #cc0000;
}

But that feels a bit clunky.

Personally, I'm an advocate of making templates by using XSLT to transform generic XML output, e.g.:
<comment><id>1</id><ip>64.50.19.XXX</ip><usertype>superadmin</usertype>...</comment>
into HTML/RSS/etc. Unfortunately, no one I've met agrees with me.

Anyway, hopefully my hack or my input are useful to someone.

By the way, I really appreciate the work you guys are doing. !Joomlacomment isn't perfect, but it seems to be the most feature-rich commenting system for Joomla! out there, and every time I get a new version, I'm blown away at the number of things that are vastly improved, including the overall maturity of the product. Keep up the good work!

Moderator comment styling 14 years 7 months ago #9684

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Alex,
Thank you for the kind words and I'm really sorry for the problems you had with our forum ;)

About the things you are saying. I'm testing this on compojoomcomment and when I post a comment my status is displayed like this:
<span class="postusertype"><span class="administrator">SAdministrator</span></span>

So you could format the administrator with a different color from the other users.
Now looking in the functijon that do this I see that only the super Admin gets this class.
hm...

Moderator comment styling 14 years 6 months ago #9993

  • Deleteme
  • Deleteme's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0
Hi there,

I'm also interested in this great feature! On my blog there are large comment discussions very often. It would be great if readers could identify my (admin) response via special styling (background) easily.

Do you already have a solution for that ? Will you integrate this feature in the next releases?

Thanks and best regards,
Felix

Moderator comment styling 14 years 6 months ago #9998

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey compofan,
As I said in my previews post there is a class
<span class="postusertype"><span class="administrator">SAdministrator</span></span>
that you can style. You can make this class red for example so everyone will see that you are the SAdmin :)

Moderator comment styling 14 years 2 months ago #10589

  • Renay Scott
  • Renay Scott's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 7
  • Thank you received: 0
ok, im going to assume this is still relevant for the newest compojoom. But i'm a lttle slow on figuring out how to go about applying this to my current template. Im modifying the modern template. In it I have the following
{BLOCK-usertype}|<span class='postusertype'>{usertype}</span>{/BLOCK-usertype}

Am I suppose to use the span class provided by Daniel to replace the above or add to it?
Will this only change the way the name is shown or could this be used to specify color/size of text by the super admin?
Any simple example you could possibly throw out there for something that could be used in the css file to try/see this in action?

I know I may be asking for a lot, but if there is anyone willing to help that'd be great!

Moderator comment styling 14 years 2 months ago #10594

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Dreameradise,
With the above code you can style just the usertype information that you have in the header of each comment.
Add to your style sheet the code:
.administrator {
color: red;
}
and now you will see SAdministrator in red.

Moderator comment styling 14 years 6 days ago #11042

  • Hari Karam Singh
  • Hari Karam Singh's Avatar
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 20
  • Thank you received: 0

Alexander wrote: It would be nice to have a bit more flexibility with template tags. If {usertype} returned just "sadministrator" instead of "<span class="administrator">SAdministrator</span>" I could do something like:


+1

Is there a definitive list anywhere of these template variables?

Moderator comment styling 14 years 6 days ago #11054

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
No there is no list with those variables.
Right now the template outputs sadministrator or administrator.

Moderator comment styling 14 years 6 days ago #11058

  • Hari Karam Singh
  • Hari Karam Singh's Avatar
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 20
  • Thank you received: 0
For some readon I'm only seeing the sAdministrator block output when I'm logged in...

Moderator comment styling 14 years 6 days ago #11061

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hari, have you written a comment as an administrator?

Moderator comment styling 14 years 6 days ago #11063

  • Hari Karam Singh
  • Hari Karam Singh's Avatar
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 20
  • Thank you received: 0
Yes. I logged in and commented. Whilst logged in the block renders but upon logging out it disappears...

Moderator comment styling 14 years 2 days ago #11125

  • Hari Karam Singh
  • Hari Karam Singh's Avatar
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 20
  • Thank you received: 0
Any news on this? thx...

Moderator comment styling 14 years 1 day ago #11131

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Ok, I lied big time!!! I'm really sorry about this, but this is wrong....

I had a deep look over the code and it is not difficult to assign a class to each comment. (I mean a class with the user type)
All you have to do is open josc_post.php

On line 584 you will find this:
$html 		= str_replace('{published}', $published , $html);
change it to
$html 		= str_replace('{published}', $published .' ' .strtolower(str_replace(' ', '', $usertype)) , $html);

now you will have classes such as superadministrator, administrator, editor etc.

Moderator comment styling 14 years 1 day ago #11136

  • Hari Karam Singh
  • Hari Karam Singh's Avatar
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 20
  • Thank you received: 0
Are you making these changes part of the core package? If not might I suggest introducing another variables such as {usertype_class} which will allow the new functionality without altering any of the current paradigm?

Moderator comment styling 14 years 1 day ago #11140

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
As I said in a previous post we have to change the whole template system as it is not so user friendly as I wish.

But the above quick fix is something that I think I can add in the next release. What are your ideas? And if you wish you are always welcome to engage in the development :)
  • Page:
  • 1
Time to create page: 0.124 seconds