示例#1
0
文件: sitemap.php 项目: noon/phpMyFAQ
 * @subpackage Frontend
 * @author     Thomas Zeithaml <*****@*****.**>
 * @author     Thorsten Rinne <*****@*****.**>
 * @since      2005-08-21
 * @version    SVN: $Id$
 * @copyright  2005-2009 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['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$faqsession->userTracking('sitemap', 0);
$letter = PMF_Filter::filterInput(INPUT_GET, 'letter', FILTER_SANITIZE_STRIPPED);
if (!is_null($letter) && 1 == PMF_String::strlen($letter)) {
    $currentLetter = strtoupper($db->escape_string(PMF_String::substr($letter, 0, 1)));
} else {
    $currentLetter = 'A';
}
$sitemap = new PMF_Sitemap($current_user, $current_groups);
$tpl->processTemplate('writeContent', array('writeLetters' => $sitemap->getAllFirstLetters(), 'writeMap' => $sitemap->getRecordsFromLetter($currentLetter), 'writeCurrentLetter' => $currentLetter));
$tpl->includeTemplate('writeContent', 'index');
 * obtain one at http://mozilla.org/MPL/2.0/.
 *
 * @category  phpMyFAQ
 * @package   Frontend
 * @author    Thomas Zeithaml <*****@*****.**>
 * @author    Thorsten Rinne <*****@*****.**>
 * @copyright 2005-2015 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
 * @link      http://www.phpmyfaq.de
 * @since     2005-08-21
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    $protocol = 'http';
    if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON') {
        $protocol = 'https';
    }
    header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$faqsession->userTracking('sitemap', 0);
$letter = PMF_Filter::filterInput(INPUT_GET, 'letter', FILTER_SANITIZE_STRIPPED);
if (!is_null($letter) && 1 == PMF_String::strlen($letter)) {
    $currentLetter = strtoupper(PMF_String::substr($letter, 0, 1));
} else {
    $currentLetter = '';
}
$sitemap = new PMF_Sitemap($faqConfig);
$sitemap->setUser($current_user);
$sitemap->setGroups($current_groups);
$tpl->parse('writeContent', array('writeLetters' => $sitemap->getAllFirstLetters(), 'writeMap' => $sitemap->getRecordsFromLetter($currentLetter), 'writeCurrentLetter' => empty($currentLetter) ? $PMF_LANG['msgSitemap'] : $currentLetter));
$tpl->merge('writeContent', 'index');