Fast forward

This commit is contained in:
8chan 2015-08-19 19:47:35 -07:00
parent 2b2a8dca5f
commit 45c0d32761
29 changed files with 115 additions and 106 deletions

View File

@ -1,31 +0,0 @@
<?php
header("Pragma-directive: no-cache");
header("Cache-directive: no-cache");
header("Cache-control: no-cache");
header("Pragma: no-cache");
header("Expires: 0");
function get_custom_banner(&$b) {
# Validate the board name
if (!(isset($b) && preg_match('/^[a-z0-9+]{1,30}$/', $b)))
return null;
# Check if directory exists
$dir = "static/banners/$b/";
if (!is_dir($dir))
return null;
# Return random file if directory is not empty
$banners = array_diff(scandir($dir), array('..', '.'));
if (!$banners)
return null;
$r = array_rand($banners);
return $dir.$banners[$r];
}
$banner = get_custom_banner($_GET['board']);
if ($banner)
header("Location: $banner");
else
header("Location: static/8chan banner.png");

View File

@ -64,7 +64,14 @@ $tagsHTML = Element("8chan/boards-tags.html", array(
) )
); );
$searchHTML = Element("8chan/boards-search.html", array( $query = query('SELECT np.* FROM newsplus np INNER JOIN `posts_n` p ON np.thread=p.id WHERE np.dead IS FALSE ORDER BY p.bump DESC');
if ($query) {
$newsplus = $query->fetchAll(PDO::FETCH_ASSOC);
} else {
$newsplus = false;
}
$searchArray = array(
"config" => $config, "config" => $config,
"boards" => $boards, "boards" => $boards,
"tags" => $tags, "tags" => $tags,
@ -83,25 +90,37 @@ $searchHTML = Element("8chan/boards-search.html", array(
"page_updated" => date('r'), "page_updated" => date('r'),
"html_boards" => $boardsHTML, "html_boards" => $boardsHTML,
"html_tags" => $tagsHTML "html_tags" => $tagsHTML,
"newsplus" => $newsplus
);
$searchHTML = Element("8chan/boards-index.html", $searchArray);
$pageHTML = Element("page.html", array(
"title" => "8chan, the infinitely expanding imageboard",
"config" => $config,
"body" => $searchHTML,
) )
); );
$pageHTML = Element("page.html", array( $searchHTML2 = Element("8chan/boards-search.html", $searchArray);
"title" => _("Boardlist"),
$pageHTML2 = Element("page.html", array(
"title" => "Boards on 8chan",
"config" => $config, "config" => $config,
"body" => $searchHTML, "body" => $searchHTML2,
"title" => _("Boards on &infin;chan")
) )
); );
// We only want to cache if this is not a dynamic form request. // We only want to cache if this is not a dynamic form request.
// Otherwise, our information will be skewed by the search criteria. // Otherwise, our information will be skewed by the search criteria.
if (php_sapi_name() == 'cli') { if (php_sapi_name() == 'cli') {
// Preserves the JSON output format of [{board},{board}]. // Preserves the JSON output format of [{board},{board}].
$nonAssociativeBoardList = array_values($response['boardsFull']); $nonAssociativeBoardList = array_values($response['boardsFull']);
file_write("boards.html", $pageHTML); file_write("index.html", $pageHTML);
file_write("boards.html", $pageHTML2);
file_write("boards.json", json_encode($nonAssociativeBoardList)); file_write("boards.json", json_encode($nonAssociativeBoardList));
$topbar = array(); $topbar = array();

View File

@ -22,16 +22,16 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if ($resp === '1') { if ($resp === '1') {
$tor = checkDNSBL($_SERVER['REMOTE_ADDR']); $tor = checkDNSBL($_SERVER['REMOTE_ADDR']);
if (!$tor) { if (!$tor) {
$query = prepare('INSERT INTO ``dnsbl_bypass`` VALUES(:ip, NOW()) ON DUPLICATE KEY UPDATE `created`=NOW()'); $query = prepare('INSERT INTO ``dnsbl_bypass`` VALUES(:ip, NOW(), 0) ON DUPLICATE KEY UPDATE `created`=NOW(),`uses`=0');
$query->bindValue(':ip', $_SERVER['REMOTE_ADDR']); $query->bindValue(':ip', $_SERVER['REMOTE_ADDR']);
$query->execute() or error(db_error($query)); $query->execute() or error(db_error($query));
} else {
$cookie = bin2hex(openssl_random_pseudo_bytes(16));
$query = prepare('INSERT INTO ``tor_cookies`` VALUES(:cookie, NOW(), 0)');
$query->bindValue(':cookie', $cookie);
$query->execute() or error(db_error($query));
setcookie("tor", $cookie);
} }
$cookie = bin2hex(openssl_random_pseudo_bytes(16));
$query = prepare('INSERT INTO ``tor_cookies`` VALUES(:cookie, NOW(), 0)');
$query->bindValue(':cookie', $cookie);
$query->execute() or error(db_error($query));
setcookie("tor", $cookie, time()+60*60*3);
echo Element("page.html", array("config" => $config, "body" => '', "title" => _("Success!"), "subtitle" => _("You may now go back and make your post."))); echo Element("page.html", array("config" => $config, "body" => '', "title" => _("Success!"), "subtitle" => _("You may now go back and make your post.")));
} else { } else {
error(_('You failed the CAPTCHA') . _('. <a href="https://8ch.net/dnsbls_bypass.php">Try again.</a> If it\'s not working, email admin@8chan.co for support.')); error(_('You failed the CAPTCHA') . _('. <a href="https://8ch.net/dnsbls_bypass.php">Try again.</a> If it\'s not working, email admin@8chan.co for support.'));

View File

@ -50,6 +50,9 @@ $body = <<<EOT
<p>Other than that, you are free to institute whatever rules you want on your board.</p> <p>Other than that, you are free to institute whatever rules you want on your board.</p>
<p><a href="/obscenity.html">More information about US obscenity laws and how they relate to 8chan boards</a></p> <p><a href="/obscenity.html">More information about US obscenity laws and how they relate to 8chan boards</a></p>
<p><a href="/dost.html">More information about the Dost test</a></p> <p><a href="/dost.html">More information about the Dost test</a></p>
<p><strong>TL;DR: 8chan considers all nude images of children to be child porn and they will be deleted and the posting address banned if viable.</strong></p>
<p><a href="/personhood.html">Just who is this 8chan person anyway?</a></p> <p><a href="/personhood.html">Just who is this 8chan person anyway?</a></p>
<h2>How do I add more volunteers?</h2> <h2>How do I add more volunteers?</h2>
<p>You may do this in your board settings, click on "Edit board volunteers". <p>You may do this in your board settings, click on "Edit board volunteers".

View File

@ -43,6 +43,7 @@
$config['mod']['view_ban'] = BOARDVOLUNTEER; $config['mod']['view_ban'] = BOARDVOLUNTEER;
$config['mod']['reassign_board'] = GLOBALVOLUNTEER; $config['mod']['reassign_board'] = GLOBALVOLUNTEER;
$config['mod']['move'] = GLOBALVOLUNTEER; $config['mod']['move'] = GLOBALVOLUNTEER;
$config['mod']['pm_all'] = GLOBALVOLUNTEER;
$config['mod']['shadow_capcode'] = 'Global Volunteer'; $config['mod']['shadow_capcode'] = 'Global Volunteer';
// Mod pages assignment // Mod pages assignment

View File

@ -68,7 +68,7 @@
$salt = generate_salt(); $salt = generate_salt();
$hashed = hash('sha256', $salt . sha1($password)); $hashed = hash('sha256', $salt . sha1($password));
$query = prepare('UPDATE ``mods`` SET `password` = :hashed, `salt` = :salt WHERE BINARY username = :mod'); $query = prepare('UPDATE ``mods`` SET `password` = :hashed, `salt` = :salt, `email` = NULL WHERE BINARY username = :mod');
$query->bindValue(':hashed', $hashed); $query->bindValue(':hashed', $hashed);
$query->bindValue(':salt', $salt); $query->bindValue(':salt', $salt);
$query->bindValue(':mod', $mods[0]['username']); $query->bindValue(':mod', $mods[0]['username']);
@ -105,7 +105,7 @@
if (!preg_match('/^[a-zA-Z0-9._]{1,30}$/', $_POST['username'])) if (!preg_match('/^[a-zA-Z0-9._]{1,30}$/', $_POST['username']))
error(_('Invalid username')); error(_('Invalid username'));
if ($count > 10) { if ($count > 20) {
error(_('Too many board volunteers!')); error(_('Too many board volunteers!'));
} }
@ -219,7 +219,7 @@
if ($size[0] > 20 or $size[0] < 11 or $size[1] > 16 or $size[1] < 11){ if ($size[0] > 20 or $size[0] < 11 or $size[1] > 16 or $size[1] < 11){
error(_('Image wrong size!')); error(_('Image wrong size!'));
} }
if (sizeof($banners) > 256) { if (sizeof($banners) > 512) {
error(_('Too many flags.')); error(_('Too many flags.'));
} }
@ -284,7 +284,7 @@ FLAGS;
if (isset($_POST['delete'])){ if (isset($_POST['delete'])){
foreach ($_POST['delete'] as $i => $d){ foreach ($_POST['delete'] as $i => $d){
if (!preg_match('/[0-9+]/', $d)){ if (!preg_match('/^[0-9]+$/', $d)){
error('Nice try.'); error('Nice try.');
} }
unlink("$dir/$d.png"); unlink("$dir/$d.png");
@ -419,6 +419,9 @@ FLAGS;
function mod_8_banners($b) { function mod_8_banners($b) {
global $config, $mod, $board; global $config, $mod, $board;
error('Banner editing is currently disabled. Please check back later!');
require_once 'inc/image.php'; require_once 'inc/image.php';
if (!hasPermission($config['mod']['edit_banners'], $b)) if (!hasPermission($config['mod']['edit_banners'], $b))
@ -468,7 +471,7 @@ FLAGS;
if (isset($_POST['delete'])){ if (isset($_POST['delete'])){
foreach ($_POST['delete'] as $i => $d){ foreach ($_POST['delete'] as $i => $d){
if (!preg_match('/[0-9+]\.(png|jpeg|jpg|gif)/', $d)){ if (!preg_match('/^[0-9]+\.(png|jpeg|jpg|gif)$/', $d)){
error('Nice try.'); error('Nice try.');
} }
unlink("$dir/$d"); unlink("$dir/$d");
@ -757,7 +760,7 @@ EOT;
foreach ($matched[0] as $match) { foreach ($matched[0] as $match) {
$match_okay = false; $match_okay = false;
foreach ($config['allowed_offsite_urls'] as $allowed_url) { foreach ($config['allowed_offsite_urls'] as $allowed_url) {
if (strpos($match, $allowed_url) !== false && strpos($match, '#') === false && strpos($match, '?') === false && strpos($match, ';') === false) { if (strpos($match, $allowed_url) === 0) {
$match_okay = true; $match_okay = true;
} }
} }

View File

@ -670,17 +670,19 @@
$config['markup'][] = array( $config['markup'][] = array(
"/\[(aa|code)\](.+?)\[\/(?:aa|code)\]/ms", "/\[(aa|code)\](.+?)\[\/(?:aa|code)\]/ms",
function($matches) { function($matches) {
$markupchars = array('_', '\'', '~', '*', '='); $markupchars = array('_', '\'', '~', '*', '=', '-');
$replacement = $markupchars; $replacement = $markupchars;
array_walk($replacement, function(&$v) { array_walk($replacement, function(&$v) {
$v = "&#".ord($v).";"; $v = "&#".ord($v).";";
}); });
// These are hacky fixes for ###board-tags### and >quotes. // These are hacky fixes for ###board-tags###, ellipses and >quotes.
$markupchars[] = '###'; $markupchars[] = '###';
$replacement[] = '&#35;&#35;&#35;'; $replacement[] = '&#35;&#35;&#35;';
$markupchars[] = '&gt;'; $markupchars[] = '&gt;';
$replacement[] = '&#62;'; $replacement[] = '&#62;';
$markupchars[] = '...';
$replacement[] = '..&#46;';
if ($matches[1] === 'aa') { if ($matches[1] === 'aa') {
return '<span class="aa">' . str_replace($markupchars, $replacement, $matches[2]) . '</span>'; return '<span class="aa">' . str_replace($markupchars, $replacement, $matches[2]) . '</span>';

View File

@ -121,7 +121,7 @@ function loadConfig() {
} }
if (!file_exists('inc/instance-config.php')) if (!file_exists('inc/instance-config.php'))
$error('Tinyboard is not configured! Create inc/instance-config.php.'); $error('Posting is down momentarily. Please try again later.');
// Initialize locale as early as possible // Initialize locale as early as possible
@ -2557,7 +2557,7 @@ function strip_combining_chars($str) {
$o = 0; $o = 0;
$ord = ordutf8($char, $o); $ord = ordutf8($char, $o);
if ( ($ord >= 768 && $ord <= 879) || ($ord >= 1750 && $ord <= 1773) || ($ord >= 3655 && $ord <= 3659) || ($ord >= 7616 && $ord <= 7679) || ($ord >= 8400 && $ord <= 8447) || ($ord >= 65056 && $ord <= 65071)){ if ( ($ord >= 768 && $ord <= 879) || ($ord >= 1536 && $ord <= 1791) || ($ord >= 3655 && $ord <= 3659) || ($ord >= 7616 && $ord <= 7679) || ($ord >= 8400 && $ord <= 8447) || ($ord >= 65056 && $ord <= 65071)){
continue; continue;
} }

View File

@ -361,7 +361,7 @@ class ImageConvert extends ImageBase {
escapeshellarg($this->src . '[0]'), escapeshellarg($this->src . '[0]'),
$this->width, $this->width,
$this->height, $this->height,
escapeshellarg($this->temp)))) || !file_exists($this->temp)) { escapeshellarg('jpg:'.$this->temp)))) || !file_exists($this->temp)) {
if (strpos($error, "known incorrect sRGB profile") === false && if (strpos($error, "known incorrect sRGB profile") === false &&
strpos($error, "iCCP: Not recognizing known sRGB profile that has been edited") === false) { strpos($error, "iCCP: Not recognizing known sRGB profile that has been edited") === false) {

View File

@ -81,7 +81,7 @@
$config['poster_id_length'] = 6; $config['poster_id_length'] = 6;
$config['ayah_enabled'] = false; $config['ayah_enabled'] = false;
$config['cbRecaptcha'] = true; $config['cbRecaptcha'] = true;
$config['url_banner'] = '/banners.php'; $config['url_banner'] = 'https://banners.8ch.net';
$config['additional_javascript_compile'] = true; $config['additional_javascript_compile'] = true;
//$config['default_stylesheet'] = array('Notsuba', 'notsuba.css'); //$config['default_stylesheet'] = array('Notsuba', 'notsuba.css');
$config['additional_javascript'][] = 'js/jquery.min.js'; $config['additional_javascript'][] = 'js/jquery.min.js';
@ -108,7 +108,6 @@
$config['additional_javascript'][] = 'js/hide-images.js'; $config['additional_javascript'][] = 'js/hide-images.js';
$config['additional_javascript'][] = 'js/expand-all-images.js'; $config['additional_javascript'][] = 'js/expand-all-images.js';
$config['additional_javascript'][] = 'js/local-time.js'; $config['additional_javascript'][] = 'js/local-time.js';
$config['additional_javascript'][] = 'js/no-animated-gif.js';
$config['additional_javascript'][] = 'js/expand.js'; $config['additional_javascript'][] = 'js/expand.js';
$config['additional_javascript'][] = 'js/auto-reload.js'; $config['additional_javascript'][] = 'js/auto-reload.js';
$config['additional_javascript'][] = 'js/options/user-css.js'; $config['additional_javascript'][] = 'js/options/user-css.js';
@ -166,7 +165,7 @@
$config['markup_paragraphs'] = true; $config['markup_paragraphs'] = true;
$config['markup_rtl'] = true; $config['markup_rtl'] = true;
$config['boards'] = array(array('<i class="fa fa-home" title="Home"></i>' => '/', '<i class="fa fa-tags" title="Boards"></i>' => '/boards.html', '<i class="fa fa-question" title="FAQ"></i>' => '/faq.html', '<i class="fa fa-random" title="Random"></i>' => '/random.php', '<i class="fa fa-plus" title="New board"></i>' => '/create.php', '<i class="fa fa-ban" title="Public ban list"></i>' => '/bans.html', '<i class="fa fa-search" title="Search"></i>' => '/search.php', '<i class="fa fa-cog" title="Manage board"></i>' => '/mod.php', '<i class="fa fa-quote-right" title="Chat"></i>' => 'https://qchat.rizon.net/?channels=#8chan'), array('b', 'n', 'boards'), array('operate', 'meta'), array('<i class="fa fa-twitter" title="Twitter"></i>'=>'https://twitter.com/infinitechan')); $config['boards'] = array(array('<i class="fa fa-home" title="Home"></i> home' => '/', '<i class="fa fa-tags" title="Boards"></i> board list' => '/boards.html', '<i class="fa fa-question" title="FAQ"></i> faq' => '/faq.html', '<i class="fa fa-random" title="Random"></i> random' => '/random.php', '<i class="fa fa-plus" title="New board"></i> create' => '/create.php', '<i class="fa fa-ban" title="Public ban list"></i> bans' => '/bans.html', '<i class="fa fa-search" title="Search"></i> search' => '/search.php', '<i class="fa fa-cog" title="Manage board"></i> manage' => '/mod.php', '<i class="fa fa-quote-right" title="Chat"></i> irc' => 'https://qchat.rizon.net/?channels=#8chan'), array('<i class="fa fa-twitter" title="Twitter"></i>'=>'https://twitter.com/infinitechan'));
//$config['boards'] = array(array('<i class="fa fa-home" title="Home"></i>' => '/', '<i class="fa fa-tags" title="Boards"></i>' => '/boards.html', '<i class="fa fa-question" title="FAQ"></i>' => '/faq.html', '<i class="fa fa-random" title="Random"></i>' => '/random.php', '<i class="fa fa-plus" title="New board"></i>' => '/create.php', '<i class="fa fa-search" title="Search"></i>' => '/search.php', '<i class="fa fa-cog" title="Manage board"></i>' => '/mod.php', '<i class="fa fa-quote-right" title="Chat"></i>' => 'https://qchat.rizon.net/?channels=#8chan'), array('b', 'meta', 'int'), array('v', 'a', 'tg', 'fit', 'pol', 'tech', 'mu', 'co', 'sp', 'boards'), array('<i class="fa fa-twitter" title="Twitter"></i>'=>'https://twitter.com/infinitechan')); //$config['boards'] = array(array('<i class="fa fa-home" title="Home"></i>' => '/', '<i class="fa fa-tags" title="Boards"></i>' => '/boards.html', '<i class="fa fa-question" title="FAQ"></i>' => '/faq.html', '<i class="fa fa-random" title="Random"></i>' => '/random.php', '<i class="fa fa-plus" title="New board"></i>' => '/create.php', '<i class="fa fa-search" title="Search"></i>' => '/search.php', '<i class="fa fa-cog" title="Manage board"></i>' => '/mod.php', '<i class="fa fa-quote-right" title="Chat"></i>' => 'https://qchat.rizon.net/?channels=#8chan'), array('b', 'meta', 'int'), array('v', 'a', 'tg', 'fit', 'pol', 'tech', 'mu', 'co', 'sp', 'boards'), array('<i class="fa fa-twitter" title="Twitter"></i>'=>'https://twitter.com/infinitechan'));
$config['footer'][] = 'All posts on 8chan are the responsibility of the individual poster and not the administration of 8chan, pursuant to 47 U.S.C. &sect; 230.'; $config['footer'][] = 'All posts on 8chan are the responsibility of the individual poster and not the administration of 8chan, pursuant to 47 U.S.C. &sect; 230.';
@ -232,6 +231,7 @@ $config['report_captcha'] = true;
$config['no_top_bar_boards'] = false; $config['no_top_bar_boards'] = false;
$config['page_404'] = 'page_404'; $config['page_404'] = 'page_404';
$config['convert_args'] = '-size %dx%d %s -thumbnail %dx%d -quality 85%% -background \'#d6daf0\' -alpha remove -auto-orient +profile "*" %s';
// Flavor and design. // Flavor and design.
$config['site_name'] = "&infin;chan"; $config['site_name'] = "&infin;chan";

Binary file not shown.

View File

@ -3557,6 +3557,7 @@ function mod_edit_page($id) {
break; break;
case 'infinity': case 'infinity':
$c = $content; $c = $content;
$config['max_links'] = PHP_INT_MAX;
markup($content); markup($content);
$write = $content; $write = $content;
$content = $c; $content = $c;

View File

@ -1,5 +1,5 @@
<?php <?php
include 'inc/functions.php'; /*include 'inc/functions.php';
$query = query('SELECT np.* FROM newsplus np INNER JOIN `posts_n` p ON np.thread=p.id WHERE np.dead IS FALSE ORDER BY p.bump DESC'); $query = query('SELECT np.* FROM newsplus np INNER JOIN `posts_n` p ON np.thread=p.id WHERE np.dead IS FALSE ORDER BY p.bump DESC');
if ($query) { if ($query) {
$newsplus = $query->fetchAll(PDO::FETCH_ASSOC); $newsplus = $query->fetchAll(PDO::FETCH_ASSOC);
@ -10,4 +10,4 @@ if ($query) {
$index = Element("8chan/index.html", array("config" => $config, "newsplus" => $newsplus)); $index = Element("8chan/index.html", array("config" => $config, "newsplus" => $newsplus));
file_write('index.html', $index); file_write('index.html', $index);
echo $index; echo $index;*/

View File

@ -11,7 +11,7 @@
*/ */
if (!localStorage.favorites) { if (!localStorage.favorites) {
localStorage.favorites = '[]'; localStorage.favorites = '["operate","b"]';
} }
function favorite(board) { function favorite(board) {

View File

@ -111,10 +111,10 @@ $(document).ready(function() {
$('.poster_id').each(toggle_id); $('.poster_id').each(toggle_id);
} }
if(forced_anon) { if (forced_anon) {
enable_fa(); enable_fa();
if (window.Options && Options.get_tab('general')) { if (window.Options && Options.get_tab('general')) {
$('#toggle-locked-threads>input').prop('checked', true); $('#forced-anon>input').prop('checked', true);
} }
} }

View File

@ -3,22 +3,21 @@ $(document).ready(function(){
window.boards = new Array(); window.boards = new Array();
if (window.Options && Options.get_tab('general')) { if (window.Options && Options.get_tab('general')) {
Options.extend_tab("general", "<label id='show-top'><input type='checkbox' /> "+_('Show top boards')+"</label>"); Options.extend_tab("general", "<label id='show_top_boards'><input type='checkbox' /> "+_('Show top boards')+"</label>");
if (typeof localStorage.show_top === 'undefined') { if (typeof localStorage.show_top_boards === 'undefined') {
localStorage.show_top = 'true'; localStorage.show_top_boards = 'false';
var show_top = JSON.parse(localStorage.show_top); var show_top = JSON.parse(localStorage.show_top_boards);
$('#show-top>input').attr('checked', 'checked');
} else {
var show_top = JSON.parse(localStorage.show_top);
if (show_top) $('#show-top>input').attr('checked', 'checked');
} }
var show_top = JSON.parse(localStorage.show_top_boards);
if (show_top) $('#show_top_boards>input').attr('checked', 'checked');
$('#show-top>input').on('change', function() {
$('#show_top_boards>input').on('change', function() {
var show_top = ($(this).is(':checked')); var show_top = ($(this).is(':checked'));
localStorage.show_top = JSON.stringify(show_top); localStorage.show_top_boards = JSON.stringify(show_top);
}); });
} }
@ -28,7 +27,7 @@ function handle_boards(data) {
}) })
if (boards[0]) { if (boards[0]) {
$('.sub[data-description="3"]').after('<span class="sub" data-description="4"> [ '+boards.slice(0,25).join(" / ")+' ] </span>'); $('.sub[data-description="1"]').after('<span class="sub" data-description="4"> [ '+boards.slice(0,25).join(" / ")+' ] </span>');
} }
} }

View File

@ -5,10 +5,6 @@
require "./inc/functions.php"; require "./inc/functions.php";
require "./inc/anti-bot.php"; require "./inc/anti-bot.php";
// The dnsbls is an optional DNS blacklist include.
// Squelch warnings if it doesn't exist.
@include "./inc/dnsbls.php";
// Fix for magic quotes // Fix for magic quotes
if (get_magic_quotes_gpc()) { if (get_magic_quotes_gpc()) {
function strip_array($var) { function strip_array($var) {
@ -234,6 +230,7 @@ elseif (isset($_POST['post'])) {
// Check if board exists // Check if board exists
if (!openBoard($post['board'])) if (!openBoard($post['board']))
error($config['error']['noboard']); error($config['error']['noboard']);
if (!isset($_POST['name'])) if (!isset($_POST['name']))
$_POST['name'] = $config['anonymous']; $_POST['name'] = $config['anonymous'];
@ -253,6 +250,12 @@ elseif (isset($_POST['post'])) {
} else } else
$post['op'] = true; $post['op'] = true;
// The dnsbls is an optional DNS blacklist include.
// Squelch warnings if it doesn't exist.
if (!$config['captcha']['enabled'] && !($post['op'] && $config['new_thread_capt'])) {
@include "./inc/dnsbls.php";
}
// Check if banned // Check if banned
checkBan($board['uri']); checkBan($board['uri']);

View File

@ -1250,6 +1250,7 @@ div.mix {
font-family: Mona, "MS PGothic", " Pゴシック", sans-serif; font-family: Mona, "MS PGothic", " Pゴシック", sans-serif;
display: block!important; display: block!important;
font-size: 12pt; font-size: 12pt;
line-height: 1.1;
} }
.dx, .dx,
.dy, .dy,

View File

@ -211,9 +211,9 @@
<br> <br>
<span>[ <a href="/b/">/b/ - Random</a> | <a href="/n/">/n/ - News</a> | <a href="/boards/">/boards/ - Boards</a>]</span> <span>[ <a href="/b/">/b/ - Random</a> | <a href="/n/">/n/ - News</a> | <a href="/boards/">/boards/ - Boards</a>]</span>
<br> <br>
<strong>{% trans %}Top 25 boards:{% endtrans %}</strong> <!-- <strong>{% trans %}Top 25 boards:{% endtrans %}</strong>
<span class="sub" data-description="3"></span> <span class="sub" data-description="1"></span>
<!-- <br> <br>
<strong> <strong>
{% trans %}Boards of the week:{% endtrans %}&nbsp;[&nbsp; {% trans %}Boards of the week:{% endtrans %}&nbsp;[&nbsp;
{% for board in config.boards_of_the_week %} {% for board in config.boards_of_the_week %}

View File

@ -4,7 +4,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes"> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes">
{% if config.meta_keywords %}<meta name="keywords" content="{{ config.meta_keywords }}">{% endif %} {% if config.meta_keywords %}<meta name="keywords" content="{{ config.meta_keywords }}">{% endif %}
{% if config.meta_description %}<meta name="description" content="{{ config.meta_description }}">{% endif %} {% if config.meta_description %}<meta name="description" content="{{ config.meta_description }}">{% endif %}
{% if not board.indexed %}<meta name="robots" content="noindex" />{% endif %} {% if board and not board.indexed %}<meta name="robots" content="noindex" />{% endif %}
{% if config.default_stylesheet.1 != '' and not mod %}<link rel="stylesheet" type="text/css" id="stylesheet" href="{{ config.uri_stylesheets }}{{ config.default_stylesheet.1 }}">{% endif %} {% if config.default_stylesheet.1 != '' and not mod %}<link rel="stylesheet" type="text/css" id="stylesheet" href="{{ config.uri_stylesheets }}{{ config.default_stylesheet.1 }}">{% endif %}
{% if config.font_awesome %}<link rel="stylesheet" media="screen" href="{{ config.root }}{{ config.font_awesome_css }}">{% endif %} {% if config.font_awesome %}<link rel="stylesheet" media="screen" href="{{ config.root }}{{ config.font_awesome_css }}">{% endif %}
{% if config.country_flags_condensed %}<link rel="stylesheet" href="{{ config.root }}{{ config.country_flags_condensed_css }}">{% endif %} {% if config.country_flags_condensed %}<link rel="stylesheet" href="{{ config.root }}{{ config.country_flags_condensed_css }}">{% endif %}

View File

@ -19,7 +19,7 @@
{{ boardlist.top }} {{ boardlist.top }}
{% if pm %}<div class="top_notice">You have <a href="?/PM/{{ pm.id }}">an unread PM</a>{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.</div><hr />{% endif %} {% if pm %}<div class="top_notice">You have <a href="?/PM/{{ pm.id }}">an unread PM</a>{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.</div><hr />{% endif %}
{% if config.url_banner %}<img class="board_image" src="{{ config.url_banner }}?board={{ board.uri|url_encode }}" {% if config.banner_width or config.banner_height %}style="{% if config.banner_width %}width:{{ config.banner_width }}px{% endif %};{% if config.banner_width %}height:{{ config.banner_height }}px{% endif %}" {% endif %}alt="" />{% endif %} {% if config.url_banner %}<img class="board_image" src="{{ config.url_banner }}/random/{{ board.uri|url_encode }}" {% if config.banner_width or config.banner_height %}style="{% if config.banner_width %}width:{{ config.banner_width }}px{% endif %};{% if config.banner_width %}height:{{ config.banner_height }}px{% endif %}" {% endif %}alt="" />{% endif %}
<header> <header>
<h1>{{ board.url }} - {{ board.title|e }}</h1> <h1>{{ board.url }} - {{ board.title|e }}</h1>
@ -42,9 +42,7 @@
{{ config.announcement }} {{ config.announcement }}
{% endif %} {% endif %}
{% if board.uri not in config.banned_ad_boards %} {% include 'ad_top.html' %}
{% include 'ad_top.html' %}
{% endif %}
{% if not no_post_form %} {% if not no_post_form %}
{% include 'post_form.html' %} {% include 'post_form.html' %}
@ -85,6 +83,10 @@
{% include 'ad_bottom.html' %} {% include 'ad_bottom.html' %}
{% endif %} {% endif %}
{% if board.uri %}
<div id="8ch-bottom"></div>
{% endif %}
<footer> <footer>
<p class="unimportant" style="margin-top:20px;text-align:center;">- <a href="http://tinyboard.org/">Tinyboard</a> + <p class="unimportant" style="margin-top:20px;text-align:center;">- <a href="http://tinyboard.org/">Tinyboard</a> +
<a href='https://int.vichan.net/devel/'>vichan</a> {{ config.version }} - <a href='https://int.vichan.net/devel/'>vichan</a> {{ config.version }} -

View File

@ -77,7 +77,7 @@
<ul style="list-style:none;padding:2px 5px"> <ul style="list-style:none;padding:2px 5px">
{% if mod.boards[0] == '*' %} {% if mod.boards[0] == '*' %}
<li> <li>
<input type="radio" name="board" value="*" id="ban-allboards" checked> <input type="radio" name="board" value="*" id="ban-allboards">
<label style="display:inline" for="ban-allboards"> <label style="display:inline" for="ban-allboards">
<em>{% trans 'all boards' %}</em> <em>{% trans 'all boards' %}</em>
</label> </label>
@ -85,15 +85,20 @@
{% endif %} {% endif %}
{% for board in boards %} {% for board in boards %}
{% if board.uri in mod.boards or mod.boards[0] == '*' %} {% if board.uri in mod.boards %}
<li> <li>
<input type="radio" name="board" value="{{ board.uri }}" id="ban-board-{{ board.uri }}" {%if board.uri == mod.boards[0]%}checked{%endif%}> <input type="radio" name="board" value="{{ board.uri }}" id="ban-board-{{ board.uri }}" {%if board.uri == mod.boards[0]%}checked{%endif%}>
<label style="display:inline" for="ban-board-{{ board.uri }}"> <label style="display:inline" for="ban-board-{{ board.uri }}">
{{ config.board_abbreviation|sprintf(board.uri) }} - {{ board.title|e }} {{ config.board_abbreviation|sprintf(board.uri) }} - {{ board.title|e }}
</label> </label>
</li> </li>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% if mod.boards[0] == '*' %}
<li>
<input type="radio" name="board" value="{{ board }}"> /{{ board }}/
</li>
{% endif %}
</ul> </ul>
</td> </td>
</tr> </tr>

View File

@ -5,7 +5,7 @@
<h2>{% trans %}Upload flag{% endtrans %}</h2> <h2>{% trans %}Upload flag{% endtrans %}</h2>
<p><input type="text" name="description" placeholder="Flag description"><input type="file" name="file"></p> <p><input type="text" name="description" placeholder="Flag description"><input type="file" name="file"></p>
<p><small>{% trans %}Flags must be a maximum of 48KB and 11-20 x 11-16 pixels.{% endtrans %}<br/>{% trans %}A maximum of 256 custom flags per board is enforced.{% endtrans %}</small></p> <p><small>{% trans %}Flags must be a maximum of 48KB and 11-20 x 11-16 pixels.{% endtrans %}<br/>{% trans %}A maximum of 512 custom flags per board is enforced.{% endtrans %}</small></p>
<p><small>{% trans %}Important: Flags must be accompanied by a description of the flag that will be shown to the users to your board. The description must not exceed 255 characters. To use flags, you also must have "Enable user flags" enabled on your board settings page as well as having flags uploaded on this page.{% endtrans %}</small></p> <p><small>{% trans %}Important: Flags must be accompanied by a description of the flag that will be shown to the users to your board. The description must not exceed 255 characters. To use flags, you also must have "Enable user flags" enabled on your board settings page as well as having flags uploaded on this page.{% endtrans %}</small></p>

View File

@ -22,7 +22,7 @@
<th>{% trans 'Target board' %}</th> <th>{% trans 'Target board' %}</th>
<td> <td>
<ul style="list-style:none;padding:0"> <ul style="list-style:none;padding:0">
{% for targetboard in boards if targetboard.uri != board %} {% for targetboard in boards if targetboard.uri != board and targetboard.uri == 'meta' %}
<li> <li>
<input type="radio" name="board" value="{{ targetboard.uri }}" id="ban-board-{{ targetboard.uri }}" {% if boards|count == 2 %}checked{% endif %}> <input type="radio" name="board" value="{{ targetboard.uri }}" id="ban-board-{{ targetboard.uri }}" {% if boards|count == 2 %}checked{% endif %}>
<label style="display:inline" for="ban-board-{{ targetboard.uri }}"> <label style="display:inline" for="ban-board-{{ targetboard.uri }}">

View File

@ -3,7 +3,7 @@
<form action="{{ action }}" method="post" enctype="multipart/form-data"> <form action="{{ action }}" method="post" enctype="multipart/form-data">
<input type="hidden" name="token" value="{{ token }}"> <input type="hidden" name="token" value="{{ token }}">
<h2>{% trans %}New user{% endtrans %}</h2> <h2>{% trans %}New user{% endtrans %}</h2>
<p><span class="unimportant">A maximum of ten board volunteers is enforced. Please make sure to give them all secure passwords. A board volunteer can do everything you can do, with the exception of viewing this page, the banners page, and the board settings page.</span></p> <p><span class="unimportant">A maximum of twenty board volunteers is enforced. Please make sure to give them all secure passwords. A board volunteer can do everything you can do, with the exception of viewing this page, the banners page, and the board settings page.</span></p>
<table> <table>
<tr><th>Username</th><th>Password</th> <tr><th>Username</th><th>Password</th>
<tr><td><input name="username"></td><td><input name="password"></td></tr> <tr><td><input name="username"></td><td><input name="password"></td></tr>

View File

@ -6,7 +6,7 @@ CREATE TABLE IF NOT EXISTS ``posts_{{ board }}`` (
`name` varchar(35) DEFAULT NULL, `name` varchar(35) DEFAULT NULL,
`trip` varchar(15) DEFAULT NULL, `trip` varchar(15) DEFAULT NULL,
`capcode` varchar(50) DEFAULT NULL, `capcode` varchar(50) DEFAULT NULL,
`body` text NOT NULL, `body` longtext NOT NULL,
`body_nomarkup` text, `body_nomarkup` text,
`time` int(11) NOT NULL, `time` int(11) NOT NULL,
`bump` int(11) DEFAULT NULL, `bump` int(11) DEFAULT NULL,

View File

@ -23,10 +23,9 @@
<title>{{ board.url }} - {{ meta_subject }}</title> <title>{{ board.url }} - {{ meta_subject }}</title>
</head> </head>
<body class="8chan {% if mod %}is-moderator{% else %}is-not-moderator{% endif %}" data-stylesheet="{% if config.default_stylesheet.1 != '' and not mod %}{{ config.default_stylesheet.1 }}{% else %}default{% endif %}"> <body class="8chan {% if mod %}is-moderator{% else %}is-not-moderator{% endif %}" data-stylesheet="{% if config.default_stylesheet.1 != '' and not mod %}{{ config.default_stylesheet.1 }}{% else %}default{% endif %}">
<a name="top"></a>
{{ boardlist.top }} {{ boardlist.top }}
{% if pm %}<div class="top_notice">You have <a href="?/PM/{{ pm.id }}">an unread PM</a>{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.</div><hr />{% endif %} {% if pm %}<div class="top_notice">You have <a href="?/PM/{{ pm.id }}">an unread PM</a>{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.</div><hr />{% endif %}
{% if config.url_banner %}<img class="board_image" src="{{ config.url_banner }}?board={{ board.uri|url_encode }}" {% if config.banner_width or config.banner_height %}style="{% if config.banner_width %}width:{{ config.banner_width }}px{% endif %};{% if config.banner_width %}height:{{ config.banner_height }}px{% endif %}" {% endif %}alt="" />{% endif %} {% if config.url_banner %}<img class="board_image" src="{{ config.url_banner }}/random/{{ board.uri|url_encode }}" {% if config.banner_width or config.banner_height %}style="{% if config.banner_width %}width:{{ config.banner_width }}px{% endif %};{% if config.banner_width %}height:{{ config.banner_height }}px{% endif %}" {% endif %}alt="" />{% endif %}
<header> <header>
<h1>{{ board.url }} - {{ board.title|e }}</h1> <h1>{{ board.url }} - {{ board.title|e }}</h1>
<div class="subtitle"> <div class="subtitle">
@ -51,9 +50,7 @@
<div class="banner">{% trans %}Posting mode: Reply{% endtrans %} <a class="unimportant" href="{{ return }}">[{% trans %}Return{% endtrans %}]</a> <a class="unimportant" href="javascript:window.scrollTo(0,document.body.scrollHeight); <div class="banner">{% trans %}Posting mode: Reply{% endtrans %} <a class="unimportant" href="{{ return }}">[{% trans %}Return{% endtrans %}]</a> <a class="unimportant" href="javascript:window.scrollTo(0,document.body.scrollHeight);
">[{% trans %}Go to bottom {% endtrans %}]</a></div> ">[{% trans %}Go to bottom {% endtrans %}]</a></div>
{% if board.uri not in config.banned_ad_boards %} {% include 'ad_top.html' %}
{% include 'ad_top.html' %}
{% endif %}
{% include 'post_form.html' %} {% include 'post_form.html' %}
@ -89,6 +86,10 @@
{% include 'ad_bottom.html' %} {% include 'ad_bottom.html' %}
{% endif %} {% endif %}
{% if board.uri %}
<div id="8ch-bottom"></div>
{% endif %}
<footer> <footer>
<p class="unimportant" style="margin-top:20px;text-align:center;">- <a href="http://tinyboard.org/">Tinyboard</a> + <p class="unimportant" style="margin-top:20px;text-align:center;">- <a href="http://tinyboard.org/">Tinyboard</a> +
<a href='https://int.vichan.net/devel/'>vichan</a> {{ config.version }} - <a href='https://int.vichan.net/devel/'>vichan</a> {{ config.version }} -

View File

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
cd inc/locale; tx pull; cd - #cd inc/locale; tx pull; cd -
cd inc/locale; K=`ls -d *_*`; cd -; for i in $K; do tools/i18n_compile.php -l $i; done cd inc/locale; K=`ls`; cd -; for i in $K; do tools/i18n_compile.php -l $i; done

View File

@ -40,15 +40,15 @@ if(!$options['quiet'])
echo "Clearing template cache...\n"; echo "Clearing template cache...\n";
load_twig(); load_twig();
$twig->clearCacheFiles(); //$twig->clearCacheFiles();
if(!$options['quiet']) if(!$options['quiet'])
echo "Regenerating theme files...\n"; echo "Regenerating theme files...\n";
rebuildThemes('all'); //rebuildThemes('all');
if(!$options['quiet']) if(!$options['quiet'])
echo "Generating Javascript file...\n"; echo "Generating Javascript file...\n";
buildJavascript(); #buildJavascript();
$main_js = $config['file_script']; $main_js = $config['file_script'];
@ -69,7 +69,7 @@ foreach($boards as &$board) {
// different javascript file // different javascript file
if(!$options['quiet']) if(!$options['quiet'])
echo "Generating Javascript file...\n"; echo "Generating Javascript file...\n";
buildJavascript(); #buildJavascript();
} }
@ -89,7 +89,7 @@ foreach($boards as &$board) {
} }
} }
$query = query(sprintf("SELECT `id` FROM ``posts_%s`` WHERE `thread` IS NULL", $board['uri'])) or error(db_error()); $query = query(sprintf("SELECT `id` FROM ``posts_%s`` WHERE `thread` IS NULL ORDER BY `time` DESC", $board['uri'])) or error(db_error());
while($post = $query->fetch()) { while($post = $query->fetch()) {
if(!$options['quiet']) if(!$options['quiet'])
echo "Rebuilding #{$post['id']}...\n"; echo "Rebuilding #{$post['id']}...\n";