vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   Using your User Profile Fields in your postbit templates (w/ all plugin method) (https://vborg.vbsupport.ru/showthread.php?t=250418)

akz645 08-30-2015 12:32 AM

Quote:

Originally Posted by Lynne (Post 2548625)
...

Quote:

Originally Posted by MarkFL (Post 2551263)
...

Multiple-Selection Menu
&
Multiple-Selection Checkbox

1) How do I get some/all of those fields highlighted/checkboxes ticked as the default during registration?

2) How do I force all my existing members into updating their user profile settings?
I have some forced options now (like gender). Members who are registering now are forced to pick male or female.
Whereas members who have already signed up, they aren't forced as nothing appears in their postbit (gender) unless they go to their userCP profile and press save.


P.S=
Thank you Lynne for this brilliant article :up:

Lynne 08-30-2015 03:23 PM

1. For Multiple-Selection Menu, you may set the first one as default but that is the only option. There is no way to pre-select several checkboxes. I think you would need to write a plugin to do that.

2. I think you can set Field Required to Yes, Always and that should do what you want.

Quote:

Yes, always - User will be required to complete this field at registration. Enabling this setting will force all users to complete it before they can continue using your forum. This applies only if the field is shown on the "Edit Your Details" page.

akz645 08-30-2015 08:14 PM

Quote:

Originally Posted by Lynne (Post 2553901)
1. For Multiple-Selection Menu, you may set the first one as default but that is the only option.

http://i.imgur.com/oBVhrlM.png + http://i.imgur.com/6h0gmLS.png
How do I set the first option as the default (highlighted)?
As the current settings I'm using, doesn't do this...
Quote:

Originally Posted by Lynne (Post 2553901)
2. I think you can set Field Required to Yes, Always and that should do what you want.
"Yes, always - User will be required to complete this field at registration. Enabling this setting will force all users to complete it before they can continue using your forum. This applies only if the field is shown on the "Edit Your Details" page."

Cheers, that worked.
Yes, at registration and profile updating - Doesn't work.
Yes, always - Worked :)

Lynne 08-31-2015 02:29 PM

1) Whoops, sorry, I was looking at the wrong type of profile field (single-selection menu, not multi-selection menu).

akz645 08-31-2015 09:48 PM

Quote:

Originally Posted by Lynne (Post 2553951)
1) Whoops, sorry, I was looking at the wrong type of profile field (single-selection menu, not multi-selection menu).

Ah alright. Anyway, thanks for the help :)

https://vborg.vbsupport.ru/showthread.php?t=320081
I made a request for somebody to make a plugin allowing the admin to set defaults for Multiple-Selection Menu/Checkbox when creating a User Profile Field.

akz645 09-17-2015 12:52 AM

Quote:

Originally Posted by Lynne (Post 2553951)
...

Quote:

Originally Posted by MarkFL (Post 2551263)
...

1) Do you know any way to set it so only certain usergroups will have X User Profile Field option appear in their userCP?

2) How do I execute a SQL Query to force All Users/ Certain Usergroups/ Certain Users to have their X user profile field options changed into what I want?
They can change into what they want from the userCP later.

Lynne 09-17-2015 03:17 PM

1) No, I do not.

2) Very hard to say without specifics. But, you can probably use phpMyAdmin to do it.

akz645 09-17-2015 03:22 PM

Quote:

Originally Posted by Lynne (Post 2555206)
2) Very hard to say without specifics. But, you can probably use phpMyAdmin to do it.

I was hoping it would be something straight forward like this:

Invisible
On: UPDATE user SET options=options + 512 WHERE NOT(options & 512);
Off: UPDATE user SET options=options - 512 WHERE options & 512;

Run from Execute SQL Query

Where you'd just need to colour code what I need to change depending on my options & field number.

Lynne 09-17-2015 07:42 PM

It would be something like that only on the userfield table (where the settings for the user profile fields are kept). But, if it is for a certain usergroup, your WHERE statement would have to include a SELECT of only certain users whose user.usergroupid was xx since the usergroupid is not included in the userfield table. I'm not good at writing those sort of queries.

akz645 09-27-2015 08:03 PM

Quote:

Originally Posted by akz645 (Post 2555178)
How do I execute a SQL Query to force All Users/ Certain Usergroups/ Certain Users to have their X user profile field options changed into what I want?
They can change into what they want from the userCP later.

Glenn Vergara posted how to do it, from vbulletin.com :)

1)
Code:

UPDATE userfield SET field5='Hide' where userid in (SELECT userid FROM user WHERE usergroupid IN (X, X, X))
This code allows you to change a usergroups' custom user profile field (any option they have), to whatever specific option you want them all to have changed to.
Key:
Red = User Profile Field ID.
Green = User Profile Field Option you want to change to.
Blue = Usergroup ID.

2)
Code:

UPDATE userfield SET field5='Hide' where field5='Male' AND userid in (SELECT userid FROM user WHERE usergroupid IN (X, X, X))
This code allows you to change a usergroups' custom user profile field (any single option), to whatever other specific option you want them all to have it changed to.
Key:
Red = User Profile Field ID.
Green = User Profile Field Option you want to change to.
Orange = Option you want changed.
Blue = Usergroup ID.

3)
Code:

UPDATE userfield SET field5='Hide' where (field5='Male' OR field5='Female') AND userid in (SELECT userid FROM user WHERE usergroupid IN (X, X, X))
This code allows you to change a usergroups' custom user profile field (multiple options), to whatever specific option you want them all to have it changed to. If they have selected an option you don't include (example: Other), then users who have selected that option will be left unaffected.
Key:
Red = User Profile Field ID.
Green = User Profile Field Option you want to change to.
Orange = Option you want changed.
Blue = Usergroup ID.

Note: Change usergroupid to userid to change for several users, instead of entire usergroups.
Note 2: You don't have to select more than 1 usergroup. Just selecting 1 usergroup still works.

P.S= If you want to know how to change 'Display Reputation', 'Invisible' etc, check out my guide here:
https://vborg.vbsupport.ru/showthrea...58#post2555258

--------------- Added [DATE]1443391500[/DATE] at [TIME]1443391500[/TIME] ---------------

Quote:

Originally Posted by akz645 (Post 2555178)
Do you know any way to set it so only certain usergroups will have X User Profile Field option appear in their userCP?

That's the only question still left unanswered.

If anybody can help out, that would be great :)


All times are GMT. The time now is 02:03 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01862 seconds
  • Memory Usage 1,762KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete