Announcement

Collapse
No announcement yet.

Efficiency question: include external html file on frontpage only?

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

  • Efficiency question: include external html file on frontpage only?

    Hi:
    I was wondering how I would go about including an external html page in vBulletin, but only on the frontpage. What I have so far is inside template "phpinclude_start", do:

    Code:
     
    ob_start();
    include('http://www.mysite.com/test.html');
    $your_code = ob_get_contents();
    ob_end_clean();
    However, am I correct a call to the test.html url is made for every page request on my forum with the above? Since I only wish to include the file on the frontpage of my forum, is there some conditional I can add to limit the fetching of the URL to frontpage requests only?
    - JavaScript Kit | CSS Drive | CodingForums.com | CodeTricks.com

  • #2
    Yes, you can surround the code you have now with this:

    PHP Code:
    if (THIS_SCRIPT == 'index')
    {
    //your code

    Best Regards
    Colin Frei

    Please don't contact me per PM.

    Comment


    • #3
      Interesting, thanks! I never even knew about THIS_SCRIPT until now.
      - JavaScript Kit | CSS Drive | CodingForums.com | CodeTricks.com

      Comment


      • #4
        Yep, THIS_SCRIPT is defined at the top of most php files that are called directly
        Best Regards
        Colin Frei

        Please don't contact me per PM.

        Comment


        • #5
          does this allow to display forum posts (actual post, not just headlines) on a html page? say www.url.com/index.php if the forums are www.url.com/forums

          Comment


          • #6
            index.php would not be a vbulletin file, so this would not be relevant.
            Best Regards
            Colin Frei

            Please don't contact me per PM.

            Comment

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