News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Indent BBC for SMF 2.1

Started by GL700Wing, September 11, 2022, 12:43:10 PM

Previous topic - Next topic

GL700Wing

Link to the mod



Indent BBC for SMF 2.1
By GL700Wing
(Based on Indent BBC mod by Hj Ahmad Rasyid Hj Ismail)




Note: For SMF 2.0 use the Indent BBC mod.

Indent BBC for SMF 2.1
- For SMF 2.1.x
- Fully hook, no file modification.

This mod will add three indent BBC buttons (ie: left side; right side; and both sides) that can used to indent text.

BSD License. Feel free to modify accordingly but keep Emanuale's name and author's link if it is in here somewhere. ;)


Release History:
v1.0 - 11-Sep-22
o Initial Release

v1.1 - 18-Sep-22
o Added Spanish language files - thanks to -Rock Lee-.
o Fixed bug reported by Steve.

v1.2 - 10-Jun-23
o Fixed hooks issue reported by Steve.


License
Copyright (c) 2014-2015, Hj Ahmad Rasyid Hj Ismail, 2022-2023 Kathy Leslie
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

TwitchisMental

Nice work :). Thank you for porting it to 2.1

-Rock Lee-

How good you will update it and by the way I leave you the translation into Spanish latam and es 8).


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Steve

Thank you thank you thank you!!!
DO NOT pm me for support!

Steve

Hi GL ... been getting this error (always twice):

Type of error

General

Error message

Hook call: function "IndentBBC" in file /home/steve/public_html/forums could not be called.
URL of page causing the error
https://myforumurl/index.php
https://myforumurl/cron.php

Backtrace information

    #0: call_integration_hook()
    Called from /home/steve/public_html/forums/Sources/Subs.php on line 2485
    #1: parse_bbc()
    Called from /home/steve/public_html/forums/Sources/tasks/CreatePost-Notify.php on line 569
    #2: handleWatchedNotifications()
    Called from /home/steve/public_html/forums/Sources/tasks/CreatePost-Notify.php on line 270
    #3: execute()
    Called from /home/steve/public_html/forums/cron.php on line 237
    #4: perform_task()
    Called from /home/steve/public_html/forums/cron.php on line 131

What does this mean?

Edit: looking at the hooks I find that this one: integrate_bbc_buttons is not found ... is this part of your mod? If not, I'll remove it and that should clear up the problem, right?
DO NOT pm me for support!

GL700Wing

@Steve I'm not seeing this on my test forum but as it has no activity there wouldn't be any notification/automated tasks to perform.

The 'integrate_bbc_buttons' is a standard hook definition and this mod uses it to display the indent buttons on the editor toolbar.

I suspect the issue may be that the file './Sources/Subs-IndentBBC.php', which is loaded by a hook, is loaded by the 'integrate_theme_include' hook (this is the same hook that loaded it in the SMF 2.0 version) and that it's probably not being loaded by automated tasks.

I think the solution is to load the file './Sources/Subs-IndentBBC.php' with the 'integrate_pre_include' hook instead - wondering if you could test this for me and let me know the outcome ...
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Steve

#6
I'm sorry GL but I wouldn't know how to do that.

I can set up an account for you if you'd like to take a look.
DO NOT pm me for support!

GL700Wing

Quote from: Steve on September 13, 2022, 07:34:37 AMI'm sorry GL but I wouldn't know how to do that.

I can set up an account for you if you'd like to take a look.
Not to worry - I've created a new version with this change for you to test and I'll send you a PM with a link to it.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Steve

Okay, I've installed it. Will let you know in a day or two if I'm still getting the errors. Thanks GL!
DO NOT pm me for support!

GL700Wing

#9
Version 1.1 - 18-Sep-22
o Added Spanish language files - thanks to -Rock Lee-.
o Fixed bug reported by Steve.


Note: No need to uninstall version 1.0 as the mod installer includes code to update to the latest version.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Steve

DO NOT pm me for support!

Steve

I've got version 1.1 installed but if I look at the list of hooks, the one called 'integrate_bbc_buttons' has a red x meaning of course that the hook has not been found. If I delete it however, my indent toolbar images disappear. Why is that?
DO NOT pm me for support!

GL700Wing

Don't know but maybe you could try uninstalling v1.1 and then reinstalling it to see if that resolves the issue.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Steve

I had removed the hook, uninstalled this mod, re-installed it, and the hook was back and still showed a red x.
DO NOT pm me for support!

Steve

I know you've been busy, this is just a gentle reminder to not forget me.  ;D
DO NOT pm me for support!

GL700Wing

Quote from: Steve on May 09, 2023, 07:13:23 AMI know you've been busy, this is just a gentle reminder to not forget me.  ;D
Not forgotten - still working full-time on an update to another mod (which is nearly done) ...
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Steve

DO NOT pm me for support!

GL700Wing

Quote from: Steve on April 30, 2023, 09:21:49 AMI've got version 1.1 installed but if I look at the list of hooks, the one called 'integrate_bbc_buttons' has a red x meaning of course that the hook has not been found. If I delete it however, my indent toolbar images disappear. Why is that?
Finally had time to look at/resolve this issue - the function name added to the hook in the database did not exactly match the case of the function name in the mod script file (ie, the function name added to the hook was IndentBBC_buttons but it should have been IndentBBC_Buttons).

I've updated the mod and there is an upgrade option for earlier versions that corrects the hook name (ie, no need to uninstall/reinstall the mod).
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

GL700Wing

Version 1.2 - 10-Jun-23
o Fixed hooks issue reported by Steve.


Note: No need to uninstall version 1.0 or 1.1 as the mod installer includes code to update to the latest version.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Steve

DO NOT pm me for support!

Advertisement: