Exemplo n.º 1
0
 *
 * @category  phpMyFAQ
 * @package   Frontend
 * @author    Thorsten Rinne <*****@*****.**>
 * @author    Lars Tiedemann <*****@*****.**>
 * @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-08-27
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($sids);
$oGlossary = new PMF_Glossary();
$oLnk = new PMF_Linkverifier();
$tagging = new PMF_Tags();
$relevant = new PMF_Relation();
$faqrating = new PMF_Rating();
$comment = new PMF_Comment();
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$currentCategory = $cat;
$record_id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$solution_id = PMF_Filter::filterInput(INPUT_GET, 'solution_id', FILTER_VALIDATE_INT);
$highlight = PMF_Filter::filterInput(INPUT_GET, 'highlight', FILTER_SANITIZE_STRIPPED);
$faqsession->userTracking('article_view', $record_id);
// Get all data from the FAQ record
Exemplo n.º 2
0
$oNews = new PMF_News();
$news_id = PMF_Filter::filterInput(INPUT_GET, 'newsid', FILTER_VALIDATE_INT);
if (is_null($news_id)) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$faqsession->userTracking('news_view', $id);
// Define the header of the page
$writeNewsHeader = $faqconfig->get('main.titleFAQ') . $PMF_LANG['msgNews'];
$writeNewsRSS = '&nbsp;<a href="feed/news/rss.php" target="_blank"><img id="newsRSS" src="images/feed.png" width="16" height="16" alt="RSS" /></a>';
// Get all data from the news record
$news = $oNews->getNewsEntry($news_id);
$content = $news['content'];
$header = $news['header'];
// Add Glossary entries
$oGlossary = new PMF_Glossary();
$content = $oGlossary->insertItemsIntoContent($content);
$header = $oGlossary->insertItemsIntoContent($header);
// Add information link if existing
if (strlen($news['link']) > 0) {
    $content .= sprintf('</p><p>%s<a href="%s" target="%s">%s</a>', $PMF_LANG['msgInfo'], $news['link'], $news['target'], $news['linkTitle']);
}
// Show link to edit the news?
$editThisEntry = '';
if (isset($permission['editnews'])) {
    $editThisEntry = sprintf('<a href="%sadmin/index.php?action=news&amp;do=edit&amp;id=%d">%s</a>', PMF_Link::getSystemRelativeUri('index.php'), $news_id, $PMF_LANG['ad_menu_news_edit']);
}
// Is the news item expired?
$expired = date('YmdHis') > $news['dateEnd'];
// Does the user have the right to add a comment?
if (!$news['active'] || !$news['allowComments'] || $expired) {
Exemplo n.º 3
0
 * 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_ADMIN')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
print sprintf('<h2>%s</h2>', $PMF_LANG['ad_menu_glossary']);
if ($permission['editglossary']) {
    $id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
    $glossary = new PMF_Glossary();
    $glossaryItem = $glossary->getGlossaryItem($id);
    ?>
<form action="?action=updateglossary" method="post">
<fieldset>
    <legend><?php 
    print $PMF_LANG['ad_glossary_edit'];
    ?>
</legend>

    <input type="hidden" name="id" value="<?php 
    print $glossaryItem['id'];
    ?>
" />

    <label class="left" for="item"><?php 
 * @author    Thorsten Rinne <*****@*****.**>
 * @copyright 2012-2015 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
 * @link      http://www.phpmyfaq.de
 * @since     2012-09-03
 */
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;
}
$page = PMF_Filter::filterInput(INPUT_GET, 'page', FILTER_VALIDATE_INT, 1);
$glossary = new PMF_Glossary($faqConfig);
$glossaryItems = $glossary->getAllGlossaryItems();
$numItems = count($glossaryItems);
$itemsPerPage = 10;
$baseUrl = sprintf('%s?action=glossary&amp;page=%d', PMF_Link::getSystemRelativeUri(), $page);
// Pagination options
$options = array('baseUrl' => $baseUrl, 'total' => count($glossaryItems), 'perPage' => $itemsPerPage, 'pageParamName' => 'page');
$pagination = new PMF_Pagination($faqConfig, $options);
if (0 < $numItems) {
    $output = array();
    $visibleItems = array_slice($glossaryItems, ($page - 1) * $itemsPerPage, $itemsPerPage);
    foreach ($visibleItems as $item) {
        $output['item'][] = $item['item'];
        $output['definition'][] = $item['definition'];
        $i++;
    }
Exemplo n.º 5
0
 * 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_ADMIN')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
print sprintf('<h2>%s</h2>', $PMF_LANG['ad_menu_glossary']);
if ($permission['addglossary'] || $permission['editglossary'] || $permission['delglossary']) {
    require_once PMF_ROOT_DIR . '/inc/Glossary.php';
    $glossary = new PMF_Glossary();
    if ('saveglossary' == $action && $permission['addglossary']) {
        $item = PMF_Filter::filterInput(INPUT_POST, 'item', FILTER_SANITIZE_STRIPPED);
        $definition = PMF_Filter::filterInput(INPUT_POST, 'definition', FILTER_SANITIZE_STRIPPED);
        if ($glossary->addGlossaryItem($item, $definition)) {
            print '<p>' . $PMF_LANG['ad_glossary_save_success'] . '</p>';
        } else {
            print '<p>' . $PMF_LANG['ad_glossary_save_error'];
            print '<br />' . $PMF_LANG["ad_adus_dberr"] . '<br />';
            print $db->error() . '</p>';
        }
    }
    if ('updateglossary' == $action && $permission['editglossary']) {
        $id = PMF_Filter::filterInput(INPUT_POST, 'id', FILTER_VALIDATE_INT);
        $item = PMF_Filter::filterInput(INPUT_POST, 'item', FILTER_SANITIZE_STRIPPED);
        $definition = PMF_Filter::filterInput(INPUT_POST, 'definition', FILTER_SANITIZE_STRIPPED);
Exemplo n.º 6
0
$oNews = new PMF_News($db, $Language);
$newsId = PMF_Filter::filterInput(INPUT_GET, 'newsid', FILTER_VALIDATE_INT);
if (is_null($newsId)) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$faqsession->userTracking('news_view', $id);
// Define the header of the page
$newsMainHeader = $faqconfig->get('main.titleFAQ') . $PMF_LANG['msgNews'];
$newsFeed = '&nbsp;<a href="feed/news/rss.php" target="_blank"><img id="newsRSS" src="images/feed.png" width="16" height="16" alt="RSS" /></a>';
// Get all data from the news record
$news = $oNews->getNewsEntry($newsId);
$newsContent = $news['content'];
$newsHeader = $news['header'];
// Add Glossary entries
$oGlossary = new PMF_Glossary();
$newsContent = $oGlossary->insertItemsIntoContent($newsContent);
$newsHeader = $oGlossary->insertItemsIntoContent($newsHeader);
// Add information link if existing
if (strlen($news['link']) > 0) {
    $newsContent .= sprintf('</p><p>%s<a href="%s" target="%s">%s</a>', $PMF_LANG['msgInfo'], $news['link'], $news['target'], $news['linkTitle']);
}
// Show link to edit the news?
$editThisEntry = '';
if (isset($permission['editnews'])) {
    $editThisEntry = sprintf('<a href="%sadmin/index.php?action=news&amp;do=edit&amp;id=%d">%s</a>', PMF_Link::getSystemRelativeUri('index.php'), $newsId, $PMF_LANG['ad_menu_news_edit']);
}
// Is the news item expired?
$expired = date('YmdHis') > $news['dateEnd'];
// Does the user have the right to add a comment?
if (!$news['active'] || !$news['allowComments'] || $expired) {
Exemplo n.º 7
0
 *
 * @category  phpMyFAQ
 * @package   Frontend
 * @author    Thorsten Rinne <*****@*****.**>
 * @author    Lars Tiedemann <*****@*****.**>
 * @copyright 2002-2012 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-08-27
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($db, $Language);
$oGlossary = new PMF_Glossary();
$oLnk = new PMF_Linkverifier();
$faqTagging = new PMF_Tags($db, $Language);
$faqRelation = new PMF_Relation($db, $Language);
$faqRating = new PMF_Rating();
$faqComment = new PMF_Comment();
if (is_null($user)) {
    $user = new PMF_User_CurrentUser();
}
$faqSearchResult = new PMF_Search_Resultset($user, $faq);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$currentCategory = $cat;
Exemplo n.º 8
0
 * @author    Lars Tiedemann <*****@*****.**>
 * @copyright 2002-2014 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
 * @link      http://www.phpmyfaq.de
 * @since     2002-08-27
 */
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;
}
$captcha = new PMF_Captcha($faqConfig);
$oGlossary = new PMF_Glossary($faqConfig);
$oLnk = new PMF_Linkverifier($faqConfig);
$faqTagging = new PMF_Tags($faqConfig);
$faqRelation = new PMF_Relation($faqConfig);
$faqRating = new PMF_Rating($faqConfig);
$faqComment = new PMF_Comment($faqConfig);
if (is_null($user)) {
    $user = new PMF_User_CurrentUser($faqConfig);
}
$faqSearchResult = new PMF_Search_Resultset($user, $faq, $faqConfig);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$currentCategory = $cat;