diff --git a/imgboard.php b/imgboard.php index e3413f3..d97c10b 100644 --- a/imgboard.php +++ b/imgboard.php @@ -331,6 +331,9 @@ if (isset($_POST["message"]) || isset($_POST["file"])) { session_destroy(); die('--> --> -->'); } + if ($text == '') { + $text = 'Thread count: ' . countThreads() . ' · Ban count: ' . count(allBans()); + } } else { $onload = manageOnLoad('login'); $text .= manageLogInForm(); diff --git a/inc/functions.php b/inc/functions.php index 42497f3..2d79f40 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -106,7 +106,7 @@ function nameAndTripcode($name) { } function nameBlock($name, $tripcode, $email, $timestamp) { - $output = ""; + $output = ''; if ($name == "" && $tripcode == "") { $output .= "Anonymous"; @@ -118,11 +118,13 @@ function nameBlock($name, $tripcode, $email, $timestamp) { $output .= '!' . $tripcode; } + $output .= ''; + if ($email != "") { $output = '' . $output . ''; } - - return '' . $output . ' ' . date('y/m/d(D)H:i:s', $timestamp); + + return $output . ' ' . date('y/m/d(D)H:i:s', $timestamp); } function writePage($filename, $contents) { diff --git a/inc/html.php b/inc/html.php index cb0eca6..b7c4c95 100644 --- a/inc/html.php +++ b/inc/html.php @@ -1,6 +1,36 @@ + + + + ${tinyib['boarddescription']} + + + + + + + + + +EOF; +} + +function pageFooter() { + return << + - futaba + futallaby + tinyib - + + + +EOF; +} + function buildPost($post, $isrespage) { $return = ""; $threadid = ($post['parent'] == 0) ? $post['id'] : $post['parent']; @@ -130,20 +160,7 @@ EOF; $unique_posts_html = "
  • Currently $unique_posts unique user posts.
  • "; } - return << - - - - ${tinyib['boarddescription']} - - - - - - - - + $body = <<
    [Manage] @@ -211,7 +228,7 @@ EOF; -
      +
      • Supported file types are: GIF, JPG, PNG
      • Maximum file size allowed is 2 MB.
      • Images greater than 250x250 pixels will be thumbnailed.
      • @@ -239,12 +256,8 @@ EOF; $pagenavigator
        - - - EOF; + return pageHeader() . $body . pageFooter(); } function rebuildIndexes() { @@ -305,38 +318,25 @@ function rebuildThread($id) { writePage("res/" . $id . ".html", fixLinksInRes(buildPage($htmlposts, $id))); } -function manageNavBar() { - global $loggedin, $isadmin; - if (!$loggedin) { return ''; } - $text = ''; - $text .= ($isadmin) ? 'bans · ' : ''; - $text .= 'moderate post · '; - $text .= ($isadmin) ? 'rebuild all · ' : ''; - $text .= 'log out'; +function adminBar() { + global $loggedin, $isadmin, $returnlink; + if (!$loggedin) { return '[Return]'; } + $text = '['; + $text .= ($isadmin) ? 'Bans] [' : ''; + $text .= 'Moderate Post] ['; + $text .= ($isadmin) ? 'Rebuild All] [' : ''; + $text .= 'Log Out] [Return]'; return $text; } function managePage($text, $onload='') { - global $tinyib, $returnlink; + global $tinyib; - $navbar = manageNavBar(); - return << - - - - ${tinyib['boarddescription']} - - - - - - - - + $adminbar = adminBar(); + $body = <<
        - [Return] + $adminbar

        Manage mode
        -
        $navbar
        $text
        - - - EOF; + return pageHeader() . $body . pageFooter(); } function manageOnLoad($page) { @@ -371,7 +366,7 @@ function manageLogInForm() {
        Please enter an administrator or moderator password -
        + @@ -433,7 +428,7 @@ function manageModeratePost($post) {
        Moderating post No.${post['id']} -
        +
        Post $post_html