MyBB Community Forums

Full Version: Custom ProfileField Postbit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

I downloaded this plugin http://mods.mybb.com/view/profilefields-on-postbit and it is partially broken. Partially broken because it does not show the option in the profile field (of ACP) to enable or disable, it does work in such that I have to make small edit in database for it to enable specific profile field to be shown on postbit

It did be nice though to have it shown on the ACP's custom profile fileld...
I suspect that there is something wrong within this code but I do not know where as I'm not a mybb dev and don't really understand the hooking things

function fieldsonpostbit_hook()
{
	global $plugins;
	
	$plugins->add_hook("admin_formcontainer_end", "fieldsonpostbit_form");
}
function fieldsonpostbit_form()
{
    global $mybb, $lang, $form, $form_container;
    
    $lang->load("fieldsonpostbit");
    
    if($args['title'] == $lang->min_posts_enabled)
	{
		$show_profilefield = array(
			$form_container->output_row($lang->show_on_postbit." <em>*</em>", $lang->show_on_postbit_desc, $form->generate_yes_no_radio('showonpostbit', $mybb->input['showonpostbit'])),
			$form_container->output_row($lang->is_image." <em>*</em>", $lang->is_image_desc, $form->generate_yes_no_radio('isimage', $mybb->input['isimage'])),
			$form_container->output_row($lang->image_type." <em>*</em>", $lang->image_type_desc, $form->generate_text_box('imagetype', $mybb->input['imagetype'], array('class' => 'field50'))),
			$form_container->output_row($lang->path_to_image." <em>*</em>", $lang->path_to_image_desc, $form->generate_text_box('imagepath', $mybb->input['imagepath']))
		);
		$form_container->output_row($lang->showonpostbit, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $show_profilefield)."</div>");
	}
}
Is there a reason you need to use this plugin? You can do the same thing by editing your postbit_author_user template and adding:

{$post['fidX']}

Where X is the number of the profile field.
Yea, I decided to use what you mentioned since I realized that this plugin don't work in all theme.