Results 1 to 4 of 4

Thread: Page Title for Custom Contact Page

  1. #1
    Join Date
    Oct 2005
    Posts
    14

    Default Page Title for Custom Contact Page

    I am trying to make a custom contact form page.
    I have the header and footer included in a page called contact.php which resides in the main root directroy (along with application.php, index.php etc.).
    It works, and the header and footer with the right links show up, and it picks up the css file fine.

    The only thing that doesn't work is the title loads up as: <%title%>.

    I tried adding $title = $titles["2016"]; to the code in contact.php, and adding the actual value of the title in titles.inc.php, but that didn't work.

    Any ideas on how to add a custom title to a custom page?

  2. #2
    Join Date
    Nov 2004
    Posts
    1,822

    Default

    hi, this is what i use and it works fine. Also allows user tracking from the admin panel.

    <?php
    //page cache AND session handling

    ob_start("ob_gzhandler");

    //-----------
    $cache_dir = '../cache/';
    $cache_file = 'faqUserSearching_';
    $cache_param = $_SERVER["QUERY_STRING"];

    $cache_time_arr = explode(';',implode(file('../page_caching.txt'),""));
    $cache_time = $cache_time_arr[0];
    $cache_time = $cache_time * 60;

    $cache_file = $cache_dir.$cache_file.$cache_param.session_id()." .html";
    // Get from the cache
    if(file_exists($cache_file) && time() - $cache_time < filemtime($cache_file)) {
    session_start();
    $_SESSION['indexu_session_username'] = $COOKIE_USERNAME;
    $_SESSION['indexu_session_location'] = "FAQ - User Searching";
    $_SESSION['indexu_session_ip'] = $_SERVER["REMOTE_ADDR"];
    echo "<!-- this is cache page -->\n";
    include($cache_file);
    exit;
    }
    else {
    include("../application.php");
    session_start();
    if(isset($COOKIE_USERNAME))
    $_SESSION['indexu_session_username'] = $COOKIE_USERNAME;
    $_SESSION['indexu_session_location'] = "FAQ - User Searching";
    $_SESSION['indexu_session_ip'] = $_SERVER["REMOTE_ADDR"];
    }

    ob_start();



    // start page output
    $title = "FAQ - User Searching";
    DisplayTemplate("http://www.bigfreeguide.com/camping/themes/default/detail_header.html" ,"\$title,\$cat");

    ?>
    <!-- content --->

    I Put the page content here....


    And then output the footer here,,,

    <?
    include("http://www.bigfreeguide.com/camping/themes/default/footer.html");
    ?>
    Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )

  3. #3
    Join Date
    Oct 2005
    Posts
    14

    Default

    BEAUTIFUL!
    The only thing that was tricky for me, was changing the paths in front of application.php, page_caching.txt, and cache/.

    I also changed the location to the header and footer file, and then the name of the title, session_location, and obviously $title.

    So, if anyone needs to use this, change those.

    Other than that, great workaround inspireme!
    Thanks!

  4. #4
    Join Date
    Nov 2004
    Posts
    1,822

    Default

    ahh yes, the paths only work for my suituation (indexU in a folder inside public_html) just drop the ../ bit on each path. obviously the header and footer path only works on my site (also i use a special header with description tags so the file name is different)

    The names and titles change as you need. glad you got it working
    Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )

Similar Threads

  1. Title / Meta Description - Home Page
    By brickholius in forum v5.x
    Replies: 0
    Last Post: 09-15-2005, 10:48 AM
  2. what does it mean ?
    By lewisw in forum v5.x
    Replies: 10
    Last Post: 08-29-2003, 02:05 AM
  3. Change title of the search page results
    By craven in forum v5.x
    Replies: 8
    Last Post: 11-17-2002, 06:58 PM
  4. Replies: 0
    Last Post: 11-01-2002, 10:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •