PDA

View Full Version : help with displaying multiple menu choice in postbit


FatalBreeze
08-06-2005, 05:04 PM
Hello i've created a new profile field in my forum.
his id is: field8 and his type is Multiple-Selection-Checkbox.
now i wanted to display its value in the postbit_legacy,
so i went a bit through member.php and i came up with the following code:


$profilefields = $DB_site->query("
SELECT profilefieldid, required, title, type, data, def, height
FROM " . TABLE_PREFIX . "profilefield
WHERE form = 0 " . iif(!($permissions['genericpermissions'] & CANSEEHIDDENCUSTOMFIELDS), "
AND hidden = 0") . "
ORDER BY displayorder
");
while ($profilefield = $DB_site->fetch_array($profilefields))
{
exec_switch_bg();
if ($profilefield['type'] == 'checkbox')
{
$data = unserialize($profilefield['data']);
foreach ($data AS $key => $val)
{
if ($post["field8"] & pow(2, $key))
{
$profilefield['value'] .= iif($profilefield['value'], ', ') . $val;
}
}
}
}
$games = $profilefield['value'];


and put it in functions_showthread.
and in the postbit_legacy template i added the variable $games of course.
the problem is, that it doesn't work.... :(

Can you please help me?

Andrew111888
08-07-2005, 07:21 AM
If you have added a post field via the Admin CP all you need to do to display it in the postbit is add $post[fieldx] to your postbit template, where x is the profile field id.

FatalBreeze
08-07-2005, 10:23 AM
you right, but only if i add a text profile field or something like that, but i added a multiple check-box and if ill put in the postbit the code $post[field8] then the value will be 7 or something like that... because before the value is stored in the db it goes through some changes(pow and some more) and to decrypte you need to do some of the changes that i wrote above.

bigcurt
08-07-2005, 12:25 PM
<a href="http://www.vbulletin.com/forum/showthread.php?t=108785" target="_blank">http://www.vbulletin.com/forum/showthread.php?t=108785</a> ---read all that

~Curt

FatalBreeze
08-07-2005, 09:37 PM
thanks mate :)

bigcurt
08-08-2005, 08:41 AM
No problem man ;).



~Curt