Take a Tour (take_a_tour.php)

Overview

The take_a_tour.php script renders the public Take a Tour page for the Tech Logistics site. It assembles shared templates, injects metadata, initializes JavaScript for a video modal, and embeds a YouTube tour video in a FancyBox iframe .

Template & Configuration

  • inc/config.php
    Starts the session, defines constants (e.g. TEMPLATE_DIR), and resolves $current_template_name based on $TEMPLATE[$currnt_file_name] .
  • Template Top Fragment
    Optionally includes TEMPLATE_DIR . $current_template_name . "_top.php" if that file exists .
  • Metadata Includes
    • TEMPLATE_DIR . "inc/template_meta.php" for core meta tags
    • inc/panels/meta.php for shared <meta> or scripts
    • Conditionally includes TEMPLATE_DIR . $current_template_name . "_meta.php" for page-specific metadata .

JavaScript Initialization

The page uses jQuery to bind FancyBox to elements with the .tour_video class:

$(document).ready(function(){
  $(".tour_video").fancybox({
    transitionIn:  'elastic',
    transitionOut: 'elastic',
    speedIn:       600,
    speedOut:      200,
    overlayShow:   true,
    type:          'iframe',
    width:         818,
    height:        618,
    hideOnOverlayClick: false
  });
});

This displays the YouTube tour in a modal iframe .

Page Structure

<?php
  include_once("inc/config.php");
  if (file_exists(TEMPLATE_DIR . $current_template_name . "_top.php")) {
    include_once(TEMPLATE_DIR . $current_template_name . "_top.php");
  }
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
  <?php 
    include_once(TEMPLATE_DIR . "inc/template_meta.php");
    include_once("inc/panels/meta.php");
    if (file_exists(TEMPLATE_DIR . $current_template_name . "_meta.php")) {
      include_once(TEMPLATE_DIR . $current_template_name . "_meta.php");
    }
  ?>
  <script type="text/javascript">
    // FancyBox init (shown above)
  </script>
</head>
<body>
  <div id="wrapper">
    <?php include_once("inc/panels/header-home.php"); ?>
    <div id="content-wrap">
      <img class="fa-banner-image" src="images/common/banner-img.jpg" alt="">
      <div class="container">
        <div class="fa-main-content fa-signup">
          <div id="content">
            <h1 class="inner-heading">Take a Tour</h1>
            <ul class="video_list">
              <center>
                <iframe width="460" height="515"
                  src="http://www.youtube.com/embed/Krxs2kSUzvk"
                  frameborder="0" allowfullscreen>
                </iframe>
              </center>
            </ul>
            <br clear="all" />
          </div>
        </div>
      </div>
    </div>
    <?php include_once("inc/panels/footer-home.php"); ?>
  </div>
  <div id="del-confirm-dialog" title=""></div>
</body>
</html>

Key Components

  • Header Panel (inc/panels/header-home.php)
    Displays the public site navigation and logo .
  • Banner Image
    Static banner located at images/common/banner-img.jpg.
  • Main Content
    Wrapped in .fa-main-content, contains the page heading and a centered YouTube embed.
  • Footer Panel (inc/panels/footer-home.php)
    Renders contact links, site footer, and legal notices .
  • Delete Confirmation Dialog
    A hidden <div> ready for jQuery UI dialogs (#del-confirm-dialog).

Dependency & Flow

  1. Config Load: Bootstraps constants, session, and template mapping.
  2. Optional Top Include: Inserts any template-specific header fragment.
  3. Meta Injection: Merges global and page-specific <meta> and script includes.
  4. Header: Renders the site’s header.
  5. Content: Displays a banner and the main “Take a Tour” section.
  6. Footer: Renders the site’s footer.
  7. Dialog Placeholder: Prepares a modal dialog container.

This modular approach keeps take_a_tour.php focused on content, while shared elements and scripts live in reusable panels and configuration files.