Version: , by Admin (Coder)
Developer Last Online: Nov 2024
Version: 2.2.x
Rating:
Released: 09-16-2001
Last Update: Never
Installs: 78
No support by the author.
This was requested by David Copeland.
He wanted to be able to list all users that have or don't have access to a certain forum.
This is very very easy to install, you just need to add one block of code and a link!
Install:
In user.php (admin folder), add this code:
PHP Code:
echo "<li><a href=\"user.php?s=$session[sessionhash]&action=findaccess\">List by access masks</a></li>\n";
right after
PHP Code:
echo "<li><a href=\"user.php?s=$session[sessionhash]&action=find\">List all users</a></li>\n";
Still in user.php, add this code:
PHP Code:
// ###################### Start Find by Access #######################
if ($action=="dofindaccess") {
if ($checkaccess!="1" and $checkaccess!="0") {
$action = "findaccess";
} else {
$lists = $DB_site->query("SELECT * FROM access");
$inquery = "";
while ($list = $DB_site->fetch_array($lists)) {
if ($list[forumid]==$forumfrom and $list[accessmask]==$checkaccess) {
if ($inquery) {
$inquery .= ",";
}
$inquery .= "$list[userid]";
}
}
if ($inquery=="") {
echo "No users found.";
$action = "findaccess";
} else {
$users = $DB_site->query("SELECT userid,username,usergroupid,password,email,FROM_UNIXTIME(joindate) AS joindate,FROM_UNIXTIME(lastvisit) AS lastvisit,posts FROM user WHERE userid IN ($inquery)");
echo "<p>Click username to view forum profile.</p>";
doformheader("","");
// ###################### Start List by Access #######################
if ($action=="findaccess") {
doformheader("user","dofindaccess");
maketableheader("List Users by Access Masks","",0);
echo "<tr class='firstalt'><td colspan=2><p>Here you can list all users that match the settings you set below.</p></td></tr>\n";
maketableheader("Forum Select");
makeforumchoosercode("Forum you'd like to order by:",forumfrom);
makeyesnocode("Does the user has access to that forum?",checkaccess,"2");
echo "</p></td></tr>\n";
doformfooter("List users");
}
right before
PHP Code:
cpfooter();
?>
The end.
See, I told you it's easy!
Now you have a link for this under Users => Find => List by access masks (under List all users).
By the way, I know that one part of the code there could be combined with the other search part, but this is just as good.
Sue me.
Feedback please.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
I don't know if this thread is still active - but Thanks Firefly! It works on v2.2.8.
Is there a way to have it list all users that have access to a specific forum - not just those that are set specifically for that forum. For instance, members in my "Board" group have access to the "board" forum, but they only show up in the "List by Access" if I manually clicked "yes" in their permissions.
Anyone? :$ It'd be really handy for me. Unless someone has a hack that adds "usergroups" that has leaders to add their own members (much like vB3's usergroups/forum permissions) type.
Originally posted by Jawelin Just a tip:
what about
1) choose a forum from a combo-list (best ordered the same way in jump-combo is, not alphabetically), fixing a parameter, this way.
Even though this is a pretty old hack, can someone try and point me out how to change the dropdown list as suggested above?