The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Background:
Public bbs run by a membership organization. Both org members and non-members use the board. Wish to identify the org members in the author info in postbit. Using a custom field in profile to identify org members. There is an org password used elsewhere on the site that members enter into this field to verify membership. This field is private so non-members can't see the password in anybody else's profile. Admins are set to be able to see private profile fields. Have inserted the following code in postbit: PHP Code:
I suspect this is because only admins have the authority to see private profile fields. When the user for whom the page is being built isn't an admin, I'm guessing the value of field5 isn't being passed to the routine at all, so the match fails and everybody is shown as Guest. We MUST keep this password field in the profile private so that the org pwd is not shown in the clear, but I need this conditional to work no matter whether the viewer is permitted to view private profile fields or not. Any suggestions? |
#2
|
||||
|
||||
![]()
Hmm here is a workaround that might work... Having a field in the user table and have it sync with the profilefield one. You'd just have to change $post['field5'] to $post['newfieldname']. An easy synch would be something like
PHP Code:
|
#3
|
||||
|
||||
![]()
Thanks, I'll give this a try.
Forgive me, but I'm a rank newbie with databases and php (old QuickBasic guy...) so I have a couple of questions: Would the code above take care of creating that field in the user record, or do I need to do something first to create the new field? And when/how often would that code be executed by including it in the phpinclude template? Another approach I thought of was to remove the private classification from field5, but put a conditional in the template that displays the profile, such that it would suppress printing to the screen unless the viewer was that user or an admin. Haven't taken a peek at the code yet to see what that would entail. |
#4
|
||||
|
||||
![]()
members can not view 'private fields' hence why it doesn't work properly for them
why don't you just upgrade the org members into their own USERGROUP? from there, it would be easier to show their 'membership type' Quote:
|
#5
|
||||
|
||||
![]() Quote:
|
#6
|
||||
|
||||
![]() Quote:
Quote:
But having a special usergroup for org members was what I wanted in the first place as there is SO much you could do with it. See this thread that just sort of died on the vine: https://vborg.vbsupport.ru/showthread.php?t=80089 I'd guess this could be done with a query similar to TheSpecialist's that compares field5 to my org_password phrase then puts that user into or out of the usergroup accordingly. Can anybody help with the query code? When is the php_include_start code run? When each user logs on, or every time a new page is created, or .... ? |
#7
|
||||
|
||||
![]()
Have found that my host has phymyadmin installed. Have timidly gone in and found the user and userfield tables.
It LOOKS like adding a new field to the user table is as simple as: Add [1] field at End of Table, and press GO. On next screen, enter field name, type, and other attributes. Haven't had the nerve to press the Save button yet. Would appreciate it if somebody can confirm the above before I trash my database out of misinterpreting something. Any particular pitfalls a total ignoramus should watch out for? Also, must I shut the board down or can this be done with the board up? |
#8
|
||||
|
||||
![]()
Simple, yes
![]() I'd say VARCHAR 25characters. Depends on your password I guess. The rest should be default, except the name of it, just make sure you are consistent with that. |
#9
|
||||
|
||||
![]()
Thanks for the come-back. It's much appreciated.
It's installed and working great. |
#10
|
||||
|
||||
![]()
Have finally found a way to automate putting an individual into a secondary group automatically, based on the value entered in profile fieldX. The above request was just a work-around until I could pull this off.
For anyone interested in the auto-add code, see https://vborg.vbsupport.ru/showpost....40&postcount=9 So now I no longer need that new field we added to the user table, above. Is getting rid of it as simple as going into phpmyadmin, selecting this field and choosing "Drop"? |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|