[ABD] Attachment Shields

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Get Involved
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
Locked
User avatar
Restless Rancor
Registered User
Posts: 184
Joined: Tue Sep 18, 2018 1:51 pm

[ABD] Attachment Shields

Post by Restless Rancor » Sun Oct 28, 2018 2:57 pm

:!: I no longer have the time to dedicate to developing this extension. It failed validation for a number of reasons, so do not use it on a live environment. Feel free to continue the development under the GNU General Public License v2.0. :!:

Extension Name: Attachment Shields
Author: Restless Rancor

Extension Description: Adds shields.io images to attachment details.

Extension Version: Image
Requirements: Image Image

GitHub Repository: https://github.com/restless-rancor/rr-a ... nt-shields
Extension Download: https://github.com/restless-rancor/rr-a ... master.zip

Only install this extension in a test environment.

Plans: Screenshots:
Image
Image
Image
Changelog:
d.m.Y H:i TO | version
  • 01.11.2018 17:42 UTC | 1.0.0-RC2
    • EOL Conversion > Unix (LF)
  • 01.11.2018 16:47 UTC | 1.0.0-RC1
    • (tr) Translation added
    • Push to version 1.0.0-RC1 for validation.
  • 01.11.2018 14:28 UTC | 0.3.2-beta
    • Code optimization to comply with phpBB coding guidelines.
  • 01.11.2018 14:11 UTC | 0.3.1-beta
    • Language is now loaded globally with the core.user_setup event:
      • We need to load it globally for shields to show correctly in post preview and search.php
  • 31.10.2018 17:44 UTC | 0.3.0-beta
    • CSS display: none; is now used instead of <!-- in attachment_file_prepend.html and --> in attachment_file_append.html.
    • Added attachment box background CSS config with copy & paste helper.
    • Flash file configuration removed:
      • I didn't find a solution using CSS display: none; to hide the default display of flash files, but as flash has been handed it's EOL notice I'm looking ahead to the future.
      • If a solution can be found I am willing to add flash shield configuration back to the extension.
      • Flash file 'views' counters will still be effected by the language change.
      • I'm putting way too much thought into flash files which will soonish be obsolete: time to move on from them.
    • phpBB syntax fully updated to Twig syntax.
    • Further code cleanup.
    • Language update.
    • Global Setting 'Enable Attachment Shields' removed.
      • This setting was exactly the same as disabling the extension via 'Customize > Manage Extensions', so there was no need for it.
    • If you have version <=0.2.4-dev installed, before updating you must:
      1. Disable the extension in ACP > Customize > Manage Extensions,
      2. Delete the extension data in ACP > Customize > Manage Extensions,
      3. Delete the extension files from the server.
      4. Upload & Enable the new version.
      • This is because attachment_file_append.html has been removed from the extension and can cause issues if the file remains in the directory after an update.
    • Moved to beta release. No new features planned, time to optimize & review code.
  • 30.10.2018 17:57 UTC | 0.2.4-dev
    • Code optimization
  • 29.10.2018 21:04 UTC | 0.2.3-dev
    • Configuration options expanded to include:
      • Image Attachments,
      • File Attachments, and
      • Flash Attachments.
  • 29.10.2018 15:48 UTC | 0.2.2-dev
    • Shield Style settings added
    • Removed 'Preview' button from ACP settings
    • Twig Syntax updated
  • 28.10.2018 18:03 UTC | 0.2.1-dev
    • Comment interception for version numbers added
    • Color settings for shields added
  • 28.10.2018 14:17 UTC | 0.2.0-dev
    • ACP Module added with a global enable/disable option.
  • 26.10.2018 13:46 UTC+1 | 0.1.1-dev
    • Optimized language event.
  • 25.10.2018 16:31 UTC+1 | 0.1.0-dev
    • Removed duplicate language call.
  • 23.10.2018 17:27 UTC+1 | 0.0.3-dev
    • Language files & event added
  • 22.10.2018 20:58 UTC+1 | 0.0.2-dev
    • CSS foundation laid
  • 22.10.2018 17:31 UTC+1 | 0.0.1-dev
    • Initial development release.
Last edited by Restless Rancor on Thu Mar 28, 2019 4:26 pm, edited 31 times in total.
These aren't the droids you're looking for...

User avatar
pikachuturkey
Registered User
Posts: 290
Joined: Wed Dec 20, 2006 10:34 pm
Name: Rıza
Contact:

Re: [3.2][DEV] Attachment Shields

Post by pikachuturkey » Sun Oct 28, 2018 4:37 pm

Turkish (tr) language files for "[3.2][DEV] Attachment Shields".....Version: Image
(there is no variable for translating at "language/en/common.php")

language/tr/info_acp_attachmentshields.php

Code: Select all

<?php
/**
 *
 * Attachment Shields. An extension for the phpBB Forum Software package.
 *
 * @copyright (c) 2018, Restless Rancor, https://www.restlessrancor.com
 * @license GNU General Public License, version 2 (GPL-2.0)
 *
 */
if (!defined('IN_PHPBB'))
{
	exit;
}
if (empty($lang) || !is_array($lang))
{
	$lang = array();
}
$lang = array_merge($lang, array(
	'ASHIELDS_TITLE'			=> 'Eklenti Kalkanları',
	'ASHIELDS_SETTINGS'			=> 'Ayarlar',
	'ASHIELDS_ENABLE_FAIL'		=> 'Eklenti aktifleştirilmesi başarısız oldu!',
	'ASHIELDS_ENABLE_SUCCESS'	=> 'Başarıyla aktifleştirildi!',
	'ASHIELDS_SAVED'			=> 'Ayarlar başarıyla kaydedildi!.',
	'ASHIELDS_UPDATED'			=> 'Eklenti Kalkanları yapılandırması güncellendi.',
	
	'ASHIELDS_ENABLE'			=> 'Ekletin Kalkanlarını aktifleştir',
	'ASHIELDS_ENABLE_EXPLAIN'	=> 'Eklentiyi global olarak aktifleştir.',
));
Last edited by pikachuturkey on Tue Oct 30, 2018 6:39 pm, edited 1 time in total.
Health For Everyone ==> www.saglikforum.org

User avatar
Restless Rancor
Registered User
Posts: 184
Joined: Tue Sep 18, 2018 1:51 pm

Re: [3.2][DEV] Attachment Shields

Post by Restless Rancor » Sun Oct 28, 2018 4:56 pm

pikachuturkey wrote:
Sun Oct 28, 2018 4:37 pm
Turkish (tr) language files for "[3.2][DEV] Attachment Shields".....Version: Image
(there is no variable for translating at "language/en/common.php")
Hi, this is intended, as it changes the default "Downloaded x times" to "x" etc. because of how the image is generated.

There's still more to add to this ext, with more language so I'm going to hold off from adding the translation just yet. Thank you though!

---

I'm currently having trouble getting an inputted color to save:
Image

As you can see the inputted 'FFFF00' saves and the grey shield at the top is actually calling that config, but not as (yellow), but grey.

If anyone could help me figure this one out that'd be great, I'm struggling with it.


Edit: Got it: I was assigning a yes/no value when outputting to the template :)
These aren't the droids you're looking for...

User avatar
Restless Rancor
Registered User
Posts: 184
Joined: Tue Sep 18, 2018 1:51 pm

Re: [3.2][DEV] Attachment Shields

Post by Restless Rancor » Mon Oct 29, 2018 4:12 pm

I've added shield style settings today, but am not entirely happy with the method I used: I'm sure there's a simpler way to achieve it, so am going to do a bit more research into that to see if it can be optimized.

Next steps: Maybe customization options specific to attachment type? (Thumbnail, File, Image, Flash)
And a better method of handling version numbers in comments. It currently uses a REGEX IF statment to show a different result if the file comment matches version-x.x.x:

Code: Select all

{% if _file.COMMENT matches '\bv?[0-9]+\.[0-9]+\.[0-9]+(?:\.[0-9]+)?\b' and S_ASHIELDS_VERSION_ENABLE %}
I struggled a lot with the REGEX, and this was the only one I tried that remotely achieved the desired result, so it may be as simple as updating the regex expression to lower the possibility of a false positive.
These aren't the droids you're looking for...

User avatar
Restless Rancor
Registered User
Posts: 184
Joined: Tue Sep 18, 2018 1:51 pm

Re: [3.2][DEV] Attachment Shields

Post by Restless Rancor » Tue Oct 30, 2018 6:24 pm

I've figured out how to use CSS display: none; instead of a <!-- in the ...prepend.html and --> in ...append.html, but have been unsuccessful in applying these changes to flash files. From the word go I've not been 100% about supporting flash files in the extension as flash reaches EOL at the end of 2020 and I think this is probably the deciding factor.

So, the next dev version will address all of the CSS to use display:none; instead of the <!-- and -->, as well as optimizing how attachments are displayed. I may add an enable/disable flash shields option which switches between the CSS and <!-- / -->, but that's probably making it unnecessarily complicated. If I don't do this, I will be removing flash file support.

If anybody has views/opinions on this, I'd appreciate the feedback. Thanks :geek:
These aren't the droids you're looking for...

User avatar
Restless Rancor
Registered User
Posts: 184
Joined: Tue Sep 18, 2018 1:51 pm

Re: [3.2][BETA] Attachment Shields

Post by Restless Rancor » Wed Oct 31, 2018 6:09 pm

Major changes today, and pushed to BETA. I have no new features planned for the extension, so now to optimize & review the code.
  • 31.10.2018 17:44 UTC | 0.3.0-beta
    • CSS display: none; is now used instead of <!-- in attachment_file_prepend.html and --> in attachment_file_append.html.
    • Added attachment box background CSS config with copy & paste helper.
    • Flash file configuration removed:
      • I didn't find a solution using CSS display: none; to hide the default display of flash files, but as flash has been handed it's EOL notice I'm looking ahead to the future.
      • If a solution can be found I am willing to add flash shield configuration back to the extension.
      • Flash file 'views' counters will still be effected by the language change.
      • I'm putting way too much thought into flash files which will soonish be obsolete: time to move on from them.
    • phpBB syntax fully updated to Twig syntax.
    • Further code cleanup.
    • Language update.
    • Global Setting 'Enable Attachment Shields' removed.
      • This setting was exactly the same as disabling the extension via 'Customize > Manage Extensions', so there was no need for it.
    • If you have version <=0.2.4-dev installed, before updating you must:
      1. Disable the extension in ACP > Customize > Manage Extensions,
      2. Delete the extension data in ACP > Customize > Manage Extensions,
      3. Delete the extension files from the server.
      4. Upload & Enable the new version.
      • This is because attachment_file_append.html has been removed from the extension and can cause issues if the file remains in the directory after an update.
    • Moved to beta release. No new features planned, time to optimize & review code.
These aren't the droids you're looking for...

User avatar
pikachuturkey
Registered User
Posts: 290
Joined: Wed Dec 20, 2006 10:34 pm
Name: Rıza
Contact:

Re: [3.2][BETA] Attachment Shields

Post by pikachuturkey » Thu Nov 01, 2018 4:39 pm

Turkish (tr) translation of "[3.2][BETA] Attachment Shields" version 0.3.2 (github date: 01.11.2018)

language/tr/common.php

Code: Select all

<?php
/**
*
* Attachment Shields. An extension for the phpBB Forum Software package.
*
* @copyright (c) 2018, Restless Rancor, https://www.restlessrancor.com
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
if (!defined('IN_PHPBB'))
{
	exit;
}
if (empty($lang) || !is_array($lang))
{
	$lang = array();
}
$lang = array_merge($lang, array(
	'DOWNLOAD_COUNTS'		=> array(
		0	=> '0',
		1	=> '%d',
		2	=> '%d',
	),
	'VIEWED_COUNTS'		=> array(
		0	=> '0',
		1	=> '%d',
		2	=> '%d',
	),
));

language/tr/info_acp_attachmentshields.php

Code: Select all

<?php
/**
*
* Attachment Shields. An extension for the phpBB Forum Software package.
*
* @copyright (c) 2018, Restless Rancor, https://www.restlessrancor.com
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/

if (!defined('IN_PHPBB'))
{
	exit;
}

if (empty($lang) || !is_array($lang))
{
	$lang = array();
}

$lang = array_merge($lang, array(
	'ASHIELDS_TITLE'			=> 'Dosya Eki Kalkanları',
	'ASHIELDS_SETTINGS'			=> 'Ayarlar',
	'ASHIELDS_ENABLE_FAIL'		=> '!!! AKTİFLEME BAŞARISIZ !!!',
	'ASHIELDS_ENABLE_SUCCESS'	=> 'Başarıyla Aktifleştirildi!',
	'ASHIELDS_SAVED'			=> 'Ayarlar başarıyla kaydedildi!.',
	'ASHIELDS_UPDATED'			=> 'Dosya Eki Kalkanları yapılandırması güncellendi.',
	
	'ASHIELDS_INTERCEPTION'		=> 'Açıklama tutma',
	'ASHIELDS_INTERCEPTION_EXPLAIN'		=> 'Dosya açıklamasının bir versiyon numarası olarak tutulması için açıklama spesifik olmalı.<br /><strong>version-1.0.0</strong> şöyle görünür',
	'ASHIELDS_VERSION_ENABLE'	=> 'Dosya versiyon numaraları için açıklama tutmayı etkinleştir',
	
	'ASHIELDS_IMAGE'			=> 'Görsel Dosya Ayarları',
	'ASHIELDS_FILE'				=> 'Dosya Ayarları',

	'ASHIELDS_PREVIEW'			=> 'Önizleme:',
	'ASHIELDS_PREVIEW_EXPLAIN'	=> 'Önizlemeyi güncel olarak görmek için <em>Kabul Et</em> butonuna tıklamalı ve sayfayı yeniden yüklemelisin.',
	
	'ASHIELDS_COLOR'			=> 'Kalkan Konusu HTML Rengi',
	'ASHIELDS_CSS'				=> 'Dosya Eki CSS',
	'ASHIELDS_COLOR_EXPLAIN'	=> 'ör: <em>FF0000</em>. # hastagi kullanmayın',
	'ASHIELDS_CSS_EXPLAIN'		=> 'Kodu <strong>;</strong> simgesi ile  <strong>bitirmeyin</strong>',
	'ASHIELDS_CSS_HELP'			=> 'CSS Yardımcısı (tweak nerede gerekli ise başlamak için kopyala & yapıştırın)',
	'ASHIELDS_CSS_HELP_EXPLAIN'	=> 'border: 1px solid;border-radius: 10px; margin: 5px; padding: 20px 20px 20px; width: auto; text-transform: uppercase; text-align: center; background-color: #ffffe6',

	'ASHIELDS_STYLE'			=> 'Kalkan Stili',
	'ASHIELDS_STYLE_EXPLAIN'	=> 'Daha fazla bilgi için <a href="https://shields.io">shields.io</a> adresini ziyaret edin',
	'ASHIELDS_FLAT'				=> 'Düz',
	'ASHIELDS_PLASTIC'			=> 'Plastik',
	'ASHIELDS_FLAT_SQUARE'		=> 'Düz-Kare',
	'ASHIELDS_FOR_THE_BADGE'	=> 'Büyük Dörtgen',
	'ASHIELDS_POPOUT'			=> 'Popout',
	'ASHIELDS_POPOUT_SQUARE'	=> 'Popout-Kare',
	'ASHIELDS_SOCIAL'			=> 'Sosyal',
));
Health For Everyone ==> www.saglikforum.org

User avatar
Restless Rancor
Registered User
Posts: 184
Joined: Tue Sep 18, 2018 1:51 pm

Re: [3.2][BETA] Attachment Shields

Post by Restless Rancor » Thu Nov 01, 2018 4:41 pm

Thanks, these will be included in the next release and I'll be submitting for validation soon!
These aren't the droids you're looking for...

Locked

Return to “Extensions in Development”