How to create a GENERIC_SHELL template for vBulletin 5?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mr B
    Member
    • Mar 2007
    • 97
    • 5.3.x

    [vB5] How to create a GENERIC_SHELL template for vBulletin 5?

    Hi,

    we are going to upgrade to vBulletin 5.x but is missing the "GENERIC_SHELL" template that was available in vBulletin 4. Any idéa how we could create one for vBulletin 5?

    Thanks!
  • Mark.B
    vBulletin Support
    • Feb 2004
    • 24286
    • 6.0.X

    #2
    vBulletin 5 uses a completely different code and template structure to vBulletin 4.

    This would require custom coding, which we are unable to provide support for.
    MARK.B
    vBulletin Support
    ------------
    My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
    My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

    Comment

    • Mr B
      Member
      • Mar 2007
      • 97
      • 5.3.x

      #3
      Thanks for quick reply Mark. I will try to get answers on the vBulletin.org site. I think we cannot upgrade to version 5.x until we can use this feature due to a custom photo album that uses it.

      Comment

      • Mark.B
        vBulletin Support
        • Feb 2004
        • 24286
        • 6.0.X

        #4
        May be worth asking on Glenn Vergara 's site also: https://vbmods.rocks
        MARK.B
        vBulletin Support
        ------------
        My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
        My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

        Comment

        • glennrocksvb
          Former vBulletin Developer
          • Mar 2011
          • 4011
          • 5.7.X

          #5
          You can create a new page in vB5 using Sitebuilder. You can drag and drop any modules you need such as PHP module, Ad module, etc. You can also call an existing or custom template from PHP module and Ad module.

          PHP Module:
          PHP Code:
          $template = new vB5_Template('mytemplate');
          $template->register('name','vBMods.rocks');
          echo 
          $template->render(); 

          Ad Module:
          Code:
          {vb:template mytemplate, name='vBMods.rocks'}
          Note: Due to vBCloud, the ad code is enclosed in <vb:literal></vb:literal> tags causing it to display as raw text. In self-hosted version, you can edit the ad template to remove the literal tags. The ad template is named based on widget instance id of the Ad module you added on the page. The format is ad_XXXX where XXXX is the widget instance id. You can find it by inspecting the module in the browser dev tools.

          In 'mytemplate' template:
          Code:
          Hello <strong>{vb:raw name}</strong>!
          Output:
          Hello vBMods.rocks!

          Flag Icon Postbit Insert GIPHY Impersonate User BETTER INITIALS AVATAR Better Name Card Quote Selected Text Bookmark Posts Post Footer Translate Stop Links in Posts +MORE!

          Comment

          • Mr B
            Member
            • Mar 2007
            • 97
            • 5.3.x

            #6
            Thanks for the reply Glenn Vergara ! Unfortunately i did not explain the whole issue but maybe you can help out more?

            We have been using the GENERIC_SHELL template from vBulletin 4 with an custom built PHP photo album. So the GENERIC_SHELL template was used to add CSS, header, navbar and footer to the custom built PHP scripts. We also included the old global.php for login handling in the photo album.

            We loaded the global.php file to grab $vbulletin->userinfo['userid'] & $vbulletin->userinfo['username'] and then constructed $navbits & $navbar and generated the custom page with the following code.

            $template = "GENERIC_SHELL";
            $templater = vB_Template::create($template);
            $templater->register_page_templates();
            $templater->register('navbar', $navbar);
            $templater->register('pagetitle', $pagetitle);
            $templater->register('HTML', $content);
            print_output($templater->render());

            It have been working really nice, but now when the new vBulletin is rebuilt it doesnt work anymore. I understand that vBulletin cannot support custom made PHP code but it would be rather nice to know how to make a custom built PHP scripts that uses the vBulletin framwork to enable CSS, header, navbar and footer.

            Any ideas?

            Comment

            • glennrocksvb
              Former vBulletin Developer
              • Mar 2011
              • 4011
              • 5.7.X

              #7
              What's the value of the $content variable?

              In vB5, you can create via Sitebuilder a new page that has the same header, navbar and footer. You don't have to code for it. You can so choose what layout (full, 70-30, 30-70, 33-33-33) to use. For the actual content, all you have to do is drag and drop modules onto the page. So I was thinking whatever value you have for the $content variable, you'll add the code in a PHP Module. In a PHP Module, you can do anything. You can call a template, call an APi, access the database directly, etc.

              Flag Icon Postbit Insert GIPHY Impersonate User BETTER INITIALS AVATAR Better Name Card Quote Selected Text Bookmark Posts Post Footer Translate Stop Links in Posts +MORE!

              Comment

              • Wayne Luke
                vBulletin Technical Support Lead
                • Aug 2000
                • 73981

                #8
                The Generic Shell was used to create custom pages in vBulletin 4. To do this in vBulletin 5, go to the main page, turn on site builder, and click "Add Page."

                Put your content in a Static HTML or PHP Module.
                Translations provided by Google.

                Wayne Luke
                The Rabid Badger - a vBulletin Cloud demonstration site.
                vBulletin 5 API

                Comment

                Related Topics

                Collapse

                Working...