Browse Source

Added option for mods to send threads directly to archive (removing them from catalog)

main
PupperWoff 6 years ago
committed by discomrade
parent
commit
060ae1e547
  1. 13
      inc/config.php
  2. 16
      inc/mod/pages.php
  3. 3
      mod.php
  4. 229
      stylesheets/tomorrow.css
  5. 4
      templates/post/post_controls.html

13
inc/config.php

@ -712,7 +712,7 @@
* ====================
*/
// "Wiki" markup syntax ($config['wiki_markup'] in pervious versions):
// "Wiki" markup syntax ($config['wiki_markup'] in previous versions):
$config['markup'][] = array("/'''(.+?)'''/", "<strong>\$1</strong>");
$config['markup'][] = array("/''(.+?)''/", "<em>\$1</em>");
$config['markup'][] = array("/\*\*(.+?)\*\*/", "<span class=\"spoiler\">\$1</span>");
@ -723,6 +723,9 @@
// "/```([a-z0-9-]{0,20})\n(.*?)\n?```\n?/s"
$config['markup_code'] = false;
// // Dice Roll Markup
// $config['markup'][] = array("/\[diceroll\](.+?)\[\/diceroll\]/s", "<img src='" . $config['root'] . "static/icons/dice.png' width=16 height=16/><b>\$1</b>");
// Repair markup with HTML Tidy. This may be slower, but it solves nesting mistakes. Tinyboard, at the
// time of writing this, can not prevent out-of-order markup tags (eg. "**''test**'') without help from
// HTML Tidy.
@ -1510,10 +1513,10 @@
$config['mod']['link_merge'] = '[Merge]';
$config['mod']['link_cycle'] = '[Cycle]';
$config['mod']['link_uncycle'] = '[-Cycle]';
$config['mod']['link_shadow_restore'] = '[SD Restore]';
$config['mod']['link_shadow_delete'] = '[SD Delete]';
$config['mod']['link_send_to_archive'] = '[Archive]';
// Moderator capcodes.
$config['capcode'] = ' <span class="capcode">## %s</span>';
@ -1776,6 +1779,10 @@
$config['mod']['news_custom'] = ADMIN;
// Delete news entries
$config['mod']['news_delete'] = ADMIN;
// Send Threads directly to Archive (need to be greater than or equal to ['mod']['delete'] permission)
$config['mod']['send_threads_to_archive'] = MOD;
if($config['mod']['send_threads_to_archive'] < $config['mod']['delete'])
$config['mod']['send_threads_to_archive'] = $config['mod']['delete'];
// Feature archived threads
$config['mod']['feature_archived_threads'] = JANITOR;
// Delete featured archived threads

16
inc/mod/pages.php

@ -3975,5 +3975,17 @@ function mod_view_archive_mod_archive($boardName) {
));
}
function mod_archive_thread($board, $post) {
global $config;
if (!openBoard($board))
error($config['error']['noboard']);
if (!hasPermission($config['mod']['send_threads_to_archive'], $board))
error($config['error']['noaccess']);
Archive::archiveThread($post);
mod_delete($board, false, $post);
header('Location: ?/' . sprintf($config['board_path'], $board) . $config['file_index'], true, $config['redirect_http']);
}

3
mod.php

@ -104,7 +104,8 @@ $pages = array(
'/(\%b)/(un)?sticky/(\d+)' => 'secure sticky', // sticky thread
'/(\%b)/(un)?cycle/(\d+)' => 'secure cycle', // cycle thread
'/(\%b)/bump(un)?lock/(\d+)' => 'secure bumplock', // "bumplock" thread
'/(\%b)/archive_thread/(\d+)' => 'secure archive_thread', // send thread to archive
'/themes' => 'themes_list', // manage themes
'/themes/(\w+)' => 'secure_POST theme_configure', // configure/reconfigure theme
'/themes/(\w+)/rebuild' => 'secure theme_rebuild', // rebuild theme

229
stylesheets/tomorrow.css

@ -0,0 +1,229 @@
/** TOMORROW, I'LL ...
A cool dark skin by 7185.
https://github.com/7185/8chan-tomorrow/
**/
body {
background:#1d1f21 none;
color:#C5C8C6
}
h1,div.subtitle {
color:#C5C8C6!important
}
a:link,a:visited,p.intro a.email span.name {
color:#81a2be
}
a:link:hover {
color:#5F89AC
}
a.post_no {
color:#C5C8C6
}
a.post_no:hover {
color:#5F89AC!important
}
div.banner {
background-color:#1d1f21
}
div.post.reply {
background-color:#282a2e;
border:1px solid #282a2e;
margin-bottom:2px;
margin-left:16px;
margin-top:2px
}
div.post.reply.highlighted {
background-color:#1d1d21;
border:1px solid #111
}
div.post.reply div.body a {
color:#81a2be
}
div.post.reply div.body a:hover {
color:#5F89AC
}
div.post-hover {
border:1px solid #000!important;
box-shadow:none!important
}
.theme-catalog div.thread:hover {
background-color:#1d1f21;
border-color:#111
}
p.intro span.subject {
color:#b294bb
}
p.intro span.name {
color:#C5C8C6
}
.quote {
color:#adbd68
}
span.heading {
color:#F20
}
form table tr th {
background:#282a2e;
border:1px solid #111;
color:#C5C8C6
}
div.ban h2 {
background:#282A2E;
color:inherit
}
div.ban {
border-color:#282A2E;
}
div.ban {
color:#C5C8C6;
background-color: inherit;
}
div.pages {
background:#1d1f21;
border-color:#1d1f21
}
div.pages a.selected {
color:#81a2be;
font-weight:700
}
div.boardlist {
background-color:#282a2e!important;
color:#C5C8C6
}
div.boardlist:nth-of-type(1) {
border-bottom:1px solid #111!important;
box-shadow:0 0 3px 0 #111
}
div.boardlist a {
color:#81a2be
}
hr {
background-color:#282a2e;
border:0;
height:1px
}
div#options_div {
background-color:#282a2e
}
div.options_tab_icon {
color:#AAA
}
div.options_tab_icon:hover {
background-color:#111
}
div.options_tab_icon.active {
color:#F20
}
div.blotter {
color:#F20
}
span.omitted {
color:#707070
}
p.intro a,span.omitted a {
text-decoration:none
}
form#quick-reply {
padding-right:1px;
border: 1px solid #111
}
span.capcode {
background-color: #122;
padding:2px 5px;
border-radius: 10px
}
div#watchlist,div#alert_div {
border:1px solid #111;
background-color:#282a2e
}
div#watchlist a,a.watchThread {
color:#81a2be;
text-decoration:none
}
div#watchlist a:hover,a.watchThread:hover {
color:#5F89AC
}
/* Remove the following parts if those annoy you */
/* Keep small thumbnails in replies */
.post.reply a:not([data-expanded="true"]) .post-image{
width:auto!important;
height:auto!important;
max-height:160px;
max-width:160px
}
/*
.modlog tr:nth-child(even), .modlog th {
background-color: #282A2E;
}
*/
table.modlog {
color: #FFF;
background-color: #282A2E;
}
table.modlog tbody {
color: #FFF;
}
table.modlog tr th,
table.modlog tr td {
background-color: #282A2E;
}
table.modlog tr:hover td {
background-color: #383A3E;
}
.box {
background: #282a2e;
border-color: #111;
color: #C5C8C6;
}
.box-title {
background: #282a2e;
color: #C5C8C6;
}
table thead th {
background: #282a2e;
border-color: #111;
color: #C5C8C6;
}
table tbody tr:nth-of-type( even ) {
background-color: #282a2e;
}
table.board-list-table .board-uri .board-sfw {
color: #81a2be;
}
tbody.board-list-omitted td {
background: #282a2e;
border-color: #111;
}
table.board-list-table .board-tags .board-cell:hover {
background: #1d1f21;
}
table.board-list-table tr:nth-of-type( even ) .board-tags .board-cell {
background: #282a2e;
}
/* Predefined reasons */
.ReasonTableForm tr:first-child td {
background: #282A2E;
}
.ReasonTableForm tr:hover td {
background: #1D1D21;
}
/* fix for post menu */
.post-menu {
color: #DB7A18;
}
.post-menu ul {
background-color: #1D1F21;
}

4
templates/post/post_controls.html

@ -59,7 +59,9 @@
<a title="{% trans %}Lock thread{% endtrans %}" href="?/{{ secure_link(board.dir ~ 'lock/' ~ post.id) }}">{{ config.mod.link_lock }}</a>&nbsp;
{% endif %}
{% endif %}
{% if mod|hasPermission(config.mod.send_threads_to_archive, board.uri) %}
{{ secure_link_confirm(config.mod.link_send_to_archive, 'Send thread to archive'|trans, 'Are you sure you want to send thread to archive and delete it from the catalog?'|trans, board.dir ~ 'archive_thread/' ~ post.id ) }}&nbsp;
{% endif %}
{% endif %}
{% if mod|hasPermission(config.mod.move, board.uri) %}
{% if not post.thread %}

Loading…
Cancel
Save