<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[MyBB Community Forums - MyBB 1.9 Development]]></title>
		<link>https://community.mybb.com/</link>
		<description><![CDATA[MyBB Community Forums - https://community.mybb.com]]></description>
		<pubDate>Sun, 22 Nov 2026 17:09:15 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[Incoming webhooks implementation]]></title>
			<link>https://community.mybb.com/thread-244838.html</link>
			<pubDate>Sat, 31 Jan 2026 16:40:54 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://community.mybb.com/member.php?action=profile&uid=25096">Omar G.</a>]]></dc:creator>
			<guid isPermaLink="false">https://community.mybb.com/thread-244838.html</guid>
			<description><![CDATA[1.9 should implement incoming webhook support by default. Although RESTful data endpoints are useful and sometimes more powerful, some services only offer webhooks as basic integration with apps and thus webhooks and RESTful data endpoints become complementary to each other.<br />
<br />
Admins will be able to manage custom webhooks that generate unique endpoints similar to <code class="inline-code">https://community.mybb.com/webhook/1440a5cd-108b-4af9-8da1-c1c65360aee3</code>.<br />
<br />
There is no code preview yet, so feel free to provide feedback or suggestions.<br />
<br />
This is part of a series of suggestions regarding account accessibility, security, data access, and external integration.<br />
<a href="https://community.mybb.com/thread-244836.html" target="_blank" rel="noopener" class="mycode_url">https://community.mybb.com/thread-244836.html</a><br />
<a href="https://community.mybb.com/thread-244837.html" target="_blank" rel="noopener" class="mycode_url">https://community.mybb.com/thread-244837.html</a><br />
<a href="https://community.mybb.com/thread-244835.html" target="_blank" rel="noopener" class="mycode_url">https://community.mybb.com/thread-244835.html</a>]]></description>
			<content:encoded><![CDATA[1.9 should implement incoming webhook support by default. Although RESTful data endpoints are useful and sometimes more powerful, some services only offer webhooks as basic integration with apps and thus webhooks and RESTful data endpoints become complementary to each other.<br />
<br />
Admins will be able to manage custom webhooks that generate unique endpoints similar to <code class="inline-code">https://community.mybb.com/webhook/1440a5cd-108b-4af9-8da1-c1c65360aee3</code>.<br />
<br />
There is no code preview yet, so feel free to provide feedback or suggestions.<br />
<br />
This is part of a series of suggestions regarding account accessibility, security, data access, and external integration.<br />
<a href="https://community.mybb.com/thread-244836.html" target="_blank" rel="noopener" class="mycode_url">https://community.mybb.com/thread-244836.html</a><br />
<a href="https://community.mybb.com/thread-244837.html" target="_blank" rel="noopener" class="mycode_url">https://community.mybb.com/thread-244837.html</a><br />
<a href="https://community.mybb.com/thread-244835.html" target="_blank" rel="noopener" class="mycode_url">https://community.mybb.com/thread-244835.html</a>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[2FA security for the forum side]]></title>
			<link>https://community.mybb.com/thread-244837.html</link>
			<pubDate>Sat, 31 Jan 2026 15:56:46 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://community.mybb.com/member.php?action=profile&uid=25096">Omar G.</a>]]></dc:creator>
			<guid isPermaLink="false">https://community.mybb.com/thread-244837.html</guid>
			<description><![CDATA[Several attempts to implement 2FA auth into the core have been made in the past. Some failed due to the script limitation at their time of development.<br />
<br />
1.9 should implement native 2FA support with a variety of settings/permissions.<br />
<br />
There is currently no code or issue created for this, so feel free to provide any feedback, technical or otherwise.<br />
<br />
This is part of a series of suggestions regarding account accessibility, security, data access, and external integration.<br />
<a href="https://community.mybb.com/thread-244836.html" target="_blank" rel="noopener" class="mycode_url">https://community.mybb.com/thread-244836.html</a><br />
<a href="https://community.mybb.com/thread-244835.html" target="_blank" rel="noopener" class="mycode_url">https://community.mybb.com/thread-244835.html</a>]]></description>
			<content:encoded><![CDATA[Several attempts to implement 2FA auth into the core have been made in the past. Some failed due to the script limitation at their time of development.<br />
<br />
1.9 should implement native 2FA support with a variety of settings/permissions.<br />
<br />
There is currently no code or issue created for this, so feel free to provide any feedback, technical or otherwise.<br />
<br />
This is part of a series of suggestions regarding account accessibility, security, data access, and external integration.<br />
<a href="https://community.mybb.com/thread-244836.html" target="_blank" rel="noopener" class="mycode_url">https://community.mybb.com/thread-244836.html</a><br />
<a href="https://community.mybb.com/thread-244835.html" target="_blank" rel="noopener" class="mycode_url">https://community.mybb.com/thread-244835.html</a>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Magic link passwordless auth]]></title>
			<link>https://community.mybb.com/thread-244836.html</link>
			<pubDate>Sat, 31 Jan 2026 15:32:14 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://community.mybb.com/member.php?action=profile&uid=25096">Omar G.</a>]]></dc:creator>
			<guid isPermaLink="false">https://community.mybb.com/thread-244836.html</guid>
			<description><![CDATA[1.9 should implement a magic link password authentication feature.<br />
<br />
Administrators should be able to disable password auth and force magic link auth for all users.<br />
<br />
Users would receive an email similar to <code class="inline-code">https://community.mybb.com/login/1440a5cd-108b-4af9-8da1-c1c65360aee3</code> with which they may login for X amount of time before expiring.<br />
<br />
There is no code preview yet, so feel free to provide feedback or suggestions.<br />
<br />
This is part of a series of suggestions regarding account accessibility, security, data access, and external integration.<br />
<a href="https://community.mybb.com/thread-244837.html" target="_blank" rel="noopener" class="mycode_url">https://community.mybb.com/thread-244837.html</a><br />
<a href="https://community.mybb.com/thread-244835.html" target="_blank" rel="noopener" class="mycode_url">https://community.mybb.com/thread-244835.html</a>]]></description>
			<content:encoded><![CDATA[1.9 should implement a magic link password authentication feature.<br />
<br />
Administrators should be able to disable password auth and force magic link auth for all users.<br />
<br />
Users would receive an email similar to <code class="inline-code">https://community.mybb.com/login/1440a5cd-108b-4af9-8da1-c1c65360aee3</code> with which they may login for X amount of time before expiring.<br />
<br />
There is no code preview yet, so feel free to provide feedback or suggestions.<br />
<br />
This is part of a series of suggestions regarding account accessibility, security, data access, and external integration.<br />
<a href="https://community.mybb.com/thread-244837.html" target="_blank" rel="noopener" class="mycode_url">https://community.mybb.com/thread-244837.html</a><br />
<a href="https://community.mybb.com/thread-244835.html" target="_blank" rel="noopener" class="mycode_url">https://community.mybb.com/thread-244835.html</a>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[oAuth2 client authentication]]></title>
			<link>https://community.mybb.com/thread-244835.html</link>
			<pubDate>Sat, 31 Jan 2026 15:25:38 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://community.mybb.com/member.php?action=profile&uid=25096">Omar G.</a>]]></dc:creator>
			<guid isPermaLink="false">https://community.mybb.com/thread-244835.html</guid>
			<description><![CDATA[1.9 will implement oAuth2 client authentication by default. A list of pre-candidate default providers is:<ul class="mycode_list"><li>Discord<br />
</li>
<li>Drupal<br />
</li>
<li>Facebook<br />
</li>
<li>GitHub<br />
</li>
<li>Google<br />
</li>
<li>LinkedIn<br />
</li>
<li>Microsoft<br />
</li>
<li>PayPal<br />
</li>
<li>Shopify<br />
</li>
<li>WordPress<br />
</li>
</ul>
<br />
Additional providers would be possible to be added via plugins. For some WIP previews, check the PR below.<br />
<br />
If you have technical knowledge, feel free to review the logic and provide any feedback.<br />
<a href="https://github.com/mybb/mybb/pull/5273" target="_blank" rel="noopener" class="mycode_url">https://github.com/mybb/mybb/pull/5273</a><br />
<br />
This is part of a series of suggestions regarding account accessibility, security, data access, and external integration.<br />
<a href="https://community.mybb.com/thread-244836.html" target="_blank" rel="noopener" class="mycode_url">https://community.mybb.com/thread-244836.html</a><br />
<a href="https://community.mybb.com/thread-244837.html" target="_blank" rel="noopener" class="mycode_url">https://community.mybb.com/thread-244837.html</a>]]></description>
			<content:encoded><![CDATA[1.9 will implement oAuth2 client authentication by default. A list of pre-candidate default providers is:<ul class="mycode_list"><li>Discord<br />
</li>
<li>Drupal<br />
</li>
<li>Facebook<br />
</li>
<li>GitHub<br />
</li>
<li>Google<br />
</li>
<li>LinkedIn<br />
</li>
<li>Microsoft<br />
</li>
<li>PayPal<br />
</li>
<li>Shopify<br />
</li>
<li>WordPress<br />
</li>
</ul>
<br />
Additional providers would be possible to be added via plugins. For some WIP previews, check the PR below.<br />
<br />
If you have technical knowledge, feel free to review the logic and provide any feedback.<br />
<a href="https://github.com/mybb/mybb/pull/5273" target="_blank" rel="noopener" class="mycode_url">https://github.com/mybb/mybb/pull/5273</a><br />
<br />
This is part of a series of suggestions regarding account accessibility, security, data access, and external integration.<br />
<a href="https://community.mybb.com/thread-244836.html" target="_blank" rel="noopener" class="mycode_url">https://community.mybb.com/thread-244836.html</a><br />
<a href="https://community.mybb.com/thread-244837.html" target="_blank" rel="noopener" class="mycode_url">https://community.mybb.com/thread-244837.html</a>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Creating UI Plugins on MyBB 1.9.x]]></title>
			<link>https://community.mybb.com/thread-244673.html</link>
			<pubDate>Sat, 13 Dec 2025 14:15:16 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://community.mybb.com/member.php?action=profile&uid=47371">Devilshakerz</a>]]></dc:creator>
			<guid isPermaLink="false">https://community.mybb.com/thread-244673.html</guid>
			<description><![CDATA[As you know, MyBB 1.9 completely revamps the user interface (UI) system: themes are re-created with modern standards, while the plugin system remains largely intact.<br />
<br />
However, many plugins use theme features by adding extra pages and UI elements. <span style="font-weight: bold;" class="mycode_b">So what do UI plugins look like on MyBB 1.9?</span><br />
<br />
<blockquote class="mycode_quote"><cite>Matter-of-fact Developer Wrote:</cite>We add resources as files with JSON metadata in the plugin's view directory, render templates using Twig with local context, and use the new API for globally scoped data.</blockquote><br />
If you know <span style="font-style: italic;" class="mycode_i">some</span> of these words, join us in a more practical sneak peek — based on 1.9's maturing code — of how a plugin interacts with the new View system.<br />
<br />
<br />
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-size: x-large;" class="mycode_size">Creating a Plugin with UI for MyBB 1.9</span></div>
<br />
As an example, we'll build a simple plugin that displays an analog clock — a small one in the header, and a large one with extra details on a custom page.<br />
<br />
From the MyBB 1.9 feature set, we'll use:<br />
<a href="https://github.com/mybb/mybb/blob/dev-1.9/inc/src/View/ARCHITECTURE.md" target="_blank" rel="noopener" class="mycode_url"><img src="https://camo.mybb.com/aac73ebb1623518e700c274e64bde22448e41149/68747470733a2f2f646576696c7368616b65727a2e636f6d2f63646e2d7374617469632f666967757265732f6d7962622d766965772d353030782d7061646465642e706e67" data-original-url="https://devilshakerz.com/cdn-static/figures/mybb-view-500x-padded.png" loading="lazy"  width="200" height="122" alt="[Image: mybb-view-500x-padded.png]" style="float: right;" class="mycode_img" /></a><ul class="mycode_list"><li><span style="color: #e16336;" class="mycode_color">2x</span> custom <span style="font-weight: bold;" class="mycode_b">templates in modern Twig format</span>,<br />
</li>
<li><span style="color: #d54942;" class="mycode_color">1x</span> call to <span style="font-weight: bold;" class="mycode_b">render a template</span> for the full page in the plugin's PHP code,<br />
</li>
<li><span style="color: #c72a52;" class="mycode_color">2x</span> <span style="font-weight: bold;" class="mycode_b">local data</span> for the full page,<br />
</li>
<li><span style="color: #a41375;" class="mycode_color">1x</span> <span style="font-weight: bold;" class="mycode_b">inclusion of a template</span> from our plugin in a theme's header,<br />
</li>
<li><span style="color: #861992;" class="mycode_color">2x</span> <span style="font-weight: bold;" class="mycode_b">global data</span> using <code class="inline-code">set()</code> and <code class="inline-code">get()</code> for the small header clock, and<br />
</li>
<li><span style="color: #692eb8;" class="mycode_color">2x</span> custom <span style="font-weight: bold;" class="mycode_b">stylesheet files</span>, attached using the new <span style="font-weight: bold;" class="mycode_b">asset management system</span>.<br />
</li>
</ul>
<br />
You'll need:<br />
<a href="https://community.mybb.com/thread-241225.html" target="_blank" rel="noopener" class="mycode_url"><img src="https://camo.mybb.com/aa72313caf3e70e19ffe9ec4ff1ccaa44dcc85e4/68747470733a2f2f626c6f672e6d7962622e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031372f31302f6765742d737461727465642d77686974652e706e67" data-original-url="https://blog.mybb.com/wp-content/uploads/2017/10/get-started-white.png" loading="lazy"  alt="[Image: get-started-white.png]" style="float: right;" class="mycode_img" /></a><ul class="mycode_list"><li><span style="color: #aaaaaa;" class="mycode_color">1x</span> web server<br />
</li>
<li><span style="color: #aaaaaa;" class="mycode_color">1x</span> MyBB 1.9, installed (<a href="https://community.mybb.com/thread-241225.html" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">Quick Start guide</span></a>)<br />
</li>
<li><span style="color: #aaaaaa;" class="mycode_color">1x</span> basic experience with web technologies<br />
</li>
<li><span style="color: #aaaaaa;" class="mycode_color">1x</span> code editor<br />
</li>
</ul>
<br />
<br />
<ol type="1" class="mycode_list"><li><span style="font-size: large;" class="mycode_size">Setting up the Plugin</span><br />
<br />
First, we'll create the plugin's main PHP file, which MyBB looks for in the <code class="inline-code">inc/plugins/</code> directory. Let's name the plugin... <code class="inline-code">clock</code>.<br />
<br />
In <code class="inline-code">inc/plugins/clock.php</code>, we'll make some helper functions available, and include the usual <a href="https://docs.mybb.com/1.8/development/plugins/basics/#_info" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">*_info()</code> function</a>:<br />
<pre class="block-code line-numbers language-none"><code class="language-php">&lt;?php

use function MyBB\View\template;
use function MyBB\View\set;

function clock_info(): array
{
    return [
        'name'          =&gt; 'Clock Plugin',
        'codename'      =&gt; 'clock',
        'version'       =&gt; 'dev',
        'author'        =&gt; 'me',
        'compatibility' =&gt; '19*',
    ];
}
</code></pre><br />
When saved, the Admin CP's <span style="font-weight: bold;" class="mycode_b">Configuration → Plugins</span> page will detect our plugin, which we can already activate:<br />
<div style="text-align: center;" class="mycode_align"><img src="https://camo.mybb.com/6f16dc2dca5b3cf15d2667ae2f209a01ade1faca/68747470733a2f2f646576696c7368616b65727a2e636f6d2f63646e2d7374617469632f666967757265732f31392d75692d706c7567696e732d636c6f636b2d706c7567696e2d6163746976617465642e706e67" data-original-url="https://devilshakerz.com/cdn-static/figures/19-ui-plugins-clock-plugin-activated.png" loading="lazy"  alt="[Image: 19-ui-plugins-clock-plugin-activated.png]" class="mycode_img" /></div>
<br />
When active, MyBB will run the plugin's PHP code during forum visits.<br />
<br />
Most of our custom logic in our PHP file will be contained in functions, which will be run by MyBB at the right moment using <a href="https://docs.mybb.com/1.8/development/plugins/basics/#plugin-hooks" target="_blank" rel="noopener" class="mycode_url">plugin hooks</a>.<br />
<br />
<br />
</li>
<li><span style="font-size: large;" class="mycode_size">Adding a Custom Page</span><br />
<br />
Extra pages are easily added with a plugin hook. In <code class="inline-code">clock.php</code>, we'll check a URL parameter, and — if right — intercept the page, and return the desired response.<br />
<br />
MyBB outputs miscellaneous pages from the <code class="inline-code">misc.php</code> file — after <a href="https://github.com/mybb/mybb/blob/1b62403183aa27005e9838a746b013a491fbf082/misc.php#L21" target="_blank" rel="noopener" class="mycode_url">executing</a> a <code class="inline-code">misc_start</code> plugin hook. We'll instruct MyBB to run a custom function at that moment, which will check the URL:<br />
<pre class="block-code line-numbers language-none"><code class="language-php">$plugins-&gt;add_hook('misc_start', 'clock_misc_start');

function clock_misc_start(): void
{
    global $mybb;

    if ($mybb-&gt;get_input('action') === 'clock') {
        output_page('...'); // todo
    }
}
</code></pre><br />
Inside the <code class="inline-code">if</code> section, we'll perform the needed calculations, prepare variables, and output the page's full HTML.<br />
<br />
Instead of embedding HTML right there, we'll stick to best practices and use a <span style="font-style: italic;" class="mycode_i">template</span>.<br />
<br />
<br />
<br />
</li>
<li><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Using a Template</span></span><br />
<br />
<img src="https://camo.mybb.com/e3b79d0b44663160286a645483a87772e394b48f/68747470733a2f2f646576696c7368616b65727a2e636f6d2f63646e2d7374617469632f666967757265732f31392d75692d706c7567696e732d636c6f636b2d706c7567696e2d747265652d312e706e67" data-original-url="https://devilshakerz.com/cdn-static/figures/19-ui-plugins-clock-plugin-tree-1.png" loading="lazy"  width="191" height="190" alt="[Image: 19-ui-plugins-clock-plugin-tree-1.png]" style="float: left;" class="mycode_img" /><br />
MyBB 1.9 automatically handles UI-related files placed in <span style="font-weight: bold;" class="mycode_b">view directories</span>.<br />
For plugins, this means <code class="inline-code">view/</code> in their own directory.<br />
<br />
Therefore, we'll create a dedicated directory <code class="inline-code">inc/plugins/clock/</code> for the plugin.<br />
<br />
Inside it, we'll then have <code class="inline-code">view/</code>.<br />
<br />
In this simple structure, we'll create the first UI file: <code class="inline-code">templates/page.twig</code>.<br />
<br />
<br />
<br />
<span style="color: #4466ff;" class="mycode_color">★ <span style="font-style: italic;" class="mycode_i">New: In MyBB 1.9, templates, styles, scripts, and images for extensions are always saved as files. No custom code is needed to create, update, or remove these resources.</span></span><br />
<br />
<br />
In the page HTML, we'll add 3 elements: the analog clock, time, and date. The analog clock will have a dot in the middle and two hands, set according to their progress throughout the day and hour.<br />
<br />
We'll use variables of both kinds — which we'll make sure to set in PHP code later:<ul class="mycode_list"><li>local variables — with date information from PHP's <code class="inline-code">date()</code> function, and<br />
</li>
<li>global variables — populated with the relevant math for the clock hands.<br />
</li>
</ul>
<br />
In the <code class="inline-code">page.twig</code> template file, we'll use the built-in <a href="https://github.com/mybb/mybb/blob/dev-1.9/inc/themes/core.base/frontend/templates/layouts/master.twig" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">layouts/master.twig</code></a> template, and define the content for its <code class="inline-code">body</code> block:<br />
<pre class="block-code line-numbers language-none"><code class="language-twig">{% extends 'layouts/master.twig' %}

{% block body %}
    &lt;div class=&quot;clock-page&quot;&gt;
        &lt;div&gt;
            &lt;div class=&quot;clock-face&quot;&gt;
                &lt;div class=&quot;center&quot;&gt;&lt;/div&gt;
                &lt;div class=&quot;hand hour&quot; style=&quot;--progress: {{ get('halfDayProgress') }}&quot;&gt;&lt;/div&gt;
                &lt;div class=&quot;hand minute&quot; style=&quot;--progress: {{ get('hourProgress') }}&quot;&gt;&lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
        &lt;p&gt;{{ time }}&lt;/p&gt;
        &lt;p&gt;{{ date }}&lt;/p&gt;
    &lt;/div&gt;
{% endblock %}
</code></pre><br />
Note the use of <code class="inline-code">get()</code>, which accesses global variables we'll define later; and Twig's standard syntax for variables that we'll pass directly to the template.<br />
<br />
MyBB will assign our plugin its very own namespace <code class="inline-code">ext.clock</code>. This means its <code class="inline-code">view/</code> resources will be accessible in code references using <code class="inline-code">@ext.clock</code>, and our template — with <code class="inline-code">@ext.clock/page.twig</code>.<br />
<br />
<span style="color: #007755;" class="mycode_color">ℹ <span style="font-style: italic;" class="mycode_i">In resource locators, <code class="inline-code">@</code> indicates a namespace of UI resources. MyBB 1.9 places plugins' resources in separate namespaces with an <code class="inline-code">ext.</code>… extension prefix to prevent conflicts. Themes can override plugins' default UI files by placing resources in such namespaces, in addition to <a href="https://github.com/mybb/mybb/tree/dev-1.9/inc/themes/core.base" target="_blank" rel="noopener" class="mycode_url">default ones</a> like <code class="inline-code">@frontend</code>.</span></span><br />
<br />
<br />
<br />
With the template saved, we'll now <span style="font-weight: bold;" class="mycode_b">render it</span>, and <span style="font-weight: bold;" class="mycode_b">create local variables</span> with date information in our <code class="inline-code">clock.php</code> file:<br />
<pre class="block-code line-numbers language-none"><code class="language-php">        output_page(
            // Use a rendered template supplied with the Plugin...
            template(

                // ...found in the Plugin's own namespace (@ext.clock)...
                '@ext.clock/page.twig',

                // ...with local variables.
                [
                    'time' =&gt; date('H:i'),
                    'date' =&gt; date('Y-m-d'),
                ],
            )
        );
</code></pre><br />
The PHP function <code class="inline-code">template()</code> accepts the template locator, and optional data array. This data is available within the rendered template.<br />
<br />
<span style="color: #007755;" class="mycode_color">ℹ <span style="font-style: italic;" class="mycode_i">When using locators in <code class="inline-code">template()</code> or Twig code, the resource type <code class="inline-code">templates/</code> is implied and can be skipped.</span></span><br />
<br />
<span style="color: #cc33aa;" class="mycode_color">🡽 <span style="font-style: italic;" class="mycode_i">On MyBB 1.9, calling the <code class="inline-code">template()</code> function with an array is equivalent to defining local variables and using <code class="inline-code">eval(…)</code> and <code class="inline-code">$templates-&gt;get(…)</code> on MyBB 1.8.</span></span><br />
<br />
<br />
The rendered HTML will be used as a parameter for MyBB's <code class="inline-code">output_page()</code> function. If we visit the page <code class="inline-code">misc.php?action=clock</code>, we'll see the date and time.<br />
<br />
Now all we need is to display it better. We'll follow best practices and style the HTML with a separate stylesheet file.<br />
<br />
<br />
</li>
<li><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Adding a Local Stylesheet</span></span><br />
<br />
First, let's add basic styling for the custom page using an SCSS file saved in the plugin's view directory.<br />
<br />
In <code class="inline-code">view/styles/page.scss</code>, we'll write:<br />
<pre class="block-code line-numbers language-none"><code class="language-scss">.clock-page {
	display: flex;
	padding: 40px 0;
	width: 100%;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-around;
	font-size: 5vw;

	.clock-face {
		width: 100px;
	}
}
</code></pre><br />
<span style="color: #4466ff;" class="mycode_color">★ <span style="font-style: italic;" class="mycode_i">New: MyBB 1.9 automatically transpiles SCSS to CSS, and keeps the resulting files up to date.</span></span><br />
<br />
<br />
To make sure the styles are applied when loading the page, we'll add simple <span style="font-weight: bold;" class="mycode_b">JSON metadata to attach the stylesheet.</span><br />
<br />
In <code class="inline-code">view/assets.json</code>, we'll list our first asset:<br />
<pre class="block-code line-numbers language-none"><code class="language-json">{
	&quot;assets&quot;: {
		&quot;styles/page.css&quot;: {
			&quot;source&quot;: &quot;page.scss&quot;,
			&quot;attached_to&quot;: [
				{
					&quot;script&quot;: &quot;misc.php&quot;,
					&quot;actions&quot;: [&quot;clock&quot;]
				}
			]
		}
	}
}
</code></pre><br />
We've defined the asset using its final path, and specified the source to use, given that we've written a <code class="inline-code">.scss</code> file, rather than <code class="inline-code">.css</code>.<br />
<br />
With this definition, MyBB 1.9 will:<ul class="mycode_list"><li>generate the resulting <code class="inline-code">styles/pages.css</code> file using <code class="inline-code">page.scss</code> from our plugin's namespace, and<br />
</li>
<li>attach the file when visiting <code class="inline-code">misc.php</code> with the <span style="font-style: italic;" class="mycode_i">action</span> parameter matching our custom page.<br />
</li>
</ul>
<br />
<span style="color: #4466ff;" class="mycode_color">★ <span style="font-style: italic;" class="mycode_i">New: MyBB 1.9 automatically processes assets declared in <code class="inline-code">assets.json</code> files and API function calls.</span></span><br />
<br />
<br />
</li>
<li><span style="font-size: large;" class="mycode_size">Adding a Global Stylesheet</span><br />
<br />
Now, we'll focus on styling the clock face. Because we also want it displayed in the header, we'll make sure those are available on all forum pages.<br />
<br />
Let's create another stylesheet file, in which we'll set the base styles for all elements of the clock face.<br />
<br />
In <code class="inline-code">view/styles/global.scss</code>, we'll have:<br />
<pre class="block-code line-numbers language-none"><code class="language-scss">.clock-face {
	--color: black;

	position: relative;
	aspect-ratio: 1;

	border: solid 0.15em var(--color);
	border-radius: 50%;

	.center {
		position: absolute;
		left: 50%;
		top: 50%;

		width: 10%;
		aspect-ratio: 1;

		background-color: var(--color);
		border-radius: 50%;

		transform: translate(-50%, -50%);
	}

	.hand {
		--height: calc(1% * var(--thickness));

		position: absolute;
		left: 50%;
		top: calc(50% - var(--height) / 2);

		width: var(--length);
		height: var(--height);

		background: var(--color);
		border-radius: 4px;

		transform-origin: 0 center;
		transform: rotate(calc(360deg * var(--progress) - 90deg));

		&amp;.hour {
			--length: 20%;
			--thickness: 6;
		}
		&amp;.minute {
			--length: 40%;
			--thickness: 4;
		}
	}
}
</code></pre><br />
Similarly, in <code class="inline-code">view/assets.json</code>, we'll add another asset definition:<br />
<pre class="block-code line-numbers language-none"><code class="language-json">		&quot;styles/global.css&quot;: {
			&quot;source&quot;: &quot;global.scss&quot;,
			&quot;attached_to&quot;: [
				{
					&quot;script&quot;: &quot;global&quot;
				}
			]
		}
</code></pre><br />
The new file will be generated from <code class="inline-code">global.scss</code>, and attached globally.<br />
<br />
<br />
</li>
<li><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Using Global Variables</span></span><br />
<br />
To finish populating all necessary data, we'll go back to <code class="inline-code">clock.php</code>, and add a second plugin hook that will execute on all pages:<br />
<pre class="block-code line-numbers language-none"><code class="language-php">$plugins-&gt;add_hook('global_end', 'clock_global_end');

function clock_global_end(): void
{
    // Global variables.
    set([
        'halfDayProgress' =&gt; (
            (int)date('H') * 3600 +
            (int)date('i') * 60 +
            (int)date('s')
        ) / (86400 / 2),
        'hourProgress' =&gt; (
            (int)date('i') * 60 +
            (int)date('s')
        ) / 3600,
    ]);
}
</code></pre><br />
<span style="font-weight: bold;" class="mycode_b">Variables set using <code class="inline-code">set()</code> are available in all templates through <code class="inline-code">get()</code>.</span> This is particularly useful when we don't control the rendering of the target template, and can't pass data directly. This is also the case for custom templates included from built-in templates (like in the next step).<br />
<br />
<span style="color: #cc33aa;" class="mycode_color">🡽 <span style="font-style: italic;" class="mycode_i">MyBB 1.9's <code class="inline-code">set()</code> function is equivalent to MyBB 1.8's use of <code class="inline-code">global</code> PHP variables for use in various templates.</span></span><br />
<br />
<br />
Any Twig template rendered after this point can use <code class="inline-code">{{ get('halfDayProgress') }}</code> and <code class="inline-code">{{ get('hourProgress') }}</code>.<br />
<br />
We can now verify that our page renders as expected, with both local and global data populated.<br />
<div style="text-align: center;" class="mycode_align"><img src="https://camo.mybb.com/9ebfcc404f6b45ccd7146e533abb0a9c9bd93c3e/68747470733a2f2f646576696c7368616b65727a2e636f6d2f63646e2d7374617469632f666967757265732f31392d75692d706c7567696e732d636c6f636b2d706c7567696e2d706167652e706e67" data-original-url="https://devilshakerz.com/cdn-static/figures/19-ui-plugins-clock-plugin-page.png" loading="lazy"  alt="[Image: 19-ui-plugins-clock-plugin-page.png]" class="mycode_img" /></div>
<br />
<br />
</li>
<li><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Adding Global Elements</span></span><br />
<br />
Finally, we'll add a small header clock. The default Base Theme's header includes an <code class="inline-code">&lt;ul&gt;</code> element suitable for adding more content.<br />
<br />
Let's create a template for the clock icon — <code class="inline-code">view/templates/icon.twig</code>:<br />
<pre class="block-code line-numbers language-none"><code class="language-twig">&lt;li&gt;
    &lt;a href=&quot;misc.php?action=clock&quot; class=&quot;clock-icon&quot;&gt;
        &lt;div class=&quot;clock-face&quot;&gt;
            &lt;div class=&quot;center&quot;&gt;&lt;/div&gt;
            &lt;div class=&quot;hand hour&quot; style=&quot;--progress: {{ get('halfDayProgress') }}&quot;&gt;&lt;/div&gt;
            &lt;div class=&quot;hand minute&quot; style=&quot;--progress: {{ get('hourProgress') }}&quot;&gt;&lt;/div&gt;
        &lt;/div&gt;
    &lt;/a&gt;
&lt;/li&gt;
</code></pre><br />
This template will use the global variables, which we already set in the PHP file.<br />
<br />
<br />
<br />
To include it on all pages, we'll modify the Base Theme — namely, the <code class="inline-code">partials/header.twig</code> template in its <a href="https://github.com/mybb/mybb/tree/dev-1.9/inc/themes/core.base/frontend" target="_blank" rel="noopener" class="mycode_url"><span style="font-style: italic;" class="mycode_i">frontend</span> namespace</a>.<br />
<br />
<span style="color: #007755;" class="mycode_color">ℹ <span style="font-style: italic;" class="mycode_i">Namespace directories in themes look like view directories in plugins. Both contain UI resources for some namespace.</span></span><br />
<br />
In <code class="inline-code">inc/themes/core.base/frontend/templates/partials/header.twig</code>, we locate the <code class="inline-code">&lt;ul class=&quot;main-menu__links&quot;&gt;</code> tag, and add just before <a href="https://github.com/mybb/mybb/blob/25edd3ca6c2abbe8398804fad4e4c6114b405943/inc/themes/core.base/frontend/templates/partials/header.twig#L48" target="_blank" rel="noopener" class="mycode_url">its end <code class="inline-code">&lt;/ul&gt;</code></a>:<br />
<pre class="block-code line-numbers language-none"><code class="language-twig">{% include '@ext.clock/icon.twig' ignore missing %}</code></pre><br />
<span style="color: #4466ff;" class="mycode_color">★ <span style="font-style: italic;" class="mycode_i">New: Twig templates can be easily included from others, and may contain complex conditions. Learn more in <a href="https://twig.symfony.com/doc/3.x/templates.html" target="_blank" rel="noopener" class="mycode_url">Twig Docs</a>.</span></span><br />
<br />
<img src="https://camo.mybb.com/f7697020d6fece3e89b3f94d54abfabbeffbc499/68747470733a2f2f646576696c7368616b65727a2e636f6d2f63646e2d7374617469632f666967757265732f31392d75692d706c7567696e732d636c6f636b2d706c7567696e2d696e6465782e706e67" data-original-url="https://devilshakerz.com/cdn-static/figures/19-ui-plugins-clock-plugin-index.png" loading="lazy"  width="517" height="477" alt="[Image: 19-ui-plugins-clock-plugin-index.png]" style="float: right;" class="mycode_img" /><br />
<br />
Most of the styling we need is already included globally; now we only need styles for the <code class="inline-code">.clock-icon</code> class.<br />
<br />
In the last <code class="inline-code">global.scss</code> file, we'll append:<br />
<pre class="block-code line-numbers language-none"><code class="language-scss">.clock-icon {
	display: inline-block;
	padding: 20px;
	height: 30px;

	.clock-face {
		width: 30px;
		--color: #f2f2f2;
	}
}
</code></pre><br />
<br />
The icon will now be rendered across the forum, and point to our page.<br />
<br />
This means our plugin is complete.<br />
<br />
</li>
</ol>
<br />
<span style="font-style: italic;" class="mycode_i">Exercises<ul class="mycode_list"><li>Not enough color? Add season images to assets, and insert the right one using <a href="https://github.com/mybb/mybb/blob/dev-1.9/inc/src/View/ARCHITECTURE.md#api-functions" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">asset()</code> functions</a>.<br />
</li>
<li>Familiar with JavaScript? Enhance the plugin with a <code class="inline-code">view/scripts/global.js</code> file to update the clock in real time.<br />
</li>
</ul>
</span><br />
<br />
<span style="font-weight: bold;" class="mycode_b">All files created in this guide:</span><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://community.mybb.com/images/attachtypes/zip.gif" title="Zip File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=48532" target="_blank" title="">Clock Plugin.zip</a> (Size: 3.48 KB / Downloads: 82)
<!-- end: postbit_attachments_attachment --><br />
<br />
<br />
<br />
<img src="https://camo.mybb.com/fe8c37fa0156ef56432b9bb3d83169f77b5d4d4f/68747470733a2f2f646576696c7368616b65727a2e636f6d2f63646e2d7374617469632f666967757265732f31392d75692d706c7567696e732d636c6f636b2d706c7567696e2d747265652d322e706e67" data-original-url="https://devilshakerz.com/cdn-static/figures/19-ui-plugins-clock-plugin-tree-2.png" loading="lazy"  width="191" height="342" alt="[Image: 19-ui-plugins-clock-plugin-tree-2.png]" style="float: left;" class="mycode_img" /><span style="font-size: medium;" class="mycode_size">Theming</span><span style="font-size: small;" class="mycode_size"><br />
<br />
Resources from plugins are part of the inheritance hierarchy, and therefore can be overridden by themes. This allows administrators and theme authors to customize the default look of any plugin.<br />
<br />
For example, a theme file <code class="inline-code">@ext.clock/styles/global.scss</code> would be used instead of the content found in the <code class="inline-code">clock</code> plugin's <code class="inline-code">view/</code> directory. Similarly, asset properties may be added and modified in a theme's own version of the <code class="inline-code">@ext.clock/assets.json</code> file.<br />
<br />
To try out themes and inheritance, read a walk-through <a href="https://community.mybb.com/thread-241300.html" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">here</span></a>.<br />
<br />
</span><span style="font-size: medium;" class="mycode_size">Debugging</span><span style="font-size: small;" class="mycode_size"><br />
<br />
Examine how MyBB handles each of the files by following the <span style="font-style: italic;" class="mycode_i">[Advanced Details]</span> footer link.<br />
<br />
The debug page will show each file's generation and hierarchical resolution (through any overriding themes to the original plugin package), timing, which templates were rendered directly, and Twig's profiling details.</span><br />
<br />
<br />
<br />
<span style="font-size: large;" class="mycode_size">Extending the Foundation</span><br />
<br />
Even though changes in plugin handling and their code PHP are limited, those seeping in from the theme system give us a taste of simplifying the creation of extensions.<br />
<br />
MyBB's core takes over the responsibilities for the logistics of custom resources, accepts instructions in commonly used format, and exposes a well-defined and consistent API. Little to no code needs to be written for installation, upgrade, and removal, so you can immediately focus on implementing your next idea.<br />
<br />
Those, and similar principles of good developer experience will guide <a href="https://github.com/orgs/mybb/projects/3/views/3" target="_blank" rel="noopener" class="mycode_url">future iterations</a> of the extension system overhaul, and how MyBB will stay true to its principle of extensibility.<br class="clear" />]]></description>
			<content:encoded><![CDATA[As you know, MyBB 1.9 completely revamps the user interface (UI) system: themes are re-created with modern standards, while the plugin system remains largely intact.<br />
<br />
However, many plugins use theme features by adding extra pages and UI elements. <span style="font-weight: bold;" class="mycode_b">So what do UI plugins look like on MyBB 1.9?</span><br />
<br />
<blockquote class="mycode_quote"><cite>Matter-of-fact Developer Wrote:</cite>We add resources as files with JSON metadata in the plugin's view directory, render templates using Twig with local context, and use the new API for globally scoped data.</blockquote><br />
If you know <span style="font-style: italic;" class="mycode_i">some</span> of these words, join us in a more practical sneak peek — based on 1.9's maturing code — of how a plugin interacts with the new View system.<br />
<br />
<br />
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-size: x-large;" class="mycode_size">Creating a Plugin with UI for MyBB 1.9</span></div>
<br />
As an example, we'll build a simple plugin that displays an analog clock — a small one in the header, and a large one with extra details on a custom page.<br />
<br />
From the MyBB 1.9 feature set, we'll use:<br />
<a href="https://github.com/mybb/mybb/blob/dev-1.9/inc/src/View/ARCHITECTURE.md" target="_blank" rel="noopener" class="mycode_url"><img src="https://camo.mybb.com/aac73ebb1623518e700c274e64bde22448e41149/68747470733a2f2f646576696c7368616b65727a2e636f6d2f63646e2d7374617469632f666967757265732f6d7962622d766965772d353030782d7061646465642e706e67" data-original-url="https://devilshakerz.com/cdn-static/figures/mybb-view-500x-padded.png" loading="lazy"  width="200" height="122" alt="[Image: mybb-view-500x-padded.png]" style="float: right;" class="mycode_img" /></a><ul class="mycode_list"><li><span style="color: #e16336;" class="mycode_color">2x</span> custom <span style="font-weight: bold;" class="mycode_b">templates in modern Twig format</span>,<br />
</li>
<li><span style="color: #d54942;" class="mycode_color">1x</span> call to <span style="font-weight: bold;" class="mycode_b">render a template</span> for the full page in the plugin's PHP code,<br />
</li>
<li><span style="color: #c72a52;" class="mycode_color">2x</span> <span style="font-weight: bold;" class="mycode_b">local data</span> for the full page,<br />
</li>
<li><span style="color: #a41375;" class="mycode_color">1x</span> <span style="font-weight: bold;" class="mycode_b">inclusion of a template</span> from our plugin in a theme's header,<br />
</li>
<li><span style="color: #861992;" class="mycode_color">2x</span> <span style="font-weight: bold;" class="mycode_b">global data</span> using <code class="inline-code">set()</code> and <code class="inline-code">get()</code> for the small header clock, and<br />
</li>
<li><span style="color: #692eb8;" class="mycode_color">2x</span> custom <span style="font-weight: bold;" class="mycode_b">stylesheet files</span>, attached using the new <span style="font-weight: bold;" class="mycode_b">asset management system</span>.<br />
</li>
</ul>
<br />
You'll need:<br />
<a href="https://community.mybb.com/thread-241225.html" target="_blank" rel="noopener" class="mycode_url"><img src="https://camo.mybb.com/aa72313caf3e70e19ffe9ec4ff1ccaa44dcc85e4/68747470733a2f2f626c6f672e6d7962622e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031372f31302f6765742d737461727465642d77686974652e706e67" data-original-url="https://blog.mybb.com/wp-content/uploads/2017/10/get-started-white.png" loading="lazy"  alt="[Image: get-started-white.png]" style="float: right;" class="mycode_img" /></a><ul class="mycode_list"><li><span style="color: #aaaaaa;" class="mycode_color">1x</span> web server<br />
</li>
<li><span style="color: #aaaaaa;" class="mycode_color">1x</span> MyBB 1.9, installed (<a href="https://community.mybb.com/thread-241225.html" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">Quick Start guide</span></a>)<br />
</li>
<li><span style="color: #aaaaaa;" class="mycode_color">1x</span> basic experience with web technologies<br />
</li>
<li><span style="color: #aaaaaa;" class="mycode_color">1x</span> code editor<br />
</li>
</ul>
<br />
<br />
<ol type="1" class="mycode_list"><li><span style="font-size: large;" class="mycode_size">Setting up the Plugin</span><br />
<br />
First, we'll create the plugin's main PHP file, which MyBB looks for in the <code class="inline-code">inc/plugins/</code> directory. Let's name the plugin... <code class="inline-code">clock</code>.<br />
<br />
In <code class="inline-code">inc/plugins/clock.php</code>, we'll make some helper functions available, and include the usual <a href="https://docs.mybb.com/1.8/development/plugins/basics/#_info" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">*_info()</code> function</a>:<br />
<pre class="block-code line-numbers language-none"><code class="language-php">&lt;?php

use function MyBB\View\template;
use function MyBB\View\set;

function clock_info(): array
{
    return [
        'name'          =&gt; 'Clock Plugin',
        'codename'      =&gt; 'clock',
        'version'       =&gt; 'dev',
        'author'        =&gt; 'me',
        'compatibility' =&gt; '19*',
    ];
}
</code></pre><br />
When saved, the Admin CP's <span style="font-weight: bold;" class="mycode_b">Configuration → Plugins</span> page will detect our plugin, which we can already activate:<br />
<div style="text-align: center;" class="mycode_align"><img src="https://camo.mybb.com/6f16dc2dca5b3cf15d2667ae2f209a01ade1faca/68747470733a2f2f646576696c7368616b65727a2e636f6d2f63646e2d7374617469632f666967757265732f31392d75692d706c7567696e732d636c6f636b2d706c7567696e2d6163746976617465642e706e67" data-original-url="https://devilshakerz.com/cdn-static/figures/19-ui-plugins-clock-plugin-activated.png" loading="lazy"  alt="[Image: 19-ui-plugins-clock-plugin-activated.png]" class="mycode_img" /></div>
<br />
When active, MyBB will run the plugin's PHP code during forum visits.<br />
<br />
Most of our custom logic in our PHP file will be contained in functions, which will be run by MyBB at the right moment using <a href="https://docs.mybb.com/1.8/development/plugins/basics/#plugin-hooks" target="_blank" rel="noopener" class="mycode_url">plugin hooks</a>.<br />
<br />
<br />
</li>
<li><span style="font-size: large;" class="mycode_size">Adding a Custom Page</span><br />
<br />
Extra pages are easily added with a plugin hook. In <code class="inline-code">clock.php</code>, we'll check a URL parameter, and — if right — intercept the page, and return the desired response.<br />
<br />
MyBB outputs miscellaneous pages from the <code class="inline-code">misc.php</code> file — after <a href="https://github.com/mybb/mybb/blob/1b62403183aa27005e9838a746b013a491fbf082/misc.php#L21" target="_blank" rel="noopener" class="mycode_url">executing</a> a <code class="inline-code">misc_start</code> plugin hook. We'll instruct MyBB to run a custom function at that moment, which will check the URL:<br />
<pre class="block-code line-numbers language-none"><code class="language-php">$plugins-&gt;add_hook('misc_start', 'clock_misc_start');

function clock_misc_start(): void
{
    global $mybb;

    if ($mybb-&gt;get_input('action') === 'clock') {
        output_page('...'); // todo
    }
}
</code></pre><br />
Inside the <code class="inline-code">if</code> section, we'll perform the needed calculations, prepare variables, and output the page's full HTML.<br />
<br />
Instead of embedding HTML right there, we'll stick to best practices and use a <span style="font-style: italic;" class="mycode_i">template</span>.<br />
<br />
<br />
<br />
</li>
<li><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Using a Template</span></span><br />
<br />
<img src="https://camo.mybb.com/e3b79d0b44663160286a645483a87772e394b48f/68747470733a2f2f646576696c7368616b65727a2e636f6d2f63646e2d7374617469632f666967757265732f31392d75692d706c7567696e732d636c6f636b2d706c7567696e2d747265652d312e706e67" data-original-url="https://devilshakerz.com/cdn-static/figures/19-ui-plugins-clock-plugin-tree-1.png" loading="lazy"  width="191" height="190" alt="[Image: 19-ui-plugins-clock-plugin-tree-1.png]" style="float: left;" class="mycode_img" /><br />
MyBB 1.9 automatically handles UI-related files placed in <span style="font-weight: bold;" class="mycode_b">view directories</span>.<br />
For plugins, this means <code class="inline-code">view/</code> in their own directory.<br />
<br />
Therefore, we'll create a dedicated directory <code class="inline-code">inc/plugins/clock/</code> for the plugin.<br />
<br />
Inside it, we'll then have <code class="inline-code">view/</code>.<br />
<br />
In this simple structure, we'll create the first UI file: <code class="inline-code">templates/page.twig</code>.<br />
<br />
<br />
<br />
<span style="color: #4466ff;" class="mycode_color">★ <span style="font-style: italic;" class="mycode_i">New: In MyBB 1.9, templates, styles, scripts, and images for extensions are always saved as files. No custom code is needed to create, update, or remove these resources.</span></span><br />
<br />
<br />
In the page HTML, we'll add 3 elements: the analog clock, time, and date. The analog clock will have a dot in the middle and two hands, set according to their progress throughout the day and hour.<br />
<br />
We'll use variables of both kinds — which we'll make sure to set in PHP code later:<ul class="mycode_list"><li>local variables — with date information from PHP's <code class="inline-code">date()</code> function, and<br />
</li>
<li>global variables — populated with the relevant math for the clock hands.<br />
</li>
</ul>
<br />
In the <code class="inline-code">page.twig</code> template file, we'll use the built-in <a href="https://github.com/mybb/mybb/blob/dev-1.9/inc/themes/core.base/frontend/templates/layouts/master.twig" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">layouts/master.twig</code></a> template, and define the content for its <code class="inline-code">body</code> block:<br />
<pre class="block-code line-numbers language-none"><code class="language-twig">{% extends 'layouts/master.twig' %}

{% block body %}
    &lt;div class=&quot;clock-page&quot;&gt;
        &lt;div&gt;
            &lt;div class=&quot;clock-face&quot;&gt;
                &lt;div class=&quot;center&quot;&gt;&lt;/div&gt;
                &lt;div class=&quot;hand hour&quot; style=&quot;--progress: {{ get('halfDayProgress') }}&quot;&gt;&lt;/div&gt;
                &lt;div class=&quot;hand minute&quot; style=&quot;--progress: {{ get('hourProgress') }}&quot;&gt;&lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
        &lt;p&gt;{{ time }}&lt;/p&gt;
        &lt;p&gt;{{ date }}&lt;/p&gt;
    &lt;/div&gt;
{% endblock %}
</code></pre><br />
Note the use of <code class="inline-code">get()</code>, which accesses global variables we'll define later; and Twig's standard syntax for variables that we'll pass directly to the template.<br />
<br />
MyBB will assign our plugin its very own namespace <code class="inline-code">ext.clock</code>. This means its <code class="inline-code">view/</code> resources will be accessible in code references using <code class="inline-code">@ext.clock</code>, and our template — with <code class="inline-code">@ext.clock/page.twig</code>.<br />
<br />
<span style="color: #007755;" class="mycode_color">ℹ <span style="font-style: italic;" class="mycode_i">In resource locators, <code class="inline-code">@</code> indicates a namespace of UI resources. MyBB 1.9 places plugins' resources in separate namespaces with an <code class="inline-code">ext.</code>… extension prefix to prevent conflicts. Themes can override plugins' default UI files by placing resources in such namespaces, in addition to <a href="https://github.com/mybb/mybb/tree/dev-1.9/inc/themes/core.base" target="_blank" rel="noopener" class="mycode_url">default ones</a> like <code class="inline-code">@frontend</code>.</span></span><br />
<br />
<br />
<br />
With the template saved, we'll now <span style="font-weight: bold;" class="mycode_b">render it</span>, and <span style="font-weight: bold;" class="mycode_b">create local variables</span> with date information in our <code class="inline-code">clock.php</code> file:<br />
<pre class="block-code line-numbers language-none"><code class="language-php">        output_page(
            // Use a rendered template supplied with the Plugin...
            template(

                // ...found in the Plugin's own namespace (@ext.clock)...
                '@ext.clock/page.twig',

                // ...with local variables.
                [
                    'time' =&gt; date('H:i'),
                    'date' =&gt; date('Y-m-d'),
                ],
            )
        );
</code></pre><br />
The PHP function <code class="inline-code">template()</code> accepts the template locator, and optional data array. This data is available within the rendered template.<br />
<br />
<span style="color: #007755;" class="mycode_color">ℹ <span style="font-style: italic;" class="mycode_i">When using locators in <code class="inline-code">template()</code> or Twig code, the resource type <code class="inline-code">templates/</code> is implied and can be skipped.</span></span><br />
<br />
<span style="color: #cc33aa;" class="mycode_color">🡽 <span style="font-style: italic;" class="mycode_i">On MyBB 1.9, calling the <code class="inline-code">template()</code> function with an array is equivalent to defining local variables and using <code class="inline-code">eval(…)</code> and <code class="inline-code">$templates-&gt;get(…)</code> on MyBB 1.8.</span></span><br />
<br />
<br />
The rendered HTML will be used as a parameter for MyBB's <code class="inline-code">output_page()</code> function. If we visit the page <code class="inline-code">misc.php?action=clock</code>, we'll see the date and time.<br />
<br />
Now all we need is to display it better. We'll follow best practices and style the HTML with a separate stylesheet file.<br />
<br />
<br />
</li>
<li><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Adding a Local Stylesheet</span></span><br />
<br />
First, let's add basic styling for the custom page using an SCSS file saved in the plugin's view directory.<br />
<br />
In <code class="inline-code">view/styles/page.scss</code>, we'll write:<br />
<pre class="block-code line-numbers language-none"><code class="language-scss">.clock-page {
	display: flex;
	padding: 40px 0;
	width: 100%;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-around;
	font-size: 5vw;

	.clock-face {
		width: 100px;
	}
}
</code></pre><br />
<span style="color: #4466ff;" class="mycode_color">★ <span style="font-style: italic;" class="mycode_i">New: MyBB 1.9 automatically transpiles SCSS to CSS, and keeps the resulting files up to date.</span></span><br />
<br />
<br />
To make sure the styles are applied when loading the page, we'll add simple <span style="font-weight: bold;" class="mycode_b">JSON metadata to attach the stylesheet.</span><br />
<br />
In <code class="inline-code">view/assets.json</code>, we'll list our first asset:<br />
<pre class="block-code line-numbers language-none"><code class="language-json">{
	&quot;assets&quot;: {
		&quot;styles/page.css&quot;: {
			&quot;source&quot;: &quot;page.scss&quot;,
			&quot;attached_to&quot;: [
				{
					&quot;script&quot;: &quot;misc.php&quot;,
					&quot;actions&quot;: [&quot;clock&quot;]
				}
			]
		}
	}
}
</code></pre><br />
We've defined the asset using its final path, and specified the source to use, given that we've written a <code class="inline-code">.scss</code> file, rather than <code class="inline-code">.css</code>.<br />
<br />
With this definition, MyBB 1.9 will:<ul class="mycode_list"><li>generate the resulting <code class="inline-code">styles/pages.css</code> file using <code class="inline-code">page.scss</code> from our plugin's namespace, and<br />
</li>
<li>attach the file when visiting <code class="inline-code">misc.php</code> with the <span style="font-style: italic;" class="mycode_i">action</span> parameter matching our custom page.<br />
</li>
</ul>
<br />
<span style="color: #4466ff;" class="mycode_color">★ <span style="font-style: italic;" class="mycode_i">New: MyBB 1.9 automatically processes assets declared in <code class="inline-code">assets.json</code> files and API function calls.</span></span><br />
<br />
<br />
</li>
<li><span style="font-size: large;" class="mycode_size">Adding a Global Stylesheet</span><br />
<br />
Now, we'll focus on styling the clock face. Because we also want it displayed in the header, we'll make sure those are available on all forum pages.<br />
<br />
Let's create another stylesheet file, in which we'll set the base styles for all elements of the clock face.<br />
<br />
In <code class="inline-code">view/styles/global.scss</code>, we'll have:<br />
<pre class="block-code line-numbers language-none"><code class="language-scss">.clock-face {
	--color: black;

	position: relative;
	aspect-ratio: 1;

	border: solid 0.15em var(--color);
	border-radius: 50%;

	.center {
		position: absolute;
		left: 50%;
		top: 50%;

		width: 10%;
		aspect-ratio: 1;

		background-color: var(--color);
		border-radius: 50%;

		transform: translate(-50%, -50%);
	}

	.hand {
		--height: calc(1% * var(--thickness));

		position: absolute;
		left: 50%;
		top: calc(50% - var(--height) / 2);

		width: var(--length);
		height: var(--height);

		background: var(--color);
		border-radius: 4px;

		transform-origin: 0 center;
		transform: rotate(calc(360deg * var(--progress) - 90deg));

		&amp;.hour {
			--length: 20%;
			--thickness: 6;
		}
		&amp;.minute {
			--length: 40%;
			--thickness: 4;
		}
	}
}
</code></pre><br />
Similarly, in <code class="inline-code">view/assets.json</code>, we'll add another asset definition:<br />
<pre class="block-code line-numbers language-none"><code class="language-json">		&quot;styles/global.css&quot;: {
			&quot;source&quot;: &quot;global.scss&quot;,
			&quot;attached_to&quot;: [
				{
					&quot;script&quot;: &quot;global&quot;
				}
			]
		}
</code></pre><br />
The new file will be generated from <code class="inline-code">global.scss</code>, and attached globally.<br />
<br />
<br />
</li>
<li><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Using Global Variables</span></span><br />
<br />
To finish populating all necessary data, we'll go back to <code class="inline-code">clock.php</code>, and add a second plugin hook that will execute on all pages:<br />
<pre class="block-code line-numbers language-none"><code class="language-php">$plugins-&gt;add_hook('global_end', 'clock_global_end');

function clock_global_end(): void
{
    // Global variables.
    set([
        'halfDayProgress' =&gt; (
            (int)date('H') * 3600 +
            (int)date('i') * 60 +
            (int)date('s')
        ) / (86400 / 2),
        'hourProgress' =&gt; (
            (int)date('i') * 60 +
            (int)date('s')
        ) / 3600,
    ]);
}
</code></pre><br />
<span style="font-weight: bold;" class="mycode_b">Variables set using <code class="inline-code">set()</code> are available in all templates through <code class="inline-code">get()</code>.</span> This is particularly useful when we don't control the rendering of the target template, and can't pass data directly. This is also the case for custom templates included from built-in templates (like in the next step).<br />
<br />
<span style="color: #cc33aa;" class="mycode_color">🡽 <span style="font-style: italic;" class="mycode_i">MyBB 1.9's <code class="inline-code">set()</code> function is equivalent to MyBB 1.8's use of <code class="inline-code">global</code> PHP variables for use in various templates.</span></span><br />
<br />
<br />
Any Twig template rendered after this point can use <code class="inline-code">{{ get('halfDayProgress') }}</code> and <code class="inline-code">{{ get('hourProgress') }}</code>.<br />
<br />
We can now verify that our page renders as expected, with both local and global data populated.<br />
<div style="text-align: center;" class="mycode_align"><img src="https://camo.mybb.com/9ebfcc404f6b45ccd7146e533abb0a9c9bd93c3e/68747470733a2f2f646576696c7368616b65727a2e636f6d2f63646e2d7374617469632f666967757265732f31392d75692d706c7567696e732d636c6f636b2d706c7567696e2d706167652e706e67" data-original-url="https://devilshakerz.com/cdn-static/figures/19-ui-plugins-clock-plugin-page.png" loading="lazy"  alt="[Image: 19-ui-plugins-clock-plugin-page.png]" class="mycode_img" /></div>
<br />
<br />
</li>
<li><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Adding Global Elements</span></span><br />
<br />
Finally, we'll add a small header clock. The default Base Theme's header includes an <code class="inline-code">&lt;ul&gt;</code> element suitable for adding more content.<br />
<br />
Let's create a template for the clock icon — <code class="inline-code">view/templates/icon.twig</code>:<br />
<pre class="block-code line-numbers language-none"><code class="language-twig">&lt;li&gt;
    &lt;a href=&quot;misc.php?action=clock&quot; class=&quot;clock-icon&quot;&gt;
        &lt;div class=&quot;clock-face&quot;&gt;
            &lt;div class=&quot;center&quot;&gt;&lt;/div&gt;
            &lt;div class=&quot;hand hour&quot; style=&quot;--progress: {{ get('halfDayProgress') }}&quot;&gt;&lt;/div&gt;
            &lt;div class=&quot;hand minute&quot; style=&quot;--progress: {{ get('hourProgress') }}&quot;&gt;&lt;/div&gt;
        &lt;/div&gt;
    &lt;/a&gt;
&lt;/li&gt;
</code></pre><br />
This template will use the global variables, which we already set in the PHP file.<br />
<br />
<br />
<br />
To include it on all pages, we'll modify the Base Theme — namely, the <code class="inline-code">partials/header.twig</code> template in its <a href="https://github.com/mybb/mybb/tree/dev-1.9/inc/themes/core.base/frontend" target="_blank" rel="noopener" class="mycode_url"><span style="font-style: italic;" class="mycode_i">frontend</span> namespace</a>.<br />
<br />
<span style="color: #007755;" class="mycode_color">ℹ <span style="font-style: italic;" class="mycode_i">Namespace directories in themes look like view directories in plugins. Both contain UI resources for some namespace.</span></span><br />
<br />
In <code class="inline-code">inc/themes/core.base/frontend/templates/partials/header.twig</code>, we locate the <code class="inline-code">&lt;ul class=&quot;main-menu__links&quot;&gt;</code> tag, and add just before <a href="https://github.com/mybb/mybb/blob/25edd3ca6c2abbe8398804fad4e4c6114b405943/inc/themes/core.base/frontend/templates/partials/header.twig#L48" target="_blank" rel="noopener" class="mycode_url">its end <code class="inline-code">&lt;/ul&gt;</code></a>:<br />
<pre class="block-code line-numbers language-none"><code class="language-twig">{% include '@ext.clock/icon.twig' ignore missing %}</code></pre><br />
<span style="color: #4466ff;" class="mycode_color">★ <span style="font-style: italic;" class="mycode_i">New: Twig templates can be easily included from others, and may contain complex conditions. Learn more in <a href="https://twig.symfony.com/doc/3.x/templates.html" target="_blank" rel="noopener" class="mycode_url">Twig Docs</a>.</span></span><br />
<br />
<img src="https://camo.mybb.com/f7697020d6fece3e89b3f94d54abfabbeffbc499/68747470733a2f2f646576696c7368616b65727a2e636f6d2f63646e2d7374617469632f666967757265732f31392d75692d706c7567696e732d636c6f636b2d706c7567696e2d696e6465782e706e67" data-original-url="https://devilshakerz.com/cdn-static/figures/19-ui-plugins-clock-plugin-index.png" loading="lazy"  width="517" height="477" alt="[Image: 19-ui-plugins-clock-plugin-index.png]" style="float: right;" class="mycode_img" /><br />
<br />
Most of the styling we need is already included globally; now we only need styles for the <code class="inline-code">.clock-icon</code> class.<br />
<br />
In the last <code class="inline-code">global.scss</code> file, we'll append:<br />
<pre class="block-code line-numbers language-none"><code class="language-scss">.clock-icon {
	display: inline-block;
	padding: 20px;
	height: 30px;

	.clock-face {
		width: 30px;
		--color: #f2f2f2;
	}
}
</code></pre><br />
<br />
The icon will now be rendered across the forum, and point to our page.<br />
<br />
This means our plugin is complete.<br />
<br />
</li>
</ol>
<br />
<span style="font-style: italic;" class="mycode_i">Exercises<ul class="mycode_list"><li>Not enough color? Add season images to assets, and insert the right one using <a href="https://github.com/mybb/mybb/blob/dev-1.9/inc/src/View/ARCHITECTURE.md#api-functions" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">asset()</code> functions</a>.<br />
</li>
<li>Familiar with JavaScript? Enhance the plugin with a <code class="inline-code">view/scripts/global.js</code> file to update the clock in real time.<br />
</li>
</ul>
</span><br />
<br />
<span style="font-weight: bold;" class="mycode_b">All files created in this guide:</span><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://community.mybb.com/images/attachtypes/zip.gif" title="Zip File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=48532" target="_blank" title="">Clock Plugin.zip</a> (Size: 3.48 KB / Downloads: 82)
<!-- end: postbit_attachments_attachment --><br />
<br />
<br />
<br />
<img src="https://camo.mybb.com/fe8c37fa0156ef56432b9bb3d83169f77b5d4d4f/68747470733a2f2f646576696c7368616b65727a2e636f6d2f63646e2d7374617469632f666967757265732f31392d75692d706c7567696e732d636c6f636b2d706c7567696e2d747265652d322e706e67" data-original-url="https://devilshakerz.com/cdn-static/figures/19-ui-plugins-clock-plugin-tree-2.png" loading="lazy"  width="191" height="342" alt="[Image: 19-ui-plugins-clock-plugin-tree-2.png]" style="float: left;" class="mycode_img" /><span style="font-size: medium;" class="mycode_size">Theming</span><span style="font-size: small;" class="mycode_size"><br />
<br />
Resources from plugins are part of the inheritance hierarchy, and therefore can be overridden by themes. This allows administrators and theme authors to customize the default look of any plugin.<br />
<br />
For example, a theme file <code class="inline-code">@ext.clock/styles/global.scss</code> would be used instead of the content found in the <code class="inline-code">clock</code> plugin's <code class="inline-code">view/</code> directory. Similarly, asset properties may be added and modified in a theme's own version of the <code class="inline-code">@ext.clock/assets.json</code> file.<br />
<br />
To try out themes and inheritance, read a walk-through <a href="https://community.mybb.com/thread-241300.html" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">here</span></a>.<br />
<br />
</span><span style="font-size: medium;" class="mycode_size">Debugging</span><span style="font-size: small;" class="mycode_size"><br />
<br />
Examine how MyBB handles each of the files by following the <span style="font-style: italic;" class="mycode_i">[Advanced Details]</span> footer link.<br />
<br />
The debug page will show each file's generation and hierarchical resolution (through any overriding themes to the original plugin package), timing, which templates were rendered directly, and Twig's profiling details.</span><br />
<br />
<br />
<br />
<span style="font-size: large;" class="mycode_size">Extending the Foundation</span><br />
<br />
Even though changes in plugin handling and their code PHP are limited, those seeping in from the theme system give us a taste of simplifying the creation of extensions.<br />
<br />
MyBB's core takes over the responsibilities for the logistics of custom resources, accepts instructions in commonly used format, and exposes a well-defined and consistent API. Little to no code needs to be written for installation, upgrade, and removal, so you can immediately focus on implementing your next idea.<br />
<br />
Those, and similar principles of good developer experience will guide <a href="https://github.com/orgs/mybb/projects/3/views/3" target="_blank" rel="noopener" class="mycode_url">future iterations</a> of the extension system overhaul, and how MyBB will stay true to its principle of extensibility.<br class="clear" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Icons system]]></title>
			<link>https://community.mybb.com/thread-243415.html</link>
			<pubDate>Sat, 17 May 2025 17:00:05 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://community.mybb.com/member.php?action=profile&uid=47371">Devilshakerz</a>]]></dc:creator>
			<guid isPermaLink="false">https://community.mybb.com/thread-243415.html</guid>
			<description><![CDATA[While <a href="https://github.com/mybb/mybb/issues/4839" target="_blank" rel="noopener" class="mycode_url">cleaning up</a> assets, we're taking a closer look at the icons system: <span style="font-weight: bold;" class="mycode_b"><a href="https://github.com/mybb/mybb/issues/4932" target="_blank" rel="noopener" class="mycode_url">https://github.com/mybb/mybb/issues/4932</a></span><br />
<br />
MyBB 1.9 currently uses FontAwesome, as planned earlier (<a href="https://community.mybb.com/thread-195763.html" target="_blank" rel="noopener" class="mycode_url">https://community.mybb.com/thread-195763.html</a>) - in the form of an icon font, and usually included in templates in a way similar to:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-twig">{{ include('partials/icon.twig', {icon: 'user'}) }}
</code></pre><br />
Feel free to share your opinion about your preferred icon packages, formats, usage, and other points raised in the Issue.]]></description>
			<content:encoded><![CDATA[While <a href="https://github.com/mybb/mybb/issues/4839" target="_blank" rel="noopener" class="mycode_url">cleaning up</a> assets, we're taking a closer look at the icons system: <span style="font-weight: bold;" class="mycode_b"><a href="https://github.com/mybb/mybb/issues/4932" target="_blank" rel="noopener" class="mycode_url">https://github.com/mybb/mybb/issues/4932</a></span><br />
<br />
MyBB 1.9 currently uses FontAwesome, as planned earlier (<a href="https://community.mybb.com/thread-195763.html" target="_blank" rel="noopener" class="mycode_url">https://community.mybb.com/thread-195763.html</a>) - in the form of an icon font, and usually included in templates in a way similar to:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-twig">{{ include('partials/icon.twig', {icon: 'user'}) }}
</code></pre><br />
Feel free to share your opinion about your preferred icon packages, formats, usage, and other points raised in the Issue.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Experimenting with Inheritance Basics]]></title>
			<link>https://community.mybb.com/thread-241300.html</link>
			<pubDate>Fri, 28 Jun 2024 17:11:25 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://community.mybb.com/member.php?action=profile&uid=47371">Devilshakerz</a>]]></dc:creator>
			<guid isPermaLink="false">https://community.mybb.com/thread-241300.html</guid>
			<description><![CDATA[MyBB 1.9, in addition to a new default look, brings a major expansion of the underlying engine for a greater ease of styling and customization. In this thread, we'll demystify the overhauled system and walk through a few basics of Theme inheritance using a real-world example.<br />
<br />
<br />
<a href="https://community.mybb.com/thread-241225.html" target="_blank" rel="noopener" class="mycode_url"><img src="https://camo.mybb.com/aa72313caf3e70e19ffe9ec4ff1ccaa44dcc85e4/68747470733a2f2f626c6f672e6d7962622e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031372f31302f6765742d737461727465642d77686974652e706e67" data-original-url="https://blog.mybb.com/wp-content/uploads/2017/10/get-started-white.png" loading="lazy"  alt="[Image: get-started-white.png]" style="float: right;" class="mycode_img" /></a><span style="font-size: x-small;" class="mycode_size"><br />
</span>To follow along, prepare a MyBB 1.9 installation using the <a href="https://community.mybb.com/thread-241225.html" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">Quick Start guide</span></a>.<br />
<br />
<br />
<br />
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-size: x-large;" class="mycode_size">Experimenting with Inheritance Basics</span></div>
<br />
To test the new system, we'll create two new, separate Themes to apply a few changes to the Base Theme's stylesheets. We'll use one child Theme to force dark mode, another Theme to change the primary color, and combine the effects with inheritance declarations.<br />
<br />
<ol type="1" class="mycode_list"><li><span style="font-size: large;" class="mycode_size">Setting Up Child Themes</span><br />
<br />
To prepare two new Theme Packages, we'll go to <code class="inline-code">inc/themes/</code> and create two more directories there, named according to their codename:<br />
<br />
<ul class="mycode_list"><li><span style="font-size: large;" class="mycode_size"><code class="inline-code">test-dark</code></span><br />
<br />
In this Package, we'll overwrite one file with minor adjustments, and attach the currently-unused <a href="https://github.com/mybb/mybb/blob/3e849f2cd425aa5759197d1f9f58e39a1a86613c/inc/themes/core.base/frontend/styles/dark.scss" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">styles/dark.scss</code></a> stylesheet.<br />
<br />
Specifically, we'll want to modify <code class="inline-code">frontend/styles/base/_dark.scss</code>. To overwrite the file using inheritance, we simply add it at the same path as in the Base Theme in the new Package's directory. Then, we can make our edits — adding a <a href="https://sass-lang.com/documentation/variables/#default-values" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">!default</code> Sass flag</a> to the variable to prevent the primary color from being overwritten by the dark mode scheme:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-scss">$primary-color: #005084 !default;
</code></pre><br />
With our second objective being to attach the file that activates the dark mode (<code class="inline-code">$dark: true;</code>), we declare it in the Theme's own <code class="inline-code">frontend/assets.json</code> file (equivalent to the same <a href="https://github.com/mybb/mybb/blob/3e849f2cd425aa5759197d1f9f58e39a1a86613c/inc/themes/core.base/frontend/assets.json" target="_blank" rel="noopener" class="mycode_url">file in the Base Theme</a>):<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-json">{
	&quot;assets&quot;: {
		&quot;styles/dark.css&quot;: {
			&quot;source&quot;: &quot;dark.scss&quot;,
			&quot;attached_to&quot;: [
				{
					&quot;script&quot;: &quot;global&quot;
				}
			],
			&quot;depends_on&quot;: [
				&quot;styles/main.css&quot;
			]
		}
	}
}
</code></pre>This will result in <code class="inline-code">dark.css</code> being attached to all pages, after <code class="inline-code">main.css</code>.<br />
<br />
Finally, we also add a basic <code class="inline-code">extension.json</code> file in the Package's main directory to declare inheritance from the Base Theme (codenamed <code class="inline-code">core.base</code>):<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-json">{
	&quot;extra&quot;: {
		&quot;inherits&quot;: [
			&quot;core.base&quot;
		]
	}
}
</code></pre><br />
You may note that certain data in manifest files — like inheritance information — is contained in the <code class="inline-code">extra</code> field. This makes it possible to keep them forward-compatible with Composer's schema, and eventually installable using the same way as MyBB's core dependencies.<br />
<br />
<br />
</li>
<li><span style="font-size: large;" class="mycode_size"><code class="inline-code">test-green</code></span><br />
<br />
In this Package, we'll change the primary color of the Theme. As 1.9's Base Theme uses variables for colors and other values, we'll only need to modify a single declaration.<br />
<br />
We copy the original <code class="inline-code">styles/base/_colors.scss</code> stylesheet within the <code class="inline-code">frontend</code> namespace, and edit chosen variables:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-scss">$primary-color: green;
</code></pre><br />
Similarly, we declare the desired inheritance in the second Theme's file — this time making it inherit from the <code class="inline-code">test-dark</code> Theme:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-json">{
	&quot;extra&quot;: {
		&quot;inherits&quot;: [
			&quot;test-dark&quot;
		]
	}
}
</code></pre></li>
</ul>
<br />
<br />
The resulting <code class="inline-code">inc/themes/</code> directory, containing all source Packages, should now look like this:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-none">inc/
└── themes/
    ├── core.base/
    │   └── ...
    ├── test-dark/
    │   ├── frontend/
    │   │   ├── styles/
    │   │   │   └── base/
    │   │   │       └── _dark.scss
    │   │   └── assets.json
    │   └── extension.json
    └── test-green/
        ├── frontend/
        │   └── styles/
        │       └── base/
        │           └── _colors.scss
        └── extension.json
</code></pre><br />
<div style="text-align: right;" class="mycode_align">
All <code class="inline-code">inc/themes/</code> files created in this guide: <!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://community.mybb.com/images/attachtypes/zip.gif" title="Zip File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=47025" target="_blank" title="">test-themes.zip</a> (Size: 3.34 KB / Downloads: 188)
<!-- end: postbit_attachments_attachment --><br />
</div>
<br />
</li>
<li><span style="font-size: large;" class="mycode_size">Using a Selected Theme Package</span><br />
<br />
Finally, we overwrite the <a href="https://github.com/mybb/mybb/blob/3e849f2cd425aa5759197d1f9f58e39a1a86613c/global.php#L470" target="_blank" rel="noopener" class="mycode_url">currently-hardcoded Theme codename in <code class="inline-code">global.php</code></a>:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-php">$packageName = 'test-green';
</code></pre><br />
This reference will eventually be managed in a similar way as in the past: taking into account settings and preferences for the default, user-, and forum-specific Themes.<br />
<br />
<br />
</li>
<li><span style="font-size: large;" class="mycode_size">Observing Results</span><br />
<br />
On the first run, <a href="https://github.com/mybb/mybb/blob/dev-1.9/inc/src/View/ARCHITECTURE.md#performance" target="_blank" rel="noopener" class="mycode_url">various data layers</a> will be warmed up, with the new CSS files being generated and published at the end, ready to be included in the HTTP response.<br />
<div style="text-align: center;" class="mycode_align"><img src="https://camo.mybb.com/54f1fcf974be522384a466baa8666f99b9391d62/68747470733a2f2f646576696c7368616b65727a2e636f6d2f63646e2d7374617469632f666967757265732f31392d746573742d6461726b2d677265656e2d6672616d652e706e67" data-original-url="https://devilshakerz.com/cdn-static/figures/19-test-dark-green-frame.png" loading="lazy"  alt="[Image: 19-test-dark-green-frame.png]" class="mycode_img" /></div>
<br />
In the page source, we can see that our definitions result in the correct order, and local files are accompanied by a timestamp that helps avoid stale cache issues:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-html">&lt;link rel=&quot;stylesheet&quot; href=&quot;https://localhost/cache/viewlets/test-green/frontend/main.css?t=1718649384&quot;&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;https://localhost/cache/viewlets/test-green/frontend/dark.css?t=1718649385&quot;&gt;
</code></pre><br />
Notably, compared to MyBB ≤ 1.8, all Assets are published in relation to the requested Theme, and don't reveal the internal hierarchy that's been set up.<br />
<br />
<br />
</li>
<li><span style="font-size: large;" class="mycode_size">Peeking Under the Hood</span><br />
<br />
If you happen to use the debug mode (<code class="inline-code">?debug=1</code>) when the Theme is generated, you'll be able to see measurements related to generating i.a. the hierarchical resolution cache, and Asset compilation.<br />
<div style="text-align: center;" class="mycode_align"><img src="https://camo.mybb.com/060572d0980974331f13e6c15d0fb8b41af28aec/68747470733a2f2f646576696c7368616b65727a2e636f6d2f63646e2d7374617469632f666967757265732f31392d746573742d6461726b2d677265656e2d64656275672d6672616d652e706e67" data-original-url="https://devilshakerz.com/cdn-static/figures/19-test-dark-green-debug-frame.png" loading="lazy"  alt="[Image: 19-test-dark-green-debug-frame.png]" class="mycode_img" /></div>
<br />
To take a better look at what's happening internally, head to the <code class="inline-code">inc/cache/viewlets/</code> directory, which contains published Assets and cache stored in a human-readable JSON format.<br />
<br />
Currently, the following structure will be created with data for the <code class="inline-code">test-green</code> Theme:<br />
<br />
<ul class="mycode_list"><li>the final <code class="inline-code">frontend/main.css</code> and <code class="inline-code">frontend/dark.css</code> files generated by the SCSS compiler,<br />
</li>
</ul>
<br />
accompanied by internal files:<br />
<br />
<ul class="mycode_list"><li><code class="inline-code">hierarchy.ancestors.json</code>, storing the <span style="font-weight: bold;" class="mycode_b">determined hierarchy</span> — from closest to furthest ancestor.<br />
<br />
As expected, the final Theme inherits from two other themes, in the following order:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-json">    &quot;value&quot;: [
        &quot;test-dark&quot;,
        &quot;core.base&quot;
    ]
</code></pre><br />
As changes to manifest files may result in differing hierarchy, the files are "stamped" to re-generate the structure when modifications are made.<br />
<br />
<br />
</li>
<li><code class="inline-code">hierarchy.resolution.resources.json</code>, the <span style="font-weight: bold;" class="mycode_b">inheritance resolution cache</span> — a structure mapping Resources to correct <span style="font-style: italic;" class="mycode_i">Viewlets</span> (which may also belong to Plugins), in each namespace.<br />
<br />
In our case, this is a result of the ancestry declared in manifest files, and each Resource file's existence in queried Themes, where descendant Themes have higher priority.<br />
<br />
Conveniently, the modified files top the alphabetically-sorted list, and appear to resolve to the respective Theme Packages in which they were modified:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-json">{
    &quot;frontend&quot;: {
        &quot;stamp&quot;: {
            &quot;test-green&quot;: null,
            &quot;test-dark&quot;: null,
            &quot;core.base&quot;: null
        },
        &quot;value&quot;: {
            &quot;styles\/base\/_colors.scss&quot;: &quot;test-green&quot;,
            &quot;styles\/base\/_dark.scss&quot;: &quot;test-dark&quot;,
            &quot;styles\/base\/_module.scss&quot;: &quot;core.base&quot;,
            &quot;styles\/base\/_settings.scss&quot;: &quot;core.base&quot;,
            &quot;styles\/base\/_typography.scss&quot;: &quot;core.base&quot;,
</code></pre><br />
In this data layer, the "stamped" sources are files called <code class="inline-code">resources.json</code> — containing Resource definitions — given that inheritance may also be modified there (but in this example, the installation doesn't include any).<br />
<br />
<br />
</li>
<li><code class="inline-code">hierarchy.properties.assets.json</code>, the <span style="font-weight: bold;" class="mycode_b">combined properties of Assets</span>, resolved according to declarations in <code class="inline-code">assets.json</code> files (similarly "stamped" if detected), per namespace.<br />
<br />
Here, we can see that the structure correctly merges properties from the Base Theme with the subsequently added declaration of <code class="inline-code">dark.css</code>:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-json">{
    &quot;frontend&quot;: {
        &quot;stamp&quot;: {
            &quot;test-green&quot;: null,
            &quot;test-dark&quot;: {
                &quot;checksum&quot;: &quot;7342713e1249ae1e61f4c3537ca2d41c&quot;,
                &quot;time&quot;: 1718488800
            },
            &quot;core.base&quot;: {
                &quot;checksum&quot;: &quot;ec24abd3b1f9ea098e439d12a93df6b7&quot;,
                &quot;time&quot;: 1716577733
            }
        },
        &quot;value&quot;: {
            &quot;shared&quot;: [],
            &quot;entity&quot;: {
                &quot;styles\/dark.css&quot;: {
                    &quot;source&quot;: &quot;dark.scss&quot;,
                    &quot;attached_to&quot;: [
                        {
                            &quot;script&quot;: &quot;global&quot;
                        }
                    ],
                    &quot;depends_on&quot;: [
                        &quot;styles\/main.css&quot;
                    ]
                },
                &quot;styles\/main.css&quot;: {
                    &quot;source&quot;: &quot;main.scss&quot;,
                    &quot;attached_to&quot;: [
                        {
                            &quot;script&quot;: &quot;global&quot;
                        }
                    ]
                },
</code></pre><br />
All included definitions are considered entity-bound; the <code class="inline-code">shared</code> structure may be conversely populated by higher-level declarations, which may be particularly useful for managing inheritance for a complete namespace.<br />
<br />
<br />
</li>
<li><code class="inline-code">resolvedResources</code>, a "flattened" directory with a <span style="font-weight: bold;" class="mycode_b">resolved set of Resources</span>. At present, this includes styles collected from the whole inheritance hierarchy.<br />
<br />
Following our modifications, it contains default files from the Base Theme with <code class="inline-code">base/_dark.scss</code> and <code class="inline-code">base/_colors.scss</code> overwritten down the chain, effectively resembling a single, final Theme.<br />
<br />
The directory is generated on demand for the SCSS compiler, and modifying it later will have no effect; however, the contents are left for easier troubleshooting and consumption by third-party processing tools.<br />
<br />
<br />
</li>
<li><code class="inline-code">publication.json</code>, containing <span style="font-weight: bold;" class="mycode_b">Asset source files</span>. The structure lists all the ingredients used to generate and publish each Asset.<br />
<br />
In addition to paths, the cache identifies Viewlets from which particular Resources originate. This helps in keeping track of Resource-Asset relationships, and propagating changes made to individual files.<br />
<br />
In this file, we can see that, for example, the two modified source files have successfully made it to the final <code class="inline-code">main.css</code> file from the correct Packages:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-json">        &quot;@frontend\/styles\/main.css&quot;: {
            &quot;sources&quot;: [
                {
                    &quot;viewlet&quot;: &quot;core.base&quot;,
                    &quot;subPath&quot;: &quot;main.scss&quot;
                },
                {
                    &quot;viewlet&quot;: &quot;core.base&quot;,
                    &quot;subPath&quot;: &quot;base\/_module.scss&quot;
                },
                {
                    &quot;viewlet&quot;: &quot;test-green&quot;,
                    &quot;subPath&quot;: &quot;base\/_colors.scss&quot;
                },
                {
                    &quot;viewlet&quot;: &quot;core.base&quot;,
                    &quot;subPath&quot;: &quot;base\/_settings.scss&quot;
                },
                {
                    &quot;viewlet&quot;: &quot;core.base&quot;,
                    &quot;subPath&quot;: &quot;base\/_typography.scss&quot;
                },
                {
                    &quot;viewlet&quot;: &quot;test-dark&quot;,
                    &quot;subPath&quot;: &quot;base\/_dark.scss&quot;
                },
</code></pre></li>
</ul>
<br />
<br />
The cache layers can be re-generated by deleting any chosen file(s) in the <code class="inline-code">cache/viewlets/*</code> directory for the respective Theme Package.<br />
<br />
We can also adjust the optimization level, currently <a href="https://github.com/mybb/mybb/blob/3e849f2cd425aa5759197d1f9f58e39a1a86613c/inc/src/View/ServiceProvider.php#L21" target="_blank" rel="noopener" class="mycode_url">set to <code class="inline-code">Optimization::WATCH</code></a>, to options available <a href="https://github.com/mybb/mybb/blob/dev-1.9/inc/src/View/Optimization.php" target="_blank" rel="noopener" class="mycode_url">here</a>.<br />
<br />
To better understand the interaction between Resources and Assets, see the <a href="https://github.com/mybb/meta/blob/main/architecture/mybb-1.9-theme-system.md#asset-management" target="_blank" rel="noopener" class="mycode_url">Asset Management</a> section and the <span style="font-style: italic;" class="mycode_i">Diagram: Asset Publishing and Management</span>.<br />
<br />
Even though the system will be expanded, this will help you hit the ground running when creating and customizing 1.9 Themes.<br />
</li>
</ol>
<br />
<span style="font-size: large;" class="mycode_size">Open by Design</span><br />
<br />
While a number of tasks will be covered by the Admin CP interface layer, you may note that the new system requires no boilerplate to start working on new Extensions; is open to modification using files alone, in a commonly recognized format; and offers greater visibility into its state, including cache content, processing steps, and runtime performance. This is part of our focus on developer experience.<br class="clear" />]]></description>
			<content:encoded><![CDATA[MyBB 1.9, in addition to a new default look, brings a major expansion of the underlying engine for a greater ease of styling and customization. In this thread, we'll demystify the overhauled system and walk through a few basics of Theme inheritance using a real-world example.<br />
<br />
<br />
<a href="https://community.mybb.com/thread-241225.html" target="_blank" rel="noopener" class="mycode_url"><img src="https://camo.mybb.com/aa72313caf3e70e19ffe9ec4ff1ccaa44dcc85e4/68747470733a2f2f626c6f672e6d7962622e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031372f31302f6765742d737461727465642d77686974652e706e67" data-original-url="https://blog.mybb.com/wp-content/uploads/2017/10/get-started-white.png" loading="lazy"  alt="[Image: get-started-white.png]" style="float: right;" class="mycode_img" /></a><span style="font-size: x-small;" class="mycode_size"><br />
</span>To follow along, prepare a MyBB 1.9 installation using the <a href="https://community.mybb.com/thread-241225.html" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">Quick Start guide</span></a>.<br />
<br />
<br />
<br />
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-size: x-large;" class="mycode_size">Experimenting with Inheritance Basics</span></div>
<br />
To test the new system, we'll create two new, separate Themes to apply a few changes to the Base Theme's stylesheets. We'll use one child Theme to force dark mode, another Theme to change the primary color, and combine the effects with inheritance declarations.<br />
<br />
<ol type="1" class="mycode_list"><li><span style="font-size: large;" class="mycode_size">Setting Up Child Themes</span><br />
<br />
To prepare two new Theme Packages, we'll go to <code class="inline-code">inc/themes/</code> and create two more directories there, named according to their codename:<br />
<br />
<ul class="mycode_list"><li><span style="font-size: large;" class="mycode_size"><code class="inline-code">test-dark</code></span><br />
<br />
In this Package, we'll overwrite one file with minor adjustments, and attach the currently-unused <a href="https://github.com/mybb/mybb/blob/3e849f2cd425aa5759197d1f9f58e39a1a86613c/inc/themes/core.base/frontend/styles/dark.scss" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">styles/dark.scss</code></a> stylesheet.<br />
<br />
Specifically, we'll want to modify <code class="inline-code">frontend/styles/base/_dark.scss</code>. To overwrite the file using inheritance, we simply add it at the same path as in the Base Theme in the new Package's directory. Then, we can make our edits — adding a <a href="https://sass-lang.com/documentation/variables/#default-values" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">!default</code> Sass flag</a> to the variable to prevent the primary color from being overwritten by the dark mode scheme:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-scss">$primary-color: #005084 !default;
</code></pre><br />
With our second objective being to attach the file that activates the dark mode (<code class="inline-code">$dark: true;</code>), we declare it in the Theme's own <code class="inline-code">frontend/assets.json</code> file (equivalent to the same <a href="https://github.com/mybb/mybb/blob/3e849f2cd425aa5759197d1f9f58e39a1a86613c/inc/themes/core.base/frontend/assets.json" target="_blank" rel="noopener" class="mycode_url">file in the Base Theme</a>):<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-json">{
	&quot;assets&quot;: {
		&quot;styles/dark.css&quot;: {
			&quot;source&quot;: &quot;dark.scss&quot;,
			&quot;attached_to&quot;: [
				{
					&quot;script&quot;: &quot;global&quot;
				}
			],
			&quot;depends_on&quot;: [
				&quot;styles/main.css&quot;
			]
		}
	}
}
</code></pre>This will result in <code class="inline-code">dark.css</code> being attached to all pages, after <code class="inline-code">main.css</code>.<br />
<br />
Finally, we also add a basic <code class="inline-code">extension.json</code> file in the Package's main directory to declare inheritance from the Base Theme (codenamed <code class="inline-code">core.base</code>):<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-json">{
	&quot;extra&quot;: {
		&quot;inherits&quot;: [
			&quot;core.base&quot;
		]
	}
}
</code></pre><br />
You may note that certain data in manifest files — like inheritance information — is contained in the <code class="inline-code">extra</code> field. This makes it possible to keep them forward-compatible with Composer's schema, and eventually installable using the same way as MyBB's core dependencies.<br />
<br />
<br />
</li>
<li><span style="font-size: large;" class="mycode_size"><code class="inline-code">test-green</code></span><br />
<br />
In this Package, we'll change the primary color of the Theme. As 1.9's Base Theme uses variables for colors and other values, we'll only need to modify a single declaration.<br />
<br />
We copy the original <code class="inline-code">styles/base/_colors.scss</code> stylesheet within the <code class="inline-code">frontend</code> namespace, and edit chosen variables:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-scss">$primary-color: green;
</code></pre><br />
Similarly, we declare the desired inheritance in the second Theme's file — this time making it inherit from the <code class="inline-code">test-dark</code> Theme:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-json">{
	&quot;extra&quot;: {
		&quot;inherits&quot;: [
			&quot;test-dark&quot;
		]
	}
}
</code></pre></li>
</ul>
<br />
<br />
The resulting <code class="inline-code">inc/themes/</code> directory, containing all source Packages, should now look like this:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-none">inc/
└── themes/
    ├── core.base/
    │   └── ...
    ├── test-dark/
    │   ├── frontend/
    │   │   ├── styles/
    │   │   │   └── base/
    │   │   │       └── _dark.scss
    │   │   └── assets.json
    │   └── extension.json
    └── test-green/
        ├── frontend/
        │   └── styles/
        │       └── base/
        │           └── _colors.scss
        └── extension.json
</code></pre><br />
<div style="text-align: right;" class="mycode_align">
All <code class="inline-code">inc/themes/</code> files created in this guide: <!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://community.mybb.com/images/attachtypes/zip.gif" title="Zip File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=47025" target="_blank" title="">test-themes.zip</a> (Size: 3.34 KB / Downloads: 188)
<!-- end: postbit_attachments_attachment --><br />
</div>
<br />
</li>
<li><span style="font-size: large;" class="mycode_size">Using a Selected Theme Package</span><br />
<br />
Finally, we overwrite the <a href="https://github.com/mybb/mybb/blob/3e849f2cd425aa5759197d1f9f58e39a1a86613c/global.php#L470" target="_blank" rel="noopener" class="mycode_url">currently-hardcoded Theme codename in <code class="inline-code">global.php</code></a>:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-php">$packageName = 'test-green';
</code></pre><br />
This reference will eventually be managed in a similar way as in the past: taking into account settings and preferences for the default, user-, and forum-specific Themes.<br />
<br />
<br />
</li>
<li><span style="font-size: large;" class="mycode_size">Observing Results</span><br />
<br />
On the first run, <a href="https://github.com/mybb/mybb/blob/dev-1.9/inc/src/View/ARCHITECTURE.md#performance" target="_blank" rel="noopener" class="mycode_url">various data layers</a> will be warmed up, with the new CSS files being generated and published at the end, ready to be included in the HTTP response.<br />
<div style="text-align: center;" class="mycode_align"><img src="https://camo.mybb.com/54f1fcf974be522384a466baa8666f99b9391d62/68747470733a2f2f646576696c7368616b65727a2e636f6d2f63646e2d7374617469632f666967757265732f31392d746573742d6461726b2d677265656e2d6672616d652e706e67" data-original-url="https://devilshakerz.com/cdn-static/figures/19-test-dark-green-frame.png" loading="lazy"  alt="[Image: 19-test-dark-green-frame.png]" class="mycode_img" /></div>
<br />
In the page source, we can see that our definitions result in the correct order, and local files are accompanied by a timestamp that helps avoid stale cache issues:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-html">&lt;link rel=&quot;stylesheet&quot; href=&quot;https://localhost/cache/viewlets/test-green/frontend/main.css?t=1718649384&quot;&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;https://localhost/cache/viewlets/test-green/frontend/dark.css?t=1718649385&quot;&gt;
</code></pre><br />
Notably, compared to MyBB ≤ 1.8, all Assets are published in relation to the requested Theme, and don't reveal the internal hierarchy that's been set up.<br />
<br />
<br />
</li>
<li><span style="font-size: large;" class="mycode_size">Peeking Under the Hood</span><br />
<br />
If you happen to use the debug mode (<code class="inline-code">?debug=1</code>) when the Theme is generated, you'll be able to see measurements related to generating i.a. the hierarchical resolution cache, and Asset compilation.<br />
<div style="text-align: center;" class="mycode_align"><img src="https://camo.mybb.com/060572d0980974331f13e6c15d0fb8b41af28aec/68747470733a2f2f646576696c7368616b65727a2e636f6d2f63646e2d7374617469632f666967757265732f31392d746573742d6461726b2d677265656e2d64656275672d6672616d652e706e67" data-original-url="https://devilshakerz.com/cdn-static/figures/19-test-dark-green-debug-frame.png" loading="lazy"  alt="[Image: 19-test-dark-green-debug-frame.png]" class="mycode_img" /></div>
<br />
To take a better look at what's happening internally, head to the <code class="inline-code">inc/cache/viewlets/</code> directory, which contains published Assets and cache stored in a human-readable JSON format.<br />
<br />
Currently, the following structure will be created with data for the <code class="inline-code">test-green</code> Theme:<br />
<br />
<ul class="mycode_list"><li>the final <code class="inline-code">frontend/main.css</code> and <code class="inline-code">frontend/dark.css</code> files generated by the SCSS compiler,<br />
</li>
</ul>
<br />
accompanied by internal files:<br />
<br />
<ul class="mycode_list"><li><code class="inline-code">hierarchy.ancestors.json</code>, storing the <span style="font-weight: bold;" class="mycode_b">determined hierarchy</span> — from closest to furthest ancestor.<br />
<br />
As expected, the final Theme inherits from two other themes, in the following order:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-json">    &quot;value&quot;: [
        &quot;test-dark&quot;,
        &quot;core.base&quot;
    ]
</code></pre><br />
As changes to manifest files may result in differing hierarchy, the files are "stamped" to re-generate the structure when modifications are made.<br />
<br />
<br />
</li>
<li><code class="inline-code">hierarchy.resolution.resources.json</code>, the <span style="font-weight: bold;" class="mycode_b">inheritance resolution cache</span> — a structure mapping Resources to correct <span style="font-style: italic;" class="mycode_i">Viewlets</span> (which may also belong to Plugins), in each namespace.<br />
<br />
In our case, this is a result of the ancestry declared in manifest files, and each Resource file's existence in queried Themes, where descendant Themes have higher priority.<br />
<br />
Conveniently, the modified files top the alphabetically-sorted list, and appear to resolve to the respective Theme Packages in which they were modified:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-json">{
    &quot;frontend&quot;: {
        &quot;stamp&quot;: {
            &quot;test-green&quot;: null,
            &quot;test-dark&quot;: null,
            &quot;core.base&quot;: null
        },
        &quot;value&quot;: {
            &quot;styles\/base\/_colors.scss&quot;: &quot;test-green&quot;,
            &quot;styles\/base\/_dark.scss&quot;: &quot;test-dark&quot;,
            &quot;styles\/base\/_module.scss&quot;: &quot;core.base&quot;,
            &quot;styles\/base\/_settings.scss&quot;: &quot;core.base&quot;,
            &quot;styles\/base\/_typography.scss&quot;: &quot;core.base&quot;,
</code></pre><br />
In this data layer, the "stamped" sources are files called <code class="inline-code">resources.json</code> — containing Resource definitions — given that inheritance may also be modified there (but in this example, the installation doesn't include any).<br />
<br />
<br />
</li>
<li><code class="inline-code">hierarchy.properties.assets.json</code>, the <span style="font-weight: bold;" class="mycode_b">combined properties of Assets</span>, resolved according to declarations in <code class="inline-code">assets.json</code> files (similarly "stamped" if detected), per namespace.<br />
<br />
Here, we can see that the structure correctly merges properties from the Base Theme with the subsequently added declaration of <code class="inline-code">dark.css</code>:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-json">{
    &quot;frontend&quot;: {
        &quot;stamp&quot;: {
            &quot;test-green&quot;: null,
            &quot;test-dark&quot;: {
                &quot;checksum&quot;: &quot;7342713e1249ae1e61f4c3537ca2d41c&quot;,
                &quot;time&quot;: 1718488800
            },
            &quot;core.base&quot;: {
                &quot;checksum&quot;: &quot;ec24abd3b1f9ea098e439d12a93df6b7&quot;,
                &quot;time&quot;: 1716577733
            }
        },
        &quot;value&quot;: {
            &quot;shared&quot;: [],
            &quot;entity&quot;: {
                &quot;styles\/dark.css&quot;: {
                    &quot;source&quot;: &quot;dark.scss&quot;,
                    &quot;attached_to&quot;: [
                        {
                            &quot;script&quot;: &quot;global&quot;
                        }
                    ],
                    &quot;depends_on&quot;: [
                        &quot;styles\/main.css&quot;
                    ]
                },
                &quot;styles\/main.css&quot;: {
                    &quot;source&quot;: &quot;main.scss&quot;,
                    &quot;attached_to&quot;: [
                        {
                            &quot;script&quot;: &quot;global&quot;
                        }
                    ]
                },
</code></pre><br />
All included definitions are considered entity-bound; the <code class="inline-code">shared</code> structure may be conversely populated by higher-level declarations, which may be particularly useful for managing inheritance for a complete namespace.<br />
<br />
<br />
</li>
<li><code class="inline-code">resolvedResources</code>, a "flattened" directory with a <span style="font-weight: bold;" class="mycode_b">resolved set of Resources</span>. At present, this includes styles collected from the whole inheritance hierarchy.<br />
<br />
Following our modifications, it contains default files from the Base Theme with <code class="inline-code">base/_dark.scss</code> and <code class="inline-code">base/_colors.scss</code> overwritten down the chain, effectively resembling a single, final Theme.<br />
<br />
The directory is generated on demand for the SCSS compiler, and modifying it later will have no effect; however, the contents are left for easier troubleshooting and consumption by third-party processing tools.<br />
<br />
<br />
</li>
<li><code class="inline-code">publication.json</code>, containing <span style="font-weight: bold;" class="mycode_b">Asset source files</span>. The structure lists all the ingredients used to generate and publish each Asset.<br />
<br />
In addition to paths, the cache identifies Viewlets from which particular Resources originate. This helps in keeping track of Resource-Asset relationships, and propagating changes made to individual files.<br />
<br />
In this file, we can see that, for example, the two modified source files have successfully made it to the final <code class="inline-code">main.css</code> file from the correct Packages:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-json">        &quot;@frontend\/styles\/main.css&quot;: {
            &quot;sources&quot;: [
                {
                    &quot;viewlet&quot;: &quot;core.base&quot;,
                    &quot;subPath&quot;: &quot;main.scss&quot;
                },
                {
                    &quot;viewlet&quot;: &quot;core.base&quot;,
                    &quot;subPath&quot;: &quot;base\/_module.scss&quot;
                },
                {
                    &quot;viewlet&quot;: &quot;test-green&quot;,
                    &quot;subPath&quot;: &quot;base\/_colors.scss&quot;
                },
                {
                    &quot;viewlet&quot;: &quot;core.base&quot;,
                    &quot;subPath&quot;: &quot;base\/_settings.scss&quot;
                },
                {
                    &quot;viewlet&quot;: &quot;core.base&quot;,
                    &quot;subPath&quot;: &quot;base\/_typography.scss&quot;
                },
                {
                    &quot;viewlet&quot;: &quot;test-dark&quot;,
                    &quot;subPath&quot;: &quot;base\/_dark.scss&quot;
                },
</code></pre></li>
</ul>
<br />
<br />
The cache layers can be re-generated by deleting any chosen file(s) in the <code class="inline-code">cache/viewlets/*</code> directory for the respective Theme Package.<br />
<br />
We can also adjust the optimization level, currently <a href="https://github.com/mybb/mybb/blob/3e849f2cd425aa5759197d1f9f58e39a1a86613c/inc/src/View/ServiceProvider.php#L21" target="_blank" rel="noopener" class="mycode_url">set to <code class="inline-code">Optimization::WATCH</code></a>, to options available <a href="https://github.com/mybb/mybb/blob/dev-1.9/inc/src/View/Optimization.php" target="_blank" rel="noopener" class="mycode_url">here</a>.<br />
<br />
To better understand the interaction between Resources and Assets, see the <a href="https://github.com/mybb/meta/blob/main/architecture/mybb-1.9-theme-system.md#asset-management" target="_blank" rel="noopener" class="mycode_url">Asset Management</a> section and the <span style="font-style: italic;" class="mycode_i">Diagram: Asset Publishing and Management</span>.<br />
<br />
Even though the system will be expanded, this will help you hit the ground running when creating and customizing 1.9 Themes.<br />
</li>
</ol>
<br />
<span style="font-size: large;" class="mycode_size">Open by Design</span><br />
<br />
While a number of tasks will be covered by the Admin CP interface layer, you may note that the new system requires no boilerplate to start working on new Extensions; is open to modification using files alone, in a commonly recognized format; and offers greater visibility into its state, including cache content, processing steps, and runtime performance. This is part of our focus on developer experience.<br class="clear" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[1.9 Development Milestone]]></title>
			<link>https://community.mybb.com/thread-241255.html</link>
			<pubDate>Sun, 23 Jun 2024 16:26:40 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://community.mybb.com/member.php?action=profile&uid=47371">Devilshakerz</a>]]></dc:creator>
			<guid isPermaLink="false">https://community.mybb.com/thread-241255.html</guid>
			<description><![CDATA[Following the general template conversion to Twig, the new theming system began taking shape across our platforms: from its scope and high-level goals on the Forums, to minutiae in the <a href="https://mybb.com/discord" target="_blank" rel="noopener" class="mycode_url">Discord server</a>, specification in design documents, and code in Pull Requests and Issues on <a href="https://github.com/mybb/mybb/tree/dev-1.9" target="_blank" rel="noopener" class="mycode_url">GitHub</a> — in addition to other improvements in the series. In this thread, we'll review a number of puzzle pieces that come together to outline the experience coming in MyBB 1.9.<br />
<br />
<br />
<br />
<div style="text-align: center;" class="mycode_align"><img src="https://camo.mybb.com/12bb653c6938474ec31d474556c4acc4b50a3672/68747470733a2f2f646576696c7368616b65727a2e636f6d2f63646e2d7374617469632f666967757265732f31392d6d696c6573746f6e652d6d6f736169632e706e67" data-original-url="https://devilshakerz.com/cdn-static/figures/19-milestone-mosaic.png" loading="lazy"  alt="[Image: 19-milestone-mosaic.png]" class="mycode_img" /></div>
<br />
<ul class="mycode_list"><li>The internal code of the <span style="font-weight: bold;" class="mycode_b">1.9 theme system</span> was <a href="https://github.com/mybb/mybb/pull/4810" target="_blank" rel="noopener" class="mycode_url">merged</a>.<br />
<br />
The new implementation revolves around JSON-based Extension metadata, inheritance resolution, Twig interaction, and <a href="https://github.com/mybb/meta/blob/main/architecture/mybb-1.9-theme-system.md#asset-management" target="_blank" rel="noopener" class="mycode_url">asset management</a>. The SCSS-based stylesheets and Templates of the <a href="https://github.com/mybb/mybb/tree/dev-1.9/inc/themes/core.base" target="_blank" rel="noopener" class="mycode_url">Base Theme</a> are now handled by the system.<br />
<br />
The integrated, and upcoming features are described in the updated  <a href="https://github.com/mybb/meta/blob/main/architecture/mybb-1.9-theme-system.md" target="_blank" rel="noopener" class="mycode_url">specification document</a> (sections for some details are collapsed for ease of reading).<br />
<br />
We also keep an eye on features coming to web browsers that may boost performance and expand MyBB's built-in customization. In particular, browser support for nesting, variables, and additional <span style="font-style: italic;" class="mycode_i">functions</span> in CSS would enable Themes to use modern code without the overhead of an SCSS compiler, and reduce the amount of logic necessary to pass values from the DOM to stylesheets.<br />
<br />
Notably, with Templates handled as files and compiled to PHP code, further optimization will be possible with <a href="https://www.php.net/manual/en/book.opcache.php" target="_blank" rel="noopener" class="mycode_url">opcache</a>.<br />
<br />
</li>
<li>A <span style="font-weight: bold;" class="mycode_b">resource versioning logic</span> <a href="https://github.com/mybb/meta/blob/main/architecture/mybb-1.9-theme-system.md#hierarchical-versioning" target="_blank" rel="noopener" class="mycode_url">scheme</a> was prepared for the Extension system.<br />
<br />
As MyBB aims to make the Extension authoring experience easier, starting with <a href="https://github.com/mybb/meta/blob/main/architecture/mybb-1.9-theme-system.md#addressing-mybb--18-theme-management-problems" target="_blank" rel="noopener" class="mycode_url">improving</a> Theme updates and version management, we looked into how changes would propagate through inherited Themes to make sure nothing gets left out by accident (which can otherwise break functionality after upgrading).<br />
<br />
The system will be able to link Extensions in the ancestry line according to explicit declarations and fallback metadata, ensuring their authors' ability to apply upstream changes across Extensions.<br />
<br />
</li>
<li>The <span style="font-weight: bold;" class="mycode_b">modification &amp; data sharing API</span> design was completed.<br />
<br />
The feature adds support for Theme <a href="https://github.com/mybb/meta/blob/main/architecture/mybb-1.9-theme-system.md#static-view-macros" target="_blank" rel="noopener" class="mycode_url">modification instructions</a> — declared in Plugin Packages, and handled by the Extension system. This mirrors and builds upon <a href="https://docs.mybb.com/1.8/development/plugins/creating-modifying-templates/#editing-templates" target="_blank" rel="noopener" class="mycode_url">existing options</a> in the core and helper libraries, offering more in-built tools to adjust Themes for activated Plugins, and to reliably restore original content.<br />
<br />
The <a href="https://github.com/mybb/meta/blob/main/architecture/mybb-1.9-theme-system.md#in-resource-data-access" target="_blank" rel="noopener" class="mycode_url">data sharing</a> functionality — available to authors from Plugins' PHP code — adds shortcuts to manage custom variables in Twig templates (and, eventually, scripts and stylesheets). In conjunction with the asset management system, the API will aid in the planned phase-out of inline assets in the future to improve security.<br />
<br />
</li>
<li>A <span style="font-weight: bold;" class="mycode_b">1.9 Admin CP Theme</span> was <a href="https://github.com/mybb/mybb/pull/4828" target="_blank" rel="noopener" class="mycode_url">introduced.</a><br />
<br />
The update joins overall visual updates in the new series, matching the front-end design and refreshed branding. The Admin CP is also one of the candidates for future contained refactoring (similar to the installation process), with other sections now finished and maturing.<br />
<br />
</li>
<li>The minimum requirements <a href="https://community.mybb.com/thread-195675-post-1394519.html#pid1394519" target="_blank" rel="noopener" class="mycode_url">were updated</a> to <span style="font-weight: bold;" class="mycode_b">PHP ≥ 8.2</span>.<br />
<br />
If you contributed to MyBB 1.8, you likely noted that some code needed adjustments for old PHP versions. This resulted from the time elapsed since the last <a href="https://docs.mybb.com/1.8/install/requirements/" target="_blank" rel="noopener" class="mycode_url">requirements</a> bump, which happens with a new series release. MyBB 1.9 allows us to once again keep the range short, sweet, and reasonable, thus avoiding over-stretching of resources and improving code quality.<br />
<br />
The bump also brings us in line with requirements for Twig 4 and components from Laravel 11 and Symfony 7.<br />
<br />
We expect similar bumps for database engines and servers to modern versions, which will altogether permit us to <a href="https://github.com/mybb/mybb/issues/4549" target="_blank" rel="noopener" class="mycode_url">shed</a> fallback code that covers old software.<br />
<br />
</li>
<li>The <span style="font-weight: bold;" class="mycode_b">Security Log</span> feature was <a href="https://github.com/mybb/mybb/pull/4599" target="_blank" rel="noopener" class="mycode_url">implemented</a>.<br />
<br />
Pages previously known from the <a href="https://community.mybb.com/mods.php?action=view&amp;pid=740" target="_blank" rel="noopener" class="mycode_url">plugin</a> will be available out-of-the-box, bringing storage and monitoring to users and administrators, who will be able to keep an eye on failed login attempts and other security-related events.<br />
<br />
</li>
<li>A new, global <span style="font-weight: bold;" class="mycode_b">debug mode</span> was <a href="https://github.com/mybb/mybb/pull/4738" target="_blank" rel="noopener" class="mycode_url">added</a>.<br />
<br />
The modernized page comes with more detailed measurements, stack traces for database queries, and additional system details. The View domain also populates information about ancestry resolution, Asset compilation, Template generation, and Twig's profiler output.<br />
<br />
The debug display is now also usable in the Admin CP.<br />
<br />
</li>
<li>MyBB 1.9 includes <span style="font-weight: bold;" class="mycode_b">new web- &amp; CLI-based installation</span> and upgrading.<br />
<br />
The setup process is made more straight-forward for regular use, skips unnecessary details to speed up development, and opens the door for various PHP- and client line-based automation. In addition, new error and <span style="font-style: italic;" class="mycode_i">closed</span> pages were introduced.<br />
<br />
You can read more about how the new OOBE and CLI parts came to be in the <a href="https://blog.mybb.com/2023/03/07/designing-mybb-1-9s-installer-2/" target="_blank" rel="noopener" class="mycode_url">MyBB Blog post</a>.<br />
<br />
</li>
<li>Several <span style="font-weight: bold;" class="mycode_b">quick-start</span> methods are now <a href="https://community.mybb.com/thread-241225.html" target="_blank" rel="noopener" class="mycode_url">available</a> to run MyBB 1.9.<br />
<br />
The new CLI tool is used in MyBB's <a href="https://github.com/mybb/deploy/tree/dev" target="_blank" rel="noopener" class="mycode_url">Docker Compose stack</a> and <a href="https://github.com/mybb/mybb/tree/dev-1.9/.devcontainer" target="_blank" rel="noopener" class="mycode_url">GitHub Codespaces</a> configurations, letting contributors set up new instances without manual installation.<br />
<br />
Additionally, a complete installable package with dependencies is now generated, making it easy to get the new branch up and running by webmasters and developers — in experience similar to MyBB ≤ 1.8.<br />
<br />
</li>
<li>The <span style="font-weight: bold;" class="mycode_b">next key steps</span> revolve around completing the View system's integration and UI.<br />
<br />
This includes a database layer for Themes — handling default and user- &amp; forum-specific Theme selection; and Theme management <a href="https://github.com/mybb/meta/blob/main/architecture/mybb-1.9-theme-system.md#controls" target="_blank" rel="noopener" class="mycode_url">interface</a> in the Admin CP.<br />
<br />
With Extensions playing an important role in our ecosystem, a foundation for the Theme modification API is also on the horizon, bringing MyBB 1.9 over the threshold of feature parity with MyBB ≤ 1.8. More advanced features taking advantage of all data available in the View system, and interfaces for options managed through JSON declarations, may also be added in the 1.9.x line.<br />
<br />
One of the work areas in the final stretch before the series' first version will cover a number of housekeeping issues related to the release process, and the MyBB.com platform.<br />
<br />
Finally, with a new set of templates, code regions, and miscellaneous tweaks, we expect various stability and performance corrections — therefore, the release timeline will be impacted by the <a href="https://en.wikipedia.org/wiki/Linus's_law" target="_blank" rel="noopener" class="mycode_url">Community effort</a> to monitor the upcoming branch from a quality perspective, <a href="https://github.com/mybb/mybb/issues" target="_blank" rel="noopener" class="mycode_url">track</a> any remaining work, and start getting the new series ready for a stable release.<br />
</li>
</ul>
<br />
<br />
<br />
<div style="text-align: center;" class="mycode_align">
<span style="font-weight: bold;" class="mycode_b">Click below to view Quick Start instructions, or explore MyBB 1.9's codebase.</span><br />
<br />
<br />
<a href="https://community.mybb.com/thread-241225.html" target="_blank" rel="noopener" class="mycode_url"><img src="https://camo.mybb.com/b4503d76252b2661ed214349b468d11edcc1e3e8/68747470733a2f2f626c6f672e6d7962622e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031372f31302f6765742d737461727465642d626c75652e706e67" data-original-url="https://blog.mybb.com/wp-content/uploads/2017/10/get-started-blue.png" loading="lazy"  alt="[Image: get-started-blue.png]" class="mycode_img" /></a><br />
<br />
<a href="https://github.com/mybb/mybb/tree/dev-1.9" target="_blank" rel="noopener" class="mycode_url"><img src="https://camo.mybb.com/49bdb090deb45e464e71cf68fac81a48e3aff322/68747470733a2f2f626c6f672e6d7962622e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031372f31302f6769746875622d7472616e73706172656e742e706e67" data-original-url="https://blog.mybb.com/wp-content/uploads/2017/10/github-transparent.png" loading="lazy"  alt="[Image: github-transparent.png]" class="mycode_img" /></a><br />
<br />
<br />
<br />
</div>]]></description>
			<content:encoded><![CDATA[Following the general template conversion to Twig, the new theming system began taking shape across our platforms: from its scope and high-level goals on the Forums, to minutiae in the <a href="https://mybb.com/discord" target="_blank" rel="noopener" class="mycode_url">Discord server</a>, specification in design documents, and code in Pull Requests and Issues on <a href="https://github.com/mybb/mybb/tree/dev-1.9" target="_blank" rel="noopener" class="mycode_url">GitHub</a> — in addition to other improvements in the series. In this thread, we'll review a number of puzzle pieces that come together to outline the experience coming in MyBB 1.9.<br />
<br />
<br />
<br />
<div style="text-align: center;" class="mycode_align"><img src="https://camo.mybb.com/12bb653c6938474ec31d474556c4acc4b50a3672/68747470733a2f2f646576696c7368616b65727a2e636f6d2f63646e2d7374617469632f666967757265732f31392d6d696c6573746f6e652d6d6f736169632e706e67" data-original-url="https://devilshakerz.com/cdn-static/figures/19-milestone-mosaic.png" loading="lazy"  alt="[Image: 19-milestone-mosaic.png]" class="mycode_img" /></div>
<br />
<ul class="mycode_list"><li>The internal code of the <span style="font-weight: bold;" class="mycode_b">1.9 theme system</span> was <a href="https://github.com/mybb/mybb/pull/4810" target="_blank" rel="noopener" class="mycode_url">merged</a>.<br />
<br />
The new implementation revolves around JSON-based Extension metadata, inheritance resolution, Twig interaction, and <a href="https://github.com/mybb/meta/blob/main/architecture/mybb-1.9-theme-system.md#asset-management" target="_blank" rel="noopener" class="mycode_url">asset management</a>. The SCSS-based stylesheets and Templates of the <a href="https://github.com/mybb/mybb/tree/dev-1.9/inc/themes/core.base" target="_blank" rel="noopener" class="mycode_url">Base Theme</a> are now handled by the system.<br />
<br />
The integrated, and upcoming features are described in the updated  <a href="https://github.com/mybb/meta/blob/main/architecture/mybb-1.9-theme-system.md" target="_blank" rel="noopener" class="mycode_url">specification document</a> (sections for some details are collapsed for ease of reading).<br />
<br />
We also keep an eye on features coming to web browsers that may boost performance and expand MyBB's built-in customization. In particular, browser support for nesting, variables, and additional <span style="font-style: italic;" class="mycode_i">functions</span> in CSS would enable Themes to use modern code without the overhead of an SCSS compiler, and reduce the amount of logic necessary to pass values from the DOM to stylesheets.<br />
<br />
Notably, with Templates handled as files and compiled to PHP code, further optimization will be possible with <a href="https://www.php.net/manual/en/book.opcache.php" target="_blank" rel="noopener" class="mycode_url">opcache</a>.<br />
<br />
</li>
<li>A <span style="font-weight: bold;" class="mycode_b">resource versioning logic</span> <a href="https://github.com/mybb/meta/blob/main/architecture/mybb-1.9-theme-system.md#hierarchical-versioning" target="_blank" rel="noopener" class="mycode_url">scheme</a> was prepared for the Extension system.<br />
<br />
As MyBB aims to make the Extension authoring experience easier, starting with <a href="https://github.com/mybb/meta/blob/main/architecture/mybb-1.9-theme-system.md#addressing-mybb--18-theme-management-problems" target="_blank" rel="noopener" class="mycode_url">improving</a> Theme updates and version management, we looked into how changes would propagate through inherited Themes to make sure nothing gets left out by accident (which can otherwise break functionality after upgrading).<br />
<br />
The system will be able to link Extensions in the ancestry line according to explicit declarations and fallback metadata, ensuring their authors' ability to apply upstream changes across Extensions.<br />
<br />
</li>
<li>The <span style="font-weight: bold;" class="mycode_b">modification &amp; data sharing API</span> design was completed.<br />
<br />
The feature adds support for Theme <a href="https://github.com/mybb/meta/blob/main/architecture/mybb-1.9-theme-system.md#static-view-macros" target="_blank" rel="noopener" class="mycode_url">modification instructions</a> — declared in Plugin Packages, and handled by the Extension system. This mirrors and builds upon <a href="https://docs.mybb.com/1.8/development/plugins/creating-modifying-templates/#editing-templates" target="_blank" rel="noopener" class="mycode_url">existing options</a> in the core and helper libraries, offering more in-built tools to adjust Themes for activated Plugins, and to reliably restore original content.<br />
<br />
The <a href="https://github.com/mybb/meta/blob/main/architecture/mybb-1.9-theme-system.md#in-resource-data-access" target="_blank" rel="noopener" class="mycode_url">data sharing</a> functionality — available to authors from Plugins' PHP code — adds shortcuts to manage custom variables in Twig templates (and, eventually, scripts and stylesheets). In conjunction with the asset management system, the API will aid in the planned phase-out of inline assets in the future to improve security.<br />
<br />
</li>
<li>A <span style="font-weight: bold;" class="mycode_b">1.9 Admin CP Theme</span> was <a href="https://github.com/mybb/mybb/pull/4828" target="_blank" rel="noopener" class="mycode_url">introduced.</a><br />
<br />
The update joins overall visual updates in the new series, matching the front-end design and refreshed branding. The Admin CP is also one of the candidates for future contained refactoring (similar to the installation process), with other sections now finished and maturing.<br />
<br />
</li>
<li>The minimum requirements <a href="https://community.mybb.com/thread-195675-post-1394519.html#pid1394519" target="_blank" rel="noopener" class="mycode_url">were updated</a> to <span style="font-weight: bold;" class="mycode_b">PHP ≥ 8.2</span>.<br />
<br />
If you contributed to MyBB 1.8, you likely noted that some code needed adjustments for old PHP versions. This resulted from the time elapsed since the last <a href="https://docs.mybb.com/1.8/install/requirements/" target="_blank" rel="noopener" class="mycode_url">requirements</a> bump, which happens with a new series release. MyBB 1.9 allows us to once again keep the range short, sweet, and reasonable, thus avoiding over-stretching of resources and improving code quality.<br />
<br />
The bump also brings us in line with requirements for Twig 4 and components from Laravel 11 and Symfony 7.<br />
<br />
We expect similar bumps for database engines and servers to modern versions, which will altogether permit us to <a href="https://github.com/mybb/mybb/issues/4549" target="_blank" rel="noopener" class="mycode_url">shed</a> fallback code that covers old software.<br />
<br />
</li>
<li>The <span style="font-weight: bold;" class="mycode_b">Security Log</span> feature was <a href="https://github.com/mybb/mybb/pull/4599" target="_blank" rel="noopener" class="mycode_url">implemented</a>.<br />
<br />
Pages previously known from the <a href="https://community.mybb.com/mods.php?action=view&amp;pid=740" target="_blank" rel="noopener" class="mycode_url">plugin</a> will be available out-of-the-box, bringing storage and monitoring to users and administrators, who will be able to keep an eye on failed login attempts and other security-related events.<br />
<br />
</li>
<li>A new, global <span style="font-weight: bold;" class="mycode_b">debug mode</span> was <a href="https://github.com/mybb/mybb/pull/4738" target="_blank" rel="noopener" class="mycode_url">added</a>.<br />
<br />
The modernized page comes with more detailed measurements, stack traces for database queries, and additional system details. The View domain also populates information about ancestry resolution, Asset compilation, Template generation, and Twig's profiler output.<br />
<br />
The debug display is now also usable in the Admin CP.<br />
<br />
</li>
<li>MyBB 1.9 includes <span style="font-weight: bold;" class="mycode_b">new web- &amp; CLI-based installation</span> and upgrading.<br />
<br />
The setup process is made more straight-forward for regular use, skips unnecessary details to speed up development, and opens the door for various PHP- and client line-based automation. In addition, new error and <span style="font-style: italic;" class="mycode_i">closed</span> pages were introduced.<br />
<br />
You can read more about how the new OOBE and CLI parts came to be in the <a href="https://blog.mybb.com/2023/03/07/designing-mybb-1-9s-installer-2/" target="_blank" rel="noopener" class="mycode_url">MyBB Blog post</a>.<br />
<br />
</li>
<li>Several <span style="font-weight: bold;" class="mycode_b">quick-start</span> methods are now <a href="https://community.mybb.com/thread-241225.html" target="_blank" rel="noopener" class="mycode_url">available</a> to run MyBB 1.9.<br />
<br />
The new CLI tool is used in MyBB's <a href="https://github.com/mybb/deploy/tree/dev" target="_blank" rel="noopener" class="mycode_url">Docker Compose stack</a> and <a href="https://github.com/mybb/mybb/tree/dev-1.9/.devcontainer" target="_blank" rel="noopener" class="mycode_url">GitHub Codespaces</a> configurations, letting contributors set up new instances without manual installation.<br />
<br />
Additionally, a complete installable package with dependencies is now generated, making it easy to get the new branch up and running by webmasters and developers — in experience similar to MyBB ≤ 1.8.<br />
<br />
</li>
<li>The <span style="font-weight: bold;" class="mycode_b">next key steps</span> revolve around completing the View system's integration and UI.<br />
<br />
This includes a database layer for Themes — handling default and user- &amp; forum-specific Theme selection; and Theme management <a href="https://github.com/mybb/meta/blob/main/architecture/mybb-1.9-theme-system.md#controls" target="_blank" rel="noopener" class="mycode_url">interface</a> in the Admin CP.<br />
<br />
With Extensions playing an important role in our ecosystem, a foundation for the Theme modification API is also on the horizon, bringing MyBB 1.9 over the threshold of feature parity with MyBB ≤ 1.8. More advanced features taking advantage of all data available in the View system, and interfaces for options managed through JSON declarations, may also be added in the 1.9.x line.<br />
<br />
One of the work areas in the final stretch before the series' first version will cover a number of housekeeping issues related to the release process, and the MyBB.com platform.<br />
<br />
Finally, with a new set of templates, code regions, and miscellaneous tweaks, we expect various stability and performance corrections — therefore, the release timeline will be impacted by the <a href="https://en.wikipedia.org/wiki/Linus's_law" target="_blank" rel="noopener" class="mycode_url">Community effort</a> to monitor the upcoming branch from a quality perspective, <a href="https://github.com/mybb/mybb/issues" target="_blank" rel="noopener" class="mycode_url">track</a> any remaining work, and start getting the new series ready for a stable release.<br />
</li>
</ul>
<br />
<br />
<br />
<div style="text-align: center;" class="mycode_align">
<span style="font-weight: bold;" class="mycode_b">Click below to view Quick Start instructions, or explore MyBB 1.9's codebase.</span><br />
<br />
<br />
<a href="https://community.mybb.com/thread-241225.html" target="_blank" rel="noopener" class="mycode_url"><img src="https://camo.mybb.com/b4503d76252b2661ed214349b468d11edcc1e3e8/68747470733a2f2f626c6f672e6d7962622e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031372f31302f6765742d737461727465642d626c75652e706e67" data-original-url="https://blog.mybb.com/wp-content/uploads/2017/10/get-started-blue.png" loading="lazy"  alt="[Image: get-started-blue.png]" class="mycode_img" /></a><br />
<br />
<a href="https://github.com/mybb/mybb/tree/dev-1.9" target="_blank" rel="noopener" class="mycode_url"><img src="https://camo.mybb.com/49bdb090deb45e464e71cf68fac81a48e3aff322/68747470733a2f2f626c6f672e6d7962622e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031372f31302f6769746875622d7472616e73706172656e742e706e67" data-original-url="https://blog.mybb.com/wp-content/uploads/2017/10/github-transparent.png" loading="lazy"  alt="[Image: github-transparent.png]" class="mycode_img" /></a><br />
<br />
<br />
<br />
</div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Quick Start: Installing MyBB 1.9 Development Version]]></title>
			<link>https://community.mybb.com/thread-241225.html</link>
			<pubDate>Wed, 19 Jun 2024 18:39:34 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://community.mybb.com/member.php?action=profile&uid=47371">Devilshakerz</a>]]></dc:creator>
			<guid isPermaLink="false">https://community.mybb.com/thread-241225.html</guid>
			<description><![CDATA[<span style="font-size: x-large;" class="mycode_size">Working with the New Codebase</span><br />
<br />
Starting with version 1.9, developed on the <a href="https://github.com/mybb/mybb/tree/dev-1.9" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">dev-1.9</code></a> branch, MyBB's dependencies are managed using <a href="https://getcomposer.org/" target="_blank" rel="noopener" class="mycode_url">Composer</a>.<br />
<br />
This means that instead of copying third-party code into its own repository, various libraries and packages are declared in the <a href="https://github.com/mybb/mybb/blob/dev-1.9/composer.json" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">composer.json</code> file</a>. The corresponding complete list of dependencies, and their specific versions, are determined by the <a href="https://getcomposer.org/doc/03-cli.md#update-u-upgrade" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">composer update</code></a> utility, which generates the <a href="https://github.com/mybb/mybb/blob/dev-1.9/composer.lock" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">composer.lock</code> file</a>. These files are updated by contributors, and checked into the repository.<br />
<br />
Additionally, MyBB's own code structures added under <code class="inline-code">inc/src/</code> follow a common standard that allows their use without explicit <code class="inline-code">include</code> or <code class="inline-code">require</code> statements in PHP - with namespace-based <code class="inline-code">use</code> declarations (see <a href="https://github.com/mybb/mybb/blob/72d4f9b9be4bf4067142a11f290b70c245df53e8/inc/src/Extensions/Theme.php#L5-L10" target="_blank" rel="noopener" class="mycode_url">example</a>).<br />
<br />
Before MyBB can run, the packages and related information need to be downloaded and built using <a href="https://getcomposer.org/doc/03-cli.md#install-i" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">composer install</code></a>. The command may be run manually or included in various scripts, and will be part of the release process.<br />
<br />
<br />
<br />
<span style="font-size: x-large;" class="mycode_size">Running MyBB 1.9 from Source</span><br />
<br />
The following options are available to run the latest development version of MyBB 1.9:<br />
<br />
<ul class="mycode_list"><li><span style="font-size: large;" class="mycode_size">📦 <span style="font-weight: bold;" class="mycode_b">Using the Automated Build Package</span> (local or remote server)</span><br />
<span style="color: #e66900;" class="mycode_color">Easiest with an existing compatible server (PHP 8.2 or newer) and database system</span><br />
<br />
This package contains both MyBB's source code and installed dependencies (<code class="inline-code">inc/vendor/</code>).<br />
<br />
<span style="font-size: medium;" class="mycode_size"><a href="https://nightly.link/mybb/mybb/workflows/build-package/dev-1.9/package.zip" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">Download Automated Build Package</span> (.zip)</a></span><br />
<br />
The file is generated automatically on GitHub when the repository is updated.<br />
<br />
You can also download a package (Artifact) for <a href="https://github.com/mybb/mybb/actions/workflows/build-package.yml" target="_blank" rel="noopener" class="mycode_url">selected runs</a> of the <span style="font-style: italic;" class="mycode_i">Build Package</span> Action, generated after changes are pushed to the repository.<br />
<br />
When placed on the web server and accessed with a browser, the application should redirect to MyBB installation.<br />
<br />
<br />
<br />
</li>
<li><span style="font-size: large;" class="mycode_size">💻 <span style="font-weight: bold;" class="mycode_b">By running Composer</span> (locally)</span><br />
<span style="color: #85562f;" class="mycode_color">Easiest for development and testing</span><br />
<br />
With <a href="https://getcomposer.org/download/" target="_blank" rel="noopener" class="mycode_url">Composer</a> installed on your system, download MyBB from the repository branch, and run the following command in the directory:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-none">composer install</code></pre><br />
Alternatively, to leave out dependencies used only for development tools, use:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-none">composer install --no-dev</code></pre><br />
This will produce the same (or similar) set of files as in the Build Package above.<br />
<br />
When placed on the web server and accessed with a browser, the application should redirect to MyBB installation.<br />
<br />
<br />
<br />
</li>
<li><span style="font-size: large;" class="mycode_size">🐳 <span style="font-weight: bold;" class="mycode_b">Using Docker Compose</span> (local environment)</span><br />
<span style="color: #3464ec;" class="mycode_color">Easiest for testing different server versions</span><br />
<br />
Use Quick Start instructions for our <a href="https://github.com/mybb/deploy/tree/dev" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">Docker development stack</span></a>, with all services necessary for MyBB (nginx, PHP, database system) running in containers.<br />
<br />
This avoids the need to install, configure, or replace each component on your host system.<br />
<br />
The Composer installation command will be executed automatically, and MyBB will attempt automated installation.<br />
<br />
<br />
<br />
</li>
<li><img src="https://camo.mybb.com/373bf57a6506d285cebfb4a63fb8bf83490948f4/68747470733a2f2f646576696c7368616b65727a2e636f6d2f63646e2d7374617469632f666967757265732f31392d636f64657370616365732d73746570732e676966" data-original-url="https://devilshakerz.com/cdn-static/figures/19-codespaces-steps.gif" loading="lazy"  width="400" height="259" alt="[Image: 19-codespaces-steps.gif]" style="float: right;" class="mycode_img" /><span style="font-size: large;" class="mycode_size">🌐 <span style="font-weight: bold;" class="mycode_b">On GitHub Codespaces</span> (remote environment)</span><br />
<span style="color: #41a547;" class="mycode_color">Easiest for simple experiments, with a GitHub account</span><br />
<br />
GitHub offers a free quota for <a href="https://github.com/features/codespaces" target="_blank" rel="noopener" class="mycode_url">Codespaces</a>, an in-browser IDE and server.<br />
<br />
When logged in, open the <a href="https://github.com/mybb/mybb/tree/dev-1.9" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">dev-1.9</code> branch</a> and use the <span style="font-weight: bold;" class="mycode_b">Code → Codespaces</span> button to launch, and wait for the build script to make the temporary server available.<br />
<br />
MyBB will be installed automatically with a SQLite database.<br />
<br />
You can also <a href="https://docs.github.com/en/codespaces/developing-in-a-codespace/using-github-codespaces-in-visual-studio-code" target="_blank" rel="noopener" class="mycode_url">use VSCode locally</a>.<br />
</li>
</ul>
<br />
<br />
<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Source Updates:</span> Regular code changes in the repository that don't affect dependencies (<code class="inline-code">composer.json</code>, <code class="inline-code">composer.lock</code>) can usually be applied by simply overwriting selected source code files in your installation, similarly to MyBB 1.8.<br />
<br />
<br />
<br />
<span style="font-size: x-large;" class="mycode_size">Dependencies Self-Check</span><br />
<img src="https://camo.mybb.com/9cd7ca9bbb73154286fbe4f41654743700d2a3b7/68747470733a2f2f646576696c7368616b65727a2e636f6d2f63646e2d7374617469632f666967757265732f31392d6572726f722d646570656e64656e636965732d6e6f742d696e7374616c6c65642d6672616d652e706e67" data-original-url="https://devilshakerz.com/cdn-static/figures/19-error-dependencies-not-installed-frame.png" loading="lazy"  width="512" height="429" alt="[Image: 19-error-dependencies-not-installed-frame.png]" style="float: left;" class="mycode_img" /><br />
<br />
<br />
During runtime, MyBB's initialization includes the <a href="https://github.com/mybb/mybb/blob/dev-1.9/inc/src/bootstrap.php" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">inc/src/bootstrap.php</code></a> file, which makes custom and third-party code known and ready for automatic inclusion.<br />
<br />
MyBB checks for the existence of Composer-generated files and, if missing, displays a relevant error.<br />
<br />
If you encounter a <span style="font-style: italic;" class="mycode_i">Dependencies Not Installed</span> (code 48) error, make sure that your installation has an <code class="inline-code">inc/vendor/</code> directory - containing a number of folders and an <code class="inline-code">autoload.php</code> file.<br />
<br />
You can also cross-reference the content of <code class="inline-code">inc/vendor/</code> with the generated Build Packages above.<br class="clear" />]]></description>
			<content:encoded><![CDATA[<span style="font-size: x-large;" class="mycode_size">Working with the New Codebase</span><br />
<br />
Starting with version 1.9, developed on the <a href="https://github.com/mybb/mybb/tree/dev-1.9" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">dev-1.9</code></a> branch, MyBB's dependencies are managed using <a href="https://getcomposer.org/" target="_blank" rel="noopener" class="mycode_url">Composer</a>.<br />
<br />
This means that instead of copying third-party code into its own repository, various libraries and packages are declared in the <a href="https://github.com/mybb/mybb/blob/dev-1.9/composer.json" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">composer.json</code> file</a>. The corresponding complete list of dependencies, and their specific versions, are determined by the <a href="https://getcomposer.org/doc/03-cli.md#update-u-upgrade" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">composer update</code></a> utility, which generates the <a href="https://github.com/mybb/mybb/blob/dev-1.9/composer.lock" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">composer.lock</code> file</a>. These files are updated by contributors, and checked into the repository.<br />
<br />
Additionally, MyBB's own code structures added under <code class="inline-code">inc/src/</code> follow a common standard that allows their use without explicit <code class="inline-code">include</code> or <code class="inline-code">require</code> statements in PHP - with namespace-based <code class="inline-code">use</code> declarations (see <a href="https://github.com/mybb/mybb/blob/72d4f9b9be4bf4067142a11f290b70c245df53e8/inc/src/Extensions/Theme.php#L5-L10" target="_blank" rel="noopener" class="mycode_url">example</a>).<br />
<br />
Before MyBB can run, the packages and related information need to be downloaded and built using <a href="https://getcomposer.org/doc/03-cli.md#install-i" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">composer install</code></a>. The command may be run manually or included in various scripts, and will be part of the release process.<br />
<br />
<br />
<br />
<span style="font-size: x-large;" class="mycode_size">Running MyBB 1.9 from Source</span><br />
<br />
The following options are available to run the latest development version of MyBB 1.9:<br />
<br />
<ul class="mycode_list"><li><span style="font-size: large;" class="mycode_size">📦 <span style="font-weight: bold;" class="mycode_b">Using the Automated Build Package</span> (local or remote server)</span><br />
<span style="color: #e66900;" class="mycode_color">Easiest with an existing compatible server (PHP 8.2 or newer) and database system</span><br />
<br />
This package contains both MyBB's source code and installed dependencies (<code class="inline-code">inc/vendor/</code>).<br />
<br />
<span style="font-size: medium;" class="mycode_size"><a href="https://nightly.link/mybb/mybb/workflows/build-package/dev-1.9/package.zip" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">Download Automated Build Package</span> (.zip)</a></span><br />
<br />
The file is generated automatically on GitHub when the repository is updated.<br />
<br />
You can also download a package (Artifact) for <a href="https://github.com/mybb/mybb/actions/workflows/build-package.yml" target="_blank" rel="noopener" class="mycode_url">selected runs</a> of the <span style="font-style: italic;" class="mycode_i">Build Package</span> Action, generated after changes are pushed to the repository.<br />
<br />
When placed on the web server and accessed with a browser, the application should redirect to MyBB installation.<br />
<br />
<br />
<br />
</li>
<li><span style="font-size: large;" class="mycode_size">💻 <span style="font-weight: bold;" class="mycode_b">By running Composer</span> (locally)</span><br />
<span style="color: #85562f;" class="mycode_color">Easiest for development and testing</span><br />
<br />
With <a href="https://getcomposer.org/download/" target="_blank" rel="noopener" class="mycode_url">Composer</a> installed on your system, download MyBB from the repository branch, and run the following command in the directory:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-none">composer install</code></pre><br />
Alternatively, to leave out dependencies used only for development tools, use:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-none">composer install --no-dev</code></pre><br />
This will produce the same (or similar) set of files as in the Build Package above.<br />
<br />
When placed on the web server and accessed with a browser, the application should redirect to MyBB installation.<br />
<br />
<br />
<br />
</li>
<li><span style="font-size: large;" class="mycode_size">🐳 <span style="font-weight: bold;" class="mycode_b">Using Docker Compose</span> (local environment)</span><br />
<span style="color: #3464ec;" class="mycode_color">Easiest for testing different server versions</span><br />
<br />
Use Quick Start instructions for our <a href="https://github.com/mybb/deploy/tree/dev" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">Docker development stack</span></a>, with all services necessary for MyBB (nginx, PHP, database system) running in containers.<br />
<br />
This avoids the need to install, configure, or replace each component on your host system.<br />
<br />
The Composer installation command will be executed automatically, and MyBB will attempt automated installation.<br />
<br />
<br />
<br />
</li>
<li><img src="https://camo.mybb.com/373bf57a6506d285cebfb4a63fb8bf83490948f4/68747470733a2f2f646576696c7368616b65727a2e636f6d2f63646e2d7374617469632f666967757265732f31392d636f64657370616365732d73746570732e676966" data-original-url="https://devilshakerz.com/cdn-static/figures/19-codespaces-steps.gif" loading="lazy"  width="400" height="259" alt="[Image: 19-codespaces-steps.gif]" style="float: right;" class="mycode_img" /><span style="font-size: large;" class="mycode_size">🌐 <span style="font-weight: bold;" class="mycode_b">On GitHub Codespaces</span> (remote environment)</span><br />
<span style="color: #41a547;" class="mycode_color">Easiest for simple experiments, with a GitHub account</span><br />
<br />
GitHub offers a free quota for <a href="https://github.com/features/codespaces" target="_blank" rel="noopener" class="mycode_url">Codespaces</a>, an in-browser IDE and server.<br />
<br />
When logged in, open the <a href="https://github.com/mybb/mybb/tree/dev-1.9" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">dev-1.9</code> branch</a> and use the <span style="font-weight: bold;" class="mycode_b">Code → Codespaces</span> button to launch, and wait for the build script to make the temporary server available.<br />
<br />
MyBB will be installed automatically with a SQLite database.<br />
<br />
You can also <a href="https://docs.github.com/en/codespaces/developing-in-a-codespace/using-github-codespaces-in-visual-studio-code" target="_blank" rel="noopener" class="mycode_url">use VSCode locally</a>.<br />
</li>
</ul>
<br />
<br />
<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Source Updates:</span> Regular code changes in the repository that don't affect dependencies (<code class="inline-code">composer.json</code>, <code class="inline-code">composer.lock</code>) can usually be applied by simply overwriting selected source code files in your installation, similarly to MyBB 1.8.<br />
<br />
<br />
<br />
<span style="font-size: x-large;" class="mycode_size">Dependencies Self-Check</span><br />
<img src="https://camo.mybb.com/9cd7ca9bbb73154286fbe4f41654743700d2a3b7/68747470733a2f2f646576696c7368616b65727a2e636f6d2f63646e2d7374617469632f666967757265732f31392d6572726f722d646570656e64656e636965732d6e6f742d696e7374616c6c65642d6672616d652e706e67" data-original-url="https://devilshakerz.com/cdn-static/figures/19-error-dependencies-not-installed-frame.png" loading="lazy"  width="512" height="429" alt="[Image: 19-error-dependencies-not-installed-frame.png]" style="float: left;" class="mycode_img" /><br />
<br />
<br />
During runtime, MyBB's initialization includes the <a href="https://github.com/mybb/mybb/blob/dev-1.9/inc/src/bootstrap.php" target="_blank" rel="noopener" class="mycode_url"><code class="inline-code">inc/src/bootstrap.php</code></a> file, which makes custom and third-party code known and ready for automatic inclusion.<br />
<br />
MyBB checks for the existence of Composer-generated files and, if missing, displays a relevant error.<br />
<br />
If you encounter a <span style="font-style: italic;" class="mycode_i">Dependencies Not Installed</span> (code 48) error, make sure that your installation has an <code class="inline-code">inc/vendor/</code> directory - containing a number of folders and an <code class="inline-code">autoload.php</code> file.<br />
<br />
You can also cross-reference the content of <code class="inline-code">inc/vendor/</code> with the generated Build Packages above.<br class="clear" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[A mostly working MyBB 1.9 theme system: please test and share your feedback]]></title>
			<link>https://community.mybb.com/thread-236631.html</link>
			<pubDate>Mon, 03 Oct 2022 06:30:47 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://community.mybb.com/member.php?action=profile&uid=116662">Laird</a>]]></dc:creator>
			<guid isPermaLink="false">https://community.mybb.com/thread-236631.html</guid>
			<description><![CDATA[G'day MyBB admins, community members, and staff,<br />
<br />
I invite you to explore the MyBB 1.9 code I've been writing, which is now - although quite rough, and not free from errors - ready for testing.<br />
<br />
This code is focussed on the theme system, and in particular on the ACP Themes and Plugins modules.<br />
<br />
You can download it from <a href="https://github.com/lairdshaw/mybb/commits/dev-1.9-theme-system" target="_blank" rel="noopener" class="mycode_url">my personal 1.9 fork</a>.<br />
<br />
It is hopefully suitable for both installations and upgrades, but <span style="font-weight: bold;" class="mycode_b">definitely</span> not for production use. There <span style="font-weight: bold;" class="mycode_b">are</span> known errors, and it <span style="font-weight: bold;" class="mycode_b">is</span> incomplete.<br />
<br />
All feedback is welcome, especially regarding the theme system and its ACP UI, but please first check the TODO list below in case the issue is already queued.<br />
<br />
From tomorrow, I will be without my development environment for a few days. Leading up to that, I have worked hard to put together code that can be tested in the meantime. I will resume development when I return to my development environment.<br />
<br />
I will try to respond to any feedback shared before I leave, in approximately seventeen hours.<br />
<br />
A couple of points of note:<br />
<ol type="1" class="mycode_list"><li>Although I am a staff developer, I have developed this code without consultation beyond some exchanges, including on the spec, with dvz, who does not agree with all of my design decisions, and it is not official in any sense. It might or might not eventually be accepted by staff and the community, with or without modifications. At this point, it simply serves as a basis for exploration, evaluation, and comment. I have not even discussed with anybody else my intention to start this thread.<br />
<br />
</li>
<li>There are some deliberate deviations from <a href="https://github.com/mybb/meta/blob/main/architecture/mybb-1.9-theme-system.md" target="_blank" rel="noopener" class="mycode_url">the official spec</a>, however, I intend for inadvertent deviations (which exist) to be corrected.<br />
</li>
</ol>
<br />
<span style="font-weight: bold;" class="mycode_b">The basic idea</span><br />
<br />
Please first see the official spec (linked above). The extensions/amendments to that spec of my code are basically as follows:<br />
<br />
The theme system as a whole is independent of the database other than for global and user default theme settings: it is otherwise entirely filesystem-based.<br />
<br />
Both themes proper and plugins can supply "themelets" (see the spec). Themelets in my code have two basic directories ("modes"): <code class="inline-code">current</code> and <code class="inline-code">devdist</code>. The <code class="inline-code">current</code> directory/mode is intended for production use: in this mode, board themes can be derived from installed core/original themes, with only board themes being mutable. The <code class="inline-code">devdist</code> directory is intended for developers of a core/original theme to work on that theme (and then from which to distribute a new release of the theme) without modifying the contents of the <code class="inline-code">current</code> (production) version of the theme. "Development and distribution" (<code class="inline-code">devdist</code>) mode can be toggled on/off from the top of every page in the ACP Themes module, as well as via the equivalent <code class="inline-code">Board Settings</code> » <code class="inline-code">General Configuration</code> » <code class="inline-code">Development Mode (Themelets)</code> setting.<br />
<br />
Plugins must now be uploaded via a zip archive, which MyBB unpacks and auto-installs. This applies to both initial installation as well as upgrade. Changes have been made to plugin structure including the addition of a <code class="inline-code">plugin.json</code> resource file which replaces the <code class="inline-code">*_info()</code> plugin function.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Features from 1.8 not (yet) migrated</span><ul class="mycode_list"><li>The equivalent of "Find Updated Templates".<br />
<br />
</li>
<li>The Twig filesystem-based template equivalent of 1.8's <code class="inline-code">find_replace_templatesets()</code>.<br />
<br />
</li>
<li>The Twig filesystem-based template equivalent of the 1.8 ACP Template module's "Search/Replace" functionality.<br />
<br />
</li>
<li>Global templates. If the decision is to continue to support this feature, my suggestion is that it be supported via a unique theme with codename <code class="inline-code">board.global</code>. This could derive from a <code class="inline-code">core.global</code> theme if it is decided that any core-supplied templates should be globals.<br />
<br />
</li>
<li>Template Set semantics, in which a theme+stylesheets can be associated with an independent set of templates: on the current 1.9 approach, templates are part of the theme itself, rather than being a separate set. If the decision is that this functionality should be supported, my suggestion is to support it by allowing the specification for a theme of not just its parent, but also of its "parent for templates". Thus, it could inherit its stylesheets separately from its templates.<br />
<br />
</li>
<li>Inheritance of theme properties and stylesheet manifest/ordering.<br />
</li>
</ul>
<br />
<span style="font-weight: bold;" class="mycode_b">TODO</span><br />
<br />
Aside from those yet-to-be-migrated features, here's a slightly cleaned up version of my TODO list for this code (which I continue to develop) in no particular order:<ul class="mycode_list"><li>On theme upgrade: if the <code class="inline-code">stylesheets</code> property has changed from the prior version, flag in derived themelets that it needs updating.<br />
<br />
</li>
<li>Require on MyBB version upgrade that the upgrade script is always run so that at least (1) the version stored in the DB is always up to date, so we know which version number to archive the default theme to, and (2) the default theme actually *is* archived. To ensure that this requirement is met, on every page load, check the version stored in the DB against the version in code, and if they differ, refuse to show the page in question unless it is the upgrade script; for other pages, link to the upgrade script.<br />
<br />
</li>
<li>When breaking inheritance upon saving a themelet resource in the ACP, store its inheritance data in the relevant JSON file.<br />
<br />
</li>
<li>Update if required any ACP reporting modules where the log contents (esp. supplied arbitrary parameters) have been modified in <code class="inline-code">admin/modules/style/themes.php</code>.<br />
<br />
</li>
<li>Warn, upon attempting to export a theme, when changes applied by the 1.9 equivalent of <code class="inline-code">find_replace_templatesets()</code>, and provide a simple means of reverting them prior to export.<br />
<br />
</li>
<li>Remove redundant functions/files.<br />
<br />
</li>
<li>Prevent the duplication of the core theme as a sibling.<br />
<br />
</li>
<li>Ensure that the <code class="inline-code">derivations</code> property of the theme <code class="inline-code">resources.json</code> file is correctly set when importing/duplicating themes.<br />
<br />
</li>
<li>Check through admin/modules/style/themes.php for:<br />
   <ul class="mycode_list"><li>
   <br />
</li>
<li>Missing hooks.<br />
   <br />
</li>
<li>Missing admin logging for template-related actions.<br />
    <br />
</li>
</ul>
<br />
</li>
<li>Update the functionality of the Browse Themes tab in the ACP Themes module.<br />
<br />
</li>
<li>Update PHPDoc blocks as required.<br />
<br />
</li>
<li>Check it's a directory not a file before warning in Plugins page that a staged plugin file is non-existent/unreadable.<br />
<br />
</li>
<li>Check whether a plugin's/theme's codename matches its directory when installing/importing (in particular in <code class="inline-code">get_staged_plugins()</code> and <code class="inline-code">get_staged_themes()</code>).<br />
<br />
</li>
<li>Resolve the redundancy in which the VERSION constant in <code class="inline-code">inc/src/Application.php</code> is duplicated by MyBB::&#36;version in <code class="inline-code">inc/class_core.php</code>.<br />
<br />
</li>
<li>Update the System Health =&gt; Check Templates code to handle FS templates.<br />
<br />
</li>
<li>Update debug_page() for FS templates.<br />
<br />
</li>
<li>In xmlhttp.php, replace the commented-out eval()s with renderings of Twig templates (there don't yet seem to be appropriate existing Twig templates).<br />
<br />
</li>
<li>Modify the plugin unzip code to use a temporary directory for initial unzip rather than the staging directory.<br />
<br />
</li>
<li>Move hard-coded language strings in inc/functions_themes.php into a language file.<br />
<br />
</li>
<li>Rather than alternative <code class="inline-code">_key</code> plugin.json properties, provide for this implicitly in the main property, per <a href="https://discord.com/channels/215876847634743296/378987603325747201/1001840574313283644" target="_blank" rel="noopener" class="mycode_url">https://discord.com/channels/21587684763...4313283644</a><br />
<br />
</li>
<li>Update copyright notices on all files: 1.8 =&gt; 1.9. Update copyright date notice for modded files to 2022.<br />
<br />
</li>
<li>Generate and store information about new conflicts with board themes that descend from newly upgraded/downgraded themes (see the corresponding TODO currently on lines 509-510 in <code class="inline-code">admin/modules/style/themes.php</code>).<br />
<br />
</li>
<li>Add sub-tabs to the stylesheet property editing ACP page.<br />
<br />
</li>
<li>Using Javascript, make the template listing collapsible/expandable.<br />
<br />
</li>
<li>Add quick link actions in the template listing to add and/or delete subdirectories (recursively deleting all dirs/files in those subdirectories).<br />
<br />
</li>
<li>When visiting the root ACP Theme page, check for themes in the staging directory, and offer to install or delete them (indicating whether it appears that they are already installed), as we already do for the ACP Plugins page.<br />
<br />
</li>
<li>Add an "Archive this plugin's current themelet" button to the ACP Plugins page. Indicate to developers that immediately after releasing a plugin version they should click this button on their development installation. Then, they can go ahead and modify their plugin's themelet on that installation, and the plugin's version number can (when desired) be updated.<br />
<br />
</li>
<li>Add to the requirements check a test for being able to write to the filesystem everywhere below the root in general, but to <code class="inline-code">inc/plugins</code>, <code class="inline-code">inc/themes</code> directories, and <code class="inline-code">inc/themes/core.default</code> in particular.<br />
<br />
</li>
<li>Disable the Twig cache when in development mode.<br />
<br />
</li>
<li>Correct the upgrade message which says "All templates reverted" or something like that when what was actually accomplished was the installation of the core theme.<br />
<br />
</li>
<li>Stipulate somewhere/somehow that stylesheet names may not begin with <code class="inline-code">ext.</code> - that is reserved for indicating that the stylesheet is inherited from a plugin with the codename follow <code class="inline-code">ext.</code>.<br />
<br />
</li>
<li>Implement JSON file validation functions which check both for the existence of required properties and the non-existence of invalid properties: e.g., <code class="inline-code">validate_theme_properties()</code>, <code class="inline-code">validate_plugin_properties()</code>, <code class="inline-code">validate_plugin_resources()</code>, etc.<br />
</li>
</ul>
]]></description>
			<content:encoded><![CDATA[G'day MyBB admins, community members, and staff,<br />
<br />
I invite you to explore the MyBB 1.9 code I've been writing, which is now - although quite rough, and not free from errors - ready for testing.<br />
<br />
This code is focussed on the theme system, and in particular on the ACP Themes and Plugins modules.<br />
<br />
You can download it from <a href="https://github.com/lairdshaw/mybb/commits/dev-1.9-theme-system" target="_blank" rel="noopener" class="mycode_url">my personal 1.9 fork</a>.<br />
<br />
It is hopefully suitable for both installations and upgrades, but <span style="font-weight: bold;" class="mycode_b">definitely</span> not for production use. There <span style="font-weight: bold;" class="mycode_b">are</span> known errors, and it <span style="font-weight: bold;" class="mycode_b">is</span> incomplete.<br />
<br />
All feedback is welcome, especially regarding the theme system and its ACP UI, but please first check the TODO list below in case the issue is already queued.<br />
<br />
From tomorrow, I will be without my development environment for a few days. Leading up to that, I have worked hard to put together code that can be tested in the meantime. I will resume development when I return to my development environment.<br />
<br />
I will try to respond to any feedback shared before I leave, in approximately seventeen hours.<br />
<br />
A couple of points of note:<br />
<ol type="1" class="mycode_list"><li>Although I am a staff developer, I have developed this code without consultation beyond some exchanges, including on the spec, with dvz, who does not agree with all of my design decisions, and it is not official in any sense. It might or might not eventually be accepted by staff and the community, with or without modifications. At this point, it simply serves as a basis for exploration, evaluation, and comment. I have not even discussed with anybody else my intention to start this thread.<br />
<br />
</li>
<li>There are some deliberate deviations from <a href="https://github.com/mybb/meta/blob/main/architecture/mybb-1.9-theme-system.md" target="_blank" rel="noopener" class="mycode_url">the official spec</a>, however, I intend for inadvertent deviations (which exist) to be corrected.<br />
</li>
</ol>
<br />
<span style="font-weight: bold;" class="mycode_b">The basic idea</span><br />
<br />
Please first see the official spec (linked above). The extensions/amendments to that spec of my code are basically as follows:<br />
<br />
The theme system as a whole is independent of the database other than for global and user default theme settings: it is otherwise entirely filesystem-based.<br />
<br />
Both themes proper and plugins can supply "themelets" (see the spec). Themelets in my code have two basic directories ("modes"): <code class="inline-code">current</code> and <code class="inline-code">devdist</code>. The <code class="inline-code">current</code> directory/mode is intended for production use: in this mode, board themes can be derived from installed core/original themes, with only board themes being mutable. The <code class="inline-code">devdist</code> directory is intended for developers of a core/original theme to work on that theme (and then from which to distribute a new release of the theme) without modifying the contents of the <code class="inline-code">current</code> (production) version of the theme. "Development and distribution" (<code class="inline-code">devdist</code>) mode can be toggled on/off from the top of every page in the ACP Themes module, as well as via the equivalent <code class="inline-code">Board Settings</code> » <code class="inline-code">General Configuration</code> » <code class="inline-code">Development Mode (Themelets)</code> setting.<br />
<br />
Plugins must now be uploaded via a zip archive, which MyBB unpacks and auto-installs. This applies to both initial installation as well as upgrade. Changes have been made to plugin structure including the addition of a <code class="inline-code">plugin.json</code> resource file which replaces the <code class="inline-code">*_info()</code> plugin function.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Features from 1.8 not (yet) migrated</span><ul class="mycode_list"><li>The equivalent of "Find Updated Templates".<br />
<br />
</li>
<li>The Twig filesystem-based template equivalent of 1.8's <code class="inline-code">find_replace_templatesets()</code>.<br />
<br />
</li>
<li>The Twig filesystem-based template equivalent of the 1.8 ACP Template module's "Search/Replace" functionality.<br />
<br />
</li>
<li>Global templates. If the decision is to continue to support this feature, my suggestion is that it be supported via a unique theme with codename <code class="inline-code">board.global</code>. This could derive from a <code class="inline-code">core.global</code> theme if it is decided that any core-supplied templates should be globals.<br />
<br />
</li>
<li>Template Set semantics, in which a theme+stylesheets can be associated with an independent set of templates: on the current 1.9 approach, templates are part of the theme itself, rather than being a separate set. If the decision is that this functionality should be supported, my suggestion is to support it by allowing the specification for a theme of not just its parent, but also of its "parent for templates". Thus, it could inherit its stylesheets separately from its templates.<br />
<br />
</li>
<li>Inheritance of theme properties and stylesheet manifest/ordering.<br />
</li>
</ul>
<br />
<span style="font-weight: bold;" class="mycode_b">TODO</span><br />
<br />
Aside from those yet-to-be-migrated features, here's a slightly cleaned up version of my TODO list for this code (which I continue to develop) in no particular order:<ul class="mycode_list"><li>On theme upgrade: if the <code class="inline-code">stylesheets</code> property has changed from the prior version, flag in derived themelets that it needs updating.<br />
<br />
</li>
<li>Require on MyBB version upgrade that the upgrade script is always run so that at least (1) the version stored in the DB is always up to date, so we know which version number to archive the default theme to, and (2) the default theme actually *is* archived. To ensure that this requirement is met, on every page load, check the version stored in the DB against the version in code, and if they differ, refuse to show the page in question unless it is the upgrade script; for other pages, link to the upgrade script.<br />
<br />
</li>
<li>When breaking inheritance upon saving a themelet resource in the ACP, store its inheritance data in the relevant JSON file.<br />
<br />
</li>
<li>Update if required any ACP reporting modules where the log contents (esp. supplied arbitrary parameters) have been modified in <code class="inline-code">admin/modules/style/themes.php</code>.<br />
<br />
</li>
<li>Warn, upon attempting to export a theme, when changes applied by the 1.9 equivalent of <code class="inline-code">find_replace_templatesets()</code>, and provide a simple means of reverting them prior to export.<br />
<br />
</li>
<li>Remove redundant functions/files.<br />
<br />
</li>
<li>Prevent the duplication of the core theme as a sibling.<br />
<br />
</li>
<li>Ensure that the <code class="inline-code">derivations</code> property of the theme <code class="inline-code">resources.json</code> file is correctly set when importing/duplicating themes.<br />
<br />
</li>
<li>Check through admin/modules/style/themes.php for:<br />
   <ul class="mycode_list"><li>
   <br />
</li>
<li>Missing hooks.<br />
   <br />
</li>
<li>Missing admin logging for template-related actions.<br />
    <br />
</li>
</ul>
<br />
</li>
<li>Update the functionality of the Browse Themes tab in the ACP Themes module.<br />
<br />
</li>
<li>Update PHPDoc blocks as required.<br />
<br />
</li>
<li>Check it's a directory not a file before warning in Plugins page that a staged plugin file is non-existent/unreadable.<br />
<br />
</li>
<li>Check whether a plugin's/theme's codename matches its directory when installing/importing (in particular in <code class="inline-code">get_staged_plugins()</code> and <code class="inline-code">get_staged_themes()</code>).<br />
<br />
</li>
<li>Resolve the redundancy in which the VERSION constant in <code class="inline-code">inc/src/Application.php</code> is duplicated by MyBB::&#36;version in <code class="inline-code">inc/class_core.php</code>.<br />
<br />
</li>
<li>Update the System Health =&gt; Check Templates code to handle FS templates.<br />
<br />
</li>
<li>Update debug_page() for FS templates.<br />
<br />
</li>
<li>In xmlhttp.php, replace the commented-out eval()s with renderings of Twig templates (there don't yet seem to be appropriate existing Twig templates).<br />
<br />
</li>
<li>Modify the plugin unzip code to use a temporary directory for initial unzip rather than the staging directory.<br />
<br />
</li>
<li>Move hard-coded language strings in inc/functions_themes.php into a language file.<br />
<br />
</li>
<li>Rather than alternative <code class="inline-code">_key</code> plugin.json properties, provide for this implicitly in the main property, per <a href="https://discord.com/channels/215876847634743296/378987603325747201/1001840574313283644" target="_blank" rel="noopener" class="mycode_url">https://discord.com/channels/21587684763...4313283644</a><br />
<br />
</li>
<li>Update copyright notices on all files: 1.8 =&gt; 1.9. Update copyright date notice for modded files to 2022.<br />
<br />
</li>
<li>Generate and store information about new conflicts with board themes that descend from newly upgraded/downgraded themes (see the corresponding TODO currently on lines 509-510 in <code class="inline-code">admin/modules/style/themes.php</code>).<br />
<br />
</li>
<li>Add sub-tabs to the stylesheet property editing ACP page.<br />
<br />
</li>
<li>Using Javascript, make the template listing collapsible/expandable.<br />
<br />
</li>
<li>Add quick link actions in the template listing to add and/or delete subdirectories (recursively deleting all dirs/files in those subdirectories).<br />
<br />
</li>
<li>When visiting the root ACP Theme page, check for themes in the staging directory, and offer to install or delete them (indicating whether it appears that they are already installed), as we already do for the ACP Plugins page.<br />
<br />
</li>
<li>Add an "Archive this plugin's current themelet" button to the ACP Plugins page. Indicate to developers that immediately after releasing a plugin version they should click this button on their development installation. Then, they can go ahead and modify their plugin's themelet on that installation, and the plugin's version number can (when desired) be updated.<br />
<br />
</li>
<li>Add to the requirements check a test for being able to write to the filesystem everywhere below the root in general, but to <code class="inline-code">inc/plugins</code>, <code class="inline-code">inc/themes</code> directories, and <code class="inline-code">inc/themes/core.default</code> in particular.<br />
<br />
</li>
<li>Disable the Twig cache when in development mode.<br />
<br />
</li>
<li>Correct the upgrade message which says "All templates reverted" or something like that when what was actually accomplished was the installation of the core theme.<br />
<br />
</li>
<li>Stipulate somewhere/somehow that stylesheet names may not begin with <code class="inline-code">ext.</code> - that is reserved for indicating that the stylesheet is inherited from a plugin with the codename follow <code class="inline-code">ext.</code>.<br />
<br />
</li>
<li>Implement JSON file validation functions which check both for the existence of required properties and the non-existence of invalid properties: e.g., <code class="inline-code">validate_theme_properties()</code>, <code class="inline-code">validate_plugin_properties()</code>, <code class="inline-code">validate_plugin_resources()</code>, etc.<br />
</li>
</ul>
]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[1.9 dev Errors and strange behaviors]]></title>
			<link>https://community.mybb.com/thread-236516.html</link>
			<pubDate>Tue, 13 Sep 2022 13:50:22 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://community.mybb.com/member.php?action=profile&uid=146336">mikser1</a>]]></dc:creator>
			<guid isPermaLink="false">https://community.mybb.com/thread-236516.html</guid>
			<description><![CDATA[This is a list of errors and strange behaviors I've found in 1.9 dev version.<br />
<br />
<span style="font-style: italic;" class="mycode_i">If I posted in wrong section, please be kind to move it.</span><br />
<br />
<span style="font-weight: bold;" class="mycode_b">1. </span>Closing already closed thread (success message before error page): <a href="https://i.imgur.com/vhHgtsB.gif" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/vhHgtsB.gif</a><br />
<span style="font-weight: bold;" class="mycode_b">2. </span>Awaiting approval count does not appear in thread list: <a href="https://i.imgur.com/27qTRJl.png" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/27qTRJl.png</a> &amp; <a href="https://i.imgur.com/6uSJa2J.gif" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/6uSJa2J.gif</a><br />
<span style="font-weight: bold;" class="mycode_b">3. </span>Buddy list string with &lt;em&gt;&lt;/em&gt;: <a href="https://i.imgur.com/5xPGc3M.png" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/5xPGc3M.png</a><br />
<span style="font-weight: bold;" class="mycode_b">4. </span>Buddy list modal strange behavior: <a href="https://i.imgur.com/uZnV2iR.gif" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/uZnV2iR.gif</a><br />
<span style="font-weight: bold;" class="mycode_b">5.</span> Edit button next to username &gt; date does nothing: <a href="https://i.imgur.com/z5BlCX8.gif" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/z5BlCX8.gif</a><br />
<span style="font-weight: bold;" class="mycode_b">6. </span>Default buttons style in Edit post: <a href="https://i.imgur.com/FYO5AGi.png" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/FYO5AGi.png</a><br />
<span style="font-weight: bold;" class="mycode_b">7. </span>Thread saved as draft after pressing enter in title field: <a href="https://i.imgur.com/ycc0FMP.gif" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/ycc0FMP.gif</a><br />
<span style="font-weight: bold;" class="mycode_b">8. </span>Modal Error code not visible due to text color: <a href="https://i.imgur.com/S3yZzBU.gif" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/S3yZzBU.gif</a><br />
<span style="font-weight: bold;" class="mycode_b">9. </span>Inline moderation strange behavior: <a href="https://i.imgur.com/F7O0GEg.gif" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/F7O0GEg.gif</a><br />
<span style="font-weight: bold;" class="mycode_b">10. </span>Last post time is not inline-block causing it to have full width and go behind avatar: <a href="https://i.imgur.com/8XkACCh.gif" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/8XkACCh.gif</a><br />
<span style="font-weight: bold;" class="mycode_b">11. </span>Should error pages have a return button? <a href="https://i.imgur.com/TLDHQbz.gif" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/TLDHQbz.gif</a><br />
<span style="font-weight: bold;" class="mycode_b">12. </span>PM quick reply has quote by default: <a href="https://i.imgur.com/R2bxPPo.png" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/R2bxPPo.png</a><br />
<span style="font-weight: bold;" class="mycode_b">13. </span>Strange characters while searching for a member: <a href="https://i.imgur.com/9pIO1xy.png" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/9pIO1xy.png</a><br />
<span style="font-weight: bold;" class="mycode_b">14. </span>Smilies strange behavior (I am not sure if I am doing this wrong): <a href="https://i.imgur.com/OP7FTVX.gif" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/OP7FTVX.gif</a><br />
<span style="font-weight: bold;" class="mycode_b">15. </span>Thread rating has no images and it's displayed as column: <a href="https://i.imgur.com/0TrLEba.png" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/0TrLEba.png</a>]]></description>
			<content:encoded><![CDATA[This is a list of errors and strange behaviors I've found in 1.9 dev version.<br />
<br />
<span style="font-style: italic;" class="mycode_i">If I posted in wrong section, please be kind to move it.</span><br />
<br />
<span style="font-weight: bold;" class="mycode_b">1. </span>Closing already closed thread (success message before error page): <a href="https://i.imgur.com/vhHgtsB.gif" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/vhHgtsB.gif</a><br />
<span style="font-weight: bold;" class="mycode_b">2. </span>Awaiting approval count does not appear in thread list: <a href="https://i.imgur.com/27qTRJl.png" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/27qTRJl.png</a> &amp; <a href="https://i.imgur.com/6uSJa2J.gif" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/6uSJa2J.gif</a><br />
<span style="font-weight: bold;" class="mycode_b">3. </span>Buddy list string with &lt;em&gt;&lt;/em&gt;: <a href="https://i.imgur.com/5xPGc3M.png" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/5xPGc3M.png</a><br />
<span style="font-weight: bold;" class="mycode_b">4. </span>Buddy list modal strange behavior: <a href="https://i.imgur.com/uZnV2iR.gif" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/uZnV2iR.gif</a><br />
<span style="font-weight: bold;" class="mycode_b">5.</span> Edit button next to username &gt; date does nothing: <a href="https://i.imgur.com/z5BlCX8.gif" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/z5BlCX8.gif</a><br />
<span style="font-weight: bold;" class="mycode_b">6. </span>Default buttons style in Edit post: <a href="https://i.imgur.com/FYO5AGi.png" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/FYO5AGi.png</a><br />
<span style="font-weight: bold;" class="mycode_b">7. </span>Thread saved as draft after pressing enter in title field: <a href="https://i.imgur.com/ycc0FMP.gif" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/ycc0FMP.gif</a><br />
<span style="font-weight: bold;" class="mycode_b">8. </span>Modal Error code not visible due to text color: <a href="https://i.imgur.com/S3yZzBU.gif" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/S3yZzBU.gif</a><br />
<span style="font-weight: bold;" class="mycode_b">9. </span>Inline moderation strange behavior: <a href="https://i.imgur.com/F7O0GEg.gif" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/F7O0GEg.gif</a><br />
<span style="font-weight: bold;" class="mycode_b">10. </span>Last post time is not inline-block causing it to have full width and go behind avatar: <a href="https://i.imgur.com/8XkACCh.gif" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/8XkACCh.gif</a><br />
<span style="font-weight: bold;" class="mycode_b">11. </span>Should error pages have a return button? <a href="https://i.imgur.com/TLDHQbz.gif" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/TLDHQbz.gif</a><br />
<span style="font-weight: bold;" class="mycode_b">12. </span>PM quick reply has quote by default: <a href="https://i.imgur.com/R2bxPPo.png" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/R2bxPPo.png</a><br />
<span style="font-weight: bold;" class="mycode_b">13. </span>Strange characters while searching for a member: <a href="https://i.imgur.com/9pIO1xy.png" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/9pIO1xy.png</a><br />
<span style="font-weight: bold;" class="mycode_b">14. </span>Smilies strange behavior (I am not sure if I am doing this wrong): <a href="https://i.imgur.com/OP7FTVX.gif" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/OP7FTVX.gif</a><br />
<span style="font-weight: bold;" class="mycode_b">15. </span>Thread rating has no images and it's displayed as column: <a href="https://i.imgur.com/0TrLEba.png" target="_blank" rel="noopener" class="mycode_url">https://i.imgur.com/0TrLEba.png</a>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[The 1.9 theme and template system]]></title>
			<link>https://community.mybb.com/thread-232217.html</link>
			<pubDate>Sat, 24 Apr 2021 22:56:47 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://community.mybb.com/member.php?action=profile&uid=116662">Laird</a>]]></dc:creator>
			<guid isPermaLink="false">https://community.mybb.com/thread-232217.html</guid>
			<description><![CDATA[With 1.9 development hopefully to resume soon, it seems useful to discuss how the key new change - the migration of the template system to Twig - will be finalised. The current plan seems to be to move templates out of the database and into the filesystem, so that they can be more easily edited outside of the MyBB admin interface itself.<br />
<br />
There are pros and cons to this. Here are those of which I am aware:<br />
<br />
Pros:<br />
<ol type="1" class="mycode_list"><li>Filesystem editing of templates offers more flexibility and user-friendliness in general.<br />
</li>
<li>Filesystem editing of templates makes the template/theme design task easier for theme designers.<br />
</li>
</ol>
Cons:<br />
<ol type="1" class="mycode_list"><li>Filesystem editing of templates makes reliable synchronisation of template/theme metadata impossible.<br />
</li>
<li>Switching to filesystem editing of templates and discarding the existing DB-based paradigm involves more work, and delays the release of 1.9.<br />
</li>
</ol>
For me, the cons outweigh the pros, but this is not a hill on which I plan to die; if the consensus is to go with filesystem templates, then that's OK with me.<br />
<br />
Just briefly, here's why I think metadata is important:<br />
<br />
I envisage a future in which the Find Updated Templates feature is largely unnecessary, because on upgrade, the system detects the version on which a template was based, the version to which it is being upgraded, and auto-generates the equivalent of a patch between the two, which it then auto-applies when it can, regardless of any edits the admin has made to the template. (I'd like to see the same for stylesheets too).<br />
<br />
This means, though, that when templates (and stylesheets) are edited, one piece of metadata needs to be reliably stored/updated: the version on which the edited template (or stylesheet) was based. We can ensure reliable storage/updating of this metadata when we require template/stylesheet editing to be done through the ACP. We can't when users can edit templates/stylesheets in the filesystem.<br />
<br />
Anyhow, there are more than likely other pros and cons, and other considerations. Given that resumption of work on 1.9 is getting closer, I thought it was worth starting a public discussion to get community input.]]></description>
			<content:encoded><![CDATA[With 1.9 development hopefully to resume soon, it seems useful to discuss how the key new change - the migration of the template system to Twig - will be finalised. The current plan seems to be to move templates out of the database and into the filesystem, so that they can be more easily edited outside of the MyBB admin interface itself.<br />
<br />
There are pros and cons to this. Here are those of which I am aware:<br />
<br />
Pros:<br />
<ol type="1" class="mycode_list"><li>Filesystem editing of templates offers more flexibility and user-friendliness in general.<br />
</li>
<li>Filesystem editing of templates makes the template/theme design task easier for theme designers.<br />
</li>
</ol>
Cons:<br />
<ol type="1" class="mycode_list"><li>Filesystem editing of templates makes reliable synchronisation of template/theme metadata impossible.<br />
</li>
<li>Switching to filesystem editing of templates and discarding the existing DB-based paradigm involves more work, and delays the release of 1.9.<br />
</li>
</ol>
For me, the cons outweigh the pros, but this is not a hill on which I plan to die; if the consensus is to go with filesystem templates, then that's OK with me.<br />
<br />
Just briefly, here's why I think metadata is important:<br />
<br />
I envisage a future in which the Find Updated Templates feature is largely unnecessary, because on upgrade, the system detects the version on which a template was based, the version to which it is being upgraded, and auto-generates the equivalent of a patch between the two, which it then auto-applies when it can, regardless of any edits the admin has made to the template. (I'd like to see the same for stylesheets too).<br />
<br />
This means, though, that when templates (and stylesheets) are edited, one piece of metadata needs to be reliably stored/updated: the version on which the edited template (or stylesheet) was based. We can ensure reliable storage/updating of this metadata when we require template/stylesheet editing to be done through the ACP. We can't when users can edit templates/stylesheets in the filesystem.<br />
<br />
Anyhow, there are more than likely other pros and cons, and other considerations. Given that resumption of work on 1.9 is getting closer, I thought it was worth starting a public discussion to get community input.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Suggestions for prioritising the release of 1.9]]></title>
			<link>https://community.mybb.com/thread-231966.html</link>
			<pubDate>Mon, 29 Mar 2021 07:15:56 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://community.mybb.com/member.php?action=profile&uid=116662">Laird</a>]]></dc:creator>
			<guid isPermaLink="false">https://community.mybb.com/thread-231966.html</guid>
			<description><![CDATA[[Originally posted in a team-only private forum; moved to this public forum at Devilshakerz's suggestion]<br />
<br />
Hi all,<br />
<br />
As I wrote in my application to join the team, my highest priority, which I believe mirrors that of our users, is a default responsive theme, which means prioritising the release of 1.9. My analysis and recommendations in this respect after some thought follow.<br />
<br />
Development discussions are, of course, better had publicly and transparently, however, given that the release of 1.9 has become a sensitive issue, with some in the community angry about its delay, I am posting this thread privately to start with. I will repost it publicly (edited if necessary) if the consensus here is that that's appropriate.<br />
<br />
As a new and relatively uninformed team member, this all might come across as unjustifiably assertive, perhaps even presumptuous or arrogant. If so, please forgive me: my intention is simply to forge the best (immediate) path forward for our project. Where I get it wrong, especially due to ignorance or error, I hope that you will correct me. Where I overstep the bounds of my role, I hope that you will let me know.<br />
<br />
That said, here is what I've come up with.<br />
<br />
In summary, my recommendations for the initial 1.9 release are for:<br />
<ol type="1" class="mycode_list"><li>1.8.27 to be the last release prior to 1.9, and for the list of PRs planned to be merged prior to 1.8.27 to be ASAP (a) minimised and (b) frozen, and, thereafter, for all remaining PRs to be deferred to the 1.9 branch (with conflicts resolved as necessary) - but for even those PRs deferred to the 1.9 branch to not necessarily be applied prior to its initial release, the timeliness of which should be prioritised above the merging of (non-critical) PRs.<br />
</li>
<li>All non-critical unimplemented changes for 1.9 other than to the template system to be deferred to a later release.<br />
</li>
<li>Changes to the template system for 1.9 anyway to be minimised, except for backwards-incompatible changes, which should be kept to the bare minimum necessary to avoid future backwards-incompatible changes given the functionality we ultimately plan to, or will potentially, implement.<br />
</li>
</ol>
I have thought about <a href="https://github.com/mybb/mybb/issues/3689" target="_blank" rel="noopener" class="mycode_url">issue #3689</a>, <span style="font-style: italic;" class="mycode_i">1.9 Theme System</span>, to which Devilshakerz pointed me in my application thread. I do not currently have answers to all of the questions raised at the start, but here are some responses to, and considerations arising from, the discussion:<ul class="mycode_list"><li>I love Euan's idea of a JS manager similar to the stylesheet manager, also with support for the stipulation of dependencies. Although it is perhaps debatable as to whether or not this should be considered a non-backwards-compatible change that ought to be included in the initial 1.9 release, my view is that it is not, since we wouldn't be able to force plugin developers to use it anyway; the approach of inserting JS files into templates would always be available to them regardless. Thus, I do not think that we should aim to include it in the initial 1.9 release.<br />
</li>
<li>I also love Devilshakerz's idea of enhancing <span style="font-style: italic;" class="mycode_i">Find Updated Templates</span> so as to provide '<span style="font-style: italic;" class="mycode_i">a comparison of what's changed in [a] specific upgrade in the master set; these "diffs" would be easier to recognize than master-custom comparison (as unrelated modifications are caught up in the report), along with a suitable UI (perhaps the diff - "suggested changes"/"copy these" - and an editor side-by-side).</span>'<br />
</li>
</ul>
Also, I love the idea of providing the same sort of updating functionality - the sort that Devilshakerz suggests there that we extend with respect to templates - for stylesheets and Javascript files too. This is (with the caveats noted below) a backwards-compatible change though, so I recommend that we defer it beyond the initial 1.9 release.<br />
<br />
Looking a little more closely into the current <span style="font-style: italic;" class="mycode_i">Find Updated Templates</span> diff functionality, as Devilshakerz's comments suggest it is fruitful to do, I have an observation which might turn out to be false (and if you know it to be false, then please say so), but which right now seems to me to be true:<br />
<br />
Because the diff is only two-way, and doesn't have access to nor take into account the prior Master template upon which the admin based their custom template, the explanation at the top of the diff report is not always accurate, that explanation being (colours not identical):<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite><span style="color: #64e15b;" class="mycode_color">Changes that have been made between your previous version and this one are highlighted like this.</span><br />
<span style="color: #fa6464;" class="mycode_color">Any customizations you've made to your templates (the old ones) are highlighted like this.</span></blockquote>
<br />
It seems to me that if the new Master template <span style="font-style: italic;" class="mycode_i">deletes</span> content present in the prior Master template, this will be shown in light red, for the admin to interpret as a "customization" that they had made to that prior template, which it is not, and which they had not.<br />
<br />
It seems to me that this confusion can best be resolved by running a three-way (or at least a dual) diff, which <span style="font-style: italic;" class="mycode_i">does</span> take into account the contents of the prior Master template from which the admin had generated their custom template. This, in turn, means storing that prior Master template and its relationship with the customised template. This would presumably be done automatically when the admin first saves an edited version of the (then-current) Master template.<br />
<br />
This would allow us to extend Devilshakerz's idea a little: we could auto-generate a "patch" between the version of the Master template which the admin had customised, and the new version of the Master template, and then attempt to auto-apply that "patch". If there were no conflicts with the customisations made by the admin, then we could simply auto-apply the patch and avoid the need for the template to even show up in "Find Updated Templates" at all (perhaps, for safety, this would be configurable, as in a yes/no setting somewhere in the ACP something like "Attempt to auto-apply core updates to customised templates where possible?"). Again, this depends on the prior Master template being stored and related to the customised template.<br />
<br />
I emphasise that final point because I think that it is of concern given the current goal of user-editable filesystem-based templates. In general, the problem is this: certain features such as the one I've just canvassed require that metadata is automatically generated and then associated with a customised template when that template is saved, however, it is impossible to automatically generate that metadata, let alone automatically store it against that template, when edits to templates are permitted via the filesystem. Too, in a filesystem-based approach, the best place to store that metadata might well be in the same file as the (user-editable) template, however, this would mix user-editable data with auto-generated data, which in my opinion is bad practice with meaningful potential for error.<br />
<br />
Regarding inheritance, I agree with Wildcard in that issue's comments that the current system works well and seems to be optimal. Again, though, I have concerns about the implementation of inheritance given user-editable filesystem-based templates. In particular: how is inheritance to be implemented in files? If a user-editable filesystem template inherits from the Master template, then what does this look like in the filesystem? If it is implemented via an empty template file, then this confounds the user's editing experience, since the user then has to locate the Master template and manually copy its contents in on first edit. On the other hand, if it is implemented by a template file with contents identical to the Master template, then an inheriting template cannot be distinguished from one which does not inherit but happens to have the same contents as the Master template anyway. Neither of these options seem to me to be viable, and I can't see an alternative, viable option. If anybody else can, then please say so.<br />
<br />
For these two reasons (and there might be others that I've overlooked), I think that filesystem-based templates, especially when user-editable independently of the MyBB UI, are not a good idea, and should be abandoned. If ease of editing is our goal, then incorporating into core Shade's FASTyle plugin, as suggested in the comments of <a href="https://github.com/mybb/mybb/issues/3686" target="_blank" rel="noopener" class="mycode_url">issue #3686</a>, <span style="font-style: italic;" class="mycode_i">Allow editing of Twig templates from the ACP</span>, is a better idea. However, as this is a backwards-compatible change, my recommendation is that it be deferred beyond the initial 1.9 release.<br />
<br />
I end this missive then with a fourth and final recommendation:<ul class="mycode_list"><li>That minimal changes be made to the templating system for the initial 1.9 release: Twig templates can and should be distributed, stored, and edited in the same way as templates for 1.8 - including by plugins via the <code class="inline-code">find_replace_templatesets()</code> function - except where this conflicts with a planned future feature which would otherwise be backwards-incompatible.<br />
</li>
</ul>
The only such feature which I am currently suggesting is the auto-patching of customised templates, which requires from the start that the version of the Master template upon which a custom template was based be stored against that custom template. Since we would ultimately want this same auto-patching to be possible for stylesheets though, we would also want 1.9 from the start to version stylesheets (just as for templates) and to store against each customised stylesheet the version of the Master stylesheet on which it is based.<br />
<br />
I encourage others to suggest their own such features ASAP so that we can plan for them, and implement the necessary infrastructure for them in, and then roll out ASAP, MyBB 1.9 with a default responsive theme.<br />
<br />
In the hope of the speediest possible release of 1.9,<br />
Cheers, guys.]]></description>
			<content:encoded><![CDATA[[Originally posted in a team-only private forum; moved to this public forum at Devilshakerz's suggestion]<br />
<br />
Hi all,<br />
<br />
As I wrote in my application to join the team, my highest priority, which I believe mirrors that of our users, is a default responsive theme, which means prioritising the release of 1.9. My analysis and recommendations in this respect after some thought follow.<br />
<br />
Development discussions are, of course, better had publicly and transparently, however, given that the release of 1.9 has become a sensitive issue, with some in the community angry about its delay, I am posting this thread privately to start with. I will repost it publicly (edited if necessary) if the consensus here is that that's appropriate.<br />
<br />
As a new and relatively uninformed team member, this all might come across as unjustifiably assertive, perhaps even presumptuous or arrogant. If so, please forgive me: my intention is simply to forge the best (immediate) path forward for our project. Where I get it wrong, especially due to ignorance or error, I hope that you will correct me. Where I overstep the bounds of my role, I hope that you will let me know.<br />
<br />
That said, here is what I've come up with.<br />
<br />
In summary, my recommendations for the initial 1.9 release are for:<br />
<ol type="1" class="mycode_list"><li>1.8.27 to be the last release prior to 1.9, and for the list of PRs planned to be merged prior to 1.8.27 to be ASAP (a) minimised and (b) frozen, and, thereafter, for all remaining PRs to be deferred to the 1.9 branch (with conflicts resolved as necessary) - but for even those PRs deferred to the 1.9 branch to not necessarily be applied prior to its initial release, the timeliness of which should be prioritised above the merging of (non-critical) PRs.<br />
</li>
<li>All non-critical unimplemented changes for 1.9 other than to the template system to be deferred to a later release.<br />
</li>
<li>Changes to the template system for 1.9 anyway to be minimised, except for backwards-incompatible changes, which should be kept to the bare minimum necessary to avoid future backwards-incompatible changes given the functionality we ultimately plan to, or will potentially, implement.<br />
</li>
</ol>
I have thought about <a href="https://github.com/mybb/mybb/issues/3689" target="_blank" rel="noopener" class="mycode_url">issue #3689</a>, <span style="font-style: italic;" class="mycode_i">1.9 Theme System</span>, to which Devilshakerz pointed me in my application thread. I do not currently have answers to all of the questions raised at the start, but here are some responses to, and considerations arising from, the discussion:<ul class="mycode_list"><li>I love Euan's idea of a JS manager similar to the stylesheet manager, also with support for the stipulation of dependencies. Although it is perhaps debatable as to whether or not this should be considered a non-backwards-compatible change that ought to be included in the initial 1.9 release, my view is that it is not, since we wouldn't be able to force plugin developers to use it anyway; the approach of inserting JS files into templates would always be available to them regardless. Thus, I do not think that we should aim to include it in the initial 1.9 release.<br />
</li>
<li>I also love Devilshakerz's idea of enhancing <span style="font-style: italic;" class="mycode_i">Find Updated Templates</span> so as to provide '<span style="font-style: italic;" class="mycode_i">a comparison of what's changed in [a] specific upgrade in the master set; these "diffs" would be easier to recognize than master-custom comparison (as unrelated modifications are caught up in the report), along with a suitable UI (perhaps the diff - "suggested changes"/"copy these" - and an editor side-by-side).</span>'<br />
</li>
</ul>
Also, I love the idea of providing the same sort of updating functionality - the sort that Devilshakerz suggests there that we extend with respect to templates - for stylesheets and Javascript files too. This is (with the caveats noted below) a backwards-compatible change though, so I recommend that we defer it beyond the initial 1.9 release.<br />
<br />
Looking a little more closely into the current <span style="font-style: italic;" class="mycode_i">Find Updated Templates</span> diff functionality, as Devilshakerz's comments suggest it is fruitful to do, I have an observation which might turn out to be false (and if you know it to be false, then please say so), but which right now seems to me to be true:<br />
<br />
Because the diff is only two-way, and doesn't have access to nor take into account the prior Master template upon which the admin based their custom template, the explanation at the top of the diff report is not always accurate, that explanation being (colours not identical):<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite><span style="color: #64e15b;" class="mycode_color">Changes that have been made between your previous version and this one are highlighted like this.</span><br />
<span style="color: #fa6464;" class="mycode_color">Any customizations you've made to your templates (the old ones) are highlighted like this.</span></blockquote>
<br />
It seems to me that if the new Master template <span style="font-style: italic;" class="mycode_i">deletes</span> content present in the prior Master template, this will be shown in light red, for the admin to interpret as a "customization" that they had made to that prior template, which it is not, and which they had not.<br />
<br />
It seems to me that this confusion can best be resolved by running a three-way (or at least a dual) diff, which <span style="font-style: italic;" class="mycode_i">does</span> take into account the contents of the prior Master template from which the admin had generated their custom template. This, in turn, means storing that prior Master template and its relationship with the customised template. This would presumably be done automatically when the admin first saves an edited version of the (then-current) Master template.<br />
<br />
This would allow us to extend Devilshakerz's idea a little: we could auto-generate a "patch" between the version of the Master template which the admin had customised, and the new version of the Master template, and then attempt to auto-apply that "patch". If there were no conflicts with the customisations made by the admin, then we could simply auto-apply the patch and avoid the need for the template to even show up in "Find Updated Templates" at all (perhaps, for safety, this would be configurable, as in a yes/no setting somewhere in the ACP something like "Attempt to auto-apply core updates to customised templates where possible?"). Again, this depends on the prior Master template being stored and related to the customised template.<br />
<br />
I emphasise that final point because I think that it is of concern given the current goal of user-editable filesystem-based templates. In general, the problem is this: certain features such as the one I've just canvassed require that metadata is automatically generated and then associated with a customised template when that template is saved, however, it is impossible to automatically generate that metadata, let alone automatically store it against that template, when edits to templates are permitted via the filesystem. Too, in a filesystem-based approach, the best place to store that metadata might well be in the same file as the (user-editable) template, however, this would mix user-editable data with auto-generated data, which in my opinion is bad practice with meaningful potential for error.<br />
<br />
Regarding inheritance, I agree with Wildcard in that issue's comments that the current system works well and seems to be optimal. Again, though, I have concerns about the implementation of inheritance given user-editable filesystem-based templates. In particular: how is inheritance to be implemented in files? If a user-editable filesystem template inherits from the Master template, then what does this look like in the filesystem? If it is implemented via an empty template file, then this confounds the user's editing experience, since the user then has to locate the Master template and manually copy its contents in on first edit. On the other hand, if it is implemented by a template file with contents identical to the Master template, then an inheriting template cannot be distinguished from one which does not inherit but happens to have the same contents as the Master template anyway. Neither of these options seem to me to be viable, and I can't see an alternative, viable option. If anybody else can, then please say so.<br />
<br />
For these two reasons (and there might be others that I've overlooked), I think that filesystem-based templates, especially when user-editable independently of the MyBB UI, are not a good idea, and should be abandoned. If ease of editing is our goal, then incorporating into core Shade's FASTyle plugin, as suggested in the comments of <a href="https://github.com/mybb/mybb/issues/3686" target="_blank" rel="noopener" class="mycode_url">issue #3686</a>, <span style="font-style: italic;" class="mycode_i">Allow editing of Twig templates from the ACP</span>, is a better idea. However, as this is a backwards-compatible change, my recommendation is that it be deferred beyond the initial 1.9 release.<br />
<br />
I end this missive then with a fourth and final recommendation:<ul class="mycode_list"><li>That minimal changes be made to the templating system for the initial 1.9 release: Twig templates can and should be distributed, stored, and edited in the same way as templates for 1.8 - including by plugins via the <code class="inline-code">find_replace_templatesets()</code> function - except where this conflicts with a planned future feature which would otherwise be backwards-incompatible.<br />
</li>
</ul>
The only such feature which I am currently suggesting is the auto-patching of customised templates, which requires from the start that the version of the Master template upon which a custom template was based be stored against that custom template. Since we would ultimately want this same auto-patching to be possible for stylesheets though, we would also want 1.9 from the start to version stylesheets (just as for templates) and to store against each customised stylesheet the version of the Master stylesheet on which it is based.<br />
<br />
I encourage others to suggest their own such features ASAP so that we can plan for them, and implement the necessary infrastructure for them in, and then roll out ASAP, MyBB 1.9 with a default responsive theme.<br />
<br />
In the hope of the speediest possible release of 1.9,<br />
Cheers, guys.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[generate emails when someone logs in to admin cp]]></title>
			<link>https://community.mybb.com/thread-228327.html</link>
			<pubDate>Mon, 22 Jun 2020 20:01:40 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://community.mybb.com/member.php?action=profile&uid=10832">andrewjs18</a>]]></dc:creator>
			<guid isPermaLink="false">https://community.mybb.com/thread-228327.html</guid>
			<description><![CDATA[this is carried over from: <a href="https://github.com/mybb/mybb/issues/4088" target="_blank" rel="noopener" class="mycode_url">https://github.com/mybb/mybb/issues/4088</a><br />
<br />
text:<br />
<br />
mybb should consider adding some code that'll generate an email when someone logs in to the admin cp. most sites that handle customer data do this and include some information such as this in the email it sends out:<br />
<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-none">Dear Andrew,

Someone has recently logged into your website account.

Username : me
IP Address : 1.2.3.4
Hostname : me.com
Time : 2020-06-21 02:50 PM

If this is not you we highly recommend you change your details and inform a
staff member immediately.

You can modify the settings of this alert under your profile.

Regards,
website
</code></pre>]]></description>
			<content:encoded><![CDATA[this is carried over from: <a href="https://github.com/mybb/mybb/issues/4088" target="_blank" rel="noopener" class="mycode_url">https://github.com/mybb/mybb/issues/4088</a><br />
<br />
text:<br />
<br />
mybb should consider adding some code that'll generate an email when someone logs in to the admin cp. most sites that handle customer data do this and include some information such as this in the email it sends out:<br />
<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-none">Dear Andrew,

Someone has recently logged into your website account.

Username : me
IP Address : 1.2.3.4
Hostname : me.com
Time : 2020-06-21 02:50 PM

If this is not you we highly recommend you change your details and inform a
staff member immediately.

You can modify the settings of this alert under your profile.

Regards,
website
</code></pre>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[docs.mybb.com]]></title>
			<link>https://community.mybb.com/thread-227563.html</link>
			<pubDate>Fri, 01 May 2020 21:18:14 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://community.mybb.com/member.php?action=profile&uid=90348">Ben</a>]]></dc:creator>
			<guid isPermaLink="false">https://community.mybb.com/thread-227563.html</guid>
			<description><![CDATA[Hi all,<br />
<br />
Please can you leave any requests below that you would like us to include on the Official Documentation? We will try to cover as many requests as possible.]]></description>
			<content:encoded><![CDATA[Hi all,<br />
<br />
Please can you leave any requests below that you would like us to include on the Official Documentation? We will try to cover as many requests as possible.]]></content:encoded>
		</item>
	</channel>
</rss>