1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-29 09:44:28 +01:00
Conflicts:
	inc/api.php
	js/multi-image.js
This commit is contained in:
czaks 2014-09-27 11:34:05 +02:00
commit e748a286b3
16 changed files with 475 additions and 449 deletions

View File

@ -2,6 +2,8 @@
include "inc/functions.php"; include "inc/functions.php";
include "inc/mod/auth.php"; include "inc/mod/auth.php";
include "inc/countries.php";
$admin = isset($mod["type"]) && $mod["type"]<=30; $admin = isset($mod["type"]) && $mod["type"]<=30;
if (php_sapi_name() == 'fpm-fcgi' && !$admin) { if (php_sapi_name() == 'fpm-fcgi' && !$admin) {
@ -9,31 +11,6 @@ if (php_sapi_name() == 'fpm-fcgi' && !$admin) {
} }
$boards = listBoards(); $boards = listBoards();
$body = <<<CSS
<style>
th.header {
background-image: url(/static/bg.gif);
cursor: pointer;
background-repeat: no-repeat;
background-position: center right;
padding-left: 20px;
margin-left: -1px;
}
th.headerSortUp {
background-image: url(/static/asc.gif);
}
th.headerSortDown {
background-image: url(/static/desc.gif);
}
.flag-eo {
background-image: url(/static/eo.png);
}
.flag-en {
background-image: url(/static/en.png);
}
</style>
CSS;
$body .= '<table class="modlog" style="width:auto"><thead><tr><th>L</th><th>Board</th><th>Board title</th><th>Posts in last hour</th><th>Total posts</th><th>Created</th></tr></thead><tbody>';
$total_posts_hour = 0; $total_posts_hour = 0;
$total_posts = 0; $total_posts = 0;
@ -69,6 +46,7 @@ function ($a, $b) {
}); });
$hidden_boards_total = 0; $hidden_boards_total = 0;
$rows = array();
foreach ($boards as $i => &$board) { foreach ($boards as $i => &$board) {
$board_config = @file_get_contents($board['uri'].'/config.php'); $board_config = @file_get_contents($board['uri'].'/config.php');
$boardCONFIG = array(); $boardCONFIG = array();
@ -84,9 +62,10 @@ foreach ($boards as $i => &$board) {
$locale_arr = explode('_', $locale); $locale_arr = explode('_', $locale);
$locale_short = isset($locale_arr[1]) ? strtolower($locale_arr[1]) : strtolower($locale_arr[0]); $locale_short = isset($locale_arr[1]) ? strtolower($locale_arr[1]) : strtolower($locale_arr[0]);
$locale_short = str_replace('.utf-8', '', $locale_short); $locale_short = str_replace('.utf-8', '', $locale_short);
if ($board['uri'] === 'int') {$locale_short = 'eo'; $locale = 'eo';} $country = get_country($locale_short);
if ($board['uri'] === 'int') {$locale_short = 'eo'; $locale = 'eo'; $country = 'Esperanto';}
$img = "<img class=\"flag flag-$locale_short\" src=\"/static/blank.gif\" style=\"width:16px;height:11px;\" alt=\"$locale\" title=\"$locale\">"; $board['img'] = "<img class=\"flag flag-$locale_short\" src=\"/static/blank.gif\" style=\"width:16px;height:11px;\" alt=\"$country\" title=\"$country\">";
if ($showboard || $admin) { if ($showboard || $admin) {
if (!$showboard) { if (!$showboard) {
@ -95,58 +74,18 @@ foreach ($boards as $i => &$board) {
$lock = ''; $lock = '';
} }
$board['ago'] = human_time_diff(strtotime($board['time'])); $board['ago'] = human_time_diff(strtotime($board['time']));
$body .= "<tr>";
$body .= "<td>$img</td>";
$body .= "<td><a href='/{$board['uri']}/'>/{$board['uri']}/</a>$lock</td>";
$body .= "<td>{$board['title']}</td>";
$body .= "<td style='text-align:right'>{$board['pph']}</td>";
$body .= "<td style='text-align:right'>{$board['max']}</td>";
$body .= "<td>{$board['time']} ({$board['ago']} ago)</td></tr>";
} else { } else {
unset($boards[$i]); unset($boards[$i]);
$hidden_boards_total += 1; $hidden_boards_total += 1;
} }
} }
$body .= <<<FOOTER
</tbody></table><script>
/*$.tablesorter.addParser({
id: 'flags',
is: function(s) {
return false;
},
format: function(s) {
return 0;
},
type: 'text'
}); */
$(function() {
$('table').tablesorter({sortList: [[3,1]],
textExtraction: function(node) {
childNode = node.childNodes[0];
if (!childNode) { return node.innerHTML; }
if (childNode.tagName == 'IMG') {
return childNode.getAttribute('class');
} else {
return (childNode.innerHTML ? childNode.innerHTML : childNode.textContent);
}
}
});
});
</script>
FOOTER;
$n_boards = sizeof($boards); $n_boards = sizeof($boards);
$t_boards = $hidden_boards_total + $n_boards; $t_boards = $hidden_boards_total + $n_boards;
$body = "<p style='text-align:center'>There are currently <strong>{$n_boards}</strong> boards + <strong>$hidden_boards_total</strong> unindexed boards = <strong>$t_boards</strong> total boards. Site-wide, {$total_posts_hour} posts have been made in the last hour, with {$total_posts} being made on all active boards since October 23, 2013.</p>" . $body;
//date_default_timezone_set('UTC');
$body .= "<p style='text-align:center'><em>Page last updated: ".date('r')."</em></p>";
$body .= "<p style='text-align:center'>".shell_exec('uptime -p')." without interruption</p>";
$config['additional_javascript'] = array('js/jquery.min.js', 'js/jquery.tablesorter.min.js'); $config['additional_javascript'] = array('js/jquery.min.js', 'js/jquery.tablesorter.min.js');
$body = Element("8chan/boards.html", array("config" => $config, "n_boards" => $n_boards, "t_boards" => $t_boards, "hidden_boards_total" => $hidden_boards_total, "total_posts" => $total_posts, "total_posts_hour" => $total_posts_hour, "boards" => $boards, "last_update" => date('r'), "uptime_p" => shell_exec('uptime -p')));
$html = Element("page.html", array("config" => $config, "body" => $body, "title" => "Boards on &infin;chan")); $html = Element("page.html", array("config" => $config, "body" => $body, "title" => "Boards on &infin;chan"));
if ($admin) { if ($admin) {
echo $html; echo $html;

View File

@ -20,7 +20,7 @@ if (!isset($_POST['uri'], $_POST['title'], $_POST['subtitle'], $_POST['username'
if (!$ayah){ if (!$ayah){
$game_html = ''; $game_html = '';
} else { } else {
$game_html = '<tr><th>Game</th><td>' . $ayah->getPublisherHTML() . '</td></tr>'; $game_html = '<tr><th>'._('Game').'</th><td>' . $ayah->getPublisherHTML() . '</td></tr>';
} }
if (!$cbRecaptcha){ if (!$cbRecaptcha){
@ -32,25 +32,9 @@ if (!$cbRecaptcha){
$password = base64_encode(openssl_random_pseudo_bytes(9)); $password = base64_encode(openssl_random_pseudo_bytes(9));
$body = <<<EOT $body = Element("8chan/create.html", array("config" => $config, "password" => $password, "game_html" => $game_html, "recapcha_html" => $recapcha_html));
<form method="POST">
<table class="modlog" style="width:auto">
<tbody>
<tr><th>URI</th><td>/<input name="uri" type="text" size="5">/ <span class="unimportant">(must be all lowercase or numbers and < 10 chars)</td></tr>
<tr><th>Title</th><td><input name="title" type="text"> <span class="unimportant">(must be < 40 chars)</td></tr>
<tr><th>Subtitle</th><td><input name="subtitle" type="text"> <span class="unimportant">(must be < 200 chars)</td></tr>
<tr><th>Username</th><td><input name="username" type="text"> <span class="unimportant">(must contain only alphanumeric, periods and underscores)</span></td></tr>
<tr><th>Password</th><td><input name="password" type="text" value="{$password}" readonly> <span class="unimportant">(write this down)</span></td></tr>
{$game_html}
{$recapcha_html}
</tbody>
</table>
<ul style="padding:0;text-align:center;list-style:none"><li><input type="submit" value="Create board"></li></ul>
</form>
EOT; echo Element("page.html", array("config" => $config, "body" => $body, "title" => _("Create your board"), "subtitle" => _("before someone else does")));
echo Element("page.html", array("config" => $config, "body" => $body, "title" => "Create your board", "subtitle" => "before someone else does"));
} }
else { else {
@ -77,30 +61,30 @@ $score = true;
$score = $ayah->scoreResult(); $score = $ayah->scoreResult();
} }
if (!$score) if (!$score)
error('You failed the game'); error(_('You failed the game'));
if (!$passedCaptcha) if (!$passedCaptcha)
error('You failed to enter the reCaptcha correctly'); error(_('You failed to enter the reCaptcha correctly'));
if (!preg_match('/^[a-z0-9]{1,10}$/', $uri)) if (!preg_match('/^[a-z0-9]{1,10}$/', $uri))
error('Invalid URI'); error(_('Invalid URI'));
if (!(strlen($title) < 40)) if (!(strlen($title) < 40))
error('Invalid title'); error(_('Invalid title'));
if (!(strlen($subtitle) < 200)) if (!(strlen($subtitle) < 200))
error('Invalid subtitle'); error(_('Invalid subtitle'));
if (!preg_match('/^[a-zA-Z0-9._]{1,30}$/', $username)) if (!preg_match('/^[a-zA-Z0-9._]{1,30}$/', $username))
error('Invalid username'); error(_('Invalid username'));
foreach (listBoards() as $i => $board) { foreach (listBoards() as $i => $board) {
if ($board['uri'] == $uri) if ($board['uri'] == $uri)
error('Board already exists!'); error(_('Board already exists!'));
} }
foreach ($bannedWords as $i => $w) { foreach ($bannedWords as $i => $w) {
if ($w[0] !== '/') { if ($w[0] !== '/') {
if (strpos($uri,$w) !== false) if (strpos($uri,$w) !== false)
error("Cannot create board with banned word $w"); error(_("Cannot create board with banned word $w"));
} else { } else {
if (preg_match($w,$uri)) if (preg_match($w,$uri))
error("Cannot create board matching banned pattern $w"); error(_("Cannot create board matching banned pattern $w"));
} }
} }
$query = prepare('SELECT ``username`` FROM ``mods`` WHERE ``username`` = :username'); $query = prepare('SELECT ``username`` FROM ``mods`` WHERE ``username`` = :username');
@ -109,7 +93,7 @@ $query->execute() or error(db_error($query));
$users = $query->fetchAll(PDO::FETCH_ASSOC); $users = $query->fetchAll(PDO::FETCH_ASSOC);
if (sizeof($users) > 0){ if (sizeof($users) > 0){
error('The username you\'ve tried to enter already exists!'); error(_('The username you\'ve tried to enter already exists!'));
} }
$salt = generate_salt(); $salt = generate_salt();
@ -142,20 +126,14 @@ buildIndex();
rebuildThemes('boards'); rebuildThemes('boards');
query("INSERT INTO ``board_create``(uri) VALUES('$uri')") or error(db_error()); $query = prepare("INSERT INTO ``board_create``(uri) VALUES(:uri)");
$query->bindValue(':uri', $uri);
$query->execute() or error(db_error());
_syslog(LOG_NOTICE, "New board: $uri"); _syslog(LOG_NOTICE, "New board: $uri");
$body = <<<EOT $body = Element("8chan/create_success.html", array("config" => $config, "password" => $_POST['password'], "uri" => $uri));
<p>Your new board is created and is live at <a href="/{$uri}">/{$uri}/</a>.</p> echo Element("page.html", array("config" => $config, "body" => $body, "title" => _("Success"), "subtitle" => _("This was a triumph")));
<p>Make sure you don't forget your password, <tt>{$_POST['password']}</tt>!</p>
<p>You can manage your board at <a href="http://8chan.co/mod.php?/">http://8chan.co/mod.php?/</a>.</p>
EOT;
echo Element("page.html", array("config" => $config, "body" => $body, "title" => "Success", "subtitle" => "This was a triumph"));
} }
?> ?>

View File

@ -1136,6 +1136,8 @@
// This is a particularly advanced feature - contact ctrlcctrlv or rails unless you // This is a particularly advanced feature - contact ctrlcctrlv or rails unless you
// really know what you're doing // really know what you're doing
$config['dir']['img_root'] = ''; $config['dir']['img_root'] = '';
// DO NOT COMMENT OUT, LEAVE BLANK AND OVERRIDE IN INSTANCE CONFIG
// Though, you shouldnt be editing this file, so what do I know?
// For load balancing, having a seperate server (and domain/subdomain) for serving static content is // For load balancing, having a seperate server (and domain/subdomain) for serving static content is

29
inc/countries.php Normal file
View File

@ -0,0 +1,29 @@
<?php
function get_country( $code ){
$country = '';
if( $code == 'en' ) $country = 'English';
if( $code == 'cs' ) $country = 'Czech';
if( $code == 'da' ) $country = 'Danish';
if( $code == 'de' ) $country = 'German';
if( $code == 'eo' ) $country = 'Esperanto';
if( $code == 'es' ) $country = 'Spanish';
if( $code == 'fi' ) $country = 'Finnish';
if( $code == 'fr' ) $country = 'French';
if( $code == 'hu' ) $country = 'Hungarian';
if( $code == 'it' ) $country = 'Italian';
if( $code == 'ja' ) $country = 'Japanese';
if( $code == 'jbo' ) $country = 'Lojban';
if( $code == 'lt' ) $country = 'Lithuanian';
if( $code == 'lv' ) $country = 'Latvian';
if( $code == 'nb' ) $country = 'Norwegian';
if( $code == 'nl' ) $country = 'Dutch';
if( $code == 'pl' ) $country = 'Polish';
if( $code == 'pt' ) $country = 'Portuguese';
if( $code == 'ru' ) $country = 'Russian';
if( $code == 'sk' ) $country = 'Slovak';
if( $code == 'zh' ) $country = 'Chinese';
if( $country == '') $country = $code;
return $country;
}

View File

@ -657,8 +657,8 @@ function listBoards($just_uri = false) {
$just_uri ? $cache_name = 'all_boards_uri' : $cache_name = 'all_boards'; $just_uri ? $cache_name = 'all_boards_uri' : $cache_name = 'all_boards';
if ($config['cache']['enabled'] && ($boards = cache::get($cache_name))) //if ($config['cache']['enabled'] && ($boards = cache::get($cache_name)))
return $boards; //return $boards;
if (!$just_uri) { if (!$just_uri) {
$query = query("SELECT ``boards``.`uri` uri, ``boards``.`title` title, ``boards``.`subtitle` subtitle, ``board_create``.`time` time FROM ``boards`` LEFT JOIN ``board_create`` ON ``boards``.`uri` = ``board_create``.`uri` ORDER BY ``boards``.`uri`") or error(db_error()); $query = query("SELECT ``boards``.`uri` uri, ``boards``.`title` title, ``boards``.`subtitle` subtitle, ``board_create``.`time` time FROM ``boards`` LEFT JOIN ``board_create`` ON ``boards``.`uri` = ``board_create``.`uri` ORDER BY ``boards``.`uri`") or error(db_error());
@ -666,7 +666,9 @@ function listBoards($just_uri = false) {
} else { } else {
$boards = array(); $boards = array();
$query = query("SELECT `uri` FROM ``boards``") or error(db_error()); $query = query("SELECT `uri` FROM ``boards``") or error(db_error());
while ($board = $query->fetchColumn()) { while (true) {
$board = $query->fetchColumn();
if ($board === FALSE) break;
$boards[] = $board; $boards[] = $board;
} }
} }

View File

@ -22,6 +22,9 @@
$config['cookies']['mod'] = 'mod'; $config['cookies']['mod'] = 'mod';
$config['cookies']['salt'] = ''; $config['cookies']['salt'] = '';
$config['spam']['hidden_inputs_max_pass'] = 128;
$config['spam']['hidden_inputs_expire'] = 60 * 60 * 4; // three hours
$config['flood_time'] = 5; $config['flood_time'] = 5;
$config['flood_time_ip'] = 2; $config['flood_time_ip'] = 2;
$config['flood_time_same'] = 2; $config['flood_time_same'] = 2;
@ -41,6 +44,8 @@
$config['allow_no_country'] = true; $config['allow_no_country'] = true;
$config['thread_subject_in_title'] = true; $config['thread_subject_in_title'] = true;
$config['spam']['hidden_inputs_max_pass'] = 128; $config['spam']['hidden_inputs_max_pass'] = 128;
$config['ayah_enabled'] = true;
$config['dnsbl'] = array();
include "secrets.php"; include "secrets.php";
@ -92,17 +97,14 @@
$config['additional_javascript'][] = 'js/favorites.js'; $config['additional_javascript'][] = 'js/favorites.js';
$config['additional_javascript'][] = 'js/show-op.js'; $config['additional_javascript'][] = 'js/show-op.js';
$config['additional_javascript'][] = 'js/hide-threads.js'; $config['additional_javascript'][] = 'js/hide-threads.js';
$config['additional_javascript'][] = 'js/mobile-style.js';
$config['additional_javascript'][] = 'js/smartphone-spoiler.js'; $config['additional_javascript'][] = 'js/smartphone-spoiler.js';
$config['additional_javascript'][] = 'js/inline-expanding.js'; $config['additional_javascript'][] = 'js/inline-expanding.js';
$config['additional_javascript'][] = 'js/show-backlinks.js'; $config['additional_javascript'][] = 'js/show-backlinks.js';
$config['additional_javascript'][] = 'js/catalog-link.js';
$config['additional_javascript'][] = 'js/webm-settings.js'; $config['additional_javascript'][] = 'js/webm-settings.js';
$config['additional_javascript'][] = 'js/expand-video.js'; $config['additional_javascript'][] = 'js/expand-video.js';
$config['additional_javascript'][] = 'js/treeview.js'; $config['additional_javascript'][] = 'js/treeview.js';
$config['additional_javascript'][] = 'js/quick-post-controls.js'; $config['additional_javascript'][] = 'js/quick-post-controls.js';
$config['additional_javascript'][] = 'js/expand-too-long.js'; $config['additional_javascript'][] = 'js/expand-too-long.js';
//$config['additional_javascript'][] = 'js/auto-reload.js';
$config['additional_javascript'][] = 'js/settings.js'; $config['additional_javascript'][] = 'js/settings.js';
$config['additional_javascript'][] = 'js/fix-report-delete-submit.js'; $config['additional_javascript'][] = 'js/fix-report-delete-submit.js';
$config['additional_javascript'][] = 'js/hide-images.js'; $config['additional_javascript'][] = 'js/hide-images.js';
@ -118,7 +120,7 @@
$config['additional_javascript'][] = 'js/forced-anon.js'; $config['additional_javascript'][] = 'js/forced-anon.js';
$config['additional_javascript'][] = 'js/toggle-locked-threads.js'; $config['additional_javascript'][] = 'js/toggle-locked-threads.js';
$config['additional_javascript'][] = 'js/toggle-images.js'; $config['additional_javascript'][] = 'js/toggle-images.js';
$config['additional_javascript'][] = 'js/threadscroll.js'; $config['additional_javascript'][] = 'js/mobile-style.js';
$config['font_awesome_css'] = '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css'; $config['font_awesome_css'] = '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css';
@ -388,3 +390,5 @@ EOT;
); );
$config['gzip_static'] = false; $config['gzip_static'] = false;
require_once "dnsbls.php";

View File

@ -1,4 +0,0 @@
<?php
$config['db']['password'] = '57x9RaVc8HQW2Ga0i74w';
$config['cookies']['salt'] = 'UiFLKolfLXUIZZCDQIFOQT1fjCvdyvWqIx3olOnJq0TJpbCAeC';
$config['secure_trip_salt'] = 'sK7A4umU4dU0875MAi012239p4WdE7A699032MJWxspSOqb39X';

323
index.php
View File

@ -1,323 +1,4 @@
<?php <?php
include "inc/functions.php"; include 'inc/functions.php';
$boards = sizeof(listBoards());
?>
<!doctype html> echo Element("8chan/index.html", array("config" => $config));
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>∞chan</title>
<style type="text/css">
/* Responsive helpers */
.col {
float: left;
}
.col-12 { width: 100%; }
.col-11 { width: 91.66666667%; }
.col-10 { width: 83.33333333%; }
.col-9 { width: 75%; }
.col-8 { width: 66.66666667%; }
.col-7 { width: 58.33333333%; }
.col-6 { width: 50%; }
.col-5 { width: 41.66666667%; }
.col-4 { width: 33.33333333%; }
.col-3 { width: 25%; }
.col-2 { width: 16.66666667%; }
.col-1 { width: 8.33333333%; }
.left-push {
float: left;
}
.right-push {
float: right;
}
/* Main */
* {
box-sizing: border-box;
}
body {
background: #EEF2FF;
font-family: 'Verdana', 'Arial', 'Helvetica', sans-serif;
line-height: 1.4;
}
#main {
margin: 0 auto;
max-width: 1110px;
width: 100%;
}
h420 {
color: #AF0A0F;
font-size: 11pt;
font-weight: bold;
margin: 0px;
padding: 0px;
}
ul, ol, dl {
padding: 0;
margin: 0;
}
a { color: #42413C; }
a:hover { color: white; }
a:visited { color: #6E6C64; }
.clear {
clear: both;
}
.mobileDisplay {
display: none;
width: 100%;
}
/* Header */
header {
background-color: #D6DAF0;
border: 1px solid #000;
display: inline-block;
line-height: 150%;
padding: 5px;
text-align: center;
width: 100%;
}
.header_text {
margin-top: 55px;
}
/* Body */
#content {
display: inline-block;
width: 100%;
}
.content_menu {
background-color: #D6DAF0;
border: 1px solid #000;
text-align: left;
list-style-position: inside;
padding: 15px 30px;
text-align: left;
}
.content_menu_head li {
list-style: none;
border-top: 1px solid #666;
margin-bottom: 15px;
}
.content_menu_head a {
padding: 5px 5px 5px 15px;
display: block;
width: 160px;
text-decoration: none;
}
.content_body {
padding: 20px;
}
iframe {
margin-top: 25px;
}
.button {
padding: 13px 18px;
border: 2px solid #000;
font-size: 2.75em;
color: #AF0A0F;
text-align: center;
display: inline-block;
background: #D6DAF0;
margin-right: 5px;
margin-top: 15px;
text-decoration: none;
font-style: normal;
}
/* Footer */
.footer {
text-align: center;
padding: 10px 0;
font-size: 10px;
margin-top: 20px;
text-align: center;
}
/* Responsive */
@media (max-width: 920px) {
#content {
margin-top: 10px;
}
.menuCol {
width: 100%;
float: none;
}
.bodyCol {
width: 100%;
float: none;
margin-top: 20px;
}
.header_logo {
float: none;
margin: auto;
width: 100%;
}
.header_text {
float: none;
margin: auto;
margin-top: 10px;
width: 100%;
}
.content_menu_head {
width: 45%;
float: left;
}
.content_menu_list {
width: 45%;
float: right;
}
.mobileDisplay {
display:inline-block;
text-align:center;
}
.mobileHide {
display:none;
}
}
@media (max-width: 570px) {
.content_menu_head {
width: 100%;
float: none;
}
.content_menu_list {
width: 100%;
float: none;
}
.button {
font-size: 1.2em;
}
}
</style>
</head>
<body>
<div id="main">
<header>
<div class="col col-3 header_logo">
<img src="https://8chan.co/static/logo_33.svg" alt="logo" name="logo" width="220" height="145" id="logo">
</div>
<div class="col col-9 header_text">
<em>Welcome to ∞chan, the infinitely expanding imageboard.</em>
<br/>
<strong>Featured boards:</strong>
<span class="sub" data-description="2">[ <a href="/v/index.html" title="Vidya Games">v</a> / <a href="/a/index.html" title="Anime, Manga and all things related">a</a> / <a href="/tg/index.html" title="Traditional Games">tg</a> / <a href="/fit/index.html" title="Fitness, Health, and Feels">fit</a> / <a href="/pol/index.html" title=" Politically Incorrect">pol</a> / <a href="/tech/index.html" title="Technology">tech</a> / <a href="/mu/index.html" title="Music">mu</a> / <a href="/co/index.html" title="Comics &amp; Cartoons">co</a> / <a href="/sp/index.html" title="Sports">sp</a> / <a href="/boards/index.html" title="8chan Boards">boards</a> ]</span>
</div>
</header>
<div class="mobileDisplay">
<a href="create.php" class="button">Create&nbsp;your&nbsp;board</a>
<a href="boards.html" class="button">Browse&nbsp;existing&nbsp;boards</a>
</div>
<div id="content">
<div class="col col-3 menuCol">
<div class="content_menu">
<ul class="content_menu_head">
<li><em><a href="https://qchat.rizon.net/?channels=#8chan" target="_blank" />IRC:#8chan @ irc.rizon.net</a></li>
<li><a href="/faq.html">Frequently Asked Questions</a></li>
<li><a href="/random.php">View random board</a></li>
<li><a href="/mod.php" >Manage your board</a></li>
</ul>
<div class="content_menu_list">
<h420>Why host your imageboard on 8ch?</h420>
<br/>
<li>100% free</li>
<li>Customizable board styles and banners</li
><li>User-definable word filters</li>
<li>Optional forced anonymity</li>
<li>Optional country flags</li>
<li>YouTube embedding</li>
<li>Run by competent, experienced global staff</li>
<li>No technical knowledge needed</li>
<li>HTTPS by default</li>
<li>Simple global rules the rest is up to you</li>
<li><s>Featured on Al Jazeera America</s> ;_;</li>
<li><em>Not owned by moot</em></li>
</div>
<div class="clear"></div>
<hr/>
<a class="twitter-timeline" data-dnt="true" href="https://twitter.com/infinitechan" data-widget-id="512750449955328002">Tweets by @infinitechan</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
</div>
<div class="col col-9 bodyCol">
<div class="content_body">
<p>On ∞chan, you can create your own imageboard for free with no experience or programming knowledge needed. As long as the admin logs in once per week and it gets one new post every 72 hours, the board will be hosted forever.</p>
<div class="mobileHide">
<a href="create.php" class="button">Create&nbsp;your&nbsp;board</a>
<a href="boards.html" class="button">Browse&nbsp;existing&nbsp;boards</a>
</div>
<br/>
<!-- START RIZON PASTE / NEWS SCRIPT CODE HERE -->
<iframe src="https://qchat2.rizon.net/?channels=8chan&uio=OT0xMTE05" width="100%" height="400"></iframe>
<!--END PASTE CODE -->
</div>
</div>
</div>
<div class="col col-12 footer">
<hr />
- <a href="http://tinyboard.org"/>Tinyboard</a> + <a href="https://int.vichan.net/devel/"/>vichan</a> 4.9.91 -<br />
<a href="http://tinyboard.org/"/>Tinyboard</a> Copyright © 2010-2014 Tinyboard Development Group <br />
<a href="https://int.vichan.net/devel/"/>vichan</a> Copyright © 2012-2014 vichan-devel<br />
<hr width="50%" />
All trademarks, copyrights, comments, and images on this page are owned by and are the responsibility of their respective parties.<br />
Proprietary Tinyboard changes & 8chan.co trademark and logo © 2013-2014 <a href="https://blog.8chan.co/"/>Fredrick Brennan</a><br />
To make a DMCA request or report illegal content, please email <a href="mailto:admin@8chan.co">admin@8chan.co</a> or use the "Global Report" functionality on every page.<br />
</div>
</div>
</body>
</html>

View File

@ -24,12 +24,22 @@ $(document).ready(function(){
imageHover = !imageHover; imageHover = !imageHover;
var imageEnter = function(){ var imageEnter = function(){
if (!imageHover) if (!imageHover)
return; return;
//don't hover-image if image expanded
if ($(this).parent().attr("data-expanded") == "true")
return;
mouseexitedImage = false; mouseexitedImage = false;
mouseisOnImage = false; mouseisOnImage = false;
//remove hover-image if user clicks on image to expand it
$(this).click(function(){
mouseexitedImage = false;
mouseisOnImage = false;
$("#hover-image").remove();
});
isVideo = (($(this).prop("tagName") == "VIDEO") ? true:($(this).parent().attr("href").indexOf("player.php?v=") > -1) ? true:false); isVideo = (($(this).prop("tagName") == "VIDEO") ? true:($(this).parent().attr("href").indexOf("player.php?v=") > -1) ? true:false);
maxWidth = document.body.offsetWidth-(document.body.offsetWidth * 0.25); maxWidth = document.body.offsetWidth-(document.body.offsetWidth * 0.25);
maxHeight = document.documentElement.clientHeight; maxHeight = document.documentElement.clientHeight;
@ -78,7 +88,7 @@ $(document).ready(function(){
$mrCheckie = $('<div><label id=\"toggle-image-hover\"><input id="toggle-hover" type=\"checkbox\"> show image on hover</label></div>'); $mrCheckie = $('<div><label id=\"toggle-image-hover\"><input id="toggle-hover" type=\"checkbox\"> show image on hover</label></div>');
$(".options_tab").append($mrCheckie); $(".options_tab:first").append($mrCheckie);
$("#toggle-hover").prop("checked", imageHover); $("#toggle-hover").prop("checked", imageHover);
$("#toggle-hover").on("click", function(){ $("#toggle-hover").on("click", function(){
if ($(this).prop("checked")){ if ($(this).prop("checked")){
@ -90,7 +100,7 @@ $(document).ready(function(){
} }
}); });
$(".options_tab").append();
$(document).on("new_post", function(e, post) { $(document).on("new_post", function(e, post) {
$(post).hover(imageEnter(),imageLeave()); $(post).hover(imageEnter(),imageLeave());

View File

@ -239,11 +239,11 @@ if (isset($_POST['delete'])) {
error($config['error']['noaccess']); error($config['error']['noaccess']);
} }
if (!$post['mod']) { /*if (!$post['mod']) {
$post['antispam_hash'] = checkSpam(array($board['uri'], isset($post['thread']) ? $post['thread'] : ($config['try_smarter'] && isset($_POST['page']) ? 0 - (int)$_POST['page'] : null))); $post['antispam_hash'] = checkSpam(array($board['uri'], isset($post['thread']) ? $post['thread'] : ($config['try_smarter'] && isset($_POST['page']) ? 0 - (int)$_POST['page'] : null)));
if ($post['antispam_hash'] === true) if ($post['antispam_hash'] === true)
error($config['error']['spam']); error($config['error']['spam']);
} }*/
if ($config['robot_enable'] && $config['robot_mute']) { if ($config['robot_enable'] && $config['robot_mute']) {
checkMute(); checkMute();

View File

@ -2,9 +2,7 @@
include "inc/functions.php"; include "inc/functions.php";
$boards = listBoards(true); $boards = listBoards(TRUE);
$board = array_rand($boards); $board = array_rand($boards);
header('Location: /'.$boards[$board]); header('Location: /'.$boards[$board]);
?> ?>

View File

@ -0,0 +1,55 @@
<style>
th.header {
background-image: url(/static/bg.gif);
cursor: pointer;
background-repeat: no-repeat;
background-position: center right;
padding-left: 20px;
margin-left: -1px;
}
th.headerSortUp {
background-image: url(/static/asc.gif);
}
th.headerSortDown {
background-image: url(/static/desc.gif);
}
.flag-eo {
background-image: url(/static/eo.png);
}
.flag-en {
background-image: url(/static/en.png);
}
</style>
<p style='text-align:center'>{% trans %}There are currently <strong>{{n_boards}}</strong> boards + <strong>{{hidden_boards_total}}</strong> unindexed boards = <strong>{{t_boards}}</strong> total boards. Site-wide, {{total_posts_hour}} posts have been made in the last hour, with {{total_posts}} being made on all active boards since October 23, 2013.{% endtrans %}</p>
<table class="modlog" style="width:auto"><thead><tr><th>L</th><th>{% trans %}Board{% endtrans %}</th><th>{% trans %}Board title{% endtrans %}</th><th>{% trans %}Posts in last hour{% endtrans %}</th><th>{% trans %}Total posts{% endtrans %}</th><th>{% trans %}Created{% endtrans %}</th></tr></thead><tbody>
{% for board in boards %}
<tr>
<td>{{ board.img|raw }}</td>
<td><a href='/{{board['uri']}}/'>/{{board['uri']}}/</a>{{lock|raw}}</td>
<td>{{ board['title'] }}</td>
<td style='text-align:right'>{{board['pph']}}</td>
<td style='text-align:right'>{{board['max']}}</td>
<td>{{board['time']}} ({{board['ago']}} ago)</td></tr>
{% endfor %}
</tbody></table>
<p style='text-align:center'><em>Page last updated: {{last_update}}</em></p>
<p style='text-align:center'>{{uptime_p}} without interruption</p>
<script>
$(function() {
$('table').tablesorter({sortList: [[3,1]],
textExtraction: function(node) {
childNode = node.childNodes[0];
if (!childNode) { return node.innerHTML; }
if (childNode.tagName == 'IMG') {
return childNode.getAttribute('class');
} else {
return (childNode.innerHTML ? childNode.innerHTML : childNode.textContent);
}
}
});
});
</script>

View File

@ -0,0 +1,15 @@
<form method="POST">
<table class="modlog" style="width:auto">
<tbody>
<tr><th>URI</th><td>/<input name="uri" type="text" size="5">/ <span class="unimportant">{% trans %}(must be all lowercase or numbers and < 10 chars){% endtrans %}</td></tr>
<tr><th>Title</th><td><input name="title" type="text"> <span class="unimportant">{% trans %}(must be < 40 chars){% endtrans %}</td></tr>
<tr><th>Subtitle</th><td><input name="subtitle" type="text"> <span class="unimportant">{% trans %}(must be < 200 chars){% endtrans %}</td></tr>
<tr><th>{% trans %}Username{% endtrans %}</th><td><input name="username" type="text"> <span class="unimportant">{% trans %}(must contain only alphanumeric, periods and underscores){% endtrans %}</span></td></tr>
<tr><th>{% trans %}Password{% endtrans %}</th><td><input name="password" type="text" value="{{ password }}" readonly> <span class="unimportant">{% trans %}(write this down){% endtrans %}</span></td></tr>
{{ game_html }}
{{ recapcha_html }}
</tbody>
</table>
<ul style="padding:0;text-align:center;list-style:none"><li><input type="submit" value="{% trans %}Create board{% endtrans %}"></li></ul>
</form>

View File

@ -0,0 +1,5 @@
<p>{% trans %}Your new board is created and is live at{% endtrans %} <a href="/{{ uri }}">/{{ uri }}/</a>.</p>
<p>{% trans %}Make sure you don't forget your password, <tt>{{ password }}</tt>!{% endtrans %}</p>
<p>{% trans %}You can manage your board at <a href="http://8chan.co/mod.php?/">http://8chan.co/mod.php?/</a>.{% endtrans %}</p>

311
templates/8chan/index.html Normal file
View File

@ -0,0 +1,311 @@
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>∞chan</title>
<style type="text/css">
/* Responsive helpers */
.col {
float: left;
}
.col-12 { width: 100%; }
.col-11 { width: 91.66666667%; }
.col-10 { width: 83.33333333%; }
.col-9 { width: 75%; }
.col-8 { width: 66.66666667%; }
.col-7 { width: 58.33333333%; }
.col-6 { width: 50%; }
.col-5 { width: 41.66666667%; }
.col-4 { width: 33.33333333%; }
.col-3 { width: 25%; }
.col-2 { width: 16.66666667%; }
.col-1 { width: 8.33333333%; }
.left-push {
float: left;
}
.right-push {
float: right;
}
/* Main */
* {
box-sizing: border-box;
}
body {
background: #EEF2FF;
font-family: 'Verdana', 'Arial', 'Helvetica', sans-serif;
line-height: 1.4;
}
#main {
margin: 0 auto;
max-width: 1110px;
width: 100%;
}
h420 {
color: #AF0A0F;
font-size: 11pt;
font-weight: bold;
margin: 0px;
padding: 0px;
}
ul, ol, dl {
padding: 0;
margin: 0;
}
a { color: #42413C; }
a:hover { color: white; }
a:visited { color: #6E6C64; }
.clear {
clear: both;
}
.mobileDisplay {
display: none;
width: 100%;
}
/* Header */
header {
background-color: #D6DAF0;
border: 1px solid #000;
display: inline-block;
line-height: 150%;
padding: 5px;
text-align: center;
width: 100%;
}
.header_text {
margin-top: 55px;
}
/* Body */
#content {
display: inline-block;
width: 100%;
}
.content_menu {
background-color: #D6DAF0;
border: 1px solid #000;
text-align: left;
list-style-position: inside;
padding: 15px 30px;
text-align: left;
}
.content_menu_head li {
list-style: none;
border-top: 1px solid #666;
margin-bottom: 15px;
}
.content_menu_head a {
padding: 5px 5px 5px 15px;
display: block;
width: 160px;
text-decoration: none;
}
.content_body {
padding: 20px;
}
iframe {
margin-top: 25px;
}
.button {
padding: 13px 18px;
border: 2px solid #000;
font-size: 2.75em;
color: #AF0A0F;
text-align: center;
display: inline-block;
background: #D6DAF0;
margin-right: 5px;
margin-top: 15px;
text-decoration: none;
font-style: normal;
}
/* Footer */
.footer {
text-align: center;
padding: 10px 0;
font-size: 10px;
margin-top: 20px;
text-align: center;
}
/* Responsive */
@media (max-width: 920px) {
#content {
margin-top: 10px;
}
.menuCol {
width: 100%;
float: none;
}
.bodyCol {
width: 100%;
float: none;
margin-top: 20px;
}
.header_logo {
float: none;
margin: auto;
width: 100%;
}
.header_text {
float: none;
margin: auto;
margin-top: 10px;
width: 100%;
}
.content_menu_head {
width: 45%;
float: left;
}
.content_menu_list {
width: 45%;
float: right;
}
.mobileDisplay {
display:inline-block;
text-align:center;
}
.mobileHide {
display:none;
}
}
@media (max-width: 570px) {
.content_menu_head {
width: 100%;
float: none;
}
.content_menu_list {
width: 100%;
float: none;
}
.button {
font-size: 1.2em;
}
}
</style>
</head>
<body>
<div id="main">
<header>
<div class="col col-3 header_logo">
<img src="https://8chan.co/static/logo_33.svg" alt="logo" name="logo" width="220" height="145" id="logo">
</div>
<div class="col col-9 header_text">
<em>{% trans %}Welcome to ∞chan, the infinitely expanding imageboard.{% endtrans %}</em>
<br/>
<strong>{% trans %}Featured boards:{% endtrans %}</strong>
<span class="sub" data-description="2">[ <a href="/v/index.html" title="Vidya Games">v</a> / <a href="/a/index.html" title="Anime, Manga and all things related">a</a> / <a href="/tg/index.html" title="Traditional Games">tg</a> / <a href="/fit/index.html" title="Fitness, Health, and Feels">fit</a> / <a href="/pol/index.html" title=" Politically Incorrect">pol</a> / <a href="/tech/index.html" title="Technology">tech</a> / <a href="/mu/index.html" title="Music">mu</a> / <a href="/co/index.html" title="Comics &amp; Cartoons">co</a> / <a href="/sp/index.html" title="Sports">sp</a> / <a href="/boards/index.html" title="8chan Boards">boards</a> ]</span>
</div>
</header>
<div class="mobileDisplay">
<a href="create.php" class="button">{% trans %}Create&nbsp;your&nbsp;board{% endtrans %}</a>
<a href="boards.html" class="button">{% trans %}Browse&nbsp;existing&nbsp;boards{% endtrans %}</a>
</div>
<div id="content">
<div class="col col-3 menuCol">
<div class="content_menu">
<ul class="content_menu_head">
<li><em><a href="https://qchat.rizon.net/?channels=#8chan" target="_blank" />IRC:#8chan @ irc.rizon.net</a></em></li>
<li><a href="/faq.html">{% trans %}Frequently Asked Questions{% endtrans %}</a></li>
<li><a href="/random.php">{% trans %}View random board{% endtrans %}</a></li>
<li><a href="/mod.php" >{% trans %}Manage your board{% endtrans %}</a></li>
</ul>
<div class="content_menu_list">
<h420>{% trans %}Why host your imageboard on 8ch?{% endtrans %}</h420>
<br/>
<li>{% trans %}100% free{% endtrans %}</li>
<li>{% trans %}Customizable board styles and banners{% endtrans %}</li
><li>{% trans %}User-definable word filters{% endtrans %}</li>
<li>{% trans %}Optional forced anonymity{% endtrans %}</li>
<li>{% trans %}Optional country flags{% endtrans %}</li>
<li>{% trans %}YouTube embedding{% endtrans %}</li>
<li>{% trans %}Run by competent, experienced global staff{% endtrans %}</li>
<li>{% trans %}No technical knowledge needed{% endtrans %}</li>
<li>{% trans %}HTTPS by default{% endtrans %}</li>
<li>{% trans %}Simple global rules — the rest is up to you{% endtrans %}</li>
<li><s>{% trans %}Featured on Al Jazeera America{% endtrans %}</s> ;_;</li>
<li><em>{% trans %}Not owned by moot{% endtrans %}</em></li>
</div>
<div class="clear"></div>
<hr/>
<a class="twitter-timeline" data-dnt="true" href="https://twitter.com/infinitechan" data-widget-id="512750449955328002">Tweets by @infinitechan</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
</div>
<div class="col col-9 bodyCol">
<div class="content_body">
<p>{% trans %}On ∞chan, you can create your own imageboard for free with no experience or programming knowledge needed. As long as the admin logs in once per week and it gets one new post every 72 hours, the board will be hosted forever.{% endtrans %}</p>
<div class="mobileHide">
<a href="create.php" class="button">{% trans %}Create&nbsp;your&nbsp;board{% endtrans %}</a>
<a href="boards.html" class="button">{% trans %}Browse&nbsp;existing&nbsp;boards{% endtrans %}</a>
</div>
<br/>
<!-- START RIZON PASTE / NEWS SCRIPT CODE HERE -->
<iframe src="https://qchat2.rizon.net/?channels=8chan&uio=OT0xMTE05" width="100%" height="400"></iframe>
<!--END PASTE CODE -->
</div>
</div>
</div>
<div class="col col-12 footer">
<footer>
<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 }} -
<br><a href="http://tinyboard.org/">Tinyboard</a> Copyright &copy; 2010-2014 Tinyboard Development Group
<br><a href="https://int.vichan.net/devel/">vichan</a> Copyright &copy; 2012-2014 vichan-devel</p>
{% for footer in config.footer %}<p class="unimportant" style="text-align:center;">{{ footer }}</p>{% endfor %}
</footer>
</div>
</body>
</html>

View File

@ -31,6 +31,7 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if mod %}<p><a href="?/">{% trans %}Return to dashboard{% endtrans %}</a></p>{% endif %} {% if mod %}<p><a href="?/">{% trans %}Return to dashboard{% endtrans %}</a></p>{% endif %}
<p><a href="{{ config.root }}{{ board.dir }}{{ config.catalog_link }}">Catalog</a></p>
</div> </div>
</header> </header>