Customizing SMF > SMF Coding Discussion

Different custom profile fields for different themes

(1/2) > >>

ara_is_sweet:
I have searched for a while, and haven't found any answers yet. :(

I would like to have some profile fields only to show up in spesific themes. While every field is on the profile page and can be edited.
I'm hoping this could be accomplished with a custom theme based Display.template.php, but im still new to php.

Simply put, I want to exclude the fields from here:

--- Code: --- // Any custom fields for standard placement?
if (!empty($message['member']['custom_fields']))
{
foreach ($message['member']['custom_fields'] as $custom)
if (empty($custom['placement']) || empty($custom['value']))
echo '
<li class="custom">', $custom['title'], ': ', $custom['value'], '</li>';
}
--- End code ---

And here:

--- Code: --- // Are there any custom profile fields for above the signature?
if (!empty($message['member']['custom_fields']))
{
$shown = false;
foreach ($message['member']['custom_fields'] as $custom)
{
if ($custom['placement'] != 2 || empty($custom['value']))
continue;
if (empty($shown))
{
$shown = true;
echo '
<div class="custom_fields_above_signature">
<ul class="reset nolist">';
}
echo '
<li>', $custom['value'], '</li>';
}
if ($shown)
echo '
</ul>
</div>';
}
--- End code ---

Anyone who can help me?

K@:
The way the SMF system works, is that any files that don't appear in the custom theme's directory get read from the default theme's directory.

So, if the custom theme has a file in it, it'll use it.

If you make each one different, they will work with just that theme.

So, copy the file from the default theme, put it in the custom theme's directory and edit it the way you want.

It SHOULD be that easy.

Does that help, much?

ara_is_sweet:
Yes, I'm aware.. I'm asking for some coding help here, as im a newb to php. :)

Arantor:
I'd love to know why you want different fields in different themes.

ara_is_sweet:
Its's a gaming forum, and devided up in sub categories, each category for a different game, and each with a different theme.

On the diablo forum, I only want the custom profile fields related to diablo showing.
And on the WoW forum, I only want WoW info and so on.. I think you got the idea :)

Navigation

[0] Message Index

[#] Next page

Go to full version