예제 #1
0
    }
    if ($maxVisits < $_r['visits']) {
        $maxVisits = $_r['visits'];
    }
    if ($faq->faqRecord['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, $faq->faqRecord['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));
}
$faqHelper = PMF_Helper_Faq::getInstance();
// Set the template variables
$tpl->processTemplate("writeContent", array('writeRubrik' => $categoryName . '<br />', 'solution_id' => $faq->faqRecord['solution_id'], 'facebookeLikeButton' => $faqHelper->renderFacebookLikeButton($facebookUrl), 'writeThema' => $thema, 'writeArticleCategoryHeader' => $PMF_LANG['msgArticleCategories'], 'writeArticleCategories' => $writeMultiCategories, 'writeContent' => $content, 'writeTagHeader' => $PMF_LANG['msg_tags'] . ': ', 'writeArticleTags' => $tagging->getAllLinkTagsById($faq->faqRecord['id']), 'writeRelatedArticlesHeader' => $PMF_LANG['msg_related_articles'] . ': ', 'writeRelatedArticles' => $relevant->getAllRelatedById($faq->faqRecord['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, $faq->faqRecord['id'], $lang), 'link_pdf' => sprintf(str_replace('%', '%%', PMF_Link::getSystemRelativeUri('index.php')) . 'pdf.php?cat=%d&amp;id=%d&amp;artlang=%s', $currentCategory, $faq->faqRecord['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' => $faq->faqRecord['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' => $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()->renderFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('writecomment')), 'writeComments' => $comment->getComments($faq->faqRecord['id'], PMF_Comment::COMMENT_TYPE_FAQ)));
$tpl->includeTemplate('writeContent', 'index');