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);
}
Example #2
0
function admImportPages(&$session, $message)
{
    $session->trace(TC_Gui1, 'admImportPages');
    admStandardHeader($session, 'Seitenimport');
    if (!empty($message)) {
        guiParagraph($session, $message, false);
    }
    guiUploadFile($session, 'Importdatei:', 'import_upload', 1000000);
    $dir_name = $session->fullPath("import") . PATH_DELIM;
    guiHeadline($session, 3, "Importverzeichnis auf dem Server: " . $dir_name);
    guiStartForm($session);
    outParagraph($session);
    outCheckBox($session, 'import_replace', 'Historie löschen', null, false);
    outParagraphEnd($session);
    admShowDir($session, $dir_name, '', '/[.]wiki$/', 'Importieren', 'import_import', 'import_file', false);
    guiFinishForm($session);
    admFinishBody($session);
}