Example #1
0
 /**
  * Returns the single instance
  *
  * @access static
  * @return PMF_Helper_Category
  */
 public static function getInstance()
 {
     if (null == self::$instance) {
         $className = __CLASS__;
         self::$instance = new $className();
     }
     return self::$instance;
 }
Example #2
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');
Example #3
0
 * @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-16
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($db, $Language);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$faqsession->userTracking('new_entry', 0);
// Get possible user input
$inputQuestion = PMF_Filter::filterInput(INPUT_GET, 'question', FILTER_VALIDATE_INT);
$inputCategory = PMF_Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT);
$question = $readonly = '';
if (!is_null($inputQuestion)) {
    $faqQuestions = new PMF_Faq_Questions();
    $question = $faqQuestions->fetch($inputQuestion);
    if (PMF_String::strlen($question->question)) {
        $readonly = ' readonly="readonly"';
    }
}
$categoryLayout = new PMF_Category_Layout(new PMF_Category_Tree_Helper(new PMF_Category_Tree($categoryData)));
$tpl->processTemplate('writeContent', array('msgNewContentHeader' => $PMF_LANG['msgNewContentHeader'], 'msgNewContentAddon' => $PMF_LANG['msgNewContentAddon'], 'writeSendAdress' => '?' . $sids . 'action=save', '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' => $categoryLayout->renderOptions(array($inputCategory)), 'msgNewContentTheme' => $PMF_LANG['msgNewContentTheme'], 'readonly' => $readonly, 'printQuestion' => $question instanceof PMF_Faq_Questions ? $question->question : '', 'msgNewContentArticle' => $PMF_LANG['msgNewContentArticle'], 'msgNewContentKeywords' => $PMF_LANG['msgNewContentKeywords'], 'msgNewContentLink' => $PMF_LANG['msgNewContentLink'], 'captchaFieldset' => PMF_Helper_Captcha::getInstance()->renderFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('add')), 'msgNewContentSubmit' => $PMF_LANG['msgNewContentSubmit']));
$tpl->includeTemplate('writeContent', 'index');
Example #4
0
 * @license   http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
 * @link      http://www.phpmyfaq.de
 * @since     2002-09-16
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($db, $Language);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$faqsession->userTracking('new_entry', 0);
// Get possible user input
$inputQuestion = PMF_Filter::filterInput(INPUT_GET, 'question', FILTER_VALIDATE_INT);
$inputCategory = PMF_Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT);
$question = $readonly = '';
if (!is_null($inputQuestion)) {
    $oQuestion = $faq->getQuestion($inputQuestion);
    $question = $oQuestion['question'];
    if (PMF_String::strlen($question)) {
        $readonly = ' readonly="readonly"';
    }
}
$category->buildTree();
$helper = PMF_Helper_Category::getInstance();
$helper->setCategory($category);
$tpl->processTemplate('writeContent', array('msgNewContentHeader' => $PMF_LANG['msgNewContentHeader'], 'msgNewContentAddon' => $PMF_LANG['msgNewContentAddon'], 'lang' => $Language->getLanguage(), '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' => $helper->renderCategoryOptions($inputCategory), 'msgNewContentTheme' => $PMF_LANG['msgNewContentTheme'], 'readonly' => $readonly, 'printQuestion' => $question, 'msgNewContentArticle' => $PMF_LANG['msgNewContentArticle'], 'msgNewContentKeywords' => $PMF_LANG['msgNewContentKeywords'], 'msgNewContentLink' => $PMF_LANG['msgNewContentLink'], 'captchaFieldset' => PMF_Helper_Captcha::getInstance()->renderCaptcha($captcha, 'add', $PMF_LANG['msgCaptcha']), 'msgNewContentSubmit' => $PMF_LANG['msgNewContentSubmit']));
$tpl->includeTemplate('writeContent', 'index');
 * This Source Code Form is subject to the terms of the Mozilla Public License,
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
 * obtain one at http://mozilla.org/MPL/2.0/.
 *
 * @category  phpMyFAQ
 * @package   Frontend
 * @author    Thorsten Rinne <*****@*****.**>
 * @author    Elger Thiele <*****@*****.**>
 * @copyright 2008-2015 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
 * @link      http://www.phpmyfaq.de
 * @since     2008-01-25
 */
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;
}
$faqsession->userTracking('registration', 0);
$captcha = new PMF_Captcha($faqConfig);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$captchaHelper = new PMF_Helper_Captcha($faqConfig);
$tpl->parse('writeContent', array('msgRegistration' => $PMF_LANG['msgRegistration'], 'msgRegistrationCredentials' => $PMF_LANG['msgRegistrationCredentials'], 'msgRegistrationNote' => $PMF_LANG['msgRegistrationNote'], 'lang' => $LANGCODE, 'loginname' => $PMF_LANG["ad_user_loginname"], 'realname' => $PMF_LANG["ad_user_realname"], 'email' => $PMF_LANG["ad_entry_email"], 'submitRegister' => $PMF_LANG['submitRegister'], 'captchaFieldset' => $captchaHelper->renderCaptcha($captcha, 'register', $PMF_LANG['msgCaptcha'], $auth)));
$tpl->merge('writeContent', 'index');
Example #6
0
    exit;
}
$translationLanguage = PMF_Filter::filterInput(INPUT_POST, 'translation', FILTER_SANITIZE_STRIPPED, $LANGCODE);
if (!PMF_Language::isASupportedLanguage($translationLanguage)) {
    $translationLanguage = $LANGCODE;
}
$faqSource['id'] = 'writeSourceFaqId';
$faqSource['lang'] = $translationLanguage;
$faqSource['title'] = 'writeSourceTitle';
$faqSource['content'] = 'writeSourceContent';
$faqSource['keywords'] = 'writeSourceKeywords';
try {
    $faqsession->userTracking('new_translation_entry', 0);
} catch (PMF_Exception $e) {
    // @todo handle the exception
}
$id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$categoryId = PMF_Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT);
$srclang = PMF_Filter::filterInput(INPUT_GET, 'srclang', FILTER_SANITIZE_STRIPPED);
if (!is_null($id) && !is_null($srclang) && PMF_Language::isASupportedLanguage($srclang)) {
    $oFaq = new PMF_Faq($faqConfig);
    $oFaq->getRecord($id);
    $faqSource = $oFaq->faqRecord;
}
$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('writeSourceFaqId' => $faqSource['id'], 'writeSourceTitle' => $faqSource['title'], 'writeSourceContent' => strip_tags($faqSource['content']), 'writeSourceKeywords' => $faqSource['keywords'], 'categoryId' => $categoryId, 'msgNewTranslationHeader' => $PMF_LANG['msgNewTranslationHeader'], 'msgNewTranslationAddon' => $PMF_LANG['msgNewTranslationAddon'], 'msgNewTransSourcePane' => $PMF_LANG['msgNewTransSourcePane'], 'msgNewTranslationPane' => $PMF_LANG['msgNewTranslationPane'], 'writeSendAdress' => '?' . $sids . 'action=save', 'defaultContentName' => $user ? $user->getUserData('display_name') : '', 'defaultContentMail' => $user ? $user->getUserData('email') : '', 'msgNewTranslationQuestion' => $PMF_LANG['msgNewContentTheme'], 'msgNewTranslationAnswer' => $PMF_LANG['msgNewContentArticle'], 'msgNewTranslationName' => $PMF_LANG['msgNewTranslationName'], 'msgNewTranslationMail' => $PMF_LANG['msgNewTranslationMail'], 'msgNewTranslationKeywords' => $PMF_LANG['msgNewTranslationKeywords'], 'writeTransFaqLanguage' => $translationLanguage, 'captchaFieldset' => $captchaHelper->renderCaptcha($captcha, 'translate', $PMF_LANG['msgCaptcha'], $auth), 'msgNewTranslationSubmit' => $PMF_LANG['msgNewTranslationSubmit'], 'tinyMCELanguage' => PMF_Language::isASupportedTinyMCELanguage($LANGCODE) ? $LANGCODE : 'en'));
$tpl->merge('writeContent', 'index');
Example #7
0
        $minVisits = $_r['visits'];
    }
    if ($maxVisits < $_r['visits']) {
        $maxVisits = $_r['visits'];
    }
    if ($record_id == $_r['id'] && $lang == $_r['lang']) {
        $currVisits = $_r['visits'];
    }
}
if ($maxVisits - $minVisits > 0) {
    $percentage = 100 * ($currVisits - $minVisits) / ($maxVisits - $minVisits);
}
$faqPopularity = $currVisits . '/' . (int) $percentage . '%';
$translationForm = '';
if (count($arrLanguage) < count(PMF_Language::getAvailableLanguages())) {
    $translationUrl = sprintf(str_replace('%', '%%', PMF_Link::getSystemRelativeUri('index.php')) . 'index.php?%saction=translate&amp;cat=%s&amp;id=%d&amp;srclang=%s', $sids, $currentCategory, $record_id, $lang);
    $translationForm = '
        <form action="' . $translationUrl . '" method="post" style="display: inline;">
            <img src="images/translate.gif" alt="' . $PMF_LANG['msgTranslate'] . '" title="' . $PMF_LANG['msgTranslate'] . '" width="16" height="16" border="0" /> ' . $PMF_LANG['msgTranslate'] . ' ' . PMF_Language::selectLanguages($LANGCODE, false, $arrLanguage, 'translation') . ' <input class="submit" type="submit" name="submit" value="' . $PMF_LANG['msgTranslateSubmit'] . '" />
        </form>';
}
// Get rating
$recordRating = $faqrating->fetch($record_id);
if (!is_null($recordRating)) {
    $printVoting = sprintf(' %s (%s)', round($recordRating->sumVotings / $recordRating->numVotings, 2), $plr->GetMsg('plmsgVotes', $recordRating->numVotings));
} else {
    $printVoting = sprintf('0 (%s)', $plr->GetMsg('plmsgVotes', 0));
}
// Set the template variables
$tpl->processTemplate("writeContent", array('writeRubrik' => $categoryName . '<br />', 'solution_id' => $faq->faqRecord['solution_id'], 'writeThema' => $thema, 'writeArticleCategoryHeader' => $PMF_LANG['msgArticleCategories'], 'writeArticleCategories' => $writeMultiCategories, 'writeContent' => $content, 'writeTagHeader' => $PMF_LANG['msg_tags'] . ': ', 'writeArticleTags' => $tagging->getAllLinkTagsById($record_id), 'writeRelatedArticlesHeader' => $PMF_LANG['msg_related_articles'] . ': ', 'writeRelatedArticles' => $relevant->getAllRelatedById($record_id, $faq->faqRecord['title'], $faq->faqRecord['keywords']), 'writePopularity' => $faqPopularity, 'writeDateMsg' => $PMF_LANG['msgLastUpdateArticle'] . $faq->faqRecord['date'], 'writeRevision' => $PMF_LANG['ad_entry_revision'] . ': 1.' . $faq->faqRecord['revision_id'], 'writeAuthor' => $PMF_LANG['msgAuthor'] . ': ' . $faq->faqRecord['author'], 'editThisEntry' => $editThisEntry, 'writeDiggMsgTag' => 'Digg it!', 'link_digg' => sprintf('http://digg.com/submit?phase=2&amp;url=%s', urlencode($diggItUrl)), 'writeFacebookMsgTag' => 'Share on Facebook', 'link_facebook' => sprintf('http://www.facebook.com/sharer.php?u=%s', urlencode($facebookUrl)), 'link_email' => sprintf(str_replace('%', '%%', PMF_Link::getSystemRelativeUri('index.php')) . 'index.php?%saction=send2friend&amp;cat=%d&amp;id=%d&amp;artlang=%s', $sids, $currentCategory, $record_id, $lang), 'link_pdf' => sprintf(str_replace('%', '%%', PMF_Link::getSystemRelativeUri('index.php')) . 'pdf.php?cat=%d&amp;id=%d&amp;artlang=%s', $currentCategory, $record_id, $lang), 'writePDFTag' => $PMF_LANG['msgPDF'], 'writePrintMsgTag' => $PMF_LANG['msgPrintArticle'], 'writeSend2FriendMsgTag' => $PMF_LANG['msgSend2Friend'], 'translationForm' => $translationForm, 'saveVotingPATH' => sprintf(str_replace('%', '%%', PMF_Link::getSystemRelativeUri('index.php')) . 'index.php?%saction=savevoting', $sids), 'saveVotingID' => $record_id, 'saveVotingIP' => $_SERVER['REMOTE_ADDR'], 'msgAverageVote' => $PMF_LANG['msgAverageVote'], 'printVotings' => $printVoting, 'switchLanguage' => $switchLanguage, 'msgVoteUseability' => $PMF_LANG['msgVoteUseability'], 'msgVoteBad' => $PMF_LANG['msgVoteBad'], 'msgVoteGood' => $PMF_LANG['msgVoteGood'], 'msgVoteSubmit' => $PMF_LANG['msgVoteSubmit'], 'writeCommentMsg' => $commentMessage, 'msgWriteComment' => $PMF_LANG['msgWriteComment'], 'writeSendAdress' => '?' . $sids . 'action=savecomment', 'id' => $record_id, 'lang' => $lang, 'msgCommentHeader' => $PMF_LANG['msgCommentHeader'], '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') : '', 'msgYourComment' => $PMF_LANG['msgYourComment'], 'msgNewContentSubmit' => $PMF_LANG['msgNewContentSubmit'], 'captchaFieldset' => PMF_Helper_Captcha::getInstance()->renderFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('writecomment')), 'writeComments' => $comment->getComments($record_id, PMF_Comment::COMMENT_TYPE_FAQ)));
$tpl->includeTemplate('writeContent', 'index');
Example #8
0
 * 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 <*****@*****.**>
 * @author    Elger Thiele <*****@*****.**>
 * @copyright 2008-2011 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
 * @link      http://www.phpmyfaq.de
 * @since     2008-01-25
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$faqsession->userTracking('registration', 0);
$captcha = new PMF_Captcha($db, $Language);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$tpl->processTemplate('writeContent', array('msgRegistration' => $PMF_LANG['msgRegistration'], 'msgRegistrationCredentials' => $PMF_LANG['msgRegistrationCredentials'], 'msgRegistrationNote' => $PMF_LANG['msgRegistrationNote'], 'lang' => $LANGCODE, 'loginname' => $PMF_LANG["ad_user_loginname"], 'realname' => $PMF_LANG["ad_user_realname"], 'email' => $PMF_LANG["ad_entry_email"], 'submitRegister' => $PMF_LANG['submitRegister'], 'captchaFieldset' => PMF_Helper_Captcha::getInstance()->renderCaptcha($captcha, 'register', $PMF_LANG['msgCaptcha'])));
$tpl->includeTemplate('writeContent', 'index');
Example #9
0
$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) {
    $commentMessage = $PMF_LANG['msgWriteNoComment'];
} else {
    $commentMessage = sprintf('<a href="javascript:void(0);" onclick="javascript:$(\'#commentForm\').show();">%s</a>', $PMF_LANG['newsWriteComment']);
}
// date of news entry
if ($news['active'] && !$expired) {
    $newsDate = sprintf('%s<span id="newsLastUpd">%s</span>', $PMF_LANG['msgLastUpdateArticle'], PMF_Date::format($news['date']));
} else {
    $newsDate = '';
}
// Set the template variables
$tpl->processTemplate('writeContent', array('writeNewsHeader' => $newsMainHeader, 'writeNewsRSS' => $newsFeed, 'writeHeader' => $newsHeader, 'writeContent' => $newsContent, 'writeDateMsg' => $newsDate, 'writeAuthor' => $news['active'] && !$expired ? $PMF_LANG['msgAuthor'] . ': ' . $news['authorName'] : '', 'editThisEntry' => $editThisEntry, 'writeCommentMsg' => $commentMessage, 'msgWriteComment' => $PMF_LANG['newsWriteComment'], 'newsId' => $newsId, 'newsLang' => $news['lang'], 'msgCommentHeader' => $PMF_LANG['msgCommentHeader'], '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') : '', 'msgYourComment' => $PMF_LANG['msgYourComment'], 'msgNewContentSubmit' => $PMF_LANG['msgNewContentSubmit'], 'captchaFieldset' => PMF_Helper_Captcha::getInstance()->renderCaptcha($captcha, 'writecomment', $PMF_LANG['msgCaptcha']), 'writeComments' => $comment->getComments($newsId, PMF_Comment::COMMENT_TYPE_NEWS)));
$tpl->includeTemplate('writeContent', 'index');
 *
 * This Source Code Form is subject to the terms of the Mozilla Public License,
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
 * obtain one at http://mozilla.org/MPL/2.0/.
 *
 * @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-16
 */
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;
}
$faqsession->userTracking('contact', 0);
$captcha = new PMF_Captcha($faqConfig);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$captchaHelper = new PMF_Helper_Captcha($faqConfig);
$tpl->parse('writeContent', array('msgContact' => $PMF_LANG['msgContact'], 'msgContactOwnText' => nl2br($faqConfig->get('main.contactInformations')), 'msgContactEMail' => $PMF_LANG['msgContactEMail'], 'msgNewContentName' => $PMF_LANG['msgNewContentName'], 'msgNewContentMail' => $PMF_LANG['msgNewContentMail'], 'lang' => $Language->getLanguage(), 'defaultContentMail' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('email') : '', 'defaultContentName' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('display_name') : '', 'msgMessage' => $PMF_LANG['msgMessage'], 'msgS2FButton' => $PMF_LANG['msgS2FButton'], 'version' => $faqConfig->get('main.currentVersion'), 'captchaFieldset' => $captchaHelper->renderCaptcha($captcha, 'contact', $PMF_LANG['msgCaptcha'], $auth)));
$tpl->merge('writeContent', 'index');
Example #11
0
 * @since     2006-11-12
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($db, $Language);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$translationLanguage = PMF_Filter::filterInput(INPUT_POST, 'translation', FILTER_SANITIZE_STRIPPED, $LANGCODE);
if (!PMF_Language::isASupportedLanguage($translationLanguage)) {
    $translationLanguage = $LANGCODE;
}
$faqSource['id'] = 'writeSourceFaqId';
$faqSource['lang'] = $translationLanguage;
$faqSource['title'] = 'writeSourceTitle';
$faqSource['content'] = 'writeSourceContent';
$faqSource['keywords'] = 'writeSourceKeywords';
$faqsession->userTracking('new_translation_entry', 0);
$id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$srclang = PMF_Filter::filterInput(INPUT_GET, 'srclang', FILTER_SANITIZE_STRIPPED);
if (!is_null($id) && !is_null($srclang) && PMF_Language::isASupportedLanguage($srclang)) {
    $oFaq = new PMF_Faq();
    $oFaq->getRecord($id);
    $faqSource = $oFaq->faqRecord;
}
$tpl->processTemplate('writeContent', array('writeSourceFaqId' => $faqSource['id'], 'writeSourceTitle' => $faqSource['title'], 'writeSourceContent' => $faqSource['content'], 'writeSourceKeywords' => $faqSource['keywords'], 'msgNewTranslationHeader' => $PMF_LANG['msgNewTranslationHeader'], 'msgNewTranslationAddon' => $PMF_LANG['msgNewTranslationAddon'], 'msgNewTransSourcePane' => $PMF_LANG['msgNewTransSourcePane'], 'msgNewTranslationPane' => $PMF_LANG['msgNewTranslationPane'], 'writeSendAdress' => '?' . $sids . 'action=save', 'defaultContentName' => $user ? $user->getUserData('display_name') : '', 'defaultContentMail' => $user ? $user->getUserData('email') : '', 'msgNewTranslationName' => $PMF_LANG['msgNewTranslationName'], 'msgNewTranslationMail' => $PMF_LANG['msgNewTranslationMail'], 'msgNewTranslationKeywords' => $PMF_LANG['msgNewTranslationKeywords'], 'writeTransFaqLanguage' => $translationLanguage, 'captchaFieldset' => PMF_Helper_Captcha::getInstance()->renderFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('translate')), 'msgNewTranslationSubmit' => $PMF_LANG['msgNewTranslationSubmit'], 'tinyMCELanguage' => PMF_Language::isASupportedTinyMCELanguage($LANGCODE) ? $LANGCODE : 'en'));
$tpl->includeTemplate('writeContent', 'index');
Example #12
0
        $htmlAllCategories .= sprintf("<li>%s</li>\n", $path);
    }
    $htmlAllCategories .= '            </ul>';
    $htmlAllCategories .= '    </div>';
}
// Related FAQs
$faqSearchResult->reviewResultset($faqRelation->getAllRelatedById($faq->faqRecord['id'], $faq->faqRecord['title'], $faq->faqRecord['keywords']));
$relatedFaqs = PMF_Helper_Search::getInstance()->renderRelatedFaqs($faqSearchResult, $faq->faqRecord['id']);
// Show link to edit the faq?
$editThisEntry = '';
if (isset($permission['editbt']) && $permission['editbt']) {
    $editThisEntry = sprintf('<a href="%sadmin/index.php?action=editentry&amp;id=%d&amp;lang=%s">%s</a>', PMF_Link::getSystemRelativeUri('index.php'), $faq->faqRecord['id'], $lang, $PMF_LANG['ad_entry_edit_1'] . ' ' . $PMF_LANG['ad_entry_edit_2']);
}
// Is the faq expired?
$expired = date('YmdHis') > $faq->faqRecord['dateEnd'];
// Does the user have the right to add a comment?
if ($faq->faqRecord['active'] != 'yes' || 'n' == $faq->faqRecord['comment'] || $expired) {
    $commentMessage = $PMF_LANG['msgWriteNoComment'];
} else {
    $commentMessage = sprintf("%s<a href=\"javascript:void(0);\" onclick=\"javascript:\$('#commentForm').show();\">%s</a>", $PMF_LANG['msgYouCan'], $PMF_LANG['msgWriteComment']);
}
$translationUrl = sprintf(str_replace('%', '%%', PMF_Link::getSystemRelativeUri('index.php')) . 'index.php?%saction=translate&amp;cat=%s&amp;id=%d&amp;srclang=%s', $sids, $currentCategory, $faq->faqRecord['id'], $lang);
if (!empty($switchLanguage)) {
    $tpl->processBlock('writeContent', 'switchLanguage', array('msgChangeLanguage' => $PMF_LANG['msgLangaugeSubmit']));
}
if (isset($permission['addtranslation']) && $permission['addtranslation']) {
    $tpl->processBlock('writeContent', 'addTranslation', array('msgTranslate' => $PMF_LANG['msgTranslate']));
}
// Set the template variables
$tpl->processTemplate('writeContent', array('writeRubrik' => $categoryName, 'solution_id' => $faq->faqRecord['solution_id'], 'writeThema' => $question, 'writeArticleCategoryHeader' => $PMF_LANG['msgArticleCategories'], 'writeArticleCategories' => $htmlAllCategories, 'writeContent' => $answer, 'writeTagHeader' => $PMF_LANG['msg_tags'] . ': ', 'writeArticleTags' => $faqTagging->getAllLinkTagsById($faq->faqRecord['id']), 'writeRelatedArticlesHeader' => $PMF_LANG['msg_related_articles'] . ': ', 'writeRelatedArticles' => $relatedFaqs, 'writeDateMsg' => $PMF_LANG['msgLastUpdateArticle'] . PMF_Date::format($faq->faqRecord['date']), 'writeRevision' => $PMF_LANG['ad_entry_revision'] . ': 1.' . $faq->faqRecord['revision_id'], 'writeAuthor' => $PMF_LANG['msgAuthor'] . ': ' . $faq->faqRecord['author'], 'editThisEntry' => $editThisEntry, 'translationUrl' => $translationUrl, 'languageSelection' => PMF_Language::selectLanguages($LANGCODE, false, $arrLanguage, 'translation'), 'msgTranslateSubmit' => $PMF_LANG['msgTranslateSubmit'], 'saveVotingPATH' => sprintf(str_replace('%', '%%', PMF_Link::getSystemRelativeUri('index.php')) . 'index.php?%saction=savevoting', $sids), 'saveVotingID' => $faq->faqRecord['id'], 'saveVotingIP' => $_SERVER['REMOTE_ADDR'], 'msgAverageVote' => $PMF_LANG['msgAverageVote'], 'printVotings' => $faqRating->getVotingResult($recordId), 'switchLanguage' => $switchLanguage, 'msgVoteUseability' => $PMF_LANG['msgVoteUseability'], 'msgVoteBad' => $PMF_LANG['msgVoteBad'], 'msgVoteGood' => $PMF_LANG['msgVoteGood'], 'msgVoteSubmit' => $PMF_LANG['msgVoteSubmit'], 'writeCommentMsg' => $commentMessage, 'msgWriteComment' => $PMF_LANG['msgWriteComment'], 'id' => $faq->faqRecord['id'], 'lang' => $lang, 'msgCommentHeader' => $PMF_LANG['msgCommentHeader'], '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') : '', 'msgYourComment' => $PMF_LANG['msgYourComment'], 'msgNewContentSubmit' => $PMF_LANG['msgNewContentSubmit'], 'captchaFieldset' => PMF_Helper_Captcha::getInstance()->renderCaptcha($captcha, 'writecomment', $PMF_LANG['msgCaptcha']), 'writeComments' => $faqComment->getComments($faq->faqRecord['id'], PMF_Comment::COMMENT_TYPE_FAQ), 'msg_about_faq' => $PMF_LANG['msg_about_faq']));
$tpl->includeTemplate('writeContent', 'index');
Example #13
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.
 *
 * @category  phpMyFAQ
 * @package   Frontend
 * @author    Thorsten Rinne <*****@*****.**>
 * @copyright 2002-2011 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-29
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($db, $Language);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$artlang = PMF_Filter::filterInput(INPUT_GET, 'artlang', FILTER_SANITIZE_STRIPPED);
$faqsession->userTracking('write_comment', $id);
$tpl->processTemplate('writeContent', array('msgCommentHeader' => $PMF_LANG['msgWriteComment'], 'writeSendAdress' => '?' . $sids . 'action=savecomment', 'ID' => $id, 'LANG' => $artlang, 'writeThema' => $faq->getRecordTitle($id), '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') : '', 'msgYourComment' => $PMF_LANG['msgYourComment'], 'msgNewContentSubmit' => $PMF_LANG['msgNewContentSubmit'], 'captchaFieldset' => PMF_Helper_Captcha::getInstance()->renderCaptcha($captcha, 'writecomment', $PMF_LANG['msgCaptcha'])));
$tpl->includeTemplate('writeContent', 'index');
Example #14
0
 *
 * 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-2011 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;
}
$captcha = new PMF_Captcha($db, $Language);
$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);
$helper = PMF_Helper_Category::getInstance();
$helper->setCategory($category);
$tpl->processTemplate('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' => $helper->renderCategoryOptions($categoryId), 'msgAskYourQuestion' => $PMF_LANG['msgAskYourQuestion'], 'captchaFieldset' => PMF_Helper_Captcha::getInstance()->renderCaptcha($captcha, 'ask', $PMF_LANG['msgCaptcha']), 'msgNewContentSubmit' => $PMF_LANG['msgNewContentSubmit']));
$tpl->includeTemplate('writeContent', 'index');
Example #15
0
 * @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-09-16
 */
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;
}
try {
    $faqsession->userTracking('send2friend', 0);
} catch (PMF_Exception $e) {
    // @todo handle the exception
}
$cat = PMF_Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT);
$id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$artlang = PMF_Filter::filterInput(INPUT_GET, 'artlang', FILTER_SANITIZE_STRIPPED);
$send2friendLink = sprintf('%s/index.php?action=artikel&amp;cat=%d&amp;id=%d&amp;artlang=%s', $faqConfig->get('main.referenceURL'), (int) $cat, (int) $id, urlencode($artlang));
$captchaHelper = new PMF_Helper_Captcha($faqConfig);
$tpl->parse('writeContent', array('lang' => $artlang, 'msgSend2Friend' => $PMF_LANG['msgSend2Friend'], 'msgS2FReferrer' => 'link', 'msgS2FName' => $PMF_LANG['msgS2FName'], 'msgS2FEMail' => $PMF_LANG['msgS2FEMail'], 'defaultContentMail' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('email') : '', 'defaultContentName' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('display_name') : '', 'msgS2FFriends' => $PMF_LANG['msgS2FFriends'], 'msgS2FEMails' => $PMF_LANG['msgS2FEMails'], 'msgS2FText' => $PMF_LANG['msgS2FText'], 'send2friend_text' => $faqConfig->get('main.send2friendText'), 'msgS2FText2' => $PMF_LANG['msgS2FText2'], 'send2friendLink' => $send2friendLink, 'msgS2FMessage' => $PMF_LANG['msgS2FMessage'], 'captchaFieldset' => $captchaHelper->renderCaptcha($captcha, 'send2friend', $PMF_LANG['msgCaptcha'], $auth), 'msgS2FButton' => $PMF_LANG['msgS2FButton']));
$tpl->merge('writeContent', 'index');
Example #16
0
 * 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-16
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$faqsession->userTracking('send2friend', 0);
$cat = PMF_Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT);
$id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$artlang = PMF_Filter::filterInput(INPUT_GET, 'artlang', FILTER_SANITIZE_STRIPPED);
$send2friendLink = sprintf('%s/index.php?action=artikel&amp;cat=%d&amp;id=%d&amp;artlang=%s', $faqconfig->get('main.referenceURL'), (int) $cat, (int) $id, urlencode($artlang));
$tpl->processTemplate('writeContent', array('msgSend2Friend' => $PMF_LANG['msgSend2Friend'], 'writeSendAdress' => '?' . $sids . 'action=mailsend2friend', 'msgS2FReferrer' => 'link', 'msgS2FName' => $PMF_LANG['msgS2FName'], 'msgS2FEMail' => $PMF_LANG['msgS2FEMail'], 'defaultContentMail' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('email') : '', 'defaultContentName' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('display_name') : '', 'msgS2FFriends' => $PMF_LANG['msgS2FFriends'], 'msgS2FEMails' => $PMF_LANG['msgS2FEMails'], 'msgS2FText' => $PMF_LANG['msgS2FText'], 'send2friend_text' => $faqconfig->get('main.send2friendText'), 'msgS2FText2' => $PMF_LANG['msgS2FText2'], 'send2friendLink' => $send2friendLink, 'msgS2FMessage' => $PMF_LANG['msgS2FMessage'], 'captchaFieldset' => PMF_Helper_Captcha::getInstance()->renderFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('send2friend')), 'msgS2FButton' => $PMF_LANG['msgS2FButton']));
$tpl->includeTemplate('writeContent', 'index');
Example #17
0
            $messages[] = $user->error();
        } else {
            // set user data (realname, email)
            $user->userdata->set(array('display_name', 'email'), array($user_realname, $user_email));
            // set user status
            $user->setStatus($defaultUserStatus);
            $text = sprintf("New user has been registrated:\n\nUsername: %s\nLoginname: %s\n\n" . "To activate this user do please use the administration interface.", $lastname, $loginname);
            $mail = new PMF_Mail();
            $mail->unsetFrom();
            $mail->setFrom($user_email);
            $mail->addTo($faqconfig->get('main.administrationMail'));
            $mail->subject = PMF_Utils::resolveMarkers($PMF_LANG['emailRegSubject']);
            $mail->message = $text;
            $result = $mail->send();
            unset($mail);
            header("Location: index.php?action=thankyou");
            exit;
        }
    }
    // no errors, show list
    if (count($messages) == 0) {
        $userAction = $defaultUserAction;
        // display error messages and show form again
    } else {
        $tpl->processTemplate('writeContent', array('regErrors' => sprintf("<strong>%s</strong> <br /> - %s <br /><br />", $PMF_LANG['msgRegError'], implode("<br />- ", $messages)), 'msgUserData' => $PMF_LANG['msgUserData'], 'login_errorRegistration' => !is_null($loginname) ? $PMF_LANG['errorRegistration'] : '', 'name_errorRegistration' => !is_null($lastname) ? $PMF_LANG['errorRegistration'] : '', 'email_errorRegistration' => !is_null($email) ? $PMF_LANG['errorRegistration'] : '', 'loginname' => $PMF_LANG["ad_user_loginname"], 'lastname' => $PMF_LANG["ad_user_realname"], 'email' => $PMF_LANG["ad_entry_email"], 'loginname_value' => $loginname, 'lastname_value' => $lastname, 'email_value' => $email, 'submitRegister' => $PMF_LANG['submitRegister'], 'captchaFieldset' => PMF_Helper_Captcha::getInstance()->renderFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('add'), isset($captchaError) ? $captchaError : '')));
        $tpl->includeTemplate('writeContent', 'index');
    }
} else {
    $tpl->processTemplate('writeContent', array('regErrors' => '', 'msgUserData' => $PMF_LANG['msgUserData'], 'login_errorRegistration' => '', 'name_errorRegistration' => '', 'email_errorRegistration' => '', 'loginname' => $PMF_LANG["ad_user_loginname"], 'lastname' => $PMF_LANG["ad_user_realname"], 'email' => $PMF_LANG["ad_entry_email"], 'loginname_value' => $loginname, 'lastname_value' => $lastname, 'email_value' => $email, 'submitRegister' => $PMF_LANG['submitRegister'], 'captchaFieldset' => PMF_Helper_Captcha::getInstance()->renderFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('add'), isset($captchaError) ? $captchaError : '')));
    $tpl->includeTemplate('writeContent', 'index');
}
Example #18
0
// 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) {
    $commentMessage = $PMF_LANG['msgWriteNoComment'];
} else {
    $oLink = new PMF_Link($_SERVER['SCRIPT_NAME'] . '?' . str_replace('&', '&amp;', $_SERVER['QUERY_STRING']));
    $oLink->itemTitle = $header;
    $commentHref = $oLink->toString() . '#comment';
    $commentMessage = sprintf('<a onclick="javascript:$(\'#comment\').show();" href="%s">%s</a>', $commentHref, $PMF_LANG['newsWriteComment']);
}
// Set the template variables
$tpl->processTemplate("writeContent", array('writeNewsHeader' => $writeNewsHeader, 'writeNewsRSS' => $writeNewsRSS, 'writeHeader' => $header, 'writeContent' => $content, 'writeDateMsg' => $news['active'] && !$expired ? $PMF_LANG['msgLastUpdateArticle'] . '<span id="newsLastUpd">' . $news['date'] . '</span>' : '', 'writeAuthor' => $news['active'] && !$expired ? $PMF_LANG['msgAuthor'] . ': ' . $news['authorName'] : '', 'editThisEntry' => $editThisEntry, 'writeCommentMsg' => $commentMessage, 'msgWriteComment' => $PMF_LANG['newsWriteComment'], 'writeSendAdress' => '?' . $sids . 'action=savecomment', 'newsId' => $news_id, 'newsLang' => $news['lang'], 'msgCommentHeader' => $PMF_LANG['msgCommentHeader'], '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') : '', 'msgYourComment' => $PMF_LANG['msgYourComment'], 'msgNewContentSubmit' => $PMF_LANG['msgNewContentSubmit'], 'captchaFieldset' => PMF_Helper_Captcha::getInstance()->renderFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('writecomment')), 'writeComments' => $comment->getComments($news_id, PMF_Comment::COMMENT_TYPE_NEWS)));
$tpl->includeTemplate('writeContent', 'index');
Example #19
0
 * 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-16
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$faqsession->userTracking('contact', 0);
$captcha = new PMF_Captcha($db, $Language);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$tpl->processTemplate('writeContent', array('msgContact' => $PMF_LANG['msgContact'], 'msgContactOwnText' => nl2br($faqconfig->get('main.contactInformations')), 'msgContactEMail' => $PMF_LANG['msgContactEMail'], 'writeSendAdress' => '?' . $sids . 'action=sendmail', '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') : '', 'msgMessage' => $PMF_LANG['msgMessage'], 'msgS2FButton' => $PMF_LANG['msgS2FButton'], 'version' => $faqconfig->get('main.currentVersion'), 'captchaFieldset' => PMF_Helper_Captcha::getInstance()->renderFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('contact'))));
$tpl->includeTemplate('writeContent', 'index');
Example #20
0
 * 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;
}
$captcha = new PMF_Captcha($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$faqsession->userTracking('ask_question', 0);
$categoryLayout = new PMF_Category_Layout(new PMF_Category_Tree_Helper(new PMF_Category_Tree($categoryData)));
$tpl->processTemplate('writeContent', array('msgQuestion' => $PMF_LANG['msgQuestion'], 'msgNewQuestion' => $PMF_LANG['msgNewQuestion'], 'writeSendAdress' => '?' . $sids . 'action=savequestion', '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' => $categoryLayout->renderOptions(), 'msgAskYourQuestion' => $PMF_LANG['msgAskYourQuestion'], 'captchaFieldset' => PMF_Helper_Captcha::getInstance()->renderFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('ask')), 'msgNewContentSubmit' => $PMF_LANG['msgNewContentSubmit']));
$tpl->includeTemplate('writeContent', 'index');
Example #21
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.
 *
 * @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-08-29
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($db, $Language);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$artlang = PMF_Filter::filterInput(INPUT_GET, 'artlang', FILTER_SANITIZE_STRIPPED);
$faqsession->userTracking('write_comment', $id);
$tpl->processTemplate('writeContent', array('msgCommentHeader' => $PMF_LANG['msgWriteComment'], 'writeSendAdress' => '?' . $sids . 'action=savecomment', 'ID' => $id, 'LANG' => $artlang, 'writeThema' => $faq->getRecordTitle($id), 'msgNewContentName' => $PMF_LANG['msgNewContentName'], 'msgNewContentMail' => $PMF_LANG['msgNewContentMail'], 'defaultContentMail' => getEmailAddress(), 'defaultContentName' => getFullUserName(), 'msgYourComment' => $PMF_LANG['msgYourComment'], 'msgNewContentSubmit' => $PMF_LANG['msgNewContentSubmit'], 'captchaFieldset' => PMF_Helper_Captcha::getInstance()->renderFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('writecomment'))));
$tpl->includeTemplate('writeContent', 'index');
Example #22
0
if ($user->perm->checkRight($user->getUserId(), 'editbt')) {
    $editThisEntry = sprintf('<a href="%sadmin/index.php?action=editentry&amp;id=%d&amp;lang=%s">%s</a>', PMF_Link::getSystemRelativeUri('index.php'), $recordId, $lang, $PMF_LANG['ad_entry_edit_1'] . ' ' . $PMF_LANG['ad_entry_edit_2']);
}
// Is the faq expired?
$expired = date('YmdHis') > $faq->faqRecord['dateEnd'];
// Does the user have the right to add a comment?
if (-1 === $user->getUserId() && !$faqConfig->get('records.allowCommentsForGuests') || $faq->faqRecord['active'] === 'no' || 'n' == $faq->faqRecord['comment'] || $expired) {
    $commentMessage = $PMF_LANG['msgWriteNoComment'];
} else {
    $commentMessage = sprintf("%s<a href=\"javascript:void(0);\" onclick=\"javascript:\$('#commentForm').show();\">%s</a>", $PMF_LANG['msgYouCan'], $PMF_LANG['msgWriteComment']);
}
$translationUrl = sprintf(str_replace('%', '%%', PMF_Link::getSystemRelativeUri('index.php')) . 'index.php?%saction=translate&amp;cat=%s&amp;id=%d&amp;srclang=%s', $sids, $currentCategory, $recordId, $lang);
if (!empty($switchLanguage)) {
    $tpl->parseBlock('writeContent', 'switchLanguage', array('msgChangeLanguage' => $PMF_LANG['msgLangaugeSubmit']));
}
if ($user->perm->checkRight($user->getUserId(), 'addtranslation')) {
    $tpl->parseBlock('writeContent', 'addTranslation', array('msgTranslate' => $PMF_LANG['msgTranslate']));
}
if ('-' !== $faqTagging->getAllLinkTagsById($recordId)) {
    $tpl->parseBlock('writeContent', 'tagsAvailable', array('renderTags' => $PMF_LANG['msg_tags'] . ': ' . $faqTagging->getAllLinkTagsById($recordId)));
}
if ('' !== $htmlAllCategories) {
    $tpl->parseBlock('writeContent', 'relatedCategories', array('renderRelatedCategoriesHeader' => $PMF_LANG['msgArticleCategories'], 'renderRelatedCategories' => $htmlAllCategories));
}
if ('' !== $relatedFaqs) {
    $tpl->parseBlock('writeContent', 'relatedFaqs', array('renderRelatedArticlesHeader' => $PMF_LANG['msg_related_articles'], 'renderRelatedArticles' => $relatedFaqs));
}
$date = new PMF_Date($faqConfig);
$captchaHelper = new PMF_Helper_Captcha($faqConfig);
$tpl->parse('writeContent', array('baseHref' => $faqSystem->getSystemUri($faqConfig), 'writeRubrik' => $categoryName, 'solution_id' => $faq->faqRecord['solution_id'], 'solution_id_link' => PMF_Link::getSystemRelativeUri() . '?solution_id=' . $faq->faqRecord['solution_id'], 'writeThema' => $question, 'writeContent' => $answer, 'writeDateMsg' => '<dt>' . $PMF_LANG['msgLastUpdateArticle'] . '</dt><dd>' . $date->format($faq->faqRecord['date']) . '</dd>', 'writeRevision' => '<dt>' . $PMF_LANG['ad_entry_revision'] . ':</dt><dd>1.' . $faq->faqRecord['revision_id'] . '</dd>', 'writeAuthor' => '<dt>' . $PMF_LANG['msgAuthor'] . ':</dt><dd>' . $faq->faqRecord['author'] . '</dd>', 'editThisEntry' => $editThisEntry, 'translationUrl' => $translationUrl, 'languageSelection' => PMF_Language::selectLanguages($LANGCODE, false, $arrLanguage, 'translation'), 'msgTranslateSubmit' => $PMF_LANG['msgTranslateSubmit'], 'saveVotingPATH' => sprintf(str_replace('%', '%%', PMF_Link::getSystemRelativeUri('index.php')) . 'index.php?%saction=savevoting', $sids), 'saveVotingID' => $recordId, 'saveVotingIP' => $_SERVER['REMOTE_ADDR'], 'msgAverageVote' => $PMF_LANG['msgAverageVote'], 'renderVotingStars' => '', 'printVotings' => $faqRating->getVotingResult($recordId), 'switchLanguage' => $switchLanguage, 'msgVoteUseability' => $PMF_LANG['msgVoteUseability'], 'msgVoteBad' => $PMF_LANG['msgVoteBad'], 'msgVoteGood' => $PMF_LANG['msgVoteGood'], 'msgVoteSubmit' => $PMF_LANG['msgVoteSubmit'], 'writeCommentMsg' => $commentMessage, 'msgWriteComment' => $PMF_LANG['msgWriteComment'], 'id' => $recordId, 'lang' => $lang, 'msgCommentHeader' => $PMF_LANG['msgCommentHeader'], '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') : '', 'msgYourComment' => $PMF_LANG['msgYourComment'], 'msgNewContentSubmit' => $PMF_LANG['msgNewContentSubmit'], 'captchaFieldset' => $captchaHelper->renderCaptcha($captcha, 'writecomment', $PMF_LANG['msgCaptcha'], $auth), 'writeComments' => $faqComment->getComments($recordId, PMF_Comment::COMMENT_TYPE_FAQ), 'msg_about_faq' => $PMF_LANG['msg_about_faq']));
$tpl->merge('writeContent', 'index');