various fixes

tomorrow mod fix
download button compatibility fix
thumbnail res rounding fix
various html valid fixes
This commit is contained in:
Sanpaku 2021-10-09 23:17:39 +02:00
parent ad5d92173a
commit ad852ab14c
14 changed files with 35 additions and 94 deletions

View File

@ -131,7 +131,7 @@ html[data-stylesheet="Tomorrow"] .catalog .container:hover {
}
html[data-stylesheet="Tomorrow"] .box.left, html[data-stylesheet="Tomorrow"] .box.right {
background: #111;
background: #282a2e;
color: #ACACAC;
border: 1px solid #000;
}

View File

@ -92,6 +92,9 @@ a:hover, .post-number a:hover {
a.download, a.download:visited {
text-decoration: none!important;
transform: rotate(90deg);
display: inline-block;
font-weight: bold;
}
div.file-info a {

View File

@ -1,60 +0,0 @@
<?php
session_start();
$permitted_chars = '3456ABCDEFGHJKLMNPQRSRUVWXY';
function generate_string($input, $strength = 10) {
$input_length = strlen($input);
$random_string = '';
for($i = 0; $i < $strength; $i++) {
$random_character = $input[mt_rand(0, $input_length - 1)];
$random_string .= $random_character;
}
$random_string = strtolower($random_string);
return $random_string;
}
$image = imagecreatetruecolor(200, 50);
imageantialias($image, true);
$colors = [];
$red = rand(125, 175);
$green = rand(125, 175);
$blue = rand(125, 175);
for($i = 0; $i < 5; $i++) {
$colors[] = imagecolorallocate($image, $red - 20*$i, $green - 20*$i, $blue - 20*$i);
}
imagefill($image, 0, 0, $colors[0]);
for($i = 0; $i < 10; $i++) {
imagesetthickness($image, rand(2, 10));
$line_color = $colors[rand(1, 4)];
imagerectangle($image, rand(-10, 190), rand(-10, 10), rand(-10, 190), rand(40, 60), $line_color);
}
$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image, 255, 255, 255);
$textcolors = [$white, $white];
$fonts = [__dir__ .'/../assets/fonts/captcha0.ttf', __dir__ .'/../assets/fonts/captcha0.ttf', __dir__ .'/../assets/fonts/captcha0.ttf', __dir__ .'/../assets/fonts/captcha0.ttf'];
$string_length = 6;
$captcha_string = generate_string($permitted_chars, $string_length);
$_SESSION['captcha_text'] = $captcha_string;
for($i = 0; $i < $string_length; $i++) {
$letter_space = 170/$string_length;
$initial = 15;
imagettftext($image, 24, rand(-15, 15), $initial + $i*$letter_space, rand(25, 45), $textcolors[rand(0, 1)], $fonts[array_rand($fonts)], $captcha_string[$i]);
}
header('Content-type: image/png');
imagepng($image);
imagedestroy($image);
?>

View File

@ -208,7 +208,7 @@ if ($allow_files !== true && isset($_FILES['file'])) {
$new_height = 1;
}
$thmb_res = $new_width . 'x' . $new_height;
$thmb_res = floor($new_width) . 'x' . floor($new_height);
if ($fileext_ == '.jpg' || $fileext_ == '.jpeg') {
$old_image = ImageCreateFromJPEG($_FILES['file']['tmp_name']);

View File

@ -369,8 +369,7 @@ if ($logged_in == false) {
include $path . '/templates/boardlist.html';
echo '<div class="page-info"><h1>Login Page</h1><div class="small">Permission required.</div></div><br><br>';
echo '<div class="main first"><h2>Login.</h2>';
echo '<p>
<div id="post-form">
echo '<div id="post-form">
<form name="login" action="' . $prefix_folder . '/mod.php" method="post">
<table id="login" style="margin:auto;">
<tr><th>Username</th><td><input type="text" name="username" size="25" maxlength="256" autocomplete="off" placeholder="Username"></td></tr>
@ -379,8 +378,7 @@ if ($logged_in == false) {
checked><label for="remember">Remember Me</label><input type="submit" name="post" value="Login" style="float: right;"></td></tr>
</table>
</form>
</div>
</p>';
</div>';
echo '</div>';
if ($changed_password == true) {

View File

@ -281,7 +281,7 @@ if (in_Array(htmlspecialchars($_GET["board"]), $config['boardlist'])) {
for ($i = 0; $i < $pages; $i++) {
$currentp = $i + 1;
if ($currentp == $number_page) {
$all_pages .= '[<a href="' . $prefix_folder . '/?board=' . $current_board . '&page=' . $currentp. '"><b>' . $currentp . '</a></b>] ';
$all_pages .= '[<a href="' . $prefix_folder . '/?board=' . $current_board . '&page=' . $currentp. '"><b>' . $currentp . '</b></a>] ';
} else {
$all_pages .= '[<a href="' . $prefix_folder . '/?board=' . $current_board . '&page=' . $currentp. '">' . $currentp . '</a>] ';
}

View File

@ -3,13 +3,13 @@
<span class="icons">
<?php
if ($info_sticky == 1) {
echo '<span title="Sticky" class="icon"><img width="16px" height="16px" src="'. $prefix_folder .'/assets/img/' . $icon_sticky . '"/></span>';
echo '<span title="Sticky" class="icon"><img width="16" height="16" src="'. $prefix_folder .'/assets/img/' . $icon_sticky . '"/></span>';
}
if ($info_locked == 1) {
echo '<span title="Locked" class="icon"><img width="16px" height="16px" src="'. $prefix_folder .'/assets/img/' . $icon_locked . '"/></span>';
echo '<span title="Locked" class="icon"><img width="16" height="16" src="'. $prefix_folder .'/assets/img/' . $icon_locked . '"/></span>';
}
if ($info_autosage == 1) {
echo '<span title="Autosage" class="icon"><img width="16px" height="16px" src="'. $prefix_folder .'/assets/img/' . $icon_autosage . '"/></span>';
echo '<span title="Autosage" class="icon"><img width="16" height="16" src="'. $prefix_folder .'/assets/img/' . $icon_autosage . '"/></span>';
}
?>
</span>

View File

@ -60,16 +60,16 @@
if (isset($current_board) && $current_board != '') {
if ($config["boards"][$current_board]["type"] == "txt") {
foreach($config['css_text'] as $theme) {
echo '&nbsp;[<a href="' . $prefix_folder . $main_file . '/?board=' . $current_board . '&thread=' . $current_thread . '&theme=' . $theme . '">' . $theme . '</a>]';
echo '&nbsp;[<a href="' . $prefix_folder . $main_file . '/?board=' . $current_board . '&thread=' . $current_thread . '&theme=' . rawurlencode($theme) . '">' . $theme . '</a>]';
}
} else {
foreach($config['css'] as $theme) {
echo '&nbsp;[<a href="' . $prefix_folder . $main_file . '/?board=' . $current_board . '&thread=' . $current_thread . '&theme=' . $theme . '">' . $theme . '</a>]';
echo '&nbsp;[<a href="' . $prefix_folder . $main_file . '/?board=' . $current_board . '&thread=' . $current_thread . '&theme=' . rawurlencode($theme) . '">' . $theme . '</a>]';
}
}
} else {
foreach($config['css'] as $theme) {
echo '&nbsp;[<a href="' . $prefix_folder . $main_file . '/?board=' . $current_board . '&thread=' . $current_thread . '&theme=' . $theme . '">' . $theme . '</a>]';
echo '&nbsp;[<a href="' . $prefix_folder . $main_file . '/?board=' . $current_board . '&thread=' . $current_thread . '&theme=' . rawurlencode($theme) . '">' . $theme . '</a>]';
}
}
?> </details>

View File

@ -22,19 +22,19 @@
<?php
echo '<table id="boards">';
echo '<thead><th>Board</th><th>Description</th><th>Posts</th></thead>';
echo '<tbody>';
foreach ($config['boards'] as $boards) {
if ($boards['hidden'] === 0) {
echo '<tr><th><a href="' . $prefix_folder . '/' . $main_file . '?board=';
echo $boards['url'];
echo '">';
echo '/' . $boards['url'] . '/' . ' - ' . $boards['title'];
echo '</a></th><th>' . $boards['description'] . '</td></th>';
echo '</a></th><th>' . $boards['description'] . '</th>';
$board_counter = file_get_contents($path . '/' . $database_folder . '/boards/' . $boards['url'] . '/counter.php') - 1;
echo '<th>' . $board_counter . '</th>';
}
}
echo '</tr>';
echo '</table>';
?>

View File

@ -1,6 +1,6 @@
<title><?php echo $title; ?></title>
<!--- SETTINGS --->
<!--SETTINGS-->
<script>
<?php if ($captcha_requires = true) { echo 'var captcha_required = true;'; } ?>
var install_location = '<?php echo $prefix_folder; ?>';
@ -18,7 +18,7 @@ var default_theme = '<?php echo $default_theme ?>';
?>
</script>
<!--- LOAD THEME IMMEDIATELY --->
<!--LOAD THEME IMMEDIATELY-->
<script>
<?php
if (isset($current_board) && $current_board != '') {
@ -46,7 +46,7 @@ if (isset($current_board) && $current_board != '') {
<?php
foreach ($config['css'] as $css) {
echo '<link rel="stylesheet" type="text/css" href="' . $prefix_folder . '/assets/css/' . $css . '.css">';
echo '<link rel="stylesheet" type="text/css" href="' . $prefix_folder . '/assets/css/' . rawurlencode($css) . '.css">';
}
?>

View File

@ -4,12 +4,11 @@
<form enctype="multipart/form-data" name="post" action="<?php echo $prefix_folder; ?>/post.php" method="post">
<table>
<!-- Hidden Inputs --->
<!--Hidden Inputs-->
<?php echo '<input type="hidden" id="board" name="board" value="' . $current_board .'">';?>
<?php if ($current_page === 'thread') { echo '<input type="hidden" id="thread" name="thread" value="thread">'; } ?>
<?php if ($current_page === 'thread') { echo '<input type="hidden" id="thread_number" name="thread_number" value="' . $post_number_op . '">'; } ?>
<?php if ($current_page === 'index' || $current_page === 'catalog') { echo '<input type="hidden" id="index" name="index" value="index">'; } ?>
<?php
if ($forced_anon !== true) {
@ -59,12 +58,13 @@
<?php
echo '<tr>';
echo '<th>Comment</th>';
echo '<td>';
if ($info_locked == 1 && $config['mod']['post_in_locked'] > $mod_level) {
echo '<td><textarea name="body" id="body" rows="5" cols="30" disabled></textarea></td>';
echo '<textarea name="body" id="body" rows="5" cols="30" disabled></textarea>';
} else {
echo '<td><textarea name="body" id="body" rows="5" cols="30"></textarea></td>';
echo '<textarea name="body" id="body" rows="5" cols="30"></textarea>';
}
echo '</tr>';
echo '<input style="height:1;width:1;float:right;visibility:hidden;" type="text" id="username" name="username" value=""></td></tr>';
?>
<?php if ($captcha_required == (true) && ($current_page == ('thread') && ($info_locked != 1 || $config['mod']['post_in_locked'] <= $mod_level) || $current_page == ('index') || $current_page == ('catalog'))) {
echo '<tr><th>Verification</th><td><img height="50" width="198" id="captcha" src="' . $prefix_folder . '/captcha.php' .'"/><br><input id="captcha-field" type="text" name="captcha" minlength="6" maxlength="6" autocomplete="off" required></td>

View File

@ -52,7 +52,7 @@
<tr>
<td><input type="text" id="reason_' . $post_number_reply . '" name="reason" maxlength="256" autocomplete="off" value="" placeholder="Reason"></td>
<td><input type="submit" name="report" value="Report"></td>
<td><label for="global_' . $post_number_reply . '"><input type="checkbox" id="global_' . $post_number_reply . '" name="global"></input>Global</label></td>
<td><label for="global_' . $post_number_reply . '"><input type="checkbox" id="global_' . $post_number_reply . '" name="global">Global</label></td>
</tr>
</tbody>
</table>
@ -107,10 +107,10 @@
if (isset($file_download)) {
switch($file_download) {
case 'original':
echo '&nbsp;<a title="Download as ' . $reply_file[0][2] . '" class="download" href="' . $prefix_folder . '/' . $uploads_folder . '/' . $current_board . '/' . $reply_file[0][1] . '" download="' . $reply_file[0][2] . '">🠋</a>';
echo '&nbsp;<a title="Download as ' . $reply_file[0][2] . '" class="download" href="' . $prefix_folder . '/' . $uploads_folder . '/' . $current_board . '/' . $reply_file[0][1] . '" download="' . $reply_file[0][2] . '"></a>';
break;
case 'server':
echo '&nbsp;<a title="Download as ' . $reply_file[0][1] . '" class="download" href="' . $prefix_folder . '/' . $uploads_folder . '/' . $current_board . '/' . $reply_file[0][1] . '" download="' . $reply_file[0][1] . '">🠋</a>';
echo '&nbsp;<a title="Download as ' . $reply_file[0][1] . '" class="download" href="' . $prefix_folder . '/' . $uploads_folder . '/' . $current_board . '/' . $reply_file[0][1] . '" download="' . $reply_file[0][1] . '"></a>';
break;
default:
break;

View File

@ -26,10 +26,10 @@
if (isset($file_download)) {
switch($file_download) {
case 'original':
echo '&nbsp;<a title="Download as ' . $op_file[0][2] . '" class="download" href="' . $prefix_folder . '/' . $uploads_folder . '/' . $current_board . '/' . $op_file[0][1] . '" download="' . $op_file[0][2] . '">🠋</a>';
echo '&nbsp;<a title="Download as ' . $op_file[0][2] . '" class="download" href="' . $prefix_folder . '/' . $uploads_folder . '/' . $current_board . '/' . $op_file[0][1] . '" download="' . $op_file[0][2] . '"></a>';
break;
case 'server':
echo '&nbsp;<a title="Download as ' . $op_file[0][1] . '" class="download" href="' . $prefix_folder . '/' . $uploads_folder . '/' . $current_board . '/' . $op_file[0][1] . '" download="' . $op_file[0][1] . '">🠋</a>';
echo '&nbsp;<a title="Download as ' . $op_file[0][1] . '" class="download" href="' . $prefix_folder . '/' . $uploads_folder . '/' . $current_board . '/' . $op_file[0][1] . '" download="' . $op_file[0][1] . '"></a>';
break;
default:
break;
@ -166,7 +166,7 @@
<tr>
<td><input type="text" id="reason_' . $post_number_op . '" name="reason" maxlength="256" autocomplete="off" value="" placeholder="Reason"></td>
<td><input type="submit" name="report" value="Report"></td>
<td><label for="global_' . $post_number_op . '"><input type="checkbox" id="global_' . $post_number_op . '" name="global"></input>Global</label></td>
<td><label for="global_' . $post_number_op . '"><input type="checkbox" id="global_' . $post_number_op . '" name="global">Global</label></td>
</tr>
</tbody>
</table>
@ -197,13 +197,13 @@
<?php
if ($info_sticky == 1) {
echo '<span title="Sticky" class="icon"><img width="16px" height="16px" src="'. $prefix_folder .'/assets/img/' . $icon_sticky . '"/></span>';
echo '<span title="Sticky" class="icon"><img width="16" height="16" src="'. $prefix_folder .'/assets/img/' . $icon_sticky . '"/></span>';
}
if ($info_locked == 1) {
echo '<span title="Locked" class="icon"><img width="16px" height="16px" src="'. $prefix_folder .'/assets/img/' . $icon_locked . '"/></span>';
echo '<span title="Locked" class="icon"><img width="16" height="16" src="'. $prefix_folder .'/assets/img/' . $icon_locked . '"/></span>';
}
if ($info_autosage == 1) {
echo '<span title="Autosage" class="icon"><img width="16px" height="16px" src="'. $prefix_folder .'/assets/img/' . $icon_autosage . '"/></span>';
echo '<span title="Autosage" class="icon"><img width="16" height="16" src="'. $prefix_folder .'/assets/img/' . $icon_autosage . '"/></span>';
}
?>

View File

@ -1 +1 @@
0.90
0.91