MyBB Community Forums

Full Version: Problems with userfields modification
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I work on a modification. I want add additional categorys for the userfields.

In the moment I'm testing some ideas. But it doesent work.

In the template usercp_profile_profilefields is responsible for the userfields

Original Version:
Code:
<br />
<fieldset class="trow2">
<legend><strong>{$lang->additional_information}</strong></legend>
<table cellspacing="0" cellpadding="{$theme['tablespace']}" width="100%">
{$customfields}
</table>
</fieldset>

First I doubled the code (for testing):
Code:
<br />
<fieldset class="trow2">
<legend><strong>{$lang->additional_information}</strong></legend>
<table cellspacing="0" cellpadding="{$theme['tablespace']}" width="100%">
{$customfields}
</table>
</fieldset>

<br />
<fieldset class="trow2">
<legend><strong>Test</strong></legend>
<table cellspacing="0" cellpadding="{$theme['tablespace']}" width="100%">
{$customfields}
</table>
</fieldset>

Now the userfields shown twice. Than I changed the second {$customfields} in {$test}.

Than I edit the user.php. I doubled this:
PHP Code:
    // Custom profile fields baby!
    
$altbg "trow1";
    
$requiredfields '';
    
$customfields '';
    
$query $db->simple_select(TABLE_PREFIX."profilefields""*""editable='yes'", array('order_by' => 'disporder'));
    while(
$profilefield $db->fetch_array($query))
    {
        
[...]

    if(
$customfields)
    {
        eval(
"\$customfields = \"".$templates->get("usercp_profile_profilefields")."\";");
    } 

and changed alle $customfield to $test in the area wich was copied.

Now I thought, the userfields have to shown twice again, but the second box, is empty...

Excuse my bad english, in the attachments: my usercp.php
Reference URL's