PDA

View Full Version : User Options Bit Setting Algorithm?


tyler_d
07-28-2007, 09:22 AM
Anyone know the function within the vB code that shows the algorithm for how the user bits are set in the 'options' field for the vB database table: '_user'

I'm doing integration work between Joomla Community Builder and vBulletin and need to learn this bit setting algorithm in order to synchronize "invisible user" options between the systems.

thanks for any leads.

I've been looking thru the vB code for a few hours now with no success on how those user option bits are set.

Carnage
07-28-2007, 09:29 AM
i'm not 100% certain on this but aren't such options set within the user datamanager?

Andreas
07-28-2007, 09:31 AM
class_dm.php

method set_bitfield()

Or basically:

To set a bit

UPDATE user SET options = IF ((options & X), options, options + X) WHERE userid = Y


To unset a bit

UPDATE user SET options = IF ((options & X), options - X, options) WHERE userid = Y

tyler_d
07-28-2007, 11:15 AM
thx andreas :)