Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
Prev Previous Post   Next Post Next
  #1  
Old 06-06-2010, 12:00 PM
James Birkett James Birkett is offline
 
Join Date: Jun 2009
Posts: 633
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Bitfield confusion

Hi there,

I'm trying to understand vBulletin's use of bitfields and this has confused me. If anyone can clear it up, I'd appreciate it:

Code:
<group name="forumpermissions">
  <bitfield name="canview" group="forum_viewing_permissions" phrase="can_view_forum" install="1,2,3,4,5,6,7">1</bitfield> 
  <bitfield name="canviewthreads" group="forum_viewing_permissions" phrase="can_view_threads" install="1,2,3,4,5,6,7">524288</bitfield> 
  <bitfield name="canviewothers" group="forum_viewing_permissions" phrase="can_view_others_threads" install="1,2,3,4,5,6,7">2</bitfield> 
  <bitfield name="cansearch" group="forum_searching_permissions" phrase="can_search_forums" install="1,2,3,4,5,6,7">4</bitfield> 
  <bitfield name="canemail" group="forum_viewing_permissions" phrase="can_use_email_to_friend" install="1,2,3,4,5,6,7">8</bitfield> 
  <bitfield name="canpostnew" group="post_thread_permissions" phrase="can_post_threads" install="2,5,6,7">16</bitfield> 
  <bitfield name="canreplyown" group="post_thread_permissions" phrase="can_reply_to_own_threads" install="2,5,6,7">32</bitfield> 
  <bitfield name="canreplyothers" group="post_thread_permissions" phrase="can_reply_to_others_threads" install="2,5,6,7">64</bitfield> 
  <bitfield name="caneditpost" group="post_thread_permissions" phrase="can_edit_own_posts" install="2,5,6,7">128</bitfield> 
  <bitfield name="candeletepost" group="post_thread_permissions" phrase="can_delete_own_posts" install="2,5,6,7">256</bitfield> 
  <bitfield name="candeletethread" group="post_thread_permissions" phrase="can_delete_own_threads" install="5,6">512</bitfield> 
  <bitfield name="canopenclose" group="post_thread_permissions" phrase="can_open_close_own_threads" install="5,6">1024</bitfield> 
  <bitfield name="canmove" group="post_thread_permissions" phrase="can_move_own_threads" install="5,6">2048</bitfield> 
  <bitfield name="cangetattachment" group="forum_viewing_permissions" phrase="can_download_attachments" install="2,5,6,7">4096</bitfield> 
  <bitfield name="canpostattachment" group="attachment_permissions" phrase="can_upload_attachments" install="2,5,6,7">8192</bitfield> 
  <bitfield name="attachlimit" intperm="true" group="attachment_permissions" phrase="space_in_bytes_attachlimit">1</bitfield> 
  <bitfield name="canpostpoll" group="poll_permissions" phrase="can_post_polls" install="2,5,6,7">16384</bitfield> 
  <bitfield name="canvote" group="poll_permissions" phrase="can_vote_on_polls" install="2,5,6,7">32768</bitfield> 
  <bitfield name="canthreadrate" group="post_thread_permissions" phrase="can_rate_threads" install="2,5,6,7">65536</bitfield> 
  <bitfield name="followforummoderation" group="post_thread_permissions" phrase="follow_forum_moderation_rules" install="1,2,3,4,5,6,7">131072</bitfield> 
  <bitfield name="canseedelnotice" group="forum_viewing_permissions" phrase="can_see_deletion_notices" install="5,6">262144</bitfield> 
  <bitfield name="cantagown" group="post_thread_permissions" phrase="can_tag_own_threads" install="2,5,6,7">1048576</bitfield> 
  <bitfield name="cantagothers" group="post_thread_permissions" phrase="can_tag_others_threads" install="2,5,6,7">2097152</bitfield> 
  <bitfield name="candeletetagown" group="post_thread_permissions" phrase="can_delete_tags_own_threads" install="5,6">4194304</bitfield> 
  <bitfield name="canseethumbnails" group="forum_viewing_permissions" phrase="can_see_thumbnails" install="2,5,6,7">8388608</bitfield> 
  </group>
Why does it go:
1, 524288, 2, 4, 8

I thought the generic method to go was: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, etc?
Reply With Quote
 

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 12:13 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.04647 seconds
  • Memory Usage 2,397KB
  • Queries Executed 12 (?)
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)bbcode_code
  • (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
  • (6)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)showthread_list
  • (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_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • 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_threaded
  • showthread_threaded_construct_link
  • 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