Additional Settings For Custom Profile Fields [1.2]
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #1
Additional Settings For Custom Profile Fields [1.2]
Requirement: XThreads

XThreads has too many useful functions (called by me as treasures Biggrin).
So, I try to use those functions, and some copy and paste from Yumi/ZiNgA's codes there (Biggrin) to create this plugin.
At least I can achieve (hopefully) some of my points here:
http://mybbhacks.zingaburga.com/showthre...http://mybbhacks.zingaburga.com/showthread.php?tid=309&pid=16

With this plugin, we'll have (hopefully) some additional settings like XThreads for our Custom Profile Fields:
  • Blank Replacement Value and Display Format (for profile page, postbit and memberlist).
  • Viewable By Usergroup.
  • Editable By Usergroup.
  • Regular Expression (for textbox, select box (single) and option buttons).
  • MyBB parser (for textbox and textarea): HTML, MyCode, img code, video code, smilies, badwords.
  • Displaying a non required (but must be editable) field on registration page.
  • Custom Input.
  • Formatting Map List.
Actually, I created this plugin for my personal use only. But I think it's OK to share it here with XThreads mania to test it.
Because I'm not a coder, please don't expect too much from this plugin and please don't laugh at me Biggrin
I'm still learning.


ACP - Postbit - Profile - Memberlist
               


Attached File(s)
.7z  xtpf.7z (Size: 7.31 KB / Downloads: 1311)

(This post was last modified: 07-30-2013 04:01 AM by RateU.)
03-31-2012 07:38 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #2
RE: Additional Settings For Custom Profile Fields
This looks like it may be very handy RateU - downloading to test it out Biggrin


[Image: leelink.gif]
MYBB1.6 & XThreads
03-31-2012 10:03 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #3
RE: Additional Settings For Custom Profile Fields
I will try it, it looks very useful for those who want to extend profile fields.

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
03-31-2012 11:34 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: #4
RE: Additional Settings For Custom Profile Fields
Thanks for your time to testing it out Smile

04-01-2012 07:30 AM
Find all posts by this user Quote this message in a reply
lilah Offline
Junior Member
**
Posts: 18
Joined: Mar 2012
Post: #5
RE: Additional Settings For Custom Profile Fields
I'll definitely give it a try Smile maybe it ends the misery I'm in with the other custom profile fields plugin, i love that you can set an own display format for each field
04-01-2012 11:25 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #6
RE: Additional Settings For Custom Profile Fields
Haven't tried, but nice thinking Smile

My Blog
04-01-2012 09:25 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #7
RE: Additional Settings For Custom Profile Fields
Thanks, Yumi Biggrin

(04-01-2012 11:25 AM)lilah Wrote:  I'll definitely give it a try Smile maybe it ends the misery I'm in with the other custom profile fields plugin, i love that you can set an own display format for each field
This plugin doesn't effect the default custom profile fields in profile page (the {$profilefields} block). If you want it to be effected by this plugin, you need to change the value of this code in the plugin file (line #297):

PHP Code:
297
$xt_proffields_custom = 0;

to

PHP Code:
297
$xt_proffields_custom = 1;

There are some behavior changes (hopefully) for the {$profilefields} block if we activate the code above:

  • It will use the parser (HTML, MyCode, img code, video code, smilies, badwords).
  • If we hide a custom profile field, it won't be displayed in the {$profilefields} block. So, if we use {$xtpf['fidX']} in the member_profile template for a custom profile field, maybe we need to hide it. With this way we can prevent the same profile field displayed twice in the page.
  • It will use the Viewable By Usergroup permission.
  • It will use the Display Format if there is value for the profile field.
  • If there is no value for the profile field (user didn't fill the field), the Blank Replacement Value will be displayed.
Unfortunately, if we activate the code above, we can't use the type of plugins you posted in this thread:
http://mybbhacks.zingaburga.com/showthread.php?tid=1248
because it'll override each other for the default {$profilefields} block (I don't know how to handle it Biggrin).
That's why it is disabled by default and I want to use it for my personal use only.

Just an additional info, we can use template conditional structures (hopefully) in the Display Format and Blank Replacement Value.
For example:

Code:
1
2
3
4
5
6
7
<if THIS_SCRIPT == 'member.php' then>
How we want it to be displayed in profile page
<elseif THIS_SCRIPT == 'showthread.php' then>
How we want it to be displayed in postbit
<else>
How we want it to be displayed in memberlist
</if>

And again, because I'm not a coder, don't expect too much from this plugin and please don't laugh at me Biggrin


04-03-2012 07:41 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #8
RE: Additional Settings For Custom Profile Fields
Reporting in - it works pretty damned awesomely Biggrin

I will have a go at redesigning my profiles layout using this. I have ONE suggestion - and I am not sure if it is even possible - but is there a way to restrict editing the profile field to certain usergroups?

As far as I can tell, we can restrict who sees them - but we cannot restrict who fills them in.


[Image: leelink.gif]
MYBB1.6 & XThreads
04-03-2012 10:03 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: #9
RE: Additional Settings For Custom Profile Fields
Thanks, Lee Smile

You can try the update.

To upgrade, replace all the plugin files with the new one.
There is a xt_proffields_upgrade.php file inside the archive.
Upload it to your plugins folder. Activate and deactivate the upgrade file.
After deactivating it, you can delete it.

There are two settings in the plugin files:

PHP Code:
338
$xt_proffields_custom = 0;

replace it to:

PHP Code:
338
$xt_proffields_custom = 1;

for the default {$profilefields}

and

PHP Code:
528
$xt_proffields_custom_edit = 0;

for the Editable by Usergroups setting (will be applied in UserCP and for editable and non required fields only).

If we activate the codes above, there is a behavior change in the {$profilefields} block (again, hopefully).
Beside using the Viewable by Usergroups permission, it will use the Editable by Usergroups permission too.
For example, if a profile field is settable by A, B, C and D usergroup/additional usergroups only, it will be displayed in the profile page if the profile page owner is in usergroup A, B, C or D (or at least they have one of those usergroup in their additional usergroups list).
With this way we can make it a bit private for each usergroup Biggrin
If the profile page owner is in usergroup A, B, C or D (or at least they have one of those usergroup in their additional usergroups list), but the viewer doesn't have permission to view it (Viewable by Usergroups setting), it won't be displayed.
It won't be displayed if the field is empty and there is no value supplied in Blank Replacement Value.


04-04-2012 07:49 AM
Find all posts by this user Quote this message in a reply
Divvy Offline
Junior Member
**
Posts: 37
Joined: Jan 2012
Post: #10
RE: Additional Settings For Custom Profile Fields
Great plugin, thank you Smile
04-04-2012 10:49 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: