Esempio n. 1
0
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
try {
    $faqsession->userTracking('new_entry', 0);
} catch (PMF_Exception $e) {
    // @todo handle the exception
}
// Get possible user input
$selectedQuestion = PMF_Filter::filterInput(INPUT_GET, 'question', FILTER_VALIDATE_INT);
$selectedCategory = PMF_Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT);
$question = $readonly = '';
if (!is_null($selectedQuestion)) {
    $oQuestion = $faq->getQuestion($selectedQuestion);
    $question = $oQuestion['question'];
    if (PMF_String::strlen($question)) {
        $readonly = ' readonly';
    }
}
$category->buildTree();
$categoryHelper = new PMF_Helper_Category();
$categoryHelper->setCategory($category);
$captchaHelper = new PMF_Helper_Captcha($faqConfig);
// Enable/Disable WYSIWYG editor
if ($faqConfig->get('main.enableWysiwygEditorFrontend')) {
    $tpl->parseBlock('writeContent', 'enableWysiwygEditor', array('currentTimestamp' => $_SERVER['REQUEST_TIME']));
}
$tpl->parse('writeContent', array('msgNewContentHeader' => $PMF_LANG['msgNewContentHeader'], 'msgNewContentAddon' => $PMF_LANG['msgNewContentAddon'], 'lang' => $Language->getLanguage(), 'openQuestionID' => $selectedQuestion, 'defaultContentMail' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('email') : '', 'defaultContentName' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('display_name') : '', 'msgNewContentName' => $PMF_LANG['msgNewContentName'], 'msgNewContentMail' => $PMF_LANG['msgNewContentMail'], 'msgNewContentCategory' => $PMF_LANG['msgNewContentCategory'], 'printCategoryOptions' => $categoryHelper->renderOptions($selectedCategory), 'msgNewContentTheme' => $PMF_LANG['msgNewContentTheme'], 'readonly' => $readonly, 'printQuestion' => $question, 'msgNewContentArticle' => $PMF_LANG['msgNewContentArticle'], 'msgNewContentKeywords' => $PMF_LANG['msgNewContentKeywords'], 'msgNewContentLink' => $PMF_LANG['msgNewContentLink'], 'captchaFieldset' => $captchaHelper->renderCaptcha($captcha, 'add', $PMF_LANG['msgCaptcha'], $auth), 'msgNewContentSubmit' => $PMF_LANG['msgNewContentSubmit']));
$tpl->merge('writeContent', 'index');
Esempio n. 2
0
    }
    ?>

                    <div class="form-group">
                        <label class="col-lg-2 control-label"><?php 
    print $PMF_LANG["msgCategory"];
    ?>
:</label>
                        <div class="col-lg-4">
                            <select name="searchcat" class="form-control">
                                <option value="0"><?php 
    print $PMF_LANG["msgShowAllCategories"];
    ?>
</option>
                                <?php 
    print $categoryHelper->renderOptions($searchcat);
    ?>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <button class="btn btn-primary" type="submit" name="submit">
                                <?php 
    print $PMF_LANG["msgSearch"];
    ?>
                            </button>
                        </div>
                    </div>
                </form>
    if ($faqConfig->get('main.enableRewriteRules')) {
        header('Location: ' . $faqConfig->get('main.referenceURL') . '/solution_id_' . $inputSearchTerm . '.html');
    } else {
        header('Location: ' . $faqConfig->get('main.referenceURL') . '/index.php?solution_id=' . $inputSearchTerm);
    }
    exit;
}
$category->buildTree();
$mostPopularSearchData = $faqSearch->getMostPopularSearches($faqConfig->get('search.numberSearchTerms'));
// Set base URL scheme
if ($faqConfig->get('main.enableRewriteRules')) {
    $baseUrl = sprintf("%ssearch.html?search=%s&amp;seite=%d%s&amp;searchcategory=%d", PMF_Link::getSystemRelativeUri('index.php'), urlencode($inputSearchTerm), $page, $languages, $inputCategory);
} else {
    $baseUrl = sprintf('%s?%saction=search&amp;search=%s&amp;seite=%d%s&amp;searchcategory=%d', PMF_Link::getSystemRelativeUri(), empty($sids) ? '' : 'sids=' . $sids . '&amp;', urlencode($inputSearchTerm), $page, $languages, $inputCategory);
}
// Pagination options
$options = array('baseUrl' => $baseUrl, 'total' => $faqSearchResult->getNumberOfResults(), 'perPage' => $faqConfig->get('records.numberOfRecordsPerPage'), 'pageParamName' => 'seite', 'layoutTpl' => '<div class="pagination text-center"><ul>{LAYOUT_CONTENT}</ul></div>');
$faqPagination = new PMF_Pagination($faqConfig, $options);
$categoryHelper = new PMF_Helper_Category();
$categoryHelper->setCategory($category);
$searchHelper = new PMF_Helper_Search($faqConfig);
$searchHelper->setSearchterm($inputSearchTerm);
$searchHelper->setCategory($category);
$searchHelper->setPagination($faqPagination);
$searchHelper->setPlurals($plr);
$searchHelper->setSessionId($sids);
if ('' == $searchResult && !is_null($inputSearchTerm)) {
    $searchResult = $searchHelper->renderSearchResult($faqSearchResult, $page);
}
$tpl->parse('writeContent', array('msgAdvancedSearch' => $tagSearch ? $PMF_LANG['msgTagSearch'] : $PMF_LANG['msgAdvancedSearch'], 'msgSearch' => $PMF_LANG['msgSearch'], 'searchString' => PMF_String::htmlspecialchars($inputSearchTerm, ENT_QUOTES, 'utf-8'), 'searchOnAllLanguages' => $PMF_LANG['msgSearchOnAllLanguages'], 'checkedAllLanguages' => $allLanguages ? ' checked="checked"' : '', 'selectCategories' => $PMF_LANG['msgSelectCategories'], 'allCategories' => $PMF_LANG['msgAllCategories'], 'printCategoryOptions' => $categoryHelper->renderOptions($inputCategory), 'writeSendAdress' => '?' . $sids . 'action=search', 'msgSearchWord' => $PMF_LANG['msgSearchWord'], 'printResult' => $searchResult, 'openSearchLink' => $searchHelper->renderOpenSearchLink(), 'msgMostPopularSearches' => $PMF_LANG['msgMostPopularSearches'], 'printMostPopularSearches' => $searchHelper->renderMostPopularSearches($mostPopularSearchData)));
$tpl->merge('writeContent', 'index');
                    </div>
                    <?php 
    }
    ?>
                </fieldset>
                <!-- categories -->
                <fieldset>
                    <div class="control-group">
                        <label class="control-label"><?php 
    echo $PMF_LANG["ad_entry_category"];
    ?>
</label>
                        <div class="controls">
                            <select name="rubrik[]" id="phpmyfaq-categories" size="8" multiple class="input-large">
                                <?php 
    echo $categoryHelper->renderOptions($categories);
    ?>
                            </select>
                        </div>
                    </div>
                </fieldset>
                <!-- Activation -->
                <fieldset>
                    <div class="control-group">
                        <label class="control-label" for="active"><?php 
    echo $PMF_LANG["ad_entry_active"];
    ?>
</label>
                        <div class="controls">
                        <?php 
    if ($permission['approverec']) {
        echo $PMF_LANG['ad_export_which_cat'];
        ?>
</legend>
                <div class="control-group">
                    <label class="control-label" for="catid"><?php 
        echo $PMF_LANG["ad_entry_category"];
        ?>
</label>
                    <div class="controls">
                        <select name="catid" id="catid" size="1">
                            <option value="0"><?php 
        echo $PMF_LANG['msgShowAllCategories'];
        ?>
</option>
                            <?php 
        echo $categoryHelper->renderOptions();
        ?>
                        </select>
                    </div>
                </div>

                <div class="control-group">
                    <div class="controls">
                        <label class="checkbox" for="downwards">
                            <input type="checkbox" name="downwards" id="downwards" value="1" checked="checked" />
                            <?php 
        echo $PMF_LANG['ad_export_cat_downwards'];
        ?>
                        </label>
                    </div>
                </div>
Esempio n. 6
0
// Set base URL scheme
if ($faqConfig->get('main.enableRewriteRules')) {
    $baseUrl = sprintf("%ssearch.html?search=%s&amp;seite=%d%s&amp;searchcategory=%d", PMF_Link::getSystemRelativeUri('index.php'), urlencode($inputSearchTerm), $page, $languages, $inputCategory);
} else {
    $baseUrl = sprintf('%s?%saction=search&amp;search=%s&amp;seite=%d%s&amp;searchcategory=%d', PMF_Link::getSystemRelativeUri(), empty($sids) ? '' : 'sids=' . $sids . '&amp;', urlencode($inputSearchTerm), $page, $languages, $inputCategory);
}
// Pagination options
$options = array('baseUrl' => $baseUrl, 'total' => $faqSearchResult->getNumberOfResults(), 'perPage' => $faqConfig->get('records.numberOfRecordsPerPage'), 'pageParamName' => 'seite', 'layoutTpl' => '<div class="text-center"><ul class="pagination">{LAYOUT_CONTENT}</ul></div>');
$faqPagination = new PMF_Pagination($faqConfig, $options);
$categoryHelper = new PMF_Helper_Category();
$categoryHelper->setCategory($category);
$searchHelper = new PMF_Helper_Search($faqConfig);
$searchHelper->setSearchterm($inputSearchTerm);
$searchHelper->setCategory($category);
$searchHelper->setPagination($faqPagination);
$searchHelper->setPlurals($plr);
$searchHelper->setSessionId($sids);
if ('' == $searchResult && !is_null($inputSearchTerm)) {
    $searchResult = $searchHelper->renderSearchResult($faqSearchResult, $page);
}
if ($tagSearch) {
    $tpl->parseBlock('writeContent', 'searchTagsSection', array('searchTags' => $tagHelper->renderTagList($tags)));
    $tpl->parseBlock('writeContent', 'relatedTags', array('relatedTagsHeader' => $PMF_LANG['msgRelatedTags'], 'relatedTags' => $relTags));
} else {
    if ('' === $search) {
        $tpl->parseBlock('writeContent', 'tagListSection', array('msgTags' => $PMF_LANG['msgPopularTags'], 'tagList' => $tagging->renderPopularTags(0)));
    }
    $tpl->parseBlock('writeContent', 'searchBoxSection', array('writeSendAdress' => '?' . $sids . 'action=search', 'searchString' => PMF_String::htmlspecialchars($inputSearchTerm, ENT_QUOTES, 'utf-8'), 'searchOnAllLanguages' => $PMF_LANG['msgSearchOnAllLanguages'], 'checkedAllLanguages' => $allLanguages ? ' checked="checked"' : '', 'selectCategories' => $PMF_LANG['msgSelectCategories'], 'allCategories' => $PMF_LANG['msgAllCategories'], 'printCategoryOptions' => $categoryHelper->renderOptions($inputCategory), 'msgSearch' => $PMF_LANG['msgSearch'], 'openSearchLink' => $searchHelper->renderOpenSearchLink()));
}
$tpl->parse('writeContent', array('msgAdvancedSearch' => $tagSearch ? $PMF_LANG['msgTagSearch'] : $PMF_LANG['msgAdvancedSearch'], 'msgSearchWord' => $PMF_LANG['msgSearchWord'], 'printResult' => $searchResult, 'msgMostPopularSearches' => $PMF_LANG['msgMostPopularSearches'], 'printMostPopularSearches' => $searchHelper->renderMostPopularSearches($mostPopularSearchData)));
$tpl->merge('writeContent', 'index');
 *
 * @category  phpMyFAQ
 * @package   Frontend
 * @author    Thorsten Rinne <*****@*****.**>
 * @copyright 2002-2015 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
 * @link      http://www.phpmyfaq.de
 * @since     2002-09-17
 */
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);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$faqsession->userTracking('ask_question', 0);
$category->buildTree();
$categoryId = PMF_Filter::filterInput(INPUT_GET, 'category_id', FILTER_VALIDATE_INT, 0);
$categoryHelper = new PMF_Helper_Category();
$categoryHelper->setCategory($category);
$captchaHelper = new PMF_Helper_Captcha($faqConfig);
$tpl->parse('writeContent', array('msgQuestion' => $PMF_LANG['msgQuestion'], 'msgNewQuestion' => $PMF_LANG['msgNewQuestion'], 'lang' => $Language->getLanguage(), 'msgNewContentName' => $PMF_LANG['msgNewContentName'], 'msgNewContentMail' => $PMF_LANG['msgNewContentMail'], 'defaultContentMail' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('email') : '', 'defaultContentName' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('display_name') : '', 'msgAskCategory' => $PMF_LANG['msgAskCategory'], 'printCategoryOptions' => $categoryHelper->renderOptions($categoryId), 'msgAskYourQuestion' => $PMF_LANG['msgAskYourQuestion'], 'captchaFieldset' => $captchaHelper->renderCaptcha($captcha, 'ask', $PMF_LANG['msgCaptcha'], $auth), 'msgNewContentSubmit' => $PMF_LANG['msgNewContentSubmit']));
$tpl->merge('writeContent', 'index');