Example #1
0
function outTableAuthorLink(&$session, $author)
{
    echo TAG_TABLE_DELIM;
    guiAuthorLink($session, $author);
    echo TAG_TABLE_DELIM_END;
}
Example #2
0
function baseLastChanges(&$session)
{
    global $last_days;
    $headline = 'Übersicht über die letzten Änderungen';
    guiStandardHeader($session, $headline, Th_StandardHeader, Th_StandardBodyStart);
    if (!isset($last_days) || $last_days < 1) {
        $last_days = 7;
    }
    guiStartForm($session);
    echo '<p>Zeitraum: die letzten ';
    guiTextField('last_days', $last_days, 3, 4);
    echo ' Tage ';
    guiButton('last_refresh', 'Aktualisieren');
    echo '</p>' . "\n";
    echo '<table border="0">' . "\n";
    for ($day = 0; $day <= $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) {
            echo '<tr><td><b>';
            echo $time_0;
            echo '</b></td></tr>' . "\n";
            do {
                echo '<tr><td>';
                echo dbSingleValue($session, 'select min(id) from ' . dbTable($session, T_Text) . ' where page=' . $rec[5]) == $rec[0] ? 'Neu' : 'Änderung';
                echo '</td><td>';
                echo $rec[0];
                echo '</td><td>';
                echo guiInternLink($session, $rec[1], $rec[1]);
                echo '</td><td>';
                guiAuthorLink($session, $rec[2]);
                echo '</td><td>';
                echo dbSqlDateToText($session, $rec[3]);
                $pred_rec = dbSingleValue($session, 'select max(id) from ' . dbTable($session, T_Text) . ' where page=' . $rec[5] . ' and createdat<' . dbSqlDateTime($session, $time_2));
                if ($pred_rec > 0) {
                    echo '</td><td>';
                    guiInternLink($session, $rec[5] . '?action=' . A_Diff . '&text_id=' . $rec[0] . '&text_id2=' . $pred_rec, 'Unterschied zum Vortag (' . $pred_rec . ')');
                }
                echo '</td></tr>' . "\n";
            } while (($rec = dbNextRecord($session)) != null);
        }
        /*		if (false){
        		$ids = dbIdList2 ($session, T_Text, 'distinct page', $condition);
        		if ($ids) {
        			echo '<tr><td><b>';
        			echo $time_0;
        			echo'</b></td></tr>' . "\n";
        			foreach ($ids as $ii => $pageid) {
        				$page = dbGetRecordById ($session, T_Page, $pageid, 'name');
        				$text = dbFirstRecord ($session,
        					'select id,createdby,createdat,replacedby from '
        				. dbTable ($session, T_Text) . ' where page=' . (0 + $pageid)
        				. ' and ' . $condition . ' order by id desc');
        				$count = 0;
        				while ($text) {
        					$pred_text = dbSingleValue ($session, 'select max(id) from '
        						. dbTable ($session, T_Text) . ' where page=' . $pageid
        						. ' and createdat<'
        						. dbSqlDateTime ($session, $time_2));
        					echo '<tr><td>';
        					echo dbSingleValue ($session, 'select min(id) from '
        						. dbTable ($session, T_Text) . ' where page=' . $pageid)
        						== $text [0] ? 'Neu' : 'Änderung';
        					echo '</td><td>';
        					echo $text [0];
        					echo '</td><td>';
        					echo $count++ > 0 ? htmlentities ($page [0])
        						: guiInternLink ($session, $page [0], $page [0]);
        					echo '</td><td>';
        					guiAuthorLink ($session, $text [1]);
        					echo '</td><td>';
        					echo dbSqlDateToText ($session, $text [2]);
        					if ($pred_text > 0) {
        						echo '</td><td>';
        						guiInternLink ($session, $page [0] . '?action=' . A_Diff
        							. '&text_id=' . $pred_text . '&text_id2=' . $text [0],
        							'Unterschied zum Vortag (' . $pred_text . ')');
        					}
        					echo '</td></tr>' . "\n";
        					$text = dbNextRecord ($session);
        				}
        			}
        		}
        		} */
    }
    echo '</table>';
    guiStandardBodyEnd($session, Th_StandardBodyEnd);
}