Log in

View Full Version : Bitfield help


Artistichaven
04-28-2011, 10:08 PM
I created two custom bitfields

<group name = "serverstuff">
<bitfield name="isserverstaff" group="server_stuff" phrase="is_server_staff">1</bitfield>
<bitfield name="isbetatester" group="server_stuff" phrase="is_beta_tester">2</bitfield>
</group>

The issue is isserverstaff gets saved in serverstuff, and isbetatester does not get saved at all.

kh99
04-28-2011, 10:28 PM
I think you want different values for those, like instead of making them both '1' make the second one '2'.

Artistichaven
04-29-2011, 12:56 AM
I think you want different values for those, like instead of making them both '1' make the second one '2'.

Oh woops! I did that, it's still not saving the value.

Edit:
Correction, it does work. The bitfields had just not been rebuilt. Now I just don't know how to call on each bitfield independently, any help there?

Artistichaven
04-30-2011, 09:04 PM
Does anyone have any idea on how to make each bitfield save separately so that I can call on them individually?

kh99
04-30-2011, 09:23 PM
I'm not sure what you're doing exaclty - how are you trying to save them?

Artistichaven
05-01-2011, 03:01 PM
I'm not sure what you're doing exaclty - how are you trying to save them?

I'm not doing anything but the bitfields... :erm:

Artistichaven
05-06-2011, 06:04 PM
It has been nearly a week. Any ideas?

Artistichaven
05-09-2011, 10:47 PM
Sorry to be a hassle, but I need this solved. If anyone knows, it would be greatly appreciated.

kh99
05-09-2011, 10:59 PM
I'll try to help you figure it out, but I don't understand what you're doing. What exactly are you doing with the xml in the first post, and what do you mean by "making them save"?

Artistichaven
05-11-2011, 09:54 AM
Basically if you click yes to 'isserverstaff' then 'serverstuff' adds one to itself for that usergroup. But if you click 'isbetatester' then 'serverstuff' adds two to itself. Meaning that if I try and call on 'serverstuff' the current way I cannot have the 'isbetatester' field because I call on it with something like $permissions['serverstuff']. I want to be able to check if the person isserverstaff, not just serverstuff. Make more sense?

kh99
05-11-2011, 10:31 AM
if ($permissions['serverstuff'] & 1)
// isserverstaff

if ($permissions['serverstuff'] & 2)
// isbetatester



You didn't say exactly where you added your xml, but I think you should be able to do something like this code (which obviously checks forumpermissions):
$permissions['forumpermissions'] & $vbulletin->bf_ugp_forumpermissions['canview']


by replacing 'bf_ugp_forumpermissions' with whatever is appropriate for your bitfields, that way you're not hard-coding the values.


Maybe this article will help: https://vborg.vbsupport.ru/showthread.php?t=166940