35 lines
1.2 KiB
Bash
35 lines
1.2 KiB
Bash
#!/bin/bash
|
|
domainprefix='https://megumin.tech/boards'
|
|
|
|
meta[title]='bashchan'
|
|
meta[css]='style.css'
|
|
source templates/head.sh
|
|
|
|
echo "<body>
|
|
<div class='center'>
|
|
<a href='./'><img id='branding' src='/img/branding_chinacat.png'><br>
|
|
bashchan</a> - a place for all your shitposts
|
|
</div>
|
|
"
|
|
IFS=$'\n'
|
|
for i in $(ls -t storage/threads); do
|
|
IFS=':'
|
|
array=($(cat storage/threads/$i | head -n 1))
|
|
echo "<a href='thread.shs?id=$i' class='nolinkdecoration'><div class='post'>"
|
|
if [[ ${array[1]} != '' ]]; then
|
|
echo "<span class='thread_title'>${array[1]}</span> | "
|
|
fi
|
|
echo "<span class='poster'>${array[0]}</span><br><img src='$domainprefix/i/${array[3]}' class='pic'>${array[2]}</div></a><hr>"
|
|
done
|
|
|
|
|
|
echo "<div class='center'><h2>Submit a new thread</h2>
|
|
<form enctype='multipart/form-data' action='post.shs' method='post' id='post'>
|
|
<input type='hidden' name='rel' value='new'>
|
|
<input type='hidden' name='a' value='broken'>
|
|
<input type='text' name='title' class='title' placeholder='Title' required><br>
|
|
<textarea name='msg' class='msg' placeholder='Message'></textarea><br>
|
|
<input type='file' name='file' class='file' accept='image/*'>
|
|
<input type='submit' value='Submit' class='submit'>
|
|
</form></center>"
|