1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-24 07:30:10 +01:00
Conflicts:
	inc/config.php
	inc/display.php
	inc/functions.php
	inc/image.php
	js/expand.js
	js/hide-threads.js
	js/local-time.js
	js/smartphone-spoiler.js
	templates/header.html
	templates/index.html
	templates/main.js
	templates/page.html
	templates/post_reply.html
	templates/post_thread.html
	templates/thread.html
This commit is contained in:
czaks 2013-07-31 14:54:20 -04:00
commit 55c7146d88
18 changed files with 668 additions and 623 deletions

View File

@ -335,9 +335,14 @@
$config['auto_unicode'] = true; $config['auto_unicode'] = true;
// Whether to turn URLs into functional links // Whether to turn URLs into functional links
$config['markup_urls'] = true; $config['markup_urls'] = true;
// Prefix those functional links with some other url, for example some service for hiding referers // Prefix those functional links with some other url, for example some service for hiding referers
// (eg. 'http://www.nullrefer.com/?', or 'http://anonym.to/?'), a pay-per-view exit page, etc. // (eg. 'http://www.nullrefer.com/?', or 'http://anonym.to/?'), a pay-per-view exit page, etc.
$config['url_ads'] = ''; $config['url_ads'] = &$config['link_prefix']; // leave alias
// Optional URL prefix for links (eg. "http://anonym.to/?")
$config['link_prefix'] = '';
// Wordfilters are used to automatically replace certain words/phrases with something else. // Wordfilters are used to automatically replace certain words/phrases with something else.
// For a normal string replacement: // For a normal string replacement:
@ -486,7 +491,7 @@
// Display the file's original filename // Display the file's original filename
$config['show_filename']= true; $config['show_filename']= true;
// Image identification buttons using regex.info/exif, tineye and google images // Image identification links using regex.info/exif, TinEye and Google Images
$config['image_identification'] = false; $config['image_identification'] = false;
// Redraw the image using GD functions to strip any excess data (commonly ZIP archives) // Redraw the image using GD functions to strip any excess data (commonly ZIP archives)
@ -542,8 +547,8 @@
$config['ban_date'] = '%A %e %B, %Y'; $config['ban_date'] = '%A %e %B, %Y';
// The names on the post buttons. (On most imageboards, these are both "Post") // The names on the post buttons. (On most imageboards, these are both "Post")
$config['button_newtopic'] = 'New Topic'; $config['button_newtopic'] = _('New Topic');
$config['button_reply'] = 'New Reply'; $config['button_reply'] = _('New Reply');
// Assign each poster in a thread a unique ID, shown by "ID: {id}" before the post number. // Assign each poster in a thread a unique ID, shown by "ID: {id}" before the post number.
$config['poster_ids'] = false; $config['poster_ids'] = false;
@ -554,7 +559,7 @@
$config['thread_subject_in_title'] = false; $config['thread_subject_in_title'] = false;
// Page footer // Page footer
$config['footer'][] = 'All trademarks, copyrights, comments, and images on this page are owned by and are the responsibility of their respective parties.'; $config['footer'][] = _('All trademarks, copyrights, comments, and images on this page are owned by and are the responsibility of their respective parties.');
// Characters used to generate a random password (with Javascript) // Characters used to generate a random password (with Javascript)
$config['genpassword_chars'] = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+'; $config['genpassword_chars'] = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+';
@ -764,8 +769,8 @@
else else
$config['root'] = '/'; // CLI mode $config['root'] = '/'; // CLI mode
// The scheme and domain. This is needed to get absolute URL of some page (for instance image // The scheme and domain. This is used to get the site's absolute URL (eg. for image identification links).
// identification buttons). If you use the CLI tools, it would be wise to override this setting. // If you use the CLI tools, it would be wise to override this setting.
$config['domain'] = (isset ($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? "https://" : "http://"; $config['domain'] = (isset ($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? "https://" : "http://";
$config['domain'] .= isset ($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost'; $config['domain'] .= isset ($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost';

View File

@ -25,6 +25,7 @@ function doBoardListPart($list, $root) {
$body = ''; $body = '';
foreach ($list as $board) { foreach ($list as $board) {
if (is_array($board)) if (is_array($board))
// $body .= ' [' . doBoardListPart($board, $root) . '] ';
$body .= ' <span class="sub">[' . doBoardListPart($board, $root) . ']</span> '; $body .= ' <span class="sub">[' . doBoardListPart($board, $root) . ']</span> ';
else { else {
if (($key = array_search($board, $list)) && gettype($key) == 'string') { if (($key = array_search($board, $list)) && gettype($key) == 'string') {

View File

@ -1311,6 +1311,13 @@ function buildJavascript() {
'config' => $config, 'config' => $config,
'stylesheets' => $stylesheets 'stylesheets' => $stylesheets
)); ));
// Check if we have translation for the javascripts; if yes, we add it to additional javascripts
list($pure_locale) = explode(".", $config['locale']);
if (file_exists ($jsloc = "inc/locale/$pure_locale/LC_MESSAGES/javascript.js")) {
$script = file_get_contents($jsloc) . "\n\n" . $script;
}
if ($config['additional_javascript_compile']) { if ($config['additional_javascript_compile']) {
foreach ($config['additional_javascript'] as $file) { foreach ($config['additional_javascript'] as $file) {
$script .= file_get_contents($file); $script .= file_get_contents($file);
@ -1415,7 +1422,7 @@ function markup_url($matches) {
$markup_urls[] = $url; $markup_urls[] = $url;
return '<a target="_blank" rel="nofollow" href="'. $config['url_ads'] . $url . '">' . $url . '</a>' . $after; return '<a target="_blank" rel="nofollow" href="'. $config['link_prefix'] . $url . '">' . $url . '</a>' . $after;
} }
function unicodify($body) { function unicodify($body) {

View File

@ -81,9 +81,7 @@ class Image {
$height = $max_height; $height = $max_height;
} }
if ($gifsicle) { $thumb->gifsicle = $gifsicle;
$thumb->gifsicle = 1;
}
$thumb->_resize($this->image->image, $width, $height); $thumb->_resize($this->image->image, $width, $height);
return $thumb; return $thumb;
@ -288,8 +286,12 @@ class ImageConvert extends ImageBase {
if (shell_exec("gifsicle --unoptimize -O2 --resize {$this->width}x{$this->height} < " . if (shell_exec("gifsicle --unoptimize -O2 --resize {$this->width}x{$this->height} < " .
escapeshellarg($this->src . '') . " > " . escapeshellarg($this->temp)) || !file_exists($this->temp)) escapeshellarg($this->src . '') . " > " . escapeshellarg($this->temp)) || !file_exists($this->temp))
error('Failed to resize image!'); error('Failed to resize image!');
<<<<<<< HEAD
} }
else { else {
=======
} else {
>>>>>>> 8e4c493a4c5bbff07483fd4a11c44c687c99e441
if (shell_exec("convert -background transparent -filter Point -sample {$this->width}x{$this->height} +antialias -quality {$quality} " . if (shell_exec("convert -background transparent -filter Point -sample {$this->width}x{$this->height} +antialias -quality {$quality} " .
escapeshellarg($this->src . '') . " " . escapeshellarg($this->temp)) || !file_exists($this->temp)) escapeshellarg($this->src . '') . " " . escapeshellarg($this->temp)) || !file_exists($this->temp))
error('Failed to resize image!'); error('Failed to resize image!');

View File

@ -446,6 +446,23 @@ function mod_new_board() {
if (!preg_match('/^' . $config['board_regex'] . '$/u', $_POST['uri'])) if (!preg_match('/^' . $config['board_regex'] . '$/u', $_POST['uri']))
error(sprintf($config['error']['invalidfield'], 'URI')); error(sprintf($config['error']['invalidfield'], 'URI'));
$bytes = 0;
$chars = preg_split('//u', $_POST['uri'], -1, PREG_SPLIT_NO_EMPTY);
foreach ($chars as $char) {
$o = 0;
$ord = ordutf8($char, $o);
if ($ord > 0x0080)
$bytes += 5; // @01ff
else
$bytes ++;
}
$bytes + strlen('posts_.frm');
if ($bytes > 255) {
error('Your filesystem cannot handle a board URI of that length (' . $bytes . '/255 bytes)');
exit;
}
if (openBoard($_POST['uri'])) { if (openBoard($_POST['uri'])) {
error(sprintf($config['error']['boardexists'], $board['url'])); error(sprintf($config['error']['boardexists'], $board['url']));
} }

View File

@ -63,4 +63,3 @@ onready(function(){
inline_expand_post.call(document); inline_expand_post.call(document);
} }
}); });

View File

@ -6,7 +6,7 @@
* Copyright (c) 2012 Michael Save <savetheinternet@tinyboard.org> * Copyright (c) 2012 Michael Save <savetheinternet@tinyboard.org>
* *
* Usage: * Usage:
* $config['additional_javascript'][] = 'js/jquery.min.js'; * // $config['additional_javascript'][] = 'js/jquery.min.js';
* $config['additional_javascript'][] = 'js/local-time.js'; * $config['additional_javascript'][] = 'js/local-time.js';
* *
*/ */
@ -45,9 +45,11 @@ onready(function(){
do_localtime(document); do_localtime(document);
if (window.jQuery) {
// allow to work with auto-reload.js, etc. // allow to work with auto-reload.js, etc.
$(document).bind('new_post', function(e, post) { $(document).bind('new_post', function(e, post) {
do_localtime(post); do_localtime(post);
}); });
}
}); });

View File

@ -380,10 +380,22 @@ if (isset($_POST['delete'])) {
wordfilters($post['body']); wordfilters($post['body']);
if (mysql_version() >= 50503) if (mysql_version() >= 50503) {
$post['body_nomarkup'] = $post['body']; // Assume we're using the utf8mb4 charset $post['body_nomarkup'] = $post['body']; // Assume we're using the utf8mb4 charset
else } else {
$post['body_nomarkup'] = preg_replace('/[\x{010000}-\x{ffffff}]/u', '', $post['body']); // MySQL's `utf8` charset only supports up to 3-byte symbols // MySQL's `utf8` charset only supports up to 3-byte symbols
// Remove anything >= 0x010000
$chars = preg_split('//u', $post['body'], -1, PREG_SPLIT_NO_EMPTY);
$post['body_nomarkup'] = '';
foreach ($chars as $char) {
$o = 0;
$ord = ordutf8($char, $o);
if ($ord >= 0x010000)
continue;
$post['body_nomarkup'] .= $char;
}
}
if (!($mod && isset($post['raw']) && $post['raw'])) if (!($mod && isset($post['raw']) && $post['raw']))
$post['tracked_cites'] = markup($post['body'], true); $post['tracked_cites'] = markup($post['body'], true);