NEW - Group Comment Plugin…
Posted: 24 June 2008 07:09 AM   [ Ignore ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6535
Joined  04-15-2006

Hiya,

I made this plugin exceptionally quickly in reply to a thread here.

Igor wanted a way to be able to style comments from a certain group differently to everyone elses.

This plugin should hopefully address that need. Whilst it is possible to style the original entry authors comments differently (scroll down to see my method wink ) this plugin allows you to style all members of a certain group differently.

Usage Instructions :

CSS Code

.group-comment {
        text
-transform: uppercase;
}
.not-a-group-comment {
        text
-transform: lowercase;
}


Obviously the CSS can be anything you need and you can use DIVs and anything else that you like in between the conditional shown below to lay out your comments just the way you want them

ExpressionEngine Code - Goes inside {exp:comment:entries} tag pair

{exp:group_comment member_id="{author_id}" group_id="1"}
{if belongs_to_group}
<p class="group-comment">{comment}</p>
{if:else}
<p class="not-a-group-comment">{comment}</p>
{/if}
{
/exp:group_comment}

Hope that helps someone somewhere. As mentioned before this was written in about 2 minutes so hopefully should work wink

Best wishes,

Mark

File Attachments
pi.group_comment.php.zip  (File Size: 2KB - Downloads: 80)
 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 26 June 2008 05:06 AM   [ Ignore ]   [ # 1 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  347
Joined  04-23-2008

Mark,

Good contribution! Couldn’t this work already? By running a conditional like so:

{if group_id != "1" AND group_id != "6"}
  Regular Comment
{if
:else}
  Super Admin
/ Editor group Comment

Managed to get it to work, but took me time to figure out to use an AND rather than a OR.

 Signature 

Danny, your poor-man’s EE designer for hire/help.

Profile
 
 
Posted: 26 June 2008 06:05 AM   [ Ignore ]   [ # 2 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6535
Joined  04-15-2006

Well that’s just not fair if it does work as I couldn’t see a group_id anywhere in the comment entries variables tag pair listed in the documents downer

I just did a really quick cursory test and it seems as though what you have there does work! All my time wasted making the plugin due to either something missing in the documents or me not looking properly?

I may still be wrong as it was a really quick test though.

Sheesh am I going to be upset if I did all that just to find out there is a group_id variable that I have missed somewhere!!!

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 01 October 2008 11:17 AM   [ Ignore ]   [ # 3 ]  
Grad Student
Rank
Total Posts:  34
Joined  07-24-2003

When I attempt to use {group_id} it returns the same regardless of the posters group.

Profile
 
 
Posted: 06 November 2008 04:19 PM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  347
Joined  04-23-2008

dchrist,

I can confirm that my original method listed above does work. I’ve had it used in live examples before. Alas, I’ve yet to try it on new builds of EE but will give this a shot and will update this thread with results.

 Signature 

Danny, your poor-man’s EE designer for hire/help.

Profile
 
 
   
 
 
‹‹ Plugin: Cookie Plus      Proper Titles ››
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64886 Total Logged-in Users: 75
Total Topics: 81811 Total Anonymous Users: 35
Total Replies: 439828 Total Guests: 270
Total Posts: 521639    
Members ( View Memberlist )
Newest Members:  Ax the Bkikibalkhulaidi19Hotcards.comShrike67Dynamic1justingpticketjendicottdxrsm