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
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
[attachment=786] [attachment=759] [attachment=760] [attachment=761]
This looks like it may be very handy RateU - downloading to test it out Biggrin
I will try it, it looks very useful for those who want to extend profile fields.
Thanks for your time to testing it out Smile
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
Haven't tried, but nice thinking Smile
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:
$xt_proffields_custom = 0;

to

PHP Code:
$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:
<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

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.
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:
$xt_proffields_custom = 0;

replace it to:

PHP Code:
$xt_proffields_custom = 1;

for the default {$profilefields}

and

PHP Code:
$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.

Great plugin, thank you Smile
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Reference URL's