Example #1
0
<?php

/**
* $Id: main.php,v 1.2.2.7 2006/01/02 12:47:09 thorstenr Exp $
*
* @author       Thorsten Rinne <*****@*****.**>
* @since        2002-08-23
* @copyright    (c) 2001-2006 phpMyFAQ Team
* 
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*/
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$tpl->processTemplate('writeContent', array('writeNewsHeader' => $PMF_CONF['title'] . $PMF_LANG['msgNews'], 'writeNews' => generateNews($LANGCODE), 'writeNumberOfArticles' => $PMF_LANG['msgHomeThereAre'] . generateNumberOfArticles() . $PMF_LANG['msgHomeArticlesOnline'], 'writeTopTenHeader' => $PMF_LANG['msgTopTen'], 'writeTopTenRow' => generateTopTen($LANGCODE), 'writeNewestHeader' => $PMF_LANG['msgLatestArticles'], 'writeNewestRow' => generateFiveNewest($LANGCODE)));
$tpl->includeTemplate('writeContent', 'index');
Example #2
0
    $inc_php = $action . ".php";
    $writeLangAdress = $_SERVER['PHP_SELF'] . "?" . str_replace("&", "&amp;", $_SERVER["QUERY_STRING"]);
} else {
    if (isset($solution_id) && is_numeric($solution_id)) {
        // show the record with the solution ID
        $inc_tpl = 'template/artikel.tpl';
        $inc_php = 'artikel.php';
    } else {
        $inc_tpl = "template/main.tpl";
        $inc_php = "main.php";
    }
    $writeLangAdress = $_SERVER['PHP_SELF'] . "?" . $sids;
}
// load templates
$tpl = new phpmyfaqTemplate(array("index" => 'template/index.tpl', "writeContent" => $inc_tpl));
$main_template_vars = array("title" => $PMF_CONF["title"] . $title, "header" => $PMF_CONF["title"], "metaDescription" => $PMF_CONF["metaDescription"], "metaKeywords" => $PMF_CONF["metaKeywords"] . $keywords, "metaPublisher" => $PMF_CONF["metaPublisher"], "metaLanguage" => $PMF_LANG["metaLanguage"], "metaCharset" => $PMF_LANG["metaCharset"], "dir" => $PMF_LANG["dir"], "msgCategory" => $PMF_LANG["msgCategory"], "showCategories" => $tree->printCategories($cat), "searchBox" => $PMF_LANG["msgSearch"], "languageBox" => $PMF_LANG["msgLangaugeSubmit"], "writeLangAdress" => $writeLangAdress, "switchLanguages" => selectLanguages($LANGCODE), "userOnline" => userOnline() . $PMF_LANG["msgUserOnline"], 'writeTopTenHeader' => $PMF_LANG['msgTopTen'], 'writeTopTenRow' => generateTopTen($LANGCODE), 'writeNewestHeader' => $PMF_LANG['msgLatestArticles'], 'writeNewestRow' => generateFiveNewest($LANGCODE), 'copyright' => 'Etelegate.net');
if (isset($PMF_CONF["mod_rewrite"]) && $PMF_CONF["mod_rewrite"] == "TRUE") {
    $links_template_vars = array("faqHome" => $_SERVER['PHP_SELF'], "msgSearch" => '<a href="search.html">' . $PMF_LANG['msgAdvancedSearch'] . '</a>', "msgAddContent" => '<a href="addcontent.html">' . $PMF_LANG["msgAddContent"] . '</a>', "msgQuestion" => '<a href="ask.html">' . $PMF_LANG["msgQuestion"] . '</a>', "msgOpenQuestions" => '<a href="open.html">' . $PMF_LANG["msgOpenQuestions"] . '</a>', "msgHelp" => '<a href="help.html">' . $PMF_LANG["msgHelp"] . '</a>', "msgContact" => '<a href="contact.html">' . $PMF_LANG["msgContact"] . '</a>', "backToHome" => '<a href="index.html">' . $PMF_LANG["msgHome"] . '</a>', "allCategories" => '<a href="showcat.html">' . $PMF_LANG["msgShowAllCategories"] . '</a>', "writeSendAdress" => 'search.html', 'showSitemap' => '<a href="sitemap-A_' . $lang . '.html">' . $PMF_LANG['msgSitemap'] . '</a>');
} else {
    $links_template_vars = array("faqHome" => $_SERVER['PHP_SELF'], "msgSearch" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=search">' . $PMF_LANG['msgAdvancedSearch'] . '</a>', "msgAddContent" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=add">' . $PMF_LANG["msgAddContent"] . '</a>', "msgQuestion" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=ask">' . $PMF_LANG["msgQuestion"] . '</a>', "msgOpenQuestions" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=open">' . $PMF_LANG["msgOpenQuestions"] . '</a>', "msgHelp" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=help">' . $PMF_LANG["msgHelp"] . '</a>', "msgContact" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=contact">' . $PMF_LANG["msgContact"] . '</a>', "allCategories" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=show">' . $PMF_LANG["msgShowAllCategories"] . '</a>', "backToHome" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . '">' . $PMF_LANG["msgHome"] . '</a>', "writeSendAdress" => $_SERVER['PHP_SELF'] . "?" . $sids . "action=search", 'showSitemap' => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=sitemap">' . $PMF_LANG['msgSitemap'] . '</a>');
}
if (DEBUG) {
    $debug_template_vars = array('debugMessages' => '<p>DEBUG INFORMATION:<br />' . $db->sqllog() . '</p>');
} else {
    // send headers and print template
    @header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    @header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    @header("Cache-Control: no-store, no-cache, must-revalidate");
    @header("Cache-Control: post-check=0, pre-check=0", false);
    @header("Pragma: no-cache");
    @header("Content-type: text/html; charset=" . $PMF_LANG["metaCharset"]);