acquire file lock in writeposts() too fix redirects fix noko for replies show thread-specific post IDs instead of IPs remove various debug messages interrupting flow diff --git a/README.md b/README.md index 55fc067..d2ddcc2 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,14 @@ small imageboard script- on devel A futaba-style imageboard script that doesn't require a database. ~~~~~~~~~~~~~~~~~~~ -#credits +# credits tripcode!q/7 - helping out with the software Pineapple - helping out aswell +qa-tari - several fixes suggested on /qa/ ~~~~~~~~~~~~~~~~~~~ -# Admin pannel Installation +# Admin panel installation ~~~~~~~~~~~~ -> sudo apt install php-mbstring make sure php-mbstring is installed @@ -18,20 +19,18 @@ make sure php-mbstring is installed # Installation ~~~~~~~~~~~~ make sure to install php-gd -https://www.php.net/manual/de/image.installation.php +https://www.php.net/manual/image.installation.php imagecreatefromjpeg is in plain php undefined -debian: +On Debian: -> sudo apt install php-gd -if you need help answer's are here: https://stackoverflow.com/questions/13338339/imagecreatefromjpeg-and-similar-functions-are-not-working-in-php - - +If you need help, answers are here: https://stackoverflow.com/questions/13338339/imagecreatefromjpeg-and-similar-functions-are-not-working-in-php To install, move all the files in the repo to a directory in the root of your webserver. For example, for a board called `/b/`, move them to /usr/share/nginx/html/b/. Create the directories `src`, -`thumb`, `bans`, `bad` and `res` and the files `posts` and `info`, +`thumb` and `res` and the files `bans`, `bad`, `posts` and `info`, make sure they are all writable to by the web server user. Should work on any unix-like system with PHP 5.5 or above and GD Library. diff --git a/post.php b/post.php index 3215553..fbd2866 100644 --- a/post.php +++ b/post.php @@ -67,8 +67,7 @@ a:visited { -'; - + '.$tp['subject'].' -Name '.$tp['name'].' '.$time.' IP:'.$tp['ip'].' No.'.$tp['id'].''; +Name '.$tp['name'].' '.$time.' ID:'.posthash($tp).' No.'.$tp['id'].''; } function old_style_image($tp){ @@ -515,7 +519,7 @@ function postform($op){ if(!ADMINOPONLY || $op > 0){ if(!LOCKED){ if(num_posts($op) < MAXREPLIES){ - $r .= '
'; + $r .= ''; $r .= ''; @@ -703,7 +707,7 @@ function writeposts($posts){ $l .= "\x1e"; } } - file_put_contents(POSTSFILE, $l); + file_put_contents(POSTSFILE, $l, LOCK_EX); } @@ -895,7 +899,6 @@ if(isset($_GET['mode'])){ $tidi = intval($_POST['thread']); if($tidi == 0) { $op = 0; } else { - print "postexists(tidi) is " . postexists($tidi); if(postexists($tidi)) { $op = $tidi; } else { abort_error(ERR_NOTFOUND); } } @@ -1117,16 +1120,19 @@ if(isset($_GET['mode'])){ insertpost($pinf); - echo ''; if($pinf['email'] == "noko"){ - echo ''; + if($op>0) { + echo ''; + } else { + echo ''; + } if($pinf['src'] != ""){ echo '

'.$pinf['file'].' uploaded. Redirecting to the thread.'; } else { echo '

Comment posted. Redirecting to the thread.

'; } } else { - echo ''; + echo ''; if($pinf['src'] != ""){ echo '

'.$pinf['file'].' uploaded.'; } else { @@ -1136,3 +1142,4 @@ if(isset($_GET['mode'])){ } } ?> +