示例#1
0
    $tbl_forums = $tbl_cdb_names['bb_forums'];
    $sql = "SELECT pt.post_id,\n                       pt.post_text,\n                       p.nom         AS lastname,\n                       p.prenom      AS firstname,\n                       p.`poster_id`,\n                       p.post_time,\n                       t.topic_id,\n                       t.topic_title,\n                       f.forum_id,\n                       f.forum_name,\n                       f.group_id\n               FROM  `" . $tbl_posts_text . "` AS pt,\n                     `" . $tbl_posts . "`      AS p,\n                     `" . $tbl_topics . "`     AS t,\n                     `" . $tbl_forums . "`     AS f\n               WHERE ( " . $sqlClauseString . ")\n                 AND pt.post_id = p.post_id\n                 AND p.topic_id = t.topic_id\n                 AND t.forum_id = f.forum_id\n               ORDER BY p.post_time DESC, t.topic_id";
    $searchResultList = claro_sql_query_fetch_all($sql);
    $userGroupList = get_user_group_list(claro_get_current_user_id());
    $userGroupList = array_keys($userGroupList);
    $tutorGroupList = get_tutor_group_list(claro_get_current_user_id());
} else {
    $searchResultList = array();
}
$pagetype = 'viewsearch';
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Forums'), 'index.php');
CssLoader::getInstance()->load('clfrm', 'screen');
$noPHP_SELF = true;
$out = '';
$out .= claro_html_tool_title(get_lang('Forums'), $is_allowedToEdit ? get_help_page_url('blockForumsHelp', 'CLFRM') : false);
$out .= claro_html_menu_horizontal(disp_forum_toolbar($pagetype, null)) . disp_forum_breadcrumb($pagetype, null, null, null) . '<h4>' . get_lang('Search result') . ' : ' . (isset($_REQUEST['searchPattern']) ? claro_htmlspecialchars($_REQUEST['searchPattern']) : '') . '</h4>' . "\n";
if (count($searchResultList) < 1) {
    $out .= '<p>' . get_lang('No result') . '</p>';
} else {
    foreach ($searchResultList as $thisPost) {
        // PREVENT USER TO CONSULT POST FROM A GROUP THEY ARE NOT ALLOWED
        if (!is_null($thisPost['group_id']) && $is_groupPrivate && !(in_array($thisPost['group_id'], $userGroupList) || in_array($thisPost['group_id'], $tutorGroupList) || claro_is_course_manager())) {
            continue;
        } else {
            // notify if is new message
            $post_time = datetime_to_timestamp($thisPost['post_time']);
            if ($post_time < $last_visit) {
                $class = ' class="item"';
            } else {
                $class = ' class="item hot"';
            }
示例#2
0
文件: editpost.php 项目: rhertzog/lcs
  Display Section
 =================================================================*/
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Forums'), 'index.php');
$noPHP_SELF = true;
$out = '';
// Forum Title
$out .= claro_html_tool_title(get_lang('Forums'), $is_allowedToEdit ? 'help_forum.php' : false);
if (!$allowed || !$is_allowedToEdit) {
    $out .= $dialogBox->render();
} else {
    if (isset($_REQUEST['submit']) && !$error) {
        if (!isset($_REQUEST['delete'])) {
            $out .= disp_confirmation_message(get_lang('Your message has been entered'), $forum_id, $topic_id);
        } else {
            $out .= disp_confirmation_message(get_lang('Your message has been deleted'), $forum_id);
        }
    } else {
        $first_post = is_first_post($topic_id, $post_id);
        if ($error) {
            $out .= $dialogBox->render();
        }
        $out .= disp_forum_breadcrumb($pagetype, $forum_id, $forum_name, $topic_id, $subject) . claro_html_menu_horizontal(disp_forum_toolbar($pagetype, $forum_id, $topic_id, 0)) . '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post" >' . "\n" . claro_form_relay_context() . '<input type="hidden" name="post_id" value="' . $post_id . '" />' . "\n" . '<table border="0" width="100%" >' . "\n";
        if ($first_post) {
            $out .= '<tr valign="top">' . "\n" . '<td align="right">' . "\n" . '<label for="subject">' . get_lang('Subject') . '</label> : ' . '</td>' . "\n" . '<td>' . "\n" . '<input type="text" name="subject" id="subject" size="50" maxlength="100" value="' . htmlspecialchars($subject) . '" />' . '</td>' . "\n" . '</tr>' . "\n";
        }
        $out .= '<tr valign="top">' . "\n" . '<td align="right">' . "\n" . '<br />' . get_lang('Message body') . ' : ' . "\n" . '</td>' . "\n" . '<td>' . "\n" . claro_html_textarea_editor('message', $message) . '</td>' . "\n" . '</tr>' . "\n" . '<tr valign="top">' . "\n" . '<td align="right">' . "\n" . '<label for="delete" >' . get_lang('Delete') . '</label>' . "\n" . ' : ' . "\n" . '</td>' . "\n" . '<td>' . "\n" . '<input type="checkbox" name="delete" id="delete" />' . "\n" . '</td>' . "\n" . '</tr>' . "\n" . '<tr>' . '<td>&nbsp;</td>' . "\n" . '<td>' . '<input type="submit" name="submit" value="' . get_lang('Ok') . '" />&nbsp; ' . '<input type="submit" name="cancel" value="' . get_lang('Cancel') . '" />' . '</td>' . "\n" . '</tr>' . "\n" . '</table>' . "\n" . '</form>' . "\n" . '<br />' . "\n" . '<center>' . '<a href="' . htmlspecialchars(Url::Contextualize(get_module_url('CLFRM') . '/viewtopic.php?topic=' . $topic_id)) . '" target="_blank">' . get_lang('Topic review') . '</a>' . '</center>' . '<br />' . "\n";
    }
    // end // else if ! isset submit
}
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
示例#3
0
文件: newtopic.php 项目: rhertzog/lcs
  Display Section
 =================================================================*/
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Forums'), 'index.php');
$noPHP_SELF = true;
$out = '';
// display tool title
$out .= claro_html_tool_title(get_lang('Forums'), $is_allowedToEdit ? 'help_forum.php' : false);
if (!$allowed) {
    $out .= $dialogBox->render();
} else {
    // Display new topic page
    if (isset($_REQUEST['submit']) && !$error) {
        // Display success message
        $out .= disp_confirmation_message(get_lang('Your message has been entered'), $forum_id, $topic_id);
    } else {
        if ($error) {
            // display error message
            $out .= $dialogBox->render();
        }
        $out .= disp_forum_breadcrumb($pagetype, $forum_id, $forum_name) . claro_html_menu_horizontal(disp_forum_toolbar($pagetype, $forum_id, 0, 0)) . '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">' . "\n" . '<input type="hidden" name="forum" value="' . $forum_id . '" />' . "\n" . claro_form_relay_context() . '<table border="0" width="100%">' . "\n" . '<tr valign="top">' . "\n" . '<td align="right"><label for="subject">' . get_lang('Subject') . '</label> : </td>' . '<td><input type="text" name="subject" id="subject" size="50" maxlength="100" value="' . htmlspecialchars($subject) . '" /></td>' . '</tr>' . '<tr  valign="top">' . "\n" . '<td align="right"><br />' . get_lang('Message body') . ' :</td>';
        if (!empty($message)) {
            $content = $message;
        } else {
            $content = '';
        }
        $out .= '<td>' . claro_html_textarea_editor('message', $content) . '</td>' . '</tr>' . '<tr  valign="top"><td>&nbsp;</td>' . '<td><input type="submit" name="submit" value="' . get_lang('Ok') . '" />&nbsp; ' . '&nbsp;<input type="submit" name="cancel" value="' . get_lang('Cancel') . '" />' . "\n" . '</td></tr>' . '</table>' . '</form>' . "\n";
    }
}
// end allowed
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
示例#4
0
文件: reply.php 项目: rhertzog/lcs
}
/*=================================================================
  Display Section
 =================================================================*/
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Forums'), 'index.php');
$noPHP_SELF = true;
$out = '';
$pagetype = 'reply';
$is_allowedToEdit = claro_is_allowed_to_edit();
$out .= claro_html_tool_title(get_lang('Forums'), $is_allowedToEdit ? 'help_forum.php' : false);
if (!$allowed) {
    // not allowed
    $out .= $dialogBox->render();
} else {
    if (isset($_REQUEST['submit']) && !$error) {
        // DISPLAY SUCCES MESSAGE
        $out .= disp_confirmation_message(get_lang('Your message has been entered'), $forum_id, $topic_id);
    } else {
        if ($error) {
            $out .= $dialogBox->render();
        }
        $out .= claro_html_menu_horizontal(disp_forum_toolbar($pagetype, $forum_id, 0, $topic_id));
        $out .= disp_forum_breadcrumb($pagetype, $forum_id, $forum_name, $topic_id, $topic_title);
        $out .= '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">' . "\n" . claro_form_relay_context() . '<input type="hidden" name="forum" value="' . $forum_id . '" />' . "\n" . '<input type="hidden" name="topic" value="' . $topic_id . '" />' . "\n";
        $out .= '<table border="0" width="100%">' . "\n" . '<tr valign="top">' . "\n" . '<td align="right"><br />' . get_lang('Message body') . '&nbsp;:</td>' . '<td>' . claro_html_textarea_editor('message', $message) . '</td>' . '</tr>' . '<tr valign="top"><td>&nbsp;</td>' . '<td>' . '<input type="submit" name="submit" value="' . get_lang('Ok') . '" />&nbsp; ' . '<input type="submit" name="cancel" value="' . get_lang('Cancel') . '" />' . '</td>' . '</tr>' . '</table>' . '</form>';
        $out .= '<p style="text-align: center;"><a href="' . htmlspecialchars(Url::Contextualize(get_module_url('CLFRM') . '/viewtopic.php?topic=' . $topic_id . '&forum=' . $forum_id)) . '" target="_blank">' . get_lang('Topic review') . '</a></p>';
    }
    // end else if submit
}
$claroline->display->body->appendContent($out);
echo $claroline->display->render();