[ home / rules / faq ] [ overboard / sfw / alt ] [ leftypol / siberia / hobby / tech / edu / games / anime / music / draw / AKM ] [ meta / roulette ] [ cytube / git ] [ GET / ref / marx / booru / zine ]

/tech/ - Technology

"Technology reveals the active relation of man to nature" - Karl Marx
Name
Options
Subject
Comment
Flag
File
Embed
Password (For file deletion.)

Join our Matrix Chat <=> IRC: #leftypol on Rizon


File: 1612129656526.gif (2.28 MB, 224x240, 1608608621350.gif)

 No.6724[View All]

This thread is only for feedback related to technical issues (bug reports, suggestions). Otherwise use /meta/.
Public Repo:
https://git.leftypol.org/leftypol/leftypol
If you have any grievances you can make a PR.

Mobile Support:
https://github.com/PietroCarrara/Clover/releases/latest
Thread For Mobile Feedback: >>>/tech/6316

Onion Link:
76i2c3hn55fcj5nut3tqlboqqbbh23zvphv7lefk3vftpx6wketlanyd.onion

Cytube:
https://tv.leftypol.org

Matrix rooms:
https://matrix.to/#/#leftypolPublic:matrix.org

We are currently working on improvements to the site, subject to the need of the tech team to sleep and go to their day jobs. If you need more immediate feedback please join the matrix room[s] and ask around. Feel free to leave comments, concerns, and suggestions about the tech side of the site here and we will try to get to it as soon as possible

Archived thread:
>>>/leftypol_archive/903
394 posts and 82 image replies omitted. Click reply to view.

 No.14865

>>14862
That is a patch for files served to you by the backend. So first we wait patiently until the techs apply the patch on the backend. After that, if you don't like the default visual marking for deleted posts, you put
div.post.reply.auto-reload-removed {
  border: ...;
  ...
}

into User CSS and replace the ellipses with your own rules.
https://developer.mozilla.org/en-US/docs/Web/CSS/border#syntax

 No.14998

you made a mistake in https://leftypol.org/robots.txt
remove the last "Allow: /" line because A) it overrides all your preceding disallow rules, and B) is redundant/unnecessary, since anything not disallowed is already allowed by default
read https://www.robotstxt.org/robotstxt.html

 No.15005

your rotating banner system (/banners.php) is inefficient because it's impossible for users to cache these images in their browsers. everyone is constantly re-downloading previously-seen banners.

you can see if a file is already cached or is downloaded by refreshing a page (e.g. https://leftypol.org/banners.php ) by checking http responses in firefox in the Network tab in Firefox Developer Tools (ctrl+shift+i) and seeing if it says "cached" under the "Transferred" column for the file

you can instead make it so twig serves the direct path to a random image from your banners folder instead of sending it to your inlined banners.php image file stream so that browsers can actually cache these images. this can speed up frequent visitors' page loads and reduce a bit of bandwidth per frequent visitor.

1. go to /inc/lib/Twig/Extensions/Extension/Tinyboard.php
2. add this line in that list of Twig extension functions:
new Twig_SimpleFunction('random_banner_url', 'twig_random_banner_url'),

(don't forget to put a comma at the end of that previous item or you'll get php error / blank page)
3. at the end of the file add this function definition:
function twig_random_banner_url() {
	$path = dirname(__DIR__, 5) . '/banners/';
	$isDirEmpty = true;
	
	if (!file_exists($path)) {
		return '/static/blank.gif';
	}
	
	$handle = opendir($path);
	while (false !== ($entry = readdir($handle))) {
		if ($entry != "." && $entry != "..") {
			$isDirEmpty = false;
			break;
		}
	}
	closedir($handle);
	
	if (!$isDirEmpty) {
		$files = scandir($path);
		$files = array_diff($files, array('.', '..'));
		return '/banners/' . $files[array_rand($files)];
	}
	return '/static/blank.gif';
}

4. go to /templates/index.html, and change
<img class="board_image" src="{{ config.url_banner }}"

to
<img class="board_image" src="{{ random_banner_url() }}"

5. do the exact same thing in #4 for /templates/thread.html, /templates/generic_page.html, and /templates/themes/index/index.html
6. rebuild all boards/threads in mod.php and test new banner system

obviously you need to test this in a dev environment first, i did this on vichan but it looks like it's identical on lainchan. the only minor drawback is that the banner changes on each thread/index based on user actions (a new reply, thread, delete, mod action, etc.) instead of refreshing the browser due to twig's caching system, but because leftypol has high enough traffic this will not be a problem, it will change frequently enough and it's worth it for the improved page load times and minor bandwidth savings of frequent visitors not having to constantly re-download previously-seen banner images. also in theory this may reduce cpu usage a bit because the banners.php opcode is no longer executed each time any user refreshes his browser or goes to a different page, whereas this new twig function would execute only on user actions which are obviously far less frequent than refreshes / page loads. the other minor issue is it will ignore whatever you set $config['url_banner'] in instance-config.php, it will only pull images from a "/banners" folder if it exists, can't think of a way right now to have this twig function work together with that, you can put a TODO comment on this function to change it later, i don't think it's a real priority.

 No.15016

>>15005
> $isDirEmpty
If the directory is not empty, you call scandir on it. If the directory is empty, scandir would do no more work than your while loop. What is the purpose of prescanning the directory instead of testing whether the result of array_diff is empty?

> the other minor issue is it will ignore whatever you set $config['url_banner'] in instance-config.php, it will only pull images from a "/banners" folder if it exists, can't think of a way right now to have this twig function work together with that

The twig_* functions can take parameters from the calling templates. The templates can take parameters in their Element(template_source, array) invocations. The invokers of Element(template_source, array) will pass in config values for whichever openBoard call is in effect at the time. >>12386

 No.15018

>>15016
>>15005
function in step 3 is now:
function twig_random_banner_url($path) {
	if (substr($path, -1) !== "/") {
		$path = $path . '/';
	}
	$path_twig_relative = dirname(__DIR__, 5) . $path;

	if (!file_exists($path_twig_relative)) {
		return '/static/blank.gif';
	}

	$files = scandir($path_twig_relative);
	$files = array_diff($files, array('.', '..'));
	if ($files) {
		return $path . $files[array_rand($files)];
	}
	return '/static/blank.gif';
}

in step 4 & 5 it is now:
<img class="board_image" src="{{ random_banner_url(config.url_banner) }}"

and now there's a new step between 5 and 6:
5.5. in instance-config.php set $config['url_banner'] to "/banners/" or "/banners" (either will work)

 No.15020

A note about Anon's >>15018 updated code. While it will pick up the correct config.url_banner in single-board template calls, on the overboard index pages, which feature banners, it will pick up the config.url_banner of whichever board had the last thread in the $top_threads, because that board had the last openBoard call in buildOne.
https://git.leftypol.org/leftypol/leftypol/src/commit/631a5b5fc705252697734c74a69e9edffbd55bec/templates/themes/overboards/theme.php#L172

If this random pick by the last $top_threads item is not desired, config.url_banner can be remembered before the first buildOne call and sent into the index template separately in the Element invocation. >>15016
https://git.leftypol.org/leftypol/leftypol/src/commit/631a5b5fc705252697734c74a69e9edffbd55bec/templates/themes/overboards/theme.php#L204

This way the overboard index pages would use the config.url_banner setting from the global instance-config.php. On the other hand, the random pick of the banner folder by the last item in $top_threads might be considered a feature.

 No.15104

File: 1653781104387.png (130.7 KB, 1819x857, alt_is_dead.png)

Currenly overboards use the default theme of the board their last visible post is from. Perhaps this should be changed in the new overboard code, if it isn't already.

 No.15161

this commit for checking report length is incorrect it will give an error saying strlen is expecting a string not an array if someone bypasses the input maxlength set in html
https://github.com/towards-a-new-leftypol/leftypol_lainchan/commit/bb0b7007fd5e27bd29c76235cf7a1b8148995f99
if (strlen($report)

should be
if (strlen($_POST['reason'])

 No.15172

File: 1654145706733.png (679.45 KB, 1022x731, ClipboardImage.png)

Anyone know of an LGBT content blocker extension or something? I don't hate gays, I'm just sick and tired of all the retarded idpol "pride" shit slapped onto everything in the most nauseatingly liberal way, I can't avoid it even though I search for content not even tangentially related to gay stuff.

 No.15173


 No.15287

File: 1654993228127.png (755.51 KB, 1064x6307, flaglist-git.png)

Flag list for >>>/meta/20864. This version uses the git repo static/flags folder https://git.leftypol.org/leftypol/leftypol/src/commit/631a5b5fc705252697734c74a69e9edffbd55bec/static/flags which is out of sync with the live site and the hidden >>11882 >>11883 >>11905 instance-config.php, so it will not match the live post form. Adjust the 80px height in the img tag's style to taste. Rerun when a new flag shows up in the git repo.
$ cd leftypol/static/flags
$ { echo '<div style="text-align: justify">'; for f in $(ls | grep -e '[.]png$' | grep -ve '^flags[.]png$'); do echo '<span style="display: inline-block; border: 1px dashed; text-align: center">'; echo '<img style="height: 80px; image-rendering: crisp-edges" src="'$f'">'; echo '<br>'; echo '<span style="font-size: 20px">'${f%.png}'</span>'; echo '</span>'; done; echo '</div>'; } > test.html

 No.15288

File: 1654993342506.png (386.26 KB, 1064x2264, flaglist-live.png)

Flag list for >>>/meta/20864. This version uses the live post form. It has to use the live static/flags folder because the git repo is out of sync >>15287. Mobile app users get their flags through https://leftypol.org/status.php which automatically syncs https://git.leftypol.org/leftypol/leftypol/src/commit/631a5b5fc705252697734c74a69e9edffbd55bec/status.php#L55 with the live post form, so it will match this version. Adjust the 80px height in the img tag's style to taste. Rerun when a new flag shows up in the live post form.
$ { echo '<div style="text-align: justify">'; wget -q -O - 'https://leftypol.org/meta/res/20864.html' | grep -E -oe '<option value="[^"]+">[^<]+</option>' | sed -r -e 's#^<option value="([^"]+)">([^<]+)</option>#<span style="display: inline-block; border: 1px dashed; text-align: center"><img style="height: 80px; image-rendering: crisp-edges" src="https://leftypol.org/static/flags/\1.png"><br><span style="font-size: 20px">\2</span><br><span style="font-size: 20px">\1</span></span>#'; echo '</div>'; } > test.html

 No.15346

I get 404s for images on /hobby/, /games/, /draw/, /anime/, /edu/, /music/, /AKM/, /meta/, /dead/ and /gulag/ when using the onion service.

 No.15348

>>15346
Image posting is temporarily turned off for everyone so that's expected

 No.15357

https://leftypol.org/search.php?search=Grace&board=siberia
1. Why doesn't this find anything at all?
2. Why do I have to select /siberia/ again in the search form?

 No.15359

File: 1655221706870.png (1.09 MB, 1080x1080, ClipboardImage.png)

Did the mods disable clipboard images for /siberia/? It works on the other boards, but not siberia (pic rel is an example)

 No.15360

>>15359
works on my machine

 No.15362

File: 1655224315297.png (357.75 KB, 690x506, ClipboardImage.png)

>>15360
It's not on mine, Tor didn't let me use it on /siberia/ either, pic rel is attempt 2 that failed. Like I CTRL+V it and tried Right-click+Paste but it just doesn't appear in the files. Neither does uploading images for that matter.

 No.15364

About >>15357
> 2. Why do I have to select /siberia/ again in the search form?

The board parameter sent from search.php to search_form.html is called 'board':
https://git.leftypol.org/leftypol/leftypol/src/commit/631a5b5fc705252697734c74a69e9edffbd55bec/search.php#L18
> $body = Element('search_form.html', Array('boards' => $boards, 'board' => isset($_GET['board']) ? $_GET['board'] : false, 'search' => isset($_GET['search']) ? str_replace('"', '&quot;', utf8tohtml($_GET['search'])) : false));

But search_form.html tests for equality with 'b':
https://git.leftypol.org/leftypol/leftypol/src/commit/631a5b5fc705252697734c74a69e9edffbd55bec/templates/search_form.html#L10
{% for b2 in boards %}
    {% if b2 == b %}
    <option value="{{ b2 }}" selected>/{{ b2 }}/</option>
    {% else %}
    <option value="{{ b2 }}">/{{ b2 }}/</option>
    {% endif %}
{% endfor %}

If either the board parameter sent from search.php to search_form.html is renamed to 'b', or the equality test is switched to 'board', the search form should pick up the correct board as its initial selection.

 No.15365


 No.15374

>>15365
Maybe the global $board interferes with the twig template, although I can't see why it would, and we should just switch both the loop variable equality test target and the Element parameter to searchboard.

> Benjamin

This is the same Southall guy who adds parens around &&, which took precedence anyway, instead of >>>/leftypol_archive/1691 around the || chain:
https://git.leftypol.org/leftypol/leftypol/commit/1792bf48eec755ee9a07aa5bef5fbf1e27d406c4

 No.15377

>>15374
It's Appleman1234 of Lainchan fame.

I would just revert b89fe3046bfbc0d7db8e7e8773e92c0536417450.

 No.15464

The report function doesn't seem to be working on /leftypol/.
The /leftypol/ thread "Why is /pol/and so fucking right-wing?" Is overrun by /pol/yp raiders and constantly derailed. Mods don't react to reports. Could you please look into it and clean up?

 No.15636

>>15464
I know it fails on posts that have already been deleted (a refresh will show if that's the case), is this a different issue?

 No.15908


 No.16143

Bug report:
When you have set another theme from the default, the Rules and FAQ pages look atrocious / almost unreadable

 No.16145


 No.16149

>>16145
Dark Bunker Red, which is one of the very few dark themes with good contrast between the text v background, so please don't change anything else with it, it saved my eyes on here

 No.16159

You idiots do realize that Cloudflare is who shut down 8ch, right? Don't you think it'd be smarter to pick a different DDoS "protection" service?

 No.16161

>>16159
In general, complaining about something isn't really useful. If you're going to complain about something, it helps to have a plan to fix it, at least. Even better if you're willing to commit the work required to make it happen.

 No.16162


 No.16165

> the Rules and FAQ pages look atrocious / almost unreadable >>16143
> Dark Bunker Red >>16149
The relevant property of dark_bunker_red.css is that it lacks ban class styling. >>16145
https://git.leftypol.org/leftypol/leftypol/src/commit/858a501b1f652831feafd9b51c6f06c3b92e30a0/stylesheets/dark_bunker_red.css
The default dark_red.css has three div.ban sections.
https://git.leftypol.org/leftypol/leftypol/src/commit/858a501b1f652831feafd9b51c6f06c3b92e30a0/stylesheets/dark_red.css#L157

To fix add div.ban { … } and div.ban h2 { … } sections to Dev Tools → Style Editor → New Stylesheet while on the Dark Bunker Red theme, adjust the foreground and background colors as well as any other desired properties until the faq and rules pages are no longer "atrocious / almost unreadable", then once satisfied post the changes for inclusion into dark_bunker_red.css.
https://developer.mozilla.org/en-US/docs/Web/CSS/color#syntax

 No.16209


 No.16236

I just realized that this site is literally fully fucking functional without using JavaScript.

I want to give the devs a french kiss right now. A commie imageboard run by unpaid volunteers handles JavaScript better than most Fortune 500 websites.

 No.16239

>>16236
I thought all imageboards are fully functional without JS unless they add crap like recaptcha.

 No.16241

>>16239
I admittedly only really use 4chan so I can't speak for others, but with 4chan the catalog, posting (as you pointed out with the captcha part), and many other smaller little things don't work without JS. You can still browse and read but it's a much less pleasant experience than /leftypol/.

 No.16491

Why does the site now load when clicking >> links between posts in a thread? It's pretty annoying tbh

 No.16622

… U+2026 Po HORIZONTAL ELLIPSIS >>>/meta/22513 &hellip;

space >>16162
no space >>16162…

Happens here:
https://git.leftypol.org/leftypol/leftypol/src/commit/858a501b1f652831feafd9b51c6f06c3b92e30a0/inc/config.php#L557
// Automatically convert things like "..." to Unicode characters ("…").
$config['auto_unicode'] = true;

https://git.leftypol.org/leftypol/leftypol/src/commit/858a501b1f652831feafd9b51c6f06c3b92e30a0/inc/functions.php#L2076
if ($config['auto_unicode']) {
    $body = unicodify($body);

https://git.leftypol.org/leftypol/leftypol/src/commit/858a501b1f652831feafd9b51c6f06c3b92e30a0/inc/functions.php#L1976
function unicodify($body) {
    $body = str_replace('...', '&hellip;', $body);


Cite markup:
https://git.leftypol.org/leftypol/leftypol/src/commit/858a501b1f652831feafd9b51c6f06c3b92e30a0/inc/functions.php#L2089
https://git.leftypol.org/leftypol/leftypol/src/commit/858a501b1f652831feafd9b51c6f06c3b92e30a0/inc/functions.php#L2136
> ((?=[\s,.:)?!])|$)

To fix add the ampersand to the character class.
< ((?=[\s,.:)?!&])|$)

 No.16848

>>16622
You broke my ascii :(
>>>/leftypol/1178093

 No.16849

File: 1663541209002.jpg (366.99 KB, 1392x2048, nitter.jpg)

User JS snippet for twitter → nitter conversion >>>/meta/22665
Array.from (document.querySelectorAll ('a[href^="https://twitter.com/"]')).forEach (e => { e.outerHTML = e.outerHTML + ' <a target="_blank" href="' + e.getAttribute ("href").replace (/^https:\/\/twitter\.com\//, "https://nitter.net/") + '">[nitter]</a>'; })

test link: >>>/meta/22666

 No.16975

Should there be an option to see "other pages" of posts? There are topics that seem to be visible only through enabling the catalog, but without that you can only see the newest posts on a single "page" of the standard UI. This is in contrast to some other imageboards (notably 4chan, among others) where you can select page 2, 3 etc.. displaying posts without having to go to the catalog display.

Is it intended functionality to not have that feature here (and a few other boards that seem to be on a similar vichan codebase like lain )? Or is there some strangeness going on on my browser's end, possibly because of addons or the like? Thanks.

 No.17152

File: 1665034717185.png (10.81 KB, 967x46, ClipboardImage.png)

>>16975
(Sorry for late reply, I've been away from /tech/)
Looks like it's a local thing if you're not seeing the page list at the bottom of the board index.

>>16849
Has anyone asked you if you want to be part of the dev team yet? We've been pretty slow for a couple of months due to other obligations.

 No.17207

can't report cp spam from /alt/

 No.17209

Onion link asking me for a login? Then if I don't just saying "Authentication required"

 No.17300

> Failed to resize image! Details: gm convert: iCCP: cHRM chunk does not match sRGB (/tmp/phpxeccyD).
When posting this: https://upload.wikimedia.org/wikipedia/commons/0/0b/Romance_languages.png

 No.17307

Dear tech team,
Can you guys make it possible to attach .mobi files?
Thanks

 No.17328

Can .webm’s finally be uploaded on the site?

Last time I tried that it didn’t work, so I had to convert it to a .png instead.

 No.17338

>>17328
Do you mean .webp?

 No.17406

>>17338
NTA but probably.

Also IMO .webp is shit

 No.17440

OGG support when


Unique IPs: 20

[Return][Go to top] [Catalog] | [Home][Post a Reply]
Delete Post [ ]
[ home / rules / faq ] [ overboard / sfw / alt ] [ leftypol / siberia / hobby / tech / edu / games / anime / music / draw / AKM ] [ meta / roulette ] [ cytube / git ] [ GET / ref / marx / booru / zine ]