Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Flagging Moderators and Admins

Quote Reply
Flagging Moderators and Admins
I'd like to "flag" moderators and administrators in my forums by changing the font color of their names when they post. Anyone have a quick and smart way of doing this?

Safe swoops
Sangiro
Quote Reply
Re: [sangiro] Flagging Moderators and Admins In reply to
The posts are generated in the web page via loops... and I do not see where they are to edit them.

include_thread_display.html uses the loop "threads"

post_view_flat.html uses the loop "post_loop"

post_view_threaded.html uses two other pages:
1) include_thread_display.html for posts with threads
2) include_post_display.html for posts that are alone

include_post_display.html uses

post_view_printable.html uses loop "post_loop"

you can fix this partially in include_post_display by doing the following:

1) through the admin pannel - create two new global variables

moderator_font
value='s <font color="#FF0000"> (you can change the hex to whatever color you want - this is red)

/moderator_font
value='s </font>

2) in include_post_display.html add the BOLD



<a href="gforum.cgi?<%if user_status%>username=<%escape_url post_username%><%else%>user=<%user_id%><%endif%>;<%hidden_query%>">
<%if post_user_is_moderator%>
<%moderator_font%>
<%endif%>
<big><%nbsp post_username%></big>
</a>
<%else%>
<%if post_user_is_moderator%>
<%moderator_font%>
<%endif%>


<big><%nbsp post_username%></big>
<%endif%>
<%if post_user_is_moderator%>
<%/moderator_font%>
<%endif%>





*NOTE: This is not a total solution - it only affects moderators and not administrators. It only changes the color inside of a post. It does not change their name in a category view, who's onlne, or links to threaded messages.
Quote Reply
Re: [shiner] Flagging Moderators and Admins In reply to
I did the same thing, but all our mods are admins so I just used <%if user_status eq 3%>. You could of course use an OR in there to catch both.


Realiiity.com Forums
Quote Reply
Re: [ellipsiiis] Flagging Moderators and Admins In reply to
>><%if user_status eq 3%><<

That may give unexpected results...you'll want:

<%if user_status == '3'%>
Quote Reply
Re: [Paul] Flagging Moderators and Admins In reply to
Oh yeah? I've had it like that for months and never had a problem, but good to know :)


Realiiity.com Forums
Quote Reply
Re: [Paul] Flagging Moderators and Admins In reply to
It was actually in the code of include_post_display - I just missed it:




<% if current_user_status = 3%><%-- An administrator --%>




so either way should work...




I just made the change with the OR statement and it works like a charm!



<%if user_id%>
<a href="gforum.cgi?<%if user_status%>username=<%escape_url post_username%><%else%>user=<%user_id%><%endif%>;<%hidden_query%>">
<%if post_user_is_moderator or user_status == '3'%>
<%moderator_font%>
<%endif%>
<big><%nbsp post_username%></big>
</a>
<%else%>
<%if post_user_is_moderator or user_status == '3'%>
<%moderator_font%>
<%endif%>


<big><%nbsp post_username%></big>
<%endif%>
<%if post_user_is_moderator or user_status == '3'%>
<%/moderator_font%>
<%endif%>


</b>
<br>
<%user_title%>
<%if post_user_is_moderator%>
/ Moderator
Quote Reply
Re: [ellipsiiis] Flagging Moderators and Admins In reply to
>>
Oh yeah? I've had it like that for months and never had a problem, but good to know :)
<<

Yep, the first reason is that the tags are built into perl output and == is for numeric comparisons, eq is for comparing strings an non-numeric data.

Secondly just using == 3 won't do what you think....anything not quoted is believed to be a tag rather than a value.

Last edited by:

Paul: Jun 26, 2002, 10:46 AM
Quote Reply
Re: [ellipsiiis] Flagging Moderators and Admins In reply to
Let me just rephrase that....the last two options will work, but eq won't....here is the output....

Code:
if ($self->_get_var(q{current_user_status}, 0, 0) eq 3) {
$return .= q{FOO};
}
$return .= q{};
if ($self->_get_var(q{current_user_status}, 0, 0) == 3) {
$return .= q{FOO};
}
$return .= q{};
if ($self->_get_var(q{current_user_status}, 0, 0) == q{3}) {
$return .= q{FOO};
}
Quote Reply
Re: [shiner] Flagging Moderators and Admins In reply to
Thank you. This helped a lot. How would you change the statement below to let moderators from ANY forum to be flagged in ANY forum. (not only the forums that they moderate)

<%if post_user_is_moderator%>

Safe swoops
Sangiro