News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Hide BBcode

Started by MrPython, Yesterday at 06:18:34 PM

Previous topic - Next topic

MrPython

Link to the mod

Hide BB Code Mod for SMF
========================
Changelog
---------

Version 1.2c (2025-07-23)
-------------------------
- Complete code refactoring for better readability and future SMF version support.
- Optimized BBCode parsing logic, fixed potential issues with nested tags handling.
- Improved PHP 8.x compatibility.
- Standardized and clarified in-code comments.
- Added inline documentation for functions and logic flow.
- Updated module version in package-info.
- License remains MIT; modification credit added.

Version 1.1 (Original by Kira_)
-------------------------------
- First public release.
- Basic functionality for hiding BB codes based on user/guest visibility conditions.

Bugo

    <file name="$sourcedir/Post.php" error="fatal">

        <operation>
            <search position="after"><![CDATA[if (!empty($can_view_post))
    {
        // Remove special formatting we don't want anymore.]]></search>
            <add><![CDATA[
        /*hBBc mod*/
        if(!empty($modSettings['hBBc_enable']))
            $row['body'] =preg_replace('%(\[hide.*\[/hide\])%iU', '', $row['body']);
        /*hBBc mod end*/   

]]></add>
        </operation>
    </file>
You can try using the integrate_unpreparsecode hook to get rid of these changes.

Advertisement: