MAX_FILE_SIZE hidden input improvements

This commit is contained in:
Trevor Slocum 2013-07-30 21:32:55 -07:00
parent b8d86e8612
commit 280eeab57e
2 changed files with 12 additions and 6 deletions

2
.gitignore vendored
View File

@ -4,4 +4,4 @@ settings.php
.posts .posts
.posts.lock .posts.lock
.project .project
.settings/

View File

@ -125,7 +125,6 @@ function buildPage($htmlposts, $parent, $pages=0, $thispage=0) {
if (TINYIB_MAXW != TINYIB_MAXWOP || TINYIB_MAXH != TINYIB_MAXHOP) { if (TINYIB_MAXW != TINYIB_MAXWOP || TINYIB_MAXH != TINYIB_MAXHOP) {
$maxdimensions .= ' (new thread) or ' . TINYIB_MAXW . 'x' . TINYIB_MAXH . ' (reply)'; $maxdimensions .= ' (new thread) or ' . TINYIB_MAXW . 'x' . TINYIB_MAXH . ' (reply)';
} }
$maxfilesize = TINYIB_MAXKB * 1024;
$postingmode = ""; $postingmode = "";
$pagenavigator = ""; $pagenavigator = "";
@ -168,9 +167,11 @@ EOF;
$unique_posts_html = "<li>Currently $unique_posts unique user posts.</li>\n"; $unique_posts_html = "<li>Currently $unique_posts unique user posts.</li>\n";
} }
$max_file_size_input = '';
$max_file_size_html = ''; $max_file_size_html = '';
if (TINYIB_MAXKB > 0) { if (TINYIB_MAXKB > 0) {
$max_file_size_html = "<li>Maximum file size allowed is " . TINYIB_MAXKBDESC . ".</li>\n"; $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>';
} }
$body = <<<EOF $body = <<<EOF
@ -186,7 +187,7 @@ EOF;
$postingmode $postingmode
<div class="postarea"> <div class="postarea">
<form name="postform" id="postform" action="imgboard.php" method="post" enctype="multipart/form-data"> <form name="postform" id="postform" action="imgboard.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="$maxfilesize"> $max_file_size_input
<input type="hidden" name="parent" value="$parent"> <input type="hidden" name="parent" value="$parent">
<table class="postform"> <table class="postform">
<tbody> <tbody>
@ -243,7 +244,7 @@ EOF;
<td colspan="2" class="rules"> <td colspan="2" class="rules">
<ul> <ul>
<li>Supported file types are GIF, JPG, and PNG.</li> <li>Supported file types are GIF, JPG, and PNG.</li>
$max_file_size_html $max_file_size_rules_html
<li>Images greater than $maxdimensions will be thumbnailed.</li> <li>Images greater than $maxdimensions will be thumbnailed.</li>
$unique_posts_html $unique_posts_html
</ul> </ul>
@ -416,11 +417,16 @@ EOF;
} }
function manageRawPostForm() { function manageRawPostForm() {
$max_file_size_input_html = '';
if (TINYIB_MAXKB > 0) {
$max_file_size_input_html = '<input type="hidden" name="MAX_FILE_SIZE" value="' . strval(TINYIB_MAXKB * 1024) . '">';
}
return <<<EOF return <<<EOF
<div class="postarea"> <div class="postarea">
<form id="tinyib" name="tinyib" method="post" action="?" enctype="multipart/form-data"> <form id="tinyib" name="tinyib" method="post" action="?" enctype="multipart/form-data">
<input type="hidden" name="rawpost" value="1"> <input type="hidden" name="rawpost" value="1">
<input type="hidden" name="MAX_FILE_SIZE" value="2097152"> $max_file_size_input_html
<table class="postform"> <table class="postform">
<tbody> <tbody>
<tr> <tr>