<?php require_once "admin-mode.php"; require_once "document.php"; if (!is_admin_mode()) { header("Location: /"); exit; } $document = new Document(); $document->SetTitle("Admin: Viimased kommentaarid"); $document->AddMainMenu(); $document->AddSubMenu(); function commentToHtml($comment) { $date = datetime_to_est($comment['datetime'], true); if (strlen($comment['homepage']) > 0) { $name = "<a href=\"{$comment['homepage']}\" title=\"kommenteerija koduleht\">{$comment['name']}</a>"; } else { $name = $comment['name']; } return <<<EOHTML <div id="kommentaar_{$comment['id']}"> {$comment['text']} <p class="autor"> Teema: {$comment['article']}<br /> {$date} {$name} ({$comment['email']}).<br /> <b><a href="?delete={$comment['id']}">Kustuta</a></b> </p> </div> EOHTML; }
<?php require_once "mysqlconnect.php"; require_once "document.php"; require_once "urlvars.php"; $document = new Document(); $document->SetTitle("Arhiiv"); $document->AddMainMenu("Arhiiv"); $document->AddSubMenu(); $chapter = "<h1>Arhiiv</h1>\n"; $query = "SELECT * FROM archive WHERE category<>'Luuletused' AND category<>'Laulud' AND `order`=0 ORDER BY category, date DESC, name"; $result = mysql_query($query); while ($doc = mysql_fetch_array($result)) { if ($doc['category'] != $old_category) { if (strlen($old_category) != 0) { $chapter .= "</ul>\n"; } $chapter .= "<h2>{$doc['category']}</h2>\n"; $chapter .= "<ul>\n"; $old_category = $doc['category']; } $address = '/' . str_replace('-', '/', $doc['date']) . '/' . UrlVars::real2url($doc['name']); if ($doc['type'] == 'normal') { $class = ''; } elseif ($doc['type'] == 'standalone') { $class = ' class="standalone"'; } elseif ($doc['type'] == 'text/css') { $class = ' class="css"'; } else { $class = ' class="file"'; }
<?php require_once "mysqlconnect.php"; require_once "document.php"; $document = new Document(); $document->SetTitle("Kontakt"); $document->AddMainMenu("Kontakt"); $document->AddSubMenu(); $chapter = <<<EOHTML <h1>Kontakt</h1> <div class="pilt"> <img src="/archive/mina.jpg" alt="Minu pilt" /> <p>Mina, oma eduka sportlaskarjääri tipphetkel?</p> </div> <p>No põhimõtteliselt, kui keegi väga soovib, siis võib ta ju mulle kirjutada ja joonistada. Aadress on igatahes nüüd välja jagatud ja saab näha, kas sünnib sellest halba/head. Ega must mingit head kirjasõpra vast ei tule, nii et parem ärge selles suunas kohe proovima hakakegi.</p> <p>Aga kui on midagi seoses sellesama Trinoloogialehega või triinudega, siis see on kõik päris kindlasti alati teretulnud.</p> <p>Seda pilti siin tuleb ühtlasi võtta kui hoiatust, et te ei kipuks kuidagi pimesi minuga kohtuma, ja et te päris selgesti näeksite, et mina ei kuulu triinude hulka.</p> <p>Olge tublid!</p>
<?php require_once "mysqlconnect.php"; require_once "document.php"; $document = new Document(); $document->SetTitle("Looming"); $document->AddMainMenu("Looming"); $document->AddSubMenu(); $chapter = "<h1>Looming</h1>\n"; $query = "SELECT * FROM archive WHERE category='Luuletused' OR category='Laulud' AND `order`=0 ORDER BY category, date DESC, name"; $result = mysql_query($query); while ($doc = mysql_fetch_array($result)) { if ($doc['category'] != $old_category) { if (strlen($old_category) != 0) { $chapter .= "</ul>\n"; } $chapter .= "<h2>{$doc['category']}</h2>\n"; $chapter .= "<ul>\n"; $old_category = $doc['category']; } $address = '/' . str_replace('-', '/', $doc['date']) . '/' . UrlVars::real2url($doc['name']); if ($doc['type'] == 'normal') { $class = ''; } elseif ($doc['type'] == 'standalone') { $class = ' class="standalone"'; } elseif ($doc['type'] == 'text/css') { $class = ' class="css"'; } else { $class = ' class="file"'; } $chapter .= "<li{$class}><a href=\"{$address}\">{$doc['name']}</a></li>\n";
<?php require_once "mysqlconnect.php"; require_once "document.php"; $document = new Document(); $document->SetTitle("Trinoloogialeht"); $document->AddMainMenu("Hiljutine"); $document->AddSubMenu(); $query = "SELECT * FROM archive WHERE type='normal' ORDER BY date DESC LIMIT 3"; $result = mysql_query($query); while ($doc = mysql_fetch_array($result)) { $query = "SELECT COUNT(*) FROM comments WHERE articleid='{$doc['id']}'"; $result2 = mysql_query($query); $com = mysql_fetch_array($result2); $url = '/' . str_replace('-', '/', $doc['date']) . '/' . UrlVars::real2url($doc['name']); if ($doc['comments'] == 'Y') { $url .= '#kommentaarid'; } $document->AddArchive($doc['address'], $com[0], $url, $doc['comments']); } $document->Out();