Toying around, i found it sucks not to be able to change the the status of the user as an admin. So i whipped out this little hack.
First, you need a whole new function in admin/adminfunctions.php
Find:
PHP Code:
// ###################### Start makechoosercode #######################
Add BEFORE:
PHP Code:
// ###################### Start makeselectcode #######################
function makeselectcode ($title,$name,$seedarray,$selvalue=-1) {
// returns a combo box containing a list thats fed from an hash called seedarray
// that hash needs a pair combination, where the name will be used as title and the value as value
// allows specification of selected value in $selvalue
echo "<tr class=\"".getrowbg()."\" valign=\"top\">\n<td><p>$title</p></td>\n<td><p><select name=\"$name\">\n";
while ( list($key, $val) = each($seedarray) ) {
if ($selvalue==$val) {
echo "<option value=\"$val\" SELECTED>$key</option>\n";
} else {
echo "<option value=\"$val\">$key</option>\n";
}
}
echo "</select>\n</p></td>\n</tr>\n";
}
Close adminfunctions.php
Open global.php (you can put it also in the user.php in the admin directory on the top, but i used it for other hack parts too, so i needed it global) and add to the top, after the <?php this part:
PHP Code:
$gender_array = array( "Undisclosed" => "0",
"Female" => "1",
"Male" => "2");
This will help a lot later on...
SAve it and close it.
Open admin/user.php
These are for the edit part of the users...
Find:
PHP Code:
makeinputcode("Yahoo Messenger Handle","yahoo",$user[yahoo],0);
Paste after it:
PHP Code:
makeselectcode("Gender","gender",$gender_array,$user[gender]);
Now these are for adding users over the control panel:
Find
PHP Code:
makeinputcode("Yahoo Messenger Handle","yahoo");
Paste after:
PHP Code:
makeselectcode("Gender","gender",$gender_array);
So much for the interface. Now we need to make sure your data gets saved!
Find:
PHP Code:
$userid=$DB_site->insert_id();
In the line before THIS, search for options,birthday and add ",gender" to it without the "" of course. Now go to the very end of the line. There it looks like '$birthday')"); wich you change now to '$birthday','$gender')");
Ok, new users are set, now the edits.
Search with your editor for this part:
PHP Code:
$DB_site->query("UPDATE user SET birthday='$birthday'
Found this, go to the very end of the line.
You read there something like that:
PHP Code:
$pmpopup=1,pmpopup,'$pmpopup') WHERE userid=$userid");
Change it to this:
PHP Code:
$pmpopup=1,pmpopup,'$pmpopup'),gender='$gender' WHERE userid=$userid");
Save it, upload the files, and you are finished. You can instantly start to edit users, or add new ones with the gender hack. I tested this on 2.2.1 as the hack before, both on an new installed test board and on an already pretty heavy hacked one.
If you got questions, mail me.