Announcement

Collapse
No announcement yet.

Using variables in 'Header'

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

  • Using variables in 'Header'

    I am currently changing the layout of one of my vBulletin forums. My design will include a split layout (one frame with 15% and 85% tables) on which i would like the left table to always display who's online, site statistics and what not, all of which are displayed currently in 'forumhome'. Here's where my problem lies. Rather than split 'forumhome' into 2 tables, i'd prefer to edit 'header' so that the division is consistent on the entire forum, rather than just the front page. When attempting to plug variables ($loggedinusers, $welcometext, etc) into a table/cell in the 'header', it returns a blank display, rather than the information that is returned when these variables are used in 'forumhome'. What is the reason that variables are not returning any values in the 'header'?

    Thanks in advance. I hope this was enough information for you to try and help me figure out the problem.




  • #2
    Try putting this code in your phpinclude template (see attachment). $loggedinusers, $welcometext, $logincode, and $newposts should work in your header with this code. I pulled it straight out of the index.php file.

    The variables weren't working because they are defined only in index.php

    Comment


    • #3
      Originally posted by Jakeman
      Try putting this code in your phpinclude template (see attachment). $loggedinusers, $welcometext, $logincode, and $newposts should work in your header with this code. I pulled it straight out of the index.php file.

      The variables weren't working because they are defined only in index.php
      Thanks Jake. Here's what I did, with no success:

      Found phpinclude which was simply:
      Code:
      // This code is PHP4 only:
      // ob_start(); 
      // require("yourheader.html");
      // $header = ob_get_contents(); 
      // ob_end_clean();
      I cut and pasted the text file you attached, right after this. Nothing seemed to have changed. Is that what you meant by 'putting this code in my phpinclude template' ?? Thanks again



      Comment


      • #4
        You also need to use those variables in your header template. Put them where you want the information to show up.

        Comment


        • #5
          Originally posted by Jakeman
          You also need to use those variables in your header template. Put them where you want the information to show up.
          Yes, I did that as well, but it is still drawing a blank return.



          Comment


          • #6
            It's working on my unhacked 2.2.9 forums.

            If you send me a PM with the url of your forums and an admin login I can take a quick look to make sure the phpinclude template and header variables are correct.

            Comment

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