This tool contains a class, that is able to trim a message from the phpbb message_parser to a maximum length without breaking the bbcodes/smilies and links.
-
Add
nickvergessen/phpbb-tool-trimmessage
as a composer dependency to your extension -
Use the code:
$object = new \Nickvergessen\TrimMessage\TrimMessage($message, $bbcode_uid, $length); // Ready to get parsed: echo $object->message();
We use Travis-CI as a continous intergtation server and phpunit for our unit testing. See more information on the phpBB development wiki.
php composer.phar install --dev
vendor/bin/phpunit
- This tool requires php 5.3.3 or above. When you include this tool in your MOD, put a note about the php-version in the author notes.
- This tool does not require a specific database.