PDA

View Full Version : member.php coding


Gio~Logist
07-25-2005, 07:07 PM
I took this code from member.php, where here is it that html is filtered out from profile fields?


// *********************
// CUSTOM PROFILE FIELDS
$profilefields = $DB_site->query("
SELECT profilefieldid, required, title, type, data, def, height
FROM " . TABLE_PREFIX . "profilefield
WHERE form = 0 OR 6 OR 7 OR 8" . iif(!can_moderate(), "
AND hidden = 0") . "
ORDER BY displayorder
");


$search = array(
'#(\r\n|\n|\r)#',
'#(<br />){3,}#', // Replace 3 or more <br /> with two <br />
);
$replace = array(
'<br />',
'<br /><br />',
);

while ($profilefield = $DB_site->fetch_array($profilefields))
{
exec_switch_bg();
$profilefieldname = "field$profilefield[profilefieldid]";
if ($profilefield['type'] == 'checkbox' OR $profilefield['type'] == 'select_multiple')
{
$data = unserialize($profilefield['data']);
foreach ($data AS $key => $val)
{
if ($userinfo["$profilefieldname"] & pow(2, $key))
{
$profilefield['value'] .= iif($profilefield['value'], ', ') . $val;
}
}
}
else if ($profilefield['type'] == 'textarea')
{
$profilefield['value'] = preg_replace($search, $replace, trim($userinfo["$profilefieldname"]));
}
else
{
$profilefield['value'] = $userinfo["$profilefieldname"];
}
if ($profilefield['value'] != '')
{
$show['extrainfo'] = true;
}
eval('$customfields .= "' . fetch_template('memberinfo_customfields') . '";');

}
// END CUSTOM PROFILE FIELDS

altsounds
09-21-2005, 09:31 PM
I want to be able to do this too. From my tests and looking at the code (not the worlds best coder) it seems that html is indeed "allowed" in terms of if you put a <b>Text</b> it shows it within your profile HOWEVER it shows it as text and I am stumped also how to invoke that html to show it rather just displaying it as text.

Can anyone help us??

altsounds
09-23-2005, 03:49 PM
Anyone??