Additional Settings For Custom Profile Fields [1.2]
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #161
RE: Additional Settings For Custom Profile Fields
It is for non custom profile field inputs.

04-30-2013 02:40 AM
Find all posts by this user Quote this message in a reply
Destroy666 Offline
Junior Member
**
Posts: 27
Joined: Jul 2012
Post: #162
RE: Additional Settings For Custom Profile Fields
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.
05-02-2013 08:37 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #163
RE: Additional Settings For Custom Profile Fields
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).


05-03-2013 02:46 AM
Find all posts by this user Quote this message in a reply
Destroy666 Offline
Junior Member
**
Posts: 27
Joined: Jul 2012
Post: #164
RE: Additional Settings For Custom Profile Fields
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:
1
2
3
4
5
6
<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
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #165
RE: Additional Settings For Custom Profile Fields
(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.

05-04-2013 05:46 AM
Find all posts by this user Quote this message in a reply
Destroy666 Offline
Junior Member
**
Posts: 27
Joined: Jul 2012
Post: #166
RE: Additional Settings For Custom Profile Fields
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.
(This post was last modified: 05-04-2013 07:06 AM by Destroy666.)
05-04-2013 07:05 AM
Find all posts by this user Quote this message in a reply
Gstone Offline
Member
***
Posts: 55
Joined: May 2012
Post: #167
RE: Additional Settings For Custom Profile Fields
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!
05-24-2013 03:49 PM
Find all posts by this user Quote this message in a reply
Lindsey Offline
Junior Member
**
Posts: 2
Joined: May 2013
Post: #168
RE: Additional Settings For Custom Profile Fields
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.
(This post was last modified: 05-24-2013 07:09 PM by Lindsey.)
05-24-2013 07:03 PM
Find all posts by this user Quote this message in a reply
Destroy666 Offline
Junior Member
**
Posts: 27
Joined: Jul 2012
Post: #169
RE: Additional Settings For Custom Profile Fields
2) Looks like you have unescaped apostrophe in query, in "He's Sexy and He knows it" specifically. Try removing it as temporary solution
(This post was last modified: 05-24-2013 07:56 PM by Destroy666.)
05-24-2013 07:56 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #170
RE: Additional Settings For Custom Profile Fields
As far as I know, it should be escaped by MyBB's datahandler (the plugin use MyBB's datahandler to save the info).

06-15-2013 01:18 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: