ModBreak BBcode

ModBreak eXtended (old: Suggestion: date and time) - ModBreak BBcode

ModBreak eXtended (old: Suggestion: date and time)

by LukeWCS » Sat Aug 18, 2018 9:42 am

Hi Ger

Thanks for this cool extension. I have been looking for this for a long time. :)

Is it possible to add automatically date & time? So it could look like this:
PicPick_2018-08-18_11-26-02.png
PicPick_2018-08-18_11-26-02.png (3.39 KiB) Viewed 104 times

My idea how this could be solved: with a variable like $date$ and this will then replaced once by the message parser with the board's date standard.

HTML replacement in this case:

Code: Select all

<p class="bbc_mod_head">{L_MODBREAK_HEAD}{TEXT1} » $date$</p><div class="bbc_mod_text">{TEXT2}</div>
The parser must be expanded for this, I think.

So if you would write this:

Code: Select all

[mod=Administrator]mod msg test admin[/mod]
It would be replaced once at "Submit" by this:

Code: Select all

[mod=Administrator » Fr 17. Aug 2018, 17:50]mod msg test admin[/mod]
Last edited by LukeWCS on Sun Aug 26, 2018 11:02 am
May the backup be with you. Always.

My extensions: Monospace font for Posting Editor (phpbb.de)
My extension forks: LF who was here (phpbb.de / phpbb.com), ModBreak eXtended (phpbb.com)
User avatar
LukeWCS
Registered User
Posts: 146
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany
Contact:

Re: Suggestion: date and time

by Ger » Mon Aug 20, 2018 8:38 am

Hmm... might be possible but that would require quite some work to process this. First, I need to store the actual timestamp but more important: the viewing users timeformat and timezone should be processed as well so it would need to be made dynamic.

In my opinion this would result in quite some work to get it done properly with little benefit. In any case it would only serve a purpose when a moderator edits another users message instead of writing a modbreak in his own post (that already has a timestamp).
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-
User avatar
Ger
Recognised Extension Developer
Posts: 1845
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: Suggestion: date and time

by LukeWCS » Mon Aug 20, 2018 6:40 pm

First, after I made some experiments I found that my idea how this could be realised wasn't very well thought out. The problem is, that the $date$ variable can't be a part of the HTML replacement, it must be a part of the BBcode. But you can't put extra text in the BBcode as "template" for the user.
Ger wrote:In any case it would only serve a purpose when a moderator edits another users message instead of writing a modbreak in his own post (that already has a timestamp).
But that is exactly the purpose for which we would use the extension. ;) If our moderators write in her own posts they don't need Mod Break.

I was able to wrote a little modification (as ext) so the message parser can replace %date%. At the moment my procedure is this:

1. Select text and press the [mod] button.

2. Then I have:

[mod]example text[/mod] in the editor.

3. Then I add my username and %date% and press submit.

[mod=Luke %date%]example text[/mod] in the editor.

Then the result is:
PicPick_2018-08-20_20-34-40.png
PicPick_2018-08-20_20-34-40.png (3.28 KiB) Viewed 99 times
The current procedure is not exactly what I want, but much better than wrote date and time manually. Next I will implement my code directly in Mod Break.
May the backup be with you. Always.

My extensions: Monospace font for Posting Editor (phpbb.de)
My extension forks: LF who was here (phpbb.de / phpbb.com), ModBreak eXtended (phpbb.com)
User avatar
LukeWCS
Registered User
Posts: 146
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany
Contact:

Re: Suggestion: date and time

by LukeWCS » Mon Aug 20, 2018 8:23 pm

Ok, after more coffee I brought my mod to work fully automatically, %date% is no longer needed. ;)

If I have this in the editor:

Code: Select all

[mod]text example[/mod]
Then the message will changed to the following if I press Preview or Submit:

Code: Select all

[mod=Luke » Mo 20. Aug 2018, 22:16]text example[/mod]
Now my mod works as it should. It adds username and date automatically. That's what i want.

And if I want to add own text it's also no problem because if there is the following in the editor

Code: Select all

[mod={whatever you want}]text example[/mod]
then it will untouched.
May the backup be with you. Always.

My extensions: Monospace font for Posting Editor (phpbb.de)
My extension forks: LF who was here (phpbb.de / phpbb.com), ModBreak eXtended (phpbb.com)
User avatar
LukeWCS
Registered User
Posts: 146
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany
Contact:

Re: Suggestion: date and time

by Ger » Tue Aug 21, 2018 6:34 am

Cool. You might want to share your code in case somebody else is interested?
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-
User avatar
Ger
Recognised Extension Developer
Posts: 1845
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: Suggestion: date and time

by LukeWCS » Tue Aug 21, 2018 2:47 pm

Yes, but currently I try to improve some details. My mod is now fully implemented in your ext and I made some changes:

Writing the formatted date was not ideal because a user could have a different date format. Instead, I'm writing the timestamp now, so we have all the formatting options and the saved date is independent from any date format. To convert the Mod Break timestamp into the user date format for topicview there was another change needed with an additional event. Currently my mod uses two events.

Procedure:

Code: Select all

[mod]message example[/mod]
will converted to:

Code: Select all

[mod=Administrator time:1534861795]message example[/mod]
Then a second event convert this timestamp for topicview. A few examples with different date format, you can see that the date is formated with the users date settings.
PicPick_2018-08-21_16-41-22.png
PicPick_2018-08-21_16-41-22.png (4.87 KiB) Viewed 97 times
PicPick_2018-08-21_16-41-43.png
PicPick_2018-08-21_16-41-43.png (5.09 KiB) Viewed 96 times
PicPick_2018-08-21_17-07-12.png
PicPick_2018-08-21_17-07-12.png (4.7 KiB) Viewed 92 times
May the backup be with you. Always.

My extensions: Monospace font for Posting Editor (phpbb.de)
My extension forks: LF who was here (phpbb.de / phpbb.com), ModBreak eXtended (phpbb.com)
User avatar
LukeWCS
Registered User
Posts: 146
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany
Contact:

Re: Suggestion: date and time

by LukeWCS » Wed Aug 22, 2018 3:31 pm

My mod have now reached v4. Now the username can be clicked and is linked to the user profile.

Example: logged in user is "Administrator", so this bbcode:

Code: Select all

[mod]test message[/mod]
will converted to:

Code: Select all

[mod=Administrator time=1534951423 user_id=2]test message[/mod]
and looks like this:
PicPick_2018-08-22_17-29-09.png
PicPick_2018-08-22_17-29-09.png (5.71 KiB) Viewed 96 times
May the backup be with you. Always.

My extensions: Monospace font for Posting Editor (phpbb.de)
My extension forks: LF who was here (phpbb.de / phpbb.com), ModBreak eXtended (phpbb.com)
User avatar
LukeWCS
Registered User
Posts: 146
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany
Contact:

Re: Suggestion: date and time

by LukeWCS » Thu Aug 23, 2018 8:52 pm

v5:
  1. To convert the message after preview/submit is no longer needed, because now I create my own mod-button which can send the complete bbcode to the editor inclusive username, timestamp and user_id. So this works now very similar to the Quote feature. The default mod-button will disabled.
  2. Added more language variables so Mod Break can now handle 3 different display types: 1) without any parameter, 2) only with username, 3) full parameters.
  3. The button will now hide correctly if the current user have no permission for using it. This is a fix for the current version of Mod Break 1.1.0.
  4. On uninstall the bbcode is now removed correctly from database. This is also a fix for Mod Break 1.1.0.
To 1: pressing the mod-button will send the full bbcode to editor:

Code: Select all

[mod=Administrator time=1535056859 user_id=2][/mod]
To 2: the following bbcode:

Code: Select all

[mod]message
 example 1[/mod]

[mod=Administrator]message
 example 2a[/mod]

[mod=Administrator time=1434861795 user_id=2]message
 example 2b[/mod]
results in:
PicPick_2018-08-23_22-42-54.png
PicPick_2018-08-23_22-42-54.png (10.8 KiB) Viewed 98 times

Language example:

Code: Select all

<?php

/**
 *
 * Modbreak
 *
 * @copyright (c) 2017 Ger Bruinsma
 * @copyright (c) 2018 LukeWCS
 * @license GNU General Public License, version 2 (GPL-2.0)
 *
 * Lang_iso   : en
 * Lang_ver   : 1.2.0
 * Lang_author: LukeWCS
 *
 */

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

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

// Some characters you may want to copy&paste:
// ’ » „ “ — …
$lang = array_merge($lang, array(
	'MODBREAK_HEAD'				=> 'Moderator message',
	'MODBREAK_HEAD_FROM'			=> ' from: ',
	'MODBREAK_HEAD_DATE_SEPARATOR'		=> ' » ',
	'MODBREAK_BUTTON_TOOLTIP'		=> 'Insert moderator message in post: [mod]Text[/mod]     Can only be used by moderators',
));
May the backup be with you. Always.

My extensions: Monospace font for Posting Editor (phpbb.de)
My extension forks: LF who was here (phpbb.de / phpbb.com), ModBreak eXtended (phpbb.com)
User avatar
LukeWCS
Registered User
Posts: 146
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany
Contact:

ModBreak eXtended translations

by LukeWCS » Sun Aug 26, 2018 10:05 am

If you want to add your translation to the initial MBX release, then you can do the following:

Simply attach your translation here. I add your attachment then to my GitHub repo.


Reference language pack English:

https://github.com/GerB/modbreak/blob/m ... common.php

Explanation:
PicPick_2018-08-22_17-29-09_exp.png
PicPick_2018-08-22_17-29-09_exp.png (11.43 KiB) Viewed 89 times

Don't forget to change "Lang_iso" and "Lang_author".

A few words about "Lang_ver": This version is intended to make it easier to see which version of the extension the language file was created for. Example: if you translate the English file 1.3.1, your translation should also have version 1.3.1. If you want to add your own version, then just write it so that you can still see the main version.

Examples:
Lang_ver: 1.3.1 (a)
Lang_ver: 1.3.1-1
Lang_ver: 1.3.1_a

or something like that. The point is, everyone just needs to know which version of the extension the translation was made for.

Current list of MBX translations (ordered by iso code):

Code: Select all

ISO CODE                            AUTHOR
-------------------------------------------------------------
de                                  LukeWCS
de_x_sie                            LukeWCS
en                                  LukeWCS
es (Formal Honorifics - USTED)      ThE KuKa
es_x_tu (Casual Honorifics - TÚ)    ThE KuKa
nl                                  Ger Bruinsma
pt_br                               eunaumtenhoid
ru                                  Jim_Di
Last edited by LukeWCS on Wed Feb 13, 2019 2:12 pm
May the backup be with you. Always.

My extensions: Monospace font for Posting Editor (phpbb.de)
My extension forks: LF who was here (phpbb.de / phpbb.com), ModBreak eXtended (phpbb.com)
User avatar
LukeWCS
Registered User
Posts: 146
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany
Contact:

Re: ModBreak eXtended (old: Suggestion: date and time)

by eunaumtenhoid » Sun Aug 26, 2018 11:06 am

Brazilian Portuguese translation by eunaumtenhoid >> https://github.com/phpBBTraducoes/modbreak
Attachments
MBX_ptbr.zip
Brazilian Portuguese translation by eunaumtenhoid
(941 Bytes) Downloaded 17 times
My translations of the extensions for Brazilian Portuguese
https://github.com/phpBBTraducoes
User avatar
eunaumtenhoid
Registered User
Posts: 845
Joined: Wed Jun 03, 2009 12:46 am
Location: ????

Re: ModBreak eXtended (old: Suggestion: date and time)

by LukeWCS » Sun Aug 26, 2018 11:14 am

@eunaumtenhoid

Thanks! Added.
May the backup be with you. Always.

My extensions: Monospace font for Posting Editor (phpbb.de)
My extension forks: LF who was here (phpbb.de / phpbb.com), ModBreak eXtended (phpbb.com)
User avatar
LukeWCS
Registered User
Posts: 146
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany
Contact:

Re: ModBreak eXtended (old: Suggestion: date and time)

by LukeWCS » Tue Aug 28, 2018 1:07 pm

From my point of view, MBX have reached RC state. If you want to test it before release, you can download it now from the officially ModBreak GitHub repository.

Some notes:
  • If possible, use your test board.
  • If you already installed ModBreak, don't forget to disable it in ACP before updating. As usual.
  • If you install ModBreak for the first time, you must create the path ger/modbreak manually in your ext folder. Then put all files from the GitHub repo to ext/ger/modbreak.
  • You don't need the file .editorconfig, you can delete it. This file is only meant for GitHub and have nothing to do with the ModBreak ext.
May the backup be with you. Always.

My extensions: Monospace font for Posting Editor (phpbb.de)
My extension forks: LF who was here (phpbb.de / phpbb.com), ModBreak eXtended (phpbb.com)
User avatar
LukeWCS
Registered User
Posts: 146
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany
Contact:

Re: ModBreak eXtended (old: Suggestion: date and time)

by LukeWCS » Fri Sep 07, 2018 12:24 pm

Regarding this post from Ger, the next MBX build (v6b1) supports now the best of both worlds: ModBreak with message box (as before, ideally for moderator edits) and with full post mode (new, ideally for moderator posts).

To be able to intuitively select both modes, there is now an option list instead of a button:
PicPick_2018-09-07_13-55-08_.png

If we choose "as message box" we get this:

Code: Select all

[mod=Administrator time=1536321323 user_id=2 mode=0][/mod]
And this looks like:
PicPick_2018-09-07_14-15-49.png

If we choose "as full post" we get this:

Code: Select all

[mod=Administrator time=1536321323 user_id=2 mode=1][/mod]
And this looks like:
PicPick_2018-09-07_14-17-24.png

So this is now a case-by-case decision by the moderators instead of a one-time decision by the administrators. It means that ModBreak can now use both modes independently, which makes ModBreak more flexible.
May the backup be with you. Always.

My extensions: Monospace font for Posting Editor (phpbb.de)
My extension forks: LF who was here (phpbb.de / phpbb.com), ModBreak eXtended (phpbb.com)
User avatar
LukeWCS
Registered User
Posts: 146
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany
Contact:

Re: ModBreak eXtended (old: Suggestion: date and time)

by LukeWCS » Fri Oct 26, 2018 12:52 pm

A short video (0:53) demonstrates usage and presentation. For a better representation of the text the highest quality level is recommended.

https://www.youtube.com/watch?v=yrNzmi3QC84
May the backup be with you. Always.

My extensions: Monospace font for Posting Editor (phpbb.de)
My extension forks: LF who was here (phpbb.de / phpbb.com), ModBreak eXtended (phpbb.com)
User avatar
LukeWCS
Registered User
Posts: 146
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany
Contact:

Re: ModBreak eXtended (old: Suggestion: date and time)

by Ger » Sat Oct 27, 2018 6:33 am

Nice job
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-
User avatar
Ger
Recognised Extension Developer
Posts: 1845
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact: