Additional Settings For Custom Profile Fields [1.2]
Schocker Offline
Junior Member
**
Posts: 2
Joined: Dec 2012
Post: #121
RE: Additional Settings For Custom Profile Fields
I'm afraid it didn't help at all; I still see {VALUE} instead of an actual value, even after rebuilding cache, saving a profile field and editing a user's profile. :/ Do You want me to give you some more details?
12-31-2012 02:45 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #122
RE: Additional Settings For Custom Profile Fields
RateU, I am using the plugin from this post and it seems very cool, thank you - but I have a question.

When the user hits the update profile button, I would like them to be redirected to the profile. Do you know how to make it redirect like that?

Thank you.


[Image: leelink.gif]
MYBB1.6 & XThreads
12-31-2012 07:47 PM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #123
RE: Additional Settings For Custom Profile Fields
(12-31-2012 02:45 AM)Schocker Wrote:  I'm afraid it didn't help at all; I still see {VALUE} instead of an actual value, even after rebuilding cache, saving a profile field and editing a user's profile. :/ Do You want me to give you some more details?

Could you post your profile field setting and the value supplied in your edit profile, so maybe I can reproduce it?


(12-31-2012 07:47 PM)leefish Wrote:  When the user hits the update profile button, I would like them to be redirected to the profile. Do you know how to make it redirect like that?

You can edit the redirect in the plugin file (around line #67):

PHP Code:
67
redirect('usercp.php',$lang->xt_proffields_updated);

to something like:

PHP Code:
67
redirect(get_profile_link($mybb->user['uid']),$lang->xt_proffields_updated);

Yeah, I think it's better if we use a 'single' usercp page, we redirect it to the profile page.


01-01-2013 03:40 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #124
RE: Additional Settings For Custom Profile Fields
Perfect !! Thank you very much.


[Image: leelink.gif]
MYBB1.6 & XThreads
01-01-2013 04:21 AM
Visit this user's website Find all posts by this user Quote this message in a reply
nier3 Offline
Member
***
Posts: 125
Joined: Jul 2012
Post: #125
RE: Additional Settings For Custom Profile Fields
(06-19-2012 08:20 AM)RateU Wrote:  [*]Facebook custom profile field (fid4) - {$xtpf_minp['fid4']}:
  • Regular Expression:

    Code:
    ^[A-Za-z0-9]{5,}$

  • Custom Input:

    HTML Code
    1
    2
    3
    4
    5
    6
    <tr>
    	<td style="width:1px">
    		<img src="images/facebook.png" alt="" title="<func htmlspecialchars_uni>{$xtpf_data['description']}</func>" />
    	</td>
    	<td>{INPUT}</td>
    </tr>

  • Display Format:

    HTML Code
    <a href="http://facebook.com/{VALUE}" target="_blank"><img src="images/facebook_button.png" alt="" /></a>

[*]Twitter custom profile field (fid5) - {$xtpf_minp['fid5']}:
  • Regular Expression:

    Code:
    ^[A-Za-z0-9_]+$

  • Custom Input:

    HTML Code
    1
    2
    3
    4
    5
    6
    <tr>
    	<td style="width:1px">
    		<img src="images/twitter.png" alt="" title="<func htmlspecialchars_uni>{$xtpf_data['description']}</func>" />
    	</td>
    	<td>{INPUT}</td>
    </tr>

  • Display Format:

    HTML Code
    <a href="http://twitter.com/{VALUE}" target="_blank"><img src="images/twitter_button.png" alt="" /></a>

[/list]

I have a problem with social things: I add my facebook page / twitter link / site web url in my usercp, then I save the page, I go on my member profile or my usercp again and social urls are disappeared. Why happen this?

In member profile I have added {$xtpf['fidX']} for facebook / twitter / site web urls.
(This post was last modified: 01-03-2013 11:45 AM by nier3.)
01-03-2013 11:10 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #126
RE: Additional Settings For Custom Profile Fields
Hi RateU, I am now using the plugin from this page and I am attempting to add the hide email option; I added it to the one page usercp but the "check" in the checkbox is not holding. Do I need to edit the plugin file or can the check be done via templates?

I figured it out - plugin edit.


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 01-03-2013 10:10 PM by leefish.)
01-03-2013 07:45 PM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #127
RE: Additional Settings For Custom Profile Fields
(01-03-2013 11:10 AM)nier3 Wrote:  I have a problem with social things: I add my facebook page / twitter link / site web url in my usercp, then I save the page, I go on my member profile or my usercp again and social urls are disappeared. Why happen this?

In member profile I have added {$xtpf['fidX']} for facebook / twitter / site web urls.

Do you mean by the 'usercp' is the usercp_profile template (User CP Edit Profile page) or the usercp template (main User CP page)?
Maybe it is better if you post the profile field settings and your template.

(01-03-2013 07:45 PM)leefish Wrote:  I figured it out - plugin edit.

Just an additional info (if we use a single usercp page - please make sure to block them for accessing the Edit Options and the Edit Profile page), we can force a value of a field by adding it to $userxtpf array inside the plugin (no matter whether the settings is displayed or not).
For example, add this code in the $userxtpf['options'] array will force (hopefully) the user to use the classic postbit layout when they update their profile:

PHP Code:
$userxtpf['options']['classicpostbit'] = 1;


01-04-2013 02:24 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #128
RE: Additional Settings For Custom Profile Fields
Hi RateU - yes, I did notice that accessing the edit profile page with a single usercp did cause settings to get "damaged" - I shall make that edit.

I had made it so all the fields were hidden, with the "correct" values hardcoded. Perhaps it is an idea to have a redirect back from the Edit profile and edit options pages back to usercp? Not that I know how to do that.


[Image: leelink.gif]
MYBB1.6 & XThreads
01-04-2013 03:02 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #129
RE: Additional Settings For Custom Profile Fields
(01-04-2013 03:02 AM)leefish Wrote:  Perhaps it is an idea to have a redirect back from the Edit profile and edit options pages back to usercp?

There are some options to do that (by editing the xt_ucp_main.php file):
After:

PHP Code:
if($GLOBALS['mybb']->settings['xt_proffields_ucp'] != 0){

try adding this code:

PHP Code:
if(in_array($GLOBALS['mybb']->input['action'],array('profile','do_profile','options','do_options'))){
	redirect('usercp.php','The Administrator has been disabled this page. You\'ll be redirected to the page where you can edit your profile');
}

or this code:

PHP Code:
1
2
3
4
5
6
7
8
global $plugins;
$plugins->add_hook('usercp_profile_start','xt_ucp_main_usercp_block');
$plugins->add_hook('usercp_do_profile_start','xt_ucp_main_usercp_block');
$plugins->add_hook('usercp_options_start','xt_ucp_main_usercp_block');
$plugins->add_hook('usercp_do_options_start','xt_ucp_main_usercp_block');
function xt_ucp_main_usercp_block(){
	redirect('usercp.php','The Administrator has been disabled this page. You\'ll be redirected to the page where you can edit your profile');
}


01-04-2013 04:02 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #130
RE: Additional Settings For Custom Profile Fields
Great - I shall try this on local host.

Do you think there will be any interest in the hideemail edit I did? Should I post the changes?


[Image: leelink.gif]
MYBB1.6 & XThreads
01-04-2013 04:34 AM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: