Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 03-01-2011, 10:15 AM
st@rsky st@rsky is offline
 
Join Date: Feb 2006
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Help with the numeric value present in DB when defining forum permissions

Hi Everyone!

I am trying to post a new thread using PHP code that I have written myself.

I have checked the posting permissions and what I did was to retrieve the information from the relevant table in the DB. When I get the information, I have the field "forumpermissions" which resides within a table of the same name, but I don't understand how the numeric value changes when you adjust the permissions for a particular forum.

Any suggestions on how this numeric value changes when permissions are updated?

Thanks in advance.
Reply With Quote
  #2  
Old 03-01-2011, 03:46 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can see the bitfield values in the file includes/xml/bitfield_vbulletin.xml I think there may be an article about this also so you should probably try a search over in the articles forums.
Reply With Quote
  #3  
Old 03-02-2011, 01:55 PM
st@rsky st@rsky is offline
 
Join Date: Feb 2006
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for your reply,

I saw the bitfield but I cant understand how it generates the number when the permission changes.

I mean :

The value in the "forumpermission" field of the db is a kind of result of a mathematical operation of the bitfields in the "bitfield_vbullettin.xml"?

How can I detect the changes between the different permissions?

Are there some vb classes that performs the control of the forum permissions which I can use?

Thanks in advance.
Reply With Quote
  #4  
Old 03-03-2011, 01:40 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is it that you're not familiar with bitfields, or that they aren't working like you'd expect?

If it's the first one, then I guess the answer is that it basically adds together the values for each permission. You can check for a particular permission by using the & operator (bitwise AND), like "if ($forumpermission & 64)" will be true if permission 64 is set (whatever that is). It makes a lot more sense if you look at the values in binary, since each permission value will correspond to one bit in the number.

If you understand all that but they aren't working like that, then I don't know.
Reply With Quote
  #5  
Old 03-03-2011, 02:58 PM
st@rsky st@rsky is offline
 
Join Date: Feb 2006
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for your suggestion.

I checked the permissions using the (&) and it works.

Your help has been really appreciated.
Reply With Quote
Reply

Thread Tools
Display Modes

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 05:43 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.05598 seconds
  • Memory Usage 2,186KB
  • 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)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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