Announcement

Collapse
No announcement yet.

Is it possible to get the userID of the current vB5 user, without coding a full-fledged vB5 plugin/extension/product?

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

  • Is it possible to get the userID of the current vB5 user, without coding a full-fledged vB5 plugin/extension/product?

    I need to create a BB code that loads an iframe (very much like video embedding BB codes do), but I need to include the vBulletin userID of the current user as a parameter in the URL loaded in this iframe.

    I therefore need to know if there is any way to access the userID of the currently logged in vBulletin 5 user, and use it in the HTML of my custom BB code, without coding a full-fledged vB5 plugin/extension/product?

    Is there?

  • #2
    The currently viewing user's ID will be in the Javascript pageData object. You can access that object with your own Javascript.

    The code restricts a BBCode's replacement text to 200 characters at this time. That could be a severe limitation.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud customization and demonstration site.
    vBulletin 5 Documentation - Updated every Friday. Report issues here.
    vBulletin 5 API - Full / Mobile
    I am not currently available for vB Messenger Chats.

    Comment


    • #3
      Ok, sounds great!

      Will I be able to run arbitrary javascript code inside BB codes then to access this you say, and will this work equally well also when users are accessing my forum and viewing these posts from my vBulletin Mobile Suite mobile apps too?

      Comment


      • #4
        You can put whatever you want within 200 characters in the replacement field when creating a custom BBCode in the AdminCP.

        If you're implementing your BBCode using some other method, then you will need a full addon product so it can be properly registered and parsed with the code.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud customization and demonstration site.
        vBulletin 5 Documentation - Updated every Friday. Report issues here.
        vBulletin 5 API - Full / Mobile
        I am not currently available for vB Messenger Chats.

        Comment


        • #5
          Ok, excellent, thanks!

          Comment


          • #6
            Originally posted by Wayne Luke View Post
            You can put whatever you want within 200 characters in the replacement field when creating a custom BBCode in the AdminCP
            Is it new? In the latest versions of 5.5x only? Can we change this max value somewhere in the code?

            I have a custom BBcode with over 200 characters in the replacement field for my version 5.5.0 and I am very happy with that.
            Last edited by lange; Sun 11th Aug '19, 10:19am.

            Comment


            • #7
              Maybe it was inadvertently fixed. I have an open issue on it so will have to recheck it.
              Translations provided by Google.

              Wayne Luke
              The Rabid Badger - a vBulletin Cloud customization and demonstration site.
              vBulletin 5 Documentation - Updated every Friday. Report issues here.
              vBulletin 5 API - Full / Mobile
              I am not currently available for vB Messenger Chats.

              Comment


              • #8
                For the record, a free characters counter online is showing 570 characters on my 5.5.0 custom BBcode (empty spaces included).

                Comment

                Related Topics

                Collapse

                Working...
                X