Skip to content

Commit

Permalink
v1.5.3
Browse files Browse the repository at this point in the history
- Revised `imcger/fancybox` support
- Conside BBCode Settings
  • Loading branch information
IMC-GER committed Aug 2, 2023
1 parent c992690 commit 1e7f596
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 17 deletions.
7 changes: 4 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# EditorConfig is awesome: https://EditorConfig.org

# phpBB - Editor Vorgaben v1.1 - https://www.phpbb.de/kb/viewarticle?a=93
# 2020 LukeWCS, phpBB.de
# phpBB Programmierrichtlinien - Editor Vorgaben v1.2
# Quelle: https://www.phpbb.de/kb/viewarticle?a=93
# Autor : LukeWCS (phpBB.de), 2023-07-27

root = true

Expand All @@ -18,5 +19,5 @@ trim_trailing_whitespace = true
[*.{txt,md,yml}]
trim_trailing_whitespace = false

[*.yml]
[*.{json,yml}]
indent_style = space
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ Go to "ACP" > "Extensions" > "External Links settings" and customize "External L

## Changelog

### v1.5.3 (02-08-2023)
- Revised `imcger/fancybox` support
- Conside BBCode Settings

### v1.5.2 (05-03-2023)
- Revised ACP templates
- Removed JS in template
Expand Down
2 changes: 1 addition & 1 deletion externallinks_version.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"stable": {
"1.5": {
"current": "1.5.2",
"current": "1.5.3",
"announcement": "https://www.phpbb.de/community/viewtopic.php?t=245923",
"download": "https://github.com/IMC-GER/phpBB-External-Links/tags",
"eol": null,
Expand Down
4 changes: 4 additions & 0 deletions imcger/externallinks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ Go to "ACP" > "Extensions" > "External Links settings" and customize "External L

## Changelog

### v1.5.3 (02-08-2023)
- Revised `imcger/fancybox` support
- Conside BBCode Settings

### v1.5.2 (05-03-2023)
- Revised ACP templates
- Removed JS in template
Expand Down
4 changes: 2 additions & 2 deletions imcger/externallinks/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"type": "phpbb-extension",
"description": "With this extension it is possible to influence the display of links and pictures. Some settings are available in the User Control Panel. This allows the user to decide for himself what is more important to him. Secure data transfer, comfortable display or fast loading times of the forum page. Open external links in a new tab/window.",
"homepage": "https://github.com/IMC-GER/phpBB-External-Links",
"version": "1.5.2",
"time": "2023-03-05",
"version": "1.5.3",
"time": "2023-08-02",
"license": "GPL-2.0-only",
"authors": [{
"name": "Thorsten Ahlers",
Expand Down
22 changes: 14 additions & 8 deletions imcger/externallinks/event/main_listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function __construct
public static function getSubscribedEvents()
{
return [
'core.phpbb_content_visibility_get_visibility_sql_before' => 'module_auth',
'core.viewtopic_modify_forum_id' => 'viewtopic_modify_forum_id',
'core.user_setup_after' => 'user_setup_after',
'core.permissions' => 'permissions',
'core.modify_text_for_display_after' => 'modify_text_for_display_after',
Expand Down Expand Up @@ -132,7 +132,7 @@ public function permissions($event)
* @return null
* @access public
*/
public function module_auth($event)
public function viewtopic_modify_forum_id($event)
{
$this->forum_id = $event['forum_id'];
}
Expand Down Expand Up @@ -429,8 +429,8 @@ public function configure_textformatter($event)
'<span class="imcger-ext-image" title="{@src}"><span><xsl:value-of select="string($L_IMCGER_EXT_LINK_BILD_SOURCE)"/></span>: ' . $img_caption_src . '</span>' .
'</div>' .
'</xsl:if>' .
// Show the image as link
'<xsl:if test="$S_IMCGER_FANCYBOX_AKTIVE and ($S_IMCGER_LINKS_IMG_TO_TEXT or (starts-with(@src, \'http://\') and $S_IMCGER_LINKS_NONE_SECURE))">' .
// Show the image as link and add Fancybox attribute
'<xsl:if test="$S_IMCGER_FANCYBOX_AKTIVE and $S_IMCGER_FANCYBOX_SHOW_WITH_LINK and ($S_IMCGER_LINKS_IMG_TO_TEXT or (starts-with(@src, \'http://\') and $S_IMCGER_LINKS_NONE_SECURE))">' .
// Simple link
'<xsl:if test="not($S_IMCGER_LINKS_TEXT_MARK) and not($S_IMCGER_LINKS_OPEN_NEWWIN)">' .
'<a href="{@src}" class="postlink" title="{$L_IMCGER_EXT_LINK_EXT_LINK}"' . $fancybox_attribute . '>' . $img_caption_src . '</a>' .
Expand All @@ -448,7 +448,8 @@ public function configure_textformatter($event)
'<a href="{@src}" class="postlink" title="{$L_IMCGER_EXT_LINK_EXT_LINK}" target="_blank" rel="noopener noreferrer"' . $fancybox_attribute . '>' . $img_caption_src . '&nbsp;<i class="imcger-ext-link"></i></a>' .
'</xsl:if>' .
'</xsl:if>' .
'<xsl:if test="not($S_IMCGER_FANCYBOX_AKTIVE) and ($S_IMCGER_LINKS_IMG_TO_TEXT or (starts-with(@src, \'http://\') and $S_IMCGER_LINKS_NONE_SECURE))">' .
// Show the image as link without Fancybox
'<xsl:if test="not($S_IMCGER_FANCYBOX_AKTIVE and $S_IMCGER_FANCYBOX_SHOW_WITH_LINK) and ($S_IMCGER_LINKS_IMG_TO_TEXT or (starts-with(@src, \'http://\') and $S_IMCGER_LINKS_NONE_SECURE))">' .
// Simple link
'<xsl:if test="not($S_IMCGER_LINKS_TEXT_MARK) and not($S_IMCGER_LINKS_OPEN_NEWWIN)">' .
'<a href="{@src}" class="postlink" title="{$L_IMCGER_EXT_LINK_EXT_LINK}">' . $img_caption_src . '</a>' .
Expand Down Expand Up @@ -537,8 +538,8 @@ public function configure_textformatter($event)
'</xsl:when>' .
'<xsl:otherwise>' .
'<xsl:choose>' .
// Check if it an image
'<xsl:when test="$S_IMCGER_FANCYBOX_AKTIVE and (' . $check_if_img . ')">' .
// Check if it an image and add Fancybox attribute
'<xsl:when test="$S_IMCGER_FANCYBOX_AKTIVE and $S_IMCGER_FANCYBOX_SHOW_WITH_LINK and (' . $check_if_img . ')">' .
'<xsl:choose>' .
// Check if URL domain from external
'<xsl:when test="($S_IMCGER_LINKS_TEXT_MARK or $S_IMCGER_LINKS_OPEN_NEWWIN) and not(' . $query_domain_url . ')">' .
Expand Down Expand Up @@ -598,11 +599,13 @@ public function set_textformatter_parameters($event)
{
/** @var \s9e\TextFormatter\Renderer $renderer */
$renderer = $event['renderer']->get_renderer();

// BBCode and Images status
$bbcode_status = ($this->config['allow_bbcode'] && $this->auth->acl_get('f_bbcode', $this->forum_id)) ? true : false;
$img_status = ($bbcode_status && $this->auth->acl_get('f_img', $this->forum_id)) ? true : false;

// Check if Fancybox aktive for Links, default true for Fancybox ext lower v1.3.1
$imcger_fancybox_show_with_link = isset($this->config['imcger_fancybox_show_with_link']) ? $this->config['imcger_fancybox_show_with_link'] : true;

// Set Domain Level for template
$domain_level = [false, false, false, false, false, false];
Expand Down Expand Up @@ -632,6 +635,9 @@ public function set_textformatter_parameters($event)

// Fancybox aktive
$renderer->setParameter('S_IMCGER_FANCYBOX_AKTIVE', (bool) $this->is_fancybox);

// Fancybox not aktive for URL
$renderer->setParameter('S_IMCGER_FANCYBOX_SHOW_WITH_LINK', (bool) $imcger_fancybox_show_with_link);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion imcger/externallinks/language/de/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

// Language pack author
'ACP_IMCGER_LANG_DESC' => 'Deutsch (Du)',
'ACP_IMCGER_LANG_EXT_VER' => '1.5.2',
'ACP_IMCGER_LANG_EXT_VER' => '1.5.3',
'ACP_IMCGER_LANG_AUTHOR' => 'IMC-Ger',

// Message text
Expand Down
2 changes: 1 addition & 1 deletion imcger/externallinks/language/de_x_sie/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

// Language pack author
'ACP_IMCGER_LANG_DESC' => 'Deutsch (Sie)',
'ACP_IMCGER_LANG_EXT_VER' => '1.5.2',
'ACP_IMCGER_LANG_EXT_VER' => '1.5.3',
'ACP_IMCGER_LANG_AUTHOR' => 'IMC-Ger',

// Message text
Expand Down
2 changes: 1 addition & 1 deletion imcger/externallinks/language/en/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

// language pack author
'ACP_IMCGER_LANG_DESC' => 'British English',
'ACP_IMCGER_LANG_EXT_VER' => '1.5.2',
'ACP_IMCGER_LANG_EXT_VER' => '1.5.3',
'ACP_IMCGER_LANG_AUTHOR' => 'IMC-Ger',

// Message text
Expand Down

0 comments on commit 1e7f596

Please sign in to comment.