* * PHP Version 5.2 * * 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. * * @category phpMyFAQ * @package Frontend * @author Thorsten Rinne <*****@*****.**> * @copyright 2002-2010 phpMyFAQ Team * @license http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1 * @link http://www.phpmyfaq.de * @since 2002-09-17 */ if (!defined('IS_VALID_PHPMYFAQ')) { header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME'])); exit; } $faqsession->userTracking('open_questions', 0); $faqQuestions = new PMF_Faq_Questions(); $faqLayout = new PMF_Faq_Layout($categoryLayout); $allquestions = $faqQuestions->fetchAll(); $tpl->processTemplate('writeContent', array('msgOpenQuestions' => $PMF_LANG['msgOpenQuestions'], 'msgQuestionText' => $PMF_LANG['msgQuestionText'], 'msgDate_User' => $PMF_LANG['msgDate_User'], 'msgQuestion2' => $PMF_LANG['msgQuestion2'], 'printOpenQuestions' => $faqLayout->renderOpenQuestions($allquestions))); $tpl->includeTemplate('writeContent', 'index');
$Language = new PMF_Language(); $LANGCODE = $Language->setLanguage($faqconfig->get('main.languageDetection'), $faqconfig->get('main.language')); // Preload English strings require_once PMF_ROOT_DIR . '/lang/language_en.php'; if (isset($LANGCODE) && PMF_Language::isASupportedLanguage($LANGCODE)) { // Overwrite English strings with the ones we have in the current language require_once PMF_ROOT_DIR . '/lang/language_' . $LANGCODE . '.php'; } else { $LANGCODE = 'en'; } // // Initalizing static string wrapper // PMF_String::init($LANGCODE); $faqQuestions = new PMF_Faq_Questions(); $rssData = $faqQuestions->fetchAll(); $num = count($rssData); $rss = new XMLWriter(); $rss->openMemory(); $rss->setIndent(true); $rss->startDocument('1.0', 'utf-8'); $rss->startElement('rss'); $rss->writeAttribute('version', '2.0'); $rss->startElement('channel'); $rss->writeElement('title', $faqconfig->get('main.titleFAQ') . ' - ' . $PMF_LANG['msgOpenQuestions']); $rss->writeElement('description', html_entity_decode($faqconfig->get('main.metaDescription'))); $rss->writeElement('link', PMF_Link::getSystemUri('/feed/openquestions/rss.php')); if ($num > 0) { $counter = 0; foreach ($rssData as $item) { if ($counter < PMF_RSS_OPENQUESTIONS_MAX) {
$categoryData = new PMF_Category_Tree_DataProvider_SingleQuery($LANGCODE); $categoryLayout = new PMF_Category_Layout(new PMF_Category_Tree_Helper(new PMF_Category_Tree($categoryData))); $faqQuestions = new PMF_Faq_Questions(); if ($delete == 'yes') { $faqQuestions->delete($questionId); print $PMF_LANG['ad_entry_delsuc']; } else { $toggleQuestion = PMF_Filter::filterInput(INPUT_GET, 'is_visible', FILTER_SANITIZE_STRING); if ($toggleQuestion == 'toggle') { $is_visible = $faqQuestions->getVisibility($questionId); if (!is_null($is_visible)) { $faqQuestions->setVisibility($questionId, $is_visible == 'N' ? 'Y' : 'N'); } } printf("<h2>%s</h2>", $PMF_LANG['msgOpenQuestions']); $openQuestions = $faqQuestions->fetchAll(); if (count($openQuestions) > 0) { ?> <table id="tableOpenQuestions"> <thead> <tr> <th><?php print $PMF_LANG['ad_entry_author']; ?> </th> <th><?php print $PMF_LANG['ad_entry_theme']; ?> </th> <th><?php print $PMF_LANG['ad_entry_visibility'];