minor touch-ups, manage pages now use the same HTML as board pages

This commit is contained in:
Trevor Slocum 2009-09-22 14:29:27 -07:00
parent 096a7508a8
commit 01eb3589f2
3 changed files with 56 additions and 56 deletions

View File

@ -331,6 +331,9 @@ if (isset($_POST["message"]) || isset($_POST["file"])) {
session_destroy(); session_destroy();
die('--&gt; --&gt; --&gt;<meta http-equiv="refresh" content="0;url=' . $returnlink . '?manage">'); die('--&gt; --&gt; --&gt;<meta http-equiv="refresh" content="0;url=' . $returnlink . '?manage">');
} }
if ($text == '') {
$text = 'Thread count: ' . countThreads() . ' &middot; Ban count: ' . count(allBans());
}
} else { } else {
$onload = manageOnLoad('login'); $onload = manageOnLoad('login');
$text .= manageLogInForm(); $text .= manageLogInForm();

View File

@ -106,7 +106,7 @@ function nameAndTripcode($name) {
} }
function nameBlock($name, $tripcode, $email, $timestamp) { function nameBlock($name, $tripcode, $email, $timestamp) {
$output = ""; $output = '<span class="postername">';
if ($name == "" && $tripcode == "") { if ($name == "" && $tripcode == "") {
$output .= "Anonymous"; $output .= "Anonymous";
@ -118,11 +118,13 @@ function nameBlock($name, $tripcode, $email, $timestamp) {
$output .= '</span><span class="postertrip">!' . $tripcode; $output .= '</span><span class="postertrip">!' . $tripcode;
} }
$output .= '</span>';
if ($email != "") { if ($email != "") {
$output = '<a href="mailto:' . $email . '">' . $output . '</a>'; $output = '<a href="mailto:' . $email . '">' . $output . '</a>';
} }
return '<span class="postername">' . $output . '</span> ' . date('y/m/d(D)H:i:s', $timestamp); return $output . ' ' . date('y/m/d(D)H:i:s', $timestamp);
} }
function writePage($filename, $contents) { function writePage($filename, $contents) {

View File

@ -1,6 +1,36 @@
<?php <?php
if (!isset($tinyib)) { die(''); } if (!isset($tinyib)) { die(''); }
function pageHeader() {
global $tinyib;
return <<<EOF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>
${tinyib['boarddescription']}
</title>
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="css/global.css">
<link rel="stylesheet" type="text/css" href="css/futaba.css" title="Futaba">
<link rel="alternate stylesheet" type="text/css" href="css/burichan.css" title="Burichan">
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
EOF;
}
function pageFooter() {
return <<<EOF
<div class="footer">
- <a href="http://www.2chan.net" target="_top">futaba</a> + <a href="http://www.1chan.net" target="_top">futallaby</a> + <a href="http://tj9991.github.com/TinyIB/" target="_top">tinyib</a> -
</div>
</body>
</html>
EOF;
}
function buildPost($post, $isrespage) { function buildPost($post, $isrespage) {
$return = ""; $return = "";
$threadid = ($post['parent'] == 0) ? $post['id'] : $post['parent']; $threadid = ($post['parent'] == 0) ? $post['id'] : $post['parent'];
@ -130,20 +160,7 @@ EOF;
$unique_posts_html = "<li>Currently $unique_posts unique user posts.</li>"; $unique_posts_html = "<li>Currently $unique_posts unique user posts.</li>";
} }
return <<<EOF $body = <<<EOF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>
${tinyib['boarddescription']}
</title>
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="css/global.css">
<link rel="stylesheet" type="text/css" href="css/futaba.css" title="Futaba">
<link rel="alternate stylesheet" type="text/css" href="css/burichan.css" title="Burichan">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body> <body>
<div class="adminbar"> <div class="adminbar">
[<a href="$managelink">Manage</a>] [<a href="$managelink">Manage</a>]
@ -211,7 +228,7 @@ EOF;
</tr> </tr>
<tr> <tr>
<td colspan="2" class="rules"> <td colspan="2" class="rules">
<ul style="margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0;"> <ul>
<li>Supported file types are: GIF, JPG, PNG</li> <li>Supported file types are: GIF, JPG, PNG</li>
<li>Maximum file size allowed is 2 MB.</li> <li>Maximum file size allowed is 2 MB.</li>
<li>Images greater than 250x250 pixels will be thumbnailed.</li> <li>Images greater than 250x250 pixels will be thumbnailed.</li>
@ -239,12 +256,8 @@ EOF;
</form> </form>
$pagenavigator $pagenavigator
<br> <br>
<div class="footer" style="clear: both;">
- <a href="http://www.2chan.net" target="_top">futaba</a> + <a href="http://www.1chan.net" target="_top">futallaby</a> + <a href="http://tj9991.github.com/TinyIB/" target="_top">tinyib</a> -
</div>
</body>
</html>
EOF; EOF;
return pageHeader() . $body . pageFooter();
} }
function rebuildIndexes() { function rebuildIndexes() {
@ -305,38 +318,25 @@ function rebuildThread($id) {
writePage("res/" . $id . ".html", fixLinksInRes(buildPage($htmlposts, $id))); writePage("res/" . $id . ".html", fixLinksInRes(buildPage($htmlposts, $id)));
} }
function manageNavBar() { function adminBar() {
global $loggedin, $isadmin; global $loggedin, $isadmin, $returnlink;
if (!$loggedin) { return ''; } if (!$loggedin) { return '[<a href="' . $returnlink . '">Return</a>]'; }
$text = ''; $text = '[';
$text .= ($isadmin) ? '<a href="?manage&bans">bans</a> &middot; ' : ''; $text .= ($isadmin) ? '<a href="?manage&bans">Bans</a>] [' : '';
$text .= '<a href="?manage&moderate">moderate post</a> &middot; '; $text .= '<a href="?manage&moderate">Moderate Post</a>] [';
$text .= ($isadmin) ? '<a href="?manage&rebuildall">rebuild all</a> &middot; ' : ''; $text .= ($isadmin) ? '<a href="?manage&rebuildall">Rebuild All</a>] [' : '';
$text .= '<a href="?manage&logout">log out</a>'; $text .= '<a href="?manage&logout">Log Out</a>] [<a href="' . $returnlink . '">Return</a>]';
return $text; return $text;
} }
function managePage($text, $onload='') { function managePage($text, $onload='') {
global $tinyib, $returnlink; global $tinyib;
$navbar = manageNavBar(); $adminbar = adminBar();
return <<<EOF $body = <<<EOF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>
${tinyib['boarddescription']}
</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="css/global.css">
<link rel="stylesheet" type="text/css" href="css/futaba.css" title="Futaba">
<link rel="alternate stylesheet" type="text/css" href="css/burichan.css" title="Burichan">
</head>
<body$onload> <body$onload>
<div class="adminbar"> <div class="adminbar">
[<a href="$returnlink">Return</a>] $adminbar
</div> </div>
<div class="logo"> <div class="logo">
${tinyib['logo']} ${tinyib['logo']}
@ -344,15 +344,10 @@ function managePage($text, $onload='') {
</div> </div>
<hr width="90%" size="1"> <hr width="90%" size="1">
<div class="replymode">Manage mode</div> <div class="replymode">Manage mode</div>
<div style="text-align: center;font-size: small;">$navbar</div>
$text $text
<hr> <hr>
<div class="footer" style="clear: both;">
- <a href="http://www.2chan.net" target="_top">futaba</a> + <a href="http://www.1chan.net" target="_top">futallaby</a> + <a href="http://tj9991.github.com/TinyIB/" target="_top">tinyib</a> -
</div>
</body>
</html>
EOF; EOF;
return pageHeader() . $body . pageFooter();
} }
function manageOnLoad($page) { function manageOnLoad($page) {
@ -371,7 +366,7 @@ function manageLogInForm() {
<form id="tinyib" name="tinyib" method="post" action="?manage"> <form id="tinyib" name="tinyib" method="post" action="?manage">
<fieldset> <fieldset>
<legend align="center">Please enter an administrator or moderator password</legend> <legend align="center">Please enter an administrator or moderator password</legend>
<div style="text-align: center;"> <div class="login">
<input type="password" id="password" name="password"><br> <input type="password" id="password" name="password"><br>
<input type="submit" value="Submit" class="managebutton"> <input type="submit" value="Submit" class="managebutton">
</div> </div>
@ -433,7 +428,7 @@ function manageModeratePost($post) {
<fieldset> <fieldset>
<legend>Moderating post No.${post['id']}</legend> <legend>Moderating post No.${post['id']}</legend>
<div style="float: right;clear: both;"> <div class="floatpost">
<fieldset> <fieldset>
<legend>Post</legend> <legend>Post</legend>
$post_html $post_html