$metaDescription = $faqconfig->get('main.metaDescription'); } // // found a solution ID? // $solution_id = PMF_Filter::filterInput(INPUT_GET, 'solution_id', FILTER_VALIDATE_INT); if (!is_null($solution_id)) { $title = ' - powered by phpMyFAQ ' . $faqconfig->get('main.currentVersion'); $keywords = ''; $faqData = $faq->getIdFromSolutionId($solution_id); if (is_array($faqData)) { $id = $faqData['id']; $lang = $faqData['lang']; $title = ' - ' . $faq->getRecordTitle($id); $keywords = ',' . $faq->getRecordKeywords($id); $metaDescription = PMF_Utils::makeShorterText(strip_tags($faqData['content']), 12); } } // // Handle the Tagging ID // $tag_id = PMF_Filter::filterInput(INPUT_GET, 'tagging_id', FILTER_VALIDATE_INT); if (!is_null($tag_id)) { $title = ' - ' . $oTag->getTagNameById($tag_id); $keywords = ''; } // // Handle the SiteMap // $letter = PMF_Filter::filterInput(INPUT_GET, 'letter', FILTER_SANITIZE_STRIPPED); if (!is_null($letter) && 1 == PMF_String::strlen($letter)) {
?> </td> <td><a href="../index.php?action=artikel&cat=<?php print $data['category_id']; ?> &id=<?php print $data['id']; ?> &artlang=<?php print $data['lang']; ?> " title="<?php print PMF_String::htmlspecialchars(trim($data['question']), ENT_QUOTES, 'utf-8'); ?> "><?php print PMF_Utils::makeShorterText(PMF_htmlentities(trim($data['question']), ENT_QUOTES, 'utf-8'), 14); ?> </a></td> <td><?php print $data['usr']; ?> </td> <td style="width: 50px;"><img src="stat.bar.php?num=<?php print $data['num']; ?> " border="0" alt="<?php print round($data['num'] * 20); ?> %" width="50" height="15" title="<?php print round($data['num'] * 20); ?>
// Handle actions switch ($action) { case 'getVersion': $result = array('version' => $faqconfig->get('main.currentVersion')); break; case 'getApiVersion': $result = array('apiVersion' => (int) $faqconfig->get('main.currentApiVersion')); break; case 'search': $search = new PMF_Search($db, $Language); $searchString = PMF_Filter::filterInput(INPUT_GET, 'q', FILTER_SANITIZE_STRIPPED); $result = $search->search($searchString, false); $url = $faqconfig->get('main.referenceURL') . '/index.php?action=artikel&cat=%d&id=%d&artlang=%s'; foreach ($result as &$data) { $data->answer = html_entity_decode(strip_tags($data->answer), ENT_COMPAT, 'utf-8'); $data->answer = PMF_Utils::makeShorterText($data->answer, 12); $data->link = sprintf($url, $data->category_id, $data->id, $data->lang); } break; case 'getCategories': $category = new PMF_Category($current_user, $current_groups, true); $result = $category->categories; break; case 'getFaqs': $faq = new PMF_Faq($current_user, $current_groups); $result = $faq->getAllRecordPerCategory($categoryId); break; case 'getFaq': $faq = new PMF_Faq($current_user, $current_groups); $faq->getRecord($recordId); $result = $faq->faqRecord;
$faq->getAllRecords(); $_records = $faq->faqRecords; $tot = count($_records); $end = microtime(true); $output .= ' #' . $tot . ', done in ' . round($end - $start, 4) . ' sec.' . ($isRequestedByWebLocalhost ? '' : "\n"); $output .= $isRequestedByWebLocalhost ? '' : "\n"; if ($isRequestedByWebLocalhost) { echo '<pre>'; } $output = $output . "\n"; echo $output; $i = 0; foreach ($_records as $_r) { $i++; $output = ''; $output .= sprintf('%0' . strlen((string) $tot) . 'd', $i) . '/' . $tot . '. Checking ' . $_r['solution_id'] . ' (' . PMF_Utils::makeShorterText(strip_tags($_r['title']), 8) . '):'; $start = microtime(true); if ($oLnk->getEntryState($_r['id'], $_r['lang'], true) === true) { $output .= $oLnk->verifyArticleURL($_r['content'], $_r['id'], $_r['lang'], true); } $end = microtime(true); $output .= ' done in ' . round($end - $start, 4) . ' sec.'; $output .= $isRequestedByWebLocalhost ? '' : "\n"; if ($isRequestedByWebLocalhost) { $output = $output . "\n"; } echo $output; } $output = ''; $totEnd = microtime(true); $output .= $isRequestedByWebLocalhost ? '' : "\n";
$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', $faqConfig->get('main.referenceURL')); $rss->startElementNS('atom', 'link', 'http://www.w3.org/2005/Atom'); $rss->writeAttribute('rel', 'self'); $rss->writeAttribute('type', 'application/rss+xml'); $rss->writeAttribute('href', $faqConfig->get('main.referenceURL') . 'feed/openquestions/rss.php'); $rss->endElement(); if ($num > 0) { $counter = 0; foreach ($rssData as $item) { if ($counter < PMF_RSS_OPENQUESTIONS_MAX) { $counter++; $rss->startElement('item'); $rss->writeElement('title', PMF_Utils::makeShorterText(html_entity_decode($item['question'], ENT_COMPAT, 'UTF-8'), 8) . " (" . $item['username'] . ")"); $rss->startElement('description'); $rss->writeCdata($item['question']); $rss->endElement(); $rss->writeElement('link', (isset($_SERVER['HTTPS']) ? 's' : '') . "://" . $_SERVER["HTTP_HOST"] . str_replace("feed/openquestions/rss.php", "index.php", $_SERVER['SCRIPT_NAME']) . "?action=open#openq_" . $item['id']); $rss->writeElement('guid', (isset($_SERVER['HTTPS']) ? 's' : '') . "://" . $_SERVER["HTTP_HOST"] . str_replace("feed/openquestions/rss.php", "index.php", $_SERVER['SCRIPT_NAME']) . "?action=open#openq_" . $item['id']); $rss->writeElement('pubDate', PMF_Date::createRFC822Date($item['created'], true)); $rss->endElement(); } } } $rss->endElement(); $rss->endElement(); $rssData = $rss->outputMemory(); $headers = array('Content-Type: application/rss+xml', 'Content-Length: ' . strlen($rssData)); $http = new PMF_Helper_Http();
/** * Prepares and returns the sticky records for the frontend * * @return array */ public function getStickyRecords() { $result = $this->getStickyRecordsData(); $output = array(); if (count($result) > 0) { foreach ($result as $row) { $output[] = array('title' => PMF_Utils::makeShorterText($row['thema'], 8), 'url' => $row['url']); } } else { $output['error'] = sprintf('<li>%s</li>', $this->pmf_lang['err_noTopTen']); } if (!isset($output['error'])) { $html = ''; foreach ($output as $entry) { $html .= sprintf('<li><a href="%s">%s</a></li>', $entry['url'], $entry['title']); } $output['html'] = $html; } return $output; }
$metaDescription = $faqConfig->get('main.metaDescription'); } // // found a solution ID? // $solutionId = PMF_Filter::filterInput(INPUT_GET, 'solution_id', FILTER_VALIDATE_INT); if (!is_null($solutionId)) { $title = ' - powered by phpMyFAQ ' . $faqConfig->get('main.currentVersion'); $keywords = ''; $faqData = $faq->getIdFromSolutionId($solutionId); if (is_array($faqData)) { $id = $faqData['id']; $lang = $faqData['lang']; $title = ' - ' . $faq->getRecordTitle($id); $keywords = ',' . $faq->getRecordKeywords($id); $metaDescription = str_replace('"', '', PMF_Utils::makeShorterText(strip_tags($faqData['content']), 12)); } } // // Handle the Tagging ID // $tag_id = PMF_Filter::filterInput(INPUT_GET, 'tagging_id', FILTER_VALIDATE_INT); if (!is_null($tag_id)) { $title = ' - ' . $oTag->getTagNameById($tag_id); $keywords = ''; } // // Handle the SiteMap // $letter = PMF_Filter::filterInput(INPUT_GET, 'letter', FILTER_SANITIZE_STRIPPED); if (!is_null($letter) && 1 == PMF_String::strlen($letter)) {
/** * The header of the PDF file * * @return void */ public function Header() { $title = $this->category->name . ': ' . $this->question; $currentTextColor = $this->TextColor; $this->SetTextColor(0, 0, 0); $this->SetFont('arialunicid0', 'B', 18); $this->MultiCell(0, 9, $title, 0, 'C', 0); if ($this->enableBookmarks) { $this->Bookmark(PMF_Utils::makeShorterText($this->question, 5)); } $this->TextColor = $currentTextColor; $this->SetMargins(PDF_MARGIN_LEFT, $this->getLastH() + 5, PDF_MARGIN_RIGHT); }
$rss->writeElement('link', PMF_Link::getSystemUri('/feed/topten/rss.php')); if ($num > 0) { $i = 0; foreach ($rssData as $item) { $i++; // Get the url $link = str_replace($_SERVER['SCRIPT_NAME'], '/index.php', $item['url']); if (PMF_RSS_USE_SEO) { if (isset($item['thema'])) { $oLink = new PMF_Link($link); $oLink->itemTitle = html_entity_decode($item['thema'], ENT_COMPAT, 'UTF-8'); $link = html_entity_decode($oLink->toString(), ENT_COMPAT, 'UTF-8'); } } $rss->startElement('item'); $rss->writeElement('title', PMF_Utils::makeShorterText(html_entity_decode($item['thema'], ENT_COMPAT, 'UTF-8'), 8) . " (" . $item['visits'] . " " . $PMF_LANG['msgViews'] . ")"); $rss->startElement('description'); $rss->writeCdata("[" . $i . ".] " . $item['thema'] . " (" . $item['visits'] . " " . $PMF_LANG['msgViews'] . ")"); $rss->endElement(); $rss->writeElement('link', PMF_Link::getSystemUri('/feed/topten/rss.php') . $link); $rss->writeElement('pubDate', PMF_Date::createRFC822Date($item['last_visit'], false)); $rss->endElement(); } } $rss->endElement(); $rss->endElement(); $rssData = $rss->outputMemory(); header('Content-Type: application/rss+xml'); header('Content-Length: ' . strlen($rssData)); print $rssData; $db->dbclose();
?> </td> <td><a href="../index.php?action=artikel&cat=<?php print $data['category_id']; ?> &id=<?php print $data['id']; ?> &artlang=<?php print $data['lang']; ?> " title="<?php print PMF_String::htmlspecialchars(trim($data['question']), ENT_QUOTES, 'utf-8'); ?> "><?php print PMF_Utils::makeShorterText(PMF_String::htmlspecialchars(trim($data['question']), ENT_QUOTES, 'utf-8'), 14); ?> </a></td> <td><?php print $data['usr']; ?> </td> <td style="width: 50px;"><img src="stat.bar.php?num=<?php print $data['num']; ?> " border="0" alt="<?php print round($data['num'] * 20); ?> %" width="50" height="15" title="<?php print round($data['num'] * 20); ?>
$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) { $counter++; $rss->startElement('item'); $rss->writeElement('title', PMF_Utils::makeShorterText(html_entity_decode($item->question), 8) . " (" . $item->username . ")"); $rss->startElement('description'); $rss->writeCdata($item->question); $rss->endElement(); $rss->writeElement('link', (isset($_SERVER['HTTPS']) ? 's' : '') . "://" . $_SERVER["HTTP_HOST"] . str_replace("feed/openquestions/rss.php", "index.php", $_SERVER["PHP_SELF"]) . "?action=open#openq_" . $item->id); $rss->writeElement('pubDate', PMF_Date::createRFC822Date($item->date, true)); $rss->endElement(); } } } $rss->endElement(); $rss->endElement(); $rssData = $rss->outputMemory(); header('Content-Type: application/rss+xml'); header('Content-Length: ' . strlen($rssData)); print $rssData;
$rss = new XMLWriter(); $rss->openMemory(); $rss->startDocument('1.0', $PMF_LANG['metaCharset']); $rss->startElement('rss'); $rss->writeAttribute('version', '2.0'); $rss->startElement('channel'); $rss->writeElement('title', utf8_encode($PMF_CONF['main.titleFAQ']) . ' - ' . utf8_encode($PMF_LANG['msgOpenQuestions'])); $rss->writeElement('description', utf8_encode($PMF_CONF['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) { $counter++; $rss->startElement('item'); $rss->writeElement('title', utf8_encode(PMF_Utils::makeShorterText($item['question'], 8) . " (" . $item['user'] . ")")); $rss->startElement('description'); $rss->writeCdata(utf8_encode($item['question'])); $rss->endElement(); $rss->writeElement('link', utf8_encode((isset($_SERVER['HTTPS']) ? 's' : '') . "://" . $_SERVER["HTTP_HOST"] . str_replace("feed/openquestions/rss.php", "index.php", $_SERVER["PHP_SELF"]) . "?action=open#openq_" . $item['id'])); $rss->writeElement('pubDate', PMF_Date::createRFC822Date($item['date'], false)); $rss->endElement(); } } } $rss->endElement(); $rss->endElement(); $rssData = $rss->outputMemory(); header('Content-Type: application/rss+xml'); header('Content-Length: ' . strlen($rssData)); print $rssData;
$rss->writeElement('link', PMF_Link::getSystemUri('/feed/topten/rss.php')); if ($num > 0) { $i = 0; foreach ($rssData as $item) { $i++; // Get the url $link = str_replace($_SERVER['PHP_SELF'], '/index.php', $item['url']); if (PMF_RSS_USE_SEO) { if (isset($item['thema'])) { $oL = new PMF_Link($link); $oL->itemTitle = $item['thema']; $link = $oL->toString(); } } $rss->startElement('item'); $rss->writeElement('title', utf8_encode(PMF_Utils::makeShorterText($item['thema'], 8) . " (" . $item['visits'] . " " . $PMF_LANG['msgViews'] . ")")); $rss->startElement('description'); $rss->writeCdata(utf8_encode("[" . $i . ".] " . $item['thema'] . " (" . $item['visits'] . " " . $PMF_LANG['msgViews'] . ")")); $rss->endElement(); $rss->writeElement('link', utf8_encode(PMF_Link::getSystemUri('/feed/topten/rss.php') . $link)); $rss->writeElement('pubDate', PMF_Date::createRFC822Date($item['last_visit'], false)); $rss->endElement(); } } $rss->endElement(); $rss->endElement(); $rssData = $rss->outputMemory(); header('Content-Type: application/rss+xml'); header('Content-Length: ' . strlen($rssData)); print $rssData; $db->dbclose();
/** * Prepares and returns the sticky records for the frontend * * @return array */ public function getStickyRecords() { $result = $this->getStickyRecordsData(); $output = array(); if (count($result) > 0) { foreach ($result as $row) { $shortTitle = PMF_Utils::makeShorterText($row['thema'], 8); $output['title'][] = $shortTitle; $output['url'][] = $row['url']; } } else { $output['error'] = $this->pmf_lang['err_noTopTen']; } return $output; }
/** * The header of the PDF file * * @return void */ public function Header() { $title = $this->categories[$this->category]['name'] . ': ' . $this->thema; $currentTextColor = $this->TextColor; $this->SetTextColor(0, 0, 0); $this->SetFont('dejavusans', 'B', 18); $this->MultiCell(0, 9, $title, 0, 'C', 0); if ($this->enableBookmarks) { $this->Bookmark(PMF_Utils::makeShorterText($this->thema, 5)); } $this->TextColor = $currentTextColor; $this->SetMargins(PDF_MARGIN_LEFT, $this->getLastH() + 5, PDF_MARGIN_RIGHT); }
onselect : function(value) { var elements = value.split('_'); var faqLink = '<a class="intfaqlink" href="index.php?action=artikel&cat=' + elements[0] + '&id=' + elements[1] + '&artlang=' + elements[2] + '">' + elements[3] + '</a>'; tinyMCE.execCommand('mceBeginUndoLevel'); tinyMCE.execCommand('mceInsertContent', false, faqLink); tinyMCE.execCommand('mceEndUndoLevel'); } }); <?php $faq->getAllRecords(FAQ_SORTING_TYPE_FAQID); foreach ($faq->faqRecords as $record) { $_title = str_replace(array("\n", "\r", "\r\n"), '', '(' . $record['id'] . ') ' . $record['title']); printf("flb.add('%s', '%d_%d_%s_%s');\n", str_replace("'", "`", PMF_Utils::makeShorterText($_title, 8)), $record['category_id'], $record['id'], $record['lang'], str_replace("'", "`", $record['title'])); } ?> return flb; } return null; } }); // Register plugin with a short name tinymce.PluginManager.add('internalfaqlinkbox', tinymce.plugins.internalFaqLinkPlugin); tinyMCE.init({
?> </td> <td><?php echo $data['lang']; ?> </td> <td> <a href="<?php echo $url; ?> " title="<?php echo $question; ?> "> <?php echo PMF_Utils::makeShorterText($question, 14); ?> </a> </td> <td><?php echo $data['usr']; ?> </td> <td> <?php if (round($data['num'] * 20) > 75) { $progressBar = 'success'; } elseif (round($data['num'] * 20) < 25) { $progressBar = 'danger'; } else { $progressBar = 'info';
?> </td> <td class="list"><a href="../index.php?action=artikel&cat=<?php print $data['category_id']; ?> &id=<?php print $data['id']; ?> &artlang=<?php print $data['lang']; ?> " title="<?php print PMF_String::htmlspecialchars(trim($data['question']), ENT_QUOTES, $PMF_LANG['metaCharset']); ?> "><?php print PMF_Utils::makeShorterText(PMF_htmlentities(trim($data['question']), ENT_QUOTES, $PMF_LANG['metaCharset']), 14); ?> </a></td> <td class="list"><?php print $data['usr']; ?> </td> <td class="list" style="background-color: #d3d3d3;"><img src="stat.bar.php?num=<?php print $data['num']; ?> " border="0" alt="<?php print round($data['num'] * 20); ?> %" width="50" height="15" title="<?php print round($data['num'] * 20); ?>