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.
you keep this up firefly, and vb is going to throw you into the staff lineup. If one didnt know better, a person would swear that you and tubedog are having a hack release contest...
[QUOTE]Originally posted by ToraTora! you keep this up firefly, and vb is going to throw you into the staff lineup. If one didnt know better, a person would swear that you and tubedog are having a hack release contest...
Database error in vBulletin Control Panel: Invalid SQL: SELECT userid,username,usergroupid,password,email,FROM_UNIXTIME(joindate) AS joindate,FROM_UNIXTIME(lastvisit) AS lastvisit,posts FROM user WHERE userid IN ()
mysql error: You have an error in your SQL syntax near ')' at line 1
mysql error number: 1064
Date: Monday 17th of September 2001 08:45:51 AM
Script: /admin/user.php
Referer: http://forum.arachid.org/admin/user....ion=findaccess
It seems there's a missing line in the form because the variable $inquery is empty (I guess it should be between the ()...
It fails even if there should be search results. I checked it on a forum where everyone has access and it gets me that error. Actually, the members should be listed there.
Other question: If the forum's set that only admins and mods can post and reply but users can only read it, will that be included in the search?