DigitalDesktops
04-07-2003, 01:46 AM
i'm having problems with this hack: https://vborg.vbsupport.ru/showthread.php?s=&threadid=21833&perpage=15&display=&pagenumber=1
The custom field options won't show up in the User CP or the registeration page.
The only thing that shows up is the Standard Text Input Field not the Select Box field.
I'm using 2.3.0. The Only thing that was different in the readme was this:
User.php
In my User.php(Line 330-340) :
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:
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
// 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
any help would be appreciated. Thanks! :)
The custom field options won't show up in the User CP or the registeration page.
The only thing that shows up is the Standard Text Input Field not the Select Box field.
I'm using 2.3.0. The Only thing that was different in the readme was this:
User.php
In my User.php(Line 330-340) :
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:
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
// 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
any help would be appreciated. Thanks! :)