MyBB Community Forums

Full Version: Adding a custom profile field to the postbit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a way to do this? I have a "Custom Title" field, but I can't figure out the variable that would allow me to add it to the postbit.

I know vB does this, and I've noticed that MyBB is quite similar, so I'm hoping it has the option as well. ^^;
Try $post[fid1]
However, you will have to htmlspecialchars() any value so that users cannot use HTML or javascript in this field and then get it to display in posts!
I don't think htmlspecialchars() will work directly in the postbit template, so you must edit the postbit function in one of the function pages.

  1. Open inc/functions_post.php
  2. Find:
    	$post['subject'] = htmlspecialchars(stripslashes($post['subject']));
  3. Add after that:
    $post['fid1'] = htmlspecialchars(stripslashes($post['fid1']));
  4. Save and upload.
I think that should work.

fid1 is the column name of your custom profile field. So you have to check your database table called "mybb_profilefields" and find out the "fid" of the profile field you want to display.