SUB-FORUMS with Auto-Setting
I. Pre-SettingAt first set this option in Settings: (Administration > Options > Time and timeouts) Redirect time = 1
II. Code installationThe code consists of two parts:
1. To top of HTML header
<!-- Subforums "no script" © Alex_63 / P.1 to top of HTML header -->
<script type="text/javascript">var SUBF = {},SUBFset = {};
// Script Settings //
SUBF.icon_old = 'https://forumstatic.ru/files/0016/4f/7e/12924.jpg'; // Subforums icon without new messages
SUBF.icon_new = 'https://forumstatic.ru/files/0016/4f/7e/75803.jpg'; // Subforums icon with new messages
SUBF.d_title = 'Subforums:' // The text in the subforums section header
SUBF.category_link = 1; // Clickability of categories: 0 - disabled, 1 - enabled
SUBFset.enable_subf = 1; // Subforums installation: 0 - manual, 1 - automatic
$(document).ready(function(){$('#navadmin>a').attr('href','/admin/index');});
if(document.URL.indexOf('/admin/')!=-1)(function(){var s='<script type="text/javascript" src="',
e='"></'+'script>',l='https://forumstatic.ru/files/0017/9e/c1/40123.js';document.write(s+l+e);}());
</script><link rel="stylesheet" type="text/css" href="https://forumstatic.ru/files/0016/4f/7e/73859.css"/>
<script type="text/javascript" src="https://forumstatic.ru/files/0017/9e/c1/73858.js"></script>
2. To top of HTML footer
<!-- Subforums "no script" © Alex_63 / P.2 to top of HTML footer -->
<script type="text/javascript">setSubforums()</script>
Additional style - to the end of "Structure style.css"
/************* Subforums Auto-Setting | Add styles *************/
.punbb-admin:not(.admin-visible)::before {
content: "You are in the administration panel without addons. Auto-setting of subforums is disabled.";
color: #c22d2d; display: block; text-align: center; border: solid 1px #d48f8f; padding: 5px; margin-bottom: 5px; background: #f8e5e5;
}
Script settings:
SUBF.icon_old - subforum icon without new posts
SUBF.icon_new - subforum icon with new posts
SUBF.d_title - the text in the subforums section header
SUBFset.enable_subf - mode of subforums installation: 0 - manual, 1 - automatic
BONUS: Ability of setting your own codes to HTML header and HTML footer in Admin-Panel!
For this set two containers (the code below) to HTML header upper than the first part of subforum script:
<noscript data="html_header">
<!-- Content of HTML header in Admin-Panel -->
</noscript>
<noscript data="html_footer">
<!-- Content of HTML footer in Admin-Panel -->
</noscript>