Example #1
0
            echo str_replace("\"", "ยด", $record['title']);
            ?>
'">
                    <?php 
            echo $record['title'];
            ?>
                </a>
<?php 
            if (isset($numCommentsByFaq[$record['id']])) {
                printf('<br/><a class="label label-inverse" href="?action=comments#record_id_%d">%d %s</a>', $record['id'], $numCommentsByFaq[$record['id']], $PMF_LANG['ad_start_comments']);
            }
            ?>
</td>
            <td style="width: 48px;">
                <?php 
            echo $date->format($record['date']);
            ?>
            </td>
            <td style="width: 96px;">
                <?php 
            echo $linkverifier->getEntryStateHTML($record['id'], $record['lang']);
            ?>
            </td>
            <td style="width: 16px;">
                <a class="btn btn-info" href="?action=copyentry&amp;id=<?php 
            echo $record['id'];
            ?>
&amp;lang=<?php 
            echo $record['lang'];
            ?>
"
Example #2
0
    print $PMF_LANG['ad_sess_session'];
    ?>
</th>
            </tr>
        </thead>
        <tbody>
<?php 
    foreach ($sessiondata as $sid => $data) {
        ?>
            <tr>
                <td><?php 
        print $data['ip'];
        ?>
</td>
                <td><?php 
        print PMF_Date::format(date("Y-m-d H:i", $data['time']));
        ?>
</td>
                <td><a href="?action=viewsession&amp;id=<?php 
        print $sid;
        ?>
"><?php 
        print $sid;
        ?>
</a></td>
            </tr>
<?php 
    }
    ?>
        </tbody>
        </table>
                <tbody>
<?php 
        foreach ($openquestions as $question) {
            ?>
                    <tr>
                        <td>
                            <input id="questions[]"
                                   name="questions[]"
                                   value="<?php 
            echo $question['id'];
            ?>
" type="checkbox" />
                        </td>
                        <td>
                            <?php 
            echo $date->format(PMF_Date::createIsoDate($question['created']));
            ?>
                            <br>
                            <a href="mailto:<?php 
            echo $question['email'];
            ?>
">
                                <?php 
            echo $question['username'];
            ?>
                            </a>
                        </td>
                        <td>
                            <strong><?php 
            echo $category->categoryName[$question['category_id']]['name'];
            ?>
Example #4
0
            continue;
        }
        $counter++;
        if ($counter <= $start) {
            continue;
        }
        $displayedCounter++;
        $user->getUserById($logging_value['usr']);
        ?>
        <tr class="cell">
            <td class="list"><?php 
        print $logging_id;
        ?>
</td>
            <td class="list"><?php 
        print PMF_Date::format(date('Y-m-d H:i', $logging_value['time']));
        ?>
</td>
            <td class="list"><?php 
        print $user->getLogin();
        ?>
</td>
            <td class="list"><?php 
        print $logging_value['ip'];
        ?>
</td>
        </tr>
        <tr class="cell">
            <td colspan="4" class="list"><?php 
        $text = $logging_value['text'];
        $text = str_replace("Loginerror", $PMF_LANG["ad_log_lger"], $text);
Example #5
0
 /**
  * Function for generating the HTML5 code for the current news
  *
  * @param boolean $showArchive Show archived news
  * @param boolean $active      Show active news
  *
  * @return string
  */
 public function getNews($showArchive = false, $active = true)
 {
     $output = '';
     $news = $this->getLatestData($showArchive, $active);
     $date = new PMF_Date($this->_config);
     foreach ($news as $item) {
         $url = sprintf('%s?action=news&amp;newsid=%d&amp;newslang=%s', PMF_Link::getSystemRelativeUri(), $item['id'], $item['lang']);
         $oLink = new PMF_Link($url, $this->_config);
         if (isset($item['header'])) {
             $oLink->itemTitle = $item['header'];
         }
         $output .= sprintf('<header><h3><a name="news_%d" href="%s">%s <img class="goNews" src="assets/img/more.gif" width="11" height="11" alt="%s" /></a></h3></header>', $item['id'], $oLink->toString(), $item['header'], $item['header']);
         $output .= sprintf('%s', $item['content']);
         if (strlen($item['link']) > 1) {
             $output .= sprintf('<br />%s <a href="%s" target="_%s">%s</a>', $this->pmf_lang['msgInfo'], $item['link'], $item['target'], $item['linkTitle']);
         }
         $output .= sprintf('
             <div class="date">%s</div>', $date->format(PMF_Date::createIsoDate($item['date'])));
     }
     return '' == $output ? $this->pmf_lang['msgNoNews'] : $output;
 }
    echo $PMF_LANG['ad_sess_session'];
    ?>
</th>
            </tr>
        </thead>
        <tbody>
<?php 
    foreach ($sessiondata as $sid => $data) {
        ?>
            <tr>
                <td><?php 
        echo $data['ip'];
        ?>
</td>
                <td><?php 
        echo $date->format(date("Y-m-d H:i", $data['time']));
        ?>
</td>
                <td><a href="?action=viewsession&amp;id=<?php 
        echo $sid;
        ?>
"><?php 
        echo $sid;
        ?>
</a></td>
            </tr>
<?php 
    }
    ?>
        </tbody>
        </table>
Example #7
0
            print $faqcomment['record_id'];
            ?>
" type="checkbox" />
            </td>
            <td>
                <span style="font-weight: bold;">
                    <a href="mailto:<?php 
            print $faqcomment['email'];
            ?>
">
                        <?php 
            print $faqcomment['username'];
            ?>
                    </a> |
                    <?php 
            print PMF_Date::format(date('Y-m-d H:i', $faqcomment['date']));
            ?>
 |
                    <a href="<?php 
            printf("../?action=artikel&cat=%d&id=%d&artlang=%s", $faqcomment['category_id'], $faqcomment['record_id'], $LANGCODE);
            ?>
">
                        <?php 
            print $faq->getRecordTitle($faqcomment['record_id']);
            ?>
                    </a>
                </span><br/>
                <?php 
            print PMF_String::htmlspecialchars($faqcomment['content']);
            ?>
            </td>
Example #8
0
            print str_replace("\"", "ยด", $record['title']);
            ?>
'">
                    <?php 
            print $record['title'];
            ?>
                </a>
<?php 
            if (isset($numCommentsByFaq[$record['id']])) {
                printf('<br/>(<a href="?action=comments#record_id_%d">%d %s</a>)', $record['id'], $numCommentsByFaq[$record['id']], $PMF_LANG['ad_start_comments']);
            }
            ?>
</td>
            <td style="width: 48px;">
                <?php 
            print PMF_Date::format($record['date']);
            ?>
            </td>
            <td style="width: 96px;">
                <?php 
            print $linkverifier->getEntryStateHTML($record['id'], $record['lang']);
            ?>
            </td>
            <td style="width: 16px;">
                <a href="javascript:void(0);"
                   onclick="javascript:deleteRecord(<?php 
            print $record['id'];
            ?>
, '<?php 
            print $record['lang'];
            ?>
            print $faqcomment['record_id'];
            ?>
" type="checkbox" />
            </td>
            <td>
                <span style="font-weight: bold;">
                    <a href="mailto:<?php 
            print $faqcomment['email'];
            ?>
">
                        <?php 
            print $faqcomment['username'];
            ?>
                    </a> |
                    <?php 
            print $date->format(date('Y-m-d H:i', $faqcomment['date']));
            ?>
 |
                    <a href="<?php 
            printf("../?action=artikel&cat=%d&id=%d&artlang=%s", $faqcomment['category_id'], $faqcomment['record_id'], $LANGCODE);
            ?>
">
                        <?php 
            print $faq->getRecordTitle($faqcomment['record_id']);
            ?>
                    </a>
                </span><br/>
                <?php 
            print PMF_String::htmlspecialchars($faqcomment['content']);
            ?>
            </td>
    echo $danz != 0 ? round($vanz / $danz, 2) : 0;
    ?>
</td>
            </tr>
            <tr>
                <td><?php 
    echo $PMF_LANG["ad_stat_fien"];
    ?>
:</td>
                <td>
<?php 
    if (is_file(PMF_ROOT_DIR . "/data/tracking" . date("dmY", $first))) {
        $fp = @fopen(PMF_ROOT_DIR . "/data/tracking" . date("dmY", $first), "r");
        list($dummy, $dummy, $dummy, $dummy, $dummy, $dummy, $dummy, $qstamp) = fgetcsv($fp, 1024, ";");
        fclose($fp);
        echo $date->format(date('Y-m-d H:i', $qstamp));
    } else {
        echo $PMF_LANG["ad_sess_noentry"];
    }
    ?>
                </td>
            </tr>
            <tr>
                <td><?php 
    echo $PMF_LANG["ad_stat_laen"];
    ?>
:</td>
                <td>
<?php 
    if (is_file(PMF_ROOT_DIR . "/data/tracking" . date("dmY", $last))) {
        $fp = fopen(PMF_ROOT_DIR . "/data/tracking" . date("dmY", $last), "r");
Example #11
0
 /**
  * Prints the open questions as a XHTML table
  *
  * @return  string
  * @access  public
  * @since   2002-09-17
  * @author  Thorsten Rinne <*****@*****.**>
  */
 function printOpenQuestions()
 {
     global $sids, $category;
     $query = sprintf("\n            SELECT\n                COUNT(*) AS num\n            FROM\n                %sfaqquestions\n            WHERE\n                is_visible != 'Y'", SQLPREFIX);
     $result = $this->db->query($query);
     $row = $this->db->fetch_object($result);
     $numOfInvisibles = $row->num;
     if ($numOfInvisibles > 0) {
         $extraout = sprintf('<tr><td colspan="3"><hr />%s%s</td></tr>', $this->pmf_lang['msgQuestionsWaiting'], $numOfInvisibles);
     } else {
         $extraout = '';
     }
     $query = sprintf("\n            SELECT\n                *\n            FROM\n                %sfaqquestions\n            WHERE\n                is_visible = 'Y'\n            ORDER BY\n                created ASC", SQLPREFIX);
     $result = $this->db->query($query);
     $output = '';
     if ($result && $this->db->num_rows($result) > 0) {
         while ($row = $this->db->fetch_object($result)) {
             $output .= '<tr class="openquestions">';
             $output .= sprintf('<td valign="top" nowrap="nowrap">%s<br /><a href="mailto:%s">%s</a></td>', PMF_Date::format(PMF_Date::createIsoDate($row->created)), PMF_Mail::safeEmail($row->email), $row->username);
             $output .= sprintf('<td valign="top"><strong>%s:</strong><br />%s</td>', isset($category->categoryName[$row->category_id]['name']) ? $category->categoryName[$row->category_id]['name'] : '', strip_tags($row->question));
             $output .= sprintf('<td valign="top"><a href="?%saction=add&amp;question=%d&amp;cat=%d">%s</a></td>', $sids, $row->id, $row->category_id, $this->pmf_lang['msg2answer']);
             $output .= '</tr>';
         }
     } else {
         $output = sprintf('<tr><td colspan="3">%s</td></tr>', $this->pmf_lang['msgNoQuestionsAvailable']);
     }
     return $output . $extraout;
 }
Example #12
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');
            print str_replace("\"", "ยด", $record['title']);
            ?>
'">
                    <?php 
            print $record['title'];
            ?>
                </a>
<?php 
            if (isset($numCommentsByFaq[$record['id']])) {
                printf('<br/><a class="label label-inverse" href="?action=comments#record_id_%d">%d %s</a>', $record['id'], $numCommentsByFaq[$record['id']], $PMF_LANG['ad_start_comments']);
            }
            ?>
</td>
            <td style="width: 48px;">
                <?php 
            print $date->format($record['date']);
            ?>
            </td>
            <td style="width: 96px;">
                <?php 
            print $linkverifier->getEntryStateHTML($record['id'], $record['lang']);
            ?>
            </td>
            <td style="width: 16px;">
                <a class="btn btn-info" href="?action=copyentry&amp;id=<?php 
            print $record['id'];
            ?>
&amp;lang=<?php 
            print $record['lang'];
            ?>
"
Example #14
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');
Example #15
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');
        $allGroups = true;
        $restrictedGroups = false;
        $groupPermission[0] = -1;
    } else {
        $allGroups = false;
        $restrictedGroups = true;
    }
    // Set data for forms
    $faqData['title'] = isset($faqData['title']) ? PMF_String::htmlspecialchars($faqData['title']) : '';
    $faqData['content'] = isset($faqData['content']) ? trim(PMF_String::htmlentities($faqData['content'])) : '';
    $faqData['tags'] = isset($faqData['tags']) ? PMF_String::htmlspecialchars($faqData['tags']) : '';
    $faqData['keywords'] = isset($faqData['keywords']) ? PMF_String::htmlspecialchars($faqData['keywords']) : '';
    $faqData['author'] = isset($faqData['author']) ? PMF_String::htmlspecialchars($faqData['author']) : $user->getUserData('display_name');
    $faqData['email'] = isset($faqData['email']) ? PMF_String::htmlspecialchars($faqData['email']) : $user->getUserData('email');
    $faqData['isoDate'] = isset($faqData['date']) ? $faqData['date'] : date('Y-m-d H:i');
    $faqData['date'] = isset($faqData['date']) ? $date->format($faqData['date']) : $date->format(date('Y-m-d H:i'));
    $faqData['changed'] = isset($faqData['changed']) ? $faqData['changed'] : '';
    if (isset($faqData['comment']) && $faqData['comment'] == 'y') {
        $faqData['comment'] = ' checked="checked"';
    } elseif ($faqConfig->get('records.defaultAllowComments')) {
        $faqData['comment'] = ' checked="checked"';
    } else {
        $faqData['comment'] = '';
    }
    // Start header
    ?>
        <header>
            <h2>
<?php 
    if (0 !== $faqData['id'] && 'copyentry' !== $action) {
        $currentRevision = sprintf(' <span class="badge badge-important">%s 1.%d</span> ', $PMF_LANG['ad_entry_revision'], $selectedRevisionId);
 /**
  * Prints the open questions as a XHTML table
  *
  * @return  string
  * @access  public
  * @since   2002-09-17
  * @author  Thorsten Rinne <*****@*****.**>
  */
 function printOpenQuestions()
 {
     global $sids, $category;
     $date = new PMF_Date($this->_config);
     $mail = new PMF_Mail($this->_config);
     $query = sprintf("\n            SELECT\n                COUNT(id) AS num\n            FROM\n                %sfaqquestions\n            WHERE\n                is_visible != 'Y'", PMF_Db::getTablePrefix());
     $result = $this->_config->getDb()->query($query);
     $row = $this->_config->getDb()->fetchObject($result);
     $numOfInvisibles = $row->num;
     if ($numOfInvisibles > 0) {
         $extraout = sprintf('<tr><td colspan="3"><small>%s %s</small></td></tr>', $this->pmf_lang['msgQuestionsWaiting'], $numOfInvisibles);
     } else {
         $extraout = '';
     }
     $query = sprintf("\n            SELECT\n                *\n            FROM\n                %sfaqquestions\n            WHERE\n                is_visible = 'Y'\n            ORDER BY\n                created ASC", PMF_Db::getTablePrefix());
     $result = $this->_config->getDb()->query($query);
     $output = '';
     if ($result && $this->_config->getDb()->numRows($result) > 0) {
         while ($row = $this->_config->getDb()->fetchObject($result)) {
             $output .= '<tr class="openquestions">';
             $output .= sprintf('<td><small>%s</small><br /><a href="mailto:%s">%s</a></td>', $date->format(PMF_Date::createIsoDate($row->created)), $mail->safeEmail($row->email), $row->username);
             $output .= sprintf('<td><strong>%s:</strong><br />%s</td>', isset($category->categoryName[$row->category_id]['name']) ? $category->categoryName[$row->category_id]['name'] : '', strip_tags($row->question));
             if ($this->_config->get('records.enableCloseQuestion') && $row->answer_id) {
                 $output .= sprintf('<td><a id="PMF_openQuestionAnswered" href="?%saction=artikel&amp;cat=%d&amp;id=%d">%s</a></td>', $sids, $row->category_id, $row->answer_id, $this->pmf_lang['msg2answerFAQ']);
             } else {
                 $output .= sprintf('<td><a class="btn btn-primary" href="?%saction=add&amp;question=%d&amp;cat=%d">%s</a></td>', $sids, $row->id, $row->category_id, $this->pmf_lang['msg2answer']);
             }
             $output .= '</tr>';
         }
     } else {
         $output = sprintf('<tr><td colspan="3">%s</td></tr>', $this->pmf_lang['msgNoQuestionsAvailable']);
     }
     return $output . $extraout;
 }
Example #18
0
                        <?php 
        print $PMF_LANG['ad_entry_changelog_history'];
        ?>
                    </a>
                </legend>
                
                <div id="editChangelogHistory" style="display: none;">
<?php 
        $changeEntries = $faq->getChangeEntries($faqData['id']);
        foreach ($changeEntries as $entry) {
            $user->getUserById($entry['user']);
            ?>
                    <p style="font-size: 10px;">
                        <label>
                            <?php 
            printf('%s  1.%d<br/>%s<br/>%s: %s', $PMF_LANG['ad_entry_revision'], $entry['revision_id'], PMF_Date::format(date('Y-m-d H:i', $entry['date'])), $PMF_LANG['ad_entry_author'], $user->getUserData('display_name'));
            ?>
                        </label>
                        <?php 
            print $entry['changelog'];
            ?>
                    </p>
<?php 
        }
        ?>
                </div>
            </fieldset>
    
    </form>
    
    <script type="text/javascript">
Example #19
0
 /**
  * The footer of the PDF file
  *
  * @return void
  */
 public function Footer()
 {
     global $PMF_LANG;
     $faqconfig = PMF_Configuration::getInstance();
     $footer = sprintf('(c) %d %s <%s> | %s', date('Y'), $faqconfig->get('main.metaPublisher'), $faqconfig->get('main.administrationMail'), PMF_Date::format(date('Y-m-d H:i')));
     $currentTextColor = $this->TextColor;
     $this->SetTextColor(0, 0, 0);
     $this->SetY(-25);
     $this->SetFont($this->currentFont, '', 10);
     $this->Cell(0, 10, $PMF_LANG['ad_gen_page'] . ' ' . $this->getAliasNumPage() . ' / ' . $this->getAliasNbPages(), 0, 0, 'C');
     $this->SetY(-20);
     $this->SetFont($this->currentFont, 'B', 8);
     $this->Cell(0, 10, $footer, 0, 1, "C");
     if ($this->enableBookmarks == false) {
         $this->SetY(-15);
         $this->SetFont($this->currentFont, '', 8);
         $baseUrl = 'index.php';
         if (is_array($this->faq) && !empty($this->faq)) {
             $baseUrl .= '?action=artikel&amp;';
             if (array_key_exists($this->category, $this->categories)) {
                 $baseUrl .= 'cat=' . $this->categories[$this->category]['id'];
             } else {
                 $baseUrl .= 'cat=0';
             }
             $baseUrl .= '&amp;id=' . $this->faq['id'];
             $baseUrl .= '&amp;artlang=' . $this->faq['lang'];
         }
         $url = PMF_Link::getSystemUri('pdf.php') . $baseUrl;
         $urlObj = new PMF_Link($url);
         $urlObj->itemTitle = $this->question;
         $_url = str_replace('&amp;', '&', $urlObj->toString());
         $this->Cell(0, 10, 'URL: ' . $_url, 0, 1, 'C', 0, $_url);
     }
     $this->TextColor = $currentTextColor;
 }
Example #20
0
 /**
  * Returns all user comments (HTML formatted) from a record by type
  *
  * @todo Move this code to a helper class
  *
  * @param integer $id   Comment ID
  * @param integer $type Comment type: {faq|news}
  *
  * @return string
  */
 public function getComments($id, $type)
 {
     $comments = $this->getCommentsData($id, $type);
     $output = '';
     foreach ($comments as $item) {
         $output .= '<p class="comment">';
         $output .= '<img src="images/bubbles.gif" />';
         $output .= sprintf('<strong>%s<a href="mailto:%s">%s</a>:</strong><br />%s<br />%s</p>', $this->pmf_lang['msgCommentBy'], PMF_Mail::safeEmail($item['email']), $item['user'], nl2br($item['content']), $this->pmf_lang['newsCommentDate'] . PMF_Date::format(PMF_Date::createIsoDate($item['date'], 'Y-m-d H:i', false)));
     }
     return $output;
 }
Example #21
0
 /**
  * Returns all user comments (HTML formatted) from a record by type
  *
  * @todo Move this code to a helper class
  *
  * @param integer $id   Comment ID
  * @param integer $type Comment type: {faq|news}
  *
  * @return string
  */
 public function getComments($id, $type)
 {
     $comments = $this->getCommentsData($id, $type);
     $date = new PMF_Date($this->config);
     $mail = new PMF_Mail($this->config);
     $output = '';
     foreach ($comments as $item) {
         $output .= '<p class="comment">';
         $output .= '<img class="commment-bubbles" src="assets/img/bubbles.gif" />';
         $output .= sprintf('<strong>%s<a href="mailto:%s">%s</a>:</strong><br />%s<br /><small>%s</small></p>', $this->pmfStr['msgCommentBy'], $mail->safeEmail($item['email']), $item['user'], $this->showShortComment($id, $item['content']), $this->pmfStr['newsCommentDate'] . $date->format(PMF_Date::createIsoDate($item['date'], 'Y-m-d H:i', false)));
     }
     return $output;
 }
Example #22
0
            </p>

            <p>
                <label><?php 
    print $PMF_LANG["ad_stat_browse"];
    ?>
:</label>
                <select name="day" size="1">
<?php 
    foreach ($trackingDates as $trackingDate) {
        printf('<option value="%d"', $trackingDate);
        if (date("Y-m-d", $trackingDate) == strftime('%Y-%m-%d', $_SERVER['REQUEST_TIME'])) {
            print ' selected="selected"';
        }
        print '>';
        print PMF_Date::format(date('Y-m-d H:i', $trackingDate));
        print "</option>\n";
    }
    ?>
                </select>
            </p>

            <p>
                <input class="submit" type="submit" name="statbrowse" value="<?php 
    print $PMF_LANG["ad_stat_ok"];
    ?>
" />
            </p>

        </fieldset>
        </form>
Example #23
0
        ?>
?</th>
                <th><?php 
        print $PMF_LANG['ad_gen_delete'];
        ?>
?</th>
            </tr>
        </thead>
        <tbody>
<?php 
        foreach ($openquestions as $question) {
            ?>
        <tr>
            <td>
                <?php 
            print PMF_Date::format(PMF_Date::createIsoDate($question['created']));
            ?>
                <br />
                <a href="mailto:<?php 
            print $question['email'];
            ?>
">
                    <?php 
            print $question['username'];
            ?>
                </a>
            </td>
            <td>
                <?php 
            print $category->categoryName[$question['category_id']]['name'];
            ?>
Example #24
0
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;
}
$news = new PMF_News($faqConfig);
if ('addnews' == $action && $user->perm->checkRight($user->getUserId(), "addnews")) {
    $twig->loadTemplate('news/add.twig')->display(array('PMF_LANG' => $PMF_LANG, 'languageSelector' => PMF_Language::selectLanguages($LANGCODE, false, array(), 'langTo'), 'userDisplayName' => $user->getUserData('display_name'), 'userEmail' => $user->getUserData('email')));
} elseif ('news' == $action && $user->perm->checkRight($user->getUserId(), "editnews")) {
    $date = new PMF_Date($faqConfig);
    $newsHeader = $news->getNewsHeader();
    foreach ($newsHeader as $key => $newsItem) {
        $newsHeader[$key]['date'] = $date->format($newsItem['date']);
    }
    $twig->loadTemplate('news/list.twig')->display(array('PMF_LANG' => $PMF_LANG, 'newsHeader' => $newsHeader));
    unset($date, $newsHeader, $key, $newsItem);
} elseif ('editnews' == $action && $user->perm->checkRight($user->getUserId(), 'editnews')) {
    $id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
    $newsData = $news->getNewsEntry($id, true);
    $dateStart = $newsData['dateStart'] != '00000000000000' ? PMF_Date::createIsoDate($newsData['dateStart'], 'Y-m-d') : '';
    $dateEnd = $newsData['dateEnd'] != '99991231235959' ? PMF_Date::createIsoDate($newsData['dateEnd'], 'Y-m-d') : '';
    $newsId = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
    $oComment = new PMF_Comment($faqConfig);
    $comments = $oComment->getCommentsData($newsId, PMF_Comment::COMMENT_TYPE_NEWS);
    foreach ($comments as $item) {
        $item['date'] = PMF_Date::createIsoDate($item['date'], 'Y-m-d H:i', false);
    }
    $twig->loadTemplate('news/edit.twig')->display(array('PMF_LANG' => $PMF_LANG, 'comments' => $comments, 'commentType' => PMF_Comment::COMMENT_TYPE_NEWS, 'dateEnd' => $dateEnd, 'dateStart' => $dateStart, 'languageSelector' => PMF_Language::selectLanguages($newsData['lang'], false, array(), 'langTo'), 'newsData' => $newsData));
Example #25
0
                <th>&nbsp;</th>
            </tr>
        </thead>
        <tbody>
<?php 
    $newsHeader = $news->getNewsHeader();
    if (count($newsHeader)) {
        foreach ($newsHeader as $newsItem) {
            ?>
        <tr>
            <td><?php 
            print $newsItem['header'];
            ?>
</td>
            <td><?php 
            print PMF_Date::format($newsItem['date']);
            ?>
</td>
            <td>
                <a href="?action=editnews&amp;id=<?php 
            print $newsItem['id'];
            ?>
" title="<?php 
            print $PMF_LANG["ad_news_update"];
            ?>
">
                    <img src="images/edit.png" width="16" height="16" alt="<?php 
            print $PMF_LANG["ad_news_update"];
            ?>
" border="0" />
                </a>
            continue;
        }
        $counter++;
        if ($counter <= $start) {
            continue;
        }
        $displayedCounter++;
        $user->getUserById($logging_value['usr']);
        ?>
        <tr>
            <td><?php 
        echo $logging_id;
        ?>
</td>
            <td><?php 
        echo $date->format(date('Y-m-d H:i', $logging_value['time']));
        ?>
</td>
            <td><?php 
        echo $user->getLogin();
        ?>
</td>
            <td><?php 
        echo $logging_value['ip'];
        ?>
</td>
            <td><small><?php 
        $text = $logging_value['text'];
        $text = str_replace("Loginerror", $PMF_LANG["ad_log_lger"], $text);
        $text = str_replace("Session expired", $PMF_LANG["ad_log_sess"], $text);
        $text = str_replace("Useredit, ", $PMF_LANG["ad_log_edit"], $text);
            </tr>
        </thead>
        <tbody>
<?php 
    $newsHeader = $news->getNewsHeader();
    $date = new PMF_Date($faqConfig);
    if (count($newsHeader)) {
        foreach ($newsHeader as $newsItem) {
            ?>
        <tr>
            <td><?php 
            echo $newsItem['header'];
            ?>
</td>
            <td><?php 
            echo $date->format($newsItem['date']);
            ?>
</td>
            <td>
                <a class="btn btn-primary" href="?action=editnews&amp;id=<?php 
            echo $newsItem['id'];
            ?>
">
                    <span title="<?php 
            echo $PMF_LANG["ad_news_update"];
            ?>
" class="icon-edit"></span>
                </a>
                &nbsp;&nbsp;
                <a class="btn btn-danger" href="?action=deletenews&amp;id=<?php 
            echo $newsItem['id'];