From e4fed1276869ecded7ba41eef84a99933066e17d Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Sun, 13 Mar 2016 04:10:50 +0100 Subject: [PATCH] Added README and some other files. --- README.md | 7 + TODO | 12 ++ package-info.xml | 1 + sbox_110.mod | 312 +++++++++++++++++++++++++++++++++++++++++++++ sbox_111.mod | 325 +++++++++++++++++++++++++++++++++++++++++++++++ sbox_112.mod | 293 ++++++++++++++++++++++++++++++++++++++++++ sbox_113.mod | 309 ++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 1259 insertions(+) create mode 100644 README.md create mode 100644 TODO create mode 100644 sbox_110.mod create mode 100644 sbox_111.mod create mode 100644 sbox_112.mod create mode 100644 sbox_113.mod diff --git a/README.md b/README.md new file mode 100644 index 0000000..c365a4a --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +SMF Shoutbox +============ + +This allows you to put a shoutbox on your SMF forum above the board index of the default theme. + +Originally written By Deep, inspired by Matthew Wolf (a.k.a Grudge) +Heavily improved by Markus Birth diff --git a/TODO b/TODO new file mode 100644 index 0000000..0ee8d19 --- /dev/null +++ b/TODO @@ -0,0 +1,12 @@ +-filter out [IMG] (checkbox for enabling) +-disallow BBcode for specific users (specify user-ids in settings) +-version checking in settings panel? (grab from SMF's mod page) +-UTF8-support +-check: " appears as " +-check: Smileys not working when BBCode is disabled? +-maybe: option to change "SMF Shoutbox" title +-maybe: different shouts of different pages (if included several times) +-maybe: option to show posts first-one-top +-optimize XML-mod code to be more tolerant +-check: shouting resets inactivity counter? +-popout Shoutbox? diff --git a/package-info.xml b/package-info.xml index 8d36fb4..61ef905 100644 --- a/package-info.xml +++ b/package-info.xml @@ -101,6 +101,7 @@ PLEASE UNINSTALL ANY LANGUAGE PACK FOR SHOUTBOX BEFORE UPGRADING!]]> + diff --git a/sbox_110.mod b/sbox_110.mod new file mode 100644 index 0000000..2e537e1 --- /dev/null +++ b/sbox_110.mod @@ -0,0 +1,312 @@ + +SMF Shoutbox + + + +1.10 + + + +This is a shoutbox with seamless integration into SMF. + +Any registered user and any guest (if you allow them to use it) can type in a message and click shout. +The shoubox appears above the board index of the default theme. To do that, BoardIndex.template.php +of the default theme will be modified. +If you are using another theme, please modify the BoardIndex.template.php of that theme manually. +Maybe you have to modify sbox.template.php a little bit if u are using an "unusual" theme. + +Instructions: +1. Install SMF shoutbox using boardmod (itīs too complex to install manually) +2. Go into the Feature Settings page and choose the appropriate settings +3. Type in a message and click Shout! + +If you really want to install this mod manually, please use this file as a "how to". + +Author: +The SMF shoutbox was originally written by Deep, some code ist "stolen" from Matthew Wolf (a.k.a Grudge). +The current version was heavily improved by Markus Birth. +Thanks a lot, Grudge! + +Please direct any questions regarding this version to Deep, either by email (diem4@gmx.net) or by posting +in the appropriate place at www.simplemachines.org (the preferred option!) + +History: +Version 1.10 +1. sequential messages from one user have the same color +2. character limit for one shout has been raised to 320 chars (like one long SMS ;-) +3. displayed weekdays are now in the language the user has chosen in SMF and from SMF's language files +4. sBox-time is kept in sync with SMF's time (including all timezone-stuff) +5. there's a bar displayed showing what's new since the last refresh +6. poster's name can be clicked to show his profile +7. no HTML allowed +8. your own nick is made bold and a sound is played on first occurence +9. sbox now uses SMF's smileys and BBCode, option in settings shows the smiley-row known from posting messages in SMF +10. now user's "Display Name"s are shown instead of usernames +!! There's some experimental code commented out - maybe someone will make it work some day. It's +!! for showing who's viewing the shoutbox and for giving each user a specific unique distinguishable color. + +version 1.04 +1. font family is now adjustable +2. german language pack extracted + +version 1.03 +1. another refreshing bug fixed +2. help texts (admin interface) added +3. javascript bug (opera and netscape only) fixed +4. smilie window now can be made invisible +5. shouts can be deleted by admin +6. font color, font size and background color can be adjusted + +version 1.02 +1. javascript/html bugs fixed +2. error when shouting empty string fixed + +version 1.01: +1. some debug code removed +2. refreshing bug fixed +3. file path bug fixed + +version 1.00: +Original Version + + + +Deep and Markus Birth + + + +No homepage available at the moment + + + +$languagedir/Modifications.english.php + + + +?> + + + + +//SMF Shoutbox +$txt['sbox_ModTitle'] = 'SMF Shoutbox'; +$txt['sbox_Visible'] = 'Shoutbox is visible'; +$txt['sbox_GuestAllowed'] = 'Guests are allowed to shout'; +$txt['sbox_GuestVisible'] = 'Make Shoutbox visible to Guests'; +$txt['sbox_MaxLines'] = 'Maximum number of displayed shouts'; +$txt['sbox_Height'] = 'Shoutbox height (px)'; +$txt['sbox_SmiliesVisible'] = 'Smiley row is visible'; +$txt['sbox_KillShout'] = 'Dou you want to kill this shout?'; +$txt['sbox_TextSize1'] = '1. Font size'; +$txt['sbox_TextColor1'] = '1. Font color'; +$txt['sbox_TextSize2'] = '2. Font size'; +$txt['sbox_TextColor2'] = '2. Font color'; +$txt['sbox_RefreshTime'] = 'Refresh time'; +$txt['sbox_BackgroundColor'] = 'Background color'; +$txt['sbox_FontFamily1'] = '1. Font family'; +$txt['sbox_FontFamily2'] = '2. Font family'; +$txt['sbox_DoHistory'] = 'Create history of shouts'; +$txt['sbox_AllowBBC'] = 'Allow BBCode'; +$txt['sbox_Refresh'] = 'Refresh'; +$txt['sbox_History'] = 'History'; +$txt['sbox_HistoryClear'] = 'Clear history'; +$txt['sbox_HistoryNotFound'] = 'No history found.'; +$txt['sbox_EnableSounds'] = 'Enable sounds'; + + + + +$languagedir/Help.english.php + + + +?> + + + + +//SMF Shoutbox +$helptxt['sbox_Visible'] = 'Here you can decide wether the shoutbox is visible at all or not.'; +$helptxt['sbox_GuestAllowed'] = 'Here you can decide whether guests are allowed to post new shouts.'; +$helptxt['sbox_GuestVisible'] = 'Defines whether the Shoutbox is visible to guests at all.'; +$helptxt['sbox_MaxLines'] = 'Here you can enter the maximal count of lines displayed in the shoutbox.'; +$helptxt['sbox_Height'] = 'Here you can enter the height (pixels) of the shoutbox.'; +$helptxt['sbox_SmiliesVisible'] = 'Here you can decide whether smileys are visible or not. They work independently of this setting, though.'; +$helptxt['sbox_RefreshTime'] = 'Here you can adjust the refresh time'; +$helptxt['sbox_DoHistory'] = 'Defines whether all shouts should be written to a file so that an Administrator can check what was going on.'; +$helptxt['sbox_AllowBBC'] = 'Defines whether users are allowed to use BBCode in shouts. If disabled, only plain text is displayed - no smileys, no formatting.'; +$helptxt['sbox_EnableSounds'] = 'Enables the notification sound, when your nickname was mentioned since the last refresh.'; + + + + +$sourcedir/ModSettings.php + + + + 'karma' => 'ModifyKarmaSettings', + + + + 'sbox' => 'ModifySboxSettings', + + + + 'layout' => array( + 'title' => $txt['mods_cat_layout'], + 'href' => $scripturl . '?action=featuresettings;sa=layout;sesc=' . $context['session_id'], + ), + + + + 'sbox' => array( + 'title' => $txt['sbox_ModTitle'], + 'href' => $scripturl . '?action=featuresettings;sa=sbox;sesc=' . $context['session_id'], + ), + + + +function ModifyKarmaSettings() + + + +function ModifySboxSettings() +{ + global $txt, $scripturl, $context, $settings, $sc; + + $config_vars = array + ( + array('check', 'sbox_Visible'), + array('check', 'sbox_GuestVisible'), + array('check', 'sbox_GuestAllowed'), + array('check', 'sbox_SmiliesVisible'), + array('check', 'sbox_AllowBBC'), + array('check', 'sbox_DoHistory'), + array('int', 'sbox_MaxLines'), + array('int', 'sbox_Height'), + array('int', 'sbox_RefreshTime'), + array('select', 'sbox_FontFamily1', array( + 'Garamond, serif' => 'Garamond, serif', + 'Times, serif' => 'Times, serif', + 'Arial, Helvetica, sans-serif' => 'Arial, Helvetica, sans-serif', + 'Tahoma, Helvetica, sans-sarif' => 'Tahoma, Helvetica, sans-sarif', + 'Verdana, sans-serif' => 'Verdana, sans-serif', + 'cursive' => 'cursive', + 'Palatino, fantasy' => 'Palatino, fantasy', + 'Courier, monospace' => 'Courier, monospace' + ), + ), + array('select', 'sbox_FontFamily2', array( + 'Garamond, serif' => 'Garamond, serif', + 'Times, serif' => 'Times, serif', + 'Arial, Helvetica, sans-serif' => 'Arial, Helvetica, sans-serif', + 'Tahoma, Helvetica, sans-sarif' => 'Tahoma, Helvetica, sans-sarif', + 'Verdana, sans-serif' => 'Verdana, sans-serif', + 'cursive' => 'cursive', + 'Palatino, fantasy' => 'Palatino, fantasy', + 'Courier, monospace' => 'Courier, monospace' + ), + ), + array('select', 'sbox_TextSize1', array( + '6pt' => '6pt', + '7pt' => '7pt', + '8pt' => '8pt', + '9pt' => '9pt', + '10pt' => '10pt', + '11pt' => '11pt', + '12pt' => '12pt', + '13pt' => '13pt', + '14pt' => '14pt', + '15pt' => '15pt', + '16pt' => '16pt', + 'xx-small' => 'xx-small', + 'x-small' => 'x-small', + 'small' => 'small', + 'medium' => 'medium', + 'large' => 'large', + 'x-large' => 'x-large', + 'xx-large' => 'xx-large' + ), + ), + array('text', 'sbox_TextColor1'), + array('select', 'sbox_TextSize2', array( + '6pt' => '6pt', + '7pt' => '7pt', + '8pt' => '8pt', + '9pt' => '9pt', + '10pt' => '10pt', + '11pt' => '11pt', + '12pt' => '12pt', + '13pt' => '13pt', + '14pt' => '14pt', + '15pt' => '15pt', + '16pt' => '16pt', + 'xx-small' => 'xx-small', + 'x-small' => 'x-small', + 'small' => 'small', + 'medium' => 'medium', + 'large' => 'large', + 'x-large' => 'x-large', + 'xx-large' => 'xx-large' + ), + ), + array('text', 'sbox_TextColor2'), + array('text', 'sbox_BackgroundColor'), + array('check', 'sbox_EnableSounds'), + ); + + // Saving? + if (isset($_GET['save'])) + { + saveDBSettings($config_vars); + redirectexit('action=featuresettings;sa=sbox'); + } + + $context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=sbox'; + $context['settings_title'] = $txt['sbox_ModTitle']; + + prepareDBSettingContext($config_vars); +} + + + + +$sourcedir/Subs.php + + + + log_error('Copyright removed!!'); + } +} + + + + +function sbox() +{ + global $sourcedir; + + include_once("$sourcedir/sbox.php"); + sbox_display(); +} + + + + +$themedir/BoardIndex.template.php + + + + + + + '; + } + + + + + // display shoutbox + if (function_exists('sbox')) sbox(); + + diff --git a/sbox_111.mod b/sbox_111.mod new file mode 100644 index 0000000..ab6eddb --- /dev/null +++ b/sbox_111.mod @@ -0,0 +1,325 @@ + +SMF Shoutbox + + + +1.11 + + + +This is a shoutbox with seamless integration into SMF. + +Any registered user and any guest (if you allow them to use it) can type in a message and click shout. +The shoubox appears above the board index of the default theme. To do that, BoardIndex.template.php +of the default theme will be modified. +If you are using another theme, please modify the BoardIndex.template.php of that theme manually. +Maybe you have to modify sbox.template.php a little bit if u are using an "unusual" theme. + +Instructions: +1. Install SMF shoutbox using boardmod (itīs too complex to install manually) +2. Go into the Feature Settings page and choose the appropriate settings +3. Type in a message and click Shout! + +If you really want to install this mod manually, please use this file as a "how to". + +Author: +The SMF shoutbox was originally written by Deep, some code ist "stolen" from Matthew Wolf (a.k.a Grudge). +The current version was heavily improved by Markus Birth. +Thanks a lot, Grudge! + +Please direct any questions regarding this version to Deep, either by email (diem4@gmx.net) or by posting +in the appropriate place at www.simplemachines.org (the preferred option!) + +History: +Version 1.11 ++ added German language-pack ++ added switch to disable linking to profile pages ++ added switch to disable Refresh after there have been no posts in lastActive time +* shortened some CSS classnames + +Version 1.10 +1. sequential messages from one user have the same color +2. character limit for one shout has been raised to 320 chars (like one long SMS ;-) +3. displayed weekdays are now in the language the user has chosen in SMF and from SMF's language files +4. sBox-time is kept in sync with SMF's time (including all timezone-stuff) +5. there's a bar displayed showing what's new since the last refresh +6. poster's name can be clicked to show his profile +7. no HTML allowed +8. your own nick is made bold and a sound is played on first occurence +9. sbox now uses SMF's smileys and BBCode, option in settings shows the smiley-row known from posting messages in SMF +10. now user's "Display Name"s are shown instead of usernames +!! There's some experimental code commented out - maybe someone will make it work some day. It's +!! for showing who's viewing the shoutbox and for giving each user a specific unique distinguishable color. + +version 1.04 +1. font family is now adjustable +2. german language pack extracted + +version 1.03 +1. another refreshing bug fixed +2. help texts (admin interface) added +3. javascript bug (opera and netscape only) fixed +4. smilie window now can be made invisible +5. shouts can be deleted by admin +6. font color, font size and background color can be adjusted + +version 1.02 +1. javascript/html bugs fixed +2. error when shouting empty string fixed + +version 1.01: +1. some debug code removed +2. refreshing bug fixed +3. file path bug fixed + +version 1.00: +Original Version + + + +Deep and Markus Birth + + + +No homepage available at the moment + + + +$languagedir/Modifications.english.php + + + +?> + + + + +//SMF Shoutbox +$txt['sbox_ModTitle'] = 'SMF Shoutbox'; +$txt['sbox_Visible'] = 'Shoutbox is visible'; +$txt['sbox_GuestAllowed'] = 'Guests are allowed to shout'; +$txt['sbox_GuestVisible'] = 'Make Shoutbox visible to Guests'; +$txt['sbox_MaxLines'] = 'Maximum number of displayed shouts'; +$txt['sbox_Height'] = 'Shoutbox height (px)'; +$txt['sbox_SmiliesVisible'] = 'Smiley row is visible'; +$txt['sbox_UserLinksVisible'] = 'Show profile links'; +$txt['sbox_KillShout'] = 'Dou you want to kill this shout?'; +$txt['sbox_TextSize1'] = '1. Font size'; +$txt['sbox_TextColor1'] = '1. Font color'; +$txt['sbox_TextSize2'] = '2. Font size'; +$txt['sbox_TextColor2'] = '2. Font color'; +$txt['sbox_RefreshTime'] = 'Refresh time'; +$txt['sbox_BlockRefresh'] = 'Block Refresh after inactivity (' . $modSettings['lastActive'] . ' mins)'; +$txt['sbox_BackgroundColor'] = 'Background color'; +$txt['sbox_FontFamily1'] = '1. Font family'; +$txt['sbox_FontFamily2'] = '2. Font family'; +$txt['sbox_DoHistory'] = 'Create history of shouts'; +$txt['sbox_AllowBBC'] = 'Allow BBCode'; +$txt['sbox_Refresh'] = 'Refresh'; +$txt['sbox_RefreshBlocked'] = 'Automatic refresh disabled due to inactivity'; +$txt['sbox_History'] = 'History'; +$txt['sbox_HistoryClear'] = 'Clear history'; +$txt['sbox_HistoryNotFound'] = 'No history found.'; +$txt['sbox_EnableSounds'] = 'Enable sounds'; + + + + +$languagedir/Help.english.php + + + +?> + + + + +//SMF Shoutbox +$helptxt['sbox_Visible'] = 'Here you can decide wether the shoutbox is visible at all or not.'; +$helptxt['sbox_GuestAllowed'] = 'Here you can decide whether guests are allowed to post new shouts.'; +$helptxt['sbox_GuestVisible'] = 'Defines whether the Shoutbox is visible to guests at all.'; +$helptxt['sbox_MaxLines'] = 'Here you can enter the maximal count of lines displayed in the shoutbox.'; +$helptxt['sbox_Height'] = 'Here you can enter the height (pixels) of the shoutbox.'; +$helptxt['sbox_SmiliesVisible'] = 'Here you can decide whether smileys are visible or not. They work independently of this setting, though.'; +$helptxt['sbox_UserLinksVisible'] = 'Defines whether the names of shouters are linked to their profile page or not.'; +$helptxt['sbox_RefreshTime'] = 'Here you can adjust the refresh time'; +$helptxt['sbox_BlockRefresh'] = 'Defines whether the Shoutbox should stop refreshing after there have been no new shouts for a while. Users can still manually refresh the Shoutbox. The time treshold used is the User online time treshold found in the Basic Features-settings. (currently ' . $modSettings['lastActive'] . ' minutes)'; +$helptxt['sbox_DoHistory'] = 'Defines whether all shouts should be written to a file so that an Administrator can check what was going on.'; +$helptxt['sbox_AllowBBC'] = 'Defines whether users are allowed to use BBCode in shouts. If disabled, only plain text is displayed - no smileys, no formatting.'; +$helptxt['sbox_EnableSounds'] = 'Enables the notification sound, when your nickname was mentioned since the last refresh.'; + + + + +$sourcedir/ModSettings.php + + + + 'karma' => 'ModifyKarmaSettings', + + + + 'sbox' => 'ModifySboxSettings', + + + + 'layout' => array( + 'title' => $txt['mods_cat_layout'], + 'href' => $scripturl . '?action=featuresettings;sa=layout;sesc=' . $context['session_id'], + ), + + + + 'sbox' => array( + 'title' => $txt['sbox_ModTitle'], + 'href' => $scripturl . '?action=featuresettings;sa=sbox;sesc=' . $context['session_id'], + ), + + + +function ModifyKarmaSettings() + + + +function ModifySboxSettings() +{ + global $txt, $scripturl, $context, $settings, $sc; + + $config_vars = array + ( + array('check', 'sbox_Visible'), + array('check', 'sbox_GuestVisible'), + array('check', 'sbox_GuestAllowed'), + array('check', 'sbox_SmiliesVisible'), + array('check', 'sbox_UserLinksVisible'), + array('check', 'sbox_AllowBBC'), + array('check', 'sbox_DoHistory'), + array('int', 'sbox_MaxLines'), + array('int', 'sbox_Height'), + array('int', 'sbox_RefreshTime'), + array('check', 'sbox_BlockRefresh'), + array('select', 'sbox_FontFamily1', array( + 'Garamond, serif' => 'Garamond, serif', + 'Times, serif' => 'Times, serif', + 'Arial, Helvetica, sans-serif' => 'Arial, Helvetica, sans-serif', + 'Tahoma, Helvetica, sans-sarif' => 'Tahoma, Helvetica, sans-sarif', + 'Verdana, sans-serif' => 'Verdana, sans-serif', + 'cursive' => 'cursive', + 'Palatino, fantasy' => 'Palatino, fantasy', + 'Courier, monospace' => 'Courier, monospace' + ), + ), + array('select', 'sbox_FontFamily2', array( + 'Garamond, serif' => 'Garamond, serif', + 'Times, serif' => 'Times, serif', + 'Arial, Helvetica, sans-serif' => 'Arial, Helvetica, sans-serif', + 'Tahoma, Helvetica, sans-sarif' => 'Tahoma, Helvetica, sans-sarif', + 'Verdana, sans-serif' => 'Verdana, sans-serif', + 'cursive' => 'cursive', + 'Palatino, fantasy' => 'Palatino, fantasy', + 'Courier, monospace' => 'Courier, monospace' + ), + ), + array('select', 'sbox_TextSize1', array( + '6pt' => '6pt', + '7pt' => '7pt', + '8pt' => '8pt', + '9pt' => '9pt', + '10pt' => '10pt', + '11pt' => '11pt', + '12pt' => '12pt', + '13pt' => '13pt', + '14pt' => '14pt', + '15pt' => '15pt', + '16pt' => '16pt', + 'xx-small' => 'xx-small', + 'x-small' => 'x-small', + 'small' => 'small', + 'medium' => 'medium', + 'large' => 'large', + 'x-large' => 'x-large', + 'xx-large' => 'xx-large' + ), + ), + array('text', 'sbox_TextColor1'), + array('select', 'sbox_TextSize2', array( + '6pt' => '6pt', + '7pt' => '7pt', + '8pt' => '8pt', + '9pt' => '9pt', + '10pt' => '10pt', + '11pt' => '11pt', + '12pt' => '12pt', + '13pt' => '13pt', + '14pt' => '14pt', + '15pt' => '15pt', + '16pt' => '16pt', + 'xx-small' => 'xx-small', + 'x-small' => 'x-small', + 'small' => 'small', + 'medium' => 'medium', + 'large' => 'large', + 'x-large' => 'x-large', + 'xx-large' => 'xx-large' + ), + ), + array('text', 'sbox_TextColor2'), + array('text', 'sbox_BackgroundColor'), + array('check', 'sbox_EnableSounds'), + ); + + // Saving? + if (isset($_GET['save'])) + { + saveDBSettings($config_vars); + redirectexit('action=featuresettings;sa=sbox'); + } + + $context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=sbox'; + $context['settings_title'] = $txt['sbox_ModTitle']; + + prepareDBSettingContext($config_vars); +} + + + + +$sourcedir/Subs.php + + + + log_error('Copyright removed!!'); + } +} + + + + +function sbox() +{ + global $sourcedir; + + include_once("$sourcedir/sbox.php"); + sbox_display(); +} + + + + +$themedir/BoardIndex.template.php + + + + + + + '; + } + + + + + // display shoutbox + if (function_exists('sbox')) sbox(); + + diff --git a/sbox_112.mod b/sbox_112.mod new file mode 100644 index 0000000..a2ee160 --- /dev/null +++ b/sbox_112.mod @@ -0,0 +1,293 @@ + +SMF Shoutbox + + + +1.12 + + + +This is a shoutbox with seamless integration into SMF. + +Any registered user and any guest (if you allow them to use it) can type in a message and click shout. +The shoubox appears above the board index of the default theme. To do that, BoardIndex.template.php +of the default theme will be modified. +If you are using another theme, please modify the BoardIndex.template.php of that theme manually. +Maybe you have to modify sbox.template.php a little bit if u are using an "unusual" theme. + +Instructions: +1. Install SMF shoutbox using boardmod (itīs too complex to install manually) +2. Go into the Feature Settings page and choose the appropriate settings +3. Type in a message and click Shout! + +If you really want to install this mod manually, please use this file as a "how to". + +Author: +The SMF shoutbox was originally written by Deep, some code ist "stolen" from Matthew Wolf (a.k.a Grudge). +The current version was heavily improved by Markus Birth. +Thanks a lot, Grudge! + +Please direct any questions regarding this version to Deep, either by email (diem4@gmx.net) or by posting +in the appropriate place at www.simplemachines.org (the preferred option!) + +History: +Version 1.12 +* made compatible with SMF 1.1rc3 +* moved basic strings from Modifications..php to sbox..php so that there now is language fallback to English (and 1 file less to change) ++ check for lock before removing History file +x JavaScript clear() was reserved, renamed to clearHist() +x active refresh on new shout ++ included language pack into main setup package so that distribution should be easier + +Version 1.11 ++ added German language-pack ++ added switch to disable linking to profile pages ++ added switch to disable Refresh after there have been no posts in lastActive time +* shortened some CSS classnames + +Version 1.10 +1. sequential messages from one user have the same color +2. character limit for one shout has been raised to 320 chars (like one long SMS ;-) +3. displayed weekdays are now in the language the user has chosen in SMF and from SMF's language files +4. sBox-time is kept in sync with SMF's time (including all timezone-stuff) +5. there's a bar displayed showing what's new since the last refresh +6. poster's name can be clicked to show his profile +7. no HTML allowed +8. your own nick is made bold and a sound is played on first occurence +9. sbox now uses SMF's smileys and BBCode, option in settings shows the smiley-row known from posting messages in SMF +10. now user's "Display Name"s are shown instead of usernames +!! There's some experimental code commented out - maybe someone will make it work some day. It's +!! for showing who's viewing the shoutbox and for giving each user a specific unique distinguishable color. + +version 1.04 +1. font family is now adjustable +2. german language pack extracted + +version 1.03 +1. another refreshing bug fixed +2. help texts (admin interface) added +3. javascript bug (opera and netscape only) fixed +4. smilie window now can be made invisible +5. shouts can be deleted by admin +6. font color, font size and background color can be adjusted + +version 1.02 +1. javascript/html bugs fixed +2. error when shouting empty string fixed + +version 1.01: +1. some debug code removed +2. refreshing bug fixed +3. file path bug fixed + +version 1.00: +Original Version + + + +Deep and Markus Birth + + + +No homepage available at the moment + + + +$sourcedir/ModSettings.php + + + + 'karma' => 'ModifyKarmaSettings', + + + + 'sbox' => 'ModifySboxSettings', + + + + 'layout' => array( + 'title' => $txt['mods_cat_layout'], + 'href' => $scripturl . '?action=featuresettings;sa=layout;sesc=' . $context['session_id'], + ), + + + + 'sbox' => array( + 'title' => $txt['sbox_ModTitle'], + 'href' => $scripturl . '?action=featuresettings;sa=sbox;sesc=' . $context['session_id'], + ), + + + +function ModifyKarmaSettings() + + + +loadLanguage('sbox'); + +function ModifySboxSettings() +{ + global $txt, $scripturl, $context, $settings, $sc; + + $config_vars = array + ( + array('check', 'sbox_Visible'), + array('check', 'sbox_GuestVisible'), + array('check', 'sbox_GuestAllowed'), + array('check', 'sbox_SmiliesVisible'), + array('check', 'sbox_UserLinksVisible'), + array('check', 'sbox_AllowBBC'), + array('check', 'sbox_DoHistory'), + array('int', 'sbox_MaxLines'), + array('int', 'sbox_Height'), + array('int', 'sbox_RefreshTime'), + array('check', 'sbox_BlockRefresh'), + array('select', 'sbox_FontFamily1', array( + 'Garamond, serif' => 'Garamond, serif', + 'Times, serif' => 'Times, serif', + 'Arial, Helvetica, sans-serif' => 'Arial, Helvetica, sans-serif', + 'Tahoma, Helvetica, sans-sarif' => 'Tahoma, Helvetica, sans-sarif', + 'Verdana, sans-serif' => 'Verdana, sans-serif', + 'cursive' => 'cursive', + 'Palatino, fantasy' => 'Palatino, fantasy', + 'Courier, monospace' => 'Courier, monospace' + ), + ), + array('select', 'sbox_FontFamily2', array( + 'Garamond, serif' => 'Garamond, serif', + 'Times, serif' => 'Times, serif', + 'Arial, Helvetica, sans-serif' => 'Arial, Helvetica, sans-serif', + 'Tahoma, Helvetica, sans-sarif' => 'Tahoma, Helvetica, sans-sarif', + 'Verdana, sans-serif' => 'Verdana, sans-serif', + 'cursive' => 'cursive', + 'Palatino, fantasy' => 'Palatino, fantasy', + 'Courier, monospace' => 'Courier, monospace' + ), + ), + array('select', 'sbox_TextSize1', array( + '6pt' => '6pt', + '7pt' => '7pt', + '8pt' => '8pt', + '9pt' => '9pt', + '10pt' => '10pt', + '11pt' => '11pt', + '12pt' => '12pt', + '13pt' => '13pt', + '14pt' => '14pt', + '15pt' => '15pt', + '16pt' => '16pt', + 'xx-small' => 'xx-small', + 'x-small' => 'x-small', + 'small' => 'small', + 'medium' => 'medium', + 'large' => 'large', + 'x-large' => 'x-large', + 'xx-large' => 'xx-large' + ), + ), + array('text', 'sbox_TextColor1'), + array('select', 'sbox_TextSize2', array( + '6pt' => '6pt', + '7pt' => '7pt', + '8pt' => '8pt', + '9pt' => '9pt', + '10pt' => '10pt', + '11pt' => '11pt', + '12pt' => '12pt', + '13pt' => '13pt', + '14pt' => '14pt', + '15pt' => '15pt', + '16pt' => '16pt', + 'xx-small' => 'xx-small', + 'x-small' => 'x-small', + 'small' => 'small', + 'medium' => 'medium', + 'large' => 'large', + 'x-large' => 'x-large', + 'xx-large' => 'xx-large' + ), + ), + array('text', 'sbox_TextColor2'), + array('text', 'sbox_BackgroundColor'), + array('check', 'sbox_EnableSounds'), + ); + + // Saving? + if (isset($_GET['save'])) + { + saveDBSettings($config_vars); + redirectexit('action=featuresettings;sa=sbox'); + } + + $context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=sbox'; + $context['settings_title'] = $txt['sbox_ModTitle']; + + prepareDBSettingContext($config_vars); +} + + + + +$sourcedir/Subs.php + + + + log_error('Copyright removed!!'); + } +} + + + + +function sbox() +{ + global $sourcedir; + + include_once("$sourcedir/sbox.php"); + sbox_display(); +} + + + + +$themedir/BoardIndex.template.php + + + + + + + '; + } + + + + + // display shoutbox + if (function_exists('sbox')) sbox(); + + + +$languagedir/Help.english.php + + + +?> + + + + +//SMF Shoutbox +$helptxt['sbox_Visible'] = 'Here you can decide wether the shoutbox is visible at all or not.'; +$helptxt['sbox_GuestAllowed'] = 'Here you can decide whether guests are allowed to post new shouts.'; +$helptxt['sbox_GuestVisible'] = 'Defines whether the Shoutbox is visible to guests at all.'; +$helptxt['sbox_MaxLines'] = 'Here you can enter the maximal count of lines displayed in the shoutbox.'; +$helptxt['sbox_Height'] = 'Here you can enter the height (pixels) of the shoutbox.'; +$helptxt['sbox_SmiliesVisible'] = 'Here you can decide whether smileys are visible or not. They work independently of this setting, though.'; +$helptxt['sbox_UserLinksVisible'] = 'Defines whether the names of shouters are linked to their profile page or not.'; +$helptxt['sbox_RefreshTime'] = 'Here you can adjust the refresh time'; +$helptxt['sbox_BlockRefresh'] = 'Defines whether the Shoutbox should stop refreshing after there have been no new shouts for a while. Users can still manually refresh the Shoutbox. The time treshold used is the User online time treshold found in the Basic Features-settings. (currently ' . $modSettings['lastActive'] . ' minutes)'; +$helptxt['sbox_DoHistory'] = 'Defines whether all shouts should be written to a file so that an Administrator can check what was going on.'; +$helptxt['sbox_AllowBBC'] = 'Defines whether users are allowed to use BBCode in shouts. If disabled, only plain text is displayed - no smileys, no formatting.'; +$helptxt['sbox_EnableSounds'] = 'Enables the notification sound, when your nickname was mentioned since the last refresh.'; + diff --git a/sbox_113.mod b/sbox_113.mod new file mode 100644 index 0000000..1fcefc8 --- /dev/null +++ b/sbox_113.mod @@ -0,0 +1,309 @@ + +SMF Shoutbox + + + +1.13 + + + +This is a shoutbox with seamless integration into SMF. + +Any registered user and any guest (if you allow them to use it) can type in a message and click shout. +The shoubox appears above the board index of the default theme. To do that, BoardIndex.template.php +of the default theme will be modified. +If you are using another theme, please modify the BoardIndex.template.php of that theme manually. +Maybe you have to modify sbox.template.php a little bit if u are using an "unusual" theme. + +Instructions: +1. Install SMF shoutbox using boardmod (itīs too complex to install manually) +2. Go into the Feature Settings page and choose the appropriate settings +3. Type in a message and click Shout! + +If you really want to install this mod manually, please use this file as a "how to". + +Author: +The SMF shoutbox was originally written by Deep, some code ist "stolen" from Matthew Wolf (a.k.a Grudge). +The current version was heavily improved by Markus Birth. +Thanks a lot, Grudge! + +Please direct any questions regarding this version to Deep, either by email (diem4@gmx.net) or by posting +in the appropriate place at www.simplemachines.org (the preferred option!) + +History: +Version 1.12 +* made compatible with SMF 1.1rc3 +* moved basic strings from Modifications..php to sbox..php so that there now is language fallback to English (and 1 file less to change) ++ check for lock before removing History file +x JavaScript clear() was reserved, renamed to clearHist() +x active refresh on new shout ++ included language pack into main setup package so that distribution should be easier + +Version 1.11 ++ added German language-pack ++ added switch to disable linking to profile pages ++ added switch to disable Refresh after there have been no posts in lastActive time +* shortened some CSS classnames + +Version 1.10 +1. sequential messages from one user have the same color +2. character limit for one shout has been raised to 320 chars (like one long SMS ;-) +3. displayed weekdays are now in the language the user has chosen in SMF and from SMF's language files +4. sBox-time is kept in sync with SMF's time (including all timezone-stuff) +5. there's a bar displayed showing what's new since the last refresh +6. poster's name can be clicked to show his profile +7. no HTML allowed +8. your own nick is made bold and a sound is played on first occurence +9. sbox now uses SMF's smileys and BBCode, option in settings shows the smiley-row known from posting messages in SMF +10. now user's "Display Name"s are shown instead of usernames +!! There's some experimental code commented out - maybe someone will make it work some day. It's +!! for showing who's viewing the shoutbox and for giving each user a specific unique distinguishable color. + +version 1.04 +1. font family is now adjustable +2. german language pack extracted + +version 1.03 +1. another refreshing bug fixed +2. help texts (admin interface) added +3. javascript bug (opera and netscape only) fixed +4. smilie window now can be made invisible +5. shouts can be deleted by admin +6. font color, font size and background color can be adjusted + +version 1.02 +1. javascript/html bugs fixed +2. error when shouting empty string fixed + +version 1.01: +1. some debug code removed +2. refreshing bug fixed +3. file path bug fixed + +version 1.00: +Original Version + + + +Deep and Markus Birth + + + +http://mods.simplemachines.org/index.php?mod=412 + + + +$sourcedir/ModSettings.php + + + + 'karma' => 'ModifyKarmaSettings', + + + + 'sbox' => 'ModifySboxSettings', + + + + 'layout' => array( + 'title' => $txt['mods_cat_layout'], + 'href' => $scripturl . '?action=featuresettings;sa=layout;sesc=' . $context['session_id'], + ), + + + + 'sbox' => array( + 'title' => $txt['sbox_ModTitle'], + 'href' => $scripturl . '?action=featuresettings;sa=sbox;sesc=' . $context['session_id'], + ), + + + +function ModifyKarmaSettings() + + + +loadLanguage('sbox'); + +function ModifySboxSettings() +{ + global $txt, $scripturl, $context, $settings, $sc; + + $config_vars = array + ( + // Generic stuff + array('check', 'sbox_Visible'), + array('check', 'sbox_ModsRule'), + array('check', 'sbox_DoHistory'), + '', + // Guest stuff + array('check', 'sbox_GuestVisible'), + array('check', 'sbox_GuestAllowed'), + array('check', 'sbox_GuestBBC'), + '', + // Visual + array('check', 'sbox_SmiliesVisible'), + array('check', 'sbox_UserLinksVisible'), + array('check', 'sbox_AllowBBC'), + array('check', 'sbox_NewShoutsBar'), + array('int', 'sbox_MaxLines'), + array('int', 'sbox_Height'), + '', + // Miscellaneous + array('int', 'sbox_RefreshTime'), + array('check', 'sbox_BlockRefresh'), + array('check', 'sbox_EnableSounds'), + '', + // Font stuff + array('select', 'sbox_FontFamily1', array( + 'Garamond, serif' => 'Garamond, serif', + 'Times, serif' => 'Times, serif', + 'Arial, Helvetica, sans-serif' => 'Arial, Helvetica, sans-serif', + 'Tahoma, Helvetica, sans-sarif' => 'Tahoma, Helvetica, sans-sarif', + 'Verdana, sans-serif' => 'Verdana, sans-serif', + 'cursive' => 'cursive', + 'Palatino, fantasy' => 'Palatino, fantasy', + 'Courier, monospace' => 'Courier, monospace' + ), + ), + array('select', 'sbox_FontFamily2', array( + 'Garamond, serif' => 'Garamond, serif', + 'Times, serif' => 'Times, serif', + 'Arial, Helvetica, sans-serif' => 'Arial, Helvetica, sans-serif', + 'Tahoma, Helvetica, sans-sarif' => 'Tahoma, Helvetica, sans-sarif', + 'Verdana, sans-serif' => 'Verdana, sans-serif', + 'cursive' => 'cursive', + 'Palatino, fantasy' => 'Palatino, fantasy', + 'Courier, monospace' => 'Courier, monospace' + ), + ), + array('select', 'sbox_TextSize1', array( + '6pt' => '6pt', + '7pt' => '7pt', + '8pt' => '8pt', + '9pt' => '9pt', + '10pt' => '10pt', + '11pt' => '11pt', + '12pt' => '12pt', + '13pt' => '13pt', + '14pt' => '14pt', + '15pt' => '15pt', + '16pt' => '16pt', + 'xx-small' => 'xx-small', + 'x-small' => 'x-small', + 'small' => 'small', + 'medium' => 'medium', + 'large' => 'large', + 'x-large' => 'x-large', + 'xx-large' => 'xx-large' + ), + ), + array('text', 'sbox_TextColor1'), + array('select', 'sbox_TextSize2', array( + '6pt' => '6pt', + '7pt' => '7pt', + '8pt' => '8pt', + '9pt' => '9pt', + '10pt' => '10pt', + '11pt' => '11pt', + '12pt' => '12pt', + '13pt' => '13pt', + '14pt' => '14pt', + '15pt' => '15pt', + '16pt' => '16pt', + 'xx-small' => 'xx-small', + 'x-small' => 'x-small', + 'small' => 'small', + 'medium' => 'medium', + 'large' => 'large', + 'x-large' => 'x-large', + 'xx-large' => 'xx-large' + ), + ), + array('text', 'sbox_TextColor2'), + array('text', 'sbox_BackgroundColor'), + ); + + // Saving? + if (isset($_GET['save'])) + { + saveDBSettings($config_vars); + redirectexit('action=featuresettings;sa=sbox'); + } + + $context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=sbox'; + $context['settings_title'] = $txt['sbox_ModTitle']; + + prepareDBSettingContext($config_vars); +} + + + + +$sourcedir/Subs.php + + + + log_error('Copyright removed!!'); + } +} + + + + +function sbox() +{ + global $sourcedir; + + include_once("$sourcedir/sbox.php"); + sbox_display(); +} + + + + +$themedir/BoardIndex.template.php + + + + + + + '; + } + + + + + // display shoutbox + if (function_exists('sbox')) sbox(); + + + +$languagedir/Help.english.php + + + +?> + + + + +//SMF Shoutbox +$helptxt['sbox_Visible'] = 'Here you can decide wether the shoutbox is visible at all or not.'; +$helptxt['sbox_DoHistory'] = 'Defines whether all shouts should be written to a file so that an Administrator can check what was going on.'; + +$helptxt['sbox_GuestVisible'] = 'Defines whether the Shoutbox is visible to guests at all.'; +$helptxt['sbox_GuestAllowed'] = 'Here you can decide whether guests are allowed to post new shouts.'; +$helptxt['sbox_GuestBBC'] = 'Here you can switch BBCode parsing for Guest-shouts. Note that this won\'t work if the Allow BBCode setting is turned off.'; + +$helptxt['sbox_SmiliesVisible'] = 'Here you can decide whether smileys are visible or not. They work independently of this setting, though.'; +$helptxt['sbox_UserLinksVisible'] = 'Defines whether the names of shouters are linked to their profile page or not.'; +$helptxt['sbox_AllowBBC'] = 'Defines whether users are allowed to use BBCode in shouts. If disabled, only plain text is displayed - no smileys, no formatting. This option also affects the Allow BBCode for Guest-shouts-option.'; +$helptxt['sbox_NewShoutsBar'] = 'Enable to show a line between new shouts (since the last refresh) and old ones.'; + +$helptxt['sbox_RefreshTime'] = 'Here you can adjust the refresh time'; +$helptxt['sbox_BlockRefresh'] = 'Defines whether the Shoutbox should stop refreshing after there have been no new shouts for a while. Users can still manually refresh the Shoutbox. The time treshold used is the User online time treshold found in the Basic Features-settings. (currently ' . $modSettings['lastActive'] . ' minutes)'; +$helptxt['sbox_EnableSounds'] = 'Enables the notification sound, when your nickname was mentioned since the last refresh.'; + +