Skip to content

Commit

Permalink
Merge branch 'release/3.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
iMattPro committed Oct 6, 2020
2 parents fc12da1 + 37b22f0 commit 5e2dd80
Show file tree
Hide file tree
Showing 444 changed files with 2,657 additions and 3,269 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
tests/ export-ignore
travis/ export-ignore
develop/ export-ignore
.travis.yml export-ignore
.gitignore export-ignore
.gitattributes export-ignore
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ Backup/

/node_modules/
/build/
/develop/
/vendor/
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ matrix:
env: DB=mysqli
- php: 7.3
env: DB=mysqli
- php: 7.4snapshot
- php: 7.4
env: DB=mysqli
- php: nightly
env: DB=mysqli
Expand Down
21 changes: 18 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
# Changelog

## 3.2.4 - 08-10-2020
## 3.3.0 - 2020-09-11

- Replaced the antiquated, pixelated GIF BBCode icons with two new SVG and PNG icon sets.
- Added BBCodes to Quick Reply.
- Added an all new ACP settings section to the Extensions tab of the ACP:
- Toggle between SVG or PNG icon sets for the ABBC3 Icon bar.
- Enable or disable the ABBC3 Icon bar.
- Enable or disable the Quick Reply BBCodes.
- Enable or disable the Pipe Tables plugin.
- Created an ABBC3 folder in phpBB's images folder. Now you can add your BBCode icons to this folder which won't be deleted when updating ABBC3.
- BBCodes with no associated icon image will display like a standard phpBB BBCode.
- BBVideo deprecation continues:
- If you have the phpBB Media Embed PlugIn installed, its `[media]` BBCode button now behaves just like the `[bbvideo]` button and opens the BBVideo wizard. You may now hide the `[bbvideo]` BBCode if you prefer to use the `[media]` BBCode (or vice versa) by turning off its display on posting page setting.
- Added Open Sans to font BBCodes list since it is part of phpBB Prosilver.

## 3.2.4 - 2020-08-10

- Fixed an issue causing circular dependency errors when co-installed with mChat in phpBB 3.3.1.

## 3.2.3 - 03-13-2020
## 3.2.3 - 2020-03-13

- Minor fixes that might cause unexpected JavaScript behaviors in phpBB 3.3.x using jQuery 3.

## 3.2.2 - 04-29-2019
## 3.2.2 - 2019-04-29

- BBCode URL/BBVideo Wizard is now a modal/overlay, to solve some issues where it might have been obscured from view.
- Ensure BBVideos are sorted alphabetically in the BBCode Wizard's examples drop down menu.
Expand Down
29 changes: 8 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Advanced BBCode Box

Replace phpBB3's BBCode buttons with icons in an attractive and customizable toolbar. This extension also adds many new and useful custom BBCodes giving users more ways to customize their posts, including BBvideo (embed videos from dozens of media sites). Custom BBCodes can be arranged and sorted in any order and assigned to specific usergroups (such as Moderators and Admins only).
Replace phpBB3's default BBCode buttons with icons in a customizable toolbar. This extension also adds many new and useful custom BBCodes giving users more ways to customize their posts, including BBvideo (embed videos from dozens of media sites). Custom BBCodes can be arranged and sorted in any order and assigned to specific user groups (such as Moderators and Admins only).

[![Build Status](https://img.shields.io/travis/iMattPro/abbc3/master.svg?style=flat)](https://travis-ci.org/iMattPro/abbc3)
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/iMattPro/abbc3/master.svg?style=flat)](https://scrutinizer-ci.com/g/iMattPro/abbc3/?branch=master)
Expand All @@ -11,7 +11,7 @@ Replace phpBB3's BBCode buttons with icons in an attractive and customizable too
## Features:
* Customizable icon-based BBCode toolbar
* Custom BBCode sorting/arrangement
* BBCodes can be assigned to certain usergroups for private use.
* BBCodes can be assigned to certain user groups for private use.
* Supports phpBB3’s custom BBCodes.
* New BBCodes:

Expand All @@ -21,31 +21,18 @@ Replace phpBB3's BBCode buttons with icons in an attractive and customizable too
Right), LTR/RTL Direction, Preformatted text, Marquee scroll, Spoiler,
Hidden, Moderator Message, Off Topic, NFO/ascii text, SoundCloud, BBvideo

* Embed video from dozens of popular media content sites with BBvideo. Also raw URLs will automatically be converted to embedded content.

* Multiple languages are supported. View the pre-installed [localizations](https://github.com/iMattPro/abbc3/tree/master/language).
* Embed video from dozens of popular media content sites with BBvideo. Also, raw URLs will automatically be converted to embedded content.
* Multiple languages supported. View the pre-installed [localizations](https://github.com/iMattPro/abbc3/tree/master/language).

## Minimum Requirements
* phpBB 3.2.2 or higher
* PHP 5.4 or higher

**Note: Only official release versions validated by the phpBB Extensions Team should be installed on a live forum. Pre-release (beta, dev) versions downloaded from this repository are only to be used for testing on offline/development forums and are not officially supported.**

## Install
1. [Download the latest validated release](https://www.phpbb.com/customise/db/extension/advanced_bbcode_box/).
2. Unzip the downloaded release and copy it to the `ext` directory of your phpBB board.
3. Navigate in the ACP to `Customise -> Manage extensions`.
4. Look for `Advanced BBCode Box` under the Disabled Extensions list and click its `Enable` link.

## Uninstall
1. Navigate in the ACP to `Customise -> Manage extensions`.
2. Click the `Disable` link for Advanced BBCode Box.
3. To permanently uninstall, click `Delete Data`, then delete the `abbc3` folder from `phpBB/ext/vse/`.

## Customizing:
1. Custom BBCode Icons: You can give your custom BBCodes icons by simply adding a GIF image named after your BBCode (e.g.: center.gif) to the `images/icons` directory. There are tons of extra BBCode icons included in the `contrib` directory.
2. BBCode Toolbar: You can change the look of the BBCode toolbar using any of the extra toolbar background images located in the `contrib` directory. Just copy one of the alternative toolbar images to `styles/all/theme/images/abbc3_bg.gif` (and refresh your browser). To assign custom toolbar images for each style, replace "all" with the name of your style.
3. NOTE: When making any of these customizations to ABBC3, be sure to note/backup your changes, as you may need to reproduce them after updating this extension, in case any of your added image files is overwritten or erased.
* Get [the latest release](https://www.phpbb.com/customise/db/extension/advanced_bbcode_box/) at phpBB.com.

## Customize:
* Read the [How To: Customize BBCode Icons & Toolbar](https://www.phpbb.com/customise/db/extension/advanced_bbcode_box/faq/1551) at phpBB.com

## License
[GNU General Public License v2](http://opensource.org/licenses/GPL-2.0)
Expand Down
29 changes: 29 additions & 0 deletions acp/abbc3_info.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
/**
*
* Advanced BBCode Box
*
* @copyright (c) 2020 Matt Friedman
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/

namespace vse\abbc3\acp;

class abbc3_info
{
public function module()
{
return [
'filename' => '\vse\abbc3\acp\abbc3_module',
'title' => 'ACP_ABBC3_MODULE',
'modes' => [
'settings' => [
'title' => 'ACP_ABBC3_SETTINGS',
'auth' => 'ext_vse/abbc3 && acl_a_board',
'cat' => ['ACP_ABBC3_MODULE'],
],
],
];
}
}
134 changes: 134 additions & 0 deletions acp/abbc3_module.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
<?php
/**
*
* Advanced BBCode Box
*
* @copyright (c) 2020 Matt Friedman
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/

namespace vse\abbc3\acp;

class abbc3_module
{
/** @var \phpbb\cache\driver\driver_interface */
protected $cache;

/** @var \phpbb\config\config */
protected $config;

/** @var \Symfony\Component\DependencyInjection\ContainerInterface */
protected $container;

/** @var \phpbb\db\driver\driver_interface */
protected $db;

/** @var \phpbb\language\language */
protected $language;

/** @var \phpbb\request\request */
protected $request;

/** @var \phpbb\template\template */
protected $template;

/** @var string */
public $page_title;

/** @var string */
public $tpl_name;

/** @var string */
public $u_action;

/**
* Constructor
*/
public function __construct()
{
global $phpbb_container;

$this->container = $phpbb_container;
$this->cache = $this->container->get('cache');
$this->config = $this->container->get('config');
$this->db = $this->container->get('dbal.conn');
$this->language = $this->container->get('language');
$this->request = $this->container->get('request');
$this->template = $this->container->get('template');
}

/**
* Main ACP module
*/
public function main()
{
$this->language->add_lang('abbc3', 'vse/abbc3');

$this->tpl_name = 'acp_abbc3_settings';
$this->page_title = $this->language->lang('ACP_ABBC3_SETTINGS');

$form_key = 'vse/abbc3';
add_form_key($form_key);

if ($this->request->is_set_post('submit'))
{
if (!check_form_key($form_key))
{
trigger_error('FORM_INVALID', E_USER_WARNING);
}

$this->save_settings();
}

$this->display_settings();
}

/**
* Add settings template vars to the form
*/
protected function display_settings()
{
$this->template->assign_vars([
'S_ABBC3_PIPES' => $this->config['abbc3_pipes'],
'S_ABBC3_BBCODE_BAR' => $this->config['abbc3_bbcode_bar'],
'S_ABBC3_QR_BBCODES' => $this->config['abbc3_qr_bbcodes'],
'S_ABBC3_ICONS_TYPE' => build_select(['png' => 'PNG', 'svg' => 'SVG'], $this->config['abbc3_icons_type']),
'U_ACTION' => $this->u_action,
]);
}

/**
* Save settings data to the database
*/
protected function save_settings()
{
$this->config->set('abbc3_bbcode_bar', $this->request->variable('abbc3_bbcode_bar', 0));
$this->config->set('abbc3_qr_bbcodes', $this->request->variable('abbc3_qr_bbcodes', 0));
$this->config->set('abbc3_icons_type', $this->request->variable('abbc3_icons_type', 'png'));
$this->save_pipes();

trigger_error($this->language->lang('CONFIG_UPDATED') . adm_back_link($this->u_action));
}

/**
* Save the Pipes Table setting.
* - Set the config
* - Show or hide the Pipes BBCode button
* - Purge BBCode caches.
*/
protected function save_pipes()
{
$enable_pipes = $this->request->variable('abbc3_pipes', 0);

$this->config->set('abbc3_pipes', $enable_pipes);

$sql = 'UPDATE ' . BBCODES_TABLE . '
SET display_on_posting = ' . (int) $enable_pipes . "
WHERE bbcode_tag = 'pipes'";
$this->db->sql_query($sql);

$this->cache->destroy($this->container->getParameter('text_formatter.cache.parser.key'));
$this->cache->destroy($this->container->getParameter('text_formatter.cache.renderer.key'));
}
}
Binary file added adm/images/abbc3logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions adm/style/acp_abbc3.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,34 @@
margin: 10px 0;
padding: 10px 10px 10px 60px;
}

#abbc3_icons_type {
vertical-align: top;
}

.abbc3-bar {
background: #f9fbfd;
background: -moz-linear-gradient(top, #f9fbfd 0%, #d9dde2 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f9fbfd), color-stop(100%, #d9dde2));
background: -webkit-linear-gradient(top, #f9fbfd 0%, #d9dde2 100%);
background: -o-linear-gradient(top, #f9fbfd 0%, #d9dde2 100%);
background: -ms-linear-gradient(top, #f9fbfd 0%, #d9dde2 100%);
background: linear-gradient(to bottom, #f9fbfd 0%, #d9dde2 100%);
border: 1px solid #b4bac0;
display: inline-flex;
justify-content: space-around;
align-items: center;
height: 30px;
margin: 0 10px;
}

.abbc3-bar span {
background-size: 20px;
width: 20px;
height: 20px;
margin: 0 4px;
}

.hidden {
display: none;
}
69 changes: 69 additions & 0 deletions adm/style/acp_abbc3_settings.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{% include 'overall_header.html' %}
{% INCLUDECSS '@vse_abbc3/acp_abbc3.css' %}

<img src="{{ ROOT_PATH }}ext/vse/abbc3/adm/images/abbc3logo.png" alt="{{ lang('ACP_ABBC3_MODULE') }}">

<p>{{ lang('ABBC3_SETTINGS_EXPLAIN') }}</p>

<form id="abbc3_settings" method="post" action="{{ U_ACTION }}" data-ajax="true">
<fieldset>
<legend>{{ lang('ABBC3_LEGEND_ICON_BAR') }}</legend>
<dl>
<dt><label for="abbc3_bbcode_bar">{{ lang('ABBC3_BBCODE_BAR') ~ lang('COLON') }}</label><br><span>{{ lang('ABBC3_BBCODE_BAR_EXPLAIN') }}</span></dt>
<dd><label><input type="radio" class="radio" name="abbc3_bbcode_bar" id="abbc3_bbcode_bar" value="1"{% if S_ABBC3_BBCODE_BAR %} checked="checked"{% endif %}> {{ lang('YES') }}</label>
<label><input type="radio" class="radio" name="abbc3_bbcode_bar" value="0"{% if not S_ABBC3_BBCODE_BAR %} checked="checked"{% endif %}> {{ lang('NO') }}</label></dd>
</dl>
<dl>
<dt><label for="abbc3_icons_type">{{ lang('ABBC3_ICONS_TYPE') ~ lang('COLON') }}</label><br><span>{{ lang('ABBC3_ICONS_TYPE_EXPLAIN') }}</span></dt>
<dd>
<select name="abbc3_icons_type" id="abbc3_icons_type">{{ S_ABBC3_ICONS_TYPE }}</select>
{% set ABBC3_ICON_PATH = ROOT_PATH ~ 'ext/vse/abbc3/images/icons/' %}
{% for ext in ['png', 'svg'] %}
<div class="abbc3-bar abbc3-icons-{{ ext }} hidden">
<span style="background-image:url('{{ ABBC3_ICON_PATH }}bold.{{ ext }}')"></span>
<span style="background-image:url('{{ ABBC3_ICON_PATH }}italic.{{ ext }}')"></span>
<span style="background-image:url('{{ ABBC3_ICON_PATH }}underline.{{ ext }}')"></span>
<span style="background-image:url('{{ ABBC3_ICON_PATH }}quote.{{ ext }}')"></span>
<span style="background-image:url('{{ ABBC3_ICON_PATH }}code.{{ ext }}')"></span>
<span style="background-image:url('{{ ABBC3_ICON_PATH }}listb.{{ ext }}')"></span>
<span style="background-image:url('{{ ABBC3_ICON_PATH }}listo.{{ ext }}')"></span>
<span style="background-image:url('{{ ABBC3_ICON_PATH }}listitem.{{ ext }}')"></span>
<span style="background-image:url('{{ ABBC3_ICON_PATH }}img.{{ ext }}')"></span>
<span style="background-image:url('{{ ABBC3_ICON_PATH }}url.{{ ext }}')"></span>
<span style="background-image:url('{{ ABBC3_ICON_PATH }}fontcolor.{{ ext }}')"></span>
</div>
{% endfor %}
</dd>
</dl>
</fieldset>
<fieldset>
<legend>{{ lang('ABBC3_LEGEND_ADD_ONS') }}</legend>
<dl>
<dt><label for="abbc3_qr_bbcodes">{{ lang('ABBC3_QR_BBCODES') ~ lang('COLON') }}</label><br><span>{{ lang('ABBC3_QR_BBCODES_EXPLAIN') }}</span></dt>
<dd><label><input type="radio" class="radio" name="abbc3_qr_bbcodes" id="abbc3_qr_bbcodes" value="1"{% if S_ABBC3_QR_BBCODES %} checked="checked"{% endif %}> {{ lang('YES') }}</label>
<label><input type="radio" class="radio" name="abbc3_qr_bbcodes" value="0"{% if not S_ABBC3_QR_BBCODES %} checked="checked"{% endif %}> {{ lang('NO') }}</label></dd>
</dl>
<dl>
<dt><label for="abbc3_pipes">{{ lang('ABBC3_PIPES') ~ lang('COLON') }}</label><br><span>{{ lang('ABBC3_PIPES_EXPLAIN') }}</span></dt>
<dd><label><input type="radio" class="radio" name="abbc3_pipes" id="abbc3_pipes" value="1"{% if S_ABBC3_PIPES %} checked="checked"{% endif %}> {{ lang('YES') }}</label>
<label><input type="radio" class="radio" name="abbc3_pipes" value="0"{% if not S_ABBC3_PIPES %} checked="checked"{% endif %}> {{ lang('NO') }}</label></dd>
</dl>
</fieldset>
<fieldset class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{{ lang('SUBMIT') }}">&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{{ lang('RESET') }}">
{{ S_FORM_TOKEN }}
</fieldset>
</form>

<script>
const select = document.querySelector("select[name='abbc3_icons_type']");
document.querySelector(".abbc3-icons-" + select.value).classList.toggle("hidden");
select.addEventListener("change", () => {
document.querySelectorAll(".abbc3-bar").forEach(bar => {
bar.classList.toggle("hidden");
});
});
</script>

{% include 'overall_footer.html' %}
2 changes: 1 addition & 1 deletion adm/style/event/acp_bbcodes_edit_fieldsets_after.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<fieldset>
<legend>{{ lang('ACP_GROUPS_PERMISSIONS') }}</legend>
<dl>
<dt><label for="bbcode_group">{{ lang('ABBC3_BBCODE_GROUP') }}</label><br /><br /><span>{{ lang('ABBC3_BBCODE_GROUP_INFO') }}</span></dt>
<dt><label for="bbcode_group">{{ lang('ABBC3_BBCODE_GROUP') }}</label><br><br><span>{{ lang('ABBC3_BBCODE_GROUP_INFO') }}</span></dt>
<dd><select id="bbcode_group" name="bbcode_group[]" size="10" multiple="multiple">{{ S_GROUP_OPTIONS }}</select></dd>
</dl>
</fieldset>
6 changes: 4 additions & 2 deletions adm/style/event/acp_posting_buttons_before.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{% INCLUDEJS '@vse_abbc3/js/abbc3.min.js' %}
{% INCLUDECSS '@vse_abbc3/abbc3_common.min.css' %}
{% INCLUDECSS '@vse_abbc3/abbc3_posting.min.css' %}
{% include '@vse_abbc3/abbc3_posting_buttons.html' %}
{% if S_ABBC3_BBCODES_BAR %}
{% INCLUDECSS '@vse_abbc3/abbc3_posting.min.css' %}
{% include '@vse_abbc3/abbc3_posting_buttons.html' %}
{% endif %}
Loading

0 comments on commit 5e2dd80

Please sign in to comment.