vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   bitfield problems. (https://vborg.vbsupport.ru/showthread.php?t=135536)

h_jinx 01-04-2007 06:05 PM

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

noppid 01-05-2007 02:59 PM

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>


h_jinx 01-08-2007 12:00 AM

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

noppid 01-09-2007 04:06 AM

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.


All times are GMT. The time now is 11:34 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.01760 seconds
  • Memory Usage 1,740KB
  • 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
  • (5)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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