header

Collapse

Please help with getting to know vB code all over again

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Go to Thank You uae
    Junior Member
    • 01.2021
    • 11
    • 0
    • 0

    Font Size
    #1

    Please help with getting to know vB code all over again

    Go to Thank You
    While examining the HTML, PHP, JavaScript, etc., of vB's architecture, I'm stumped on a particular aspect of how it's all assembled to create a page. For this post I'll use the example of ACP > Settings > Options > Spam Management.

    I viewed the HTML source of that page to get an idea of what's there, and I noticed that the form code looks like this (some values replaced with x's):

    HTML Code:
    <form action="options.php?do=dooptions" method="post" onsubmit="if (!window.__cfRLUnblockHandlers) return false; return count_errors()" name="optionsform" id="optionsform" data-cf-modified-xxxxxxxxxxxxxxxxxxxxxxxx-="">
    <input type="hidden" name="do" id="do" value="dooptions" />
    <input type="hidden" name="adminhash" value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
    <input type="hidden" name="securitytoken" value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
    I see a data-cf-modified value, a hash value, and a security token. I also see more data-cf-modified values all through the HTML source code.

    I've looked at many script files to see if I can determine how those values are generated, and can't seem wrap my head around it. So if I want to create a form for whatever reason, what scripts do I call to make everything work?
    I realize it may not be a simply explanation, so I definitely appreciate the time anyone can take to explain it to me.

    Thanks!Go to Top of Post
    Similar Threads
  • Go to Thank You arif
    Junior Member
    • 01.2021
    • 15
    • 2
    • 8

    Font Size
    #2
    Go to Thank You
    I'd recommend taking a look at the existing vBulletin 4 form modification. It will provide you with a lot more information than anyone can post here in a reasonable amount of time.

    New Posting Features - Easy Forms v4.x - Create a form or multiple forms without php or html knowledge vBulletin 4.x Add-ons
    Go to Top of Post

    Comment

    • Go to Thank You Ömer
      Super Moderator
      • 01.2021
      • 15
      • 1
      • 9

      Font Size
      #3
      Go to Thank You
      vBulletin 4.X uses a very linear method of building pages. It won't output a page until everything has been created. This is different from vBulletin 5 which will draw most of the page and then use AJAX and other modern technologies to fill in the blanks. vBulletin 4 also relies on HTML tags being in a specific order to dictate the layout of the page shown to the user. vBulletin 5 does not.

      You shouldn't have to worry about the data-cf-modified value. This is a timestamp inserted by Cloudflare to monitor whether to use a cached version of the form or not. If you do not use cloudflare, then you won't see this. It doesn't actually exist in the vBulletin code.

      Data attributes are a method of adding information to HTML tags that do not violate the HTML 5 specification. vBulletin 4.X doesn't actually use HTML 5. It uses XHMTL 1.0. A different specification. Though, browsers should still ignore attributes they don't understand unless you're running in a strict XHTML mode. The strict mode is not recommended because the majority of websites do not comply with it and many do not use decade old technology like XHTML 1.0 anymore.

      vBulletin 5 on the other hand, makes extensive use of data attributes along with Javascript hooks via CSS to build its pages.

      You can find more information on data-attributes here: Using data attributes - Learn web development | MDN (mozilla.org)


      The best tool to see how vBulletin 4 draws a specific AdminCP page is to look at the corresponding PHP script. Every link leads to a specific PHP file that reboots the vBulletin Engine, pulls information from the database, and initializes variables for that specific page only. Any single page doesn't know what the page before it did.

      Development should occur in a non-CloudFlare environment. Using a caching service like Cloudflare on a development server can make it appear like there are errors when in fact there are none.Go to Top of Post

      Comment

      X

      Thread Information

      Collapse

      Users Browsing this Thread

      There are currently 1 users browsing this thread. (0 members and 1 guests)

        Those who read this thread

        Collapse

        Members who have read this thread: 0

          Related Topics

          Collapse

          Topics Statistics Last Post
          Started by vB-Info, 2 weeks ago
          0 responses
          4 views
          0 reactions
          Last Post vB-Info
          by vB-Info
          Started by vB-Info, 2 weeks ago
          0 responses
          2 views
          0 reactions
          Last Post vB-Info
          by vB-Info
          Started by vB-Info, 13.03.24, 20:42
          0 responses
          21 views
          0 reactions
          Last Post vB-Info
          by vB-Info
          Working...
          😀
          😂
          🥰
          😘
          🤢
          😎
          😞
          😡
          👍
          👎

          AdBlock Detected

          Please Disable Adblock

          Please consider supporting us by disabling the ad blocker.

          I've Disabled AdBlock
          Home