Are you using the same database that vbulletin uses? If so, you really don't need to go through and define all the database stuff again. It should be available to you after you call global.php. So, try rewriting some of the stuff just as if it were vb stuff, ie. "$db->query_read" instead of "mysql_query" and "while ($row = $db->fetch_array($r))" instead of "while ($row = mysql_fetch_array($r, MYSQL_BOTH))". In the while loop, you would then use "$row[username]" instead of "retUsername($row[0])".
(Disclaimer: I write code by trial and error so often, so I hope I'm not steering you wrong here.)
|