Run this query:
[sql]ALTER TABLE usergroup ADD userchoose smallint(6) NOT NULL DEFAULT '0'[/sql]
Open admin/usergroup.php:
Find:
PHP Code:
makeyesnocode("Viewable on <a href=\"../showgroups.php?s=$session[sessionhash]\" target=\"_blank\">Show Groups</a>?","showgroup",1);
Add below:
PHP Code:
makeyesnocode("User can select to join this group on registration?","userchoose",0);
Find:
PHP Code:
usergroup (usergroupid,title,usertitle,
Replace with:
PHP Code:
usergroup (usergroupid,title,usertitle,userchoose,
Find:
PHP Code:
NULL,'".addslashes($title)."','".addslashes($usertitle)."',
Replace with:
PHP Code:
NULL,'".addslashes($title)."','".addslashes($usertitle)."','$userchoose',
Find:
PHP Code:
if (($usergroupid != 1 and $usergroupid != 2 and $usergroupid != 3 and $usergroupid != 4 and $usergroupid != 7) or $usergroup['showgroup'] == 1) {
makeyesnocode("Viewable on <a href=\"../showgroups.php?s=$session[sessionhash]\" target=\"_blank\">Show Groups</a>?","showgroup",$usergroup[showgroup]);
} else {
makehiddencode("showgroup",0);
}
Add below:
PHP Code:
makeyesnocode("User can select to join this group on registration?","userchoose",$usergroup[userchoose]);
Find:
PHP Code:
usergroup SET title='".addslashes($title)."',usertitle='".addslashes($usertitle)."',
Replace with:
PHP Code:
usergroup SET title='".addslashes($title)."',usertitle='".addslashes($usertitle)."',userchoose='$userchoose',
Open root/register.php:
Find:
PHP Code:
// User selectable style sets
$stylesetlist = "";
if ($allowchangestyles==1) {
$stylesets=$DB_site->query("SELECT * FROM style WHERE userselect=1");
while($thisset=$DB_site->fetch_array($stylesets)) {
if ($bbuserinfo[styleid]==$thisset[styleid]) {
$selected = "selected";
} else {
$selected = "";
}
$thisid = $thisset[styleid];
$thisstylename = $thisset[title];
eval ("\$stylesetlist .= \"".gettemplate("modifyoptions_styleset")."\";");
altbgcolor($prf_bgcolor);
eval ("\$stylecell = \"".gettemplate("register_stylecell")."\";");
}
} else {
$stylecell = "";
}
Add below:
PHP Code:
// User selectable usergroups
$usergrouplist = "";
$usergroups=$DB_site->query("SELECT * FROM usergroup WHERE userchoose=1");
while($thisgroup=$DB_site->fetch_array($usergroups)) {
$thisisid = $thisgroup[usergroupid];
$thisisgroupname = $thisgroup[title];
eval ("\$usergrouplist .= \"".gettemplate("modifyoptions_usergroup")."\";");
altbgcolor($prf_bgcolor);
eval ("\$groupcell = \"".gettemplate("register_groupcell")."\";");
}
Find:
PHP Code:
if ($allowchangestyles==1) {
$newstylefield = "styleid,";
$newstyleval = "'".intval($newstyleset)."',";
} else {
$newstylefield = "";
$newstyleval = "";
}
Add below:
PHP Code:
$newgroupid = "'".intval($newusergroup)."',";
Find:
PHP Code:
'$newusergroupid',
Replace with:
Create new template: register_groupcell
Code:
<tr>
<td bgcolor="{ firstaltcolor }"><normalfont><b>Usergroup:</b><br>
<smallfont>You make pick a usergroup from the list to belong to.</smallfont></normalfont></td>
<td bgcolor="{ firstaltcolor }"><smallfont><select name="newusergroup">
$usergrouplist
</select></smallfont></td>
[high]Remember:[/high] Remove the spaces in [high]{ firstaltcolor }[/high]
Create new template: modifyoptions_usergroup
Code:
<option value="$thisisid" $selected> $thisisgroupname </option>
Edit template: registeradult (and registercoppa)
Find:
Replace with:
Code:
$stylecell
$groupcell
All should work

Satan