MyBB Community Forums

Full Version: custom profile fields, images
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
How can I turn on html or BBcode for a specific custom profile field? Also, what would be the PHP to embed it in another part of the forum? Like {$custom_profile(name here)} <- I'm just making a guess.
Quote:How can I turn on html or BBcode for a specific custom profile field?
You can't. Whether for all or for none. Plus it is dangerous,like any code might mess your pages.

Quote:what would be the PHP to embed it in another part of the forum? Like {$custom_profile(name here)} <- I'm just making a guess.
Specify which place, coz in some places we don't need to code a lot, in other we need differnet codes, so tell me where you want to display them and i will provide you with the solution
Well I wanted to add a Multiple Selection area in the User CP so people can select fan tags that I add to the selection. Then their selected fan tags would be displayed in a certain part of their signature. (Left)
To display them in postbit signature you will need to do the following:
in Admin CP > Templates > Modify /Delete > Expand > postbit templates >postbit_signature

Put

{$post['fidX']}

Replace X by the id of custom profile field.You can find it in their manager.

Now to show this also in the signature in the profile page open member.php
Find
if($customfields)
	{
		eval("\$profilefields = \"".$templates->get("member_profile_customfields")."\";");
	}
Below it add
eval("\$signature = \"".$templates->get("member_profile_signature")."\";");


And in member_profile_signature template add

{$userfields['fidX']}

Same story for X
Thanks, but I'de like the custom profile so I can add images, then the user can check boxes of what images they want displayed. After they check the images they want displayed, their signature will show the images. Like this,
*Image Photoshoped*
[Image: examplewa7.jpg]
I know how to how to set it up so it's displayed on the left of the users signature, I just need to know how I can use BB, or html, in the area where I add the selections for the custom profile. It's basicly a second signature area, except they can't code what's in it, only select images I put in the selection.
Alright but when they choose we can't display pictures alright, they will only see text in User CP and images will only be displayed in the signature.

So from Admin CP > Users and Groups > Custom Profile Fields
Create a new one, make sure that the Field Type is Multiple Selection Selection Box

Note down the the ID of this new FID and also the criteria you selected.

Now open ./inc/functions_post.php
find
		$post['signature'] = $parser->parse_message($post['signature'], $sig_parser);

Above itadd
	$multi_pf = explode("\n", $post['fidX']);
	$mutli_pf_images = '';
	if(is_array($multi_pf))
	{
		foreach($multi_pf as $val)
		{
			if($val != '')
			{
				$mutli_pf_images .= "<img src=\"./images/$val.gif\" border=\"0\"/><br/>";
			}
		}
	}

Replace X by the fid, See the source of the images? i have coded it so that the images  use/have the same name of the criteria you have added while creating this profile field.

So if you put Hello. You should have an images called Hello.gif

In postbit_signature template, put
{$mutli_pf_images}

Now let's add it to the profile.
open member.php
Find
if($customfields)
    {
        eval("\$profilefields = \"".$templates->get("member_profile_customfields")."\";");
    } 
Below it add
	$multi_pf = explode("\n", $userfields['fidX']);
	$mutli_pf_images = '';
	if(is_array($multi_pf))
	{
		foreach($multi_pf as $val)
		{
			if($val != '')
			{
				$mutli_pf_images .= "<img src=\"./images/$val.gif\" border=\"0\"/><br/>";
			}
		}
	}
eval("\$signature = \"".$templates->get("member_profile_signature")."\";"); 
Same thing for X

And in member_profile_signature template add

{$mutli_pf_images}
Thanks for the help. I did as you said, but it's not a selection area, it's just a small input field. Also, the 'Sex' field is no longer a drop down box, it's a small input field the same as the fan tags. I can't type anything in them either.
[Image: ften0.gif]
My code doesn't touch those things.
Are you sure you have not messed up in the Custom Profile Fields manager by selecting different input types?
I've changed the input type, after I've already tested it. I'll redo everything, starting with a new custom profile. But just to go over it,
Quote:Name: Fan Tags
Desc. -
Maximum Length: 0
Field Length: 20
Display Order: 4
Field Type: Multiple Option Selection Box
Selectable Options: (temp)
star
0stars
Required? No.
Editable by User? Yes
Hidden on Profile? No

Edit:
I removed everything you said to do now, but it's still
[Image: ften0.gif]

Edit:
I just took out the WYSIWYG editor, because the edit wasn't working, and now the selection boxes are back. So I'm about to redo your instructions.
Edit: It works now! Thanks a lot!
Alright then Toungue i was worried about this... good you worked it out..
Pages: 1 2