[CDB] Simple Spoiler BBCode

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)
User avatar
AbaddonOrmuz
Registered User
Posts: 691
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo Ramos
Contact:

[CDB] Simple Spoiler BBCode

Post by AbaddonOrmuz » Sun Jan 15, 2017 10:32 pm

Extension Name: Simple Spoiler
Author: Alfredo Ramos (Abaddon Ormuz)
Extension Description:

Write [spoiler]text[/spoiler] or [spoiler=title]text[/spoiler] and it will hide the content on anywhere that you can render BBCodes. More information in the GitHub repository.

Note: It removes any existing [spoiler] BBCode and installs, or updates with the new data, the [spoiler=title] tag if already exists.

Extension Version: 1.0.6
Requirements:
  • php 5.6 or greater
  • phpBB 3.2 or greater
Features:
  • BBCodes can be nested
  • Full Unicode support in title for the [spoiler=title] BBCode
  • It's easily extendible and modificable for new styles
Screenshots:
Image
(Click to see in full size)

Installation:
  • Download the latest release
  • Decompress the *.zip or *.tar.gz file
  • Copy the files and directories inside <PHPBB_ROOT>/ext/alfredoramos/simplespoiler/
  • Go to your Administration Control Panel > Customize > Manage extensions
  • Click on Enable and confirm.
Configuration:

To add support for more styles simply copy the content of the styles/prosilver/theme/ directory into styles/<NEW_STYLE>/theme/

To customize the look and colors, edit the following files:
  • styles/<STYLE>/theme/css/style.css
  • styles/<STYLE>/theme/css/colors.css
Uninstallation:
  • Go to your Administration Control Panel > Customize > Manage extensions
  • Click on Disable and confirm.
  • Go back to Manage extensions > Simple Spoiler > Delete data and confirm.
Upgrade:
  • Uninstall the extension.
  • Delete all the files inside <PHPBB_ROOT>/alfredoramos/simplespoiler/.
  • Install the new version.
Extension Download: zip | tar.gz
GitHub Repository: AlfredoRamos/phpbb-ext-simple-spoiler
Last edited by AbaddonOrmuz on Fri Mar 24, 2017 1:17 pm, edited 9 times in total.
Some of my phpBB extensions: [ Imgur | SEO Metadata | Markdown ]
Check out all my extensions
Arch Linux user

User avatar
AbaddonOrmuz
Registered User
Posts: 691
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo Ramos
Contact:

Re: [3.2][RC] Simple Spoiler BBCode

Post by AbaddonOrmuz » Mon Jan 16, 2017 8:20 pm

ChangeLog:
  • [1.0.6] - 2017-03-21
    • Use __DIR__ instead of dirname(__FILE__)
    • Add French translation, thanks to Nokorbis
    • Add Greek translation, thanks to manicx
    [1.0.5] - 2017-02-20
    • Load BBCode template from file
    • Add Turkish translation, thanks to pikachuturkey
    • Fix Internet Explorer (jQuery) and Chrome/Chromium (CSS) issues
    [1.0.4] - 2017-02-02
    • Trim spoiler title and show the default title if it's empty
  • [1.0.3] - 2017-01-25
    • Fix conflict if another [spoiler] BBCode exists
    • Add button icon on posting box
  • [1.0.2] - 2017-01-18
    • Add title limit of 65 characters
    • Fix status height when title has two or more lines
    • Add title word breaking rule
    • Fix margin
  • [1.0.1] - 2017-01-16
    • Add extra security check when uninstalling the extension
    • Add Russian translation, thanks to Smayliks
Last edited by AbaddonOrmuz on Wed Mar 22, 2017 6:13 am, edited 5 times in total.
Some of my phpBB extensions: [ Imgur | SEO Metadata | Markdown ]
Check out all my extensions
Arch Linux user

User avatar
strelok-by
Registered User
Posts: 102
Joined: Fri Nov 21, 2014 10:22 am
Location: Mozyr / Belarus
Name: Stanislav
Contact:

Re: [3.2][RC] Simple Spoiler BBCode

Post by strelok-by » Mon Jan 16, 2017 9:04 pm

good job, even works on php 7.0.13 [phpBB 3.2]

User avatar
AbaddonOrmuz
Registered User
Posts: 691
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo Ramos
Contact:

Re: [3.2][RC] Simple Spoiler BBCode

Post by AbaddonOrmuz » Tue Jan 17, 2017 3:42 pm

strelok-by wrote:
Mon Jan 16, 2017 9:04 pm
good job, even works on php 7.0.13 [phpBB 3.2]
Thanks 8-)

The extension is tested on PHP 5.6, 7.0 and 7.1 locally and on an actual (shared) server before making any changes.
Some of my phpBB extensions: [ Imgur | SEO Metadata | Markdown ]
Check out all my extensions
Arch Linux user

onlyproevo
Registered User
Posts: 110
Joined: Tue Jun 21, 2011 8:13 pm

Re: [3.2][RC] Simple Spoiler BBCode

Post by onlyproevo » Wed Jan 18, 2017 11:01 am

Great ext! I really like it! :D

But would it be possible to allow emojis and smilies in the Spoiler title?

For example, this works fine:

Code: Select all

[spoiler=Example]🇩🇪[/spoiler]
but currently, the following doesn't:

Code: Select all

[spoiler=🇩🇪 Example][/spoiler]
Also, would it be possible to look at improving the spacing between spoilers?

To space out spoilers, like this:

Image

... you must press the Enter key two extra times:

Code: Select all

[spoiler=Example 1][/spoiler]



[spoiler=Example 2][/spoiler]
When really, using the standard format, you should only have to type this to get the image above:

Code: Select all

[spoiler=Example 1][/spoiler]

[spoiler=Example 2][/spoiler]
I hope you understand what I mean. :)

User avatar
AbaddonOrmuz
Registered User
Posts: 691
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo Ramos
Contact:

Re: [3.2][RC] Simple Spoiler BBCode

Post by AbaddonOrmuz » Wed Jan 18, 2017 11:59 am

onlyproevo wrote:
Wed Jan 18, 2017 11:01 am
[...]

But would it be possible to allow emojis and smilies in the Spoiler title?

[...]

Also, would it be possible to look at improving the spacing between spoilers?

[...]
I'm not sure if the {TEXT} token allows emojis, but it looks like not, I'll look into it.

Regarding the margin, it'll be fixed in the next version 8-)
Some of my phpBB extensions: [ Imgur | SEO Metadata | Markdown ]
Check out all my extensions
Arch Linux user

onlyproevo
Registered User
Posts: 110
Joined: Tue Jun 21, 2011 8:13 pm

Re: [3.2][RC] Simple Spoiler BBCode

Post by onlyproevo » Wed Jan 18, 2017 12:23 pm

AbaddonOrmuz wrote:
Wed Jan 18, 2017 11:59 am

I'm not sure if the {TEXT} token allows emojis, but it looks like not, I'll look into it.

Regarding the margin, it'll be fixed in the next version 8-)
Thanks and thanks! :D

User avatar
AbaddonOrmuz
Registered User
Posts: 691
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo Ramos
Contact:

Re: [3.2][RC] Simple Spoiler BBCode

Post by AbaddonOrmuz » Wed Jan 18, 2017 1:07 pm

onlyproevo wrote:
Wed Jan 18, 2017 12:23 pm
Thanks and thanks! :D
Well, emojis actually work on spoiler=, smilies certainly not.

- http://mysticknight.x10.mx/viewtopic.php?f=3&t=2 (test forum)

I'm not sure if it should show smilies, I don't think it is really needed and I didn't make this extension with that in mind, but hey you can show emojis :roll:
Some of my phpBB extensions: [ Imgur | SEO Metadata | Markdown ]
Check out all my extensions
Arch Linux user

User avatar
AbaddonOrmuz
Registered User
Posts: 691
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo Ramos
Contact:

Re: [3.2][RC] Simple Spoiler BBCode

Post by AbaddonOrmuz » Wed Jan 18, 2017 3:27 pm

Updated to version 1.0.2, see changelog.

Regarding the title limit for [spoiler=title], can be changed in the following method:

alfredoramos\simplespoiler\includes\helper::bbcode_data()
Some of my phpBB extensions: [ Imgur | SEO Metadata | Markdown ]
Check out all my extensions
Arch Linux user

onlyproevo
Registered User
Posts: 110
Joined: Tue Jun 21, 2011 8:13 pm

Re: [3.2][RC] Simple Spoiler BBCode

Post by onlyproevo » Wed Jan 18, 2017 3:43 pm

Good work! 😀

Unfortunately though, I still can't see emojis in my spoiler titles.

Screenshot here:

Image

Same emoji has been used for both title and content - but only the content shows correctly. Unless I'm missing something...

User avatar
AbaddonOrmuz
Registered User
Posts: 691
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo Ramos
Contact:

Re: [3.2][RC] Simple Spoiler BBCode

Post by AbaddonOrmuz » Wed Jan 18, 2017 3:58 pm

onlyproevo wrote:
Wed Jan 18, 2017 3:43 pm
Good work! 😀

Unfortunately though, I still can't see emojis in my spoiler titles.

Screenshot here:

Image

Same emoji has been used for both title and content - but only the content shows correctly. Unless I'm missing something...
I think that's a web browser issue, and if that's the case then there's nothing I can do to fix it.

Firefox 50.1.0
Image

Can you see all these emojis?

- http://getemoji.com/
Some of my phpBB extensions: [ Imgur | SEO Metadata | Markdown ]
Check out all my extensions
Arch Linux user

onlyproevo
Registered User
Posts: 110
Joined: Tue Jun 21, 2011 8:13 pm

Re: [3.2][RC] Simple Spoiler BBCode

Post by onlyproevo » Wed Jan 18, 2017 4:25 pm

AbaddonOrmuz wrote:
Wed Jan 18, 2017 3:58 pm
I think that's a web browser issue, and if that's the case then there's nothing I can do to fix it.
I assume it's something to do with this:
This computer will no longer receive Google Chrome updates because Windows XP and Windows Vista are no longer supported.
Still, thanks for all your help. 🤘

JWPlatt
Registered User
Posts: 25
Joined: Tue Nov 07, 2006 4:41 am

Re: [3.2][RC] Simple Spoiler BBCode

Post by JWPlatt » Sat Feb 18, 2017 4:22 pm

@AbaddonOrmuz

Thanks for this extension, especially since phpBB 3.2 appears to have broken most or all of the custom spoiler BBCode out there.

I have two suggestions:

1. To make install as easy as possible for non-techs, this instruction should not exist:
  • Copy the files and directories inside <PHPBB_ROOT>/ext/alfredoramos/simplespoiler/
Please create the entire folder structure in your repo so that we can unzip directly into the ext folder. It is unclear as well about whether to include the zip file name itself in the folder structure (I know it isn't, but it is unstated and "obvious" only to the experienced user).

2. Please include a brief write-up about what to do or is necessary, or not to do or is unnecessary, when custom spoiler BBCode (broken in phpBB 3.2) is already present. I see version 1.0.3 handles it somehow. It needs explanation in terms of any action required - or not required. Maybe all you need to say is "Simple Spoiler BBCode preempts any existing custom spoiler BBCode, which can be turned off in the ACP/Posting/BBCodes page using the green gear." If that's correct.
Last edited by JWPlatt on Sat Feb 18, 2017 5:06 pm, edited 2 times in total.

User avatar
lopoto
Registered User
Posts: 106
Joined: Thu Feb 12, 2015 3:13 pm

Re: [3.2][RC] Simple Spoiler BBCode

Post by lopoto » Sat Feb 18, 2017 4:44 pm

thx. for ext. very cool an handy :ugeek:

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

Re: [3.2][RC] Simple Spoiler BBCode

Post by pikachuturkey » Sat Feb 18, 2017 5:23 pm

Turkish language file for "[3.2][RC] Simple Spoiler BBCode" version 1.0.4. tr

Code: Select all

<?php
/**
 * Simple Spoiler Extension for phpBB.
 * @author Alfredo Ramos <alfredo.ramos@yandex.com>
 * @copyright 2017 Alfredo Ramos
 * @license GNU GPL-3.0+
 */
/**
 * @ignore
 */
if (!defined('IN_PHPBB')) {
	exit;
}
/**
 * @ignore
 */
if (empty($lang) || !is_array($lang)) {
	$lang = [];
}
/*
 * DEVELOPERS PLEASE NOTE
 *
 * All language files should use UTF-8 as their encoding and the files must not contain a BOM.
 *
 * Placeholders can now contain order information, e.g. instead of
 * 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
 * translators to re-order the output of data while ensuring it remains correct
 *
 * You do not need this where single placeholders are used, e.g. 'Message %d' is fine
 * equally where a string contains only two placeholders which are used to wrap text
 * in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
 *
 * Some characters you may want to copy&paste:
 * ’ » “ ” …
 */
$lang = array_merge($lang, [
	'SPOILER'			=> 'Spoiler',
	'SPOILER_HELPLINE'	=> 'Kullanımı: [spoiler]yazı metni[/spoiler] veya [spoiler=başlık]yazı metni[/spoiler]',
	'SPOILER_SHOW'		=> 'Göster',
	'SPOILER_HIDE'		=> 'Gizle'
]);
Health For Everyone ==> www.saglikforum.org

Locked

Return to “Extensions in Development”