1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.3 secondary_group_ids

Discussion in 'XenForo Questions and Support' started by WSWD, Aug 2, 2014.

  1. WSWD

    WSWD Well-Known Member

    Hello,

    Just upgraded one of our forums to 1.3. Yeah, yeah...I know. :p

    In any event. I have an external PHP script, and I use various items from the XenForo database to authenticate users on that page. One of them I use is the secondary_group_ids entries, to grant certain permissions (i.e. their forum permissions match what they can do on the external site). They used to be a nice comma-separated list, but now are just bizarre.

    For example. I have a member whose secondary user groups are 3, 10, and 12. In the old version, the database would show 3,10,12. It was really easy to pull that from the database via a PHP file using CONCAT. Now it shows 332c31302c3132. No clue what any of that means, or what I'm supposed to do with it.

    No idea when this changed, but it's the same way on all our 1.3 forums. Any help would be greatly appreciated!
     
  2. MattW

    MattW Well-Known Member

    It's a hex value for the literal string. The column is now a varbinary.

    332c31302c3132 = 3,10,12
     
    WSWD likes this.
  3. WSWD

    WSWD Well-Known Member

    Hmmmmm...used to be so simple. Thanks Matt!

    Any easy way to use a WHERE statement with that? For example, I was using CONCAT to determine if "10" was in secondary_user_groups. On another page, I needed to see if "12" was in there. Was basically pulling somebody's information from the database based on upon their Secondary User Group membership.
     
  4. Mike

    Mike XenForo Developer Staff Member

    Nothing changed in the data. What you're seeing is your DB viewer's (phpMyAdmin?) decided representation for that type of field. The data is still the same.
     
    MattW and WSWD like this.
  5. WSWD

    WSWD Well-Known Member

    Ahhhhh, okay. So I can still use the same queries I'm guessing. Yes, I was using phpMyAdmin at the time.


    Thanks!
     
  6. MattW

    MattW Well-Known Member

    Correct: stats_type in xf_stats_daily is another varbinary column.

    Code:
    MariaDB [z22se_xenforo]> SELECT stats_type FROM xf_stats_daily LIMIT 10;
    +-----------------------+
    | stats_type            |
    +-----------------------+
    | attachment            |
    | attachment_disk_usage |
    | post                  |
    | thread                |
    | user_registration     |
    | attachment            |
    | attachment_disk_usage |
    | post                  |
    | thread                |
    | user_registration     |
    +-----------------------+
    10 rows in set (0.00 sec)
    
    MariaDB [z22se_xenforo]> 
     
    WSWD likes this.
  7. WSWD

    WSWD Well-Known Member

    Love it!
     

Share This Page