Compare commits

..

12 Commits

7 changed files with 53 additions and 24 deletions

View File

@ -45,7 +45,7 @@ class Api {
$this->threadsPageFields = array(
'id' => 'no',
'bump' => 'last_modified',
'bump' => 'bump',
'board' => 'board',
);
@ -197,6 +197,7 @@ class Api {
$ips[] = $p->ip;
}
$apiPosts['posts'][0]['unique_ips'] = count(array_unique($ips));
$apiPosts['posts'][0]['last_modified'] = (empty($thread->posts) ? $thread : end($thread->posts))->time;
return $apiPosts;
}

View File

@ -18,6 +18,7 @@ class Filter {
private bool $add_note;
private bool $noip;
private $find_time;
private string $ip;
public function __construct(array $arr) {
foreach ($arr as $key => $value) {

View File

@ -41,7 +41,7 @@ $config['prepended_foreign_boards'] = array(
// Board categories. Only used in the "Categories" theme.
$config['categories'] = array(
'Leftypol' => array(
'Boards' => array(
'leftypol',
'b',
'WRK',
@ -563,11 +563,31 @@ $config['filters'][] = array(
$config['filters'][] = array(
'condition' => array(
'body' => '/(^|\s)((https?):\/\/)?[\w-]{2,6}\.[a-z]{2,4}\/\w{2,8}(\s|$)/i', // url shorteners are not allowed
'body' => '/(^|\s)((https?):\/\/)?[\w-]{2,6}\.[a-z]{2,4}\/\w{2,8}(#[^\s]+)?(\s|$)/i', // url shorteners are not allowed
),
'action' => 'reject',
'message' => 'Url shorteners are not allowed'
);
// Rate limit posting new threads over Tor
$config['filters'][] = array(
'condition' => array(
/*
* Confusingly `isreply` is defined as:
* $flood_post['isreply'] == $post['op']
*
* We only want to look at OP posts in the flood table.
*/
'flood-match' => array('isreply'),
'OP' => true,
'flood-time-any' => 60 * 10 // 10 minutes
),
'noip' => true,
'ip' => '127.0.0.1',
'find_time' => 60 * 60 * 1,
'action' => 'reject',
'message' => 'New threads are being created too quickly. Wait [at most] 10 minutes'
);
$config['global_message'] = '<span><a href="https://talk.leftychan.net/#/room/#welcome:matrix.leftychan.net" class="">Matrix</a></span> &nbsp; <span><a href="ircs://irc.leftychan.net:6697/#leftychan" class="">IRC Chat</a></span> &nbsp; <span><a href="mumble://leftychan.net" class="">Mumble</a></span> &nbsp; <span><a href="https://t.me/+RegtyzzrE0M1NDMx" class="">Telegram</a></span> &nbsp; <span><a href="https://discord.gg/AcZeFKXPmZ" class="">Discord</a></span>';
$config['debug'] = false;

View File

@ -103,6 +103,7 @@ $().ready(() => {
LCNPostContainer.all(dom.querySelector(`#thread_${threadPost.getInfo().getThreadId()}`)))
updateRepliesFn(thread, missingPCList)
statUniqueIPs.innerText = dom.querySelector("#lcn-uniqueips").innerText
}
const fetchThreadFn = async () => {
@ -141,7 +142,6 @@ $().ready(() => {
}
const threadEl = thread.getElement()
statUniqueIPs.innerText = threadStats.unique_ips
statReplies.innerText = thread.getReplies().length
statFiles.innerText = threadEl.querySelectorAll(".files .file").length - threadEl.querySelectorAll(".files .file .post-image.deleted").length
statPage.innerText = threadStats.page + 1

View File

@ -20,7 +20,9 @@ body {
.bar.top {
position: relative;
width: 100vw;
width: calc(100% + 8px);
box-sizing: border-box;
padding: 0 .25em;
left: -4px;
}

View File

@ -8,23 +8,18 @@
<link rel="stylesheet" media="screen" href="/stylesheets/bunker_like.css">
<style type="text/css">
.sidebar {
grid-column: 1;
grid-column: 1 / 3;
grid-row: 1 / 3;
width: 200px;
border-right-color: gray;
border-right-style: solid;
border-width: 2px;
margin-right: 15px;
}
.introduction {
grid-column: 2 / 9;
grid-column: 3 / 9;
grid-row: 1;
width: 100%;
}
.content {
grid-column: 2 / 9;
grid-column: 3 / 9;
grid-row: 2;
width: 100%;
max-width: 100%;
@ -33,8 +28,8 @@
body {
display: grid;
grid-template-columns: repeat(auto-fill,minmax(200px, 1fr));
gap: 20px;
grid-template-columns: repeat(auto-fill,minmax(120px, 20%));
min-height: 100vh;
}
.modlog {
@ -71,6 +66,16 @@
font-weight: bold;
}
footer {
grid-column: 1 / 9;
}
div.news.ban {
width: 100%;
max-width: 100%;
box-sizing: border-box;
}
@media (max-width:768px) {
body{
display: grid;

View File

@ -25,7 +25,7 @@
</header>
</div>
<div class="content">
<div class="ban">
<div class="ban news">
{% if not news %}
<p style="text-align:center" class="unimportant">{% trans %}(No news to show.){% endtrans %}</p>
{% else %}
@ -98,14 +98,14 @@
</tbody>
</table>
{% endif %}
<footer>
</div>
<footer>
<p class="unimportant" style="margin-top:20px;text-align:center;">- Tinyboard +
<a href="https://engine.vichan.net/">vichan</a> {{ config.version }} -
<br>Tinyboard Copyright &copy; 2010-2014 Tinyboard Development Group
<br><a href="https://engine.vichan.net/">vichan</a> Copyright &copy; 2012-2016 vichan-devel
<br><br>
<br><b>Leftychan.net is not currently under investigation by any Federal, State, or Local Authorities.</b></p>
</footer>
</div>
</footer>
{% endapply %}