* * 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; } // HACK: (re)evaluate the Category object w/o passing the user language // so the result set of a Search will have the Category Path // for any of the multilanguage faq records and the Category list // on the left pane will not be affected $tree = new Category(); $tree->transform(0); if (isset($_GET['suchbegriff']) || isset($_GET['search'])) { if (isset($_GET['suchbegriff'])) { $suchbegriff = $db->escape_string(strip_tags($_GET['suchbegriff'])); $searchcategory = isset($_GET['searchcategory']) ? $db->escape_string(strip_tags($_GET['searchcategory'])) : '%'; } if (isset($_GET['search'])) { $suchbegriff = $db->escape_string(strip_tags($_GET['search'])); $searchcategory = isset($_GET['searchcategory']) ? $db->escape_string(strip_tags($_GET['searchcategory'])) : '%'; } $printResult = searchEngine($suchbegriff, $searchcategory); } else { $printResult = $PMF_LANG['help_search']; $suchbegriff = ''; } Tracking('fulltext_search', $suchbegriff);
$query_changes = sprintf("INSERT INTO %sfaqchanges (id, beitrag, usr, datum, what, lang, revision_id) VALUES (%d, %d, '%s', %d, '%s', '%s', %d)", SQLPREFIX, $db->nextID(SQLPREFIX . 'faqchanges', 'id'), $nextID, $auth_id, time(), nl2br($_POST['changed']), $lang, $revision_id); $result_changes = $db->query($query_changes); if ($result_record) { // Insert the new category relations foreach ($rubrik as $categories) { $db->query("INSERT INTO " . SQLPREFIX . "faqcategoryrelations VALUES (" . $categories . ", '" . $lang . "', " . $nextID . ", '" . $lang . "')"); } print $PMF_LANG["ad_entry_savedsuc"]; } else { print $PMF_LANG["ad_entry_savedfail"] . $db->error(); } } elseif (isset($submit[2]) && isset($_POST["thema"]) && $_POST["thema"] != "" && isset($_POST['rubrik']) && is_array($_POST['rubrik'])) { // Preview $rubrik = $_POST["rubrik"]; $cat = new Category(); $cat->transform(0); $categorylist = ''; foreach ($rubrik as $categories) { $categorylist .= $cat->getPath($categories) . '<br />'; } if (isset($_REQUEST["id"]) && $_REQUEST["id"] != "") { $id = $_REQUEST["id"]; } else { $id = ""; } $content = $_POST['content']; ?> <h3><strong><em><?php print $categorylist; ?> </em>
/** * generateXHTMLFile() * * This function generates a plain XHTML file with all entries. * * @return boolean * @access public * @author Thorsten Rinne <*****@*****.**> * @since 2004-11-13 */ function generateXHTMLFile() { global $db, $PMF_CONF, $PMF_LANG; $tree = new Category(); $tree->transform(0); $old = 0; $result = $db->query('SELECT ' . SQLPREFIX . 'faqdata.id AS id, ' . SQLPREFIX . 'faqdata.lang AS lang, ' . SQLPREFIX . 'faqdata.solution_id AS solution_id, ' . SQLPREFIX . 'faqdata.revision_id AS revision_id, ' . SQLPREFIX . 'faqcategoryrelations.category_id AS category_id, ' . SQLPREFIX . 'faqdata.keywords AS keywords, ' . SQLPREFIX . 'faqdata.thema AS thema, ' . SQLPREFIX . 'faqdata.content AS content, ' . SQLPREFIX . 'faqdata.author AS author, ' . SQLPREFIX . 'faqdata.datum AS datum FROM ' . SQLPREFIX . 'faqdata LEFT JOIN ' . SQLPREFIX . 'faqcategoryrelations ON ' . SQLPREFIX . 'faqdata.id = ' . SQLPREFIX . 'faqcategoryrelations.record_id AND ' . SQLPREFIX . 'faqdata.lang = ' . SQLPREFIX . 'faqcategoryrelations.record_lang ORDER BY ' . SQLPREFIX . 'faqcategoryrelations.category_id, ' . SQLPREFIX . 'faqdata.id'); $xhtml = '<?xml version="1.0" encoding="' . $PMF_LANG['metaCharset'] . '" ?>'; $xhtml .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'; $xhtml .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . $PMF_LANG['metaLanguage'] . '" lang="' . $PMF_LANG['metaLanguage'] . '">'; $xhtml .= '<head>'; $xhtml .= ' <title>' . $PMF_CONF['title'] . '</title>'; $xhtml .= ' <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=' . $PMF_LANG['metaCharset'] . '" />'; $xhtml .= ' <meta name="title" content="' . $PMF_CONF['title'] . '" />'; $xhtml .= '</head>'; $xhtml .= '<body dir="' . $PMF_LANG['dir'] . '">'; if ($db->num_rows($result) > 0) { while ($row = $db->fetch_object($result)) { if ($row->category_id != $old) { $xhtml .= '<h1>' . $tree->getPath($row->category_id) . '</h1>'; } $xhtml .= '<h2>' . $row->thema . '</h2>'; $xhtml .= '<p>' . $row->content . '</p>'; $xhtml .= '<p>' . $PMF_LANG["msgAuthor"] . $row->author . '<br />'; $xhtml .= 'ID: ' . $row->solution_id . '<br />'; $xhtml .= $PMF_LANG['ad_entry_revision'] . ': 1.' . $row->revision_id . '<br />'; $xhtml .= $PMF_LANG["msgLastUpdateArticle"] . makeDate($row->datum) . '</p>'; $xhtml .= '<hr style="width: 90%;" />'; $old = $row->category_id; } } $xhtml .= '</body>'; $xhtml .= '</html>'; if ($fp = fopen("../xml/phpmyfaq.html", "w")) { fputs($fp, $xhtml); fclose($fp); } }
*/ if (!defined('IS_VALID_PHPMYFAQ')) { header('Location: http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME'])); exit; } if (isset($_REQUEST['cat']) && is_numeric($_REQUEST['cat'])) { $category = (int) $_REQUEST['cat']; } if (isset($category) && $category != 0 && isset($tree->categoryName[$category])) { Tracking('show_category', $category); $parent = $tree->categoryName[$category]['parent_id']; $name = $tree->categoryName[$category]['name']; $records = printThemes($category); if (!$records) { $cats = new Category($LANGCODE); $cats->transform($category); $cats->collapseAll(); $records = $cats->viewTree(); } if ($parent != 0) { $up = '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=show&cat=' . $parent . '">' . $PMF_LANG['msgCategoryUp'] . '</a>'; } else { $up = ''; } $tpl->processTemplate('writeContent', array('writeCategory' => $PMF_LANG['msgEntriesIn'] . $name, 'writeThemes' => $records, 'writeOneThemeBack' => $up)); $tpl->includeTemplate('writeContent', 'index'); } else { Tracking('show_all_categories', 0); $tpl->processTemplate('writeContent', array('writeCategory' => $PMF_LANG['msgFullCategories'], 'writeThemes' => $tree->viewTree(), 'writeOneThemeBack' => '')); $tpl->includeTemplate('writeContent', 'index'); }