Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-18-2011, 08:55 AM
phil_11 phil_11 is offline
 
Join Date: Aug 2011
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default different profile fields for usergroups

First, I want to apologize for my far from perfect english..

I have different Usergroups, A, B and C. All have the same profile-fields.

Now I want additional fields for A-Users (x,y,z), some for B-Users (u,v,w) and so on.

A should not see the fields for B when filling out the profile, of course - but should see B's fields when looking at B's profile.


As far as i know, this should work with an if-condition for usergroups.
But unfortunately, I have no idea how exactly this condition should look like and where to put it.


Could someone help me, please?

greets, phil
Reply With Quote
  #2  
Old 08-22-2011, 02:31 PM
phil_11 phil_11 is offline
 
Join Date: Aug 2011
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nearly 100 views, but no replies yet..

Is my question too banal and nobody wants to tell me to rtfm?

Or is it so specific no one has ever thought about doing that before?


greets,
phil
Reply With Quote
  #3  
Old 08-22-2011, 05:45 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think it's not an easy question to answer. And there is no manual, so you'd have to rtfsc (source code)

The custom profile field info is stored in the database (of course), so you need to find where that info is read and then figure out how to tell if it's one of the fields you want to set by user group. And unless they are private fields, you will want to do this where they are displayed *and* where they are edited.

Maybe a different approach would be to add a usergroup id column to the profilefield table (with 0 for all usergroups) and then find everywhere that table is queried and add usergroupid checks to the WHERE clause. I doubt it could be done using hooks only, but I'm not sure.

ETA: I had another thought: maybe if you find the template used to render the profile fields, you could check the field id and user group in a <vb:if... there.
Reply With Quote
  #4  
Old 08-24-2011, 03:36 AM
Marco64Th Marco64Th is offline
 
Join Date: Aug 2011
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

He only want to users of a group to be able to fill out certain profile fields. He want everyone to see them.

As long as they are not required fields, a template conditional should be able to do the trick. Although i don't like to code functionality into a presentation layer.
Reply With Quote
  #5  
Old 08-24-2011, 04:12 AM
Badshah93 Badshah93 is offline
 
Join Date: Jun 2010
Location: India
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

its not hard, but need few file edit .. this thing can't be done by template as all the field are in one array..

1. you need to add a field in profilefield table which will store usergroups id's to whom that profile field will be show.

2. Then next thing will be edit functions_user.php file

in that you need to edit fetch_profilefields function..

3. YOu need to edit profile.php file admincp to add a column for entering usergroupid.
Reply With Quote
  #6  
Old 08-24-2011, 08:07 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marco64Th View Post
He only want to users of a group to be able to fill out certain profile fields. He want everyone to see them.
Well, I assumed that he wanted everyone only to see the fields that apply to that user's (the user whose profile it is) group, but I could be wrong.
Reply With Quote
  #7  
Old 08-27-2011, 01:12 AM
deespys deespys is offline
 
Join Date: Aug 2011
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am looking for the same thing.

Profile fields based on user groups.

Admins would have profile fields a,b,c,d,e,f

Registered User would only have fields a,b,c and not be able to see d,e,f when they edit their profile.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:56 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04112 seconds
  • Memory Usage 2,213KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete