MyBB Hacks

Full Version: Additional Settings For Custom Profile Fields [1.2]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
It is for non custom profile field inputs.
Right now it's possible to display the inputs in UserCP main page (with another file) and EditProfile, the fields on the Profile/Postbit/Memberlist, right? Would it be possible to make it global, at least inputs?

And another suggestion - add minimum/limit for multiple selection.
Adding code like this will display the fields (Display Format/Blank Replacement Value) globally:

PHP Code:
$plugins->add_hook('global_start','xt_proffields_gs');
function xt_proffields_gs(){
	xt_proffields_load($GLOBALS['mybb']->user);
}


Changing the hooks in your xt_ucp_main.php file will display the inputs (Custom Input) on a page (depends on what hooks you use), including the other non custom profile fields (depends on whatever fields loaded/processed in that file).

Thanks, xt_proffields_load($GLOBALS['mybb']->user); in global hook worked well.

However, I have already tried changing the UserCP hook to global, it shows the inputs but:
1) It gives warnings like: "Warning [2] Illegal string offset 'Manchester City' - Line: 581 - File: C:\xampp\htdocs\mybb\inc\plugins\xt_proffields.php PHP 5.4.7 (WINNT)". Manchester City is one of profile field values.
2) After clicking Update Profile value isn't changed, I'm only redirected to UserCP. Here's what I tried:

Code:
<form action="usercp.php" method="post">
                              Favorite club: {$xtpf_minp['fid4']}<br />
                              <input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
                              <input type="hidden" name="action" value="do_update_xt_proffields" />
                              <input type="submit" class="button" value="Update Profile" />
</form>


Also what about min/max selection?

(05-03-2013 06:58 AM)Destroy666 Wrote: [ -> ]However, I have already tried changing the UserCP hook to global, it shows the inputs but:
1) It gives warnings like: "Warning [2] Illegal string offset 'Manchester City' - Line: 581 - File: C:\xampp\htdocs\mybb\inc\plugins\xt_proffields.php PHP 5.4.7 (WINNT)". Manchester City is one of profile field values.
Try downloading the file from the first post (I've updated it) so (hopefully) it "supports" PHP 5.4.

Use codes like this for displaying the value globally:

PHP Code:
$plugins->add_hook('global_start','xt_proffields_gs');
function xt_proffields_gs(){
	global $xtpf;
	$xtpf = xt_proffields_load($GLOBALS['mybb']->user);
}


(05-03-2013 06:58 AM)Destroy666 Wrote: [ -> ]2) After clicking Update Profile value isn't changed, I'm only redirected to UserCP.
At least add the variable to display the inline_error in your template so you know why it isn't updated.

(05-03-2013 06:58 AM)Destroy666 Wrote: [ -> ]Also what about min/max selection?
Maybe later.
Making the xt_proffields_load global as $xptf fixed the warnings, thanks.

(05-04-2013 05:46 AM)RateU Wrote: [ -> ]At least add the variable to display the inline_error in your template so you know why it isn't updated.

I don't really understand what you mean. The errors on the top of page? I have that enabled, they showed only the mentioned warning multiple times, now after clicking Update Profile nothing shows up. Or you mean the {$errors}? After adding it it says "Please correct the following errors before continuing: Please choose a valid birthday privacy option."

(05-04-2013 05:46 AM)RateU Wrote: [ -> ]Maybe later.

Ok, looking forward to it.
ooone more question: does the xt_ucp_main plugin allow the theme selector variable to be used -- {$stylelist}?

I tried that and it wasn't displaying so i think it's not in there unless its another variable.

thank you!
I recently downloaded this plugin and I've noticed a few strange errors.

1) Custom Profile Fields Block doesn't work when Editable by Usergroup is disabled.

2) However, when Editable by Usergroup is enabled, I get an error when I try to update my Board Settings.

Quote:MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
    1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'test, test test', `fid18`='Tiki Astrophel x Orion Astrophel (OTP)', `' at line 2
Query:
    UPDATE mybb_userfields SET `fid1`='', `fid6`='', `fid9`='', `fid10`='', `fid11`='', `fid12`='', `fid13`='Andee Astrophel', `fid3`='Other', `fid14`='From The Ashes', `fid15`='type', `fid16`='more random stuff', `fid17`='He's Sexy and He knows it. ', `fid18`='Tiki Astrophel x Orion Astrophel (OTP)', `fid19`='history. blah blah blah', `fid20`='', `fid21`='4', `fid22`='10', `fid23`='May', `fid24`='8' WHERE ufid='16'

I have no idea why this is happening.

edit: I also should mention that fid18 is not even enabled at the moment. There is no reason it would be causing an error. Plus Board Settings is a completely different page.
2) Looks like you have unescaped apostrophe in query, in "He's Sexy and He knows it" specifically. Try removing it as temporary solution
As far as I know, it should be escaped by MyBB's datahandler (the plugin use MyBB's datahandler to save the info).
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Reference URL's