1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-01-19 01:24:05 +01:00
This commit is contained in:
Fredrick Brennan 2015-04-20 10:58:49 +08:00
commit 48d02bfbef
9 changed files with 53 additions and 44 deletions

View File

@ -81,7 +81,6 @@ $searchHTML = Element("8chan/boards-search.html", array(
"founding_date" => $founding_date,
"page_updated" => date('r'),
"uptime" => shell_exec('uptime -p'),
"html_boards" => $boardsHTML,
"html_tags" => $tagsHTML
@ -91,7 +90,8 @@ $searchHTML = Element("8chan/boards-search.html", array(
$pageHTML = Element("page.html", array(
"title" => _("Boardlist"),
"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.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;

View File

@ -417,10 +417,10 @@ class Post {
));
}
public function getClean( ) {
public function getClean($actually_do = false) {
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}")) {
return $this->clean;
}
@ -443,8 +443,10 @@ class Post {
if ($config['cache']['enabled'])
cache::set("post_clean_{$board['uri']}_{$this->id}", $this->clean);
}
} else {
$this->clean = array();
}
return $this->clean;
}
};

View File

@ -628,47 +628,41 @@ function purge($uri) {
function file_write($path, $data, $simple = false, $skip_purge = false) {
global $config, $debug;
if (preg_match('/^remote:\/\/(.+)\:(.+)$/', $path, $m)) {
if (isset($config['remote'][$m[1]])) {
require_once 'inc/remote.php';
$remote = new Remote($config['remote'][$m[1]]);
$remote->write($data, $m[2]);
return;
}
else {
} else {
error('Invalid remote server: ' . $m[1]);
}
}
else {
// This will convert a local, relative path like "b/index.html" to a full path.
// 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)) {
if (!$fp = dio_open($path, O_WRONLY | O_CREAT, 0644))
error('Unable to open file for writing: ' . $path);
}
// 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);
}
// Truncate file
if (!dio_truncate($fp, 0))
error('Unable to truncate file: ' . $path);
// Write data
if (($bytes = dio_write($fp, $data)) === false) {
if (($bytes = dio_write($fp, $data)) === false)
error('Unable to write to file: ' . $path);
}
// 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
dio_close($fp);
/**
* Create gzipped file.
*

View File

@ -197,7 +197,7 @@
'fr' => "Français",
'hu' => "Magyar",
'it' => "Italiano",
'jp' => "日本語",
'ja' => "日本語",
'jbo' => "Lojban",
'lt' => "Lietuvių Kalba",
'lv' => "Latviešu Valoda",
@ -233,7 +233,7 @@ $config['page_404'] = 'page_404';
// Flavor and design.
$config['site_name'] = "∞chan";
$config['site_logo'] = "/static/logo_33.svg";
#$config['site_logo'] = "/static/logo_33.svg";
// 8chan specific mod pages
require '8chan-mod-config.php';

View File

@ -2507,7 +2507,7 @@ function mod_reports() {
}
// Fetch clean status.
$po->getClean();
$po->getClean(true);
$clean = $po->clean;

View File

@ -14,9 +14,8 @@ $(document).ready(function(){
var thread_id = (document.location.pathname + document.location.search).split('/');
thread_id = thread_id[thread_id.length -1].split('+')[0].split('.')[0];
$('form[name="postcontrols"] > .delete')
.first()
.before('<div id="thread_stats"></div>');
$('#thread-links')
.after('<div id="thread_stats"></div>');
var el = $('#thread_stats');
el.prepend('Page <span id="thread_stats_page">?</span>');
if (IDsupport){

View File

@ -72,6 +72,9 @@ table.mod.config-editor input[type="text"] {
width: 98%;
}
.longtable p {
margin: 0;
}
/* Uncategorized */
#post-form-outer {
@ -367,7 +370,6 @@ p.intro a {
color: maroon;
}
p.body-line,
div.post p {
display: block;
margin: 0;
@ -378,12 +380,15 @@ div.post p {
}
div.post div.body {
margin-left: 1.8em;
margin-top: 0.8em;
padding-right: 3em;
padding-bottom: 0.3em;
}
div.post.reply div.body {
margin-left: 1.8em;
}
div.post.reply.highlighted {
background: #D6BAD0;
}
@ -392,10 +397,6 @@ div.post.reply div.body a {
color: #D00;
}
div.post {
padding-left: 20px;
}
div.post div.body {
word-wrap: break-word;
white-space: pre-wrap;
@ -1614,4 +1615,8 @@ td.board-tags a.tag-link {
font-size: 0;
width: 0;
}
}
}
#post-moderation-fields {
display: none;
}

View File

@ -2,6 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" media="screen" href="{{ config.url_stylesheet }}">
<title>∞chan</title>
<style type="text/css">
/* Main */

View File

@ -177,7 +177,7 @@ function highlightReply(id, event) {
post.className += ' highlighted';
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 {
window.location.hash = id;
}