What tables hold Post IP addresses, Registration IP, and Admin Email permission?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gettingbetter
    Member
    • Nov 2007
    • 45
    • 4.0.x

    [Forum] What tables hold Post IP addresses, Registration IP, and Admin Email permission?

    Looking for:

    1) Post IP table
    2) Registration IP table
    3) Table that holds data showing whether a user has given permission to receive email from the admin ("Receive Admin Emails")

    Would like to query them and list them on a webpage.

    Thanks.
  • Trevor Hannant
    vBulletin Support
    • Aug 2002
    • 24325
    • 5.7.X

    #2
    1. post (ipaddress)
    2. user (ipaddress)
    3. user (options)

    To get a list of users who have Receive Admin Emails, use the following query (and adapt to your needs):

    Code:
    SELECT * FROM user WHERE options & 16;
    Last edited by Trevor Hannant; Fri 5 Nov '10, 2:40am.
    Vote for:

    - Admin Settable Paid Subscription Reminder Timeframe (vB6)
    - Add Admin ability to auto-subscribe users to specific channel(s) (vB6)

    Comment

    • Andy
      Senior Member
      • Jan 2002
      • 5886
      • 4.1.x

      #3
      The following code shows the values for the options field in the user table. Do a query on the options field assign the value to $options[].

      Code:
      <bitfield name="showsignatures">1</bitfield>
      <bitfield name="showavatars">2</bitfield>
      <bitfield name="showimages">4</bitfield>
      <bitfield name="coppauser">8</bitfield>
      <bitfield name="adminemail">16</bitfield>
      <bitfield name="showvcard">32</bitfield>
      <bitfield name="dstauto">64</bitfield>
      <bitfield name="dstonoff">128</bitfield>
      <bitfield name="showemail">256</bitfield>
      <bitfield name="invisible">512</bitfield>
      <bitfield name="showreputation">1024</bitfield>
      <bitfield name="receivepm">2048</bitfield>
      <bitfield name="emailonpm">4096</bitfield>
      <bitfield name="hasaccessmask">8192</bitfield>
      <bitfield name="postorder">32768</bitfield>
      <bitfield name="receivepmbuddies">131072</bitfield>
      <bitfield name="noactivationmails">262144</bitfield>
      <bitfield name="pmboxwarning">524288</bitfield>
      <bitfield name="showusercss">1048576</bitfield>
      <bitfield name="receivefriendemailrequest">2097152</bitfield>
      <bitfield name="vm_enable">8388608</bitfield>
      <bitfield name="vm_contactonly">16777216</bitfield>
      You will want to & 16.

      Example:

      $adminemail = $options[$i] & 16;

      So if $adminemail has a value of 0 it is not set, if the value is 16 it is set.

      Comment

      • gettingbetter
        Member
        • Nov 2007
        • 45
        • 4.0.x

        #4
        Thanks for that. Very helpful.

        I'm also a bit curious about the "joindate" column in the user table. It appears it is a string of numbers that don't make immediate sense as far as common date structures (like MM/DD/YYYY.

        Can anyone shed some light on this? Is there a way to query the DB so that it returns the joindate column in that format MM/DD/YYYY instead of one continuous string?

        Comment

        • gettingbetter
          Member
          • Nov 2007
          • 45
          • 4.0.x

          #5
          Nevermind, I found the answer. Searching the forum is a magical thing! :-)

          Comment

          • gettingbetter
            Member
            • Nov 2007
            • 45
            • 4.0.x

            #6
            Ok, so far so good. Here is another little tweak...

            Let's say I want to look up all users who's option value is 16 (they are receiving admin emails) but I also want to include their email address in the MySQL output - what would be the command for that?

            I've already tried this, but it yielded no results:

            select 'email' from `users_table` WHERE 'options' & 16;

            Perhaps I have the wrong boolean statement? (&) ?

            Thank you.

            Comment

            • gettingbetter
              Member
              • Nov 2007
              • 45
              • 4.0.x

              #7
              Anyone have any insight into what the proper command is here?

              Thanks.

              Comment

              • Lynne
                Former vBulletin Support
                • Oct 2004
                • 26255

                #8
                It isn't called "users_table", it is simply called "user" (unless you have a prefix, in which case it would be "prefixuser")

                Please don't PM or VM me for support - I only help out in the threads.
                vBulletin Manual & vBulletin 4.0 Code Documentation (API)
                Want help modifying your vbulletin forum? Head on over to vbulletin.org
                If I post CSS and you don't know where it goes, throw it into the additional.css template.

                W3Schools &lt;- awesome site for html/css help

                Comment

                • gettingbetter
                  Member
                  • Nov 2007
                  • 45
                  • 4.0.x

                  #9
                  Yes, I realize that - I just put that name in there as an example...

                  Comment

                  • Lynne
                    Former vBulletin Support
                    • Oct 2004
                    • 26255

                    #10
                    It helps to see exactly what you put in . Like, did you put the single quotes around options in the WHERE statement (you should not).

                    Please don't PM or VM me for support - I only help out in the threads.
                    vBulletin Manual & vBulletin 4.0 Code Documentation (API)
                    Want help modifying your vbulletin forum? Head on over to vbulletin.org
                    If I post CSS and you don't know where it goes, throw it into the additional.css template.

                    W3Schools &lt;- awesome site for html/css help

                    Comment

                    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                    Working...