diff --git a/create.php b/create.php
index f220157b..37dfb2f5 100644
--- a/create.php
+++ b/create.php
@@ -21,6 +21,7 @@ $title = $_POST['title'];
$subtitle = $_POST['subtitle'];
$username = $_POST['username'];
$password = $_POST['password'];
+$email = (isset($_POST['email']) ? $_POST['email'] : '');
$resp = file_get_contents($config['captcha']['provider_check'] . "?" . http_build_query([
'mode' => 'check',
@@ -39,6 +40,8 @@ if (!preg_match('/^[a-zA-Z0-9._]{1,30}$/', $username))
error(_('Invalid username'));
if ($resp !== '1')
error($config['error']['captcha']);
+if (!filter_var($email, FILTER_VALIDATE_EMAIL))
+ $email = '';
foreach (listBoards() as $i => $board) {
if ($board['uri'] == $uri)
@@ -66,12 +69,13 @@ error(_('The username you\'ve tried to enter already exists!'));
$salt = generate_salt();
$password = hash('sha256', $salt . sha1($password));
-$query = prepare('INSERT INTO ``mods`` VALUES (NULL, :username, :password, :salt, :type, :boards)');
+$query = prepare('INSERT INTO ``mods`` VALUES (NULL, :username, :password, :salt, :type, :boards, :email)');
$query->bindValue(':username', $username);
$query->bindValue(':password', $password);
$query->bindValue(':salt', $salt);
$query->bindValue(':type', 20);
$query->bindValue(':boards', $uri);
+$query->bindValue(':email', $email);
$query->execute() or error(db_error($query));
$query = prepare('INSERT INTO ``boards`` (`uri`, `title`, `subtitle`) VALUES (:uri, :title, :subtitle)');
diff --git a/inc/8chan-mod-config.php b/inc/8chan-mod-config.php
index 1c2ed2ac..962b5a51 100644
--- a/inc/8chan-mod-config.php
+++ b/inc/8chan-mod-config.php
@@ -15,6 +15,7 @@
$config['mod']['mod_board_log'] = MOD;
$config['mod']['editpost'] = BOARDVOLUNTEER;
$config['mod']['edit_banners'] = MOD;
+ $config['mod']['edit_assets'] = MOD;
$config['mod']['edit_flags'] = MOD;
$config['mod']['edit_settings'] = MOD;
$config['mod']['edit_volunteers'] = MOD;
@@ -51,3 +52,4 @@
$config['mod']['custom_pages']['/flags/(\%b)'] = '8_flags';
$config['mod']['custom_pages']['/banners/(\%b)'] = '8_banners';
$config['mod']['custom_pages']['/settings/(\%b)'] = '8_settings';
+ $config['mod']['custom_pages']['/assets/(\%b)'] = '8_assets';
diff --git a/inc/8chan-mod-pages.php b/inc/8chan-mod-pages.php
index f080c70f..7569b986 100644
--- a/inc/8chan-mod-pages.php
+++ b/inc/8chan-mod-pages.php
@@ -118,7 +118,7 @@
$salt = generate_salt();
$password = hash('sha256', $salt . sha1($_POST['password']));
- $query = prepare('INSERT INTO ``mods`` VALUES (NULL, :username, :password, :salt, 19, :board)');
+ $query = prepare('INSERT INTO ``mods`` VALUES (NULL, :username, :password, :salt, 19, :board, "")');
$query->bindValue(':username', $_POST['username']);
$query->bindValue(':password', $password);
$query->bindValue(':salt', $salt);
@@ -224,7 +224,7 @@
}
copy($upload, "$dir/$id.$extension");
- purge("$dir/$id.$extension");
+ purge("$dir/$id.$extension", true);
$config['user_flags'][$id] = utf8tohtml($description);
file_write($b.'/flags.ser', serialize($config['user_flags']));
}
@@ -303,6 +303,120 @@ FLAGS;
mod_page(_('Edit flags'), 'mod/flags.html', array('board'=>$board,'banners'=>$banners,'token'=>make_secure_link_token('banners/'.$board['uri'])));
}
+ function mod_8_assets($b) {
+ global $config, $mod, $board;
+ require_once 'inc/image.php';
+
+ if (!hasPermission($config['mod']['edit_assets'], $b))
+ error($config['error']['noaccess']);
+
+ if (!openBoard($b))
+ error("Could not open board!");
+
+ $dir = 'static/assets/'.$b;
+
+ if (!is_dir($dir)){
+ mkdir($dir, 0777, true);
+
+ symlink(getcwd() . '/' . $config['image_deleted'], "$dir/deleted.png");
+ symlink(getcwd() . '/' . $config['spoiler_image'], "$dir/spoiler.png");
+ symlink(getcwd() . '/' . $config['no_file_image'], "$dir/no-file.png");
+ }
+
+ // "File deleted"
+ if (isset($_FILES['deleted_file']) && !empty($_FILES['deleted_file']['tmp_name'])){
+ $upload = $_FILES['deleted_file']['tmp_name'];
+ $extension = strtolower(mb_substr($_FILES['deleted_file']['name'], mb_strrpos($_FILES['deleted_file']['name'], '.') + 1));
+
+ if (!is_readable($upload)) {
+ error($config['error']['nomove']);
+ }
+
+ if (filesize($upload) > 512000){
+ error('File too large!');
+ }
+
+ if (!in_array($extension, array('png', 'gif'))) {
+ error('File must be PNG or GIF format.');
+ }
+
+ if (!$size = @getimagesize($upload)) {
+ error($config['error']['invalidimg']);
+ }
+
+ if ($size[0] != 140 or $size[1] != 50){
+ error('Image wrong size!');
+ }
+
+ unlink("$dir/deleted.png");
+ copy($upload, "$dir/deleted.png");
+ purge("$dir/deleted.png", true);
+ }
+
+ // Spoiler file
+ if (isset($_FILES['spoiler_file']) && !empty($_FILES['spoiler_file']['tmp_name'])){
+ $upload = $_FILES['spoiler_file']['tmp_name'];
+ $extension = strtolower(mb_substr($_FILES['spoiler_file']['name'], mb_strrpos($_FILES['spoiler_file']['name'], '.') + 1));
+
+ if (!is_readable($upload)) {
+ error($config['error']['nomove']);
+ }
+
+ if (filesize($upload) > 512000){
+ error('File too large!');
+ }
+
+
+ if (!in_array($extension, array('png', 'gif'))) {
+ error('File must be PNG or GIF format.');
+ }
+
+ if (!$size = @getimagesize($upload)) {
+ error($config['error']['invalidimg']);
+ }
+
+ if ($size[0] != 128 or $size[1] != 128){
+ error('Image wrong size!');
+ }
+
+ unlink("$dir/spoiler.png");
+ copy($upload, "$dir/spoiler.png");
+ purge("$dir/spoiler.png", true);
+ }
+
+ // No file
+ if (isset($_FILES['nofile_file']) && !empty($_FILES['nofile_file']['tmp_name'])){
+ $upload = $_FILES['nofile_file']['tmp_name'];
+ $extension = strtolower(mb_substr($_FILES['nofile_file']['name'], mb_strrpos($_FILES['nofile_file']['name'], '.') + 1));
+
+ if (!is_readable($upload)) {
+ error($config['error']['nomove']);
+ }
+
+ if (filesize($upload) > 512000){
+ error('File too large!');
+ }
+
+ if (!in_array($extension, array('png', 'gif'))) {
+ error('File must be PNG or GIF format.');
+ }
+
+ if (!$size = @getimagesize($upload)) {
+ error($config['error']['invalidimg']);
+ }
+
+ if ($size[0] != 500 or $size[1] != 500){
+ error('Image wrong size!');
+ }
+
+ unlink("$dir/no-file.png");
+ copy($upload, "$dir/no-file.png");
+ purge("$dir/no-file.png", true);
+ }
+
+ mod_page(_('Edit board assets'), 'mod/assets.html', array('board'=>$board,'token'=>make_secure_link_token('assets/'.$board['uri'])));
+ }
+
function mod_8_banners($b) {
global $config, $mod, $board;
require_once 'inc/image.php';
@@ -431,6 +545,16 @@ FLAGS;
$multiimage = '';
}
+ if (isset($_POST['custom_assets'])) {
+ $assets = "\$config['custom_assets'] = true;
+ \$config['spoiler_image'] = 'static/assets/$b/spoiler.png';
+ \$config['image_deleted'] = 'static/assets/$b/deleted.png';
+ \$config['no_file_image'] = 'static/assets/$b/no-file.png';
+ ";
+ } else {
+ $assets = '';
+ }
+
$file_board = '';
if ($fileboard) {
$force_image_op = true;
@@ -475,7 +599,7 @@ FLAGS;
}
}
- $anal_filenames = ($imgboard || $fileboard) && isset($_POST['anal_filenames']) ? "\$config['filename_func'] = 'filename_func';\n" : '';
+ $anal_filenames = ($fileboard) && isset($_POST['anal_filenames']) ? "\$config['filename_func'] = 'filename_func';\n" : '';
$anonymous = base64_encode($_POST['anonymous']);
$blotter = base64_encode(purify_html(html_entity_decode($_POST['blotter'])));
@@ -588,7 +712,8 @@ FLAGS;
\$config['max_pages'] = $max_pages;
\$config['max_newlines'] = $max_newlines;
\$config['oekaki'] = $oekaki;
-$code_tags $katex $replace $multiimage $allow_flash $allow_pdf $user_flags
+$code_tags $katex $replace $multiimage $allow_flash $allow_pdf $user_flags
+$assets
$locale
$anal_filenames
$file_board
diff --git a/inc/api.php b/inc/api.php
index b278da96..9972deb6 100644
--- a/inc/api.php
+++ b/inc/api.php
@@ -92,7 +92,7 @@ class Api {
$apiPost['filename'] = @substr($file->name, 0, strrpos($file->name, '.'));
$dotPos = strrpos($file->file, '.');
$apiPost['ext'] = substr($file->file, $dotPos);
- $apiPost['tim'] = substr($file->file, 0, $dotPos);
+ $apiPost['tim'] = urlencode(substr($file->file, 0, $dotPos));
if (isset($file->hash))
$apiPost['md5'] = base64_encode(hex2bin($file->hash));
}
diff --git a/inc/bans.php b/inc/bans.php
index 3e9eb9cf..b4f45149 100644
--- a/inc/bans.php
+++ b/inc/bans.php
@@ -187,7 +187,9 @@ class Bans {
if ($ban['post']) {
$post = json_decode($ban['post']);
- $ban['message'] = $post->body;
+ if ($post) {
+ $ban['message'] = $post->body;
+ }
}
unset($ban['ipstart'], $ban['ipend'], $ban['post'], $ban['creator']);
diff --git a/inc/config.php b/inc/config.php
index 8536ab44..1d85a544 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -839,7 +839,7 @@
// Location of thumbnail to use for spoiler images.
$config['spoiler_image'] = 'static/spoiler.png';
// Location of thumbnail to use for deleted images.
- // $config['image_deleted'] = 'static/deleted.png';
+ $config['image_deleted'] = 'static/deleted.png';
// Location of placeholder image for fileless posts in catalog.
$config['no_file_image'] = 'static/no-file.png';
@@ -1530,7 +1530,7 @@
// Edit any users' login information
$config['mod']['editusers'] = ADMIN;
// Change user's own password
- $config['mod']['change_password'] = JANITOR;
+ $config['mod']['edit_profile'] = JANITOR;
// Delete a user
$config['mod']['deleteusers'] = ADMIN;
// Create a user
@@ -1783,4 +1783,14 @@
$config['report_captcha'] = false;
// Allowed HTML tags in ?/edit_pages.
- $config['allowed_html'] = 'a[href|title],p,br,li,ol,ul,strong,em,u,h2,b,i,tt,div,img[src|alt|title],hr';
+ $config['allowed_html'] = 'a[href|title],p,br,li,ol,ul,strong,em,u,h2,b,i,tt,div,img[src|alt|title],hr,h1,h2,h3,h4,h5';
+
+ // Use custom assets? (spoiler file, etc; this is used by ?/settings and ?/assets)
+ $config['custom_assets'] = false;
+
+ // If you use CloudFlare set these for some features to work correctly.
+ $config['cloudflare'] = array();
+ $config['cloudflare']['enabled'] = false;
+ $config['cloudflare']['token'] = 'token';
+ $config['cloudflare']['email'] = 'email';
+ $config['cloudflare']['domain'] = 'example.com';
diff --git a/inc/functions.php b/inc/functions.php
index 5281a231..3c8b2366 100755
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -589,9 +589,42 @@ function boardTitle($uri) {
return false;
}
-function purge($uri) {
+function cloudflare_purge($uri) {
+ global $config;
+
+ if (!$config['cloudflare']['enabled']) return;
+
+ $fields = array(
+ 'a' => 'zone_file_purge',
+ 'tkn' => $config['cloudflare']['token'],
+ 'email' => $config['cloudflare']['email'],
+ 'z' => $config['cloudflare']['domain'],
+ 'url' => 'https://' . $config['cloudflare']['domain'] . '/' . $uri
+ );
+
+ $fields_string = http_build_query($fields);
+
+ $ch = curl_init();
+
+ curl_setopt($ch, CURLOPT_URL, 'https://www.cloudflare.com/api_json.html');
+ curl_setopt($ch, CURLOPT_POST, count($fields));
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+
+ $result = curl_exec($ch);
+
+ curl_close($ch);
+
+ return $result;
+}
+
+function purge($uri, $cloudflare = false) {
global $config, $debug;
+ if ($cloudflare) {
+ cloudflare_purge($uri);
+ }
+
if (!isset($config['purge'])) return;
// Fix for Unicode
@@ -986,7 +1019,7 @@ function fetchBoardTags( $uris ) {
$boardTags[ $tagRow['uri'] ] = array();
}
- $boardTags[ $tagRow['uri'] ][] = htmlentities( utf8_encode( $tag ) );
+ $boardTags[ $tagRow['uri'] ][] = $tag;
}
}
diff --git a/inc/lib/webm/ffmpeg.php b/inc/lib/webm/ffmpeg.php
index bf14f7d9..fab60099 100644
--- a/inc/lib/webm/ffmpeg.php
+++ b/inc/lib/webm/ffmpeg.php
@@ -57,17 +57,17 @@ function make_webm_thumbnail($filename, $thumbnail, $width, $height, $duration)
global $board, $config;
$filename = escapeshellarg($filename);
- //$thumbnail = escapeshellarg($thumbnail); // Should be safe by default but you
+ $thumbnailfc = escapeshellarg($thumbnail); // Should be safe by default but you
// can never be too safe.
$ffmpeg = $config['webm']['ffmpeg_path'];
$ret = 0;
$ffmpeg_out = array();
- exec("$ffmpeg -strict -2 -ss " . floor($duration / 2) . " -i $filename -v quiet -an -vframes 1 -f mjpeg -vf scale=$width:$height $thumbnail 2>&1", $ffmpeg_out, $ret);
+ exec("$ffmpeg -strict -2 -ss " . floor($duration / 2) . " -i $filename -v quiet -an -vframes 1 -f mjpeg -vf scale=$width:$height $thumbnailfc 2>&1", $ffmpeg_out, $ret);
// Work around for https://trac.ffmpeg.org/ticket/4362
if (filesize($thumbnail) === 0) {
// try again with first frame
- exec("$ffmpeg -y -strict -2 -ss 0 -i $filename -v quiet -an -vframes 1 -f mjpeg -vf scale=$width:$height $thumbnail 2>&1", $ffmpeg_out, $ret);
+ exec("$ffmpeg -y -strict -2 -ss 0 -i $filename -v quiet -an -vframes 1 -f mjpeg -vf scale=$width:$height $thumbnailfc 2>&1", $ffmpeg_out, $ret);
clearstatcache();
// failed if no thumbnail size even if ret code 0, ffmpeg is buggy
if (filesize($thumbnail) === 0) {
diff --git a/inc/mod/pages.php b/inc/mod/pages.php
index 3d78fb31..54356489 100644
--- a/inc/mod/pages.php
+++ b/inc/mod/pages.php
@@ -1914,11 +1914,11 @@ function mod_deletebyip($boardName, $post, $global = false) {
function mod_user($uid) {
global $config, $mod;
- if (!hasPermission($config['mod']['editusers']) && !(hasPermission($config['mod']['change_password']) && $uid == $mod['id']))
+ if (!hasPermission($config['mod']['editusers']) && !(hasPermission($config['mod']['edit_profile']) && $uid == $mod['id']))
error($config['error']['noaccess']);
if (in_array($mod['boards'][0], array('infinity', 'z')))
- error('This board has password changing disabled.');
+ error('This board has profile changing disabled.');
$query = prepare('SELECT * FROM ``mods`` WHERE `id` = :id');
$query->bindValue(':id', $uid);
@@ -1997,8 +1997,8 @@ function mod_user($uid) {
return;
}
- if (hasPermission($config['mod']['change_password']) && $uid == $mod['id'] && isset($_POST['password'])) {
- if ($_POST['password'] != '') {
+ if (hasPermission($config['mod']['edit_profile']) && $uid == $mod['id']) {
+ if (isset($_POST['password']) && $_POST['password'] != '') {
$salt = generate_salt();
$password = hash('sha256', $salt . sha1($_POST['password']));
@@ -2013,13 +2013,50 @@ function mod_user($uid) {
login($user['username'], $_POST['password']);
setCookies();
}
+
+ if (isset($_POST['username']) && $user['username'] !== $_POST['username']) {
+ if ($_POST['username'] == '')
+ error(sprintf($config['error']['required'], 'username'));
+
+ if (!preg_match('/^[a-zA-Z0-9._]{1,30}$/', $_POST['username']))
+ error(_('Invalid username'));
+
+ $query = prepare('SELECT `username` FROM ``mods``');
+ $query->execute() or error(db_error($query));
+ $users = $query->fetchAll(PDO::FETCH_ASSOC);
+
+ foreach ($users as $i => $v) {
+ if (strtolower($_POST['username']) == strtolower($v['username'])) {
+ error(_('Refusing to change your username because another user is already using it.'));
+ }
+ }
+
+ $query = prepare('UPDATE ``mods`` SET `username` = :username WHERE `id` = :id');
+ $query->bindValue(':id', $uid);
+ $query->bindValue(':username', $_POST['username']);
+ $query->execute() or error(db_error($query));
- if (hasPermission($config['mod']['manageusers']))
- header('Location: ?/users', true, $config['redirect_http']);
- else
- header('Location: ?/', true, $config['redirect_http']);
+ modLog('Renamed user "' . utf8tohtml($user['username']) . '" (#' . $user['id'] . ') to "' . utf8tohtml($_POST['username']) . '"');
+ }
+
+ if (isset($_POST['email']) && $user['email'] !== $_POST['email'] && (empty($_POST['email']) || filter_var($_POST['email'], FILTER_VALIDATE_EMAIL))) {
+ // account was renamed
+ $query = prepare('UPDATE ``mods`` SET `email` = :email WHERE `id` = :id');
+ $query->bindValue(':id', $uid);
+ $query->bindValue(':email', $_POST['email']);
+ $query->execute() or error(db_error($query));
- return;
+ modLog('Changed user\'s email "' . utf8tohtml($user['email']) . '" (#' . $user['id'] . ') to "' . utf8tohtml($_POST['email']) . '"');
+ }
+
+ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
+ if (hasPermission($config['mod']['manageusers']))
+ header('Location: ?/users', true, $config['redirect_http']);
+ else
+ header('Location: ?/', true, $config['redirect_http']);
+
+ return;
+ }
}
if (hasPermission($config['mod']['modlog'])) {
@@ -2032,21 +2069,18 @@ function mod_user($uid) {
}
if ($mod['type'] >= ADMIN){
- $boards = listBoards();
+ $boards = listBoards();
} else {
- $boards2 = explode(',', $user['boards']);
-
- foreach($boards2 as $string){
-
- $boards[] = array("uri"=>$string, "title"=>"MY BOARD");
-
- }
-
+ $boards2 = explode(',', $user['boards']);
+ foreach ($boards2 as $string){
+ $boards[] = array("uri"=>$string, "title" => _("My board"));
+ }
}
+
$user['boards'] = explode(',', $user['boards']);
- mod_page(_('Edit user'), 'mod/user.html', array(
+ mod_page(_('Edit user profile'), 'mod/user.html', array(
'user' => $user,
'logs' => $log,
'boards' => $boards,
@@ -2088,12 +2122,13 @@ function mod_user_new() {
$salt = generate_salt();
$password = hash('sha256', $salt . sha1($_POST['password']));
- $query = prepare('INSERT INTO ``mods`` VALUES (NULL, :username, :password, :salt, :type, :boards)');
+ $query = prepare('INSERT INTO ``mods`` VALUES (NULL, :username, :password, :salt, :type, :boards, :email)');
$query->bindValue(':username', $_POST['username']);
$query->bindValue(':password', $password);
$query->bindValue(':salt', $salt);
$query->bindValue(':type', $type);
$query->bindValue(':boards', implode(',', $boards));
+ $query->bindValue(':email', (isset($_POST['email']) ? $_POST['email'] : ''));
$query->execute() or error(db_error($query));
$userID = $pdo->lastInsertId();
@@ -2114,7 +2149,7 @@ function mod_users() {
if (!hasPermission($config['mod']['manageusers']))
error($config['error']['noaccess']);
- $query = query("SELECT ``m``.`id`, ``m``.`username`, ``m``.`boards`, ``m``.`type`,
+ $query = query("SELECT ``m``.`id`, ``m``.`username`, ``m``.`boards`, ``m``.`type`, ``m``.`email`,
``ml``.`time` last, ``ml``.`text` action
FROM ``mods`` AS m
LEFT JOIN (
@@ -2125,7 +2160,7 @@ function mod_users() {
FROM ``modlogs``
GROUP BY `mod`
) AS ml2 USING (`mod`, time)
- ) AS ml ON m.id = ml.`mod` ORDER BY ``m``.`type` DESC;") or error(db_error());
+ ) AS ml ON m.id = ml.`mod` GROUP BY ``m``.`id` ORDER BY ``m``.`type` DESC;") or error(db_error());
$users = $query->fetchAll(PDO::FETCH_ASSOC);
foreach ($users as &$user) {
diff --git a/install.sql b/install.sql
index 99553822..a58e79ad 100644
--- a/install.sql
+++ b/install.sql
@@ -134,6 +134,7 @@ CREATE TABLE IF NOT EXISTS `mods` (
`salt` char(32) CHARACTER SET ascii NOT NULL,
`type` smallint(2) NOT NULL,
`boards` text CHARACTER SET utf8 NOT NULL,
+ `email` varchar(1024) DEFAULT '',
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`,`username`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
diff --git a/js/catalog.js b/js/catalog.js
index 065fba7b..3ded2141 100644
--- a/js/catalog.js
+++ b/js/catalog.js
@@ -17,6 +17,7 @@ if (active_page == 'catalog') $(function(){
var value = this.value, old;
$(".grid-li").removeClass("grid-size-vsmall");
$(".grid-li").removeClass("grid-size-small");
+ $(".grid-li").removeClass("grid-size-medium");
$(".grid-li").removeClass("grid-size-large");
$(".grid-li").addClass("grid-size-"+value);
catalog.image_size = value;
@@ -35,4 +36,14 @@ if (active_page == 'catalog') $(function(){
if (catalog.image_size !== undefined) {
$('#image_size').val(catalog.image_size).trigger('change');
}
+
+ $('div.thread').on('click', function(e) {
+ if ($(this).css('overflow-y') === 'hidden') {
+ $(this).css('overflow-y', 'auto');
+ $(this).css('width', '100%');
+ } else {
+ $(this).css('overflow-y', 'hidden');
+ $(this).css('width', 'auto');
+ }
+ });
});
diff --git a/post.php b/post.php
index 7d8a0bc7..576a17bd 100644
--- a/post.php
+++ b/post.php
@@ -664,7 +664,7 @@ elseif (isset($_POST['post'])) {
}
}
- if ($config['allowed_tags'] && $post['op'] && isset($_POST['tag']) && isset($config['allowed_tags'][$_POST['tag']])) {
+ if ($config['allowed_tags'] && $post['op'] && isset($_POST['tag']) && $_POST['tag'] && isset($config['allowed_tags'][$_POST['tag']])) {
$post['body'] .= "\n
{% trans %}Edit board banners{% endtrans %}
+{% trans %}Edit board assets{% endtrans %}
{% trans %}Edit board flags{% endtrans %}
{% trans %}Edit board volunteers{% endtrans %}
{% trans %}Edit board tags{% endtrans %}
diff --git a/templates/mod/user.html b/templates/mod/user.html index 08598fe5..100f56e6 100644 --- a/templates/mod/user.html +++ b/templates/mod/user.html @@ -8,9 +8,9 @@{% trans 'Username' %} | +{% trans 'Username' %} {% if not mod|hasPermission(config.mod.editusers) %}({% trans 'warning: changing your username will log you out and change all occurrences of your old username to the new one in your board\'s logs' %}){% endif %} |
- {% if new or mod|hasPermission(config.mod.editusers) %} + {% if new or mod|hasPermission(config.mod.edit_profile) %} {% else %} {{ user.username|e }} @@ -20,13 +20,23 @@ |
---|---|---|
{% trans 'Password' %}{% if not new %} ({% trans 'new; optional' %}){% endif %} | - {% if new or (mod|hasPermission(config.mod.editusers) or (mod|hasPermission(config.mod.change_password) and user.id == mod.id)) %} + {% if new or (mod|hasPermission(config.mod.editusers) or (mod|hasPermission(config.mod.edit_profile) and user.id == mod.id)) %} {% else %} - {% endif %} | |
{% trans 'Email' %} ({% trans 'if you forget your board password email admin@8chan.co from this address to request a reset; optional' %}) |
+ + {% if new or (mod|hasPermission(config.mod.editusers) or (mod|hasPermission(config.mod.edit_profile) and user.id == mod.id)) %} + + {% else %} + - + {% endif %} + | +|
{% trans 'Group' %} | @@ -42,6 +52,7 @@||
{% trans 'Boards' %} | @@ -73,6 +84,7 @@ |
File: {{ file.file }}
(
diff --git a/templates/post/mod_attributes.html b/templates/post/mod_attributes.html
new file mode 100644
index 00000000..0eb89747
--- /dev/null
+++ b/templates/post/mod_attributes.html
@@ -0,0 +1,28 @@
+{% if post.sticky %}
+ {% if config.font_awesome %}
+
+ {% else %}
+
+ {% endif %}
+{% endif %}
+{% if post.locked %}
+ {% if config.font_awesome %}
+
+ {% else %}
+
+ {% endif %}
+{% endif %}
+{% if post.bumplocked and (config.mod.view_bumplock < 0 or (post.mod and post.mod|hasPermission(config.mod.view_bumplock, board.uri))) %}
+ {% if config.font_awesome %}
+
+ {% else %}
+
+ {% endif %}
+{% endif %}
+{% if post.cycle %}
+ {% if config.font_awesome %}
+
+ {% else %}
+
+ {% endif %}
+{% endif %}
diff --git a/templates/post_form.html b/templates/post_form.html
index 028de0f3..16db8413 100644
--- a/templates/post_form.html
+++ b/templates/post_form.html
@@ -229,12 +229,9 @@
{% if not config.field_disable_password or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri)) %}
{% endif %}
diff --git a/templates/post_thread.html b/templates/post_thread.html
index 77462bd5..ff693e22 100644
--- a/templates/post_thread.html
+++ b/templates/post_thread.html
@@ -17,34 +17,7 @@
{% include 'post/poster_id.html' %}
No.
{{ post.id }}
- {% if post.sticky %}
- {% if config.font_awesome %}
-
- {% else %}
-
{% trans %}Password{% endtrans %}
-
-
-
-
+
{% trans %}(For file and post deletion.){% endtrans %}
- {% endif %}
- {% endif %}
- {% if post.locked %}
- {% if config.font_awesome %}
-
- {% else %}
-
- {% endif %}
- {% endif %}
- {% if post.bumplocked and (config.mod.view_bumplock < 0 or (post.mod and post.mod|hasPermission(config.mod.view_bumplock, board.uri))) %}
- {% if config.font_awesome %}
-
- {% else %}
-
- {% endif %}
- {% endif %}
- {% if post.cycle %}
- {% if config.font_awesome %}
-
- {% else %}
-
- {% endif %}
- {% endif %}
+ {% include 'post/mod_attributes.html' %}
{% if index %}
[{% trans %}Reply{% endtrans %}]
{% endif %}
diff --git a/templates/post_thread_fileboard.html b/templates/post_thread_fileboard.html
index 3f17907d..079b5086 100644
--- a/templates/post_thread_fileboard.html
+++ b/templates/post_thread_fileboard.html
@@ -8,7 +8,7 @@
diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php index 42fad1ea..69db0119 100644 --- a/templates/themes/catalog/theme.php +++ b/templates/themes/catalog/theme.php @@ -76,13 +76,17 @@ if ($files[0]) { if ($files[0]->file == 'deleted') { - $post['file'] = $config['image_deleted']; + $post['file'] = $config['root'] . $config['image_deleted']; } else if($files[0]->thumb == 'spoiler') { - $post['file'] = '/' . $config['spoiler_image']; + $post['file'] = $config['root'] . $config['spoiler_image']; } else { - $post['file'] = $config['uri_thumb'] . $files[0]->thumb; + if ($files[0]->thumb == 'file') { + $post['file'] = $config['root'] . sprintf($config['file_thumb'], 'file.png'); + } else { + $post['file'] = $config['uri_thumb'] . $files[0]->thumb; + } $post['fullimage'] = $config['uri_img'] . $files[0]->file; } }