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

Reply
 
Thread Tools Display Modes
  #1  
Old 01-04-2007, 06:05 PM
h_jinx h_jinx is offline
 
Join Date: Mar 2005
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default bitfield problems.

I assure you I have searched high and low to a solution to this before I posted. Anyone that can shed light on this would be appreciated.

I have the following:

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<bitfields product="item_shop">
    <bitfielddefs>
        <group name="ugp">
          <group name="shop_item_settings">
              <bitfield name="shop_invent_size" group="shop_usergroup_options" phrase="shop_inventory_size" intperm="true"  >1</bitfield>
              <bitfield name="shop_pbit_size" group="shop_usergroup_options" phrase="shop_pbit_size" intperm="true" >1</bitfield>
            </group>
        </group>
    </bitfielddefs>
</bitfields>
It appears fine in the usergroup manager. On checking the dbase it updates the fields correctly and after updates the usergroup manager shows these updates to be true. I have also rebuilt the fields a number of times.

However, when I try to access it in code using:

Code:
$visibleallowed = $vbulletin->bf_ugp_shop_item_settings['shop_pbit_size'];
$inventoryallowed = $vbulletin->bf_ugp_shop_item_settings['shop_invent_size'];
I am getting nothing back.

var_dump($vbulletin->bf_ugp_shop_item_settings);

brings back NULL;

var_dump($vbulletin->bf_ugp);

brings back

Code:
array(8) {   ["forumpermissions"]=>   &array(20) {     ["canview"]=>     int(1)     ["canviewthreads"]=>     int(524288)     ["canviewothers"]=>     int(2)     ["cansearch"]=>     int(4)     ["canemail"]=>     int(8)     ["canpostnew"]=>     int(16)     ["canreplyown"]=>     int(32)     ["canreplyothers"]=>     int(64)     ["caneditpost"]=>     int(128)     ["candeletepost"]=>     int(256)     ["candeletethread"]=>     int(512)     ["canopenclose"]=>     int(1024)     ["canmove"]=>     int(2048)     ["cangetattachment"]=>     int(4096)     ["canpostattachment"]=>     int(8192)     ["canpostpoll"]=>     int(16384)     ["canvote"]=>     int(32768)     ["canthreadrate"]=>     int(65536)     ["followforummoderation"]=>     int(131072)     ["canseedelnotice"]=>     int(262144)   }   ["pmpermissions"]=>   &array(3) {     ["canignorequota"]=>     int(4)     ["cantrackpm"]=>     int(1)     ["candenypmreceipts"]=>     int(2)   }   ["calendarpermissions"]=>   &array(6) {     ["canviewcalendar"]=>     int(1)     ["canpostevent"]=>     int(2)     ["caneditevent"]=>     int(4)     ["candeleteevent"]=>     int(8)     ["canviewothersevent"]=>     int(16)     ["isnotmoderated"]=>     int(32)   }   ["wolpermissions"]=>   &array(5) {     ["canwhosonline"]=>     int(1)     ["canwhosonlineip"]=>     int(2)     ["canwhosonlinefull"]=>     int(4)     ["canwhosonlinebad"]=>     int(8)     ["canwhosonlinelocation"]=>     int(16)   }   ["adminpermissions"]=>   &array(17) {     ["ismoderator"]=>     int(1)     ["cancontrolpanel"]=>     int(2)     ["canadminsettings"]=>     int(4)     ["canadminstyles"]=>     int(8)     ["canadminlanguages"]=>     int(16)     ["canadminforums"]=>     int(32)     ["canadminthreads"]=>     int(64)     ["canadmincalendars"]=>     int(128)     ["canadminusers"]=>     int(256)     ["canadminpermissions"]=>     int(512)     ["canadminfaq"]=>     int(1024)     ["canadminimages"]=>     int(2048)     ["canadminbbcodes"]=>     int(4096)     ["canadmincron"]=>     int(8192)     ["canadminmaintain"]=>     int(16384)     ["canadminupgrade"]=>     int(32768)     ["canadminplugins"]=>     int(65536)   }   ["genericpermissions"]=>   &array(30) {     ["canviewmembers"]=>     int(1)     ["canmodifyprofile"]=>     int(2)     ["caninvisible"]=>     int(4)     ["canviewothersusernotes"]=>     int(8)     ["canmanageownusernotes"]=>     int(16)     ["canseehidden"]=>     int(32)     ["canbeusernoted"]=>     int(64)     ["canprofilepic"]=>     int(128)     ["cananimateprofilepic"]=>     int(134217728)     ["canuseavatar"]=>     int(512)     ["cananimateavatar"]=>     int(67108864)     ["canusesignature"]=>     int(1024)     ["canusecustomtitle"]=>     int(2048)     ["canseeprofilepic"]=>     int(4096)     ["canviewownusernotes"]=>     int(8192)     ["canmanageothersusernotes"]=>     int(16384)     ["canpostownusernotes"]=>     int(32768)     ["canpostothersusernotes"]=>     int(65536)     ["caneditownusernotes"]=>     int(131072)     ["canseehiddencustomfields"]=>     int(262144)     ["canseeownrep"]=>     int(256)     ["canuserep"]=>     int(524288)     ["canhiderep"]=>     int(1048576)     ["cannegativerep"]=>     int(2097152)     ["cangiveinfraction"]=>     int(4194304)     ["canseeinfraction"]=>     int(8388608)     ["cangivearbinfraction"]=>     int(536870912)     ["canreverseinfraction"]=>     int(16777216)     ["cansearchft_bool"]=>     int(33554432)     ["canemailmember"]=>     int(268435456)   }   ["genericoptions"]=>   &array(6) {     ["showgroup"]=>     int(1)     ["showbirthday"]=>     int(2)     ["showmemberlist"]=>     int(4)     ["showeditedby"]=>     int(8)     ["allowmembergroups"]=>     int(16)     ["isnotbannedgroup"]=>     int(32)   }   ["signaturepermissions"]=>   &array(17) {     ["canbbcode"]=>     int(131072)     ["canbbcodebasic"]=>     int(1)     ["canbbcodecolor"]=>     int(2)     ["canbbcodesize"]=>     int(4)     ["canbbcodefont"]=>     int(8)     ["canbbcodealign"]=>     int(16)     ["canbbcodelist"]=>     int(32)     ["canbbcodelink"]=>     int(64)     ["canbbcodecode"]=>     int(128)     ["canbbcodephp"]=>     int(256)     ["canbbcodehtml"]=>     int(512)     ["canbbcodequote"]=>     int(1024)     ["allowimg"]=>     int(2048)     ["allowsmilies"]=>     int(4096)     ["allowhtml"]=>     int(8192)     ["cansigpic"]=>     int(32768)     ["cananimatesigpic"]=>     int(65536)   } }
Any assistance is much appreciated.

Thanks,

d4
Reply With Quote
  #2  
Old 01-05-2007, 02:59 PM
noppid noppid is offline
 
Join Date: Mar 2003
Location: Florida
Posts: 1,875
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this in your xml file...

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<bitfields product="vbulletin">
	<bitfielddefs>
		<group name="ugp">
			<group name="shop_item_settings">
              <bitfield name="shop_invent_size" group="shop_usergroup_options" phrase="shop_inventory_size" intperm="true" >1</bitfield>
              <bitfield name="shop_pbit_size" group="shop_usergroup_options" phrase="shop_pbit_size" intperm="true">1</bitfield>
			</group>
		</group>
	</bitfielddefs>
</bitfields>
Reply With Quote
  #3  
Old 01-08-2007, 12:00 AM
h_jinx h_jinx is offline
 
Join Date: Mar 2005
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Reason: This reference only works when it is a bit permission. If the permission is an integer standing on it's own, then the reference is $permissions[nameoffield]

Thanks tho noppid
Reply With Quote
  #4  
Old 01-09-2007, 04:06 AM
noppid noppid is offline
 
Join Date: Mar 2003
Location: Florida
Posts: 1,875
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I missed that completely.

Maybe you need...
Code:
<bitfield intperm="true" name="name" group="group" phrase="phrase">6</bitfield>
I'm using it like that in group permissions for numbers.
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 03:04 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.03855 seconds
  • Memory Usage 2,195KB
  • 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
  • (5)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)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