예제 #1
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;
}
$recordId = PMF_Filter::filterInput(INPUT_POST, 'artikel', FILTER_VALIDATE_INT, 0);
$vote = PMF_Filter::filterInput(INPUT_POST, 'vote', FILTER_VALIDATE_INT);
$userIp = PMF_Filter::filterVar($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP);
if (isset($vote) && $faq->votingCheck($recordId, $userIp) && $vote > 0 && $vote < 6) {
    $faqsession->userTracking('save_voting', $recordId);
    $voting = new PMF_Rating();
    $votingData = array('id' => null, 'record_id' => $recordId, 'vote' => $vote, 'date' => $_SERVER['REQUEST_TIME'], 'user_ip' => $userIp);
    if (!$voting->fetch($recordId)) {
        $voting->create($votingData);
    } else {
        $voting->update($recordId, $votingData);
    }
    $tpl->processTemplate('writeContent', array('msgVoteThanks' => $PMF_LANG['msgVoteThanks']));
} elseif (isset($voting) && !$faq->votingCheck($recordId, $userIp)) {
    $faqsession->userTracking('error_save_voting', $recordId);
    $tpl->processTemplate('writeContent', array('msgVoteThanks' => $PMF_LANG['err_VoteTooMuch']));
} else {
    $faqsession->userTracking('error_save_voting', $recordId);
    $tpl->processTemplate('writeContent', array('msgVoteThanks' => $PMF_LANG['err_noVote']));
}
$tpl->includeTemplate('writeContent', 'index');
예제 #2
0
 * @link      http://www.phpmyfaq.de
 * @since     2003-02-24
 */
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;
}
if ($user->perm->checkRight($user->getUserId(), 'viewlog')) {
    $category = new PMF_Category($faqConfig, [], false);
    $category->setUser($currentAdminUser);
    $category->setGroups($currentAdminGroups);
    $ratings = new PMF_Rating($faqConfig);
    $ratingdata = $ratings->getAllRatings();
    $numratings = count($ratingdata);
    $oldcategory = 0;
    ?>
        <header class="row">
            <div class="col-lg-12">
                <h2 class="page-header"><i class="fa fa-tasks"></i> <?php 
    echo $PMF_LANG["ad_rs"];
    ?>
</h2>
            </div>
        </header>

        <div class="row">
            <div class="col-lg-12">
예제 #3
0
파일: artikel.php 프로젝트: nosch/phpMyFAQ
 * @author    Lars Tiedemann <*****@*****.**>
 * @copyright 2002-2010 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
 * @link      http://www.phpmyfaq.de
 * @since     2002-08-27
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($sids);
$oGlossary = new PMF_Glossary();
$oLnk = new PMF_Linkverifier();
$tagging = new PMF_Tags();
$relevant = new PMF_Relation();
$faqrating = new PMF_Rating();
$comment = new PMF_Comment();
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$currentCategory = $cat;
$record_id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$solution_id = PMF_Filter::filterInput(INPUT_GET, 'solution_id', FILTER_VALIDATE_INT);
$highlight = PMF_Filter::filterInput(INPUT_GET, 'highlight', FILTER_SANITIZE_STRIPPED);
$faqsession->userTracking('article_view', $record_id);
// Get all data from the FAQ record
if (0 == $solution_id) {
    $faq->getRecord($record_id);
} else {
    $faq->getRecordBySolutionId($solution_id);
예제 #4
0
     break;
 case 'savevoting':
     $faq = new PMF_Faq();
     $type = PMF_Filter::filterInput(INPUT_POST, 'type', FILTER_SANITIZE_STRING, 'faq');
     $recordId = PMF_Filter::filterInput(INPUT_POST, 'id', FILTER_VALIDATE_INT, 0);
     $vote = PMF_Filter::filterInput(INPUT_POST, 'vote', FILTER_VALIDATE_INT);
     $userIp = PMF_Filter::filterVar($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP);
     if (isset($vote) && $faq->votingCheck($recordId, $userIp) && $vote > 0 && $vote < 6) {
         $faqsession->userTracking('save_voting', $recordId);
         $votingData = array('record_id' => $recordId, 'vote' => $vote, 'user_ip' => $userIp);
         if (!$faq->getNumberOfVotings($recordId)) {
             $faq->addVoting($votingData);
         } else {
             $faq->updateVoting($votingData);
         }
         $faqRating = new PMF_Rating();
         $message = array('success' => $PMF_LANG['msgVoteThanks'], 'rating' => $faqRating->getVotingResult($recordId));
     } elseif (!$faq->votingCheck($recordId, $userIp)) {
         $faqsession->userTracking('error_save_voting', $recordId);
         $message = array('error' => $PMF_LANG['err_VoteTooMuch']);
     } else {
         $faqsession->userTracking('error_save_voting', $recordId);
         $message = array('error' => $PMF_LANG['err_noVote']);
     }
     break;
     // Send user generated mails
 // Send user generated mails
 case 'sendcontact':
     $name = PMF_Filter::filterInput(INPUT_POST, 'name', FILTER_SANITIZE_STRING);
     $email = PMF_Filter::filterInput(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL);
     $question = PMF_Filter::filterInput(INPUT_POST, 'question', FILTER_SANITIZE_STRIPPED);
예제 #5
0
파일: artikel.php 프로젝트: atlcurling/tkt
 * @author    Lars Tiedemann <*****@*****.**>
 * @copyright 2002-2012 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
 * @link      http://www.phpmyfaq.de
 * @since     2002-08-27
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($db, $Language);
$oGlossary = new PMF_Glossary();
$oLnk = new PMF_Linkverifier();
$faqTagging = new PMF_Tags($db, $Language);
$faqRelation = new PMF_Relation($db, $Language);
$faqRating = new PMF_Rating();
$faqComment = new PMF_Comment();
if (is_null($user)) {
    $user = new PMF_User_CurrentUser();
}
$faqSearchResult = new PMF_Search_Resultset($user, $faq);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$currentCategory = $cat;
$recordId = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$solutionId = PMF_Filter::filterInput(INPUT_GET, 'solution_id', FILTER_VALIDATE_INT);
$highlight = PMF_Filter::filterInput(INPUT_GET, 'highlight', FILTER_SANITIZE_STRIPPED);
// Set the FAQ language
예제 #6
0
파일: artikel.php 프로젝트: ae120/phpMyFAQ
 * @since     2002-08-27
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    $protocol = 'http';
    if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON') {
        $protocol = 'https';
    }
    header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($faqConfig);
$oGlossary = new PMF_Glossary($faqConfig);
$oLnk = new PMF_Linkverifier($faqConfig);
$faqTagging = new PMF_Tags($faqConfig);
$faqRelation = new PMF_Relation($faqConfig);
$faqRating = new PMF_Rating($faqConfig);
$faqComment = new PMF_Comment($faqConfig);
if (is_null($user)) {
    $user = new PMF_User_CurrentUser($faqConfig);
}
$faqSearchResult = new PMF_Search_Resultset($user, $faq, $faqConfig);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$currentCategory = $cat;
$recordId = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$solutionId = PMF_Filter::filterInput(INPUT_GET, 'solution_id', FILTER_VALIDATE_INT);
// Get all data from the FAQ record
if (0 == $solutionId) {
예제 #7
0
파일: artikel.php 프로젝트: noon/phpMyFAQ
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($sids);
$oGlossary = new PMF_Glossary();
$oLnk = new PMF_Linkverifier();
$tagging = new PMF_Tags();
$relevant = new PMF_Relation();
$faqrating = new PMF_Rating();
$comment = new PMF_Comment();
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$currentCategory = $cat;
$record_id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$solution_id = PMF_Filter::filterInput(INPUT_GET, 'solution_id', FILTER_VALIDATE_INT);
$highlight = PMF_Filter::filterInput(INPUT_GET, 'highlight', FILTER_SANITIZE_STRIPPED);
$faqsession->userTracking('article_view', $record_id);
// Get all data from the FAQ record
if (0 == $solution_id) {
    $faq->getRecord($record_id);
} else {
    $faq->getRecordBySolutionId($solution_id);