PDA

View Full Version : Message (Posting) Icons for admins and mods only


amykhar
05-30-2002, 09:01 PM
I have a small flame icon that I would like to use to indicate that a thread has gotten a bit heated. I don't want normal members to be able to use it, just admins or mods.

Therefore, I need a hack that will allow me to set up one or more message icons for staff use only.

Amy

amykhar
05-31-2002, 01:53 PM
Never mind, I got it. Easy stuff.

1. I added a new field to the icon table called modonly. If it is a restricted icon, I set that to 1.

2. I copied the chooseicons function in functions.php and used it to create a new function called chooseicons2

3. I changed the query in the chooseicons2 function so that it does not show icons marked modonly.

4. I changed the call to the chooseicons function in newthread, newreply, and editpost to call chooseicons2 instead of the original. I did it this way because nobody is allowed to intentionally create a post they know is a flame.

5. The postings.php call (the one that handles the thread edit) remains the same. Therefore, ALL icons show up there, even the modonly ones. Because only mods and admins can edit the thread on my board, this effectively restricts that icon to my mods and admins.

Amy

Xenon
05-31-2002, 07:06 PM
good idea mate, think i'll do so too :)