PDA

View Full Version : Moderators & Private Request.


Doogie
02-01-2002, 03:29 AM
Hoping I'm not creating something that might already of been covered.

I host clan forums among other things, and now I've got the mod access masks hack going, it's fantastic!!! I don't have to edit access masks for every tom, dick and harriet who wants to be added to the private forums. The mods can do it.

But HOW can I bloody stop it so that it doesn't automatically add the moderators to each private forum I create?? With 120+ moderators, with one two-three who should see the forums, this makes for a lot of editing!!!

Hack No 2:

To be able to list the members who have access to a private forum. I've been asked for this many a time, but there is no way of doing it. I'm a php newbie, so it's beyond my ability :)

Martz
02-01-2002, 10:36 AM
1) open admin/forum.php

Find:
$mods=$DB_site->query("SELECT DISTINCT moderator.userid FROM moderator,user WHERE moderator.userid=user.userid AND user.usergroupid<>6 AND user.usergroupid<>5");
if ($DB_site->num_rows($mods)) {
while ($mod=$DB_site->fetch_array($mods)) {
$accessto[] = $mod['userid'];
}
while ( list($key,$userid)=each($accessto) ) {

$DB_site->query("INSERT INTO access(userid,forumid,accessmask) VALUES ('$userid','$forumid',1)");
}
}
}

Change to

$mods=$DB_site->query("SELECT DISTINCT moderator.userid FROM moderator,user WHERE moderator.userid=user.userid AND user.usergroupid<>6 AND user.usergroupid<>5");
if ($DB_site->num_rows($mods)) {
while ($mod=$DB_site->fetch_array($mods)) {
$accessto[] = $mod['userid'];
}
while ( list($key,$userid)=each($accessto) ) {
// HACK - the line below is commented out to stop moderators getting custom access permissions for private forums.
// $DB_site->query("INSERT INTO access(userid,forumid,accessmask) VALUES ('$userid','$forumid',1)");
}
}
}


Hacking at this level is easy - the work is done already. Just try and understand the php and keep reading it, soon enough it will all become a little clearer.

To check if a user has access to a private forum, Flirefly or PPN has written a hack to display this.

Doogie
02-01-2002, 10:51 AM
Much appreciated Martz... nice to see someone else supporting Unreal Tournament Clans. My forums are fairly much similar layout, but you've a lot more posts :)

http://forums.skankyflat.net

Cheers,
Doogie