Welcome, Guest. Please Login or Register.
May 09, 2025, 05:19:15 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Help With Moderator Membergroup Mod « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Help With Moderator Membergroup Mod  (Read 337 times)
David
Destroyer Dave
Global Moderator
YaBB God
*****
Posts: 5761


I'm not a llama!

WWW
Help With Moderator Membergroup Mod
« on: January 05, 2003, 06:21:04 AM »
Reply with quote

Ok, I want to be able to add moderator as a real membergroup and wrote a function that given a username returns if they are a moderator on a board.  Problem is where exactly should I use this?  I need some ideas, help, insight, genious.  :P
function is_mod($usern)
   $boards_result = query('SELECT ID_BOARD FROM '.$db_prefix.'boards WHERE \''.$usern.'\' IN(moderators)');
   if(mysql_num_rows($boards_result) > 0)
      return true;
   else
      return false;
}
Logged

[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Help With Moderator Membergroup Mod
« Reply #1 on: January 05, 2003, 06:36:01 AM »
Reply with quote

Well, first a suggestion.... cache the result.  Make it static and check against an empty string....

Anyway, I would look for "in_array($username,$moderators)" and replace it with your function.  (ie. is_mod($username))

-[Unknown]
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Help With Moderator Membergroup Mod « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.059 seconds with 21 queries.