Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Determining the author of a post's usergroup in any circumstance
Author Message
zeeman
Junior Member


Posts: 4
Joined: Mar 2011
Reputation: 0
Post: #1
Determining the author of a post's usergroup in any circumstance
Hey all,
I've been busy setting up a custom forum and one of the features I've implemented is a staff-only MyCode tag that is to be used by administrators and moderators to highlight sections of their posts that are being written in their "official" capacity as a staff member. This, of course, raises the issue of non-staff members determining what the tag is and then using it to mess around and intimidate other members or whatnot. This isn't hugely concerning to me, but this is the sort of problem that I find interesting and so I decided to try my hand at building a plugin which does two things: first, it makes it difficult to determine exactly what MyCode is used, by stripping the MyCode itself from any quoted version of a post. Second, it pre-processes every post to determine if it has been made by a staff member and, if it hasn't, replaces any use of the official tag with another tag which proclaims in very large text that the author of the post is breaking the rules.

However, I've run into a few issues:
First, I want to have a site-wide announcement post detailing all of the rules, which also includes a note about the staff-only tag. It would be really great if said announcement could include the staff-only tag itself, except the variable that I use to check whether or not the user is a staff member (uid, more on this in a bit) isn't available with announcements. Presently, I've been getting by with just leaving the guidelines post as a regular, stickied post in my announcements forum, but I'd really like to be able to get this working sitewide.

The second issue, which is particularly irritating, is that I haven't been able to figure out how to determine, in every instance, the group that a posting user is a member of. This is important, because although the group ID is available in the postbit when posts are rendered normally, this is not so when posts are rendered in the thread preview when making a reply. As a consequence, if a staff member makes use of the staff-only MyCode and another member goes to reply to them, they will see the staff member's "official" message replaced with a notice that they are a naughty member who has abused a staff-only feature. Obviously, this should not be so.

I feel like both of these issues can be resolved simply by figuring out how to get an author's group ID in every instance where they've made a post, but I'm not sure how to get there from here. Any help would be greatly appreciated! (I hope this doesn't sound too rude, but yes, I am aware that I could just not implement a restrictive solution like this, which is something I've already considered, but I've already implemented this in an unobtrusive way and am merely looking for advice on how to improve my system. I'm interested only in discovering possible avenues that I can pursue which involve working on my own solution - as I said in my introductory post, here, I'm interested in learning, not adapting pre-existing solutions or abandoning my project. )
03-01-2011, 11:04 AM
Nickman
Manager



Posts: 2,667
Joined: May 2008
Reputation: 64
Post: #2
RE: Determining the author of a post's usergroup in any circumstance
It's a little hard for me to understand your goal. Could you possible post some code so I can try and see what is going on?


DailyMix
03-02-2011, 12:22 PM
 




User(s) browsing this thread: 2 Guest(s)