vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=250418

MarkFL 24 Jul 2015 17:03

Okay, try using the plugin code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

What do you get now?

ProfC 24 Jul 2015 17:13

"House Membership: Default", I have "Ravenclaw" selected in my profile. I edited my profile to leave it blank, and the field disappeared but upon changing it to Ravenclaw again, it went to "Default" on the postbit.

MarkFL 24 Jul 2015 17:18

Okay, it sounds to me that the value being stored in the variable $post['field17'] isn't what you are expecting.

ProfC 24 Jul 2015 17:43

It seems it.

I'm not sure what I may have done wrong. This is a screenshot of the profile field from the ACP.

MarkFL 24 Jul 2015 18:25

Okay, try this as your plugin code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


ProfC 24 Jul 2015 19:45

That works perfectly, thank you. :) It seems I was in fact using the wrong method. Now the question would be on how to get it to display a different image based on the option selected on your profile.

MarkFL 24 Jul 2015 19:55

Do your images have the options for field17 embedded in their URL? If so you could easily build the HTML using string concatenation. Suppose your images are stored in the folder "images/housemembership" and their filenames are composed of the options and the extension ".png". Then you would use the plugin code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


ProfC 24 Jul 2015 20:01

They don't, but I'll work on that later tonight and see what I can whip up. Thank you ^^

MarkFL 24 Jul 2015 20:04

Quote:

Originally Posted by ProfC (Post 2551262)
They don't, but I'll work on that later tonight and see what I can whip up. Thank you ^^

Rather than rename the folder and files, it would be easier to construct a switch statement to build the element. Just let me know the folder name and which image filename goes with which option, and I will write the plugin code. ;)

ProfC 24 Jul 2015 20:43

Quote:

Originally Posted by MarkFL (Post 2551263)
Rather than rename the folder and files, it would be easier to construct a switch statement to build the element. Just let me know the folder name and which image filename goes with which option, and I will write the plugin code. ;)

Thank you :)

I'll drop you a message in a few moments with everything.

akz645 30 Aug 2015 02:32

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 30 Aug 2015 17:23

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 30 Aug 2015 22:14

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 31 Aug 2015 16:29

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

akz645 31 Aug 2015 23:48

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 :)

http://www.vbulletin.org/forum/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 17 Sep 2015 02:52

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 17 Sep 2015 17:17

1) No, I do not.

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

akz645 17 Sep 2015 17:22

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 17 Sep 2015 21:42

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 27 Sep 2015 22:03

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)
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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)
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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)
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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:
http://www.vbulletin.org/forum/showt...58#post2555258

--------------- Added 27 Sep 2015 at 22:05 ---------------

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 :)

StormBreaker 09 May 2017 13:10

If i want to show profile field in ad_navbar_below template instead of {vb:var adsense_pub_id}.. I done this>>

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

to

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Will it work?

Lynne 09 May 2017 22:11

Quote:

Originally Posted by StormBreaker (Post 2586324)
If i want to show profile field in ad_navbar_below template instead of {vb:var adsense_pub_id}.. I done this>>

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

to

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Will it work?

Doubtful. I do not believe the $post variable is registered for use in that template. And, most likely you want to use $vbuserinfo or something like that and so you would need to register that variable for use in that template.


All times are GMT. The time now is 22:54.

Powered by vBulletin® Version 3.8.14
Copyright © 2021, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.