PHP Code:
$changeuser = '';
if ($bbuserinfo['posts'] >= $postuserchange) {
$oldnames = $DB_site->query_first("SELECT * FROM namelogs WHERE userid='$bbuserinfo[userid]' ORDER BY time DESC");
$diff = time() - $oldnames['time'];
$limit = (86400 * $dayuserchange);
if ($diff > $limit or $bbuserinfo['usergroupid'] == 6) {
eval("\$changeuser = \"".gettemplate("changeuser")."\";");
} elseif ($diff < $limit or !$bbuserinfo['usergroupid'] == 6) {
eval("\$changeuser = \"".gettemplate("nochangeuser")."\";");
}
}
Ok there we have some code, heh. What I want to do, is have a variable which will say how long (in days) until the user can next change his username. I messed around with making new variables and such, but nothing is working for me! What variable do I need to set here so I can put it into the "nochangeuser" template, so it will display the number of days left until the user can change his/her username? Or is it more complicated?