function setPageData($name, $date, $by) { $this->fPageName = $name; $this->fPageChangedAt = dbSqlDateToText($this, $date); $this->fPageChangedBy = $by; }
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 baseThread(&$session) { global $thread_id, $posting_id, $page_no; $session->trace(TC_Gui1, 'baseThread'); if (empty($thread_id)) { if (empty($posting_id)) { $thread_id = 1; } else { $thread_id = dbSingleValue($session, 'select top from ' . dbTable($session, T_Posting) . " where id={$posting_id}"); if (empty($thread_id)) { $thread_id = $posting_id; } } } if (!isset($page_no)) { $page_no = isset($posting_id) ? dbPageOfPosting($session, $thread_id, $posting_id) : 1; } $id_list = dbIdListOfThreadPage($session, $thread_id, $page_no); $thread = dbGetRecordById($session, T_Posting, $thread_id, 'author,subject,text,createdat,changedby,changedat,calls,forum'); dbThreadInfo($session, $thread_id, $answers, $pages, $last); $thread_date = dbSqlDateToText($session, $thread[3]); $forum = dbGetRecordById($session, T_Forum, $thread[7], 'name'); guiStandardHeader($session, 'Thema: ' . $thread[1], Th_ThreadHeader, Th_ThreadBodyStart); guiParagraph($session, $thread[0] . ', ' . $thread_date . ', ' . (0 + $answers) . ' Antwort' . ($answers == 1 ? ', ' : 'en, ') . $pages . ' Seite' . ($pages == 1 ? '' : 'n'), true); echo '<table width="100%" border="0"><tr><td>'; echo 'Forum: '; guiInternLink($session, P_Forum . '?forum_id=' . $thread[7], $forum[0]); if ($pages > 1) { echo '</td><td style="text-align: right">'; guiPageLinks($session, P_Thread . '?action=' . A_ShowThread . '&thread_id=' . $thread_id, $page_no, $pages); } echo "</td></tr></table>\n"; dbUpdateRaw($session, T_Posting, $thread_id, 'calls=calls+1'); echo '<table width="100%" border="0">' . "\n"; // Autor Thema-Text foreach ($id_list as $ii => $id) { # echo "alle Postings: $ii / $id<br>"; if ($id == $thread_id) { $posting = $thread; } else { $posting = dbGetRecordById($session, T_Posting, $id, 'author,subject,text,createdat,changedby,changedat'); } dbGetAuthorInfo($session, $posting[0], $author_link, $postings, $avatar, $ranking); echo '<tr><td style="vertical-align:top">'; guiLine(1); echo $thread[0] . '<br/>' . ($postings + 0) . ' Beiträge<br/>' . $ranking; if (!empty($avatar)) { echo '<br/>' . $avatar; } echo '</td><td>'; guiLine(1); if ($id == $thread_id) { guiHeadline($session, 3, 'Thema: ' . $posting[1]); } else { guiHeadline($session, 3, 'Antwort ' . ($ii + $session->fUserPostingsPerPage * ($page_no - 1)) . ': ' . $posting[1]); } echo 'Geschrieben am ' . dbSqlDateToText($session, $posting[3]); if (strcmp($posting[5], $posting[3]) != 0) { echo ' Letzte Änderung: ' . dbSqlDateToText($session, $posting[5]); if (!empty($posting[4]) && strcmp($posting[4], $posting[0]) != 0) { echo ' von ' . $posting[5]; } } echo '<br/>'; wikiToHTML($session, $posting[2]); echo '<p>'; guiInternLink($session, P_Thread . '?action=' . A_Answer . "&thread_id={$thread_id}&reference_id={$id}", 'Antworten'); if (strcmp($posting[0], $session->fUserName) == 0) { echo ' '; guiInternLink($session, P_Thread . '?action=' . A_ChangeThread . "&thread_id={$thread_id}&posting_id={$id}", 'Ändern'); echo "</p>\n"; } echo "</td><tr>\n"; } echo "</table>\n"; guiStandardBodyEnd($session, Th_ThreadBodyEnd); }
function setPageData($name, $date, $by) { $this->getMacro(TM_PageName, $name); if ($date != null) { $this->setMacro(TM_PageChangedAt, dbSqlDateToText($this, $date)); $this->setMacro(TM_PageChangedBy, $by); } }
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); }