Ejemplo n.º 1
0
<?php 
require "php/topbar.php";
?>
<body>
	<div class="maindiv">

<?php 
session_start();
require_once "php/database.php";
require_once "php/storedprocedures.php";
require_once "php/error.php";
require_once "php/posting.php";
if (isset($_POST['threadid'])) {
    $db = connectToDatabase();
    if ($db) {
        $info = getThreadInfo($db, $_SESSION['id'], $_POST['threadid']);
        switch ($info[SP::ERROR]) {
            case ERR::OK:
                echo <<<EOT
<h2 class='title'>Posting to: <a href=threadview.php?threadid={$_POST['threadid']}>{$info[THREAD::TITLE]}</a></h2>
<form id="postform" method="POST" action="postsubmission.php">
\t<input type='hidden' id='threadid' name='threadid' value='{$_POST['threadid']}'>
EOT;
                if (isset($_POST['editstr'])) {
                    echo createContentArea($_POST['editstr']);
                } else {
                    echo createContentArea();
                }
                /*	<input type="hidden" id="content" name="content" />
                	<div id='postcontent' contenteditable>
                EOT;
Ejemplo n.º 2
0
            } else {
                document.getElementById('options_field').style.display = 'none';
                \$("[name='numeric_calification']").val(0);
                \$("[name='calification_notebook_title']").val('');
                \$("[name='weight_calification']").val(0);
                \$("[name='thread_peer_qualify'][value='0']").prop('checked', true);
            }
        });
    });
    </script>
JS;
if ($origin == 'learnpath') {
    Display::display_reduced_header();
} else {
    Display::display_header(null);
}
handle_forum_and_forumcategories();
// Action links
echo '<div class="actions">';
echo '<span style="float:right;">' . search_link() . '</span>';
echo '<a href="viewforum.php?forum=' . intval($_GET['forum']) . '&' . $cidreq . '">' . Display::return_icon('back.png', get_lang('BackToForum'), '', ICON_SIZE_MEDIUM) . '</a>';
echo '</div>';
$threadData = getThreadInfo($threadId, $cId);
$values = showUpdateThreadForm($currentForum, $forumSettings, $threadData);
if (!empty($values) && isset($values['SubmitPost'])) {
    // update thread in table forum_thread.
    updateThread($values);
}
if (isset($origin) && $origin != 'learnpath') {
    Display::display_footer();
}
Ejemplo n.º 3
0
session_start();
require_once "php/database.php";
require_once "php/storedprocedures.php";
require_once "php/error.php";
require_once "php/constants.php";
$db = connectToDatabase();
$page = 0;
$threadID;
$threadInfo;
$postsPerPage = 10;
$focusPostID = isset($_GET['postid']) ? $_GET['postid'] : null;
$postIDs;
$loggedUserDetails = null;
if (isset($_GET['threadid'])) {
    $threadID = $_GET['threadid'];
    $threadInfo = getThreadInfo($db, $_SESSION['id'], $threadID);
    echo "<title>" . $threadInfo[THREAD::TITLE] . "</title>";
} else {
    echo "No thread.";
    exit;
}
// If we navigate around the pages, it doesn't count as a view. If we come to a thread without the page set, it does count.
if (isset($_GET['page'])) {
    $page = $_GET['page'];
} else {
    viewThread($db, $threadID);
}
echo "</head><body>";
require "php/topbar.php";
if (isset($_SESSION['id']) && isset($_SESSION['token'])) {
    $loggedUserDetails = getPrivateUserDetails($db, $_SESSION['id'], $_SESSION['token']);