forked from GithubBackups/vichan
Merge branch 'master' of https://github.com/ctrlcctrlv/infinity
This commit is contained in:
commit
48d02bfbef
16
boards.php
16
boards.php
@ -81,7 +81,6 @@ $searchHTML = Element("8chan/boards-search.html", array(
|
|||||||
|
|
||||||
"founding_date" => $founding_date,
|
"founding_date" => $founding_date,
|
||||||
"page_updated" => date('r'),
|
"page_updated" => date('r'),
|
||||||
"uptime" => shell_exec('uptime -p'),
|
|
||||||
|
|
||||||
"html_boards" => $boardsHTML,
|
"html_boards" => $boardsHTML,
|
||||||
"html_tags" => $tagsHTML
|
"html_tags" => $tagsHTML
|
||||||
@ -91,7 +90,8 @@ $searchHTML = Element("8chan/boards-search.html", array(
|
|||||||
$pageHTML = Element("page.html", array(
|
$pageHTML = Element("page.html", array(
|
||||||
"title" => _("Boardlist"),
|
"title" => _("Boardlist"),
|
||||||
"config" => $config,
|
"config" => $config,
|
||||||
"body" => $searchHTML
|
"body" => $searchHTML,
|
||||||
|
"title" => _("Boards on ∞chan")
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -103,7 +103,15 @@ if (php_sapi_name() == 'cli') {
|
|||||||
|
|
||||||
file_write("boards.html", $pageHTML);
|
file_write("boards.html", $pageHTML);
|
||||||
file_write("boards.json", json_encode($nonAssociativeBoardList));
|
file_write("boards.json", json_encode($nonAssociativeBoardList));
|
||||||
file_write("boards-top20.json", json_encode(array_splice($nonAssociativeBoardList, 0, 48)));
|
|
||||||
|
$topbar = array();
|
||||||
|
foreach ($boards as $i => $b) {
|
||||||
|
if (!in_array($b['uri'], $config['no_top_bar_boards'])) {
|
||||||
|
$topbar[] = $b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
file_write("boards-top20.json", json_encode(array_splice($topbar, 0, 48)));
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $pageHTML;
|
echo $pageHTML;
|
||||||
|
@ -417,10 +417,10 @@ class Post {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getClean( ) {
|
public function getClean($actually_do = false) {
|
||||||
global $board, $config;
|
global $board, $config;
|
||||||
|
|
||||||
if( !isset( $this->clean ) ) {
|
if( !isset( $this->clean ) && $actually_do ) {
|
||||||
if ($config['cache']['enabled'] && $this->clean = cache::get("post_clean_{$board['uri']}_{$this->id}")) {
|
if ($config['cache']['enabled'] && $this->clean = cache::get("post_clean_{$board['uri']}_{$this->id}")) {
|
||||||
return $this->clean;
|
return $this->clean;
|
||||||
}
|
}
|
||||||
@ -443,8 +443,10 @@ class Post {
|
|||||||
if ($config['cache']['enabled'])
|
if ($config['cache']['enabled'])
|
||||||
cache::set("post_clean_{$board['uri']}_{$this->id}", $this->clean);
|
cache::set("post_clean_{$board['uri']}_{$this->id}", $this->clean);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$this->clean = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->clean;
|
return $this->clean;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -628,47 +628,41 @@ function purge($uri) {
|
|||||||
|
|
||||||
function file_write($path, $data, $simple = false, $skip_purge = false) {
|
function file_write($path, $data, $simple = false, $skip_purge = false) {
|
||||||
global $config, $debug;
|
global $config, $debug;
|
||||||
|
|
||||||
if (preg_match('/^remote:\/\/(.+)\:(.+)$/', $path, $m)) {
|
if (preg_match('/^remote:\/\/(.+)\:(.+)$/', $path, $m)) {
|
||||||
if (isset($config['remote'][$m[1]])) {
|
if (isset($config['remote'][$m[1]])) {
|
||||||
require_once 'inc/remote.php';
|
require_once 'inc/remote.php';
|
||||||
|
|
||||||
$remote = new Remote($config['remote'][$m[1]]);
|
$remote = new Remote($config['remote'][$m[1]]);
|
||||||
$remote->write($data, $m[2]);
|
$remote->write($data, $m[2]);
|
||||||
return;
|
return;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
error('Invalid remote server: ' . $m[1]);
|
error('Invalid remote server: ' . $m[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
// This will convert a local, relative path like "b/index.html" to a full path.
|
if (!$fp = dio_open($path, O_WRONLY | O_CREAT, 0644))
|
||||||
// dio_open does not work with relative paths on Windows machines.
|
|
||||||
$path = realpath(dirname($path)) . DIRECTORY_SEPARATOR . basename($path);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$fp = dio_open( $path, O_WRONLY | O_CREAT | O_TRUNC, 0644)) {
|
|
||||||
error('Unable to open file for writing: ' . $path);
|
error('Unable to open file for writing: ' . $path);
|
||||||
}
|
|
||||||
|
|
||||||
// File locking
|
// File locking
|
||||||
if (function_exists("dio_fcntl") && dio_fcntl($fp, F_SETLKW, array('type' => F_WRLCK)) === -1) {
|
if (dio_fcntl($fp, F_SETLKW, array('type' => F_WRLCK)) === -1) {
|
||||||
error('Unable to lock file: ' . $path);
|
error('Unable to lock file: ' . $path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Truncate file
|
||||||
|
if (!dio_truncate($fp, 0))
|
||||||
|
error('Unable to truncate file: ' . $path);
|
||||||
|
|
||||||
// Write data
|
// Write data
|
||||||
if (($bytes = dio_write($fp, $data)) === false) {
|
if (($bytes = dio_write($fp, $data)) === false)
|
||||||
error('Unable to write to file: ' . $path);
|
error('Unable to write to file: ' . $path);
|
||||||
}
|
|
||||||
|
|
||||||
// Unlock
|
// Unlock
|
||||||
if (function_exists("dio_fcntl")) {
|
dio_fcntl($fp, F_SETLK, array('type' => F_UNLCK));
|
||||||
dio_fcntl($fp, F_SETLK, array('type' => F_UNLCK));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Close
|
// Close
|
||||||
dio_close($fp);
|
dio_close($fp);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create gzipped file.
|
* Create gzipped file.
|
||||||
*
|
*
|
||||||
|
@ -197,7 +197,7 @@
|
|||||||
'fr' => "Français",
|
'fr' => "Français",
|
||||||
'hu' => "Magyar",
|
'hu' => "Magyar",
|
||||||
'it' => "Italiano",
|
'it' => "Italiano",
|
||||||
'jp' => "日本語",
|
'ja' => "日本語",
|
||||||
'jbo' => "Lojban",
|
'jbo' => "Lojban",
|
||||||
'lt' => "Lietuvių Kalba",
|
'lt' => "Lietuvių Kalba",
|
||||||
'lv' => "Latviešu Valoda",
|
'lv' => "Latviešu Valoda",
|
||||||
@ -233,7 +233,7 @@ $config['page_404'] = 'page_404';
|
|||||||
|
|
||||||
// Flavor and design.
|
// Flavor and design.
|
||||||
$config['site_name'] = "∞chan";
|
$config['site_name'] = "∞chan";
|
||||||
$config['site_logo'] = "/static/logo_33.svg";
|
#$config['site_logo'] = "/static/logo_33.svg";
|
||||||
|
|
||||||
// 8chan specific mod pages
|
// 8chan specific mod pages
|
||||||
require '8chan-mod-config.php';
|
require '8chan-mod-config.php';
|
||||||
|
@ -2507,7 +2507,7 @@ function mod_reports() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fetch clean status.
|
// Fetch clean status.
|
||||||
$po->getClean();
|
$po->getClean(true);
|
||||||
$clean = $po->clean;
|
$clean = $po->clean;
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,9 +14,8 @@ $(document).ready(function(){
|
|||||||
var thread_id = (document.location.pathname + document.location.search).split('/');
|
var thread_id = (document.location.pathname + document.location.search).split('/');
|
||||||
thread_id = thread_id[thread_id.length -1].split('+')[0].split('.')[0];
|
thread_id = thread_id[thread_id.length -1].split('+')[0].split('.')[0];
|
||||||
|
|
||||||
$('form[name="postcontrols"] > .delete')
|
$('#thread-links')
|
||||||
.first()
|
.after('<div id="thread_stats"></div>');
|
||||||
.before('<div id="thread_stats"></div>');
|
|
||||||
var el = $('#thread_stats');
|
var el = $('#thread_stats');
|
||||||
el.prepend('Page <span id="thread_stats_page">?</span>');
|
el.prepend('Page <span id="thread_stats_page">?</span>');
|
||||||
if (IDsupport){
|
if (IDsupport){
|
||||||
|
@ -72,6 +72,9 @@ table.mod.config-editor input[type="text"] {
|
|||||||
width: 98%;
|
width: 98%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.longtable p {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Uncategorized */
|
/* Uncategorized */
|
||||||
#post-form-outer {
|
#post-form-outer {
|
||||||
@ -367,7 +370,6 @@ p.intro a {
|
|||||||
color: maroon;
|
color: maroon;
|
||||||
}
|
}
|
||||||
|
|
||||||
p.body-line,
|
|
||||||
div.post p {
|
div.post p {
|
||||||
display: block;
|
display: block;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@ -378,12 +380,15 @@ div.post p {
|
|||||||
}
|
}
|
||||||
|
|
||||||
div.post div.body {
|
div.post div.body {
|
||||||
margin-left: 1.8em;
|
|
||||||
margin-top: 0.8em;
|
margin-top: 0.8em;
|
||||||
padding-right: 3em;
|
padding-right: 3em;
|
||||||
padding-bottom: 0.3em;
|
padding-bottom: 0.3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.post.reply div.body {
|
||||||
|
margin-left: 1.8em;
|
||||||
|
}
|
||||||
|
|
||||||
div.post.reply.highlighted {
|
div.post.reply.highlighted {
|
||||||
background: #D6BAD0;
|
background: #D6BAD0;
|
||||||
}
|
}
|
||||||
@ -392,10 +397,6 @@ div.post.reply div.body a {
|
|||||||
color: #D00;
|
color: #D00;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.post {
|
|
||||||
padding-left: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.post div.body {
|
div.post div.body {
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
@ -1614,4 +1615,8 @@ td.board-tags a.tag-link {
|
|||||||
font-size: 0;
|
font-size: 0;
|
||||||
width: 0;
|
width: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#post-moderation-fields {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
|
<link rel="stylesheet" media="screen" href="{{ config.url_stylesheet }}">
|
||||||
<title>∞chan</title>
|
<title>∞chan</title>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
/* Main */
|
/* Main */
|
||||||
|
@ -177,7 +177,7 @@ function highlightReply(id, event) {
|
|||||||
post.className += ' highlighted';
|
post.className += ' highlighted';
|
||||||
|
|
||||||
if (history.pushState) {
|
if (history.pushState) {
|
||||||
history.pushState(null, null, window.document.location.origin + window.document.location.pathname + window.document.location.search + '#' + id);
|
history.pushState(null, null, window.document.location.protocol + "//" + window.document.location.host + window.document.location.pathname + window.document.location.search + '#' + id);
|
||||||
} else {
|
} else {
|
||||||
window.location.hash = id;
|
window.location.hash = id;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user