function baseLastChanges(&$session)
{
    $headline = 'Übersicht über die letzten Änderungen';
    guiStandardHeader($session, $headline, Th_StandardHeader, Th_StandardBodyStart);
    if (!isset($_POST['last_days']) || $_POST['last_days'] < 1) {
        $_POST['last_days'] = 7;
    }
    guiStartForm($session);
    outParagraph($session);
    echo 'Zeitraum: die letzten ';
    outTextField($session, 'last_days', $_POST['last_days'], 3, 4);
    echo ' Tage ';
    outButton($session, 'last_refresh', 'Aktualisieren');
    outParagraphEnd($session);
    outTable();
    for ($day = 0; $day <= $_POST['last_days']; $day++) {
        $date = localtime(time() - $day * 86400);
        $time_0 = strftime('%Y.%m.%d', time() - $day * 86400);
        $time_2 = mktime(0, 0, 0, $date[4] + 1, $date[3], $date[5]);
        $time_1 = dbSqlDateTime($session, $time_2);
        $condition = 't.createdat>=' . $time_1 . ' and t.createdat<=' . str_replace('00:00:00', '23:59:59', $time_1);
        $rec = dbFirstRecord($session, 'select t.id,p.name,t.createdby,t.createdat,t.replacedby,p.id from ' . dbTable($session, T_Text) . ' t, ' . dbTable($session, T_Page) . ' p where p.id=t.page and ' . $condition . ' order by createdat desc');
        if ($rec) {
            outTableRecord();
            outTableCellStrong($time_0);
            outTableRecordEnd();
            do {
                $text_id = $rec[0] + 0;
                $page_id = $rec[5] + 0;
                $page_name = $rec[1];
                $page_link = encodeWikiName($session, $page_name);
                outTableRecord();
                outTableCell(dbSingleValue($session, 'select min(id) from ' . dbTable($session, T_Text) . ' where page=' . $page_id) == $text_id ? 'Neu' : 'Änderung');
                outTableInternLink($session, null, $page_link . '?action=' . A_ShowText . '&page_id=' . $page_id . '&text_id=' . $text_id, $text_id);
                outTableInternLink($session, null, $page_link, $page_name);
                outTableAuthorLink($session, $rec[2]);
                outTableCell(dbSqlDateToText($session, $rec[3]));
                $pred_rec = dbSingleValue($session, 'select max(id) from ' . dbTable($session, T_Text) . ' where page=' . $page_id . ' and createdat<' . dbSqlDateTime($session, $time_2));
                if ($pred_rec > 0) {
                    outTableInternLink($session, null, $page_link . '?action=' . A_Diff . '&text_id=' . $text_id . '&text_id2=' . $pred_rec, 'Unterschied zum Vortag (' . $pred_rec . ')');
                }
                outTableRecordEnd();
            } while (($rec = dbNextRecord($session)) != null);
        }
    }
    outTableEnd();
    guiStandardBodyEnd($session, Th_StandardBodyEnd);
}
function addressPrintRow(&$session, $row)
{
    $what = 'lastname,firstname,country,zip,city,street,' . 'emailprivate,emailprivate2,phoneprivate,phoneprivate2,mobileprivate,faxprivate,' . 'emailoffice,emailoffice2,phoneoffice,phoneoffice2,mobileoffice,faxoffice,' . 'functions,notes,nickname,id,changedat,createdat';
    outTableRecord();
    outTableInternLink($session, null, '?action=' . A_EditCard . '&card_id=' . $row[21], $row[21]);
    if (guiChecked($session, 'show_withname')) {
        $name = addressAddLine("", $row[0]);
        $name = addressAddLine($name, $row[1]);
        $name = addressAddLine($name, $row[20]);
        outTableCell($name);
    }
    if (guiChecked($session, 'show_withprivate')) {
        if (guiChecked($session, 'show_withemail')) {
            $value = addressAddLine("", $row[6]);
            $value = addressAddLine($value, $row[7]);
            outTableCell($value);
        }
        if (guiChecked($session, 'show_withphone')) {
            $value = addressAddLine("", $row[8], 'T: ');
            $value = addressAddLine($value, $row[9], 'T: ');
            $value = addressAddLine($value, $row[10], 'H: ');
            $value = addressAddLine($value, $row[11], 'F: ');
            outTableCell($value);
        }
    }
    if (guiChecked($session, 'show_withoffice')) {
        if (guiChecked($session, 'show_withemail')) {
            $value = addressAddLine("", $row[12]);
            $value = addressAddLine($value, $row[13]);
            outTableCell($value);
        }
        if (guiChecked($session, 'show_withphone')) {
            $value = addressAddLine("", $row[14], 'T: ');
            $value = addressAddLine($value, $row[15], 'T: ');
            $value = addressAddLine($value, $row[16], 'H: ');
            $value = addressAddLine($value, $row[17], 'F: ');
            outTableCell($value);
        }
    }
    if (guiChecked($session, 'show_withaddress')) {
        $value = addressAddLine("", $row[5]);
        $str = empty($row[2]) ? $row[2] . '-' : '';
        $str .= empty($row[3]) ? $row[3] . '-' : '';
        $str .= empty($row[4]) ? '' : ' ' . $row[4];
        $value = addressAddLine($value, $str);
        outTableCell($value);
    }
    if (guiChecked($session, 'show_withfunction')) {
        outTableCell($row[18]);
    }
    if (guiChecked($session, 'show_withnote')) {
        outTableCell($row[19]);
    }
    if (guiChecked($session, 'show_withdate')) {
        $value = addressAddLine("", $row[23]);
        $value = addressAddLine($value, $row[22]);
        outTableCell($value);
    }
    outTableRecordEnd();
}
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);
}
示例#4
0
function admRename(&$session, $message)
{
    $session->trace(TC_Gui1, 'admRename');
    admStandardHeader($session, 'Umbenennen einer Seite');
    if (!empty($message)) {
        guiParagraph($session, $message, false);
    }
    guiStartForm($session);
    outTableAndRecord();
    outTableTextField($session, 'Bisheriger Name:', 'rename_oldname', null, 64, 64);
    outTableRecordDelim();
    outTableTextField($session, 'Neuer Name:', 'rename_newname', null, 64, 64);
    outTableRecordDelim();
    outTableCell(' ');
    outTableDelim();
    outButton($session, 'rename_info', 'Info');
    if (!empty($_POST['rename_oldname']) && !empty($_POST['rename_newname'])) {
        echo ' | ';
        outButton($session, 'rename_rename', 'Umbenennen');
        outNewline();
        outCheckBox($session, 'rename_backlinks', 'Alle Verweise umbenennen', null);
    }
    outTableDelimAndRecordEnd();
    outTableEnd();
    guiFinishForm($session);
    if (!empty($_POST['rename_oldname']) && dbPageId($session, $_POST['rename_oldname']) > 0) {
        $row = dbFirstRecord($session, 'select page,text,createdby,createdat from ' . dbTable($session, T_Text) . ' where replacedby is null and text like ' . dbSqlString($session, '%' . $_POST['rename_oldname'] . '%'));
        if (!$row) {
            guiParagraph($session, '+++ keine Verweise gefunden', false);
        } else {
            outTableAndRecord(1);
            outTableCellStrong('Seite');
            outTableCellStrong('Typ');
            outTableCellStrong('von');
            outTableCellStrong('Letzte &Auml;nderung');
            outTableCellStrong('Fundstelle');
            outTableCellStrong('Seite');
            outTableRecordEnd();
            while ($row) {
                $pagerecord = dbGetRecordById($session, T_Page, $row[0], 'name,type');
                $text = findTextInLine($row[1], $_POST['rename_oldname'], 10, true);
                if (!empty($text)) {
                    outTableRecord();
                    outTableInternLink($session, null, encodeWikiName($session, $pagerecord[0]), $pagerecord[0], M_Base);
                    outTableCell($pagerecord[1]);
                    outTableCell($row[2]);
                    outTableCell(htmlentities($row[3]));
                    outTableCell($text);
                    outTableRecordEnd();
                }
                $row = dbNextRecord($session);
            }
            outTableEnd();
        }
    }
    admFinishBody($session);
}