Exemplo n.º 1
0
 // Show max qualify in my form
 $maxQualify = showQualify('2', $userIdToQualify, $threadId);
 $score = isset($_POST['idtextqualify']) ? $_POST['idtextqualify'] : '';
 if ($score > $maxQualify) {
     Display::display_error_message(get_lang('QualificationCanNotBeGreaterThanMaxScore'), false);
 }
 if (!empty($score)) {
     $saveResult = saveThreadScore($currentThread, $userIdToQualify, $threadId, $score, api_get_utc_datetime(), api_get_session_id());
 }
 // show qualifications history
 $type = isset($_GET['type']) ? $_GET['type'] : '';
 $historyList = getThreadScoreHistory($userIdToQualify, $threadId, $type);
 $counter = count($historyList);
 // Show current qualify in my form
 $qualify = current_qualify_of_thread($threadId, api_get_session_id(), $_GET['user']);
 $result = get_statistical_information($threadId, $_GET['user_id'], api_get_course_int_id());
 $url = api_get_path(WEB_CODE_PATH) . 'forum/forumqualify.php?' . api_get_cidreq() . '&forum=' . intval($_GET['forum']) . '&thread=' . $threadId . '&user='******'user']) . '&user_id=' . intval($_GET['user']);
 $userToQualifyInfo = api_get_user_info($userIdToQualify);
 $form = new FormValidator('forum-thread-qualify', 'post', $url);
 $form->addHeader($userToQualifyInfo['complete_name']);
 $form->addLabel(get_lang('Thread'), $currentThread['thread_title']);
 $form->addLabel(get_lang('CourseUsers'), $result['user_course']);
 $form->addLabel(get_lang('PostsNumber'), $result['post']);
 $form->addLabel(get_lang('NumberOfPostsForThisUser'), $result['user_post']);
 $form->addLabel(get_lang('AveragePostPerUser'), round($result['user_post'] / $result['post'], 2));
 $form->addText('idtextqualify', array(get_lang('Qualification'), get_lang('MaxScore') . ' ' . $maxQualify), $qualify);
 include 'viewpost.inc.php';
 $form->addButtonSave(get_lang('QualifyThisThread'));
 $form->setDefaults(array('idtextqualify' => $qualify));
 $form->display();
 // Show past data
Exemplo n.º 2
0
                echo ' "> ' . $user_filename . ' </a>';
                echo '<span class="forum_attach_comment" >' . $attachment['comment'] . '</span><br />';
                echo '</td></tr>';
            }
        }
        // The post has been displayed => it can be removed from the what's new array
        unset($whatsnew_post_info[$current_forum['forum_id']][$current_thread['thread_id']][$row['post_id']]);
        unset($whatsnew_post_info[$current_forum['forum_id']][$current_thread['thread_id']]);
        unset($_SESSION['whatsnew_post_info'][$current_forum['forum_id']][$current_thread['thread_id']][$row['post_id']]);
        unset($_SESSION['whatsnew_post_info'][$current_forum['forum_id']][$current_thread['thread_id']]);
        echo "</table></div>";
        $counter++;
    }
}
$userid = (int) $_GET['user_id'];
$userinf = api_get_user_info($userid);
$current_thread = get_thread_information($_GET['thread']);
$threadid = $current_thread['thread_id'];
$qualify = (int) $_POST['idtextqualify'];
//return Max qualify thread
$max_qualify = show_qualify('2', $userid, $threadid);
$current_qualify_thread = show_qualify('1', $userid, $threadid);
if (isset($_POST['idtextqualify'])) {
    store_theme_qualify($userid, $threadid, $qualify, $_SESSION['_user']['user_id'], date('Y-m-d H:i:s'), '');
}
$result = get_statistical_information($current_thread['thread_id'], $_GET['user_id'], $_GET['cidReq']);
if ($userinf['status'] != '1') {
    echo '<div class="forum-qualification-input-box">';
    require_once 'forumbody.inc.php';
    echo '</div>';
}
Exemplo n.º 3
0
                echo '<span class="forum_attach_comment" >' . $attachment['comment'] . '</span><br />';
                echo '</td></tr>';
            }
        }
        // The post has been displayed => it can be removed from the what's new array
        if (isset($whatsnew_post_info)) {
            unset($whatsnew_post_info[$currentForum['forum_id']][$current_thread['thread_id']][$row['post_id']]);
            unset($whatsnew_post_info[$currentForum['forum_id']][$current_thread['thread_id']]);
        }
        if (isset($_SESSION['whatsnew_post_info'])) {
            unset($_SESSION['whatsnew_post_info'][$currentForum['forum_id']][$current_thread['thread_id']][$row['post_id']]);
            unset($_SESSION['whatsnew_post_info'][$currentForum['forum_id']][$current_thread['thread_id']]);
        }
        echo "</table></div>";
        $counter++;
    }
}
//return Max qualify thread
$max_qualify = showQualify('2', $userid, $threadid);
$current_qualify_thread = showQualify('1', $userid, $threadid);
if (isset($_POST['idtextqualify'])) {
    saveThreadScore($current_thread, $userid, $threadid, $_POST['idtextqualify'], api_get_user_id(), date('Y-m-d H:i:s'), '');
}
$result = get_statistical_information($current_thread['thread_id'], $_GET['user_id'], api_get_course_int_id());
/*
if ($userInfo['status']!='1') {
    echo '<div class="forum-qualification-input-box">';
    require_once 'forumbody.inc.php';
    echo '</div>';
}
*/