MyBB Community Forums

Full Version: {$customfields}
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I have a question and dont seem to be able to find the solution to it.

Normally with most things you can just ad ['fidX'] ({$customfields['fidX']} in this case. With almost all settings. Only this doesnt seem to work for customfields.

What im trying to do is:

In usercp_profile_profilefields (Manage Template > User Control Panel Templates > usercp_profile_profilefields ) i want to edit this file. I want to make it display the customfield things in a custom way. I would like the ability to add 3 next to each other.

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

This:

<br />
<fieldset class="trow2">
<legend><strong>{$lang->additional_information}</strong></legend>
<table cellspacing="0" cellpadding="{$theme['tablespace']}" width="100%"><br />
Title  <br />
{$customfields['fid1']}{$customfields['fid2']}{$customfields['fid3']} <br />
Some other information etc.
</table>
</fieldset>

And just customize that whole thing exactely the way i want to.
Hopefully anybody is able to help me with this.

edit:

quick note i forgot to add when i try this i end up with:
>
only displaying.

I guess no replies means this is not possible Sad
Bump (if thats even allowed sorry if its not) Still having the same problem anybody got any suggestions if or how i can display the customfields differently?
Try this:

{$userfields['fidX']}
Sorry i forgot to update the original post, but i mean the place where to input the information. UserCP > (Edit profile)
Currently that displays the Customfields in one giant box. And everything is done like this:
<tr>
<td>
<a title="{$profilefield['description']}" style="text-decoration: none;">{$profilefield['name']}</a>:
<br />
<span class="smalltext">{$profilefield['description']}</span>
</td>
</tr>
<tr>
<td>{$code}</td>
</tr>

I would like to change that to how i want this to be displayed on a customfield by field basis.
And even rather pull all of them out of the additional information box if thats possible.
Ah, I'm not sure it's possible due to how the fields are actually fetched unfortunately. The fields are fetched in a loop that builds the output.
I actually had to do this once, I can't quite remember what for though. I remember it being a blueberry to do, it took me quite some time. You have to add in the variable in the templates, put the code inside that template and then call the variable where you want it.
Quote:Ah, I'm not sure it's possible due to how the fields are actually fetched unfortunately. The fields are fetched in a loop that builds the output.

Ah well if its not possible nothing i can do then. Would be a nice suggestion to add such a option or template edit with a future release.

Quote:I actually had to do this once, I can't quite remember what for though. I remember it being a blueberry to do, it took me quite some time. You have to add in the variable in the templates, put the code inside that template and then call the variable where you want it.

Could you explain in a bit more detail what you exactly mean. And how i would achieve it with maybe some template code examples, or a link where i could read it.

To make it a bit easier this is what im trying to achieve:

[Additional Information]
Bio:
(textarea)
Main:
(textbox char name) | (textbox char realm)
Alts:
(textbox char name) | (textbox char realm)
(textbox char name) | (textbox char realm)
(textbox char name) | (textbox char realm)
(textbox char name) | (textbox char realm)
[end of the additional information box]

So simply less titles above every individual input field and to place them next to each other.
(2012-04-11, 11:36 PM)anori Wrote: [ -> ]
Quote:Ah, I'm not sure it's possible due to how the fields are actually fetched unfortunately. The fields are fetched in a loop that builds the output.

Ah well if its not possible nothing i can do then. Would be a nice suggestion to add such a option or template edit with a future release.

Quote:I actually had to do this once, I can't quite remember what for though. I remember it being a blueberry to do, it took me quite some time. You have to add in the variable in the templates, put the code inside that template and then call the variable where you want it.

Could you explain in a bit more detail what you exactly mean. And how i would achieve it with maybe some template code examples, or a link where i could read it.

Ugh, erm.

Go to ACP > Templates & Style > Templates > Your Theme > Add Template

Once you've added your template, go to where you created it, put the code inside of where you want it. Now, erm, SH*T I just remembered you have to edit a PHP file, give me 5 minutes while I troll through my files, I think it's the templates file, just give me a second.
(2012-04-11, 11:40 PM)Deliver Wrote: [ -> ]Go to ACP > Templates & Style > Templates > Your Theme > Add Template

Once you've added your template, go to where you created it, put the code inside of where you want it. Now, erm, SH*T I just remembered you have to edit a PHP file, give me 5 minutes while I troll through my files, I think it's the templates file, just give me a second.



No worries take your time, i still wonder though how are you going to grab each individual custom field. Since currently doing something like:
{$profilefield['fidX']} Doesnt actually grab that one input frame. And i cant really find any other way to just grab that one input part.
I believe it's the "functions.php" in your "inc" folder, but my cpanel is being retarded so I can't look right now, give me another 5 minutes.
Pages: 1 2