/**
     * turns the Page into HTML
     */
    public function display_page(Page $page)
    {
        global $config;
        $theme_name = $config->get_string('theme', 'default');
        $data_href = get_base_href();
        $contact_link = $config->get_string('contact_link');
        $header_html = "";
        ksort($page->headers);
        foreach ($page->headers as $line) {
            $header_html .= "\t\t{$line}\n";
        }
        $left_block_html = "";
        $main_block_html = "";
        $sub_block_html = "";
        foreach ($page->blocks as $block) {
            switch ($block->section) {
                case "left":
                    $left_block_html .= $this->block_to_html($block, true, "left");
                    break;
                case "main":
                    $main_block_html .= $this->block_to_html($block, false, "main");
                    break;
                case "subheading":
                    $sub_block_html .= $this->block_to_html($block, false, "main");
                    break;
                default:
                    print "<p>error: {$block->header} using an unknown section ({$block->section})";
                    break;
            }
        }
        $debug = get_debug_info();
        $contact = empty($contact_link) ? "" : "<br><a href='{$contact_link}'>Contact</a>";
        $wrapper = "";
        if (strlen($page->heading) > 100) {
            $wrapper = ' style="height: 3em; overflow: auto;"';
        }
        print <<<EOD
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
\t<head>
\t\t<title>{$page->title}</title>
\t\t<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
\t\t<link rel="stylesheet" href="{$data_href}/themes/{$theme_name}/style.css" type="text/css">
{$header_html}
\t</head>

\t<body>
\t\t<h1{$wrapper}>{$page->heading}</h1>

\t\t{$sub_block_html}

\t\t<div id="nav">{$left_block_html}</div>
\t\t<div id="body">{$main_block_html}</div>

\t\t<div id="footer">
\t\t\tImages &copy; their respective owners,
\t\t\t<a href="http://code.shishnet.org/shimmie2/">Shimmie</a> &copy;
\t\t\t<a href="http://www.shishnet.org/">Shish</a> &amp; Co 2007-2010,
\t\t\tbased on the Danbooru concept.
\t\t\t{$debug}
\t\t\t{$contact}
\t\t</div>
\t</body>
</html>
EOD;
    }
Beispiel #2
0
    /**
     * turns the Page into HTML
     */
    public function display_page(Page $page)
    {
        global $config;
        $theme_name = $config->get_string('theme', 'material');
        $site_name = $config->get_string('title');
        $data_href = get_base_href();
        $main_page = $config->get_string('main_page');
        $contact_link = $config->get_string('contact_link');
        $site_link = make_link();
        $header_html = "";
        ksort($page->html_headers);
        foreach ($page->html_headers as $line) {
            $header_html .= "\t\t{$line}\n";
        }
        $left_block_html = "";
        $main_block_html = "";
        $head_block_html = "";
        $sub_block_html = "";
        $drawer_block_html = "";
        //use exampled in user.theme.php & view.theme.php
        $toolbar_block_html = "";
        // not used at this point
        $subtoolbar_block_html = "";
        // use exampled in user.theme.php
        $navigation = "";
        $h_search = "\n      <div class='mdl-textfield mdl-js-textfield mdl-textfield--expandable\n                  mdl-textfield--floating-label mdl-textfield--align-right'>\n        <form action='" . make_link() . "' method='GET'>\n          <label class='mdl-button mdl-js-button mdl-button--icon'\n                 for='waterfall-exp'>\n            <i class='material-icons'>search</i>\n          </label>\n          <div class='mdl-textfield__expandable-holder'>\n            <input id='waterfall-exp' class='autocomplete_tags mdl-textfield__input' name='search' type='text' placeholder='Search' value='' />\n            <input type='hidden' name='q' value='/post/list'>\n            <input type='submit' value='Find' style='display: none;' />\n          </div>\n        </form>\n      </div>\n    ";
        foreach ($page->blocks as $block) {
            switch ($block->section) {
                case "toolbar":
                    $toolbar_block_html .= $this->get_html($block, "toolbar");
                    break;
                case "subtoolbar":
                    $subtoolbar_block_html .= $this->get_html($block, "subtoolbar");
                    break;
                case "left":
                    if ($block->header == "Navigation") {
                        $subtoolbar_block_html = $this->rework_navigation($block);
                        break;
                    }
                    // $left_block_html .= $block->get_html(true);
                    $left_block_html .= $this->get_html($block, "full", true, "left-blocks nav-card mdl-cell--4-col-tablet");
                    break;
                case "head":
                    $head_block_html .= $this->get_html($block, "third", true, "nav-card head-blocks");
                    break;
                case "drawer":
                    $drawer_block_html .= $this->get_html($block, "full", true, "nav-card drawer-blocks");
                    break;
                case "main":
                    // $main_block_html .= $block->get_html(false);
                    $main_block_html .= $this->get_html($block, "main", true, "");
                    break;
                case "subheading":
                    // $sub_block_html .= $block->body; // $this->block_to_html($block, true);
                    $sub_block_html .= $this->get_html($block, "third", true, "nav-card");
                    break;
                default:
                    print "<p>error: {$block->header} using an unknown section ({$block->section})";
                    break;
            }
        }
        $debug = get_debug_info();
        $contact = empty($contact_link) ? "" : "<br><a href='mailto:{$contact_link}'>Contact</a>";
        /*$subheading = empty($page->subheading) ? "" : "<div id='subtitle'>{$page->subheading}</div>";
        
        		$wrapper = "";
        		if(strlen($page->heading) > 100) {
        			$wrapper = ' style="height: 3em; overflow: auto;"';
        		}
        		*/
        $flash = get_prefixed_cookie("flash_message");
        $flash_html = "";
        if ($flash) {
            $flash_html = "<b id='flash'>" . nl2br(html_escape($flash)) . " <a href='#' onclick=\"\$('#flash').hide(); return false;\">[X]</a></b>";
            set_prefixed_cookie("flash_message", "", -1, "/");
        }
        print <<<EOD
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
\t<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
\t\t<title>{$page->title}</title>
    <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:regular,bold,italic,thin,light,bolditalic,black,medium&amp;lang=en">
    <link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons"  rel="stylesheet">
    <link rel="stylesheet" href="{$data_href}/themes/{$theme_name}/material.min.css?v1.0.5"  rel="stylesheet">
    {$header_html}
\t\t<script type="text/javascript" src="{$data_href}/themes/{$theme_name}/material.min.js?v1.0.5"></script>
\t\t<script type="text/javascript" src="{$data_href}/themes/{$theme_name}/script0.js?v1"></script>
    <!-- having conflicts this ensures the screens will not remain hidden \\while the layout is adjusted -->
\t</head>

\t<body>

    <div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
      <header class="mdl-layout__header mdl-layout__header--waterfall">
        <!-- Top row, always visible -->
        <div class="mdl-layout__header-row ">
          <!-- Title -->
          <span class="mdl-layout-title">
            <a class="mdl-logo" href="{$site_link}">{$site_name}</a>
          </span>
          <div class="mdl-layout-spacer"></div>
          {$h_search}
          {$toolbar_block_html}
          <button id="menu-left-col-menu"
                  class="mdl-button mdl-js-button mdl-button--icon">
            <i class="material-icons">more_vert</i>
          </button>
        </div>
        <!-- Bottom row, not visible on scroll -->
        <div class="mdl-layout__header-row">
          <div class="mdl-layout-spacer"></div>
          <!-- Navigation -->
          {$subtoolbar_block_html}
        </div>
      </header>
      <div class="mdl-layout__drawer">
        <span class="mdl-layout-title">Drawer</span>
          <div class="mdl-grid">
            {$drawer_block_html}
          </div>
        <nav class="mdl-navigation">
          <a class="mdl-navigation__link" href="http://code.shishnet.org/shimmie2/">Shimmie  &copy;</a>
        </nav>
      </div>
      <main class="mdl-layout__content">
        <div class="mdl-grid">
          <div class="mdl-cell mdl-cell--12-col mdl-grid ">
            {$head_block_html}
            {$sub_block_html}
          </div>
        </div>
        <div id="main-grid" class="mdl-grid">
          <div id="left-block" class="mdl-cell mdl-cell--4-col mdl-cell--8-col-tablet mdl-cell--4-col-phone mdl-color--grey-200">
            <script>
              document.getElementById("left-block").style.display="none";
            </script>
            <div id="left-blk-content" class="mdl-cell mdl-cell--12-col mdl-grid">
              <!-- Start Left Block -->
              {$left_block_html}
            </div>
          </div>
          <div id="main-block" class="mdl-cell mdl-shadow--2dp mdl-cell--8-col mdl-cell--8-col-tablet mdl-color--grey-200 mdl-grid">
              <script>
                document.getElementById("main-block").style.display="none";
              </script>
              <!-- Start art Block -->
              <article class="mdl-cell mdl-cell--12-col mdl-cell--top">
              {$flash_html}
              {$main_block_html}
              </article>
          </div>
        </div>
          <footer class="mdl-mini-footer">
              {$debug}
              {$contact}
          </footer>
      </main>
    </div>

    <ul class="mdl-menu mdl-menu--bottom-right mdl-js-menu mdl-js-ripple-effect"
        for="menu-left-col-menu">
      <li id="layout-top" class="mdl-menu__item">Layout Top</li>
      <li id="layout-right" class="mdl-menu__item">Layout Right</li>
      <li id="layout-bottom" class="mdl-menu__item">Layout Bottom</li>
      <li id="layout-left" class="mdl-menu__item">Layout Left</li>
    </ul>
\t</body>
</html>
EOD;
    }
    public function display_page($page)
    {
        global $config, $user;
        $theme_name = $config->get_string('theme');
        $base_href = $config->get_string('base_href');
        $data_href = get_base_href();
        $contact_link = $config->get_string('contact_link');
        $header_html = "";
        ksort($page->headers);
        foreach ($page->headers as $line) {
            $header_html .= "\t\t{$line}\n";
        }
        $left_block_html = "";
        $user_block_html = "";
        $main_block_html = "";
        $sub_block_html = "";
        foreach ($page->blocks as $block) {
            switch ($block->section) {
                case "left":
                    $left_block_html .= $this->block_to_html($block, true);
                    break;
                case "user":
                    $user_block_html .= $block->body;
                    // $this->block_to_html($block, true);
                    break;
                case "subheading":
                    $sub_block_html .= $block->body;
                    // $this->block_to_html($block, true);
                    break;
                case "main":
                    if ($block->header == "Images") {
                        $block->header = "&nbsp;";
                    }
                    $main_block_html .= $this->block_to_html($block, false);
                    break;
                default:
                    print "<p>error: {$block->header} using an unknown section ({$block->section})";
                    break;
            }
        }
        $debug = get_debug_info();
        $contact = empty($contact_link) ? "" : "<br><a href='{$contact_link}'>Contact</a>";
        if (empty($this->subheading)) {
            $subheading = "";
        } else {
            $subheading = "<div id='subtitle'>{$this->subheading}</div>";
        }
        $site_name = $config->get_string('title');
        // bzchan: change from normal default to get title for top of page
        $main_page = $config->get_string('main_page');
        // bzchan: change from normal default to get main page for top of page
        // bzchan: CUSTOM LINKS are prepared here, change these to whatever you like
        $custom_links = "";
        if ($user->is_anonymous()) {
            $custom_links .= $this->navlinks(make_link('user_admin/login'), "My Account", array("user", "user_admin", "setup", "admin"));
        } else {
            $custom_links .= $this->navlinks(make_link('user'), "My Account", array("user", "user_admin", "setup", "admin"));
        }
        $custom_links .= $this->navlinks(make_link('post/list'), "Posts", array("post"));
        $custom_links .= $this->navlinks(make_link('comment/list'), "Comments", array("comment"));
        $custom_links .= $this->navlinks(make_link('tags'), "Tags", array("tags"));
        if (class_exists("Pools")) {
            $custom_links .= $this->navlinks(make_link('pool/list'), "Pools", array("pool"));
        }
        $custom_links .= $this->navlinks(make_link('upload'), "Upload", array("upload"));
        if (class_exists("Wiki")) {
            $custom_links .= $this->navlinks(make_link('wiki'), "Wiki", array("wiki"));
            $custom_links .= $this->navlinks(make_link('wiki/more'), "More &raquo;", array("wiki/more"));
        }
        $custom_sublinks = "";
        // hack
        global $user;
        $username = url_escape($user->name);
        // hack
        $qp = _get_query_parts();
        $hw = class_exists("Wiki");
        // php sucks
        switch ($qp[0]) {
            default:
                $custom_sublinks .= $user_block_html;
                break;
            case "":
                # FIXME: this assumes that the front page is
                # post/list; in 99% of case it will either be
                # post/list or home, and in the latter case
                # the subnav links aren't shown, but it would
                # be nice to be correct
            # FIXME: this assumes that the front page is
            # post/list; in 99% of case it will either be
            # post/list or home, and in the latter case
            # the subnav links aren't shown, but it would
            # be nice to be correct
            case "post":
            case "upload":
                $custom_sublinks .= "<li><a href='" . make_link('post/list') . "'>All</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link("post/list/favorited_by={$username}/1") . "'>My Favorites</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link("ext_doc/index") . "'>Help</a></li>";
                break;
            case "comment":
                $custom_sublinks .= "<li><a href='" . make_link('comment/list') . "'>All</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link("ext_doc/comment") . "'>Help</a></li>";
                break;
            case "pool":
                $custom_sublinks .= "<li><a href='" . make_link('pool/list') . "'>List</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link("pool/new") . "'>Create</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link("pool/updated") . "'>Changes</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link("ext_doc/pools") . "'>Help</a></li>";
                break;
            case "wiki":
                $custom_sublinks .= "<li><a href='" . make_link('wiki') . "'>Index</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link("wiki/rules") . "'>Rules</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link("ext_doc/wiki") . "'>Help</a></li>";
                break;
            case "tags":
            case "alias":
                $custom_sublinks .= "<li><a href='" . make_link('tags/map') . "'>Map</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link('tags/alphabetic') . "'>Alphabetic</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link('tags/popularity') . "'>Popularity</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link('tags/categories') . "'>Categories</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link('alias/list') . "'>Aliases</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link("ext_doc/tag_edit") . "'>Help</a></li>";
                break;
        }
        // bzchan: failed attempt to add heading after title_link (failure was it looked bad)
        //if($this->heading==$site_name)$this->heading = '';
        //$title_link = "<h1><a href='".make_link($main_page)."'>$site_name</a>/$this->heading</h1>";
        // bzchan: prepare main title link
        $title_link = "<h1 id='site-title'><a href='" . make_link($main_page) . "'>{$site_name}</a></h1>";
        if ($page->left_enabled) {
            $left = "<div id='nav'>{$left_block_html}</div>";
            $withleft = "withleft";
        } else {
            $left = "";
            $withleft = "noleft";
        }
        print <<<EOD
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
\t<head>
\t\t<title>{$page->title}</title>
\t\t<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
\t\t<link rel="stylesheet" href="{$data_href}/themes/{$theme_name}/style.css" type="text/css">
{$header_html}
\t\t<script src='{$data_href}/themes/{$theme_name}/sidebar.js' type='text/javascript'></script>
\t\t<script src='{$data_href}/themes/{$theme_name}/script.js' type='text/javascript'></script>
\t</head>

\t<body>
\t\t<div id="header">
\t\t{$title_link}
\t\t<ul id="navbar" class="flat-list">
\t\t\t{$custom_links}
\t\t</ul>
\t\t<ul id="subnavbar" class="flat-list">
\t\t\t{$custom_sublinks}
\t\t</ul>
\t\t</div>
\t\t{$subheading}
\t\t{$sub_block_html}
\t\t
\t\t{$left}
\t\t<div id="body" class="{$withleft}">{$main_block_html}</div>

\t\t<div id="footer">
        <em>
\t\t\tImages &copy; their respective owners,
\t\t\t<a href="http://code.shishnet.org/shimmie2/">Shimmie</a> &copy;
\t\t\t<a href="http://www.shishnet.org/">Shish</a> &amp; Co 2007-2010,
\t\t\tbased on the Danbooru concept.
\t\t\t{$debug}
\t\t\t{$contact}
        </em>
\t\t</div>
\t</body>
</html>
EOD;
    }
<?php

include_once ICL_PLUGIN_PATH . '/inc/functions-debug-information.php';
$debug_info = get_debug_info();
$debug_data = $debug_info->run();
/* DEBUG ACTION */
/**
 * @param $term_object
 *
 * @return callable
 */
?>
<div class="wrap">
	<h1><?php 
echo __('Debug information', 'sitepress');
?>
</h1>
	<?php 
$message = filter_input(INPUT_GET, 'message', FILTER_SANITIZE_FULL_SPECIAL_CHARS, FILTER_NULL_ON_FAILURE);
if ($message) {
    ?>
		<div class="updated message fade"><p>
				<?php 
    echo esc_html($message);
    ?>
			</p></div>
	<?php 
}
?>
	<div id="poststuff">
		<div id="wpml-debug-info" class="postbox">
Beispiel #5
0
    function display_page(Page $page)
    {
        global $config;
        $theme_name = $config->get_string('theme', 'default');
        $data_href = get_base_href();
        $contact_link = $config->get_string('contact_link');
        $header_html = "";
        ksort($page->html_headers);
        foreach ($page->html_headers as $line) {
            $header_html .= "\t\t{$line}\n";
        }
        $left_block_html = "";
        $main_block_html = "";
        $sub_block_html = "";
        foreach ($page->blocks as $block) {
            switch ($block->section) {
                case "left":
                    $left_block_html .= $block->get_html(true);
                    break;
                case "main":
                    $main_block_html .= $block->get_html(false);
                    break;
                case "subheading":
                    $sub_block_html .= $block->body;
                    // $this->block_to_html($block, true);
                    break;
                default:
                    print "<p>error: {$block->header} using an unknown section ({$block->section})";
                    break;
            }
        }
        $debug = get_debug_info();
        $contact = empty($contact_link) ? "" : "<br><a href='mailto:{$contact_link}'>Contact</a>";
        if (empty($page->subheading)) {
            $subheading = "";
        } else {
            $subheading = "<div id='subtitle'>{$page->subheading}</div>";
        }
        if ($page->left_enabled) {
            $left = "<nav>{$left_block_html}</nav>";
            $withleft = "withleft";
        } else {
            $left = "";
            $withleft = "";
        }
        $flash = get_prefixed_cookie("flash_message");
        $flash_html = "";
        if ($flash) {
            $flash_html = "<b id='flash'>" . nl2br(html_escape($flash)) . " <a href='#' onclick=\"\$('#flash').hide(); return false;\">[X]</a></b>";
            set_prefixed_cookie("flash_message", "", -1, "/");
        }
        print <<<EOD
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
\t<head>
\t\t<title>{$page->title}</title>
{$header_html}
\t\t<script src='{$data_href}/themes/{$theme_name}/script.js' type='text/javascript'></script>
\t</head>

\t<body>
\t\t<header>
\t\t\t<h1>{$page->heading}</h1>
\t\t\t{$subheading}
\t\t\t{$sub_block_html}
\t\t</header>
\t\t{$left}
\t\t<article class="{$withleft}">
\t\t\t{$flash_html}
\t\t\t{$main_block_html}
\t\t</article>
\t\t<footer>
\t\t\t<hr>
\t\t\tImages &copy; their respective owners,
\t\t\t<a href="http://code.shishnet.org/shimmie2/">Shimmie</a> &copy;
\t\t\t<a href="http://www.shishnet.org/">Shish</a> &amp;
\t\t\t<a href="https://github.com/shish/shimmie2/graphs/contributors">The Team</a>
\t\t\t2007-2014,
\t\t\tbased on the Danbooru concept.
\t\t\t<br>Futaba theme based on 4chan's layout and CSS :3
\t\t\t{$debug}
\t\t\t{$contact}
\t\t</footer>
\t</body>
</html>
EOD;
    }
    public function display_page($page)
    {
        global $config, $user;
        $theme_name = $config->get_string('theme');
        //$base_href = $config->get_string('base_href');
        $data_href = get_base_href();
        $contact_link = $config->get_string('contact_link');
        $header_html = "";
        ksort($page->html_headers);
        foreach ($page->html_headers as $line) {
            $header_html .= "\t\t{$line}\n";
        }
        $left_block_html = "";
        $user_block_html = "";
        $main_block_html = "";
        $sub_block_html = "";
        foreach ($page->blocks as $block) {
            switch ($block->section) {
                case "left":
                    $left_block_html .= $block->get_html(true);
                    break;
                case "user":
                    $user_block_html .= $block->body;
                    // $this->block_to_html($block, true);
                    break;
                case "subheading":
                    $sub_block_html .= $block->body;
                    // $this->block_to_html($block, true);
                    break;
                case "main":
                    if ($block->header == "Images") {
                        $block->header = "&nbsp;";
                    }
                    $main_block_html .= $block->get_html(false);
                    break;
                default:
                    print "<p>error: {$block->header} using an unknown section ({$block->section})";
                    break;
            }
        }
        $debug = get_debug_info();
        $contact = empty($contact_link) ? "" : "<br><a href='mailto:{$contact_link}'>Contact</a>";
        if (empty($this->subheading)) {
            $subheading = "";
        } else {
            $subheading = "<div id='subtitle'>{$this->subheading}</div>";
        }
        $site_name = $config->get_string('title');
        // bzchan: change from normal default to get title for top of page
        $main_page = $config->get_string('main_page');
        // bzchan: change from normal default to get main page for top of page
        // bzchan: CUSTOM LINKS are prepared here, change these to whatever you like
        $custom_links = "";
        if ($user->is_anonymous()) {
            $custom_links .= $this->navlinks(make_link('user_admin/login'), "My Account", array("user", "user_admin", "setup", "admin"));
        } else {
            $custom_links .= $this->navlinks(make_link('user'), "My Account", array("user", "user_admin", "setup", "admin"));
        }
        $custom_links .= $this->navlinks(make_link('post/list'), "Posts", array("post"));
        $custom_links .= $this->navlinks(make_link('comment/list'), "Comments", array("comment"));
        $custom_links .= $this->navlinks(make_link('tags'), "Tags", array("tags"));
        if (class_exists("Pools")) {
            $custom_links .= $this->navlinks(make_link('pool/list'), "Pools", array("pool"));
        }
        $custom_links .= $this->navlinks(make_link('upload'), "Upload", array("upload"));
        if (class_exists("Wiki")) {
            $custom_links .= $this->navlinks(make_link('wiki'), "Wiki", array("wiki"));
            $custom_links .= $this->navlinks(make_link('wiki/more'), "More &raquo;", array("wiki/more"));
        }
        $custom_sublinks = "";
        // hack
        $username = url_escape($user->name);
        // hack
        $qp = explode("/", ltrim(_get_query(), "/"));
        // php sucks
        switch ($qp[0]) {
            default:
                $custom_sublinks .= $user_block_html;
                break;
            case "":
                # FIXME: this assumes that the front page is
                # post/list; in 99% of case it will either be
                # post/list or home, and in the latter case
                # the subnav links aren't shown, but it would
                # be nice to be correct
            # FIXME: this assumes that the front page is
            # post/list; in 99% of case it will either be
            # post/list or home, and in the latter case
            # the subnav links aren't shown, but it would
            # be nice to be correct
            case "post":
            case "upload":
                if (class_exists("NumericScore")) {
                    $custom_sublinks .= "<li><b>Popular by </b><a href='" . make_link('popular_by_day') . "'>Day</a>/<a href='" . make_link('popular_by_month') . "'>Month</a>/<a href='" . make_link('popular_by_year') . "'>Year</a></li>";
                }
                $custom_sublinks .= "<li><a href='" . make_link('post/list') . "'>All</a></li>";
                if (class_exists("Favorites")) {
                    $custom_sublinks .= "<li><a href='" . make_link("post/list/favorited_by={$username}/1") . "'>My Favorites</a></li>";
                }
                if (class_exists("RSS_Images")) {
                    $custom_sublinks .= "<li><a href='" . make_link('rss/images') . "'>Feed</a></li>";
                }
                if (class_exists("RandomImage")) {
                    $custom_sublinks .= "<li><a href='" . make_link("random_image/view") . "'>Random Image</a></li>";
                }
                if (class_exists("Wiki")) {
                    $custom_sublinks .= "<li><a href='" . make_link("wiki/posts") . "'>Help</a></li>";
                } else {
                    $custom_sublinks .= "<li><a href='" . make_link("ext_doc/index") . "'>Help</a></li>";
                }
                break;
            case "comment":
                $custom_sublinks .= "<li><a href='" . make_link('comment/list') . "'>All</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link("ext_doc/comment") . "'>Help</a></li>";
                break;
            case "pool":
                $custom_sublinks .= "<li><a href='" . make_link('pool/list') . "'>List</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link("pool/new") . "'>Create</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link("pool/updated") . "'>Changes</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link("ext_doc/pools") . "'>Help</a></li>";
                break;
            case "wiki":
                $custom_sublinks .= "<li><a href='" . make_link('wiki') . "'>Index</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link("wiki/rules") . "'>Rules</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link("ext_doc/wiki") . "'>Help</a></li>";
                break;
            case "tags":
            case "alias":
                $custom_sublinks .= "<li><a href='" . make_link('tags/map') . "'>Map</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link('tags/alphabetic') . "'>Alphabetic</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link('tags/popularity') . "'>Popularity</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link('tags/categories') . "'>Categories</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link('alias/list') . "'>Aliases</a></li>";
                $custom_sublinks .= "<li><a href='" . make_link("ext_doc/tag_edit") . "'>Help</a></li>";
                break;
        }
        // bzchan: failed attempt to add heading after title_link (failure was it looked bad)
        //if($this->heading==$site_name)$this->heading = '';
        //$title_link = "<h1><a href='".make_link($main_page)."'>$site_name</a>/$this->heading</h1>";
        // bzchan: prepare main title link
        $title_link = "<h1 id='site-title'><a href='" . make_link($main_page) . "'>{$site_name}</a></h1>";
        if ($page->left_enabled) {
            $left = "<nav>{$left_block_html}</nav>";
            $withleft = "withleft";
        } else {
            $left = "";
            $withleft = "noleft";
        }
        $flash = $page->get_cookie("flash_message");
        $flash_html = "";
        if ($flash) {
            $flash_html = "<b id='flash'>" . nl2br(html_escape($flash)) . " <a href='#' onclick=\"\$('#flash').hide(); return false;\">[X]</a></b>";
        }
        print <<<EOD
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
\t<head>
\t\t<title>{$page->title}</title>
{$header_html}
\t\t<script src='{$data_href}/themes/{$theme_name}/script.js' type='text/javascript'></script>
\t</head>

\t<body>
\t\t<header>
\t\t\t{$title_link}
\t\t\t<ul id="navbar" class="flat-list">
\t\t\t\t{$custom_links}
\t\t\t</ul>
\t\t\t<ul id="subnavbar" class="flat-list">
\t\t\t\t{$custom_sublinks}
\t\t\t</ul>
\t\t</header>
\t\t{$subheading}
\t\t{$sub_block_html}
\t\t{$left}
\t\t<article class="{$withleft}">
\t\t\t{$flash_html}
\t\t\t{$main_block_html}
\t\t</article>
\t\t<footer><em>
\t\t\tImages &copy; their respective owners,
\t\t\t<a href="http://code.shishnet.org/shimmie2/">Shimmie</a> &copy;
\t\t\t<a href="http://www.shishnet.org/">Shish</a> &amp;
\t\t\t<a href="https://github.com/shish/shimmie2/graphs/contributors">The Team</a>
\t\t\t2007-2014,
\t\t\tbased on the Danbooru concept.
\t\t\t{$debug}
\t\t\t{$contact}
        </em></footer>
\t</body>
</html>
EOD;
    }
    /**
     * turns the Page into HTML
     *
     * @param Page $page
     */
    public function display_page(Page $page)
    {
        global $config;
        //$theme_name = $config->get_string('theme', 'default');
        $site_name = $config->get_string('title');
        $data_href = get_base_href();
        $main_page = $config->get_string('main_page');
        $contact_link = $config->get_string('contact_link');
        $header_html = "";
        ksort($page->html_headers);
        foreach ($page->html_headers as $line) {
            $header_html .= "\t\t{$line}\n";
        }
        $left_block_html = "";
        $main_block_html = "";
        $head_block_html = "";
        $sub_block_html = "";
        foreach ($page->blocks as $block) {
            switch ($block->section) {
                case "left":
                    $left_block_html .= $block->get_html(true);
                    break;
                case "head":
                    $head_block_html .= "<td width='250'><small>" . $block->get_html(false) . "</small></td>";
                    break;
                case "main":
                    $main_block_html .= $block->get_html(false);
                    break;
                case "subheading":
                    $sub_block_html .= $block->body;
                    // $this->block_to_html($block, true);
                    break;
                default:
                    print "<p>error: {$block->header} using an unknown section ({$block->section})";
                    break;
            }
        }
        $debug = get_debug_info();
        $contact = empty($contact_link) ? "" : "<br><a href='mailto:{$contact_link}'>Contact</a>";
        /*$subheading = empty($page->subheading) ? "" : "<div id='subtitle'>{$page->subheading}</div>";
        
        		$wrapper = "";
        		if(strlen($page->heading) > 100) {
        			$wrapper = ' style="height: 3em; overflow: auto;"';
        		}
        		*/
        $flash = $page->get_cookie("flash_message");
        $flash_html = "";
        if ($flash) {
            $flash_html = "<b id='flash'>" . nl2br(html_escape($flash)) . " <a href='#' onclick=\"\$('#flash').hide(); return false;\">[X]</a></b>";
        }
        print <<<EOD
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
\t<head>
\t\t<title>{$page->title}</title>
{$header_html}
\t</head>

\t<body>
\t\t<header>
\t\t\t<table id="header" class="bgtop" width="100%" height="113px">
\t\t\t\t<tr>
\t\t\t\t\t<td><center>
\t\t\t\t\t\t<h1><a href="{$data_href}/{$main_page}">{$site_name}</a></h1>
\t\t\t\t\t\t<p>[Navigation links go here]
\t\t\t\t\t</center></td>
\t\t\t\t\t{$head_block_html}
\t\t\t\t</tr>
\t\t\t</table>
\t\t\t{$sub_block_html}
\t\t</header>
\t\t<nav>
\t\t\t{$left_block_html}
\t\t</nav>
\t\t<article>
\t\t\t{$flash_html}
\t\t\t{$main_block_html}
\t\t</article>
\t\t<footer>
\t\t\tImages &copy; their respective owners,
\t\t\t<a href="http://code.shishnet.org/shimmie2/">Shimmie</a> &copy;
\t\t\t<a href="http://www.shishnet.org/">Shish</a> &amp;
\t\t\t<a href="https://github.com/shish/shimmie2/graphs/contributors">The Team</a>
\t\t\t2007-2014,
\t\t\tbased on the Danbooru concept.
\t\t\t{$debug}
\t\t\t{$contact}
\t\t</footer>
\t</body>
</html>
EOD;
    }
Beispiel #8
0
    function display_page($page)
    {
        global $config;
        $theme_name = $config->get_string('theme', 'default');
        $data_href = get_base_href();
        $contact_link = $config->get_string('contact_link');
        $header_html = "";
        ksort($page->html_headers);
        foreach ($page->html_headers as $line) {
            $header_html .= "\t\t{$line}\n";
        }
        $left_block_html = "";
        $main_block_html = "";
        $sub_block_html = "";
        foreach ($page->blocks as $block) {
            switch ($block->section) {
                case "left":
                    $left_block_html .= $this->block_to_html($block, true, "left");
                    break;
                case "main":
                    $main_block_html .= $this->block_to_html($block, false, "main");
                    break;
                case "subheading":
                    $sub_block_html .= $block->body;
                    // $this->block_to_html($block, true);
                    break;
                default:
                    print "<p>error: {$block->header} using an unknown section ({$block->section})";
                    break;
            }
        }
        $debug = get_debug_info();
        $contact = empty($contact_link) ? "" : "<br><a href='mailto:{$contact_link}'>Contact</a>";
        if (empty($page->subheading)) {
            $subheading = "";
        } else {
            $subheading = "<div id='subtitle'>{$page->subheading}</div>";
        }
        if ($page->left_enabled) {
            $left = "<div id='nav'>{$left_block_html}</div>";
            $withleft = "withleft";
        } else {
            $left = "";
            $withleft = "";
        }
        print <<<EOD
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
\t<head>
\t\t<title>{$page->title}</title>
\t\t<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
\t\t<link rel="stylesheet" href="{$data_href}/themes/{$theme_name}/style.css" type="text/css">
{$header_html}
\t\t<script src='{$data_href}/themes/{$theme_name}/sidebar.js' type='text/javascript'></script>
\t\t<script src='{$data_href}/themes/{$theme_name}/script.js' type='text/javascript'></script>
\t</head>

\t<body>
\t\t<h1>{$page->heading}</h1>
\t\t{$subheading}
\t\t{$sub_block_html}
\t\t
\t\t{$left}
\t\t<div id="body" class="{$withleft}">{$main_block_html}</div>

\t\t<div id="footer">
\t\t\t<hr>
\t\t\tImages &copy; their respective owners,
\t\t\t<a href="http://code.shishnet.org/shimmie2/">Shimmie</a> &copy;
\t\t\t<a href="http://www.shishnet.org/">Shish</a> &amp; Co 2007-2012,
\t\t\tbased on the Danbooru concept.
\t\t\t<br>Futaba theme based on 4chan's layout and CSS :3
\t\t\t{$debug}
\t\t\t{$contact}
\t\t</div>
\t</body>
</html>
EOD;
    }
    /**
     * turns the Page into HTML
     */
    public function display_page(Page $page)
    {
        global $config, $user;
        $theme_name = $config->get_string('theme', 'lite');
        $site_name = $config->get_string('title');
        $data_href = get_base_href();
        $contact_link = $config->get_string('contact_link');
        $header_html = "";
        foreach ($page->headers as $line) {
            $header_html .= "\t\t{$line}\n";
        }
        $menu = "<div class='menu'>\n\t\t\t<script type='text/javascript' src='{$data_href}/themes/{$theme_name}/wz_tooltip.js'></script>\n\t\t\t<a href='" . make_link() . "' onmouseover='Tip(&#39;Home&#39;, BGCOLOR, &#39;#C3D2E0&#39;, FADEIN, 100)' onmouseout='UnTip()'><img src='{$data_href}/favicon.ico' style='position: relative; top: 3px;'></a>\n\t\t\t<b>{$site_name}</b> ";
        // Custom links: These appear on the menu.
        $custom_links = "";
        if ($user->is_anonymous()) {
            $custom_links .= $this->navlinks(make_link('user_admin/login'), "Account", array("user", "user_admin", "setup", "admin", "profile"));
        } else {
            $custom_links .= $this->navlinks(make_link('user'), "Account", array("user", "setup", "user_admin", "admin", "profile"));
        }
        $custom_links .= $this->navlinks(make_link('post/list'), "Posts", array("post", "view"));
        $custom_links .= $this->navlinks(make_link('comment/list'), "Comments", array("comment"));
        $custom_links .= $this->navlinks(make_link('tags'), "Tags", array("tags"));
        $custom_links .= $this->navlinks(make_link('upload'), "Upload", array("upload"));
        if (class_exists("Wiki")) {
            $custom_links .= $this->navlinks(make_link('wiki/rules'), "Rules", array("wiki/rules"));
            $custom_links .= $this->navlinks(make_link('wiki'), "Wiki", array("wiki"));
        }
        $menu .= "{$custom_links}</div>";
        $left_block_html = "";
        $main_block_html = "";
        $sub_block_html = "";
        $user_block_html = "";
        foreach ($page->blocks as $block) {
            switch ($block->section) {
                case "left":
                    $left_block_html .= $this->block_to_html($block, true, "left");
                    break;
                case "main":
                    $main_block_html .= $this->block_to_html($block, false, "main");
                    break;
                case "user":
                    $user_block_html .= $block->body;
                    break;
                case "subheading":
                    $sub_block_html .= $this->block_to_html($block, false, "main");
                    break;
                default:
                    print "<p>error: {$block->header} using an unknown section ({$block->section})";
                    break;
            }
        }
        $custom_sublinks = "<div class='sbar'>";
        $cs = null;
        // hack
        global $user;
        $username = url_escape($user->name);
        // hack
        $qp = _get_query_parts();
        $hw = class_exists("Wiki");
        // php sucks
        switch ($qp[0]) {
            default:
                $cs = $user_block_html;
                break;
            case "":
                # FIXME: this assumes that the front page is
                # post/list; in 99% of case it will either be
                # post/list or home, and in the latter case
                # the subnav links aren't shown, but it would
                # be nice to be correct
            # FIXME: this assumes that the front page is
            # post/list; in 99% of case it will either be
            # post/list or home, and in the latter case
            # the subnav links aren't shown, but it would
            # be nice to be correct
            case "post":
                $cs .= "<a class='tab' href='" . make_link('post/list') . "'>All</a>";
                $cs .= "<a class='tab' href='" . make_link("post/list/favorited_by={$username}/1") . "'>My Favorites</a>";
                $cs .= "<a class='tab' href='" . make_link('rss/images') . "'>Feed</a>";
                if ($hw) {
                    $cs .= "<a class='tab' href='" . make_link("wiki/posts") . "'>Help</a>";
                }
                break;
            case "comment":
                $cs .= "<a class='tab' href='" . make_link('comment/list') . "'>All</a>";
                $cs .= "<a class='tab' href='" . make_link('rss/comments') . "'>Feed</a>";
                $cs .= "<a class='tab' href='" . make_link("ext_doc/comment") . "'>Help</a>";
                break;
            case "pool":
                $cs .= "<a class='tab' href='" . make_link('pool/list') . "'>List</a>";
                $cs .= "<a class='tab' href='" . make_link("pool/new") . "'>Create</a>";
                $cs .= "<a class='tab' href='" . make_link("pool/updated") . "'>Changes</a>";
                $cs .= "<a class='tab' href='" . make_link("ext_doc/pools") . "'>Help</a>";
                break;
            case "wiki":
                $cs .= "<a class='tab' href='" . make_link('wiki') . "'>Index</a>";
                $cs .= "<a class='tab' href='" . make_link("wiki/rules") . "'>Rules</a>";
                $cs .= "<a class='tab' href='" . make_link("ext_doc/wiki") . "'>Help</a>";
                break;
            case "tags":
            case "alias":
                $cs .= "<a class='tab' href='" . make_link('tags/map') . "'>Map</a>";
                $cs .= "<a class='tab' href='" . make_link('tags/alphabetic') . "'>Alphabetic</a>";
                $cs .= "<a class='tab' href='" . make_link('tags/popularity') . "'>Popularity</a>";
                $cs .= "<a class='tab' href='" . make_link('tags/categories') . "'>Categories</a>";
                $cs .= "<a class='tab' href='" . make_link('alias/list') . "'>Aliases</a>";
                $cs .= "<a class='tab' href='" . make_link("ext_doc/tag_edit") . "'>Help</a>";
                break;
            case "upload":
                if ($hw) {
                    $cs .= "<a class='tab' href='" . make_link("wiki/upload_guidelines") . "'>Guidelines</a>";
                }
                break;
            case "random":
                $cs .= "<a class='tab' href='" . make_link('random/view') . "'>Shuffle</a>";
                $cs .= "<a class='tab' href='" . make_link('random/download') . "'>Download</a>";
                break;
            case "featured":
                $cs .= "<a class='tab' href='" . make_link('featured/download') . "'>Download</a>";
                break;
        }
        if ($cs == "") {
            $custom_sublinks = "";
        } else {
            $custom_sublinks .= "{$cs}</div>";
        }
        $debug = get_debug_info();
        $contact = empty($contact_link) ? "" : "<br><a href='{$contact_link}'>Contact</a>";
        $subheading = empty($page->subheading) ? "" : "<div id='subtitle'>{$page->subheading}</div>";
        $wrapper = "";
        if (strlen($page->heading) > 100) {
            $wrapper = ' style="height: 3em; overflow: auto;"';
        }
        if ($page->left_enabled == false) {
            $left_block_html = "";
            $main_block_html = "<div id='body_noleft'>{$main_block_html}</div>";
        } else {
            $left_block_html = "<div id='nav'>{$left_block_html}</div>";
            $main_block_html = "<div id='body'>{$main_block_html}</div>";
        }
        print <<<EOD
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
\t<head>
\t\t<title>{$page->title}</title>
\t\t<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
\t\t<link rel="stylesheet" href="{$data_href}/themes/{$theme_name}/style.css" type="text/css">
\t\t{$header_html}
\t</head>

\t<body>
\t\t{$menu}
\t\t{$custom_sublinks}
\t\t
\t\t{$sub_block_html}

\t\t{$left_block_html}
\t\t{$main_block_html}
\t\t

\t\t<div id="footer">
\t\t\tImages &copy; their respective owners,
\t\t\t<a href="http://code.shishnet.org/shimmie2/">Shimmie</a> &copy;
\t\t\t<a href="http://www.shishnet.org/">Shish</a> &amp; Co 2007-2010,
\t\t\tbased on the Danbooru concept.<br />
\t\t\tLite Theme by <a href="http://seemslegit.com">Zach</a>
\t\t\t{$debug}
\t\t\t{$contact}
\t\t</div>
\t</body>
</html>
EOD;
    }
    /**
     * turns the Page into HTML.
     *
     * @param Page $page
     */
    public function display_page(Page $page)
    {
        global $config, $user;
        $theme_name = $config->get_string('theme', 'lite');
        $site_name = $config->get_string('title');
        $data_href = get_base_href();
        $contact_link = $config->get_string('contact_link');
        $header_html = "";
        ksort($page->html_headers);
        foreach ($page->html_headers as $line) {
            $header_html .= "\t\t{$line}\n";
        }
        $menu = "<div class='menu'>\n\t\t\t<script type='text/javascript' src='{$data_href}/themes/{$theme_name}/wz_tooltip.js'></script>\n\t\t\t<a href='" . make_link() . "' onmouseover='Tip(&#39;Home&#39;, BGCOLOR, &#39;#C3D2E0&#39;, FADEIN, 100)' onmouseout='UnTip()'><img src='{$data_href}/favicon.ico' style='position: relative; top: 3px;'></a>\n\t\t\t<b>{$site_name}</b> ";
        // Custom links: These appear on the menu.
        $custom_links = "";
        if ($user->is_anonymous()) {
            $custom_links .= $this->navlinks(make_link('user_admin/login'), "Account", array("user", "user_admin", "setup", "admin", "profile"));
        } else {
            $custom_links .= $this->navlinks(make_link('user'), "Account", array("user", "setup", "user_admin", "admin", "profile"));
        }
        $custom_links .= $this->navlinks(make_link('post/list'), "Posts", array("post", "view"));
        $custom_links .= $this->navlinks(make_link('comment/list'), "Comments", array("comment"));
        $custom_links .= $this->navlinks(make_link('tags'), "Tags", array("tags"));
        if (class_exists("Pools")) {
            $custom_links .= $this->navlinks(make_link('pool/list'), "Pools", array("pool"));
        }
        $custom_links .= $this->navlinks(make_link('upload'), "Upload", array("upload"));
        if (class_exists("Wiki")) {
            $custom_links .= $this->navlinks(make_link('wiki/rules'), "Rules", array("wiki/rules"));
            $custom_links .= $this->navlinks(make_link('wiki'), "Wiki", array("wiki"));
        }
        $menu .= "{$custom_links}</div>";
        $left_block_html = "";
        $main_block_html = "";
        $sub_block_html = "";
        $user_block_html = "";
        foreach ($page->blocks as $block) {
            switch ($block->section) {
                case "left":
                    $left_block_html .= $this->block_to_html($block, true, "left");
                    break;
                case "main":
                    $main_block_html .= $this->block_to_html($block, false, "main");
                    break;
                case "user":
                    $user_block_html .= $block->body;
                    break;
                case "subheading":
                    $sub_block_html .= $this->block_to_html($block, false, "main");
                    break;
                default:
                    print "<p>error: {$block->header} using an unknown section ({$block->section})";
                    break;
            }
        }
        $custom_sublinks = "<div class='sbar'>";
        // hack
        $username = url_escape($user->name);
        // hack
        $qp = explode("/", ltrim(_get_query(), "/"));
        $cs = "";
        // php sucks
        switch ($qp[0]) {
            default:
                $cs = $user_block_html;
                break;
            case "":
                # FIXME: this assumes that the front page is
                # post/list; in 99% of case it will either be
                # post/list or home, and in the latter case
                # the subnav links aren't shown, but it would
                # be nice to be correct
            # FIXME: this assumes that the front page is
            # post/list; in 99% of case it will either be
            # post/list or home, and in the latter case
            # the subnav links aren't shown, but it would
            # be nice to be correct
            case "post":
                if (class_exists("NumericScore")) {
                    $cs .= "<b>Popular by </b><a href='" . make_link('popular_by_day') . "'>Day</a><b>/</b><a href='" . make_link('popular_by_month') . "'>Month</a><b>/</b><a href='" . make_link('popular_by_year') . "'>Year</a> ";
                }
                $cs .= "<a class='tab' href='" . make_link('post/list') . "'>All</a>";
                if (class_exists("Favorites")) {
                    $cs .= "<a class='tab' href='" . make_link("post/list/favorited_by={$username}/1") . "'>My Favorites</a>";
                }
                if (class_exists("RSS_Images")) {
                    $cs .= "<a class='tab' href='" . make_link('rss/images') . "'>Feed</a>";
                }
                if (class_exists("Random_Image")) {
                    $cs .= "<a class='tab' href='" . make_link("random_image/view") . "'>Random Image</a>";
                }
                if (class_exists("Wiki")) {
                    $cs .= "<a class='tab' href='" . make_link("wiki/posts") . "'>Help</a>";
                } else {
                    $cs .= "<a class='tab' href='" . make_link("ext_doc/index") . "'>Help</a>";
                }
                break;
            case "comment":
                $cs .= "<a class='tab' href='" . make_link('comment/list') . "'>All</a>";
                $cs .= "<a class='tab' href='" . make_link('rss/comments') . "'>Feed</a>";
                $cs .= "<a class='tab' href='" . make_link("ext_doc/comment") . "'>Help</a>";
                break;
            case "pool":
                $cs .= "<a class='tab' href='" . make_link('pool/list') . "'>List</a>";
                $cs .= "<a class='tab' href='" . make_link("pool/new") . "'>Create</a>";
                $cs .= "<a class='tab' href='" . make_link("pool/updated") . "'>Changes</a>";
                $cs .= "<a class='tab' href='" . make_link("ext_doc/pools") . "'>Help</a>";
                break;
            case "wiki":
                $cs .= "<a class='tab' href='" . make_link('wiki') . "'>Index</a>";
                $cs .= "<a class='tab' href='" . make_link("wiki/rules") . "'>Rules</a>";
                $cs .= "<a class='tab' href='" . make_link("ext_doc/wiki") . "'>Help</a>";
                break;
            case "tags":
            case "alias":
                $cs .= "<a class='tab' href='" . make_link('tags/map') . "'>Map</a>";
                $cs .= "<a class='tab' href='" . make_link('tags/alphabetic') . "'>Alphabetic</a>";
                $cs .= "<a class='tab' href='" . make_link('tags/popularity') . "'>Popularity</a>";
                $cs .= "<a class='tab' href='" . make_link('tags/categories') . "'>Categories</a>";
                $cs .= "<a class='tab' href='" . make_link('alias/list') . "'>Aliases</a>";
                $cs .= "<a class='tab' href='" . make_link("ext_doc/tag_edit") . "'>Help</a>";
                break;
            case "upload":
                if (class_exists("Wiki")) {
                    $cs .= "<a class='tab' href='" . make_link("wiki/upload_guidelines") . "'>Guidelines</a>";
                }
                break;
            case "random":
                $cs .= "<a class='tab' href='" . make_link('random/view') . "'>Shuffle</a>";
                $cs .= "<a class='tab' href='" . make_link('random/download') . "'>Download</a>";
                break;
            case "featured":
                $cs .= "<a class='tab' href='" . make_link('featured/download') . "'>Download</a>";
                break;
        }
        if ($cs == "") {
            $custom_sublinks = "";
        } else {
            $custom_sublinks .= "{$cs}</div>";
        }
        $debug = get_debug_info();
        $contact = empty($contact_link) ? "" : "<br><a href='mailto:{$contact_link}'>Contact</a>";
        //$subheading = empty($page->subheading) ? "" : "<div id='subtitle'>{$page->subheading}</div>";
        /*$wrapper = "";
        		if(strlen($page->heading) > 100) {
        			$wrapper = ' style="height: 3em; overflow: auto;"';
        		}*/
        if ($page->left_enabled == false) {
            $left_block_html = "";
            $main_block_html = "<article id='body_noleft'>{$main_block_html}</article>";
        } else {
            $left_block_html = "<nav>{$left_block_html}</nav>";
            $main_block_html = "<article>{$main_block_html}</article>";
        }
        $flash = $page->get_cookie("flash_message");
        $flash_html = "";
        if ($flash) {
            $flash_html = "<b id='flash'>" . nl2br(html_escape($flash)) . " <a href='#' onclick=\"\$('#flash').hide(); return false;\">[X]</a></b>";
        }
        print <<<EOD
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
\t<head>
\t\t<title>{$page->title}</title>
\t\t{$header_html}
\t</head>

\t<body>
\t\t<header>
\t\t\t{$menu}
\t\t\t{$custom_sublinks}
\t\t\t{$sub_block_html}
\t\t</header>
\t\t{$left_block_html}
\t\t{$flash_html}
\t\t{$main_block_html}
\t\t<footer>
\t\t\tImages &copy; their respective owners,
\t\t\t<a href="http://code.shishnet.org/shimmie2/">Shimmie</a> &copy;
\t\t\t<a href="http://www.shishnet.org/">Shish</a> &amp;
\t\t\t<a href="https://github.com/shish/shimmie2/graphs/contributors">The Team</a>
\t\t\t2007-2014,
\t\t\tbased on the Danbooru concept.<br />
\t\t\tLite Theme by <a href="http://seemslegit.com">Zach</a>
\t\t\t{$debug}
\t\t\t{$contact}
\t\t</footer>
\t</body>
</html>
EOD;
    }