I think it would be better to do it this way:
Edit dograntadmin.pl to give them a title:
# Update this user's status
my $newstat = $dbh -> quote("Administrator");
my $newcolor = $dbh -> quote($theme{'admincolor'});
my $newtitle = $dbh -> quote("Administrator");
$query = qq!
UPDATE w3t_Users
SET U_Status = $newstat,
U_Color = $newcolor,
U_Title = $newtitle
$updategroups
WHERE U_Username = $Username_q
!;
$dbh -> do($query) or die "Can't execute query: $query. Reason: $DBI::errstr";
Edit doassignmod.pl ditto:
# Update this user's status if they are not an admin
my $newstat = $dbh -> quote("Moderator");
my $Username_q = $dbh -> quote($Username);
my $Keyword_q = $dbh -> quote($Keyword);
my $checkstat = $dbh -> quote("Administrator");
my $newcolor = $dbh -> quote($theme{'modcolor'});
my $newtitle = $dbh -> quote("Moderator");
my $query = qq!
UPDATE w3t_Users
SET U_Status = $newstat,
U_Color = $newcolor,
U_Title = $newtitle
WHERE U_Username = $Username_q
AND U_Status <> $checkstat
!;
$dbh -> do($query) or die "Can't execute query: $query. Reason: $DBI::errstr";
Then in addpost.pl only update the title if they aren't an Aministrator or a Moderator:
# Now if the newtitle is different from their current title, then we update their profile
# if they are not a Moderator or an Administrator
if ( ($NewTitle ne $CurrTitle) && ($user{'Status'} ne "Administrator") && ($user{'Status'} ne "Moderator") ){
$query = qq!
UPDATE w3t_Users
SET U_Title = $UserTitle_q
WHERE U_Username = $Username_q
!;
$dbh -> do($query) or die "Can't do $query. Reason: $DBI::errstr.";
}
}
This way Mods and Admins can edit their own titles as often as they like. []/w3timages/icons/cool.gif[/]