Exemplo n.º 1
0
function baseForum(&$session)
{
    global $page_no, $forum_id;
    $session->trace(TC_Gui1, 'baseForum');
    if (!isset($forum_id) || !isInt($forum_id)) {
        $forum_id = 1;
    }
    if (empty($page_no)) {
        $page_no = 1;
    }
    $forum = dbGetRecordById($session, T_Forum, $forum_id, 'name,description');
    dbForumInfo($session, $forum_id, $threads, $pages);
    $headline = 'Forum ' . $forum[0];
    guiStandardHeader($session, $headline, Th_StandardHeader, Th_StandardBodyStart);
    guiParagraph($session, $forum[1], true);
    guiParagraph($session, 'Seite ' . $page_no . ' von ' . $pages . ' (' . (0 + $threads) . ($threads == 1 ? ' Thema)' : ' Themen)'), false);
    echo '<table width="100%" border="0"><tr><td>';
    guiInternLink($session, P_Forum . '?forum_id=' . $forum_id . '&action=' . A_NewThread, 'Neues Thema');
    echo '</td><td style="text-align: right">';
    guiPageLinks($session, P_Forum . '?action=' . A_ShowForum . '&forum_id=' . $forum_id, $page_no, $pages);
    echo '</td></tr></table>' . "\n";
    $id_list = dbIdListOfPage($session, T_Posting, "forum={$forum_id} and top is null order by id desc", $session->fUserThreadsPerPage, $page_no);
    echo '<table width="100%" border="1">' . "\n" . '<tr><td><b>Thema</b></td><td><b>Autor</b></td>' . '<td><b>Antworten</b></td><td><b>Aufrufe</b></td>' . '<td><b>Letzter Beitrag</b></td>' . "</tr>\n";
    foreach ($id_list as $ii => $id) {
        $thread = dbGetRecordById($session, T_Posting, $id, 'author,changedat,subject,changedby,calls');
        $last_id = null;
        dbThreadInfo($session, $id, $answers, $thread_pages, $last_id);
        if (empty($last_id)) {
            $last = $thread;
            $last_id = $id;
        } else {
            $last = dbGetRecordById($session, T_Posting, $last_id, 'author,changedat,subject');
        }
        echo '<tr><td>';
        guiThreadPageLink($session, $id, 1, $thread[2]);
        echo '</td><td>' . htmlentities($thread[0]) . '</td><td>';
        echo $answers + 0;
        echo '</td><td>' . ($thread[4] + 0) . '</td><td>';
        echo $last[0] . ' ' . dbSqlDateToText($session, $last[1]) . '<br/>';
        guiInternLink($session, P_Thread . '?action=' . A_ShowThread . '&posting_id=' . $last_id, $last[2]);
        echo '</td></tr>' . "\n";
    }
    echo "</table>\n";
    echo '<table width="100%" border="0"><tr><td>';
    guiInternLink($session, P_Forum . '?forum_id=' . $forum_id . '&action=' . A_NewThread, 'Neues Thema');
    echo '</td><td style="text-align: right">';
    guiPageLinks($session, P_Forum . '?action=' . A_ShowForum . '&forum_id=' . $forum_id, $page_no, $pages);
    echo '</td></tr></table>' . "\n";
    guiStandardBodyEnd($session, Th_StandardBodyEnd);
}
Exemplo n.º 2
0
function baseForum(&$session)
{
    $session->trace(TC_Gui1, 'baseForum');
    if (!isset($_POST['forum_id']) || !isInt($_POST['forum_id'])) {
        $_POST['forum_id'] = 1;
    }
    $forum_id = $_POST['forum_id'];
    if (empty($_POST['page_no'])) {
        $_POST['page_no'] = 1;
    }
    $page_no = $_POST['page_no'];
    $forum = dbGetRecordById($session, T_Forum, $forum_id, 'name,description');
    dbForumInfo($session, $forum_id, $threads, $pages);
    $headline = 'Forum ' . $forum[0];
    guiStandardHeader($session, $headline, Th_StandardHeader, Th_StandardBodyStart);
    guiParagraph($session, $forum[1], true);
    guiParagraph($session, 'Seite ' . $page_no . ' von ' . $pages . ' (' . (0 + $threads) . ($threads == 1 ? ' Thema)' : ' Themen)'), false);
    outTableAndRecord();
    outTableInternLink($session, null, P_Forum . '?forum_id=' . $forum_id . '&action=' . A_NewThread, 'Neues Thema');
    outTableDelim(AL_Right);
    guiPageLinks($session, P_Forum . '?action=' . A_ShowForum . '&forum_id=' . $forum_id, $page_no, $pages);
    outTableDelimAndRecordEnd();
    outTableEnd();
    $id_list = dbIdListOfPage($session, T_Posting, "forum={$forum_id} and top is null order by id desc", $session->fUserThreadsPerPage, $page_no);
    outTableAndRecord(1);
    outTableCellStrong('Thema');
    outTableCellStrong('Autor');
    outTableCellStrong('Antworten');
    outTableCellStrong('Aufrufe');
    outTableCellStrong('Letzter Beitrag');
    outTableCellStrong('Thema');
    outTableRecordEnd();
    foreach ($id_list as $ii => $id) {
        $thread = dbGetRecordById($session, T_Posting, $id, 'author,changedat,subject,changedby,calls');
        $last_id = null;
        dbThreadInfo($session, $id, $answers, $thread_pages, $last_id);
        if (empty($last_id)) {
            $last = $thread;
            $last_id = $id;
        } else {
            $last = dbGetRecordById($session, T_Posting, $last_id, 'author,changedat,subject');
        }
        outTableRecordAndDelim();
        guiThreadPageLink($session, $id, 1, $thread[2]);
        outTableDelimEnd();
        outTableCell(htmlentities($thread[0]));
        outTableCell($answers + 0);
        outTableCell($thread[4] + 0);
        outTableDelim();
        echo $last[0];
        echo ' ';
        echo dbSqlDateToText($session, $last[1]);
        outNewline();
        guiInternLink($session, P_Thread . '?action=' . A_ShowThread . '&posting_id=' . $last_id, $last[2]);
        outTableDelimAndRecordEnd();
    }
    outTableEnd();
    outTableAndRecord();
    outTableInternLink($session, null, P_Forum . '?forum_id=' . $forum_id . '&action=' . A_NewThread, 'Neues Thema');
    outTableDelim(AL_Right);
    guiPageLinks($session, P_Forum . '?action=' . A_ShowForum . '&forum_id=' . $forum_id, $page_no, $pages);
    outTableDelimAndRecordEnd();
    outTableEnd();
    guiStandardBodyEnd($session, Th_StandardBodyEnd);
}