dopetalk

Technology => SMF Forum Code Modifications => Topic started by: Chip on March 02, 2018, 04:16:43 PM

Title: [Plugin] SP - Extra Shoutbox Permissions/Options [Version 1.7]
Post by: Chip on March 02, 2018, 04:16:43 PM
https://simpleportal.net/index.php?topic=11714.msg59639#msg59639

New Features

These are additional features that are available within each shoutbox unique settings.
Custom Permissions -> Read Only [R]
Force Lowercase (possibly used for regex)
Regex filter (flavour/pattern)
Regex callback (PHP)
Reset regex to defaults option
Exempt Administrators from the regex filter
Consecutive shout limit
Consecutive limit exceeded warning (BBCode parsed)
Maximum single shout input characters setting
Disallowed hyperlink warning (BBCode parsed)

Permissions

These are site wide permissions meaning they affect all Simple Portal shoutboxes on your website.
Unique shoutbox permissions work in conjunction with these although the newer permission set has authority.
They are available in your membergroup permission settings.
Allow/Disallow viewing of shouts
Allow/Disallow posting of shouts
Allow/Disallow posting links
Allow/Disallow deletion of own shouts
Allow/Disallow editing of own shouts
Allow/Disallow whispering option
Enable/Disable filter of shout text via regex & callback (configurable)
Enable/Disable limiting amount of consecutive shouts
The above settings are available for Guest permissions (<- can opt guests to use the shoutbox)

General Features

These are general features that were added and/or changed from the shoutbox default behaviour.
They do not require any change of options as they are automatically applied.
Word-wrap added to css of each shout to prevent possible horizontal scroll bar
General warning displayed in some circumstances instead of fatal error message

Prerequisits for install and in this order:

can live without
Uninstall package: "Shoutbox PM button - SimplePortal 2.3.5", version 1.0
here is the lowdown on this mod:
https://forum.drugs-and-users.org/index.php/topic,3067.msg34042.html#msg34042 (https://forum.drugs-and-users.org/index.php/topic,3067.msg34042.html#msg34042)

can live without it
Uninstall package: "SP-Shoutbox Sounds", version 1.1

This had to go but needed undoing so see the link:
Uninstall package: "SP-Shoutbox Permissions", version 1.0   
https://forum.drugs-and-users.org/index.php/topic,4140.0.html (https://forum.drugs-and-users.org/index.php/topic,4140.0.html)

Install new package: "SP-Shoutbox Options", version 1.7

Post Merge: March 02, 2018, 04:56:36 PM
installed
Title: Re: [Plugin] SP - Extra Shoutbox Permissions/Options [Version 1.7]
Post by: Chip on June 27, 2018, 03:29:31 AM
BUG FIX for :

Quote
some characters undergo this odd translation to &xyx eg.:

"hi" -> &quot;hi&quot;

v1.71 to v1.72 upgrade (c/o Simple Portal Support

BACKUP first ...

Code: [Select]
cd /var/www/html
cp Themes/default/PortalShoutbox.template.php Themes/default/PortalShoutbox.template.php-Extra_Shoutbox_Options_v1.71_to_v1.72_upgrade

THEN ... in ./Themes/default/PortalShoutbox.template.php:

conflicts addressed; the lines that i needed to change plus comments to v.71 prior to the install are shown below:

change:
Code: [Select]
function template_shoutbox_xml()
{
        global $context, $txt;
to:
Code: [Select]
function template_shoutbox_xml()
{
        global $context, $txt, $smcFunc;

Code: [Select]
// the following line was not found in Simple Portal Extra Shoutbox Options v1.71 to v1.72 upgrade, it was removed and replaced by the line after it:
//              <timeclean>', htmlspecialchars(strip_tags($shout['time'])), '</timeclean>
                <timeclean>', $smcFunc['htmlspecialchars'](strip_tags($shout['time'])), '</timeclean>

Code: [Select]
// the following line was not found in Simple Portal Extra Shoutbox Options v1.71 to v1.72 upgrade, it was removed and replaced by the line after it:
//              <content>', htmlspecialchars($shout['text']), '</content>
                <content>', $smcFunc['htmlspecialchars']('<span style="word-wrap: break-word;overflow-y: auto;overflow-x: hidden;">'), $smcFunc['htmlspecialchars']($shout['text'], ENT_QUOTES), $smcFunc['htmlspecialchars']('</span>'), '</content>
SimplePortal 2.3.6 © 2008-2014, SimplePortal