+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: How to fix overall_header?

  1. #1
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    How to fix overall_header?

    Ok, I should put the x10 ad on top of some 20+ pages in the same directory. Now I ask you, how to make a overall_header like in phpBB 3 without editing 20+ files. Is that possible? All template files is written in php.
    Edit:
    Plz help! You are getting me suspended if you don't tell me
    Last edited by galaxyAbstractor; 11-10-2007 at 05:54 AM. Reason: Automerged Doublepost

  2. #2
    Thewinator is offline x10 Lieutenant Thewinator is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    [NL]
    Posts
    256

    Re: How to fix overall_header?

    Well you could write a piece of code that inserts the code in all files in a folder or something.
    But the best way is to use a new php file to load the contents of the other files.
    This is realy basic but comes down to this:
    PHP Code:
    echo "the x10 ad here";
    include(
    'your_content.php'); 



  3. #3
    GamingX's Avatar
    GamingX is offline Executive Team GamingX is an unknown quantity at this point
    Join Date
    Aug 2007
    Location
    Bangalore, India
    Posts
    6,353

    Re: How to fix overall_header?

    Read the tutorials for ads by clicking the link in the signature. You will find a tutorial for inserting ads for PHBB 3.
    Syed
    Executive Team
    www.x10hosting.com

    Phone #: 1-888-X10-9668 -> Ext: 709

  4. #4
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Re: How to fix overall_header?

    I have managed to insert in phpBB 3 but I will insert it here: http://jagf.pcriot.com/dk and here: http://jagf.pcriot.com/phaos . All template files is php. In phaos there isn't even template files. There are over ~100 php files that the public can see and I want to insert the add making changes to just 1 or 2 files. I have no energy to paste code in over 120 php files and if some error occours idk where the problem are.

  5. #5
    Slothie's Avatar
    Slothie is offline Lord Of The Keys Slothie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Singapore
    Posts
    1,432

    Re: How to fix overall_header?

    There should be a header.tpl somewhere. I haven't used phpBB for quite some time, if you'd paste out the directory structure for the template files I'm sure I could figure out something.

    Easiest 70 points you'll make on x10

    Feel free to add my reputation by clicking on the if you found my post helpful to you :P


    If I am not responding to your PMs, that means I am ignoring you. Take a hint.



    09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0


  6. #6
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Re: How to fix overall_header?

    BUT FOR **** SAKE!!! I'm not want help with phpBB!!! I am already done with phpBB. Now I want to add the banner at the pages that still needs it! I have over 100 pages I don't know how to insert the ad without editing them all!!! And no!! There aren't any .tpl files. Only php and css! Not even html!

  7. #7
    Thewinator is offline x10 Lieutenant Thewinator is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    [NL]
    Posts
    256

    Re: How to fix overall_header?

    Quote Originally Posted by Thewinator View Post
    Well you could write a piece of code that inserts the code in all files in a folder or something.
    But the best way is to use a new php file to load the contents of the other files.
    This is realy basic but comes down to this:
    PHP Code:
    echo "the x10 ad here";
    include(
    'your_content.php'); 
    Have you considered this?



  8. #8
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Re: How to fix overall_header?

    Yes but do I need to insert it in every php file???

  9. #9
    Slothie's Avatar
    Slothie is offline Lord Of The Keys Slothie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Singapore
    Posts
    1,432

    Re: How to fix overall_header?

    Okay this might work and it might not for you. But here's a way to add a php header to ALL files in the directory

    Add this in the .htaccess file of the directory
    Code:
    AddHandler application/x-httpd-php .php
    php_value auto_prepend_file overall_header.php
    php_value auto_append_file overall_footer.php
    This code, tells Apache to automatically run the overall_header.php before the requested php file and to run the file overall_footer.php after the conclusion of the requested file.

    It’s a powerful way to create common headers and footers to pages or files, but be aware that it comes at a cost,


    Then create a new file called overall_header.php and put the following text in it:
    PHP Code:
    <?php
    function callback($buffer)
    {
    $adtext = <<<EOF
    <BODY>
    SOME ADS HERE
    EOF;
      
    $x = (str_replace("<body>"$adtext$buffer));
      return 
    $x;
    }
    ob_start("callback");
    ?>
    You probably want to change the body text to whatever tag you want the ads to show under, that's just an example.

    Finally you need to flush the file, so make a new file called overall_footer.php and put this inside

    PHP Code:
    <?php
    ob_end_flush
    ();
    ?>
    Final notes: The handler MAY be different according to which version of PHP you have. I haven't logged into my x10 account for awhile so I forgot the handler name but you can find it in cPanel.
    Last edited by Slothie; 11-10-2007 at 08:41 AM.

    Easiest 70 points you'll make on x10

    Feel free to add my reputation by clicking on the if you found my post helpful to you :P


    If I am not responding to your PMs, that means I am ignoring you. Take a hint.



    09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0


  10. #10
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Re: How to fix overall_header?

    Quote Originally Posted by Slothie View Post
    Okay this might work and it might not for you. But here's a way to add a php header to ALL files in the directory

    Add
    Code:
    AddHandler application/x-httpd-php .php
    php_value auto_prepend_file overall_header.php
    php_value auto_append_file overall_footer.php
    Do I add this in the apache handler in the cPanel??? And will the overall_header.php only show up in the directory overall_header.php is in?

+ Reply to Thread
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers