Browse Source

Merge branch 'master' of https://github.com/savetheinternet/Tinyboard

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
pull/40/head
czaks 11 years ago
parent
commit
55c7146d88
  1. 19
      inc/config.php
  2. 1
      inc/display.php
  3. 9
      inc/functions.php
  4. 8
      inc/image.php
  5. 17
      inc/mod/pages.php
  6. 1
      js/inline-expanding.js
  7. 4
      js/local-time.js
  8. 18
      post.php

19
inc/config.php

@ -335,9 +335,14 @@
$config['auto_unicode'] = true;
// Whether to turn URLs into functional links
$config['markup_urls'] = true;
// 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.
$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.
// For a normal string replacement:
@ -486,7 +491,7 @@
// Display the file's original filename
$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;
// 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';
// The names on the post buttons. (On most imageboards, these are both "Post")
$config['button_newtopic'] = 'New Topic';
$config['button_reply'] = 'New Reply';
$config['button_newtopic'] = _('New Topic');
$config['button_reply'] = _('New Reply');
// Assign each poster in a thread a unique ID, shown by "ID: {id}" before the post number.
$config['poster_ids'] = false;
@ -554,7 +559,7 @@
$config['thread_subject_in_title'] = false;
// 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)
$config['genpassword_chars'] = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+';
@ -764,8 +769,8 @@
else
$config['root'] = '/'; // CLI mode
// The scheme and domain. This is needed to get absolute URL of some page (for instance image
// identification buttons). If you use the CLI tools, it would be wise to override this setting.
// The scheme and domain. This is used to get the site's absolute URL (eg. for image identification links).
// 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['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost';

1
inc/display.php

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

9
inc/functions.php

@ -1311,6 +1311,13 @@ function buildJavascript() {
'config' => $config,
'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']) {
foreach ($config['additional_javascript'] as $file) {
$script .= file_get_contents($file);
@ -1415,7 +1422,7 @@ function markup_url($matches) {
$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) {

8
inc/image.php

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

17
inc/mod/pages.php

@ -446,6 +446,23 @@ function mod_new_board() {
if (!preg_match('/^' . $config['board_regex'] . '$/u', $_POST['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'])) {
error(sprintf($config['error']['boardexists'], $board['url']));
}

1
js/inline-expanding.js

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

4
js/local-time.js

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

18
post.php

@ -380,10 +380,22 @@ if (isset($_POST['delete'])) {
wordfilters($post['body']);
if (mysql_version() >= 50503)
if (mysql_version() >= 50503) {
$post['body_nomarkup'] = $post['body']; // Assume we're using the utf8mb4 charset
else
$post['body_nomarkup'] = preg_replace('/[\x{010000}-\x{ffffff}]/u', '', $post['body']); // MySQL's `utf8` charset only supports up to 3-byte symbols
} else {
// 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']))
$post['tracked_cites'] = markup($post['body'], true);

Loading…
Cancel
Save