FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » API to programatically add moderators and group leaders ?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: API to programatically add moderators and group leaders ? [message #35447 is a reply to message #35430] Fri, 12 January 2007 02:27 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma:
Senior Member
Administrator
Core Developer
You have sets of commands here 1 to add a mod:

INSERT INTO fud26_mod (forum_id, user_id) VALUES(3, 96);
UPDATE fud26_forum SET moderators='a:1:{i:96;s:32:\"display name\";}' WHERE id=3;
UPDATE fud26_users SET users_opt=users_opt|524288 WHERE id IN(96) AND (users_opt & 1048576)=0;

and another to remove a mod

DELETE FROM fud26_mod WHERE user_id=96;
UPDATE fud26_forum SET moderators=NULL;
UPDATE fud26_users SET users_opt=users_opt & ~ 524288 WHERE users_opt>=524288 AND (users_opt & 524288) > 0;

Just wrap those two in the functions and voila...


FUDforum Core Developer
[Message index]
 
Read Message
Read Message
Previous Topic: Sending pm's via the fud api
Next Topic: backup without database
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 20:10:38 GMT 2024

Total time taken to generate the page: 0.04441 seconds