Announcement

Collapse
No announcement yet.

User Information for a custom script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Forum] User Information for a custom script

    Hi,

    Is there anyway I can access a user info (userid, usergroup etc) from an outside script? I don't want to use VB template. I only want to get userid and other info. Please point me to the right direction if this question has already been asked.

    Thank you,

  • #2
    You would need to include the global.php or at least the init.php

    Then you can access all the $vbulletin Variables

    Comment


    • #3
      Thank you for the response. I tried that but I get this error message when I tried global.php:
      Code:
      Parse error: syntax error, unexpected T_STRING in /site/includes/class_core.php(4014) : eval()'d code on line 1
       
      Unable to add cookies, header already sent.
      File: /Applications/MAMP/htdocs/calendar/index.php
      Line: 1
      When I tried init.php, I get
      Code:
      Unable to add cookies, header already sent.
      File: /Applications/MAMP/htdocs/calendar/index.php
      Line: 1

      Comment


      • #4
        Originally posted by Rattanack View Post
        Hi,

        Is there anyway I can access a user info (userid, usergroup etc) from an outside script? I don't want to use VB template. I only want to get userid and other info. Please point me to the right direction if this question has already been asked.

        Thank you,
        If they are logged in with the "Remember Me" checked, just grab the bb_userid cookie value. Then query the database as needed to get info you want.

        If the "Remember Me" is not checked, get the sessionhash value from their cookie and query the database session table. This will provide the userid.

        Comment


        • #5
          Thank you Andy, but I still have problem directing guests to a login page.

          Comment


          • #6
            Originally posted by Andy View Post
            If they are logged in with the "Remember Me" checked, just grab the bb_userid cookie value. Then query the database as needed to get info you want.
            Everybody could chnage the bb_userid cookie value and could be logged in as admin That's not enought

            Comment


            • #7
              Could you direct me to info relating to cookie value?

              Thank you,

              Comment


              • #8
                Originally posted by Rattanack View Post
                Could you direct me to info relating to cookie value?

                Thank you,
                I suggest you ask over at vbulletin.org for custom coding help.

                Comment


                • #9
                  I did and tried to bump it up but no one responded.

                  http://www.vbulletin.org/forum/showthread.php?t=238321

                  Comment

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