PDA

View Full Version : Printable List of Usernames with UserIDs


Sven
03-08-2002, 10:00 PM
Not a "real" Hack, more a kind of code modification.

As I'm in the process of importing a large UBB Board (1200+ Members) into a large vBulletin Board (800+ Members) with a lot of double users I needed a script that would help me to identify the Usernames and IDs of the existing vBulletin Users.
There is an option to display this list built in the bbimport.php but it will present a form and you have to scroll alot to identify a userID from a given username.
What I wanted is a printable version and here is what I coded:
<?php
error_reporting(7);
chdir ("./../admin");
include ("./../admin/global.php");
echo "<b>$bbtitle Members:</b>";
$vbusers = $DB_site->query("SELECT userid,username,importuserid FROM user ORDER BY username");
echo "<table border=1><tr><td><b>Username</b></td><td><b>UserID</b></td></tr>";
while ($vbuser = $DB_site->fetch_array($vbusers)) {
echo "<tr><td><font size=2>$vbuser[username]</font></td><td><font size=2>$vbuser[userid]</font></td></tr>";
}
echo "</table>";
?>
Eventually this may help some of you if you're facing a situation as I'm currently doing ;)

Place attached file into the vBulletin/admin directory

Robert9
03-09-2002, 08:18 PM
it doesn't work on my vbb

he reported an mysql error!

can you help me?


Database error in vBulletin Control Panel 2.2.0:

Invalid SQL: SELECT userid,username,importuserid FROM user ORDER BY username
mysql error: Unknown column 'importuserid' in 'field list'

mysql error number: 1054

Date: Sunday 10th of March 2002 12:20:32 AM
Script: http://www.*********.***/admin/listuser.php
Referer:

MrLister
03-10-2002, 01:05 AM
This is because that column doesn't exist in the database. Try this




<?php
error_reporting(7);
chdir ("./../admin");
include ("./../admin/global.php");
echo "<b>$bbtitle Members:</b>";
$vbusers = $DB_site->query("SELECT userid,username FROM user ORDER BY username");
echo "<table border=1><tr><td><b>Username</b></td><td><b>UserID</b></td></tr>";
while ($vbuser = $DB_site->fetch_array($vbusers)) {
echo "<tr><td><font size=2>$vbuser[username]</font></td><td><font size=2>$vbuser[userid]</font></td></tr>";
}
echo "</table>";
?>


$vbuser[importeduserid] is not even used so the above works exactly the same.

Robert9
03-10-2002, 04:57 AM
it works, THANKX!

Robert9
03-10-2002, 05:10 AM
and is it possible to make another row with the usertitle?

i think for admins it is much beter, because usernmae and id doesen't say so much to an admin with a big board!

SaintDog
03-11-2002, 09:26 AM
EDIT:

Nevermind, I got it to display and order by IP address. This will help me out greatly. Thanks for the hack, I just added onto it to suit my needs.

Thanks again,

Saintdog

AllMadden.net
03-30-2003, 10:59 AM
um...which php does the code go into? Or do we just upload the attached php file and run that?

Boofo
03-30-2003, 11:07 AM
03-11-02 at 05:26 AM SaintDog said this in Post #6 (https://vborg.vbsupport.ru/showthread.php?postid=228183#post228183)
EDIT:

Nevermind, I got it to display and order by IP address. This will help me out greatly. Thanks for the hack, I just added onto it to suit my needs.

Thanks again,

Saintdog

Could you let us in on what you changed it to? might be good to have. ;)