i'm still having problems with this. The custom field options won't show up in the User CP. I'm using 2.3.0. The Only thing that was different in the readme was this:
User.php
In my User.php(Line 295) :
PHP Code:
maketableheader("Custom Profile Fields");
$userfield=$DB_site->query_first("SELECT * FROM userfield WHERE userid=$userid");
$profilefields=$DB_site->query("SELECT profilefieldid,title FROM profilefield");
while ($profilefield=$DB_site->fetch_array($profilefields)) {
$varname="field$profilefield[profilefieldid]";
makeinputcode($profilefield[title],"field".$profilefield[profilefieldid],$userfield[$varname]);
}
doformfooter("Save Changes");
}
// ###################### Start do update #######################
In customfileds.txt posted by Nomb it says to replace this code:
PHP Code:
maketableheader("Custom Profile Fields");
$profilefields=$DB_site->query("SELECT profilefieldid,title FROM profilefield");
while ($profilefield=$DB_site->fetch_array($profilefields)) {
makeinputcode($profilefield[title],"field".$profilefield[profilefieldid]);
}
with this code
PHP Code:
// new options
maketableheader("Custom Profile Fields");
$profilefields=$DB_site->query("SELECT *
FROM profilefield
WHERE editable = 1
ORDER BY displayorder");
while ($profilefield=$DB_site->fetch_array($profilefields)) {
$profilefieldname="field$profilefield[profilefieldid]";
if ($bgcolor=="#13486D") {
$bgcolor="#1C5780";
} else {
$bgcolor="#13486D";
}
// new options
$TheField="";
$optionlines = explode(',', $profilefield[options]);
$option_bit=$optionlines[0];
if ($profilefield[type]==1) {
// radio
while ($option_bit) {
$option_bit=trim($option_bit);
if ($option_bit == $bbuserinfo[$profilefieldname]) { $LocOn = "checked"; } else { $LocOn = ""; }
$TheField .= "<input type=\"radio\" name=\"$profilefieldname\" value=\"$option_bit\" $LocOn> $option_bit ";
$option_bit=next($optionlines);
}
} elseif ($profilefield[type]==2) {
// select
$TheField = "<select size=\"$profilefield[size]\" name=\"$profilefieldname\">";
while ($option_bit) {
$option_bit=trim($option_bit);
if ($option_bit == $bbuserinfo[$profilefieldname]) { $LocOn = "selected"; } else { $LocOn = ""; }
$TheField .= "<option value=\"$option_bit\" $LocOn>$option_bit</option>";
$option_bit=next($optionlines);
}
$TheField .= "</select>";
} elseif ($profilefield[type]==3) {
// textarea
$bbuserinfo[$profilefieldname]=htmlspecialchars($bbuserinfo[$profilefieldname] );
$TheField = "<textarea name=\"$profilefieldname\" rows=\"6\" cols=\"40\" wrap=\"physical\">$bbuserinfo[$profilefieldname]</textarea>";
} else {
$TheField="<input type=\"text\" class=\"bginput\" name=\"$profilefieldname\" value=\"$bbuserinfo[$profilefieldname]\" size=\"$profilefield[size]\" maxlength=\"$profilefield[maxlength]\">";
}
makelabelcode($profilefield[title],$TheField);
}
// new options
Can anyone help me with this?