vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Mod/ S. Mod and Admin Only Profile Fields (https://vborg.vbsupport.ru/showthread.php?t=43597)

bensonfactor 09-16-2002 01:54 AM

Mod/ S. Mod and Admin Only Profile Fields
 
Could anyone do it?

Logician 09-16-2002 11:42 AM

1- Install Advanced Templates
2- Create an admin only field in your Admin CP and note its field number.
3- Edit your postbit template and add there (to relevant place):
PHP Code:

[[($bbuserinfo[usergroupid]==OR $bbuserinfo[usergroupid]==OR $bbuserinfo[usergroupid]==7)]]
$post[fieldX]
[[/(
$bbuserinfo[usergroupid]==OR $bbuserinfo[usergroupid]==OR $bbuserinfo[usergroupid]==7)]] 

Replace X with the id of your field.

This will display this field to your Admins/Mods and S.Mods in postbit..

Enjoy.

bensonfactor 09-16-2002 12:39 PM

Thank you very much, worked like a charm.

I needed in order to display the name color fields correctly; they are only for mods, super mods, and admins but since I want them to be able to edit the fields themselves, just anyone could do it. This way no matter what regs put in the fields it won't display. :D

Logician 09-16-2002 03:53 PM

Quote:

Originally posted by bensonfactor
Thank you very much, worked like a charm.

I needed in order to display the name color fields correctly; they are only for mods, super mods, and admins but since I want them to be able to edit the fields themselves, just anyone could do it. This way no matter what regs put in the fields it won't display. :D

The code I gave you makes sures that the admin only profile field of the user is visible to Mods/S.Mods and Admins. If this is already what you want, well it's great but I get the impression from that message that you ask something else like making a field visible to eveybody if poster is a mod/s.mod or admin. This hack does not do it as you may have already noticed..

bensonfactor 09-16-2002 04:38 PM

Yes, I noticed it didn't do quite what I wanted... hmm

Logician 09-16-2002 05:00 PM

Quote:

Originally posted by bensonfactor
Yes, I noticed it didn't do quite what I wanted... hmm
ok try this conditional: (after you installed advanced templates)

PHP Code:

[[($post[usergroupid]==OR $post[usergroupid]==OR $post[usergroupid]==7)]]
$post[fieldX]
[[/(
$post[usergroupid]==OR $post[usergroupid]==OR $post[usergroupid]==7)]] 

It displays the fieldx if poster is admin/s.mod or mod.. I guess this is now what you want... ;)

bensonfactor 09-16-2002 06:03 PM

I need it so it displays in the edit profile area, only to admins etc.

Logician 09-17-2002 07:31 AM

Quote:

Originally posted by bensonfactor
I need it so it displays in the edit profile area, only to admins etc.
Edit template register_customfields and just in the begining add:

[[(($bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==7 OR $bbuserinfo[usergroupid]==5) OR ($profilefieldname!="fieldX"))]]

and at the end:

[[/(($bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==7 OR $bbuserinfo[usergroupid]==5) OR ($profilefieldname!="fieldX"))]]

Dont forget to replace "X" with your field id. This change will display this field to only S.Mods, Mods and Admins while editing user profile fields and since the others cant see it, they cant set any info there..

bensonfactor 09-17-2002 09:42 AM

In which template and where exactly?

Logician 09-17-2002 09:51 AM

template register_customfields add as FIRST and LAST line

bensonfactor 09-17-2002 10:17 PM

This works for profiles, after the person signs up?

Logician 09-18-2002 07:30 AM

Quote:

Originally posted by bensonfactor
This works for profiles, after the person signs up?
This works for editing profiles after user signed up and very likely also for register screen while they sign up..

bensonfactor 09-18-2002 11:16 PM

It is now working, thank you very much.


All times are GMT. The time now is 10:06 AM.

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.03615 seconds
  • Memory Usage 1,743KB
  • 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
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete