Compare commits

...

27 Commits

Author SHA1 Message Date
towards-a-new-leftypol 9e944dc189 undo instance-config.php settings changes 2024-12-22 00:41:17 -05:00
towards-a-new-leftypol f78bf4c036 retab image.php (use vim, convert tabs to space) 2024-12-22 05:24:27 +00:00
towards-a-new-leftypol e9020ed17f Improve posting error handling
- if spamnoticer was contacted, add cleanup callback to error handler if
  something goes wrong during the rest of the process (like thumbnail
  creation for example)

- add another allowed warning (string) that gm may safely report back
  and don't call error if we see it.
2024-12-22 05:21:37 +00:00
towards-a-new-leftypol 9c1bed645e bunker_like: heading and subtitle font sizes 2024-12-01 13:07:59 +00:00
towards-a-new-leftypol 05fd69026c Up the font sizes for bunker_like a little bit 2024-12-01 12:42:43 +00:00
towards-a-new-leftypol 2cd594c2ce Fix textarea size in bunker_like theme 2024-11-29 04:25:13 -05:00
towards-a-new-leftypol f6557f4f67 bunker_like: submit button color 2024-11-27 19:23:26 -05:00
towards-a-new-leftypol e781ed5712 bunker_like: submit button color 2024-11-27 19:21:43 -05:00
towards-a-new-leftypol 952c5ad050 bunker-like css fix 2024-11-27 19:17:36 -05:00
towards-a-new-leftypol 4a2e25e5f9 fix bunker-like css tweaks 2024-11-27 19:15:51 -05:00
towards-a-new-leftypol 13ffe08443 bunker_like: padding adjust 2024-11-27 19:12:58 -05:00
towards-a-new-leftypol e27f7c3621 bunker-like: form tweaks 2024-11-27 18:55:49 -05:00
towards-a-new-leftypol 8dc190f8e1 bunkerlike form css tweaks (by 1px) 2024-11-27 18:31:17 -05:00
towards-a-new-leftypol ebb9f8a3ae retab 2024-11-27 18:29:32 -05:00
towards-a-new-leftypol bd4a5088be bunker_like css form field padding tweak 2024-11-27 18:16:54 -05:00
towards-a-new-leftypol d7e882dbde bunkerlike - fix form padding 2024-11-27 18:02:46 -05:00
towards-a-new-leftypol b0d2e73400 Bunker-like theme changes
- change post body font to 'serif'
- change border radius's to 2px (down from 5px, which was silly)
2024-11-27 14:19:39 -05:00
towards-a-new-leftypol 30d9305a2b Replace flag instead of creating a new one 2024-11-27 11:51:45 -05:00
towards-a-new-leftypol 183da23550 Add flags 2024-11-27 11:40:36 -05:00
towards-a-new-leftypol f8d359118e Add music board and a link to nukechan 2024-09-17 15:40:32 -04:00
towards-a-new-leftypol 1c13ec98ba expand.js: don't add weird spacing 2024-09-17 15:40:21 -04:00
towards-a-new-leftypol ff3e3e2358 Fix log.php 2024-08-25 17:24:53 -04:00
towards-a-new-leftypol a35dc59add Make headings bolder and brighter for better readability 2024-08-25 15:08:34 -04:00
towards-a-new-leftypol b14dac6681 Fix a rebuilding when moving (targetBoard -> originBoard) 2024-08-12 16:54:39 -04:00
towards-a-new-leftypol 0654d7f0ea 8 new banners 2024-08-08 01:26:02 -04:00
towards-a-new-leftypol 968eea515b anti-bot: do not flag missing hash values as spam 2024-07-19 15:40:25 -04:00
towards-a-new-leftypol 136caf9fa2 add banners 2024-07-19 15:21:46 -04:00
23 changed files with 670 additions and 539 deletions

BIN
banners/BANNER _d.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
banners/BANNER_58.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

BIN
banners/banner_pepe_che.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -295,13 +295,19 @@ function checkSpam(array $extra_salt = array()) {
#print_err("checkSpam start");
$extra_salt_orig = $extra_salt;
/*
if (!isset($_POST['hash'])) {
print_err("checkSpam: _POST array doesn't have key 'hash', check failed.");
dumpVars($extra_salt_orig);
return true;
}
*/
$hash = $_POST['hash'];
if (isset($_POST['hash'])) {
$hash = $_POST['hash'];
} else {
$hash = "";
}
if (!empty($extra_salt)) {
// create a salted hash of the "extra salt"
@ -336,7 +342,12 @@ function checkSpam(array $extra_salt = array()) {
// Use SHA1 for the hash
$_hash = sha1($_hash . $extra_salt);
if ($hash != $_hash) {
if (empty($hash)) {
print_err("checkSpam: hash is either empty or was never present, check failed. Not flagging as spam however.");
dumpVars($extra_salt_orig);
// Ignore missing hash, because it was missing for some legitimate posters and bots tend to fill in any field.
return false;
} else if ($hash != $_hash) {
print_err("checkSpam: Hash values do not match! submitted hash value from POST data: $hash ; Computed hash value: $_hash");
dumpVars($extra_salt_orig);
return true;

View File

@ -24,6 +24,42 @@ register_shutdown_function('fatal_error_handler');
$error_recursion=false;
/*
* Global anything is always a bad idea, but since all of this website's error handling comes
* down to calling this error function and quitting, we have no way of catching exceptions, for example
* during thumbnail creation.
*
* So push things to run in case of a crash into a list, and then run all of them in error.
*
* This will be exclusive to callbacks for posting a post callflow, not mod actions or anything else.
*/
function global_post_cleanup() {
global $post_cleanup_list;
foreach ($post_cleanup_list as $f) {
$f();
}
unset($post_cleanup_list);
}
function push_global_post_cleanup($f) {
global $post_cleanup_list;
if (!isset($post_cleanup_list)) {
$post_cleanup_list = array($f);
} else {
array_push($post_cleanup_list, $f);
}
}
function init_global_post_cleanup() {
global $post_cleanup_list;
$post_cleanup_list = array();
}
function error($message, $priority = true, $debug_stuff = false) {
global $board, $mod, $config, $db_error, $error_recursion;
@ -75,11 +111,14 @@ function error($message, $priority = true, $debug_stuff = false) {
$data['debug']=$debug_stuff;
}
print json_encode($data);
global_post_cleanup();
exit();
}
header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error');
global_post_cleanup();
die(Element('page.html', array(
'config' => $config,
'title' => _('Error'),

File diff suppressed because it is too large Load Diff

View File

@ -22,6 +22,7 @@ $config['boards'] = array(
'edu',
'ga',
'ent',
'music',
'777',
'posad',
'i',
@ -50,6 +51,7 @@ $config['categories'] = array(
'edu',
'ga',
'ent',
'music',
'777',
'posad',
'i',
@ -67,7 +69,8 @@ $config['custom_categories'] = array(
'New Multitude' => 'https://newmultitude.org',
'Booru image repository' => 'https://lefty.pictures',
'Official chat room' => 'https://talk.leftychan.net/#/room/#welcome:matrix.leftychan.net',
'Gitea instance' => 'https://git.leftychan.net',
'Nukechan' => 'https://nukechan.net',
#'Gitea instance' => 'https://git.leftychan.net',
'Rules' => 'rules.html',
'Search' => 'search.php',
),
@ -259,6 +262,7 @@ $config['user_flags'] = array (
'egalitarianism' => 'Egalitarianism',
'egoism' => 'Egoism',
'eristocracy' => 'Έριστοκρατία',
'Eurasianism' => 'Eurasianism',
'eureka' => 'Eureka',
'eurocommunism' => 'Eurocommunism',
'farc' => 'Las FARC',
@ -285,7 +289,7 @@ $config['user_flags'] = array (
'marxism_blackpilism' => 'Marxism Blackpillism',
'mutualism' => 'Mutualism',
'naxalite' => 'Naxalite',
'nazbol' => 'Nazbol',
'nazbol' => 'National Bolshevik',
'nazi' => 'Nazi',
'ndfp' => 'NDFP',
'palestine' => 'Palestine',
@ -312,12 +316,14 @@ $config['user_flags'] = array (
'syndicalism' => 'Syndicalism',
'tankie' => 'Tankie',
'technocracy' => 'Technocracy',
'The_Other_Russia' => 'The Other Russia',
'think' => 'Think',
'transhumanism' => 'Transhumanism',
'united_farm_workers' => 'United Farm Workers',
'viet_cong' => 'Viet Cong',
'ypg' => 'YPG',
'yugoslavia' => 'Yugoslavia'
'yugoslavia' => 'Yugoslavia',
'zgang' => 'Z Gang'
);

View File

@ -1501,7 +1501,7 @@ function mod_move($originBoard, $postID) {
} else {
deletePost($postID);
buildIndex();
rebuildThemes('post', $targetBoard);
rebuildThemes('post', $originBoard);
openBoard($targetBoard);
header('Location: ?/' . sprintf($config['board_path'], $newboard['uri']) . $config['dir']['res'] . link_for($op, false, $newboard), true, $config['redirect_http']);

View File

@ -32,11 +32,13 @@ $(document).ready(function(){
thread.find('div.hidden').remove();
var post_in_doc = thread.find('#' + $(this).attr('id'));
if(post_in_doc.length == 0) {
/*
if(last_expanded) {
$(this).addClass('expanded').insertAfter(last_expanded).before('<br class="expanded">');
} else {
$(this).addClass('expanded').insertAfter(thread.find('div.post:first')).after('<br class="expanded">');
}
*/
last_expanded = $(this);
$(document).trigger('new_post', this);
} else {

View File

@ -1,6 +1,6 @@
<?php
include 'inc/functions.php';
include 'inc/mod/pages.php';
require_once 'inc/functions.php';
require_once 'inc/mod/pages.php';
if (!isset($_GET['board']) || !preg_match("/{$config['board_regex']}/u", $_GET['board'])) {
http_response_code(400);

View File

@ -457,6 +457,8 @@ function validate_images(array $post_array) {
function handle_post(){
global $config,$dropped_post,$board, $mod,$pdo;
init_global_post_cleanup();
if (!isset($_POST['body'], $_POST['board']) && !$dropped_post) {
error($config['error']['bot']);
}
@ -1036,6 +1038,17 @@ function handle_post(){
$spam_noticer_result = checkWithSpamNoticer($config, $post, $board['uri']);
/*
* If we have an error with posting this later, send back the
* delete token to spamnoticer to remove the post from the recent
* posts table. (see error.php for the error cleanup function)
*/
$f_spamnoticer_cleanup_on_err = function() use ($config, $delete_token) {
removeRecentPostFromSpamnoticer($config, array($delete_token));
};
push_global_post_cleanup($f_spamnoticer_cleanup_on_err);
if ($spam_noticer_result->succeeded && $spam_noticer_result->noticed) {
error($config['error']['spam_noticer'] . $spam_noticer_result->reason);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 669 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 625 B

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
static/flags/zgang.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

View File

@ -3,184 +3,220 @@ div.sidearrows {
}
body {
background: #1D1F21;
color: #ACACAC;
font-family: Courier, monospace;
font-size: 13px;
background: #1D1F21;
color: #ACACAC;
font-family: Courier, monospace;
font-size: 15px;
}
.theme-catalog .replies {
font-family: serif;
}
div.post div.body {
font-family: serif;
}
span.heading {
font-size: 15px;
}
.theme-catalog .replies .meta,
.theme-catalog .replies .intro,
div.post div.body a,
div.post div.body .toolong {
font-family: Courier, monospace;
}
/* LINKS */
a, a:link, a:visited, .intro a.email span.name {
color: #FFB300;
text-decoration: none;
color: #FFB300;
text-decoration: none;
}
a:link:hover, a:visited:hover {
color: #FFB300;
text-shadow: 0px 0px 5px #117743;
color: #FFB300;
text-shadow: 0px 0px 5px #117743;
}
div.pages a.selected {
color: #FFB300;
color: #FFB300;
}
/* INTRO */
h1, div.title, header div.subtitle {
color: #663E11;
font-family: Courier, monospace;
color: #FFB300;
font-family: Courier, monospace;
}
h1 {
font-size: 24pt;
font-weight: normal;
letter-spacing: 0px;
font-size: 18pt;
font-weight: bold;
letter-spacing: 0px;
}
header div.subtitle {
font-size: 12pt;
font-size: 10pt;
}
/* FORMS AND BUTTONS */
div.banner {
background-color: inherit;
color: #ACACAC;
background-color: inherit;
color: #ACACAC;
}
form table {
border: 1px dashed #117743;
padding-right: 1px;
border: 1px dashed #117743;
padding-right: 1px;
border-radius: 3px;
}
form table tr th {
background: #282A2E;
border: 1px solid #117743;
border-radius: 5px;
background: #282A2E;
border: 1px solid #117743;
border-radius: 2px;
padding: 3px;
}
input[type="text"], input[type="password"], textarea, select {
border: 1px double #07371F;
border-radius: 5px;
background: #282A2E;
color: #ACACAC;
font-family: Courier, monospace;
border: 1px double #07371F;
border-radius: 2px;
background: #282A2E;
color: #ACACAC;
font-family: Courier, monospace;
margin: 0 1px;
padding: 3px !important;
box-sizing: border-box;
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
box-shadow: 0px 0px 5px 2px #117743;
box-shadow: 0px 0px 5px 2px #117743;
}
input[type="submit"] {
border: 3px double #07371F;
border-radius: 5px;
background: #16171A;
color: #ACACAC;
font-family: Courier, monospace;
font-weight: bold;
border: 3px double #07371F;
border-radius: 2px;
background-color: #07371F;
color: #ACACAC;
font-family: Courier, monospace;
font-weight: bold;
font-size: 16px;
}
input[type="submit"]:hover {
border-color: #117743;
background-color: #117743;
}
.dropzone {
background: #16171A;
border: 3px double #07371F;
color: #ACACAC;
background: #16171A;
border: 1px solid #07371F;
color: #ACACAC;
border-radius: 2px;
margin: 0 2px;
}
.dropzone .file-hint {
color: #ACACAC;
font-weight: bold;
color: #ACACAC;
font-weight: bold;
}
#quick-reply table {
background: #1D1F21 !important;
background: #1D1F21 !important;
}
fieldset {
border: 1px dashed #117743;
border: 1px dashed #117743;
}
/* POST IDENTIFIERS */
.intro span.subject {
color: #34ED3A;
color: #34ED3A;
}
.intro span.name {
color: #117743;
color: #117743;
}
.intro span.trip {
color: #117743;
color: #117743;
}
.intro a.capcode, p.intro a.nametag {
color: #FF0000;
font-weight: bold;
color: #FF0000;
font-weight: bold;
}
.intro a.email, p.intro a.email span.name, p.intro a.email:hover, p.intro a.email:hover span.name {
color: #34ED97;
color: #34ED97;
}
.intro time {
font-weight: bold;
font-weight: bold;
}
.intro a.post_no {
color: #ACACAC;
font-weight: bold;
color: #ACACAC;
font-weight: bold;
}
/* POST BOXES */
div.post.reply {
background: #282A2E;
border: 1px solid #117743;
border-radius: 5px;
background: #282A2E;
border: 1px solid #117743;
border-radius: 2px;
}
div.post.reply.highlighted {
background: rgba(59, 22, 43, 0.4);
border: 1px solid #117743;
border-radius: 5px;
background: rgba(59, 22, 43, 0.4);
border: 1px solid #117743;
border-radius: 2px;
}
/* POST CONTENT */
div.post.reply div.body a {
color: #FFB300;
color: #FFB300;
}
.quote {
color: #789922;
color: #789922;
}
/* BARS */
.bar {
background-color: #151515;
background-color: #151515;
}
.bar.top {
border-bottom: 1px solid #B0790A;
border-bottom: 1px solid #B0790A;
}
.bar.bottom {
border-top: 1px solid #B0790A;
border-top: 1px solid #B0790A;
}
div.boardlist {
color: #ACACAC;
color: #ACACAC;
}
hr {
border: none;
border-top: 1pt solid #117743;
border: none;
border-top: 1pt solid #117743;
}
/* CATALOG */
.theme-catalog h1 {
color: #ACACAC;
font-size: 18pt;
font-weight: bold;
color: #ACACAC;
font-size: 18pt;
font-weight: bold;
}
.theme-catalog h1 a {
font-weight: normal;
font-weight: normal;
}
.theme-catalog div.thread, .theme-catalog div.thread:hover {
background: #282A2E;
border: 1px solid #117743;
border-radius: 5px;
font-size: 10pt;
background: #282A2E;
border: 1px solid #117743;
border-radius: 2px;
font-size: 11pt;
}
/* OPTIONS */
#options_div, #alert_div {
background: #1D1F21;
border: 1px dashed #117743;
background: #1D1F21;
border: 1px dashed #117743;
}
#options_tablist {
border-right: 1px dashed #117743;
border-right: 1px dashed #117743;
}
.options_tab_icon {
color: #ACACAC;
color: #ACACAC;
}
.options_tab_icon.active {
color: #FFB300;
color: #FFB300;
}
/* FIXES */
div.ban {
background: #1D1F21;
background: #1D1F21;
border: 1px dashed #117743;
}
@ -225,7 +261,7 @@ table thead th {
}
.theme-catalog .thread .meta {
font-size: 10pt;
font-size: 13px;
}
.theme-catalog .thread.grid-size-small .replies {