How exactly do you want this to work?
This will select a random username from all registered users with each and every page load.
in global.php
find (around line 548):
Code:
// parse headinclude, header & footer
eval('$headinclude = "' . fetch_template('headinclude') . '";');
eval('$header = "' . fetch_template('header') . '";');
eval('$footer = "' . fetch_template('footer') . '";');
if ($shownewpm)
{
if ($bbuserinfo['pmunread'] == 1)
{
$pmpopupurl = "private.php?$session[sessionurl_js]do=showpm&pmid=$newpm[pmid]";
}
else
{
$pmpopupurl = "private.php?$session[sessionurl_js]";
}
eval('$footer .= "' . fetch_template('pm_popup_script') . '";');
}
Insert AFTER that:
Code:
$who=$DB_site->query_first("SELECT username, usergroupid, userid FROM " . TABLE_PREFIX . "user WHERE usergroupid='2' ORDER BY rand() LIMIT 1");
$rUsr=$who['username'];
Note the usergroup='2' clause. This query is set to ONLY choose usernames from registered users, no other user group will show up. If you want to add more usergroups add more where clauses or delete "WHERE usergroupid='2'" if you want to pull from all usergroups (but that will include banned and waiting for confirmation as well.)
Then in any template add $rUsr where ever you want the username to appear.