Exemplo n.º 1
0
function buildPage($htmlposts, $parent, $pages = 0, $thispage = 0)
{
    $managelink = basename($_SERVER['PHP_SELF']) . "?manage";
    $maxdimensions = TINYIB_MAXWOP . 'x' . TINYIB_MAXHOP;
    if (TINYIB_MAXW != TINYIB_MAXWOP || TINYIB_MAXH != TINYIB_MAXHOP) {
        $maxdimensions .= ' (new thread) or ' . TINYIB_MAXW . 'x' . TINYIB_MAXH . ' (reply)';
    }
    $postingmode = "";
    $pagenavigator = "";
    if ($parent == TINYIB_NEWTHREAD) {
        $pages = max($pages, 0);
        $previous = $thispage == 1 ? "index" : $thispage - 1;
        $next = $thispage + 1;
        $pagelinks = $thispage == 0 ? "<td>Previous</td>" : '<td><form method="get" action="' . $previous . '.html"><input value="Previous" type="submit"></form></td>';
        $pagelinks .= "<td>";
        for ($i = 0; $i <= $pages; $i++) {
            if ($thispage == $i) {
                $pagelinks .= '&#91;' . $i . '&#93; ';
            } else {
                $href = $i == 0 ? "index" : $i;
                $pagelinks .= '&#91;<a href="' . $href . '.html">' . $i . '</a>&#93; ';
            }
        }
        $pagelinks .= "</td>";
        $pagelinks .= $pages <= $thispage ? "<td>Next</td>" : '<td><form method="get" action="' . $next . '.html"><input value="Next" type="submit"></form></td>';
        $pagenavigator = <<<EOF
<table border="1">
\t<tbody>
\t\t<tr>
\t\t\t{$pagelinks}
\t\t</tr>
\t</tbody>
</table>
EOF;
    } else {
        $postingmode = '&#91;<a href="../">Return</a>&#93;<div class="replymode">Posting mode: Reply</div> ';
    }
    $max_file_size_input_html = '';
    $max_file_size_rules_html = '';
    $reqmod_html = '';
    $filetypes_html = '';
    $file_input_html = '';
    $embed_input_html = '';
    $unique_posts_html = '';
    $captcha_html = '';
    if (TINYIB_CAPTCHA) {
        $captcha_html = <<<EOF
\t\t\t\t\t<tr>
\t\t\t\t\t\t<td class="postblock">
\t\t\t\t\t\t\tCAPTCHA
\t\t\t\t\t\t</td>
\t\t\t\t\t\t<td>
\t\t\t\t\t\t\t<input type="text" name="captcha" id="captcha" autocomplete="off" size="6" accesskey="c">&nbsp;&nbsp;(enter the text below)<br>
\t\t\t\t\t\t\t<img id="captchaimage" src="inc/captcha.php" width="175" height="55" alt="CAPTCHA" onclick="javascript:reloadCAPTCHA()" style="margin-top: 5px;cursor: pointer;">
\t\t\t\t\t\t</td>
\t\t\t\t\t</tr>
EOF;
    }
    if (TINYIB_PIC || TINYIB_WEBM || TINYIB_SWF) {
        if (TINYIB_MAXKB > 0) {
            $max_file_size_input_html = '<input type="hidden" name="MAX_FILE_SIZE" value="' . strval(TINYIB_MAXKB * 1024) . '">';
            $max_file_size_rules_html = '<li>Maximum file size allowed is ' . TINYIB_MAXKBDESC . '.</li>';
        }
        $filetypes_html = '<li>' . supportedFileTypes() . '</li>';
        $file_input_html = <<<EOF
\t\t\t\t\t<tr>
\t\t\t\t\t\t<td class="postblock">
\t\t\t\t\t\t\tFile
\t\t\t\t\t\t</td>
\t\t\t\t\t\t<td>
\t\t\t\t\t\t\t<input type="file" name="file" size="35" accesskey="f">
\t\t\t\t\t\t</td>
\t\t\t\t\t</tr>
EOF;
    }
    if (TINYIB_EMBED) {
        $embed_input_html = <<<EOF
\t\t\t\t\t<tr>
\t\t\t\t\t\t<td class="postblock">
\t\t\t\t\t\t\tEmbed
\t\t\t\t\t\t</td>
\t\t\t\t\t\t<td>
\t\t\t\t\t\t\t<input type="text" name="embed" size="28" accesskey="e">&nbsp;&nbsp;(paste a YouTube URL)
\t\t\t\t\t\t</td>
\t\t\t\t\t</tr>
EOF;
    }
    if (TINYIB_REQMOD != 'disable') {
        $reqmod_html = '<li>All posts' . (TINYIB_REQMOD == 'files' ? ' with a file attached' : '') . ' will be moderated before being shown.</li>';
    }
    $thumbnails_html = '';
    if (TINYIB_PIC) {
        $thumbnails_html = "<li>Images greater than {$maxdimensions} will be thumbnailed.</li>";
    }
    $unique_posts = uniquePosts();
    if ($unique_posts > 0) {
        $unique_posts_html = "<li>Currently {$unique_posts} unique user posts.</li>\n";
    }
    $body = <<<EOF
\t<body>
\t\t<div class="adminbar">
\t\t\t[<a href="{$managelink}" style="text-decoration: underline;">Manage</a>]
\t\t</div>
\t\t<div class="logo">
EOF;
    $body .= TINYIB_LOGO . TINYIB_BOARDDESC . <<<EOF
\t\t</div>
\t\t<hr width="90%" size="1">
\t\t{$postingmode}
\t\t<div class="postarea">
\t\t\t<form name="postform" id="postform" action="imgboard.php" method="post" enctype="multipart/form-data">
\t\t\t{$max_file_size_input_html}
\t\t\t<input type="hidden" name="parent" value="{$parent}">
\t\t\t<table class="postform">
\t\t\t\t<tbody>
\t\t\t\t\t<tr>
\t\t\t\t\t\t<td class="postblock">
\t\t\t\t\t\t\tName
\t\t\t\t\t\t</td>
\t\t\t\t\t\t<td>
\t\t\t\t\t\t\t<input type="text" name="name" size="28" maxlength="75" accesskey="n">
\t\t\t\t\t\t</td>
\t\t\t\t\t</tr>
\t\t\t\t\t<tr>
\t\t\t\t\t\t<td class="postblock">
\t\t\t\t\t\t\tE-mail
\t\t\t\t\t\t</td>
\t\t\t\t\t\t<td>
\t\t\t\t\t\t\t<input type="text" name="email" size="28" maxlength="75" accesskey="e">
\t\t\t\t\t\t</td>
\t\t\t\t\t</tr>
\t\t\t\t\t<tr>
\t\t\t\t\t\t<td class="postblock">
\t\t\t\t\t\t\tSubject
\t\t\t\t\t\t</td>
\t\t\t\t\t\t<td>
\t\t\t\t\t\t\t<input type="text" name="subject" size="40" maxlength="75" accesskey="s">
\t\t\t\t\t\t\t<input type="submit" value="Submit" accesskey="z">
\t\t\t\t\t\t</td>
\t\t\t\t\t</tr>
\t\t\t\t\t<tr>
\t\t\t\t\t\t<td class="postblock">
\t\t\t\t\t\t\tMessage
\t\t\t\t\t\t</td>
\t\t\t\t\t\t<td>
\t\t\t\t\t\t\t<textarea id="message" name="message" cols="48" rows="4" accesskey="m"></textarea>
\t\t\t\t\t\t</td>
\t\t\t\t\t</tr>
\t\t\t\t\t{$captcha_html}
\t\t\t\t\t{$file_input_html}
\t\t\t\t\t{$embed_input_html}
\t\t\t\t\t<tr>
\t\t\t\t\t\t<td class="postblock">
\t\t\t\t\t\t\tPassword
\t\t\t\t\t\t</td>
\t\t\t\t\t\t<td>
\t\t\t\t\t\t\t<input type="password" name="password" id="newpostpassword" size="8" accesskey="p">&nbsp;&nbsp;(for post and file deletion)
\t\t\t\t\t\t</td>
\t\t\t\t\t</tr>
\t\t\t\t\t<tr>
\t\t\t\t\t\t<td colspan="2" class="rules">
\t\t\t\t\t\t\t<ul>
\t\t\t\t\t\t\t\t{$reqmod_html}
\t\t\t\t\t\t\t\t{$filetypes_html}
\t\t\t\t\t\t\t\t{$max_file_size_rules_html}
\t\t\t\t\t\t\t\t{$thumbnails_html}
\t\t\t\t\t\t\t\t{$unique_posts_html}
\t\t\t\t\t\t\t</ul>
\t\t\t\t\t\t</td>
\t\t\t\t\t</tr>
\t\t\t\t</tbody>
\t\t\t</table>
\t\t\t</form>
\t\t</div>
\t\t<hr>
\t\t<form id="delform" action="imgboard.php?delete" method="post">
\t\t<input type="hidden" name="board" 
EOF;
    $body .= 'value="' . TINYIB_BOARD . '">' . <<<EOF
\t\t{$htmlposts}
\t\t<table class="userdelete">
\t\t\t<tbody>
\t\t\t\t<tr>
\t\t\t\t\t<td>
\t\t\t\t\t\tDelete Post <input type="password" name="password" id="deletepostpassword" size="8" placeholder="Password">&nbsp;<input name="deletepost" value="Delete" type="submit">
\t\t\t\t\t</td>
\t\t\t\t</tr>
\t\t\t</tbody>
\t\t</table>
\t\t</form>
\t\t{$pagenavigator}
\t\t<br>
EOF;
    return pageHeader() . $body . pageFooter();
}
Exemplo n.º 2
0
function buildPage($htmlposts, $parent, $pages = 0, $thispage = 0)
{
    global $tinyib;
    $managelink = basename($_SERVER['PHP_SELF']) . "?manage";
    $postingmode = "";
    $pagenavigator = "";
    if ($parent == 0) {
        $pages = max($pages, 0);
        $previous = $thispage == 1 ? "index" : $thispage - 1;
        $next = $thispage + 1;
        $pagelinks = $thispage == 0 ? "<td>Previous</td>" : '<td><form method="get" action="' . $previous . '.html"><input value="Previous" type="submit"></form></td>';
        $pagelinks .= "<td>";
        for ($i = 0; $i <= $pages; $i++) {
            if ($thispage == $i) {
                $pagelinks .= '&#91;' . $i . '&#93; ';
            } else {
                $href = $i == 0 ? "index" : $i;
                $pagelinks .= '&#91;<a href="' . $href . '.html">' . $i . '</a>&#93; ';
            }
        }
        $pagelinks .= "</td>";
        $pagelinks .= $pages <= $thispage ? "<td>Next</td>" : '<td><form method="get" action="' . $next . '.html"><input value="Next" type="submit"></form></td>';
        $pagenavigator = <<<EOF
<table border="1">
\t<tbody>
\t\t<tr>
\t\t\t{$pagelinks}
\t\t</tr>
\t</tbody>
</table>
EOF;
    } else {
        $postingmode = '&#91;<a href="../">Return</a>&#93;<div class="replymode">Posting mode: Reply</div> ';
    }
    $unique_posts_html = '';
    $unique_posts = uniquePosts();
    if ($unique_posts > 0) {
        $unique_posts_html = "<li>Currently {$unique_posts} unique user posts.</li>";
    }
    $body = <<<EOF
\t<body>
\t\t<div class="adminbar">
\t\t\t[<a href="{$managelink}">Manage</a>]
\t\t</div>
\t\t<div class="logo">
\t\t\t{$tinyib['logo']}
\t\t\t{$tinyib['boarddescription']}
\t\t</div>
\t\t<hr width="90%" size="1">
\t\t{$postingmode}
\t\t<div class="postarea">
\t\t\t<form name="postform" id="postform" action="imgboard.php" method="post" enctype="multipart/form-data">
\t\t\t<input type="hidden" name="MAX_FILE_SIZE" value="2097152">
\t\t\t<input type="hidden" name="parent" value="{$parent}">
\t\t\t<table class="postform">
\t\t\t\t<tbody>
\t\t\t\t\t<tr>
\t\t\t\t\t\t<td class="postblock">
\t\t\t\t\t\t\tName
\t\t\t\t\t\t</td>
\t\t\t\t\t\t<td>
\t\t\t\t\t\t\t<input type="text" name="name" size="28" maxlength="75" accesskey="n">
\t\t\t\t\t\t</td>
\t\t\t\t\t</tr>
\t\t\t\t\t<tr>
\t\t\t\t\t\t<td class="postblock">
\t\t\t\t\t\t\tE-mail
\t\t\t\t\t\t</td>
\t\t\t\t\t\t<td>
\t\t\t\t\t\t\t<input type="text" name="email" size="28" maxlength="75" accesskey="e">
\t\t\t\t\t\t</td>
\t\t\t\t\t</tr>
\t\t\t\t\t<tr>
\t\t\t\t\t\t<td class="postblock">
\t\t\t\t\t\t\tSubject
\t\t\t\t\t\t</td>
\t\t\t\t\t\t<td>
\t\t\t\t\t\t\t<input type="text" name="subject" size="40" maxlength="75" accesskey="s">
\t\t\t\t\t\t\t<input type="submit" value="Submit" accesskey="z">
\t\t\t\t\t\t</td>
\t\t\t\t\t</tr>
\t\t\t\t\t<tr>
\t\t\t\t\t\t<td class="postblock">
\t\t\t\t\t\t\tMessage
\t\t\t\t\t\t</td>
\t\t\t\t\t\t<td>
\t\t\t\t\t\t\t<textarea name="message" cols="48" rows="4" accesskey="m"></textarea>
\t\t\t\t\t\t</td>
\t\t\t\t\t</tr>
\t\t\t\t\t<tr>
\t\t\t\t\t\t<td class="postblock">
\t\t\t\t\t\t\tFile
\t\t\t\t\t\t</td>
\t\t\t\t\t\t<td>
\t\t\t\t\t\t\t<input type="file" name="file" size="35" accesskey="f">
\t\t\t\t\t\t</td>
\t\t\t\t\t</tr>
\t\t\t\t\t<tr>
\t\t\t\t\t\t<td class="postblock">
\t\t\t\t\t\t\tPassword
\t\t\t\t\t\t</td>
\t\t\t\t\t\t<td>
\t\t\t\t\t\t\t<input type="password" name="password" size="8" accesskey="p">&nbsp;(for post and file deletion)
\t\t\t\t\t\t</td>
\t\t\t\t\t</tr>
\t\t\t\t\t<tr>
\t\t\t\t\t\t<td colspan="2" class="rules">
\t\t\t\t\t\t\t<ul>
\t\t\t\t\t\t\t\t<li>Supported file types are: GIF, JPG, PNG</li>
\t\t\t\t\t\t\t\t<li>Maximum file size allowed is 2 MB.</li>
\t\t\t\t\t\t\t\t<li>Images greater than 250x250 pixels will be thumbnailed.</li>
\t\t\t\t\t\t\t\t{$unique_posts_html}
\t\t\t\t\t\t\t</ul>
\t\t\t\t\t\t</td>
\t\t\t\t\t</tr>
\t\t\t\t</tbody>
\t\t\t</table>
\t\t\t</form>
\t\t</div>
\t\t<hr>
\t\t<form id="delform" action="imgboard.php?delete" method="post">
\t\t<input type="hidden" name="board" value="{$tinyib['board']}">
\t\t{$htmlposts}
\t\t<table class="userdelete">
\t\t\t<tbody>
\t\t\t\t<tr>
\t\t\t\t\t<td>
\t\t\t\t\t\tDelete Post<br>Password <input type="password" name="password" size="8">&nbsp;<input name="deletepost" value="Delete" type="submit"> 
\t\t\t\t\t</td>
\t\t\t\t</tr>
\t\t\t</tbody>
\t\t</table>
\t\t</form>
\t\t{$pagenavigator}
\t\t<br>
EOF;
    return pageHeader() . $body . pageFooter();
}