How to make vb header and footer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dawidnex
    Member
    • Apr 2014
    • 41

    How to make vb header and footer

    Hi

    I need to instal may home page menunavbar in vb 5 - how i can make it - any ideas?
  • Mark.B
    vBulletin Support
    • Feb 2004
    • 24286
    • 6.0.X

    #2
    This would require custom coding....you can try asking for help on vbulletin.org.
    Most likely, you'll be looking at paying a third party coder to do this, as it involves integrating a third party website with vBulletin.
    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

    • dawidnex
      Member
      • Apr 2014
      • 41

      #3
      Do you know somebody that can do that ?

      Comment

      • pjclas
        New Member
        • Aug 2012
        • 25
        • 4.2.X

        #4
        This is completely doable in vb5, but it's a bit different than it was in vb4. I do this at http://psntrophyleaders.com/forums. What you need to do is create a product and then in the api folder of the product create a php file called page.php with the following code:

        Code:
        <?php
        
        class myproductname_Api_Page extends vB_Api_Extensions
        {
          public $product = 'myproductname';
          public $version = '1.0.0';
          public $developer = 'Foo Developer';
          public $title = 'Site Integration';
          public $minver = '5.0.0';
          public $maxver = '6.0.0';
          public $infourl = '';
          public $checkurl = '';
          public $AutoInstall = 0;
          public $extensionOrder = 5;
        
            public function fetchPageById($page, $pageid, $routeData = array())
            {
               ob_start();
               include('myheader.php');
               $page['myHeader'] = ob_get_contents();
               ob_end_clean();
                                 
               ob_start();
               include('myfooter.php');
               $page['myFooter'] = ob_get_contents();
               ob_end_clean();
        
               return $page;
            } 
        }
        
        ?>
        This code will be called every time a page is loaded and will store your header and footer in variables passed to the template.

        After this, create a custom template for the header and a template for the footer. Each template will contain one simple line of code:
        Code:
        {vb:raw page.myHeader} or {vb:raw page.myFooter}
        Now all you have to do is install your product and add hooks for the header and footer. I added the footer at location footer_before_body_end and passed page=page as "Hook Arguments". For the header hook, I actually created a new hook called header_after_body_begin and also passed page=page as "Hook Arguments". The good news is that I submitted a new function request for the new hook location and it was approved. The new hook should be released in 5.1.4, but you can follow that here.

        When you are all done, this should install a custom header and footer around the vbulletin page!

        Hope this helps you!

        Comment

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