From 8dc48c50c39fb754e1ca5d5f5cdbc9f43c0175c4 Mon Sep 17 00:00:00 2001 From: wholelotofhs Date: Thu, 20 Nov 2014 14:33:25 -0500 Subject: [PATCH 01/17] Update style.css --- stylesheets/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stylesheets/style.css b/stylesheets/style.css index bebd4813..f542ec36 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -858,7 +858,7 @@ pre { #options_div { width: 600px; - height: 300px; + height: 320px; } #alert_div { From 7ac1ccf448c2f5f85e68037473691cb84f3169d2 Mon Sep 17 00:00:00 2001 From: wholelotofhs Date: Thu, 20 Nov 2014 14:39:20 -0500 Subject: [PATCH 02/17] Create disable-styles.js --- js/disable-styles.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 js/disable-styles.js diff --git a/js/disable-styles.js b/js/disable-styles.js new file mode 100644 index 00000000..aff6f034 --- /dev/null +++ b/js/disable-styles.js @@ -0,0 +1,35 @@ +/* This file is dedicated to the public domain; you may do as you wish with it. */ + +/* Adds a checkbox in the General options tab to disable and enable board style sheets. */ + +var disableStyleSheet = function () { + var disableStyles = localStorage['disablestylesheet'] ? true : false; + var i = 0 + while(i' + ' Disable board specific style sheets' + '') + $(element).find('input').prop('checked', disableStyles) + } + + $(element).on(event, function() { + if(disableStyles) { + delete localStorage.disablestylesheet; + } else { + localStorage.disablestylesheet = true; + } + disableStyles =! disableStyles; + document.styleSheets[sheet].disabled = disableStyles; + }) +} +$(document).ready(disableStyleSheet()); From 8fa14518e2de990bb66f11296d3691ef17ba5b5a Mon Sep 17 00:00:00 2001 From: wholelotofhs Date: Thu, 20 Nov 2014 14:50:01 -0500 Subject: [PATCH 03/17] only disable stylesheets on Applicable pages --- js/disable-styles.js | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/js/disable-styles.js b/js/disable-styles.js index aff6f034..c44510e4 100644 --- a/js/disable-styles.js +++ b/js/disable-styles.js @@ -4,17 +4,21 @@ var disableStyleSheet = function () { var disableStyles = localStorage['disablestylesheet'] ? true : false; - var i = 0 - while(i Date: Thu, 20 Nov 2014 15:12:40 -0500 Subject: [PATCH 04/17] clean up and added comments --- js/disable-styles.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/js/disable-styles.js b/js/disable-styles.js index c44510e4..823d023a 100644 --- a/js/disable-styles.js +++ b/js/disable-styles.js @@ -2,8 +2,9 @@ /* Adds a checkbox in the General options tab to disable and enable board style sheets. */ -var disableStyleSheet = function () { +$(document).ready(function () { var disableStyles = localStorage['disablestylesheet'] ? true : false; + /* only search for and disable board stylesheets if the user is on a page that uses them */ if(active_page == 'ukko' || active_page == 'thread' || active_page == 'index' || active_page == 'catalog') { var i = 0 @@ -18,22 +19,19 @@ var disableStyleSheet = function () { i++ } } - + /* add the option on all pages so that the user doesn't need to goto a board to toggle it */ if (window.Options && Options.get_tab('general')){ - element = '#disablestyle' - event = 'change' Options.extend_tab('general','') - $(element).find('input').prop('checked', disableStyles) + $('#disablestyle').find('input').prop('checked', disableStyles) } - $(element).on(event, function() { + $('#disablestyle').on('change', function() { if(disableStyles) { - delete localStorage.disablestylesheet; + delete localStorage.disablestylesheet } else { - localStorage.disablestylesheet = true; + localStorage.disablestylesheet = true } - disableStyles =! disableStyles; - if(active_page == 'ukko' || active_page == 'thread' || active_page == 'index' || active_page == 'catalog') document.styleSheets[sheet].disabled = disableStyles; + disableStyles =! disableStyles + if(active_page == 'ukko' || active_page == 'thread' || active_page == 'index' || active_page == 'catalog') document.styleSheets[sheet].disabled = disableStyles }) -} -$(document).ready(disableStyleSheet()); +}) From 345b0b848fdafdf74b39da485b294edd281252a6 Mon Sep 17 00:00:00 2001 From: wholelotofhs Date: Thu, 20 Nov 2014 15:23:19 -0500 Subject: [PATCH 05/17] Update disable-styles.js --- js/disable-styles.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/js/disable-styles.js b/js/disable-styles.js index 823d023a..c69f4e2d 100644 --- a/js/disable-styles.js +++ b/js/disable-styles.js @@ -1,5 +1,3 @@ -/* This file is dedicated to the public domain; you may do as you wish with it. */ - /* Adds a checkbox in the General options tab to disable and enable board style sheets. */ $(document).ready(function () { From 81e5f9f0cb0ea6955240ddf0402ffb91c66dae88 Mon Sep 17 00:00:00 2001 From: Forkless Date: Sat, 22 Nov 2014 19:41:23 -0600 Subject: [PATCH 06/17] Fix thread stats so post count hover works on the OP's id. --- js/thread-stats.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/thread-stats.js b/js/thread-stats.js index c787bbdb..c66916f1 100644 --- a/js/thread-stats.js +++ b/js/thread-stats.js @@ -50,9 +50,12 @@ $(document).ready(function(){ ids[opID] = 0; } ids[opID]++; + var cur = op.find('>.intro >.poster_id'); + cur.find('+.posts_by_id').remove(); + cur.after(' ('+ ids[cur.text()] +')'); replies.each(function(){ - var cur = $(this).find('> .intro > .poster_id'); - cur.find('+ .posts_by_id').remove(); + cur = $(this).find('>.intro >.poster_id'); + cur.find('+.posts_by_id').remove(); cur.after(' ('+ ids[cur.text()] +')'); }); var size = function(obj) { From af305de33688fdf207e0560ecdec4ed5e2dfd04a Mon Sep 17 00:00:00 2001 From: topkek Date: Sun, 23 Nov 2014 22:48:00 +0000 Subject: [PATCH 07/17] add space between backlinks --- js/show-backlinks.js | 3 ++- stylesheets/style.css | 6 +----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/js/show-backlinks.js b/js/show-backlinks.js index fa4865fd..4056119e 100644 --- a/js/show-backlinks.js +++ b/js/show-backlinks.js @@ -38,7 +38,8 @@ onready(function(){ var $link = $('>>' + reply_id + ''); - $link.appendTo($mentioned) + $link.appendTo($mentioned); + $link.after(" "); if (window.init_hover) { $link.each(init_hover); diff --git a/stylesheets/style.css b/stylesheets/style.css index bebd4813..5f88551a 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -257,7 +257,7 @@ p.intro span.capcode,p.intro a.capcode,p.intro a.nametag { } p.intro a { - margin-left: 8px; + margin-left: 5px; } div.delete { @@ -939,10 +939,6 @@ pre { margin-top: 0px; } -.mentioned { - word-wrap: break-word; -} - .poster_id { cursor: pointer; } From a2c20cda6540697af3ae312f6a02cce462b431ad Mon Sep 17 00:00:00 2001 From: Markerov Date: Sat, 29 Nov 2014 11:01:30 +0800 Subject: [PATCH 08/17] Fix bug with inline expansion with Unanimate Gif Issue #273 --- js/inline-expanding.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/inline-expanding.js b/js/inline-expanding.js index cf8cab81..8da66898 100644 --- a/js/inline-expanding.js +++ b/js/inline-expanding.js @@ -19,7 +19,7 @@ onready(function(){ for (var i = 0; i < link.length; i++) { if (typeof link[i] == "object" && link[i].childNodes && typeof link[i].childNodes[0] !== 'undefined' && link[i].childNodes[0].src && link[i].childNodes[0].className.match(/post-image/) && !link[i].className.match(/file/)) { link[i].onclick = function(e) { - var img, post_body, still_open; + var img, post_body, still_open, canvas; var thumb = this.childNodes[0]; var padding = 5; var boardlist = $('.boardlist')[0]; @@ -43,8 +43,10 @@ onready(function(){ this.dataset.expanded = 'true'; if (thumb.tagName === 'CANVAS') { - this.removeChild(thumb); - thumb.style.display = 'block'; + canvas = thumb; + thumb = thumb.nextSibling; + this.removeChild(canvas); + canvas.style.display = 'block'; } thumb.style.opacity = '0.4'; From c2e9be776b67b4be98dd6ebbb95a265265ced9f9 Mon Sep 17 00:00:00 2001 From: b4x Date: Mon, 1 Dec 2014 20:36:11 +0100 Subject: [PATCH 09/17] Changed moderate to volunteer on --- inc/locale/en/LC_MESSAGES/tinyboard.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/locale/en/LC_MESSAGES/tinyboard.po b/inc/locale/en/LC_MESSAGES/tinyboard.po index e1b8f64b..97fc01ac 100644 --- a/inc/locale/en/LC_MESSAGES/tinyboard.po +++ b/inc/locale/en/LC_MESSAGES/tinyboard.po @@ -689,7 +689,7 @@ msgstr "" msgid "You seem to have mistyped the verification." msgstr "" -#. Moderator errors +#. Volunteer errors #: ../../../../inc/config.php:906 ../../../../inc/config.php:1011 #: ../../../../inc/config.php:1002 ../../../../inc/config.php:1004 #: ../../../../inc/config.php:1006 ../../../../inc/config.php:1022 @@ -879,7 +879,7 @@ msgstr "" #: ../../../../inc/mod/pages.php:671 ../../../../inc/mod/pages.php:698 #: ../../../../templates/cache/72/7e/271125664718133518fd942f20fb724224e100f8a0d47cb0b52f895ac12f.php:300 #: ../../../../templates/cache/73/f8/5e3142a8a6f8d7e40422ff577e83b0dedf55a7cb9bc7082839b24f653545.php:75 -msgid "Moderation log" +msgid "Volunteer log" msgstr "" #. line 104 @@ -3489,7 +3489,7 @@ msgid "There are no active posts." msgstr "" #: ../../../../templates/cache/ba/55/2553cc018aecf7d29a62331aec4bedc71b646817c7e4c4e7d1a885263676.php:49 -msgid "Show only bans from boards I moderate" +msgid "Show only bans from boards I volunteer on" msgstr "" #: ../../../../templates/cache/ba/55/2553cc018aecf7d29a62331aec4bedc71b646817c7e4c4e7d1a885263676.php:55 From 666a7f760d48ea4ae017a425f101a11cb11d2cd4 Mon Sep 17 00:00:00 2001 From: topkek Date: Wed, 26 Nov 2014 21:10:27 +0000 Subject: [PATCH 10/17] add global option for tree view --- js/treeview.js | 71 +++++++++++++++++++++++++++---------------- stylesheets/style.css | 3 +- 2 files changed, 47 insertions(+), 27 deletions(-) diff --git a/js/treeview.js b/js/treeview.js index 78ad620b..c9bd55f8 100644 --- a/js/treeview.js +++ b/js/treeview.js @@ -11,35 +11,54 @@ * */ +if (active_page == 'thread' || active_page == 'ukko' || active_page == 'index') +$(function() { + if (window.Options && Options.get_tab('general')) { + var selector = '#treeview-global>input'; + Options.extend_tab("general", ""); + } + $(selector).on('change', function () { + if (localStorage.treeview === 'true') { + localStorage.treeview = 'false'; + } else { + localStorage.treeview = 'true'; + } + }); + if (localStorage.treeview === 'true') { + $(selector).attr('checked', 'checked'); + } +}); + if (active_page == 'thread') $(function() { + var treeview = function() { + $('.post.reply').each(function(){ + var references = []; + $(this).find('.body a').each(function(){ + if ($(this).html().match('^>>[0-9]+$')) { + references.push(parseInt($(this).html().replace('>>', ''))); + } + }); + var maxref = references.reduce(function(a,b) { return a > b ? a : b; }, 0); + + var parent_post = $("#reply_"+maxref); + if (parent_post.length == 0) return; + + var margin = parseInt(parent_post.css("margin-left"))+32; + + var post = $(this); + var br = post.next(); + + post.detach().css("margin-left", margin).insertAfter(parent_post.next()); + br.detach().insertAfter(post); + }); + } + if (localStorage.treeview === 'true') { + treeview(); + } + $('hr:first').before('
'); $('div#treeview a') .text(_('Tree view')) - .click(function(e) { - e.preventDefault(); - - $('.post.reply').each(function(){ - var references = []; - $(this).find('.body a').each(function(){ - if ($(this).html().match('^>>[0-9]+$')) { - references.push(parseInt($(this).html().replace('>>', ''))); - } - }); - - var maxref = references.reduce(function(a,b) { return a > b ? a : b; }, 0); - - var parent_post = $("#reply_"+maxref); - if (parent_post.length == 0) return; - - var margin = parseInt(parent_post.css("margin-left"))+32; - - var post = $(this); - var br = post.next(); - - post.detach().css("margin-left", margin).insertAfter(parent_post.next()); - br.detach().insertAfter(post); - - }); - }); + .click(function(e) { treeview(); e.preventDefault(); }); }); diff --git a/stylesheets/style.css b/stylesheets/style.css index bebd4813..f86f0021 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -858,7 +858,7 @@ pre { #options_div { width: 600px; - height: 300px; + height: 320px; } #alert_div { @@ -925,6 +925,7 @@ pre { right: 0px; text-align: left; font-size: 12px; + overflow-y: auto; } .options_tab h2 { From 2da17bfebeabd2c85b5102d66bec8ea733f846f6 Mon Sep 17 00:00:00 2001 From: topkek Date: Wed, 26 Nov 2014 22:48:54 +0000 Subject: [PATCH 11/17] toggle tree view --- js/treeview.js | 52 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/js/treeview.js b/js/treeview.js index c9bd55f8..937ea6ff 100644 --- a/js/treeview.js +++ b/js/treeview.js @@ -31,27 +31,41 @@ $(function() { if (active_page == 'thread') $(function() { + var treeview_on = false; var treeview = function() { - $('.post.reply').each(function(){ - var references = []; - $(this).find('.body a').each(function(){ - if ($(this).html().match('^>>[0-9]+$')) { - references.push(parseInt($(this).html().replace('>>', ''))); - } - }); - var maxref = references.reduce(function(a,b) { return a > b ? a : b; }, 0); - - var parent_post = $("#reply_"+maxref); - if (parent_post.length == 0) return; - - var margin = parseInt(parent_post.css("margin-left"))+32; - - var post = $(this); - var br = post.next(); + if (!treeview_on) { + treeview_on = true; + $('.post.reply').each(function(){ + var references = []; + $(this).find('.body a').each(function(){ + if ($(this).html().match('^>>[0-9]+$')) { + references.push(parseInt($(this).html().replace('>>', ''))); + } + }); + var maxref = references.reduce(function(a,b) { return a > b ? a : b; }, 0); - post.detach().css("margin-left", margin).insertAfter(parent_post.next()); - br.detach().insertAfter(post); - }); + var parent_post = $("#reply_"+maxref); + if (parent_post.length == 0) return; + + var margin = parseInt(parent_post.css("margin-left"))+32; + + var post = $(this); + var br = post.next(); + + post.detach().css("margin-left", margin).insertAfter(parent_post.next()); + br.detach().insertAfter(post); + }); + } else { + treeview_on = false; + $('.post.reply').sort(function(a,b) { + return parseInt(a.id.replace('reply_', '')) > parseInt(b.id.replace('reply_', '')); + }).each(function () { + var post = $(this); + var br = post.next(); + post.detach().css('margin-left', '0').appendTo('.thread'); + br.detach().insertAfter(post); + }); + } } if (localStorage.treeview === 'true') { treeview(); From 191347b92e79b03457ff3c1d8581181bd8f912cc Mon Sep 17 00:00:00 2001 From: topkek Date: Thu, 27 Nov 2014 00:36:51 +0000 Subject: [PATCH 12/17] chrome fix --- js/treeview.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/treeview.js b/js/treeview.js index 937ea6ff..046a9796 100644 --- a/js/treeview.js +++ b/js/treeview.js @@ -58,7 +58,7 @@ $(function() { } else { treeview_on = false; $('.post.reply').sort(function(a,b) { - return parseInt(a.id.replace('reply_', '')) > parseInt(b.id.replace('reply_', '')); + return parseInt(a.id.replace('reply_', '')) - parseInt(b.id.replace('reply_', '')); }).each(function () { var post = $(this); var br = post.next(); From 2a2f64c09805a4f6dfe8ba298fd8570b21518661 Mon Sep 17 00:00:00 2001 From: topkek Date: Thu, 27 Nov 2014 18:14:12 +0000 Subject: [PATCH 13/17] don't indent previews --- js/post-hover.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/post-hover.js b/js/post-hover.js index eefb3875..657c4f1d 100644 --- a/js/post-hover.js +++ b/js/post-hover.js @@ -73,6 +73,7 @@ onready(function(){ .css('font-style', 'normal') .css('z-index', '100') .css('left', '0') + .css('margin-left', '0') .addClass('reply').addClass('post') .appendTo(link.closest('div.post')) From 82fc6c241b6b1ba7c5c80a4771101dc12a633a90 Mon Sep 17 00:00:00 2001 From: topkek Date: Fri, 28 Nov 2014 01:15:10 +0000 Subject: [PATCH 14/17] checkbox for tree view --- js/favorites.js | 1 - js/post-hover.js | 2 +- js/treeview.js | 21 +++++++++------------ 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/js/favorites.js b/js/favorites.js index 39bae783..acef9c7e 100644 --- a/js/favorites.js +++ b/js/favorites.js @@ -56,7 +56,6 @@ if (active_page == 'thread' || active_page == 'index' || active_page == 'catalog $(document).ready(function(){ var favorites = JSON.parse(localStorage.favorites); var is_board_favorite = ~$.inArray(board_name, favorites); - console.log(is_board_favorite); $('header>h1').append('\u2605'); add_favorites(); diff --git a/js/post-hover.js b/js/post-hover.js index 657c4f1d..94841cc5 100644 --- a/js/post-hover.js +++ b/js/post-hover.js @@ -73,7 +73,7 @@ onready(function(){ .css('font-style', 'normal') .css('z-index', '100') .css('left', '0') - .css('margin-left', '0') + .css('margin-left', '') .addClass('reply').addClass('post') .appendTo(link.closest('div.post')) diff --git a/js/treeview.js b/js/treeview.js index 046a9796..dcd87e1e 100644 --- a/js/treeview.js +++ b/js/treeview.js @@ -31,10 +31,8 @@ $(function() { if (active_page == 'thread') $(function() { - var treeview_on = false; - var treeview = function() { - if (!treeview_on) { - treeview_on = true; + var treeview = function(enable) { + if (enable === true) { $('.post.reply').each(function(){ var references = []; $(this).find('.body a').each(function(){ @@ -56,23 +54,22 @@ $(function() { br.detach().insertAfter(post); }); } else { - treeview_on = false; $('.post.reply').sort(function(a,b) { return parseInt(a.id.replace('reply_', '')) - parseInt(b.id.replace('reply_', '')); }).each(function () { var post = $(this); var br = post.next(); - post.detach().css('margin-left', '0').appendTo('.thread'); + post.detach().css('margin-left', '').appendTo('.thread'); br.detach().insertAfter(post); }); } } + + $('hr:first').before('
'); + $('input#treeview').on('change', function(e) { treeview($(this).is(':checked')); }); + if (localStorage.treeview === 'true') { - treeview(); + treeview(true); + $('input#treeview').attr('checked', true); } - - $('hr:first').before('
'); - $('div#treeview a') - .text(_('Tree view')) - .click(function(e) { treeview(); e.preventDefault(); }); }); From 74a6ad7e52d043227f7bae279c766100d4e7dca7 Mon Sep 17 00:00:00 2001 From: topkek Date: Fri, 28 Nov 2014 21:59:05 +0000 Subject: [PATCH 15/17] clean up options code --- js/treeview.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/js/treeview.js b/js/treeview.js index dcd87e1e..1709debb 100644 --- a/js/treeview.js +++ b/js/treeview.js @@ -16,16 +16,16 @@ $(function() { if (window.Options && Options.get_tab('general')) { var selector = '#treeview-global>input'; Options.extend_tab("general", ""); - } - $(selector).on('change', function () { + $(selector).on('change', function() { + if (localStorage.treeview === 'true') { + localStorage.treeview = 'false'; + } else { + localStorage.treeview = 'true'; + } + }); if (localStorage.treeview === 'true') { - localStorage.treeview = 'false'; - } else { - localStorage.treeview = 'true'; + $(selector).attr('checked', 'checked'); } - }); - if (localStorage.treeview === 'true') { - $(selector).attr('checked', 'checked'); } }); From 96d69c52f2935a72516f8a15b2fd97289004f911 Mon Sep 17 00:00:00 2001 From: topkek Date: Tue, 9 Dec 2014 02:04:53 +0000 Subject: [PATCH 16/17] Scroll to thumbnail when shrinking an expanded image --- js/inline-expanding.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/inline-expanding.js b/js/inline-expanding.js index 8da66898..05300138 100644 --- a/js/inline-expanding.js +++ b/js/inline-expanding.js @@ -74,10 +74,10 @@ onready(function(){ if (still_open > 1) { if (e.target.getBoundingClientRect().top - padding < 0) - $('body').scrollTop($(e.target).parent().parent().offset().top - padding); + $(document).scrollTop($(e.target).parent().parent().offset().top - padding); } else { if (post_body[0].getBoundingClientRect().top - padding < 0) - $('body').scrollTop(post_body.offset().top - padding); + $(document).scrollTop(post_body.offset().top - padding); } } From d457cb57b82c9115360d862c4e0940ca9be8c1c6 Mon Sep 17 00:00:00 2001 From: Forkless Date: Sun, 14 Dec 2014 22:46:11 -0600 Subject: [PATCH 17/17] Added tripcode removal to post editing --- inc/mod/pages.php | 7 ++++--- templates/mod/edit_post_form.html | 8 ++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 0f059f05..8f7a54bb 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1599,12 +1599,13 @@ function mod_edit_post($board, $edit_raw_html, $postID) { error($config['error']['404']); if (isset($_POST['name'], $_POST['email'], $_POST['subject'], $_POST['body'])) { + $trip = isset($_POST['remove_trip']) ? ' `trip` = NULL,' : ''; if ($edit_raw_html) - $query = prepare(sprintf('UPDATE ``posts_%s`` SET `name` = :name, `email` = :email, `subject` = :subject, `body` = :body, `body_nomarkup` = :body_nomarkup, `edited_at` = NOW() WHERE `id` = :id', $board)); + $query = prepare(sprintf('UPDATE ``posts_%s`` SET `name` = :name,'. $trip .' `email` = :email, `subject` = :subject, `body` = :body, `body_nomarkup` = :body_nomarkup, `edited_at` = NOW() WHERE `id` = :id', $board)); else - $query = prepare(sprintf('UPDATE ``posts_%s`` SET `name` = :name, `email` = :email, `subject` = :subject, `body_nomarkup` = :body, `edited_at` = NOW() WHERE `id` = :id', $board)); + $query = prepare(sprintf('UPDATE ``posts_%s`` SET `name` = :name,'. $trip .' `email` = :email, `subject` = :subject, `body_nomarkup` = :body, `edited_at` = NOW() WHERE `id` = :id', $board)); $query->bindValue(':id', $postID); - $query->bindValue('name', $_POST['name']); + $query->bindValue(':name', $_POST['name'] ? $_POST['name'] : $config['anonymous']); $query->bindValue(':email', $_POST['email']); $query->bindValue(':subject', $_POST['subject']); $query->bindValue(':body', $_POST['body']); diff --git a/templates/mod/edit_post_form.html b/templates/mod/edit_post_form.html index a2980d35..09dc3fcd 100644 --- a/templates/mod/edit_post_form.html +++ b/templates/mod/edit_post_form.html @@ -10,6 +10,14 @@ + + + {% trans %}Tripcode{% endtrans %} + + + Remove? + + {% trans %}Email{% endtrans %}