documentation is lacking: including two external php files.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LEARNER29
    Senior Member
    • Nov 2001
    • 316
    • 3.6.x

    documentation is lacking: including two external php files.

    hello. I am writing in reference to this.


    I would like to include two different php files, header.php in the header template and footer.php in the footer template.


    I created two plug-ins, both as "global start".

    the code of the "header" plug-in is

    Code:
      
     
      ob_start();
      include('path/to/this/file/header.php');
      $includedphpheader = ob_get_contents();
      ob_end_clean();
    that of the footer plug-in is



    Code:
      
     
      ob_start();
      include('path/to/this/file/footer.php');
      $includedphpfooter = ob_get_contents();
      ob_end_clean();

    and added to the "header" template of my style

    $includedphpheader

    and to the "footer" template of my style

    $includedphpfooter


    I of course did not forget to change

    path/to/this/file/

    to the real path on my server


    what is wrong or missing?
    .
  • Wayne Luke
    vBulletin Technical Support Lead
    • Aug 2000
    • 74132

    #2
    Nothing is lacking or missing. Are you sure its including the file correctly? Try using an absolute path from the server root or doing a chdir() to the directory and then back afterwards.
    Translations provided by Google.

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

    Comment

    • LEARNER29
      Senior Member
      • Nov 2001
      • 316
      • 3.6.x

      #3
      Originally posted by Wayne Luke
      Nothing is lacking or missing. Are you sure its including the file correctly? Try using an absolute path from the server root or doing a chdir() to the directory and then back afterwards.
      Sir,

      a non-programmer, such as myself, finds this document not clear enough as to how to add TWO external files.

      as a non-coder, I am not sure which part of the above code needs to be changed and which can / must stay as it is.

      I am begging that you kindly do not consider this as a personal attack on you or the person who is responsible of the documentation.
      .

      Comment

      • LEARNER29
        Senior Member
        • Nov 2001
        • 316
        • 3.6.x

        #4
        Originally posted by Wayne Luke
        Nothing is lacking or missing. Are you sure its including the file correctly? Try using an absolute path from the server root or doing a chdir() to the directory and then back afterwards.

        Wayne. I managed then to include 2 files. Now am trying to include a third, in the very same way, but it is not working.

        Something is missing but I can't figure out what.

        The plug in is active, no typing errors, but still not working.

        Anything you would recommend?
        .

        Comment

        • LEARNER29
          Senior Member
          • Nov 2001
          • 316
          • 3.6.x

          #5
          Originally posted by LEARNER29
          Wayne. I managed then to include 2 files. Now am trying to include a third, in the very same way, but it is not working.

          Something is missing but I can't figure out what.

          The plug in is active, no typing errors, but still not working.

          Anything you would recommend?

          now that is a bit surprising

          if $includedphpinpost is used in the header template, it works.
          when the very same $includedphpinpost is used in the postbit and postbit_legacy is used, it does not parse.

          .

          Comment

          • LEARNER29
            Senior Member
            • Nov 2001
            • 316
            • 3.6.x

            #6
            What am I supposed to do to get some support here ?

            why did we pay $160 for the script if there is no support?
            .

            Comment

            • Steve Machol
              Former Customer Support Manager
              • Jul 2000
              • 154488

              #7
              For help with add-ons and plugins, use www.vbulletin.org.
              Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
              Change CKEditor Colors to Match Style (for 4.1.4 and above)

              Steve Machol Photography


              Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


              Comment

              • LEARNER29
                Senior Member
                • Nov 2001
                • 316
                • 3.6.x

                #8
                Originally posted by Steve Machol
                For help with add-ons and plugins, use www.vbulletin.org.

                Steve thanks.

                I add an external php file to the common-template "header" of each style
                $includedphpheader
                and this works smoothly.

                In the same way, I added $includedineverypost in the postbit template.
                and a plug-in hooked to Product : vBulletin
                plug-in title ineverypost
                Hook global_start
                Plugin PHP Code
                ob_start();
                include('/home/domain/public_html/php/includes/ineverypost.inc.php');
                $includedineverypost = ob_get_contents();
                ob_end_clean();
                Plugin is Active YES
                but $includedphpheader is not being parsed.
                What am I missing?
                .

                Comment

                • LEARNER29
                  Senior Member
                  • Nov 2001
                  • 316
                  • 3.6.x

                  #9
                  If you have a similar problem and are looking for a solution, here you go
                  .

                  Comment

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