Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: GL700Wing on September 11, 2022, 12:43:10 PM

Title: Indent BBC for SMF 2.1
Post by: GL700Wing on September 11, 2022, 12:43:10 PM
Link to the mod (https://custom.simplemachines.org/index.php?mod=4343)



Indent BBC for SMF 2.1
By GL700Wing (https://www.simplemachines.org/community/index.php?action=profile;u=112942)
(Based on Indent BBC (https://custom.simplemachines.org/index.php?mod=4003) mod by Hj Ahmad Rasyid Hj Ismail (https://www.simplemachines.org/community/index.php?action=profile;u=51815))




Note: For SMF 2.0 use the Indent BBC (https://custom.simplemachines.org/mods/index.php?mod=4003) 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 (https://www.simplemachines.org/community/index.php?action=profile;u=193241) and author's link (https://www.simplemachines.org/community/index.php?action=profile;u=51815) 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- (https://www.simplemachines.org/community/index.php?action=profile;u=322597).
o Fixed bug reported by Steve (https://www.simplemachines.org/community/index.php?msg=4134781).

v1.2 - 10-Jun-23
o Fixed hooks issue reported by Steve (https://www.simplemachines.org/community/index.php?msg=4151473).


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.
Title: Re: Indent BBC for SMF 2.1
Post by: TwitchisMental on September 11, 2022, 12:45:04 PM
Nice work :). Thank you for porting it to 2.1
Title: Re: Indent BBC for SMF 2.1
Post by: -Rock Lee- on September 11, 2022, 12:54:48 PM
How good you will update it and by the way I leave you the translation into Spanish latam and es 8).


Regards!
Title: Re: Indent BBC for SMF 2.1
Post by: Steve on September 11, 2022, 01:31:56 PM
Thank you thank you thank you!!!
Title: Re: Indent BBC for SMF 2.1
Post by: Steve on September 12, 2022, 04:54:31 PM
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?
Title: Re: Indent BBC for SMF 2.1
Post by: GL700Wing on September 12, 2022, 06:41:18 PM
@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 ...
Title: Re: Indent BBC for SMF 2.1
Post by: Steve on September 13, 2022, 07:34:37 AM
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.
Title: Re: Indent BBC for SMF 2.1
Post by: GL700Wing on September 13, 2022, 05:30:34 PM
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.
Title: Re: Indent BBC for SMF 2.1
Post by: Steve on September 13, 2022, 07:06:46 PM
Okay, I've installed it. Will let you know in a day or two if I'm still getting the errors. Thanks GL!
Title: Re: Indent BBC for SMF 2.1
Post by: GL700Wing on September 17, 2022, 10:01:15 PM
Version 1.1 - 18-Sep-22
o Added Spanish language files - thanks to -Rock Lee- (https://www.simplemachines.org/community/index.php?action=profile;u=322597).
o Fixed bug reported by Steve (https://www.simplemachines.org/community/index.php?msg=4134781).


Note: No need to uninstall version 1.0 as the mod installer includes code to update to the latest version.
Title: Re: Indent BBC for SMF 2.1
Post by: Steve on September 18, 2022, 06:36:10 AM
Thanks GL!
Title: Re: Indent BBC for SMF 2.1
Post by: Steve on April 30, 2023, 09:21:49 AM
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?
Title: Re: Indent BBC for SMF 2.1
Post by: GL700Wing on April 30, 2023, 09:31:00 AM
Don't know but maybe you could try uninstalling v1.1 and then reinstalling it to see if that resolves the issue.
Title: Re: Indent BBC for SMF 2.1
Post by: Steve on April 30, 2023, 10:36:12 AM
I had removed the hook, uninstalled this mod, re-installed it, and the hook was back and still showed a red x.
Title: Re: Indent BBC for SMF 2.1
Post by: Steve on May 09, 2023, 07:13:23 AM
I know you've been busy, this is just a gentle reminder to not forget me.  ;D
Title: Re: Indent BBC for SMF 2.1
Post by: GL700Wing on May 09, 2023, 09:20:26 AM
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) ...
Title: Re: Indent BBC for SMF 2.1
Post by: Steve on May 09, 2023, 02:36:11 PM
Okie doke ... (https://i.imgur.com/nSYBlcy.gif)
Title: Re: Indent BBC for SMF 2.1
Post by: GL700Wing on June 12, 2023, 03:49:13 AM
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).
Title: Re: Indent BBC for SMF 2.1
Post by: GL700Wing on June 12, 2023, 03:50:30 AM
Version 1.2 - 10-Jun-23
o Fixed hooks issue reported by Steve (https://www.simplemachines.org/community/index.php?msg=4151473).


Note: No need to uninstall version 1.0 or 1.1 as the mod installer includes code to update to the latest version.
Title: Re: Indent BBC for SMF 2.1
Post by: Steve on June 12, 2023, 07:35:15 AM
Thank you GL!